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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/checker.py | python | JavaScriptStyleChecker._DependencyPass | (self, token) | Processes an invidual token for dependency information.
Used to encapsulate the logic needed to process an individual token so that
it can be passed to _ExecutePass.
Args:
token: The token to process. | Processes an invidual token for dependency information. | [
"Processes",
"an",
"invidual",
"token",
"for",
"dependency",
"information",
"."
] | def _DependencyPass(self, token):
"""Processes an invidual token for dependency information.
Used to encapsulate the logic needed to process an individual token so that
it can be passed to _ExecutePass.
Args:
token: The token to process.
"""
self._namespaces_info.ProcessToken(token, self... | [
"def",
"_DependencyPass",
"(",
"self",
",",
"token",
")",
":",
"self",
".",
"_namespaces_info",
".",
"ProcessToken",
"(",
"token",
",",
"self",
".",
"_state_tracker",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/checker.py#L104-L113 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py | python | PopenSpawn._read_incoming | (self) | Run in a thread to move output from a pipe to a queue. | Run in a thread to move output from a pipe to a queue. | [
"Run",
"in",
"a",
"thread",
"to",
"move",
"output",
"from",
"a",
"pipe",
"to",
"a",
"queue",
"."
] | def _read_incoming(self):
"""Run in a thread to move output from a pipe to a queue."""
fileno = self.proc.stdout.fileno()
while 1:
buf = b''
try:
buf = os.read(fileno, 1024)
except OSError as e:
self._log(e, 'read')
... | [
"def",
"_read_incoming",
"(",
"self",
")",
":",
"fileno",
"=",
"self",
".",
"proc",
".",
"stdout",
".",
"fileno",
"(",
")",
"while",
"1",
":",
"buf",
"=",
"b''",
"try",
":",
"buf",
"=",
"os",
".",
"read",
"(",
"fileno",
",",
"1024",
")",
"except"... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py#L100-L115 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathSurfaceSupport.py | python | pathGeomToOffsetPointSet | (obj, compGeoShp) | return [LINES] | pathGeomToOffsetPointSet(obj, compGeoShp)...
Convert a compound set of 3D profile segmented wires to 2D segments, applying linear optimization. | pathGeomToOffsetPointSet(obj, compGeoShp)...
Convert a compound set of 3D profile segmented wires to 2D segments, applying linear optimization. | [
"pathGeomToOffsetPointSet",
"(",
"obj",
"compGeoShp",
")",
"...",
"Convert",
"a",
"compound",
"set",
"of",
"3D",
"profile",
"segmented",
"wires",
"to",
"2D",
"segments",
"applying",
"linear",
"optimization",
"."
] | def pathGeomToOffsetPointSet(obj, compGeoShp):
"""pathGeomToOffsetPointSet(obj, compGeoShp)...
Convert a compound set of 3D profile segmented wires to 2D segments, applying linear optimization."""
PathLog.debug("pathGeomToOffsetPointSet()")
LINES = []
optimize = obj.OptimizeLinearPaths
ofstCnt ... | [
"def",
"pathGeomToOffsetPointSet",
"(",
"obj",
",",
"compGeoShp",
")",
":",
"PathLog",
".",
"debug",
"(",
"\"pathGeomToOffsetPointSet()\"",
")",
"LINES",
"=",
"[",
"]",
"optimize",
"=",
"obj",
".",
"OptimizeLinearPaths",
"ofstCnt",
"=",
"len",
"(",
"compGeoShp",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSurfaceSupport.py#L1856-L1902 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/aoc/genie_unit.py | python | GenieGameEntityGroup.is_creatable | (self, civ_id=-1) | return train_location_id > -1 | Units/Buildings are creatable if they have a valid train location.
:param civ_id: Test if the property is true for unit lines
of the civ with this ID:
:type civ_id: int
:returns: True if the train location obj_id is greater than zero. | Units/Buildings are creatable if they have a valid train location. | [
"Units",
"/",
"Buildings",
"are",
"creatable",
"if",
"they",
"have",
"a",
"valid",
"train",
"location",
"."
] | def is_creatable(self, civ_id=-1):
"""
Units/Buildings are creatable if they have a valid train location.
:param civ_id: Test if the property is true for unit lines
of the civ with this ID:
:type civ_id: int
:returns: True if the train location obj_id is g... | [
"def",
"is_creatable",
"(",
"self",
",",
"civ_id",
"=",
"-",
"1",
")",
":",
"# Get the train location obj_id for the first unit in the line",
"head_unit",
"=",
"self",
".",
"get_head_unit",
"(",
")",
"if",
"civ_id",
"!=",
"-",
"1",
":",
"head_unit",
"=",
"self",... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L255-L272 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/thumbnailctrl.py | python | ScrolledThumbnail.UpdateItems | (self) | Updates thumbnail items. | Updates thumbnail items. | [
"Updates",
"thumbnail",
"items",
"."
] | def UpdateItems(self):
""" Updates thumbnail items. """
selected = self._selectedarray
selectedfname = []
selecteditemid = []
for ii in xrange(len(self._selectedarray)):
selectedfname.append(self.GetSelectedItem(ii).GetFileName())
selecte... | [
"def",
"UpdateItems",
"(",
"self",
")",
":",
"selected",
"=",
"self",
".",
"_selectedarray",
"selectedfname",
"=",
"[",
"]",
"selecteditemid",
"=",
"[",
"]",
"for",
"ii",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"_selectedarray",
")",
")",
":",
"s... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/thumbnailctrl.py#L1701-L1728 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/extension_dict.py | python | _ExtensionDict._FindExtensionByName | (self, name) | return self._extended_message._extensions_by_name.get(name, None) | Tries to find a known extension with the specified name.
Args:
name: Extension full name.
Returns:
Extension field descriptor. | Tries to find a known extension with the specified name. | [
"Tries",
"to",
"find",
"a",
"known",
"extension",
"with",
"the",
"specified",
"name",
"."
] | def _FindExtensionByName(self, name):
"""Tries to find a known extension with the specified name.
Args:
name: Extension full name.
Returns:
Extension field descriptor.
"""
return self._extended_message._extensions_by_name.get(name, None) | [
"def",
"_FindExtensionByName",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_extended_message",
".",
"_extensions_by_name",
".",
"get",
"(",
"name",
",",
"None",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/extension_dict.py#L172-L181 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linear_operator_algebra.py | python | _registered_function | (type_list, registry) | return registry.get(tuple(r[1] for r in registered_combination), None) | Given a list of classes, finds the most specific function registered. | Given a list of classes, finds the most specific function registered. | [
"Given",
"a",
"list",
"of",
"classes",
"finds",
"the",
"most",
"specific",
"function",
"registered",
"."
] | def _registered_function(type_list, registry):
"""Given a list of classes, finds the most specific function registered."""
enumerated_hierarchies = [enumerate(tf_inspect.getmro(t)) for t in type_list]
# Get all possible combinations of hierarchies.
cls_combinations = list(itertools.product(*enumerated_hierarchi... | [
"def",
"_registered_function",
"(",
"type_list",
",",
"registry",
")",
":",
"enumerated_hierarchies",
"=",
"[",
"enumerate",
"(",
"tf_inspect",
".",
"getmro",
"(",
"t",
")",
")",
"for",
"t",
"in",
"type_list",
"]",
"# Get all possible combinations of hierarchies.",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linear_operator_algebra.py#L35-L48 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/estimators/tensor_signature.py | python | create_placeholders_from_signatures | (signatures) | return {
key: signatures[key].get_placeholder()
for key in signatures} | Creates placeholders from given signatures.
Args:
signatures: Dict of `TensorSignature` objects or single `TensorSignature`,
or `None`.
Returns:
Dict of `tf.placeholder` objects or single `tf.placeholder`, or `None`. | Creates placeholders from given signatures. | [
"Creates",
"placeholders",
"from",
"given",
"signatures",
"."
] | def create_placeholders_from_signatures(signatures):
"""Creates placeholders from given signatures.
Args:
signatures: Dict of `TensorSignature` objects or single `TensorSignature`,
or `None`.
Returns:
Dict of `tf.placeholder` objects or single `tf.placeholder`, or `None`.
"""
if signatures is ... | [
"def",
"create_placeholders_from_signatures",
"(",
"signatures",
")",
":",
"if",
"signatures",
"is",
"None",
":",
"return",
"None",
"if",
"not",
"isinstance",
"(",
"signatures",
",",
"dict",
")",
":",
"return",
"signatures",
".",
"get_placeholder",
"(",
")",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/tensor_signature.py#L151-L167 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickle.py | python | whichmodule | (obj, name) | return '__main__' | Find the module an object belong to. | Find the module an object belong to. | [
"Find",
"the",
"module",
"an",
"object",
"belong",
"to",
"."
] | def whichmodule(obj, name):
"""Find the module an object belong to."""
module_name = getattr(obj, '__module__', None)
if module_name is not None:
return module_name
# Protect the iteration by using a list copy of sys.modules against dynamic
# modules that trigger imports of other modules upo... | [
"def",
"whichmodule",
"(",
"obj",
",",
"name",
")",
":",
"module_name",
"=",
"getattr",
"(",
"obj",
",",
"'__module__'",
",",
"None",
")",
"if",
"module_name",
"is",
"not",
"None",
":",
"return",
"module_name",
"# Protect the iteration by using a list copy of sys.... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickle.py#L302-L317 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialutil.py | python | SerialBase.__init__ | (self,
port=None,
baudrate=9600,
bytesize=EIGHTBITS,
parity=PARITY_NONE,
stopbits=STOPBITS_ONE,
timeout=None,
xonxoff=False,
rtscts=False,
write_timeout=None,
... | \
Initialize comm port object. If a "port" is given, then the port will be
opened immediately. Otherwise a Serial port object in closed state
is returned. | \
Initialize comm port object. If a "port" is given, then the port will be
opened immediately. Otherwise a Serial port object in closed state
is returned. | [
"\\",
"Initialize",
"comm",
"port",
"object",
".",
"If",
"a",
"port",
"is",
"given",
"then",
"the",
"port",
"will",
"be",
"opened",
"immediately",
".",
"Otherwise",
"a",
"Serial",
"port",
"object",
"in",
"closed",
"state",
"is",
"returned",
"."
] | def __init__(self,
port=None,
baudrate=9600,
bytesize=EIGHTBITS,
parity=PARITY_NONE,
stopbits=STOPBITS_ONE,
timeout=None,
xonxoff=False,
rtscts=False,
write_timeout=No... | [
"def",
"__init__",
"(",
"self",
",",
"port",
"=",
"None",
",",
"baudrate",
"=",
"9600",
",",
"bytesize",
"=",
"EIGHTBITS",
",",
"parity",
"=",
"PARITY_NONE",
",",
"stopbits",
"=",
"STOPBITS_ONE",
",",
"timeout",
"=",
"None",
",",
"xonxoff",
"=",
"False",... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialutil.py#L176-L240 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_5_1/tools/grokdump.py | python | InspectionPadawan.FindObject | (self, tagged_address) | When used as a mixin in place of V8Heap. | When used as a mixin in place of V8Heap. | [
"When",
"used",
"as",
"a",
"mixin",
"in",
"place",
"of",
"V8Heap",
"."
] | def FindObject(self, tagged_address):
"""When used as a mixin in place of V8Heap."""
raise NotImplementedError | [
"def",
"FindObject",
"(",
"self",
",",
"tagged_address",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/grokdump.py#L1850-L1852 | ||
eyllanesc/stackoverflow | 3837cc9ff94541bf5a500aac1b6182f53669537d | questions/55241644/fakeuic/__init__.py | python | loadUiType | (uifile, from_imports=False, resource_suffix='_rc', import_from='.') | return (ui_globals[winfo["uiclass"]], getattr(QtWidgets, winfo["baseclass"])) | loadUiType(uifile, from_imports=False, resource_suffix='_rc', import_from='.') -> (form class, base class)
Load a Qt Designer .ui file and return the generated form class and the Qt
base class.
uifile is a file name or file-like object containing the .ui file.
from_imports is optionally set to generat... | loadUiType(uifile, from_imports=False, resource_suffix='_rc', import_from='.') -> (form class, base class) | [
"loadUiType",
"(",
"uifile",
"from_imports",
"=",
"False",
"resource_suffix",
"=",
"_rc",
"import_from",
"=",
".",
")",
"-",
">",
"(",
"form",
"class",
"base",
"class",
")"
] | def loadUiType(uifile, from_imports=False, resource_suffix='_rc', import_from='.'):
"""loadUiType(uifile, from_imports=False, resource_suffix='_rc', import_from='.') -> (form class, base class)
Load a Qt Designer .ui file and return the generated form class and the Qt
base class.
uifile is a file name... | [
"def",
"loadUiType",
"(",
"uifile",
",",
"from_imports",
"=",
"False",
",",
"resource_suffix",
"=",
"'_rc'",
",",
"import_from",
"=",
"'.'",
")",
":",
"import",
"sys",
"from",
"PySide2",
"import",
"QtWidgets",
"if",
"sys",
".",
"hexversion",
">=",
"0x0300000... | https://github.com/eyllanesc/stackoverflow/blob/3837cc9ff94541bf5a500aac1b6182f53669537d/questions/55241644/fakeuic/__init__.py#L170-L203 | |
dmlc/nnvm | dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38 | python/nnvm/top/attr_dict.py | python | AttrDict.get_int | (self, key) | return int(self[key]) | Get integer from attr dict
Parameters
----------
key : str
The attr key
Returns
-------
value : int
The result value | Get integer from attr dict | [
"Get",
"integer",
"from",
"attr",
"dict"
] | def get_int(self, key):
"""Get integer from attr dict
Parameters
----------
key : str
The attr key
Returns
-------
value : int
The result value
"""
return int(self[key]) | [
"def",
"get_int",
"(",
"self",
",",
"key",
")",
":",
"return",
"int",
"(",
"self",
"[",
"key",
"]",
")"
] | https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/top/attr_dict.py#L71-L84 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/hipify/hipify_python.py | python | preprocess | (
output_directory: str,
all_files: Iterable,
includes: Iterable,
show_detailed: bool = False,
show_progress: bool = True,
hip_clang_launch: bool = False,
is_pytorch_extension: bool = False,
clean_ctx: Optional[GeneratedFileCleaner] = None) | return HIPIFY_FINAL_RESULT | Call preprocessor on selected files.
Arguments)
show_detailed - Show a detailed summary of the transpilation process. | Call preprocessor on selected files. | [
"Call",
"preprocessor",
"on",
"selected",
"files",
"."
] | def preprocess(
output_directory: str,
all_files: Iterable,
includes: Iterable,
show_detailed: bool = False,
show_progress: bool = True,
hip_clang_launch: bool = False,
is_pytorch_extension: bool = False,
clean_ctx: Optional[GeneratedFileCleaner] = None) -... | [
"def",
"preprocess",
"(",
"output_directory",
":",
"str",
",",
"all_files",
":",
"Iterable",
",",
"includes",
":",
"Iterable",
",",
"show_detailed",
":",
"bool",
"=",
"False",
",",
"show_progress",
":",
"bool",
"=",
"True",
",",
"hip_clang_launch",
":",
"boo... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/hipify/hipify_python.py#L188-L220 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/data/parallel_reader.py | python | ParallelReader.__init__ | (self,
reader_class,
common_queue,
num_readers=4,
reader_kwargs=None) | ParallelReader creates num_readers instances of the reader_class.
Each instance is created by calling the `reader_class` function passing
the arguments specified in `reader_kwargs` as in:
reader_class(**read_kwargs)
When you read from a ParallelReader, with its `read()` method,
you just dequeue ... | ParallelReader creates num_readers instances of the reader_class. | [
"ParallelReader",
"creates",
"num_readers",
"instances",
"of",
"the",
"reader_class",
"."
] | def __init__(self,
reader_class,
common_queue,
num_readers=4,
reader_kwargs=None):
"""ParallelReader creates num_readers instances of the reader_class.
Each instance is created by calling the `reader_class` function passing
the arguments specified... | [
"def",
"__init__",
"(",
"self",
",",
"reader_class",
",",
"common_queue",
",",
"num_readers",
"=",
"4",
",",
"reader_kwargs",
"=",
"None",
")",
":",
"if",
"len",
"(",
"common_queue",
".",
"dtypes",
")",
"!=",
"2",
":",
"raise",
"TypeError",
"(",
"'common... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/data/parallel_reader.py#L38-L96 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | PseudoDC.RemoveId | (*args, **kwargs) | return _gdi_.PseudoDC_RemoveId(*args, **kwargs) | RemoveId(self, int id)
Remove the object node (and all operations) associated with an id. | RemoveId(self, int id) | [
"RemoveId",
"(",
"self",
"int",
"id",
")"
] | def RemoveId(*args, **kwargs):
"""
RemoveId(self, int id)
Remove the object node (and all operations) associated with an id.
"""
return _gdi_.PseudoDC_RemoveId(*args, **kwargs) | [
"def",
"RemoveId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_RemoveId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L7633-L7639 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | ReadDir | (*args) | return _gdal.ReadDir(*args) | r"""ReadDir(char const * utf8_path, int nMaxFiles=0) -> char ** | r"""ReadDir(char const * utf8_path, int nMaxFiles=0) -> char ** | [
"r",
"ReadDir",
"(",
"char",
"const",
"*",
"utf8_path",
"int",
"nMaxFiles",
"=",
"0",
")",
"-",
">",
"char",
"**"
] | def ReadDir(*args):
r"""ReadDir(char const * utf8_path, int nMaxFiles=0) -> char **"""
return _gdal.ReadDir(*args) | [
"def",
"ReadDir",
"(",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"ReadDir",
"(",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L1594-L1596 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | SplitterWindow.SetMinimumPaneSize | (*args, **kwargs) | return _windows_.SplitterWindow_SetMinimumPaneSize(*args, **kwargs) | SetMinimumPaneSize(self, int min)
Sets the minimum pane size in pixels.
The default minimum pane size is zero, which means that either pane
can be reduced to zero by dragging the sash, thus removing one of the
panes. To prevent this behaviour (and veto out-of-range sash
draggin... | SetMinimumPaneSize(self, int min) | [
"SetMinimumPaneSize",
"(",
"self",
"int",
"min",
")"
] | def SetMinimumPaneSize(*args, **kwargs):
"""
SetMinimumPaneSize(self, int min)
Sets the minimum pane size in pixels.
The default minimum pane size is zero, which means that either pane
can be reduced to zero by dragging the sash, thus removing one of the
panes. To preve... | [
"def",
"SetMinimumPaneSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SplitterWindow_SetMinimumPaneSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L1596-L1609 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBPlatformShellCommand.GetWorkingDirectory | (self) | return _lldb.SBPlatformShellCommand_GetWorkingDirectory(self) | GetWorkingDirectory(SBPlatformShellCommand self) -> char const * | GetWorkingDirectory(SBPlatformShellCommand self) -> char const * | [
"GetWorkingDirectory",
"(",
"SBPlatformShellCommand",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetWorkingDirectory(self):
"""GetWorkingDirectory(SBPlatformShellCommand self) -> char const *"""
return _lldb.SBPlatformShellCommand_GetWorkingDirectory(self) | [
"def",
"GetWorkingDirectory",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBPlatformShellCommand_GetWorkingDirectory",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8020-L8022 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/buildbot/bb_device_steps.py | python | _ConvertTrieToFlatPaths | (trie, prefix=None) | return result | Flatten the trie of failures into a list. | Flatten the trie of failures into a list. | [
"Flatten",
"the",
"trie",
"of",
"failures",
"into",
"a",
"list",
"."
] | def _ConvertTrieToFlatPaths(trie, prefix=None):
"""Flatten the trie of failures into a list."""
# Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results
result = {}
for name, data in trie.iteritems():
if prefix:
name = prefix + '/' + name
if len(data) and 'actual' not in data and 'e... | [
"def",
"_ConvertTrieToFlatPaths",
"(",
"trie",
",",
"prefix",
"=",
"None",
")",
":",
"# Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results",
"result",
"=",
"{",
"}",
"for",
"name",
",",
"data",
"in",
"trie",
".",
"iteritems",
"(",
")",
":",
"if",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/buildbot/bb_device_steps.py#L350-L363 | |
commaai/openpilot | 4416c21b1e738ab7d04147c5ae52b5135e0cdb40 | selfdrive/controls/lib/vehicle_model.py | python | VehicleModel.get_steer_from_yaw_rate | (self, yaw_rate: float, u: float, roll: float) | return self.get_steer_from_curvature(curv, u, roll) | Calculates the required steering wheel angle for a given yaw_rate
Args:
yaw_rate: Desired yaw rate [rad/s]
u: Speed [m/s]
roll: Road Roll [rad]
Returns:
Steering wheel angle [rad] | Calculates the required steering wheel angle for a given yaw_rate | [
"Calculates",
"the",
"required",
"steering",
"wheel",
"angle",
"for",
"a",
"given",
"yaw_rate"
] | def get_steer_from_yaw_rate(self, yaw_rate: float, u: float, roll: float) -> float:
"""Calculates the required steering wheel angle for a given yaw_rate
Args:
yaw_rate: Desired yaw rate [rad/s]
u: Speed [m/s]
roll: Road Roll [rad]
Returns:
Steering wheel angle [rad]
"""
cur... | [
"def",
"get_steer_from_yaw_rate",
"(",
"self",
",",
"yaw_rate",
":",
"float",
",",
"u",
":",
"float",
",",
"roll",
":",
"float",
")",
"->",
"float",
":",
"curv",
"=",
"yaw_rate",
"/",
"u",
"return",
"self",
".",
"get_steer_from_curvature",
"(",
"curv",
"... | https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/selfdrive/controls/lib/vehicle_model.py#L125-L137 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py | python | metadata | (distribution_name) | return Distribution.from_name(distribution_name).metadata | Get the metadata for the named package.
:param distribution_name: The name of the distribution package to query.
:return: A PackageMetadata containing the parsed metadata. | Get the metadata for the named package. | [
"Get",
"the",
"metadata",
"for",
"the",
"named",
"package",
"."
] | def metadata(distribution_name) -> _meta.PackageMetadata:
"""Get the metadata for the named package.
:param distribution_name: The name of the distribution package to query.
:return: A PackageMetadata containing the parsed metadata.
"""
return Distribution.from_name(distribution_name).metadata | [
"def",
"metadata",
"(",
"distribution_name",
")",
"->",
"_meta",
".",
"PackageMetadata",
":",
"return",
"Distribution",
".",
"from_name",
"(",
"distribution_name",
")",
".",
"metadata"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py#L1024-L1030 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/lib2to3/fixer_util.py | python | Subscript | (index_node) | return Node(syms.trailer, [Leaf(token.LBRACE, "["),
index_node,
Leaf(token.RBRACE, "]")]) | A numeric or string subscript | A numeric or string subscript | [
"A",
"numeric",
"or",
"string",
"subscript"
] | def Subscript(index_node):
"""A numeric or string subscript"""
return Node(syms.trailer, [Leaf(token.LBRACE, "["),
index_node,
Leaf(token.RBRACE, "]")]) | [
"def",
"Subscript",
"(",
"index_node",
")",
":",
"return",
"Node",
"(",
"syms",
".",
"trailer",
",",
"[",
"Leaf",
"(",
"token",
".",
"LBRACE",
",",
"\"[\"",
")",
",",
"index_node",
",",
"Leaf",
"(",
"token",
".",
"RBRACE",
",",
"\"]\"",
")",
"]",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/fixer_util.py#L77-L81 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/utils.py | python | global_scatter | (x,
local_count,
global_count,
group=None,
use_calc_stream=True) | The global_scatter operator distributes the data of x to n_expert * world_size experts according to local_count,
and then receives data according to global_count. The expert refers to a user-defined expert network,
n_expert refers to the number of expert networks owned by each card, and world_size refers to t... | The global_scatter operator distributes the data of x to n_expert * world_size experts according to local_count,
and then receives data according to global_count. The expert refers to a user-defined expert network,
n_expert refers to the number of expert networks owned by each card, and world_size refers to t... | [
"The",
"global_scatter",
"operator",
"distributes",
"the",
"data",
"of",
"x",
"to",
"n_expert",
"*",
"world_size",
"experts",
"according",
"to",
"local_count",
"and",
"then",
"receives",
"data",
"according",
"to",
"global_count",
".",
"The",
"expert",
"refers",
... | def global_scatter(x,
local_count,
global_count,
group=None,
use_calc_stream=True):
"""
The global_scatter operator distributes the data of x to n_expert * world_size experts according to local_count,
and then receives data accordi... | [
"def",
"global_scatter",
"(",
"x",
",",
"local_count",
",",
"global_count",
",",
"group",
"=",
"None",
",",
"use_calc_stream",
"=",
"True",
")",
":",
"if",
"group",
"is",
"not",
"None",
"and",
"not",
"group",
".",
"is_member",
"(",
")",
":",
"return",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/utils.py#L57-L176 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBInstructionList.Print | (self, out) | return _lldb.SBInstructionList_Print(self, out) | Print(SBInstructionList self, FILE * out) | Print(SBInstructionList self, FILE * out) | [
"Print",
"(",
"SBInstructionList",
"self",
"FILE",
"*",
"out",
")"
] | def Print(self, out):
"""Print(SBInstructionList self, FILE * out)"""
return _lldb.SBInstructionList_Print(self, out) | [
"def",
"Print",
"(",
"self",
",",
"out",
")",
":",
"return",
"_lldb",
".",
"SBInstructionList_Print",
"(",
"self",
",",
"out",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6340-L6342 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsEnclosedAlphanumerics | (code) | return ret | Check whether the character is part of
EnclosedAlphanumerics UCS Block | Check whether the character is part of
EnclosedAlphanumerics UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"EnclosedAlphanumerics",
"UCS",
"Block"
] | def uCSIsEnclosedAlphanumerics(code):
"""Check whether the character is part of
EnclosedAlphanumerics UCS Block """
ret = libxml2mod.xmlUCSIsEnclosedAlphanumerics(code)
return ret | [
"def",
"uCSIsEnclosedAlphanumerics",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsEnclosedAlphanumerics",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1711-L1715 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | components/cronet/tools/link_dependencies.py | python | library_deps | (targets, workdir, query=query_ninja) | return deps | Returns the set of library dependencies for the supplied targets.
The entries in the targets list can be either a static library, an object
file, or an executable. Static libraries and object files are incorporated
directly; executables are treated as being thin executable inputs to a fat
executable link step,... | Returns the set of library dependencies for the supplied targets. | [
"Returns",
"the",
"set",
"of",
"library",
"dependencies",
"for",
"the",
"supplied",
"targets",
"."
] | def library_deps(targets, workdir, query=query_ninja):
"""Returns the set of library dependencies for the supplied targets.
The entries in the targets list can be either a static library, an object
file, or an executable. Static libraries and object files are incorporated
directly; executables are treated as b... | [
"def",
"library_deps",
"(",
"targets",
",",
"workdir",
",",
"query",
"=",
"query_ninja",
")",
":",
"deps",
"=",
"set",
"(",
")",
"for",
"target",
"in",
"targets",
":",
"if",
"is_library",
"(",
"target",
")",
":",
"deps",
".",
"add",
"(",
"os",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/components/cronet/tools/link_dependencies.py#L98-L121 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/httplib.py | python | HTTPConnection.send | (self, data) | Send `data' to the server. | Send `data' to the server. | [
"Send",
"data",
"to",
"the",
"server",
"."
] | def send(self, data):
"""Send `data' to the server."""
if self.sock is None:
if self.auto_open:
self.connect()
else:
raise NotConnected()
if self.debuglevel > 0:
print "send:", repr(data)
blocksize = 8192
if has... | [
"def",
"send",
"(",
"self",
",",
"data",
")",
":",
"if",
"self",
".",
"sock",
"is",
"None",
":",
"if",
"self",
".",
"auto_open",
":",
"self",
".",
"connect",
"(",
")",
"else",
":",
"raise",
"NotConnected",
"(",
")",
"if",
"self",
".",
"debuglevel",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/httplib.py#L787-L805 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py | python | AttentionWrapper.__init__ | (self,
cell,
attention_mechanism,
attention_layer_size=None,
alignment_history=False,
cell_input_fn=None,
output_attention=True,
initial_cell_state=None,
name=None,
attention_layer=None... | Construct the `AttentionWrapper`.
**NOTE** If you are using the `BeamSearchDecoder` with a cell wrapped in
`AttentionWrapper`, then you must ensure that:
- The encoder output has been tiled to `beam_width` via
`tf.contrib.seq2seq.tile_batch` (NOT `tf.tile`).
- The `batch_size` argument passed to... | Construct the `AttentionWrapper`. | [
"Construct",
"the",
"AttentionWrapper",
"."
] | def __init__(self,
cell,
attention_mechanism,
attention_layer_size=None,
alignment_history=False,
cell_input_fn=None,
output_attention=True,
initial_cell_state=None,
name=None,
attentio... | [
"def",
"__init__",
"(",
"self",
",",
"cell",
",",
"attention_mechanism",
",",
"attention_layer_size",
"=",
"None",
",",
"alignment_history",
"=",
"False",
",",
"cell_input_fn",
"=",
"None",
",",
"output_attention",
"=",
"True",
",",
"initial_cell_state",
"=",
"N... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L2140-L2335 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.SetPalette | (*args, **kwargs) | return _gdi_.DC_SetPalette(*args, **kwargs) | SetPalette(self, Palette palette)
If this is a window DC or memory DC, assigns the given palette to the
window or bitmap associated with the DC. If the argument is
``wx.NullPalette``, the current palette is selected out of the device
context, and the original palette restored. | SetPalette(self, Palette palette) | [
"SetPalette",
"(",
"self",
"Palette",
"palette",
")"
] | def SetPalette(*args, **kwargs):
"""
SetPalette(self, Palette palette)
If this is a window DC or memory DC, assigns the given palette to the
window or bitmap associated with the DC. If the argument is
``wx.NullPalette``, the current palette is selected out of the device
... | [
"def",
"SetPalette",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_SetPalette",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4056-L4065 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/pytorch/policy_gradient.py | python | PolicyGradient._pi_update | (self) | return pi_loss | Compute the Pi loss on sampled transitions and perform a Pi update.
Returns:
The average Pi loss obtained on this batch. | Compute the Pi loss on sampled transitions and perform a Pi update. | [
"Compute",
"the",
"Pi",
"loss",
"on",
"sampled",
"transitions",
"and",
"perform",
"a",
"Pi",
"update",
"."
] | def _pi_update(self):
"""Compute the Pi loss on sampled transitions and perform a Pi update.
Returns:
The average Pi loss obtained on this batch.
"""
# TODO(author3): illegal action handling.
info_state = torch.Tensor(self._dataset["info_states"])
action = torch.LongTensor(self._dataset["... | [
"def",
"_pi_update",
"(",
"self",
")",
":",
"# TODO(author3): illegal action handling.",
"info_state",
"=",
"torch",
".",
"Tensor",
"(",
"self",
".",
"_dataset",
"[",
"\"info_states\"",
"]",
")",
"action",
"=",
"torch",
".",
"LongTensor",
"(",
"self",
".",
"_d... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/pytorch/policy_gradient.py#L437-L466 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py | python | hermeder | (c, m=1, scl=1, axis=0) | return c | Differentiate a Hermite_e series.
Returns the series coefficients `c` differentiated `m` times along
`axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is an array of coefficients from low to high degree along ea... | Differentiate a Hermite_e series. | [
"Differentiate",
"a",
"Hermite_e",
"series",
"."
] | def hermeder(c, m=1, scl=1, axis=0) :
"""
Differentiate a Hermite_e series.
Returns the series coefficients `c` differentiated `m` times along
`axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is an arra... | [
"def",
"hermeder",
"(",
"c",
",",
"m",
"=",
"1",
",",
"scl",
"=",
"1",
",",
"axis",
"=",
"0",
")",
":",
"c",
"=",
"np",
".",
"array",
"(",
"c",
",",
"ndmin",
"=",
"1",
",",
"copy",
"=",
"1",
")",
"if",
"c",
".",
"dtype",
".",
"char",
"i... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py#L634-L721 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/trade_manage/broker_mail.py | python | MailOrderBroker.sell | (self, code, price, num) | 执行卖出操作,向指定的邮箱发送邮件,格式如下::
邮件标题:【Hkyuu提醒】卖出 证券代码
邮件内容:卖出:证券代码,价格:卖出的价格,数量:卖出数量
:param str code: 证券代码
:param float price: 卖出价格
:param int num: 卖出数量 | 执行卖出操作,向指定的邮箱发送邮件,格式如下::
邮件标题:【Hkyuu提醒】卖出 证券代码
邮件内容:卖出:证券代码,价格:卖出的价格,数量:卖出数量
:param str code: 证券代码
:param float price: 卖出价格
:param int num: 卖出数量 | [
"执行卖出操作,向指定的邮箱发送邮件,格式如下",
"::",
"邮件标题:【Hkyuu提醒】卖出",
"证券代码",
"邮件内容:卖出:证券代码,价格:卖出的价格,数量:卖出数量",
":",
"param",
"str",
"code",
":",
"证券代码",
":",
"param",
"float",
"price",
":",
"卖出价格",
":",
"param",
"int",
"num",
":",
"卖出数量"
] | def sell(self, code, price, num):
"""执行卖出操作,向指定的邮箱发送邮件,格式如下::
邮件标题:【Hkyuu提醒】卖出 证券代码
邮件内容:卖出:证券代码,价格:卖出的价格,数量:卖出数量
:param str code: 证券代码
:param float price: 卖出价格
:param int num: 卖出数量
"""
title = "【Hkyuu提醒】卖出 {}".format(code)
ac... | [
"def",
"sell",
"(",
"self",
",",
"code",
",",
"price",
",",
"num",
")",
":",
"title",
"=",
"\"【Hkyuu提醒】卖出 {}\".format(code",
")",
"",
"",
"",
"",
"action",
"=",
"\"卖出:{},价格:{},数量:{} \".format(code, price, n",
"u",
"m)",
"",
"",
"",
"",
"",
"",
"",
"sel... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/trade_manage/broker_mail.py#L90-L102 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/_cpdispatch.py | python | RoutesDispatcher.__init__ | (self, full_result=False) | Routes dispatcher
Set full_result to True if you wish the controller
and the action to be passed on to the page handler
parameters. By default they won't be. | Routes dispatcher | [
"Routes",
"dispatcher"
] | def __init__(self, full_result=False):
"""
Routes dispatcher
Set full_result to True if you wish the controller
and the action to be passed on to the page handler
parameters. By default they won't be.
"""
import routes
self.full_result = full_result
... | [
"def",
"__init__",
"(",
"self",
",",
"full_result",
"=",
"False",
")",
":",
"import",
"routes",
"self",
".",
"full_result",
"=",
"full_result",
"self",
".",
"controllers",
"=",
"{",
"}",
"self",
".",
"mapper",
"=",
"routes",
".",
"Mapper",
"(",
")",
"s... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpdispatch.py#L455-L467 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/targets.py | python | FeatureMap.flatten | (self, sort=True) | return ','.join('{0}{1}'.format(flag_map[v], k)
for k, v in iterator) | Args
----
sort: bool
Optional. If True, the features are sorted by name; otherwise,
the ordering is unstable between python session due to hash
randomization. Defaults to True.
Returns a string suitable for use as the ``features`` argument to
``Targ... | Args
----
sort: bool
Optional. If True, the features are sorted by name; otherwise,
the ordering is unstable between python session due to hash
randomization. Defaults to True. | [
"Args",
"----",
"sort",
":",
"bool",
"Optional",
".",
"If",
"True",
"the",
"features",
"are",
"sorted",
"by",
"name",
";",
"otherwise",
"the",
"ordering",
"is",
"unstable",
"between",
"python",
"session",
"due",
"to",
"hash",
"randomization",
".",
"Defaults"... | def flatten(self, sort=True):
"""
Args
----
sort: bool
Optional. If True, the features are sorted by name; otherwise,
the ordering is unstable between python session due to hash
randomization. Defaults to True.
Returns a string suitable for ... | [
"def",
"flatten",
"(",
"self",
",",
"sort",
"=",
"True",
")",
":",
"iterator",
"=",
"sorted",
"(",
"self",
".",
"items",
"(",
")",
")",
"if",
"sort",
"else",
"iter",
"(",
"self",
".",
"items",
"(",
")",
")",
"flag_map",
"=",
"{",
"True",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/targets.py#L28-L44 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/configobj.py | python | ConfigObj._handle_error | (self, text, ErrorClass, infile, cur_index) | Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index`` | Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index`` | [
"Handle",
"an",
"error",
"according",
"to",
"the",
"error",
"settings",
".",
"Either",
"raise",
"the",
"error",
"or",
"store",
"it",
".",
"The",
"error",
"will",
"have",
"occured",
"at",
"cur_index"
] | def _handle_error(self, text, ErrorClass, infile, cur_index):
"""
Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index``
"""
line = infile[cur_index]
cur_index += 1
message... | [
"def",
"_handle_error",
"(",
"self",
",",
"text",
",",
"ErrorClass",
",",
"infile",
",",
"cur_index",
")",
":",
"line",
"=",
"infile",
"[",
"cur_index",
"]",
"cur_index",
"+=",
"1",
"message",
"=",
"text",
"%",
"cur_index",
"error",
"=",
"ErrorClass",
"(... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/configobj.py#L1720-L1736 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | MHMessage.__init__ | (self, message=None) | Initialize an MHMessage instance. | Initialize an MHMessage instance. | [
"Initialize",
"an",
"MHMessage",
"instance",
"."
] | def __init__(self, message=None):
"""Initialize an MHMessage instance."""
self._sequences = []
Message.__init__(self, message) | [
"def",
"__init__",
"(",
"self",
",",
"message",
"=",
"None",
")",
":",
"self",
".",
"_sequences",
"=",
"[",
"]",
"Message",
".",
"__init__",
"(",
"self",
",",
"message",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1754-L1757 | ||
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | SourceRange.__contains__ | (self, other) | return False | Useful to detect the Token/Lexer bug | Useful to detect the Token/Lexer bug | [
"Useful",
"to",
"detect",
"the",
"Token",
"/",
"Lexer",
"bug"
] | def __contains__(self, other):
"""Useful to detect the Token/Lexer bug"""
if not isinstance(other, SourceLocation):
return False
if other.file is None and self.start.file is None:
pass
elif ( self.start.file.name != other.file.name or
other.file.nam... | [
"def",
"__contains__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"SourceLocation",
")",
":",
"return",
"False",
"if",
"other",
".",
"file",
"is",
"None",
"and",
"self",
".",
"start",
".",
"file",
"is",
"None",
... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L342-L363 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py | python | TurtleScreenBase._onclick | (self, item, fun, num=1, add=None) | Bind fun to mouse-click event on turtle.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1 | Bind fun to mouse-click event on turtle.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1 | [
"Bind",
"fun",
"to",
"mouse",
"-",
"click",
"event",
"on",
"turtle",
".",
"fun",
"must",
"be",
"a",
"function",
"with",
"two",
"arguments",
"the",
"coordinates",
"of",
"the",
"clicked",
"point",
"on",
"the",
"canvas",
".",
"num",
"the",
"number",
"of",
... | def _onclick(self, item, fun, num=1, add=None):
"""Bind fun to mouse-click event on turtle.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1
"""
if fun is None:
sel... | [
"def",
"_onclick",
"(",
"self",
",",
"item",
",",
"fun",
",",
"num",
"=",
"1",
",",
"add",
"=",
"None",
")",
":",
"if",
"fun",
"is",
"None",
":",
"self",
".",
"cv",
".",
"tag_unbind",
"(",
"item",
",",
"\"<Button-%s>\"",
"%",
"num",
")",
"else",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L629-L642 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/contrib/util.py | python | TempDirectory.remove | (self) | Remote the tmp dir | Remote the tmp dir | [
"Remote",
"the",
"tmp",
"dir"
] | def remove(self):
"""Remote the tmp dir"""
if self.temp_dir:
self._rmtree(self.temp_dir, ignore_errors=True)
self.temp_dir = None | [
"def",
"remove",
"(",
"self",
")",
":",
"if",
"self",
".",
"temp_dir",
":",
"self",
".",
"_rmtree",
"(",
"self",
".",
"temp_dir",
",",
"ignore_errors",
"=",
"True",
")",
"self",
".",
"temp_dir",
"=",
"None"
] | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/contrib/util.py#L16-L20 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/App/FreeCADInit.py | python | removeFromPath | (module_name) | removes the module from the sys.path. The entry point for imports
will therefore always be FreeCAD.
eg.: from FreeCAD.Module.submodule import function | removes the module from the sys.path. The entry point for imports
will therefore always be FreeCAD.
eg.: from FreeCAD.Module.submodule import function | [
"removes",
"the",
"module",
"from",
"the",
"sys",
".",
"path",
".",
"The",
"entry",
"point",
"for",
"imports",
"will",
"therefore",
"always",
"be",
"FreeCAD",
".",
"eg",
".",
":",
"from",
"FreeCAD",
".",
"Module",
".",
"submodule",
"import",
"function"
] | def removeFromPath(module_name):
"""removes the module from the sys.path. The entry point for imports
will therefore always be FreeCAD.
eg.: from FreeCAD.Module.submodule import function"""
import sys
paths = sys.path
for path in paths:
if module_name in path:
sys.path.remove(path)
return
Wrn(module_na... | [
"def",
"removeFromPath",
"(",
"module_name",
")",
":",
"import",
"sys",
"paths",
"=",
"sys",
".",
"path",
"for",
"path",
"in",
"paths",
":",
"if",
"module_name",
"in",
"path",
":",
"sys",
".",
"path",
".",
"remove",
"(",
"path",
")",
"return",
"Wrn",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/App/FreeCADInit.py#L33-L43 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/nturl2path.py | python | pathname2url | (p) | return path | OS-specific conversion from a file system path to a relative URL
of the 'file' scheme; not recommended for general use. | OS-specific conversion from a file system path to a relative URL
of the 'file' scheme; not recommended for general use. | [
"OS",
"-",
"specific",
"conversion",
"from",
"a",
"file",
"system",
"path",
"to",
"a",
"relative",
"URL",
"of",
"the",
"file",
"scheme",
";",
"not",
"recommended",
"for",
"general",
"use",
"."
] | def pathname2url(p):
"""OS-specific conversion from a file system path to a relative URL
of the 'file' scheme; not recommended for general use."""
# e.g.
# C:\foo\bar\spam.foo
# becomes
# ///C|/foo/bar/spam.foo
import urllib
if not ':' in p:
# No drive specifier, just convert sla... | [
"def",
"pathname2url",
"(",
"p",
")",
":",
"# e.g.",
"# C:\\foo\\bar\\spam.foo",
"# becomes",
"# ///C|/foo/bar/spam.foo",
"import",
"urllib",
"if",
"not",
"':'",
"in",
"p",
":",
"# No drive specifier, just convert slashes and quote the name",
"if",
"p",
"[",
":",
"2",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/nturl2path.py#L35-L63 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator_util.py | python | matmul_with_broadcast | (a,
b,
transpose_a=False,
transpose_b=False,
adjoint_a=False,
adjoint_b=False,
a_is_sparse=False,
b_is_sparse=False,
... | Multiplies matrix `a` by matrix `b`, producing `a @ b`.
The inputs must be matrices (or tensors of rank > 2, representing batches of
matrices).
Both matrices must be of the same type. The supported types are:
`float16`, `float32`, `float64`, `int32`, `complex64`, `complex128`.
Either matrix can be transpos... | Multiplies matrix `a` by matrix `b`, producing `a @ b`. | [
"Multiplies",
"matrix",
"a",
"by",
"matrix",
"b",
"producing",
"a",
"@",
"b",
"."
] | def matmul_with_broadcast(a,
b,
transpose_a=False,
transpose_b=False,
adjoint_a=False,
adjoint_b=False,
a_is_sparse=False,
b_is_sparse=Fal... | [
"def",
"matmul_with_broadcast",
"(",
"a",
",",
"b",
",",
"transpose_a",
"=",
"False",
",",
"transpose_b",
"=",
"False",
",",
"adjoint_a",
"=",
"False",
",",
"adjoint_b",
"=",
"False",
",",
"a_is_sparse",
"=",
"False",
",",
"b_is_sparse",
"=",
"False",
",",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator_util.py#L198-L289 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_alternating_legs_env_example.py | python | hand_tuned_balance_example | (log_path=None) | An example that the minitaur balances while alternating its legs.
Args:
log_path: The directory that the log files are written to. If log_path is
None, no logs will be written. | An example that the minitaur balances while alternating its legs. | [
"An",
"example",
"that",
"the",
"minitaur",
"balances",
"while",
"alternating",
"its",
"legs",
"."
] | def hand_tuned_balance_example(log_path=None):
"""An example that the minitaur balances while alternating its legs.
Args:
log_path: The directory that the log files are written to. If log_path is
None, no logs will be written.
"""
steps = 1000
episodes = 5
randomizer = randomizer_lib.MinitaurAlt... | [
"def",
"hand_tuned_balance_example",
"(",
"log_path",
"=",
"None",
")",
":",
"steps",
"=",
"1000",
"episodes",
"=",
"5",
"randomizer",
"=",
"randomizer_lib",
".",
"MinitaurAlternatingLegsEnvRandomizer",
"(",
")",
"environment",
"=",
"minitaur_alternating_legs_env",
".... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_alternating_legs_env_example.py#L66-L102 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | traceParseAction | (f) | return z | Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exc... | Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exc... | [
"Decorator",
"for",
"debugging",
"parse",
"actions",
".",
"When",
"the",
"parse",
"action",
"is",
"called",
"this",
"decorator",
"will",
"print",
"C",
"{",
">>",
"entering",
"I",
"{",
"method",
"-",
"name",
"}",
"(",
"line",
":",
"I",
"{",
"current_sourc... | def traceParseAction(f):
"""
Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} follo... | [
"def",
"traceParseAction",
"(",
"f",
")",
":",
"f",
"=",
"_trim_arity",
"(",
"f",
")",
"def",
"z",
"(",
"*",
"paArgs",
")",
":",
"thisFunc",
"=",
"f",
".",
"__name__",
"s",
",",
"l",
",",
"t",
"=",
"paArgs",
"[",
"-",
"3",
":",
"]",
"if",
"le... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L4406-L4445 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | SimRobotController.getPIDGains | (self) | return _robotsim.SimRobotController_getPIDGains(self) | getPIDGains(SimRobotController self)
Gets the PID gains for the PID controller. | getPIDGains(SimRobotController self) | [
"getPIDGains",
"(",
"SimRobotController",
"self",
")"
] | def getPIDGains(self):
"""
getPIDGains(SimRobotController self)
Gets the PID gains for the PID controller.
"""
return _robotsim.SimRobotController_getPIDGains(self) | [
"def",
"getPIDGains",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"SimRobotController_getPIDGains",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L7788-L7797 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/fourwaysplitter.py | python | FourWaySplitterEvent.IsAllowed | (self) | return self.isAllowed | Returns ``True`` if the change is allowed (:meth:`~FourWaySplitterEvent.Veto` hasn't been called) or
``False`` otherwise (if it was). | Returns ``True`` if the change is allowed (:meth:`~FourWaySplitterEvent.Veto` hasn't been called) or
``False`` otherwise (if it was). | [
"Returns",
"True",
"if",
"the",
"change",
"is",
"allowed",
"(",
":",
"meth",
":",
"~FourWaySplitterEvent",
".",
"Veto",
"hasn",
"t",
"been",
"called",
")",
"or",
"False",
"otherwise",
"(",
"if",
"it",
"was",
")",
"."
] | def IsAllowed(self):
"""
Returns ``True`` if the change is allowed (:meth:`~FourWaySplitterEvent.Veto` hasn't been called) or
``False`` otherwise (if it was).
"""
return self.isAllowed | [
"def",
"IsAllowed",
"(",
"self",
")",
":",
"return",
"self",
".",
"isAllowed"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/fourwaysplitter.py#L271-L277 | |
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/npbackend/bohrium/backend_messaging.py | python | gpu_enable | () | return _backend_msg("GPU: enable") | Enable the GPU backend in the current runtime stack | Enable the GPU backend in the current runtime stack | [
"Enable",
"the",
"GPU",
"backend",
"in",
"the",
"current",
"runtime",
"stack"
] | def gpu_enable():
"""Enable the GPU backend in the current runtime stack"""
return _backend_msg("GPU: enable") | [
"def",
"gpu_enable",
"(",
")",
":",
"return",
"_backend_msg",
"(",
"\"GPU: enable\"",
")"
] | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/backend_messaging.py#L24-L26 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | libVeles/cpplint.py | python | CheckLanguage | (filename, clean_lines, linenum, file_extension, include_state,
error) | Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum:... | Checks rules from the 'C++ language rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"language",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
fil... | [
"def",
"CheckLanguage",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"include_state",
",",
"error",
")",
":",
"# If the line is empty or consists of entirely a comment, no need to",
"# check it.",
"line",
"=",
"clean_lines",
".",
"elide... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L3145-L3446 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py | python | DNNRegressor._get_train_ops | (self, features, targets) | return super(DNNRegressor, self)._get_train_ops(features, targets) | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def _get_train_ops(self, features, targets):
"""See base class."""
self._validate_dnn_feature_columns(features)
return super(DNNRegressor, self)._get_train_ops(features, targets) | [
"def",
"_get_train_ops",
"(",
"self",
",",
"features",
",",
"targets",
")",
":",
"self",
".",
"_validate_dnn_feature_columns",
"(",
"features",
")",
"return",
"super",
"(",
"DNNRegressor",
",",
"self",
")",
".",
"_get_train_ops",
"(",
"features",
",",
"targets... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py#L338-L341 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | TypeHandler.WriteBucketValidationCode | (self, func, file) | Writes the validation code for a bucket version of a command. | Writes the validation code for a bucket version of a command. | [
"Writes",
"the",
"validation",
"code",
"for",
"a",
"bucket",
"version",
"of",
"a",
"command",
"."
] | def WriteBucketValidationCode(self, func, file):
"""Writes the validation code for a bucket version of a command."""
file.Write("// TODO(gman): %s\n" % func.name) | [
"def",
"WriteBucketValidationCode",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"file",
".",
"Write",
"(",
"\"// TODO(gman): %s\\n\"",
"%",
"func",
".",
"name",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2163-L2165 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/sparse/dok.py | python | dok_matrix.conjtransp | (self) | return new | Return the conjugate transpose. | Return the conjugate transpose. | [
"Return",
"the",
"conjugate",
"transpose",
"."
] | def conjtransp(self):
"""Return the conjugate transpose."""
M, N = self.shape
new = dok_matrix((N, M), dtype=self.dtype)
dict.update(new, (((right, left), np.conj(val))
for (left, right), val in iteritems(self)))
return new | [
"def",
"conjtransp",
"(",
"self",
")",
":",
"M",
",",
"N",
"=",
"self",
".",
"shape",
"new",
"=",
"dok_matrix",
"(",
"(",
"N",
",",
"M",
")",
",",
"dtype",
"=",
"self",
".",
"dtype",
")",
"dict",
".",
"update",
"(",
"new",
",",
"(",
"(",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/dok.py#L440-L446 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/bayesflow/python/ops/stochastic_tensor_impl.py | python | StochasticTensor.__init__ | (self,
dist,
name="StochasticTensor",
dist_value_type=None,
loss_fn=sge.score_function) | Construct a `StochasticTensor`.
`StochasticTensor` is backed by the `dist` distribution and its `value`
method will return the same value each time it is called. What `value` is
returned is controlled by the `dist_value_type` (defaults to
`SampleValue`).
Some distributions' sample functions are no... | Construct a `StochasticTensor`. | [
"Construct",
"a",
"StochasticTensor",
"."
] | def __init__(self,
dist,
name="StochasticTensor",
dist_value_type=None,
loss_fn=sge.score_function):
"""Construct a `StochasticTensor`.
`StochasticTensor` is backed by the `dist` distribution and its `value`
method will return the same value each ... | [
"def",
"__init__",
"(",
"self",
",",
"dist",
",",
"name",
"=",
"\"StochasticTensor\"",
",",
"dist_value_type",
"=",
"None",
",",
"loss_fn",
"=",
"sge",
".",
"score_function",
")",
":",
"if",
"not",
"isinstance",
"(",
"dist",
",",
"distribution",
".",
"Dist... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/bayesflow/python/ops/stochastic_tensor_impl.py#L272-L337 | ||
interpretml/interpret | 29466bffc04505fe4f836a83fcfebfd313ac8454 | python/interpret-core/interpret/glassbox/ebm/ebm.py | python | ExplainableBoostingRegressor.predict_and_contrib | (self, X) | return ebm_decision_function_and_explain(
X,
n_samples,
self.feature_names_in_,
self.feature_types_in_,
self.bins_,
self.intercept_,
self.additive_terms_,
self.term_features_
) | Predicts on provided samples, returning predictions and explanations for each sample.
Args:
X: Numpy array for samples.
Returns:
Predictions and local explanations for each sample. | Predicts on provided samples, returning predictions and explanations for each sample. | [
"Predicts",
"on",
"provided",
"samples",
"returning",
"predictions",
"and",
"explanations",
"for",
"each",
"sample",
"."
] | def predict_and_contrib(self, X):
"""Predicts on provided samples, returning predictions and explanations for each sample.
Args:
X: Numpy array for samples.
Returns:
Predictions and local explanations for each sample.
"""
check_is_fitted(self, "has_fitt... | [
"def",
"predict_and_contrib",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
",",
"\"has_fitted_\"",
")",
"X",
",",
"n_samples",
"=",
"clean_X",
"(",
"X",
")",
"return",
"ebm_decision_function_and_explain",
"(",
"X",
",",
"n_samples",
",",
... | https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/glassbox/ebm/ebm.py#L1494-L1517 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/multiprocessing/pool.py | python | Pool.map | (self, func, iterable, chunksize=None) | return self.map_async(func, iterable, chunksize).get() | Equivalent of `map()` builtin | Equivalent of `map()` builtin | [
"Equivalent",
"of",
"map",
"()",
"builtin"
] | def map(self, func, iterable, chunksize=None):
'''
Equivalent of `map()` builtin
'''
assert self._state == RUN
return self.map_async(func, iterable, chunksize).get() | [
"def",
"map",
"(",
"self",
",",
"func",
",",
"iterable",
",",
"chunksize",
"=",
"None",
")",
":",
"assert",
"self",
".",
"_state",
"==",
"RUN",
"return",
"self",
".",
"map_async",
"(",
"func",
",",
"iterable",
",",
"chunksize",
")",
".",
"get",
"(",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/pool.py#L143-L148 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/supervisor.py | python | Supervisor.ready_op | (self) | return self._ready_op | Return the Ready Op used by the supervisor.
Returns:
An Op or `None`. | Return the Ready Op used by the supervisor. | [
"Return",
"the",
"Ready",
"Op",
"used",
"by",
"the",
"supervisor",
"."
] | def ready_op(self):
"""Return the Ready Op used by the supervisor.
Returns:
An Op or `None`.
"""
return self._ready_op | [
"def",
"ready_op",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ready_op"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/supervisor.py#L544-L550 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/offline_debug/mi_validators.py | python | check_add_watchpoint | (method) | return new_method | Wrapper method to check the parameters of DbgServices AddWatchpoint. | Wrapper method to check the parameters of DbgServices AddWatchpoint. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"DbgServices",
"AddWatchpoint",
"."
] | def check_add_watchpoint(method):
"""Wrapper method to check the parameters of DbgServices AddWatchpoint."""
@wraps(method)
def new_method(self, *args, **kwargs):
[id_value, watch_condition, check_node_list, parameter_list], _ = parse_user_args(method, *args, **kwargs)
check_uint32(id_valu... | [
"def",
"check_add_watchpoint",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"id_value",
",",
"watch_condition",
",",
"check_node_list",
",",
"parame... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/offline_debug/mi_validators.py#L56-L84 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/utilities/power_tools.py | python | pow_mid | (p, max_denom: int = 1024) | return p, (p, 1-p) | Return (x,1,t) power tuple
t <= x^p 1^(1-p)
user wants the epigraph variable t | Return (x,1,t) power tuple | [
"Return",
"(",
"x",
"1",
"t",
")",
"power",
"tuple"
] | def pow_mid(p, max_denom: int = 1024):
""" Return (x,1,t) power tuple
t <= x^p 1^(1-p)
user wants the epigraph variable t
"""
assert 0 < p < 1
p = Fraction(p).limit_denominator(max_denom)
return p, (p, 1-p) | [
"def",
"pow_mid",
"(",
"p",
",",
"max_denom",
":",
"int",
"=",
"1024",
")",
":",
"assert",
"0",
"<",
"p",
"<",
"1",
"p",
"=",
"Fraction",
"(",
"p",
")",
".",
"limit_denominator",
"(",
"max_denom",
")",
"return",
"p",
",",
"(",
"p",
",",
"1",
"-... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/utilities/power_tools.py#L102-L111 | |
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/caffe-mnc/scripts/cpp_lint.py | python | RemoveMultiLineComments | (filename, lines, error) | Removes multiline (c-style) comments from lines. | Removes multiline (c-style) comments from lines. | [
"Removes",
"multiline",
"(",
"c",
"-",
"style",
")",
"comments",
"from",
"lines",
"."
] | def RemoveMultiLineComments(filename, lines, error):
"""Removes multiline (c-style) comments from lines."""
lineix = 0
while lineix < len(lines):
lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
if lineix_begin >= len(lines):
return
lineix_end = FindNextMultiLineCommentEnd(lines, line... | [
"def",
"RemoveMultiLineComments",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"lineix",
"=",
"0",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"lineix_begin",
"=",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
"if",
... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L1151-L1164 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/windows_utils.py | python | pipe | (*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE) | Like os.pipe() but with overlapped support and using handles not fds. | Like os.pipe() but with overlapped support and using handles not fds. | [
"Like",
"os",
".",
"pipe",
"()",
"but",
"with",
"overlapped",
"support",
"and",
"using",
"handles",
"not",
"fds",
"."
] | def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
"""Like os.pipe() but with overlapped support and using handles not fds."""
address = tempfile.mktemp(
prefix=r'\\.\pipe\python-pipe-{:d}-{:d}-'.format(
os.getpid(), next(_mmap_counter)))
if duplex:
openmode = ... | [
"def",
"pipe",
"(",
"*",
",",
"duplex",
"=",
"False",
",",
"overlapped",
"=",
"(",
"True",
",",
"True",
")",
",",
"bufsize",
"=",
"BUFSIZE",
")",
":",
"address",
"=",
"tempfile",
".",
"mktemp",
"(",
"prefix",
"=",
"r'\\\\.\\pipe\\python-pipe-{:d}-{:d}-'",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/windows_utils.py#L32-L75 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py | python | cov | (m, y=None, rowvar=True, bias=False, ddof=None, fweights=None,
aweights=None) | return c.squeeze() | Estimate a covariance matrix, given data and weights.
Covariance indicates the level to which two variables vary together.
If we examine N-dimensional samples, :math:`X = [x_1, x_2, ... x_N]^T`,
then the covariance matrix element :math:`C_{ij}` is the covariance of
:math:`x_i` and :math:`x_j`. The elem... | Estimate a covariance matrix, given data and weights. | [
"Estimate",
"a",
"covariance",
"matrix",
"given",
"data",
"and",
"weights",
"."
] | def cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None,
aweights=None):
"""
Estimate a covariance matrix, given data and weights.
Covariance indicates the level to which two variables vary together.
If we examine N-dimensional samples, :math:`X = [x_1, x_2, ... x_N]^T`,
then t... | [
"def",
"cov",
"(",
"m",
",",
"y",
"=",
"None",
",",
"rowvar",
"=",
"True",
",",
"bias",
"=",
"False",
",",
"ddof",
"=",
"None",
",",
"fweights",
"=",
"None",
",",
"aweights",
"=",
"None",
")",
":",
"# Check inputs",
"if",
"ddof",
"is",
"not",
"No... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py#L2246-L2456 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-blocks/python/blocks/qa_rotator_cc.py | python | qa_rotator_cc.test_scheduled_phase_inc_update_with_tagging_disabled | (self) | Test a scheduled phase increment update without tagging the update
Same as test_scheduled_phase_inc_update but with tagging disabled. | Test a scheduled phase increment update without tagging the update | [
"Test",
"a",
"scheduled",
"phase",
"increment",
"update",
"without",
"tagging",
"the",
"update"
] | def test_scheduled_phase_inc_update_with_tagging_disabled(self):
"""Test a scheduled phase increment update without tagging the update
Same as test_scheduled_phase_inc_update but with tagging disabled.
"""
self._setUp(tag_inc_updates=False)
_, _, expected_samples = self._test_... | [
"def",
"test_scheduled_phase_inc_update_with_tagging_disabled",
"(",
"self",
")",
":",
"self",
".",
"_setUp",
"(",
"tag_inc_updates",
"=",
"False",
")",
"_",
",",
"_",
",",
"expected_samples",
"=",
"self",
".",
"_test_scheduled_phase_inc_update",
"(",
")",
"self",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-blocks/python/blocks/qa_rotator_cc.py#L155-L170 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/decimal.py | python | Decimal.sqrt | (self, context=None) | return ans | Return the square root of self. | Return the square root of self. | [
"Return",
"the",
"square",
"root",
"of",
"self",
"."
] | def sqrt(self, context=None):
"""Return the square root of self."""
if context is None:
context = getcontext()
if self._is_special:
ans = self._check_nans(context=context)
if ans:
return ans
if self._isinfinity() and self._sign ==... | [
"def",
"sqrt",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"if",
"self",
".",
"_is_special",
":",
"ans",
"=",
"self",
".",
"_check_nans",
"(",
"context",
"=",
"contex... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L2611-L2708 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | caffe/scripts/cpp_lint.py | python | FindNextMultiLineCommentStart | (lines, lineix) | return len(lines) | Find the beginning marker for a multiline comment. | Find the beginning marker for a multiline comment. | [
"Find",
"the",
"beginning",
"marker",
"for",
"a",
"multiline",
"comment",
"."
] | def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
if lines[lineix].strip().startswith('/*'):
# Only return this marker if the comment goes beyond this line
if lines[lineix].strip().find('*/', 2) < 0:
return l... | [
"def",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"'/*'",
")",
":",
"# Only return this... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L1127-L1135 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_util.py | python | GetContainingWhileContext | (ctxt, stop_ctxt=None) | return None | Returns the first ancestor WhileContext of `ctxt`.
Returns `ctxt` if `ctxt` is a WhileContext, or None if `ctxt` is not in a
while loop.
Args:
ctxt: ControlFlowContext
stop_ctxt: ControlFlowContext, optional. If provided, the search will end
if it sees stop_ctxt.
Returns:
`ctxt` if `ctxt` i... | Returns the first ancestor WhileContext of `ctxt`. | [
"Returns",
"the",
"first",
"ancestor",
"WhileContext",
"of",
"ctxt",
"."
] | def GetContainingWhileContext(ctxt, stop_ctxt=None):
"""Returns the first ancestor WhileContext of `ctxt`.
Returns `ctxt` if `ctxt` is a WhileContext, or None if `ctxt` is not in a
while loop.
Args:
ctxt: ControlFlowContext
stop_ctxt: ControlFlowContext, optional. If provided, the search will end
... | [
"def",
"GetContainingWhileContext",
"(",
"ctxt",
",",
"stop_ctxt",
"=",
"None",
")",
":",
"while",
"ctxt",
":",
"if",
"ctxt",
".",
"IsWhileContext",
"(",
")",
"or",
"ctxt",
"==",
"stop_ctxt",
":",
"return",
"ctxt",
"ctxt",
"=",
"ctxt",
".",
"outer_context"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_util.py#L191-L210 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_data.py | python | Data.get_timestamp | (self) | return timestamp(pn_data_get_timestamp(self._data)) | Get the current node value as a :class:`timestamp`.
:return: If the current node is a timestamp, its value, 0 otherwise. | Get the current node value as a :class:`timestamp`. | [
"Get",
"the",
"current",
"node",
"value",
"as",
"a",
":",
"class",
":",
"timestamp",
"."
] | def get_timestamp(self) -> timestamp:
"""
Get the current node value as a :class:`timestamp`.
:return: If the current node is a timestamp, its value, 0 otherwise.
"""
return timestamp(pn_data_get_timestamp(self._data)) | [
"def",
"get_timestamp",
"(",
"self",
")",
"->",
"timestamp",
":",
"return",
"timestamp",
"(",
"pn_data_get_timestamp",
"(",
"self",
".",
"_data",
")",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_data.py#L1291-L1297 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py | python | Any.Is | (self, descriptor) | return '/' in self.type_url and self.TypeName() == descriptor.full_name | Checks if this Any represents the given protobuf type. | Checks if this Any represents the given protobuf type. | [
"Checks",
"if",
"this",
"Any",
"represents",
"the",
"given",
"protobuf",
"type",
"."
] | def Is(self, descriptor):
"""Checks if this Any represents the given protobuf type."""
return '/' in self.type_url and self.TypeName() == descriptor.full_name | [
"def",
"Is",
"(",
"self",
",",
"descriptor",
")",
":",
"return",
"'/'",
"in",
"self",
".",
"type_url",
"and",
"self",
".",
"TypeName",
"(",
")",
"==",
"descriptor",
".",
"full_name"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L87-L89 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py | python | Progressbar.start | (self, interval=None) | Begin autoincrement mode: schedules a recurring timer event
that calls method step every interval milliseconds.
interval defaults to 50 milliseconds (20 steps/second) if ommited. | Begin autoincrement mode: schedules a recurring timer event
that calls method step every interval milliseconds. | [
"Begin",
"autoincrement",
"mode",
":",
"schedules",
"a",
"recurring",
"timer",
"event",
"that",
"calls",
"method",
"step",
"every",
"interval",
"milliseconds",
"."
] | def start(self, interval=None):
"""Begin autoincrement mode: schedules a recurring timer event
that calls method step every interval milliseconds.
interval defaults to 50 milliseconds (20 steps/second) if ommited."""
self.tk.call(self._w, "start", interval) | [
"def",
"start",
"(",
"self",
",",
"interval",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"start\"",
",",
"interval",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1010-L1015 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/image/image.py | python | RandomSizedCropAug.__call__ | (self, src) | return random_size_crop(src, self.size, self.min_area, self.ratio, self.interp)[0] | Augmenter body | Augmenter body | [
"Augmenter",
"body"
] | def __call__(self, src):
"""Augmenter body"""
return random_size_crop(src, self.size, self.min_area, self.ratio, self.interp)[0] | [
"def",
"__call__",
"(",
"self",
",",
"src",
")",
":",
"return",
"random_size_crop",
"(",
"src",
",",
"self",
".",
"size",
",",
"self",
".",
"min_area",
",",
"self",
".",
"ratio",
",",
"self",
".",
"interp",
")",
"[",
"0",
"]"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/image.py#L614-L616 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/datasets/mnist.py | python | extract_labels | (f, one_hot=False, num_classes=10) | Extract the labels into a 1D uint8 numpy array [index].
Args:
f: A file object that can be passed into a gzip reader.
one_hot: Does one hot encoding for the result.
num_classes: Number of classes for the one hot encoding.
Returns:
labels: a 1D uint8 numpy array.
Raises:
ValueError: If the b... | Extract the labels into a 1D uint8 numpy array [index]. | [
"Extract",
"the",
"labels",
"into",
"a",
"1D",
"uint8",
"numpy",
"array",
"[",
"index",
"]",
"."
] | def extract_labels(f, one_hot=False, num_classes=10):
"""Extract the labels into a 1D uint8 numpy array [index].
Args:
f: A file object that can be passed into a gzip reader.
one_hot: Does one hot encoding for the result.
num_classes: Number of classes for the one hot encoding.
Returns:
labels: ... | [
"def",
"extract_labels",
"(",
"f",
",",
"one_hot",
"=",
"False",
",",
"num_classes",
"=",
"10",
")",
":",
"print",
"(",
"'Extracting'",
",",
"f",
".",
"name",
")",
"with",
"gzip",
".",
"GzipFile",
"(",
"fileobj",
"=",
"f",
")",
"as",
"bytestream",
":... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/datasets/mnist.py#L78-L103 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/sets/sets.py | python | BaseSet.copy | (self) | return result | Return a shallow copy of a set. | Return a shallow copy of a set. | [
"Return",
"a",
"shallow",
"copy",
"of",
"a",
"set",
"."
] | def copy(self):
"""Return a shallow copy of a set."""
result = self.__class__()
result._data.update(self._data)
return result | [
"def",
"copy",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"__class__",
"(",
")",
"result",
".",
"_data",
".",
"update",
"(",
"self",
".",
"_data",
")",
"return",
"result"
] | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/sets/sets.py#L163-L167 | |
facebookresearch/mvfst-rl | 778bc4259ae7277e67c2ead593a493845c93db83 | train/models.py | python | SimpleNet.concat_to_job_id | (self, tensor, job_id) | return torch.cat((tensor, one_hot), dim=1) | Concatenate a 2D tensor with the one-hot encoding associated to `job_id` | Concatenate a 2D tensor with the one-hot encoding associated to `job_id` | [
"Concatenate",
"a",
"2D",
"tensor",
"with",
"the",
"one",
"-",
"hot",
"encoding",
"associated",
"to",
"job_id"
] | def concat_to_job_id(self, tensor, job_id):
"""Concatenate a 2D tensor with the one-hot encoding associated to `job_id`"""
one_hot = (
F.one_hot(job_id.flatten().long(), self.n_train_jobs)
.type(tensor.dtype)
.to(tensor.device)
)
return torch.cat((tens... | [
"def",
"concat_to_job_id",
"(",
"self",
",",
"tensor",
",",
"job_id",
")",
":",
"one_hot",
"=",
"(",
"F",
".",
"one_hot",
"(",
"job_id",
".",
"flatten",
"(",
")",
".",
"long",
"(",
")",
",",
"self",
".",
"n_train_jobs",
")",
".",
"type",
"(",
"tens... | https://github.com/facebookresearch/mvfst-rl/blob/778bc4259ae7277e67c2ead593a493845c93db83/train/models.py#L83-L90 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/eager/function.py | python | _GraphModeFunction._backprop_call | (self, args) | return self._build_call_outputs(self._returns, real_outputs) | Calls the wrapped function and records the result on a tape. | Calls the wrapped function and records the result on a tape. | [
"Calls",
"the",
"wrapped",
"function",
"and",
"records",
"the",
"result",
"on",
"a",
"tape",
"."
] | def _backprop_call(self, args):
"""Calls the wrapped function and records the result on a tape."""
all_args = args + self._extra_inputs
signature = self._forward_fdef.definition.signature
ctx = context.context()
if ctx.in_graph_mode():
g = ops.get_default_graph()
g._add_function(self._fo... | [
"def",
"_backprop_call",
"(",
"self",
",",
"args",
")",
":",
"all_args",
"=",
"args",
"+",
"self",
".",
"_extra_inputs",
"signature",
"=",
"self",
".",
"_forward_fdef",
".",
"definition",
".",
"signature",
"ctx",
"=",
"context",
".",
"context",
"(",
")",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/function.py#L289-L331 | |
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/API/social_api.py | python | SocialAPI.__init__ | (self, extra) | Init | Init | [
"Init"
] | def __init__(self, extra):
"""Init
"""
super(SocialAPI, self).__init__(extra)
"""
self.server = extra["server"]
self.project_manager = extra["project_manager"]
self.output_manager = extra["output_manager"]
""" | [
"def",
"__init__",
"(",
"self",
",",
"extra",
")",
":",
"super",
"(",
"SocialAPI",
",",
"self",
")",
".",
"__init__",
"(",
"extra",
")",
"\"\"\"\n self.server = extra[\"server\"]\n self.project_manager = extra[\"project_manager\"]\n self.output_manager = ex... | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/API/social_api.py#L13-L21 | ||
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/console/console_sci.py | python | ShellScintilla.is_cursor_on_last_line | (self) | return cline == self.lines() - 1 | Return True if cursor is on the last line | Return True if cursor is on the last line | [
"Return",
"True",
"if",
"cursor",
"is",
"on",
"the",
"last",
"line"
] | def is_cursor_on_last_line(self):
"""Return True if cursor is on the last line"""
cline, _ = self.getCursorPosition()
return cline == self.lines() - 1 | [
"def",
"is_cursor_on_last_line",
"(",
"self",
")",
":",
"cline",
",",
"_",
"=",
"self",
".",
"getCursorPosition",
"(",
")",
"return",
"cline",
"==",
"self",
".",
"lines",
"(",
")",
"-",
"1"
] | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/console/console_sci.py#L204-L207 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchWall.py | python | _CommandWall.setWidth | (self,d) | Simple callback for the interactive mode gui widget to set width. | Simple callback for the interactive mode gui widget to set width. | [
"Simple",
"callback",
"for",
"the",
"interactive",
"mode",
"gui",
"widget",
"to",
"set",
"width",
"."
] | def setWidth(self,d):
"""Simple callback for the interactive mode gui widget to set width."""
self.Width = d
self.tracker.width(d)
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("WallWidth",d) | [
"def",
"setWidth",
"(",
"self",
",",
"d",
")",
":",
"self",
".",
"Width",
"=",
"d",
"self",
".",
"tracker",
".",
"width",
"(",
"d",
")",
"FreeCAD",
".",
"ParamGet",
"(",
"\"User parameter:BaseApp/Preferences/Mod/Arch\"",
")",
".",
"SetFloat",
"(",
"\"WallW... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchWall.py#L566-L571 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/random.py | python | seed | (seed_state) | Seeds the random number generators in MXNet.
This affects the behavior of modules in MXNet that uses random number generators,
like the dropout operator and `NDArray`'s random sampling operators.
Parameters
----------
seed_state : int
The random number seed to set to all devices.
Note... | Seeds the random number generators in MXNet. | [
"Seeds",
"the",
"random",
"number",
"generators",
"in",
"MXNet",
"."
] | def seed(seed_state):
"""Seeds the random number generators in MXNet.
This affects the behavior of modules in MXNet that uses random number generators,
like the dropout operator and `NDArray`'s random sampling operators.
Parameters
----------
seed_state : int
The random number seed to ... | [
"def",
"seed",
"(",
"seed_state",
")",
":",
"if",
"not",
"isinstance",
"(",
"seed_state",
",",
"int",
")",
":",
"raise",
"ValueError",
"(",
"'sd must be int'",
")",
"seed_state",
"=",
"ctypes",
".",
"c_int",
"(",
"int",
"(",
"seed_state",
")",
")",
"chec... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/random.py#L29-L66 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexing.py | python | _NDFrameIndexer._multi_take | (self, tup: Tuple) | return o._reindex_with_indexers(d, copy=True, allow_dups=True) | Create the indexers for the passed tuple of keys, and
executes the take operation. This allows the take operation to be
executed all at once, rather than once for each dimension.
Improving efficiency.
Parameters
----------
tup : tuple
Tuple of indexers, one p... | Create the indexers for the passed tuple of keys, and
executes the take operation. This allows the take operation to be
executed all at once, rather than once for each dimension.
Improving efficiency. | [
"Create",
"the",
"indexers",
"for",
"the",
"passed",
"tuple",
"of",
"keys",
"and",
"executes",
"the",
"take",
"operation",
".",
"This",
"allows",
"the",
"take",
"operation",
"to",
"be",
"executed",
"all",
"at",
"once",
"rather",
"than",
"once",
"for",
"eac... | def _multi_take(self, tup: Tuple):
"""
Create the indexers for the passed tuple of keys, and
executes the take operation. This allows the take operation to be
executed all at once, rather than once for each dimension.
Improving efficiency.
Parameters
----------
... | [
"def",
"_multi_take",
"(",
"self",
",",
"tup",
":",
"Tuple",
")",
":",
"# GH 836",
"o",
"=",
"self",
".",
"obj",
"d",
"=",
"{",
"axis",
":",
"self",
".",
"_get_listlike_indexer",
"(",
"key",
",",
"axis",
")",
"for",
"(",
"key",
",",
"axis",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexing.py#L1320-L1342 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/ctc_ops.py | python | ctc_beam_search_decoder | (inputs, sequence_length, beam_width=100,
top_paths=1, merge_repeated=True) | return (
[ops.SparseTensor(ix, val, shape) for (ix, val, shape)
in zip(decoded_ixs, decoded_vals, decoded_shapes)],
log_probabilities) | Performs beam search decoding on the logits given in input.
**Note** The `ctc_greedy_decoder` is a special case of the
`ctc_beam_search_decoder` with `top_paths=1` (but that decoder is faster
for this special case).
If `merge_repeated` is `True`, merge repeated classes in the output beams.
This means that i... | Performs beam search decoding on the logits given in input. | [
"Performs",
"beam",
"search",
"decoding",
"on",
"the",
"logits",
"given",
"in",
"input",
"."
] | def ctc_beam_search_decoder(inputs, sequence_length, beam_width=100,
top_paths=1, merge_repeated=True):
"""Performs beam search decoding on the logits given in input.
**Note** The `ctc_greedy_decoder` is a special case of the
`ctc_beam_search_decoder` with `top_paths=1` (but that deco... | [
"def",
"ctc_beam_search_decoder",
"(",
"inputs",
",",
"sequence_length",
",",
"beam_width",
"=",
"100",
",",
"top_paths",
"=",
"1",
",",
"merge_repeated",
"=",
"True",
")",
":",
"decoded_ixs",
",",
"decoded_vals",
",",
"decoded_shapes",
",",
"log_probabilities",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/ctc_ops.py#L213-L260 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Optimize.set | (self, *args, **keys) | Set a configuration option.
The method `help()` return a string containing all available options. | Set a configuration option.
The method `help()` return a string containing all available options. | [
"Set",
"a",
"configuration",
"option",
".",
"The",
"method",
"help",
"()",
"return",
"a",
"string",
"containing",
"all",
"available",
"options",
"."
] | def set(self, *args, **keys):
"""Set a configuration option.
The method `help()` return a string containing all available options.
"""
p = args2params(args, keys, self.ctx)
Z3_optimize_set_params(self.ctx.ref(), self.optimize, p.params) | [
"def",
"set",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"keys",
")",
":",
"p",
"=",
"args2params",
"(",
"args",
",",
"keys",
",",
"self",
".",
"ctx",
")",
"Z3_optimize_set_params",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7798-L7803 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/ctc/multiproc_data.py | python | MPData.__init__ | (self, num_processes, max_queue_size, fn) | Parameters
----------
num_processes: int
Number of processes to spawn
max_queue_size: int
Maximum samples in the queue before processes wait
fn: function
function that generates samples, executed on separate processes. | Parameters
----------
num_processes: int
Number of processes to spawn
max_queue_size: int
Maximum samples in the queue before processes wait
fn: function
function that generates samples, executed on separate processes. | [
"Parameters",
"----------",
"num_processes",
":",
"int",
"Number",
"of",
"processes",
"to",
"spawn",
"max_queue_size",
":",
"int",
"Maximum",
"samples",
"in",
"the",
"queue",
"before",
"processes",
"wait",
"fn",
":",
"function",
"function",
"that",
"generates",
... | def __init__(self, num_processes, max_queue_size, fn):
"""Parameters
----------
num_processes: int
Number of processes to spawn
max_queue_size: int
Maximum samples in the queue before processes wait
fn: function
function that generates samples,... | [
"def",
"__init__",
"(",
"self",
",",
"num_processes",
",",
"max_queue_size",
",",
"fn",
")",
":",
"self",
".",
"queue",
"=",
"mp",
".",
"Queue",
"(",
"maxsize",
"=",
"int",
"(",
"max_queue_size",
")",
")",
"self",
".",
"alive",
"=",
"mp",
".",
"Value... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/ctc/multiproc_data.py#L38-L52 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/utils/lui/lldbutil.py | python | sort_stopped_threads | (process,
breakpoint_threads=None,
crashed_threads=None,
watchpoint_threads=None,
signal_threads=None,
exiting_threads=None,
other_threads=None) | Fills array *_threads with threads stopped for the corresponding stop
reason. | Fills array *_threads with threads stopped for the corresponding stop
reason. | [
"Fills",
"array",
"*",
"_threads",
"with",
"threads",
"stopped",
"for",
"the",
"corresponding",
"stop",
"reason",
"."
] | def sort_stopped_threads(process,
breakpoint_threads=None,
crashed_threads=None,
watchpoint_threads=None,
signal_threads=None,
exiting_threads=None,
other_threads=None):
... | [
"def",
"sort_stopped_threads",
"(",
"process",
",",
"breakpoint_threads",
"=",
"None",
",",
"crashed_threads",
"=",
"None",
",",
"watchpoint_threads",
"=",
"None",
",",
"signal_threads",
"=",
"None",
",",
"exiting_threads",
"=",
"None",
",",
"other_threads",
"=",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/utils/lui/lldbutil.py#L285-L314 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/utils/group/planar.py | python | rectangle | () | return D(2) | The symmetry group of a rectangle aligned with the Cartesian axes (Vierergruppe). | The symmetry group of a rectangle aligned with the Cartesian axes (Vierergruppe). | [
"The",
"symmetry",
"group",
"of",
"a",
"rectangle",
"aligned",
"with",
"the",
"Cartesian",
"axes",
"(",
"Vierergruppe",
")",
"."
] | def rectangle() -> PointGroup:
"""
The symmetry group of a rectangle aligned with the Cartesian axes (Vierergruppe).
"""
return D(2) | [
"def",
"rectangle",
"(",
")",
"->",
"PointGroup",
":",
"return",
"D",
"(",
"2",
")"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/group/planar.py#L144-L148 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_operator.py | python | _default_read_and_write_value | (value_mem: List[Any],
in_out: int,
attr_value: Optional[Any] = None) | r""" if in_out == 0 stamp value in memory, otherwise get memory_value | r""" if in_out == 0 stamp value in memory, otherwise get memory_value | [
"r",
"if",
"in_out",
"==",
"0",
"stamp",
"value",
"in",
"memory",
"otherwise",
"get",
"memory_value"
] | def _default_read_and_write_value(value_mem: List[Any],
in_out: int,
attr_value: Optional[Any] = None):
r""" if in_out == 0 stamp value in memory, otherwise get memory_value"""
if in_out == 0:
if isinstance(attr_value, (list, tuple, set)):
... | [
"def",
"_default_read_and_write_value",
"(",
"value_mem",
":",
"List",
"[",
"Any",
"]",
",",
"in_out",
":",
"int",
",",
"attr_value",
":",
"Optional",
"[",
"Any",
"]",
"=",
"None",
")",
":",
"if",
"in_out",
"==",
"0",
":",
"if",
"isinstance",
"(",
"att... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_operator.py#L30-L44 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py | python | Taskmaster.will_not_build | (self, nodes, node_func=lambda n: None) | Perform clean-up about nodes that will never be built. Invokes
a user defined function on all of these nodes (including all
of their parents). | Perform clean-up about nodes that will never be built. Invokes
a user defined function on all of these nodes (including all
of their parents). | [
"Perform",
"clean",
"-",
"up",
"about",
"nodes",
"that",
"will",
"never",
"be",
"built",
".",
"Invokes",
"a",
"user",
"defined",
"function",
"on",
"all",
"of",
"these",
"nodes",
"(",
"including",
"all",
"of",
"their",
"parents",
")",
"."
] | def will_not_build(self, nodes, node_func=lambda n: None):
"""
Perform clean-up about nodes that will never be built. Invokes
a user defined function on all of these nodes (including all
of their parents).
"""
T = self.trace
pending_children = self.pending_child... | [
"def",
"will_not_build",
"(",
"self",
",",
"nodes",
",",
"node_func",
"=",
"lambda",
"n",
":",
"None",
")",
":",
"T",
"=",
"self",
".",
"trace",
"pending_children",
"=",
"self",
".",
"pending_children",
"to_visit",
"=",
"set",
"(",
"nodes",
")",
"pending... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py#L999-L1041 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/re.py | python | match | (pattern, string, flags=0) | return _compile(pattern, flags).match(string) | Try to apply the pattern at the start of the string, returning
a match object, or None if no match was found. | Try to apply the pattern at the start of the string, returning
a match object, or None if no match was found. | [
"Try",
"to",
"apply",
"the",
"pattern",
"at",
"the",
"start",
"of",
"the",
"string",
"returning",
"a",
"match",
"object",
"or",
"None",
"if",
"no",
"match",
"was",
"found",
"."
] | def match(pattern, string, flags=0):
"""Try to apply the pattern at the start of the string, returning
a match object, or None if no match was found."""
return _compile(pattern, flags).match(string) | [
"def",
"match",
"(",
"pattern",
",",
"string",
",",
"flags",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"flags",
")",
".",
"match",
"(",
"string",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/re.py#L134-L137 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/summary/impl/io_wrapper.py | python | ListDirectoryAbsolute | (directory) | Yields all files in the given directory. The paths are absolute. | Yields all files in the given directory. The paths are absolute. | [
"Yields",
"all",
"files",
"in",
"the",
"given",
"directory",
".",
"The",
"paths",
"are",
"absolute",
"."
] | def ListDirectoryAbsolute(directory):
"""Yields all files in the given directory. The paths are absolute."""
if gcs.IsGCSPath(directory):
return gcs.ListDirectory(directory)
else:
return (os.path.join(directory, path)
for path in gfile.ListDirectory(directory)) | [
"def",
"ListDirectoryAbsolute",
"(",
"directory",
")",
":",
"if",
"gcs",
".",
"IsGCSPath",
"(",
"directory",
")",
":",
"return",
"gcs",
".",
"ListDirectory",
"(",
"directory",
")",
"else",
":",
"return",
"(",
"os",
".",
"path",
".",
"join",
"(",
"directo... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/summary/impl/io_wrapper.py#L48-L54 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py | python | Telnet.fill_rawq | (self) | Fill raw queue from exactly one recv() system call.
Block if no data is immediately available. Set self.eof when
connection is closed. | Fill raw queue from exactly one recv() system call. | [
"Fill",
"raw",
"queue",
"from",
"exactly",
"one",
"recv",
"()",
"system",
"call",
"."
] | def fill_rawq(self):
"""Fill raw queue from exactly one recv() system call.
Block if no data is immediately available. Set self.eof when
connection is closed.
"""
if self.irawq >= len(self.rawq):
self.rawq = ''
self.irawq = 0
# The buffer size s... | [
"def",
"fill_rawq",
"(",
"self",
")",
":",
"if",
"self",
".",
"irawq",
">=",
"len",
"(",
"self",
".",
"rawq",
")",
":",
"self",
".",
"rawq",
"=",
"''",
"self",
".",
"irawq",
"=",
"0",
"# The buffer size should be fairly small so as to avoid quadratic",
"# be... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L561-L576 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlCellEvent.GetLinkClicked | (*args, **kwargs) | return _html.HtmlCellEvent_GetLinkClicked(*args, **kwargs) | GetLinkClicked(self) -> bool | GetLinkClicked(self) -> bool | [
"GetLinkClicked",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetLinkClicked(*args, **kwargs):
"""GetLinkClicked(self) -> bool"""
return _html.HtmlCellEvent_GetLinkClicked(*args, **kwargs) | [
"def",
"GetLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCellEvent_GetLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1706-L1708 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | SystemSettings.HasFeature | (*args, **kwargs) | return _misc_.SystemSettings_HasFeature(*args, **kwargs) | HasFeature(int index) -> bool | HasFeature(int index) -> bool | [
"HasFeature",
"(",
"int",
"index",
")",
"-",
">",
"bool"
] | def HasFeature(*args, **kwargs):
"""HasFeature(int index) -> bool"""
return _misc_.SystemSettings_HasFeature(*args, **kwargs) | [
"def",
"HasFeature",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"SystemSettings_HasFeature",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L173-L175 | |
libocca/occa | 83b48a6d87a22fb55ae79412206d1dc3b14811fb | scripts/docs/api_docgen/xml_utils.py | python | get_bool_attr | (attrs: Any, attr: str, default_value :Optional[str]='no') | return attrs.get(attr, default_value) == 'yes' | Doxygen booleans are stored 'yes' and 'no' strings | Doxygen booleans are stored 'yes' and 'no' strings | [
"Doxygen",
"booleans",
"are",
"stored",
"yes",
"and",
"no",
"strings"
] | def get_bool_attr(attrs: Any, attr: str, default_value :Optional[str]='no'):
'''
Doxygen booleans are stored 'yes' and 'no' strings
'''
return attrs.get(attr, default_value) == 'yes' | [
"def",
"get_bool_attr",
"(",
"attrs",
":",
"Any",
",",
"attr",
":",
"str",
",",
"default_value",
":",
"Optional",
"[",
"str",
"]",
"=",
"'no'",
")",
":",
"return",
"attrs",
".",
"get",
"(",
"attr",
",",
"default_value",
")",
"==",
"'yes'"
] | https://github.com/libocca/occa/blob/83b48a6d87a22fb55ae79412206d1dc3b14811fb/scripts/docs/api_docgen/xml_utils.py#L65-L69 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py | python | add_to_android_cache | (conf, path_to_resource, arch_override = None) | return rel_path | Adds resource files from outside the engine folder into a local cache directory so they can be used by WAF tasks.
Returns the path of the new resource file relative the cache root. | Adds resource files from outside the engine folder into a local cache directory so they can be used by WAF tasks.
Returns the path of the new resource file relative the cache root. | [
"Adds",
"resource",
"files",
"from",
"outside",
"the",
"engine",
"folder",
"into",
"a",
"local",
"cache",
"directory",
"so",
"they",
"can",
"be",
"used",
"by",
"WAF",
"tasks",
".",
"Returns",
"the",
"path",
"of",
"the",
"new",
"resource",
"file",
"relative... | def add_to_android_cache(conf, path_to_resource, arch_override = None):
"""
Adds resource files from outside the engine folder into a local cache directory so they can be used by WAF tasks.
Returns the path of the new resource file relative the cache root.
"""
cache_node = get_android_cache_node(co... | [
"def",
"add_to_android_cache",
"(",
"conf",
",",
"path_to_resource",
",",
"arch_override",
"=",
"None",
")",
":",
"cache_node",
"=",
"get_android_cache_node",
"(",
"conf",
")",
"cache_node",
".",
"mkdir",
"(",
")",
"dest_node",
"=",
"cache_node",
"dest_subfolder",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py#L527-L554 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | check_feature_columns | (feature_columns) | Checks the validity of the set of FeatureColumns.
Args:
feature_columns: A set of instances or subclasses of FeatureColumn.
Raises:
ValueError: If there are duplicate feature column keys. | Checks the validity of the set of FeatureColumns. | [
"Checks",
"the",
"validity",
"of",
"the",
"set",
"of",
"FeatureColumns",
"."
] | def check_feature_columns(feature_columns):
"""Checks the validity of the set of FeatureColumns.
Args:
feature_columns: A set of instances or subclasses of FeatureColumn.
Raises:
ValueError: If there are duplicate feature column keys.
"""
seen_keys = set()
for f in feature_columns:
key = f.key... | [
"def",
"check_feature_columns",
"(",
"feature_columns",
")",
":",
"seen_keys",
"=",
"set",
"(",
")",
"for",
"f",
"in",
"feature_columns",
":",
"key",
"=",
"f",
".",
"key",
"if",
"key",
"in",
"seen_keys",
":",
"raise",
"ValueError",
"(",
"'Duplicate feature c... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L302-L319 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListCtrl.GetColumnsOrder | (*args, **kwargs) | return _controls_.ListCtrl_GetColumnsOrder(*args, **kwargs) | GetColumnsOrder(self) -> wxArrayInt | GetColumnsOrder(self) -> wxArrayInt | [
"GetColumnsOrder",
"(",
"self",
")",
"-",
">",
"wxArrayInt"
] | def GetColumnsOrder(*args, **kwargs):
"""GetColumnsOrder(self) -> wxArrayInt"""
return _controls_.ListCtrl_GetColumnsOrder(*args, **kwargs) | [
"def",
"GetColumnsOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetColumnsOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4489-L4491 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bdb.py | python | Bdb.clear_bpbynumber | (self, arg) | return None | Delete a breakpoint by its index in Breakpoint.bpbynumber.
If arg is invalid, return an error message. | Delete a breakpoint by its index in Breakpoint.bpbynumber. | [
"Delete",
"a",
"breakpoint",
"by",
"its",
"index",
"in",
"Breakpoint",
".",
"bpbynumber",
"."
] | def clear_bpbynumber(self, arg):
"""Delete a breakpoint by its index in Breakpoint.bpbynumber.
If arg is invalid, return an error message.
"""
try:
bp = self.get_bpbynumber(arg)
except ValueError as err:
return str(err)
bp.deleteMe()
self.... | [
"def",
"clear_bpbynumber",
"(",
"self",
",",
"arg",
")",
":",
"try",
":",
"bp",
"=",
"self",
".",
"get_bpbynumber",
"(",
"arg",
")",
"except",
"ValueError",
"as",
"err",
":",
"return",
"str",
"(",
"err",
")",
"bp",
".",
"deleteMe",
"(",
")",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bdb.py#L414-L425 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBar.ToggleTool | (*args, **kwargs) | return _aui.AuiToolBar_ToggleTool(*args, **kwargs) | ToggleTool(self, int toolId, bool state) | ToggleTool(self, int toolId, bool state) | [
"ToggleTool",
"(",
"self",
"int",
"toolId",
"bool",
"state",
")"
] | def ToggleTool(*args, **kwargs):
"""ToggleTool(self, int toolId, bool state)"""
return _aui.AuiToolBar_ToggleTool(*args, **kwargs) | [
"def",
"ToggleTool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_ToggleTool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2146-L2148 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/compiler.py | python | CodeGenerator.blockvisit | (self, nodes, frame) | Visit a list of nodes as block in a frame. If the current frame
is no buffer a dummy ``if 0: yield None`` is written automatically. | Visit a list of nodes as block in a frame. If the current frame
is no buffer a dummy ``if 0: yield None`` is written automatically. | [
"Visit",
"a",
"list",
"of",
"nodes",
"as",
"block",
"in",
"a",
"frame",
".",
"If",
"the",
"current",
"frame",
"is",
"no",
"buffer",
"a",
"dummy",
"if",
"0",
":",
"yield",
"None",
"is",
"written",
"automatically",
"."
] | def blockvisit(self, nodes, frame):
"""Visit a list of nodes as block in a frame. If the current frame
is no buffer a dummy ``if 0: yield None`` is written automatically.
"""
try:
self.writeline('pass')
for node in nodes:
self.visit(node, frame)
... | [
"def",
"blockvisit",
"(",
"self",
",",
"nodes",
",",
"frame",
")",
":",
"try",
":",
"self",
".",
"writeline",
"(",
"'pass'",
")",
"for",
"node",
"in",
"nodes",
":",
"self",
".",
"visit",
"(",
"node",
",",
"frame",
")",
"except",
"CompilerExit",
":",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/compiler.py#L371-L380 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/BASIC/basparse.py | python | p_command_read_bad | (p) | command : READ error | command : READ error | [
"command",
":",
"READ",
"error"
] | def p_command_read_bad(p):
'''command : READ error'''
p[0] = "MALFORMED VARIABLE LIST IN READ" | [
"def",
"p_command_read_bad",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"MALFORMED VARIABLE LIST IN READ\""
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L97-L99 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/systrace/systrace/tracing_agents/atrace_agent.py | python | try_create_agent | (options) | return BootAgent() if options.boot else AtraceAgent() | Create an Atrace agent.
Args:
options: Command line options.
categories: Categories of trace events to capture. | Create an Atrace agent. | [
"Create",
"an",
"Atrace",
"agent",
"."
] | def try_create_agent(options):
"""Create an Atrace agent.
Args:
options: Command line options.
categories: Categories of trace events to capture.
"""
if options.target != 'android':
return False
if options.from_file is not None:
return False
# Check device SDK version.
device_sdk_ver... | [
"def",
"try_create_agent",
"(",
"options",
")",
":",
"if",
"options",
".",
"target",
"!=",
"'android'",
":",
"return",
"False",
"if",
"options",
".",
"from_file",
"is",
"not",
"None",
":",
"return",
"False",
"# Check device SDK version.",
"device_sdk_version",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/systrace/systrace/tracing_agents/atrace_agent.py#L67-L91 | |
dicecco1/fpga_caffe | 7a191704efd7873071cfef35772d7e7bf3e3cfd6 | scripts/cpp_lint.py | python | FindStartOfExpressionInLine | (line, endpos, depth, startchar, endchar) | return (-1, depth) | Find position at the matching startchar.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching at this position.
depth: nesting level at endpos.
startchar: expression... | Find position at the matching startchar. | [
"Find",
"position",
"at",
"the",
"matching",
"startchar",
"."
] | def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar):
"""Find position at the matching startchar.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching ... | [
"def",
"FindStartOfExpressionInLine",
"(",
"line",
",",
"endpos",
",",
"depth",
",",
"startchar",
",",
"endchar",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"endpos",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"if",
"line",
"[",
"i",
"]",
"==",
"endch... | https://github.com/dicecco1/fpga_caffe/blob/7a191704efd7873071cfef35772d7e7bf3e3cfd6/scripts/cpp_lint.py#L1304-L1328 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.