/third_party/python/Lib/test/ |
D | string_tests.py | 11 def __init__(self, seq='wxyz'): self.seq = seq argument 12 def __len__(self): return len(self.seq) argument 13 def __getitem__(self, i): return self.seq[i] argument 16 def __init__(self): self.seq = [7, 'hello', 123] argument 17 def __str__(self): return '{0} {1} {2}'.format(*self.seq) argument 20 def __init__(self): self.seq = ['a', 'b', 'c'] argument 21 def __len__(self): return 8 argument 40 def fixtype(self, obj): argument 42 return self.__class__.type2test(obj) 44 return [self.fixtype(x) for x in obj] [all …]
|
D | test_set.py | 23 def __hash__(self): argument 25 def __eq__(self, other): argument 30 def __repr__(self): argument 31 return repr(self.value) 35 def __init__(self, *args): argument 36 self.hash_count = 0 37 def __hash__(self): argument 38 self.hash_count += 1 39 return int.__hash__(self) 44 def setUp(self): argument [all …]
|
D | test_weakset.py | 15 def __init__(self): argument 16 self.cycle = self 21 def setUp(self): argument 23 self.items = [ustr(c) for c in ('a', 'b', 'c')] 24 self.items2 = [ustr(c) for c in ('x', 'y', 'z')] 25 self.ab_items = [ustr(c) for c in 'ab'] 26 self.abcde_items = [ustr(c) for c in 'abcde'] 27 self.def_items = [ustr(c) for c in 'def'] 28 self.ab_weakset = WeakSet(self.ab_items) 29 self.abcde_weakset = WeakSet(self.abcde_items) [all …]
|
D | test_index.py | 7 def __index__(self): argument 8 return self.ind 11 def __index__(self): argument 12 return int(self) 15 def setUp(self): argument 16 self.o = newstyle() 17 self.n = newstyle() 19 def test_basic(self): argument 20 self.o.ind = -2 21 self.n.ind = 2 [all …]
|
D | seq_tests.py | 20 def __init__(self, seqn): argument 21 self.seqn = seqn 22 def __getitem__(self, i): argument 23 return self.seqn[i] 27 def __init__(self, seqn): argument 28 self.seqn = seqn 29 self.i = 0 30 def __iter__(self): argument 31 return self 32 def __next__(self): argument [all …]
|
D | test_optparse.py | 29 def __init__(self, argument 33 self.error_message = error_message 34 self.exit_status = exit_status 35 self.exit_message = exit_message 37 def __str__(self): argument 38 return self.error_message or self.exit_message or "intercepted error" 41 def exit(self, status=0, msg=None): argument 44 def error(self, msg): argument 49 def assertParseOK(self, args, expected_opts, expected_positional_args): argument 62 (options, positional_args) = self.parser.parse_args(args) [all …]
|
D | test_unparse.py | 119 def assertASTEqual(self, ast1, ast2): argument 120 self.assertEqual(ast.dump(ast1), ast.dump(ast2)) 122 def check_ast_roundtrip(self, code1, **kwargs): argument 123 with self.subTest(code1=code1, ast_parse_kwargs=kwargs): 127 self.assertASTEqual(ast1, ast2) 129 def check_invalid(self, node, raises=ValueError): argument 130 with self.subTest(node=node): 131 self.assertRaises(raises, ast.unparse, node) 133 def get_source(self, code1, code2=None): argument 138 def check_src_roundtrip(self, code1, code2=None): argument [all …]
|
D | test_smtpd.py | 17 def __init__(self, *args, **kwargs): argument 18 smtpd.SMTPServer.__init__(self, *args, **kwargs) 19 self.messages = [] 20 if self._decode_data: 21 self.return_status = 'return status' 23 self.return_status = b'return status' 25 def process_message(self, peer, mailfrom, rcpttos, data, **kw): argument 26 self.messages.append((peer, mailfrom, rcpttos, data)) 27 if data == self.return_status: 38 def listen(self, num): argument [all …]
|
/third_party/glib/gio/gdbus-2.0/codegen/ |
D | dbustypes.py | 27 def __init__(self, key, value): argument 28 self.key = key 29 self.value = value 30 self.annotations = [] 31 self.since = "" 33 def post_process(self, interface_prefix, cns, cns_upper, cns_lower, container): argument 34 key = self.key 36 self.annotations, "org.gtk.GDBus.C.Name" 39 self.key_lower = overridden_key.lower() 43 self.key_lower = ( [all …]
|
/third_party/python/Lib/lib2to3/tests/ |
D | test_util.py | 22 def assertStr(self, node, string): argument 25 self.assertEqual(str(node), string) 29 def is_tuple(self, string): argument 32 def test_valid(self): argument 33 self.assertTrue(self.is_tuple("(a, b)")) 34 self.assertTrue(self.is_tuple("(a, (b, c))")) 35 self.assertTrue(self.is_tuple("((a, (b, c)),)")) 36 self.assertTrue(self.is_tuple("(a,)")) 37 self.assertTrue(self.is_tuple("()")) 39 def test_invalid(self): argument [all …]
|
/third_party/python/Lib/tkinter/test/test_ttk/ |
D | test_widgets.py | 19 def test_configure_class(self): argument 20 widget = self.create() 21 self.assertEqual(widget['class'], '') 25 self.checkInvalidParam(widget, 'class', 'Foo', errmsg=errmsg) 26 widget2 = self.create(class_='Foo') 27 self.assertEqual(widget2['class'], 'Foo') 29 def test_configure_padding(self): argument 30 widget = self.create() 31 self.checkParam(widget, 'padding', 0, expected=('0',)) 32 self.checkParam(widget, 'padding', 5, expected=('5',)) [all …]
|
/third_party/python/Lib/test/test_importlib/ |
D | test_spec.py | 18 def __init__(self, path=None, is_package=None): argument 19 self.path = path 20 self.package = is_package 22 def __repr__(self): argument 25 def __getattr__(self, name): argument 26 if name == 'get_filename' and self.path is not None: 27 return self._get_filename 29 return self._is_package 32 def _get_filename(self, name): argument 33 return self.path [all …]
|
/third_party/python/Lib/tkinter/ |
D | tix.py | 89 def tix_addbitmapdir(self, directory): argument 99 return self.tk.call('tix', 'addbitmapdir', directory) 101 def tix_cget(self, option): argument 106 return self.tk.call('tix', 'cget', option) 108 def tix_configure(self, cnf=None, **kw): argument 125 return self._getconfigure('tix', 'configure') 127 return self._getconfigure1('tix', 'configure', '-'+cnf) 128 return self.tk.call(('tix', 'configure') + self._options(cnf)) 130 def tix_filedialog(self, dlgclass=None): argument 140 return self.tk.call('tix', 'filedialog', dlgclass) [all …]
|
/third_party/PyYAML/lib/yaml/ |
D | scanner.py | 38 def __init__(self, token_number, required, index, line, column, mark): argument 39 self.token_number = token_number 40 self.required = required 41 self.index = index 42 self.line = line 43 self.column = column 44 self.mark = mark 48 def __init__(self): argument 60 self.done = False 64 self.flow_level = 0 [all …]
|
D | emitter.py | 18 def __init__(self, scalar, empty, multiline, argument 22 self.scalar = scalar 23 self.empty = empty 24 self.multiline = multiline 25 self.allow_flow_plain = allow_flow_plain 26 self.allow_block_plain = allow_block_plain 27 self.allow_single_quoted = allow_single_quoted 28 self.allow_double_quoted = allow_double_quoted 29 self.allow_block = allow_block 38 def __init__(self, stream, canonical=None, indent=None, width=None, argument [all …]
|
D | parser.py | 81 def __init__(self): argument 82 self.current_event = None 83 self.yaml_version = None 84 self.tag_handles = {} 85 self.states = [] 86 self.marks = [] 87 self.state = self.parse_stream_start 89 def dispose(self): argument 91 self.states = [] 92 self.state = None [all …]
|
/third_party/python/Lib/unittest/test/ |
D | test_case.py | 34 def runTest(self): pass argument 35 def test1(self): pass argument 38 def test2(self): pass argument 43 def __init__(self, events): argument 44 super(Test.LoggingTestCase, self).__init__('test') 45 self.events = events 47 def setUp(self): argument 48 self.events.append('setUp') 50 def test(self): argument 51 self.events.append('test') [all …]
|
/third_party/python/Tools/scripts/ |
D | texi2html.py | 103 def __init__(self, dir, name, topname, title, next, prev, up): argument 104 self.dirname = dir 105 self.name = name 107 self.topname = topname 109 self.topname = name 110 self.title = title 111 self.next = next 112 self.prev = prev 113 self.up = up 114 self.lines = [] [all …]
|
/third_party/python/Lib/ |
D | wave.py | 125 def initfp(self, file): argument 126 self._convert = None 127 self._soundpos = 0 128 self._file = Chunk(file, bigendian = 0) 129 if self._file.getname() != b'RIFF': 131 if self._file.read(4) != b'WAVE': 133 self._fmt_chunk_read = 0 134 self._data_chunk = None 136 self._data_seek_needed = 1 138 chunk = Chunk(self._file, bigendian = 0) [all …]
|
D | sunau.py | 159 def __init__(self, f): argument 163 self._opened = True 165 self._opened = False 166 self.initfp(f) 168 def __del__(self): argument 169 if self._file: 170 self.close() 172 def __enter__(self): argument 173 return self 175 def __exit__(self, *args): argument [all …]
|
D | aifc.py | 308 def initfp(self, file): argument 309 self._version = 0 310 self._convert = None 311 self._markers = [] 312 self._soundpos = 0 313 self._file = file 319 self._aifc = 0 321 self._aifc = 1 324 self._comm_chunk_read = 0 325 self._ssnd_chunk = None [all …]
|
/third_party/python/Lib/test/test_email/ |
D | test__header_value_parser.py | 12 def test_EWWhiteSpaceTerminal(self): argument 14 self.assertEqual(x, ' \t') 15 self.assertEqual(str(x), '') 16 self.assertEqual(x.value, '') 17 self.assertEqual(x.token_type, 'fws') 22 def _assert_results(self, tl, rest, string, value, defects, remainder, argument 24 self.assertEqual(str(tl), string) 25 self.assertEqual(tl.value, value) 26 self.assertDefectsEqual(tl.all_defects, defects) 27 self.assertEqual(rest, remainder) [all …]
|
/third_party/python/Lib/ctypes/test/ |
D | test_cfuncs.py | 13 def S(self): argument 14 return c_longlong.in_dll(self._dll, "last_tf_arg_s").value 15 def U(self): argument 16 return c_ulonglong.in_dll(self._dll, "last_tf_arg_u").value 18 def test_byte(self): argument 19 self._dll.tf_b.restype = c_byte 20 self._dll.tf_b.argtypes = (c_byte,) 21 self.assertEqual(self._dll.tf_b(-126), -42) 22 self.assertEqual(self.S(), -126) 24 def test_byte_plus(self): argument [all …]
|
/third_party/mindspore/mindspore/nn/probability/distribution/ |
D | distribution.py | 54 def __init__(self, argument 62 super(Distribution, self).__init__() 65 validator.check_value_type('name', name, [str], type(self).__name__) 68 self._name = name 69 self._seed = seed 70 self._dtype = cast_type_for_device(dtype) 71 self._parameters = {} 76 self._parameters[k] = param[k] 79 if 'distribution' not in self.parameters.keys(): 80 self.parameter_type = set_param_type( [all …]
|
/third_party/python/Lib/tkinter/test/test_tkinter/ |
D | test_widgets.py | 25 def test_configure_class(self): argument 26 widget = self.create() 27 self.assertEqual(widget['class'], 29 self.checkInvalidParam(widget, 'class', 'Foo', 31 widget2 = self.create(class_='Foo') 32 self.assertEqual(widget2['class'], 'Foo') 34 def test_configure_colormap(self): argument 35 widget = self.create() 36 self.assertEqual(widget['colormap'], '') 37 self.checkInvalidParam(widget, 'colormap', 'new', [all …]
|