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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/printing.py | python | PrintHandler.run_print_operation | (self, print_operation, parent) | Run a Ready Print Operation | Run a Ready Print Operation | [
"Run",
"a",
"Ready",
"Print",
"Operation"
] | def run_print_operation(self, print_operation, parent):
"""Run a Ready Print Operation"""
if self.pdf_filepath: print_operation.set_export_filename(self.pdf_filepath)
print_operation_action = gtk.PRINT_OPERATION_ACTION_EXPORT if self.pdf_filepath else gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG
... | [
"def",
"run_print_operation",
"(",
"self",
",",
"print_operation",
",",
"parent",
")",
":",
"if",
"self",
".",
"pdf_filepath",
":",
"print_operation",
".",
"set_export_filename",
"(",
"self",
".",
"pdf_filepath",
")",
"print_operation_action",
"=",
"gtk",
".",
"... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/printing.py#L60-L73 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/numpy_pickle_compat.py | python | ZNDArrayWrapper.read | (self, unpickler) | return array | Reconstruct the array from the meta-information and the z-file. | Reconstruct the array from the meta-information and the z-file. | [
"Reconstruct",
"the",
"array",
"from",
"the",
"meta",
"-",
"information",
"and",
"the",
"z",
"-",
"file",
"."
] | def read(self, unpickler):
"""Reconstruct the array from the meta-information and the z-file."""
# Here we a simply reproducing the unpickling mechanism for numpy
# arrays
filename = os.path.join(unpickler._dirname, self.filename)
array = unpickler.np.core.multiarray._reconstruct... | [
"def",
"read",
"(",
"self",
",",
"unpickler",
")",
":",
"# Here we a simply reproducing the unpickling mechanism for numpy",
"# arrays",
"filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"unpickler",
".",
"_dirname",
",",
"self",
".",
"filename",
")",
"array",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/numpy_pickle_compat.py#L145-L155 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/syntax.py | python | Condition.__init__ | (self, file_name, line, column) | Construct a Condition. | Construct a Condition. | [
"Construct",
"a",
"Condition",
"."
] | def __init__(self, file_name, line, column):
# type: (str, int, int) -> None
"""Construct a Condition."""
self.expr = None # type: str
self.constexpr = None # type: str
self.preprocessor = None # type: str
super(Condition, self).__init__(file_name, line, column) | [
"def",
"__init__",
"(",
"self",
",",
"file_name",
",",
"line",
",",
"column",
")",
":",
"# type: (str, int, int) -> None",
"self",
".",
"expr",
"=",
"None",
"# type: str",
"self",
".",
"constexpr",
"=",
"None",
"# type: str",
"self",
".",
"preprocessor",
"=",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L711-L718 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ast.py | python | copy_location | (new_node, old_node) | return new_node | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | [
"Copy",
"source",
"location",
"(",
"lineno",
"and",
"col_offset",
"attributes",
")",
"from",
"*",
"old_node",
"*",
"to",
"*",
"new_node",
"*",
"if",
"possible",
"and",
"return",
"*",
"new_node",
"*",
"."
] | def copy_location(new_node, old_node):
"""
Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*.
"""
for attr in 'lineno', 'col_offset':
if attr in old_node._attributes and attr in new_node._attributes \
and h... | [
"def",
"copy_location",
"(",
"new_node",
",",
"old_node",
")",
":",
"for",
"attr",
"in",
"'lineno'",
",",
"'col_offset'",
":",
"if",
"attr",
"in",
"old_node",
".",
"_attributes",
"and",
"attr",
"in",
"new_node",
".",
"_attributes",
"and",
"hasattr",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ast.py#L133-L142 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | SizerItem.SetInitSize | (*args, **kwargs) | return _core_.SizerItem_SetInitSize(*args, **kwargs) | SetInitSize(self, int x, int y) | SetInitSize(self, int x, int y) | [
"SetInitSize",
"(",
"self",
"int",
"x",
"int",
"y",
")"
] | def SetInitSize(*args, **kwargs):
"""SetInitSize(self, int x, int y)"""
return _core_.SizerItem_SetInitSize(*args, **kwargs) | [
"def",
"SetInitSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizerItem_SetInitSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14109-L14111 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/tools/hexlify_codec.py | python | IncrementalEncoder.encode | (self, data, final=False) | return serial.to_bytes(encoded) | \
Incremental encode, keep track of digits and emit a byte when a pair
of hex digits is found. The space is optional unless the error
handling is defined to be 'strict'. | \
Incremental encode, keep track of digits and emit a byte when a pair
of hex digits is found. The space is optional unless the error
handling is defined to be 'strict'. | [
"\\",
"Incremental",
"encode",
"keep",
"track",
"of",
"digits",
"and",
"emit",
"a",
"byte",
"when",
"a",
"pair",
"of",
"hex",
"digits",
"is",
"found",
".",
"The",
"space",
"is",
"optional",
"unless",
"the",
"error",
"handling",
"is",
"defined",
"to",
"be... | def encode(self, data, final=False):
"""\
Incremental encode, keep track of digits and emit a byte when a pair
of hex digits is found. The space is optional unless the error
handling is defined to be 'strict'.
"""
state = self.state
encoded = []
for c in d... | [
"def",
"encode",
"(",
"self",
",",
"data",
",",
"final",
"=",
"False",
")",
":",
"state",
"=",
"self",
".",
"state",
"encoded",
"=",
"[",
"]",
"for",
"c",
"in",
"data",
".",
"upper",
"(",
")",
":",
"if",
"c",
"in",
"HEXDIGITS",
":",
"z",
"=",
... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/tools/hexlify_codec.py#L72-L96 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | python/artm/master_component.py | python | MasterComponent.import_score_tracker | (self, filename) | :param str filename: the name of file to load score tracker from binary format | :param str filename: the name of file to load score tracker from binary format | [
":",
"param",
"str",
"filename",
":",
"the",
"name",
"of",
"file",
"to",
"load",
"score",
"tracker",
"from",
"binary",
"format"
] | def import_score_tracker(self, filename):
"""
:param str filename: the name of file to load score tracker from binary format
"""
args = messages.ImportScoreTrackerArgs(file_name=filename)
result = self._lib.ArtmImportScoreTracker(self.master_id, args) | [
"def",
"import_score_tracker",
"(",
"self",
",",
"filename",
")",
":",
"args",
"=",
"messages",
".",
"ImportScoreTrackerArgs",
"(",
"file_name",
"=",
"filename",
")",
"result",
"=",
"self",
".",
"_lib",
".",
"ArtmImportScoreTracker",
"(",
"self",
".",
"master_... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/master_component.py#L1002-L1007 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py | python | Message.getrawheader | (self, name) | return ''.join(lst) | A higher-level interface to getfirstmatchingheader().
Return a string containing the literal text of the header but with the
keyword stripped. All leading, trailing and embedded whitespace is
kept in the string, however. Return None if the header does not
occur. | A higher-level interface to getfirstmatchingheader(). | [
"A",
"higher",
"-",
"level",
"interface",
"to",
"getfirstmatchingheader",
"()",
"."
] | def getrawheader(self, name):
"""A higher-level interface to getfirstmatchingheader().
Return a string containing the literal text of the header but with the
keyword stripped. All leading, trailing and embedded whitespace is
kept in the string, however. Return None if the header does ... | [
"def",
"getrawheader",
"(",
"self",
",",
"name",
")",
":",
"lst",
"=",
"self",
".",
"getfirstmatchingheader",
"(",
"name",
")",
"if",
"not",
"lst",
":",
"return",
"None",
"lst",
"[",
"0",
"]",
"=",
"lst",
"[",
"0",
"]",
"[",
"len",
"(",
"name",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py#L270-L283 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/pydocview/FindService.py | python | FindService.OnFindClose | (self, event) | Cleanup handles when find/replace dialog is closed | Cleanup handles when find/replace dialog is closed | [
"Cleanup",
"handles",
"when",
"find",
"/",
"replace",
"dialog",
"is",
"closed"
] | def OnFindClose(self, event):
""" Cleanup handles when find/replace dialog is closed """
if self._findDialog != None:
self._findDialog = None
elif self._replaceDialog != None:
self._replaceDialog = None | [
"def",
"OnFindClose",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"_findDialog",
"!=",
"None",
":",
"self",
".",
"_findDialog",
"=",
"None",
"elif",
"self",
".",
"_replaceDialog",
"!=",
"None",
":",
"self",
".",
"_replaceDialog",
"=",
"None"
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pydocview/FindService.py#L138-L143 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py | python | WindowRenderInfo.first_visible_line | (self, after_scroll_offset: bool = False) | Return the line number (0 based) of the input document that corresponds
with the first visible line. | Return the line number (0 based) of the input document that corresponds
with the first visible line. | [
"Return",
"the",
"line",
"number",
"(",
"0",
"based",
")",
"of",
"the",
"input",
"document",
"that",
"corresponds",
"with",
"the",
"first",
"visible",
"line",
"."
] | def first_visible_line(self, after_scroll_offset: bool = False) -> int:
"""
Return the line number (0 based) of the input document that corresponds
with the first visible line.
"""
if after_scroll_offset:
return self.displayed_lines[self.applied_scroll_offsets.top]
... | [
"def",
"first_visible_line",
"(",
"self",
",",
"after_scroll_offset",
":",
"bool",
"=",
"False",
")",
"->",
"int",
":",
"if",
"after_scroll_offset",
":",
"return",
"self",
".",
"displayed_lines",
"[",
"self",
".",
"applied_scroll_offsets",
".",
"top",
"]",
"el... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py#L1242-L1250 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/abc.py | python | Serializable.device_serialize | (self) | return header, frames | Serialize data and metadata associated with device memory.
Returns
-------
header : dict
The metadata required to reconstruct the object.
frames : list
The Buffers or memoryviews that the object should contain.
:meta private: | Serialize data and metadata associated with device memory. | [
"Serialize",
"data",
"and",
"metadata",
"associated",
"with",
"device",
"memory",
"."
] | def device_serialize(self):
"""Serialize data and metadata associated with device memory.
Returns
-------
header : dict
The metadata required to reconstruct the object.
frames : list
The Buffers or memoryviews that the object should contain.
:met... | [
"def",
"device_serialize",
"(",
"self",
")",
":",
"header",
",",
"frames",
"=",
"self",
".",
"serialize",
"(",
")",
"assert",
"all",
"(",
"(",
"type",
"(",
"f",
")",
"in",
"[",
"cudf",
".",
"core",
".",
"buffer",
".",
"Buffer",
",",
"memoryview",
"... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/abc.py#L85-L106 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/typing.py | python | _SpecialForm.__new__ | (cls, *args, **kwds) | return super().__new__(cls) | Constructor.
This only exists to give a better error message in case
someone tries to subclass a special typing object (not a good idea). | Constructor. | [
"Constructor",
"."
] | def __new__(cls, *args, **kwds):
"""Constructor.
This only exists to give a better error message in case
someone tries to subclass a special typing object (not a good idea).
"""
if (len(args) == 3 and
isinstance(args[0], str) and
isinstance(args[1... | [
"def",
"__new__",
"(",
"cls",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"(",
"len",
"(",
"args",
")",
"==",
"3",
"and",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"str",
")",
"and",
"isinstance",
"(",
"args",
"[",
"1",
"]",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/typing.py#L300-L311 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rfc822.py | python | Message.getfirstmatchingheader | (self, name) | return lst | Get the first header line matching name.
This is similar to getallmatchingheaders, but it returns only the
first matching header (and its continuation lines). | Get the first header line matching name. | [
"Get",
"the",
"first",
"header",
"line",
"matching",
"name",
"."
] | def getfirstmatchingheader(self, name):
"""Get the first header line matching name.
This is similar to getallmatchingheaders, but it returns only the
first matching header (and its continuation lines).
"""
name = name.lower() + ':'
n = len(name)
lst = []
... | [
"def",
"getfirstmatchingheader",
"(",
"self",
",",
"name",
")",
":",
"name",
"=",
"name",
".",
"lower",
"(",
")",
"+",
"':'",
"n",
"=",
"len",
"(",
"name",
")",
"lst",
"=",
"[",
"]",
"hit",
"=",
"0",
"for",
"line",
"in",
"self",
".",
"headers",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rfc822.py#L250-L268 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/lib/hl_api_simulation.py | python | Cleanup | () | Cleans up resources after a `Run` call. Not needed for `Simulate`.
Closes state for a series of runs, such as flushing and closing files.
A `Prepare` is needed after a `Cleanup` before any more calls to `Run`.
See Also
--------
Run, Prepare | Cleans up resources after a `Run` call. Not needed for `Simulate`. | [
"Cleans",
"up",
"resources",
"after",
"a",
"Run",
"call",
".",
"Not",
"needed",
"for",
"Simulate",
"."
] | def Cleanup():
"""Cleans up resources after a `Run` call. Not needed for `Simulate`.
Closes state for a series of runs, such as flushing and closing files.
A `Prepare` is needed after a `Cleanup` before any more calls to `Run`.
See Also
--------
Run, Prepare
"""
sr('Cleanup') | [
"def",
"Cleanup",
"(",
")",
":",
"sr",
"(",
"'Cleanup'",
")"
] | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_simulation.py#L123-L134 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PreviewFrame.CreateControlBar | (*args, **kwargs) | return _windows_.PreviewFrame_CreateControlBar(*args, **kwargs) | CreateControlBar(self) | CreateControlBar(self) | [
"CreateControlBar",
"(",
"self",
")"
] | def CreateControlBar(*args, **kwargs):
"""CreateControlBar(self)"""
return _windows_.PreviewFrame_CreateControlBar(*args, **kwargs) | [
"def",
"CreateControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PreviewFrame_CreateControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L5497-L5499 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/init_ops.py | python | glorot_normal_initializer | (seed=None, dtype=dtypes.float32) | return variance_scaling_initializer(scale=1.0,
mode="fan_avg",
distribution="normal",
seed=seed,
dtype=dtype) | The Glorot normal initializer, also called Xavier normal initializer.
It draws samples from a truncated normal distribution centered on 0
with `stddev = sqrt(2 / (fan_in + fan_out))`
where `fan_in` is the number of input units in the weight tensor
and `fan_out` is the number of output units in the weight tenso... | The Glorot normal initializer, also called Xavier normal initializer. | [
"The",
"Glorot",
"normal",
"initializer",
"also",
"called",
"Xavier",
"normal",
"initializer",
"."
] | def glorot_normal_initializer(seed=None, dtype=dtypes.float32):
"""The Glorot normal initializer, also called Xavier normal initializer.
It draws samples from a truncated normal distribution centered on 0
with `stddev = sqrt(2 / (fan_in + fan_out))`
where `fan_in` is the number of input units in the weight ten... | [
"def",
"glorot_normal_initializer",
"(",
"seed",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
")",
":",
"return",
"variance_scaling_initializer",
"(",
"scale",
"=",
"1.0",
",",
"mode",
"=",
"\"fan_avg\"",
",",
"distribution",
"=",
"\"normal\"",
",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/init_ops.py#L553-L576 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/datasets/pascal_voc.py | python | pascal_voc._load_image_set_index | (self) | return image_index | Load the indexes listed in this dataset's image set file. | Load the indexes listed in this dataset's image set file. | [
"Load",
"the",
"indexes",
"listed",
"in",
"this",
"dataset",
"s",
"image",
"set",
"file",
"."
] | def _load_image_set_index(self):
"""
Load the indexes listed in this dataset's image set file.
"""
# Example path to image set file:
# self._devkit_path + /VOCdevkit2007/VOC2007/ImageSets/Main/val.txt
image_set_file = os.path.join(self._data_path, 'ImageSets', 'Main',
... | [
"def",
"_load_image_set_index",
"(",
"self",
")",
":",
"# Example path to image set file:",
"# self._devkit_path + /VOCdevkit2007/VOC2007/ImageSets/Main/val.txt",
"image_set_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_data_path",
",",
"'ImageSets'",
",",... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/datasets/pascal_voc.py#L73-L85 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L1384-L1386 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/USANSReduction.py | python | USANSReduction._load_data | (self) | return total_points | Load data and go through each file to determine how many points
will have to be dealt with. | Load data and go through each file to determine how many points
will have to be dealt with. | [
"Load",
"data",
"and",
"go",
"through",
"each",
"file",
"to",
"determine",
"how",
"many",
"points",
"will",
"have",
"to",
"be",
"dealt",
"with",
"."
] | def _load_data(self):
"""
Load data and go through each file to determine how many points
will have to be dealt with.
"""
# Load the empty run
empty_run = self.getProperty("EmptyRun").value
Load(Filename='USANS_%s' % empty_run, LoadMonitors=True, OutputWor... | [
"def",
"_load_data",
"(",
"self",
")",
":",
"# Load the empty run",
"empty_run",
"=",
"self",
".",
"getProperty",
"(",
"\"EmptyRun\"",
")",
".",
"value",
"Load",
"(",
"Filename",
"=",
"'USANS_%s'",
"%",
"empty_run",
",",
"LoadMonitors",
"=",
"True",
",",
"Ou... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/USANSReduction.py#L73-L129 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py | python | fix_input_files_for_numbered_seq | (sourceDir, suffix, timestamp, containers) | Fixes files used as input when pre-processing MPL-containers in their numbered form. | Fixes files used as input when pre-processing MPL-containers in their numbered form. | [
"Fixes",
"files",
"used",
"as",
"input",
"when",
"pre",
"-",
"processing",
"MPL",
"-",
"containers",
"in",
"their",
"numbered",
"form",
"."
] | def fix_input_files_for_numbered_seq(sourceDir, suffix, timestamp, containers):
"""Fixes files used as input when pre-processing MPL-containers in their numbered form."""
# Fix input files for each MPL-container type.
for container in containers:
files = glob.glob( os.path.join( sourceDir, container... | [
"def",
"fix_input_files_for_numbered_seq",
"(",
"sourceDir",
",",
"suffix",
",",
"timestamp",
",",
"containers",
")",
":",
"# Fix input files for each MPL-container type.",
"for",
"container",
"in",
"containers",
":",
"files",
"=",
"glob",
".",
"glob",
"(",
"os",
".... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py#L114-L120 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBModuleSpec.SetTriple | (self, *args) | return _lldb.SBModuleSpec_SetTriple(self, *args) | SetTriple(self, str triple) | SetTriple(self, str triple) | [
"SetTriple",
"(",
"self",
"str",
"triple",
")"
] | def SetTriple(self, *args):
"""SetTriple(self, str triple)"""
return _lldb.SBModuleSpec_SetTriple(self, *args) | [
"def",
"SetTriple",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBModuleSpec_SetTriple",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6560-L6562 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | docs/tutorials/shared/tutorial_helpers.py | python | non_max_suppression | (regions, overlap_threshold, categories) | return final_regions | Given a list of `regions` (returned by a call to `get_regions`), remove
any overlapping bounding boxes for the same object.
`overlap_threshold` is the minimum amount of overlap needed between two
boxes for them to be considered the same.
`categories` is a list of categories that represent the type of ... | Given a list of `regions` (returned by a call to `get_regions`), remove
any overlapping bounding boxes for the same object. | [
"Given",
"a",
"list",
"of",
"regions",
"(",
"returned",
"by",
"a",
"call",
"to",
"get_regions",
")",
"remove",
"any",
"overlapping",
"bounding",
"boxes",
"for",
"the",
"same",
"object",
"."
] | def non_max_suppression(regions, overlap_threshold, categories):
"""Given a list of `regions` (returned by a call to `get_regions`), remove
any overlapping bounding boxes for the same object.
`overlap_threshold` is the minimum amount of overlap needed between two
boxes for them to be considered the sam... | [
"def",
"non_max_suppression",
"(",
"regions",
",",
"overlap_threshold",
",",
"categories",
")",
":",
"if",
"not",
"regions",
":",
"# If list of regions is empty, return an empty list",
"return",
"[",
"]",
"final_regions",
"=",
"[",
"]",
"for",
"c",
"in",
"categories... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/docs/tutorials/shared/tutorial_helpers.py#L493-L557 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | GraphicsContext.DrawEllipse | (*args, **kwargs) | return _gdi_.GraphicsContext_DrawEllipse(*args, **kwargs) | DrawEllipse(self, Double x, Double y, Double w, Double h)
Draws an ellipse. | DrawEllipse(self, Double x, Double y, Double w, Double h) | [
"DrawEllipse",
"(",
"self",
"Double",
"x",
"Double",
"y",
"Double",
"w",
"Double",
"h",
")"
] | def DrawEllipse(*args, **kwargs):
"""
DrawEllipse(self, Double x, Double y, Double w, Double h)
Draws an ellipse.
"""
return _gdi_.GraphicsContext_DrawEllipse(*args, **kwargs) | [
"def",
"DrawEllipse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_DrawEllipse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6490-L6496 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathPropertyEditor.py | python | Types | () | return [t for t in _EditorFactory] | Return the types of properties supported. | Return the types of properties supported. | [
"Return",
"the",
"types",
"of",
"properties",
"supported",
"."
] | def Types():
"""Return the types of properties supported."""
return [t for t in _EditorFactory] | [
"def",
"Types",
"(",
")",
":",
"return",
"[",
"t",
"for",
"t",
"in",
"_EditorFactory",
"]"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathPropertyEditor.py#L229-L231 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/mox.py | python | MockObject.__call__ | (self, *params, **named_params) | return mock_method(*params, **named_params) | Provide custom logic for mocking classes that are callable. | Provide custom logic for mocking classes that are callable. | [
"Provide",
"custom",
"logic",
"for",
"mocking",
"classes",
"that",
"are",
"callable",
"."
] | def __call__(self, *params, **named_params):
"""Provide custom logic for mocking classes that are callable."""
# Verify the class we are mocking is callable
callable = self._class_to_mock.__dict__.get('__call__', None)
if callable is None:
raise TypeError('Not callable')
# Because the call i... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"params",
",",
"*",
"*",
"named_params",
")",
":",
"# Verify the class we are mocking is callable",
"callable",
"=",
"self",
".",
"_class_to_mock",
".",
"__dict__",
".",
"get",
"(",
"'__call__'",
",",
"None",
")",
"if"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L490-L501 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.node_recipients | (self, node_name, is_control=False, device_name=None) | Get recipient of the given node's output according to partition graphs.
Args:
node_name: (`str`) name of the node.
is_control: (`bool`) whether control outputs, rather than non-control
outputs, are to be returned.
device_name: (`str`) name of the device. If there is only one device or if
... | Get recipient of the given node's output according to partition graphs. | [
"Get",
"recipient",
"of",
"the",
"given",
"node",
"s",
"output",
"according",
"to",
"partition",
"graphs",
"."
] | def node_recipients(self, node_name, is_control=False, device_name=None):
"""Get recipient of the given node's output according to partition graphs.
Args:
node_name: (`str`) name of the node.
is_control: (`bool`) whether control outputs, rather than non-control
outputs, are to be returned.
... | [
"def",
"node_recipients",
"(",
"self",
",",
"node_name",
",",
"is_control",
"=",
"False",
",",
"device_name",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_debug_graphs",
":",
"raise",
"LookupError",
"(",
"\"Node recipients are not loaded from partition graphs ... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_data.py#L1227-L1254 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_search.py | python | EdSearchCtrl.OnCancel | (self, evt) | Cancels the Search Query
@param evt: SearchCtrl event | Cancels the Search Query
@param evt: SearchCtrl event | [
"Cancels",
"the",
"Search",
"Query",
"@param",
"evt",
":",
"SearchCtrl",
"event"
] | def OnCancel(self, evt):
"""Cancels the Search Query
@param evt: SearchCtrl event
"""
self.SetValue(u"")
self.ShowCancelButton(False)
evt.Skip() | [
"def",
"OnCancel",
"(",
"self",
",",
"evt",
")",
":",
"self",
".",
"SetValue",
"(",
"u\"\"",
")",
"self",
".",
"ShowCancelButton",
"(",
"False",
")",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_search.py#L1164-L1171 | ||
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/kafka_batch_io_dataset_ops.py | python | KafkaBatchIODataset.__init__ | (
self,
topics,
group_id,
servers,
stream_timeout=-1,
message_poll_timeout=10000,
configuration=None,
internal=True,
) | Args:
topics: A `tf.string` tensor containing topic names in [topic] format.
For example: ["topic1"]
group_id: The id of the consumer group. For example: cgstream
servers: An optional list of bootstrap servers.
For example: `localhost:9092`.
stream_timeout... | Args:
topics: A `tf.string` tensor containing topic names in [topic] format.
For example: ["topic1"]
group_id: The id of the consumer group. For example: cgstream
servers: An optional list of bootstrap servers.
For example: `localhost:9092`.
stream_timeout... | [
"Args",
":",
"topics",
":",
"A",
"tf",
".",
"string",
"tensor",
"containing",
"topic",
"names",
"in",
"[",
"topic",
"]",
"format",
".",
"For",
"example",
":",
"[",
"topic1",
"]",
"group_id",
":",
"The",
"id",
"of",
"the",
"consumer",
"group",
".",
"F... | def __init__(
self,
topics,
group_id,
servers,
stream_timeout=-1,
message_poll_timeout=10000,
configuration=None,
internal=True,
):
"""
Args:
topics: A `tf.string` tensor containing topic names in [topic] format.
F... | [
"def",
"__init__",
"(",
"self",
",",
"topics",
",",
"group_id",
",",
"servers",
",",
"stream_timeout",
"=",
"-",
"1",
",",
"message_poll_timeout",
"=",
"10000",
",",
"configuration",
"=",
"None",
",",
"internal",
"=",
"True",
",",
")",
":",
"with",
"tf",... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/kafka_batch_io_dataset_ops.py#L70-L158 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | QueryLayoutInfoEvent.__init__ | (self, *args, **kwargs) | __init__(self, int id=0) -> QueryLayoutInfoEvent | __init__(self, int id=0) -> QueryLayoutInfoEvent | [
"__init__",
"(",
"self",
"int",
"id",
"=",
"0",
")",
"-",
">",
"QueryLayoutInfoEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, int id=0) -> QueryLayoutInfoEvent"""
_windows_.QueryLayoutInfoEvent_swiginit(self,_windows_.new_QueryLayoutInfoEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"QueryLayoutInfoEvent_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_QueryLayoutInfoEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1954-L1956 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip_w.py | python | CalltipWindow.showcontents | (self) | Create the call-tip widget. | Create the call-tip widget. | [
"Create",
"the",
"call",
"-",
"tip",
"widget",
"."
] | def showcontents(self):
"""Create the call-tip widget."""
self.label = Label(self.tipwindow, text=self.text, justify=LEFT,
background="#ffffd0", foreground="black",
relief=SOLID, borderwidth=1,
font=self.anchor_widget['font... | [
"def",
"showcontents",
"(",
"self",
")",
":",
"self",
".",
"label",
"=",
"Label",
"(",
"self",
".",
"tipwindow",
",",
"text",
"=",
"self",
".",
"text",
",",
"justify",
"=",
"LEFT",
",",
"background",
"=",
"\"#ffffd0\"",
",",
"foreground",
"=",
"\"black... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip_w.py#L80-L86 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/path.py/path.py | python | Path.lstat | (self) | return os.lstat(self) | Like :meth:`stat`, but do not follow symbolic links.
.. seealso:: :meth:`stat`, :func:`os.lstat` | Like :meth:`stat`, but do not follow symbolic links. | [
"Like",
":",
"meth",
":",
"stat",
"but",
"do",
"not",
"follow",
"symbolic",
"links",
"."
] | def lstat(self):
""" Like :meth:`stat`, but do not follow symbolic links.
.. seealso:: :meth:`stat`, :func:`os.lstat`
"""
return os.lstat(self) | [
"def",
"lstat",
"(",
"self",
")",
":",
"return",
"os",
".",
"lstat",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/path.py/path.py#L1076-L1081 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/diffraction/diffraction_reduction_script.py | python | DiffractionReductionScripter.constructPythonScript | (self, paramdict) | return script | Construct python script | Construct python script | [
"Construct",
"python",
"script"
] | def constructPythonScript(self, paramdict):
""" Construct python script
"""
# 1. Obtain all information
runsetupdict = paramdict["RunSetupWidget"]
advsetupdict = paramdict["AdvancedSetupWidget"]
filterdict = paramdict["FilterSetupWidget"]
# 2. Obtain some informa... | [
"def",
"constructPythonScript",
"(",
"self",
",",
"paramdict",
")",
":",
"# 1. Obtain all information",
"runsetupdict",
"=",
"paramdict",
"[",
"\"RunSetupWidget\"",
"]",
"advsetupdict",
"=",
"paramdict",
"[",
"\"AdvancedSetupWidget\"",
"]",
"filterdict",
"=",
"paramdict... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/diffraction/diffraction_reduction_script.py#L136-L230 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | TranslationUnit.codeComplete | (self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False) | return None | Code complete in this translation unit.
In-memory contents for files can be provided by passing a list of pairs
as unsaved_files, the first items should be the filenames to be mapped
and the second should be the contents to be substituted for the
file. The contents may be passed as stri... | Code complete in this translation unit. | [
"Code",
"complete",
"in",
"this",
"translation",
"unit",
"."
] | def codeComplete(self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False):
"""
Code complete in this translation unit.
In-memory contents for files can be provided by passing a list o... | [
"def",
"codeComplete",
"(",
"self",
",",
"path",
",",
"line",
",",
"column",
",",
"unsaved_files",
"=",
"None",
",",
"include_macros",
"=",
"False",
",",
"include_code_patterns",
"=",
"False",
",",
"include_brief_comments",
"=",
"False",
")",
":",
"options",
... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L2763-L2806 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | plugins/wb.admin/backend/wb_log_reader.py | python | BaseLogFileReader._shorten_query_field | (self, data) | return data if l <= 256 else data + ' [truncated, %s total]' % size | Receives a query stored in a log file and prepares it for the output in
the log viewer shortening to 256 characters and taking care of encoding issues | Receives a query stored in a log file and prepares it for the output in
the log viewer shortening to 256 characters and taking care of encoding issues | [
"Receives",
"a",
"query",
"stored",
"in",
"a",
"log",
"file",
"and",
"prepares",
"it",
"for",
"the",
"output",
"in",
"the",
"log",
"viewer",
"shortening",
"to",
"256",
"characters",
"and",
"taking",
"care",
"of",
"encoding",
"issues"
] | def _shorten_query_field(self, data):
'''
Receives a query stored in a log file and prepares it for the output in
the log viewer shortening to 256 characters and taking care of encoding issues
'''
l = len(data)
abbr = data[:256]
size = '%d bytes' % l i... | [
"def",
"_shorten_query_field",
"(",
"self",
",",
"data",
")",
":",
"l",
"=",
"len",
"(",
"data",
")",
"abbr",
"=",
"data",
"[",
":",
"256",
"]",
"size",
"=",
"'%d bytes'",
"%",
"l",
"if",
"l",
"<",
"1024",
"else",
"'%.1f KB'",
"%",
"(",
"l",
"/",... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_log_reader.py#L476-L484 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | examples/fairmotion_interface.py | python | FairmotionInterface.load_model | (self) | Loads the model currently set by metadata. | Loads the model currently set by metadata. | [
"Loads",
"the",
"model",
"currently",
"set",
"by",
"metadata",
"."
] | def load_model(self) -> None:
"""
Loads the model currently set by metadata.
"""
# loading text because the setup pauses here during motion load
logger.info("Loading...")
self.hide_model()
self.activity = Activity.MOTION_STAGE
# keeps the model up to date... | [
"def",
"load_model",
"(",
"self",
")",
"->",
"None",
":",
"# loading text because the setup pauses here during motion load",
"logger",
".",
"info",
"(",
"\"Loading...\"",
")",
"self",
".",
"hide_model",
"(",
")",
"self",
".",
"activity",
"=",
"Activity",
".",
"MOT... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/examples/fairmotion_interface.py#L312-L335 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | PyControl.DoGetVirtualSize | (*args, **kwargs) | return _controls_.PyControl_DoGetVirtualSize(*args, **kwargs) | DoGetVirtualSize(self) -> Size | DoGetVirtualSize(self) -> Size | [
"DoGetVirtualSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def DoGetVirtualSize(*args, **kwargs):
"""DoGetVirtualSize(self) -> Size"""
return _controls_.PyControl_DoGetVirtualSize(*args, **kwargs) | [
"def",
"DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"PyControl_DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5870-L5872 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | SelectionDataModel._buildPropPath | (self, primPath, propName) | return Sdf.Path(str(primPath) + "." + propName) | Build a new property path from a prim path and a property name. | Build a new property path from a prim path and a property name. | [
"Build",
"a",
"new",
"property",
"path",
"from",
"a",
"prim",
"path",
"and",
"a",
"property",
"name",
"."
] | def _buildPropPath(self, primPath, propName):
"""Build a new property path from a prim path and a property name."""
return Sdf.Path(str(primPath) + "." + propName) | [
"def",
"_buildPropPath",
"(",
"self",
",",
"primPath",
",",
"propName",
")",
":",
"return",
"Sdf",
".",
"Path",
"(",
"str",
"(",
"primPath",
")",
"+",
"\".\"",
"+",
"propName",
")"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L521-L524 | |
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | scripts/build/msgfmt.py | python | generate | () | return output | Return the generated output. | Return the generated output. | [
"Return",
"the",
"generated",
"output",
"."
] | def generate():
"Return the generated output."
global MESSAGES
# the keys are sorted in the .mo file
keys = sorted(MESSAGES.keys())
offsets = []
ids = strs = b''
for id in keys:
# For each string, we need size and file offset. Each string is NUL
# terminated; the NUL does no... | [
"def",
"generate",
"(",
")",
":",
"global",
"MESSAGES",
"# the keys are sorted in the .mo file",
"keys",
"=",
"sorted",
"(",
"MESSAGES",
".",
"keys",
"(",
")",
")",
"offsets",
"=",
"[",
"]",
"ids",
"=",
"strs",
"=",
"b''",
"for",
"id",
"in",
"keys",
":",... | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/scripts/build/msgfmt.py#L58-L96 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/docs/tools/dump_ast_matchers.py | python | extract_result_types | (comment) | Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'] in case of 'Any Matcher', or ['T1', 'T... | Extracts a list of result types from the given comment. | [
"Extracts",
"a",
"list",
"of",
"result",
"types",
"from",
"the",
"given",
"comment",
"."
] | def extract_result_types(comment):
"""Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'... | [
"def",
"extract_result_types",
"(",
"comment",
")",
":",
"result_types",
"=",
"[",
"]",
"m",
"=",
"re",
".",
"search",
"(",
"r'Usable as: Any Matcher[\\s\\n]*$'",
",",
"comment",
",",
"re",
".",
"S",
")",
"if",
"m",
":",
"return",
"[",
"'*'",
"]",
"while... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/docs/tools/dump_ast_matchers.py#L60-L83 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | InstalledDistribution.exports | (self) | return result | Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name. | Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name. | [
"Return",
"the",
"information",
"exported",
"by",
"this",
"distribution",
".",
":",
"return",
":",
"A",
"dictionary",
"of",
"exports",
"mapping",
"an",
"export",
"category",
"to",
"a",
"dict",
"of",
":",
"class",
":",
"ExportEntry",
"instances",
"describing",
... | def exports(self):
"""
Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name.
"""
... | [
"def",
"exports",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"EXPORTS_FILENAME",
")",
"if",
"r",
":",
"result",
"=",
"self",
".",
"read_exports",
"(",
")",
"return",
"result"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L584-L595 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/message.py | python | Message.__eq__ | (self, other_msg) | Recursively compares two messages by value and structure. | Recursively compares two messages by value and structure. | [
"Recursively",
"compares",
"two",
"messages",
"by",
"value",
"and",
"structure",
"."
] | def __eq__(self, other_msg):
"""Recursively compares two messages by value and structure."""
raise NotImplementedError | [
"def",
"__eq__",
"(",
"self",
",",
"other_msg",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/message.py#L74-L76 | ||
1989Ryan/Semantic_SLAM | 0284b3f832ca431c494f9c134fe46c40ec86ee38 | Third_Part/PSPNet_Keras_tensorflow/Semantic_Information_Publisher.py | python | Semantic_Imformation_Publisher.__init__ | (self) | node initialization | node initialization | [
"node",
"initialization"
] | def __init__(self):
'''
node initialization
'''
self._cv_bridge = CvBridge()
#self._session = tf.Session()
self.pspnet = PSPNet101(nb_classes=19, input_shape=(713, 713),
weights='pspnet101_cityscapes')
#init = tf.global_varia... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_cv_bridge",
"=",
"CvBridge",
"(",
")",
"#self._session = tf.Session()",
"self",
".",
"pspnet",
"=",
"PSPNet101",
"(",
"nb_classes",
"=",
"19",
",",
"input_shape",
"=",
"(",
"713",
",",
"713",
")",
... | https://github.com/1989Ryan/Semantic_SLAM/blob/0284b3f832ca431c494f9c134fe46c40ec86ee38/Third_Part/PSPNet_Keras_tensorflow/Semantic_Information_Publisher.py#L30-L42 | ||
apache/trafodion | 8455c839ad6b6d7b6e04edda5715053095b78046 | install/python-installer/scripts/traf_discover.py | python | Discover.get_cpu_cores | (self) | return self.CPUINFO.count('processor') | get CPU cores | get CPU cores | [
"get",
"CPU",
"cores"
] | def get_cpu_cores(self):
""" get CPU cores """
return self.CPUINFO.count('processor') | [
"def",
"get_cpu_cores",
"(",
"self",
")",
":",
"return",
"self",
".",
"CPUINFO",
".",
"count",
"(",
"'processor'",
")"
] | https://github.com/apache/trafodion/blob/8455c839ad6b6d7b6e04edda5715053095b78046/install/python-installer/scripts/traf_discover.py#L188-L190 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_mode_switcher_view.py | python | TFAsymmetryModeSwitcherView.__init__ | (self, parent: QWidget = None) | Initializes the TFAsymmetryModeSwitcherView. | Initializes the TFAsymmetryModeSwitcherView. | [
"Initializes",
"the",
"TFAsymmetryModeSwitcherView",
"."
] | def __init__(self, parent: QWidget = None):
"""Initializes the TFAsymmetryModeSwitcherView."""
super(TFAsymmetryModeSwitcherView, self).__init__(parent)
self.setupUi(self) | [
"def",
"__init__",
"(",
"self",
",",
"parent",
":",
"QWidget",
"=",
"None",
")",
":",
"super",
"(",
"TFAsymmetryModeSwitcherView",
",",
"self",
")",
".",
"__init__",
"(",
"parent",
")",
"self",
".",
"setupUi",
"(",
"self",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_mode_switcher_view.py#L22-L25 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp3/ctptd.py | python | CtpTd.onRspQryInstrumentOrderCommRate | (self, InstrumentOrderCommRateField, RspInfoField, requestId, final) | 请求查询报单手续费响应 | 请求查询报单手续费响应 | [
"请求查询报单手续费响应"
] | def onRspQryInstrumentOrderCommRate(self, InstrumentOrderCommRateField, RspInfoField, requestId, final):
"""请求查询报单手续费响应"""
pass | [
"def",
"onRspQryInstrumentOrderCommRate",
"(",
"self",
",",
"InstrumentOrderCommRateField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L306-L308 | ||
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py | python | _AddPrivateHelperMethods | (message_descriptor, cls) | Adds implementation of private helper methods to cls. | Adds implementation of private helper methods to cls. | [
"Adds",
"implementation",
"of",
"private",
"helper",
"methods",
"to",
"cls",
"."
] | def _AddPrivateHelperMethods(message_descriptor, cls):
"""Adds implementation of private helper methods to cls."""
def Modified(self):
"""Sets the _cached_byte_size_dirty bit to true,
and propagates this to our listener iff this was a state change.
"""
# Note: Some callers check _cached_byte_size... | [
"def",
"_AddPrivateHelperMethods",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"def",
"Modified",
"(",
"self",
")",
":",
"\"\"\"Sets the _cached_byte_size_dirty bit to true,\n and propagates this to our listener iff this was a state change.\n \"\"\"",
"# Note: Some callers ... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py#L1333-L1364 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/sinh_arcsinh.py | python | SinhArcsinh.tailweight | (self) | return self._tailweight | The `tailweight` in: `Y = Sinh((Arcsinh(X) + skewness) * tailweight)`. | The `tailweight` in: `Y = Sinh((Arcsinh(X) + skewness) * tailweight)`. | [
"The",
"tailweight",
"in",
":",
"Y",
"=",
"Sinh",
"((",
"Arcsinh",
"(",
"X",
")",
"+",
"skewness",
")",
"*",
"tailweight",
")",
"."
] | def tailweight(self):
"""The `tailweight` in: `Y = Sinh((Arcsinh(X) + skewness) * tailweight)`."""
return self._tailweight | [
"def",
"tailweight",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tailweight"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/sinh_arcsinh.py#L152-L154 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/key_ranges.py | python | KeyRangesFactory.create_from_list | (cls, list_of_key_ranges) | return _KeyRangesFromList(list_of_key_ranges) | Create a KeyRanges object.
Args:
list_of_key_ranges: a list of key_range.KeyRange object.
Returns:
A _KeyRanges object. | Create a KeyRanges object. | [
"Create",
"a",
"KeyRanges",
"object",
"."
] | def create_from_list(cls, list_of_key_ranges):
"""Create a KeyRanges object.
Args:
list_of_key_ranges: a list of key_range.KeyRange object.
Returns:
A _KeyRanges object.
"""
return _KeyRangesFromList(list_of_key_ranges) | [
"def",
"create_from_list",
"(",
"cls",
",",
"list_of_key_ranges",
")",
":",
"return",
"_KeyRangesFromList",
"(",
"list_of_key_ranges",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/key_ranges.py#L21-L30 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | openr/py/openr/cli/clis/decision.py | python | DecisionRibPolicyCli.show | (cli_opts) | Show currently configured RibPolicy | Show currently configured RibPolicy | [
"Show",
"currently",
"configured",
"RibPolicy"
] | def show(cli_opts): # noqa: B902
"""
Show currently configured RibPolicy
"""
decision.DecisionRibPolicyCmd(cli_opts).run() | [
"def",
"show",
"(",
"cli_opts",
")",
":",
"# noqa: B902",
"decision",
".",
"DecisionRibPolicyCmd",
"(",
"cli_opts",
")",
".",
"run",
"(",
")"
] | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/clis/decision.py#L157-L162 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | StandardDialogLayoutAdapter.CreateScrolledWindow | (*args, **kwargs) | return _windows_.StandardDialogLayoutAdapter_CreateScrolledWindow(*args, **kwargs) | CreateScrolledWindow(self, Window parent) -> ScrolledWindow | CreateScrolledWindow(self, Window parent) -> ScrolledWindow | [
"CreateScrolledWindow",
"(",
"self",
"Window",
"parent",
")",
"-",
">",
"ScrolledWindow"
] | def CreateScrolledWindow(*args, **kwargs):
"""CreateScrolledWindow(self, Window parent) -> ScrolledWindow"""
return _windows_.StandardDialogLayoutAdapter_CreateScrolledWindow(*args, **kwargs) | [
"def",
"CreateScrolledWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"StandardDialogLayoutAdapter_CreateScrolledWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L979-L981 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/mixture/dpgmm.py | python | _DPGMMBase._update_means | (self, X, z) | Update the variational distributions for the means | Update the variational distributions for the means | [
"Update",
"the",
"variational",
"distributions",
"for",
"the",
"means"
] | def _update_means(self, X, z):
"""Update the variational distributions for the means"""
n_features = X.shape[1]
for k in range(self.n_components):
if self.covariance_type in ['spherical', 'diag']:
num = np.sum(z.T[k].reshape((-1, 1)) * X, axis=0)
num *... | [
"def",
"_update_means",
"(",
"self",
",",
"X",
",",
"z",
")",
":",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"for",
"k",
"in",
"range",
"(",
"self",
".",
"n_components",
")",
":",
"if",
"self",
".",
"covariance_type",
"in",
"[",
"'spheri... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/dpgmm.py#L307-L324 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | _singlefileMailbox.remove | (self, key) | Remove the keyed message; raise KeyError if it doesn't exist. | Remove the keyed message; raise KeyError if it doesn't exist. | [
"Remove",
"the",
"keyed",
"message",
";",
"raise",
"KeyError",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
self._lookup(key)
del self._toc[key]
self._pending = True | [
"def",
"remove",
"(",
"self",
",",
"key",
")",
":",
"self",
".",
"_lookup",
"(",
"key",
")",
"del",
"self",
".",
"_toc",
"[",
"key",
"]",
"self",
".",
"_pending",
"=",
"True"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L600-L604 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/util/system.py | python | set_context | (path, recursive=False) | Calls ``restorecon`` to set the proper context on SELinux systems. Only if
the ``restorecon`` executable is found anywhere in the path it will get
called.
If the ``CEPH_VOLUME_SKIP_RESTORECON`` environment variable is set to
any of: "1", "true", "yes" the call will be skipped as well.
Finally, if ... | Calls ``restorecon`` to set the proper context on SELinux systems. Only if
the ``restorecon`` executable is found anywhere in the path it will get
called. | [
"Calls",
"restorecon",
"to",
"set",
"the",
"proper",
"context",
"on",
"SELinux",
"systems",
".",
"Only",
"if",
"the",
"restorecon",
"executable",
"is",
"found",
"anywhere",
"in",
"the",
"path",
"it",
"will",
"get",
"called",
"."
] | def set_context(path, recursive=False):
"""
Calls ``restorecon`` to set the proper context on SELinux systems. Only if
the ``restorecon`` executable is found anywhere in the path it will get
called.
If the ``CEPH_VOLUME_SKIP_RESTORECON`` environment variable is set to
any of: "1", "true", "yes"... | [
"def",
"set_context",
"(",
"path",
",",
"recursive",
"=",
"False",
")",
":",
"skip",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'CEPH_VOLUME_SKIP_RESTORECON'",
",",
"''",
")",
"if",
"skip",
".",
"lower",
"(",
")",
"in",
"[",
"'1'",
",",
"'true'",
"... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/util/system.py#L342-L380 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/multiarray.py | python | trunc | (x, out=None, **kwargs) | return _mx_nd_np.trunc(x, out=out, **kwargs) | r"""
Return the truncated value of the input, element-wise.
The truncated value of the scalar `x` is the nearest integer `i` which
is closer to zero than `x` is. In short, the fractional part of the
signed number `x` is discarded.
Parameters
----------
x : ndarray or scalar
Input da... | r"""
Return the truncated value of the input, element-wise.
The truncated value of the scalar `x` is the nearest integer `i` which
is closer to zero than `x` is. In short, the fractional part of the
signed number `x` is discarded. | [
"r",
"Return",
"the",
"truncated",
"value",
"of",
"the",
"input",
"element",
"-",
"wise",
".",
"The",
"truncated",
"value",
"of",
"the",
"scalar",
"x",
"is",
"the",
"nearest",
"integer",
"i",
"which",
"is",
"closer",
"to",
"zero",
"than",
"x",
"is",
".... | def trunc(x, out=None, **kwargs):
r"""
Return the truncated value of the input, element-wise.
The truncated value of the scalar `x` is the nearest integer `i` which
is closer to zero than `x` is. In short, the fractional part of the
signed number `x` is discarded.
Parameters
----------
... | [
"def",
"trunc",
"(",
"x",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_mx_nd_np",
".",
"trunc",
"(",
"x",
",",
"out",
"=",
"out",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L5609-L5643 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListCtrl.GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.ListCtrl_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4834-L4849 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/stats/stats.py | python | ttest_ind_from_stats | (mean1, std1, nobs1, mean2, std2, nobs2,
equal_var=True) | return Ttest_indResult(*res) | T-test for means of two independent samples from descriptive statistics.
This is a two-sided test for the null hypothesis that two independent
samples have identical average (expected) values.
Parameters
----------
mean1 : array_like
The mean(s) of sample 1.
std1 : array_like
T... | T-test for means of two independent samples from descriptive statistics. | [
"T",
"-",
"test",
"for",
"means",
"of",
"two",
"independent",
"samples",
"from",
"descriptive",
"statistics",
"."
] | def ttest_ind_from_stats(mean1, std1, nobs1, mean2, std2, nobs2,
equal_var=True):
"""
T-test for means of two independent samples from descriptive statistics.
This is a two-sided test for the null hypothesis that two independent
samples have identical average (expected) values.... | [
"def",
"ttest_ind_from_stats",
"(",
"mean1",
",",
"std1",
",",
"nobs1",
",",
"mean2",
",",
"std2",
",",
"nobs2",
",",
"equal_var",
"=",
"True",
")",
":",
"if",
"equal_var",
":",
"df",
",",
"denom",
"=",
"_equal_var_ttest_denom",
"(",
"std1",
"**",
"2",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/stats.py#L4004-L4089 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetCaretLineBackAlpha | (*args, **kwargs) | return _stc.StyledTextCtrl_GetCaretLineBackAlpha(*args, **kwargs) | GetCaretLineBackAlpha(self) -> int
Get the background alpha of the caret line. | GetCaretLineBackAlpha(self) -> int | [
"GetCaretLineBackAlpha",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCaretLineBackAlpha(*args, **kwargs):
"""
GetCaretLineBackAlpha(self) -> int
Get the background alpha of the caret line.
"""
return _stc.StyledTextCtrl_GetCaretLineBackAlpha(*args, **kwargs) | [
"def",
"GetCaretLineBackAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetCaretLineBackAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5623-L5629 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/dateutil/tz/tz.py | python | datetime_ambiguous | (dt, tz=None) | return not (same_offset and same_dst) | Given a datetime and a time zone, determine whether or not a given datetime
is ambiguous (i.e if there are two times differentiated only by their DST
status).
:param dt:
A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
is provided.)
:param tz:
A :class:`d... | Given a datetime and a time zone, determine whether or not a given datetime
is ambiguous (i.e if there are two times differentiated only by their DST
status). | [
"Given",
"a",
"datetime",
"and",
"a",
"time",
"zone",
"determine",
"whether",
"or",
"not",
"a",
"given",
"datetime",
"is",
"ambiguous",
"(",
"i",
".",
"e",
"if",
"there",
"are",
"two",
"times",
"differentiated",
"only",
"by",
"their",
"DST",
"status",
")... | def datetime_ambiguous(dt, tz=None):
"""
Given a datetime and a time zone, determine whether or not a given datetime
is ambiguous (i.e if there are two times differentiated only by their DST
status).
:param dt:
A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
... | [
"def",
"datetime_ambiguous",
"(",
"dt",
",",
"tz",
"=",
"None",
")",
":",
"if",
"tz",
"is",
"None",
":",
"if",
"dt",
".",
"tzinfo",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Datetime is naive and no time zone provided.'",
")",
"tz",
"=",
"dt",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/tz/tz.py#L1443-L1486 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | benchmark/opperf/nd_operations/binary_operators.py | python | run_mx_binary_element_wise_operators_benchmarks | (ctx=mx.cpu(), dtype='float32', warmup=10, runs=50) | return mx_binary_op_results | Runs benchmarks with the given context and precision (dtype)for all the binary
element_wise operators in MXNet.
Parameters
----------
ctx: mx.ctx
Context to run benchmarks
dtype: str, default 'float32'
Precision to use for benchmarks
warmup: int, default 10
Number of tim... | Runs benchmarks with the given context and precision (dtype)for all the binary
element_wise operators in MXNet. | [
"Runs",
"benchmarks",
"with",
"the",
"given",
"context",
"and",
"precision",
"(",
"dtype",
")",
"for",
"all",
"the",
"binary",
"element_wise",
"operators",
"in",
"MXNet",
"."
] | def run_mx_binary_element_wise_operators_benchmarks(ctx=mx.cpu(), dtype='float32', warmup=10, runs=50):
"""Runs benchmarks with the given context and precision (dtype)for all the binary
element_wise operators in MXNet.
Parameters
----------
ctx: mx.ctx
Context to run benchmarks
dtype: s... | [
"def",
"run_mx_binary_element_wise_operators_benchmarks",
"(",
"ctx",
"=",
"mx",
".",
"cpu",
"(",
")",
",",
"dtype",
"=",
"'float32'",
",",
"warmup",
"=",
"10",
",",
"runs",
"=",
"50",
")",
":",
"# Fetch all Binary Element_wise Operators",
"mx_binary_element_wise_op... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/benchmark/opperf/nd_operations/binary_operators.py#L68-L92 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/summary/summary.py | python | image | (name, tensor, max_outputs=3, collections=None, family=None) | return val | Outputs a `Summary` protocol buffer with images.
The summary has up to `max_outputs` summary values containing images. The
images are built from `tensor` which must be 4-D with shape `[batch_size,
height, width, channels]` and where `channels` can be:
* 1: `tensor` is interpreted as Grayscale.
* 3: `tenso... | Outputs a `Summary` protocol buffer with images. | [
"Outputs",
"a",
"Summary",
"protocol",
"buffer",
"with",
"images",
"."
] | def image(name, tensor, max_outputs=3, collections=None, family=None):
"""Outputs a `Summary` protocol buffer with images.
The summary has up to `max_outputs` summary values containing images. The
images are built from `tensor` which must be 4-D with shape `[batch_size,
height, width, channels]` and where `cha... | [
"def",
"image",
"(",
"name",
",",
"tensor",
",",
"max_outputs",
"=",
"3",
",",
"collections",
"=",
"None",
",",
"family",
"=",
"None",
")",
":",
"with",
"_summary_op_util",
".",
"summary_scope",
"(",
"name",
",",
"family",
",",
"values",
"=",
"[",
"ten... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/summary/summary.py#L104-L155 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/runners.py | python | run | (main, *, debug=False) | Execute the coroutine and return the result.
This function runs the passed coroutine, taking care of
managing the asyncio event loop and finalizing asynchronous
generators.
This function cannot be called when another asyncio event loop is
running in the same thread.
If debug is True, the even... | Execute the coroutine and return the result. | [
"Execute",
"the",
"coroutine",
"and",
"return",
"the",
"result",
"."
] | def run(main, *, debug=False):
"""Execute the coroutine and return the result.
This function runs the passed coroutine, taking care of
managing the asyncio event loop and finalizing asynchronous
generators.
This function cannot be called when another asyncio event loop is
running in the same t... | [
"def",
"run",
"(",
"main",
",",
"*",
",",
"debug",
"=",
"False",
")",
":",
"if",
"events",
".",
"_get_running_loop",
"(",
")",
"is",
"not",
"None",
":",
"raise",
"RuntimeError",
"(",
"\"asyncio.run() cannot be called from a running event loop\"",
")",
"if",
"n... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/runners.py#L8-L50 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/utils/inputvalue.py | python | InputValue.write | (self, name="", indent="") | return Input.write(self, name=name, indent=indent, text=write_type(self.type, self.value)) | Writes data in xml file format.
Writes the data in the appropriate format between appropriate tags.
Args:
name: An optional string giving the tag name. Defaults to "".
indent: An optional string giving the string to be added to the start
of the line, so usually a number of ta... | Writes data in xml file format. | [
"Writes",
"data",
"in",
"xml",
"file",
"format",
"."
] | def write(self, name="", indent=""):
"""Writes data in xml file format.
Writes the data in the appropriate format between appropriate tags.
Args:
name: An optional string giving the tag name. Defaults to "".
indent: An optional string giving the string to be added to the start
... | [
"def",
"write",
"(",
"self",
",",
"name",
"=",
"\"\"",
",",
"indent",
"=",
"\"\"",
")",
":",
"return",
"Input",
".",
"write",
"(",
"self",
",",
"name",
"=",
"name",
",",
"indent",
"=",
"indent",
",",
"text",
"=",
"write_type",
"(",
"self",
".",
"... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/inputvalue.py#L827-L841 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/initializer.py | python | InputInitCell.fetch | (self) | return self._initclass(value=ibase.value, mode=mode, units=self.units.fetch()) | Creates a cell initializer object.
Note that the cell can be initialized from the lengths of the sides and
the angles between them instead of by a vector, as specified by the
'abc' or 'abcABC' modes. | Creates a cell initializer object. | [
"Creates",
"a",
"cell",
"initializer",
"object",
"."
] | def fetch(self):
"""Creates a cell initializer object.
Note that the cell can be initialized from the lengths of the sides and
the angles between them instead of by a vector, as specified by the
'abc' or 'abcABC' modes.
"""
mode = self.mode.fetch()
ibase = super(InputInitCel... | [
"def",
"fetch",
"(",
"self",
")",
":",
"mode",
"=",
"self",
".",
"mode",
".",
"fetch",
"(",
")",
"ibase",
"=",
"super",
"(",
"InputInitCell",
",",
"self",
")",
".",
"fetch",
"(",
")",
"if",
"mode",
"==",
"\"abc\"",
"or",
"mode",
"==",
"\"abcABC\"",... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/initializer.py#L250-L290 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/altgraph/altgraph/Dot.py | python | Dot.style | (self, **attr) | Changes the overall style | Changes the overall style | [
"Changes",
"the",
"overall",
"style"
] | def style(self, **attr):
'''
Changes the overall style
'''
self.attr = attr | [
"def",
"style",
"(",
"self",
",",
"*",
"*",
"attr",
")",
":",
"self",
".",
"attr",
"=",
"attr"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/altgraph/altgraph/Dot.py#L170-L174 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/tools/graphviz.py | python | LoadEdges | (filename, targets) | return target_edges | Load the edges map from the dump file, and filter it to only
show targets in |targets| and their depedendents. | Load the edges map from the dump file, and filter it to only
show targets in |targets| and their depedendents. | [
"Load",
"the",
"edges",
"map",
"from",
"the",
"dump",
"file",
"and",
"filter",
"it",
"to",
"only",
"show",
"targets",
"in",
"|targets|",
"and",
"their",
"depedendents",
"."
] | def LoadEdges(filename, targets):
"""Load the edges map from the dump file, and filter it to only
show targets in |targets| and their depedendents."""
file = open('dump.json')
edges = json.load(file)
file.close()
# Copy out only the edges we're interested in from the full edge list.
target_edges = {}
... | [
"def",
"LoadEdges",
"(",
"filename",
",",
"targets",
")",
":",
"file",
"=",
"open",
"(",
"'dump.json'",
")",
"edges",
"=",
"json",
".",
"load",
"(",
"file",
")",
"file",
".",
"close",
"(",
")",
"# Copy out only the edges we're interested in from the full edge li... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/tools/graphviz.py#L24-L42 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py | python | RegistryInfo.vc_for_python | (self) | return r'DevDiv\VCForPython' | Microsoft Visual C++ for Python registry key.
Return
------
str
Registry key | Microsoft Visual C++ for Python registry key. | [
"Microsoft",
"Visual",
"C",
"++",
"for",
"Python",
"registry",
"key",
"."
] | def vc_for_python(self):
"""
Microsoft Visual C++ for Python registry key.
Return
------
str
Registry key
"""
return r'DevDiv\VCForPython' | [
"def",
"vc_for_python",
"(",
"self",
")",
":",
"return",
"r'DevDiv\\VCForPython'"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L550-L559 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py | python | NTEventLogHandler.emit | (self, record) | Emit a record.
Determine the message ID, event category and event type. Then
log the message in the NT event log. | Emit a record. | [
"Emit",
"a",
"record",
"."
] | def emit(self, record):
"""
Emit a record.
Determine the message ID, event category and event type. Then
log the message in the NT event log.
"""
if self._welu:
try:
id = self.getMessageID(record)
cat = self.getEventCategory(re... | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"if",
"self",
".",
"_welu",
":",
"try",
":",
"id",
"=",
"self",
".",
"getMessageID",
"(",
"record",
")",
"cat",
"=",
"self",
".",
"getEventCategory",
"(",
"record",
")",
"type",
"=",
"self",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py#L1016-L1033 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyEventBinder.Bind | (self, target, id1, id2, function) | Bind this set of event types to target. | Bind this set of event types to target. | [
"Bind",
"this",
"set",
"of",
"event",
"types",
"to",
"target",
"."
] | def Bind(self, target, id1, id2, function):
"""Bind this set of event types to target."""
for et in self.evtType:
target.Connect(id1, id2, et, function) | [
"def",
"Bind",
"(",
"self",
",",
"target",
",",
"id1",
",",
"id2",
",",
"function",
")",
":",
"for",
"et",
"in",
"self",
".",
"evtType",
":",
"target",
".",
"Connect",
"(",
"id1",
",",
"id2",
",",
"et",
",",
"function",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L4569-L4572 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py | python | domain_tan.__call__ | (self, x) | return umath.less(umath.absolute(umath.cos(x)), self.eps) | Execute the call behavior. | Execute the call behavior. | [
"Execute",
"the",
"call",
"behavior",
"."
] | def __call__ (self, x):
"Execute the call behavior."
return umath.less(umath.absolute(umath.cos(x)), self.eps) | [
"def",
"__call__",
"(",
"self",
",",
"x",
")",
":",
"return",
"umath",
".",
"less",
"(",
"umath",
".",
"absolute",
"(",
"umath",
".",
"cos",
"(",
"x",
")",
")",
",",
"self",
".",
"eps",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L287-L289 | |
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | python/gtsam/examples/PlanarManipulatorExample.py | python | ThreeLinkArm.manipulator_jacobian | (self, q) | return np.stack(differential_twists, axis=1) | Calculate manipulator Jacobian.
Takes numpy array of joint angles, in radians.
Returns the manipulator Jacobian of differential twists. When multiplied with
a vector of joint velocities, will yield a single differential twist which is
the spatial velocity d(sTt)/dt * inv(... | Calculate manipulator Jacobian.
Takes numpy array of joint angles, in radians.
Returns the manipulator Jacobian of differential twists. When multiplied with
a vector of joint velocities, will yield a single differential twist which is
the spatial velocity d(sTt)/dt * inv(... | [
"Calculate",
"manipulator",
"Jacobian",
".",
"Takes",
"numpy",
"array",
"of",
"joint",
"angles",
"in",
"radians",
".",
"Returns",
"the",
"manipulator",
"Jacobian",
"of",
"differential",
"twists",
".",
"When",
"multiplied",
"with",
"a",
"vector",
"of",
"joint",
... | def manipulator_jacobian(self, q):
""" Calculate manipulator Jacobian.
Takes numpy array of joint angles, in radians.
Returns the manipulator Jacobian of differential twists. When multiplied with
a vector of joint velocities, will yield a single differential twist which is
... | [
"def",
"manipulator_jacobian",
"(",
"self",
",",
"q",
")",
":",
"l1Zl1",
"=",
"Pose2",
".",
"Expmap",
"(",
"self",
".",
"xi1",
"*",
"q",
"[",
"0",
"]",
")",
"l2Zl2",
"=",
"Pose2",
".",
"Expmap",
"(",
"self",
".",
"xi2",
"*",
"q",
"[",
"1",
"]",... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam/examples/PlanarManipulatorExample.py#L137-L160 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/effect_subprocessor.py | python | AoCEffectSubprocessor.get_repair_effects | (line, location_ref) | return effects | Creates effects that are used for repairing (unit command: 106)
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:param location_ref: Reference to API object the effects are added to.
:type location_ref: str
:... | Creates effects that are used for repairing (unit command: 106) | [
"Creates",
"effects",
"that",
"are",
"used",
"for",
"repairing",
"(",
"unit",
"command",
":",
"106",
")"
] | def get_repair_effects(line, location_ref):
"""
Creates effects that are used for repairing (unit command: 106)
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:param location_ref: Reference to API object the... | [
"def",
"get_repair_effects",
"(",
"line",
",",
"location_ref",
")",
":",
"dataset",
"=",
"line",
".",
"data",
"api_objects",
"=",
"dataset",
".",
"nyan_api_objects",
"name_lookup_dict",
"=",
"internal_name_lookups",
".",
"get_entity_lookups",
"(",
"dataset",
".",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/effect_subprocessor.py#L337-L456 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/reroute.py | python | _RerouteMode.check | (cls, mode) | Check swap mode.
Args:
mode: an integer representing one of the modes.
Returns:
A tuple `(a2b, b2a)` boolean indicating what rerouting needs doing.
Raises:
ValueError: if mode is outside the enum range. | Check swap mode. | [
"Check",
"swap",
"mode",
"."
] | def check(cls, mode):
"""Check swap mode.
Args:
mode: an integer representing one of the modes.
Returns:
A tuple `(a2b, b2a)` boolean indicating what rerouting needs doing.
Raises:
ValueError: if mode is outside the enum range.
"""
if mode == cls.swap:
return True, True
... | [
"def",
"check",
"(",
"cls",
",",
"mode",
")",
":",
"if",
"mode",
"==",
"cls",
".",
"swap",
":",
"return",
"True",
",",
"True",
"elif",
"mode",
"==",
"cls",
".",
"b2a",
":",
"return",
"False",
",",
"True",
"elif",
"mode",
"==",
"cls",
".",
"a2b",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/reroute.py#L81-L98 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/encoder.py | python | StringSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a string field. | Returns a sizer for a string field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"string",
"field",
"."
] | def StringSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a string field."""
tag_size = _TagSize(field_number)
local_VarintSize = _VarintSize
local_len = len
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in ... | [
"def",
"StringSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"local_VarintSize",
"=",
"_VarintSize",
"local_len",
"=",
"len",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/encoder.py#L230-L249 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_carbon/gizmos.py | python | TreeListCtrl.DeleteChildren | (*args, **kwargs) | return _gizmos.TreeListCtrl_DeleteChildren(*args, **kwargs) | DeleteChildren(self, TreeItemId item) | DeleteChildren(self, TreeItemId item) | [
"DeleteChildren",
"(",
"self",
"TreeItemId",
"item",
")"
] | def DeleteChildren(*args, **kwargs):
"""DeleteChildren(self, TreeItemId item)"""
return _gizmos.TreeListCtrl_DeleteChildren(*args, **kwargs) | [
"def",
"DeleteChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_DeleteChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L862-L864 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/stdpy/thread.py | python | _remove_thread_id | (threadId) | Removes the thread with the indicated ID from the thread list. | Removes the thread with the indicated ID from the thread list. | [
"Removes",
"the",
"thread",
"with",
"the",
"indicated",
"ID",
"from",
"the",
"thread",
"list",
"."
] | def _remove_thread_id(threadId):
""" Removes the thread with the indicated ID from the thread list. """
# On interpreter shutdown, Python may set module globals to None.
if _threadsLock is None or _threads is None:
return
_threadsLock.acquire()
try:
if threadId in _threads:
... | [
"def",
"_remove_thread_id",
"(",
"threadId",
")",
":",
"# On interpreter shutdown, Python may set module globals to None.",
"if",
"_threadsLock",
"is",
"None",
"or",
"_threads",
"is",
"None",
":",
"return",
"_threadsLock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/stdpy/thread.py#L217-L233 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/share/gdb/python/gdb/FrameDecorator.py | python | FrameDecorator.line | (self) | Return line number information associated with the frame's
pc. If symbol table/line information does not exist, or if
this frame is deemed to be a special case, return None | Return line number information associated with the frame's
pc. If symbol table/line information does not exist, or if
this frame is deemed to be a special case, return None | [
"Return",
"line",
"number",
"information",
"associated",
"with",
"the",
"frame",
"s",
"pc",
".",
"If",
"symbol",
"table",
"/",
"line",
"information",
"does",
"not",
"exist",
"or",
"if",
"this",
"frame",
"is",
"deemed",
"to",
"be",
"a",
"special",
"case",
... | def line(self):
""" Return line number information associated with the frame's
pc. If symbol table/line information does not exist, or if
this frame is deemed to be a special case, return None"""
if hasattr(self._base, "line"):
return self._base.line()
frame = self... | [
"def",
"line",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_base",
",",
"\"line\"",
")",
":",
"return",
"self",
".",
"_base",
".",
"line",
"(",
")",
"frame",
"=",
"self",
".",
"inferior_frame",
"(",
")",
"if",
"self",
".",
"_is_limit... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/share/gdb/python/gdb/FrameDecorator.py#L179-L195 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetLdflags | (self, configname, product_dir, gyp_to_build_path) | return ldflags | Returns flags that need to be passed to the linker.
Args:
configname: The name of the configuration to get ld flags for.
product_dir: The directory where products such static and dynamic
libraries are placed. This is added to the library search path.
gyp_to_build_path: A functio... | Returns flags that need to be passed to the linker. | [
"Returns",
"flags",
"that",
"need",
"to",
"be",
"passed",
"to",
"the",
"linker",
"."
] | def GetLdflags(self, configname, product_dir, gyp_to_build_path):
"""Returns flags that need to be passed to the linker.
Args:
configname: The name of the configuration to get ld flags for.
product_dir: The directory where products such static and dynamic
libraries are placed. This ... | [
"def",
"GetLdflags",
"(",
"self",
",",
"configname",
",",
"product_dir",
",",
"gyp_to_build_path",
")",
":",
"self",
".",
"configname",
"=",
"configname",
"ldflags",
"=",
"[",
"]",
"# The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS",
"# can contai... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py#L499-L563 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/grokdump.py | python | InspectionShell.do_dp | (self, address) | return self.do_display_page(address) | see display_page | see display_page | [
"see",
"display_page"
] | def do_dp(self, address):
""" see display_page """
return self.do_display_page(address) | [
"def",
"do_dp",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"do_display_page",
"(",
"address",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/grokdump.py#L3622-L3624 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py | python | BaseReadline.get_line_buffer | (self) | return self.mode.l_buffer.get_line_text() | Return the current contents of the line buffer. | Return the current contents of the line buffer. | [
"Return",
"the",
"current",
"contents",
"of",
"the",
"line",
"buffer",
"."
] | def get_line_buffer(self):
'''Return the current contents of the line buffer.'''
return self.mode.l_buffer.get_line_text() | [
"def",
"get_line_buffer",
"(",
"self",
")",
":",
"return",
"self",
".",
"mode",
".",
"l_buffer",
".",
"get_line_text",
"(",
")"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py#L120-L122 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_to_struct/json_to_struct.py | python | _Load | (filename) | return result | Loads a JSON file int a Python object and return this object. | Loads a JSON file int a Python object and return this object. | [
"Loads",
"a",
"JSON",
"file",
"int",
"a",
"Python",
"object",
"and",
"return",
"this",
"object",
"."
] | def _Load(filename):
"""Loads a JSON file int a Python object and return this object.
"""
# TODO(beaudoin): When moving to Python 2.7 use object_pairs_hook=OrderedDict.
with open(filename, 'r') as handle:
result = json.loads(json_comment_eater.Nom(handle.read()))
return result | [
"def",
"_Load",
"(",
"filename",
")",
":",
"# TODO(beaudoin): When moving to Python 2.7 use object_pairs_hook=OrderedDict.",
"with",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"handle",
":",
"result",
"=",
"json",
".",
"loads",
"(",
"json_comment_eater",
".",
"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_to_struct/json_to_struct.py#L168-L174 | |
kit-cel/gr-radar | ceebb6d83280526f6e08a8aa0dde486db6898c81 | docs/doxygen/doxyxml/doxyindex.py | python | generate_swig_doc_i | (self) | %feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
Wraps the C++: gr_align_on_samplenumbers_ss::align_state"; | %feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
Wraps the C++: gr_align_on_samplenumbers_ss::align_state"; | [
"%feature",
"(",
"docstring",
")",
"gr_make_align_on_samplenumbers_ss",
"::",
"align_state",
"Wraps",
"the",
"C",
"++",
":",
"gr_align_on_samplenumbers_ss",
"::",
"align_state",
";"
] | def generate_swig_doc_i(self):
"""
%feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
Wraps the C++: gr_align_on_samplenumbers_ss::align_state";
"""
pass | [
"def",
"generate_swig_doc_i",
"(",
"self",
")",
":",
"pass"
] | https://github.com/kit-cel/gr-radar/blob/ceebb6d83280526f6e08a8aa0dde486db6898c81/docs/doxygen/doxyxml/doxyindex.py#L63-L68 | ||
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/element.py | python | Element._fromPyHelper | (self, value, name=None, path=None) | Helper method for `fromPy`.
Args:
value: Used to format this `Element` or the `Element` specified
by ``name``.
name (Name or str): If ``name`` is ``None``, format this `Element`
with ``value``. Otherwise, ``name`` refers to this `Element`'s
... | Helper method for `fromPy`. | [
"Helper",
"method",
"for",
"fromPy",
"."
] | def _fromPyHelper(self, value, name=None, path=None):
"""Helper method for `fromPy`.
Args:
value: Used to format this `Element` or the `Element` specified
by ``name``.
name (Name or str): If ``name`` is ``None``, format this `Element`
with ``value... | [
"def",
"_fromPyHelper",
"(",
"self",
",",
"value",
",",
"name",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"# Note, the double exception throwing has no good solution in Python 2,",
"# but Python 3 has exception chaining that we should use when we can",
"activeElement",
"... | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/element.py#L1219-L1330 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/scanner.py | python | reset | () | Clear the module state. This is mainly for testing purposes. | Clear the module state. This is mainly for testing purposes. | [
"Clear",
"the",
"module",
"state",
".",
"This",
"is",
"mainly",
"for",
"testing",
"purposes",
"."
] | def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
global __scanners, __rv_cache, __scanner_cache
# Maps registered scanner classes to relevant properties
__scanners = {}
# A cache of scanners.
# The key is: class_name.properties_tag, where properties_ta... | [
"def",
"reset",
"(",
")",
":",
"global",
"__scanners",
",",
"__rv_cache",
",",
"__scanner_cache",
"# Maps registered scanner classes to relevant properties",
"__scanners",
"=",
"{",
"}",
"# A cache of scanners.",
"# The key is: class_name.properties_tag, where properties_tag is the... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/scanner.py#L38-L49 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py | python | collectintargz | (target, source, env) | return (target, tarball) | Puts all source files into a tar.gz file. | Puts all source files into a tar.gz file. | [
"Puts",
"all",
"source",
"files",
"into",
"a",
"tar",
".",
"gz",
"file",
"."
] | def collectintargz(target, source, env):
""" Puts all source files into a tar.gz file. """
# the rpm tool depends on a source package, until this is changed
# this hack needs to be here that tries to pack all sources in.
sources = env.FindSourceFiles()
# filter out the target we are building the so... | [
"def",
"collectintargz",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"# the rpm tool depends on a source package, until this is changed",
"# this hack needs to be here that tries to pack all sources in.",
"sources",
"=",
"env",
".",
"FindSourceFiles",
"(",
")",
"# filte... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py#L86-L110 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/backend.py | python | set_session | (session) | Sets the global TensorFlow session.
Arguments:
session: A TF Session. | Sets the global TensorFlow session. | [
"Sets",
"the",
"global",
"TensorFlow",
"session",
"."
] | def set_session(session):
"""Sets the global TensorFlow session.
Arguments:
session: A TF Session.
"""
global _SESSION
_SESSION = session | [
"def",
"set_session",
"(",
"session",
")",
":",
"global",
"_SESSION",
"_SESSION",
"=",
"session"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L380-L387 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/SIP/sipspectrum.py | python | SIPSpectrum.removeEpsilonEffect | (self, er=None, mode=0) | return er | remove effect of (constant high-frequency) epsilon from sigma
Parameters
----------
er : float
relative epsilon to correct for (else automatically determined)
mode : int
automatic epsilon determination mode (see determineEpsilon)
Returns
-------
... | remove effect of (constant high-frequency) epsilon from sigma | [
"remove",
"effect",
"of",
"(",
"constant",
"high",
"-",
"frequency",
")",
"epsilon",
"from",
"sigma"
] | def removeEpsilonEffect(self, er=None, mode=0):
"""remove effect of (constant high-frequency) epsilon from sigma
Parameters
----------
er : float
relative epsilon to correct for (else automatically determined)
mode : int
automatic epsilon determination mo... | [
"def",
"removeEpsilonEffect",
"(",
"self",
",",
"er",
"=",
"None",
",",
"mode",
"=",
"0",
")",
":",
"sigR",
",",
"sigI",
"=",
"self",
".",
"realimag",
"(",
"cond",
"=",
"True",
")",
"if",
"er",
"is",
"None",
":",
"#",
"er",
"=",
"self",
".",
"d... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/SIP/sipspectrum.py#L562-L587 | |
ONLYOFFICE/core | 1f976ae79a2593fc22ee78e9fdbb76090e83785c | DesktopEditor/freetype_names/freetype-2.5.3/src/tools/docmaker/tohtml.py | python | HtmlFormatter.make_html_word | ( self, word ) | return html_quote( word ) | analyze a simple word to detect cross-references and styling | analyze a simple word to detect cross-references and styling | [
"analyze",
"a",
"simple",
"word",
"to",
"detect",
"cross",
"-",
"references",
"and",
"styling"
] | def make_html_word( self, word ):
"""analyze a simple word to detect cross-references and styling"""
# look for cross-references
m = re_crossref.match( word )
if m:
try:
name = m.group( 1 )
rest = m.group( 2 )
block = self.iden... | [
"def",
"make_html_word",
"(",
"self",
",",
"word",
")",
":",
"# look for cross-references",
"m",
"=",
"re_crossref",
".",
"match",
"(",
"word",
")",
"if",
"m",
":",
"try",
":",
"name",
"=",
"m",
".",
"group",
"(",
"1",
")",
"rest",
"=",
"m",
".",
"... | https://github.com/ONLYOFFICE/core/blob/1f976ae79a2593fc22ee78e9fdbb76090e83785c/DesktopEditor/freetype_names/freetype-2.5.3/src/tools/docmaker/tohtml.py#L226-L256 | |
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py | python | _clean_plot | (plot) | return plot | Replace HTML tags with Kodi skin tags | Replace HTML tags with Kodi skin tags | [
"Replace",
"HTML",
"tags",
"with",
"Kodi",
"skin",
"tags"
] | def _clean_plot(plot):
# type: (Text) -> Text
"""Replace HTML tags with Kodi skin tags"""
for repl in CLEAN_PLOT_REPLACEMENTS:
plot = plot.replace(repl[0], repl[1])
plot = TAG_RE.sub('', plot)
return plot | [
"def",
"_clean_plot",
"(",
"plot",
")",
":",
"# type: (Text) -> Text",
"for",
"repl",
"in",
"CLEAN_PLOT_REPLACEMENTS",
":",
"plot",
"=",
"plot",
".",
"replace",
"(",
"repl",
"[",
"0",
"]",
",",
"repl",
"[",
"1",
"]",
")",
"plot",
"=",
"TAG_RE",
".",
"s... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py#L63-L69 | |
ppwwyyxx/speaker-recognition | 15d7bf32ad4ba2f1543e1287b03f3f2e6791d4dd | log/final/dataextractor.py | python | DataExtractor.extract_data | (self, lines) | return xs, ys, yerr | return x, y, yerr | return x, y, yerr | [
"return",
"x",
"y",
"yerr"
] | def extract_data(self, lines):
""" return x, y, yerr """
data = defaultdict(list)
cur_x = None
for lino, line in enumerate(lines):
tx = self.get_x(line)
if tx is not None:
assert cur_x is None, (lino + 1, line)
cur_x = tx
... | [
"def",
"extract_data",
"(",
"self",
",",
"lines",
")",
":",
"data",
"=",
"defaultdict",
"(",
"list",
")",
"cur_x",
"=",
"None",
"for",
"lino",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"tx",
"=",
"self",
".",
"get_x",
"(",
"line",
")"... | https://github.com/ppwwyyxx/speaker-recognition/blob/15d7bf32ad4ba2f1543e1287b03f3f2e6791d4dd/log/final/dataextractor.py#L34-L56 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/optparse.py | python | OptionParser.parse_args | (self, args=None, values=None) | return self.check_values(values, args) | parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string])
Parse the command-line options found in 'args' (default:
sys.argv[1:]). Any errors result in a call to 'error()', which
by default prints the usage message to std... | parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string]) | [
"parse_args",
"(",
"args",
":",
"[",
"string",
"]",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"values",
":",
"Values",
"=",
"None",
")",
"-",
">",
"(",
"values",
":",
"Values",
"args",
":",
"[",
"string",
"]",
")"
] | def parse_args(self, args=None, values=None):
"""
parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string])
Parse the command-line options found in 'args' (default:
sys.argv[1:]). Any errors result in a call to '... | [
"def",
"parse_args",
"(",
"self",
",",
"args",
"=",
"None",
",",
"values",
"=",
"None",
")",
":",
"rargs",
"=",
"self",
".",
"_get_args",
"(",
"args",
")",
"if",
"values",
"is",
"None",
":",
"values",
"=",
"self",
".",
"get_default_values",
"(",
")",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/optparse.py#L1367-L1404 | |
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | python/caffe/io.py | python | Transformer.set_input_scale | (self, in_, scale) | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign this scale factor
scale : scale coefficient | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE. | [
"Set",
"the",
"scale",
"of",
"preprocessed",
"inputs",
"s",
".",
"t",
".",
"the",
"blob",
"=",
"blob",
"*",
"scale",
".",
"N",
".",
"B",
".",
"input_scale",
"is",
"done",
"AFTER",
"mean",
"subtraction",
"and",
"other",
"preprocessing",
"while",
"raw_scal... | def set_input_scale(self, in_, scale):
"""
Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign... | [
"def",
"set_input_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"input_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/python/caffe/io.py#L262-L274 | ||
luliyucoordinate/Leetcode | 96afcdc54807d1d184e881a075d1dbf3371e31fb | src/0344-Reverse-String/0344.py | python | Solution.reverseString | (self, s) | return s[::-1] | :type s: str
:rtype: str | :type s: str
:rtype: str | [
":",
"type",
"s",
":",
"str",
":",
"rtype",
":",
"str"
] | def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
return s[::-1] | [
"def",
"reverseString",
"(",
"self",
",",
"s",
")",
":",
"return",
"s",
"[",
":",
":",
"-",
"1",
"]"
] | https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0344-Reverse-String/0344.py#L2-L7 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ToolBarToolBase.IsControl | (*args, **kwargs) | return _controls_.ToolBarToolBase_IsControl(*args, **kwargs) | IsControl(self) -> int | IsControl(self) -> int | [
"IsControl",
"(",
"self",
")",
"-",
">",
"int"
] | def IsControl(*args, **kwargs):
"""IsControl(self) -> int"""
return _controls_.ToolBarToolBase_IsControl(*args, **kwargs) | [
"def",
"IsControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToolBarToolBase_IsControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3461-L3463 | |
zdevito/ATen | 4aa3e1de29ed58457e530f84217e53db0998476c | aten/src/ATen/nn_parse.py | python | base_declaration | (func, thnn_function, backends, backend_types, inplace=False) | return function_info(name, arguments, None, buffers, backends, inplace, func.get('scalar_check'), backend_types) | Creates the NN function without any buffers in it's signature | Creates the NN function without any buffers in it's signature | [
"Creates",
"the",
"NN",
"function",
"without",
"any",
"buffers",
"in",
"it",
"s",
"signature"
] | def base_declaration(func, thnn_function, backends, backend_types, inplace=False):
"""Creates the NN function without any buffers in it's signature"""
name, params = re.match(NAME_PARAM_REGEX, func['name']).groups()
if inplace:
name += '_'
params = params.split(', ')
arguments = [argument_to... | [
"def",
"base_declaration",
"(",
"func",
",",
"thnn_function",
",",
"backends",
",",
"backend_types",
",",
"inplace",
"=",
"False",
")",
":",
"name",
",",
"params",
"=",
"re",
".",
"match",
"(",
"NAME_PARAM_REGEX",
",",
"func",
"[",
"'name'",
"]",
")",
".... | https://github.com/zdevito/ATen/blob/4aa3e1de29ed58457e530f84217e53db0998476c/aten/src/ATen/nn_parse.py#L246-L258 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/op_selector.py | python | map_subgraph | (init_tensor, sources, disallowed_placeholders, visited_ops,
op_outputs, add_sources) | return extra_sources | Walk a Graph and capture the subgraph between init_tensor and sources.
Note: This function mutates visited_ops and op_outputs.
Args:
init_tensor: A Tensor or Operation where the subgraph terminates.
sources: A set of Tensors where subgraph extraction should stop.
disallowed_placeholders: An optional... | Walk a Graph and capture the subgraph between init_tensor and sources. | [
"Walk",
"a",
"Graph",
"and",
"capture",
"the",
"subgraph",
"between",
"init_tensor",
"and",
"sources",
"."
] | def map_subgraph(init_tensor, sources, disallowed_placeholders, visited_ops,
op_outputs, add_sources):
"""Walk a Graph and capture the subgraph between init_tensor and sources.
Note: This function mutates visited_ops and op_outputs.
Args:
init_tensor: A Tensor or Operation where the subgra... | [
"def",
"map_subgraph",
"(",
"init_tensor",
",",
"sources",
",",
"disallowed_placeholders",
",",
"visited_ops",
",",
"op_outputs",
",",
"add_sources",
")",
":",
"ops_to_visit",
"=",
"[",
"_as_operation",
"(",
"init_tensor",
")",
"]",
"extra_sources",
"=",
"object_i... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/op_selector.py#L365-L416 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | GetPasswordFromUser | (*args, **kwargs) | return _misc_.GetPasswordFromUser(*args, **kwargs) | GetPasswordFromUser(String message, String caption=EmptyString, String default_value=EmptyString,
Window parent=None) -> String | GetPasswordFromUser(String message, String caption=EmptyString, String default_value=EmptyString,
Window parent=None) -> String | [
"GetPasswordFromUser",
"(",
"String",
"message",
"String",
"caption",
"=",
"EmptyString",
"String",
"default_value",
"=",
"EmptyString",
"Window",
"parent",
"=",
"None",
")",
"-",
">",
"String"
] | def GetPasswordFromUser(*args, **kwargs):
"""
GetPasswordFromUser(String message, String caption=EmptyString, String default_value=EmptyString,
Window parent=None) -> String
"""
return _misc_.GetPasswordFromUser(*args, **kwargs) | [
"def",
"GetPasswordFromUser",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"GetPasswordFromUser",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L462-L467 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_NULL_KDF_SCHEME.GetUnionSelector | (self) | return TPM_ALG_ID.NULL | TpmUnion method | TpmUnion method | [
"TpmUnion",
"method"
] | def GetUnionSelector(self): # TPM_ALG_ID
""" TpmUnion method """
return TPM_ALG_ID.NULL | [
"def",
"GetUnionSelector",
"(",
"self",
")",
":",
"# TPM_ALG_ID",
"return",
"TPM_ALG_ID",
".",
"NULL"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6899-L6901 | |
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | 3rdparty/benchmark/mingw.py | python | find_in_path | (file, path=None) | return list(filter(os.path.exists,
map(lambda dir, file=file: os.path.join(dir, file), path))) | Attempts to find an executable in the path | Attempts to find an executable in the path | [
"Attempts",
"to",
"find",
"an",
"executable",
"in",
"the",
"path"
] | def find_in_path(file, path=None):
'''
Attempts to find an executable in the path
'''
if platform.system() == 'Windows':
file += '.exe'
if path is None:
path = os.environ.get('PATH', '')
if type(path) is type(''):
path = path.split(os.pathsep)
return list(filter(os.pa... | [
"def",
"find_in_path",
"(",
"file",
",",
"path",
"=",
"None",
")",
":",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'Windows'",
":",
"file",
"+=",
"'.exe'",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"os",
".",
"environ",
".",
"get",
"(",
... | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/benchmark/mingw.py#L86-L97 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | tools/caffe_translator/scripts/convert_caffe_model.py | python | CaffeModelConverter.add_param | (self, param_name, layer_index, blob_index) | Add a param to the .params file | Add a param to the .params file | [
"Add",
"a",
"param",
"to",
"the",
".",
"params",
"file"
] | def add_param(self, param_name, layer_index, blob_index):
"""Add a param to the .params file"""
blobs = self.layers[layer_index].blobs
self.dict_param[param_name] = mx.nd.array(caffe.io.blobproto_to_array(blobs[blob_index])) | [
"def",
"add_param",
"(",
"self",
",",
"param_name",
",",
"layer_index",
",",
"blob_index",
")",
":",
"blobs",
"=",
"self",
".",
"layers",
"[",
"layer_index",
"]",
".",
"blobs",
"self",
".",
"dict_param",
"[",
"param_name",
"]",
"=",
"mx",
".",
"nd",
".... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/tools/caffe_translator/scripts/convert_caffe_model.py#L33-L36 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiToolBar.GetOverflowVisible | (*args, **kwargs) | return _aui.AuiToolBar_GetOverflowVisible(*args, **kwargs) | GetOverflowVisible(self) -> bool | GetOverflowVisible(self) -> bool | [
"GetOverflowVisible",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetOverflowVisible(*args, **kwargs):
"""GetOverflowVisible(self) -> bool"""
return _aui.AuiToolBar_GetOverflowVisible(*args, **kwargs) | [
"def",
"GetOverflowVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetOverflowVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L2130-L2132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.