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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VladyslavUsenko/basalt-mirror | 6d55fdab9ff2e6901dbcab634cf5025c58ad7371 | python/basalt/experiments.py | python | Experiment.sequences | (self, filter_regex=None) | return list of sequence names found for this experiment
:param filter_regex: if provided, return only they sequences that match the regex | return list of sequence names found for this experiment
:param filter_regex: if provided, return only they sequences that match the regex | [
"return",
"list",
"of",
"sequence",
"names",
"found",
"for",
"this",
"experiment",
":",
"param",
"filter_regex",
":",
"if",
"provided",
"return",
"only",
"they",
"sequences",
"that",
"match",
"the",
"regex"
] | def sequences(self, filter_regex=None):
"""return list of sequence names found for this experiment
:param filter_regex: if provided, return only they sequences that match the regex
"""
if filter_regex is None:
return self.runs.keys()
else:
return ... | [
"def",
"sequences",
"(",
"self",
",",
"filter_regex",
"=",
"None",
")",
":",
"if",
"filter_regex",
"is",
"None",
":",
"return",
"self",
".",
"runs",
".",
"keys",
"(",
")",
"else",
":",
"return",
"[",
"k",
"for",
"k",
"in",
"self",
".",
"runs",
".",... | https://github.com/VladyslavUsenko/basalt-mirror/blob/6d55fdab9ff2e6901dbcab634cf5025c58ad7371/python/basalt/experiments.py#L121-L129 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | AutoBufferedPaintDC.__init__ | (self, *args, **kwargs) | __init__(self, Window win) -> AutoBufferedPaintDC
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory` | __init__(self, Window win) -> AutoBufferedPaintDC | [
"__init__",
"(",
"self",
"Window",
"win",
")",
"-",
">",
"AutoBufferedPaintDC"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, Window win) -> AutoBufferedPaintDC
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory`
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"AutoBufferedPaintDC_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_AutoBufferedPaintDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5307-L5317 | ||
leanprover/lean | 72a965986fa5aeae54062e98efb3140b2c4e79fd | src/cmake/Modules/cpplint.py | python | FindNextMatchingAngleBracket | (clean_lines, linenum, init_suffix) | return True | Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a matching bracket exists. | Find the corresponding > to close a template. | [
"Find",
"the",
"corresponding",
">",
"to",
"close",
"a",
"template",
"."
] | def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix):
"""Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a ... | [
"def",
"FindNextMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_suffix",
")",
":",
"line",
"=",
"init_suffix",
"nesting_stack",
"=",
"[",
"'<'",
"]",
"while",
"True",
":",
"# Find the next operator that can tell us whether < is used as an",
"# openin... | https://github.com/leanprover/lean/blob/72a965986fa5aeae54062e98efb3140b2c4e79fd/src/cmake/Modules/cpplint.py#L2149-L2216 | |
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/msp_ss.py | python | BootStrapLoader.actionChangeBaudrate | (self, baudrate=9600) | change baudrate. first the command is sent, then the comm
port is reprogrammed. only possible with newer MSP430-BSL versions.
(ROM >=1.6, downloadable >=1.5) | change baudrate. first the command is sent, then the comm
port is reprogrammed. only possible with newer MSP430-BSL versions.
(ROM >=1.6, downloadable >=1.5) | [
"change",
"baudrate",
".",
"first",
"the",
"command",
"is",
"sent",
"then",
"the",
"comm",
"port",
"is",
"reprogrammed",
".",
"only",
"possible",
"with",
"newer",
"MSP430",
"-",
"BSL",
"versions",
".",
"(",
"ROM",
">",
"=",
"1",
".",
"6",
"downloadable",... | def actionChangeBaudrate(self, baudrate=9600):
"""change baudrate. first the command is sent, then the comm
port is reprogrammed. only possible with newer MSP430-BSL versions.
(ROM >=1.6, downloadable >=1.5)"""
try:
baudconfigs = bauratetable[self.cpu]
except KeyError:
... | [
"def",
"actionChangeBaudrate",
"(",
"self",
",",
"baudrate",
"=",
"9600",
")",
":",
"try",
":",
"baudconfigs",
"=",
"bauratetable",
"[",
"self",
".",
"cpu",
"]",
"except",
"KeyError",
":",
"raise",
"ValueError",
"(",
"\"unknown CPU type %s, can't switch baudrate\"... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/msp_ss.py#L1173-L1192 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/__init__.py | python | Node.build | (self, **kw) | Actually build the node.
This is called by the Taskmaster after it's decided that the
Node is out-of-date and must be rebuilt, and after the prepare()
method has gotten everything, uh, prepared.
This method is called from multiple threads in a parallel build,
so only do thread ... | Actually build the node. | [
"Actually",
"build",
"the",
"node",
"."
] | def build(self, **kw):
"""Actually build the node.
This is called by the Taskmaster after it's decided that the
Node is out-of-date and must be rebuilt, and after the prepare()
method has gotten everything, uh, prepared.
This method is called from multiple threads in a parallel... | [
"def",
"build",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"try",
":",
"self",
".",
"get_executor",
"(",
")",
"(",
"self",
",",
"*",
"*",
"kw",
")",
"except",
"SCons",
".",
"Errors",
".",
"BuildError",
"as",
"e",
":",
"e",
".",
"node",
"=",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/__init__.py#L753-L769 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetCflagsObjCC | (self, configname) | return cflags_objcc | Returns flags that need to be added to .mm compilations. | Returns flags that need to be added to .mm compilations. | [
"Returns",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
".",
"mm",
"compilations",
"."
] | def GetCflagsObjCC(self, configname):
"""Returns flags that need to be added to .mm compilations."""
self.configname = configname
cflags_objcc = []
self._AddObjectiveCGarbageCollectionFlags(cflags_objcc)
if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'):
cflags_objcc.append('-fobj... | [
"def",
"GetCflagsObjCC",
"(",
"self",
",",
"configname",
")",
":",
"self",
".",
"configname",
"=",
"configname",
"cflags_objcc",
"=",
"[",
"]",
"self",
".",
"_AddObjectiveCGarbageCollectionFlags",
"(",
"cflags_objcc",
")",
"if",
"self",
".",
"_Test",
"(",
"'GC... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L400-L408 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | TranslationUnit.save | (self, filename) | Saves the TranslationUnit to a file.
This is equivalent to passing -emit-ast to the clang frontend. The
saved file can be loaded back into a TranslationUnit. Or, if it
corresponds to a header, it can be used as a pre-compiled header file.
If an error occurs while saving, a TranslationU... | Saves the TranslationUnit to a file. | [
"Saves",
"the",
"TranslationUnit",
"to",
"a",
"file",
"."
] | def save(self, filename):
"""Saves the TranslationUnit to a file.
This is equivalent to passing -emit-ast to the clang frontend. The
saved file can be loaded back into a TranslationUnit. Or, if it
corresponds to a header, it can be used as a pre-compiled header file.
If an erro... | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"options",
"=",
"conf",
".",
"lib",
".",
"clang_defaultSaveOptions",
"(",
"self",
")",
"result",
"=",
"int",
"(",
"conf",
".",
"lib",
".",
"clang_saveTranslationUnit",
"(",
"self",
",",
"fspath",
"("... | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L3012-L3032 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | generateKScript | (filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript) | Generate a random Kaleidoscope script based on the given parameters | Generate a random Kaleidoscope script based on the given parameters | [
"Generate",
"a",
"random",
"Kaleidoscope",
"script",
"based",
"on",
"the",
"given",
"parameters"
] | def generateKScript(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript):
""" Generate a random Kaleidoscope script based on the given parameters """
print("Generating " + filename)
print(" %d functions, %d elements per function, %d functions between execution" %
(n... | [
"def",
"generateKScript",
"(",
"filename",
",",
"numFuncs",
",",
"elementsPerFunc",
",",
"funcsBetweenExec",
",",
"callWeighting",
",",
"timingScript",
")",
":",
"print",
"(",
"\"Generating \"",
"+",
"filename",
")",
"print",
"(",
"\" %d functions, %d elements per fu... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L176-L206 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | onnxruntime/python/tools/transformers/gpt2_beamsearch_helper.py | python | Gpt2BeamSearchHelper.prepare_io_binding | (ort_session,
input_ids,
position_ids,
attention_mask,
past,
output_buffers,
output_shapes,
beam_select_idx=None,
... | return io_binding | Returnas IO binding object for a session. | Returnas IO binding object for a session. | [
"Returnas",
"IO",
"binding",
"object",
"for",
"a",
"session",
"."
] | def prepare_io_binding(ort_session,
input_ids,
position_ids,
attention_mask,
past,
output_buffers,
output_shapes,
beam_select_idx=N... | [
"def",
"prepare_io_binding",
"(",
"ort_session",
",",
"input_ids",
",",
"position_ids",
",",
"attention_mask",
",",
"past",
",",
"output_buffers",
",",
"output_shapes",
",",
"beam_select_idx",
"=",
"None",
",",
"input_log_probs",
"=",
"None",
",",
"input_unfinished_... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/transformers/gpt2_beamsearch_helper.py#L686-L819 | |
xenia-project/xenia | 9b1fdac98665ac091b9660a5d0fbb259ed79e578 | third_party/google-styleguide/cpplint/cpplint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matching parentheses.
Ideally we would want to index all... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time match... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"(",
"line",
"[",
"pos",
"]",
"not",
"in",
"'({[<'",
")",
"or",
"Match",
"(",
"r'<[<=]'",
",",
"... | https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L1348-L1389 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/util.py | python | execute | (func, args, msg=None, verbose=0, dry_run=0) | Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is supply the
function to call and an argument tuple for it (to e... | Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is supply the
function to call and an argument tuple for it (to e... | [
"Perform",
"some",
"action",
"that",
"affects",
"the",
"outside",
"world",
"(",
"eg",
".",
"by",
"writing",
"to",
"the",
"filesystem",
")",
".",
"Such",
"actions",
"are",
"special",
"because",
"they",
"are",
"disabled",
"by",
"the",
"dry_run",
"flag",
".",... | def execute (func, args, msg=None, verbose=0, dry_run=0):
"""Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is s... | [
"def",
"execute",
"(",
"func",
",",
"args",
",",
"msg",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"dry_run",
"=",
"0",
")",
":",
"if",
"msg",
"is",
"None",
":",
"msg",
"=",
"\"%s%r\"",
"%",
"(",
"func",
".",
"__name__",
",",
"args",
")",
"if"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/util.py#L315-L331 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/objpanel.py | python | DirpathWidgetContainer.define_widgetset | (self) | return [('name', self.create_namewidget(), wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL),
('value', self.create_valuewidget(), wx.EXPAND),
('unit', self.create_unitwidget(), wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL), ] | Generates the widgets representing this attribute. | Generates the widgets representing this attribute. | [
"Generates",
"the",
"widgets",
"representing",
"this",
"attribute",
"."
] | def define_widgetset(self):
"""
Generates the widgets representing this attribute.
"""
return [('name', self.create_namewidget(), wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL),
('value', self.create_valuewidget(), wx.EXPAND),
('unit', self.create_unit... | [
"def",
"define_widgetset",
"(",
"self",
")",
":",
"return",
"[",
"(",
"'name'",
",",
"self",
".",
"create_namewidget",
"(",
")",
",",
"wx",
".",
"ALIGN_RIGHT",
"|",
"wx",
".",
"ALIGN_CENTER_VERTICAL",
")",
",",
"(",
"'value'",
",",
"self",
".",
"create_v... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L1608-L1614 | |
traveller59/spconv | 647927ce6b64dc51fbec4eb50c7194f8ca5007e5 | spconv/pytorch/core.py | python | SparseConvTensor.__init__ | (self,
features: torch.Tensor,
indices: torch.Tensor,
spatial_shape: Union[List[int], np.ndarray],
batch_size: int,
grid: Optional[torch.Tensor] = None,
voxel_num: Optional[torch.Tensor] = None,
indice... | Args:
features: [num_points, num_features] feature tensor
indices: [num_points, ndim + 1] indice tensor. batch index saved in indices[:, 0]
spatial_shape: spatial shape of your sparse data
batch_size: batch size of your sparse data
grid: pre-allocated grid ten... | Args:
features: [num_points, num_features] feature tensor
indices: [num_points, ndim + 1] indice tensor. batch index saved in indices[:, 0]
spatial_shape: spatial shape of your sparse data
batch_size: batch size of your sparse data
grid: pre-allocated grid ten... | [
"Args",
":",
"features",
":",
"[",
"num_points",
"num_features",
"]",
"feature",
"tensor",
"indices",
":",
"[",
"num_points",
"ndim",
"+",
"1",
"]",
"indice",
"tensor",
".",
"batch",
"index",
"saved",
"in",
"indices",
"[",
":",
"0",
"]",
"spatial_shape",
... | def __init__(self,
features: torch.Tensor,
indices: torch.Tensor,
spatial_shape: Union[List[int], np.ndarray],
batch_size: int,
grid: Optional[torch.Tensor] = None,
voxel_num: Optional[torch.Tensor] = None,
... | [
"def",
"__init__",
"(",
"self",
",",
"features",
":",
"torch",
".",
"Tensor",
",",
"indices",
":",
"torch",
".",
"Tensor",
",",
"spatial_shape",
":",
"Union",
"[",
"List",
"[",
"int",
"]",
",",
"np",
".",
"ndarray",
"]",
",",
"batch_size",
":",
"int"... | https://github.com/traveller59/spconv/blob/647927ce6b64dc51fbec4eb50c7194f8ca5007e5/spconv/pytorch/core.py#L124-L168 | ||
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | scripts/git/cpplint.py | python | FileInfo.Extension | (self) | return self.Split()[2] | File extension - text following the final period. | File extension - text following the final period. | [
"File",
"extension",
"-",
"text",
"following",
"the",
"final",
"period",
"."
] | def Extension(self):
"""File extension - text following the final period."""
return self.Split()[2] | [
"def",
"Extension",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"2",
"]"
] | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L1096-L1098 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py | python | _format_elemcreate | (etype, script=False, *args, **kw) | return spec, opts | Formats args and kw according to the given element factory etype. | Formats args and kw according to the given element factory etype. | [
"Formats",
"args",
"and",
"kw",
"according",
"to",
"the",
"given",
"element",
"factory",
"etype",
"."
] | def _format_elemcreate(etype, script=False, *args, **kw):
"""Formats args and kw according to the given element factory etype."""
spec = None
opts = ()
if etype in ("image", "vsapi"):
if etype == "image": # define an element based on an image
# first arg should be the default image n... | [
"def",
"_format_elemcreate",
"(",
"etype",
",",
"script",
"=",
"False",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"spec",
"=",
"None",
"opts",
"=",
"(",
")",
"if",
"etype",
"in",
"(",
"\"image\"",
",",
"\"vsapi\"",
")",
":",
"if",
"etype",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L117-L152 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | ParseResults.dump | (self, indent='', depth=0, full=True) | return "".join(out) | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data.
Example::
integer = Word(nums)
date_str = integer("year") + '/' + integer("month") + '/' + i... | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data. | [
"Diagnostic",
"method",
"for",
"listing",
"out",
"the",
"contents",
"of",
"a",
"C",
"{",
"ParseResults",
"}",
".",
"Accepts",
"an",
"optional",
"C",
"{",
"indent",
"}",
"argument",
"so",
"that",
"this",
"string",
"can",
"be",
"embedded",
"in",
"a",
"nest... | def dump(self, indent='', depth=0, full=True):
"""
Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data.
Example::
integer = Word(nums)
... | [
"def",
"dump",
"(",
"self",
",",
"indent",
"=",
"''",
",",
"depth",
"=",
"0",
",",
"full",
"=",
"True",
")",
":",
"out",
"=",
"[",
"]",
"NL",
"=",
"'\\n'",
"out",
".",
"append",
"(",
"indent",
"+",
"_ustr",
"(",
"self",
".",
"asList",
"(",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L871-L914 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/meta/bytecodetools/pyc_file.py | python | extract | (binary) | return modtime, code | Extract a code object from a binary pyc file.
:param binary: a sequence of bytes from a pyc file. | Extract a code object from a binary pyc file.
:param binary: a sequence of bytes from a pyc file. | [
"Extract",
"a",
"code",
"object",
"from",
"a",
"binary",
"pyc",
"file",
".",
":",
"param",
"binary",
":",
"a",
"sequence",
"of",
"bytes",
"from",
"a",
"pyc",
"file",
"."
] | def extract(binary):
'''
Extract a code object from a binary pyc file.
:param binary: a sequence of bytes from a pyc file.
'''
if len(binary) <= 8:
raise Exception("Binary pyc must be greater than 8 bytes (got %i)" % len(binary))
magic = binary[:4]
MAGIC = get_magic()
... | [
"def",
"extract",
"(",
"binary",
")",
":",
"if",
"len",
"(",
"binary",
")",
"<=",
"8",
":",
"raise",
"Exception",
"(",
"\"Binary pyc must be greater than 8 bytes (got %i)\"",
"%",
"len",
"(",
"binary",
")",
")",
"magic",
"=",
"binary",
"[",
":",
"4",
"]",
... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/meta/bytecodetools/pyc_file.py#L12-L31 | |
dscharrer/innoextract | 5519d364cc8898f906f6285d81a87ab8c5469cde | cmake/cpplint.py | python | CleansedLines._CollapseStrings | (elided) | return elided | Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings. | Collapses strings and chars on a line to simple "" or '' blocks. | [
"Collapses",
"strings",
"and",
"chars",
"on",
"a",
"line",
"to",
"simple",
"or",
"blocks",
"."
] | def _CollapseStrings(elided):
"""Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings.
"""
if not _RE_PATTERN_INCLUDE.matc... | [
"def",
"_CollapseStrings",
"(",
"elided",
")",
":",
"if",
"not",
"_RE_PATTERN_INCLUDE",
".",
"match",
"(",
"elided",
")",
":",
"# Remove escaped characters first to make quote/single quote collapsing",
"# basic. Things that look like escaped characters shouldn't occur",
"# outside... | https://github.com/dscharrer/innoextract/blob/5519d364cc8898f906f6285d81a87ab8c5469cde/cmake/cpplint.py#L1010-L1028 | |
zerollzeng/tiny-tensorrt | e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2 | third_party/pybind11/tools/clang/cindex.py | python | Config.set_compatibility_check | (check_status) | Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading the bindings. This check
will throw an exception,... | Perform compatibility check when loading libclang | [
"Perform",
"compatibility",
"check",
"when",
"loading",
"libclang"
] | def set_compatibility_check(check_status):
""" Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading th... | [
"def",
"set_compatibility_check",
"(",
"check_status",
")",
":",
"if",
"Config",
".",
"loaded",
":",
"raise",
"Exception",
"(",
"\"compatibility_check must be set before before \"",
"\"using any other functionalities in libclang.\"",
")",
"Config",
".",
"compatibility_check",
... | https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L3789-L3810 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/nntplib.py | python | NNTP.getline | (self) | return line | Internal: return one line from the server, stripping CRLF.
Raise EOFError if the connection is closed. | Internal: return one line from the server, stripping CRLF.
Raise EOFError if the connection is closed. | [
"Internal",
":",
"return",
"one",
"line",
"from",
"the",
"server",
"stripping",
"CRLF",
".",
"Raise",
"EOFError",
"if",
"the",
"connection",
"is",
"closed",
"."
] | def getline(self):
"""Internal: return one line from the server, stripping CRLF.
Raise EOFError if the connection is closed."""
line = self.file.readline(_MAXLINE + 1)
if len(line) > _MAXLINE:
raise NNTPDataError('line too long')
if self.debugging > 1:
pri... | [
"def",
"getline",
"(",
"self",
")",
":",
"line",
"=",
"self",
".",
"file",
".",
"readline",
"(",
"_MAXLINE",
"+",
"1",
")",
"if",
"len",
"(",
"line",
")",
">",
"_MAXLINE",
":",
"raise",
"NNTPDataError",
"(",
"'line too long'",
")",
"if",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/nntplib.py#L207-L218 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/nest.py | python | flatten | (structure, expand_composites=False) | return _pywrap_tensorflow.Flatten(structure, expand_composites) | Returns a flat list from a given nested structure.
If nest is not a sequence, tuple, or dict, then returns a single-element list:
[nest].
In the case of dict instances, the sequence consists of the values, sorted by
key to ensure deterministic behavior. This is true also for OrderedDict
instances: their seq... | Returns a flat list from a given nested structure. | [
"Returns",
"a",
"flat",
"list",
"from",
"a",
"given",
"nested",
"structure",
"."
] | def flatten(structure, expand_composites=False):
"""Returns a flat list from a given nested structure.
If nest is not a sequence, tuple, or dict, then returns a single-element list:
[nest].
In the case of dict instances, the sequence consists of the values, sorted by
key to ensure deterministic behavior. Th... | [
"def",
"flatten",
"(",
"structure",
",",
"expand_composites",
"=",
"False",
")",
":",
"return",
"_pywrap_tensorflow",
".",
"Flatten",
"(",
"structure",
",",
"expand_composites",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/nest.py#L233-L263 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/modtool/core/rm.py | python | ModToolRemove._run_subdir | (self, path, globs, makefile_vars, cmakeedit_func=None) | return files_deleted | Delete all files that match a certain pattern in path.
path - The directory in which this will take place
globs - A tuple of standard UNIX globs of files to delete (e.g. *.yml)
makefile_vars - A tuple with a list of CMakeLists.txt-variables which
may contain references to... | Delete all files that match a certain pattern in path.
path - The directory in which this will take place
globs - A tuple of standard UNIX globs of files to delete (e.g. *.yml)
makefile_vars - A tuple with a list of CMakeLists.txt-variables which
may contain references to... | [
"Delete",
"all",
"files",
"that",
"match",
"a",
"certain",
"pattern",
"in",
"path",
".",
"path",
"-",
"The",
"directory",
"in",
"which",
"this",
"will",
"take",
"place",
"globs",
"-",
"A",
"tuple",
"of",
"standard",
"UNIX",
"globs",
"of",
"files",
"to",
... | def _run_subdir(self, path, globs, makefile_vars, cmakeedit_func=None):
""" Delete all files that match a certain pattern in path.
path - The directory in which this will take place
globs - A tuple of standard UNIX globs of files to delete (e.g. *.yml)
makefile_vars - A tuple with a list... | [
"def",
"_run_subdir",
"(",
"self",
",",
"path",
",",
"globs",
",",
"makefile_vars",
",",
"cmakeedit_func",
"=",
"None",
")",
":",
"if",
"self",
".",
"cli",
":",
"from",
".",
".",
"cli",
"import",
"cli_input",
"# 1. Create a filtered list",
"files",
"=",
"[... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/core/rm.py#L135-L207 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/ultratb.py | python | VerboseTB.format_records | (self, records, last_unique, recursion_repeat) | return frames | Format the stack frames of the traceback | Format the stack frames of the traceback | [
"Format",
"the",
"stack",
"frames",
"of",
"the",
"traceback"
] | def format_records(self, records, last_unique, recursion_repeat):
"""Format the stack frames of the traceback"""
frames = []
skipped = 0
lastrecord = len(records) - 1
for i, r in enumerate(records[: last_unique + recursion_repeat + 1]):
if self.skip_hidden:
... | [
"def",
"format_records",
"(",
"self",
",",
"records",
",",
"last_unique",
",",
"recursion_repeat",
")",
":",
"frames",
"=",
"[",
"]",
"skipped",
"=",
"0",
"lastrecord",
"=",
"len",
"(",
"records",
")",
"-",
"1",
"for",
"i",
",",
"r",
"in",
"enumerate",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/ultratb.py#L815-L849 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/util.py | python | arrayFromMarkupsControlPoints | (markupsNode, world = False) | return narray | Return control point positions of a markups node as rows in a numpy array (of size Nx3).
:param world: if set to True then the control points coordinates are returned in world coordinate system
(effect of parent transform to the node is applied).
The returned array is just a copy and so any modification in the ... | Return control point positions of a markups node as rows in a numpy array (of size Nx3).
:param world: if set to True then the control points coordinates are returned in world coordinate system
(effect of parent transform to the node is applied).
The returned array is just a copy and so any modification in the ... | [
"Return",
"control",
"point",
"positions",
"of",
"a",
"markups",
"node",
"as",
"rows",
"in",
"a",
"numpy",
"array",
"(",
"of",
"size",
"Nx3",
")",
".",
":",
"param",
"world",
":",
"if",
"set",
"to",
"True",
"then",
"the",
"control",
"points",
"coordina... | def arrayFromMarkupsControlPoints(markupsNode, world = False):
"""Return control point positions of a markups node as rows in a numpy array (of size Nx3).
:param world: if set to True then the control points coordinates are returned in world coordinate system
(effect of parent transform to the node is applied).... | [
"def",
"arrayFromMarkupsControlPoints",
"(",
"markupsNode",
",",
"world",
"=",
"False",
")",
":",
"numberOfControlPoints",
"=",
"markupsNode",
".",
"GetNumberOfControlPoints",
"(",
")",
"import",
"numpy",
"as",
"np",
"narray",
"=",
"np",
".",
"zeros",
"(",
"[",
... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/util.py#L1223-L1238 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py | python | _ServiceStubBuilder.__init__ | (self, service_descriptor) | Initializes an instance of the service stub class builder.
Args:
service_descriptor: ServiceDescriptor to use when constructing the
stub class. | Initializes an instance of the service stub class builder. | [
"Initializes",
"an",
"instance",
"of",
"the",
"service",
"stub",
"class",
"builder",
"."
] | def __init__(self, service_descriptor):
"""Initializes an instance of the service stub class builder.
Args:
service_descriptor: ServiceDescriptor to use when constructing the
stub class.
"""
self.descriptor = service_descriptor | [
"def",
"__init__",
"(",
"self",
",",
"service_descriptor",
")",
":",
"self",
".",
"descriptor",
"=",
"service_descriptor"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py#L242-L249 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py | python | LoadEmptyVesuvio._load_ip_file | (self, workspace, ip_file) | return update_inst.getProperty("Workspace").value | If provided, load the instrument parameter file into the result workspace.
@param ip_file A string containing the full path to an IP file
@return Updated workspace | If provided, load the instrument parameter file into the result workspace. | [
"If",
"provided",
"load",
"the",
"instrument",
"parameter",
"file",
"into",
"the",
"result",
"workspace",
"."
] | def _load_ip_file(self, workspace, ip_file):
"""
If provided, load the instrument parameter file into the result workspace.
@param ip_file A string containing the full path to an IP file
@return Updated workspace
"""
ip_header = self._get_header_format(ip_file)
#... | [
"def",
"_load_ip_file",
"(",
"self",
",",
"workspace",
",",
"ip_file",
")",
":",
"ip_header",
"=",
"self",
".",
"_get_header_format",
"(",
"ip_file",
")",
"# More verbose until the child algorithm stuff is sorted",
"update_inst",
"=",
"self",
".",
"createChildAlgorithm"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py#L85-L103 | |
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/usb/_objfinalizer.py | python | _AutoFinalizedObjectBase._finalize_object | (self) | Actually finalizes the object (frees allocated resources etc.).
Returns: None
Derived classes should implement this. | Actually finalizes the object (frees allocated resources etc.). | [
"Actually",
"finalizes",
"the",
"object",
"(",
"frees",
"allocated",
"resources",
"etc",
".",
")",
"."
] | def _finalize_object(self):
"""Actually finalizes the object (frees allocated resources etc.).
Returns: None
Derived classes should implement this.
"""
pass | [
"def",
"_finalize_object",
"(",
"self",
")",
":",
"pass"
] | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/_objfinalizer.py#L44-L51 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_parkingarea.py | python | ParkingAreaDomain.getVehicleCount | (self, stopID) | return self._getUniversal(tc.VAR_STOP_STARTING_VEHICLES_NUMBER, stopID) | getParkingAreaWaiting() -> integer
Get the total number of vehicles stopped at the named parking area. | getParkingAreaWaiting() -> integer
Get the total number of vehicles stopped at the named parking area. | [
"getParkingAreaWaiting",
"()",
"-",
">",
"integer",
"Get",
"the",
"total",
"number",
"of",
"vehicles",
"stopped",
"at",
"the",
"named",
"parking",
"area",
"."
] | def getVehicleCount(self, stopID):
"""getParkingAreaWaiting() -> integer
Get the total number of vehicles stopped at the named parking area.
"""
return self._getUniversal(tc.VAR_STOP_STARTING_VEHICLES_NUMBER, stopID) | [
"def",
"getVehicleCount",
"(",
"self",
",",
"stopID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_STOP_STARTING_VEHICLES_NUMBER",
",",
"stopID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_parkingarea.py#L57-L61 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/symbolic_atoms.py | python | SymbolicAtoms.signatures | (self) | return [ (_to_str(_lib.clingo_signature_name(c_sig)),
_lib.clingo_signature_arity(c_sig),
_lib.clingo_signature_is_positive(c_sig)) for c_sig in p_sigs ] | The list of predicate signatures occurring in the program.
The Boolean indicates the sign of the signature. | The list of predicate signatures occurring in the program. | [
"The",
"list",
"of",
"predicate",
"signatures",
"occurring",
"in",
"the",
"program",
"."
] | def signatures(self) -> List[Tuple[str,int,bool]]:
'''
The list of predicate signatures occurring in the program.
The Boolean indicates the sign of the signature.
'''
size = _c_call('size_t', _lib.clingo_symbolic_atoms_signatures_size, self._rep)
p_sigs = _ffi.new('clin... | [
"def",
"signatures",
"(",
"self",
")",
"->",
"List",
"[",
"Tuple",
"[",
"str",
",",
"int",
",",
"bool",
"]",
"]",
":",
"size",
"=",
"_c_call",
"(",
"'size_t'",
",",
"_lib",
".",
"clingo_symbolic_atoms_signatures_size",
",",
"self",
".",
"_rep",
")",
"p... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/symbolic_atoms.py#L154-L167 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/imaplib.py | python | ParseFlags | (resp) | return tuple(mo.group('flags').split()) | Convert IMAP4 flags response to python tuple. | Convert IMAP4 flags response to python tuple. | [
"Convert",
"IMAP4",
"flags",
"response",
"to",
"python",
"tuple",
"."
] | def ParseFlags(resp):
"""Convert IMAP4 flags response to python tuple."""
mo = Flags.match(resp)
if not mo:
return ()
return tuple(mo.group('flags').split()) | [
"def",
"ParseFlags",
"(",
"resp",
")",
":",
"mo",
"=",
"Flags",
".",
"match",
"(",
"resp",
")",
"if",
"not",
"mo",
":",
"return",
"(",
")",
"return",
"tuple",
"(",
"mo",
".",
"group",
"(",
"'flags'",
")",
".",
"split",
"(",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/imaplib.py#L1371-L1379 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlWordCell.SetPreviousWord | (*args, **kwargs) | return _html.HtmlWordCell_SetPreviousWord(*args, **kwargs) | SetPreviousWord(self, HtmlWordCell cell) | SetPreviousWord(self, HtmlWordCell cell) | [
"SetPreviousWord",
"(",
"self",
"HtmlWordCell",
"cell",
")"
] | def SetPreviousWord(*args, **kwargs):
"""SetPreviousWord(self, HtmlWordCell cell)"""
return _html.HtmlWordCell_SetPreviousWord(*args, **kwargs) | [
"def",
"SetPreviousWord",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWordCell_SetPreviousWord",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L779-L781 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MouseState.SetRightDown | (*args, **kwargs) | return _core_.MouseState_SetRightDown(*args, **kwargs) | SetRightDown(self, bool down) | SetRightDown(self, bool down) | [
"SetRightDown",
"(",
"self",
"bool",
"down",
")"
] | def SetRightDown(*args, **kwargs):
"""SetRightDown(self, bool down)"""
return _core_.MouseState_SetRightDown(*args, **kwargs) | [
"def",
"SetRightDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseState_SetRightDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L4502-L4504 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/logging_ops.py | python | Print | (input_, data, message=None, first_n=None, summarize=None,
name=None) | return gen_logging_ops._print(input_, data, message, first_n, summarize, name) | Prints a list of tensors.
This is an identity op with the side effect of printing `data` when
evaluating.
Args:
input_: A tensor passed through this op.
data: A list of tensors to print out when op is evaluated.
message: A string, prefix of the error message.
first_n: Only log `first_n` number o... | Prints a list of tensors. | [
"Prints",
"a",
"list",
"of",
"tensors",
"."
] | def Print(input_, data, message=None, first_n=None, summarize=None,
name=None):
"""Prints a list of tensors.
This is an identity op with the side effect of printing `data` when
evaluating.
Args:
input_: A tensor passed through this op.
data: A list of tensors to print out when op is evaluate... | [
"def",
"Print",
"(",
"input_",
",",
"data",
",",
"message",
"=",
"None",
",",
"first_n",
"=",
"None",
",",
"summarize",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"gen_logging_ops",
".",
"_print",
"(",
"input_",
",",
"data",
",",
"mes... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/logging_ops.py#L64-L84 | |
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | python/caffe/io.py | python | Transformer.set_raw_scale | (self, in_, scale) | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
Parameters
----------
in_ : which input ... | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255. | [
"Set",
"the",
"scale",
"of",
"raw",
"features",
"s",
".",
"t",
".",
"the",
"input",
"blob",
"=",
"input",
"*",
"scale",
".",
"While",
"Python",
"represents",
"images",
"in",
"[",
"0",
"1",
"]",
"certain",
"Caffe",
"models",
"like",
"CaffeNet",
"and",
... | def set_raw_scale(self, in_, scale):
"""
Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
... | [
"def",
"set_raw_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"raw_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/io.py#L217-L230 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PyScrolledWindow.DoGetVirtualSize | (*args, **kwargs) | return _windows_.PyScrolledWindow_DoGetVirtualSize(*args, **kwargs) | DoGetVirtualSize(self) -> Size | DoGetVirtualSize(self) -> Size | [
"DoGetVirtualSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def DoGetVirtualSize(*args, **kwargs):
"""DoGetVirtualSize(self) -> Size"""
return _windows_.PyScrolledWindow_DoGetVirtualSize(*args, **kwargs) | [
"def",
"DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyScrolledWindow_DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4540-L4542 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | DC.MinY | (*args, **kwargs) | return _gdi_.DC_MinY(*args, **kwargs) | MinY(self) -> int
Gets the minimum vertical extent used in drawing commands so far. | MinY(self) -> int | [
"MinY",
"(",
"self",
")",
"-",
">",
"int"
] | def MinY(*args, **kwargs):
"""
MinY(self) -> int
Gets the minimum vertical extent used in drawing commands so far.
"""
return _gdi_.DC_MinY(*args, **kwargs) | [
"def",
"MinY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_MinY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4587-L4593 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommandReturnObject.GetStatus | (self) | return _lldb.SBCommandReturnObject_GetStatus(self) | GetStatus(SBCommandReturnObject self) -> lldb::ReturnStatus | GetStatus(SBCommandReturnObject self) -> lldb::ReturnStatus | [
"GetStatus",
"(",
"SBCommandReturnObject",
"self",
")",
"-",
">",
"lldb",
"::",
"ReturnStatus"
] | def GetStatus(self):
"""GetStatus(SBCommandReturnObject self) -> lldb::ReturnStatus"""
return _lldb.SBCommandReturnObject_GetStatus(self) | [
"def",
"GetStatus",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBCommandReturnObject_GetStatus",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2915-L2917 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/count-unhappy-friends.py | python | Solution.unhappyFriends | (self, n, preferences, pairs) | return sum(any(friends[i][j] < friends[i][pairing[i]] and friends[j][i] < friends[j][pairing[j]]
for j in xrange(len(friends[i])) if j != i and j != pairing[i])
for i in xrange(len(friends))) | :type n: int
:type preferences: List[List[int]]
:type pairs: List[List[int]]
:rtype: int | :type n: int
:type preferences: List[List[int]]
:type pairs: List[List[int]]
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"type",
"preferences",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"type",
"pairs",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def unhappyFriends(self, n, preferences, pairs):
"""
:type n: int
:type preferences: List[List[int]]
:type pairs: List[List[int]]
:rtype: int
"""
friends = [[0]*n for _ in xrange(n)]
for i in xrange(len(preferences)):
for j in xrange(len(prefer... | [
"def",
"unhappyFriends",
"(",
"self",
",",
"n",
",",
"preferences",
",",
"pairs",
")",
":",
"friends",
"=",
"[",
"[",
"0",
"]",
"*",
"n",
"for",
"_",
"in",
"xrange",
"(",
"n",
")",
"]",
"for",
"i",
"in",
"xrange",
"(",
"len",
"(",
"preferences",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/count-unhappy-friends.py#L5-L21 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_json.py | python | JSONTableWriter.__init__ | (
self,
obj,
orient: Optional[str],
date_format: str,
double_precision: int,
ensure_ascii: bool,
date_unit: str,
index: bool,
default_handler: Optional[Callable[[Any], JSONSerializable]] = None,
indent: int = 0,
) | Adds a `schema` attribute with the Table Schema, resets
the index (can't do in caller, because the schema inference needs
to know what the index is, forces orient to records, and forces
date_format to 'iso'. | Adds a `schema` attribute with the Table Schema, resets
the index (can't do in caller, because the schema inference needs
to know what the index is, forces orient to records, and forces
date_format to 'iso'. | [
"Adds",
"a",
"schema",
"attribute",
"with",
"the",
"Table",
"Schema",
"resets",
"the",
"index",
"(",
"can",
"t",
"do",
"in",
"caller",
"because",
"the",
"schema",
"inference",
"needs",
"to",
"know",
"what",
"the",
"index",
"is",
"forces",
"orient",
"to",
... | def __init__(
self,
obj,
orient: Optional[str],
date_format: str,
double_precision: int,
ensure_ascii: bool,
date_unit: str,
index: bool,
default_handler: Optional[Callable[[Any], JSONSerializable]] = None,
indent: int = 0,
):
"... | [
"def",
"__init__",
"(",
"self",
",",
"obj",
",",
"orient",
":",
"Optional",
"[",
"str",
"]",
",",
"date_format",
":",
"str",
",",
"double_precision",
":",
"int",
",",
"ensure_ascii",
":",
"bool",
",",
"date_unit",
":",
"str",
",",
"index",
":",
"bool",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_json.py#L252-L321 | ||
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/debug_helper.py | python | DebugHelper.draw_arrow | (self, marker, lifetime, color) | draw arrow from ros marker | draw arrow from ros marker | [
"draw",
"arrow",
"from",
"ros",
"marker"
] | def draw_arrow(self, marker, lifetime, color):
"""
draw arrow from ros marker
"""
if marker.points:
if not len(marker.points) == 2:
rospy.logwarn(
"Drawing arrow from points requires two points. Received {}".format(
... | [
"def",
"draw_arrow",
"(",
"self",
",",
"marker",
",",
"lifetime",
",",
"color",
")",
":",
"if",
"marker",
".",
"points",
":",
"if",
"not",
"len",
"(",
"marker",
".",
"points",
")",
"==",
"2",
":",
"rospy",
".",
"logwarn",
"(",
"\"Drawing arrow from poi... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/debug_helper.py#L77-L107 | ||
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/bs4/dammit.py | python | EntitySubstitution.substitute_xml | (cls, value, make_quoted_attribute=False) | return value | Substitute XML entities for special XML characters.
:param value: A string to be substituted. The less-than sign
will become <, the greater-than sign will become >,
and any ampersands will become &. If you want ampersands
that appear to be part of an entity definition to... | Substitute XML entities for special XML characters. | [
"Substitute",
"XML",
"entities",
"for",
"special",
"XML",
"characters",
"."
] | def substitute_xml(cls, value, make_quoted_attribute=False):
"""Substitute XML entities for special XML characters.
:param value: A string to be substituted. The less-than sign
will become <, the greater-than sign will become >,
and any ampersands will become &. If you wan... | [
"def",
"substitute_xml",
"(",
"cls",
",",
"value",
",",
"make_quoted_attribute",
"=",
"False",
")",
":",
"# Escape angle brackets and ampersands.",
"value",
"=",
"cls",
".",
"AMPERSAND_OR_BRACKET",
".",
"sub",
"(",
"cls",
".",
"_substitute_xml_entity",
",",
"value",... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/bs4/dammit.py#L137-L155 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixlink.py | python | generate | (env) | Add Builders and construction variables for Visual Age linker to
an Environment. | Add Builders and construction variables for Visual Age linker to
an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"Visual",
"Age",
"linker",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""
Add Builders and construction variables for Visual Age linker to
an Environment.
"""
link.generate(env)
env['SMARTLINKFLAGS'] = smart_linkflags
env['LINKFLAGS'] = SCons.Util.CLVar('$SMARTLINKFLAGS')
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -qmkshr... | [
"def",
"generate",
"(",
"env",
")",
":",
"link",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'SMARTLINKFLAGS'",
"]",
"=",
"smart_linkflags",
"env",
"[",
"'LINKFLAGS'",
"]",
"=",
"SCons",
".",
"Util",
".",
"CLVar",
"(",
"'$SMARTLINKFLAGS'",
")",
"env",... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixlink.py#L51-L61 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/split_penalty.py | python | _SetStronglyConnected | (*nodes) | Set a STRONGLY_CONNECTED penalty annotation for the given nodes. | Set a STRONGLY_CONNECTED penalty annotation for the given nodes. | [
"Set",
"a",
"STRONGLY_CONNECTED",
"penalty",
"annotation",
"for",
"the",
"given",
"nodes",
"."
] | def _SetStronglyConnected(*nodes):
"""Set a STRONGLY_CONNECTED penalty annotation for the given nodes."""
for node in nodes:
_RecAnnotate(node, pytree_utils.Annotation.SPLIT_PENALTY,
STRONGLY_CONNECTED) | [
"def",
"_SetStronglyConnected",
"(",
"*",
"nodes",
")",
":",
"for",
"node",
"in",
"nodes",
":",
"_RecAnnotate",
"(",
"node",
",",
"pytree_utils",
".",
"Annotation",
".",
"SPLIT_PENALTY",
",",
"STRONGLY_CONNECTED",
")"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/split_penalty.py#L431-L435 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/layers/python/layers/layers.py | python | dropout | (inputs,
keep_prob=0.5,
noise_shape=None,
is_training=True,
outputs_collections=None,
scope=None) | Returns a dropout op applied to the input.
With probability `keep_prob`, outputs the input element scaled up by
`1 / keep_prob`, otherwise outputs `0`. The scaling is so that the expected
sum is unchanged.
Args:
inputs: The tensor to pass to the nn.dropout op.
keep_prob: A scalar `Tensor` with the sa... | Returns a dropout op applied to the input. | [
"Returns",
"a",
"dropout",
"op",
"applied",
"to",
"the",
"input",
"."
] | def dropout(inputs,
keep_prob=0.5,
noise_shape=None,
is_training=True,
outputs_collections=None,
scope=None):
"""Returns a dropout op applied to the input.
With probability `keep_prob`, outputs the input element scaled up by
`1 / keep_prob`, otherwise o... | [
"def",
"dropout",
"(",
"inputs",
",",
"keep_prob",
"=",
"0.5",
",",
"noise_shape",
"=",
"None",
",",
"is_training",
"=",
"True",
",",
"outputs_collections",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/layers.py#L1374-L1410 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/caffe/extractors/native_caffe.py | python | blob_name | (i) | Implements legacy schema for blobs naming:
0-th blob is called 'weights'
1-th blob is called 'biases'
then, next blobs are called according to the new default schema
with 'custom_' prefix: custom_2, custom_3 and so on. | Implements legacy schema for blobs naming:
0-th blob is called 'weights'
1-th blob is called 'biases'
then, next blobs are called according to the new default schema
with 'custom_' prefix: custom_2, custom_3 and so on. | [
"Implements",
"legacy",
"schema",
"for",
"blobs",
"naming",
":",
"0",
"-",
"th",
"blob",
"is",
"called",
"weights",
"1",
"-",
"th",
"blob",
"is",
"called",
"biases",
"then",
"next",
"blobs",
"are",
"called",
"according",
"to",
"the",
"new",
"default",
"s... | def blob_name(i):
"""
Implements legacy schema for blobs naming:
0-th blob is called 'weights'
1-th blob is called 'biases'
then, next blobs are called according to the new default schema
with 'custom_' prefix: custom_2, custom_3 and so on.
"""
predefined_names = ['weights', 'bia... | [
"def",
"blob_name",
"(",
"i",
")",
":",
"predefined_names",
"=",
"[",
"'weights'",
",",
"'biases'",
"]",
"if",
"i",
"<",
"len",
"(",
"predefined_names",
")",
":",
"return",
"predefined_names",
"[",
"i",
"]",
"else",
":",
"return",
"'custom_{}'",
".",
"fo... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/caffe/extractors/native_caffe.py#L10-L22 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/perf/metrics/io.py | python | IOMetric.AddSummaryResults | (self, browser, results) | Add summary results to the results object. | Add summary results to the results object. | [
"Add",
"summary",
"results",
"to",
"the",
"results",
"object",
"."
] | def AddSummaryResults(self, browser, results):
"""Add summary results to the results object."""
io_stats = browser.io_stats
if not io_stats['Browser']:
return
def AddSummariesForProcessType(process_type_io, process_type_trace):
"""For a given process type, add all relevant summary results.
... | [
"def",
"AddSummaryResults",
"(",
"self",
",",
"browser",
",",
"results",
")",
":",
"io_stats",
"=",
"browser",
".",
"io_stats",
"if",
"not",
"io_stats",
"[",
"'Browser'",
"]",
":",
"return",
"def",
"AddSummariesForProcessType",
"(",
"process_type_io",
",",
"pr... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/io.py#L24-L60 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | KeyboardState.SetMetaDown | (*args, **kwargs) | return _core_.KeyboardState_SetMetaDown(*args, **kwargs) | SetMetaDown(self, bool down) | SetMetaDown(self, bool down) | [
"SetMetaDown",
"(",
"self",
"bool",
"down",
")"
] | def SetMetaDown(*args, **kwargs):
"""SetMetaDown(self, bool down)"""
return _core_.KeyboardState_SetMetaDown(*args, **kwargs) | [
"def",
"SetMetaDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyboardState_SetMetaDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L4392-L4394 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/tools/wrappers.py | python | ExternalProcess._receive | (self) | Wait for a message from the worker process and return its payload.
Raises:
Exception: An exception was raised inside the worker process.
KeyError: The reveived message is of an unknown type.
Returns:
Payload object of the message. | Wait for a message from the worker process and return its payload. | [
"Wait",
"for",
"a",
"message",
"from",
"the",
"worker",
"process",
"and",
"return",
"its",
"payload",
"."
] | def _receive(self):
"""Wait for a message from the worker process and return its payload.
Raises:
Exception: An exception was raised inside the worker process.
KeyError: The reveived message is of an unknown type.
Returns:
Payload object of the message.
"""
message, payload = sel... | [
"def",
"_receive",
"(",
"self",
")",
":",
"message",
",",
"payload",
"=",
"self",
".",
"_conn",
".",
"recv",
"(",
")",
"# Re-raise exceptions in the main process.",
"if",
"message",
"==",
"self",
".",
"_EXCEPTION",
":",
"stacktrace",
"=",
"payload",
"raise",
... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/wrappers.py#L418-L435 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/dataset/dataset.py | python | FileInstantDataset.init | (self, **kwargs) | should be called only once in user's python scripts to initialize setings of dataset instance | should be called only once in user's python scripts to initialize setings of dataset instance | [
"should",
"be",
"called",
"only",
"once",
"in",
"user",
"s",
"python",
"scripts",
"to",
"initialize",
"setings",
"of",
"dataset",
"instance"
] | def init(self, **kwargs):
"""
should be called only once in user's python scripts to initialize setings of dataset instance
"""
super(FileInstantDataset, self).init(**kwargs) | [
"def",
"init",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"FileInstantDataset",
",",
"self",
")",
".",
"init",
"(",
"*",
"*",
"kwargs",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/dataset/dataset.py#L1302-L1306 | ||
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | adodbapi/adodbapi.py | python | Connection._rollback | (self) | In case a database does provide transactions this method causes the the database to roll back to
the start of any pending transaction. Closing a connection without committing the changes first will
cause an implicit rollback to be performed.
If the database does not support the functionality re... | In case a database does provide transactions this method causes the the database to roll back to
the start of any pending transaction. Closing a connection without committing the changes first will
cause an implicit rollback to be performed. | [
"In",
"case",
"a",
"database",
"does",
"provide",
"transactions",
"this",
"method",
"causes",
"the",
"the",
"database",
"to",
"roll",
"back",
"to",
"the",
"start",
"of",
"any",
"pending",
"transaction",
".",
"Closing",
"a",
"connection",
"without",
"committing... | def _rollback(self):
"""In case a database does provide transactions this method causes the the database to roll back to
the start of any pending transaction. Closing a connection without committing the changes first will
cause an implicit rollback to be performed.
If the database does ... | [
"def",
"_rollback",
"(",
"self",
")",
":",
"self",
".",
"messages",
"=",
"[",
"]",
"if",
"(",
"self",
".",
"transaction_level",
")",
":",
"# trying to roll back with no open transaction causes an error",
"try",
":",
"self",
".",
"transaction_level",
"=",
"self",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/adodbapi/adodbapi.py#L409-L443 | ||
BVLC/caffe | 9b891540183ddc834a02b2bd81b31afae71b2153 | scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/scripts/cpp_lint.py#L2373-L2385 | |
Kitware/kwiver | 7ed70308905698b6e88d27ae3dc028c9b016ca0a | python/kwiver/vital/modules/loaders.py | python | ModuleLoader._findPluginFilePaths | (self, namespace) | Searches for modules in `namespace` that are reachable from the paths
defined in the `PYTHONPATH` environment variable.
Args:
namespace (str): the importable name of a python module or package
Yields:
str: mod_rel_path - the paths (relative to PYTHONPATH) of
... | Searches for modules in `namespace` that are reachable from the paths
defined in the `PYTHONPATH` environment variable. | [
"Searches",
"for",
"modules",
"in",
"namespace",
"that",
"are",
"reachable",
"from",
"the",
"paths",
"defined",
"in",
"the",
"PYTHONPATH",
"environment",
"variable",
"."
] | def _findPluginFilePaths(self, namespace):
"""
Searches for modules in `namespace` that are reachable from the paths
defined in the `PYTHONPATH` environment variable.
Args:
namespace (str): the importable name of a python module or package
Yields:
str: m... | [
"def",
"_findPluginFilePaths",
"(",
"self",
",",
"namespace",
")",
":",
"already_seen",
"=",
"set",
"(",
")",
"py_exts",
"=",
"[",
"'.py'",
",",
"'.pyc'",
",",
"'.pyo'",
"]",
"for",
"ext",
"in",
"py_exts",
":",
"if",
"namespace",
".",
"endswith",
"(",
... | https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/vital/modules/loaders.py#L87-L143 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/build/vs_toolchain.py | python | _CopyRuntime2015 | (target_dir, source_dir, dll_pattern) | Copy both the msvcp and vccorlib runtime DLLs, only if the target doesn't
exist, but the target directory does exist. | Copy both the msvcp and vccorlib runtime DLLs, only if the target doesn't
exist, but the target directory does exist. | [
"Copy",
"both",
"the",
"msvcp",
"and",
"vccorlib",
"runtime",
"DLLs",
"only",
"if",
"the",
"target",
"doesn",
"t",
"exist",
"but",
"the",
"target",
"directory",
"does",
"exist",
"."
] | def _CopyRuntime2015(target_dir, source_dir, dll_pattern):
"""Copy both the msvcp and vccorlib runtime DLLs, only if the target doesn't
exist, but the target directory does exist."""
for file_part in ('msvcp', 'vccorlib'):
dll = dll_pattern % file_part
target = os.path.join(target_dir, dll)
source = o... | [
"def",
"_CopyRuntime2015",
"(",
"target_dir",
",",
"source_dir",
",",
"dll_pattern",
")",
":",
"for",
"file_part",
"in",
"(",
"'msvcp'",
",",
"'vccorlib'",
")",
":",
"dll",
"=",
"dll_pattern",
"%",
"file_part",
"target",
"=",
"os",
".",
"path",
".",
"join"... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/build/vs_toolchain.py#L107-L114 | ||
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/anomaly_detection/detector/tools/slow_sql/diagnosing.py | python | diagnose_user | (dbagent, query, start_time) | return zip_rca | Get RCA of system resource.
:param dbagent: obj, interface for sqlite3.
:param query: str, query.
:param start_time: int, start_time.
:return | Get RCA of system resource.
:param dbagent: obj, interface for sqlite3.
:param query: str, query.
:param start_time: int, start_time.
:return | [
"Get",
"RCA",
"of",
"system",
"resource",
".",
":",
"param",
"dbagent",
":",
"obj",
"interface",
"for",
"sqlite3",
".",
":",
"param",
"query",
":",
"str",
"query",
".",
":",
"param",
"start_time",
":",
"int",
"start_time",
".",
":",
"return"
] | def diagnose_user(dbagent, query, start_time):
"""
Get RCA of system resource.
:param dbagent: obj, interface for sqlite3.
:param query: str, query.
:param start_time: int, start_time.
:return
"""
rca = []
suggestion = []
plan = Plan()
timestamp, start_time, finish_time, expl... | [
"def",
"diagnose_user",
"(",
"dbagent",
",",
"query",
",",
"start_time",
")",
":",
"rca",
"=",
"[",
"]",
"suggestion",
"=",
"[",
"]",
"plan",
"=",
"Plan",
"(",
")",
"timestamp",
",",
"start_time",
",",
"finish_time",
",",
"explain",
"=",
"dbagent",
"."... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/anomaly_detection/detector/tools/slow_sql/diagnosing.py#L257-L308 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/addins/excel.py | python | ExcelAddin.generateRegisterFunctions | (self, cat) | Generate the code for registering addin functions with Excel. | Generate the code for registering addin functions with Excel. | [
"Generate",
"the",
"code",
"for",
"registering",
"addin",
"functions",
"with",
"Excel",
"."
] | def generateRegisterFunctions(self, cat):
"""Generate the code for registering addin functions with Excel."""
registerCode = ''
unregisterCode = ''
for func in cat.functions(self.name_, supportedplatform.MANUAL):
self.functionCount_ += 1
registerCode += self.gener... | [
"def",
"generateRegisterFunctions",
"(",
"self",
",",
"cat",
")",
":",
"registerCode",
"=",
"''",
"unregisterCode",
"=",
"''",
"for",
"func",
"in",
"cat",
".",
"functions",
"(",
"self",
".",
"name_",
",",
"supportedplatform",
".",
"MANUAL",
")",
":",
"self... | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/excel.py#L245-L255 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/interpolate/fitpack2.py | python | UnivariateSpline._from_tck | (cls, tck, ext=0) | return self | Construct a spline object from given tck | Construct a spline object from given tck | [
"Construct",
"a",
"spline",
"object",
"from",
"given",
"tck"
] | def _from_tck(cls, tck, ext=0):
"""Construct a spline object from given tck"""
self = cls.__new__(cls)
t, c, k = tck
self._eval_args = tck
# _data == x,y,w,xb,xe,k,s,n,t,c,fp,fpint,nrdata,ier
self._data = (None, None, None, None, None, k, None, len(t), t,
... | [
"def",
"_from_tck",
"(",
"cls",
",",
"tck",
",",
"ext",
"=",
"0",
")",
":",
"self",
"=",
"cls",
".",
"__new__",
"(",
"cls",
")",
"t",
",",
"c",
",",
"k",
"=",
"tck",
"self",
".",
"_eval_args",
"=",
"tck",
"# _data == x,y,w,xb,xe,k,s,n,t,c,fp,fpint,nrda... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/fitpack2.py#L194-L203 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py | python | issequence | (seq) | return False | Is seq a sequence (ndarray, list or tuple)? | Is seq a sequence (ndarray, list or tuple)? | [
"Is",
"seq",
"a",
"sequence",
"(",
"ndarray",
"list",
"or",
"tuple",
")",
"?"
] | def issequence(seq):
"""Is seq a sequence (ndarray, list or tuple)?"""
if isinstance(seq, (ndarray, tuple, list)):
return True
return False | [
"def",
"issequence",
"(",
"seq",
")",
":",
"if",
"isinstance",
"(",
"seq",
",",
"(",
"ndarray",
",",
"tuple",
",",
"list",
")",
")",
":",
"return",
"True",
"return",
"False"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py#L55-L59 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/api.py | python | get | (url, params=None, **kwargs) | return request('get', url, params=params, **kwargs) | Sends a GET request.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:return: :class:`Response <Response>` object
:rtype: request... | Sends a GET request. | [
"Sends",
"a",
"GET",
"request",
"."
] | def get(url, params=None, **kwargs):
"""Sends a GET request.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:return: :class:`Res... | [
"def",
"get",
"(",
"url",
",",
"params",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"setdefault",
"(",
"'allow_redirects'",
",",
"True",
")",
"return",
"request",
"(",
"'get'",
",",
"url",
",",
"params",
"=",
"params",
",",
"*",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/api.py#L58-L69 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | RadioBox.FindString | (*args, **kwargs) | return _controls_.RadioBox_FindString(*args, **kwargs) | FindString(self, String s) -> int | FindString(self, String s) -> int | [
"FindString",
"(",
"self",
"String",
"s",
")",
"-",
">",
"int"
] | def FindString(*args, **kwargs):
"""FindString(self, String s) -> int"""
return _controls_.RadioBox_FindString(*args, **kwargs) | [
"def",
"FindString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_FindString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2615-L2617 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/reporter.py | python | Reporter._write | (self, message) | Implement actual message writing. | Implement actual message writing. | [
"Implement",
"actual",
"message",
"writing",
"."
] | def _write(self, message):
"""Implement actual message writing."""
wholemsg = ''
if message.location:
wholemsg += str(message.location) + ': '
wholemsg += message.message
if message.details:
wholemsg += '\n ' + '\n '.join(message.details)
who... | [
"def",
"_write",
"(",
"self",
",",
"message",
")",
":",
"wholemsg",
"=",
"''",
"if",
"message",
".",
"location",
":",
"wholemsg",
"+=",
"str",
"(",
"message",
".",
"location",
")",
"+",
"': '",
"wholemsg",
"+=",
"message",
".",
"message",
"if",
"messag... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/reporter.py#L191-L203 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsCJKCompatibility | (code) | return ret | Check whether the character is part of CJKCompatibility UCS
Block | Check whether the character is part of CJKCompatibility UCS
Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"CJKCompatibility",
"UCS",
"Block"
] | def uCSIsCJKCompatibility(code):
"""Check whether the character is part of CJKCompatibility UCS
Block """
ret = libxml2mod.xmlUCSIsCJKCompatibility(code)
return ret | [
"def",
"uCSIsCJKCompatibility",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCJKCompatibility",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2137-L2141 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/ops.py | python | get_to_proto_function | (collection_name) | Returns the to_proto function for collection_name. | Returns the to_proto function for collection_name. | [
"Returns",
"the",
"to_proto",
"function",
"for",
"collection_name",
"."
] | def get_to_proto_function(collection_name):
"""Returns the to_proto function for collection_name."""
try:
return _proto_function_registry.lookup(collection_name)[1]
except LookupError:
return None | [
"def",
"get_to_proto_function",
"(",
"collection_name",
")",
":",
"try",
":",
"return",
"_proto_function_registry",
".",
"lookup",
"(",
"collection_name",
")",
"[",
"1",
"]",
"except",
"LookupError",
":",
"return",
"None"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L4071-L4076 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | is_array | (a) | return isinstance(a, ArrayRef) | Return `True` if `a` is a Z3 array expression.
>>> a = Array('a', IntSort(), IntSort())
>>> is_array(a)
True
>>> is_array(Store(a, 0, 1))
True
>>> is_array(a[0])
False | Return `True` if `a` is a Z3 array expression. | [
"Return",
"True",
"if",
"a",
"is",
"a",
"Z3",
"array",
"expression",
"."
] | def is_array(a):
"""Return `True` if `a` is a Z3 array expression.
>>> a = Array('a', IntSort(), IntSort())
>>> is_array(a)
True
>>> is_array(Store(a, 0, 1))
True
>>> is_array(a[0])
False
"""
return isinstance(a, ArrayRef) | [
"def",
"is_array",
"(",
"a",
")",
":",
"return",
"isinstance",
"(",
"a",
",",
"ArrayRef",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4576-L4587 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/download.py | python | parse_content_disposition | (content_disposition, default_filename) | return filename or default_filename | Parse the "filename" value from a Content-Disposition header, and
return the default filename if the result is empty. | Parse the "filename" value from a Content-Disposition header, and
return the default filename if the result is empty. | [
"Parse",
"the",
"filename",
"value",
"from",
"a",
"Content",
"-",
"Disposition",
"header",
"and",
"return",
"the",
"default",
"filename",
"if",
"the",
"result",
"is",
"empty",
"."
] | def parse_content_disposition(content_disposition, default_filename):
# type: (str, str) -> str
"""
Parse the "filename" value from a Content-Disposition header, and
return the default filename if the result is empty.
"""
_type, params = cgi.parse_header(content_disposition)
filename = param... | [
"def",
"parse_content_disposition",
"(",
"content_disposition",
",",
"default_filename",
")",
":",
"# type: (str, str) -> str",
"_type",
",",
"params",
"=",
"cgi",
".",
"parse_header",
"(",
"content_disposition",
")",
"filename",
"=",
"params",
".",
"get",
"(",
"'fi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/download.py#L89-L101 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialutil.py | python | SerialBase.inter_byte_timeout | (self, ic_timeout) | Change inter-byte timeout setting. | Change inter-byte timeout setting. | [
"Change",
"inter",
"-",
"byte",
"timeout",
"setting",
"."
] | def inter_byte_timeout(self, ic_timeout):
"""Change inter-byte timeout setting."""
if ic_timeout is not None:
if ic_timeout < 0:
raise ValueError("Not a valid timeout: {!r}".format(ic_timeout))
try:
ic_timeout + 1 # test if it's a number, will ... | [
"def",
"inter_byte_timeout",
"(",
"self",
",",
"ic_timeout",
")",
":",
"if",
"ic_timeout",
"is",
"not",
"None",
":",
"if",
"ic_timeout",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"Not a valid timeout: {!r}\"",
".",
"format",
"(",
"ic_timeout",
")",
")",
"... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialutil.py#L396-L408 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_basestc.py | python | EditraBaseStc.SetBlockCaret | (self) | Change caret style to block | Change caret style to block | [
"Change",
"caret",
"style",
"to",
"block"
] | def SetBlockCaret(self):
"""Change caret style to block"""
if hasattr(self, 'SetCaretStyle'): # wxPython 2.9 or greater
self.SetCaretStyle(wx.stc.STC_CARETSTYLE_BLOCK)
else:
# Alternatively, just make the caret a bit thicker!
# best we can do on 2.8
... | [
"def",
"SetBlockCaret",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'SetCaretStyle'",
")",
":",
"# wxPython 2.9 or greater",
"self",
".",
"SetCaretStyle",
"(",
"wx",
".",
"stc",
".",
"STC_CARETSTYLE_BLOCK",
")",
"else",
":",
"# Alternatively, just... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_basestc.py#L310-L317 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/parser/source_reader.py | python | source_reader_t.create_xml_file | (self, source_file, destination=None) | return xml_file | This method will generate a xml file using an external tool.
The method will return the file path of the generated xml file.
:param source_file: path to the source file that should be parsed.
:type source_file: str
:param destination: if given, will be used as target file path for
... | This method will generate a xml file using an external tool. | [
"This",
"method",
"will",
"generate",
"a",
"xml",
"file",
"using",
"an",
"external",
"tool",
"."
] | def create_xml_file(self, source_file, destination=None):
"""
This method will generate a xml file using an external tool.
The method will return the file path of the generated xml file.
:param source_file: path to the source file that should be parsed.
:type source_file: str
... | [
"def",
"create_xml_file",
"(",
"self",
",",
"source_file",
",",
"destination",
"=",
"None",
")",
":",
"xml_file",
"=",
"destination",
"# If file specified, remove it to start else create new file name",
"if",
"xml_file",
":",
"utils",
".",
"remove_file_no_raise",
"(",
"... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/parser/source_reader.py#L202-L274 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForRepeatedField | (field, cls) | Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below).
Note that when clients add values to these containers, we perform
type-checking i... | Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below). | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"repeated",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"the",
"value",
"of",
"the",
"field",
"which",
"will",
"be",
"either",
"a",
"_RepeatedScalarFieldContainer... | def _AddPropertiesForRepeatedField(field, cls):
"""Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below).
Note that when clients add val... | [
"def",
"_AddPropertiesForRepeatedField",
"(",
"field",
",",
"cls",
")",
":",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_field_name",
")",
"def",
"getter",
"(",
"self",
")",
":",
"field_value",
"=",
"self",
... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py#L594-L635 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | rad2deg | (x) | return 180.0*x/pi | Transforms radians into degrees.
:param `x`: a float representing an angle in radians. | Transforms radians into degrees. | [
"Transforms",
"radians",
"into",
"degrees",
"."
] | def rad2deg(x):
"""
Transforms radians into degrees.
:param `x`: a float representing an angle in radians.
"""
return 180.0*x/pi | [
"def",
"rad2deg",
"(",
"x",
")",
":",
"return",
"180.0",
"*",
"x",
"/",
"pi"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1205-L1212 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/text_file.py | python | TextFile.open | (self, filename) | Open a new file named 'filename'. This overrides both the
'filename' and 'file' arguments to the constructor. | Open a new file named 'filename'. This overrides both the
'filename' and 'file' arguments to the constructor. | [
"Open",
"a",
"new",
"file",
"named",
"filename",
".",
"This",
"overrides",
"both",
"the",
"filename",
"and",
"file",
"arguments",
"to",
"the",
"constructor",
"."
] | def open(self, filename):
"""Open a new file named 'filename'. This overrides both the
'filename' and 'file' arguments to the constructor."""
self.filename = filename
self.file = io.open(self.filename, 'r', errors=self.errors)
self.current_line = 0 | [
"def",
"open",
"(",
"self",
",",
"filename",
")",
":",
"self",
".",
"filename",
"=",
"filename",
"self",
".",
"file",
"=",
"io",
".",
"open",
"(",
"self",
".",
"filename",
",",
"'r'",
",",
"errors",
"=",
"self",
".",
"errors",
")",
"self",
".",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/text_file.py#L111-L116 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/warnings.py | python | formatwarning | (message, category, filename, lineno, line=None) | return s | Function to format a warning the standard way. | Function to format a warning the standard way. | [
"Function",
"to",
"format",
"a",
"warning",
"the",
"standard",
"way",
"."
] | def formatwarning(message, category, filename, lineno, line=None):
"""Function to format a warning the standard way."""
try:
unicodetype = unicode
except NameError:
unicodetype = ()
try:
message = str(message)
except UnicodeEncodeError:
pass
s = "%s: %s: %s\n" % ... | [
"def",
"formatwarning",
"(",
"message",
",",
"category",
",",
"filename",
",",
"lineno",
",",
"line",
"=",
"None",
")",
":",
"try",
":",
"unicodetype",
"=",
"unicode",
"except",
"NameError",
":",
"unicodetype",
"=",
"(",
")",
"try",
":",
"message",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/warnings.py#L40-L65 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/spatial/kdtree.py | python | minkowski_distance | (x, y, p=2) | Compute the L**p distance between two arrays.
Parameters
----------
x : (M, K) array_like
Input array.
y : (N, K) array_like
Input array.
p : float, 1 <= p <= infinity
Which Minkowski p-norm to use.
Examples
--------
>>> from scipy.spatial import minkowski_dista... | Compute the L**p distance between two arrays. | [
"Compute",
"the",
"L",
"**",
"p",
"distance",
"between",
"two",
"arrays",
"."
] | def minkowski_distance(x, y, p=2):
"""
Compute the L**p distance between two arrays.
Parameters
----------
x : (M, K) array_like
Input array.
y : (N, K) array_like
Input array.
p : float, 1 <= p <= infinity
Which Minkowski p-norm to use.
Examples
--------
... | [
"def",
"minkowski_distance",
"(",
"x",
",",
"y",
",",
"p",
"=",
"2",
")",
":",
"x",
"=",
"np",
".",
"asarray",
"(",
"x",
")",
"y",
"=",
"np",
".",
"asarray",
"(",
"y",
")",
"if",
"p",
"==",
"np",
".",
"inf",
"or",
"p",
"==",
"1",
":",
"re... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/spatial/kdtree.py#L49-L74 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/util.py | python | TimeZoneOffset.utcoffset | (self, dt) | return datetime.timedelta(minutes=self.__offset) | Get the a timedelta with the time zone's offset from UTC.
Returns:
The time zone offset from UTC, as a timedelta. | Get the a timedelta with the time zone's offset from UTC. | [
"Get",
"the",
"a",
"timedelta",
"with",
"the",
"time",
"zone",
"s",
"offset",
"from",
"UTC",
"."
] | def utcoffset(self, dt):
"""Get the a timedelta with the time zone's offset from UTC.
Returns:
The time zone offset from UTC, as a timedelta.
"""
return datetime.timedelta(minutes=self.__offset) | [
"def",
"utcoffset",
"(",
"self",
",",
"dt",
")",
":",
"return",
"datetime",
".",
"timedelta",
"(",
"minutes",
"=",
"self",
".",
"__offset",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/util.py#L420-L426 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | PyPickerBase.UpdateTextCtrlFromPicker | (*args, **kwargs) | return _controls_.PyPickerBase_UpdateTextCtrlFromPicker(*args, **kwargs) | UpdateTextCtrlFromPicker(self) | UpdateTextCtrlFromPicker(self) | [
"UpdateTextCtrlFromPicker",
"(",
"self",
")"
] | def UpdateTextCtrlFromPicker(*args, **kwargs):
"""UpdateTextCtrlFromPicker(self)"""
return _controls_.PyPickerBase_UpdateTextCtrlFromPicker(*args, **kwargs) | [
"def",
"UpdateTextCtrlFromPicker",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"PyPickerBase_UpdateTextCtrlFromPicker",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L6879-L6881 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/graph_editor/match.py | python | OpMatcher.input_ops | (self, *args) | return self | Add input matches. | Add input matches. | [
"Add",
"input",
"matches",
"."
] | def input_ops(self, *args):
"""Add input matches."""
if self.input_op_matches is not None:
raise ValueError("input_op_matches is already set.")
self.input_op_matches = []
for input_match in args:
self.input_op_matches.append(_make_graph_match(input_match))
return self | [
"def",
"input_ops",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"self",
".",
"input_op_matches",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"input_op_matches is already set.\"",
")",
"self",
".",
"input_op_matches",
"=",
"[",
"]",
"for",
"inp... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/graph_editor/match.py#L122-L129 | |
YosysHQ/nextpnr | 74c99f9195eeb47d106ca74b7abb894cfd47cc03 | 3rdparty/pybind11/pybind11/setup_helpers.py | python | ParallelCompile.function | (self) | return compile_function | Builds a function object usable as distutils.ccompiler.CCompiler.compile. | Builds a function object usable as distutils.ccompiler.CCompiler.compile. | [
"Builds",
"a",
"function",
"object",
"usable",
"as",
"distutils",
".",
"ccompiler",
".",
"CCompiler",
".",
"compile",
"."
] | def function(self):
"""
Builds a function object usable as distutils.ccompiler.CCompiler.compile.
"""
def compile_function(
compiler,
sources,
output_dir=None,
macros=None,
include_dirs=None,
debug=0,
ex... | [
"def",
"function",
"(",
"self",
")",
":",
"def",
"compile_function",
"(",
"compiler",
",",
"sources",
",",
"output_dir",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"debug",
"=",
"0",
",",
"extra_preargs",
"=",
"None",... | https://github.com/YosysHQ/nextpnr/blob/74c99f9195eeb47d106ca74b7abb894cfd47cc03/3rdparty/pybind11/pybind11/setup_helpers.py#L364-L425 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/pyplugin_installer/installer_data.py | python | Repositories.all | (self) | return self.mRepositories | return dict of all repositories | return dict of all repositories | [
"return",
"dict",
"of",
"all",
"repositories"
] | def all(self) -> Dict[str, Dict[str, Any]]:
""" return dict of all repositories """
return self.mRepositories | [
"def",
"all",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"return",
"self",
".",
"mRepositories"
] | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/pyplugin_installer/installer_data.py#L185-L187 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py | python | EnumValueDescriptor.__init__ | (self, name, index, number, type=None, options=None) | Arguments are as described in the attribute description above. | Arguments are as described in the attribute description above. | [
"Arguments",
"are",
"as",
"described",
"in",
"the",
"attribute",
"description",
"above",
"."
] | def __init__(self, name, index, number, type=None, options=None):
"""Arguments are as described in the attribute description above."""
super(EnumValueDescriptor, self).__init__(options, 'EnumValueOptions')
self.name = name
self.index = index
self.number = number
self.type = type | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"index",
",",
"number",
",",
"type",
"=",
"None",
",",
"options",
"=",
"None",
")",
":",
"super",
"(",
"EnumValueDescriptor",
",",
"self",
")",
".",
"__init__",
"(",
"options",
",",
"'EnumValueOptions'",
... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L473-L479 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/objpanel.py | python | ScalarPanel._prepend_name | (self, names, name) | Predends name if not in list | Predends name if not in list | [
"Predends",
"name",
"if",
"not",
"in",
"list"
] | def _prepend_name(self, names, name):
"""
Predends name if not in list
"""
if names.count(name) == 0:
names.insert(name, 0) | [
"def",
"_prepend_name",
"(",
"self",
",",
"names",
",",
"name",
")",
":",
"if",
"names",
".",
"count",
"(",
"name",
")",
"==",
"0",
":",
"names",
".",
"insert",
"(",
"name",
",",
"0",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L1884-L1889 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | HLTrigger/Configuration/python/customizeHLTforPatatrack.py | python | customiseEcalLocalReconstruction | (process) | return process | from RecoLocalCalo.EcalRecProducers.ecalRecHitGPU_cfi import ecalRecHitGPU as _ecalRecHitGPU
process.hltEcalRecHitGPU = _ecalRecHitGPU.clone(
uncalibrecHitsInLabelEB = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEB"),
uncalibrecHitsInLabelEE = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEE"),
... | from RecoLocalCalo.EcalRecProducers.ecalRecHitGPU_cfi import ecalRecHitGPU as _ecalRecHitGPU
process.hltEcalRecHitGPU = _ecalRecHitGPU.clone(
uncalibrecHitsInLabelEB = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEB"),
uncalibrecHitsInLabelEE = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEE"),
... | [
"from",
"RecoLocalCalo",
".",
"EcalRecProducers",
".",
"ecalRecHitGPU_cfi",
"import",
"ecalRecHitGPU",
"as",
"_ecalRecHitGPU",
"process",
".",
"hltEcalRecHitGPU",
"=",
"_ecalRecHitGPU",
".",
"clone",
"(",
"uncalibrecHitsInLabelEB",
"=",
"(",
"hltEcalUncalibRecHitGPU",
"Ec... | def customiseEcalLocalReconstruction(process):
hasHLTEcalPreshowerSeq = any(seq in process.__dict__ for seq in ['HLTDoFullUnpackingEgammaEcalMFSequence', 'HLTDoFullUnpackingEgammaEcalSequence'])
if not (hasHLTEcalPreshowerSeq or 'HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence' in process.__dict__):
... | [
"def",
"customiseEcalLocalReconstruction",
"(",
"process",
")",
":",
"hasHLTEcalPreshowerSeq",
"=",
"any",
"(",
"seq",
"in",
"process",
".",
"__dict__",
"for",
"seq",
"in",
"[",
"'HLTDoFullUnpackingEgammaEcalMFSequence'",
",",
"'HLTDoFullUnpackingEgammaEcalSequence'",
"]"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/HLTrigger/Configuration/python/customizeHLTforPatatrack.py#L402-L585 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_composit.py | python | DivisionShape.GetLeftSideStyle | (self) | return self._leftSideStyle | Return the style used for the left side of the division. | Return the style used for the left side of the division. | [
"Return",
"the",
"style",
"used",
"for",
"the",
"left",
"side",
"of",
"the",
"division",
"."
] | def GetLeftSideStyle(self):
"""Return the style used for the left side of the division."""
return self._leftSideStyle | [
"def",
"GetLeftSideStyle",
"(",
"self",
")",
":",
"return",
"self",
".",
"_leftSideStyle"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_composit.py#L991-L993 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | AnyButton.SetBitmapCurrent | (*args, **kwargs) | return _controls_.AnyButton_SetBitmapCurrent(*args, **kwargs) | SetBitmapCurrent(self, Bitmap bitmap) | SetBitmapCurrent(self, Bitmap bitmap) | [
"SetBitmapCurrent",
"(",
"self",
"Bitmap",
"bitmap",
")"
] | def SetBitmapCurrent(*args, **kwargs):
"""SetBitmapCurrent(self, Bitmap bitmap)"""
return _controls_.AnyButton_SetBitmapCurrent(*args, **kwargs) | [
"def",
"SetBitmapCurrent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"AnyButton_SetBitmapCurrent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L92-L94 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/ops.py | python | _arith_method_SERIES | (cls, op, special) | return wrapper | Wrapper function for Series arithmetic operations, to avoid
code duplication. | Wrapper function for Series arithmetic operations, to avoid
code duplication. | [
"Wrapper",
"function",
"for",
"Series",
"arithmetic",
"operations",
"to",
"avoid",
"code",
"duplication",
"."
] | def _arith_method_SERIES(cls, op, special):
"""
Wrapper function for Series arithmetic operations, to avoid
code duplication.
"""
str_rep = _get_opstr(op, cls)
op_name = _get_op_name(op, special)
eval_kwargs = _gen_eval_kwargs(op_name)
fill_zeros = _gen_fill_zeros(op_name)
construct_... | [
"def",
"_arith_method_SERIES",
"(",
"cls",
",",
"op",
",",
"special",
")",
":",
"str_rep",
"=",
"_get_opstr",
"(",
"op",
",",
"cls",
")",
"op_name",
"=",
"_get_op_name",
"(",
"op",
",",
"special",
")",
"eval_kwargs",
"=",
"_gen_eval_kwargs",
"(",
"op_name"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/ops.py#L1490-L1588 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py | python | IMAP4.enable | (self, capability) | return typ, data | Send an RFC5161 enable string to the server.
(typ, [data]) = <intance>.enable(capability) | Send an RFC5161 enable string to the server. | [
"Send",
"an",
"RFC5161",
"enable",
"string",
"to",
"the",
"server",
"."
] | def enable(self, capability):
"""Send an RFC5161 enable string to the server.
(typ, [data]) = <intance>.enable(capability)
"""
if 'ENABLE' not in self.capabilities:
raise IMAP4.error("Server does not support ENABLE")
typ, data = self._simple_command('ENABLE', capabil... | [
"def",
"enable",
"(",
"self",
",",
"capability",
")",
":",
"if",
"'ENABLE'",
"not",
"in",
"self",
".",
"capabilities",
":",
"raise",
"IMAP4",
".",
"error",
"(",
"\"Server does not support ENABLE\"",
")",
"typ",
",",
"data",
"=",
"self",
".",
"_simple_command... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py#L497-L507 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/RecoTrack/python/plotting/plotting.py | python | PlotGroup.onlyForPileup | (self) | return self._onlyForPileup | Return True if the PlotGroup is intended only for pileup samples | Return True if the PlotGroup is intended only for pileup samples | [
"Return",
"True",
"if",
"the",
"PlotGroup",
"is",
"intended",
"only",
"for",
"pileup",
"samples"
] | def onlyForPileup(self):
"""Return True if the PlotGroup is intended only for pileup samples"""
return self._onlyForPileup | [
"def",
"onlyForPileup",
"(",
"self",
")",
":",
"return",
"self",
".",
"_onlyForPileup"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/plotting.py#L2323-L2325 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/weights_broadcast_ops.py | python | assert_broadcastable | (weights, values) | Asserts `weights` can be broadcast to `values`.
In `tf.losses` and `tf.metrics`, we support limited weight broadcasting. We
let weights be either scalar, or the same rank as the target values, with each
dimension either 1, or the same as the corresponding values dimension.
Args:
weights: `Tensor` of weigh... | Asserts `weights` can be broadcast to `values`. | [
"Asserts",
"weights",
"can",
"be",
"broadcast",
"to",
"values",
"."
] | def assert_broadcastable(weights, values):
"""Asserts `weights` can be broadcast to `values`.
In `tf.losses` and `tf.metrics`, we support limited weight broadcasting. We
let weights be either scalar, or the same rank as the target values, with each
dimension either 1, or the same as the corresponding values di... | [
"def",
"assert_broadcastable",
"(",
"weights",
",",
"values",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"\"assert_broadcastable\"",
",",
"(",
"weights",
",",
"values",
")",
")",
"as",
"scope",
":",
"with",
"ops",
".",
"name_scope",
"(",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/weights_broadcast_ops.py#L60-L131 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBAddress.GetLineEntry | (self) | return _lldb.SBAddress_GetLineEntry(self) | GetLineEntry(SBAddress self) -> SBLineEntry | GetLineEntry(SBAddress self) -> SBLineEntry | [
"GetLineEntry",
"(",
"SBAddress",
"self",
")",
"-",
">",
"SBLineEntry"
] | def GetLineEntry(self):
"""GetLineEntry(SBAddress self) -> SBLineEntry"""
return _lldb.SBAddress_GetLineEntry(self) | [
"def",
"GetLineEntry",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBAddress_GetLineEntry",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L991-L993 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuItem.SetLabel | (self, text) | Sets the label text for this item from the text (excluding the accelerator).
:param string `text`: the new item label (excluding the accelerator). | Sets the label text for this item from the text (excluding the accelerator). | [
"Sets",
"the",
"label",
"text",
"for",
"this",
"item",
"from",
"the",
"text",
"(",
"excluding",
"the",
"accelerator",
")",
"."
] | def SetLabel(self, text):
"""
Sets the label text for this item from the text (excluding the accelerator).
:param string `text`: the new item label (excluding the accelerator).
"""
if text:
indx = text.find("\t")
if indx >= 0:
self._acce... | [
"def",
"SetLabel",
"(",
"self",
",",
"text",
")",
":",
"if",
"text",
":",
"indx",
"=",
"text",
".",
"find",
"(",
"\"\\t\"",
")",
"if",
"indx",
">=",
"0",
":",
"self",
".",
"_accelStr",
"=",
"text",
"[",
"indx",
"+",
"1",
":",
"]",
"label",
"=",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5153-L5178 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Sizer.FitInside | (*args, **kwargs) | return _core_.Sizer_FitInside(*args, **kwargs) | FitInside(self, Window window)
Tell the sizer to resize the *virtual size* of the *window* to match the
sizer's minimal size. This will not alter the on screen size of the
window, but may cause the addition/removal/alteration of scrollbars
required to view the virtual area in windows wh... | FitInside(self, Window window) | [
"FitInside",
"(",
"self",
"Window",
"window",
")"
] | def FitInside(*args, **kwargs):
"""
FitInside(self, Window window)
Tell the sizer to resize the *virtual size* of the *window* to match the
sizer's minimal size. This will not alter the on screen size of the
window, but may cause the addition/removal/alteration of scrollbars
... | [
"def",
"FitInside",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_FitInside",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14889-L14901 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/events.py | python | set_event_loop | (loop) | Equivalent to calling get_event_loop_policy().set_event_loop(loop). | Equivalent to calling get_event_loop_policy().set_event_loop(loop). | [
"Equivalent",
"to",
"calling",
"get_event_loop_policy",
"()",
".",
"set_event_loop",
"(",
"loop",
")",
"."
] | def set_event_loop(loop):
"""Equivalent to calling get_event_loop_policy().set_event_loop(loop)."""
get_event_loop_policy().set_event_loop(loop) | [
"def",
"set_event_loop",
"(",
"loop",
")",
":",
"get_event_loop_policy",
"(",
")",
".",
"set_event_loop",
"(",
"loop",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/events.py#L754-L756 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/jpsro.py | python | _rmwcce | (meta_game, per_player_repeats, ignore_repeats=False) | return dist, dict() | Random maximum welfare CCE. | Random maximum welfare CCE. | [
"Random",
"maximum",
"welfare",
"CCE",
"."
] | def _rmwcce(meta_game, per_player_repeats, ignore_repeats=False):
"""Random maximum welfare CCE."""
del ignore_repeats
num_players = len(per_player_repeats)
cost = np.ravel(np.sum(meta_game, axis=0))
cost += np.ravel(np.random.normal(size=meta_game.shape[1:])) * 1e-6
a_mat, _ = _cce_constraints(
meta_... | [
"def",
"_rmwcce",
"(",
"meta_game",
",",
"per_player_repeats",
",",
"ignore_repeats",
"=",
"False",
")",
":",
"del",
"ignore_repeats",
"num_players",
"=",
"len",
"(",
"per_player_repeats",
")",
"cost",
"=",
"np",
".",
"ravel",
"(",
"np",
".",
"sum",
"(",
"... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/jpsro.py#L955-L967 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | LogTextCtrl.__init__ | (self, *args, **kwargs) | __init__(self, wxTextCtrl pTextCtrl) -> LogTextCtrl | __init__(self, wxTextCtrl pTextCtrl) -> LogTextCtrl | [
"__init__",
"(",
"self",
"wxTextCtrl",
"pTextCtrl",
")",
"-",
">",
"LogTextCtrl"
] | def __init__(self, *args, **kwargs):
"""__init__(self, wxTextCtrl pTextCtrl) -> LogTextCtrl"""
_misc_.LogTextCtrl_swiginit(self,_misc_.new_LogTextCtrl(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_misc_",
".",
"LogTextCtrl_swiginit",
"(",
"self",
",",
"_misc_",
".",
"new_LogTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1749-L1751 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/parser.py | python | p_ActorType | (p) | ActorType : ID ':' State | ActorType : ID ':' State | [
"ActorType",
":",
"ID",
":",
"State"
] | def p_ActorType(p):
"""ActorType : ID ':' State"""
loc = locFromTok(p, 1)
p[0] = TypeSpec(loc, QualifiedId(loc, p[1]), state=p[3]) | [
"def",
"p_ActorType",
"(",
"p",
")",
":",
"loc",
"=",
"locFromTok",
"(",
"p",
",",
"1",
")",
"p",
"[",
"0",
"]",
"=",
"TypeSpec",
"(",
"loc",
",",
"QualifiedId",
"(",
"loc",
",",
"p",
"[",
"1",
"]",
")",
",",
"state",
"=",
"p",
"[",
"3",
"]... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L676-L679 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/cpu/dropout.py | python | _dropout_cpu | () | return | Dropout cpu register | Dropout cpu register | [
"Dropout",
"cpu",
"register"
] | def _dropout_cpu():
"""Dropout cpu register"""
return | [
"def",
"_dropout_cpu",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/cpu/dropout.py#L28-L30 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/html/parser.py | python | HTMLParser.__init__ | (self, *, convert_charrefs=True) | Initialize and reset this instance.
If convert_charrefs is True (the default), all character references
are automatically converted to the corresponding Unicode characters. | Initialize and reset this instance. | [
"Initialize",
"and",
"reset",
"this",
"instance",
"."
] | def __init__(self, *, convert_charrefs=True):
"""Initialize and reset this instance.
If convert_charrefs is True (the default), all character references
are automatically converted to the corresponding Unicode characters.
"""
self.convert_charrefs = convert_charrefs
self... | [
"def",
"__init__",
"(",
"self",
",",
"*",
",",
"convert_charrefs",
"=",
"True",
")",
":",
"self",
".",
"convert_charrefs",
"=",
"convert_charrefs",
"self",
".",
"reset",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/html/parser.py#L87-L94 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/atomsdata.py | python | AtomsData._check_item | (item: Dict[str, Any], n_atoms: Optional[int] = None) | return item | Raise an error if Atoms data item is unsuitable
:param item: element to be added
:param n_atoms: Number of atoms in data. If provided, check that "sort" value is not higher than expected. | Raise an error if Atoms data item is unsuitable | [
"Raise",
"an",
"error",
"if",
"Atoms",
"data",
"item",
"is",
"unsuitable"
] | def _check_item(item: Dict[str, Any], n_atoms: Optional[int] = None) -> Dict[str, Any]:
"""
Raise an error if Atoms data item is unsuitable
:param item: element to be added
:param n_atoms: Number of atoms in data. If provided, check that "sort" value is not higher than expected.
... | [
"def",
"_check_item",
"(",
"item",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"n_atoms",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"if",
"not",
"isinstance",
"(",
"item",
",",
"dict",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/atomsdata.py#L49-L102 | |
gtcasl/gpuocelot | fa63920ee7c5f9a86e264cd8acd4264657cbd190 | ocelot/scripts/build_environment.py | python | getDebianArchitecture | () | return arch[0] | Determines the debian architecture
return {deb_arch} | Determines the debian architecture
return {deb_arch} | [
"Determines",
"the",
"debian",
"architecture",
"return",
"{",
"deb_arch",
"}"
] | def getDebianArchitecture():
"""Determines the debian architecture
return {deb_arch}
"""
# check for supported OS
if os.name != 'posix':
raise ValueError, 'Error: unknown OS. Can only build .deb on linux.'
try:
dpkg_arch_path = which('dpkg-architecture')
except:
raise ValueError, "Failed to find 'dpk... | [
"def",
"getDebianArchitecture",
"(",
")",
":",
"# check for supported OS",
"if",
"os",
".",
"name",
"!=",
"'posix'",
":",
"raise",
"ValueError",
",",
"'Error: unknown OS. Can only build .deb on linux.'",
"try",
":",
"dpkg_arch_path",
"=",
"which",
"(",
"'dpkg-architect... | https://github.com/gtcasl/gpuocelot/blob/fa63920ee7c5f9a86e264cd8acd4264657cbd190/ocelot/scripts/build_environment.py#L11-L34 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/build_tools/update_nacl_manifest.py | python | VersionFinder._GetAvailableArchivesFor | (self, version_string) | return filter(lambda a: a + '.json' in manifests, archives) | Downloads a list of all available archives for a given version.
Args:
version_string: The version to find archives for. (e.g. "18.0.1025.164")
Returns:
A list of strings, each of which is a platform-specific archive URL. (e.g.
"gs://nativeclient_mirror/nacl/nacl_sdk/18.0.1025.164/"
"nac... | Downloads a list of all available archives for a given version. | [
"Downloads",
"a",
"list",
"of",
"all",
"available",
"archives",
"for",
"a",
"given",
"version",
"."
] | def _GetAvailableArchivesFor(self, version_string):
"""Downloads a list of all available archives for a given version.
Args:
version_string: The version to find archives for. (e.g. "18.0.1025.164")
Returns:
A list of strings, each of which is a platform-specific archive URL. (e.g.
"gs://n... | [
"def",
"_GetAvailableArchivesFor",
"(",
"self",
",",
"version_string",
")",
":",
"files",
"=",
"self",
".",
"delegate",
".",
"GsUtil_ls",
"(",
"GS_BUCKET_PATH",
"+",
"version_string",
")",
"assert",
"all",
"(",
"file",
".",
"startswith",
"(",
"'gs://'",
")",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/update_nacl_manifest.py#L574-L593 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/site.py | python | addsitepackages | (known_paths) | return known_paths | Add site-packages (and possibly site-python) to sys.path | Add site-packages (and possibly site-python) to sys.path | [
"Add",
"site",
"-",
"packages",
"(",
"and",
"possibly",
"site",
"-",
"python",
")",
"to",
"sys",
".",
"path"
] | def addsitepackages(known_paths):
"""Add site-packages (and possibly site-python) to sys.path"""
for sitedir in getsitepackages():
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
return known_paths | [
"def",
"addsitepackages",
"(",
"known_paths",
")",
":",
"for",
"sitedir",
"in",
"getsitepackages",
"(",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"sitedir",
")",
":",
"addsitedir",
"(",
"sitedir",
",",
"known_paths",
")",
"return",
"known_paths... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/site.py#L309-L315 | |
google/usd_from_gltf | 6d288cce8b68744494a226574ae1d7ba6a9c46eb | tools/ufginstall/ufginstall.py | python | DracoDep.install | (self) | Installs Draco dependency. | Installs Draco dependency. | [
"Installs",
"Draco",
"dependency",
"."
] | def install(self):
"""Installs Draco dependency."""
url = 'https://github.com/google/draco/archive/1.3.5.zip'
path = os.path.join(cfg.src_dir, 'draco.zip')
force = self.forced()
dl_dir = download_archive(url, path, force)
with cwd(dl_dir):
extra_args = ['-DCMAKE_POSITION_INDEPENDENT_CODE=1... | [
"def",
"install",
"(",
"self",
")",
":",
"url",
"=",
"'https://github.com/google/draco/archive/1.3.5.zip'",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cfg",
".",
"src_dir",
",",
"'draco.zip'",
")",
"force",
"=",
"self",
".",
"forced",
"(",
")",
"dl... | https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufginstall/ufginstall.py#L139-L152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.