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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zyq8709/DexHunter | 9d829a9f6f608ebad26923f29a294ae9c68d0441 | art/tools/cpplint.py | python | _IsTestFilename | (filename) | Determines if the given filename has a suffix that identifies it as a test.
Args:
filename: The input filename.
Returns:
True if 'filename' looks like a test, False otherwise. | Determines if the given filename has a suffix that identifies it as a test. | [
"Determines",
"if",
"the",
"given",
"filename",
"has",
"a",
"suffix",
"that",
"identifies",
"it",
"as",
"a",
"test",
"."
] | def _IsTestFilename(filename):
"""Determines if the given filename has a suffix that identifies it as a test.
Args:
filename: The input filename.
Returns:
True if 'filename' looks like a test, False otherwise.
"""
if (filename.endswith('_test.cc') or
filename.endswith('_unittest.cc') or
... | [
"def",
"_IsTestFilename",
"(",
"filename",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"'_test.cc'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'_unittest.cc'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'_regtest.cc'",
")",
")",
":",
"ret... | https://github.com/zyq8709/DexHunter/blob/9d829a9f6f608ebad26923f29a294ae9c68d0441/art/tools/cpplint.py#L2950-L2964 | ||
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/util/vis.py | python | analyze_diff_and_nearby_variants | (
channels: List[np.ndarray]) | return diff_fraction, num_potential_nearby_variants | Analyzes which differences belong to nearby variants and which do not.
This attempts to identify putative nearby variants from the pileup image
alone, and then excludes these columns of the pileup to calculate the
remaining fraction of differences that may be attributed to sequencing errors.
Args:
chann... | Analyzes which differences belong to nearby variants and which do not. | [
"Analyzes",
"which",
"differences",
"belong",
"to",
"nearby",
"variants",
"and",
"which",
"do",
"not",
"."
] | def analyze_diff_and_nearby_variants(
channels: List[np.ndarray]) -> Tuple[float, int]:
"""Analyzes which differences belong to nearby variants and which do not.
This attempts to identify putative nearby variants from the pileup image
alone, and then excludes these columns of the pileup to calculate the
re... | [
"def",
"analyze_diff_and_nearby_variants",
"(",
"channels",
":",
"List",
"[",
"np",
".",
"ndarray",
"]",
")",
"->",
"Tuple",
"[",
"float",
",",
"int",
"]",
":",
"diff_channel",
"=",
"remove_ref_band",
"(",
"channels",
"[",
"5",
"]",
")",
"# Count the number ... | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/vis.py#L737-L776 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_cpp.py | python | add_global | (code) | Adds code to the current global (header) context. | Adds code to the current global (header) context. | [
"Adds",
"code",
"to",
"the",
"current",
"global",
"(",
"header",
")",
"context",
"."
] | def add_global(code):
""" Adds code to the current global (header) context. """
context.globals.write(code) | [
"def",
"add_global",
"(",
"code",
")",
":",
"context",
".",
"globals",
".",
"write",
"(",
"code",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_cpp.py#L111-L113 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | PointCloud.addProperty | (self, *args) | return _robotsim.PointCloud_addProperty(self, *args) | addProperty(PointCloud self, std::string const & pname)
addProperty(PointCloud self, std::string const & pname, doubleVector properties)
Adds a new property with name pname, and sets values for this property to the
given list (a n-list) | addProperty(PointCloud self, std::string const & pname)
addProperty(PointCloud self, std::string const & pname, doubleVector properties) | [
"addProperty",
"(",
"PointCloud",
"self",
"std",
"::",
"string",
"const",
"&",
"pname",
")",
"addProperty",
"(",
"PointCloud",
"self",
"std",
"::",
"string",
"const",
"&",
"pname",
"doubleVector",
"properties",
")"
] | def addProperty(self, *args):
"""
addProperty(PointCloud self, std::string const & pname)
addProperty(PointCloud self, std::string const & pname, doubleVector properties)
Adds a new property with name pname, and sets values for this property to the
given list (a n-list)
... | [
"def",
"addProperty",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_robotsim",
".",
"PointCloud_addProperty",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L1119-L1130 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__setitem__ | (self, key, value) | Sets the item on the specified position. | Sets the item on the specified position. | [
"Sets",
"the",
"item",
"on",
"the",
"specified",
"position",
"."
] | def __setitem__(self, key, value):
"""Sets the item on the specified position."""
if isinstance(key, slice): # PY3
if key.step is not None:
raise ValueError('Extended slices not supported')
self.__setslice__(key.start, key.stop, value)
else:
self._values[key] = self._type_checker.... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"slice",
")",
":",
"# PY3",
"if",
"key",
".",
"step",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Extended slices not supported'",
")"... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/containers.py#L298-L306 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/trainer.py | python | Trainer._init_kvstore | (self) | Create kvstore. | Create kvstore. | [
"Create",
"kvstore",
"."
] | def _init_kvstore(self):
"""Create kvstore."""
config = self._kvstore_params
# configure kvstore, update_on_kvstore and self._distributed on three cases:
if self._contains_sparse_weight:
# If weight is sparse, kvstore must be present and the weight must be updated on kvstore.... | [
"def",
"_init_kvstore",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"_kvstore_params",
"# configure kvstore, update_on_kvstore and self._distributed on three cases:",
"if",
"self",
".",
"_contains_sparse_weight",
":",
"# If weight is sparse, kvstore must be present and the w... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/trainer.py#L169-L248 | ||
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOM/DICOM.py | python | DICOM.addMenu | (self) | Add an action to the File menu that will go into
the DICOM module by selecting the module. Note that
once the module is constructed (below in setup) another
connection is made that will also cause the instance-created
DICOM browser to be raised by this menu action | Add an action to the File menu that will go into
the DICOM module by selecting the module. Note that
once the module is constructed (below in setup) another
connection is made that will also cause the instance-created
DICOM browser to be raised by this menu action | [
"Add",
"an",
"action",
"to",
"the",
"File",
"menu",
"that",
"will",
"go",
"into",
"the",
"DICOM",
"module",
"by",
"selecting",
"the",
"module",
".",
"Note",
"that",
"once",
"the",
"module",
"is",
"constructed",
"(",
"below",
"in",
"setup",
")",
"another"... | def addMenu(self):
"""Add an action to the File menu that will go into
the DICOM module by selecting the module. Note that
once the module is constructed (below in setup) another
connection is made that will also cause the instance-created
DICOM browser to be raised by this menu action"""
a = s... | [
"def",
"addMenu",
"(",
"self",
")",
":",
"a",
"=",
"self",
".",
"parent",
".",
"action",
"(",
")",
"fileMenu",
"=",
"slicer",
".",
"util",
".",
"lookupTopLevelWidget",
"(",
"'FileMenu'",
")",
"if",
"fileMenu",
":",
"for",
"action",
"in",
"fileMenu",
".... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOM/DICOM.py#L220-L231 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/splitter.py | python | MultiSplitterWindow.SizeWindows | (self) | Reposition and size the windows managed by the splitter.
Useful when windows have been added/removed or when styles
have been changed. | Reposition and size the windows managed by the splitter.
Useful when windows have been added/removed or when styles
have been changed. | [
"Reposition",
"and",
"size",
"the",
"windows",
"managed",
"by",
"the",
"splitter",
".",
"Useful",
"when",
"windows",
"have",
"been",
"added",
"/",
"removed",
"or",
"when",
"styles",
"have",
"been",
"changed",
"."
] | def SizeWindows(self):
"""
Reposition and size the windows managed by the splitter.
Useful when windows have been added/removed or when styles
have been changed.
"""
self._SizeWindows() | [
"def",
"SizeWindows",
"(",
"self",
")",
":",
"self",
".",
"_SizeWindows",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/splitter.py#L228-L234 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_endpoints.py | python | Link.transport | (self) | return self.session.transport | The transport bound to the connection on which this link was attached. | The transport bound to the connection on which this link was attached. | [
"The",
"transport",
"bound",
"to",
"the",
"connection",
"on",
"which",
"this",
"link",
"was",
"attached",
"."
] | def transport(self) -> Transport:
"""
The transport bound to the connection on which this link was attached.
"""
return self.session.transport | [
"def",
"transport",
"(",
"self",
")",
"->",
"Transport",
":",
"return",
"self",
".",
"session",
".",
"transport"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_endpoints.py#L864-L868 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Tools/iobench/iobench.py | python | modify_bytewise | (f, source) | modify one unit at a time | modify one unit at a time | [
"modify",
"one",
"unit",
"at",
"a",
"time"
] | def modify_bytewise(f, source):
""" modify one unit at a time """
f.seek(0)
for i in xrange(0, len(source)):
f.write(source[i:i+1]) | [
"def",
"modify_bytewise",
"(",
"f",
",",
"source",
")",
":",
"f",
".",
"seek",
"(",
"0",
")",
"for",
"i",
"in",
"xrange",
"(",
"0",
",",
"len",
"(",
"source",
")",
")",
":",
"f",
".",
"write",
"(",
"source",
"[",
"i",
":",
"i",
"+",
"1",
"]... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/iobench/iobench.py#L166-L170 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/cookielib.py | python | http2time | (text) | return _str2time(day, mon, yr, hr, min, sec, tz) | Returns time in seconds since epoch of time represented by a string.
Return value is an integer.
None is returned if the format of str is unrecognized, the time is outside
the representable range, or the timezone string is not recognized. If the
string contains no timezone, UTC is assumed.
The t... | Returns time in seconds since epoch of time represented by a string. | [
"Returns",
"time",
"in",
"seconds",
"since",
"epoch",
"of",
"time",
"represented",
"by",
"a",
"string",
"."
] | def http2time(text):
"""Returns time in seconds since epoch of time represented by a string.
Return value is an integer.
None is returned if the format of str is unrecognized, the time is outside
the representable range, or the timezone string is not recognized. If the
string contains no timezone... | [
"def",
"http2time",
"(",
"text",
")",
":",
"# fast exit for strictly conforming string",
"m",
"=",
"STRICT_DATE_RE",
".",
"search",
"(",
"text",
")",
"if",
"m",
":",
"g",
"=",
"m",
".",
"groups",
"(",
")",
"mon",
"=",
"MONTHS_LOWER",
".",
"index",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cookielib.py#L212-L266 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py | python | NodePattern._submatch | (self, node, results=None) | return True | Match the pattern's content to the node's children.
This assumes the node type matches and self.content is not None.
Returns True if it matches, False if not.
If results is not None, it must be a dict which will be
updated with the nodes matching named subpatterns.
When retur... | Match the pattern's content to the node's children. | [
"Match",
"the",
"pattern",
"s",
"content",
"to",
"the",
"node",
"s",
"children",
"."
] | def _submatch(self, node, results=None):
"""
Match the pattern's content to the node's children.
This assumes the node type matches and self.content is not None.
Returns True if it matches, False if not.
If results is not None, it must be a dict which will be
updated w... | [
"def",
"_submatch",
"(",
"self",
",",
"node",
",",
"results",
"=",
"None",
")",
":",
"if",
"self",
".",
"wildcards",
":",
"for",
"c",
",",
"r",
"in",
"generate_matches",
"(",
"self",
".",
"content",
",",
"node",
".",
"children",
")",
":",
"if",
"c"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py#L611-L636 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/build_tools/update_nacl_manifest.py | python | Run | (delegate, platforms, extra_archives, fixed_bundle_versions=None) | Entry point for the auto-updater.
Args:
delegate: The Delegate object to use for reading Urls, files, etc.
platforms: A sequence of platforms to consider, e.g.
('mac', 'linux', 'win')
extra_archives: A sequence of tuples: (archive_basename, minimum_version),
e.g. [('foo.tar.bz2', '18.... | Entry point for the auto-updater. | [
"Entry",
"point",
"for",
"the",
"auto",
"-",
"updater",
"."
] | def Run(delegate, platforms, extra_archives, fixed_bundle_versions=None):
"""Entry point for the auto-updater.
Args:
delegate: The Delegate object to use for reading Urls, files, etc.
platforms: A sequence of platforms to consider, e.g.
('mac', 'linux', 'win')
extra_archives: A sequence of tu... | [
"def",
"Run",
"(",
"delegate",
",",
"platforms",
",",
"extra_archives",
",",
"fixed_bundle_versions",
"=",
"None",
")",
":",
"if",
"fixed_bundle_versions",
":",
"fixed_bundle_versions",
"=",
"dict",
"(",
"fixed_bundle_versions",
")",
"else",
":",
"fixed_bundle_versi... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/update_nacl_manifest.py#L779-L847 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | llvm/utils/lit/lit/llvm/config.py | python | LLVMConfig.use_clang | (self, additional_tool_dirs=[], additional_flags=[],
required=True, use_installed=False) | Configure the test suite to be able to invoke clang.
Sets up some environment variables important to clang, locates a
just-built or optionally an installed clang, and add a set of standard
substitutions useful to any test suite that makes use of clang. | Configure the test suite to be able to invoke clang. | [
"Configure",
"the",
"test",
"suite",
"to",
"be",
"able",
"to",
"invoke",
"clang",
"."
] | def use_clang(self, additional_tool_dirs=[], additional_flags=[],
required=True, use_installed=False):
"""Configure the test suite to be able to invoke clang.
Sets up some environment variables important to clang, locates a
just-built or optionally an installed clang, and add ... | [
"def",
"use_clang",
"(",
"self",
",",
"additional_tool_dirs",
"=",
"[",
"]",
",",
"additional_flags",
"=",
"[",
"]",
",",
"required",
"=",
"True",
",",
"use_installed",
"=",
"False",
")",
":",
"# Clear some environment variables that might affect Clang.",
"#",
"# ... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/llvm/utils/lit/lit/llvm/config.py#L441-L581 | ||
vesoft-inc/nebula | 25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35 | .linters/cpp/cpplint.py | python | CheckInvalidIncrement | (filename, clean_lines, linenum, error) | Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ or *count += 1.
Args:
filename: The name of the current file.
... | Checks for invalid increment *count++. | [
"Checks",
"for",
"invalid",
"increment",
"*",
"count",
"++",
"."
] | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
"""Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ ... | [
"def",
"CheckInvalidIncrement",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"_RE_PATTERN_INVALID_INCREMENT",
".",
"match",
"(",
"line",
")",
":",
"error",
... | https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L2403-L2422 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.GetDelayedLayoutThreshold | (*args, **kwargs) | return _richtext.RichTextCtrl_GetDelayedLayoutThreshold(*args, **kwargs) | GetDelayedLayoutThreshold(self) -> long
Get the threshold in character positions for doing layout optimization
during sizing. | GetDelayedLayoutThreshold(self) -> long | [
"GetDelayedLayoutThreshold",
"(",
"self",
")",
"-",
">",
"long"
] | def GetDelayedLayoutThreshold(*args, **kwargs):
"""
GetDelayedLayoutThreshold(self) -> long
Get the threshold in character positions for doing layout optimization
during sizing.
"""
return _richtext.RichTextCtrl_GetDelayedLayoutThreshold(*args, **kwargs) | [
"def",
"GetDelayedLayoutThreshold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetDelayedLayoutThreshold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2952-L2959 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/modulegraph/pkg_resources.py | python | WorkingSet.find_plugins | (self,
plugin_env, full_env=None, installer=None, fallback=True
) | return distributions, error_info | Find all activatable distributions in `plugin_env`
Example usage::
distributions, errors = working_set.find_plugins(
Environment(plugin_dirlist)
)
map(working_set.add, distributions) # add plugins+libs to sys.path
print "Couldn't load", errors ... | Find all activatable distributions in `plugin_env` | [
"Find",
"all",
"activatable",
"distributions",
"in",
"plugin_env"
] | def find_plugins(self,
plugin_env, full_env=None, installer=None, fallback=True
):
"""Find all activatable distributions in `plugin_env`
Example usage::
distributions, errors = working_set.find_plugins(
Environment(plugin_dirlist)
)
map(w... | [
"def",
"find_plugins",
"(",
"self",
",",
"plugin_env",
",",
"full_env",
"=",
"None",
",",
"installer",
"=",
"None",
",",
"fallback",
"=",
"True",
")",
":",
"plugin_projects",
"=",
"list",
"(",
"plugin_env",
")",
"plugin_projects",
".",
"sort",
"(",
")",
... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L455-L531 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/memory_stats/python/ops/memory_stats_ops.py | python | BytesLimit | () | return gen_memory_stats_ops.bytes_limit() | Generates an op that measures the total memory (in bytes) of a device. | Generates an op that measures the total memory (in bytes) of a device. | [
"Generates",
"an",
"op",
"that",
"measures",
"the",
"total",
"memory",
"(",
"in",
"bytes",
")",
"of",
"a",
"device",
"."
] | def BytesLimit():
"""Generates an op that measures the total memory (in bytes) of a device."""
return gen_memory_stats_ops.bytes_limit() | [
"def",
"BytesLimit",
"(",
")",
":",
"return",
"gen_memory_stats_ops",
".",
"bytes_limit",
"(",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/memory_stats/python/ops/memory_stats_ops.py#L34-L36 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/WX/pidWxDc.py | python | PiddleWxDc.fontDescent | (self, font=None) | return extents[2] | Find the descent (extent below base) of the given font. | Find the descent (extent below base) of the given font. | [
"Find",
"the",
"descent",
"(",
"extent",
"below",
"base",
")",
"of",
"the",
"given",
"font",
"."
] | def fontDescent(self, font=None):
'''Find the descent (extent below base) of the given font.'''
wx_font = self._setWXfont(font)
extents = self.dc.GetFullTextExtent(' ', wx_font)
return extents[2] | [
"def",
"fontDescent",
"(",
"self",
",",
"font",
"=",
"None",
")",
":",
"wx_font",
"=",
"self",
".",
"_setWXfont",
"(",
"font",
")",
"extents",
"=",
"self",
".",
"dc",
".",
"GetFullTextExtent",
"(",
"' '",
",",
"wx_font",
")",
"return",
"extents",
"[",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/WX/pidWxDc.py#L147-L151 | |
DOCGroup/ACE_TAO | 79c6e76aa604bcc83e2db1608ab1a1af1960141a | ACE/bin/make_release.py | python | generate_workspaces | (stage_dir) | Generates workspaces in the given stage_dir | Generates workspaces in the given stage_dir | [
"Generates",
"workspaces",
"in",
"the",
"given",
"stage_dir"
] | def generate_workspaces (stage_dir):
""" Generates workspaces in the given stage_dir """
print ("Generating workspaces...")
# Make sure we are in the right directory...
os.chdir (os.path.join (stage_dir, "ACE_wrappers"))
# Set up our environment
os.putenv ("ACE_ROOT", os.path.join (stage_dir, ... | [
"def",
"generate_workspaces",
"(",
"stage_dir",
")",
":",
"print",
"(",
"\"Generating workspaces...\"",
")",
"# Make sure we are in the right directory...",
"os",
".",
"chdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"stage_dir",
",",
"\"ACE_wrappers\"",
")",
")",... | https://github.com/DOCGroup/ACE_TAO/blob/79c6e76aa604bcc83e2db1608ab1a1af1960141a/ACE/bin/make_release.py#L747-L796 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/boto_translation.py | python | BotoTranslation._StorageUriForObject | (self, bucket, object_name, generation=None) | return boto.storage_uri(
uri_string, suppress_consec_slashes=False,
bucket_storage_uri_class=self.bucket_storage_uri_class,
debug=self.debug) | Returns a boto storage_uri for the given object.
Args:
bucket: Bucket name (string).
object_name: Object name (string).
generation: Generation or version_id of object. If None, live version
of the object is used.
Returns:
Boto storage_uri for the object. | Returns a boto storage_uri for the given object. | [
"Returns",
"a",
"boto",
"storage_uri",
"for",
"the",
"given",
"object",
"."
] | def _StorageUriForObject(self, bucket, object_name, generation=None):
"""Returns a boto storage_uri for the given object.
Args:
bucket: Bucket name (string).
object_name: Object name (string).
generation: Generation or version_id of object. If None, live version
of the obje... | [
"def",
"_StorageUriForObject",
"(",
"self",
",",
"bucket",
",",
"object_name",
",",
"generation",
"=",
"None",
")",
":",
"uri_string",
"=",
"'%s://%s/%s'",
"%",
"(",
"self",
".",
"provider",
",",
"bucket",
",",
"object_name",
")",
"if",
"generation",
":",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/boto_translation.py#L1032-L1050 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | contrib/src/sceneeditor/seParticleEffect.py | python | ParticleEffect.getForceGroupDict | (self) | return self.forceGroupDict | getForceGroup() | getForceGroup() | [
"getForceGroup",
"()"
] | def getForceGroupDict(self):
"""getForceGroup()"""
return self.forceGroupDict | [
"def",
"getForceGroupDict",
"(",
"self",
")",
":",
"return",
"self",
".",
"forceGroupDict"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seParticleEffect.py#L163-L165 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/crowd_modelling.py | python | MFGCrowdModellingState._rewards | (self) | return 0.0 | Reward for the player for this state. | Reward for the player for this state. | [
"Reward",
"for",
"the",
"player",
"for",
"this",
"state",
"."
] | def _rewards(self):
"""Reward for the player for this state."""
if self._player_id == 0:
r_x = 1 - (1.0 * np.abs(self.x - self.size // 2)) / (self.size // 2)
r_a = -(1.0 * np.abs(self._ACTION_TO_MOVE[self._last_action])) / self.size
r_mu = - np.log(self._distribution[self.x] + _EPSILON)
... | [
"def",
"_rewards",
"(",
"self",
")",
":",
"if",
"self",
".",
"_player_id",
"==",
"0",
":",
"r_x",
"=",
"1",
"-",
"(",
"1.0",
"*",
"np",
".",
"abs",
"(",
"self",
".",
"x",
"-",
"self",
".",
"size",
"//",
"2",
")",
")",
"/",
"(",
"self",
".",... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/crowd_modelling.py#L236-L243 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/depot_tools/cpplint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L1004-L1007 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/serialupdi/nvm.py | python | NvmUpdiTinyMega.write_eeprom | (self, address, data) | return self.write_nvm(address, data, use_word_access=False,
nvmcommand=constants.UPDI_V0_NVMCTRL_CTRLA_ERASE_WRITE_PAGE) | Write data to EEPROM (v0)
:param address: address to write to
:param data: data to write | Write data to EEPROM (v0)
:param address: address to write to
:param data: data to write | [
"Write",
"data",
"to",
"EEPROM",
"(",
"v0",
")",
":",
"param",
"address",
":",
"address",
"to",
"write",
"to",
":",
"param",
"data",
":",
"data",
"to",
"write"
] | def write_eeprom(self, address, data):
"""
Write data to EEPROM (v0)
:param address: address to write to
:param data: data to write
"""
return self.write_nvm(address, data, use_word_access=False,
nvmcommand=constants.UPDI_V0_NVMCTRL_CTRLA_ERA... | [
"def",
"write_eeprom",
"(",
"self",
",",
"address",
",",
"data",
")",
":",
"return",
"self",
".",
"write_nvm",
"(",
"address",
",",
"data",
",",
"use_word_access",
"=",
"False",
",",
"nvmcommand",
"=",
"constants",
".",
"UPDI_V0_NVMCTRL_CTRLA_ERASE_WRITE_PAGE",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/serialupdi/nvm.py#L120-L127 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._calculate_element_block_thickness | (self, element_block_ids) | return self._get_thickness_from_volume_and_area(volume, area) | Return the approximate thickness of the given element blocks.
This approximates the thickness by calculating the volume and exposed
surface area of the element blocks, then returning the thickness of a
short disk with the same characteristics. | Return the approximate thickness of the given element blocks. | [
"Return",
"the",
"approximate",
"thickness",
"of",
"the",
"given",
"element",
"blocks",
"."
] | def _calculate_element_block_thickness(self, element_block_ids):
"""
Return the approximate thickness of the given element blocks.
This approximates the thickness by calculating the volume and exposed
surface area of the element blocks, then returning the thickness of a
short di... | [
"def",
"_calculate_element_block_thickness",
"(",
"self",
",",
"element_block_ids",
")",
":",
"element_block_ids",
"=",
"self",
".",
"_format_element_block_id_list",
"(",
"element_block_ids",
",",
"empty_list_okay",
"=",
"False",
")",
"# delete any element blocks which are no... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L8201-L8231 | |
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'counting='",
",",
"'filter='",
",",
... | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L6232-L6299 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Script/SConscript.py | python | compute_exports | (exports) | return retval | Compute a dictionary of exports given one of the parameters
to the Export() function or the exports argument to SConscript(). | Compute a dictionary of exports given one of the parameters
to the Export() function or the exports argument to SConscript(). | [
"Compute",
"a",
"dictionary",
"of",
"exports",
"given",
"one",
"of",
"the",
"parameters",
"to",
"the",
"Export",
"()",
"function",
"or",
"the",
"exports",
"argument",
"to",
"SConscript",
"()",
"."
] | def compute_exports(exports):
"""Compute a dictionary of exports given one of the parameters
to the Export() function or the exports argument to SConscript()."""
loc, glob = get_calling_namespaces()
retval = {}
try:
for export in exports:
if is_Dict(export):
ret... | [
"def",
"compute_exports",
"(",
"exports",
")",
":",
"loc",
",",
"glob",
"=",
"get_calling_namespaces",
"(",
")",
"retval",
"=",
"{",
"}",
"try",
":",
"for",
"export",
"in",
"exports",
":",
"if",
"is_Dict",
"(",
"export",
")",
":",
"retval",
".",
"updat... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/SConscript.py#L85-L104 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/os.py | python | makedirs | (name, mode=0777) | makedirs(path [, mode=0777])
Super-mkdir; create a leaf directory and all intermediate ones.
Works like mkdir, except that any intermediate path segment (not
just the rightmost) will be created if it does not exist. This is
recursive. | makedirs(path [, mode=0777]) | [
"makedirs",
"(",
"path",
"[",
"mode",
"=",
"0777",
"]",
")"
] | def makedirs(name, mode=0777):
"""makedirs(path [, mode=0777])
Super-mkdir; create a leaf directory and all intermediate ones.
Works like mkdir, except that any intermediate path segment (not
just the rightmost) will be created if it does not exist. This is
recursive.
"""
head, tail = pat... | [
"def",
"makedirs",
"(",
"name",
",",
"mode",
"=",
"0777",
")",
":",
"head",
",",
"tail",
"=",
"path",
".",
"split",
"(",
"name",
")",
"if",
"not",
"tail",
":",
"head",
",",
"tail",
"=",
"path",
".",
"split",
"(",
"head",
")",
"if",
"head",
"and... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/os.py#L136-L157 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/cardinality.py | python | cardinality | (dataset) | return ged_ops.dataset_cardinality(dataset._variant_tensor) | Returns the cardinality of `dataset`, if known.
The operation returns the cardinality of `dataset`. The operation may return
`tf.data.experimental.INFINITE_CARDINALITY` if `dataset` contains an infinite
number of elements or `tf.data.experimental.UNKNOWN_CARDINALITY` if the
analysis fails to determine the numb... | Returns the cardinality of `dataset`, if known. | [
"Returns",
"the",
"cardinality",
"of",
"dataset",
"if",
"known",
"."
] | def cardinality(dataset):
"""Returns the cardinality of `dataset`, if known.
The operation returns the cardinality of `dataset`. The operation may return
`tf.data.experimental.INFINITE_CARDINALITY` if `dataset` contains an infinite
number of elements or `tf.data.experimental.UNKNOWN_CARDINALITY` if the
analy... | [
"def",
"cardinality",
"(",
"dataset",
")",
":",
"return",
"ged_ops",
".",
"dataset_cardinality",
"(",
"dataset",
".",
"_variant_tensor",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/cardinality.py#L33-L51 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MemoryFSHandler.OpenFile | (*args, **kwargs) | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | OpenFile(self, FileSystem fs, String location) -> FSFile | OpenFile(self, FileSystem fs, String location) -> FSFile | [
"OpenFile",
"(",
"self",
"FileSystem",
"fs",
"String",
"location",
")",
"-",
">",
"FSFile"
] | def OpenFile(*args, **kwargs):
"""OpenFile(self, FileSystem fs, String location) -> FSFile"""
return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | [
"def",
"OpenFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MemoryFSHandler_OpenFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2578-L2580 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/predictor/python/model.py | python | RnnModel.load | (self) | Routine to load pre-trained model for prediction purpose
:param model_name: name of the checkpoint
:return: tf.Session, out_nodes | Routine to load pre-trained model for prediction purpose
:param model_name: name of the checkpoint
:return: tf.Session, out_nodes | [
"Routine",
"to",
"load",
"pre",
"-",
"trained",
"model",
"for",
"prediction",
"purpose",
":",
"param",
"model_name",
":",
"name",
"of",
"the",
"checkpoint",
":",
"return",
":",
"tf",
".",
"Session",
"out_nodes"
] | def load(self):
"""
Routine to load pre-trained model for prediction purpose
:param model_name: name of the checkpoint
:return: tf.Session, out_nodes
"""
keras.backend.clear_session()
set_session(self.session)
self.model_info.load_info()
with self... | [
"def",
"load",
"(",
"self",
")",
":",
"keras",
".",
"backend",
".",
"clear_session",
"(",
")",
"set_session",
"(",
"self",
".",
"session",
")",
"self",
".",
"model_info",
".",
"load_info",
"(",
")",
"with",
"self",
".",
"graph",
".",
"as_default",
"(",... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/predictor/python/model.py#L599-L619 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py | python | FakePathModule.isfile | (self, path) | return self._istype(path, stat.S_IFREG) | Determines if path identifies a regular file. | Determines if path identifies a regular file. | [
"Determines",
"if",
"path",
"identifies",
"a",
"regular",
"file",
"."
] | def isfile(self, path):
"""Determines if path identifies a regular file."""
return self._istype(path, stat.S_IFREG) | [
"def",
"isfile",
"(",
"self",
",",
"path",
")",
":",
"return",
"self",
".",
"_istype",
"(",
"path",
",",
"stat",
".",
"S_IFREG",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L1070-L1072 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py | python | get_cpu_arch | () | return out.strip("\n") | Retrieves processor architecture type (32-bit or 64-bit).
Returns:
String that is CPU architecture.
e.g. 'x86_64' | Retrieves processor architecture type (32-bit or 64-bit). | [
"Retrieves",
"processor",
"architecture",
"type",
"(",
"32",
"-",
"bit",
"or",
"64",
"-",
"bit",
")",
"."
] | def get_cpu_arch():
"""Retrieves processor architecture type (32-bit or 64-bit).
Returns:
String that is CPU architecture.
e.g. 'x86_64'
"""
key = "cpu_arch"
out, err = run_shell_cmd(cmds_all[PLATFORM][key])
if err and FLAGS.debug:
print("Error in detecting CPU arch:\n %s" % str(err))
retu... | [
"def",
"get_cpu_arch",
"(",
")",
":",
"key",
"=",
"\"cpu_arch\"",
"out",
",",
"err",
"=",
"run_shell_cmd",
"(",
"cmds_all",
"[",
"PLATFORM",
"]",
"[",
"key",
"]",
")",
"if",
"err",
"and",
"FLAGS",
".",
"debug",
":",
"print",
"(",
"\"Error in detecting CP... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py#L192-L204 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | _IncludeState.CheckNextIncludeOrder | (self, header_type) | return '' | Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The empty string if the header is in the right order, or a... | Returns a non-empty error message if the next header is out of order. | [
"Returns",
"a",
"non",
"-",
"empty",
"error",
"message",
"if",
"the",
"next",
"header",
"is",
"out",
"of",
"order",
"."
] | def CheckNextIncludeOrder(self, header_type):
"""Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The e... | [
"def",
"CheckNextIncludeOrder",
"(",
"self",
",",
"header_type",
")",
":",
"error_message",
"=",
"(",
"'Found %s after %s'",
"%",
"(",
"self",
".",
"_TYPE_NAMES",
"[",
"header_type",
"]",
",",
"self",
".",
"_SECTION_NAMES",
"[",
"self",
".",
"_section",
"]",
... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L910-L961 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/wsgiref/handlers.py | python | BaseHandler.cleanup_headers | (self) | Make any necessary header changes or defaults
Subclasses can extend this to add other defaults. | Make any necessary header changes or defaults | [
"Make",
"any",
"necessary",
"header",
"changes",
"or",
"defaults"
] | def cleanup_headers(self):
"""Make any necessary header changes or defaults
Subclasses can extend this to add other defaults.
"""
if not self.headers.has_key('Content-Length'):
self.set_content_length() | [
"def",
"cleanup_headers",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"headers",
".",
"has_key",
"(",
"'Content-Length'",
")",
":",
"self",
".",
"set_content_length",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/handlers.py#L158-L164 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | examples/python/assignment_with_constraints_sat.py | python | solve_assignment | () | Solve the assignment problem. | Solve the assignment problem. | [
"Solve",
"the",
"assignment",
"problem",
"."
] | def solve_assignment():
"""Solve the assignment problem."""
# Data.
cost = [[90, 76, 75, 70, 50, 74], [35, 85, 55, 65, 48,
101], [125, 95, 90, 105, 59, 120],
[45, 110, 95, 115, 104, 83], [60, 105, 80, 75, 59, 62], [
45, 65, 110, 95, 47, 31
... | [
"def",
"solve_assignment",
"(",
")",
":",
"# Data.",
"cost",
"=",
"[",
"[",
"90",
",",
"76",
",",
"75",
",",
"70",
",",
"50",
",",
"74",
"]",
",",
"[",
"35",
",",
"85",
",",
"55",
",",
"65",
",",
"48",
",",
"101",
"]",
",",
"[",
"125",
",... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/assignment_with_constraints_sat.py#L19-L116 | ||
appleseedhq/appleseed | 1ba62025b5db722e179a2219d8d366c34bfaa342 | docs/source/conf.py | python | get_version | () | Returns project version as string from 'git describe' command. | Returns project version as string from 'git describe' command. | [
"Returns",
"project",
"version",
"as",
"string",
"from",
"git",
"describe",
"command",
"."
] | def get_version():
"""
Returns project version as string from 'git describe' command.
"""
pipe = Popen(
'git describe --tags --always --abbrev=0',
stdout=PIPE, shell=True)
version = pipe.stdout.read()
if version:
return version
else:
return 'X.Y' | [
"def",
"get_version",
"(",
")",
":",
"pipe",
"=",
"Popen",
"(",
"'git describe --tags --always --abbrev=0'",
",",
"stdout",
"=",
"PIPE",
",",
"shell",
"=",
"True",
")",
"version",
"=",
"pipe",
".",
"stdout",
".",
"read",
"(",
")",
"if",
"version",
":",
"... | https://github.com/appleseedhq/appleseed/blob/1ba62025b5db722e179a2219d8d366c34bfaa342/docs/source/conf.py#L37-L50 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py | python | TimingScriptGenerator.writeTimingCall | (self, irname, callname) | Echo some comments and invoke both versions of toy | Echo some comments and invoke both versions of toy | [
"Echo",
"some",
"comments",
"and",
"invoke",
"both",
"versions",
"of",
"toy"
] | def writeTimingCall(self, irname, callname):
"""Echo some comments and invoke both versions of toy"""
rootname = irname
if '.' in irname:
rootname = irname[:irname.rfind('.')]
self.shfile.write("echo \"%s: Calls %s\" >> %s\n" % (callname, irname, self.timeFile))
self.... | [
"def",
"writeTimingCall",
"(",
"self",
",",
"irname",
",",
"callname",
")",
":",
"rootname",
"=",
"irname",
"if",
"'.'",
"in",
"irname",
":",
"rootname",
"=",
"irname",
"[",
":",
"irname",
".",
"rfind",
"(",
"'.'",
")",
"]",
"self",
".",
"shfile",
".... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py#L12-L34 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py | python | ContentHandler.endElement | (self, name) | Signals the end of an element in non-namespace mode.
The name parameter contains the name of the element type, just
as with the startElement event. | Signals the end of an element in non-namespace mode. | [
"Signals",
"the",
"end",
"of",
"an",
"element",
"in",
"non",
"-",
"namespace",
"mode",
"."
] | def endElement(self, name):
"""Signals the end of an element in non-namespace mode.
The name parameter contains the name of the element type, just
as with the startElement event.""" | [
"def",
"endElement",
"(",
"self",
",",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py#L134-L138 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/filters/inject_meta_charset.py | python | Filter.__init__ | (self, source, encoding) | Creates a Filter
:arg source: the source token stream
:arg encoding: the encoding to set | Creates a Filter | [
"Creates",
"a",
"Filter"
] | def __init__(self, source, encoding):
"""Creates a Filter
:arg source: the source token stream
:arg encoding: the encoding to set
"""
base.Filter.__init__(self, source)
self.encoding = encoding | [
"def",
"__init__",
"(",
"self",
",",
"source",
",",
"encoding",
")",
":",
"base",
".",
"Filter",
".",
"__init__",
"(",
"self",
",",
"source",
")",
"self",
".",
"encoding",
"=",
"encoding"
] | 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/html5lib/filters/inject_meta_charset.py#L8-L17 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/config.py | python | CoverageConfig.from_environment | (self, env_var) | Read configuration from the `env_var` environment variable. | Read configuration from the `env_var` environment variable. | [
"Read",
"configuration",
"from",
"the",
"env_var",
"environment",
"variable",
"."
] | def from_environment(self, env_var):
"""Read configuration from the `env_var` environment variable."""
# Timidity: for nose users, read an environment variable. This is a
# cheap hack, since the rest of the command line arguments aren't
# recognized, but it solves some users' problems.
... | [
"def",
"from_environment",
"(",
"self",
",",
"env_var",
")",
":",
"# Timidity: for nose users, read an environment variable. This is a",
"# cheap hack, since the rest of the command line arguments aren't",
"# recognized, but it solves some users' problems.",
"env",
"=",
"os",
".",
"en... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/config.py#L61-L68 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/external/bazel_tools/tools/cpp/wrapper/bin/pydir/msvc_cl.py | python | _IsLink | (args) | return False | Determines whether we need to link rather than compile.
A set of arguments is for linking if they contain -static, -shared, are adding
adding library search paths through -L, or libraries via -l.
Args:
args: List of arguments
Returns:
Boolean whether this is a link operation or not. | Determines whether we need to link rather than compile. | [
"Determines",
"whether",
"we",
"need",
"to",
"link",
"rather",
"than",
"compile",
"."
] | def _IsLink(args):
"""Determines whether we need to link rather than compile.
A set of arguments is for linking if they contain -static, -shared, are adding
adding library search paths through -L, or libraries via -l.
Args:
args: List of arguments
Returns:
Boolean whether this is a link operation o... | [
"def",
"_IsLink",
"(",
"args",
")",
":",
"for",
"arg",
"in",
"args",
":",
"# Certain flags indicate we are linking.",
"if",
"(",
"arg",
"in",
"[",
"'-shared'",
",",
"'-static'",
"]",
"or",
"arg",
"[",
":",
"2",
"]",
"in",
"[",
"'-l'",
",",
"'-L'",
"]",... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/cpp/wrapper/bin/pydir/msvc_cl.py#L71-L88 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_SCHEME_OAEP.fromTpm | (buf) | return buf.createObj(TPMS_SCHEME_OAEP) | Returns new TPMS_SCHEME_OAEP object constructed from its marshaled
representation in the given TpmBuffer buffer | Returns new TPMS_SCHEME_OAEP object constructed from its marshaled
representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPMS_SCHEME_OAEP",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPMS_SCHEME_OAEP object constructed from its marshaled
representation in the given TpmBuffer buffer
"""
return buf.createObj(TPMS_SCHEME_OAEP) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPMS_SCHEME_OAEP",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L17804-L17808 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | require | (required) | return decorator | Decorator for checking the required values in state.
It checks the required attributes in the passed state and stop when
any of those is missing. | Decorator for checking the required values in state. | [
"Decorator",
"for",
"checking",
"the",
"required",
"values",
"in",
"state",
"."
] | def require(required):
""" Decorator for checking the required values in state.
It checks the required attributes in the passed state and stop when
any of those is missing. """
def decorator(function):
@functools.wraps(function)
def wrapper(*args, **kwargs):
for key in requ... | [
"def",
"require",
"(",
"required",
")",
":",
"def",
"decorator",
"(",
"function",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"function",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"key",
"in",
"required",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libscanbuild/analyze.py#L408-L426 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListCtrl.DeleteItem | (*args, **kwargs) | return _controls_.ListCtrl_DeleteItem(*args, **kwargs) | DeleteItem(self, long item) -> bool | DeleteItem(self, long item) -> bool | [
"DeleteItem",
"(",
"self",
"long",
"item",
")",
"-",
">",
"bool"
] | def DeleteItem(*args, **kwargs):
"""DeleteItem(self, long item) -> bool"""
return _controls_.ListCtrl_DeleteItem(*args, **kwargs) | [
"def",
"DeleteItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_DeleteItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4641-L4643 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/module/bucketing_module.py | python | BucketingModule.label_shapes | (self) | return self._curr_module.label_shapes | Get label shapes.
Returns
-------
A list of `(name, shape)` pairs.
The return value could be ``None`` if the module does not need labels,
or if the module is not bound for training (in this case, label information
is not available). | Get label shapes. | [
"Get",
"label",
"shapes",
"."
] | def label_shapes(self):
"""Get label shapes.
Returns
-------
A list of `(name, shape)` pairs.
The return value could be ``None`` if the module does not need labels,
or if the module is not bound for training (in this case, label information
is not ava... | [
"def",
"label_shapes",
"(",
"self",
")",
":",
"assert",
"self",
".",
"binded",
"return",
"self",
".",
"_curr_module",
".",
"label_shapes"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/bucketing_module.py#L141-L152 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/sandbox.py | python | SandboxedEnvironment.call_unop | (self, context, operator, arg) | return self.unop_table[operator](arg) | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6 | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators. | [
"For",
"intercepted",
"unary",
"operator",
"calls",
"(",
":",
"meth",
":",
"intercepted_unops",
")",
"this",
"function",
"is",
"executed",
"instead",
"of",
"the",
"builtin",
"operator",
".",
"This",
"can",
"be",
"used",
"to",
"fine",
"tune",
"the",
"behavior... | def call_unop(self, context, operator, arg):
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return ... | [
"def",
"call_unop",
"(",
"self",
",",
"context",
",",
"operator",
",",
"arg",
")",
":",
"return",
"self",
".",
"unop_table",
"[",
"operator",
"]",
"(",
"arg",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/sandbox.py#L350-L357 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py | python | _SConstruct_exists | (dirname='', repositories=[], filelist=None) | return None | This function checks that an SConstruct file exists in a directory.
If so, it returns the path of the file. By default, it checks the
current directory. | This function checks that an SConstruct file exists in a directory.
If so, it returns the path of the file. By default, it checks the
current directory. | [
"This",
"function",
"checks",
"that",
"an",
"SConstruct",
"file",
"exists",
"in",
"a",
"directory",
".",
"If",
"so",
"it",
"returns",
"the",
"path",
"of",
"the",
"file",
".",
"By",
"default",
"it",
"checks",
"the",
"current",
"directory",
"."
] | def _SConstruct_exists(dirname='', repositories=[], filelist=None):
"""This function checks that an SConstruct file exists in a directory.
If so, it returns the path of the file. By default, it checks the
current directory.
"""
if not filelist:
filelist = ['SConstruct', 'Sconstruct', 'sconst... | [
"def",
"_SConstruct_exists",
"(",
"dirname",
"=",
"''",
",",
"repositories",
"=",
"[",
"]",
",",
"filelist",
"=",
"None",
")",
":",
"if",
"not",
"filelist",
":",
"filelist",
"=",
"[",
"'SConstruct'",
",",
"'Sconstruct'",
",",
"'sconstruct'",
"]",
"for",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py#L607-L622 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVV.Clr | (self, *args) | return _snap.TIntIntVV_Clr(self, *args) | Clr(TIntIntVV self, bool const & DoDel=True, int const & NoDelLim=-1)
Parameters:
DoDel: bool const &
NoDelLim: int const &
Clr(TIntIntVV self, bool const & DoDel=True)
Parameters:
DoDel: bool const &
Clr(TIntIntVV self)
Parameters:
... | Clr(TIntIntVV self, bool const & DoDel=True, int const & NoDelLim=-1) | [
"Clr",
"(",
"TIntIntVV",
"self",
"bool",
"const",
"&",
"DoDel",
"=",
"True",
"int",
"const",
"&",
"NoDelLim",
"=",
"-",
"1",
")"
] | def Clr(self, *args):
"""
Clr(TIntIntVV self, bool const & DoDel=True, int const & NoDelLim=-1)
Parameters:
DoDel: bool const &
NoDelLim: int const &
Clr(TIntIntVV self, bool const & DoDel=True)
Parameters:
DoDel: bool const &
Clr(T... | [
"def",
"Clr",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TIntIntVV_Clr",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L16706-L16725 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/closurizednamespacesinfo.py | python | ClosurizedNamespacesInfo.IsExtraRequire | (self, token) | return True | Returns whether the given goog.require token is unnecessary.
Args:
token: A goog.require token.
Returns:
True if the given token corresponds to an unnecessary goog.require
statement, otherwise False. | Returns whether the given goog.require token is unnecessary. | [
"Returns",
"whether",
"the",
"given",
"goog",
".",
"require",
"token",
"is",
"unnecessary",
"."
] | def IsExtraRequire(self, token):
"""Returns whether the given goog.require token is unnecessary.
Args:
token: A goog.require token.
Returns:
True if the given token corresponds to an unnecessary goog.require
statement, otherwise False.
"""
if self._scopified_file:
return Fa... | [
"def",
"IsExtraRequire",
"(",
"self",
",",
"token",
")",
":",
"if",
"self",
".",
"_scopified_file",
":",
"return",
"False",
"namespace",
"=",
"tokenutil",
".",
"Search",
"(",
"token",
",",
"TokenType",
".",
"STRING_TEXT",
")",
".",
"string",
"base_namespace"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/closurizednamespacesinfo.py#L154-L193 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/logging/handlers.py | python | SysLogHandler.encodePriority | (self, facility, priority) | return (facility << 3) | priority | Encode the facility and priority. You can pass in strings or
integers - if strings are passed, the facility_names and
priority_names mapping dictionaries are used to convert them to
integers. | Encode the facility and priority. You can pass in strings or
integers - if strings are passed, the facility_names and
priority_names mapping dictionaries are used to convert them to
integers. | [
"Encode",
"the",
"facility",
"and",
"priority",
".",
"You",
"can",
"pass",
"in",
"strings",
"or",
"integers",
"-",
"if",
"strings",
"are",
"passed",
"the",
"facility_names",
"and",
"priority_names",
"mapping",
"dictionaries",
"are",
"used",
"to",
"convert",
"t... | def encodePriority(self, facility, priority):
"""
Encode the facility and priority. You can pass in strings or
integers - if strings are passed, the facility_names and
priority_names mapping dictionaries are used to convert them to
integers.
"""
if isinstance(faci... | [
"def",
"encodePriority",
"(",
"self",
",",
"facility",
",",
"priority",
")",
":",
"if",
"isinstance",
"(",
"facility",
",",
"basestring",
")",
":",
"facility",
"=",
"self",
".",
"facility_names",
"[",
"facility",
"]",
"if",
"isinstance",
"(",
"priority",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/handlers.py#L817-L828 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/Pharm3D/EmbedLib.py | python | MatchFeatsToMol | (mol, featFactory, features) | return True, res | generates a list of all possible mappings of each feature to a molecule
Returns a 2-tuple:
1) a boolean indicating whether or not all features were found
2) a list, numFeatures long, of sequences of features
>>> import os.path
>>> from rdkit import RDConfig, Geometry
>>> fdefFile = os.path.join... | generates a list of all possible mappings of each feature to a molecule | [
"generates",
"a",
"list",
"of",
"all",
"possible",
"mappings",
"of",
"each",
"feature",
"to",
"a",
"molecule"
] | def MatchFeatsToMol(mol, featFactory, features):
""" generates a list of all possible mappings of each feature to a molecule
Returns a 2-tuple:
1) a boolean indicating whether or not all features were found
2) a list, numFeatures long, of sequences of features
>>> import os.path
>>> from rdkit im... | [
"def",
"MatchFeatsToMol",
"(",
"mol",
",",
"featFactory",
",",
"features",
")",
":",
"molFeats",
"=",
"_getFeatDict",
"(",
"mol",
",",
"featFactory",
",",
"features",
")",
"res",
"=",
"[",
"]",
"for",
"feat",
"in",
"features",
":",
"matches",
"=",
"molFe... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Pharm3D/EmbedLib.py#L781-L830 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py | python | RequestValidator.get_original_scopes | (self, refresh_token, request, *args, **kwargs) | Get the list of scopes associated with the refresh token.
:param refresh_token: Unicode refresh token
:param request: The HTTP Request (oauthlib.common.Request)
:rtype: List of scopes.
Method is used by:
- Refresh token grant | Get the list of scopes associated with the refresh token. | [
"Get",
"the",
"list",
"of",
"scopes",
"associated",
"with",
"the",
"refresh",
"token",
"."
] | def get_original_scopes(self, refresh_token, request, *args, **kwargs):
"""Get the list of scopes associated with the refresh token.
:param refresh_token: Unicode refresh token
:param request: The HTTP Request (oauthlib.common.Request)
:rtype: List of scopes.
Method is used by:... | [
"def",
"get_original_scopes",
"(",
"self",
",",
"refresh_token",
",",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Subclasses must implement this method.'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py#L136-L146 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/drafttaskpanels/task_scale.py | python | ScaleTaskPanel.reject | (self) | return True | Execute when clicking the Cancel button. | Execute when clicking the Cancel button. | [
"Execute",
"when",
"clicking",
"the",
"Cancel",
"button",
"."
] | def reject(self):
"""Execute when clicking the Cancel button."""
if self.sourceCmd:
self.sourceCmd.finish()
Gui.ActiveDocument.resetEdit()
return True | [
"def",
"reject",
"(",
"self",
")",
":",
"if",
"self",
".",
"sourceCmd",
":",
"self",
".",
"sourceCmd",
".",
"finish",
"(",
")",
"Gui",
".",
"ActiveDocument",
".",
"resetEdit",
"(",
")",
"return",
"True"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_scale.py#L174-L179 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py | python | Treeview.detach | (self, *items) | Unlinks all of the specified items from the tree.
The items and all of their descendants are still present, and may
be reinserted at another point in the tree, but will not be
displayed. The root item may not be detached. | Unlinks all of the specified items from the tree. | [
"Unlinks",
"all",
"of",
"the",
"specified",
"items",
"from",
"the",
"tree",
"."
] | def detach(self, *items):
"""Unlinks all of the specified items from the tree.
The items and all of their descendants are still present, and may
be reinserted at another point in the tree, but will not be
displayed. The root item may not be detached."""
self.tk.call(self._w, "de... | [
"def",
"detach",
"(",
"self",
",",
"*",
"items",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"detach\"",
",",
"items",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py#L1220-L1226 | ||
CNugteren/CLBlast | 4500a03440e2cc54998c0edab366babf5e504d67 | scripts/database/database/db.py | python | group_by | (database, attributes) | return result | Returns an list with the name of the group and the corresponding entries in the database | Returns an list with the name of the group and the corresponding entries in the database | [
"Returns",
"an",
"list",
"with",
"the",
"name",
"of",
"the",
"group",
"and",
"the",
"corresponding",
"entries",
"in",
"the",
"database"
] | def group_by(database, attributes):
"""Returns an list with the name of the group and the corresponding entries in the database"""
assert len(database) > 0
attributes = [a for a in attributes if a in database[0]]
database.sort(key=itemgetter(*attributes))
result = []
for key, data in itertools.g... | [
"def",
"group_by",
"(",
"database",
",",
"attributes",
")",
":",
"assert",
"len",
"(",
"database",
")",
">",
"0",
"attributes",
"=",
"[",
"a",
"for",
"a",
"in",
"attributes",
"if",
"a",
"in",
"database",
"[",
"0",
"]",
"]",
"database",
".",
"sort",
... | https://github.com/CNugteren/CLBlast/blob/4500a03440e2cc54998c0edab366babf5e504d67/scripts/database/database/db.py#L68-L76 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib2.py | python | HTTPPasswordMgr.is_suburi | (self, base, test) | return False | Check if test is below base in a URI tree
Both args must be URIs in reduced form. | Check if test is below base in a URI tree | [
"Check",
"if",
"test",
"is",
"below",
"base",
"in",
"a",
"URI",
"tree"
] | def is_suburi(self, base, test):
"""Check if test is below base in a URI tree
Both args must be URIs in reduced form.
"""
if base == test:
return True
if base[0] != test[0]:
return False
common = posixpath.commonprefix((base[1], test[1]))
... | [
"def",
"is_suburi",
"(",
"self",
",",
"base",
",",
"test",
")",
":",
"if",
"base",
"==",
"test",
":",
"return",
"True",
"if",
"base",
"[",
"0",
"]",
"!=",
"test",
"[",
"0",
"]",
":",
"return",
"False",
"common",
"=",
"posixpath",
".",
"commonprefix... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib2.py#L802-L814 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc._register | (self, func, subst=None, needcleanup=1) | return name | Return a newly created Tcl function. If this
function is called, the Python function FUNC will
be executed. An optional function SUBST can
be given which will be executed before FUNC. | Return a newly created Tcl function. If this
function is called, the Python function FUNC will
be executed. An optional function SUBST can
be given which will be executed before FUNC. | [
"Return",
"a",
"newly",
"created",
"Tcl",
"function",
".",
"If",
"this",
"function",
"is",
"called",
"the",
"Python",
"function",
"FUNC",
"will",
"be",
"executed",
".",
"An",
"optional",
"function",
"SUBST",
"can",
"be",
"given",
"which",
"will",
"be",
"ex... | def _register(self, func, subst=None, needcleanup=1):
"""Return a newly created Tcl function. If this
function is called, the Python function FUNC will
be executed. An optional function SUBST can
be given which will be executed before FUNC."""
f = CallWrapper(func, subst, self)._... | [
"def",
"_register",
"(",
"self",
",",
"func",
",",
"subst",
"=",
"None",
",",
"needcleanup",
"=",
"1",
")",
":",
"f",
"=",
"CallWrapper",
"(",
"func",
",",
"subst",
",",
"self",
")",
".",
"__call__",
"name",
"=",
"repr",
"(",
"id",
"(",
"f",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1357-L1377 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/optimizer.py | python | Optimizer.register | (klass) | return klass | Registers a new optimizer.
Once an optimizer is registered, we can create an instance of this
optimizer with `create_optimizer` later.
Examples
--------
>>> @mx.optimizer.Optimizer.register
... class MyOptimizer(mx.optimizer.Optimizer):
... pass
>>>... | Registers a new optimizer. | [
"Registers",
"a",
"new",
"optimizer",
"."
] | def register(klass):
"""Registers a new optimizer.
Once an optimizer is registered, we can create an instance of this
optimizer with `create_optimizer` later.
Examples
--------
>>> @mx.optimizer.Optimizer.register
... class MyOptimizer(mx.optimizer.Optimizer):
... | [
"def",
"register",
"(",
"klass",
")",
":",
"assert",
"(",
"isinstance",
"(",
"klass",
",",
"type",
")",
")",
"name",
"=",
"klass",
".",
"__name__",
".",
"lower",
"(",
")",
"if",
"name",
"in",
"Optimizer",
".",
"opt_registry",
":",
"logging",
".",
"wa... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/optimizer.py#L113-L138 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/gcc.py | python | gcc_modifier_win32 | (conf) | Configuration flags for executing gcc on Windows | Configuration flags for executing gcc on Windows | [
"Configuration",
"flags",
"for",
"executing",
"gcc",
"on",
"Windows"
] | def gcc_modifier_win32(conf):
"""Configuration flags for executing gcc on Windows"""
v = conf.env
v.cprogram_PATTERN = '%s.exe'
v.cshlib_PATTERN = '%s.dll'
v.implib_PATTERN = '%s.dll.a'
v.IMPLIB_ST = '-Wl,--out-implib,%s'
v.CFLAGS_cshlib = []
# Auto-import is enabled by default e... | [
"def",
"gcc_modifier_win32",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
".",
"cprogram_PATTERN",
"=",
"'%s.exe'",
"v",
".",
"cshlib_PATTERN",
"=",
"'%s.dll'",
"v",
".",
"implib_PATTERN",
"=",
"'%s.dll.a'",
"v",
".",
"IMPLIB_ST",
"=",
"'-Wl,-... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/gcc.py#L65-L79 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Entry.selection_present | (self) | return self.tk.getboolean(
self.tk.call(self._w, 'selection', 'present')) | Return True if there are characters selected in the entry, False
otherwise. | Return True if there are characters selected in the entry, False
otherwise. | [
"Return",
"True",
"if",
"there",
"are",
"characters",
"selected",
"in",
"the",
"entry",
"False",
"otherwise",
"."
] | def selection_present(self):
"""Return True if there are characters selected in the entry, False
otherwise."""
return self.tk.getboolean(
self.tk.call(self._w, 'selection', 'present')) | [
"def",
"selection_present",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"getboolean",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'selection'",
",",
"'present'",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L2549-L2553 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/re.py | python | compile | (pattern, flags=0) | return _compile(pattern, flags) | Compile a regular expression pattern, returning a pattern object. | Compile a regular expression pattern, returning a pattern object. | [
"Compile",
"a",
"regular",
"expression",
"pattern",
"returning",
"a",
"pattern",
"object",
"."
] | def compile(pattern, flags=0):
"Compile a regular expression pattern, returning a pattern object."
return _compile(pattern, flags) | [
"def",
"compile",
"(",
"pattern",
",",
"flags",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"flags",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/re.py#L188-L190 | |
sailing-pmls/pmls-caffe | 49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a | scripts/cpp_lint.py | python | CheckCaffeRandom | (filename, clean_lines, linenum, error) | Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which should produce deterministic results for a
fixed Caffe seed set u... | Checks for calls to C random functions (rand, rand_r, random, ...). | [
"Checks",
"for",
"calls",
"to",
"C",
"random",
"functions",
"(",
"rand",
"rand_r",
"random",
"...",
")",
"."
] | def CheckCaffeRandom(filename, clean_lines, linenum, error):
"""Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which s... | [
"def",
"CheckCaffeRandom",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
"in",
"c_random_function_list",
":",
"ix",
"=",
"line",
".",
"find",
... | https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L1640-L1663 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/formatters.py | python | PlainTextFormatter._float_precision_changed | (self, change) | float_precision changed, set float_format accordingly.
float_precision can be set by int or str.
This will set float_format, after interpreting input.
If numpy has been imported, numpy print precision will also be set.
integer `n` sets format to '%.nf', otherwise, format set directly.
... | float_precision changed, set float_format accordingly. | [
"float_precision",
"changed",
"set",
"float_format",
"accordingly",
"."
] | def _float_precision_changed(self, change):
"""float_precision changed, set float_format accordingly.
float_precision can be set by int or str.
This will set float_format, after interpreting input.
If numpy has been imported, numpy print precision will also be set.
integer `n` ... | [
"def",
"_float_precision_changed",
"(",
"self",
",",
"change",
")",
":",
"new",
"=",
"change",
"[",
"'new'",
"]",
"if",
"'%'",
"in",
"new",
":",
"# got explicit format string",
"fmt",
"=",
"new",
"try",
":",
"fmt",
"%",
"3.14159",
"except",
"Exception",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/formatters.py#L619-L663 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/stats_ops.py | python | set_stats_aggregator | (stats_aggregator, prefix="", counter_prefix="") | return _apply_fn | Set the given `stats_aggregator` for aggregating the input dataset stats.
Args:
stats_aggregator: A `tf.data.experimental.StatsAggregator` object.
prefix: (Optional) String, all statistics recorded for the input `dataset`
will have given `prefix` prepend with the name.
counter_prefix: (Optional) St... | Set the given `stats_aggregator` for aggregating the input dataset stats. | [
"Set",
"the",
"given",
"stats_aggregator",
"for",
"aggregating",
"the",
"input",
"dataset",
"stats",
"."
] | def set_stats_aggregator(stats_aggregator, prefix="", counter_prefix=""):
"""Set the given `stats_aggregator` for aggregating the input dataset stats.
Args:
stats_aggregator: A `tf.data.experimental.StatsAggregator` object.
prefix: (Optional) String, all statistics recorded for the input `dataset`
wi... | [
"def",
"set_stats_aggregator",
"(",
"stats_aggregator",
",",
"prefix",
"=",
"\"\"",
",",
"counter_prefix",
"=",
"\"\"",
")",
":",
"def",
"_apply_fn",
"(",
"dataset",
")",
":",
"return",
"dataset_ops",
".",
"_SetStatsAggregatorDataset",
"(",
"# pylint: disable=protec... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/stats_ops.py#L29-L48 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/mxnet/model.py | python | _initialize_kvstore | (kvstore, param_arrays, arg_params, param_names,
update_on_kvstore) | Initialize kvstore | Initialize kvstore | [
"Initialize",
"kvstore"
] | def _initialize_kvstore(kvstore, param_arrays, arg_params, param_names,
update_on_kvstore):
""" Initialize kvstore"""
for idx in range(len(param_arrays)):
param_on_devs = param_arrays[idx]
kvstore.init(idx, arg_params[param_names[idx]])
if update_on_kvstore:
... | [
"def",
"_initialize_kvstore",
"(",
"kvstore",
",",
"param_arrays",
",",
"arg_params",
",",
"param_names",
",",
"update_on_kvstore",
")",
":",
"for",
"idx",
"in",
"range",
"(",
"len",
"(",
"param_arrays",
")",
")",
":",
"param_on_devs",
"=",
"param_arrays",
"["... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/model.py#L78-L86 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/log/__init__.py | python | crit | (msg, *args, **kwargs) | critical error message | critical error message | [
"critical",
"error",
"message"
] | def crit(msg, *args, **kwargs):
""" critical error message """
logging.critical(msg, *args, **kwargs) | [
"def",
"crit",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"logging",
".",
"critical",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/log/__init__.py#L124-L126 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/chunk.py | python | Chunk.getname | (self) | return self.chunkname | Return the name (ID) of the current chunk. | Return the name (ID) of the current chunk. | [
"Return",
"the",
"name",
"(",
"ID",
")",
"of",
"the",
"current",
"chunk",
"."
] | def getname(self):
"""Return the name (ID) of the current chunk."""
return self.chunkname | [
"def",
"getname",
"(",
"self",
")",
":",
"return",
"self",
".",
"chunkname"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/chunk.py#L78-L80 | |
facebook/fboss | 60063db1df37c2ec0e7dcd0955c54885ea9bf7f0 | build/fbcode_builder/getdeps/fetcher.py | python | Fetcher.clean | (self) | Reverts any changes that might have been made to
the src dir | Reverts any changes that might have been made to
the src dir | [
"Reverts",
"any",
"changes",
"that",
"might",
"have",
"been",
"made",
"to",
"the",
"src",
"dir"
] | def clean(self):
"""Reverts any changes that might have been made to
the src dir"""
pass | [
"def",
"clean",
"(",
"self",
")",
":",
"pass"
] | https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/build/fbcode_builder/getdeps/fetcher.py#L113-L116 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/generators.py | python | Generator.determine_output_name | (self, sources) | return self.determine_target_name(sources[0].name()) | Determine the name of the produced target from the
names of the sources. | Determine the name of the produced target from the
names of the sources. | [
"Determine",
"the",
"name",
"of",
"the",
"produced",
"target",
"from",
"the",
"names",
"of",
"the",
"sources",
"."
] | def determine_output_name(self, sources):
"""Determine the name of the produced target from the
names of the sources."""
# The simple case if when a name
# of source has single dot. Then, we take the part before
# dot. Several dots can be caused by:
# - Using sou... | [
"def",
"determine_output_name",
"(",
"self",
",",
"sources",
")",
":",
"# The simple case if when a name",
"# of source has single dot. Then, we take the part before",
"# dot. Several dots can be caused by:",
"# - Using source file like a.host.cpp",
"# - A type which suffix has a dot. Say, w... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/generators.py#L412-L435 | |
scummvm/scummvm | 9c039d027e7ffb9d83ae2e274147e2daf8d57ce2 | devtools/agi-palex.py | python | isAmigaPalette | (palette) | return True | Test if the given palette is an Amiga-style palette | Test if the given palette is an Amiga-style palette | [
"Test",
"if",
"the",
"given",
"palette",
"is",
"an",
"Amiga",
"-",
"style",
"palette"
] | def isAmigaPalette(palette):
"""Test if the given palette is an Amiga-style palette"""
# Palette must be of correct size
if len(palette) != colorsPerPalette:
return False
# First palette color must be black and last palette color must be black
if palette[whiteColorNum] != decodedWhite or palette[blackColorNum] ... | [
"def",
"isAmigaPalette",
"(",
"palette",
")",
":",
"# Palette must be of correct size",
"if",
"len",
"(",
"palette",
")",
"!=",
"colorsPerPalette",
":",
"return",
"False",
"# First palette color must be black and last palette color must be black",
"if",
"palette",
"[",
"whi... | https://github.com/scummvm/scummvm/blob/9c039d027e7ffb9d83ae2e274147e2daf8d57ce2/devtools/agi-palex.py#L78-L97 | |
dmlc/nnvm | dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38 | python/nnvm/top/attr_dict.py | python | AttrDict.get_int_pair_tuple | (self, key) | return tuple((flat[i], flat[i+1]) for i in range(0, len(flat), 2)) | Get tuple of integer pairs from attr dict
Parameters
----------
key : str
The attr key
Returns
-------
tuple : tuple of int pairs
The result tuple | Get tuple of integer pairs from attr dict | [
"Get",
"tuple",
"of",
"integer",
"pairs",
"from",
"attr",
"dict"
] | def get_int_pair_tuple(self, key):
"""Get tuple of integer pairs from attr dict
Parameters
----------
key : str
The attr key
Returns
-------
tuple : tuple of int pairs
The result tuple
"""
flat = [int(x.strip(' [] ')) for ... | [
"def",
"get_int_pair_tuple",
"(",
"self",
",",
"key",
")",
":",
"flat",
"=",
"[",
"int",
"(",
"x",
".",
"strip",
"(",
"' [] '",
")",
")",
"for",
"x",
"in",
"self",
"[",
"key",
"]",
"[",
"1",
":",
"-",
"1",
"]",
".",
"split",
"(",
"\",\"",
")"... | https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/top/attr_dict.py#L55-L69 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/cptools.py | python | redirect | (url='', internal=True, debug=False) | Raise InternalRedirect or HTTPRedirect to the given url. | Raise InternalRedirect or HTTPRedirect to the given url. | [
"Raise",
"InternalRedirect",
"or",
"HTTPRedirect",
"to",
"the",
"given",
"url",
"."
] | def redirect(url='', internal=True, debug=False):
"""Raise InternalRedirect or HTTPRedirect to the given url."""
if debug:
cherrypy.log('Redirecting %sto: %s' %
({True: 'internal ', False: ''}[internal], url),
'TOOLS.REDIRECT')
if internal:
raise che... | [
"def",
"redirect",
"(",
"url",
"=",
"''",
",",
"internal",
"=",
"True",
",",
"debug",
"=",
"False",
")",
":",
"if",
"debug",
":",
"cherrypy",
".",
"log",
"(",
"'Redirecting %sto: %s'",
"%",
"(",
"{",
"True",
":",
"'internal '",
",",
"False",
":",
"''... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/cptools.py#L441-L450 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/training_ops.py | python | _ApplyMomentumShape | (op) | return [grad_shape] | Shape function for the ApplyMomentum op. | Shape function for the ApplyMomentum op. | [
"Shape",
"function",
"for",
"the",
"ApplyMomentum",
"op",
"."
] | def _ApplyMomentumShape(op):
"""Shape function for the ApplyMomentum op."""
var_shape = op.inputs[0].get_shape()
accum_shape = op.inputs[1].get_shape().merge_with(var_shape)
_AssertInputIsScalar(op, 2) # lr
grad_shape = op.inputs[3].get_shape().merge_with(accum_shape)
_AssertInputIsScalar(op, 4) # momentu... | [
"def",
"_ApplyMomentumShape",
"(",
"op",
")",
":",
"var_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"accum_shape",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
".",
"get_shape",
"(",
")",
".",
"merge_with",
"(",
"var_shap... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/training_ops.py#L115-L122 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTypeCategory.AddTypeSynthetic | (self, *args) | return _lldb.SBTypeCategory_AddTypeSynthetic(self, *args) | AddTypeSynthetic(self, SBTypeNameSpecifier arg0, SBTypeSynthetic arg1) -> bool | AddTypeSynthetic(self, SBTypeNameSpecifier arg0, SBTypeSynthetic arg1) -> bool | [
"AddTypeSynthetic",
"(",
"self",
"SBTypeNameSpecifier",
"arg0",
"SBTypeSynthetic",
"arg1",
")",
"-",
">",
"bool"
] | def AddTypeSynthetic(self, *args):
"""AddTypeSynthetic(self, SBTypeNameSpecifier arg0, SBTypeSynthetic arg1) -> bool"""
return _lldb.SBTypeCategory_AddTypeSynthetic(self, *args) | [
"def",
"AddTypeSynthetic",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBTypeCategory_AddTypeSynthetic",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10856-L10858 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/array_creations.py | python | asarray_const | (a, dtype=None) | return Tensor(a, dtype=dtype) | Converts the input to tensor. Note here `a` cannot be tensor itself. | Converts the input to tensor. Note here `a` cannot be tensor itself. | [
"Converts",
"the",
"input",
"to",
"tensor",
".",
"Note",
"here",
"a",
"cannot",
"be",
"tensor",
"itself",
"."
] | def asarray_const(a, dtype=None):
"""Converts the input to tensor. Note here `a` cannot be tensor itself."""
_check_input_for_asarray(a)
if dtype is not None:
dtype = _check_dtype(dtype)
if isinstance(a, (float, int, bool)) and dtype is None:
dtype = _get_dtype_from_scalar(a)
if i... | [
"def",
"asarray_const",
"(",
"a",
",",
"dtype",
"=",
"None",
")",
":",
"_check_input_for_asarray",
"(",
"a",
")",
"if",
"dtype",
"is",
"not",
"None",
":",
"dtype",
"=",
"_check_dtype",
"(",
"dtype",
")",
"if",
"isinstance",
"(",
"a",
",",
"(",
"float",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/array_creations.py#L104-L137 | |
OGRECave/ogre-next | 287307980e6de8910f04f3cc0994451b075071fd | Tools/BlenderExport/ogrepkg/armatureexport.py | python | ArmatureExporter.getBoneIndex | (self, boneName) | return index | Returns bone index for a given bone name.
@param boneName Name of the bone.
@return Bone index or <code>None</code> if a bone with the given name does not exist. | Returns bone index for a given bone name. | [
"Returns",
"bone",
"index",
"for",
"a",
"given",
"bone",
"name",
"."
] | def getBoneIndex(self, boneName):
"""Returns bone index for a given bone name.
@param boneName Name of the bone.
@return Bone index or <code>None</code> if a bone with the given name does not exist.
"""
if self.boneIndices.has_key(boneName):
index = self.boneIndices[boneName]
else:
index = No... | [
"def",
"getBoneIndex",
"(",
"self",
",",
"boneName",
")",
":",
"if",
"self",
".",
"boneIndices",
".",
"has_key",
"(",
"boneName",
")",
":",
"index",
"=",
"self",
".",
"boneIndices",
"[",
"boneName",
"]",
"else",
":",
"index",
"=",
"None",
"return",
"in... | https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/armatureexport.py#L494-L504 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Listbox.itemconfigure | (self, index, cnf=None, **kw) | return self._configure(('itemconfigure', index), cnf, kw) | Configure resources of an ITEM.
The values for resources are specified as keyword arguments.
To get an overview about the allowed keyword arguments
call the method without arguments.
Valid resource names: background, bg, foreground, fg,
selectbackground, selectforeground. | Configure resources of an ITEM. | [
"Configure",
"resources",
"of",
"an",
"ITEM",
"."
] | def itemconfigure(self, index, cnf=None, **kw):
"""Configure resources of an ITEM.
The values for resources are specified as keyword arguments.
To get an overview about the allowed keyword arguments
call the method without arguments.
Valid resource names: background, bg, foregro... | [
"def",
"itemconfigure",
"(",
"self",
",",
"index",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_configure",
"(",
"(",
"'itemconfigure'",
",",
"index",
")",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2622-L2630 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py | python | Logger.exception | (self, msg, *args, exc_info=True, **kwargs) | Convenience method for logging an ERROR with exception information. | Convenience method for logging an ERROR with exception information. | [
"Convenience",
"method",
"for",
"logging",
"an",
"ERROR",
"with",
"exception",
"information",
"."
] | def exception(self, msg, *args, exc_info=True, **kwargs):
"""
Convenience method for logging an ERROR with exception information.
"""
self.error(msg, *args, exc_info=exc_info, **kwargs) | [
"def",
"exception",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"exc_info",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"error",
"(",
"msg",
",",
"*",
"args",
",",
"exc_info",
"=",
"exc_info",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L1409-L1413 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/restful/api/request.py | python | Request.get | (self, **kwargs) | return context.instance.requests | List all the available requests | List all the available requests | [
"List",
"all",
"the",
"available",
"requests"
] | def get(self, **kwargs):
"""
List all the available requests
"""
return context.instance.requests | [
"def",
"get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"context",
".",
"instance",
".",
"requests"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/restful/api/request.py#L48-L52 | |
CMU-Perceptual-Computing-Lab/caffe_rtpose | a4778bb1c3eb74d7250402016047216f77b4dba6 | scripts/cpp_lint.py | python | CheckCaffeAlternatives | (filename, clean_lines, linenum, error) | Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The nu... | Checks for C(++) functions for which a Caffe substitute should be used. | [
"Checks",
"for",
"C",
"(",
"++",
")",
"functions",
"for",
"which",
"a",
"Caffe",
"substitute",
"should",
"be",
"used",
"."
] | def CheckCaffeAlternatives(filename, clean_lines, linenum, error):
"""Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_... | [
"def",
"CheckCaffeAlternatives",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
",",
"alts",
"in",
"caffe_alt_function_list",
":",
"ix",
"=",
"li... | https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/blob/a4778bb1c3eb74d7250402016047216f77b4dba6/scripts/cpp_lint.py#L1572-L1592 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/util/nest.py | python | map_structure | (func, *structure, **check_types_dict) | return pack_sequence_as(
structure[0], [func(*x) for x in entries]) | Applies `func` to each entry in `structure` and returns a new structure.
Applies `func(x[0], x[1], ...)` where x[i] is an entry in
`structure[i]`. All structures in `structure` must have the same arity,
and the return value will contain the results in the same structure.
Args:
func: A callable that accep... | Applies `func` to each entry in `structure` and returns a new structure. | [
"Applies",
"func",
"to",
"each",
"entry",
"in",
"structure",
"and",
"returns",
"a",
"new",
"structure",
"."
] | def map_structure(func, *structure, **check_types_dict):
"""Applies `func` to each entry in `structure` and returns a new structure.
Applies `func(x[0], x[1], ...)` where x[i] is an entry in
`structure[i]`. All structures in `structure` must have the same arity,
and the return value will contain the results i... | [
"def",
"map_structure",
"(",
"func",
",",
"*",
"structure",
",",
"*",
"*",
"check_types_dict",
")",
":",
"if",
"not",
"callable",
"(",
"func",
")",
":",
"raise",
"TypeError",
"(",
"\"func must be callable, got: %s\"",
"%",
"func",
")",
"if",
"not",
"structur... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/util/nest.py#L195-L245 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/models/PortFactory.py | python | PortFactory.__init__ | (self) | Private Constructor (singleton pattern) | Private Constructor (singleton pattern) | [
"Private",
"Constructor",
"(",
"singleton",
"pattern",
")"
] | def __init__(self):
"""
Private Constructor (singleton pattern)
"""
self.__parsed = None
self.__instance = None
self.__configured_visitors = dict() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"__parsed",
"=",
"None",
"self",
".",
"__instance",
"=",
"None",
"self",
".",
"__configured_visitors",
"=",
"dict",
"(",
")"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/PortFactory.py#L41-L47 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddPropertiesForNonRepeatedScalarField | (field, cls) | Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits are set as a side-effect, and we also perform
type-checking.... | Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits are set as a side-effect, and we also perform
type-checking. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"nonrepeated",
"scalar",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"and",
"directly",
"set",
"the",
"value",
"of",
"the",
"field",
".",
"Note",
"that",
"whe... | def _AddPropertiesForNonRepeatedScalarField(field, cls):
"""Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits ... | [
"def",
"_AddPropertiesForNonRepeatedScalarField",
"(",
"field",
",",
"cls",
")",
":",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_field_name",
")",
"type_checker",
"=",
"type_checkers",
".",
"GetTypeChecker",
"(",
... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L489-L521 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | is_mask | (m) | Return True if m is a valid, standard mask.
This function does not check the contents of the input, only that the
type is MaskType. In particular, this function returns False if the
mask has a flexible dtype.
Parameters
----------
m : array_like
Array to test.
Returns
-------
... | Return True if m is a valid, standard mask. | [
"Return",
"True",
"if",
"m",
"is",
"a",
"valid",
"standard",
"mask",
"."
] | def is_mask(m):
"""
Return True if m is a valid, standard mask.
This function does not check the contents of the input, only that the
type is MaskType. In particular, this function returns False if the
mask has a flexible dtype.
Parameters
----------
m : array_like
Array to tes... | [
"def",
"is_mask",
"(",
"m",
")",
":",
"try",
":",
"return",
"m",
".",
"dtype",
".",
"type",
"is",
"MaskType",
"except",
"AttributeError",
":",
"return",
"False"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L1359-L1424 | ||
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/routing/debug_passage_region.py | python | print_help_command | () | Print command help information.
Print help information of command.
Args: | Print command help information. | [
"Print",
"command",
"help",
"information",
"."
] | def print_help_command():
"""Print command help information.
Print help information of command.
Args:
"""
print('type in command: [q] [r]')
print(' q exit')
print(' p plot passage region') | [
"def",
"print_help_command",
"(",
")",
":",
"print",
"(",
"'type in command: [q] [r]'",
")",
"print",
"(",
"' q exit'",
")",
"print",
"(",
"' p plot passage region'",
")"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/routing/debug_passage_region.py#L112-L122 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | _frommethod.getdoc | (self) | Return the doc of the function (from the doc of the method). | Return the doc of the function (from the doc of the method). | [
"Return",
"the",
"doc",
"of",
"the",
"function",
"(",
"from",
"the",
"doc",
"of",
"the",
"method",
")",
"."
] | def getdoc(self):
"Return the doc of the function (from the doc of the method)."
meth = getattr(MaskedArray, self.__name__, None) or\
getattr(np, self.__name__, None)
signature = self.__name__ + get_object_signature(meth)
if meth is not None:
doc = """ %s\n%s""... | [
"def",
"getdoc",
"(",
"self",
")",
":",
"meth",
"=",
"getattr",
"(",
"MaskedArray",
",",
"self",
".",
"__name__",
",",
"None",
")",
"or",
"getattr",
"(",
"np",
",",
"self",
".",
"__name__",
",",
"None",
")",
"signature",
"=",
"self",
".",
"__name__",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L6665-L6673 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pickletools.py | python | read_unicodestring1 | (f) | r"""
>>> import io
>>> s = 'abcd\uabcd'
>>> enc = s.encode('utf-8')
>>> enc
b'abcd\xea\xaf\x8d'
>>> n = bytes([len(enc)]) # little-endian 1-byte length
>>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
>>> s == t
True
>>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
... | r"""
>>> import io
>>> s = 'abcd\uabcd'
>>> enc = s.encode('utf-8')
>>> enc
b'abcd\xea\xaf\x8d'
>>> n = bytes([len(enc)]) # little-endian 1-byte length
>>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
>>> s == t
True | [
"r",
">>>",
"import",
"io",
">>>",
"s",
"=",
"abcd",
"\\",
"uabcd",
">>>",
"enc",
"=",
"s",
".",
"encode",
"(",
"utf",
"-",
"8",
")",
">>>",
"enc",
"b",
"abcd",
"\\",
"xea",
"\\",
"xaf",
"\\",
"x8d",
">>>",
"n",
"=",
"bytes",
"(",
"[",
"len",... | def read_unicodestring1(f):
r"""
>>> import io
>>> s = 'abcd\uabcd'
>>> enc = s.encode('utf-8')
>>> enc
b'abcd\xea\xaf\x8d'
>>> n = bytes([len(enc)]) # little-endian 1-byte length
>>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
>>> s == t
True
>>> read_unicodestr... | [
"def",
"read_unicodestring1",
"(",
"f",
")",
":",
"n",
"=",
"read_uint1",
"(",
"f",
")",
"assert",
"n",
">=",
"0",
"data",
"=",
"f",
".",
"read",
"(",
"n",
")",
"if",
"len",
"(",
"data",
")",
"==",
"n",
":",
"return",
"str",
"(",
"data",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pickletools.py#L629-L653 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/random.py | python | SystemRandom._notimplemented | (self, *args, **kwds) | Method should not be called for a system random number generator. | Method should not be called for a system random number generator. | [
"Method",
"should",
"not",
"be",
"called",
"for",
"a",
"system",
"random",
"number",
"generator",
"."
] | def _notimplemented(self, *args, **kwds):
"Method should not be called for a system random number generator."
raise NotImplementedError('System entropy source does not have state.') | [
"def",
"_notimplemented",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"raise",
"NotImplementedError",
"(",
"'System entropy source does not have state.'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/random.py#L834-L836 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/symbolic.py | python | Context.addVar | (self,name,type='V',size=None) | return v | Creates a new Variable with the given name, type, and size.
Valid types include:
- V: vector (default)
- M: matrix
- N: numeric (generic float or integer)
- B: boolean
- I: integer
- A: generic array
- X: index
size is a hint for vector variables... | Creates a new Variable with the given name, type, and size. | [
"Creates",
"a",
"new",
"Variable",
"with",
"the",
"given",
"name",
"type",
"and",
"size",
"."
] | def addVar(self,name,type='V',size=None):
"""Creates a new Variable with the given name, type, and size.
Valid types include:
- V: vector (default)
- M: matrix
- N: numeric (generic float or integer)
- B: boolean
- I: integer
- A: generic array
- ... | [
"def",
"addVar",
"(",
"self",
",",
"name",
",",
"type",
"=",
"'V'",
",",
"size",
"=",
"None",
")",
":",
"if",
"name",
"in",
"self",
".",
"variableDict",
":",
"raise",
"RuntimeError",
"(",
"\"Variable \"",
"+",
"name",
"+",
"\" already exists\"",
")",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/symbolic.py#L1039-L1064 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/reshape/merge.py | python | merge_ordered | (
left: DataFrame,
right: DataFrame,
on: IndexLabel | None = None,
left_on: IndexLabel | None = None,
right_on: IndexLabel | None = None,
left_by=None,
right_by=None,
fill_method: str | None = None,
suffixes: Suffixes = ("_x", "_y"),
how: str = "outer",
) | return result | Perform merge with optional filling/interpolation.
Designed for ordered data like time series data. Optionally
perform group-wise merge (see examples).
Parameters
----------
left : DataFrame
right : DataFrame
on : label or list
Field names to join on. Must be found in both DataFram... | Perform merge with optional filling/interpolation. | [
"Perform",
"merge",
"with",
"optional",
"filling",
"/",
"interpolation",
"."
] | def merge_ordered(
left: DataFrame,
right: DataFrame,
on: IndexLabel | None = None,
left_on: IndexLabel | None = None,
right_on: IndexLabel | None = None,
left_by=None,
right_by=None,
fill_method: str | None = None,
suffixes: Suffixes = ("_x", "_y"),
how: str = "outer",
) -> Data... | [
"def",
"merge_ordered",
"(",
"left",
":",
"DataFrame",
",",
"right",
":",
"DataFrame",
",",
"on",
":",
"IndexLabel",
"|",
"None",
"=",
"None",
",",
"left_on",
":",
"IndexLabel",
"|",
"None",
"=",
"None",
",",
"right_on",
":",
"IndexLabel",
"|",
"None",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/reshape/merge.py#L184-L322 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythplugins/mytharchive/mythburn/scripts/mythburn.py | python | isFileOkayForDVD | (file, folder) | return True | return true if the file is dvd compliant | return true if the file is dvd compliant | [
"return",
"true",
"if",
"the",
"file",
"is",
"dvd",
"compliant"
] | def isFileOkayForDVD(file, folder):
"""return true if the file is dvd compliant"""
if not getVideoCodec(folder).lower().startswith("mpeg2video"):
return False
# if (getAudioCodec(folder)).lower() != "ac3" and encodeToAC3:
# return False
videosize = getVideoSize(os.path.join(folder, "st... | [
"def",
"isFileOkayForDVD",
"(",
"file",
",",
"folder",
")",
":",
"if",
"not",
"getVideoCodec",
"(",
"folder",
")",
".",
"lower",
"(",
")",
".",
"startswith",
"(",
"\"mpeg2video\"",
")",
":",
"return",
"False",
"# if (getAudioCodec(folder)).lower() != \"ac3\" an... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mytharchive/mythburn/scripts/mythburn.py#L4462-L4490 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/ops/tpu_ops.py | python | cross_replica_sum | (x, group_assignment=None, name=None) | return gen_tpu_ops.cross_replica_sum(x, group_assignment, name=name) | Sum the input tensor across replicas according to group_assignment.
Args:
x: The local tensor to the sum.
group_assignment: Optional 2d int32 lists with shape [num_groups,
num_replicas_per_group]. `group_assignment[i]` represents the replica ids
in the ith subgroup.
name: Optional op name.
... | Sum the input tensor across replicas according to group_assignment. | [
"Sum",
"the",
"input",
"tensor",
"across",
"replicas",
"according",
"to",
"group_assignment",
"."
] | def cross_replica_sum(x, group_assignment=None, name=None):
"""Sum the input tensor across replicas according to group_assignment.
Args:
x: The local tensor to the sum.
group_assignment: Optional 2d int32 lists with shape [num_groups,
num_replicas_per_group]. `group_assignment[i]` represents the repl... | [
"def",
"cross_replica_sum",
"(",
"x",
",",
"group_assignment",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"group_assignment",
"is",
"None",
":",
"group_assignment",
"=",
"_create_default_group_assignment",
"(",
")",
"return",
"gen_tpu_ops",
".",
"cro... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/ops/tpu_ops.py#L89-L105 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pydoc.py | python | synopsis | (filename, cache={}) | return result | Get the one-line summary out of a module file. | Get the one-line summary out of a module file. | [
"Get",
"the",
"one",
"-",
"line",
"summary",
"out",
"of",
"a",
"module",
"file",
"."
] | def synopsis(filename, cache={}):
"""Get the one-line summary out of a module file."""
mtime = os.stat(filename).st_mtime
lastupdate, result = cache.get(filename, (None, None))
if lastupdate is None or lastupdate < mtime:
info = inspect.getmoduleinfo(filename)
try:
file = ope... | [
"def",
"synopsis",
"(",
"filename",
",",
"cache",
"=",
"{",
"}",
")",
":",
"mtime",
"=",
"os",
".",
"stat",
"(",
"filename",
")",
".",
"st_mtime",
"lastupdate",
",",
"result",
"=",
"cache",
".",
"get",
"(",
"filename",
",",
"(",
"None",
",",
"None"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pydoc.py#L212-L232 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cognito/identity/layer1.py | python | CognitoIdentityConnection.update_identity_pool | (self, identity_pool_id, identity_pool_name,
allow_unauthenticated_identities,
supported_login_providers=None,
developer_provider_name=None,
open_id_connect_provider_ar_ns=None) | return self.make_request(action='UpdateIdentityPool',
body=json.dumps(params)) | Updates a user pool.
:type identity_pool_id: string
:param identity_pool_id: An identity pool ID in the format REGION:GUID.
:type identity_pool_name: string
:param identity_pool_name: A string that you provide.
:type allow_unauthenticated_identities: boolean
:param all... | Updates a user pool. | [
"Updates",
"a",
"user",
"pool",
"."
] | def update_identity_pool(self, identity_pool_id, identity_pool_name,
allow_unauthenticated_identities,
supported_login_providers=None,
developer_provider_name=None,
open_id_connect_provider_ar_ns=None):
... | [
"def",
"update_identity_pool",
"(",
"self",
",",
"identity_pool_id",
",",
"identity_pool_name",
",",
"allow_unauthenticated_identities",
",",
"supported_login_providers",
"=",
"None",
",",
"developer_provider_name",
"=",
"None",
",",
"open_id_connect_provider_ar_ns",
"=",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cognito/identity/layer1.py#L483-L525 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/policy.py | python | Policy.__init__ | (self, game, player_ids) | Initializes a policy.
Args:
game: the game for which this policy applies
player_ids: list of player ids for which this policy applies; each should
be in the range 0..game.num_players()-1. | Initializes a policy. | [
"Initializes",
"a",
"policy",
"."
] | def __init__(self, game, player_ids):
"""Initializes a policy.
Args:
game: the game for which this policy applies
player_ids: list of player ids for which this policy applies; each should
be in the range 0..game.num_players()-1.
"""
self.game = game
self.player_ids = player_ids | [
"def",
"__init__",
"(",
"self",
",",
"game",
",",
"player_ids",
")",
":",
"self",
".",
"game",
"=",
"game",
"self",
".",
"player_ids",
"=",
"player_ids"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/policy.py#L113-L122 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py | python | getpager | () | Decide what method to use for paging through text. | Decide what method to use for paging through text. | [
"Decide",
"what",
"method",
"to",
"use",
"for",
"paging",
"through",
"text",
"."
] | def getpager():
"""Decide what method to use for paging through text."""
if type(sys.stdout) is not types.FileType:
return plainpager
if not sys.stdin.isatty() or not sys.stdout.isatty():
return plainpager
if 'PAGER' in os.environ:
if sys.platform == 'win32': # pipes completely b... | [
"def",
"getpager",
"(",
")",
":",
"if",
"type",
"(",
"sys",
".",
"stdout",
")",
"is",
"not",
"types",
".",
"FileType",
":",
"return",
"plainpager",
"if",
"not",
"sys",
".",
"stdin",
".",
"isatty",
"(",
")",
"or",
"not",
"sys",
".",
"stdout",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py#L1339-L1368 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.__init__ | (self, debug_dump) | DebugAnalyzer constructor.
Args:
debug_dump: A DebugDumpDir object. | DebugAnalyzer constructor. | [
"DebugAnalyzer",
"constructor",
"."
] | def __init__(self, debug_dump):
"""DebugAnalyzer constructor.
Args:
debug_dump: A DebugDumpDir object.
"""
self._debug_dump = debug_dump
# Initialize tensor filters state.
self._tensor_filters = {}
# Argument parsers for command handlers.
self._arg_parsers = {}
# Parser fo... | [
"def",
"__init__",
"(",
"self",
",",
"debug_dump",
")",
":",
"self",
".",
"_debug_dump",
"=",
"debug_dump",
"# Initialize tensor filters state.",
"self",
".",
"_tensor_filters",
"=",
"{",
"}",
"# Argument parsers for command handlers.",
"self",
".",
"_arg_parsers",
"=... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/cli/analyzer_cli.py#L55-L189 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Misc.winfo_visualsavailable | (self, includeids=False) | return [self.__winfo_parseitem(x) for x in data] | Return a list of all visuals available for the screen
of this widget.
Each item in the list consists of a visual name (see winfo_visual), a
depth and if includeids is true is given also the X identifier. | Return a list of all visuals available for the screen
of this widget. | [
"Return",
"a",
"list",
"of",
"all",
"visuals",
"available",
"for",
"the",
"screen",
"of",
"this",
"widget",
"."
] | def winfo_visualsavailable(self, includeids=False):
"""Return a list of all visuals available for the screen
of this widget.
Each item in the list consists of a visual name (see winfo_visual), a
depth and if includeids is true is given also the X identifier."""
data = self.tk.ca... | [
"def",
"winfo_visualsavailable",
"(",
"self",
",",
"includeids",
"=",
"False",
")",
":",
"data",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'visualsavailable'",
",",
"self",
".",
"_w",
",",
"'includeids'",
"if",
"includeids",
"else",
"None"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L1123-L1132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.