nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | FormulaProcessor.processcontents | (self, bit) | Process the contents of a formula bit. | Process the contents of a formula bit. | [
"Process",
"the",
"contents",
"of",
"a",
"formula",
"bit",
"."
] | def processcontents(self, bit):
"Process the contents of a formula bit."
if not isinstance(bit, FormulaBit):
return
bit.process()
for element in bit.contents:
self.processcontents(element) | [
"def",
"processcontents",
"(",
"self",
",",
"bit",
")",
":",
"if",
"not",
"isinstance",
"(",
"bit",
",",
"FormulaBit",
")",
":",
"return",
"bit",
".",
"process",
"(",
")",
"for",
"element",
"in",
"bit",
".",
"contents",
":",
"self",
".",
"processconten... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L2860-L2866 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/supervisor.py | python | Supervisor._init_local_init_op | (self, local_init_op=USE_DEFAULT) | Initializes local_init_op.
Args:
local_init_op: `Operation` run for every new supervisor instance. If set
to USE_DEFAULT, use the first op from the GraphKeys.LOCAL_INIT_OP
collection. If the collection is empty, create an op that initializes
all local variables and all tables. | Initializes local_init_op. | [
"Initializes",
"local_init_op",
"."
] | def _init_local_init_op(self, local_init_op=USE_DEFAULT):
"""Initializes local_init_op.
Args:
local_init_op: `Operation` run for every new supervisor instance. If set
to USE_DEFAULT, use the first op from the GraphKeys.LOCAL_INIT_OP
collection. If the collection is empty, create an op that in... | [
"def",
"_init_local_init_op",
"(",
"self",
",",
"local_init_op",
"=",
"USE_DEFAULT",
")",
":",
"if",
"local_init_op",
"is",
"Supervisor",
".",
"USE_DEFAULT",
":",
"local_init_op",
"=",
"self",
".",
"_get_first_op_from_collection",
"(",
"ops",
".",
"GraphKeys",
"."... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/supervisor.py#L392-L410 | ||
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L934-L937 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/odr/odrpack.py | python | Model.__getattr__ | (self, attr) | Dispatch attribute access to the metadata. | Dispatch attribute access to the metadata. | [
"Dispatch",
"attribute",
"access",
"to",
"the",
"metadata",
"."
] | def __getattr__(self, attr):
""" Dispatch attribute access to the metadata.
"""
if attr in self.meta:
return self.meta[attr]
else:
raise AttributeError("'%s' not in metadata" % attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"in",
"self",
".",
"meta",
":",
"return",
"self",
".",
"meta",
"[",
"attr",
"]",
"else",
":",
"raise",
"AttributeError",
"(",
"\"'%s' not in metadata\"",
"%",
"attr",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/odr/odrpack.py#L535-L542 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | RecoVertex/BeamSpotProducer/scripts/CommonMethods.py | python | unpackLumiid | (i) | return {'run':j[0],'lumisection':j[1]} | unpack 64bit lumiid to dictionary {'run','lumisection'} | unpack 64bit lumiid to dictionary {'run','lumisection'} | [
"unpack",
"64bit",
"lumiid",
"to",
"dictionary",
"{",
"run",
"lumisection",
"}"
] | def unpackLumiid(i):
"""unpack 64bit lumiid to dictionary {'run','lumisection'}
"""
j=unpack(i)
return {'run':j[0],'lumisection':j[1]} | [
"def",
"unpackLumiid",
"(",
"i",
")",
":",
"j",
"=",
"unpack",
"(",
"i",
")",
"return",
"{",
"'run'",
":",
"j",
"[",
"0",
"]",
",",
"'lumisection'",
":",
"j",
"[",
"1",
"]",
"}"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/RecoVertex/BeamSpotProducer/scripts/CommonMethods.py#L245-L249 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_thunk.py | python | _GetShortName | (interface, filter_suffixes) | return ''.join(parts) | Return a shorter interface name that matches Is* and Create* functions. | Return a shorter interface name that matches Is* and Create* functions. | [
"Return",
"a",
"shorter",
"interface",
"name",
"that",
"matches",
"Is",
"*",
"and",
"Create",
"*",
"functions",
"."
] | def _GetShortName(interface, filter_suffixes):
"""Return a shorter interface name that matches Is* and Create* functions."""
parts = interface.GetName().split('_')[1:]
tail = parts[len(parts) - 1]
if tail in filter_suffixes:
parts = parts[:-1]
return ''.join(parts) | [
"def",
"_GetShortName",
"(",
"interface",
",",
"filter_suffixes",
")",
":",
"parts",
"=",
"interface",
".",
"GetName",
"(",
")",
".",
"split",
"(",
"'_'",
")",
"[",
"1",
":",
"]",
"tail",
"=",
"parts",
"[",
"len",
"(",
"parts",
")",
"-",
"1",
"]",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_thunk.py#L153-L159 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py | python | list2cmdline | (seq) | return ''.join(result) | Translate a sequence of arguments into a command line
string, using the same rules as the MS C runtime:
1) Arguments are delimited by white space, which is either a
space or a tab.
2) A string surrounded by double quotation marks is
interpreted as a single argument, regardless of white space... | Translate a sequence of arguments into a command line
string, using the same rules as the MS C runtime: | [
"Translate",
"a",
"sequence",
"of",
"arguments",
"into",
"a",
"command",
"line",
"string",
"using",
"the",
"same",
"rules",
"as",
"the",
"MS",
"C",
"runtime",
":"
] | def list2cmdline(seq):
"""
Translate a sequence of arguments into a command line
string, using the same rules as the MS C runtime:
1) Arguments are delimited by white space, which is either a
space or a tab.
2) A string surrounded by double quotation marks is
interpreted as a single ... | [
"def",
"list2cmdline",
"(",
"seq",
")",
":",
"# See",
"# http://msdn.microsoft.com/en-us/library/17w5ykft.aspx",
"# or search http://msdn.microsoft.com for",
"# \"Parsing C++ Command-Line Arguments\"",
"result",
"=",
"[",
"]",
"needquote",
"=",
"False",
"for",
"arg",
"in",
"s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py#L516-L583 | |
BSVino/DoubleAction | c550b168a3e919926c198c30240f506538b92e75 | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py | python | BytesDecoder | (field_number, is_repeated, is_packed, key, new_default) | Returns a decoder for a bytes field. | Returns a decoder for a bytes field. | [
"Returns",
"a",
"decoder",
"for",
"a",
"bytes",
"field",
"."
] | def BytesDecoder(field_number, is_repeated, is_packed, key, new_default):
"""Returns a decoder for a bytes field."""
local_DecodeVarint = _DecodeVarint
assert not is_packed
if is_repeated:
tag_bytes = encoder.TagBytes(field_number,
wire_format.WIRETYPE_LENGTH_DELIMITED)
... | [
"def",
"BytesDecoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
",",
"key",
",",
"new_default",
")",
":",
"local_DecodeVarint",
"=",
"_DecodeVarint",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"tag_bytes",
"=",
"encoder",
".",
"Tag... | https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L342-L376 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeExportEnvString | (self, env) | return ' '.join(export_str) | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | [
"Given",
"an",
"environment",
"returns",
"a",
"string",
"looking",
"like",
"export",
"FOO",
"=",
"foo",
";",
"export",
"BAR",
"=",
"$",
"{",
"FOO",
"}",
"bar",
";",
"that",
"exports",
"|env|",
"to",
"the",
"shell",
"."
] | def ComputeExportEnvString(self, env):
"""Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell."""
export_str = []
for k, v in env:
export_str.append('export %s=%s;' %
(k, ninja_syntax.escape(gyp.common.Enco... | [
"def",
"ComputeExportEnvString",
"(",
"self",
",",
"env",
")",
":",
"export_str",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"env",
":",
"export_str",
".",
"append",
"(",
"'export %s=%s;'",
"%",
"(",
"k",
",",
"ninja_syntax",
".",
"escape",
"(",
"gyp",... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py#L1467-L1475 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | modules/db.sybase/db_sybase_re_grt.py | python | join_multiline_content | (name_column, split_column, cursor, callback=lambda _:None) | Generator to join definition columns that are split across several rows
In Sybase, object definitions in syscomments can be split into several rows. For example,
a stored procedure can have several row entries in syscomments each having the same object
name and containing the chunks of the procedure's code... | Generator to join definition columns that are split across several rows | [
"Generator",
"to",
"join",
"definition",
"columns",
"that",
"are",
"split",
"across",
"several",
"rows"
] | def join_multiline_content(name_column, split_column, cursor, callback=lambda _:None):
"""Generator to join definition columns that are split across several rows
In Sybase, object definitions in syscomments can be split into several rows. For example,
a stored procedure can have several row entries in sysc... | [
"def",
"join_multiline_content",
"(",
"name_column",
",",
"split_column",
",",
"cursor",
",",
"callback",
"=",
"lambda",
"_",
":",
"None",
")",
":",
"idx",
"=",
"0",
"current_object",
"=",
"None",
"current_object_chunks",
"=",
"[",
"]",
"column_index",
"=",
... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/modules/db.sybase/db_sybase_re_grt.py#L111-L148 | ||
facebookresearch/TensorComprehensions | fd014435ab384847e7400eac15bf87b3dcccddf0 | tensor_comprehensions/__init__.py | python | assert_almost_equal | (actual : torch.Tensor,
expected : torch.Tensor,
*inputs : torch.Tensor,
operations: Optional[int] = 1,
precision: Optional[float] = 1e-7) | r"""Asserts numerical precision requirements.
:param actual: the PyTorch Tensor to check.
:param expected: the expected PyTorch Tensor.
:param inputs: PyTorch Tensors passed as inputs to the TC that produced the
actual Tensor.
:param operations: maximum number of iterated op... | r"""Asserts numerical precision requirements. | [
"r",
"Asserts",
"numerical",
"precision",
"requirements",
"."
] | def assert_almost_equal(actual : torch.Tensor,
expected : torch.Tensor,
*inputs : torch.Tensor,
operations: Optional[int] = 1,
precision: Optional[float] = 1e-7):
r"""Asserts numerical precision requirements.
:p... | [
"def",
"assert_almost_equal",
"(",
"actual",
":",
"torch",
".",
"Tensor",
",",
"expected",
":",
"torch",
".",
"Tensor",
",",
"*",
"inputs",
":",
"torch",
".",
"Tensor",
",",
"operations",
":",
"Optional",
"[",
"int",
"]",
"=",
"1",
",",
"precision",
":... | https://github.com/facebookresearch/TensorComprehensions/blob/fd014435ab384847e7400eac15bf87b3dcccddf0/tensor_comprehensions/__init__.py#L47-L71 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/idl_parser/idl_ppapi_parser.py | python | IDLPPAPIParser.p_EnumValueList | (self, p) | EnumValueList : EnumValue EnumValues | EnumValueList : EnumValue EnumValues | [
"EnumValueList",
":",
"EnumValue",
"EnumValues"
] | def p_EnumValueList(self, p):
"""EnumValueList : EnumValue EnumValues"""
p[0] = ListFromConcat(p[1], p[2]) | [
"def",
"p_EnumValueList",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ListFromConcat",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"2",
"]",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/idl_parser/idl_ppapi_parser.py#L157-L159 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGrid.GenerateEditorTextCtrl | (*args, **kwargs) | return _propgrid.PropertyGrid_GenerateEditorTextCtrl(*args, **kwargs) | GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary,
int extraStyle=0, int maxLen=0, int forColumn=1) -> Window | GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary,
int extraStyle=0, int maxLen=0, int forColumn=1) -> Window | [
"GenerateEditorTextCtrl",
"(",
"self",
"Point",
"pos",
"Size",
"sz",
"String",
"value",
"Window",
"secondary",
"int",
"extraStyle",
"=",
"0",
"int",
"maxLen",
"=",
"0",
"int",
"forColumn",
"=",
"1",
")",
"-",
">",
"Window"
] | def GenerateEditorTextCtrl(*args, **kwargs):
"""
GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary,
int extraStyle=0, int maxLen=0, int forColumn=1) -> Window
"""
return _propgrid.PropertyGrid_GenerateEditorTextCtrl(*args, **kwargs) | [
"def",
"GenerateEditorTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GenerateEditorTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2347-L2352 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.hash | (self) | return self._hash | Returns a hash of the cursor as an int. | Returns a hash of the cursor as an int. | [
"Returns",
"a",
"hash",
"of",
"the",
"cursor",
"as",
"an",
"int",
"."
] | def hash(self):
"""Returns a hash of the cursor as an int."""
if not hasattr(self, '_hash'):
self._hash = conf.lib.clang_hashCursor(self)
return self._hash | [
"def",
"hash",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_hash'",
")",
":",
"self",
".",
"_hash",
"=",
"conf",
".",
"lib",
".",
"clang_hashCursor",
"(",
"self",
")",
"return",
"self",
".",
"_hash"
] | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1244-L1249 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiManager.InsertPane | (*args, **kwargs) | return _aui.AuiManager_InsertPane(*args, **kwargs) | InsertPane(self, Window window, AuiPaneInfo insertLocation, int insertLevel=AUI_INSERT_PANE) -> bool | InsertPane(self, Window window, AuiPaneInfo insertLocation, int insertLevel=AUI_INSERT_PANE) -> bool | [
"InsertPane",
"(",
"self",
"Window",
"window",
"AuiPaneInfo",
"insertLocation",
"int",
"insertLevel",
"=",
"AUI_INSERT_PANE",
")",
"-",
">",
"bool"
] | def InsertPane(*args, **kwargs):
"""InsertPane(self, Window window, AuiPaneInfo insertLocation, int insertLevel=AUI_INSERT_PANE) -> bool"""
return _aui.AuiManager_InsertPane(*args, **kwargs) | [
"def",
"InsertPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiManager_InsertPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L651-L653 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/theorem_fingerprint.py | python | Fingerprint | (theorem) | return result | Compute a unique, stable fingerprint for theorem objects.
Args:
theorem: proof_assistant_pb2.Theorem object
Returns:
62 bit non-negative integer fingerprint. Note that we truncate to 62 bits
for OCaml compatibility. OCaml uses 63 bit signed integers. | Compute a unique, stable fingerprint for theorem objects. | [
"Compute",
"a",
"unique",
"stable",
"fingerprint",
"for",
"theorem",
"objects",
"."
] | def Fingerprint(theorem):
"""Compute a unique, stable fingerprint for theorem objects.
Args:
theorem: proof_assistant_pb2.Theorem object
Returns:
62 bit non-negative integer fingerprint. Note that we truncate to 62 bits
for OCaml compatibility. OCaml uses 63 bit signed integers.
"""
if not theor... | [
"def",
"Fingerprint",
"(",
"theorem",
")",
":",
"if",
"not",
"theorem",
".",
"HasField",
"(",
"'conclusion'",
")",
"and",
"theorem",
".",
"HasField",
"(",
"'fingerprint'",
")",
":",
"return",
"theorem",
".",
"fingerprint",
"fp",
"=",
"farmhash",
".",
"fing... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/theorem_fingerprint.py#L37-L58 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MemoryFSHandler.__init__ | (self, *args, **kwargs) | __init__(self) -> MemoryFSHandler | __init__(self) -> MemoryFSHandler | [
"__init__",
"(",
"self",
")",
"-",
">",
"MemoryFSHandler"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> MemoryFSHandler"""
_core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"MemoryFSHandler_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_MemoryFSHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2560-L2562 | ||
SIPp/sipp | f44d0cf5dec0013eff8fd7b4da885d455aa82e0e | cpplint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/SIPp/sipp/blob/f44d0cf5dec0013eff8fd7b4da885d455aa82e0e/cpplint.py#L3775-L3812 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | ScreenDC.__init__ | (self, *args, **kwargs) | __init__(self) -> ScreenDC
A wxScreenDC can be used to paint anywhere on the screen. This should
normally be constructed as a temporary stack object; don't store a
wxScreenDC object. | __init__(self) -> ScreenDC | [
"__init__",
"(",
"self",
")",
"-",
">",
"ScreenDC"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> ScreenDC
A wxScreenDC can be used to paint anywhere on the screen. This should
normally be constructed as a temporary stack object; don't store a
wxScreenDC object.
"""
_gdi_.ScreenDC_swiginit(self,_gdi... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"ScreenDC_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_ScreenDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5003-L5012 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | threejs_get_transforms | (arg1: "WorldModel") | return _robotsim.threejs_get_transforms(arg1) | r"""
threejs_get_transforms(WorldModel arg1) -> std::string
Exports the WorldModel to a JSON string ready for use in Three.js. | r"""
threejs_get_transforms(WorldModel arg1) -> std::string | [
"r",
"threejs_get_transforms",
"(",
"WorldModel",
"arg1",
")",
"-",
">",
"std",
"::",
"string"
] | def threejs_get_transforms(arg1: "WorldModel") -> "std::string":
r"""
threejs_get_transforms(WorldModel arg1) -> std::string
Exports the WorldModel to a JSON string ready for use in Three.js.
"""
return _robotsim.threejs_get_transforms(arg1) | [
"def",
"threejs_get_transforms",
"(",
"arg1",
":",
"\"WorldModel\"",
")",
"->",
"\"std::string\"",
":",
"return",
"_robotsim",
".",
"threejs_get_transforms",
"(",
"arg1",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8723-L8731 | |
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/regression/scripts/utils/log_pipe.py | python | LogPipe.fileno | (self) | return self.fdWrite | Return the write file descriptor of the pipe | Return the write file descriptor of the pipe | [
"Return",
"the",
"write",
"file",
"descriptor",
"of",
"the",
"pipe"
] | def fileno(self):
"""Return the write file descriptor of the pipe"""
return self.fdWrite | [
"def",
"fileno",
"(",
"self",
")",
":",
"return",
"self",
".",
"fdWrite"
] | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/regression/scripts/utils/log_pipe.py#L20-L22 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/msvc.py | python | RegistryInfo.vs | (self) | return join(self.sxs, 'VS7') | Microsoft Visual Studio VS7 registry key.
Return
------
str
Registry key | Microsoft Visual Studio VS7 registry key. | [
"Microsoft",
"Visual",
"Studio",
"VS7",
"registry",
"key",
"."
] | def vs(self):
"""
Microsoft Visual Studio VS7 registry key.
Return
------
str
Registry key
"""
return join(self.sxs, 'VS7') | [
"def",
"vs",
"(",
"self",
")",
":",
"return",
"join",
"(",
"self",
".",
"sxs",
",",
"'VS7'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/msvc.py#L541-L550 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | FiniteDomainRef.sort | (self) | return FiniteDomainSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx) | Return the sort of the finite-domain expression `self`. | Return the sort of the finite-domain expression `self`. | [
"Return",
"the",
"sort",
"of",
"the",
"finite",
"-",
"domain",
"expression",
"self",
"."
] | def sort(self):
"""Return the sort of the finite-domain expression `self`."""
return FiniteDomainSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx) | [
"def",
"sort",
"(",
"self",
")",
":",
"return",
"FiniteDomainSortRef",
"(",
"Z3_get_sort",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as_ast",
"(",
")",
")",
",",
"self",
".",
"ctx",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7652-L7654 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py | python | Load | () | return _data_ops | Load the data ops library and return the loaded module. | Load the data ops library and return the loaded module. | [
"Load",
"the",
"data",
"ops",
"library",
"and",
"return",
"the",
"loaded",
"module",
"."
] | def Load():
"""Load the data ops library and return the loaded module."""
with _ops_lock:
global _data_ops
if not _data_ops:
ops_path = resource_loader.get_path_to_datafile(DATA_OPS_FILE)
logging.info('data path: %s', ops_path)
_data_ops = load_library.load_op_library(ops_path)
asse... | [
"def",
"Load",
"(",
")",
":",
"with",
"_ops_lock",
":",
"global",
"_data_ops",
"if",
"not",
"_data_ops",
":",
"ops_path",
"=",
"resource_loader",
".",
"get_path_to_datafile",
"(",
"DATA_OPS_FILE",
")",
"logging",
".",
"info",
"(",
"'data path: %s'",
",",
"ops_... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py#L60-L70 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListItem.SetId | (*args, **kwargs) | return _controls_.ListItem_SetId(*args, **kwargs) | SetId(self, long id) | SetId(self, long id) | [
"SetId",
"(",
"self",
"long",
"id",
")"
] | def SetId(*args, **kwargs):
"""SetId(self, long id)"""
return _controls_.ListItem_SetId(*args, **kwargs) | [
"def",
"SetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItem_SetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4164-L4166 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/data_structures.py | python | List.__init__ | (self, *args, **kwargs) | Construct a new sequence. Arguments are passed to `list()`. | Construct a new sequence. Arguments are passed to `list()`. | [
"Construct",
"a",
"new",
"sequence",
".",
"Arguments",
"are",
"passed",
"to",
"list",
"()",
"."
] | def __init__(self, *args, **kwargs):
"""Construct a new sequence. Arguments are passed to `list()`."""
super(List, self).__init__()
self._storage = self._make_storage(*args, **kwargs)
for index, element in enumerate(self._storage):
self._storage[index] = self._track_value(
element, name=... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"List",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_storage",
"=",
"self",
".",
"_make_storage",
"(",
"*",
"args",
",",
"*",
"*",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/data_structures.py#L288-L294 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommandInterpreter.HasAliasOptions | (self) | return _lldb.SBCommandInterpreter_HasAliasOptions(self) | HasAliasOptions(SBCommandInterpreter self) -> bool | HasAliasOptions(SBCommandInterpreter self) -> bool | [
"HasAliasOptions",
"(",
"SBCommandInterpreter",
"self",
")",
"-",
">",
"bool"
] | def HasAliasOptions(self):
"""HasAliasOptions(SBCommandInterpreter self) -> bool"""
return _lldb.SBCommandInterpreter_HasAliasOptions(self) | [
"def",
"HasAliasOptions",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBCommandInterpreter_HasAliasOptions",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2743-L2745 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/actor/Actor.py | python | Actor.bindAnim | (self, animName, partName = None, lodName = None,
allowAsyncBind = False) | Binds the named animation to the named part and/or lod. If
allowAsyncBind is False, this guarantees that the animation is
bound immediately--the animation is never bound in a
sub-thread; it will be loaded and bound in the main thread, so
it will be available by the time this method retu... | Binds the named animation to the named part and/or lod. If
allowAsyncBind is False, this guarantees that the animation is
bound immediately--the animation is never bound in a
sub-thread; it will be loaded and bound in the main thread, so
it will be available by the time this method retu... | [
"Binds",
"the",
"named",
"animation",
"to",
"the",
"named",
"part",
"and",
"/",
"or",
"lod",
".",
"If",
"allowAsyncBind",
"is",
"False",
"this",
"guarantees",
"that",
"the",
"animation",
"is",
"bound",
"immediately",
"--",
"the",
"animation",
"is",
"never",
... | def bindAnim(self, animName, partName = None, lodName = None,
allowAsyncBind = False):
"""
Binds the named animation to the named part and/or lod. If
allowAsyncBind is False, this guarantees that the animation is
bound immediately--the animation is never bound in a
... | [
"def",
"bindAnim",
"(",
"self",
",",
"animName",
",",
"partName",
"=",
"None",
",",
"lodName",
"=",
"None",
",",
"allowAsyncBind",
"=",
"False",
")",
":",
"self",
".",
"getAnimControls",
"(",
"animName",
"=",
"animName",
",",
"partName",
"=",
"partName",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L2292-L2311 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | tools/clang_format.py | python | Repo.get_branch_name | (self) | return branch | Get the current branch name, short form
This returns "main", not "refs/head/main"
Will not work if the current branch is detached | Get the current branch name, short form
This returns "main", not "refs/head/main"
Will not work if the current branch is detached | [
"Get",
"the",
"current",
"branch",
"name",
"short",
"form",
"This",
"returns",
"main",
"not",
"refs",
"/",
"head",
"/",
"main",
"Will",
"not",
"work",
"if",
"the",
"current",
"branch",
"is",
"detached"
] | def get_branch_name(self):
"""Get the current branch name, short form
This returns "main", not "refs/head/main"
Will not work if the current branch is detached
"""
branch = self.rev_parse(["--abbrev-ref", "HEAD"])
if branch == "HEAD":
raise ValueError("B... | [
"def",
"get_branch_name",
"(",
"self",
")",
":",
"branch",
"=",
"self",
".",
"rev_parse",
"(",
"[",
"\"--abbrev-ref\"",
",",
"\"HEAD\"",
"]",
")",
"if",
"branch",
"==",
"\"HEAD\"",
":",
"raise",
"ValueError",
"(",
"\"Branch is currently detached\"",
")",
"retu... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/tools/clang_format.py#L444-L453 | |
nodejs/nan | 8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62 | cpplint.py | python | RemoveMultiLineComments | (filename, lines, error) | Removes multiline (c-style) comments from lines. | Removes multiline (c-style) comments from lines. | [
"Removes",
"multiline",
"(",
"c",
"-",
"style",
")",
"comments",
"from",
"lines",
"."
] | def RemoveMultiLineComments(filename, lines, error):
"""Removes multiline (c-style) comments from lines."""
lineix = 0
while lineix < len(lines):
lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
if lineix_begin >= len(lines):
return
lineix_end = FindNextMultiLineCommentEnd(lines, line... | [
"def",
"RemoveMultiLineComments",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"lineix",
"=",
"0",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"lineix_begin",
"=",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
"if",
... | https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L1617-L1630 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParseResults.asList | (self) | return [res.asList() if isinstance(res, ParseResults) else res for res in self.__toklist] | Returns the parse results as a nested list of matching tokens, all converted to strings.
Example::
patt = OneOrMore(Word(alphas))
result = patt.parseString("sldkj lsdkj sldkj")
# even though the result prints in string-like form, it is actually a pyparsing ParseResult... | [] | def asList(self):
"""
Returns the parse results as a nested list of matching tokens, all converted to strings.
Example::
patt = OneOrMore(Word(alphas))
result = patt.parseString("sldkj lsdkj sldkj")
# even though the result prints in string-like form... | [
"def",
"asList",
"(",
"self",
")",
":",
"return",
"[",
"res",
".",
"asList",
"(",
")",
"if",
"isinstance",
"(",
"res",
",",
"ParseResults",
")",
"else",
"res",
"for",
"res",
"in",
"self",
".",
"__toklist",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L1785-L1815 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/node/base.py | python | Node.IsResourceMapSource | (self) | return False | Whether this node is a resource map source. | Whether this node is a resource map source. | [
"Whether",
"this",
"node",
"is",
"a",
"resource",
"map",
"source",
"."
] | def IsResourceMapSource(self):
'''Whether this node is a resource map source.'''
return False | [
"def",
"IsResourceMapSource",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/base.py#L623-L625 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py | python | MaskedArray.count | (self, axis = None) | Count of the non-masked elements in a, or along a certain axis. | Count of the non-masked elements in a, or along a certain axis. | [
"Count",
"of",
"the",
"non",
"-",
"masked",
"elements",
"in",
"a",
"or",
"along",
"a",
"certain",
"axis",
"."
] | def count (self, axis = None):
"Count of the non-masked elements in a, or along a certain axis."
m = self._mask
s = self._data.shape
ls = len(s)
if m is nomask:
if ls == 0:
return 1
if ls == 1:
return s[0]
if axi... | [
"def",
"count",
"(",
"self",
",",
"axis",
"=",
"None",
")",
":",
"m",
"=",
"self",
".",
"_mask",
"s",
"=",
"self",
".",
"_data",
".",
"shape",
"ls",
"=",
"len",
"(",
"s",
")",
"if",
"m",
"is",
"nomask",
":",
"if",
"ls",
"==",
"0",
":",
"ret... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1198-L1226 | ||
CGRU/cgru | 1881a4128530e3d31ac6c25314c18314fc50c2c7 | afanasy/python/parsers/awscli.py | python | awscli.do | (self, i_args) | Missing DocString | Missing DocString | [
"Missing",
"DocString"
] | def do(self, i_args):
"""Missing DocString
"""
data = i_args['data']
data = re.findall(r'\d+ of \d+ part', data)
if len(data) == 0:
return
data = re.findall(r'(\d+) of (\d+) part', data[-1])
if len(data) == 0:
return
self.percent... | [
"def",
"do",
"(",
"self",
",",
"i_args",
")",
":",
"data",
"=",
"i_args",
"[",
"'data'",
"]",
"data",
"=",
"re",
".",
"findall",
"(",
"r'\\d+ of \\d+ part'",
",",
"data",
")",
"if",
"len",
"(",
"data",
")",
"==",
"0",
":",
"return",
"data",
"=",
... | https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/parsers/awscli.py#L17-L34 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py | python | idz_reconint | (idx, proj) | return _id.idz_reconint(idx, proj) | Reconstruct interpolation matrix from complex ID.
:param idx:
Column index array.
:type idx: :class:`numpy.ndarray`
:param proj:
Interpolation coefficients.
:type proj: :class:`numpy.ndarray`
:return:
Interpolation matrix.
:rtype: :class:`numpy.ndarray` | Reconstruct interpolation matrix from complex ID. | [
"Reconstruct",
"interpolation",
"matrix",
"from",
"complex",
"ID",
"."
] | def idz_reconint(idx, proj):
"""
Reconstruct interpolation matrix from complex ID.
:param idx:
Column index array.
:type idx: :class:`numpy.ndarray`
:param proj:
Interpolation coefficients.
:type proj: :class:`numpy.ndarray`
:return:
Interpolation matrix.
:rtype... | [
"def",
"idz_reconint",
"(",
"idx",
",",
"proj",
")",
":",
"return",
"_id",
".",
"idz_reconint",
"(",
"idx",
",",
"proj",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L1057-L1072 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/layers/merge.py | python | average | (inputs, **kwargs) | return Average(**kwargs)(inputs) | Functional interface to the `tf.keras.layers.Average` layer.
Example:
>>> x1 = np.ones((2, 2))
>>> x2 = np.zeros((2, 2))
>>> y = tf.keras.layers.Average()([x1, x2])
>>> y.numpy().tolist()
[[0.5, 0.5], [0.5, 0.5]]
Usage in a functional model:
>>> input1 = tf.keras.layers.Input(shape=(16,))
>>> x1 =... | Functional interface to the `tf.keras.layers.Average` layer. | [
"Functional",
"interface",
"to",
"the",
"tf",
".",
"keras",
".",
"layers",
".",
"Average",
"layer",
"."
] | def average(inputs, **kwargs):
"""Functional interface to the `tf.keras.layers.Average` layer.
Example:
>>> x1 = np.ones((2, 2))
>>> x2 = np.zeros((2, 2))
>>> y = tf.keras.layers.Average()([x1, x2])
>>> y.numpy().tolist()
[[0.5, 0.5], [0.5, 0.5]]
Usage in a functional model:
>>> input1 = tf.keras.... | [
"def",
"average",
"(",
"inputs",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"Average",
"(",
"*",
"*",
"kwargs",
")",
"(",
"inputs",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/layers/merge.py#L832-L864 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/WebIDL.py | python | Parser.p_PrimitiveOrStringTypeFloat | (self, p) | PrimitiveOrStringType : FLOAT | PrimitiveOrStringType : FLOAT | [
"PrimitiveOrStringType",
":",
"FLOAT"
] | def p_PrimitiveOrStringTypeFloat(self, p):
"""
PrimitiveOrStringType : FLOAT
"""
p[0] = IDLBuiltinType.Types.float | [
"def",
"p_PrimitiveOrStringTypeFloat",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"IDLBuiltinType",
".",
"Types",
".",
"float"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4713-L4717 | ||
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/advanced_outline.py | python | bline_to_bezier | (bline_pos, origin, bezier_size) | return bline_pos | Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1289
Args:
bline_pos (Float):
origin (Float):
bezier_size (Float):
Returns:
(Float) | Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1289 | [
"Synfig",
"function",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"synfig",
"/",
"synfig",
"/",
"blob",
"/",
"15607089680af560ad031465d31878425af927eb",
"/",
"synfig",
"-",
"core",
"/",
"src",
"/",
"modules",
"/",
"mod_geometry",
"/",
"advanced_outline... | def bline_to_bezier(bline_pos, origin, bezier_size):
"""
Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1289
Args:
bline_pos (Float):
origin (Float):
bezier_size (Float):
... | [
"def",
"bline_to_bezier",
"(",
"bline_pos",
",",
"origin",
",",
"bezier_size",
")",
":",
"if",
"bezier_size",
"!=",
"0",
":",
"return",
"(",
"bline_pos",
"-",
"origin",
")",
"/",
"bezier_size",
"return",
"bline_pos"
] | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/advanced_outline.py#L1063-L1077 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/twitter.py | python | User.GetUrl | (self) | return self._url | Get the homepage url of this user.
Returns:
The homepage url of this user | Get the homepage url of this user. | [
"Get",
"the",
"homepage",
"url",
"of",
"this",
"user",
"."
] | def GetUrl(self):
'''Get the homepage url of this user.
Returns:
The homepage url of this user
'''
return self._url | [
"def",
"GetUrl",
"(",
"self",
")",
":",
"return",
"self",
".",
"_url"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/twitter.py#L415-L421 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISDisk.py | python | ISISDisk.getFlux | (self, Ei_in=None, frequency=None) | return flux | Returns the instrument flux at a given Ei by interpolating from a table of measured flux. | Returns the instrument flux at a given Ei by interpolating from a table of measured flux. | [
"Returns",
"the",
"instrument",
"flux",
"at",
"a",
"given",
"Ei",
"by",
"interpolating",
"from",
"a",
"table",
"of",
"measured",
"flux",
"."
] | def getFlux(self, Ei_in=None, frequency=None):
"""
Returns the instrument flux at a given Ei by interpolating from a table of measured flux.
"""
Ei = self.Ei if Ei_in is None else Ei_in
if Ei is None:
raise ValueError('Incident energy has not been specified')
... | [
"def",
"getFlux",
"(",
"self",
",",
"Ei_in",
"=",
"None",
",",
"frequency",
"=",
"None",
")",
":",
"Ei",
"=",
"self",
".",
"Ei",
"if",
"Ei_in",
"is",
"None",
"else",
"Ei_in",
"if",
"Ei",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Incident energ... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISDisk.py#L350-L370 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py | python | Locator.__init__ | (self, scheme='default') | Initialise an instance.
:param scheme: Because locators look for most recent versions, they
need to know the version scheme to use. This specifies
the current PEP-recommended scheme - use ``'legacy'``
if you need to support existing distri... | [] | def __init__(self, scheme='default'):
"""
Initialise an instance.
:param scheme: Because locators look for most recent versions, they
need to know the version scheme to use. This specifies
the current PEP-recommended scheme - use ``'legacy'``
... | [
"def",
"__init__",
"(",
"self",
",",
"scheme",
"=",
"'default'",
")",
":",
"self",
".",
"_cache",
"=",
"{",
"}",
"self",
".",
"scheme",
"=",
"scheme",
"# Because of bugs in some of the handlers on some of the platforms,",
"# we use our own opener rather than just using ur... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py#L203-L237 | |||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/special_matrices.py | python | kron | (a, b) | return np.concatenate(np.concatenate(o, axis=1), axis=1) | Kronecker product.
The result is the block matrix::
a[0,0]*b a[0,1]*b ... a[0,-1]*b
a[1,0]*b a[1,1]*b ... a[1,-1]*b
...
a[-1,0]*b a[-1,1]*b ... a[-1,-1]*b
Parameters
----------
a : (M, N) ndarray
Input array
b : (P, Q) ndarray
Input array
... | Kronecker product. | [
"Kronecker",
"product",
"."
] | def kron(a, b):
"""
Kronecker product.
The result is the block matrix::
a[0,0]*b a[0,1]*b ... a[0,-1]*b
a[1,0]*b a[1,1]*b ... a[1,-1]*b
...
a[-1,0]*b a[-1,1]*b ... a[-1,-1]*b
Parameters
----------
a : (M, N) ndarray
Input array
b : (P, Q) ... | [
"def",
"kron",
"(",
"a",
",",
"b",
")",
":",
"if",
"not",
"a",
".",
"flags",
"[",
"'CONTIGUOUS'",
"]",
":",
"a",
"=",
"np",
".",
"reshape",
"(",
"a",
",",
"a",
".",
"shape",
")",
"if",
"not",
"b",
".",
"flags",
"[",
"'CONTIGUOUS'",
"]",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/special_matrices.py#L432-L470 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Queue.py | python | Queue.empty | (self) | return n | Return True if the queue is empty, False otherwise (not reliable!). | Return True if the queue is empty, False otherwise (not reliable!). | [
"Return",
"True",
"if",
"the",
"queue",
"is",
"empty",
"False",
"otherwise",
"(",
"not",
"reliable!",
")",
"."
] | def empty(self):
"""Return True if the queue is empty, False otherwise (not reliable!)."""
self.mutex.acquire()
n = not self._qsize()
self.mutex.release()
return n | [
"def",
"empty",
"(",
"self",
")",
":",
"self",
".",
"mutex",
".",
"acquire",
"(",
")",
"n",
"=",
"not",
"self",
".",
"_qsize",
"(",
")",
"self",
".",
"mutex",
".",
"release",
"(",
")",
"return",
"n"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Queue.py#L93-L98 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | python | Writer.AddConfig | (self, name, attrs=None, tools=None) | Adds a configuration to the project.
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None. | Adds a configuration to the project. | [
"Adds",
"a",
"configuration",
"to",
"the",
"project",
"."
] | def AddConfig(self, name, attrs=None, tools=None):
"""Adds a configuration to the project.
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
"""
spec = self._GetSpecForConfiguratio... | [
"def",
"AddConfig",
"(",
"self",
",",
"name",
",",
"attrs",
"=",
"None",
",",
"tools",
"=",
"None",
")",
":",
"spec",
"=",
"self",
".",
"_GetSpecForConfiguration",
"(",
"\"Configuration\"",
",",
"name",
",",
"attrs",
",",
"tools",
")",
"self",
".",
"co... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py#L122-L131 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | FloatProperty.__init__ | (self, *args, **kwargs) | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
double value=0.0) -> FloatProperty | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
double value=0.0) -> FloatProperty | [
"__init__",
"(",
"self",
"String",
"label",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"name",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"double",
"value",
"=",
"0",
".",
"0",
")",
"-",
">",
"FloatProperty"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
double value=0.0) -> FloatProperty
"""
_propgrid.FloatProperty_swiginit(self,_propgrid.new_FloatProperty(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_propgrid",
".",
"FloatProperty_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_FloatProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2952-L2957 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_matplotlib/converter.py | python | TimeSeries_DateLocator._get_default_locs | (self, vmin, vmax) | return np.compress(locator["maj"], locator["val"]) | Returns the default locations of ticks. | Returns the default locations of ticks. | [
"Returns",
"the",
"default",
"locations",
"of",
"ticks",
"."
] | def _get_default_locs(self, vmin, vmax):
"""Returns the default locations of ticks."""
if self.plot_obj.date_axis_info is None:
self.plot_obj.date_axis_info = self.finder(vmin, vmax, self.freq)
locator = self.plot_obj.date_axis_info
if self.isminor:
return np.co... | [
"def",
"_get_default_locs",
"(",
"self",
",",
"vmin",
",",
"vmax",
")",
":",
"if",
"self",
".",
"plot_obj",
".",
"date_axis_info",
"is",
"None",
":",
"self",
".",
"plot_obj",
".",
"date_axis_info",
"=",
"self",
".",
"finder",
"(",
"vmin",
",",
"vmax",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_matplotlib/converter.py#L949-L958 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/Pharm2D/Utils.py | python | GetTriangles | (nPts) | return res | returns a tuple with the distance indices for
triangles composing an nPts-pharmacophore | returns a tuple with the distance indices for
triangles composing an nPts-pharmacophore | [
"returns",
"a",
"tuple",
"with",
"the",
"distance",
"indices",
"for",
"triangles",
"composing",
"an",
"nPts",
"-",
"pharmacophore"
] | def GetTriangles(nPts):
""" returns a tuple with the distance indices for
triangles composing an nPts-pharmacophore
"""
global _trianglesInPharmacophore
if nPts < 3:
return []
res = _trianglesInPharmacophore.get(nPts, [])
if not res:
idx1, idx2, idx3 = (0, 1, nPts - 1)
... | [
"def",
"GetTriangles",
"(",
"nPts",
")",
":",
"global",
"_trianglesInPharmacophore",
"if",
"nPts",
"<",
"3",
":",
"return",
"[",
"]",
"res",
"=",
"_trianglesInPharmacophore",
".",
"get",
"(",
"nPts",
",",
"[",
"]",
")",
"if",
"not",
"res",
":",
"idx1",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Pharm2D/Utils.py#L111-L129 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/rpc.py | python | SocketIO.handle_EOF | (self) | action taken upon link being closed by peer | action taken upon link being closed by peer | [
"action",
"taken",
"upon",
"link",
"being",
"closed",
"by",
"peer"
] | def handle_EOF(self):
"action taken upon link being closed by peer"
self.EOFhook()
self.debug("handle_EOF")
for key in self.cvars:
cv = self.cvars[key]
cv.acquire()
self.responses[key] = ('EOF', None)
cv.notify()
cv.release()
... | [
"def",
"handle_EOF",
"(",
"self",
")",
":",
"self",
".",
"EOFhook",
"(",
")",
"self",
".",
"debug",
"(",
"\"handle_EOF\"",
")",
"for",
"key",
"in",
"self",
".",
"cvars",
":",
"cv",
"=",
"self",
".",
"cvars",
"[",
"key",
"]",
"cv",
".",
"acquire",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/rpc.py#L471-L482 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTime.ParseTime | (*args, **kwargs) | return _misc_.DateTime_ParseTime(*args, **kwargs) | ParseTime(self, String time) -> int | ParseTime(self, String time) -> int | [
"ParseTime",
"(",
"self",
"String",
"time",
")",
"-",
">",
"int"
] | def ParseTime(*args, **kwargs):
"""ParseTime(self, String time) -> int"""
return _misc_.DateTime_ParseTime(*args, **kwargs) | [
"def",
"ParseTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_ParseTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4158-L4160 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/variables.py | python | Variable.device | (self) | return self._variable.device | The device of this variable. | The device of this variable. | [
"The",
"device",
"of",
"this",
"variable",
"."
] | def device(self):
"""The device of this variable."""
return self._variable.device | [
"def",
"device",
"(",
"self",
")",
":",
"return",
"self",
".",
"_variable",
".",
"device"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L817-L819 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/tool/android2grd.py | python | Android2Grd.ShortDescription | (self) | return 'Converts Android string.xml files into Chrome grd files.' | Returns a short description of the Android2Grd tool.
Overridden from grit.interface.Tool
Returns:
A string containing a short description of the android2grd tool. | Returns a short description of the Android2Grd tool. | [
"Returns",
"a",
"short",
"description",
"of",
"the",
"Android2Grd",
"tool",
"."
] | def ShortDescription(self):
"""Returns a short description of the Android2Grd tool.
Overridden from grit.interface.Tool
Returns:
A string containing a short description of the android2grd tool.
"""
return 'Converts Android string.xml files into Chrome grd files.' | [
"def",
"ShortDescription",
"(",
"self",
")",
":",
"return",
"'Converts Android string.xml files into Chrome grd files.'"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/tool/android2grd.py#L108-L116 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/client/timeline.py | python | _ChromeTraceFormatter.emit_counter | (self, category, name, pid, timestamp, counter, value) | Emits a record for a single counter.
Args:
category: The event category as a string.
name: The event name as a string.
pid: Identifier of the process generating this event as an integer.
timestamp: The timestamp of this event as a long integer.
counter: Name of the counter as a str... | Emits a record for a single counter. | [
"Emits",
"a",
"record",
"for",
"a",
"single",
"counter",
"."
] | def emit_counter(self, category, name, pid, timestamp, counter, value):
"""Emits a record for a single counter.
Args:
category: The event category as a string.
name: The event name as a string.
pid: Identifier of the process generating this event as an integer.
timestamp: The timesta... | [
"def",
"emit_counter",
"(",
"self",
",",
"category",
",",
"name",
",",
"pid",
",",
"timestamp",
",",
"counter",
",",
"value",
")",
":",
"event",
"=",
"self",
".",
"_create_event",
"(",
"'C'",
",",
"category",
",",
"name",
",",
"pid",
",",
"0",
",",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/timeline.py#L216-L229 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/gcs-oauth2-boto-plugin/gcs_oauth2_boto_plugin/oauth2_client.py | python | OAuth2Client.GetAccessToken | (self) | Obtains an access token for this client.
This client's access token cache is first checked for an existing,
not-yet-expired access token. If none is found, the client obtains a fresh
access token from the OAuth2 provider's token endpoint.
Returns:
The cached or freshly obtained AccessToken.
... | Obtains an access token for this client. | [
"Obtains",
"an",
"access",
"token",
"for",
"this",
"client",
"."
] | def GetAccessToken(self):
"""Obtains an access token for this client.
This client's access token cache is first checked for an existing,
not-yet-expired access token. If none is found, the client obtains a fresh
access token from the OAuth2 provider's token endpoint.
Returns:
The cached or f... | [
"def",
"GetAccessToken",
"(",
"self",
")",
":",
"# Ensure only one thread at a time attempts to get (and possibly refresh)",
"# the access token. This doesn't prevent concurrent refresh attempts across",
"# multiple gsutil instances, but at least protects against multiple threads",
"# simultaneous... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/gcs-oauth2-boto-plugin/gcs_oauth2_boto_plugin/oauth2_client.py#L292-L321 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/hooks.py | python | editor | (self, filename, linenum=None, wait=True) | Open the default editor at the given filename and linenumber.
This is IPython's default editor hook, you can use it as an example to
write your own modified one. To set your own editor function as the
new editor hook, call ip.set_hook('editor',yourfunc). | Open the default editor at the given filename and linenumber. | [
"Open",
"the",
"default",
"editor",
"at",
"the",
"given",
"filename",
"and",
"linenumber",
"."
] | def editor(self, filename, linenum=None, wait=True):
"""Open the default editor at the given filename and linenumber.
This is IPython's default editor hook, you can use it as an example to
write your own modified one. To set your own editor function as the
new editor hook, call ip.set_hook('editor',yo... | [
"def",
"editor",
"(",
"self",
",",
"filename",
",",
"linenum",
"=",
"None",
",",
"wait",
"=",
"True",
")",
":",
"# IPython configures a default editor at startup by reading $EDITOR from",
"# the environment, and falling back on vi (unix) or notepad (win32).",
"editor",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/hooks.py#L57-L82 | ||
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/gmxtree.py | python | File.get_declared_defines | (self) | return self._declared_defines | Return set of defines declared in this file.
The information is only populated for selected files. | Return set of defines declared in this file. | [
"Return",
"set",
"of",
"defines",
"declared",
"in",
"this",
"file",
"."
] | def get_declared_defines(self):
"""Return set of defines declared in this file.
The information is only populated for selected files."""
return self._declared_defines | [
"def",
"get_declared_defines",
"(",
"self",
")",
":",
"return",
"self",
".",
"_declared_defines"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/gmxtree.py#L347-L351 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.WriteBitmap | (*args, **kwargs) | return _richtext.RichTextCtrl_WriteBitmap(*args, **kwargs) | WriteBitmap(self, Bitmap bitmap, int bitmapType=BITMAP_TYPE_PNG) -> bool
Write a bitmap at the current insertion point. Supply optional type to
use for internal and file storage of the raw data. | WriteBitmap(self, Bitmap bitmap, int bitmapType=BITMAP_TYPE_PNG) -> bool | [
"WriteBitmap",
"(",
"self",
"Bitmap",
"bitmap",
"int",
"bitmapType",
"=",
"BITMAP_TYPE_PNG",
")",
"-",
">",
"bool"
] | def WriteBitmap(*args, **kwargs):
"""
WriteBitmap(self, Bitmap bitmap, int bitmapType=BITMAP_TYPE_PNG) -> bool
Write a bitmap at the current insertion point. Supply optional type to
use for internal and file storage of the raw data.
"""
return _richtext.RichTextCtrl_Writ... | [
"def",
"WriteBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_WriteBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3258-L3265 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/compile_resources.py | python | _ToAndroidLocales | (locale_allowlist) | return ret | Converts the list of Chrome locales to Android config locale qualifiers.
Args:
locale_allowlist: A list of Chromium locale names.
Returns:
A set of matching Android config locale qualifier names. | Converts the list of Chrome locales to Android config locale qualifiers. | [
"Converts",
"the",
"list",
"of",
"Chrome",
"locales",
"to",
"Android",
"config",
"locale",
"qualifiers",
"."
] | def _ToAndroidLocales(locale_allowlist):
"""Converts the list of Chrome locales to Android config locale qualifiers.
Args:
locale_allowlist: A list of Chromium locale names.
Returns:
A set of matching Android config locale qualifier names.
"""
ret = set()
for locale in locale_allowlist:
locale ... | [
"def",
"_ToAndroidLocales",
"(",
"locale_allowlist",
")",
":",
"ret",
"=",
"set",
"(",
")",
"for",
"locale",
"in",
"locale_allowlist",
":",
"locale",
"=",
"resource_utils",
".",
"ToAndroidLocaleName",
"(",
"locale",
")",
"if",
"locale",
"is",
"None",
"or",
"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/compile_resources.py#L318-L336 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/modulegraph/modulegraph/find_modules.py | python | find_modules | (scripts=(), includes=(), packages=(), excludes=(), path=None, debug=0) | return mf | High-level interface, takes iterables for:
scripts, includes, packages, excludes
And returns a :class:`modulegraph.modulegraph.ModuleGraph` instance,
python_files, and extensions
python_files is a list of pure python dependencies as modulegraph.Module objects,
extensions is a list of platform-... | High-level interface, takes iterables for:
scripts, includes, packages, excludes | [
"High",
"-",
"level",
"interface",
"takes",
"iterables",
"for",
":",
"scripts",
"includes",
"packages",
"excludes"
] | def find_modules(scripts=(), includes=(), packages=(), excludes=(), path=None, debug=0):
"""
High-level interface, takes iterables for:
scripts, includes, packages, excludes
And returns a :class:`modulegraph.modulegraph.ModuleGraph` instance,
python_files, and extensions
python_files is a ... | [
"def",
"find_modules",
"(",
"scripts",
"=",
"(",
")",
",",
"includes",
"=",
"(",
")",
",",
"packages",
"=",
"(",
")",
",",
"excludes",
"=",
"(",
")",
",",
"path",
"=",
"None",
",",
"debug",
"=",
"0",
")",
":",
"scripts",
"=",
"set",
"(",
"scrip... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/modulegraph/modulegraph/find_modules.py#L319-L342 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/serialwin32.py | python | Serial._update_break_state | (self) | Set break: Controls TXD. When active, to transmitting is possible. | Set break: Controls TXD. When active, to transmitting is possible. | [
"Set",
"break",
":",
"Controls",
"TXD",
".",
"When",
"active",
"to",
"transmitting",
"is",
"possible",
"."
] | def _update_break_state(self):
"""Set break: Controls TXD. When active, to transmitting is possible."""
if not self.is_open:
raise portNotOpenError
if self._break_state:
win32.SetCommBreak(self._port_handle)
else:
win32.ClearCommBreak(self._port_handle... | [
"def",
"_update_break_state",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"if",
"self",
".",
"_break_state",
":",
"win32",
".",
"SetCommBreak",
"(",
"self",
".",
"_port_handle",
")",
"else",
":",
"win32",
"... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/serialwin32.py#L364-L371 | ||
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Cursor.get_usr | (self) | return conf.lib.clang_getCursorUSR(self) | Return the Unified Symbol Resultion (USR) for the entity referenced
by the given cursor (or None).
A Unified Symbol Resolution (USR) is a string that identifies a
particular entity (function, class, variable, etc.) within a
program. USRs can be compared across translation units to deter... | Return the Unified Symbol Resultion (USR) for the entity referenced
by the given cursor (or None). | [
"Return",
"the",
"Unified",
"Symbol",
"Resultion",
"(",
"USR",
")",
"for",
"the",
"entity",
"referenced",
"by",
"the",
"given",
"cursor",
"(",
"or",
"None",
")",
"."
] | def get_usr(self):
"""Return the Unified Symbol Resultion (USR) for the entity referenced
by the given cursor (or None).
A Unified Symbol Resolution (USR) is a string that identifies a
particular entity (function, class, variable, etc.) within a
program. USRs can be compared acr... | [
"def",
"get_usr",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getCursorUSR",
"(",
"self",
")"
] | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1237-L1246 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/docview.py | python | DocChildFrame.ProcessUpdateUIEvent | (self, event) | Processes a UI event, searching event tables and calling zero or more
suitable event handler function(s). Note that the ProcessEvent
method is called from the wxPython docview framework directly since
wxPython does not have a virtual ProcessEvent function. | Processes a UI event, searching event tables and calling zero or more
suitable event handler function(s). Note that the ProcessEvent
method is called from the wxPython docview framework directly since
wxPython does not have a virtual ProcessEvent function. | [
"Processes",
"a",
"UI",
"event",
"searching",
"event",
"tables",
"and",
"calling",
"zero",
"or",
"more",
"suitable",
"event",
"handler",
"function",
"(",
"s",
")",
".",
"Note",
"that",
"the",
"ProcessEvent",
"method",
"is",
"called",
"from",
"the",
"wxPython... | def ProcessUpdateUIEvent(self, event):
"""
Processes a UI event, searching event tables and calling zero or more
suitable event handler function(s). Note that the ProcessEvent
method is called from the wxPython docview framework directly since
wxPython does not have a virtual Pr... | [
"def",
"ProcessUpdateUIEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"GetParent",
"(",
")",
":",
"self",
".",
"GetParent",
"(",
")",
".",
"ProcessUpdateUIEvent",
"(",
"event",
")",
"else",
":",
"return",
"False"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L2535-L2545 | ||
ome/openmicroscopy | 17d0a38493571540815074bfbf06932526fc3349 | examples/ScriptingService/adminWorkflow.py | python | listScripts | (scriptService) | Prints out the available Official Scripts returned by getScripts()
and User Scripts returned by getUserScripts() | Prints out the available Official Scripts returned by getScripts()
and User Scripts returned by getUserScripts() | [
"Prints",
"out",
"the",
"available",
"Official",
"Scripts",
"returned",
"by",
"getScripts",
"()",
"and",
"User",
"Scripts",
"returned",
"by",
"getUserScripts",
"()"
] | def listScripts(scriptService):
"""
Prints out the available Official Scripts returned by getScripts()
and User Scripts returned by getUserScripts()
"""
print("--OFFICIAL SCRIPTS--")
scripts = scriptService.getScripts()
for s in scripts:
print(s.id.val, s.path.val + s.name.val)
... | [
"def",
"listScripts",
"(",
"scriptService",
")",
":",
"print",
"(",
"\"--OFFICIAL SCRIPTS--\"",
")",
"scripts",
"=",
"scriptService",
".",
"getScripts",
"(",
")",
"for",
"s",
"in",
"scripts",
":",
"print",
"(",
"s",
".",
"id",
".",
"val",
",",
"s",
".",
... | https://github.com/ome/openmicroscopy/blob/17d0a38493571540815074bfbf06932526fc3349/examples/ScriptingService/adminWorkflow.py#L95-L110 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/column/lists.py | python | ListMethods.len | (self) | return self._return_or_inplace(count_elements(self._column)) | Computes the length of each element in the Series/Index.
Returns
-------
Series or Index
Examples
--------
>>> s = cudf.Series([[1, 2, 3], None, [4, 5]])
>>> s
0 [1, 2, 3]
1 None
2 [4, 5]
dtype: list
>>> s... | Computes the length of each element in the Series/Index. | [
"Computes",
"the",
"length",
"of",
"each",
"element",
"in",
"the",
"Series",
"/",
"Index",
"."
] | def len(self) -> ParentType:
"""
Computes the length of each element in the Series/Index.
Returns
-------
Series or Index
Examples
--------
>>> s = cudf.Series([[1, 2, 3], None, [4, 5]])
>>> s
0 [1, 2, 3]
1 None
... | [
"def",
"len",
"(",
"self",
")",
"->",
"ParentType",
":",
"return",
"self",
".",
"_return_or_inplace",
"(",
"count_elements",
"(",
"self",
".",
"_column",
")",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/lists.py#L459-L481 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/conv.py | python | Converter.run | (self, graminit_h, graminit_c) | Load the grammar tables from the text files written by pgen. | Load the grammar tables from the text files written by pgen. | [
"Load",
"the",
"grammar",
"tables",
"from",
"the",
"text",
"files",
"written",
"by",
"pgen",
"."
] | def run(self, graminit_h, graminit_c):
"""Load the grammar tables from the text files written by pgen."""
self.parse_graminit_h(graminit_h)
self.parse_graminit_c(graminit_c)
self.finish_off() | [
"def",
"run",
"(",
"self",
",",
"graminit_h",
",",
"graminit_c",
")",
":",
"self",
".",
"parse_graminit_h",
"(",
"graminit_h",
")",
"self",
".",
"parse_graminit_c",
"(",
"graminit_c",
")",
"self",
".",
"finish_off",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/conv.py#L47-L51 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | Categorical.as_ordered | (self, inplace=False) | return self.set_ordered(True, inplace=inplace) | Set the Categorical to be ordered.
Parameters
----------
inplace : bool, default False
Whether or not to set the ordered attribute in-place or return
a copy of this categorical with ordered set to True.
Returns
-------
Categorical
Order... | Set the Categorical to be ordered. | [
"Set",
"the",
"Categorical",
"to",
"be",
"ordered",
"."
] | def as_ordered(self, inplace=False):
"""
Set the Categorical to be ordered.
Parameters
----------
inplace : bool, default False
Whether or not to set the ordered attribute in-place or return
a copy of this categorical with ordered set to True.
Retu... | [
"def",
"as_ordered",
"(",
"self",
",",
"inplace",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"\"inplace\"",
")",
"return",
"self",
".",
"set_ordered",
"(",
"True",
",",
"inplace",
"=",
"inplace",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L756-L772 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Rmdir | (*args) | return _gdal.Rmdir(*args) | r"""Rmdir(char const * utf8_path) -> VSI_RETVAL | r"""Rmdir(char const * utf8_path) -> VSI_RETVAL | [
"r",
"Rmdir",
"(",
"char",
"const",
"*",
"utf8_path",
")",
"-",
">",
"VSI_RETVAL"
] | def Rmdir(*args):
r"""Rmdir(char const * utf8_path) -> VSI_RETVAL"""
return _gdal.Rmdir(*args) | [
"def",
"Rmdir",
"(",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"Rmdir",
"(",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L1684-L1686 | |
SmartisanTech/Wrench | 27f3c17692910997bba3a3c9fd88c8717497aac6 | extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py | python | SipGenerator._read_source | (self, extent) | return "".join(extract).replace("\n", " ") | Read the given range from the unpre-processed source.
:param extent: The range of text required. | Read the given range from the unpre-processed source. | [
"Read",
"the",
"given",
"range",
"from",
"the",
"unpre",
"-",
"processed",
"source",
"."
] | def _read_source(self, extent):
"""
Read the given range from the unpre-processed source.
:param extent: The range of text required.
"""
extract = self.unpreprocessed_source[extent.start.line - 1:extent.end.line]
if extent.start.line == extent.end.line:
... | [
"def",
"_read_source",
"(",
"self",
",",
"extent",
")",
":",
"extract",
"=",
"self",
".",
"unpreprocessed_source",
"[",
"extent",
".",
"start",
".",
"line",
"-",
"1",
":",
"extent",
".",
"end",
".",
"line",
"]",
"if",
"extent",
".",
"start",
".",
"li... | https://github.com/SmartisanTech/Wrench/blob/27f3c17692910997bba3a3c9fd88c8717497aac6/extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py#L626-L641 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/gather/interface.py | python | GathererBase.SetGrdNode | (self, node) | Sets the grd node on which this gatherer is running. | Sets the grd node on which this gatherer is running. | [
"Sets",
"the",
"grd",
"node",
"on",
"which",
"this",
"gatherer",
"is",
"running",
"."
] | def SetGrdNode(self, node):
'''Sets the grd node on which this gatherer is running.
'''
self.grd_node = node | [
"def",
"SetGrdNode",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"grd_node",
"=",
"node"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/gather/interface.py#L70-L73 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py | python | HDFStore.select_column | (
self,
key: str,
column: str,
start: Optional[int] = None,
stop: Optional[int] = None,
) | return tbl.read_column(column=column, start=start, stop=stop) | return a single column from the table. This is generally only useful to
select an indexable
Parameters
----------
key : str
column : str
The column of interest.
start : int or None, default None
stop : int or None, default None
Raises
... | return a single column from the table. This is generally only useful to
select an indexable | [
"return",
"a",
"single",
"column",
"from",
"the",
"table",
".",
"This",
"is",
"generally",
"only",
"useful",
"to",
"select",
"an",
"indexable"
] | def select_column(
self,
key: str,
column: str,
start: Optional[int] = None,
stop: Optional[int] = None,
):
"""
return a single column from the table. This is generally only useful to
select an indexable
Parameters
----------
k... | [
"def",
"select_column",
"(",
"self",
",",
"key",
":",
"str",
",",
"column",
":",
"str",
",",
"start",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"stop",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
")",
":",
"tbl",
"=",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L839-L869 | |
Caffe-MPI/Caffe-MPI.github.io | df5992af571a2a19981b69635115c393f18d1c76 | tools/extra/parse_log.py | python | write_csv | (output_filename, dict_list, delimiter, verbose=False) | Write a CSV file | Write a CSV file | [
"Write",
"a",
"CSV",
"file"
] | def write_csv(output_filename, dict_list, delimiter, verbose=False):
"""Write a CSV file
"""
if not dict_list:
if verbose:
print('Not writing %s; no lines to write' % output_filename)
return
dialect = csv.excel
dialect.delimiter = delimiter
with open(output_filenam... | [
"def",
"write_csv",
"(",
"output_filename",
",",
"dict_list",
",",
"delimiter",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"dict_list",
":",
"if",
"verbose",
":",
"print",
"(",
"'Not writing %s; no lines to write'",
"%",
"output_filename",
")",
"return... | https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/tools/extra/parse_log.py#L148-L166 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Complex.__truediv__ | (self, other) | self / other with __future__ division.
Should promote to float when necessary. | self / other with __future__ division. | [
"self",
"/",
"other",
"with",
"__future__",
"division",
"."
] | def __truediv__(self, other):
"""self / other with __future__ division.
Should promote to float when necessary.
"""
raise NotImplementedError | [
"def",
"__truediv__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L124-L129 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_handlers.py | python | EndpointStateHandler.is_local_uninitialised | (cls, endpoint: Endpoint) | return bool(endpoint.state & Endpoint.LOCAL_UNINIT) | Test if local ``endpoint`` is uninitialised (ie has state
:const:`proton.Endpoint.LOCAL_UNINIT`).
:param endpoint: The local endpoint to be tested.
:return: ``True`` if local endpoint is in state
:const:`proton.Endpoint.LOCAL_UNINIT`, ``False`` otherwise. | Test if local ``endpoint`` is uninitialised (ie has state
:const:`proton.Endpoint.LOCAL_UNINIT`). | [
"Test",
"if",
"local",
"endpoint",
"is",
"uninitialised",
"(",
"ie",
"has",
"state",
":",
"const",
":",
"proton",
".",
"Endpoint",
".",
"LOCAL_UNINIT",
")",
"."
] | def is_local_uninitialised(cls, endpoint: Endpoint) -> bool:
"""
Test if local ``endpoint`` is uninitialised (ie has state
:const:`proton.Endpoint.LOCAL_UNINIT`).
:param endpoint: The local endpoint to be tested.
:return: ``True`` if local endpoint is in state
:const... | [
"def",
"is_local_uninitialised",
"(",
"cls",
",",
"endpoint",
":",
"Endpoint",
")",
"->",
"bool",
":",
"return",
"bool",
"(",
"endpoint",
".",
"state",
"&",
"Endpoint",
".",
"LOCAL_UNINIT",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_handlers.py#L337-L346 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.GetCursor | (*args, **kwargs) | return _core_.Window_GetCursor(*args, **kwargs) | GetCursor(self) -> Cursor
Return the cursor associated with this window. | GetCursor(self) -> Cursor | [
"GetCursor",
"(",
"self",
")",
"-",
">",
"Cursor"
] | def GetCursor(*args, **kwargs):
"""
GetCursor(self) -> Cursor
Return the cursor associated with this window.
"""
return _core_.Window_GetCursor(*args, **kwargs) | [
"def",
"GetCursor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetCursor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10970-L10976 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.LinesSplit | (*args, **kwargs) | return _stc.StyledTextCtrl_LinesSplit(*args, **kwargs) | LinesSplit(self, int pixelWidth)
Split the lines in the target into lines that are less wide than pixelWidth
where possible. | LinesSplit(self, int pixelWidth) | [
"LinesSplit",
"(",
"self",
"int",
"pixelWidth",
")"
] | def LinesSplit(*args, **kwargs):
"""
LinesSplit(self, int pixelWidth)
Split the lines in the target into lines that are less wide than pixelWidth
where possible.
"""
return _stc.StyledTextCtrl_LinesSplit(*args, **kwargs) | [
"def",
"LinesSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_LinesSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4305-L4312 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | RectS | (*args, **kwargs) | return val | RectS(Size size) -> Rect
Create a new Rect from a size only. | RectS(Size size) -> Rect | [
"RectS",
"(",
"Size",
"size",
")",
"-",
">",
"Rect"
] | def RectS(*args, **kwargs):
"""
RectS(Size size) -> Rect
Create a new Rect from a size only.
"""
val = _core_.new_RectS(*args, **kwargs)
return val | [
"def",
"RectS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_core_",
".",
"new_RectS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1621-L1628 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/modes/emacs.py | python | EmacsMode.re_read_init_file | (self, e) | Read in the contents of the inputrc file, and incorporate any
bindings or variable assignments found there. | Read in the contents of the inputrc file, and incorporate any
bindings or variable assignments found there. | [
"Read",
"in",
"the",
"contents",
"of",
"the",
"inputrc",
"file",
"and",
"incorporate",
"any",
"bindings",
"or",
"variable",
"assignments",
"found",
"there",
"."
] | def re_read_init_file(self, e): # (C-x C-r)
'''Read in the contents of the inputrc file, and incorporate any
bindings or variable assignments found there.'''
self.finalize() | [
"def",
"re_read_init_file",
"(",
"self",
",",
"e",
")",
":",
"# (C-x C-r)",
"self",
".",
"finalize",
"(",
")"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/emacs.py#L525-L528 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/closure_compiler/compile2.py | python | Checker._run_jar | (self, jar, args) | return process.returncode, stderr | Runs a .jar from the command line with arguments.
Args:
jar: A file path to a .jar file
args: A list of command line arguments to be passed when running the .jar.
Return:
(exit_code, stderr) The exit code of the command (e.g. 0 for success) and
the stderr collected while running |j... | Runs a .jar from the command line with arguments. | [
"Runs",
"a",
".",
"jar",
"from",
"the",
"command",
"line",
"with",
"arguments",
"."
] | def _run_jar(self, jar, args):
"""Runs a .jar from the command line with arguments.
Args:
jar: A file path to a .jar file
args: A list of command line arguments to be passed when running the .jar.
Return:
(exit_code, stderr) The exit code of the command (e.g. 0 for success) and
... | [
"def",
"_run_jar",
"(",
"self",
",",
"jar",
",",
"args",
")",
":",
"shell_command",
"=",
"\" \"",
".",
"join",
"(",
"self",
".",
"_JAR_COMMAND",
"+",
"[",
"jar",
"]",
"+",
"args",
")",
"self",
".",
"_log_debug",
"(",
"\"Running jar: %s\"",
"%",
"shell_... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/closure_compiler/compile2.py#L79-L97 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/email/_parseaddr.py | python | AddrlistClass.getdomainliteral | (self) | return '[%s]' % self.getdelimited('[', ']\r', False) | Parse an RFC 2822 domain-literal. | Parse an RFC 2822 domain-literal. | [
"Parse",
"an",
"RFC",
"2822",
"domain",
"-",
"literal",
"."
] | def getdomainliteral(self):
"""Parse an RFC 2822 domain-literal."""
return '[%s]' % self.getdelimited('[', ']\r', False) | [
"def",
"getdomainliteral",
"(",
"self",
")",
":",
"return",
"'[%s]'",
"%",
"self",
".",
"getdelimited",
"(",
"'['",
",",
"']\\r'",
",",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_parseaddr.py#L457-L459 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/serialutil.py | python | SerialBase.getXonXoff | (self) | return self._xonxoff | Get the current XON/XOFF setting. | Get the current XON/XOFF setting. | [
"Get",
"the",
"current",
"XON",
"/",
"XOFF",
"setting",
"."
] | def getXonXoff(self):
"""Get the current XON/XOFF setting."""
return self._xonxoff | [
"def",
"getXonXoff",
"(",
"self",
")",
":",
"return",
"self",
".",
"_xonxoff"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialutil.py#L435-L437 | |
vadimcn/vscode-lldb | 0ece78ec15eda432be7c9e4392aaec9404c29942 | adapter/codelldb.py | python | debug_info | (debugger, command, result, internal_dict) | Display compilation units found in each module's debug info.\nUsage: debug_info [module name] | Display compilation units found in each module's debug info.\nUsage: debug_info [module name] | [
"Display",
"compilation",
"units",
"found",
"in",
"each",
"module",
"s",
"debug",
"info",
".",
"\\",
"nUsage",
":",
"debug_info",
"[",
"module",
"name",
"]"
] | def debug_info(debugger, command, result, internal_dict):
'''Display compilation units found in each module's debug info.\nUsage: debug_info [module name]'''
import shlex
args = shlex.split(command)
if len(args) > 0:
import re
regex = re.compile(args[0])
filter = lambda mod: rege... | [
"def",
"debug_info",
"(",
"debugger",
",",
"command",
",",
"result",
",",
"internal_dict",
")",
":",
"import",
"shlex",
"args",
"=",
"shlex",
".",
"split",
"(",
"command",
")",
"if",
"len",
"(",
"args",
")",
">",
"0",
":",
"import",
"re",
"regex",
"=... | https://github.com/vadimcn/vscode-lldb/blob/0ece78ec15eda432be7c9e4392aaec9404c29942/adapter/codelldb.py#L294-L315 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/debugger.py | python | Pdb.do_psource | (self, arg) | Print (or run through pager) the source code for an object. | Print (or run through pager) the source code for an object. | [
"Print",
"(",
"or",
"run",
"through",
"pager",
")",
"the",
"source",
"code",
"for",
"an",
"object",
"."
] | def do_psource(self, arg):
"""Print (or run through pager) the source code for an object."""
namespaces = [
("Locals", self.curframe_locals),
("Globals", self.curframe.f_globals),
]
self.shell.find_line_magic("psource")(arg, namespaces=namespaces) | [
"def",
"do_psource",
"(",
"self",
",",
"arg",
")",
":",
"namespaces",
"=",
"[",
"(",
"\"Locals\"",
",",
"self",
".",
"curframe_locals",
")",
",",
"(",
"\"Globals\"",
",",
"self",
".",
"curframe",
".",
"f_globals",
")",
",",
"]",
"self",
".",
"shell",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/debugger.py#L864-L870 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/sans/eqsans_sample_script.py | python | SampleData.to_xml | (self) | return BaseScriptElement.addElementToSection(xml_str, "Transmission", "combine_transmission_frames",
str(self.combine_transmission_frames)) | Create XML from the current data. | Create XML from the current data. | [
"Create",
"XML",
"from",
"the",
"current",
"data",
"."
] | def to_xml(self):
"""
Create XML from the current data.
"""
xml_str = super(SampleData, self).to_xml()
return BaseScriptElement.addElementToSection(xml_str, "Transmission", "combine_transmission_frames",
str(self.combine_tr... | [
"def",
"to_xml",
"(",
"self",
")",
":",
"xml_str",
"=",
"super",
"(",
"SampleData",
",",
"self",
")",
".",
"to_xml",
"(",
")",
"return",
"BaseScriptElement",
".",
"addElementToSection",
"(",
"xml_str",
",",
"\"Transmission\"",
",",
"\"combine_transmission_frames... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/sans/eqsans_sample_script.py#L47-L53 | |
pristineio/webrtc-mirror | 7a5bcdffaab90a05bc1146b2b1ea71c004e54d71 | tools_webrtc/vim/webrtc.ycm_extra_conf.py | python | FlagsForFile | (filename) | return {
'flags': final_flags,
'do_cache': should_cache_flags_for_file
} | This is the main entry point for YCM. Its interface is fixed.
Args:
filename: (String) Path to source file being edited.
Returns:
(Dictionary)
'flags': (List of Strings) Command line flags.
'do_cache': (Boolean) True if the result should be cached. | This is the main entry point for YCM. Its interface is fixed. | [
"This",
"is",
"the",
"main",
"entry",
"point",
"for",
"YCM",
".",
"Its",
"interface",
"is",
"fixed",
"."
] | def FlagsForFile(filename):
"""This is the main entry point for YCM. Its interface is fixed.
Args:
filename: (String) Path to source file being edited.
Returns:
(Dictionary)
'flags': (List of Strings) Command line flags.
'do_cache': (Boolean) True if the result should be cached.
"""
abs_... | [
"def",
"FlagsForFile",
"(",
"filename",
")",
":",
"abs_filename",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"filename",
")",
"webrtc_root",
"=",
"FindWebrtcSrcFromFilename",
"(",
"abs_filename",
")",
"clang_flags",
"=",
"GetClangOptionsFromNinjaForFilename",
"(",... | https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/vim/webrtc.ycm_extra_conf.py#L332-L357 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/crossbow/cli.py | python | report | (obj, job_name, sender_name, sender_email, recipient_email,
smtp_user, smtp_password, smtp_server, smtp_port, poll,
poll_max_minutes, poll_interval_minutes, send, fetch) | Send an e-mail report showing success/failure of tasks in a Crossbow run | Send an e-mail report showing success/failure of tasks in a Crossbow run | [
"Send",
"an",
"e",
"-",
"mail",
"report",
"showing",
"success",
"/",
"failure",
"of",
"tasks",
"in",
"a",
"Crossbow",
"run"
] | def report(obj, job_name, sender_name, sender_email, recipient_email,
smtp_user, smtp_password, smtp_server, smtp_port, poll,
poll_max_minutes, poll_interval_minutes, send, fetch):
"""
Send an e-mail report showing success/failure of tasks in a Crossbow run
"""
output = obj['output... | [
"def",
"report",
"(",
"obj",
",",
"job_name",
",",
"sender_name",
",",
"sender_email",
",",
"recipient_email",
",",
"smtp_user",
",",
"smtp_password",
",",
"smtp_server",
",",
"smtp_port",
",",
"poll",
",",
"poll_max_minutes",
",",
"poll_interval_minutes",
",",
... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/crossbow/cli.py#L268-L301 | ||
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | scripts/cpp_lint.py | python | CheckEmptyBlockBody | (filename, clean_lines, linenum, error) | Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Look for empty loop/conditional body with only a single semicolon. | [
"Look",
"for",
"empty",
"loop",
"/",
"conditional",
"body",
"with",
"only",
"a",
"single",
"semicolon",
"."
] | def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
"""Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functio... | [
"def",
"CheckEmptyBlockBody",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Search for loop keywords at the beginning of the line. Because only",
"# whitespaces are allowed before the keywords, this will also ignore most",
"# do-while-loops, since those... | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L3243-L3275 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/graph_io.py | python | write_graph | (graph_or_graph_def, logdir, name, as_text=True) | return path | Writes a graph proto to a file.
The graph is written as a text proto unless `as_text` is `False`.
```python
v = tf.Variable(0, name='my_variable')
sess = tf.Session()
tf.train.write_graph(sess.graph_def, '/tmp/my-model', 'train.pbtxt')
```
or
```python
v = tf.Variable(0, name='my_variable')
sess... | Writes a graph proto to a file. | [
"Writes",
"a",
"graph",
"proto",
"to",
"a",
"file",
"."
] | def write_graph(graph_or_graph_def, logdir, name, as_text=True):
"""Writes a graph proto to a file.
The graph is written as a text proto unless `as_text` is `False`.
```python
v = tf.Variable(0, name='my_variable')
sess = tf.Session()
tf.train.write_graph(sess.graph_def, '/tmp/my-model', 'train.pbtxt')
... | [
"def",
"write_graph",
"(",
"graph_or_graph_def",
",",
"logdir",
",",
"name",
",",
"as_text",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"graph_or_graph_def",
",",
"ops",
".",
"Graph",
")",
":",
"graph_def",
"=",
"graph_or_graph_def",
".",
"as_graph_def",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/graph_io.py#L29-L72 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/jit/_trace.py | python | trace_module | (
mod,
inputs,
optimize=None,
check_trace=True,
check_inputs=None,
check_tolerance=1e-5,
strict=True,
_force_outplace=False,
_module_class=None,
_compilation_unit=_python_cu,
) | return module | Trace a module and return an executable :class:`ScriptModule` that will be optimized
using just-in-time compilation. When a module is passed to :func:`torch.jit.trace <torch.jit.trace>`, only
the ``forward`` method is run and traced. With ``trace_module``, you can specify a dictionary of
method names to exa... | Trace a module and return an executable :class:`ScriptModule` that will be optimized
using just-in-time compilation. When a module is passed to :func:`torch.jit.trace <torch.jit.trace>`, only
the ``forward`` method is run and traced. With ``trace_module``, you can specify a dictionary of
method names to exa... | [
"Trace",
"a",
"module",
"and",
"return",
"an",
"executable",
":",
"class",
":",
"ScriptModule",
"that",
"will",
"be",
"optimized",
"using",
"just",
"-",
"in",
"-",
"time",
"compilation",
".",
"When",
"a",
"module",
"is",
"passed",
"to",
":",
"func",
":",... | def trace_module(
mod,
inputs,
optimize=None,
check_trace=True,
check_inputs=None,
check_tolerance=1e-5,
strict=True,
_force_outplace=False,
_module_class=None,
_compilation_unit=_python_cu,
):
"""
Trace a module and return an executable :class:`ScriptModule` that will be... | [
"def",
"trace_module",
"(",
"mod",
",",
"inputs",
",",
"optimize",
"=",
"None",
",",
"check_trace",
"=",
"True",
",",
"check_inputs",
"=",
"None",
",",
"check_tolerance",
"=",
"1e-5",
",",
"strict",
"=",
"True",
",",
"_force_outplace",
"=",
"False",
",",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/jit/_trace.py#L827-L996 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | scripts/cpp_lint.py | python | CheckForHeaderGuard | (filename, lines, error) | Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representing a line of the file.
error: The function to call... | Checks that the file contains a header guard. | [
"Checks",
"that",
"the",
"file",
"contains",
"a",
"header",
"guard",
"."
] | def CheckForHeaderGuard(filename, lines, error):
"""Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representi... | [
"def",
"CheckForHeaderGuard",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"cppvar",
"=",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
"ifndef",
"=",
"None",
"ifndef_linenum",
"=",
"0",
"define",
"=",
"None",
"endif",
"=",
"None",
"endif_linenu... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L1408-L1480 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py | python | Treeview.set | (self, item, column=None, value=None) | Query or set the value of given item.
With one argument, return a dictionary of column/value pairs
for the specified item. With two arguments, return the current
value of the specified column. With three arguments, set the
value of given column in given item to the specified value. | Query or set the value of given item. | [
"Query",
"or",
"set",
"the",
"value",
"of",
"given",
"item",
"."
] | def set(self, item, column=None, value=None):
"""Query or set the value of given item.
With one argument, return a dictionary of column/value pairs
for the specified item. With two arguments, return the current
value of the specified column. With three arguments, set the
value o... | [
"def",
"set",
"(",
"self",
",",
"item",
",",
"column",
"=",
"None",
",",
"value",
"=",
"None",
")",
":",
"res",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"set\"",
",",
"item",
",",
"column",
",",
"value",
")",
"if",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py#L1476-L1488 | ||
alexgkendall/caffe-posenet | 62aafbd7c45df91acdba14f5d1406d8295c2bc6f | python/caffe/pycaffe.py | python | _Net_backward | (self, diffs=None, start=None, end=None, **kwargs) | return {out: self.blobs[out].diff for out in outputs} | Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If None, top diffs are taken from forward loss.
start : optional name of layer at w... | Backward pass: prepare diffs and run the net backward. | [
"Backward",
"pass",
":",
"prepare",
"diffs",
"and",
"run",
"the",
"net",
"backward",
"."
] | def _Net_backward(self, diffs=None, start=None, end=None, **kwargs):
"""
Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If Non... | [
"def",
"_Net_backward",
"(",
"self",
",",
"diffs",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"diffs",
"is",
"None",
":",
"diffs",
"=",
"[",
"]",
"if",
"start",
"is",
"not",
"None",
... | https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/python/caffe/pycaffe.py#L111-L156 | |
CalcProgrammer1/OpenRGB | 8156b0167a7590dd8ba561dfde524bfcacf46b5e | dependencies/mbedtls-2.24.0/scripts/config.py | python | Config.__getitem__ | (self, name) | return self.settings[name].value | Get the value of name, i.e. what the preprocessor symbol expands to.
If name is not known, raise KeyError. name does not need to be active. | Get the value of name, i.e. what the preprocessor symbol expands to. | [
"Get",
"the",
"value",
"of",
"name",
"i",
".",
"e",
".",
"what",
"the",
"preprocessor",
"symbol",
"expands",
"to",
"."
] | def __getitem__(self, name):
"""Get the value of name, i.e. what the preprocessor symbol expands to.
If name is not known, raise KeyError. name does not need to be active.
"""
return self.settings[name].value | [
"def",
"__getitem__",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"settings",
"[",
"name",
"]",
".",
"value"
] | https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/config.py#L86-L91 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py | python | Timestamp.FromMilliseconds | (self, millis) | Converts milliseconds since epoch to Timestamp. | Converts milliseconds since epoch to Timestamp. | [
"Converts",
"milliseconds",
"since",
"epoch",
"to",
"Timestamp",
"."
] | def FromMilliseconds(self, millis):
"""Converts milliseconds since epoch to Timestamp."""
self.seconds = millis // _MILLIS_PER_SECOND
self.nanos = (millis % _MILLIS_PER_SECOND) * _NANOS_PER_MILLISECOND | [
"def",
"FromMilliseconds",
"(",
"self",
",",
"millis",
")",
":",
"self",
".",
"seconds",
"=",
"millis",
"//",
"_MILLIS_PER_SECOND",
"self",
".",
"nanos",
"=",
"(",
"millis",
"%",
"_MILLIS_PER_SECOND",
")",
"*",
"_NANOS_PER_MILLISECOND"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L224-L227 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecCodeSignBundle | (self, key, entitlements, provisioning, path, preserve) | Code sign a bundle.
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as embedded.mobileprovision,
2. copy Entitlements.plist from user or SDK next to th... | Code sign a bundle. | [
"Code",
"sign",
"a",
"bundle",
"."
] | def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve):
"""Code sign a bundle.
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as ... | [
"def",
"ExecCodeSignBundle",
"(",
"self",
",",
"key",
",",
"entitlements",
",",
"provisioning",
",",
"path",
",",
"preserve",
")",
":",
"substitutions",
",",
"overrides",
"=",
"self",
".",
"_InstallProvisioningProfile",
"(",
"provisioning",
",",
"self",
".",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/mac_tool.py#L411-L432 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/NNDF/models.py | python | NNModelFile.__init__ | (
self,
default_converter: ModelFileConverter = None,
network_metadata: NetworkMetadata = None,
) | Since torch functions often allow for models to either be from disk as fpath or from a loaded object,
we provide a similar option here. Arguments can either be a path on disk or from model itself.
Args:
model (Union[str, torch.Model]): Location of the model as fpath OR loaded torch.Model ob... | Since torch functions often allow for models to either be from disk as fpath or from a loaded object,
we provide a similar option here. Arguments can either be a path on disk or from model itself. | [
"Since",
"torch",
"functions",
"often",
"allow",
"for",
"models",
"to",
"either",
"be",
"from",
"disk",
"as",
"fpath",
"or",
"from",
"a",
"loaded",
"object",
"we",
"provide",
"a",
"similar",
"option",
"here",
".",
"Arguments",
"can",
"either",
"be",
"a",
... | def __init__(
self,
default_converter: ModelFileConverter = None,
network_metadata: NetworkMetadata = None,
):
"""
Since torch functions often allow for models to either be from disk as fpath or from a loaded object,
we provide a similar option here. Arguments can eit... | [
"def",
"__init__",
"(",
"self",
",",
"default_converter",
":",
"ModelFileConverter",
"=",
"None",
",",
"network_metadata",
":",
"NetworkMetadata",
"=",
"None",
",",
")",
":",
"if",
"default_converter",
"is",
"not",
"None",
":",
"self",
".",
"default_converter",
... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/models.py#L137-L154 | ||
apache/madlib | be297fe6beada0640f93317e8948834032718e32 | src/madpack/upgrade_util.py | python | ChangeHandler.drop_changed_udo | (self) | @brief Drop all operators (UDO) that were removed/updated in new version | [] | def drop_changed_udo(self):
"""
@brief Drop all operators (UDO) that were removed/updated in new version
"""
for op in self._udo:
for value in self._udo[op]:
leftarg = value['leftarg'].replace('schema_madlib', self._schema)
rightarg = value['ri... | [
"def",
"drop_changed_udo",
"(",
"self",
")",
":",
"for",
"op",
"in",
"self",
".",
"_udo",
":",
"for",
"value",
"in",
"self",
".",
"_udo",
"[",
"op",
"]",
":",
"leftarg",
"=",
"value",
"[",
"'leftarg'",
"]",
".",
"replace",
"(",
"'schema_madlib'",
","... | https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/upgrade_util.py#L452-L462 | |||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/_ffi/node.py | python | NodeBase.same_as | (self, other) | return self.__hash__() == other.__hash__() | check object identity equality | check object identity equality | [
"check",
"object",
"identity",
"equality"
] | def same_as(self, other):
"""check object identity equality"""
if not isinstance(other, NodeBase):
return False
return self.__hash__() == other.__hash__() | [
"def",
"same_as",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"NodeBase",
")",
":",
"return",
"False",
"return",
"self",
".",
"__hash__",
"(",
")",
"==",
"other",
".",
"__hash__",
"(",
")"
] | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/_ffi/node.py#L68-L72 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py | python | Layer1.list_tables | (self, limit=None, start_table=None) | return self.make_request('ListTables', json_input) | Returns a dictionary of results. The dictionary contains
a **TableNames** key whose value is a list of the table names.
The dictionary could also contain a **LastEvaluatedTableName**
key whose value would be the last table name returned if
the complete list of table names was not return... | Returns a dictionary of results. The dictionary contains
a **TableNames** key whose value is a list of the table names.
The dictionary could also contain a **LastEvaluatedTableName**
key whose value would be the last table name returned if
the complete list of table names was not return... | [
"Returns",
"a",
"dictionary",
"of",
"results",
".",
"The",
"dictionary",
"contains",
"a",
"**",
"TableNames",
"**",
"key",
"whose",
"value",
"is",
"a",
"list",
"of",
"the",
"table",
"names",
".",
"The",
"dictionary",
"could",
"also",
"contain",
"a",
"**",
... | def list_tables(self, limit=None, start_table=None):
"""
Returns a dictionary of results. The dictionary contains
a **TableNames** key whose value is a list of the table names.
The dictionary could also contain a **LastEvaluatedTableName**
key whose value would be the last table... | [
"def",
"list_tables",
"(",
"self",
",",
"limit",
"=",
"None",
",",
"start_table",
"=",
"None",
")",
":",
"data",
"=",
"{",
"}",
"if",
"limit",
":",
"data",
"[",
"'Limit'",
"]",
"=",
"limit",
"if",
"start_table",
":",
"data",
"[",
"'ExclusiveStartTableN... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py#L180-L206 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/distributions/python/ops/student_t.py | python | StudentT.mu | (self) | return self._mu | Locations of these Student's t distribution(s). | Locations of these Student's t distribution(s). | [
"Locations",
"of",
"these",
"Student",
"s",
"t",
"distribution",
"(",
"s",
")",
"."
] | def mu(self):
"""Locations of these Student's t distribution(s)."""
return self._mu | [
"def",
"mu",
"(",
"self",
")",
":",
"return",
"self",
".",
"_mu"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/student_t.py#L154-L156 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/npyio.py | python | NpzFile.keys | (self) | return self.files | Return files in the archive with a ".npy" extension. | Return files in the archive with a ".npy" extension. | [
"Return",
"files",
"in",
"the",
"archive",
"with",
"a",
".",
"npy",
"extension",
"."
] | def keys(self):
"""Return files in the archive with a ".npy" extension."""
return self.files | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"self",
".",
"files"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/npyio.py#L253-L255 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/base.py | python | data_dir_default | () | :return: default data directory depending on the platform and environment variables | [] | def data_dir_default():
"""
:return: default data directory depending on the platform and environment variables
"""
system = platform.system()
if system == 'Windows':
return os.path.join(os.environ.get('APPDATA'), 'mxnet')
else:
return os.path.join(os.path.expanduser("~"), '.mxn... | [
"def",
"data_dir_default",
"(",
")",
":",
"system",
"=",
"platform",
".",
"system",
"(",
")",
"if",
"system",
"==",
"'Windows'",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'APPDATA'",
")",
",",
"'mxnet... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/base.py#L59-L68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.