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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/tools/docs/py_guide_parser.py | python | PyGuideParser.process | (self, full_path) | return ret | Read and process the file at `full_path`. | Read and process the file at `full_path`. | [
"Read",
"and",
"process",
"the",
"file",
"at",
"full_path",
"."
] | def process(self, full_path):
"""Read and process the file at `full_path`."""
md_string = open(full_path).read()
self._lines = md_string.split('\n')
seen = set()
in_blockquote = False
for i, line in enumerate(self._lines):
if '```' in line:
in_blockquote = not in_blockquote
... | [
"def",
"process",
"(",
"self",
",",
"full_path",
")",
":",
"md_string",
"=",
"open",
"(",
"full_path",
")",
".",
"read",
"(",
")",
"self",
".",
"_lines",
"=",
"md_string",
".",
"split",
"(",
"'\\n'",
")",
"seen",
"=",
"set",
"(",
")",
"in_blockquote"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/py_guide_parser.py#L45-L82 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | InstalledDistribution.read_exports | (self) | return result | Read exports data from a file in .ini format.
:return: A dictionary of exports, mapping an export category to a list
of :class:`ExportEntry` instances describing the individual
export entries. | Read exports data from a file in .ini format. | [
"Read",
"exports",
"data",
"from",
"a",
"file",
"in",
".",
"ini",
"format",
"."
] | def read_exports(self):
"""
Read exports data from a file in .ini format.
:return: A dictionary of exports, mapping an export category to a list
of :class:`ExportEntry` instances describing the individual
export entries.
"""
result = {}
... | [
"def",
"read_exports",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"EXPORTS_FILENAME",
")",
"if",
"r",
":",
"with",
"contextlib",
".",
"closing",
"(",
"r",
".",
"as_stream",
"(",
")",
")",
"as",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L617-L630 | |
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L1258-L1301 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Platform/virtualenv.py | python | Virtualenv | () | return None | Returns path to the virtualenv home if scons is executing within a
virtualenv or None, if not. | Returns path to the virtualenv home if scons is executing within a
virtualenv or None, if not. | [
"Returns",
"path",
"to",
"the",
"virtualenv",
"home",
"if",
"scons",
"is",
"executing",
"within",
"a",
"virtualenv",
"or",
"None",
"if",
"not",
"."
] | def Virtualenv():
"""Returns path to the virtualenv home if scons is executing within a
virtualenv or None, if not."""
if _running_in_virtualenv():
return sys.prefix
return None | [
"def",
"Virtualenv",
"(",
")",
":",
"if",
"_running_in_virtualenv",
"(",
")",
":",
"return",
"sys",
".",
"prefix",
"return",
"None"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Platform/virtualenv.py#L97-L102 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/writers/AbstractWriter.py | python | AbstractWriter.setGenerateEmptyFile | (self) | This method is used to set a flag indicating that an empty file
should be generated. This is just a flag. It is up to the derived
class to ensure an empty file is generated for the code snippet
producers. | This method is used to set a flag indicating that an empty file
should be generated. This is just a flag. It is up to the derived
class to ensure an empty file is generated for the code snippet
producers. | [
"This",
"method",
"is",
"used",
"to",
"set",
"a",
"flag",
"indicating",
"that",
"an",
"empty",
"file",
"should",
"be",
"generated",
".",
"This",
"is",
"just",
"a",
"flag",
".",
"It",
"is",
"up",
"to",
"the",
"derived",
"class",
"to",
"ensure",
"an",
... | def setGenerateEmptyFile(self):
"""
This method is used to set a flag indicating that an empty file
should be generated. This is just a flag. It is up to the derived
class to ensure an empty file is generated for the code snippet
producers.
"""
self.__generate_emp... | [
"def",
"setGenerateEmptyFile",
"(",
"self",
")",
":",
"self",
".",
"__generate_empty_file",
"=",
"True"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/AbstractWriter.py#L43-L50 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/tools/docs/generate_lib.py | python | _is_free_function | (py_object, full_name, index) | return True | Check if input is a free function (and not a class- or static method). | Check if input is a free function (and not a class- or static method). | [
"Check",
"if",
"input",
"is",
"a",
"free",
"function",
"(",
"and",
"not",
"a",
"class",
"-",
"or",
"static",
"method",
")",
"."
] | def _is_free_function(py_object, full_name, index):
"""Check if input is a free function (and not a class- or static method)."""
if not tf_inspect.isfunction(py_object):
return False
# Static methods are functions to tf_inspect (in 2.7), so check if the parent
# is a class. If there is no parent, it's not ... | [
"def",
"_is_free_function",
"(",
"py_object",
",",
"full_name",
",",
"index",
")",
":",
"if",
"not",
"tf_inspect",
".",
"isfunction",
"(",
"py_object",
")",
":",
"return",
"False",
"# Static methods are functions to tf_inspect (in 2.7), so check if the parent",
"# is a cl... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/generate_lib.py#L36-L50 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | validateNameValue | (value) | return ret | Validate that the given value match Name production | Validate that the given value match Name production | [
"Validate",
"that",
"the",
"given",
"value",
"match",
"Name",
"production"
] | def validateNameValue(value):
"""Validate that the given value match Name production """
ret = libxml2mod.xmlValidateNameValue(value)
return ret | [
"def",
"validateNameValue",
"(",
"value",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlValidateNameValue",
"(",
"value",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1052-L1055 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | ext/scintilla/scripts/Dependencies.py | python | ExtractDependencies | (input) | return deps | Create a list of dependencies from input list of lines
Each element contains the name of the object and a list of
files that it depends on.
Dependencies that contain "/usr/" are removed as they are system headers. | Create a list of dependencies from input list of lines
Each element contains the name of the object and a list of
files that it depends on.
Dependencies that contain "/usr/" are removed as they are system headers. | [
"Create",
"a",
"list",
"of",
"dependencies",
"from",
"input",
"list",
"of",
"lines",
"Each",
"element",
"contains",
"the",
"name",
"of",
"the",
"object",
"and",
"a",
"list",
"of",
"files",
"that",
"it",
"depends",
"on",
".",
"Dependencies",
"that",
"contai... | def ExtractDependencies(input):
""" Create a list of dependencies from input list of lines
Each element contains the name of the object and a list of
files that it depends on.
Dependencies that contain "/usr/" are removed as they are system headers. """
deps = []
for line in input:
headersLine = line.startswit... | [
"def",
"ExtractDependencies",
"(",
"input",
")",
":",
"deps",
"=",
"[",
"]",
"for",
"line",
"in",
"input",
":",
"headersLine",
"=",
"line",
".",
"startswith",
"(",
"\" \"",
")",
"or",
"line",
".",
"startswith",
"(",
"\"\\t\"",
")",
"line",
"=",
"line",... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/ext/scintilla/scripts/Dependencies.py#L104-L123 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genlisp/src/genlisp/generate.py | python | generate_msg_from_spec | (msg_context, spec, search_path, output_dir, package) | Generate a message
@param msg_path: The path to the .msg file
@type msg_path: str | Generate a message | [
"Generate",
"a",
"message"
] | def generate_msg_from_spec(msg_context, spec, search_path, output_dir, package):
"""
Generate a message
@param msg_path: The path to the .msg file
@type msg_path: str
"""
genmsg.msg_loader.load_depends(msg_context, spec, search_path)
spec.actual_name=spec.short_name
spec.component_t... | [
"def",
"generate_msg_from_spec",
"(",
"msg_context",
",",
"spec",
",",
"search_path",
",",
"output_dir",
",",
"package",
")",
":",
"genmsg",
".",
"msg_loader",
".",
"load_depends",
"(",
"msg_context",
",",
"spec",
",",
"search_path",
")",
"spec",
".",
"actual_... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genlisp/src/genlisp/generate.py#L741-L823 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlDoc.newDocPI | (self, name, content) | return __tmp | Creation of a processing instruction element. | Creation of a processing instruction element. | [
"Creation",
"of",
"a",
"processing",
"instruction",
"element",
"."
] | def newDocPI(self, name, content):
"""Creation of a processing instruction element. """
ret = libxml2mod.xmlNewDocPI(self._o, name, content)
if ret is None:raise treeError('xmlNewDocPI() failed')
__tmp = xmlNode(_obj=ret)
return __tmp | [
"def",
"newDocPI",
"(",
"self",
",",
"name",
",",
"content",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlNewDocPI",
"(",
"self",
".",
"_o",
",",
"name",
",",
"content",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlNewDocPI() fa... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4300-L4305 | |
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L988-L990 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/adapters.py | python | HTTPAdapter.request_url | (self, request, proxies) | return url | Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is only exposed for use
when subclassing the
... | Obtain the url to use when making the final request. | [
"Obtain",
"the",
"url",
"to",
"use",
"when",
"making",
"the",
"final",
"request",
"."
] | def request_url(self, request, proxies):
"""Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is o... | [
"def",
"request_url",
"(",
"self",
",",
"request",
",",
"proxies",
")",
":",
"proxy",
"=",
"select_proxy",
"(",
"request",
".",
"url",
",",
"proxies",
")",
"scheme",
"=",
"urlparse",
"(",
"request",
".",
"url",
")",
".",
"scheme",
"is_proxied_http_request"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/adapters.py#L323-L350 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File.changed_timestamp_match | (self, target, prev_ni, repo_node=None) | Return True if the timestamps don't match or if there is no previous timestamp
:param target:
:param prev_ni: Information about the node from the previous build
:return: | Return True if the timestamps don't match or if there is no previous timestamp
:param target:
:param prev_ni: Information about the node from the previous build
:return: | [
"Return",
"True",
"if",
"the",
"timestamps",
"don",
"t",
"match",
"or",
"if",
"there",
"is",
"no",
"previous",
"timestamp",
":",
"param",
"target",
":",
":",
"param",
"prev_ni",
":",
"Information",
"about",
"the",
"node",
"from",
"the",
"previous",
"build"... | def changed_timestamp_match(self, target, prev_ni, repo_node=None):
"""
Return True if the timestamps don't match or if there is no previous timestamp
:param target:
:param prev_ni: Information about the node from the previous build
:return:
"""
try:
r... | [
"def",
"changed_timestamp_match",
"(",
"self",
",",
"target",
",",
"prev_ni",
",",
"repo_node",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"get_timestamp",
"(",
")",
"!=",
"prev_ni",
".",
"timestamp",
"except",
"AttributeError",
":",
"return",... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L3487-L3497 | ||
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/common/walterWidgets/itemStyle.py | python | ItemStyle.subElementRect | (self, element, option, widget=None) | return self.__parent.subElementRect(element, option, widget) | Return the sub-area for the given element as described in the provided
style option. The returned rectangle is defined in screen coordinates. | Return the sub-area for the given element as described in the provided
style option. The returned rectangle is defined in screen coordinates. | [
"Return",
"the",
"sub",
"-",
"area",
"for",
"the",
"given",
"element",
"as",
"described",
"in",
"the",
"provided",
"style",
"option",
".",
"The",
"returned",
"rectangle",
"is",
"defined",
"in",
"screen",
"coordinates",
"."
] | def subElementRect(self, element, option, widget=None):
"""
Return the sub-area for the given element as described in the provided
style option. The returned rectangle is defined in screen coordinates.
"""
return self.__parent.subElementRect(element, option, widget) | [
"def",
"subElementRect",
"(",
"self",
",",
"element",
",",
"option",
",",
"widget",
"=",
"None",
")",
":",
"return",
"self",
".",
"__parent",
".",
"subElementRect",
"(",
"element",
",",
"option",
",",
"widget",
")"
] | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/itemStyle.py#L148-L153 | |
bilibili/biliobs | 573613dc3b2b63fe7c1506cc94717609a2c52c0c | base/android/jni_generator/jni_generator.py | python | InlHeaderFileGenerator.GetRegisterCalledByNativesImplString | (self) | return '\n'.join(ret) | Returns the code for registering the called by native methods. | Returns the code for registering the called by native methods. | [
"Returns",
"the",
"code",
"for",
"registering",
"the",
"called",
"by",
"native",
"methods",
"."
] | def GetRegisterCalledByNativesImplString(self):
"""Returns the code for registering the called by native methods."""
if not self.options.eager_called_by_natives:
return ''
template = Template("""\
g_${JAVA_CLASS}_${METHOD_ID_VAR_NAME} = ${GET_METHOD_ID_IMPL}
if (g_${JAVA_CLASS}_${METHOD_ID_VAR_NAM... | [
"def",
"GetRegisterCalledByNativesImplString",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"options",
".",
"eager_called_by_natives",
":",
"return",
"''",
"template",
"=",
"Template",
"(",
"\"\"\"\\\n g_${JAVA_CLASS}_${METHOD_ID_VAR_NAME} = ${GET_METHOD_ID_IMPL}\n if (... | https://github.com/bilibili/biliobs/blob/573613dc3b2b63fe7c1506cc94717609a2c52c0c/base/android/jni_generator/jni_generator.py#L906-L924 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py | python | DocComment.__repr__ | (self) | return '<DocComment: %s, %s>' % (
str(self.ordered_params), str(self.__flags)) | Returns a string representation of this object.
Returns:
A string representation of this object. | Returns a string representation of this object. | [
"Returns",
"a",
"string",
"representation",
"of",
"this",
"object",
"."
] | def __repr__(self):
"""Returns a string representation of this object.
Returns:
A string representation of this object.
"""
return '<DocComment: %s, %s>' % (
str(self.ordered_params), str(self.__flags)) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"'<DocComment: %s, %s>'",
"%",
"(",
"str",
"(",
"self",
".",
"ordered_params",
")",
",",
"str",
"(",
"self",
".",
"__flags",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L569-L576 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/subfields/thalamus.py | python | ThalamicNuclei.get_cheating_gaussians | (self, sameGaussianParameters) | return (means, variances) | Return a tuple of (means, variances) for the initial segmentation-fitting stage. | Return a tuple of (means, variances) for the initial segmentation-fitting stage. | [
"Return",
"a",
"tuple",
"of",
"(",
"means",
"variances",
")",
"for",
"the",
"initial",
"segmentation",
"-",
"fitting",
"stage",
"."
] | def get_cheating_gaussians(self, sameGaussianParameters):
"""
Return a tuple of (means, variances) for the initial segmentation-fitting stage.
"""
means = np.zeros(len(sameGaussianParameters))
variances = 0.01 * np.ones(len(sameGaussianParameters))
for i in range(len(same... | [
"def",
"get_cheating_gaussians",
"(",
"self",
",",
"sameGaussianParameters",
")",
":",
"means",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"sameGaussianParameters",
")",
")",
"variances",
"=",
"0.01",
"*",
"np",
".",
"ones",
"(",
"len",
"(",
"sameGaussianPara... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/subfields/thalamus.py#L200-L216 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Main/glue/vboxapi.py | python | PlatformBase.waitForEvents | (self, cMsTimeout) | return 2 | Wait for events to arrive and process them.
The timeout (cMsTimeout) is in milliseconds for how long to wait for
events to arrive. A negative value means waiting for ever, while 0
does not wait at all.
Returns 0 if events was processed.
Returns 1 if timed out or interrupted in... | Wait for events to arrive and process them. | [
"Wait",
"for",
"events",
"to",
"arrive",
"and",
"process",
"them",
"."
] | def waitForEvents(self, cMsTimeout):
"""
Wait for events to arrive and process them.
The timeout (cMsTimeout) is in milliseconds for how long to wait for
events to arrive. A negative value means waiting for ever, while 0
does not wait at all.
Returns 0 if events was pr... | [
"def",
"waitForEvents",
"(",
"self",
",",
"cMsTimeout",
")",
":",
"_",
"=",
"cMsTimeout",
"return",
"2"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Main/glue/vboxapi.py#L290-L306 | |
rprichard/CxxCodeBrowser | a2fa83d2fe06119f0a7a1827b8167fab88b53561 | third_party/libre2/lib/codereview/codereview.py | python | GetEmail | (prompt) | return email | Prompts the user for their email address and returns it.
The last used email address is saved to a file and offered up as a suggestion
to the user. If the user presses enter without typing in anything the last
used email address is used. If the user enters a new address, it is saved
for next time we prompt. | Prompts the user for their email address and returns it. | [
"Prompts",
"the",
"user",
"for",
"their",
"email",
"address",
"and",
"returns",
"it",
"."
] | def GetEmail(prompt):
"""Prompts the user for their email address and returns it.
The last used email address is saved to a file and offered up as a suggestion
to the user. If the user presses enter without typing in anything the last
used email address is used. If the user enters a new address, it is saved
for n... | [
"def",
"GetEmail",
"(",
"prompt",
")",
":",
"last_email_file_name",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"\"~/.last_codereview_email_address\"",
")",
"last_email",
"=",
"\"\"",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"last_email_file_name",
")",
... | https://github.com/rprichard/CxxCodeBrowser/blob/a2fa83d2fe06119f0a7a1827b8167fab88b53561/third_party/libre2/lib/codereview/codereview.py#L2702-L2731 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/core.py | python | CatBoost.save_model | (self, fname, format="cbm", export_parameters=None, pool=None) | Save the model to a file.
Parameters
----------
fname : string
Output file name.
format : string
Possible values:
* 'cbm' for catboost binary format,
* 'coreml' to export into Apple CoreML format
* 'onnx' to export ... | Save the model to a file. | [
"Save",
"the",
"model",
"to",
"a",
"file",
"."
] | def save_model(self, fname, format="cbm", export_parameters=None, pool=None):
"""
Save the model to a file.
Parameters
----------
fname : string
Output file name.
format : string
Possible values:
* 'cbm' for catboost binary format,... | [
"def",
"save_model",
"(",
"self",
",",
"fname",
",",
"format",
"=",
"\"cbm\"",
",",
"export_parameters",
"=",
"None",
",",
"pool",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"is_fitted",
"(",
")",
":",
"raise",
"CatBoostError",
"(",
"\"There is no ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L3114-L3155 | ||
alexozer/jankdrone | c4b403eb254b41b832ab2bdfade12ba59c99e5dc | shm/lib/pyratemp/pyratemp.py | python | EvalPseudoSandbox.f_setvar | (self, name, expr) | return "" | ``setvar()`` for the sandboxed code.
Set a variable.
:Example: see module-docstring | ``setvar()`` for the sandboxed code. | [
"setvar",
"()",
"for",
"the",
"sandboxed",
"code",
"."
] | def f_setvar(self, name, expr):
"""``setvar()`` for the sandboxed code.
Set a variable.
:Example: see module-docstring
"""
self.vars_ptr[name] = self.eval(expr, self.vars_ptr)
return "" | [
"def",
"f_setvar",
"(",
"self",
",",
"name",
",",
"expr",
")",
":",
"self",
".",
"vars_ptr",
"[",
"name",
"]",
"=",
"self",
".",
"eval",
"(",
"expr",
",",
"self",
".",
"vars_ptr",
")",
"return",
"\"\""
] | https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/shm/lib/pyratemp/pyratemp.py#L995-L1003 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntH.GetDatV | (self, *args) | return _snap.TIntH_GetDatV(self, *args) | GetDatV(TIntH self, TIntV DatV)
Parameters:
DatV: TVec< TInt > & | GetDatV(TIntH self, TIntV DatV) | [
"GetDatV",
"(",
"TIntH",
"self",
"TIntV",
"DatV",
")"
] | def GetDatV(self, *args):
"""
GetDatV(TIntH self, TIntV DatV)
Parameters:
DatV: TVec< TInt > &
"""
return _snap.TIntH_GetDatV(self, *args) | [
"def",
"GetDatV",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TIntH_GetDatV",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L18703-L18711 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/filecmp.py | python | cmpfiles | (a, b, common, shallow=1) | return res | Compare common files in two directories.
a, b -- directory names
common -- list of file names found in both directories
shallow -- if true, do comparison based solely on stat() information
Returns a tuple of three lists:
files that compare equal
files that are different
filenames tha... | Compare common files in two directories. | [
"Compare",
"common",
"files",
"in",
"two",
"directories",
"."
] | def cmpfiles(a, b, common, shallow=1):
"""Compare common files in two directories.
a, b -- directory names
common -- list of file names found in both directories
shallow -- if true, do comparison based solely on stat() information
Returns a tuple of three lists:
files that compare equal
... | [
"def",
"cmpfiles",
"(",
"a",
",",
"b",
",",
"common",
",",
"shallow",
"=",
"1",
")",
":",
"res",
"=",
"(",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
")",
"for",
"x",
"in",
"common",
":",
"ax",
"=",
"os",
".",
"path",
".",
"join",
"(",
"a",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/filecmp.py#L241-L259 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListCtrl.SetColumnsOrder | (*args, **kwargs) | return _controls_.ListCtrl_SetColumnsOrder(*args, **kwargs) | SetColumnsOrder(self, wxArrayInt orders) -> bool | SetColumnsOrder(self, wxArrayInt orders) -> bool | [
"SetColumnsOrder",
"(",
"self",
"wxArrayInt",
"orders",
")",
"-",
">",
"bool"
] | def SetColumnsOrder(*args, **kwargs):
"""SetColumnsOrder(self, wxArrayInt orders) -> bool"""
return _controls_.ListCtrl_SetColumnsOrder(*args, **kwargs) | [
"def",
"SetColumnsOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_SetColumnsOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4493-L4495 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/forces.py | python | InputForces.fetch | (self) | return flist | Returns a list of the output objects included in this dynamic
container.
Returns:
A list of tuples, with each tuple being of the form ('type', 'object'),
where 'type' is the type of forcefield, and 'object' is a | Returns a list of the output objects included in this dynamic
container. | [
"Returns",
"a",
"list",
"of",
"the",
"output",
"objects",
"included",
"in",
"this",
"dynamic",
"container",
"."
] | def fetch(self):
"""Returns a list of the output objects included in this dynamic
container.
Returns:
A list of tuples, with each tuple being of the form ('type', 'object'),
where 'type' is the type of forcefield, and 'object' is a
"""
super(InputForces, self).fetch()
... | [
"def",
"fetch",
"(",
"self",
")",
":",
"super",
"(",
"InputForces",
",",
"self",
")",
".",
"fetch",
"(",
")",
"flist",
"=",
"[",
"(",
"n",
",",
"f",
".",
"fetch",
"(",
")",
")",
"for",
"(",
"n",
",",
"f",
")",
"in",
"self",
".",
"extra",
"]... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/forces.py#L145-L157 | |
learnforpractice/pyeos | 4f04eb982c86c1fdb413084af77c713a6fda3070 | libraries/vm/vm_cpython_ss/lib/codecs.py | python | StreamWriter.__init__ | (self, stream, errors='strict') | Creates a StreamWriter instance.
stream must be a file-like object open for writing.
The StreamWriter may use different error handling
schemes by providing the errors keyword argument. These
parameters are predefined:
'strict' - raise a ValueError (or a su... | Creates a StreamWriter instance. | [
"Creates",
"a",
"StreamWriter",
"instance",
"."
] | def __init__(self, stream, errors='strict'):
""" Creates a StreamWriter instance.
stream must be a file-like object open for writing.
The StreamWriter may use different error handling
schemes by providing the errors keyword argument. These
parameters are predef... | [
"def",
"__init__",
"(",
"self",
",",
"stream",
",",
"errors",
"=",
"'strict'",
")",
":",
"self",
".",
"stream",
"=",
"stream",
"self",
".",
"errors",
"=",
"errors"
] | https://github.com/learnforpractice/pyeos/blob/4f04eb982c86c1fdb413084af77c713a6fda3070/libraries/vm/vm_cpython_ss/lib/codecs.py#L347-L370 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm.scores | (self) | return (self._all_scores, self._scores) | Returns the distances to each class.
Returns:
A tuple with two Tensors. The first contains the distance to
each class. The second contains the distance to the assigned
class. | Returns the distances to each class. | [
"Returns",
"the",
"distances",
"to",
"each",
"class",
"."
] | def scores(self):
"""Returns the distances to each class.
Returns:
A tuple with two Tensors. The first contains the distance to
each class. The second contains the distance to the assigned
class.
"""
return (self._all_scores, self._scores) | [
"def",
"scores",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_all_scores",
",",
"self",
".",
"_scores",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L194-L202 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py | python | get_distribution | (req_name) | return _search_distribution(req_name) | Given a requirement name, return the installed Distribution object.
This searches from *all* distributions available in the environment, to
match the behavior of ``pkg_resources.get_distribution()``. | Given a requirement name, return the installed Distribution object. | [
"Given",
"a",
"requirement",
"name",
"return",
"the",
"installed",
"Distribution",
"object",
"."
] | def get_distribution(req_name):
# type: (str) -> Optional[Distribution]
"""Given a requirement name, return the installed Distribution object.
This searches from *all* distributions available in the environment, to
match the behavior of ``pkg_resources.get_distribution()``.
"""
# Searc... | [
"def",
"get_distribution",
"(",
"req_name",
")",
":",
"# type: (str) -> Optional[Distribution]",
"# Search the distribution by looking through the working set",
"dist",
"=",
"_search_distribution",
"(",
"req_name",
")",
"# If distribution could not be found, call working_set.require",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py#L1007-L1057 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.dot | (self, size=None, *color) | Draw a dot with diameter size, using color.
Optional arguments:
size -- an integer >= 1 (if given)
color -- a colorstring or a numeric color tuple
Draw a circular dot with diameter size, using color.
If size is not given, the maximum of pensize+4 and 2*pensize is used.
... | Draw a dot with diameter size, using color. | [
"Draw",
"a",
"dot",
"with",
"diameter",
"size",
"using",
"color",
"."
] | def dot(self, size=None, *color):
"""Draw a dot with diameter size, using color.
Optional arguments:
size -- an integer >= 1 (if given)
color -- a colorstring or a numeric color tuple
Draw a circular dot with diameter size, using color.
If size is not given, the maximum... | [
"def",
"dot",
"(",
"self",
",",
"size",
"=",
"None",
",",
"*",
"color",
")",
":",
"#print \"dot-1:\", size, color",
"if",
"not",
"color",
":",
"if",
"isinstance",
"(",
"size",
",",
"(",
"str",
",",
"tuple",
")",
")",
":",
"color",
"=",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L3215-L3264 | ||
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | tools/extra/extract_seconds.py | python | get_start_time | (line_iterable, year) | return start_datetime | Find start time from group of lines | Find start time from group of lines | [
"Find",
"start",
"time",
"from",
"group",
"of",
"lines"
] | def get_start_time(line_iterable, year):
"""Find start time from group of lines
"""
start_datetime = None
for line in line_iterable:
line = line.strip()
if line.find('Solving') != -1:
start_datetime = extract_datetime_from_line(line, year)
break
return start_... | [
"def",
"get_start_time",
"(",
"line_iterable",
",",
"year",
")",
":",
"start_datetime",
"=",
"None",
"for",
"line",
"in",
"line_iterable",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
".",
"find",
"(",
"'Solving'",
")",
"!=",
"-",
"1... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/tools/extra/extract_seconds.py#L31-L41 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/package_index.py | python | find_external_links | (url, page) | Find rel="homepage" and rel="download" links in `page`, yielding URLs | Find rel="homepage" and rel="download" links in `page`, yielding URLs | [
"Find",
"rel",
"=",
"homepage",
"and",
"rel",
"=",
"download",
"links",
"in",
"page",
"yielding",
"URLs"
] | def find_external_links(url, page):
"""Find rel="homepage" and rel="download" links in `page`, yielding URLs"""
for match in REL.finditer(page):
tag, rel = match.groups()
rels = set(map(str.strip, rel.lower().split(',')))
if 'homepage' in rels or 'download' in rels:
for matc... | [
"def",
"find_external_links",
"(",
"url",
",",
"page",
")",
":",
"for",
"match",
"in",
"REL",
".",
"finditer",
"(",
"page",
")",
":",
"tag",
",",
"rel",
"=",
"match",
".",
"groups",
"(",
")",
"rels",
"=",
"set",
"(",
"map",
"(",
"str",
".",
"stri... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/package_index.py#L205-L220 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/macostools.py | python | copy | (src, dst, createpath=0, copydates=1, forcetype=None) | Copy a file, including finder info, resource fork, etc | Copy a file, including finder info, resource fork, etc | [
"Copy",
"a",
"file",
"including",
"finder",
"info",
"resource",
"fork",
"etc"
] | def copy(src, dst, createpath=0, copydates=1, forcetype=None):
"""Copy a file, including finder info, resource fork, etc"""
src = File.pathname(src)
dst = File.pathname(dst)
if createpath:
mkdirs(os.path.split(dst)[0])
ifp = open(src, 'rb')
ofp = open(dst, 'wb')
d = ifp.read(BUFSIZ)... | [
"def",
"copy",
"(",
"src",
",",
"dst",
",",
"createpath",
"=",
"0",
",",
"copydates",
"=",
"1",
",",
"forcetype",
"=",
"None",
")",
":",
"src",
"=",
"File",
".",
"pathname",
"(",
"src",
")",
"dst",
"=",
"File",
".",
"pathname",
"(",
"dst",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/macostools.py#L90-L128 | ||
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/unit_tree/html_output.py | python | cleanurl | (url) | return urllib.parse.quote(url, encoding='utf-8') | Encode the given URL to ensure it only contains valid URL characters
(also known as percent-encoding). | Encode the given URL to ensure it only contains valid URL characters
(also known as percent-encoding). | [
"Encode",
"the",
"given",
"URL",
"to",
"ensure",
"it",
"only",
"contains",
"valid",
"URL",
"characters",
"(",
"also",
"known",
"as",
"percent",
"-",
"encoding",
")",
"."
] | def cleanurl(url):
"""
Encode the given URL to ensure it only contains valid URL characters
(also known as percent-encoding).
"""
if url is None:
return url
return urllib.parse.quote(url, encoding='utf-8') | [
"def",
"cleanurl",
"(",
"url",
")",
":",
"if",
"url",
"is",
"None",
":",
"return",
"url",
"return",
"urllib",
".",
"parse",
".",
"quote",
"(",
"url",
",",
"encoding",
"=",
"'utf-8'",
")"
] | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/unit_tree/html_output.py#L181-L188 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/dbgen/cinder.py | python | grab_cinder_dat | (build_dir="", datapath='') | return rtn | Grabs the cinder.dat file from the DATAPATH directory if not already
present. | Grabs the cinder.dat file from the DATAPATH directory if not already
present. | [
"Grabs",
"the",
"cinder",
".",
"dat",
"file",
"from",
"the",
"DATAPATH",
"directory",
"if",
"not",
"already",
"present",
"."
] | def grab_cinder_dat(build_dir="", datapath=''):
"""Grabs the cinder.dat file from the DATAPATH directory if not already
present."""
build_filename = os.path.join(build_dir, 'cinder.dat')
if os.path.exists(build_filename):
return True
if isinstance(datapath, basestring) and 0 < len(datapath)... | [
"def",
"grab_cinder_dat",
"(",
"build_dir",
"=",
"\"\"",
",",
"datapath",
"=",
"''",
")",
":",
"build_filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"build_dir",
",",
"'cinder.dat'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"build_filename... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/dbgen/cinder.py#L25-L53 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_set.py | python | RequirementSet.__init__ | (self, require_hashes=False, check_supported_wheels=True) | Create a RequirementSet. | Create a RequirementSet. | [
"Create",
"a",
"RequirementSet",
"."
] | def __init__(self, require_hashes=False, check_supported_wheels=True):
# type: (bool, bool) -> None
"""Create a RequirementSet.
"""
self.requirements = OrderedDict() # type: Dict[str, InstallRequirement] # noqa: E501
self.require_hashes = require_hashes
self.check_supp... | [
"def",
"__init__",
"(",
"self",
",",
"require_hashes",
"=",
"False",
",",
"check_supported_wheels",
"=",
"True",
")",
":",
"# type: (bool, bool) -> None",
"self",
".",
"requirements",
"=",
"OrderedDict",
"(",
")",
"# type: Dict[str, InstallRequirement] # noqa: E501",
"... | 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/_internal/req/req_set.py#L21-L34 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/distributions/python/ops/mvn.py | python | MultivariateNormalCholesky.__init__ | (self,
mu,
chol,
validate_args=False,
allow_nan_stats=True,
name="MultivariateNormalCholesky") | Multivariate Normal distributions on `R^k`.
User must provide means `mu` and `chol` which holds the (batch) Cholesky
factors, such that the covariance of each batch member is `chol chol^T`.
Args:
mu: `(N+1)-D` floating point tensor with shape `[N1,...,Nb, k]`,
`b >= 0`.
chol: `(N+2)-D`... | Multivariate Normal distributions on `R^k`. | [
"Multivariate",
"Normal",
"distributions",
"on",
"R^k",
"."
] | def __init__(self,
mu,
chol,
validate_args=False,
allow_nan_stats=True,
name="MultivariateNormalCholesky"):
"""Multivariate Normal distributions on `R^k`.
User must provide means `mu` and `chol` which holds the (batch) Cholesky
fact... | [
"def",
"__init__",
"(",
"self",
",",
"mu",
",",
"chol",
",",
"validate_args",
"=",
"False",
",",
"allow_nan_stats",
"=",
"True",
",",
"name",
"=",
"\"MultivariateNormalCholesky\"",
")",
":",
"cov",
"=",
"operator_pd_cholesky",
".",
"OperatorPDCholesky",
"(",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/mvn.py#L580-L615 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/tex.py | python | bibunitscan | (self) | return nodes | Parse the inputs and try to find the *bibunit* dependencies
:return: list of bibunit files
:rtype: list of :py:class:`waflib.Node.Node` | Parse the inputs and try to find the *bibunit* dependencies | [
"Parse",
"the",
"inputs",
"and",
"try",
"to",
"find",
"the",
"*",
"bibunit",
"*",
"dependencies"
] | def bibunitscan(self):
"""
Parse the inputs and try to find the *bibunit* dependencies
:return: list of bibunit files
:rtype: list of :py:class:`waflib.Node.Node`
"""
node = self.inputs[0]
nodes = []
if not node: return nodes
code = node.read()
for match in re_bibunit.finditer(code):
path = match.group(... | [
"def",
"bibunitscan",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"inputs",
"[",
"0",
"]",
"nodes",
"=",
"[",
"]",
"if",
"not",
"node",
":",
"return",
"nodes",
"code",
"=",
"node",
".",
"read",
"(",
")",
"for",
"match",
"in",
"re_bibunit",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/tex.py#L35-L63 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/jellyfish-2.2.0/swig/python/jellyfish.py | python | HashCounter.__getitem__ | (self, *args) | return _jellyfish.HashCounter___getitem__(self, *args) | Read a Jellyfish database sequentially | Read a Jellyfish database sequentially | [
"Read",
"a",
"Jellyfish",
"database",
"sequentially"
] | def __getitem__(self, *args):
"""Read a Jellyfish database sequentially"""
return _jellyfish.HashCounter___getitem__(self, *args) | [
"def",
"__getitem__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_jellyfish",
".",
"HashCounter___getitem__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/jellyfish-2.2.0/swig/python/jellyfish.py#L298-L300 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/pytables.py | python | Table.ncols | (self) | return sum(len(a.values) for a in self.values_axes) | the number of total columns in the values axes | the number of total columns in the values axes | [
"the",
"number",
"of",
"total",
"columns",
"in",
"the",
"values",
"axes"
] | def ncols(self):
""" the number of total columns in the values axes """
return sum(len(a.values) for a in self.values_axes) | [
"def",
"ncols",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"len",
"(",
"a",
".",
"values",
")",
"for",
"a",
"in",
"self",
".",
"values_axes",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L3202-L3204 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | libs/lv2/lv2specgen/lv2specgen.py | python | owlInfo | (term, m) | return res | Returns an extra information that is defined about a term using OWL. | Returns an extra information that is defined about a term using OWL. | [
"Returns",
"an",
"extra",
"information",
"that",
"is",
"defined",
"about",
"a",
"term",
"using",
"OWL",
"."
] | def owlInfo(term, m):
"""Returns an extra information that is defined about a term using OWL."""
res = ''
# Inverse properties ( owl:inverseOf )
first = True
for st in findStatements(m, term, owl.inverseOf, None):
res += getProperty(getTermLink(getObject(st)), first)
first = False
... | [
"def",
"owlInfo",
"(",
"term",
",",
"m",
")",
":",
"res",
"=",
"''",
"# Inverse properties ( owl:inverseOf )",
"first",
"=",
"True",
"for",
"st",
"in",
"findStatements",
"(",
"m",
",",
"term",
",",
"owl",
".",
"inverseOf",
",",
"None",
")",
":",
"res",
... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/libs/lv2/lv2specgen/lv2specgen.py#L624-L649 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FMRendererXP.__init__ | (self) | Default class constructor. | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self):
""" Default class constructor. """
FMRenderer.__init__(self)
self.drawLeftMargin = True
self.separatorHeight = 3
self.highlightCheckAndRadio = True
self.scrollBarButtons = True # Display scrollbar buttons if the menu doesn't fit on the scre... | [
"def",
"__init__",
"(",
"self",
")",
":",
"FMRenderer",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"drawLeftMargin",
"=",
"True",
"self",
".",
"separatorHeight",
"=",
"3",
"self",
".",
"highlightCheckAndRadio",
"=",
"True",
"self",
".",
"scrollBarButton... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1743-L1768 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/data/_utils/collate.py | python | default_collate | (batch) | r"""
Function that takes in a batch of data and puts the elements within the batch
into a tensor with an additional outer dimension - batch size. The exact output type can be
a :class:`torch.Tensor`, a `Sequence` of :class:`torch.Tensor`, a
Collection of :class:`torch.Tensor`, or left un... | r"""
Function that takes in a batch of data and puts the elements within the batch
into a tensor with an additional outer dimension - batch size. The exact output type can be
a :class:`torch.Tensor`, a `Sequence` of :class:`torch.Tensor`, a
Collection of :class:`torch.Tensor`, or left un... | [
"r",
"Function",
"that",
"takes",
"in",
"a",
"batch",
"of",
"data",
"and",
"puts",
"the",
"elements",
"within",
"the",
"batch",
"into",
"a",
"tensor",
"with",
"an",
"additional",
"outer",
"dimension",
"-",
"batch",
"size",
".",
"The",
"exact",
"output",
... | def default_collate(batch):
r"""
Function that takes in a batch of data and puts the elements within the batch
into a tensor with an additional outer dimension - batch size. The exact output type can be
a :class:`torch.Tensor`, a `Sequence` of :class:`torch.Tensor`, a
Collection of :... | [
"def",
"default_collate",
"(",
"batch",
")",
":",
"elem",
"=",
"batch",
"[",
"0",
"]",
"elem_type",
"=",
"type",
"(",
"elem",
")",
"if",
"isinstance",
"(",
"elem",
",",
"torch",
".",
"Tensor",
")",
":",
"out",
"=",
"None",
"if",
"torch",
".",
"util... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/data/_utils/collate.py#L84-L180 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/keycloak.py | python | run_admin_cmds | (ctx,config) | Running Keycloak Admin commands(kcadm commands) in order to get the token, aud value, thumbprint and realm name. | Running Keycloak Admin commands(kcadm commands) in order to get the token, aud value, thumbprint and realm name. | [
"Running",
"Keycloak",
"Admin",
"commands",
"(",
"kcadm",
"commands",
")",
"in",
"order",
"to",
"get",
"the",
"token",
"aud",
"value",
"thumbprint",
"and",
"realm",
"name",
"."
] | def run_admin_cmds(ctx,config):
"""
Running Keycloak Admin commands(kcadm commands) in order to get the token, aud value, thumbprint and realm name.
"""
assert isinstance(config, dict)
log.info('Running admin commands...')
for (client,_) in config.items():
(remote,) = ctx.cluster.only(cl... | [
"def",
"run_admin_cmds",
"(",
"ctx",
",",
"config",
")",
":",
"assert",
"isinstance",
"(",
"config",
",",
"dict",
")",
"log",
".",
"info",
"(",
"'Running admin commands...'",
")",
"for",
"(",
"client",
",",
"_",
")",
"in",
"config",
".",
"items",
"(",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/keycloak.py#L158-L418 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/sax/handler.py | python | ContentHandler.startPrefixMapping | (self, prefix, uri) | Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal
Namespace processing: the SAX XML reader will automatically
replace prefixes for element and attribute names when the
http://xml.org/sax/features/namespaces feature is true (th... | Begin the scope of a prefix-URI Namespace mapping. | [
"Begin",
"the",
"scope",
"of",
"a",
"prefix",
"-",
"URI",
"Namespace",
"mapping",
"."
] | def startPrefixMapping(self, prefix, uri):
"""Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal
Namespace processing: the SAX XML reader will automatically
replace prefixes for element and attribute names when the
http... | [
"def",
"startPrefixMapping",
"(",
"self",
",",
"prefix",
",",
"uri",
")",
":"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/handler.py#L96-L117 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/tensorboard/backend/server.py | python | ParseEventFilesSpec | (logdir) | return files | Parses `logdir` into a map from paths to run group names.
The events files flag format is a comma-separated list of path specifications.
A path specification either looks like 'group_name:/path/to/directory' or
'/path/to/directory'; in the latter case, the group is unnamed. Group names
cannot start with a forw... | Parses `logdir` into a map from paths to run group names. | [
"Parses",
"logdir",
"into",
"a",
"map",
"from",
"paths",
"to",
"run",
"group",
"names",
"."
] | def ParseEventFilesSpec(logdir):
"""Parses `logdir` into a map from paths to run group names.
The events files flag format is a comma-separated list of path specifications.
A path specification either looks like 'group_name:/path/to/directory' or
'/path/to/directory'; in the latter case, the group is unnamed. ... | [
"def",
"ParseEventFilesSpec",
"(",
"logdir",
")",
":",
"files",
"=",
"{",
"}",
"if",
"logdir",
"is",
"None",
":",
"return",
"files",
"for",
"specification",
"in",
"logdir",
".",
"split",
"(",
"','",
")",
":",
"# If it's a gcs path, don't split on colon",
"if",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/tensorboard/backend/server.py#L48-L86 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/framework/checkpoint_utils.py | python | list_variables | (checkpoint_dir) | return result | Returns list of all variables in the latest checkpoint.
Args:
checkpoint_dir: Directory with checkpoints file or path to checkpoint.
Returns:
List of tuples `(name, shape)`. | Returns list of all variables in the latest checkpoint. | [
"Returns",
"list",
"of",
"all",
"variables",
"in",
"the",
"latest",
"checkpoint",
"."
] | def list_variables(checkpoint_dir):
"""Returns list of all variables in the latest checkpoint.
Args:
checkpoint_dir: Directory with checkpoints file or path to checkpoint.
Returns:
List of tuples `(name, shape)`.
"""
reader = load_checkpoint(checkpoint_dir)
variable_map = reader.get_variable_to_sh... | [
"def",
"list_variables",
"(",
"checkpoint_dir",
")",
":",
"reader",
"=",
"load_checkpoint",
"(",
"checkpoint_dir",
")",
"variable_map",
"=",
"reader",
".",
"get_variable_to_shape_map",
"(",
")",
"names",
"=",
"sorted",
"(",
"variable_map",
".",
"keys",
"(",
")",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/framework/checkpoint_utils.py#L84-L99 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/metrics/classification.py | python | matthews_corrcoef | (y_true, y_pred, sample_weight=None) | Compute the Matthews correlation coefficient (MCC) for binary classes
The Matthews correlation coefficient is used in machine learning as a
measure of the quality of binary (two-class) classifications. It takes into
account true and false positives and negatives and is generally regarded as
a balanced ... | Compute the Matthews correlation coefficient (MCC) for binary classes | [
"Compute",
"the",
"Matthews",
"correlation",
"coefficient",
"(",
"MCC",
")",
"for",
"binary",
"classes"
] | def matthews_corrcoef(y_true, y_pred, sample_weight=None):
"""Compute the Matthews correlation coefficient (MCC) for binary classes
The Matthews correlation coefficient is used in machine learning as a
measure of the quality of binary (two-class) classifications. It takes into
account true and false po... | [
"def",
"matthews_corrcoef",
"(",
"y_true",
",",
"y_pred",
",",
"sample_weight",
"=",
"None",
")",
":",
"y_type",
",",
"y_true",
",",
"y_pred",
"=",
"_check_targets",
"(",
"y_true",
",",
"y_pred",
")",
"if",
"y_type",
"!=",
"\"binary\"",
":",
"raise",
"Valu... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/metrics/classification.py#L444-L521 | ||
thpatch/thcrap | 9a0ebc52ebc775d93a44ddfe19d1bed0c512958f | scripts/repo_update.py | python | patch_build | (patch_id, servers, f, t, ignored) | return patch_js['title'] | Updates the patch in the [f]/[patch_id] directory, ignoring the files
that match [ignored].
Ensures that patch.js contains all necessary keys and values, then updates
the checksums in files.js and, if [t] differs from [f], copies all patch
files from [f] to [t].
Returns the contents of the patch I... | Updates the patch in the [f]/[patch_id] directory, ignoring the files
that match [ignored]. | [
"Updates",
"the",
"patch",
"in",
"the",
"[",
"f",
"]",
"/",
"[",
"patch_id",
"]",
"directory",
"ignoring",
"the",
"files",
"that",
"match",
"[",
"ignored",
"]",
"."
] | def patch_build(patch_id, servers, f, t, ignored):
"""Updates the patch in the [f]/[patch_id] directory, ignoring the files
that match [ignored].
Ensures that patch.js contains all necessary keys and values, then updates
the checksums in files.js and, if [t] differs from [f], copies all patch
files... | [
"def",
"patch_build",
"(",
"patch_id",
",",
"servers",
",",
"f",
",",
"t",
",",
"ignored",
")",
":",
"f_path",
",",
"t_path",
"=",
"[",
"os",
".",
"path",
".",
"join",
"(",
"i",
",",
"patch_id",
")",
"for",
"i",
"in",
"[",
"f",
",",
"t",
"]",
... | https://github.com/thpatch/thcrap/blob/9a0ebc52ebc775d93a44ddfe19d1bed0c512958f/scripts/repo_update.py#L99-L169 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/turtle.py | python | TPen.isdown | (self) | return self._drawing | Return True if pen is down, False if it's up.
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.penup()
>>> turtle.isdown()
False
>>> turtle.pendown()
>>> turtle.isdown()
True | Return True if pen is down, False if it's up. | [
"Return",
"True",
"if",
"pen",
"is",
"down",
"False",
"if",
"it",
"s",
"up",
"."
] | def isdown(self):
"""Return True if pen is down, False if it's up.
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.penup()
>>> turtle.isdown()
False
>>> turtle.pendown()
>>> turtle.isdown()
True
"""
return se... | [
"def",
"isdown",
"(",
"self",
")",
":",
"return",
"self",
".",
"_drawing"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/turtle.py#L2038-L2051 | |
eomahony/Numberjack | 53fa9e994a36f881ffd320d8d04158097190aad8 | Numberjack/__init__.py | python | NBJ_STD_Solver.load_mps | (self, filename, extension) | Asks the underlying MIP solver to load an MPS file.
:param filename: the path to the file.
:param extension: the file's extension.
:raises UnsupportedSolverFunction: if called on a non MIP solver. | Asks the underlying MIP solver to load an MPS file. | [
"Asks",
"the",
"underlying",
"MIP",
"solver",
"to",
"load",
"an",
"MPS",
"file",
"."
] | def load_mps(self, filename, extension):
"""
Asks the underlying MIP solver to load an MPS file.
:param filename: the path to the file.
:param extension: the file's extension.
:raises UnsupportedSolverFunction: if called on a non MIP solver.
"""
if not hasattr(se... | [
"def",
"load_mps",
"(",
"self",
",",
"filename",
",",
"extension",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
".",
"solver",
",",
"'load_mps'",
")",
":",
"raise",
"UnsupportedSolverFunction",
"(",
"str",
"(",
"type",
"(",
"self",
")",
")",
",",
"\"... | https://github.com/eomahony/Numberjack/blob/53fa9e994a36f881ffd320d8d04158097190aad8/Numberjack/__init__.py#L3845-L3857 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItem.SetAlign | (self, align) | Sets the alignment for the item.
:param `align`: one of the following bits:
============================ ========= ==============================
Alignment Bits Hex Value Description
============================ ========= ==============================
``ULC_F... | Sets the alignment for the item. | [
"Sets",
"the",
"alignment",
"for",
"the",
"item",
"."
] | def SetAlign(self, align):
"""
Sets the alignment for the item.
:param `align`: one of the following bits:
============================ ========= ==============================
Alignment Bits Hex Value Description
============================ ========= ... | [
"def",
"SetAlign",
"(",
"self",
",",
"align",
")",
":",
"self",
".",
"_mask",
"|=",
"ULC_MASK_FORMAT",
"self",
".",
"_format",
"=",
"align"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L1593-L1611 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.CaptureMouse | (*args, **kwargs) | return _core_.Window_CaptureMouse(*args, **kwargs) | CaptureMouse(self)
Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
release the capture.
Note that wxWindows maintains the stack of windows having captured the
mouse and when the mouse is released the capture returns to the window
which had had captured it... | CaptureMouse(self) | [
"CaptureMouse",
"(",
"self",
")"
] | def CaptureMouse(*args, **kwargs):
"""
CaptureMouse(self)
Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
release the capture.
Note that wxWindows maintains the stack of windows having captured the
mouse and when the mouse is released the capture ... | [
"def",
"CaptureMouse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_CaptureMouse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10619-L10638 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/serde.py | python | float_ | () | return Optional(FloatSerde()) | Return an optional float serde. | Return an optional float serde. | [
"Return",
"an",
"optional",
"float",
"serde",
"."
] | def float_():
"""
Return an optional float serde.
"""
return Optional(FloatSerde()) | [
"def",
"float_",
"(",
")",
":",
"return",
"Optional",
"(",
"FloatSerde",
"(",
")",
")"
] | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/serde.py#L711-L715 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.winfo_visual | (self) | return self.tk.call('winfo', 'visual', self._w) | Return one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the
colormodel of this widget. | Return one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the
colormodel of this widget. | [
"Return",
"one",
"of",
"the",
"strings",
"directcolor",
"grayscale",
"pseudocolor",
"staticcolor",
"staticgray",
"or",
"truecolor",
"for",
"the",
"colormodel",
"of",
"this",
"widget",
"."
] | def winfo_visual(self):
"""Return one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the
colormodel of this widget."""
return self.tk.call('winfo', 'visual', self._w) | [
"def",
"winfo_visual",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'visual'",
",",
"self",
".",
"_w",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L965-L969 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/session.py | python | Session.get_available_services | (self) | return self._session.get_available_services() | Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`.
:rtype: list
:return: List of service names | Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`. | [
"Get",
"a",
"list",
"of",
"available",
"services",
"that",
"can",
"be",
"loaded",
"as",
"low",
"-",
"level",
"clients",
"via",
":",
"py",
":",
"meth",
":",
"Session",
".",
"client",
"."
] | def get_available_services(self):
"""
Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`.
:rtype: list
:return: List of service names
"""
return self._session.get_available_services() | [
"def",
"get_available_services",
"(",
"self",
")",
":",
"return",
"self",
".",
"_session",
".",
"get_available_services",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/session.py#L124-L132 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextEvent.GetUpdated | (*args, **kwargs) | return _stc.StyledTextEvent_GetUpdated(*args, **kwargs) | GetUpdated(self) -> int | GetUpdated(self) -> int | [
"GetUpdated",
"(",
"self",
")",
"-",
">",
"int"
] | def GetUpdated(*args, **kwargs):
"""GetUpdated(self) -> int"""
return _stc.StyledTextEvent_GetUpdated(*args, **kwargs) | [
"def",
"GetUpdated",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_GetUpdated",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L7198-L7200 | |
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/vkconventions.py | python | VulkanConventions.valid_flag_bit | (self, bitpos) | return bitpos >= 0 and bitpos < 31 | Return True if bitpos is an allowed numeric bit position for
an API flag bit.
Vulkan uses 32 bit Vk*Flags types, and assumes C compilers may
cause Vk*FlagBits values with bit 31 set to result in a 64 bit
enumerated type, so disallows such flags. | Return True if bitpos is an allowed numeric bit position for
an API flag bit. | [
"Return",
"True",
"if",
"bitpos",
"is",
"an",
"allowed",
"numeric",
"bit",
"position",
"for",
"an",
"API",
"flag",
"bit",
"."
] | def valid_flag_bit(self, bitpos):
"""Return True if bitpos is an allowed numeric bit position for
an API flag bit.
Vulkan uses 32 bit Vk*Flags types, and assumes C compilers may
cause Vk*FlagBits values with bit 31 set to result in a 64 bit
enumerated type, so disall... | [
"def",
"valid_flag_bit",
"(",
"self",
",",
"bitpos",
")",
":",
"return",
"bitpos",
">=",
"0",
"and",
"bitpos",
"<",
"31"
] | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/vkconventions.py#L268-L275 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSSettings.py | python | ValidateMSVSSettings | (settings, stderr=sys.stderr) | Validates that the names of the settings are valid for MSVS.
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages. | Validates that the names of the settings are valid for MSVS. | [
"Validates",
"that",
"the",
"names",
"of",
"the",
"settings",
"are",
"valid",
"for",
"MSVS",
"."
] | def ValidateMSVSSettings(settings, stderr=sys.stderr):
"""Validates that the names of the settings are valid for MSVS.
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages... | [
"def",
"ValidateMSVSSettings",
"(",
"settings",
",",
"stderr",
"=",
"sys",
".",
"stderr",
")",
":",
"_ValidateSettings",
"(",
"_msvs_validators",
",",
"settings",
",",
"stderr",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSSettings.py#L480-L488 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/python/google/platform_utils_win.py | python | GetCygwinPath | (path) | return path.replace('\\', '/') | Convert a Windows path to a cygwin path.
The cygpath utility insists on converting paths that it thinks are Cygwin
root paths to what it thinks the correct roots are. So paths such as
"C:\b\slave\webkit-release-kjs\build\third_party\cygwin\bin" are converted to
plain "/usr/bin". To avoid this, we do the conv... | Convert a Windows path to a cygwin path. | [
"Convert",
"a",
"Windows",
"path",
"to",
"a",
"cygwin",
"path",
"."
] | def GetCygwinPath(path):
"""Convert a Windows path to a cygwin path.
The cygpath utility insists on converting paths that it thinks are Cygwin
root paths to what it thinks the correct roots are. So paths such as
"C:\b\slave\webkit-release-kjs\build\third_party\cygwin\bin" are converted to
plain "/usr/bin". ... | [
"def",
"GetCygwinPath",
"(",
"path",
")",
":",
"drive_regexp",
"=",
"re",
".",
"compile",
"(",
"r'([a-z]):[/\\\\]'",
",",
"re",
".",
"IGNORECASE",
")",
"def",
"LowerDrive",
"(",
"matchobj",
")",
":",
"return",
"'/cygdrive/%s/'",
"%",
"matchobj",
".",
"group"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/python/google/platform_utils_win.py#L180-L194 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/base64.py | python | urlsafe_b64encode | (s) | return b64encode(s).translate(_urlsafe_encode_translation) | Encode bytes using the URL- and filesystem-safe Base64 alphabet.
Argument s is a bytes-like object to encode. The result is returned as a
bytes object. The alphabet uses '-' instead of '+' and '_' instead of
'/'. | Encode bytes using the URL- and filesystem-safe Base64 alphabet. | [
"Encode",
"bytes",
"using",
"the",
"URL",
"-",
"and",
"filesystem",
"-",
"safe",
"Base64",
"alphabet",
"."
] | def urlsafe_b64encode(s):
"""Encode bytes using the URL- and filesystem-safe Base64 alphabet.
Argument s is a bytes-like object to encode. The result is returned as a
bytes object. The alphabet uses '-' instead of '+' and '_' instead of
'/'.
"""
return b64encode(s).translate(_urlsafe_encode_t... | [
"def",
"urlsafe_b64encode",
"(",
"s",
")",
":",
"return",
"b64encode",
"(",
"s",
")",
".",
"translate",
"(",
"_urlsafe_encode_translation",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/base64.py#L111-L118 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_shgo_lib/triangulation.py | python | Complex.n_cube | (self, dim, symmetry=False, printout=False) | Generate the simplicial triangulation of the n dimensional hypercube
containing 2**n vertices | Generate the simplicial triangulation of the n dimensional hypercube
containing 2**n vertices | [
"Generate",
"the",
"simplicial",
"triangulation",
"of",
"the",
"n",
"dimensional",
"hypercube",
"containing",
"2",
"**",
"n",
"vertices"
] | def n_cube(self, dim, symmetry=False, printout=False):
"""
Generate the simplicial triangulation of the n dimensional hypercube
containing 2**n vertices
"""
origin = list(np.zeros(dim, dtype=int))
self.origin = origin
supremum = list(np.ones(dim, dtype=int))
... | [
"def",
"n_cube",
"(",
"self",
",",
"dim",
",",
"symmetry",
"=",
"False",
",",
"printout",
"=",
"False",
")",
":",
"origin",
"=",
"list",
"(",
"np",
".",
"zeros",
"(",
"dim",
",",
"dtype",
"=",
"int",
")",
")",
"self",
".",
"origin",
"=",
"origin"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_shgo_lib/triangulation.py#L147-L181 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGProperty.GetValidator | (*args, **kwargs) | return _propgrid.PGProperty_GetValidator(*args, **kwargs) | GetValidator(self) -> Validator | GetValidator(self) -> Validator | [
"GetValidator",
"(",
"self",
")",
"-",
">",
"Validator"
] | def GetValidator(*args, **kwargs):
"""GetValidator(self) -> Validator"""
return _propgrid.PGProperty_GetValidator(*args, **kwargs) | [
"def",
"GetValidator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_GetValidator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L775-L777 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBDebugger.SetLoggingCallback | (self, *args) | return _lldb.SBDebugger_SetLoggingCallback(self, *args) | SetLoggingCallback(self, LogOutputCallback log_callback) | SetLoggingCallback(self, LogOutputCallback log_callback) | [
"SetLoggingCallback",
"(",
"self",
"LogOutputCallback",
"log_callback",
")"
] | def SetLoggingCallback(self, *args):
"""SetLoggingCallback(self, LogOutputCallback log_callback)"""
return _lldb.SBDebugger_SetLoggingCallback(self, *args) | [
"def",
"SetLoggingCallback",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_SetLoggingCallback",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3402-L3404 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | ControlFlowState.ExitGradWhileContext | (self, op, before) | Exit the WhileContext for gradient computation. | Exit the WhileContext for gradient computation. | [
"Exit",
"the",
"WhileContext",
"for",
"gradient",
"computation",
"."
] | def ExitGradWhileContext(self, op, before):
"""Exit the WhileContext for gradient computation."""
grad_state = self._GetGradState(op, before)
if grad_state:
grad_state.grad_context.Exit() | [
"def",
"ExitGradWhileContext",
"(",
"self",
",",
"op",
",",
"before",
")",
":",
"grad_state",
"=",
"self",
".",
"_GetGradState",
"(",
"op",
",",
"before",
")",
"if",
"grad_state",
":",
"grad_state",
".",
"grad_context",
".",
"Exit",
"(",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L836-L840 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_SCHEME_ECDAA.GetUnionSelector | (self) | return TPM_ALG_ID.ECDAA | TpmUnion method | TpmUnion method | [
"TpmUnion",
"method"
] | def GetUnionSelector(self): # TPM_ALG_ID
""" TpmUnion method """
return TPM_ALG_ID.ECDAA | [
"def",
"GetUnionSelector",
"(",
"self",
")",
":",
"# TPM_ALG_ID",
"return",
"TPM_ALG_ID",
".",
"ECDAA"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6233-L6235 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | HelpProvider.GetHelp | (*args, **kwargs) | return _controls_.HelpProvider_GetHelp(*args, **kwargs) | GetHelp(self, Window window) -> String
Gets the help string for this window. Its interpretation is dependent
on the help provider except that empty string always means that no
help is associated with the window. | GetHelp(self, Window window) -> String | [
"GetHelp",
"(",
"self",
"Window",
"window",
")",
"-",
">",
"String"
] | def GetHelp(*args, **kwargs):
"""
GetHelp(self, Window window) -> String
Gets the help string for this window. Its interpretation is dependent
on the help provider except that empty string always means that no
help is associated with the window.
"""
return _contr... | [
"def",
"GetHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"HelpProvider_GetHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6235-L6243 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/main.py | python | _TopImprovements | (recent_anomalies, num_to_show) | return improvements[:num_to_show] | Fills in the given template dictionary with top improvements.
Args:
recent_anomalies: A list of Anomaly entities sorted from large to small.
num_to_show: The number of improvements to return.
Returns:
A list of top improvement Anomaly entities, in decreasing order. | Fills in the given template dictionary with top improvements. | [
"Fills",
"in",
"the",
"given",
"template",
"dictionary",
"with",
"top",
"improvements",
"."
] | def _TopImprovements(recent_anomalies, num_to_show):
"""Fills in the given template dictionary with top improvements.
Args:
recent_anomalies: A list of Anomaly entities sorted from large to small.
num_to_show: The number of improvements to return.
Returns:
A list of top improvement Anomaly entities,... | [
"def",
"_TopImprovements",
"(",
"recent_anomalies",
",",
"num_to_show",
")",
":",
"improvements",
"=",
"[",
"a",
"for",
"a",
"in",
"recent_anomalies",
"if",
"a",
".",
"is_improvement",
"]",
"return",
"improvements",
"[",
":",
"num_to_show",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/main.py#L139-L150 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOMLib/DICOMBrowser.py | python | SlicerDICOMBrowser.checkForExtensions | (self) | return extensionsToOffer | Check to see if there
are any registered extensions that might be available to
help the user work with data in the database.
1) load extension json description
2) load info for each series
3) check if data matches
then return matches
See
http://www.na-mic.org/Bug/view.php?id=4146 | Check to see if there
are any registered extensions that might be available to
help the user work with data in the database. | [
"Check",
"to",
"see",
"if",
"there",
"are",
"any",
"registered",
"extensions",
"that",
"might",
"be",
"available",
"to",
"help",
"the",
"user",
"work",
"with",
"data",
"in",
"the",
"database",
"."
] | def checkForExtensions(self):
"""Check to see if there
are any registered extensions that might be available to
help the user work with data in the database.
1) load extension json description
2) load info for each series
3) check if data matches
then return matches
See
http://www... | [
"def",
"checkForExtensions",
"(",
"self",
")",
":",
"# 1 - load json",
"import",
"logging",
",",
"os",
",",
"json",
"logging",
".",
"info",
"(",
"'Imported a DICOM directory, checking for extensions'",
")",
"modulePath",
"=",
"os",
".",
"path",
".",
"dirname",
"("... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMLib/DICOMBrowser.py#L235-L295 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/msgpack/ext.py | python | Timestamp.__repr__ | (self) | return "Timestamp(seconds={0}, nanoseconds={1})".format(
self.seconds, self.nanoseconds
) | String representation of Timestamp. | String representation of Timestamp. | [
"String",
"representation",
"of",
"Timestamp",
"."
] | def __repr__(self):
"""String representation of Timestamp."""
return "Timestamp(seconds={0}, nanoseconds={1})".format(
self.seconds, self.nanoseconds
) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"\"Timestamp(seconds={0}, nanoseconds={1})\"",
".",
"format",
"(",
"self",
".",
"seconds",
",",
"self",
".",
"nanoseconds",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/msgpack/ext.py#L137-L145 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | utils/sort_includes.py | python | sort_includes | (f) | Sort the #include lines of a specific file. | Sort the #include lines of a specific file. | [
"Sort",
"the",
"#include",
"lines",
"of",
"a",
"specific",
"file",
"."
] | def sort_includes(f):
"""Sort the #include lines of a specific file."""
# Skip files which are under INPUTS trees or test trees.
if 'INPUTS/' in f.name or 'test/' in f.name:
return
ext = os.path.splitext(f.name)[1]
if ext not in ['.cpp', '.c', '.h', '.inc', '.def']:
return
lines = f.readlines()
... | [
"def",
"sort_includes",
"(",
"f",
")",
":",
"# Skip files which are under INPUTS trees or test trees.",
"if",
"'INPUTS/'",
"in",
"f",
".",
"name",
"or",
"'test/'",
"in",
"f",
".",
"name",
":",
"return",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"f... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/utils/sort_includes.py#L14-L82 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L394-L407 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTypeMemberFunction.GetReturnType | (self) | return _lldb.SBTypeMemberFunction_GetReturnType(self) | GetReturnType(self) -> SBType | GetReturnType(self) -> SBType | [
"GetReturnType",
"(",
"self",
")",
"-",
">",
"SBType"
] | def GetReturnType(self):
"""GetReturnType(self) -> SBType"""
return _lldb.SBTypeMemberFunction_GetReturnType(self) | [
"def",
"GetReturnType",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBTypeMemberFunction_GetReturnType",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10228-L10230 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/generator.py | python | Generator.in_listed_extend_classed | (self, class_name) | return False | returns True if the class is in the list of required classes that need to extend | returns True if the class is in the list of required classes that need to extend | [
"returns",
"True",
"if",
"the",
"class",
"is",
"in",
"the",
"list",
"of",
"required",
"classes",
"that",
"need",
"to",
"extend"
] | def in_listed_extend_classed(self, class_name):
"""
returns True if the class is in the list of required classes that need to extend
"""
for key in self.classes_need_extend:
md = re.match("^" + key + "$", class_name)
if md:
return True
retu... | [
"def",
"in_listed_extend_classed",
"(",
"self",
",",
"class_name",
")",
":",
"for",
"key",
"in",
"self",
".",
"classes_need_extend",
":",
"md",
"=",
"re",
".",
"match",
"(",
"\"^\"",
"+",
"key",
"+",
"\"$\"",
",",
"class_name",
")",
"if",
"md",
":",
"r... | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/generator.py#L820-L828 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FlatNotebook.EnableTab | (self, page, enabled=True) | Enables or disables a tab.
:param `page`: an integer specifying the page index;
:param `enabled`: ``True`` to enable a tab, ``False`` to disable it. | Enables or disables a tab. | [
"Enables",
"or",
"disables",
"a",
"tab",
"."
] | def EnableTab(self, page, enabled=True):
"""
Enables or disables a tab.
:param `page`: an integer specifying the page index;
:param `enabled`: ``True`` to enable a tab, ``False`` to disable it.
"""
if page >= len(self._windows):
return
self._windows... | [
"def",
"EnableTab",
"(",
"self",
",",
"page",
",",
"enabled",
"=",
"True",
")",
":",
"if",
"page",
">=",
"len",
"(",
"self",
".",
"_windows",
")",
":",
"return",
"self",
".",
"_windows",
"[",
"page",
"]",
".",
"Enable",
"(",
"enabled",
")",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4975-L4987 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | Distribution.requires | (self, extras=()) | return deps | List of Requirements needed for this distro if `extras` are used | List of Requirements needed for this distro if `extras` are used | [
"List",
"of",
"Requirements",
"needed",
"for",
"this",
"distro",
"if",
"extras",
"are",
"used"
] | def requires(self, extras=()):
"""List of Requirements needed for this distro if `extras` are used"""
dm = self._dep_map
deps = []
deps.extend(dm.get(None, ()))
for ext in extras:
try:
deps.extend(dm[safe_extra(ext)])
except KeyError:
... | [
"def",
"requires",
"(",
"self",
",",
"extras",
"=",
"(",
")",
")",
":",
"dm",
"=",
"self",
".",
"_dep_map",
"deps",
"=",
"[",
"]",
"deps",
".",
"extend",
"(",
"dm",
".",
"get",
"(",
"None",
",",
"(",
")",
")",
")",
"for",
"ext",
"in",
"extras... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2734-L2746 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/weights_broadcast_ops.py | python | assert_broadcastable | (weights, values) | Asserts `weights` can be broadcast to `values`.
In `tf.losses` and `tf.metrics`, we support limited weight broadcasting. We
let weights be either scalar, or the same rank as the target values, with each
dimension either 1, or the same as the corresponding values dimension.
Args:
weights: `Tensor` of weigh... | Asserts `weights` can be broadcast to `values`. | [
"Asserts",
"weights",
"can",
"be",
"broadcast",
"to",
"values",
"."
] | def assert_broadcastable(weights, values):
"""Asserts `weights` can be broadcast to `values`.
In `tf.losses` and `tf.metrics`, we support limited weight broadcasting. We
let weights be either scalar, or the same rank as the target values, with each
dimension either 1, or the same as the corresponding values di... | [
"def",
"assert_broadcastable",
"(",
"weights",
",",
"values",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"\"assert_broadcastable\"",
",",
"(",
"weights",
",",
"values",
")",
")",
"as",
"scope",
":",
"with",
"ops",
".",
"name_scope",
"(",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/weights_broadcast_ops.py#L63-L133 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/dockart.py | python | AuiDefaultDockArt.GetFont | (self, id) | return wx.NullFont | Gets a font setting.
:param integer `id`: must be ``AUI_DOCKART_CAPTION_FONT``, otherwise :class:`NullFont` is returned. | Gets a font setting. | [
"Gets",
"a",
"font",
"setting",
"."
] | def GetFont(self, id):
"""
Gets a font setting.
:param integer `id`: must be ``AUI_DOCKART_CAPTION_FONT``, otherwise :class:`NullFont` is returned.
"""
if id == AUI_DOCKART_CAPTION_FONT:
return self._caption_font
return wx.NullFont | [
"def",
"GetFont",
"(",
"self",
",",
"id",
")",
":",
"if",
"id",
"==",
"AUI_DOCKART_CAPTION_FONT",
":",
"return",
"self",
".",
"_caption_font",
"return",
"wx",
".",
"NullFont"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/dockart.py#L392-L402 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/difflib.py | python | get_close_matches | (word, possibilities, n=3, cutoff=0.6) | return [x for score, x in result] | Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of strings).
Optional arg n (default 3) is the maximum number of cl... | Use SequenceMatcher to return list of the best "good enough" matches. | [
"Use",
"SequenceMatcher",
"to",
"return",
"list",
"of",
"the",
"best",
"good",
"enough",
"matches",
"."
] | def get_close_matches(word, possibilities, n=3, cutoff=0.6):
"""Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of s... | [
"def",
"get_close_matches",
"(",
"word",
",",
"possibilities",
",",
"n",
"=",
"3",
",",
"cutoff",
"=",
"0.6",
")",
":",
"if",
"not",
"n",
">",
"0",
":",
"raise",
"ValueError",
"(",
"\"n must be > 0: %r\"",
"%",
"(",
"n",
",",
")",
")",
"if",
"not",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/difflib.py#L701-L747 | |
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/wesnoth/wmlparser3.py | python | TagNode.wml | (self) | return s | Returns a (binary) WML representation of the entire node.
All attribute values are enclosed in quotes and quotes are
escaped (as double quotes). Note that no other escaping is
performed (see the BinaryWML specification for additional
escaping you may require). | Returns a (binary) WML representation of the entire node.
All attribute values are enclosed in quotes and quotes are
escaped (as double quotes). Note that no other escaping is
performed (see the BinaryWML specification for additional
escaping you may require). | [
"Returns",
"a",
"(",
"binary",
")",
"WML",
"representation",
"of",
"the",
"entire",
"node",
".",
"All",
"attribute",
"values",
"are",
"enclosed",
"in",
"quotes",
"and",
"quotes",
"are",
"escaped",
"(",
"as",
"double",
"quotes",
")",
".",
"Note",
"that",
... | def wml(self) -> bytes:
"""
Returns a (binary) WML representation of the entire node.
All attribute values are enclosed in quotes and quotes are
escaped (as double quotes). Note that no other escaping is
performed (see the BinaryWML specification for additional
escaping y... | [
"def",
"wml",
"(",
"self",
")",
"->",
"bytes",
":",
"s",
"=",
"b\"[\"",
"+",
"self",
".",
"name",
"+",
"b\"]\\n\"",
"for",
"sub",
"in",
"self",
".",
"data",
":",
"s",
"+=",
"sub",
".",
"wml",
"(",
")",
"+",
"b\"\\n\"",
"s",
"+=",
"b\"[/\"",
"+"... | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmlparser3.py#L187-L199 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | EvtHandler.QueueEvent | (*args, **kwargs) | return _core_.EvtHandler_QueueEvent(*args, **kwargs) | QueueEvent(self, Event event) | QueueEvent(self, Event event) | [
"QueueEvent",
"(",
"self",
"Event",
"event",
")"
] | def QueueEvent(*args, **kwargs):
"""QueueEvent(self, Event event)"""
return _core_.EvtHandler_QueueEvent(*args, **kwargs) | [
"def",
"QueueEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"EvtHandler_QueueEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L4164-L4166 | |
lhmRyan/deep-supervised-hashing-DSH | 631901f82e2ab031fbac33f914a5b08ef8e21d57 | scripts/cpp_lint.py | python | UpdateIncludeState | (filename, include_state, io=codecs) | return True | Fill up the include_state with new includes found from the file.
Args:
filename: the name of the header to read.
include_state: an _IncludeState instance in which the headers are inserted.
io: The io factory to use to read the file. Provided for testability.
Returns:
True if a header was succesful... | Fill up the include_state with new includes found from the file. | [
"Fill",
"up",
"the",
"include_state",
"with",
"new",
"includes",
"found",
"from",
"the",
"file",
"."
] | def UpdateIncludeState(filename, include_state, io=codecs):
"""Fill up the include_state with new includes found from the file.
Args:
filename: the name of the header to read.
include_state: an _IncludeState instance in which the headers are inserted.
io: The io factory to use to read the file. Provide... | [
"def",
"UpdateIncludeState",
"(",
"filename",
",",
"include_state",
",",
"io",
"=",
"codecs",
")",
":",
"headerfile",
"=",
"None",
"try",
":",
"headerfile",
"=",
"io",
".",
"open",
"(",
"filename",
",",
"'r'",
",",
"'utf8'",
",",
"'replace'",
")",
"excep... | https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/scripts/cpp_lint.py#L4454-L4480 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/ipython_view.py | python | IterableIPShell.shell | (self, cmd,verbose=0,debug=0,header='') | !
Replacement method to allow shell commands without them blocking.
@param cmd: Shell command to execute.
@param verbose: Verbosity
@param debug: Debug level
@param header: Header to be printed before output
@return none | !
Replacement method to allow shell commands without them blocking. | [
"!",
"Replacement",
"method",
"to",
"allow",
"shell",
"commands",
"without",
"them",
"blocking",
"."
] | def shell(self, cmd,verbose=0,debug=0,header=''):
"""!
Replacement method to allow shell commands without them blocking.
@param cmd: Shell command to execute.
@param verbose: Verbosity
@param debug: Debug level
@param header: Header to be printed before output
@return none
"""
s... | [
"def",
"shell",
"(",
"self",
",",
"cmd",
",",
"verbose",
"=",
"0",
",",
"debug",
"=",
"0",
",",
"header",
"=",
"''",
")",
":",
"stat",
"=",
"0",
"if",
"verbose",
"or",
"debug",
":",
"print",
"(",
"header",
"+",
"cmd",
")",
"# flush stdout so we don... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/ipython_view.py#L313-L330 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA256.py | python | SHA256Hash.digest | (self) | return get_raw_buffer(bfr) | Return the **binary** (non-printable) digest of the message that has been hashed so far.
:return: The hash digest, computed over the data processed so far.
Binary form.
:rtype: byte string | Return the **binary** (non-printable) digest of the message that has been hashed so far. | [
"Return",
"the",
"**",
"binary",
"**",
"(",
"non",
"-",
"printable",
")",
"digest",
"of",
"the",
"message",
"that",
"has",
"been",
"hashed",
"so",
"far",
"."
] | def digest(self):
"""Return the **binary** (non-printable) digest of the message that has been hashed so far.
:return: The hash digest, computed over the data processed so far.
Binary form.
:rtype: byte string
"""
bfr = create_string_buffer(self.digest_size)
... | [
"def",
"digest",
"(",
"self",
")",
":",
"bfr",
"=",
"create_string_buffer",
"(",
"self",
".",
"digest_size",
")",
"result",
"=",
"_raw_sha256_lib",
".",
"SHA256_digest",
"(",
"self",
".",
"_state",
".",
"get",
"(",
")",
",",
"bfr",
",",
"c_size_t",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA256.py#L96-L112 | |
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L1318-L1320 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py | python | __detect_cl_tool | (env, chainkey, cdict) | Helper function, picks a command line tool from the list
and initializes its environment variables. | Helper function, picks a command line tool from the list
and initializes its environment variables. | [
"Helper",
"function",
"picks",
"a",
"command",
"line",
"tool",
"from",
"the",
"list",
"and",
"initializes",
"its",
"environment",
"variables",
"."
] | def __detect_cl_tool(env, chainkey, cdict):
"""
Helper function, picks a command line tool from the list
and initializes its environment variables.
"""
if env.get(chainkey,'') == '':
clpath = ''
for cltool in cdict:
clpath = env.WhereIs(cltool)
if clpath:
... | [
"def",
"__detect_cl_tool",
"(",
"env",
",",
"chainkey",
",",
"cdict",
")",
":",
"if",
"env",
".",
"get",
"(",
"chainkey",
",",
"''",
")",
"==",
"''",
":",
"clpath",
"=",
"''",
"for",
"cltool",
"in",
"cdict",
":",
"clpath",
"=",
"env",
".",
"WhereIs... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py#L169-L181 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/artmanager.py | python | ArtManager.GetMenuBarColourScheme | (self) | return self._menuBarColourScheme | Returns the current colour scheme.
:return: A string representing the current colour scheme. | Returns the current colour scheme. | [
"Returns",
"the",
"current",
"colour",
"scheme",
"."
] | def GetMenuBarColourScheme(self):
"""
Returns the current colour scheme.
:return: A string representing the current colour scheme.
"""
return self._menuBarColourScheme | [
"def",
"GetMenuBarColourScheme",
"(",
"self",
")",
":",
"return",
"self",
".",
"_menuBarColourScheme"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L2034-L2041 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeConstraintForce | (
doc,
name="ConstraintForce"
) | return obj | makeConstraintForce(document, [name]):
makes a Fem ConstraintForce object | makeConstraintForce(document, [name]):
makes a Fem ConstraintForce object | [
"makeConstraintForce",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"Fem",
"ConstraintForce",
"object"
] | def makeConstraintForce(
doc,
name="ConstraintForce"
):
"""makeConstraintForce(document, [name]):
makes a Fem ConstraintForce object"""
obj = doc.addObject("Fem::ConstraintForce", name)
return obj | [
"def",
"makeConstraintForce",
"(",
"doc",
",",
"name",
"=",
"\"ConstraintForce\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::ConstraintForce\"",
",",
"name",
")",
"return",
"obj"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L186-L193 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Scripting.py | python | dist | (ctx) | makes a tarball for redistributing the sources | makes a tarball for redistributing the sources | [
"makes",
"a",
"tarball",
"for",
"redistributing",
"the",
"sources"
] | def dist(ctx):
'''makes a tarball for redistributing the sources'''
pass | [
"def",
"dist",
"(",
"ctx",
")",
":",
"pass"
] | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Scripting.py#L521-L523 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ragged/ragged_tensor_shape.py | python | RaggedTensorDynamicShape.from_tensor | (cls, rt_input, dim_size_dtype=None) | Constructs a ragged shape for a potentially ragged tensor. | Constructs a ragged shape for a potentially ragged tensor. | [
"Constructs",
"a",
"ragged",
"shape",
"for",
"a",
"potentially",
"ragged",
"tensor",
"."
] | def from_tensor(cls, rt_input, dim_size_dtype=None):
"""Constructs a ragged shape for a potentially ragged tensor."""
with ops.name_scope(None, 'RaggedTensorDynamicShapeFromTensor', [rt_input]):
rt_input = ragged_tensor.convert_to_tensor_or_ragged_tensor(rt_input)
if not ragged_tensor.is_ragged(rt_i... | [
"def",
"from_tensor",
"(",
"cls",
",",
"rt_input",
",",
"dim_size_dtype",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"'RaggedTensorDynamicShapeFromTensor'",
",",
"[",
"rt_input",
"]",
")",
":",
"rt_input",
"=",
"ragged_tensor",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_tensor_shape.py#L177-L189 | ||
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForExtensions | (descriptor, cls) | Adds properties for all fields in this protocol message type. | Adds properties for all fields in this protocol message type. | [
"Adds",
"properties",
"for",
"all",
"fields",
"in",
"this",
"protocol",
"message",
"type",
"."
] | def _AddPropertiesForExtensions(descriptor, cls):
"""Adds properties for all fields in this protocol message type."""
extension_dict = descriptor.extensions_by_name
for extension_name, extension_field in extension_dict.iteritems():
constant_name = extension_name.upper() + "_FIELD_NUMBER"
setattr(cls, cons... | [
"def",
"_AddPropertiesForExtensions",
"(",
"descriptor",
",",
"cls",
")",
":",
"extension_dict",
"=",
"descriptor",
".",
"extensions_by_name",
"for",
"extension_name",
",",
"extension_field",
"in",
"extension_dict",
".",
"iteritems",
"(",
")",
":",
"constant_name",
... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L520-L525 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/scripts/configs.py | python | walker | () | return locals() | Configuration for MuJoCo's walker task. | Configuration for MuJoCo's walker task. | [
"Configuration",
"for",
"MuJoCo",
"s",
"walker",
"task",
"."
] | def walker():
"""Configuration for MuJoCo's walker task."""
locals().update(default())
# Environment
env = 'Walker2d-v1'
max_length = 1000
steps = 1e7 # 10M
return locals() | [
"def",
"walker",
"(",
")",
":",
"locals",
"(",
")",
".",
"update",
"(",
"default",
"(",
")",
")",
"# Environment",
"env",
"=",
"'Walker2d-v1'",
"max_length",
"=",
"1000",
"steps",
"=",
"1e7",
"# 10M",
"return",
"locals",
"(",
")"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/scripts/configs.py#L77-L84 | |
ros2/demos | fb3ad7e7fc6548c30e77a6ed86a2bd108fce5d82 | quality_of_service_demo/rclpy/quality_of_service_demo_py/common_nodes.py | python | Talker.stop | (self) | Cancel publishing and any manual liveliness assertions. | Cancel publishing and any manual liveliness assertions. | [
"Cancel",
"publishing",
"and",
"any",
"manual",
"liveliness",
"assertions",
"."
] | def stop(self):
"""Cancel publishing and any manual liveliness assertions."""
if self.assert_topic_timer:
self.assert_topic_timer.cancel()
self.publish_timer.cancel()
self.assert_topic_timer = None | [
"def",
"stop",
"(",
"self",
")",
":",
"if",
"self",
".",
"assert_topic_timer",
":",
"self",
".",
"assert_topic_timer",
".",
"cancel",
"(",
")",
"self",
".",
"publish_timer",
".",
"cancel",
"(",
")",
"self",
".",
"assert_topic_timer",
"=",
"None"
] | https://github.com/ros2/demos/blob/fb3ad7e7fc6548c30e77a6ed86a2bd108fce5d82/quality_of_service_demo/rclpy/quality_of_service_demo_py/common_nodes.py#L83-L88 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_calibrator.py | python | CalibratorDomain.getInserted | (self, calibratorID) | return self._getUniversal(tc.VAR_INSERTED, calibratorID) | getInserted(string) -> double
Returns the number of inserted vehicles in the current calibration interval | getInserted(string) -> double
Returns the number of inserted vehicles in the current calibration interval | [
"getInserted",
"(",
"string",
")",
"-",
">",
"double",
"Returns",
"the",
"number",
"of",
"inserted",
"vehicles",
"in",
"the",
"current",
"calibration",
"interval"
] | def getInserted(self, calibratorID):
"""getInserted(string) -> double
Returns the number of inserted vehicles in the current calibration interval
"""
return self._getUniversal(tc.VAR_INSERTED, calibratorID) | [
"def",
"getInserted",
"(",
"self",
",",
"calibratorID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_INSERTED",
",",
"calibratorID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_calibrator.py#L97-L101 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.log_sigmoid | (self, *args, **kwargs) | return op.log_sigmoid(self, *args, **kwargs) | Convenience fluent method for :py:func:`log_sigmoid`.
The arguments are the same as for :py:func:`log_sigmoid`, with
this array as data. | Convenience fluent method for :py:func:`log_sigmoid`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"log_sigmoid",
"."
] | def log_sigmoid(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`log_sigmoid`.
The arguments are the same as for :py:func:`log_sigmoid`, with
this array as data.
"""
return op.log_sigmoid(self, *args, **kwargs) | [
"def",
"log_sigmoid",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"log_sigmoid",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L2174-L2180 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/carla/agents/navigation/basic_agent.py | python | BasicAgent.ignore_traffic_lights | (self, active=True) | (De)activates the checks for traffic lights | (De)activates the checks for traffic lights | [
"(",
"De",
")",
"activates",
"the",
"checks",
"for",
"traffic",
"lights"
] | def ignore_traffic_lights(self, active=True):
"""(De)activates the checks for traffic lights"""
self._ignore_traffic_lights = active | [
"def",
"ignore_traffic_lights",
"(",
"self",
",",
"active",
"=",
"True",
")",
":",
"self",
".",
"_ignore_traffic_lights",
"=",
"active"
] | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/carla/agents/navigation/basic_agent.py#L190-L192 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | MH.get_folder | (self, folder) | return MH(os.path.join(self._path, folder),
factory=self._factory, create=False) | Return an MH instance for the named folder. | Return an MH instance for the named folder. | [
"Return",
"an",
"MH",
"instance",
"for",
"the",
"named",
"folder",
"."
] | def get_folder(self, folder):
"""Return an MH instance for the named folder."""
return MH(os.path.join(self._path, folder),
factory=self._factory, create=False) | [
"def",
"get_folder",
"(",
"self",
",",
"folder",
")",
":",
"return",
"MH",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"folder",
")",
",",
"factory",
"=",
"self",
".",
"_factory",
",",
"create",
"=",
"False",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1100-L1103 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | src/atomicgen.py | python | generate_cpp | () | return cpp_file | Generates the source file. | Generates the source file. | [
"Generates",
"the",
"source",
"file",
"."
] | def generate_cpp():
"""Generates the source file."""
cpp_file = AUTOGEN_WARNING
cpp_file += "// Implements basic nuclear data functions.\n"
cpp_file += "#ifndef PYNE_IS_AMALGAMATED\n"
cpp_file += "#include \"atomic_data.h\"\n"
cpp_file += "#include \"nucname.h\"\n"
cpp_file += "#endif\n"
... | [
"def",
"generate_cpp",
"(",
")",
":",
"cpp_file",
"=",
"AUTOGEN_WARNING",
"cpp_file",
"+=",
"\"// Implements basic nuclear data functions.\\n\"",
"cpp_file",
"+=",
"\"#ifndef PYNE_IS_AMALGAMATED\\n\"",
"cpp_file",
"+=",
"\"#include \\\"atomic_data.h\\\"\\n\"",
"cpp_file",
"+=",
... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/src/atomicgen.py#L129-L179 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBAttachInfo.GroupIDIsValid | (self) | return _lldb.SBAttachInfo_GroupIDIsValid(self) | GroupIDIsValid(self) -> bool | GroupIDIsValid(self) -> bool | [
"GroupIDIsValid",
"(",
"self",
")",
"-",
">",
"bool"
] | def GroupIDIsValid(self):
"""GroupIDIsValid(self) -> bool"""
return _lldb.SBAttachInfo_GroupIDIsValid(self) | [
"def",
"GroupIDIsValid",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBAttachInfo_GroupIDIsValid",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1094-L1096 | |
baidu/tera | dbcd28af792d879d961bf9fc7eb60de81b437646 | src/sdk/python/TeraSdk.py | python | RowReader.Family | (self) | return copy_string_to_user(value, long(vallen.value)) | Returns:
(string) 当前cell对应的ColumnFamily | Returns:
(string) 当前cell对应的ColumnFamily | [
"Returns",
":",
"(",
"string",
")",
"当前cell对应的ColumnFamily"
] | def Family(self):
"""
Returns:
(string) 当前cell对应的ColumnFamily
"""
value = POINTER(c_ubyte)()
vallen = c_uint64()
lib.tera_row_reader_family(self.reader, byref(value), byref(vallen))
return copy_string_to_user(value, long(vallen.value)) | [
"def",
"Family",
"(",
"self",
")",
":",
"value",
"=",
"POINTER",
"(",
"c_ubyte",
")",
"(",
")",
"vallen",
"=",
"c_uint64",
"(",
")",
"lib",
".",
"tera_row_reader_family",
"(",
"self",
".",
"reader",
",",
"byref",
"(",
"value",
")",
",",
"byref",
"(",... | https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L780-L788 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/runtime.py | python | make_logging_undefined | (logger=None, base=None) | return LoggingUndefined | Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created.
Example::
logger = logging.getLogger(__name__)
LoggingUndefined = make_logging_undefined(
logger=lo... | Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created. | [
"Given",
"a",
"logger",
"object",
"this",
"returns",
"a",
"new",
"undefined",
"class",
"that",
"will",
"log",
"certain",
"failures",
".",
"It",
"will",
"log",
"iterations",
"and",
"printing",
".",
"If",
"no",
"logger",
"is",
"given",
"a",
"default",
"logge... | def make_logging_undefined(logger=None, base=None):
"""Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created.
Example::
logger = logging.getLogger(__name__)
Loggi... | [
"def",
"make_logging_undefined",
"(",
"logger",
"=",
"None",
",",
"base",
"=",
"None",
")",
":",
"if",
"logger",
"is",
"None",
":",
"import",
"logging",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"addHandler",
"(",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/runtime.py#L677-L755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.