nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/npyio.py
python
genfromtxt
(fname, dtype=float, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=''.join(sorted(NameValidator.defaultdeletechars)), ...
return output.squeeze()
Load data from a text file, with missing values handled as specified. Each line past the first `skip_header` lines is split at the `delimiter` character, and characters following the `comments` character are discarded. Parameters ---------- fname : file, str, pathlib.Path, list of str, generator ...
Load data from a text file, with missing values handled as specified.
[ "Load", "data", "from", "a", "text", "file", "with", "missing", "values", "handled", "as", "specified", "." ]
def genfromtxt(fname, dtype=float, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=''.join(sorted(NameValidator.defaultdeletechars)),...
[ "def", "genfromtxt", "(", "fname", ",", "dtype", "=", "float", ",", "comments", "=", "'#'", ",", "delimiter", "=", "None", ",", "skip_header", "=", "0", ",", "skip_footer", "=", "0", ",", "converters", "=", "None", ",", "missing_values", "=", "None", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/npyio.py#L1562-L2254
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
wrappers/Python/CoolProp/Plots/SimpleCyclesCompression.py
python
SimpleCompressionCycle.simple_solve_dt
(self, Te, Tc, dT_sh, dT_sc, eta_com, fluid=None, SI=True)
A simple vapour compression cycle calculation based on superheat, subcooling and temperatures. Parameters ---------- Te : float The evaporation temperature Tc : float The condensation temperature dT_sh : float The superheat after the e...
A simple vapour compression cycle calculation based on superheat, subcooling and temperatures.
[ "A", "simple", "vapour", "compression", "cycle", "calculation", "based", "on", "superheat", "subcooling", "and", "temperatures", "." ]
def simple_solve_dt(self, Te, Tc, dT_sh, dT_sc, eta_com, fluid=None, SI=True): """" A simple vapour compression cycle calculation based on superheat, subcooling and temperatures. Parameters ---------- Te : float The evaporation temperature Tc : float ...
[ "def", "simple_solve_dt", "(", "self", ",", "Te", ",", "Tc", ",", "dT_sh", ",", "dT_sc", ",", "eta_com", ",", "fluid", "=", "None", ",", "SI", "=", "True", ")", ":", "if", "fluid", "is", "not", "None", ":", "self", ".", "state", "=", "process_fluid...
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/wrappers/Python/CoolProp/Plots/SimpleCyclesCompression.py#L163-L217
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CondCore/Utilities/scripts/uploadConditions_v2.py
python
getInputWorkflow
(prompt = '')
Like getInput() but tailored to get target workflows (synchronization options).
Like getInput() but tailored to get target workflows (synchronization options).
[ "Like", "getInput", "()", "but", "tailored", "to", "get", "target", "workflows", "(", "synchronization", "options", ")", "." ]
def getInputWorkflow(prompt = ''): '''Like getInput() but tailored to get target workflows (synchronization options). ''' while True: workflow = getInput(defaultWorkflow, prompt) if workflow in frozenset(['offline', 'hlt', 'express', 'prompt', 'pcl']): return workflow ...
[ "def", "getInputWorkflow", "(", "prompt", "=", "''", ")", ":", "while", "True", ":", "workflow", "=", "getInput", "(", "defaultWorkflow", ",", "prompt", ")", "if", "workflow", "in", "frozenset", "(", "[", "'offline'", ",", "'hlt'", ",", "'express'", ",", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/scripts/uploadConditions_v2.py#L73-L83
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Misc.winfo_reqwidth
(self)
return getint( self.tk.call('winfo', 'reqwidth', self._w))
Return requested width of this widget.
Return requested width of this widget.
[ "Return", "requested", "width", "of", "this", "widget", "." ]
def winfo_reqwidth(self): """Return requested width of this widget.""" return getint( self.tk.call('winfo', 'reqwidth', self._w))
[ "def", "winfo_reqwidth", "(", "self", ")", ":", "return", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'reqwidth'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L896-L899
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/actionlib/tools/library.py
python
yaml_msgs_str
(type_, yaml_str, filename=None)
return msgs
Load messages from YAML list-of-dictionaries representation. @param type_: Message class @type type_: class (Message subclass) @param filename: Name of YAML file @type filename: str
Load messages from YAML list-of-dictionaries representation.
[ "Load", "messages", "from", "YAML", "list", "-", "of", "-", "dictionaries", "representation", "." ]
def yaml_msgs_str(type_, yaml_str, filename=None): """ Load messages from YAML list-of-dictionaries representation. @param type_: Message class @type type_: class (Message subclass) @param filename: Name of YAML file @type filename: str """ import yaml yaml_doc = yaml.load(yaml_st...
[ "def", "yaml_msgs_str", "(", "type_", ",", "yaml_str", ",", "filename", "=", "None", ")", ":", "import", "yaml", "yaml_doc", "=", "yaml", ".", "load", "(", "yaml_str", ")", "msgs", "=", "[", "]", "for", "msg_dict", "in", "yaml_doc", ":", "if", "not", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/actionlib/tools/library.py#L117-L138
zhaoweicai/hwgq
ebc706bee3e2d145de1da4be446ce8de8740738f
scripts/cpp_lint.py
python
_NestingState.SeenOpenBrace
(self)
return (not self.stack) or self.stack[-1].seen_open_brace
Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace.
Check if we have seen the opening brace for the innermost block.
[ "Check", "if", "we", "have", "seen", "the", "opening", "brace", "for", "the", "innermost", "block", "." ]
def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace
[ "def", "SeenOpenBrace", "(", "self", ")", ":", "return", "(", "not", "self", ".", "stack", ")", "or", "self", ".", "stack", "[", "-", "1", "]", ".", "seen_open_brace" ]
https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/scripts/cpp_lint.py#L1931-L1938
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
demo/HuggingFace/NNDF/interface.py
python
NetworkCommand.check_network_metadata_is_supported
(self, metadata: NetworkMetadata)
Checks if current command supports the given metadata as defined by the NNConfig. Args: metadata (NetworkMetadata): NetworkMetadata to check if input is supported. Throws: NotImplementedError: If the given metadata is not a valid configuration for this network. Returns:...
Checks if current command supports the given metadata as defined by the NNConfig. Args: metadata (NetworkMetadata): NetworkMetadata to check if input is supported.
[ "Checks", "if", "current", "command", "supports", "the", "given", "metadata", "as", "defined", "by", "the", "NNConfig", ".", "Args", ":", "metadata", "(", "NetworkMetadata", ")", ":", "NetworkMetadata", "to", "check", "if", "input", "is", "supported", "." ]
def check_network_metadata_is_supported(self, metadata: NetworkMetadata) -> None: """ Checks if current command supports the given metadata as defined by the NNConfig. Args: metadata (NetworkMetadata): NetworkMetadata to check if input is supported. Throws: NotIm...
[ "def", "check_network_metadata_is_supported", "(", "self", ",", "metadata", ":", "NetworkMetadata", ")", "->", "None", ":", "if", "metadata", "not", "in", "self", ".", "config", ".", "variants", ":", "raise", "NotImplementedError", "(", "\"The following network conf...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/interface.py#L127-L144
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py
python
scope_name
()
return context().scope_name
Name of the current scope.
Name of the current scope.
[ "Name", "of", "the", "current", "scope", "." ]
def scope_name(): """Name of the current scope.""" return context().scope_name
[ "def", "scope_name", "(", ")", ":", "return", "context", "(", ")", ".", "scope_name" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L1654-L1656
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
Type.argument_types
(self)
return ArgumentsIterator(self)
Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance.
Retrieve a container for the non-variadic arguments for this type.
[ "Retrieve", "a", "container", "for", "the", "non", "-", "variadic", "arguments", "for", "this", "type", "." ]
def argument_types(self): """Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance. """ class ArgumentsIterator(collections_abc.Sequence): def __init__(self, par...
[ "def", "argument_types", "(", "self", ")", ":", "class", "ArgumentsIterator", "(", "collections_abc", ".", "Sequence", ")", ":", "def", "__init__", "(", "self", ",", "parent", ")", ":", "self", ".", "parent", "=", "parent", "self", ".", "length", "=", "N...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L2192-L2228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/plugin.py
python
PluginManager.EnablePlugin
(self, plugin, enable=True)
Enables a named plugin. @param plugin: plugin to enable/disable (case insensitive) @param enable: should plugin be enabled or disabled @precondition: plugin must be managed by this manager instance @postcondition: plugin is added to activate list for activation on ...
Enables a named plugin. @param plugin: plugin to enable/disable (case insensitive) @param enable: should plugin be enabled or disabled @precondition: plugin must be managed by this manager instance @postcondition: plugin is added to activate list for activation on ...
[ "Enables", "a", "named", "plugin", ".", "@param", "plugin", ":", "plugin", "to", "enable", "/", "disable", "(", "case", "insensitive", ")", "@param", "enable", ":", "should", "plugin", "be", "enabled", "or", "disabled", "@precondition", ":", "plugin", "must"...
def EnablePlugin(self, plugin, enable=True): """Enables a named plugin. @param plugin: plugin to enable/disable (case insensitive) @param enable: should plugin be enabled or disabled @precondition: plugin must be managed by this manager instance @postcondition: plugin is added to...
[ "def", "EnablePlugin", "(", "self", ",", "plugin", ",", "enable", "=", "True", ")", ":", "for", "name", "in", "self", ".", "_config", ":", "if", "name", ".", "lower", "(", ")", "==", "plugin", ".", "lower", "(", ")", ":", "plugin", "=", "name", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L581-L598
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/build/build_request.py
python
expand_no_defaults
(property_sets)
return [property_set.create(p) for p in product]
Expand the given build request by combining all property_sets which don't specify conflicting non-free features.
Expand the given build request by combining all property_sets which don't specify conflicting non-free features.
[ "Expand", "the", "given", "build", "request", "by", "combining", "all", "property_sets", "which", "don", "t", "specify", "conflicting", "non", "-", "free", "features", "." ]
def expand_no_defaults (property_sets): """ Expand the given build request by combining all property_sets which don't specify conflicting non-free features. """ assert is_iterable_typed(property_sets, property_set.PropertySet) # First make all features and subfeatures explicit expanded_prope...
[ "def", "expand_no_defaults", "(", "property_sets", ")", ":", "assert", "is_iterable_typed", "(", "property_sets", ",", "property_set", ".", "PropertySet", ")", "# First make all features and subfeatures explicit", "expanded_property_sets", "=", "[", "ps", ".", "expand_subfe...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/build_request.py#L17-L28
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/bdb.py
python
Bdb.is_skipped_module
(self, module_name)
return False
Return True if module_name matches any skip pattern.
Return True if module_name matches any skip pattern.
[ "Return", "True", "if", "module_name", "matches", "any", "skip", "pattern", "." ]
def is_skipped_module(self, module_name): "Return True if module_name matches any skip pattern." for pattern in self.skip: if fnmatch.fnmatch(module_name, pattern): return True return False
[ "def", "is_skipped_module", "(", "self", ",", "module_name", ")", ":", "for", "pattern", "in", "self", ".", "skip", ":", "if", "fnmatch", ".", "fnmatch", "(", "module_name", ",", "pattern", ")", ":", "return", "True", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/bdb.py#L191-L196
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/largest-triangle-area.py
python
Solution.largestTriangleArea
(self, points)
return result
:type points: List[List[int]] :rtype: float
:type points: List[List[int]] :rtype: float
[ ":", "type", "points", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "float" ]
def largestTriangleArea(self, points): """ :type points: List[List[int]] :rtype: float """ result = 0 for i in xrange(len(points)-2): for j in xrange(i+1, len(points)-1): for k in xrange(j+1, len(points)): result = max(resul...
[ "def", "largestTriangleArea", "(", "self", ",", "points", ")", ":", "result", "=", "0", "for", "i", "in", "xrange", "(", "len", "(", "points", ")", "-", "2", ")", ":", "for", "j", "in", "xrange", "(", "i", "+", "1", ",", "len", "(", "points", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/largest-triangle-area.py#L6-L22
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py
python
GroupEncoder
(field_number, is_repeated, is_packed)
Returns an encoder for a group field.
Returns an encoder for a group field.
[ "Returns", "an", "encoder", "for", "a", "group", "field", "." ]
def GroupEncoder(field_number, is_repeated, is_packed): """Returns an encoder for a group field.""" start_tag = TagBytes(field_number, wire_format.WIRETYPE_START_GROUP) end_tag = TagBytes(field_number, wire_format.WIRETYPE_END_GROUP) assert not is_packed if is_repeated: def EncodeRepeatedField(write, val...
[ "def", "GroupEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "start_tag", "=", "TagBytes", "(", "field_number", ",", "wire_format", ".", "WIRETYPE_START_GROUP", ")", "end_tag", "=", "TagBytes", "(", "field_number", ",", "wire_format"...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py#L697-L715
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/auto_control_deps.py
python
AutomaticControlDependencies.run_independently
(self, op)
Marks the given op as independent. Overrides any other rule for the op. Independent ops are guaranteed to execute before the return values, but are allowed to run in parallel with everything else. Use in programs which can guarantee that an op has side effects that don't affect any other op. Args...
Marks the given op as independent.
[ "Marks", "the", "given", "op", "as", "independent", "." ]
def run_independently(self, op): """Marks the given op as independent. Overrides any other rule for the op. Independent ops are guaranteed to execute before the return values, but are allowed to run in parallel with everything else. Use in programs which can guarantee that an op has side effects t...
[ "def", "run_independently", "(", "self", ",", "op", ")", ":", "self", ".", "_independent_ops", ".", "append", "(", "op", ")", "op", ".", "_set_attr", "(", "\"_independent_side_effects\"", ",", "attr_value_pb2", ".", "AttrValue", "(", "b", "=", "True", ")", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/auto_control_deps.py#L252-L265
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
Get1CnCom
(*args)
return _snap.Get1CnCom(*args)
Get1CnCom(PUNGraph const & Graph, TCnComV & Cn1ComV) Parameters: Graph: PUNGraph const & Cn1ComV: TCnComV &
Get1CnCom(PUNGraph const & Graph, TCnComV & Cn1ComV)
[ "Get1CnCom", "(", "PUNGraph", "const", "&", "Graph", "TCnComV", "&", "Cn1ComV", ")" ]
def Get1CnCom(*args): """ Get1CnCom(PUNGraph const & Graph, TCnComV & Cn1ComV) Parameters: Graph: PUNGraph const & Cn1ComV: TCnComV & """ return _snap.Get1CnCom(*args)
[ "def", "Get1CnCom", "(", "*", "args", ")", ":", "return", "_snap", ".", "Get1CnCom", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L741-L750
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Canvas.icursor
(self, *args)
Set cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.
Set cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.
[ "Set", "cursor", "at", "position", "POS", "in", "the", "item", "identified", "by", "TAGORID", ".", "In", "ARGS", "TAGORID", "must", "be", "first", "." ]
def icursor(self, *args): """Set cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.""" self.tk.call((self._w, 'icursor') + args)
[ "def", "icursor", "(", "self", ",", "*", "args", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'icursor'", ")", "+", "args", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2327-L2330
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.get_coord
(self, i)
return listX[0], listY[0], listZ[0]
get model coordinates of a single node >>> x_coord, y_coord, z_coord = exo.get_coord(node_index) Parameters ---------- node_index : int the 1-based node index (indexing is from 1 to exo.num_nodes()) Returns ------- x_coord : double globa...
get model coordinates of a single node
[ "get", "model", "coordinates", "of", "a", "single", "node" ]
def get_coord(self, i): """ get model coordinates of a single node >>> x_coord, y_coord, z_coord = exo.get_coord(node_index) Parameters ---------- node_index : int the 1-based node index (indexing is from 1 to exo.num_nodes()) Returns ------...
[ "def", "get_coord", "(", "self", ",", "i", ")", ":", "listX", ",", "listY", ",", "listZ", "=", "self", ".", "__ex_get_partial_coord", "(", "i", ",", "1", ")", "return", "listX", "[", "0", "]", ",", "listY", "[", "0", "]", ",", "listZ", "[", "0", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L1255-L1286
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/grassprovider/ext/v_edit.py
python
checkParameterValuesBeforeExecuting
(alg, parameters, context)
return True, None
Verify if we have the right parameters
Verify if we have the right parameters
[ "Verify", "if", "we", "have", "the", "right", "parameters" ]
def checkParameterValuesBeforeExecuting(alg, parameters, context): """ Verify if we have the right parameters """ if (alg.parameterAsString(parameters, 'input_txt', context) and alg.parameterAsString(parameters, 'input', context)): return False, alg.tr("You need to set either an input ASCII ...
[ "def", "checkParameterValuesBeforeExecuting", "(", "alg", ",", "parameters", ",", "context", ")", ":", "if", "(", "alg", ".", "parameterAsString", "(", "parameters", ",", "'input_txt'", ",", "context", ")", "and", "alg", ".", "parameterAsString", "(", "parameter...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/grassprovider/ext/v_edit.py#L28-L34
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pgen2/driver.py
python
main
(*args)
return True
Main program, when run as a script: produce grammar pickle files. Calls load_grammar for each argument, a path to a grammar text file.
Main program, when run as a script: produce grammar pickle files.
[ "Main", "program", "when", "run", "as", "a", "script", ":", "produce", "grammar", "pickle", "files", "." ]
def main(*args): """Main program, when run as a script: produce grammar pickle files. Calls load_grammar for each argument, a path to a grammar text file. """ if not args: args = sys.argv[1:] logging.basicConfig(level=logging.INFO, stream=sys.stdout, format='%(messag...
[ "def", "main", "(", "*", "args", ")", ":", "if", "not", "args", ":", "args", "=", "sys", ".", "argv", "[", "1", ":", "]", "logging", ".", "basicConfig", "(", "level", "=", "logging", ".", "INFO", ",", "stream", "=", "sys", ".", "stdout", ",", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pgen2/driver.py#L143-L154
kclyu/rpi-webrtc-streamer
e109e418aa9023009b3b59c95eec2de4721125be
tools/telegramBot.py
python
bot_error_handler
(bot, update, error)
Log Errors caused by Updates.
Log Errors caused by Updates.
[ "Log", "Errors", "caused", "by", "Updates", "." ]
def bot_error_handler(bot, update, error): """Log Errors caused by Updates. """ logger.warning('Update "%s" caused error "%s"', update, error)
[ "def", "bot_error_handler", "(", "bot", ",", "update", ",", "error", ")", ":", "logger", ".", "warning", "(", "'Update \"%s\" caused error \"%s\"'", ",", "update", ",", "error", ")" ]
https://github.com/kclyu/rpi-webrtc-streamer/blob/e109e418aa9023009b3b59c95eec2de4721125be/tools/telegramBot.py#L609-L612
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/python_message.py
python
_BytesForNonRepeatedElement
(value, field_number, field_type)
Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value. Args: value: Value we're serializing. field_number: Field number of this value. (Since the field number ...
Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value.
[ "Returns", "the", "number", "of", "bytes", "needed", "to", "serialize", "a", "non", "-", "repeated", "element", ".", "The", "returned", "byte", "count", "includes", "space", "for", "tag", "information", "and", "any", "other", "additional", "space", "associated...
def _BytesForNonRepeatedElement(value, field_number, field_type): """Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value. Args: value: Value we're serializing. ...
[ "def", "_BytesForNonRepeatedElement", "(", "value", ",", "field_number", ",", "field_type", ")", ":", "try", ":", "fn", "=", "type_checkers", ".", "TYPE_TO_BYTE_SIZE_FN", "[", "field_type", "]", "return", "fn", "(", "field_number", ",", "value", ")", "except", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/python_message.py#L1041-L1058
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/image/detection.py
python
ImageDetIter._check_valid_label
(self, label)
Validate label and its shape.
Validate label and its shape.
[ "Validate", "label", "and", "its", "shape", "." ]
def _check_valid_label(self, label): """Validate label and its shape.""" if len(label.shape) != 2 or label.shape[1] < 5: msg = "Label with shape (1+, 5+) required, %s received." % str(label) raise RuntimeError(msg) valid_label = np.where(np.logical_and(label[:, 0] >= 0, l...
[ "def", "_check_valid_label", "(", "self", ",", "label", ")", ":", "if", "len", "(", "label", ".", "shape", ")", "!=", "2", "or", "label", ".", "shape", "[", "1", "]", "<", "5", ":", "msg", "=", "\"Label with shape (1+, 5+) required, %s received.\"", "%", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/detection.py#L692-L700
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/sonnx.py
python
SingaFrontend._create_slice
(cls, op, op_t)
return node
get a onnx node from singa slice Args: op: a given operator Args: op_t: the tensor of the operator Returns: the onnx node
get a onnx node from singa slice Args: op: a given operator Args: op_t: the tensor of the operator Returns: the onnx node
[ "get", "a", "onnx", "node", "from", "singa", "slice", "Args", ":", "op", ":", "a", "given", "operator", "Args", ":", "op_t", ":", "the", "tensor", "of", "the", "operator", "Returns", ":", "the", "onnx", "node" ]
def _create_slice(cls, op, op_t): """ get a onnx node from singa slice Args: op: a given operator Args: op_t: the tensor of the operator Returns: the onnx node """ node = cls._common_singa_tensor_to_onnx_node(op, op_t) ...
[ "def", "_create_slice", "(", "cls", ",", "op", ",", "op_t", ")", ":", "node", "=", "cls", ".", "_common_singa_tensor_to_onnx_node", "(", "op", ",", "op_t", ")", "for", "attr", "in", "[", "'starts'", ",", "'ends'", ",", "'axes'", ",", "'steps'", "]", ":...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L314-L327
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintscoordentry.py
python
CoordEntry.set_mass
(self, mass)
Assign the mass of the atom (useful for isotopic substitutions).
Assign the mass of the atom (useful for isotopic substitutions).
[ "Assign", "the", "mass", "of", "the", "atom", "(", "useful", "for", "isotopic", "substitutions", ")", "." ]
def set_mass(self, mass): """Assign the mass of the atom (useful for isotopic substitutions).""" self.PYmass = mass
[ "def", "set_mass", "(", "self", ",", "mass", ")", ":", "self", ".", "PYmass", "=", "mass" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintscoordentry.py#L294-L296
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/uff_ssd/utils/inference_trt.py
python
TRTInference.infer
(self, image_path)
return detection_out, keepCount_out
Infers model on given image. Args: image_path (str): image to run object detection model on
Infers model on given image.
[ "Infers", "model", "on", "given", "image", "." ]
def infer(self, image_path): """Infers model on given image. Args: image_path (str): image to run object detection model on """ # Load image into CPU img = self._load_img(image_path) # Copy it into appropriate place into memory # (self.inputs was re...
[ "def", "infer", "(", "self", ",", "image_path", ")", ":", "# Load image into CPU", "img", "=", "self", ".", "_load_img", "(", "image_path", ")", "# Copy it into appropriate place into memory", "# (self.inputs was returned earlier by allocate_buffers())", "np", ".", "copyto"...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/uff_ssd/utils/inference_trt.py#L104-L132
Illumina/manta
75b5c38d4fcd2f6961197b28a41eb61856f2d976
src/python/lib/configureUtil.py
python
getConfigWithPrimaryOptions
(pickleConfigFile,primarySection)
return (options,configSections)
Deserialize the config pickle file and return (1) a class representing the options of a section specified as primary (2) a hash of hashes representing all sections
Deserialize the config pickle file and return (1) a class representing the options of a section specified as primary (2) a hash of hashes representing all sections
[ "Deserialize", "the", "config", "pickle", "file", "and", "return", "(", "1", ")", "a", "class", "representing", "the", "options", "of", "a", "section", "specified", "as", "primary", "(", "2", ")", "a", "hash", "of", "hashes", "representing", "all", "sectio...
def getConfigWithPrimaryOptions(pickleConfigFile,primarySection) : """ Deserialize the config pickle file and return (1) a class representing the options of a section specified as primary (2) a hash of hashes representing all sections """ configSections=getConfigSections(pickleConfigFile) op...
[ "def", "getConfigWithPrimaryOptions", "(", "pickleConfigFile", ",", "primarySection", ")", ":", "configSections", "=", "getConfigSections", "(", "pickleConfigFile", ")", "options", "=", "getPrimarySectionOptions", "(", "configSections", ",", "primarySection", ")", "return...
https://github.com/Illumina/manta/blob/75b5c38d4fcd2f6961197b28a41eb61856f2d976/src/python/lib/configureUtil.py#L98-L107
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParseResults.asXML
( self, doctag=None, namedItemsOnly=False, indent="", formatted=True )
return "".join(out)
(Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
(Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
[ "(", "Deprecated", ")", "Returns", "the", "parse", "results", "as", "XML", ".", "Tags", "are", "created", "for", "tokens", "and", "lists", "that", "have", "defined", "results", "names", "." ]
def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ): """ (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. """ nl = "\n" out = [] namedItems = dict((v[1],k) for (k,vlist) in se...
[ "def", "asXML", "(", "self", ",", "doctag", "=", "None", ",", "namedItemsOnly", "=", "False", ",", "indent", "=", "\"\"", ",", "formatted", "=", "True", ")", ":", "nl", "=", "\"\\n\"", "out", "=", "[", "]", "namedItems", "=", "dict", "(", "(", "v",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L766-L825
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBSection.__iter__
(self)
return lldb_iter(self, 'GetNumSubSections', 'GetSubSectionAtIndex')
Iterate over all subsections in a lldb.SBSection object.
Iterate over all subsections in a lldb.SBSection object.
[ "Iterate", "over", "all", "subsections", "in", "a", "lldb", ".", "SBSection", "object", "." ]
def __iter__(self): '''Iterate over all subsections in a lldb.SBSection object.''' return lldb_iter(self, 'GetNumSubSections', 'GetSubSectionAtIndex')
[ "def", "__iter__", "(", "self", ")", ":", "return", "lldb_iter", "(", "self", ",", "'GetNumSubSections'", ",", "'GetSubSectionAtIndex'", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9361-L9363
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/glassbox/ebm/ebm.py
python
BaseEBM.get_feature_names_out
(self)
return [" x ".join(self.feature_names_in_[i] for i in grp) for grp in self.term_features_]
Provides the term names in the format "feature_name_1 X feature_name_2" Args: Returns: A list of per-term names
Provides the term names in the format "feature_name_1 X feature_name_2"
[ "Provides", "the", "term", "names", "in", "the", "format", "feature_name_1", "X", "feature_name_2" ]
def get_feature_names_out(self): """ Provides the term names in the format "feature_name_1 X feature_name_2" Args: Returns: A list of per-term names """ return [" x ".join(self.feature_names_in_[i] for i in grp) for grp in self.term_features_]
[ "def", "get_feature_names_out", "(", "self", ")", ":", "return", "[", "\" x \"", ".", "join", "(", "self", ".", "feature_names_in_", "[", "i", "]", "for", "i", "in", "grp", ")", "for", "grp", "in", "self", ".", "term_features_", "]" ]
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/glassbox/ebm/ebm.py#L1166-L1175
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/__init__.py
python
findall
(dir = os.curdir)
return all_files
Find all files under 'dir' and return the list of full filenames (relative to 'dir').
Find all files under 'dir' and return the list of full filenames (relative to 'dir').
[ "Find", "all", "files", "under", "dir", "and", "return", "the", "list", "of", "full", "filenames", "(", "relative", "to", "dir", ")", "." ]
def findall(dir = os.curdir): """Find all files under 'dir' and return the list of full filenames (relative to 'dir'). """ all_files = [] for base, dirs, files in os.walk(dir): if base==os.curdir or base.startswith(os.curdir+os.sep): base = base[2:] if base: f...
[ "def", "findall", "(", "dir", "=", "os", ".", "curdir", ")", ":", "all_files", "=", "[", "]", "for", "base", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "dir", ")", ":", "if", "base", "==", "os", ".", "curdir", "or", "base", ".", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/__init__.py#L73-L84
HKUST-Aerial-Robotics/Teach-Repeat-Replan
98505a7f74b13c8b501176ff838a38423dbef536
utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Corrections.py
python
Corrections.deserialize_numpy
(self, str, numpy)
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", "using", "numpy", "for", "array", "types", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str", ":", "param", "numpy", ":", "numpy", "python", ...
def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: end = 0 start = end end += 8 (self.kf_corr...
[ "def", "deserialize_numpy", "(", "self", ",", "str", ",", "numpy", ")", ":", "try", ":", "end", "=", "0", "start", "=", "end", "end", "+=", "8", "(", "self", ".", "kf_correction", ",", ")", "=", "_struct_d", ".", "unpack", "(", "str", "[", "start",...
https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Corrections.py#L91-L107
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
_NamespaceInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Check end of namespace comments.
Check end of namespace comments.
[ "Check", "end", "of", "namespace", "comments", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply chec...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "raw_lines", "[", "linenum", "]", "# Check how many lines is enclosed in this namespace. Don't issue", "# warning for missing n...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L2447-L2497
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/ast.py
python
EnumValue.__init__
(self, file_name, line, column)
Construct an Enum.
Construct an Enum.
[ "Construct", "an", "Enum", "." ]
def __init__(self, file_name, line, column): # type: (str, int, int) -> None """Construct an Enum.""" self.name = None # type: str self.description = None # type: str self.value = None # type: str self.extra_data = None # type: Dict[str, Any] super(EnumValue,...
[ "def", "__init__", "(", "self", ",", "file_name", ",", "line", ",", "column", ")", ":", "# type: (str, int, int) -> None", "self", ".", "name", "=", "None", "# type: str", "self", ".", "description", "=", "None", "# type: str", "self", ".", "value", "=", "No...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/ast.py#L340-L348
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteMakeRule
(self, outputs, inputs, actions=None, comment=None, order_only=False, force=False, phony=False, command=None)
Write a Makefile rule, with some extra tricks. outputs: a list of outputs for the rule (note: this is not directly supported by make; see comments below) inputs: a list of inputs for the rule actions: a list of shell commands to run for the rule comment: a comment to put in the Makefile ab...
Write a Makefile rule, with some extra tricks.
[ "Write", "a", "Makefile", "rule", "with", "some", "extra", "tricks", "." ]
def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, order_only=False, force=False, phony=False, command=None): """Write a Makefile rule, with some extra tricks. outputs: a list of outputs for the rule (note: this is not directly supported by make; see comments ...
[ "def", "WriteMakeRule", "(", "self", ",", "outputs", ",", "inputs", ",", "actions", "=", "None", ",", "comment", "=", "None", ",", "order_only", "=", "False", ",", "force", "=", "False", ",", "phony", "=", "False", ",", "command", "=", "None", ")", "...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1733-L1791
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsPhoneticExtensions
(code)
return ret
Check whether the character is part of PhoneticExtensions UCS Block
Check whether the character is part of PhoneticExtensions UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "PhoneticExtensions", "UCS", "Block" ]
def uCSIsPhoneticExtensions(code): """Check whether the character is part of PhoneticExtensions UCS Block """ ret = libxml2mod.xmlUCSIsPhoneticExtensions(code) return ret
[ "def", "uCSIsPhoneticExtensions", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsPhoneticExtensions", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2815-L2819
wangkuiyi/mapreduce-lite
1bb92fe094dc47480ef9163c34070a3199feead6
src/mapreduce_lite/scheduler/worker.py
python
Communicator.run_instruction
(self, instruction)
Run instruction given by scheduler
Run instruction given by scheduler
[ "Run", "instruction", "given", "by", "scheduler" ]
def run_instruction(self, instruction): """ Run instruction given by scheduler """ if instruction not in self.task_callback: raise RuntimeError('Illegal instruction %s' %instruction) if instruction == 'start_mapper' and self.worker.is_map_worker(): self.process =...
[ "def", "run_instruction", "(", "self", ",", "instruction", ")", ":", "if", "instruction", "not", "in", "self", ".", "task_callback", ":", "raise", "RuntimeError", "(", "'Illegal instruction %s'", "%", "instruction", ")", "if", "instruction", "==", "'start_mapper'"...
https://github.com/wangkuiyi/mapreduce-lite/blob/1bb92fe094dc47480ef9163c34070a3199feead6/src/mapreduce_lite/scheduler/worker.py#L373-L386
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/json_to_struct/json_to_struct.py
python
_GenerateCC
(basepath, fileroot, head, namespace, schema, description)
Generates the .cc file containing the static initializers for the of the elements specified in the description. Args: basepath: The base directory in which files are generated. fileroot: The filename and path, relative to basepath, of the file to create, without an extension. head: The string t...
Generates the .cc file containing the static initializers for the of the elements specified in the description.
[ "Generates", "the", ".", "cc", "file", "containing", "the", "static", "initializers", "for", "the", "of", "the", "elements", "specified", "in", "the", "description", "." ]
def _GenerateCC(basepath, fileroot, head, namespace, schema, description): """Generates the .cc file containing the static initializers for the of the elements specified in the description. Args: basepath: The base directory in which files are generated. fileroot: The filename and path, relative to basep...
[ "def", "_GenerateCC", "(", "basepath", ",", "fileroot", ",", "head", ",", "namespace", ",", "schema", ",", "description", ")", ":", "with", "open", "(", "os", ".", "path", ".", "join", "(", "basepath", ",", "fileroot", "+", "'.cc'", ")", ",", "'w'", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_to_struct/json_to_struct.py#L136-L166
sfzhang15/RefineDet
52b6fe23dc1a160fe710b7734576dca509bf4fae
scripts/cpp_lint.py
python
ReplaceAll
(pattern, rep, s)
return _regexp_compile_cache[pattern].sub(rep, s)
Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements)
Replaces instances of pattern in a string with a replacement.
[ "Replaces", "instances", "of", "pattern", "in", "a", "string", "with", "a", "replacement", "." ]
def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if...
[ "def", "ReplaceAll", "(", "pattern", ",", "rep", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_c...
https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/scripts/cpp_lint.py#L525-L540
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/interfaces/gaussian_process_interface.py
python
GaussianProcessDataInterface.get_covariance_copy
(self)
Return a copy of the covariance object specifying the Gaussian Process. :return: covariance object encoding assumptions about the GP's behavior on our data :rtype: :class:`moe.optimal_learning.python.interfaces.covariance_interface.CovarianceInterface` subclass
Return a copy of the covariance object specifying the Gaussian Process.
[ "Return", "a", "copy", "of", "the", "covariance", "object", "specifying", "the", "Gaussian", "Process", "." ]
def get_covariance_copy(self): """Return a copy of the covariance object specifying the Gaussian Process. :return: covariance object encoding assumptions about the GP's behavior on our data :rtype: :class:`moe.optimal_learning.python.interfaces.covariance_interface.CovarianceInterface` subclass...
[ "def", "get_covariance_copy", "(", "self", ")", ":", "pass" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/interfaces/gaussian_process_interface.py#L40-L47
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/guidance/inputs.py
python
read_vocab
(path)
return size, vocab_to_id
Read vocabulary from an sstable. Must be kept synchronized with the Vocabulary class in clause_ops.cc. Vocabulary flags may be specified after a ':'; for now the only valid flag is ':one_variable'. Args: path: Path to vocabulary sstable. Returns: size: Vocabulary size (maximum id + 1). vocab_to...
Read vocabulary from an sstable.
[ "Read", "vocabulary", "from", "an", "sstable", "." ]
def read_vocab(path): """Read vocabulary from an sstable. Must be kept synchronized with the Vocabulary class in clause_ops.cc. Vocabulary flags may be specified after a ':'; for now the only valid flag is ':one_variable'. Args: path: Path to vocabulary sstable. Returns: size: Vocabulary size (ma...
[ "def", "read_vocab", "(", "path", ")", ":", "# Remove flags from path", "if", "':'", "in", "path", ".", "split", "(", "'/'", ")", "[", "-", "1", "]", ":", "path", "=", "path", ".", "split", "(", "':'", ")", "options", "=", "path", "[", "-", "1", ...
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/guidance/inputs.py#L91-L141
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
dev/scripts/ideal_curves.py
python
IdealCurveTracer.objective
(self)
return self.AS.keyed_output(CoolProp.iZ) - 1
Z = 1
Z = 1
[ "Z", "=", "1" ]
def objective(self): """ Z = 1 """ return self.AS.keyed_output(CoolProp.iZ) - 1
[ "def", "objective", "(", "self", ")", ":", "return", "self", ".", "AS", ".", "keyed_output", "(", "CoolProp", ".", "iZ", ")", "-", "1" ]
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/scripts/ideal_curves.py#L64-L66
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place.py
python
Pick_Place._generate_grasps
(self, pose, width)
return grasps
Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg.
Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg.
[ "Generate", "grasps", "by", "using", "the", "grasp", "generator", "generate", "action", ";", "based", "on", "server_test", ".", "py", "example", "on", "moveit_simple_grasps", "pkg", "." ]
def _generate_grasps(self, pose, width): """ Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg. """ # Create goal: goal = GenerateGraspsGoal() goal.pose = pose goal.width = width ...
[ "def", "_generate_grasps", "(", "self", ",", "pose", ",", "width", ")", ":", "# Create goal:", "goal", "=", "GenerateGraspsGoal", "(", ")", "goal", ".", "pose", "=", "pose", "goal", ".", "width", "=", "width", "options", "=", "GraspGeneratorOptions", "(", ...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place.py#L157-L189
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/operations/prepare.py
python
unpack_url
( link, # type: Link location, # type: str download, # type: Downloader download_dir=None, # type: Optional[str] hashes=None, # type: Optional[Hashes] )
return file
Unpack link into location, downloading if required. :param hashes: A Hashes object, one of whose embedded hashes must match, or HashMismatch will be raised. If the Hashes is empty, no matches are required, and unhashable types of requirements (like VCS ones, which would ordinarily raise Has...
Unpack link into location, downloading if required.
[ "Unpack", "link", "into", "location", "downloading", "if", "required", "." ]
def unpack_url( link, # type: Link location, # type: str download, # type: Downloader download_dir=None, # type: Optional[str] hashes=None, # type: Optional[Hashes] ): # type: (...) -> Optional[File] """Unpack link into location, downloading if required. :param hashes: A Hashes obj...
[ "def", "unpack_url", "(", "link", ",", "# type: Link", "location", ",", "# type: str", "download", ",", "# type: Downloader", "download_dir", "=", "None", ",", "# type: Optional[str]", "hashes", "=", "None", ",", "# type: Optional[Hashes]", ")", ":", "# type: (...) ->...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/operations/prepare.py#L197-L242
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/android/sdk/shared_prefs.py
python
SharedPrefs.changed
(self)
return self._changed
True if properties have changed and a commit would be needed.
True if properties have changed and a commit would be needed.
[ "True", "if", "properties", "have", "changed", "and", "a", "commit", "would", "be", "needed", "." ]
def changed(self): """True if properties have changed and a commit would be needed.""" return self._changed
[ "def", "changed", "(", "self", ")", ":", "return", "self", ".", "_changed" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/shared_prefs.py#L229-L231
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py
python
CokeCanPickAndPlace._generate_grasps
(self, pose, width)
return grasps
Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg.
Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg.
[ "Generate", "grasps", "by", "using", "the", "grasp", "generator", "generate", "action", ";", "based", "on", "server_test", ".", "py", "example", "on", "moveit_simple_grasps", "pkg", "." ]
def _generate_grasps(self, pose, width): """ Generate grasps by using the grasp generator generate action; based on server_test.py example on moveit_simple_grasps pkg. """ # Create goal: goal = GenerateGraspsGoal() goal.pose = pose goal.width = width ...
[ "def", "_generate_grasps", "(", "self", ",", "pose", ",", "width", ")", ":", "# Create goal:", "goal", "=", "GenerateGraspsGoal", "(", ")", "goal", ".", "pose", "=", "pose", "goal", ".", "width", "=", "width", "options", "=", "GraspGeneratorOptions", "(", ...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py#L157-L189
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/which/build.py
python
target_all
()
Build all release packages.
Build all release packages.
[ "Build", "all", "release", "packages", "." ]
def target_all(): """Build all release packages.""" log.info("target: default") if sys.platform == "win32": target_launcher() target_sdist() target_webdist()
[ "def", "target_all", "(", ")", ":", "log", ".", "info", "(", "\"target: default\"", ")", "if", "sys", ".", "platform", "==", "\"win32\"", ":", "target_launcher", "(", ")", "target_sdist", "(", ")", "target_webdist", "(", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/which/build.py#L219-L225
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/pimp.py
python
PimpPackage.__cmp__
(self, other)
return self._db.preferences.compareFlavors(self.flavor(), other.flavor())
Compare two packages, where the "better" package sorts lower.
Compare two packages, where the "better" package sorts lower.
[ "Compare", "two", "packages", "where", "the", "better", "package", "sorts", "lower", "." ]
def __cmp__(self, other): """Compare two packages, where the "better" package sorts lower.""" if not isinstance(other, PimpPackage): return cmp(id(self), id(other)) if self.name() != other.name(): return cmp(self.name(), other.name()) if self.version() != other.v...
[ "def", "__cmp__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "PimpPackage", ")", ":", "return", "cmp", "(", "id", "(", "self", ")", ",", "id", "(", "other", ")", ")", "if", "self", ".", "name", "(", ")", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/pimp.py#L568-L577
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py
python
DrillExportModel.inactivateAlgorithm
(self, algorithm)
Inactivate a specific algorithm. Args: algorithm (str): name of the algo
Inactivate a specific algorithm.
[ "Inactivate", "a", "specific", "algorithm", "." ]
def inactivateAlgorithm(self, algorithm): """ Inactivate a specific algorithm. Args: algorithm (str): name of the algo """ if algorithm in self._exportAlgorithms: self._exportAlgorithms[algorithm] = False
[ "def", "inactivateAlgorithm", "(", "self", ",", "algorithm", ")", ":", "if", "algorithm", "in", "self", ".", "_exportAlgorithms", ":", "self", ".", "_exportAlgorithms", "[", "algorithm", "]", "=", "False" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py#L126-L134
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/math_grad.py
python
_SigmoidGrad
(op, grad)
Returns grad * sigmoid(x) * (1 - sigmoid(x)).
Returns grad * sigmoid(x) * (1 - sigmoid(x)).
[ "Returns", "grad", "*", "sigmoid", "(", "x", ")", "*", "(", "1", "-", "sigmoid", "(", "x", "))", "." ]
def _SigmoidGrad(op, grad): """Returns grad * sigmoid(x) * (1 - sigmoid(x)).""" y = op.outputs[0] # y = sigmoid(x) with ops.control_dependencies([grad]): y = math_ops.conj(y) # pylint: disable=protected-access return gen_math_ops._sigmoid_grad(y, grad)
[ "def", "_SigmoidGrad", "(", "op", ",", "grad", ")", ":", "y", "=", "op", ".", "outputs", "[", "0", "]", "# y = sigmoid(x)", "with", "ops", ".", "control_dependencies", "(", "[", "grad", "]", ")", ":", "y", "=", "math_ops", ".", "conj", "(", "y", ")...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_grad.py#L593-L599
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
python/gtsam_unstable/examples/TimeOfArrivalExample.py
python
create_trajectory
(n)
return trajectory
Create ground truth trajectory.
Create ground truth trajectory.
[ "Create", "ground", "truth", "trajectory", "." ]
def create_trajectory(n): """Create ground truth trajectory.""" trajectory = [] timeOfEvent = 10 # simulate emitting a sound every second while moving on straight line for key in range(n): trajectory.append( Event(timeOfEvent, 245 * CM + key * 1.0, 201.5 * CM, (212 - 45) * CM)) ...
[ "def", "create_trajectory", "(", "n", ")", ":", "trajectory", "=", "[", "]", "timeOfEvent", "=", "10", "# simulate emitting a sound every second while moving on straight line", "for", "key", "in", "range", "(", "n", ")", ":", "trajectory", ".", "append", "(", "Eve...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam_unstable/examples/TimeOfArrivalExample.py#L37-L47
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py
python
DirFile.write
(self, sync=1)
Write the .sconsign file to disk. Try to write to a temporary file first, and rename it if we succeed. If we can't write to the temporary file, it's probably because the directory isn't writable (and if so, how did we build anything in this directory, anyway?), so try to write ...
Write the .sconsign file to disk.
[ "Write", "the", ".", "sconsign", "file", "to", "disk", "." ]
def write(self, sync=1): """ Write the .sconsign file to disk. Try to write to a temporary file first, and rename it if we succeed. If we can't write to the temporary file, it's probably because the directory isn't writable (and if so, how did we build anything in this ...
[ "def", "write", "(", "self", ",", "sync", "=", "1", ")", ":", "if", "not", "self", ".", "dirty", ":", "return", "self", ".", "merge", "(", ")", "temp", "=", "os", ".", "path", ".", "join", "(", "self", ".", "dir", ".", "get_internal_path", "(", ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py#L332-L390
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Simulator.enableContactFeedback
(self, obj1: int, obj2: int)
return _robotsim.Simulator_enableContactFeedback(self, obj1, obj2)
r""" Call this to enable contact feedback between the two objects (arguments are indexes returned by object.getID()). Contact feedback has a small overhead so you may want to do this selectively. This must be called before using inContact, getContacts, getContactForces, contactForce, con...
r""" Call this to enable contact feedback between the two objects (arguments are indexes returned by object.getID()). Contact feedback has a small overhead so you may want to do this selectively. This must be called before using inContact, getContacts, getContactForces, contactForce, con...
[ "r", "Call", "this", "to", "enable", "contact", "feedback", "between", "the", "two", "objects", "(", "arguments", "are", "indexes", "returned", "by", "object", ".", "getID", "()", ")", ".", "Contact", "feedback", "has", "a", "small", "overhead", "so", "you...
def enableContactFeedback(self, obj1: int, obj2: int) ->None: r""" Call this to enable contact feedback between the two objects (arguments are indexes returned by object.getID()). Contact feedback has a small overhead so you may want to do this selectively. This must be called before usi...
[ "def", "enableContactFeedback", "(", "self", ",", "obj1", ":", "int", ",", "obj2", ":", "int", ")", "->", "None", ":", "return", "_robotsim", ".", "Simulator_enableContactFeedback", "(", "self", ",", "obj1", ",", "obj2", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7917-L7929
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
red_black_tree/red_black_tree.py
python
RedBlackTree.insert
(self, data)
inserts new integer data into the tree at the position, so that the red black tree property is maintained.
inserts new integer data into the tree at the position, so that the red black tree property is maintained.
[ "inserts", "new", "integer", "data", "into", "the", "tree", "at", "the", "position", "so", "that", "the", "red", "black", "tree", "property", "is", "maintained", "." ]
def insert(self, data): # pylint: disable=too-many-statements """ inserts new integer data into the tree at the position, so that the red black tree property is maintained. """ def insert_case1(node): if node.parent is None: node.color = BLACK ...
[ "def", "insert", "(", "self", ",", "data", ")", ":", "# pylint: disable=too-many-statements", "def", "insert_case1", "(", "node", ")", ":", "if", "node", ".", "parent", "is", "None", ":", "node", ".", "color", "=", "BLACK", "else", ":", "insert_case2", "("...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/red_black_tree/red_black_tree.py#L61-L134
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/tools/miniterm.py
python
Miniterm.upload_file
(self)
Ask user for filenname and send its contents
Ask user for filenname and send its contents
[ "Ask", "user", "for", "filenname", "and", "send", "its", "contents" ]
def upload_file(self): """Ask user for filenname and send its contents""" sys.stderr.write('\n--- File to upload: ') sys.stderr.flush() with self.console: filename = sys.stdin.readline().rstrip('\r\n') if filename: try: with ope...
[ "def", "upload_file", "(", "self", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'\\n--- File to upload: '", ")", "sys", ".", "stderr", ".", "flush", "(", ")", "with", "self", ".", "console", ":", "filename", "=", "sys", ".", "stdin", ".", "readl...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/tools/miniterm.py#L581-L601
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGridInterface.GetPyIterator
(self, flags=PG_ITERATE_DEFAULT, firstProperty=None)
Returns a pythonic property iterator for a single `PropertyGrid` or page in `PropertyGridManager`. Arguments are same as for `GetIterator`. Following example demonstrates iterating absolutely all items in a single grid:: iterator = propGrid.GetPyIterator(wx.propgrid.PG_ITERATE_ALL) ...
Returns a pythonic property iterator for a single `PropertyGrid` or page in `PropertyGridManager`. Arguments are same as for `GetIterator`. Following example demonstrates iterating absolutely all items in a single grid::
[ "Returns", "a", "pythonic", "property", "iterator", "for", "a", "single", "PropertyGrid", "or", "page", "in", "PropertyGridManager", ".", "Arguments", "are", "same", "as", "for", "GetIterator", ".", "Following", "example", "demonstrates", "iterating", "absolutely", ...
def GetPyIterator(self, flags=PG_ITERATE_DEFAULT, firstProperty=None): """ Returns a pythonic property iterator for a single `PropertyGrid` or page in `PropertyGridManager`. Arguments are same as for `GetIterator`. Following example demonstrates iterating absolutely...
[ "def", "GetPyIterator", "(", "self", ",", "flags", "=", "PG_ITERATE_DEFAULT", ",", "firstProperty", "=", "None", ")", ":", "it", "=", "self", ".", "GetIterator", "(", "flags", ",", "firstProperty", ")", "while", "not", "it", ".", "AtEnd", "(", ")", ":", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1725-L1743
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.DeviceToLogicalY
(*args, **kwargs)
return _gdi_.DC_DeviceToLogicalY(*args, **kwargs)
DeviceToLogicalY(self, int y) -> int Converts device Y coordinate to logical coordinate, using the current mapping mode.
DeviceToLogicalY(self, int y) -> int
[ "DeviceToLogicalY", "(", "self", "int", "y", ")", "-", ">", "int" ]
def DeviceToLogicalY(*args, **kwargs): """ DeviceToLogicalY(self, int y) -> int Converts device Y coordinate to logical coordinate, using the current mapping mode. """ return _gdi_.DC_DeviceToLogicalY(*args, **kwargs)
[ "def", "DeviceToLogicalY", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DeviceToLogicalY", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L4228-L4235
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py
python
NeuralNetworkBuilder.add_custom
(self, name, input_names, output_names, custom_proto_spec=None)
return spec_layer
Add a custom layer. Refer to the **CustomLayerParams** message in specification (NeuralNetwork.proto) for more details. Parameters ---------- name: str The name of this layer. input_names: list of str The input blob names to this layer. output_n...
Add a custom layer. Refer to the **CustomLayerParams** message in specification (NeuralNetwork.proto) for more details.
[ "Add", "a", "custom", "layer", ".", "Refer", "to", "the", "**", "CustomLayerParams", "**", "message", "in", "specification", "(", "NeuralNetwork", ".", "proto", ")", "for", "more", "details", "." ]
def add_custom(self, name, input_names, output_names, custom_proto_spec=None): """ Add a custom layer. Refer to the **CustomLayerParams** message in specification (NeuralNetwork.proto) for more details. Parameters ---------- name: str The name of this layer. ...
[ "def", "add_custom", "(", "self", ",", "name", ",", "input_names", ",", "output_names", ",", "custom_proto_spec", "=", "None", ")", ":", "# custom layers require a newer specification version", "from", "coremltools", "import", "_MINIMUM_CUSTOM_LAYER_SPEC_VERSION", "if", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L4118-L4150
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py
python
EditorWindow.get_geometry
(self)
return list(map(int, m.groups()))
Return (width, height, x, y)
Return (width, height, x, y)
[ "Return", "(", "width", "height", "x", "y", ")" ]
def get_geometry(self): "Return (width, height, x, y)" geom = self.top.wm_geometry() m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom) return list(map(int, m.groups()))
[ "def", "get_geometry", "(", "self", ")", ":", "geom", "=", "self", ".", "top", ".", "wm_geometry", "(", ")", "m", "=", "re", ".", "match", "(", "r\"(\\d+)x(\\d+)\\+(-?\\d+)\\+(-?\\d+)\"", ",", "geom", ")", "return", "list", "(", "map", "(", "int", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py#L1047-L1051
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/bindings/python/clang/cindex.py
python
File.name
(self)
return conf.lib.clang_getFileName(self)
Return the complete file and path name of the file.
Return the complete file and path name of the file.
[ "Return", "the", "complete", "file", "and", "path", "name", "of", "the", "file", "." ]
def name(self): """Return the complete file and path name of the file.""" return conf.lib.clang_getFileName(self)
[ "def", "name", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getFileName", "(", "self", ")" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L3101-L3103
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/op_def_library.py
python
OpDefLibrary._apply_op_helper
(self, op_type_name, name=None, **keywords)
Implementation of apply_op that returns output_structure, op.
Implementation of apply_op that returns output_structure, op.
[ "Implementation", "of", "apply_op", "that", "returns", "output_structure", "op", "." ]
def _apply_op_helper(self, op_type_name, name=None, **keywords): """Implementation of apply_op that returns output_structure, op.""" op_info = self._ops.get(op_type_name, None) if op_info is None: raise RuntimeError("Unrecognized Op name " + op_type_name) op_def = op_info.op_def # Determine t...
[ "def", "_apply_op_helper", "(", "self", ",", "op_type_name", ",", "name", "=", "None", ",", "*", "*", "keywords", ")", ":", "op_info", "=", "self", ".", "_ops", ".", "get", "(", "op_type_name", ",", "None", ")", "if", "op_info", "is", "None", ":", "r...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/op_def_library.py#L356-L805
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/virtualenv.py
python
VirtualenvManager.virtualenv_script_path
(self)
return os.path.join(self.topsrcdir, 'python', 'virtualenv', 'virtualenv.py')
Path to virtualenv's own populator script.
Path to virtualenv's own populator script.
[ "Path", "to", "virtualenv", "s", "own", "populator", "script", "." ]
def virtualenv_script_path(self): """Path to virtualenv's own populator script.""" return os.path.join(self.topsrcdir, 'python', 'virtualenv', 'virtualenv.py')
[ "def", "virtualenv_script_path", "(", "self", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "topsrcdir", ",", "'python'", ",", "'virtualenv'", ",", "'virtualenv.py'", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/virtualenv.py#L57-L60
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/opset1/ops.py
python
reduce_max
( node: NodeInput, reduction_axes: NodeInput, keep_dims: bool = False, name: Optional[str] = None )
return _get_node_factory_opset1().create( "ReduceMax", as_nodes(node, reduction_axes), {"keep_dims": keep_dims} )
Max-reduction operation on input tensor, eliminating the specified reduction axes. :param node: The tensor we want to max-reduce. :param reduction_axes: The axes to eliminate through max operation. :param keep_dims: If set to True it holds axes that are used for reduction :param name: Op...
Max-reduction operation on input tensor, eliminating the specified reduction axes.
[ "Max", "-", "reduction", "operation", "on", "input", "tensor", "eliminating", "the", "specified", "reduction", "axes", "." ]
def reduce_max( node: NodeInput, reduction_axes: NodeInput, keep_dims: bool = False, name: Optional[str] = None ) -> Node: """Max-reduction operation on input tensor, eliminating the specified reduction axes. :param node: The tensor we want to max-reduce. :param reduction_axes: The axes to el...
[ "def", "reduce_max", "(", "node", ":", "NodeInput", ",", "reduction_axes", ":", "NodeInput", ",", "keep_dims", ":", "bool", "=", "False", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "Node", ":", "return", "_get_node_factory_opset...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset1/ops.py#L2292-L2304
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.last_value
(self, last_value)
Sets the last_value of this Position. :param last_value: The last_value of this Position. # noqa: E501 :type: float
Sets the last_value of this Position.
[ "Sets", "the", "last_value", "of", "this", "Position", "." ]
def last_value(self, last_value): """Sets the last_value of this Position. :param last_value: The last_value of this Position. # noqa: E501 :type: float """ self._last_value = last_value
[ "def", "last_value", "(", "self", ",", "last_value", ")", ":", "self", ".", "_last_value", "=", "last_value" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L2404-L2412
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/clang/cindex.py
python
File.time
(self)
return File_time(self)
Return the last modification time of the file.
Return the last modification time of the file.
[ "Return", "the", "last", "modification", "time", "of", "the", "file", "." ]
def time(self): """Return the last modification time of the file.""" return File_time(self)
[ "def", "time", "(", "self", ")", ":", "return", "File_time", "(", "self", ")" ]
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/clang/cindex.py#L1520-L1522
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
media/tools/constrained_network_server/cns.py
python
ConstrainedNetworkServer.__init__
(self, options, port_allocator)
Sets up initial state for the CNS. Args: options: optparse based class returned by ParseArgs() port_allocator: A port allocator instance.
Sets up initial state for the CNS.
[ "Sets", "up", "initial", "state", "for", "the", "CNS", "." ]
def __init__(self, options, port_allocator): """Sets up initial state for the CNS. Args: options: optparse based class returned by ParseArgs() port_allocator: A port allocator instance. """ self._options = options self._port_allocator = port_allocator
[ "def", "__init__", "(", "self", ",", "options", ",", "port_allocator", ")", ":", "self", ".", "_options", "=", "options", "self", ".", "_port_allocator", "=", "port_allocator" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/media/tools/constrained_network_server/cns.py#L171-L179
anestisb/oatdump_plus
ba858c1596598f0d9ae79c14d08c708cecc50af3
tools/cpplint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "# BEGIN android-added", "old_errors", "=", "_cpplint_state", ".", "error_count", "# END android-added", "try", ":", ...
https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L3902-L3973
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlWinParser.GetLinkColor
(*args, **kwargs)
return _html.HtmlWinParser_GetLinkColor(*args, **kwargs)
GetLinkColor(self) -> Colour
GetLinkColor(self) -> Colour
[ "GetLinkColor", "(", "self", ")", "-", ">", "Colour" ]
def GetLinkColor(*args, **kwargs): """GetLinkColor(self) -> Colour""" return _html.HtmlWinParser_GetLinkColor(*args, **kwargs)
[ "def", "GetLinkColor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_GetLinkColor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L340-L342
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiManagerEvent.SetPane
(*args, **kwargs)
return _aui.AuiManagerEvent_SetPane(*args, **kwargs)
SetPane(self, AuiPaneInfo p)
SetPane(self, AuiPaneInfo p)
[ "SetPane", "(", "self", "AuiPaneInfo", "p", ")" ]
def SetPane(*args, **kwargs): """SetPane(self, AuiPaneInfo p)""" return _aui.AuiManagerEvent_SetPane(*args, **kwargs)
[ "def", "SetPane", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiManagerEvent_SetPane", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L819-L821
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/mox.py
python
MockMethod.MultipleTimes
(self, group_name="default")
return self._CheckAndCreateNewGroup(group_name, MultipleTimesGroup)
Move this method into group of calls which may be called multiple times. A group of repeating calls must be defined together, and must be executed in full before the next expected mehtod can be called. Args: group_name: the name of the unordered group. Returns: self
Move this method into group of calls which may be called multiple times.
[ "Move", "this", "method", "into", "group", "of", "calls", "which", "may", "be", "called", "multiple", "times", "." ]
def MultipleTimes(self, group_name="default"): """Move this method into group of calls which may be called multiple times. A group of repeating calls must be defined together, and must be executed in full before the next expected mehtod can be called. Args: group_name: the name of the unordered ...
[ "def", "MultipleTimes", "(", "self", ",", "group_name", "=", "\"default\"", ")", ":", "return", "self", ".", "_CheckAndCreateNewGroup", "(", "group_name", ",", "MultipleTimesGroup", ")" ]
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L704-L716
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/containers.py
python
ScalarMap.__init__
(self, message_listener, key_checker, value_checker)
Args: message_listener: A MessageListener implementation. The ScalarMap will call this object's Modified() method when it is modified. key_checker: A type_checkers.ValueChecker instance to run on keys inserted into this container. value_checker: A type_checkers.ValueChecker ins...
Args: message_listener: A MessageListener implementation. The ScalarMap will call this object's Modified() method when it is modified. key_checker: A type_checkers.ValueChecker instance to run on keys inserted into this container. value_checker: A type_checkers.ValueChecker ins...
[ "Args", ":", "message_listener", ":", "A", "MessageListener", "implementation", ".", "The", "ScalarMap", "will", "call", "this", "object", "s", "Modified", "()", "method", "when", "it", "is", "modified", ".", "key_checker", ":", "A", "type_checkers", ".", "Val...
def __init__(self, message_listener, key_checker, value_checker): """ Args: message_listener: A MessageListener implementation. The ScalarMap will call this object's Modified() method when it is modified. key_checker: A type_checkers.ValueChecker instance to run on keys inser...
[ "def", "__init__", "(", "self", ",", "message_listener", ",", "key_checker", ",", "value_checker", ")", ":", "self", ".", "_message_listener", "=", "message_listener", "self", ".", "_key_checker", "=", "key_checker", "self", ".", "_value_checker", "=", "value_chec...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/containers.py#L441-L455
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_ASYM_PARMS.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.symmetric = TPMT_SYM_DEF_OBJECT.fromTpm(buf) schemeScheme = buf.readShort() self.scheme = UnionFactory.create('TPMU_ASYM_SCHEME', schemeScheme) self.scheme.initFromTpm(buf)
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "symmetric", "=", "TPMT_SYM_DEF_OBJECT", ".", "fromTpm", "(", "buf", ")", "schemeScheme", "=", "buf", ".", "readShort", "(", ")", "self", ".", "scheme", "=", "UnionFactory", ".", "crea...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7936-L7941
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/sessions.py
python
SessionRedirectMixin.get_redirect_target
(self, resp)
return None
Receives a Response. Returns a redirect URI or ``None``
Receives a Response. Returns a redirect URI or ``None``
[ "Receives", "a", "Response", ".", "Returns", "a", "redirect", "URI", "or", "None" ]
def get_redirect_target(self, resp): """Receives a Response. Returns a redirect URI or ``None``""" # Due to the nature of how requests processes redirects this method will # be called at least once upon the original response and at least twice # on each subsequent redirect response (if a...
[ "def", "get_redirect_target", "(", "self", ",", "resp", ")", ":", "# Due to the nature of how requests processes redirects this method will", "# be called at least once upon the original response and at least twice", "# on each subsequent redirect response (if any).", "# If a custom mixin is u...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/sessions.py#L97-L116
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py
python
Preprocessor.write
(self, aLine)
Internal method for handling output.
Internal method for handling output.
[ "Internal", "method", "for", "handling", "output", "." ]
def write(self, aLine): """ Internal method for handling output. """ if not self.out: return if self.checkLineNumbers: self.writtenLines += 1 ln = self.context['LINE'] if self.writtenLines != ln: self.out.write('//@...
[ "def", "write", "(", "self", ",", "aLine", ")", ":", "if", "not", "self", ".", "out", ":", "return", "if", "self", ".", "checkLineNumbers", ":", "self", ".", "writtenLines", "+=", "1", "ln", "=", "self", ".", "context", "[", "'LINE'", "]", "if", "s...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py#L415-L436
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/evaluators/roc.py
python
plotROC
(rocFP, rocTP, fileName = None, **args)
plot the ROC curve from a given Results (or Results-like) object :Parameters: - `res` - Results (or Container object that was made by saving a a Results object (note that if you have a Results object you can use this function as a method so there is no need to supply this argument). ...
plot the ROC curve from a given Results (or Results-like) object
[ "plot", "the", "ROC", "curve", "from", "a", "given", "Results", "(", "or", "Results", "-", "like", ")", "object" ]
def plotROC(rocFP, rocTP, fileName = None, **args) : """plot the ROC curve from a given Results (or Results-like) object :Parameters: - `res` - Results (or Container object that was made by saving a a Results object (note that if you have a Results object you can use this function as a me...
[ "def", "plotROC", "(", "rocFP", ",", "rocTP", ",", "fileName", "=", "None", ",", "*", "*", "args", ")", ":", "if", "'show'", "in", "args", ":", "show", "=", "args", "[", "'show'", "]", "else", ":", "show", "=", "True", "if", "'plotStr'", "in", "a...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/evaluators/roc.py#L185-L255
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
FileSystem.AddHandler
(*args, **kwargs)
return _core_.FileSystem_AddHandler(*args, **kwargs)
AddHandler(CPPFileSystemHandler handler)
AddHandler(CPPFileSystemHandler handler)
[ "AddHandler", "(", "CPPFileSystemHandler", "handler", ")" ]
def AddHandler(*args, **kwargs): """AddHandler(CPPFileSystemHandler handler)""" return _core_.FileSystem_AddHandler(*args, **kwargs)
[ "def", "AddHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "FileSystem_AddHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2436-L2438
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewTreeStoreContainerNode.GetChildren
(*args)
return _dataview.DataViewTreeStoreContainerNode_GetChildren(*args)
GetChildren(self) -> DataViewTreeStoreNodeList GetChildren(self) -> DataViewTreeStoreNodeList
GetChildren(self) -> DataViewTreeStoreNodeList GetChildren(self) -> DataViewTreeStoreNodeList
[ "GetChildren", "(", "self", ")", "-", ">", "DataViewTreeStoreNodeList", "GetChildren", "(", "self", ")", "-", ">", "DataViewTreeStoreNodeList" ]
def GetChildren(*args): """ GetChildren(self) -> DataViewTreeStoreNodeList GetChildren(self) -> DataViewTreeStoreNodeList """ return _dataview.DataViewTreeStoreContainerNode_GetChildren(*args)
[ "def", "GetChildren", "(", "*", "args", ")", ":", "return", "_dataview", ".", "DataViewTreeStoreContainerNode_GetChildren", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2326-L2331
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/cli/analyzer_cli.py
python
DebugAnalyzer._tensor_list_column_heads
(self, parsed, max_timestamp_width, max_dump_size_width, max_op_type_width)
return debugger_cli_common.RichTextLines([row], font_attr_segs=attr_segs)
Generate a line containing the column heads of the tensor list. Args: parsed: Parsed arguments (by argparse) of the list_tensors command. max_timestamp_width: (int) maximum width of the timestamp column. max_dump_size_width: (int) maximum width of the dump size column. max_op_type_width: (i...
Generate a line containing the column heads of the tensor list.
[ "Generate", "a", "line", "containing", "the", "column", "heads", "of", "the", "tensor", "list", "." ]
def _tensor_list_column_heads(self, parsed, max_timestamp_width, max_dump_size_width, max_op_type_width): """Generate a line containing the column heads of the tensor list. Args: parsed: Parsed arguments (by argparse) of the list_tensors command. max_timestamp_width:...
[ "def", "_tensor_list_column_heads", "(", "self", ",", "parsed", ",", "max_timestamp_width", ",", "max_dump_size_width", ",", "max_op_type_width", ")", ":", "base_command", "=", "\"list_tensors\"", "if", "parsed", ".", "tensor_filter", ":", "base_command", "+=", "\" -f...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/analyzer_cli.py#L577-L639
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
RendererNative.GetGeneric
(*args, **kwargs)
return _gdi_.RendererNative_GetGeneric(*args, **kwargs)
GetGeneric() -> RendererNative Return the generic implementation of the renderer. Under some platforms, this is the default renderer implementation, others have platform-specific default renderer which can be retrieved by calling `wx.RendererNative.GetDefault`.
GetGeneric() -> RendererNative
[ "GetGeneric", "()", "-", ">", "RendererNative" ]
def GetGeneric(*args, **kwargs): """ GetGeneric() -> RendererNative Return the generic implementation of the renderer. Under some platforms, this is the default renderer implementation, others have platform-specific default renderer which can be retrieved by calling `wx....
[ "def", "GetGeneric", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "RendererNative_GetGeneric", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7471-L7480
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/preprocessing/image.py
python
array_to_img
(x, data_format=None, scale=True, dtype=None)
return image.array_to_img(x, data_format=data_format, scale=scale, **kwargs)
Converts a 3D Numpy array to a PIL Image instance. Arguments: x: Input Numpy array. data_format: Image data format. either "channels_first" or "channels_last". scale: Whether to rescale image values to be within `[0, 255]`. dtype: Dtype to use. Returns: A PIL Imag...
Converts a 3D Numpy array to a PIL Image instance.
[ "Converts", "a", "3D", "Numpy", "array", "to", "a", "PIL", "Image", "instance", "." ]
def array_to_img(x, data_format=None, scale=True, dtype=None): """Converts a 3D Numpy array to a PIL Image instance. Arguments: x: Input Numpy array. data_format: Image data format. either "channels_first" or "channels_last". scale: Whether to rescale image values to be within...
[ "def", "array_to_img", "(", "x", ",", "data_format", "=", "None", ",", "scale", "=", "True", ",", "dtype", "=", "None", ")", ":", "if", "data_format", "is", "None", ":", "data_format", "=", "backend", ".", "image_data_format", "(", ")", "kwargs", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/preprocessing/image.py#L48-L74
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/__future__.py
python
_Feature.getMandatoryRelease
(self)
return self.mandatory
Return release in which this feature will become mandatory. This is a 5-tuple, of the same form as sys.version_info, or, if the feature was dropped, is None.
Return release in which this feature will become mandatory.
[ "Return", "release", "in", "which", "this", "feature", "will", "become", "mandatory", "." ]
def getMandatoryRelease(self): """Return release in which this feature will become mandatory. This is a 5-tuple, of the same form as sys.version_info, or, if the feature was dropped, is None. """ return self.mandatory
[ "def", "getMandatoryRelease", "(", "self", ")", ":", "return", "self", ".", "mandatory" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/__future__.py#L94-L101
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/module/python_module.py
python
PythonModule.init_params
(self, initializer=Uniform(0.01), arg_params=None, aux_params=None, allow_missing=False, force_init=False, allow_extra=False)
Initializes the parameters and auxiliary states. By default this function does nothing. Subclass should override this method if contains parameters. Parameters ---------- initializer : Initializer Called to initialize parameters if needed. arg_params : dict ...
Initializes the parameters and auxiliary states. By default this function does nothing. Subclass should override this method if contains parameters.
[ "Initializes", "the", "parameters", "and", "auxiliary", "states", ".", "By", "default", "this", "function", "does", "nothing", ".", "Subclass", "should", "override", "this", "method", "if", "contains", "parameters", "." ]
def init_params(self, initializer=Uniform(0.01), arg_params=None, aux_params=None, allow_missing=False, force_init=False, allow_extra=False): """Initializes the parameters and auxiliary states. By default this function does nothing. Subclass should override this method if contains pa...
[ "def", "init_params", "(", "self", ",", "initializer", "=", "Uniform", "(", "0.01", ")", ",", "arg_params", "=", "None", ",", "aux_params", "=", "None", ",", "allow_missing", "=", "False", ",", "force_init", "=", "False", ",", "allow_extra", "=", "False", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/python_module.py#L107-L132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
Parser.__unicode__
(self)
return self.__class__.__name__ + ' (' + unicode(self.begin) + ')'
Return a description
Return a description
[ "Return", "a", "description" ]
def __unicode__(self): "Return a description" return self.__class__.__name__ + ' (' + unicode(self.begin) + ')'
[ "def", "__unicode__", "(", "self", ")", ":", "return", "self", ".", "__class__", ".", "__name__", "+", "' ('", "+", "unicode", "(", "self", ".", "begin", ")", "+", "')'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1454-L1456
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/CGIHTTPServer.py
python
executable
(path)
return st.st_mode & 0111 != 0
Test for executable file.
Test for executable file.
[ "Test", "for", "executable", "file", "." ]
def executable(path): """Test for executable file.""" try: st = os.stat(path) except os.error: return False return st.st_mode & 0111 != 0
[ "def", "executable", "(", "path", ")", ":", "try", ":", "st", "=", "os", ".", "stat", "(", "path", ")", "except", "os", ".", "error", ":", "return", "False", "return", "st", ".", "st_mode", "&", "0111", "!=", "0" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/CGIHTTPServer.py#L363-L369
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/so2.py
python
identity
()
return 0
The identity rotation. Here for compatibility with so3.py
The identity rotation. Here for compatibility with so3.py
[ "The", "identity", "rotation", ".", "Here", "for", "compatibility", "with", "so3", ".", "py" ]
def identity() -> float: """The identity rotation. Here for compatibility with so3.py""" return 0
[ "def", "identity", "(", ")", "->", "float", ":", "return", "0" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/so2.py#L11-L13
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_endpoints.py
python
Sender.send
(self, obj: Union[bytes, 'Message'], tag: Optional[str] = None)
A convenience method to send objects as message content. Send specified object over this sender; the object is expected to have a ``send()`` method on it that takes the sender and an optional tag as arguments. Where the object is a :class:`Message`, this will send the message over ...
A convenience method to send objects as message content.
[ "A", "convenience", "method", "to", "send", "objects", "as", "message", "content", "." ]
def send(self, obj: Union[bytes, 'Message'], tag: Optional[str] = None) -> Union[int, Delivery]: """ A convenience method to send objects as message content. Send specified object over this sender; the object is expected to have a ``send()`` method on it that takes the sender and an opt...
[ "def", "send", "(", "self", ",", "obj", ":", "Union", "[", "bytes", ",", "'Message'", "]", ",", "tag", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "Union", "[", "int", ",", "Delivery", "]", ":", "if", "hasattr", "(", "obj", ",", "...
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_endpoints.py#L1187-L1202
liulei01/DRBox
b5c76e033c555c9009590ab384e1f7bd3c66c237
tools/extra/parse_log.py
python
parse_log
(path_to_log)
return train_dict_list, test_dict_list
Parse log file Returns (train_dict_list, test_dict_list) train_dict_list and test_dict_list are lists of dicts that define the table rows
Parse log file Returns (train_dict_list, test_dict_list)
[ "Parse", "log", "file", "Returns", "(", "train_dict_list", "test_dict_list", ")" ]
def parse_log(path_to_log): """Parse log file Returns (train_dict_list, test_dict_list) train_dict_list and test_dict_list are lists of dicts that define the table rows """ regex_iteration = re.compile('Iteration (\d+)') regex_train_output = re.compile('Train net output #(\d+): (\S+) = ([\...
[ "def", "parse_log", "(", "path_to_log", ")", ":", "regex_iteration", "=", "re", ".", "compile", "(", "'Iteration (\\d+)'", ")", "regex_train_output", "=", "re", ".", "compile", "(", "'Train net output #(\\d+): (\\S+) = ([\\.\\deE+-]+)'", ")", "regex_test_output", "=", ...
https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/tools/extra/parse_log.py#L17-L76
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/pydoc.py
python
doc
(thing, title='Python Library Documentation: %s', forceload=0)
Display text documentation, given an object or a path to an object.
Display text documentation, given an object or a path to an object.
[ "Display", "text", "documentation", "given", "an", "object", "or", "a", "path", "to", "an", "object", "." ]
def doc(thing, title='Python Library Documentation: %s', forceload=0): """Display text documentation, given an object or a path to an object.""" try: pager(render_doc(thing, title, forceload)) except (ImportError, ErrorDuringImport), value: print value
[ "def", "doc", "(", "thing", ",", "title", "=", "'Python Library Documentation: %s'", ",", "forceload", "=", "0", ")", ":", "try", ":", "pager", "(", "render_doc", "(", "thing", ",", "title", ",", "forceload", ")", ")", "except", "(", "ImportError", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L1576-L1581
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/io/ros.py
python
object_publisher
(topic,klampt_object,convert_kwargs=None,**kwargs)
return publisher(topic,_compatibleKlamptType(klampt_object),convert_kwargs,ros_type,**kwargs)
Convenience function. If klampt_object is an object, this sets up the publisher to be of the correct type. You can then call publish on the returned publisher using the same klampt_object (or another compatible Klampt objects). SimRobotSensors (particularly, cameras) can be published to multiple ...
Convenience function. If klampt_object is an object, this sets up the publisher to be of the correct type. You can then call publish on the returned publisher using the same klampt_object (or another compatible Klampt objects).
[ "Convenience", "function", ".", "If", "klampt_object", "is", "an", "object", "this", "sets", "up", "the", "publisher", "to", "be", "of", "the", "correct", "type", ".", "You", "can", "then", "call", "publish", "on", "the", "returned", "publisher", "using", ...
def object_publisher(topic,klampt_object,convert_kwargs=None,**kwargs): """Convenience function. If klampt_object is an object, this sets up the publisher to be of the correct type. You can then call publish on the returned publisher using the same klampt_object (or another compatible Klampt objects)...
[ "def", "object_publisher", "(", "topic", ",", "klampt_object", ",", "convert_kwargs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "from", "klampt", "import", "SimRobotSensor", ",", "Geometry3D", "if", "isinstance", "(", "klampt_object", ",", "SimRobotSensor"...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/io/ros.py#L908-L931
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/tpu_embedding_gradient.py
python
create_dummy_table_variables
(tpu_embedding)
return (dummy_table_variables, variables.variables_initializer( dummy_table_variables.values(), name='tpu_embedding_dummy_table_variables_init'))
Create dummy embedding table variables. The sole purpose of these dummy variables are to trigger gradient calculation wrt them so that the gradients wrt activation can be captured and later sent to TPU embedding. Args: tpu_embedding: TPUEmbedding, dummy table variables will be created for use with t...
Create dummy embedding table variables.
[ "Create", "dummy", "embedding", "table", "variables", "." ]
def create_dummy_table_variables(tpu_embedding): """Create dummy embedding table variables. The sole purpose of these dummy variables are to trigger gradient calculation wrt them so that the gradients wrt activation can be captured and later sent to TPU embedding. Args: tpu_embedding: TPUEmbedding, dumm...
[ "def", "create_dummy_table_variables", "(", "tpu_embedding", ")", ":", "dummy_table_variables", "=", "collections", ".", "OrderedDict", "(", ")", "for", "table_id", ",", "table", "in", "enumerate", "(", "tpu_embedding", ".", "table_to_features_dict", ")", ":", "dumm...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_embedding_gradient.py#L49-L96
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/graph_editor/match.py
python
_make_graph_match
(graph_match)
return graph_match
Convert to a OpMatcher instance.
Convert to a OpMatcher instance.
[ "Convert", "to", "a", "OpMatcher", "instance", "." ]
def _make_graph_match(graph_match): """Convert to a OpMatcher instance.""" if graph_match is None: return None if not isinstance(graph_match, OpMatcher): graph_match = OpMatcher(graph_match) return graph_match
[ "def", "_make_graph_match", "(", "graph_match", ")", ":", "if", "graph_match", "is", "None", ":", "return", "None", "if", "not", "isinstance", "(", "graph_match", ",", "OpMatcher", ")", ":", "graph_match", "=", "OpMatcher", "(", "graph_match", ")", "return", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/match.py#L27-L33
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/jit/_recursive.py
python
create_script_class
(obj)
return wrap_cpp_class(cpp_object)
Create and return a RecursiveScriptClass instance from a Python object. Arguments: obj: A Python object.
Create and return a RecursiveScriptClass instance from a Python object.
[ "Create", "and", "return", "a", "RecursiveScriptClass", "instance", "from", "a", "Python", "object", "." ]
def create_script_class(obj): """ Create and return a RecursiveScriptClass instance from a Python object. Arguments: obj: A Python object. """ qualified_class_name = _jit_internal._qualified_name(type(obj)) rcb = _jit_internal.createResolutionCallbackForClassMethods(type(obj)) # Scr...
[ "def", "create_script_class", "(", "obj", ")", ":", "qualified_class_name", "=", "_jit_internal", ".", "_qualified_name", "(", "type", "(", "obj", ")", ")", "rcb", "=", "_jit_internal", ".", "createResolutionCallbackForClassMethods", "(", "type", "(", "obj", ")", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/jit/_recursive.py#L412-L431
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tarfile.py
python
TarFile.gettarinfo
(self, name=None, arcname=None, fileobj=None)
return tarinfo
Create a TarInfo object from the result of os.stat or equivalent on an existing file. The file is either named by `name', or specified as a file object `fileobj' with a file descriptor. If given, `arcname' specifies an alternative name for the file in the archive, otherwise, ...
Create a TarInfo object from the result of os.stat or equivalent on an existing file. The file is either named by `name', or specified as a file object `fileobj' with a file descriptor. If given, `arcname' specifies an alternative name for the file in the archive, otherwise, ...
[ "Create", "a", "TarInfo", "object", "from", "the", "result", "of", "os", ".", "stat", "or", "equivalent", "on", "an", "existing", "file", ".", "The", "file", "is", "either", "named", "by", "name", "or", "specified", "as", "a", "file", "object", "fileobj"...
def gettarinfo(self, name=None, arcname=None, fileobj=None): """Create a TarInfo object from the result of os.stat or equivalent on an existing file. The file is either named by `name', or specified as a file object `fileobj' with a file descriptor. If given, `arcname' specifies...
[ "def", "gettarinfo", "(", "self", ",", "name", "=", "None", ",", "arcname", "=", "None", ",", "fileobj", "=", "None", ")", ":", "self", ".", "_check", "(", "\"awx\"", ")", "# When fileobj is given, replace name by", "# fileobj's real name.", "if", "fileobj", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L1773-L1871
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
EditableListBox.GetUpButton
(*args, **kwargs)
return _gizmos.EditableListBox_GetUpButton(*args, **kwargs)
GetUpButton(self) -> BitmapButton
GetUpButton(self) -> BitmapButton
[ "GetUpButton", "(", "self", ")", "-", ">", "BitmapButton" ]
def GetUpButton(*args, **kwargs): """GetUpButton(self) -> BitmapButton""" return _gizmos.EditableListBox_GetUpButton(*args, **kwargs)
[ "def", "GetUpButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "EditableListBox_GetUpButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L175-L177
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/discover.py
python
DiscoverClasses
(start_dir, top_level_dir, base_class, pattern='*', index_by_class_name=False)
return classes
Discover all classes in |start_dir| which subclass |base_class|. Base classes that contain subclasses are ignored by default. Args: start_dir: The directory to recursively search. top_level_dir: The top level of the package, for importing. base_class: The base class to search for. pattern: Unix sh...
Discover all classes in |start_dir| which subclass |base_class|.
[ "Discover", "all", "classes", "in", "|start_dir|", "which", "subclass", "|base_class|", "." ]
def DiscoverClasses(start_dir, top_level_dir, base_class, pattern='*', index_by_class_name=False): """Discover all classes in |start_dir| which subclass |base_class|. Base classes that contain subclasses are ignored by default. Args: start_dir: The directory to recursively search. to...
[ "def", "DiscoverClasses", "(", "start_dir", ",", "top_level_dir", ",", "base_class", ",", "pattern", "=", "'*'", ",", "index_by_class_name", "=", "False", ")", ":", "modules", "=", "DiscoverModules", "(", "start_dir", ",", "top_level_dir", ",", "pattern", ")", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/discover.py#L52-L96
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py
python
ListComp
(xp, fp, it, test=None)
return Node(syms.atom, [Leaf(token.LBRACE, "["), inner, Leaf(token.RBRACE, "]")])
A list comprehension of the form [xp for fp in it if test]. If test is None, the "if test" part is omitted.
A list comprehension of the form [xp for fp in it if test].
[ "A", "list", "comprehension", "of", "the", "form", "[", "xp", "for", "fp", "in", "it", "if", "test", "]", "." ]
def ListComp(xp, fp, it, test=None): """A list comprehension of the form [xp for fp in it if test]. If test is None, the "if test" part is omitted. """ xp.prefix = "" fp.prefix = " " it.prefix = " " for_leaf = Leaf(token.NAME, "for") for_leaf.prefix = " " in_leaf = Leaf(token.NAME, ...
[ "def", "ListComp", "(", "xp", ",", "fp", ",", "it", ",", "test", "=", "None", ")", ":", "xp", ".", "prefix", "=", "\"\"", "fp", ".", "prefix", "=", "\" \"", "it", ".", "prefix", "=", "\" \"", "for_leaf", "=", "Leaf", "(", "token", ".", "NAME", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py#L87-L109
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
python/caffe/coord_map.py
python
conv_params
(fn)
return (axis, np.array(params.get('stride', 1), ndmin=1), (ks - 1) * dilation + 1, np.array(params.get('pad', 0), ndmin=1))
Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation. Implementation detail: Convolution, Deconvolution, and Im2col layers define these in the convolution_param message, while Pooling has its own fields in pooling_param. This method deals with...
Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation.
[ "Extract", "the", "spatial", "parameters", "that", "determine", "the", "coordinate", "mapping", ":", "kernel", "size", "stride", "padding", "and", "dilation", "." ]
def conv_params(fn): """ Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation. Implementation detail: Convolution, Deconvolution, and Im2col layers define these in the convolution_param message, while Pooling has its own fields in pool...
[ "def", "conv_params", "(", "fn", ")", ":", "params", "=", "fn", ".", "params", ".", "get", "(", "'convolution_param'", ",", "fn", ".", "params", ")", "axis", "=", "params", ".", "get", "(", "'axis'", ",", "1", ")", "ks", "=", "np", ".", "array", ...
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/python/caffe/coord_map.py#L18-L37
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
build/plugins/gobuild.py
python
on_go_process_srcs
(unit)
_GO_PROCESS_SRCS() macro processes only 'CGO' files. All remaining *.go files and other input files are currently processed by a link command of the GO module (GO_LIBRARY, GO_PROGRAM)
_GO_PROCESS_SRCS() macro processes only 'CGO' files. All remaining *.go files and other input files are currently processed by a link command of the GO module (GO_LIBRARY, GO_PROGRAM)
[ "_GO_PROCESS_SRCS", "()", "macro", "processes", "only", "CGO", "files", ".", "All", "remaining", "*", ".", "go", "files", "and", "other", "input", "files", "are", "currently", "processed", "by", "a", "link", "command", "of", "the", "GO", "module", "(", "GO...
def on_go_process_srcs(unit): """ _GO_PROCESS_SRCS() macro processes only 'CGO' files. All remaining *.go files and other input files are currently processed by a link command of the GO module (GO_LIBRARY, GO_PROGRAM) """ srcs_files = get_appended_values(unit, '_GO_SRCS_VALUE') ...
[ "def", "on_go_process_srcs", "(", "unit", ")", ":", "srcs_files", "=", "get_appended_values", "(", "unit", ",", "'_GO_SRCS_VALUE'", ")", "asm_files", "=", "[", "]", "c_files", "=", "[", "]", "cxx_files", "=", "[", "]", "ev_files", "=", "[", "]", "fbs_files...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/plugins/gobuild.py#L87-L275
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/glassbox/ebm/ebm.py
python
BaseEBM.get_feature_types_out
(self)
return [self.feature_types_in_[grp[0]] if len(grp) == 1 else "interaction" for grp in self.term_features_]
Provides the term types. For non-interactions these are the feature_types, and "interactions" for interactions. Args: Returns: A list of per-term names
Provides the term types. For non-interactions these are the feature_types, and "interactions" for interactions.
[ "Provides", "the", "term", "types", ".", "For", "non", "-", "interactions", "these", "are", "the", "feature_types", "and", "interactions", "for", "interactions", "." ]
def get_feature_types_out(self): """ Provides the term types. For non-interactions these are the feature_types, and "interactions" for interactions. Args: Returns: A list of per-term names """ return [self.feature_types_in_[grp[0]] if len(grp) == 1 else "interacti...
[ "def", "get_feature_types_out", "(", "self", ")", ":", "return", "[", "self", ".", "feature_types_in_", "[", "grp", "[", "0", "]", "]", "if", "len", "(", "grp", ")", "==", "1", "else", "\"interaction\"", "for", "grp", "in", "self", ".", "term_features_",...
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/glassbox/ebm/ebm.py#L1177-L1186
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/feature_column/feature_column_v2.py
python
HashedCategoricalColumn.get_config
(self)
return config
See 'FeatureColumn` base class.
See 'FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def get_config(self): """See 'FeatureColumn` base class.""" config = dict(zip(self._fields, self)) config['dtype'] = self.dtype.name return config
[ "def", "get_config", "(", "self", ")", ":", "config", "=", "dict", "(", "zip", "(", "self", ".", "_fields", ",", "self", ")", ")", "config", "[", "'dtype'", "]", "=", "self", ".", "dtype", ".", "name", "return", "config" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column_v2.py#L3460-L3464