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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/requests/cookies.py | python | RequestsCookieJar.multiple_domains | (self) | return False | Returns True if there are multiple domains in the jar.
Returns False otherwise. | Returns True if there are multiple domains in the jar.
Returns False otherwise. | [
"Returns",
"True",
"if",
"there",
"are",
"multiple",
"domains",
"in",
"the",
"jar",
".",
"Returns",
"False",
"otherwise",
"."
] | def multiple_domains(self):
"""Returns True if there are multiple domains in the jar.
Returns False otherwise."""
domains = []
for cookie in iter(self):
if cookie.domain is not None and cookie.domain in domains:
return True
domains.append(cookie.do... | [
"def",
"multiple_domains",
"(",
"self",
")",
":",
"domains",
"=",
"[",
"]",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"if",
"cookie",
".",
"domain",
"is",
"not",
"None",
"and",
"cookie",
".",
"domain",
"in",
"domains",
":",
"return",
"Tru... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/cookies.py#L231-L239 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/dask_cudf/versioneer.py | python | git_versions_from_keywords | (keywords, tag_prefix, verbose) | return {
"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False,
"error": "no suitable tags",
"date": None,
} | Get version information from git keywords. | Get version information from git keywords. | [
"Get",
"version",
"information",
"from",
"git",
"keywords",
"."
] | def git_versions_from_keywords(keywords, tag_prefix, verbose):
"""Get version information from git keywords."""
if not keywords:
raise NotThisMethod("no keywords at all, weird")
date = keywords.get("date")
if date is not None:
# git-2.2.0 added "%cI", which expands to an ISO-8601 -compli... | [
"def",
"git_versions_from_keywords",
"(",
"keywords",
",",
"tag_prefix",
",",
"verbose",
")",
":",
"if",
"not",
"keywords",
":",
"raise",
"NotThisMethod",
"(",
"\"no keywords at all, weird\"",
")",
"date",
"=",
"keywords",
".",
"get",
"(",
"\"date\"",
")",
"if",... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/versioneer.py#L988-L1046 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py | python | ISkypeEvents.PluginEventClicked | (self, Event) | This event occurs when a user clicks on a plug-in event.
@param Event: Plugin event object.
@type Event: L{IPluginEvent} | This event occurs when a user clicks on a plug-in event. | [
"This",
"event",
"occurs",
"when",
"a",
"user",
"clicks",
"on",
"a",
"plug",
"-",
"in",
"event",
"."
] | def PluginEventClicked(self, Event):
'''This event occurs when a user clicks on a plug-in event.
@param Event: Plugin event object.
@type Event: L{IPluginEvent}
''' | [
"def",
"PluginEventClicked",
"(",
"self",
",",
"Event",
")",
":"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py#L1604-L1609 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | Mailbox.iterkeys | (self) | Return an iterator over keys. | Return an iterator over keys. | [
"Return",
"an",
"iterator",
"over",
"keys",
"."
] | def iterkeys(self):
"""Return an iterator over keys."""
raise NotImplementedError('Method must be implemented by subclass') | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Method must be implemented by subclass'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L97-L99 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/generator/ninja.py | python | GetDefaultConcurrentLinks | () | Returns a best-guess for a number of concurrent links. | Returns a best-guess for a number of concurrent links. | [
"Returns",
"a",
"best",
"-",
"guess",
"for",
"a",
"number",
"of",
"concurrent",
"links",
"."
] | def GetDefaultConcurrentLinks():
"""Returns a best-guess for a number of concurrent links."""
pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))
if pool_size:
return pool_size
if sys.platform in ('win32', 'cygwin'):
import ctypes
class MEMORYSTATUSEX(ctypes.Structure):
_fields_ = [
... | [
"def",
"GetDefaultConcurrentLinks",
"(",
")",
":",
"pool_size",
"=",
"int",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'GYP_LINK_CONCURRENCY'",
",",
"0",
")",
")",
"if",
"pool_size",
":",
"return",
"pool_size",
"if",
"sys",
".",
"platform",
"in",
"(",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/ninja.py#L1744-L1796 | ||
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/generate_junitxml.py | python | JunitReport.__unicode__ | (self) | return root_node_dom.toprettyxml(indent=' ' * 4) | Generate and return a pretty-printable XML unicode string | Generate and return a pretty-printable XML unicode string | [
"Generate",
"and",
"return",
"a",
"pretty",
"-",
"printable",
"XML",
"unicode",
"string"
] | def __unicode__(self):
"""
Generate and return a pretty-printable XML unicode string
"""
root_node_unicode = ET.tostring(self.root_element)
root_node_dom = minidom.parseString(root_node_unicode)
return root_node_dom.toprettyxml(indent=' ' * 4) | [
"def",
"__unicode__",
"(",
"self",
")",
":",
"root_node_unicode",
"=",
"ET",
".",
"tostring",
"(",
"self",
".",
"root_element",
")",
"root_node_dom",
"=",
"minidom",
".",
"parseString",
"(",
"root_node_unicode",
")",
"return",
"root_node_dom",
".",
"toprettyxml"... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/generate_junitxml.py#L200-L206 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py | python | tower_loss | (scope) | return total_loss | Calculate the total loss on a single tower running the CIFAR model.
Args:
scope: unique prefix string identifying the CIFAR tower, e.g. 'tower_0'
Returns:
Tensor of shape [] containing the total loss for a batch of data | Calculate the total loss on a single tower running the CIFAR model. | [
"Calculate",
"the",
"total",
"loss",
"on",
"a",
"single",
"tower",
"running",
"the",
"CIFAR",
"model",
"."
] | def tower_loss(scope):
"""Calculate the total loss on a single tower running the CIFAR model.
Args:
scope: unique prefix string identifying the CIFAR tower, e.g. 'tower_0'
Returns:
Tensor of shape [] containing the total loss for a batch of data
"""
# Get images and labels for CIFAR-10.
images, l... | [
"def",
"tower_loss",
"(",
"scope",
")",
":",
"# Get images and labels for CIFAR-10.",
"images",
",",
"labels",
"=",
"cifar10",
".",
"distorted_inputs",
"(",
")",
"# Build inference Graph.",
"logits",
"=",
"cifar10",
".",
"inference",
"(",
"images",
")",
"# Build the... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py#L65-L107 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py | python | DependencyGraph.__repr__ | (self) | return '\n'.join(output) | Representation of the graph | Representation of the graph | [
"Representation",
"of",
"the",
"graph"
] | def __repr__(self):
"""Representation of the graph"""
output = []
for dist, adjs in self.adjacency_list.items():
output.append(self.repr_node(dist))
return '\n'.join(output) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"output",
"=",
"[",
"]",
"for",
"dist",
",",
"adjs",
"in",
"self",
".",
"adjacency_list",
".",
"items",
"(",
")",
":",
"output",
".",
"append",
"(",
"self",
".",
"repr_node",
"(",
"dist",
")",
")",
"return"... | 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/distlib/database.py#L1217-L1222 | |
avast/retdec | b9879088a5f0278508185ec645494e6c5c57a455 | scripts/type_extractor/type_extractor/header_text_filters.py | python | filter_conditional_preprocessor_statements | (text) | return re.sub(
r'^\s*#\s*if(?:def)?.*?[\r\n]{1,2}(.*?(?=#\s*(?:else|elif|endif))).*?#\s*endif',
r'\1', text, flags=re.S | re.M
) | Removes 'else' branches of #if[def] statement. | Removes 'else' branches of #if[def] statement. | [
"Removes",
"else",
"branches",
"of",
"#if",
"[",
"def",
"]",
"statement",
"."
] | def filter_conditional_preprocessor_statements(text):
"""Removes 'else' branches of #if[def] statement."""
return re.sub(
r'^\s*#\s*if(?:def)?.*?[\r\n]{1,2}(.*?(?=#\s*(?:else|elif|endif))).*?#\s*endif',
r'\1', text, flags=re.S | re.M
) | [
"def",
"filter_conditional_preprocessor_statements",
"(",
"text",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'^\\s*#\\s*if(?:def)?.*?[\\r\\n]{1,2}(.*?(?=#\\s*(?:else|elif|endif))).*?#\\s*endif'",
",",
"r'\\1'",
",",
"text",
",",
"flags",
"=",
"re",
".",
"S",
"|",
"re"... | https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/header_text_filters.py#L56-L61 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/package_index.py | python | PackageIndex.fetch | (self, requirement, tmpdir, force_scan=False, source=False) | return None | Obtain a file suitable for fulfilling `requirement`
DEPRECATED; use the ``fetch_distribution()`` method now instead. For
backward compatibility, this routine is identical but returns the
``location`` of the downloaded distribution instead of a distribution
object. | Obtain a file suitable for fulfilling `requirement` | [
"Obtain",
"a",
"file",
"suitable",
"for",
"fulfilling",
"requirement"
] | def fetch(self, requirement, tmpdir, force_scan=False, source=False):
"""Obtain a file suitable for fulfilling `requirement`
DEPRECATED; use the ``fetch_distribution()`` method now instead. For
backward compatibility, this routine is identical but returns the
``location`` of the downlo... | [
"def",
"fetch",
"(",
"self",
",",
"requirement",
",",
"tmpdir",
",",
"force_scan",
"=",
"False",
",",
"source",
"=",
"False",
")",
":",
"dist",
"=",
"self",
".",
"fetch_distribution",
"(",
"requirement",
",",
"tmpdir",
",",
"force_scan",
",",
"source",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/package_index.py#L669-L680 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/operation.py | python | OutputData.reset | (self) | Reinitialize the data store.
Note:
This is a workaround until the execution model is more developed.
Todo:
Remove this method when all operation handles provide factories to
reinstantiate on new Contexts and/or with new inputs. | Reinitialize the data store. | [
"Reinitialize",
"the",
"data",
"store",
"."
] | def reset(self):
"""Reinitialize the data store.
Note:
This is a workaround until the execution model is more developed.
Todo:
Remove this method when all operation handles provide factories to
reinstantiate on new Contexts and/or with new inputs.
"... | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"_done",
"=",
"[",
"False",
"]",
"*",
"self",
".",
"_description",
".",
"width",
"self",
".",
"_data",
"=",
"[",
"None",
"]",
"*",
"self",
".",
"_description",
".",
"width"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L161-L173 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_squeeze | (self, name, input_name, output_name, axes=None, squeeze_all=False) | return spec_layer | Add a squeeze layer to the model that decrease the rank of the input
tensor by removing unit dimensions.
Refer to the **SqueezeLayerParams** message in specification
(NeuralNetwork.proto) for more details.
Parameters
----------
name: str
The name of this laye... | Add a squeeze layer to the model that decrease the rank of the input
tensor by removing unit dimensions.
Refer to the **SqueezeLayerParams** message in specification
(NeuralNetwork.proto) for more details. | [
"Add",
"a",
"squeeze",
"layer",
"to",
"the",
"model",
"that",
"decrease",
"the",
"rank",
"of",
"the",
"input",
"tensor",
"by",
"removing",
"unit",
"dimensions",
".",
"Refer",
"to",
"the",
"**",
"SqueezeLayerParams",
"**",
"message",
"in",
"specification",
"(... | def add_squeeze(self, name, input_name, output_name, axes=None, squeeze_all=False):
"""
Add a squeeze layer to the model that decrease the rank of the input
tensor by removing unit dimensions.
Refer to the **SqueezeLayerParams** message in specification
(NeuralNetwork.proto) for ... | [
"def",
"add_squeeze",
"(",
"self",
",",
"name",
",",
"input_name",
",",
"output_name",
",",
"axes",
"=",
"None",
",",
"squeeze_all",
"=",
"False",
")",
":",
"spec_layer",
"=",
"self",
".",
"_add_generic_layer",
"(",
"name",
",",
"[",
"input_name",
"]",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L7062-L7100 | |
LisaAnne/lisa-caffe-public | 49b8643ddef23a4f6120017968de30c45e693f59 | scripts/cpp_lint.py | python | CheckStyle | (filename, clean_lines, linenum, file_extension, nesting_state,
error) | Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,
tab usage, spaces inside code, etc.
Args:
filename: The name of the current file.
clean_line... | Checks rules from the 'C++ style rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"style",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,... | [
"def",
"CheckStyle",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want ... | https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/scripts/cpp_lint.py#L3459-L3563 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/slim/python/slim/summaries.py | python | add_image_summary | (tensor, name=None, prefix=None, print_summary=False) | return op | Adds an image summary for the given tensor.
Args:
tensor: a variable or op tensor with shape [batch,height,width,channels]
name: the optional name for the summary.
prefix: An optional prefix for the summary names.
print_summary: If `True`, the summary is printed to stdout when the summary
is co... | Adds an image summary for the given tensor. | [
"Adds",
"an",
"image",
"summary",
"for",
"the",
"given",
"tensor",
"."
] | def add_image_summary(tensor, name=None, prefix=None, print_summary=False):
"""Adds an image summary for the given tensor.
Args:
tensor: a variable or op tensor with shape [batch,height,width,channels]
name: the optional name for the summary.
prefix: An optional prefix for the summary names.
print_... | [
"def",
"add_image_summary",
"(",
"tensor",
",",
"name",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"print_summary",
"=",
"False",
")",
":",
"summary_name",
"=",
"_get_summary_name",
"(",
"tensor",
",",
"name",
",",
"prefix",
")",
"# If print_summary, then w... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/summaries.py#L79-L102 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L792-L794 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/c_aliases.py | python | get_extensions | (lst) | return ret | :param lst: files to process
:list lst: list of string or :py:class:`waflib.Node.Node`
:return: list of file extensions
:rtype: list of string | :param lst: files to process
:list lst: list of string or :py:class:`waflib.Node.Node`
:return: list of file extensions
:rtype: list of string | [
":",
"param",
"lst",
":",
"files",
"to",
"process",
":",
"list",
"lst",
":",
"list",
"of",
"string",
"or",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Node",
".",
"Node",
":",
"return",
":",
"list",
"of",
"file",
"extensions",
":",
"rtype",
":",
... | def get_extensions(lst):
"""
:param lst: files to process
:list lst: list of string or :py:class:`waflib.Node.Node`
:return: list of file extensions
:rtype: list of string
"""
ret = []
for x in Utils.to_list(lst):
try:
if not isinstance(x, str):
x = x.name
ret.append(x[x.rfind('.') + 1:])
except E... | [
"def",
"get_extensions",
"(",
"lst",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"x",
"in",
"Utils",
".",
"to_list",
"(",
"lst",
")",
":",
"try",
":",
"if",
"not",
"isinstance",
"(",
"x",
",",
"str",
")",
":",
"x",
"=",
"x",
".",
"name",
"ret",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/c_aliases.py#L11-L26 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/generator/analyzer.py | python | Config.Init | (self, params) | Initializes Config. This is a separate method as it raises an exception
if there is a parse error. | Initializes Config. This is a separate method as it raises an exception
if there is a parse error. | [
"Initializes",
"Config",
".",
"This",
"is",
"a",
"separate",
"method",
"as",
"it",
"raises",
"an",
"exception",
"if",
"there",
"is",
"a",
"parse",
"error",
"."
] | def Init(self, params):
"""Initializes Config. This is a separate method as it raises an exception
if there is a parse error."""
generator_flags = params.get('generator_flags', {})
config_path = generator_flags.get('config_path', None)
if not config_path:
return
try:
f = open(config_... | [
"def",
"Init",
"(",
"self",
",",
"params",
")",
":",
"generator_flags",
"=",
"params",
".",
"get",
"(",
"'generator_flags'",
",",
"{",
"}",
")",
"config_path",
"=",
"generator_flags",
".",
"get",
"(",
"'config_path'",
",",
"None",
")",
"if",
"not",
"conf... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/analyzer.py#L253-L273 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.clip | (self, lower=None, upper=None, inplace=False, axis=1) | return self._mimic_inplace(output, inplace=inplace) | Trim values at input threshold(s).
Assigns values outside boundary to boundary values.
Thresholds can be singular values or array like,
and in the latter case the clipping is performed
element-wise in the specified axis. Currently only
`axis=1` is supported.
Parameters
... | Trim values at input threshold(s). | [
"Trim",
"values",
"at",
"input",
"threshold",
"(",
"s",
")",
"."
] | def clip(self, lower=None, upper=None, inplace=False, axis=1):
"""
Trim values at input threshold(s).
Assigns values outside boundary to boundary values.
Thresholds can be singular values or array like,
and in the latter case the clipping is performed
element-wise in the... | [
"def",
"clip",
"(",
"self",
",",
"lower",
"=",
"None",
",",
"upper",
"=",
"None",
",",
"inplace",
"=",
"False",
",",
"axis",
"=",
"1",
")",
":",
"if",
"axis",
"!=",
"1",
":",
"raise",
"NotImplementedError",
"(",
"\"`axis is not yet supported in clip`\"",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L746-L871 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | IOMC/RandomEngine/python/RandomServiceHelper.py | python | RandomNumberServiceHelper.__psetsWithSeeds | (self) | return list(filter(self.__containsSeed, svcAttrs)) | _psetsWithSeeds_
*private method*
return the list of PSet instances with seeds in them | _psetsWithSeeds_ | [
"_psetsWithSeeds_"
] | def __psetsWithSeeds(self):
"""
_psetsWithSeeds_
*private method*
return the list of PSet instances with seeds in them
"""
svcAttrs = [getattr(self._randService, item, None)
for item in self._randService.parameters_()
if item not... | [
"def",
"__psetsWithSeeds",
"(",
"self",
")",
":",
"svcAttrs",
"=",
"[",
"getattr",
"(",
"self",
".",
"_randService",
",",
"item",
",",
"None",
")",
"for",
"item",
"in",
"self",
".",
"_randService",
".",
"parameters_",
"(",
")",
"if",
"item",
"not",
"in... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/IOMC/RandomEngine/python/RandomServiceHelper.py#L46-L61 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | bindings/python/retries.py | python | RandomBackoff.__init__ | (self, lower=0.0, upper=3.0) | @type lower: C{float}
@param lower: the minimum time to sleep between iterations
@type upper: C{float}
@param upper: the maximum time to sleep between iterations | @type lower: C{float}
@param lower: the minimum time to sleep between iterations | [
"@type",
"lower",
":",
"C",
"{",
"float",
"}",
"@param",
"lower",
":",
"the",
"minimum",
"time",
"to",
"sleep",
"between",
"iterations"
] | def __init__(self, lower=0.0, upper=3.0):
"""
@type lower: C{float}
@param lower: the minimum time to sleep between iterations
@type upper: C{float}
@param upper: the maximum time to sleep between iterations
"""
def wait_time_gen():
while True:
... | [
"def",
"__init__",
"(",
"self",
",",
"lower",
"=",
"0.0",
",",
"upper",
"=",
"3.0",
")",
":",
"def",
"wait_time_gen",
"(",
")",
":",
"while",
"True",
":",
"yield",
"random",
".",
"uniform",
"(",
"lower",
",",
"upper",
")",
"BackoffRetry",
".",
"__ini... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/bindings/python/retries.py#L229-L241 | ||
tum-vision/fusenet | a1451be2971b348a01b0f525c2a3a7a0e215a591 | python/caffe/detector.py | python | Detector.configure_crop | (self, context_pad) | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping. | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding. | [
"Configure",
"crop",
"dimensions",
"and",
"amount",
"of",
"context",
"for",
"cropping",
".",
"If",
"context",
"is",
"included",
"make",
"the",
"special",
"input",
"mean",
"for",
"context",
"padding",
"."
] | def configure_crop(self, context_pad):
"""
Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping.
"""
# cro... | [
"def",
"configure_crop",
"(",
"self",
",",
"context_pad",
")",
":",
"# crop dimensions",
"in_",
"=",
"self",
".",
"inputs",
"[",
"0",
"]",
"tpose",
"=",
"self",
".",
"transformer",
".",
"transpose",
"[",
"in_",
"]",
"inv_tpose",
"=",
"[",
"tpose",
"[",
... | https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/python/caffe/detector.py#L181-L216 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py | python | cal_tuple_slice_mask | (data_shape, tuple_index) | return begin_mask, end_mask | calculate the strided_slice begin and end mask | calculate the strided_slice begin and end mask | [
"calculate",
"the",
"strided_slice",
"begin",
"and",
"end",
"mask"
] | def cal_tuple_slice_mask(data_shape, tuple_index):
"""calculate the strided_slice begin and end mask"""
begin_mask = 0
end_mask = 0
for i, slice_index in enumerate(tuple_index):
if isinstance(slice_index, slice):
begin_mask += 2**i if slice_get_item(slice_index, "start") is None else... | [
"def",
"cal_tuple_slice_mask",
"(",
"data_shape",
",",
"tuple_index",
")",
":",
"begin_mask",
"=",
"0",
"end_mask",
"=",
"0",
"for",
"i",
",",
"slice_index",
"in",
"enumerate",
"(",
"tuple_index",
")",
":",
"if",
"isinstance",
"(",
"slice_index",
",",
"slice... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py#L472-L483 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | SizerItem.DetachSizer | (*args, **kwargs) | return _core_.SizerItem_DetachSizer(*args, **kwargs) | DetachSizer(self)
Enable deleting the SizerItem without destroying the contained sizer. | DetachSizer(self) | [
"DetachSizer",
"(",
"self",
")"
] | def DetachSizer(*args, **kwargs):
"""
DetachSizer(self)
Enable deleting the SizerItem without destroying the contained sizer.
"""
return _core_.SizerItem_DetachSizer(*args, **kwargs) | [
"def",
"DetachSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizerItem_DetachSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L14052-L14058 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/ndimage/morphology.py | python | iterate_structure | (structure, iterations, origin=None) | Iterate a structure by dilating it with itself.
Parameters
----------
structure : array_like
Structuring element (an array of bools, for example), to be dilated with
itself.
iterations : int
number of dilations performed on the structure with itself
origin : optional
If... | Iterate a structure by dilating it with itself. | [
"Iterate",
"a",
"structure",
"by",
"dilating",
"it",
"with",
"itself",
"."
] | def iterate_structure(structure, iterations, origin=None):
"""
Iterate a structure by dilating it with itself.
Parameters
----------
structure : array_like
Structuring element (an array of bools, for example), to be dilated with
itself.
iterations : int
number of dilations ... | [
"def",
"iterate_structure",
"(",
"structure",
",",
"iterations",
",",
"origin",
"=",
"None",
")",
":",
"structure",
"=",
"numpy",
".",
"asarray",
"(",
"structure",
")",
"if",
"iterations",
"<",
"2",
":",
"return",
"structure",
".",
"copy",
"(",
")",
"ni"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/ndimage/morphology.py#L55-L121 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/log.py | python | _get_logger | () | return logger | Get logger instance.
Returns:
Logger, a logger. | Get logger instance. | [
"Get",
"logger",
"instance",
"."
] | def _get_logger():
"""
Get logger instance.
Returns:
Logger, a logger.
"""
if _global_logger:
return _global_logger
kwargs = _get_env_config()
_verify_config(kwargs)
logger = _setup_logger(_adapt_cfg(kwargs))
return logger | [
"def",
"_get_logger",
"(",
")",
":",
"if",
"_global_logger",
":",
"return",
"_global_logger",
"kwargs",
"=",
"_get_env_config",
"(",
")",
"_verify_config",
"(",
"kwargs",
")",
"logger",
"=",
"_setup_logger",
"(",
"_adapt_cfg",
"(",
"kwargs",
")",
")",
"return"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/log.py#L150-L163 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Spinbox.invoke | (self, element) | return self.tk.call(self._w, 'invoke', element) | Causes the specified element to be invoked
The element could be buttondown or buttonup
triggering the action associated with it. | Causes the specified element to be invoked | [
"Causes",
"the",
"specified",
"element",
"to",
"be",
"invoked"
] | def invoke(self, element):
"""Causes the specified element to be invoked
The element could be buttondown or buttonup
triggering the action associated with it.
"""
return self.tk.call(self._w, 'invoke', element) | [
"def",
"invoke",
"(",
"self",
",",
"element",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'invoke'",
",",
"element",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3458-L3464 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/service/read/nyan_api_loader.py | python | _insert_members | (api_objects) | Creates members for API objects. | Creates members for API objects. | [
"Creates",
"members",
"for",
"API",
"objects",
"."
] | def _insert_members(api_objects):
"""
Creates members for API objects.
"""
# engine.ability
# engine.ability.Ability
api_object = api_objects["engine.ability.Ability"]
subtype = NyanMemberType(api_objects["engine.ability.property.AbilityProperty"])
key_type = NyanMemberType(MemberType.A... | [
"def",
"_insert_members",
"(",
"api_objects",
")",
":",
"# engine.ability",
"# engine.ability.Ability",
"api_object",
"=",
"api_objects",
"[",
"\"engine.ability.Ability\"",
"]",
"subtype",
"=",
"NyanMemberType",
"(",
"api_objects",
"[",
"\"engine.ability.property.AbilityPrope... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/service/read/nyan_api_loader.py#L2416-L4803 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/session_ops.py | python | delete_session_tensor | (handle, name=None) | return (holder, deleter) | Delete the tensor for the given tensor handle.
This is EXPERIMENTAL and subject to change.
Delete the tensor of a given tensor handle. The tensor is produced
in a previous run() and stored in the state of the session.
Args:
handle: The string representation of a persistent tensor handle.
name: Option... | Delete the tensor for the given tensor handle. | [
"Delete",
"the",
"tensor",
"for",
"the",
"given",
"tensor",
"handle",
"."
] | def delete_session_tensor(handle, name=None):
"""Delete the tensor for the given tensor handle.
This is EXPERIMENTAL and subject to change.
Delete the tensor of a given tensor handle. The tensor is produced
in a previous run() and stored in the state of the session.
Args:
handle: The string representat... | [
"def",
"delete_session_tensor",
"(",
"handle",
",",
"name",
"=",
"None",
")",
":",
"handle_device",
"=",
"TensorHandle",
".",
"_get_device_name",
"(",
"handle",
")",
"with",
"ops",
".",
"device",
"(",
"handle_device",
")",
":",
"holder",
"=",
"array_ops",
".... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/session_ops.py#L202-L222 | |
adobe/brackets-app | 26dc31087a30bef7754b94e09fe7e74f6da9d699 | src/mac/tools/change_mach_o_flags.py | python | ReadUInt32 | (file, endian) | return uint32 | Reads an unsinged 32-bit integer from the file-like |file| object,
treating it as having endianness specified by |endian| (per the |struct|
module), and returns it as a number. Raises a MachOError if the proper
length of data can't be read from |file|. | Reads an unsinged 32-bit integer from the file-like |file| object,
treating it as having endianness specified by |endian| (per the |struct|
module), and returns it as a number. Raises a MachOError if the proper
length of data can't be read from |file|. | [
"Reads",
"an",
"unsinged",
"32",
"-",
"bit",
"integer",
"from",
"the",
"file",
"-",
"like",
"|file|",
"object",
"treating",
"it",
"as",
"having",
"endianness",
"specified",
"by",
"|endian|",
"(",
"per",
"the",
"|struct|",
"module",
")",
"and",
"returns",
"... | def ReadUInt32(file, endian):
"""Reads an unsinged 32-bit integer from the file-like |file| object,
treating it as having endianness specified by |endian| (per the |struct|
module), and returns it as a number. Raises a MachOError if the proper
length of data can't be read from |file|."""
bytes = CheckedRead(... | [
"def",
"ReadUInt32",
"(",
"file",
",",
"endian",
")",
":",
"bytes",
"=",
"CheckedRead",
"(",
"file",
",",
"4",
")",
"(",
"uint32",
",",
")",
"=",
"struct",
".",
"unpack",
"(",
"endian",
"+",
"'I'",
",",
"bytes",
")",
"return",
"uint32"
] | https://github.com/adobe/brackets-app/blob/26dc31087a30bef7754b94e09fe7e74f6da9d699/src/mac/tools/change_mach_o_flags.py#L125-L134 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/solvers/symmetric/qre_anneal_noaux.py | python | Solver.exploitability | (self, params, payoff_matrices) | return exp.qre_exploitability(params, payoff_matrices, self.temperature) | Compute and return shannon entropy regularized exploitability.
Args:
params: tuple of params (dist, y), see qre.gradients
payoff_matrices: (>=2 x A x A) np.array, payoffs for each joint action
Returns:
float, exploitability of current dist | Compute and return shannon entropy regularized exploitability. | [
"Compute",
"and",
"return",
"shannon",
"entropy",
"regularized",
"exploitability",
"."
] | def exploitability(self, params, payoff_matrices):
"""Compute and return shannon entropy regularized exploitability.
Args:
params: tuple of params (dist, y), see qre.gradients
payoff_matrices: (>=2 x A x A) np.array, payoffs for each joint action
Returns:
float, exploitability of current ... | [
"def",
"exploitability",
"(",
"self",
",",
"params",
",",
"payoff_matrices",
")",
":",
"return",
"exp",
".",
"qre_exploitability",
"(",
"params",
",",
"payoff_matrices",
",",
"self",
".",
"temperature",
")"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/solvers/symmetric/qre_anneal_noaux.py#L95-L104 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/config.py | python | ConfigOptionsHandler.parse_section_exclude_package_data | (self, section_options) | Parses `exclude_package_data` configuration file section.
:param dict section_options: | Parses `exclude_package_data` configuration file section. | [
"Parses",
"exclude_package_data",
"configuration",
"file",
"section",
"."
] | def parse_section_exclude_package_data(self, section_options):
"""Parses `exclude_package_data` configuration file section.
:param dict section_options:
"""
self['exclude_package_data'] = self._parse_package_data(
section_options) | [
"def",
"parse_section_exclude_package_data",
"(",
"self",
",",
"section_options",
")",
":",
"self",
"[",
"'exclude_package_data'",
"]",
"=",
"self",
".",
"_parse_package_data",
"(",
"section_options",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/config.py#L677-L683 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TFlt.GetKiloStr | (*args) | return _snap.TFlt_GetKiloStr(*args) | GetKiloStr(double const & Val) -> TStr
Parameters:
Val: double const & | GetKiloStr(double const & Val) -> TStr | [
"GetKiloStr",
"(",
"double",
"const",
"&",
"Val",
")",
"-",
">",
"TStr"
] | def GetKiloStr(*args):
"""
GetKiloStr(double const & Val) -> TStr
Parameters:
Val: double const &
"""
return _snap.TFlt_GetKiloStr(*args) | [
"def",
"GetKiloStr",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TFlt_GetKiloStr",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L14540-L14548 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | ParserElement.matches | (self, testString, parseAll=True) | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- parseAll - (default=C{True}) - flag to pass to C{L{par... | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- parseAll - (default=C{True}) - flag to pass to C{L{par... | [
"Method",
"for",
"quick",
"testing",
"of",
"a",
"parser",
"against",
"a",
"test",
"string",
".",
"Good",
"for",
"simple",
"inline",
"microtests",
"of",
"sub",
"expressions",
"while",
"building",
"up",
"larger",
"parser",
".",
"Parameters",
":",
"-",
"testStr... | def matches(self, testString, parseAll=True):
"""
Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match... | [
"def",
"matches",
"(",
"self",
",",
"testString",
",",
"parseAll",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"parseString",
"(",
"_ustr",
"(",
"testString",
")",
",",
"parseAll",
"=",
"parseAll",
")",
"return",
"True",
"except",
"ParseBaseException",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L2213-L2230 | ||
mongodb/mongo-cxx-driver | eb86512b05be20d2f51d53ba9b860c709e0799b3 | etc/clang_format.py | python | get_clang_format_from_cache_and_extract | (url, tarball_ext) | Get clang-format from mongodb's cache
and extract the tarball | Get clang-format from mongodb's cache
and extract the tarball | [
"Get",
"clang",
"-",
"format",
"from",
"mongodb",
"s",
"cache",
"and",
"extract",
"the",
"tarball"
] | def get_clang_format_from_cache_and_extract(url, tarball_ext):
"""Get clang-format from mongodb's cache
and extract the tarball
"""
dest_dir = tempfile.gettempdir()
temp_tar_file = os.path.join(dest_dir, "temp.tar" + tarball_ext)
# Download from file
print("Downloading clang-format %s from ... | [
"def",
"get_clang_format_from_cache_and_extract",
"(",
"url",
",",
"tarball_ext",
")",
":",
"dest_dir",
"=",
"tempfile",
".",
"gettempdir",
"(",
")",
"temp_tar_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dest_dir",
",",
"\"temp.tar\"",
"+",
"tarball_ext",
... | https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L136-L160 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/predator_prey.py | python | MFGPredatorPreyState.update_distribution | (self, distribution) | This function is central and specific to the logic of the MFG.
It should only be called when the node is in MEAN_FIELD state.
Args:
distribution: List of floats that should contain the probability of each
state returned by distribution_support(). | This function is central and specific to the logic of the MFG. | [
"This",
"function",
"is",
"central",
"and",
"specific",
"to",
"the",
"logic",
"of",
"the",
"MFG",
"."
] | def update_distribution(self, distribution):
"""This function is central and specific to the logic of the MFG.
It should only be called when the node is in MEAN_FIELD state.
Args:
distribution: List of floats that should contain the probability of each
state returned by distribution_support(... | [
"def",
"update_distribution",
"(",
"self",
",",
"distribution",
")",
":",
"expected_dist_size",
"=",
"self",
".",
"num_states",
"*",
"self",
".",
"num_players",
"(",
")",
"assert",
"len",
"(",
"distribution",
")",
"==",
"expected_dist_size",
",",
"(",
"f\"Unex... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/predator_prey.py#L338-L355 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.get_extpanid | (self) | return self.__parse_extpanid(self.execute_command('extpanid')) | Get the Thread Extended PAN ID value. | Get the Thread Extended PAN ID value. | [
"Get",
"the",
"Thread",
"Extended",
"PAN",
"ID",
"value",
"."
] | def get_extpanid(self) -> str:
"""Get the Thread Extended PAN ID value."""
return self.__parse_extpanid(self.execute_command('extpanid')) | [
"def",
"get_extpanid",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"__parse_extpanid",
"(",
"self",
".",
"execute_command",
"(",
"'extpanid'",
")",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L379-L381 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/util/decorator_utils.py | python | add_notice_to_docstring | (
doc, instructions, no_doc_str, suffix_str, notice) | return '\n'.join(lines) | Adds a deprecation notice to a docstring. | Adds a deprecation notice to a docstring. | [
"Adds",
"a",
"deprecation",
"notice",
"to",
"a",
"docstring",
"."
] | def add_notice_to_docstring(
doc, instructions, no_doc_str, suffix_str, notice):
"""Adds a deprecation notice to a docstring."""
if not doc:
lines = [no_doc_str]
else:
lines = _normalize_docstring(doc).splitlines()
lines[0] += ' ' + suffix_str
notice = [''] + notice + [instructions]
if len(l... | [
"def",
"add_notice_to_docstring",
"(",
"doc",
",",
"instructions",
",",
"no_doc_str",
",",
"suffix_str",
",",
"notice",
")",
":",
"if",
"not",
"doc",
":",
"lines",
"=",
"[",
"no_doc_str",
"]",
"else",
":",
"lines",
"=",
"_normalize_docstring",
"(",
"doc",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/util/decorator_utils.py#L76-L96 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | addon-sdk/source/python-lib/simplejson/__init__.py | python | write | (obj) | return dumps(obj) | jsonlib, JsonUtils, python-json, json-py API compatibility hook.
Use dumps(s) instead. | jsonlib, JsonUtils, python-json, json-py API compatibility hook.
Use dumps(s) instead. | [
"jsonlib",
"JsonUtils",
"python",
"-",
"json",
"json",
"-",
"py",
"API",
"compatibility",
"hook",
".",
"Use",
"dumps",
"(",
"s",
")",
"instead",
"."
] | def write(obj):
"""
jsonlib, JsonUtils, python-json, json-py API compatibility hook.
Use dumps(s) instead.
"""
import warnings
warnings.warn("simplejson.dumps(s) should be used instead of write(s)",
DeprecationWarning)
return dumps(obj) | [
"def",
"write",
"(",
"obj",
")",
":",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"\"simplejson.dumps(s) should be used instead of write(s)\"",
",",
"DeprecationWarning",
")",
"return",
"dumps",
"(",
"obj",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/addon-sdk/source/python-lib/simplejson/__init__.py#L363-L371 | |
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | examples/finetune_flickr_style/assemble_data.py | python | download_image | (args_tuple) | For use with multiprocessing map. Returns filename on fail. | For use with multiprocessing map. Returns filename on fail. | [
"For",
"use",
"with",
"multiprocessing",
"map",
".",
"Returns",
"filename",
"on",
"fail",
"."
] | def download_image(args_tuple):
"For use with multiprocessing map. Returns filename on fail."
try:
url, filename = args_tuple
if not os.path.exists(filename):
urllib.urlretrieve(url, filename)
with open(filename) as f:
assert hashlib.sha1(f.read()).hexdigest() != ... | [
"def",
"download_image",
"(",
"args_tuple",
")",
":",
"try",
":",
"url",
",",
"filename",
"=",
"args_tuple",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"urllib",
".",
"urlretrieve",
"(",
"url",
",",
"filename",
")",
"with... | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/examples/finetune_flickr_style/assemble_data.py#L23-L36 | ||
acbull/Unbiased_LambdaMart | 7c39abe5caa18ca07df2d23c2db392916d92956c | Unbias_LightGBM/python-package/lightgbm/engine.py | python | cv | (params, train_set, num_boost_round=100,
folds=None, nfold=5, stratified=True, shuffle=True,
metrics=None, fobj=None, feval=None, init_model=None,
feature_name='auto', categorical_feature='auto',
early_stopping_rounds=None, fpreproc=None,
verbose_eval=None, show_stdv=True, seed=0,
... | return dict(results) | Perform the cross-validation with given paramaters.
Parameters
----------
params : dict
Parameters for Booster.
train_set : Dataset
Data to be trained on.
num_boost_round : int, optional (default=100)
Number of boosting iterations.
folds : a generator or iterator of (tra... | Perform the cross-validation with given paramaters. | [
"Perform",
"the",
"cross",
"-",
"validation",
"with",
"given",
"paramaters",
"."
] | def cv(params, train_set, num_boost_round=100,
folds=None, nfold=5, stratified=True, shuffle=True,
metrics=None, fobj=None, feval=None, init_model=None,
feature_name='auto', categorical_feature='auto',
early_stopping_rounds=None, fpreproc=None,
verbose_eval=None, show_stdv=True, seed=... | [
"def",
"cv",
"(",
"params",
",",
"train_set",
",",
"num_boost_round",
"=",
"100",
",",
"folds",
"=",
"None",
",",
"nfold",
"=",
"5",
",",
"stratified",
"=",
"True",
",",
"shuffle",
"=",
"True",
",",
"metrics",
"=",
"None",
",",
"fobj",
"=",
"None",
... | https://github.com/acbull/Unbiased_LambdaMart/blob/7c39abe5caa18ca07df2d23c2db392916d92956c/Unbias_LightGBM/python-package/lightgbm/engine.py#L314-L467 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | deg2rad | (x) | return x*pi/180.0 | Transforms degrees into radians.
:param `x`: a float representing an angle in degrees. | Transforms degrees into radians. | [
"Transforms",
"degrees",
"into",
"radians",
"."
] | def deg2rad(x):
"""
Transforms degrees into radians.
:param `x`: a float representing an angle in degrees.
"""
return x*pi/180.0 | [
"def",
"deg2rad",
"(",
"x",
")",
":",
"return",
"x",
"*",
"pi",
"/",
"180.0"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1215-L1222 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py | python | Report.composeSummaryEmail | (self) | return message | Compose a message to send to the Boost developer's
list. Return the message and return it. | Compose a message to send to the Boost developer's
list. Return the message and return it. | [
"Compose",
"a",
"message",
"to",
"send",
"to",
"the",
"Boost",
"developer",
"s",
"list",
".",
"Return",
"the",
"message",
"and",
"return",
"it",
"."
] | def composeSummaryEmail(self):
"""
Compose a message to send to the Boost developer's
list. Return the message and return it.
"""
message = """From: Douglas Gregor <dgregor@osl.iu.edu>
To: boost@lists.boost.org
Reply-To: boost@lists.boost.org
Subject: [Report] """
message... | [
"def",
"composeSummaryEmail",
"(",
"self",
")",
":",
"message",
"=",
"\"\"\"From: Douglas Gregor <dgregor@osl.iu.edu>\nTo: boost@lists.boost.org\nReply-To: boost@lists.boost.org\nSubject: [Report] \"\"\"",
"message",
"+=",
"str",
"(",
"self",
".",
"numFailures",
"(",
")",
")",
... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py#L486-L577 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozboot/mozboot/android.py | python | check_output | (*args, **kwargs) | return fn(*args, **kwargs) | Run subprocess.check_output even if Python doesn't provide it. | Run subprocess.check_output even if Python doesn't provide it. | [
"Run",
"subprocess",
".",
"check_output",
"even",
"if",
"Python",
"doesn",
"t",
"provide",
"it",
"."
] | def check_output(*args, **kwargs):
"""Run subprocess.check_output even if Python doesn't provide it."""
from base import BaseBootstrapper
fn = getattr(subprocess, 'check_output', BaseBootstrapper._check_output)
return fn(*args, **kwargs) | [
"def",
"check_output",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"base",
"import",
"BaseBootstrapper",
"fn",
"=",
"getattr",
"(",
"subprocess",
",",
"'check_output'",
",",
"BaseBootstrapper",
".",
"_check_output",
")",
"return",
"fn",
"(",... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozboot/mozboot/android.py#L76-L81 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py | python | extended_linecache_checkcache | (filename=None,
orig_checkcache=linecache.checkcache) | Extend linecache.checkcache to preserve the <pyshell#...> entries
Rather than repeating the linecache code, patch it to save the
<pyshell#...> entries, call the original linecache.checkcache()
(skipping them), and then restore the saved entries.
orig_checkcache is bound at definition time to the origi... | Extend linecache.checkcache to preserve the <pyshell#...> entries | [
"Extend",
"linecache",
".",
"checkcache",
"to",
"preserve",
"the",
"<pyshell#",
"...",
">",
"entries"
] | def extended_linecache_checkcache(filename=None,
orig_checkcache=linecache.checkcache):
"""Extend linecache.checkcache to preserve the <pyshell#...> entries
Rather than repeating the linecache code, patch it to save the
<pyshell#...> entries, call the original linecache.ch... | [
"def",
"extended_linecache_checkcache",
"(",
"filename",
"=",
"None",
",",
"orig_checkcache",
"=",
"linecache",
".",
"checkcache",
")",
":",
"cache",
"=",
"linecache",
".",
"cache",
"save",
"=",
"{",
"}",
"for",
"key",
"in",
"list",
"(",
"cache",
")",
":",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py#L103-L120 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py | python | FieldStorage.read_urlencoded | (self) | Internal: read data in query string format. | Internal: read data in query string format. | [
"Internal",
":",
"read",
"data",
"in",
"query",
"string",
"format",
"."
] | def read_urlencoded(self):
"""Internal: read data in query string format."""
qs = self.fp.read(self.length)
if self.qs_on_post:
qs += '&' + self.qs_on_post
self.list = list = []
for key, value in urlparse.parse_qsl(qs, self.keep_blank_values,
... | [
"def",
"read_urlencoded",
"(",
"self",
")",
":",
"qs",
"=",
"self",
".",
"fp",
".",
"read",
"(",
"self",
".",
"length",
")",
"if",
"self",
".",
"qs_on_post",
":",
"qs",
"+=",
"'&'",
"+",
"self",
".",
"qs_on_post",
"self",
".",
"list",
"=",
"list",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py#L604-L613 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.udp_open | (self) | Opens the example socket. | Opens the example socket. | [
"Opens",
"the",
"example",
"socket",
"."
] | def udp_open(self):
"""Opens the example socket."""
self.execute_command('udp open') | [
"def",
"udp_open",
"(",
"self",
")",
":",
"self",
".",
"execute_command",
"(",
"'udp open'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L2176-L2178 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/applications/inception_v3.py | python | conv2d_bn | (x,
filters,
num_row,
num_col,
padding='same',
strides=(1, 1),
name=None) | return x | Utility function to apply conv + BN.
Arguments:
x: input tensor.
filters: filters in `Conv2D`.
num_row: height of the convolution kernel.
num_col: width of the convolution kernel.
padding: padding mode in `Conv2D`.
strides: strides in `Conv2D`.
name: name of the ops; will be... | Utility function to apply conv + BN. | [
"Utility",
"function",
"to",
"apply",
"conv",
"+",
"BN",
"."
] | def conv2d_bn(x,
filters,
num_row,
num_col,
padding='same',
strides=(1, 1),
name=None):
"""Utility function to apply conv + BN.
Arguments:
x: input tensor.
filters: filters in `Conv2D`.
num_row: height of the conv... | [
"def",
"conv2d_bn",
"(",
"x",
",",
"filters",
",",
"num_row",
",",
"num_col",
",",
"padding",
"=",
"'same'",
",",
"strides",
"=",
"(",
"1",
",",
"1",
")",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"not",
"None",
":",
"bn_name",
"=",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/applications/inception_v3.py#L54-L95 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/environment.py | python | Environment.handle_exception | (self, exc_info=None, rendered=False, source_hint=None) | Exception handling helper. This is used internally to either raise
rewritten exceptions or return a rendered traceback for the template. | Exception handling helper. This is used internally to either raise
rewritten exceptions or return a rendered traceback for the template. | [
"Exception",
"handling",
"helper",
".",
"This",
"is",
"used",
"internally",
"to",
"either",
"raise",
"rewritten",
"exceptions",
"or",
"return",
"a",
"rendered",
"traceback",
"for",
"the",
"template",
"."
] | def handle_exception(self, exc_info=None, rendered=False, source_hint=None):
"""Exception handling helper. This is used internally to either raise
rewritten exceptions or return a rendered traceback for the template.
"""
global _make_traceback
if exc_info is None:
ex... | [
"def",
"handle_exception",
"(",
"self",
",",
"exc_info",
"=",
"None",
",",
"rendered",
"=",
"False",
",",
"source_hint",
"=",
"None",
")",
":",
"global",
"_make_traceback",
"if",
"exc_info",
"is",
"None",
":",
"exc_info",
"=",
"sys",
".",
"exc_info",
"(",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/environment.py#L760-L780 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/configure.d/nodedownload.py | python | reporthook | (count, size, total) | internal hook used by retrievefile | internal hook used by retrievefile | [
"internal",
"hook",
"used",
"by",
"retrievefile"
] | def reporthook(count, size, total):
"""internal hook used by retrievefile"""
sys.stdout.write(' Fetch: %c %sMB total, %sMB downloaded \r' %
(spin(count),
formatSize(total),
formatSize(count*size))) | [
"def",
"reporthook",
"(",
"count",
",",
"size",
",",
"total",
")",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"' Fetch: %c %sMB total, %sMB downloaded \\r'",
"%",
"(",
"spin",
"(",
"count",
")",
",",
"formatSize",
"(",
"total",
")",
",",
"formatSize",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/configure.d/nodedownload.py#L29-L34 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | util/style/sort_includes.py | python | include_key | (line) | return key | Mark directories with a leading space so directories
are sorted before files | Mark directories with a leading space so directories
are sorted before files | [
"Mark",
"directories",
"with",
"a",
"leading",
"space",
"so",
"directories",
"are",
"sorted",
"before",
"files"
] | def include_key(line):
'''Mark directories with a leading space so directories
are sorted before files'''
match = include_re.match(line)
assert match, line
keyword = match.group(2)
include = match.group(3)
# Everything but the file part needs to have a space prepended
parts = include.s... | [
"def",
"include_key",
"(",
"line",
")",
":",
"match",
"=",
"include_re",
".",
"match",
"(",
"line",
")",
"assert",
"match",
",",
"line",
"keyword",
"=",
"match",
".",
"group",
"(",
"2",
")",
"include",
"=",
"match",
".",
"group",
"(",
"3",
")",
"# ... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/style/sort_includes.py#L68-L88 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py | python | OrderedSet.copy | (self) | return self.__class__(self) | Return a shallow copy of this object.
Example:
>>> this = OrderedSet([1, 2, 3])
>>> other = this.copy()
>>> this == other
True
>>> this is other
False | Return a shallow copy of this object. | [
"Return",
"a",
"shallow",
"copy",
"of",
"this",
"object",
"."
] | def copy(self):
"""
Return a shallow copy of this object.
Example:
>>> this = OrderedSet([1, 2, 3])
>>> other = this.copy()
>>> this == other
True
>>> this is other
False
"""
return self.__class__(self) | [
"def",
"copy",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py#L101-L113 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/TaskGen.py | python | task_gen.clone | (self, env) | return newobj | Makes a copy of a task generator. Once the copy is made, it is necessary to ensure that the
it does not create the same output files as the original, or the same files may
be compiled several times.
:param env: A configuration set
:type env: :py:class:`waflib.ConfigSet.ConfigSet`
:return: A copy
:rtype: :p... | Makes a copy of a task generator. Once the copy is made, it is necessary to ensure that the
it does not create the same output files as the original, or the same files may
be compiled several times. | [
"Makes",
"a",
"copy",
"of",
"a",
"task",
"generator",
".",
"Once",
"the",
"copy",
"is",
"made",
"it",
"is",
"necessary",
"to",
"ensure",
"that",
"the",
"it",
"does",
"not",
"create",
"the",
"same",
"output",
"files",
"as",
"the",
"original",
"or",
"the... | def clone(self, env):
"""
Makes a copy of a task generator. Once the copy is made, it is necessary to ensure that the
it does not create the same output files as the original, or the same files may
be compiled several times.
:param env: A configuration set
:type env: :py:class:`waflib.ConfigSet.ConfigSet`
... | [
"def",
"clone",
"(",
"self",
",",
"env",
")",
":",
"newobj",
"=",
"self",
".",
"bld",
"(",
")",
"for",
"x",
"in",
"self",
".",
"__dict__",
":",
"if",
"x",
"in",
"(",
"'env'",
",",
"'bld'",
")",
":",
"continue",
"elif",
"x",
"in",
"(",
"'path'",... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/TaskGen.py#L287-L313 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListCtrl.GetItemBackgroundColour | (*args, **kwargs) | return _gizmos.TreeListCtrl_GetItemBackgroundColour(*args, **kwargs) | GetItemBackgroundColour(self, TreeItemId item) -> Colour | GetItemBackgroundColour(self, TreeItemId item) -> Colour | [
"GetItemBackgroundColour",
"(",
"self",
"TreeItemId",
"item",
")",
"-",
">",
"Colour"
] | def GetItemBackgroundColour(*args, **kwargs):
"""GetItemBackgroundColour(self, TreeItemId item) -> Colour"""
return _gizmos.TreeListCtrl_GetItemBackgroundColour(*args, **kwargs) | [
"def",
"GetItemBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_GetItemBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L693-L695 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUNGraph.EndNI | (self) | return _snap.TUNGraph_EndNI(self) | EndNI(TUNGraph self) -> TUNGraph::TNodeI
Parameters:
self: TUNGraph const * | EndNI(TUNGraph self) -> TUNGraph::TNodeI | [
"EndNI",
"(",
"TUNGraph",
"self",
")",
"-",
">",
"TUNGraph",
"::",
"TNodeI"
] | def EndNI(self):
"""
EndNI(TUNGraph self) -> TUNGraph::TNodeI
Parameters:
self: TUNGraph const *
"""
return _snap.TUNGraph_EndNI(self) | [
"def",
"EndNI",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TUNGraph_EndNI",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L3551-L3559 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/timeline/model.py | python | TimelineModel.IterGlobalMemoryDumps | (self) | return iter(self._global_memory_dumps or []) | Iterate over the memory dump events of this model. | Iterate over the memory dump events of this model. | [
"Iterate",
"over",
"the",
"memory",
"dump",
"events",
"of",
"this",
"model",
"."
] | def IterGlobalMemoryDumps(self):
"""Iterate over the memory dump events of this model."""
return iter(self._global_memory_dumps or []) | [
"def",
"IterGlobalMemoryDumps",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"_global_memory_dumps",
"or",
"[",
"]",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/timeline/model.py#L84-L86 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_message.py | python | Message.delivery_count | (self) | return pn_message_get_delivery_count(self._msg) | The number of delivery attempts made for this message.
:raise: :exc:`MessageException` if there is any Proton error when using the setter. | The number of delivery attempts made for this message. | [
"The",
"number",
"of",
"delivery",
"attempts",
"made",
"for",
"this",
"message",
"."
] | def delivery_count(self) -> int:
"""The number of delivery attempts made for this message.
:raise: :exc:`MessageException` if there is any Proton error when using the setter.
"""
return pn_message_get_delivery_count(self._msg) | [
"def",
"delivery_count",
"(",
"self",
")",
"->",
"int",
":",
"return",
"pn_message_get_delivery_count",
"(",
"self",
".",
"_msg",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_message.py#L250-L255 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/instrument.py | python | Instrument.sell_leg | (self) | return self._sell_leg | Gets the sell_leg of this Instrument. # noqa: E501
:return: The sell_leg of this Instrument. # noqa: E501
:rtype: str | Gets the sell_leg of this Instrument. # noqa: E501 | [
"Gets",
"the",
"sell_leg",
"of",
"this",
"Instrument",
".",
"#",
"noqa",
":",
"E501"
] | def sell_leg(self):
"""Gets the sell_leg of this Instrument. # noqa: E501
:return: The sell_leg of this Instrument. # noqa: E501
:rtype: str
"""
return self._sell_leg | [
"def",
"sell_leg",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sell_leg"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L772-L779 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | python/caffe/io.py | python | resize_image | (im, new_dims, interp_order=1) | return resized_im.astype(np.float32) | Resize an image array with interpolation.
Parameters
----------
im : (H x W x K) ndarray
new_dims : (height, width) tuple of new dimensions.
interp_order : interpolation order, default is linear.
Returns
-------
im : resized ndarray with shape (new_dims[0], new_dims[1], K) | Resize an image array with interpolation. | [
"Resize",
"an",
"image",
"array",
"with",
"interpolation",
"."
] | def resize_image(im, new_dims, interp_order=1):
"""
Resize an image array with interpolation.
Parameters
----------
im : (H x W x K) ndarray
new_dims : (height, width) tuple of new dimensions.
interp_order : interpolation order, default is linear.
Returns
-------
im : resized n... | [
"def",
"resize_image",
"(",
"im",
",",
"new_dims",
",",
"interp_order",
"=",
"1",
")",
":",
"if",
"im",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"1",
"or",
"im",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"3",
":",
"im_min",
",",
"im_max",
"=",
"... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/python/caffe/io.py#L306-L338 | |
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | lib/fast_rcnn/train.py | python | filter_roidb | (roidb) | return filtered_roidb | Remove roidb entries that have no usable RoIs. | Remove roidb entries that have no usable RoIs. | [
"Remove",
"roidb",
"entries",
"that",
"have",
"no",
"usable",
"RoIs",
"."
] | def filter_roidb(roidb):
"""Remove roidb entries that have no usable RoIs."""
def is_valid(entry):
# Valid images have:
# (1) At least one foreground RoI OR
# (2) At least one background RoI
overlaps = entry['max_overlaps']
# find boxes with sufficient overlap
... | [
"def",
"filter_roidb",
"(",
"roidb",
")",
":",
"def",
"is_valid",
"(",
"entry",
")",
":",
"# Valid images have:",
"# (1) At least one foreground RoI OR",
"# (2) At least one background RoI",
"overlaps",
"=",
"entry",
"[",
"'max_overlaps'",
"]",
"# find boxes with suffic... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/lib/fast_rcnn/train.py#L127-L149 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/targets.py | python | TargetRegistry.create_typed_target | (self, type, project, name, sources, requirements, default_build, usage_requirements) | return self.main_target_alternative (TypedTarget (name, project, type,
self.main_target_sources (sources, name),
self.main_target_requirements (requirements, project),
self.main_target_default_build (default_build, project),
self.main_target_usage_requirements (usage_requ... | Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
by the user in Jamfile corresponding to 'project'. | Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
by the user in Jamfile corresponding to 'project'. | [
"Creates",
"a",
"TypedTarget",
"with",
"the",
"specified",
"properties",
".",
"The",
"name",
"sources",
"requirements",
"default_build",
"and",
"usage_requirements",
"are",
"assumed",
"to",
"be",
"in",
"the",
"form",
"specified",
"by",
"the",
"user",
"in",
"Jamf... | def create_typed_target (self, type, project, name, sources, requirements, default_build, usage_requirements):
""" Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
... | [
"def",
"create_typed_target",
"(",
"self",
",",
"type",
",",
"project",
",",
"name",
",",
"sources",
",",
"requirements",
",",
"default_build",
",",
"usage_requirements",
")",
":",
"return",
"self",
".",
"main_target_alternative",
"(",
"TypedTarget",
"(",
"name"... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/targets.py#L208-L218 | |
h2oai/datatable | 753197c3f76041dd6468e0f6a9708af92d80f6aa | ci/xbuild/extension.py | python | Extension._scan_files | (self) | Parse all <modified> files and determine their set of
includes. As each file is scanned, its <modified> flag is
cleared. At the same time, we recursively scan all includes
from all modified files, ensuring that full dependency tree
is known.
The final effect of this method is th... | Parse all <modified> files and determine their set of
includes. As each file is scanned, its <modified> flag is
cleared. At the same time, we recursively scan all includes
from all modified files, ensuring that full dependency tree
is known. | [
"Parse",
"all",
"<modified",
">",
"files",
"and",
"determine",
"their",
"set",
"of",
"includes",
".",
"As",
"each",
"file",
"is",
"scanned",
"its",
"<modified",
">",
"flag",
"is",
"cleared",
".",
"At",
"the",
"same",
"time",
"we",
"recursively",
"scan",
... | def _scan_files(self):
"""
Parse all <modified> files and determine their set of
includes. As each file is scanned, its <modified> flag is
cleared. At the same time, we recursively scan all includes
from all modified files, ensuring that full dependency tree
is known.
... | [
"def",
"_scan_files",
"(",
"self",
")",
":",
"self",
".",
"log",
".",
"step_scan_files",
"(",
"sum",
"(",
"self",
".",
"_files_modified",
".",
"values",
"(",
")",
")",
")",
"while",
"any",
"(",
"self",
".",
"_files_modified",
".",
"values",
"(",
")",
... | https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/ci/xbuild/extension.py#L551-L577 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr.__iadd__ | (self, *args) | return _snap.TStr___iadd__(self, *args) | __iadd__(TStr self, TStr Str) -> TStr
Parameters:
Str: TStr const &
__iadd__(TStr self, char const * CStr) -> TStr
Parameters:
CStr: char const * | __iadd__(TStr self, TStr Str) -> TStr | [
"__iadd__",
"(",
"TStr",
"self",
"TStr",
"Str",
")",
"-",
">",
"TStr"
] | def __iadd__(self, *args):
"""
__iadd__(TStr self, TStr Str) -> TStr
Parameters:
Str: TStr const &
__iadd__(TStr self, char const * CStr) -> TStr
Parameters:
CStr: char const *
"""
return _snap.TStr___iadd__(self, *args) | [
"def",
"__iadd__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStr___iadd__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9571-L9584 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py | python | _AddConfigurationToMSVS | (p, spec, tools, config, config_type, config_name) | Add to the project file the configuration specified by config.
Arguments:
p: The target project being generated.
spec: the target project dict.
tools: A dictionnary of settings; the tool name is the key.
config: The dictionnary that defines the special processing to be done
for this confi... | Add to the project file the configuration specified by config. | [
"Add",
"to",
"the",
"project",
"file",
"the",
"configuration",
"specified",
"by",
"config",
"."
] | def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):
"""Add to the project file the configuration specified by config.
Arguments:
p: The target project being generated.
spec: the target project dict.
tools: A dictionnary of settings; the tool name is the key.
config: The d... | [
"def",
"_AddConfigurationToMSVS",
"(",
"p",
",",
"spec",
",",
"tools",
",",
"config",
",",
"config_type",
",",
"config_name",
")",
":",
"attributes",
"=",
"_GetMSVSAttributes",
"(",
"spec",
",",
"config",
",",
"config_type",
")",
"# Add in this configuration.",
... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L1234-L1250 | ||
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py | python | NotEmacsMode.accept_line | (self, e) | return True | Accept the line regardless of where the cursor is. If this line
is non-empty, it may be added to the history list for future recall
with add_history(). If this line is a modified history line, the
history line is restored to its original state. | Accept the line regardless of where the cursor is. If this line
is non-empty, it may be added to the history list for future recall
with add_history(). If this line is a modified history line, the
history line is restored to its original state. | [
"Accept",
"the",
"line",
"regardless",
"of",
"where",
"the",
"cursor",
"is",
".",
"If",
"this",
"line",
"is",
"non",
"-",
"empty",
"it",
"may",
"be",
"added",
"to",
"the",
"history",
"list",
"for",
"future",
"recall",
"with",
"add_history",
"()",
".",
... | def accept_line(self, e): # (Newline or Return)
'''Accept the line regardless of where the cursor is. If this line
is non-empty, it may be added to the history list for future recall
with add_history(). If this line is a modified history line, the
history line is restored to its origina... | [
"def",
"accept_line",
"(",
"self",
",",
"e",
")",
":",
"# (Newline or Return)",
"return",
"True"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py#L133-L138 | |
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/projector.py | python | projection_geometry | (i) | return p.projection_geometry(i) | Get projection geometry of a projector.
:param i: ID of projector.
:type i: :class:`int`
:returns: :class:`dict` -- projection geometry | Get projection geometry of a projector. | [
"Get",
"projection",
"geometry",
"of",
"a",
"projector",
"."
] | def projection_geometry(i):
"""Get projection geometry of a projector.
:param i: ID of projector.
:type i: :class:`int`
:returns: :class:`dict` -- projection geometry
"""
return p.projection_geometry(i) | [
"def",
"projection_geometry",
"(",
"i",
")",
":",
"return",
"p",
".",
"projection_geometry",
"(",
"i",
")"
] | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/projector.py#L58-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py | python | Set._hash | (self) | return h | Compute the hash value of a set.
Note that we don't define __hash__: not all sets are hashable.
But if you define a hashable set type, its __hash__ should
call this function.
This must be compatible __eq__.
All sets ought to compare equal if they contain the same
eleme... | Compute the hash value of a set. | [
"Compute",
"the",
"hash",
"value",
"of",
"a",
"set",
"."
] | def _hash(self):
"""Compute the hash value of a set.
Note that we don't define __hash__: not all sets are hashable.
But if you define a hashable set type, its __hash__ should
call this function.
This must be compatible __eq__.
All sets ought to compare equal if they co... | [
"def",
"_hash",
"(",
"self",
")",
":",
"MAX",
"=",
"sys",
".",
"maxsize",
"MASK",
"=",
"2",
"*",
"MAX",
"+",
"1",
"n",
"=",
"len",
"(",
"self",
")",
"h",
"=",
"1927868237",
"*",
"(",
"n",
"+",
"1",
")",
"h",
"&=",
"MASK",
"for",
"x",
"in",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py#L521-L551 | |
gaoxiang12/ORBSLAM2_with_pointcloud_map | cf94d66a9e4253abd66398c7ef461a7a903efffe | ORB_SLAM2_modified/Examples/ROS/ORB_SLAM2/build/catkin_generated/installspace/_setup_util.py | python | _prefix_env_variable | (environ, name, paths, subfolders) | return prefix_str | Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. | Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. | [
"Return",
"the",
"prefix",
"to",
"prepend",
"to",
"the",
"environment",
"variable",
"NAME",
"adding",
"any",
"path",
"in",
"NEW_PATHS_STR",
"without",
"creating",
"duplicate",
"or",
"empty",
"items",
"."
] | def _prefix_env_variable(environ, name, paths, subfolders):
'''
Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items.
'''
value = environ[name] if name in environ else ''
environ_paths = [path for path in value.spli... | [
"def",
"_prefix_env_variable",
"(",
"environ",
",",
"name",
",",
"paths",
",",
"subfolders",
")",
":",
"value",
"=",
"environ",
"[",
"name",
"]",
"if",
"name",
"in",
"environ",
"else",
"''",
"environ_paths",
"=",
"[",
"path",
"for",
"path",
"in",
"value"... | https://github.com/gaoxiang12/ORBSLAM2_with_pointcloud_map/blob/cf94d66a9e4253abd66398c7ef461a7a903efffe/ORB_SLAM2_modified/Examples/ROS/ORB_SLAM2/build/catkin_generated/installspace/_setup_util.py#L149-L172 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/docs/utils.py | python | get_resource_ignore_params | (params) | return ignore_params | Helper method to determine which parameters to ignore for actions
:returns: A list of the parameter names that does not need to be
included in a resource's method call for documentation purposes. | Helper method to determine which parameters to ignore for actions | [
"Helper",
"method",
"to",
"determine",
"which",
"parameters",
"to",
"ignore",
"for",
"actions"
] | def get_resource_ignore_params(params):
"""Helper method to determine which parameters to ignore for actions
:returns: A list of the parameter names that does not need to be
included in a resource's method call for documentation purposes.
"""
ignore_params = []
for param in params:
... | [
"def",
"get_resource_ignore_params",
"(",
"params",
")",
":",
"ignore_params",
"=",
"[",
"]",
"for",
"param",
"in",
"params",
":",
"result",
"=",
"jmespath",
".",
"compile",
"(",
"param",
".",
"target",
")",
"current",
"=",
"result",
".",
"parsed",
"# Use ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/docs/utils.py#L20-L38 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/deviceufunc.py | python | UFuncMechanism.to_host | (self, devary, stream) | Implement to host transfer
Override in subclass | Implement to host transfer
Override in subclass | [
"Implement",
"to",
"host",
"transfer",
"Override",
"in",
"subclass"
] | def to_host(self, devary, stream):
"""Implement to host transfer
Override in subclass
"""
raise NotImplementedError | [
"def",
"to_host",
"(",
"self",
",",
"devary",
",",
"stream",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/deviceufunc.py#L340-L344 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/appengine.py | python | OAuth2Decorator.authorize_url | (self) | return str(url) | Returns the URL to start the OAuth dance.
Must only be called from with a webapp.RequestHandler subclassed method
that had been decorated with either @oauth_required or @oauth_aware. | Returns the URL to start the OAuth dance. | [
"Returns",
"the",
"URL",
"to",
"start",
"the",
"OAuth",
"dance",
"."
] | def authorize_url(self):
"""Returns the URL to start the OAuth dance.
Must only be called from with a webapp.RequestHandler subclassed method
that had been decorated with either @oauth_required or @oauth_aware.
"""
url = self.flow.step1_get_authorize_url()
return str(url) | [
"def",
"authorize_url",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"flow",
".",
"step1_get_authorize_url",
"(",
")",
"return",
"str",
"(",
"url",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/appengine.py#L809-L816 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | utils/vim-lldb/python-vim-lldb/vim_panes.py | python | VimPane.create | (self, method) | create window | create window | [
"create",
"window"
] | def create(self, method):
""" create window """
if method != 'edit':
belowcmd = "below" if self.openBelow else ""
vim.command('silent %s %s %s' % (belowcmd, method, self.name))
else:
vim.command('silent %s %s' % (method, self.name))
self.window = vim... | [
"def",
"create",
"(",
"self",
",",
"method",
")",
":",
"if",
"method",
"!=",
"'edit'",
":",
"belowcmd",
"=",
"\"below\"",
"if",
"self",
".",
"openBelow",
"else",
"\"\"",
"vim",
".",
"command",
"(",
"'silent %s %s %s'",
"%",
"(",
"belowcmd",
",",
"method"... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/vim_panes.py#L274-L297 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | EntryProxy.__get_base_path | (self) | return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],
entry.name + "_base") | Return the file's directory and file name, with the
suffix stripped. | Return the file's directory and file name, with the
suffix stripped. | [
"Return",
"the",
"file",
"s",
"directory",
"and",
"file",
"name",
"with",
"the",
"suffix",
"stripped",
"."
] | def __get_base_path(self):
"""Return the file's directory and file name, with the
suffix stripped."""
entry = self.get()
return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],
entry.name + "_base") | [
"def",
"__get_base_path",
"(",
"self",
")",
":",
"entry",
"=",
"self",
".",
"get",
"(",
")",
"return",
"SCons",
".",
"Subst",
".",
"SpecialAttrWrapper",
"(",
"SCons",
".",
"Util",
".",
"splitext",
"(",
"entry",
".",
"get_path",
"(",
")",
")",
"[",
"0... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L459-L464 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py | python | ifloordiv | (a, b) | return a | Same as a //= b. | Same as a //= b. | [
"Same",
"as",
"a",
"//",
"=",
"b",
"."
] | def ifloordiv(a, b):
"Same as a //= b."
a //= b
return a | [
"def",
"ifloordiv",
"(",
"a",
",",
"b",
")",
":",
"a",
"//=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py#L355-L358 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/mpi_collectives/mpi_ops.py | python | _allreduce | (tensor, name=None) | return MPI_LIB.mpi_allreduce(tensor, name=name) | An op which sums an input tensor over all the MPI processes.
The reduction operation is keyed by the name of the op. The tensor type and
shape must be the same on all MPI processes for a given name. The reduction
will not start until all processes are ready to send and receive the tensor.
Returns:
A tenso... | An op which sums an input tensor over all the MPI processes. | [
"An",
"op",
"which",
"sums",
"an",
"input",
"tensor",
"over",
"all",
"the",
"MPI",
"processes",
"."
] | def _allreduce(tensor, name=None):
"""An op which sums an input tensor over all the MPI processes.
The reduction operation is keyed by the name of the op. The tensor type and
shape must be the same on all MPI processes for a given name. The reduction
will not start until all processes are ready to send and rec... | [
"def",
"_allreduce",
"(",
"tensor",
",",
"name",
"=",
"None",
")",
":",
"return",
"MPI_LIB",
".",
"mpi_allreduce",
"(",
"tensor",
",",
"name",
"=",
"name",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/mpi_collectives/mpi_ops.py#L121-L132 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py | python | Folder.setlast | (self, last) | Set the last message number. | Set the last message number. | [
"Set",
"the",
"last",
"message",
"number",
"."
] | def setlast(self, last):
"""Set the last message number."""
if last is None:
if hasattr(self, 'last'):
del self.last
else:
self.last = last | [
"def",
"setlast",
"(",
"self",
",",
"last",
")",
":",
"if",
"last",
"is",
"None",
":",
"if",
"hasattr",
"(",
"self",
",",
"'last'",
")",
":",
"del",
"self",
".",
"last",
"else",
":",
"self",
".",
"last",
"=",
"last"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py#L655-L661 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | ppapi/generators/idl_parser.py | python | IDLParser.p_interface_list | (self, p) | interface_list : member_function ';' interface_list
| | interface_list : member_function ';' interface_list
| | [
"interface_list",
":",
"member_function",
";",
"interface_list",
"|"
] | def p_interface_list(self, p):
"""interface_list : member_function ';' interface_list
| """
if len(p) > 1 :
p[0] = ListFromConcat(p[1], p[3])
if self.parse_debug: DumpReduction('interface_list', p) | [
"def",
"p_interface_list",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
">",
"1",
":",
"p",
"[",
"0",
"]",
"=",
"ListFromConcat",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"3",
"]",
")",
"if",
"self",
".",
"parse_debug",
":",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_parser.py#L714-L719 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib2to3/refactor.py | python | RefactoringTool._read_python_source | (self, filename) | Do our best to decode a Python source file correctly. | Do our best to decode a Python source file correctly. | [
"Do",
"our",
"best",
"to",
"decode",
"a",
"Python",
"source",
"file",
"correctly",
"."
] | def _read_python_source(self, filename):
"""
Do our best to decode a Python source file correctly.
"""
try:
f = open(filename, "rb")
except IOError as err:
self.log_error("Can't open %s: %s", filename, err)
return None, None
try:
... | [
"def",
"_read_python_source",
"(",
"self",
",",
"filename",
")",
":",
"try",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"\"rb\"",
")",
"except",
"IOError",
"as",
"err",
":",
"self",
".",
"log_error",
"(",
"\"Can't open %s: %s\"",
",",
"filename",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/refactor.py#L323-L337 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | left_shift | (a, n) | Shift the bits of an integer to the left.
This is the masked array version of `numpy.left_shift`, for details
see that function.
See Also
--------
numpy.left_shift | Shift the bits of an integer to the left. | [
"Shift",
"the",
"bits",
"of",
"an",
"integer",
"to",
"the",
"left",
"."
] | def left_shift(a, n):
"""
Shift the bits of an integer to the left.
This is the masked array version of `numpy.left_shift`, for details
see that function.
See Also
--------
numpy.left_shift
"""
m = getmask(a)
if m is nomask:
d = umath.left_shift(filled(a), n)
r... | [
"def",
"left_shift",
"(",
"a",
",",
"n",
")",
":",
"m",
"=",
"getmask",
"(",
"a",
")",
"if",
"m",
"is",
"nomask",
":",
"d",
"=",
"umath",
".",
"left_shift",
"(",
"filled",
"(",
"a",
")",
",",
"n",
")",
"return",
"masked_array",
"(",
"d",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L6905-L6923 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.votes | (self, issue) | return self._find_for_resource(Votes, issue) | Get a votes Resource from the server.
:param issue: ID or key of the issue to get the votes for | Get a votes Resource from the server. | [
"Get",
"a",
"votes",
"Resource",
"from",
"the",
"server",
"."
] | def votes(self, issue):
"""Get a votes Resource from the server.
:param issue: ID or key of the issue to get the votes for
"""
return self._find_for_resource(Votes, issue) | [
"def",
"votes",
"(",
"self",
",",
"issue",
")",
":",
"return",
"self",
".",
"_find_for_resource",
"(",
"Votes",
",",
"issue",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L1564-L1569 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/compiler/pycodegen.py | python | CodeGenerator.checkClass | (self) | Verify that class is constructed correctly | Verify that class is constructed correctly | [
"Verify",
"that",
"class",
"is",
"constructed",
"correctly"
] | def checkClass(self):
"""Verify that class is constructed correctly"""
try:
assert hasattr(self, 'graph')
assert getattr(self, 'NameFinder')
assert getattr(self, 'FunctionGen')
assert getattr(self, 'ClassGen')
except AssertionError, msg:
... | [
"def",
"checkClass",
"(",
"self",
")",
":",
"try",
":",
"assert",
"hasattr",
"(",
"self",
",",
"'graph'",
")",
"assert",
"getattr",
"(",
"self",
",",
"'NameFinder'",
")",
"assert",
"getattr",
"(",
"self",
",",
"'FunctionGen'",
")",
"assert",
"getattr",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/compiler/pycodegen.py#L227-L236 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteTarget | (self, spec, configs, deps, link_deps, bundle_deps,
extra_outputs, part_of_all) | Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
extra_outputs: any extra outputs that our target should depend on
part_of_all: flag indicating this target is part of 'all' | Write Makefile code to produce the final target of the gyp spec. | [
"Write",
"Makefile",
"code",
"to",
"produce",
"the",
"final",
"target",
"of",
"the",
"gyp",
"spec",
"."
] | def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
extra_outputs, part_of_all):
"""Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
extra_outputs: any extra outputs that... | [
"def",
"WriteTarget",
"(",
"self",
",",
"spec",
",",
"configs",
",",
"deps",
",",
"link_deps",
",",
"bundle_deps",
",",
"extra_outputs",
",",
"part_of_all",
")",
":",
"self",
".",
"WriteLn",
"(",
"'### Rules for final target.'",
")",
"if",
"extra_outputs",
":"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1457-L1690 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/model_helper.py | python | ModelHelper._Validate | (self) | return dupes | Check for duplicate params | Check for duplicate params | [
"Check",
"for",
"duplicate",
"params"
] | def _Validate(self):
'''
Check for duplicate params
'''
params_list = [str(p) for p in self.params]
params_set = set(params_list)
dupes = []
if len(params_set) != len(params_list):
params_list = sorted(params_list)
for j, p in enumerate(pa... | [
"def",
"_Validate",
"(",
"self",
")",
":",
"params_list",
"=",
"[",
"str",
"(",
"p",
")",
"for",
"p",
"in",
"self",
".",
"params",
"]",
"params_set",
"=",
"set",
"(",
"params_list",
")",
"dupes",
"=",
"[",
"]",
"if",
"len",
"(",
"params_set",
")",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/model_helper.py#L370-L385 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/rfcn/lib/datasets/voc_eval.py | python | parse_rec | (filename) | return objects | Parse a PASCAL VOC xml file | Parse a PASCAL VOC xml file | [
"Parse",
"a",
"PASCAL",
"VOC",
"xml",
"file"
] | def parse_rec(filename):
""" Parse a PASCAL VOC xml file """
tree = ET.parse(filename)
objects = []
for obj in tree.findall('object'):
obj_struct = {}
obj_struct['name'] = obj.find('name').text
obj_struct['pose'] = obj.find('pose').text
obj_struct['truncated'] = int(obj.f... | [
"def",
"parse_rec",
"(",
"filename",
")",
":",
"tree",
"=",
"ET",
".",
"parse",
"(",
"filename",
")",
"objects",
"=",
"[",
"]",
"for",
"obj",
"in",
"tree",
".",
"findall",
"(",
"'object'",
")",
":",
"obj_struct",
"=",
"{",
"}",
"obj_struct",
"[",
"... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/datasets/voc_eval.py#L12-L29 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_pydecimal.py | python | Decimal.__hash__ | (self) | return -2 if ans == -1 else ans | x.__hash__() <==> hash(x) | x.__hash__() <==> hash(x) | [
"x",
".",
"__hash__",
"()",
"<",
"==",
">",
"hash",
"(",
"x",
")"
] | def __hash__(self):
"""x.__hash__() <==> hash(x)"""
# In order to make sure that the hash of a Decimal instance
# agrees with the hash of a numerically equal integer, float
# or Fraction, we follow the rules for numeric hashes outlined
# in the documentation. (See library docs,... | [
"def",
"__hash__",
"(",
"self",
")",
":",
"# In order to make sure that the hash of a Decimal instance",
"# agrees with the hash of a numerically equal integer, float",
"# or Fraction, we follow the rules for numeric hashes outlined",
"# in the documentation. (See library docs, 'Built-in Types').... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L943-L967 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/one_shot_object_detector/one_shot_object_detector.py | python | OneShotObjectDetector.summary | (self, output=None) | Print a summary of the model. The summary includes a description of
training data, options, hyper-parameters, and statistics measured
during model creation.
Parameters
----------
output : str, None
The type of summary to return.
- None or 'stdout' : prin... | Print a summary of the model. The summary includes a description of
training data, options, hyper-parameters, and statistics measured
during model creation. | [
"Print",
"a",
"summary",
"of",
"the",
"model",
".",
"The",
"summary",
"includes",
"a",
"description",
"of",
"training",
"data",
"options",
"hyper",
"-",
"parameters",
"and",
"statistics",
"measured",
"during",
"model",
"creation",
"."
] | def summary(self, output=None):
"""
Print a summary of the model. The summary includes a description of
training data, options, hyper-parameters, and statistics measured
during model creation.
Parameters
----------
output : str, None
The type of summa... | [
"def",
"summary",
"(",
"self",
",",
"output",
"=",
"None",
")",
":",
"from",
"turicreate",
".",
"toolkits",
".",
"_internal_utils",
"import",
"(",
"_toolkit_serialize_summary_struct",
",",
")",
"if",
"output",
"is",
"None",
"or",
"output",
"==",
"\"stdout\"",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/one_shot_object_detector/one_shot_object_detector.py#L313-L351 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/internal/decoder.py | python | _SkipVarint | (buffer, pos, end) | return pos | Skip a varint value. Returns the new position. | Skip a varint value. Returns the new position. | [
"Skip",
"a",
"varint",
"value",
".",
"Returns",
"the",
"new",
"position",
"."
] | def _SkipVarint(buffer, pos, end):
"""Skip a varint value. Returns the new position."""
while ord(buffer[pos]) & 0x80:
pos += 1
pos += 1
if pos > end:
raise _DecodeError('Truncated message.')
return pos | [
"def",
"_SkipVarint",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"while",
"ord",
"(",
"buffer",
"[",
"pos",
"]",
")",
"&",
"0x80",
":",
"pos",
"+=",
"1",
"pos",
"+=",
"1",
"if",
"pos",
">",
"end",
":",
"raise",
"_DecodeError",
"(",
"'Trunca... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/decoder.py#L632-L640 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/keras_tensor.py | python | KerasTensor.from_tensor | (cls, tensor) | Convert a traced (composite)tensor to a representative KerasTensor. | Convert a traced (composite)tensor to a representative KerasTensor. | [
"Convert",
"a",
"traced",
"(",
"composite",
")",
"tensor",
"to",
"a",
"representative",
"KerasTensor",
"."
] | def from_tensor(cls, tensor):
"""Convert a traced (composite)tensor to a representative KerasTensor."""
if isinstance(tensor, ops.Tensor):
name = getattr(tensor, 'name', None)
type_spec = type_spec_module.type_spec_from_value(tensor)
inferred_value = None
if (type_spec.dtype == dtypes.in... | [
"def",
"from_tensor",
"(",
"cls",
",",
"tensor",
")",
":",
"if",
"isinstance",
"(",
"tensor",
",",
"ops",
".",
"Tensor",
")",
":",
"name",
"=",
"getattr",
"(",
"tensor",
",",
"'name'",
",",
"None",
")",
"type_spec",
"=",
"type_spec_module",
".",
"type_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/keras_tensor.py#L144-L183 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | RadioBox.GetColumnCount | (*args, **kwargs) | return _controls_.RadioBox_GetColumnCount(*args, **kwargs) | GetColumnCount(self) -> unsigned int | GetColumnCount(self) -> unsigned int | [
"GetColumnCount",
"(",
"self",
")",
"-",
">",
"unsigned",
"int"
] | def GetColumnCount(*args, **kwargs):
"""GetColumnCount(self) -> unsigned int"""
return _controls_.RadioBox_GetColumnCount(*args, **kwargs) | [
"def",
"GetColumnCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_GetColumnCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2645-L2647 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | syzygy/scripts/benchmark/ibmperf.py | python | IbmPerfTool._Popen | (self, cmd_line) | return subprocess.Popen(cmd_line,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=self._ibmperf_dir) | Creates a subprocess.Popen object for the given command-line.
Separated for easy injection of results in unittests.
Args:
cmd_line: The command line to execute, with the executable and each
argument as a separate entry in a list.
Returns:
An instance of subprocess.Popen for the give... | Creates a subprocess.Popen object for the given command-line. | [
"Creates",
"a",
"subprocess",
".",
"Popen",
"object",
"for",
"the",
"given",
"command",
"-",
"line",
"."
] | def _Popen(self, cmd_line):
"""Creates a subprocess.Popen object for the given command-line.
Separated for easy injection of results in unittests.
Args:
cmd_line: The command line to execute, with the executable and each
argument as a separate entry in a list.
Returns:
An instan... | [
"def",
"_Popen",
"(",
"self",
",",
"cmd_line",
")",
":",
"return",
"subprocess",
".",
"Popen",
"(",
"cmd_line",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIPE",
",",
"cwd",
"=",
"self",
".",
"_ibmperf_dir",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/scripts/benchmark/ibmperf.py#L110-L125 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/util/nest.py | python | yield_flat_paths | (nest, expand_composites=False) | Yields paths for some nested structure.
Refer to [tf.nest](https://www.tensorflow.org/api_docs/python/tf/nest)
for the definition of a structure.
Paths are lists of objects which can be str-converted, which may include
integers or other types which are used as indices in a dict.
The flat list will be in th... | Yields paths for some nested structure. | [
"Yields",
"paths",
"for",
"some",
"nested",
"structure",
"."
] | def yield_flat_paths(nest, expand_composites=False):
"""Yields paths for some nested structure.
Refer to [tf.nest](https://www.tensorflow.org/api_docs/python/tf/nest)
for the definition of a structure.
Paths are lists of objects which can be str-converted, which may include
integers or other types which are... | [
"def",
"yield_flat_paths",
"(",
"nest",
",",
"expand_composites",
"=",
"False",
")",
":",
"is_nested_fn",
"=",
"_is_nested_or_composite",
"if",
"expand_composites",
"else",
"_is_nested",
"for",
"k",
",",
"_",
"in",
"_yield_flat_up_to",
"(",
"nest",
",",
"nest",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/nest.py#L1604-L1645 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/powercycle/lib/services.py | python | PosixService.stop | (self, timeout) | return 0, None | Crash the posix process process. Empty "pids" to signal to `status` the process was terminated. Returns (code, output) tuple. | Crash the posix process process. Empty "pids" to signal to `status` the process was terminated. Returns (code, output) tuple. | [
"Crash",
"the",
"posix",
"process",
"process",
".",
"Empty",
"pids",
"to",
"signal",
"to",
"status",
"the",
"process",
"was",
"terminated",
".",
"Returns",
"(",
"code",
"output",
")",
"tuple",
"."
] | def stop(self, timeout): # pylint: disable=unused-argument
"""Crash the posix process process. Empty "pids" to signal to `status` the process was terminated. Returns (code, output) tuple."""
proc = ProcessControl(name=self.bin_name)
proc.kill()
self.pids = []
return 0, None | [
"def",
"stop",
"(",
"self",
",",
"timeout",
")",
":",
"# pylint: disable=unused-argument",
"proc",
"=",
"ProcessControl",
"(",
"name",
"=",
"self",
".",
"bin_name",
")",
"proc",
".",
"kill",
"(",
")",
"self",
".",
"pids",
"=",
"[",
"]",
"return",
"0",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/powercycle/lib/services.py#L215-L220 | |
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/export_fbx_bin.py | python | fbx_data_material_elements | (root, mat, scene_data) | Write the Material data block. | Write the Material data block. | [
"Write",
"the",
"Material",
"data",
"block",
"."
] | def fbx_data_material_elements(root, mat, scene_data):
"""
Write the Material data block.
"""
ambient_color = (0.0, 0.0, 0.0)
if scene_data.data_world:
ambient_color = next(iter(scene_data.data_world.keys())).ambient_color
mat_key, _objs = scene_data.data_materials[mat]
skip_mat = c... | [
"def",
"fbx_data_material_elements",
"(",
"root",
",",
"mat",
",",
"scene_data",
")",
":",
"ambient_color",
"=",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
")",
"if",
"scene_data",
".",
"data_world",
":",
"ambient_color",
"=",
"next",
"(",
"iter",
"(",
"scene_dat... | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/export_fbx_bin.py#L1213-L1277 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_pydecimal.py | python | Context.create_decimal_from_float | (self, f) | return d._fix(self) | Creates a new Decimal instance from a float but rounding using self
as the context.
>>> context = Context(prec=5, rounding=ROUND_DOWN)
>>> context.create_decimal_from_float(3.1415926535897932)
Decimal('3.1415')
>>> context = Context(prec=5, traps=[Inexact])
>>> context.c... | Creates a new Decimal instance from a float but rounding using self
as the context. | [
"Creates",
"a",
"new",
"Decimal",
"instance",
"from",
"a",
"float",
"but",
"rounding",
"using",
"self",
"as",
"the",
"context",
"."
] | def create_decimal_from_float(self, f):
"""Creates a new Decimal instance from a float but rounding using self
as the context.
>>> context = Context(prec=5, rounding=ROUND_DOWN)
>>> context.create_decimal_from_float(3.1415926535897932)
Decimal('3.1415')
>>> context = Con... | [
"def",
"create_decimal_from_float",
"(",
"self",
",",
"f",
")",
":",
"d",
"=",
"Decimal",
".",
"from_float",
"(",
"f",
")",
"# An exact conversion",
"return",
"d",
".",
"_fix",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L4111-L4126 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py | python | GradientBoostedDecisionTreeModel._make_update_bias_stats_fn | (self, ensemble_stamp, predictions, gradients,
bias_stats_accumulator) | return _update_bias_stats | A method to create the function which updates the bias stats. | A method to create the function which updates the bias stats. | [
"A",
"method",
"to",
"create",
"the",
"function",
"which",
"updates",
"the",
"bias",
"stats",
"."
] | def _make_update_bias_stats_fn(self, ensemble_stamp, predictions, gradients,
bias_stats_accumulator):
"""A method to create the function which updates the bias stats."""
def _update_bias_stats():
"""A method to update the bias stats."""
# Get reduced gradients and h... | [
"def",
"_make_update_bias_stats_fn",
"(",
"self",
",",
"ensemble_stamp",
",",
"predictions",
",",
"gradients",
",",
"bias_stats_accumulator",
")",
":",
"def",
"_update_bias_stats",
"(",
")",
":",
"\"\"\"A method to update the bias stats.\"\"\"",
"# Get reduced gradients and h... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py#L876-L900 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/coli.py | python | CommandlineWrapper.processParams | (self, inputs, constants, outputs, context, logConfig) | Process the input parameters and achieve the intended purpose | Process the input parameters and achieve the intended purpose | [
"Process",
"the",
"input",
"parameters",
"and",
"achieve",
"the",
"intended",
"purpose"
] | def processParams(self, inputs, constants, outputs, context, logConfig):
"""Process the input parameters and achieve the intended purpose"""
raise NotImplementedError("processParams must be implemented") | [
"def",
"processParams",
"(",
"self",
",",
"inputs",
",",
"constants",
",",
"outputs",
",",
"context",
",",
"logConfig",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"processParams must be implemented\"",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/coli.py#L250-L252 | ||
ethz-asl/rotors_simulator | cd813b7a8c375d677352aa20ad20047feb661126 | rotors_evaluation/src/rosbag_tools/analyze_bag.py | python | BaseWithTime.slice | (self, start_time, end_time) | return copied_obj | Copy the object and slice it between start_time and end_time. | Copy the object and slice it between start_time and end_time. | [
"Copy",
"the",
"object",
"and",
"slice",
"it",
"between",
"start_time",
"and",
"end_time",
"."
] | def slice(self, start_time, end_time):
"""Copy the object and slice it between start_time and end_time."""
start_index = self.get_next_index(start_time)
end_index = self.get_next_index(end_time)
copied_obj = copy.deepcopy(self)
for key in self.__dict__:
copied_obj.__s... | [
"def",
"slice",
"(",
"self",
",",
"start_time",
",",
"end_time",
")",
":",
"start_index",
"=",
"self",
".",
"get_next_index",
"(",
"start_time",
")",
"end_index",
"=",
"self",
".",
"get_next_index",
"(",
"end_time",
")",
"copied_obj",
"=",
"copy",
".",
"de... | https://github.com/ethz-asl/rotors_simulator/blob/cd813b7a8c375d677352aa20ad20047feb661126/rotors_evaluation/src/rosbag_tools/analyze_bag.py#L37-L45 | |
cyberbotics/webots | af7fa7d68dcf7b4550f1f2e132092b41e83698fc | projects/humans/c3d/controllers/c3d_viewer/c3d.py | python | Param.uint16_value | (self) | return self._as('H') | Get the param as a 16-bit unsigned integer. | Get the param as a 16-bit unsigned integer. | [
"Get",
"the",
"param",
"as",
"a",
"16",
"-",
"bit",
"unsigned",
"integer",
"."
] | def uint16_value(self):
'''Get the param as a 16-bit unsigned integer.'''
return self._as('H') | [
"def",
"uint16_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_as",
"(",
"'H'",
")"
] | https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/projects/humans/c3d/controllers/c3d_viewer/c3d.py#L295-L297 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/cpp_lint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L1167-L1180 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/websocket.py | python | WebSocketProtocol13.compute_accept_value | (key: Union[str, bytes]) | return native_str(base64.b64encode(sha1.digest())) | Computes the value for the Sec-WebSocket-Accept header,
given the value for Sec-WebSocket-Key. | Computes the value for the Sec-WebSocket-Accept header,
given the value for Sec-WebSocket-Key. | [
"Computes",
"the",
"value",
"for",
"the",
"Sec",
"-",
"WebSocket",
"-",
"Accept",
"header",
"given",
"the",
"value",
"for",
"Sec",
"-",
"WebSocket",
"-",
"Key",
"."
] | def compute_accept_value(key: Union[str, bytes]) -> str:
"""Computes the value for the Sec-WebSocket-Accept header,
given the value for Sec-WebSocket-Key.
"""
sha1 = hashlib.sha1()
sha1.update(utf8(key))
sha1.update(b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11") # Magic value
... | [
"def",
"compute_accept_value",
"(",
"key",
":",
"Union",
"[",
"str",
",",
"bytes",
"]",
")",
"->",
"str",
":",
"sha1",
"=",
"hashlib",
".",
"sha1",
"(",
")",
"sha1",
".",
"update",
"(",
"utf8",
"(",
"key",
")",
")",
"sha1",
".",
"update",
"(",
"b... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/websocket.py#L899-L906 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py | python | validate_resampler_func | (method, args, kwargs) | 'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature | 'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature | [
"args",
"and",
"kwargs",
"should",
"be",
"empty",
"because",
"all",
"of",
"their",
"necessary",
"parameters",
"are",
"explicitly",
"listed",
"in",
"the",
"function",
"signature"
] | def validate_resampler_func(method, args, kwargs):
"""
'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature
"""
if len(args) + len(kwargs) > 0:
if method in RESAMPLER_NUMPY_OPS:
raise UnsupportedFunction... | [
"def",
"validate_resampler_func",
"(",
"method",
",",
"args",
",",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
"+",
"len",
"(",
"kwargs",
")",
">",
"0",
":",
"if",
"method",
"in",
"RESAMPLER_NUMPY_OPS",
":",
"raise",
"UnsupportedFunctionCall",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py#L371-L385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.