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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/descriptor.py | python | FieldDescriptor.__init__ | (self, name, full_name, index, number, type, cpp_type, label,
default_value, message_type, enum_type, containing_type,
is_extension, extension_scope, options=None,
has_default_value=True) | The arguments are as described in the description of FieldDescriptor
attributes above.
Note that containing_type may be None, and may be set later if necessary
(to deal with circular references between message types, for example).
Likewise for extension_scope. | The arguments are as described in the description of FieldDescriptor
attributes above. | [
"The",
"arguments",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"FieldDescriptor",
"attributes",
"above",
"."
] | def __init__(self, name, full_name, index, number, type, cpp_type, label,
default_value, message_type, enum_type, containing_type,
is_extension, extension_scope, options=None,
has_default_value=True):
"""The arguments are as described in the description of FieldDescripto... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"index",
",",
"number",
",",
"type",
",",
"cpp_type",
",",
"label",
",",
"default_value",
",",
"message_type",
",",
"enum_type",
",",
"containing_type",
",",
"is_extension",
",",
"extension_... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/descriptor.py#L428-L466 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/bdist_egg.py | python | iter_symbols | (code) | Yield names and strings used by `code` and its nested code objects | Yield names and strings used by `code` and its nested code objects | [
"Yield",
"names",
"and",
"strings",
"used",
"by",
"code",
"and",
"its",
"nested",
"code",
"objects"
] | def iter_symbols(code):
"""Yield names and strings used by `code` and its nested code objects"""
for name in code.co_names:
yield name
for const in code.co_consts:
if isinstance(const, six.string_types):
yield const
elif isinstance(const, CodeType):
for name i... | [
"def",
"iter_symbols",
"(",
"code",
")",
":",
"for",
"name",
"in",
"code",
".",
"co_names",
":",
"yield",
"name",
"for",
"const",
"in",
"code",
".",
"co_consts",
":",
"if",
"isinstance",
"(",
"const",
",",
"six",
".",
"string_types",
")",
":",
"yield",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/bdist_egg.py#L449-L458 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBProcess.SetSelectedThread | (self, thread) | return _lldb.SBProcess_SetSelectedThread(self, thread) | SetSelectedThread(SBProcess self, SBThread thread) -> bool | SetSelectedThread(SBProcess self, SBThread thread) -> bool | [
"SetSelectedThread",
"(",
"SBProcess",
"self",
"SBThread",
"thread",
")",
"-",
">",
"bool"
] | def SetSelectedThread(self, thread):
"""SetSelectedThread(SBProcess self, SBThread thread) -> bool"""
return _lldb.SBProcess_SetSelectedThread(self, thread) | [
"def",
"SetSelectedThread",
"(",
"self",
",",
"thread",
")",
":",
"return",
"_lldb",
".",
"SBProcess_SetSelectedThread",
"(",
"self",
",",
"thread",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8441-L8443 | |
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/dashboard/dashboard.py | python | DashboardServer._fill_default_template | (self, varz) | Update the varz with variables required by the default template. | Update the varz with variables required by the default template. | [
"Update",
"the",
"varz",
"with",
"variables",
"required",
"by",
"the",
"default",
"template",
"."
] | def _fill_default_template(self, varz):
"""Update the varz with variables required by the default template."""
varz["pages"] = """<a href=http://%s:%d/sth>
The Signed Tree Head Dashboard</a>\n""" % (
self.host, self.port) | [
"def",
"_fill_default_template",
"(",
"self",
",",
"varz",
")",
":",
"varz",
"[",
"\"pages\"",
"]",
"=",
"\"\"\"<a href=http://%s:%d/sth>\n The Signed Tree Head Dashboard</a>\\n\"\"\"",
"%",
"(",
"self",
".",
"host",
",",
"self",
".",
"port",
")"
... | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/dashboard/dashboard.py#L91-L95 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/outputs.py | python | InputCheckpoint.__init__ | (self, help=None, default=None, dtype=None, dimension=None) | Initializes InputCheckpoint.
Just calls the parent initialization function with appropriate arguments. | Initializes InputCheckpoint. | [
"Initializes",
"InputCheckpoint",
"."
] | def __init__(self, help=None, default=None, dtype=None, dimension=None):
"""Initializes InputCheckpoint.
Just calls the parent initialization function with appropriate arguments.
"""
super(InputCheckpoint,self).__init__(help=help, default=default, dtype=int, dimension=dimension) | [
"def",
"__init__",
"(",
"self",
",",
"help",
"=",
"None",
",",
"default",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"dimension",
"=",
"None",
")",
":",
"super",
"(",
"InputCheckpoint",
",",
"self",
")",
".",
"__init__",
"(",
"help",
"=",
"help",
... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/outputs.py#L185-L191 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/Audio3DManager.py | python | Audio3DManager.setListenerVelocityAuto | (self) | If velocity is set to auto, the velocity will be determined by the
previous position of the object the listener is attached to and the frame dt.
Make sure if you use this method that you remember to clear the previous
transformation between frames. | If velocity is set to auto, the velocity will be determined by the
previous position of the object the listener is attached to and the frame dt.
Make sure if you use this method that you remember to clear the previous
transformation between frames. | [
"If",
"velocity",
"is",
"set",
"to",
"auto",
"the",
"velocity",
"will",
"be",
"determined",
"by",
"the",
"previous",
"position",
"of",
"the",
"object",
"the",
"listener",
"is",
"attached",
"to",
"and",
"the",
"frame",
"dt",
".",
"Make",
"sure",
"if",
"yo... | def setListenerVelocityAuto(self):
"""
If velocity is set to auto, the velocity will be determined by the
previous position of the object the listener is attached to and the frame dt.
Make sure if you use this method that you remember to clear the previous
transformation between ... | [
"def",
"setListenerVelocityAuto",
"(",
"self",
")",
":",
"self",
".",
"listener_vel",
"=",
"None"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Audio3DManager.py#L175-L182 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBar.FindControl | (*args, **kwargs) | return _aui.AuiToolBar_FindControl(*args, **kwargs) | FindControl(self, int windowId) -> Control | FindControl(self, int windowId) -> Control | [
"FindControl",
"(",
"self",
"int",
"windowId",
")",
"-",
">",
"Control"
] | def FindControl(*args, **kwargs):
"""FindControl(self, int windowId) -> Control"""
return _aui.AuiToolBar_FindControl(*args, **kwargs) | [
"def",
"FindControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_FindControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L2054-L2056 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | RobotModel.__init__ | (self) | r""" | r""" | [
"r"
] | def __init__(self):
r"""
"""
_robotsim.RobotModel_swiginit(self, _robotsim.new_RobotModel()) | [
"def",
"__init__",
"(",
"self",
")",
":",
"_robotsim",
".",
"RobotModel_swiginit",
"(",
"self",
",",
"_robotsim",
".",
"new_RobotModel",
"(",
")",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4602-L4605 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/descriptor.py | python | FieldDescriptor.__init__ | (self, name, full_name, index, number, type, cpp_type, label,
default_value, message_type, enum_type, containing_type,
is_extension, extension_scope, options=None,
has_default_value=True) | The arguments are as described in the description of FieldDescriptor
attributes above.
Note that containing_type may be None, and may be set later if necessary
(to deal with circular references between message types, for example).
Likewise for extension_scope. | The arguments are as described in the description of FieldDescriptor
attributes above. | [
"The",
"arguments",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"FieldDescriptor",
"attributes",
"above",
"."
] | def __init__(self, name, full_name, index, number, type, cpp_type, label,
default_value, message_type, enum_type, containing_type,
is_extension, extension_scope, options=None,
has_default_value=True):
"""The arguments are as described in the description of FieldDescripto... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"index",
",",
"number",
",",
"type",
",",
"cpp_type",
",",
"label",
",",
"default_value",
",",
"message_type",
",",
"enum_type",
",",
"containing_type",
",",
"is_extension",
",",
"extension_... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/descriptor.py#L428-L466 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py | python | monthrange | (year, month) | return day1, ndays | Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
year, month. | Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
year, month. | [
"Return",
"weekday",
"(",
"0",
"-",
"6",
"~",
"Mon",
"-",
"Sun",
")",
"and",
"number",
"of",
"days",
"(",
"28",
"-",
"31",
")",
"for",
"year",
"month",
"."
] | def monthrange(year, month):
"""Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
year, month."""
if not 1 <= month <= 12:
raise IllegalMonthError(month)
day1 = weekday(year, month, 1)
ndays = mdays[month] + (month == February and isleap(year))
return day1, ndays | [
"def",
"monthrange",
"(",
"year",
",",
"month",
")",
":",
"if",
"not",
"1",
"<=",
"month",
"<=",
"12",
":",
"raise",
"IllegalMonthError",
"(",
"month",
")",
"day1",
"=",
"weekday",
"(",
"year",
",",
"month",
",",
"1",
")",
"ndays",
"=",
"mdays",
"[... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py#L116-L123 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | python | MacTool._LoadPlistMaybeBinary | (self, plist_path) | Loads into a memory a plist possibly encoded in binary format.
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path: string, path to a plist file, in XML or binary format
... | Loads into a memory a plist possibly encoded in binary format. | [
"Loads",
"into",
"a",
"memory",
"a",
"plist",
"possibly",
"encoded",
"in",
"binary",
"format",
"."
] | def _LoadPlistMaybeBinary(self, plist_path):
"""Loads into a memory a plist possibly encoded in binary format.
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path:... | [
"def",
"_LoadPlistMaybeBinary",
"(",
"self",
",",
"plist_path",
")",
":",
"try",
":",
"# First, try to read the file using plistlib that only supports XML,",
"# and if an exception is raised, convert a temporary copy to XML and",
"# load that copy.",
"return",
"plistlib",
".",
"readP... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L585-L608 | ||
gitahead/gitahead | 711a9633149ef8f9dd0d2d6becfee4e147b6458c | dep/scintilla/scintilla-3.21.0/scripts/Dependencies.py | python | InsertSynonym | (dependencies, current, additional) | return result | Insert a copy of one object file with dependencies under a different name.
Used when one source file is used to create two object files with different
preprocessor definitions. | Insert a copy of one object file with dependencies under a different name.
Used when one source file is used to create two object files with different
preprocessor definitions. | [
"Insert",
"a",
"copy",
"of",
"one",
"object",
"file",
"with",
"dependencies",
"under",
"a",
"different",
"name",
".",
"Used",
"when",
"one",
"source",
"file",
"is",
"used",
"to",
"create",
"two",
"object",
"files",
"with",
"different",
"preprocessor",
"defin... | def InsertSynonym(dependencies, current, additional):
""" Insert a copy of one object file with dependencies under a different name.
Used when one source file is used to create two object files with different
preprocessor definitions. """
result = []
for dep in dependencies:
result.append(dep)
if (dep[0] == cu... | [
"def",
"InsertSynonym",
"(",
"dependencies",
",",
"current",
",",
"additional",
")",
":",
"result",
"=",
"[",
"]",
"for",
"dep",
"in",
"dependencies",
":",
"result",
".",
"append",
"(",
"dep",
")",
"if",
"(",
"dep",
"[",
"0",
"]",
"==",
"current",
")... | https://github.com/gitahead/gitahead/blob/711a9633149ef8f9dd0d2d6becfee4e147b6458c/dep/scintilla/scintilla-3.21.0/scripts/Dependencies.py#L92-L102 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/learn_runner.py | python | _is_distributed | (config) | return task_count > 1 | Returns true if this is a distributed job. | Returns true if this is a distributed job. | [
"Returns",
"true",
"if",
"this",
"is",
"a",
"distributed",
"job",
"."
] | def _is_distributed(config):
"""Returns true if this is a distributed job."""
if not config.cluster_spec:
return False
# This is considered a distributed job if there is more than one task
# in the cluster spec.
task_count = 0
for job in config.cluster_spec.jobs:
for _ in config.cluster_spec.job_ta... | [
"def",
"_is_distributed",
"(",
"config",
")",
":",
"if",
"not",
"config",
".",
"cluster_spec",
":",
"return",
"False",
"# This is considered a distributed job if there is more than one task",
"# in the cluster spec.",
"task_count",
"=",
"0",
"for",
"job",
"in",
"config",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/learn_runner.py#L248-L260 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | array/largest_rectangle_histogram.py | python | main | () | operational function | operational function | [
"operational",
"function"
] | def main():
""" operational function """
print(largest_rectangle_area([2, 1, 5, 6, 2, 3])) | [
"def",
"main",
"(",
")",
":",
"print",
"(",
"largest_rectangle_area",
"(",
"[",
"2",
",",
"1",
",",
"5",
",",
"6",
",",
"2",
",",
"3",
"]",
")",
")"
] | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/array/largest_rectangle_histogram.py#L39-L41 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/_psosx.py | python | get_system_per_cpu_times | () | return ret | Return system CPU times as a named tuple | Return system CPU times as a named tuple | [
"Return",
"system",
"CPU",
"times",
"as",
"a",
"named",
"tuple"
] | def get_system_per_cpu_times():
"""Return system CPU times as a named tuple"""
ret = []
for cpu_t in _psutil_osx.get_system_per_cpu_times():
user, nice, system, idle = cpu_t
item = _cputimes_ntuple(user, nice, system, idle)
ret.append(item)
return ret | [
"def",
"get_system_per_cpu_times",
"(",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"cpu_t",
"in",
"_psutil_osx",
".",
"get_system_per_cpu_times",
"(",
")",
":",
"user",
",",
"nice",
",",
"system",
",",
"idle",
"=",
"cpu_t",
"item",
"=",
"_cputimes_ntuple",
"("... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/_psosx.py#L94-L101 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBAttachInfo.GetWaitForLaunch | (self) | return _lldb.SBAttachInfo_GetWaitForLaunch(self) | GetWaitForLaunch(self) -> bool | GetWaitForLaunch(self) -> bool | [
"GetWaitForLaunch",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetWaitForLaunch(self):
"""GetWaitForLaunch(self) -> bool"""
return _lldb.SBAttachInfo_GetWaitForLaunch(self) | [
"def",
"GetWaitForLaunch",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBAttachInfo_GetWaitForLaunch",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1047-L1049 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_expression_opt_1 | (t) | expression_opt : empty | expression_opt : empty | [
"expression_opt",
":",
"empty"
] | def p_expression_opt_1(t):
'expression_opt : empty'
pass | [
"def",
"p_expression_opt_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L557-L559 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TLFlt.__call__ | (self) | return _snap.TLFlt___call__(self) | __call__(TLFlt self) -> ldouble
Parameters:
self: TLFlt const * | __call__(TLFlt self) -> ldouble | [
"__call__",
"(",
"TLFlt",
"self",
")",
"-",
">",
"ldouble"
] | def __call__(self):
"""
__call__(TLFlt self) -> ldouble
Parameters:
self: TLFlt const *
"""
return _snap.TLFlt___call__(self) | [
"def",
"__call__",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TLFlt___call__",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15057-L15065 | |
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | python/setup.py | python | parallelCCompile | (
self,
sources,
output_dir=None,
macros=None,
include_dirs=None,
debug=0,
extra_preargs=None,
extra_postargs=None,
depends=None,
) | return objects | Build sources in parallel.
Reference link:
http://stackoverflow.com/questions/11013851/speeding-up-build-process-with-distutils
Monkey-patch for parallel compilation. | Build sources in parallel. | [
"Build",
"sources",
"in",
"parallel",
"."
] | def parallelCCompile(
self,
sources,
output_dir=None,
macros=None,
include_dirs=None,
debug=0,
extra_preargs=None,
extra_postargs=None,
depends=None,
):
"""Build sources in parallel.
Reference link:
http://stackoverflow.com/questions/11013851/speeding-up-build-process-wi... | [
"def",
"parallelCCompile",
"(",
"self",
",",
"sources",
",",
"output_dir",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"debug",
"=",
"0",
",",
"extra_preargs",
"=",
"None",
",",
"extra_postargs",
"=",
"None",
",",
"dep... | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/setup.py#L103-L148 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py | python | VersionControl._is_local_repository | (cls, repo) | return repo.startswith(os.path.sep) or bool(drive) | posix absolute paths start with os.path.sep,
win32 ones start with drive (like c:\\folder) | posix absolute paths start with os.path.sep,
win32 ones start with drive (like c:\\folder) | [
"posix",
"absolute",
"paths",
"start",
"with",
"os",
".",
"path",
".",
"sep",
"win32",
"ones",
"start",
"with",
"drive",
"(",
"like",
"c",
":",
"\\\\",
"folder",
")"
] | def _is_local_repository(cls, repo):
# type: (str) -> bool
"""
posix absolute paths start with os.path.sep,
win32 ones start with drive (like c:\\folder)
"""
drive, tail = os.path.splitdrive(repo)
return repo.startswith(os.path.sep) or bool(drive) | [
"def",
"_is_local_repository",
"(",
"cls",
",",
"repo",
")",
":",
"# type: (str) -> bool",
"drive",
",",
"tail",
"=",
"os",
".",
"path",
".",
"splitdrive",
"(",
"repo",
")",
"return",
"repo",
".",
"startswith",
"(",
"os",
".",
"path",
".",
"sep",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py#L378-L385 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L4768-L4843 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLParameterScan.py | python | PowderILLParameterScan._group_spectra | (self, ws) | Groups the spectrum axis by summing spectra
@param ws : the input workspace | Groups the spectrum axis by summing spectra | [
"Groups",
"the",
"spectrum",
"axis",
"by",
"summing",
"spectra"
] | def _group_spectra(self, ws):
"""
Groups the spectrum axis by summing spectra
@param ws : the input workspace
"""
new_axis = []
start_index = 0
axis = mtd[ws].getAxis(1).extractValues()
grouped = self._hide('grouped')
name = grouped
... | [
"def",
"_group_spectra",
"(",
"self",
",",
"ws",
")",
":",
"new_axis",
"=",
"[",
"]",
"start_index",
"=",
"0",
"axis",
"=",
"mtd",
"[",
"ws",
"]",
".",
"getAxis",
"(",
"1",
")",
".",
"extractValues",
"(",
")",
"grouped",
"=",
"self",
".",
"_hide",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLParameterScan.py#L317-L344 | ||
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | scripts/cpp_lint.py | python | IsCppString | (line) | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 | Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string constant. | Does line terminate so, that the next symbol is in string constant. | [
"Does",
"line",
"terminate",
"so",
"that",
"the",
"next",
"symbol",
"is",
"in",
"string",
"constant",
"."
] | def IsCppString(line):
"""Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string c... | [
"def",
"IsCppString",
"(",
"line",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"r'\\\\'",
",",
"'XX'",
")",
"# after this, \\\\\" does not match to \\\"",
"return",
"(",
"(",
"line",
".",
"count",
"(",
"'\"'",
")",
"-",
"line",
".",
"count",
"(",
... | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L1049-L1063 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | ci/Dockerfile_generator.py | python | warn | (message: str) | Log the warning to stdout | Log the warning to stdout | [
"Log",
"the",
"warning",
"to",
"stdout"
] | def warn(message: str):
"""Log the warning to stdout"""
print(_apply_color("yellow", f"[!] {message}")) | [
"def",
"warn",
"(",
"message",
":",
"str",
")",
":",
"print",
"(",
"_apply_color",
"(",
"\"yellow\"",
",",
"f\"[!] {message}\"",
")",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/ci/Dockerfile_generator.py#L247-L249 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Blob.py | python | Blob.__mul__ | (self, other) | return Blob(PythonWrapper.blob_mul(self._internal, float(other))) | Elementwise multiplies two blobs or a blob and a scalar value. | Elementwise multiplies two blobs or a blob and a scalar value. | [
"Elementwise",
"multiplies",
"two",
"blobs",
"or",
"a",
"blob",
"and",
"a",
"scalar",
"value",
"."
] | def __mul__(self, other):
"""Elementwise multiplies two blobs or a blob and a scalar value.
"""
if self.size == 0:
raise ValueError("The blob mustn't be empty.")
if type(other) is Blob:
if not neoml.Utils.check_can_broadcast(self, other):
raise Va... | [
"def",
"__mul__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"size",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"The blob mustn't be empty.\"",
")",
"if",
"type",
"(",
"other",
")",
"is",
"Blob",
":",
"if",
"not",
"neoml",
".",
"Utils",... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Blob.py#L170-L181 | |
lyxok1/Tiny-DSOD | 94d15450699bea0dd3720e75e2d273e476174fba | examples/pycaffe/layers/pascal_multilabel_datalayers.py | python | BatchLoader.load_next_image | (self) | return self.transformer.preprocess(im), multilabel | Load the next image in a batch. | Load the next image in a batch. | [
"Load",
"the",
"next",
"image",
"in",
"a",
"batch",
"."
] | def load_next_image(self):
"""
Load the next image in a batch.
"""
# Did we finish an epoch?
if self._cur == len(self.indexlist):
self._cur = 0
shuffle(self.indexlist)
# Load an image
index = self.indexlist[self._cur] # Get the image inde... | [
"def",
"load_next_image",
"(",
"self",
")",
":",
"# Did we finish an epoch?",
"if",
"self",
".",
"_cur",
"==",
"len",
"(",
"self",
".",
"indexlist",
")",
":",
"self",
".",
"_cur",
"=",
"0",
"shuffle",
"(",
"self",
".",
"indexlist",
")",
"# Load an image",
... | https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L106-L137 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/tools/build/win/resedit.py | python | main | (options, args) | Main program for the script. | Main program for the script. | [
"Main",
"program",
"for",
"the",
"script",
"."
] | def main(options, args):
"""Main program for the script."""
if options.verbose:
logging.basicConfig(level=logging.INFO)
# Create the editor for our input file.
editor = _ResourceEditor(args[0], options.output_file)
if options.extract_all:
editor.ExtractAllToDir(options.extract_all)
for res_type, ... | [
"def",
"main",
"(",
"options",
",",
"args",
")",
":",
"if",
"options",
".",
"verbose",
":",
"logging",
".",
"basicConfig",
"(",
"level",
"=",
"logging",
".",
"INFO",
")",
"# Create the editor for our input file.",
"editor",
"=",
"_ResourceEditor",
"(",
"args",... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/build/win/resedit.py#L295-L316 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_remove_redundancy.py | python | _remove_zero_rows | (A, b) | return A, b, status, message | Eliminates trivial equations from system of equations defined by Ax = b
and identifies trivial infeasibilities
Parameters
----------
A : 2-D array
An array representing the left-hand side of a system of equations
b : 1-D array
An array representing the right-hand side of a system of ... | Eliminates trivial equations from system of equations defined by Ax = b
and identifies trivial infeasibilities | [
"Eliminates",
"trivial",
"equations",
"from",
"system",
"of",
"equations",
"defined",
"by",
"Ax",
"=",
"b",
"and",
"identifies",
"trivial",
"infeasibilities"
] | def _remove_zero_rows(A, b):
"""
Eliminates trivial equations from system of equations defined by Ax = b
and identifies trivial infeasibilities
Parameters
----------
A : 2-D array
An array representing the left-hand side of a system of equations
b : 1-D array
An array represe... | [
"def",
"_remove_zero_rows",
"(",
"A",
",",
"b",
")",
":",
"status",
"=",
"0",
"message",
"=",
"\"\"",
"i_zero",
"=",
"_row_count",
"(",
"A",
")",
"==",
"0",
"A",
"=",
"A",
"[",
"np",
".",
"logical_not",
"(",
"i_zero",
")",
",",
":",
"]",
"if",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_remove_redundancy.py#L57-L92 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseEvent.LeftDClick | (*args, **kwargs) | return _core_.MouseEvent_LeftDClick(*args, **kwargs) | LeftDClick(self) -> bool
Returns true if the event was a left button double click. | LeftDClick(self) -> bool | [
"LeftDClick",
"(",
"self",
")",
"-",
">",
"bool"
] | def LeftDClick(*args, **kwargs):
"""
LeftDClick(self) -> bool
Returns true if the event was a left button double click.
"""
return _core_.MouseEvent_LeftDClick(*args, **kwargs) | [
"def",
"LeftDClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseEvent_LeftDClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5705-L5711 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/aetools.py | python | decodeerror | (arguments) | return (err_a1, err_a2, err_a3) | Create the 'best' argument for a raise MacOS.Error | Create the 'best' argument for a raise MacOS.Error | [
"Create",
"the",
"best",
"argument",
"for",
"a",
"raise",
"MacOS",
".",
"Error"
] | def decodeerror(arguments):
"""Create the 'best' argument for a raise MacOS.Error"""
errn = arguments['errn']
err_a1 = errn
if 'errs' in arguments:
err_a2 = arguments['errs']
else:
err_a2 = MacOS.GetErrorString(errn)
if 'erob' in arguments:
err_a3 = arguments['erob']
... | [
"def",
"decodeerror",
"(",
"arguments",
")",
":",
"errn",
"=",
"arguments",
"[",
"'errn'",
"]",
"err_a1",
"=",
"errn",
"if",
"'errs'",
"in",
"arguments",
":",
"err_a2",
"=",
"arguments",
"[",
"'errs'",
"]",
"else",
":",
"err_a2",
"=",
"MacOS",
".",
"Ge... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/aetools.py#L131-L144 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/histograms.py | python | _ravel_and_check_weights | (a, weights) | return a, weights | Check a and weights have matching shapes, and ravel both | Check a and weights have matching shapes, and ravel both | [
"Check",
"a",
"and",
"weights",
"have",
"matching",
"shapes",
"and",
"ravel",
"both"
] | def _ravel_and_check_weights(a, weights):
""" Check a and weights have matching shapes, and ravel both """
a = np.asarray(a)
# Ensure that the array is a "subtractable" dtype
if a.dtype == np.bool_:
warnings.warn("Converting input from {} to {} for compatibility."
.format(... | [
"def",
"_ravel_and_check_weights",
"(",
"a",
",",
"weights",
")",
":",
"a",
"=",
"np",
".",
"asarray",
"(",
"a",
")",
"# Ensure that the array is a \"subtractable\" dtype",
"if",
"a",
".",
"dtype",
"==",
"np",
".",
"bool_",
":",
"warnings",
".",
"warn",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/histograms.py#L283-L301 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | ps-lite/tracker/dmlc_mpi.py | python | get_mpi_env | (envs) | return cmd | get the mpirun command for setting the envornment
support both openmpi and mpich2 | get the mpirun command for setting the envornment | [
"get",
"the",
"mpirun",
"command",
"for",
"setting",
"the",
"envornment"
] | def get_mpi_env(envs):
"""get the mpirun command for setting the envornment
support both openmpi and mpich2
"""
outfile="/tmp/mpiver"
os.system("mpirun 1>/tmp/mpiver 2>/tmp/mpiver")
with open (outfile, "r") as infile:
mpi_ver = infile.read()
cmd = ''
if 'Open MPI' in mpi_ver:
... | [
"def",
"get_mpi_env",
"(",
"envs",
")",
":",
"outfile",
"=",
"\"/tmp/mpiver\"",
"os",
".",
"system",
"(",
"\"mpirun 1>/tmp/mpiver 2>/tmp/mpiver\"",
")",
"with",
"open",
"(",
"outfile",
",",
"\"r\"",
")",
"as",
"infile",
":",
"mpi_ver",
"=",
"infile",
".",
"r... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/ps-lite/tracker/dmlc_mpi.py#L33-L52 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py | python | get_module_configurations | (ctx, target, restricted_platform=None, pre_process_results=True) | return ctx.preprocess_target_configuration_list(target, restricted_platform, configurations) if pre_process_results else configurations | Quickly look up the supported platforms for a target
:param ctx: Context
:param target: Name of the target to lookup
:param restricted_platform: Optional platform to restrict the list of possible configurations
:param pre_process_results: Pre-process the result (i.e. apply ... | Quickly look up the supported platforms for a target | [
"Quickly",
"look",
"up",
"the",
"supported",
"platforms",
"for",
"a",
"target"
] | def get_module_configurations(ctx, target, restricted_platform=None, pre_process_results=True):
"""
Quickly look up the supported platforms for a target
:param ctx: Context
:param target: Name of the target to lookup
:param restricted_platform: Optional platform to rest... | [
"def",
"get_module_configurations",
"(",
"ctx",
",",
"target",
",",
"restricted_platform",
"=",
"None",
",",
"pre_process_results",
"=",
"True",
")",
":",
"module_def_map",
"=",
"_get_module_def",
"(",
"ctx",
",",
"target",
")",
"configurations",
"=",
"module_def_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py#L1188-L1201 | |
peter-ch/MultiNEAT | 0dc93aa0e228e23eeb95371bdd3838c64f08fdae | examples/NoveltySearch.py | python | NN_agent.interact | (self, ball) | inputs: x - ball_x, y - ball_y, self_vx, self_vy, 1
output: x velocity [-1 .. 1]*const, y velocity [-1 .. 1]*const | inputs: x - ball_x, y - ball_y, self_vx, self_vy, 1
output: x velocity [-1 .. 1]*const, y velocity [-1 .. 1]*const | [
"inputs",
":",
"x",
"-",
"ball_x",
"y",
"-",
"ball_y",
"self_vx",
"self_vy",
"1",
"output",
":",
"x",
"velocity",
"[",
"-",
"1",
"..",
"1",
"]",
"*",
"const",
"y",
"velocity",
"[",
"-",
"1",
"..",
"1",
"]",
"*",
"const"
] | def interact(self, ball):
"""
inputs: x - ball_x, y - ball_y, self_vx, self_vy, 1
output: x velocity [-1 .. 1]*const, y velocity [-1 .. 1]*const
"""
inputs = [(self.body.position[0] - ball.body.position[0])/300,
(self.body.position[1] - ball.body.position[1])/30... | [
"def",
"interact",
"(",
"self",
",",
"ball",
")",
":",
"inputs",
"=",
"[",
"(",
"self",
".",
"body",
".",
"position",
"[",
"0",
"]",
"-",
"ball",
".",
"body",
".",
"position",
"[",
"0",
"]",
")",
"/",
"300",
",",
"(",
"self",
".",
"body",
"."... | https://github.com/peter-ch/MultiNEAT/blob/0dc93aa0e228e23eeb95371bdd3838c64f08fdae/examples/NoveltySearch.py#L110-L126 | ||
google/orbit | 7c0a530f402f0c3753d0bc52f8e3eb620f65d017 | third_party/include-what-you-use/fix_includes.py | python | IWYUOutputParser.ParseOneRecord | (self, iwyu_output, flags) | return retval | Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
2) What line numbers hold includes/fwd-declares to ... | Given a file object with output from an iwyu run, return per file info. | [
"Given",
"a",
"file",
"object",
"with",
"output",
"from",
"an",
"iwyu",
"run",
"return",
"per",
"file",
"info",
"."
] | def ParseOneRecord(self, iwyu_output, flags):
"""Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
... | [
"def",
"ParseOneRecord",
"(",
"self",
",",
"iwyu_output",
",",
"flags",
")",
":",
"for",
"line",
"in",
"iwyu_output",
":",
"if",
"not",
"self",
".",
"_ProcessOneLine",
"(",
"line",
",",
"flags",
".",
"basedir",
")",
":",
"# returns False at end-of-record",
"... | https://github.com/google/orbit/blob/7c0a530f402f0c3753d0bc52f8e3eb620f65d017/third_party/include-what-you-use/fix_includes.py#L388-L472 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | MaskedArray.min | (self, axis=None, out=None, fill_value=None, keepdims=np._NoValue) | return out | Return the minimum along a given axis.
Parameters
----------
axis : {None, int}, optional
Axis along which to operate. By default, ``axis`` is None and the
flattened input is used.
out : array_like, optional
Alternative output array in which to place... | Return the minimum along a given axis. | [
"Return",
"the",
"minimum",
"along",
"a",
"given",
"axis",
"."
] | def min(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue):
"""
Return the minimum along a given axis.
Parameters
----------
axis : {None, int}, optional
Axis along which to operate. By default, ``axis`` is None and the
flattened input is ... | [
"def",
"min",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"fill_value",
"=",
"None",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"keepdims",
"is",
"np",
".",
"_NoValue",
"else",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L5632-L5696 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/cuda/memory.py | python | memory_stats | (device: Union[Device, int] = None) | return collections.OrderedDict(result) | r"""Returns a dictionary of CUDA memory allocator statistics for a
given device.
The return value of this function is a dictionary of statistics, each of
which is a non-negative integer.
Core statistics:
- ``"allocated.{all,large_pool,small_pool}.{current,peak,allocated,freed}"``:
number of... | r"""Returns a dictionary of CUDA memory allocator statistics for a
given device. | [
"r",
"Returns",
"a",
"dictionary",
"of",
"CUDA",
"memory",
"allocator",
"statistics",
"for",
"a",
"given",
"device",
"."
] | def memory_stats(device: Union[Device, int] = None) -> Dict[str, Any]:
r"""Returns a dictionary of CUDA memory allocator statistics for a
given device.
The return value of this function is a dictionary of statistics, each of
which is a non-negative integer.
Core statistics:
- ``"allocated.{al... | [
"def",
"memory_stats",
"(",
"device",
":",
"Union",
"[",
"Device",
",",
"int",
"]",
"=",
"None",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"result",
"=",
"[",
"]",
"def",
"_recurse_add_to_result",
"(",
"prefix",
",",
"obj",
")",
":",
"if... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/cuda/memory.py#L117-L202 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/core/cros_interface.py | python | CrOSInterface.GetFile | (self, filename, destfile=None) | Copies a local file |filename| to |destfile| on the device.
Args:
filename: The name of the local source file.
destfile: The name of the file to copy to, and if it is not specified
then it is the basename of the source file. | Copies a local file |filename| to |destfile| on the device. | [
"Copies",
"a",
"local",
"file",
"|filename|",
"to",
"|destfile|",
"on",
"the",
"device",
"."
] | def GetFile(self, filename, destfile=None):
"""Copies a local file |filename| to |destfile| on the device.
Args:
filename: The name of the local source file.
destfile: The name of the file to copy to, and if it is not specified
then it is the basename of the source file.
"""
loggin... | [
"def",
"GetFile",
"(",
"self",
",",
"filename",
",",
"destfile",
"=",
"None",
")",
":",
"logging",
".",
"debug",
"(",
"\"GetFile(%s, %s)\"",
"%",
"(",
"filename",
",",
"destfile",
")",
")",
"if",
"self",
".",
"local",
":",
"if",
"destfile",
"is",
"not"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/cros_interface.py#L296-L320 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | ComboCtrl_GetFeatures | (*args) | return _combo.ComboCtrl_GetFeatures(*args) | ComboCtrl_GetFeatures() -> int
Returns a bit-list of flags indicating which features of the ComboCtrl
functionality are implemented by this implemetation. See
`wx.combo.ComboCtrlFeatures`. | ComboCtrl_GetFeatures() -> int | [
"ComboCtrl_GetFeatures",
"()",
"-",
">",
"int"
] | def ComboCtrl_GetFeatures(*args):
"""
ComboCtrl_GetFeatures() -> int
Returns a bit-list of flags indicating which features of the ComboCtrl
functionality are implemented by this implemetation. See
`wx.combo.ComboCtrlFeatures`.
"""
return _combo.ComboCtrl_GetFeatures(*args) | [
"def",
"ComboCtrl_GetFeatures",
"(",
"*",
"args",
")",
":",
"return",
"_combo",
".",
"ComboCtrl_GetFeatures",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L570-L578 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Scanner/__init__.py | python | Scanner | (function, *args, **kw) | Public interface factory function for creating different types
of Scanners based on the different types of "functions" that may
be supplied.
TODO: Deprecate this some day. We've moved the functionality
inside the Base class and really don't need this factory function
any more. It was, however, u... | Public interface factory function for creating different types
of Scanners based on the different types of "functions" that may
be supplied. | [
"Public",
"interface",
"factory",
"function",
"for",
"creating",
"different",
"types",
"of",
"Scanners",
"based",
"on",
"the",
"different",
"types",
"of",
"functions",
"that",
"may",
"be",
"supplied",
"."
] | def Scanner(function, *args, **kw):
"""
Public interface factory function for creating different types
of Scanners based on the different types of "functions" that may
be supplied.
TODO: Deprecate this some day. We've moved the functionality
inside the Base class and really don't need this fa... | [
"def",
"Scanner",
"(",
"function",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"if",
"SCons",
".",
"Util",
".",
"is_Dict",
"(",
"function",
")",
":",
"return",
"Selector",
"(",
"function",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
"else",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Scanner/__init__.py#L45-L60 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/bin/codegen.py | python | main | () | Main program. | Main program. | [
"Main",
"program",
"."
] | def main():
"""
Main program.
"""
global ERROR # prevent local creation of variable
global VERBOSE # prevent local creation of variable
global GEN_TEST_CODE # indicate if test code should be generated
global DEPLOYMENT # deployment set in topology xml only and used to install new instanc... | [
"def",
"main",
"(",
")",
":",
"global",
"ERROR",
"# prevent local creation of variable",
"global",
"VERBOSE",
"# prevent local creation of variable",
"global",
"GEN_TEST_CODE",
"# indicate if test code should be generated",
"global",
"DEPLOYMENT",
"# deployment set in topology xml on... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/bin/codegen.py#L1174-L1327 | ||
teeworlds/teeworlds | b9a30e8a2b872c31b4513e9575c99e044be40bd4 | scripts/reconvert_l10n.py | python | reconvert | (filename, json_filename) | Converts a l10n file.po into a file.json, keeping author info from a previous file.json if possible | Converts a l10n file.po into a file.json, keeping author info from a previous file.json if possible | [
"Converts",
"a",
"l10n",
"file",
".",
"po",
"into",
"a",
"file",
".",
"json",
"keeping",
"author",
"info",
"from",
"a",
"previous",
"file",
".",
"json",
"if",
"possible"
] | def reconvert(filename, json_filename):
"""Converts a l10n file.po into a file.json, keeping author info from a previous file.json if possible"""
po = polib.pofile(open(filename, encoding='utf-8').read())
translations = []
for entry in po:
if entry.msgstr:
t_entry = {}
t_entry[JSON_KEY_OR] = entry.msgid
... | [
"def",
"reconvert",
"(",
"filename",
",",
"json_filename",
")",
":",
"po",
"=",
"polib",
".",
"pofile",
"(",
"open",
"(",
"filename",
",",
"encoding",
"=",
"'utf-8'",
")",
".",
"read",
"(",
")",
")",
"translations",
"=",
"[",
"]",
"for",
"entry",
"in... | https://github.com/teeworlds/teeworlds/blob/b9a30e8a2b872c31b4513e9575c99e044be40bd4/scripts/reconvert_l10n.py#L12-L48 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/examples/python/mach_o.py | python | TerminalColors.inverse | (self, on=True) | return '' | Enable or disable inverse depending on the "on" parameter. | Enable or disable inverse depending on the "on" parameter. | [
"Enable",
"or",
"disable",
"inverse",
"depending",
"on",
"the",
"on",
"parameter",
"."
] | def inverse(self, on=True):
'''Enable or disable inverse depending on the "on" parameter.'''
if self.enabled:
if on:
return "\x1b[7m"
else:
return "\x1b[27m"
return '' | [
"def",
"inverse",
"(",
"self",
",",
"on",
"=",
"True",
")",
":",
"if",
"self",
".",
"enabled",
":",
"if",
"on",
":",
"return",
"\"\\x1b[7m\"",
"else",
":",
"return",
"\"\\x1b[27m\"",
"return",
"''"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/examples/python/mach_o.py#L253-L260 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Menu.__init__ | (self, master=None, cnf={}, **kw) | Construct menu widget with the parent MASTER.
Valid resource names: activebackground, activeborderwidth,
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
selectcolor, takefocus, tearoff, tearoffcommand, title, type... | Construct menu widget with the parent MASTER. | [
"Construct",
"menu",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct menu widget with the parent MASTER.
Valid resource names: activebackground, activeborderwidth,
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
se... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'menu'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2635-L2642 | ||
rbgirshick/caffe-fast-rcnn | 28a579eaf0668850705598b3075b8969f22226d9 | python/caffe/pycaffe.py | python | _Net_batch | (self, blobs) | Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} dict for a single batch. | Batch blob lists according to net's batch size. | [
"Batch",
"blob",
"lists",
"according",
"to",
"net",
"s",
"batch",
"size",
"."
] | def _Net_batch(self, blobs):
"""
Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} ... | [
"def",
"_Net_batch",
"(",
"self",
",",
"blobs",
")",
":",
"num",
"=",
"len",
"(",
"blobs",
".",
"itervalues",
"(",
")",
".",
"next",
"(",
")",
")",
"batch_size",
"=",
"self",
".",
"blobs",
".",
"itervalues",
"(",
")",
".",
"next",
"(",
")",
".",
... | https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/python/caffe/pycaffe.py#L238-L269 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/fsprinting.py | python | get_color_rules | () | return RULE_CACHE | Returns a dict of pattern : colorcode, retrieved from LS_COLORS. | Returns a dict of pattern : colorcode, retrieved from LS_COLORS. | [
"Returns",
"a",
"dict",
"of",
"pattern",
":",
"colorcode",
"retrieved",
"from",
"LS_COLORS",
"."
] | def get_color_rules():
"""
Returns a dict of pattern : colorcode, retrieved from LS_COLORS.
"""
if RULE_CACHE:
return RULE_CACHE
from os import environ
try:
rules = environ['LS_COLORS']
except KeyError:
return {}
for rule in rules.split(':'):
rule = rul... | [
"def",
"get_color_rules",
"(",
")",
":",
"if",
"RULE_CACHE",
":",
"return",
"RULE_CACHE",
"from",
"os",
"import",
"environ",
"try",
":",
"rules",
"=",
"environ",
"[",
"'LS_COLORS'",
"]",
"except",
"KeyError",
":",
"return",
"{",
"}",
"for",
"rule",
"in",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/fsprinting.py#L15-L43 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/decoder/beam_search_decoder.py | python | BeamSearchDecoder.update_array | (self, array, value) | Store the value generated in current step in an array for each RNN step.
This array could be accessed by read_array method.
Args:
array (Variable): The array to append the new variable to.
value (Variable): The newly generated value to be stored. | Store the value generated in current step in an array for each RNN step.
This array could be accessed by read_array method. | [
"Store",
"the",
"value",
"generated",
"in",
"current",
"step",
"in",
"an",
"array",
"for",
"each",
"RNN",
"step",
".",
"This",
"array",
"could",
"be",
"accessed",
"by",
"read_array",
"method",
"."
] | def update_array(self, array, value):
"""
Store the value generated in current step in an array for each RNN step.
This array could be accessed by read_array method.
Args:
array (Variable): The array to append the new variable to.
value (Variable): The newly gene... | [
"def",
"update_array",
"(",
"self",
",",
"array",
",",
"value",
")",
":",
"self",
".",
"_assert_in_decoder_block",
"(",
"'update_array'",
")",
"if",
"not",
"isinstance",
"(",
"array",
",",
"Variable",
")",
":",
"raise",
"TypeError",
"(",
"'The input argument `... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/decoder/beam_search_decoder.py#L782-L802 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/savegame_codec/_encoder.py | python | _encode_tuple | (o) | return _encode_with_prefix(TUPLE_PREFIX, "(%s)" % (_encode_list(list(o)).replace('"', PLACEHOLDER))) | Get a string representation of a tuple with its encoded content. | Get a string representation of a tuple with its encoded content. | [
"Get",
"a",
"string",
"representation",
"of",
"a",
"tuple",
"with",
"its",
"encoded",
"content",
"."
] | def _encode_tuple(o):
"""Get a string representation of a tuple with its encoded content."""
return _encode_with_prefix(TUPLE_PREFIX, "(%s)" % (_encode_list(list(o)).replace('"', PLACEHOLDER))) | [
"def",
"_encode_tuple",
"(",
"o",
")",
":",
"return",
"_encode_with_prefix",
"(",
"TUPLE_PREFIX",
",",
"\"(%s)\"",
"%",
"(",
"_encode_list",
"(",
"list",
"(",
"o",
")",
")",
".",
"replace",
"(",
"'\"'",
",",
"PLACEHOLDER",
")",
")",
")"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/savegame_codec/_encoder.py#L138-L140 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/cluster/ClusterServer.py | python | ClusterServer._readerPollTask | (self, state) | return Task.cont | Non blocking task to read all available datagrams | Non blocking task to read all available datagrams | [
"Non",
"blocking",
"task",
"to",
"read",
"all",
"available",
"datagrams"
] | def _readerPollTask(self, state):
""" Non blocking task to read all available datagrams """
while 1:
(datagram, dgi, type) = self.msgHandler.nonBlockingRead(self.qcr)
# Queue is empty, done for now
if type is CLUSTER_NONE:
break
else:
... | [
"def",
"_readerPollTask",
"(",
"self",
",",
"state",
")",
":",
"while",
"1",
":",
"(",
"datagram",
",",
"dgi",
",",
"type",
")",
"=",
"self",
".",
"msgHandler",
".",
"nonBlockingRead",
"(",
"self",
".",
"qcr",
")",
"# Queue is empty, done for now",
"if",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/cluster/ClusterServer.py#L197-L207 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/lookup_ops.py | python | InitializableLookupTableBase.lookup | (self, keys, name=None) | Looks up `keys` in a table, outputs the corresponding values.
The `default_value` is used for keys not present in the table.
Args:
keys: Keys to look up. May be either a `SparseTensor` or dense `Tensor`.
name: A name for the operation (optional).
Returns:
A `SparseTensor` if keys are sp... | Looks up `keys` in a table, outputs the corresponding values. | [
"Looks",
"up",
"keys",
"in",
"a",
"table",
"outputs",
"the",
"corresponding",
"values",
"."
] | def lookup(self, keys, name=None):
"""Looks up `keys` in a table, outputs the corresponding values.
The `default_value` is used for keys not present in the table.
Args:
keys: Keys to look up. May be either a `SparseTensor` or dense `Tensor`.
name: A name for the operation (optional).
Retu... | [
"def",
"lookup",
"(",
"self",
",",
"keys",
",",
"name",
"=",
"None",
")",
":",
"key_tensor",
"=",
"keys",
"if",
"isinstance",
"(",
"keys",
",",
"sparse_tensor",
".",
"SparseTensor",
")",
":",
"key_tensor",
"=",
"keys",
".",
"values",
"if",
"keys",
".",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/lookup_ops.py#L199-L235 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/statetracker.py | python | StateTracker.InFunction | (self) | return bool(self._functions) | Returns true if the current token is within a function.
Returns:
True if the current token is within a function. | Returns true if the current token is within a function. | [
"Returns",
"true",
"if",
"the",
"current",
"token",
"is",
"within",
"a",
"function",
"."
] | def InFunction(self):
"""Returns true if the current token is within a function.
Returns:
True if the current token is within a function.
"""
return bool(self._functions) | [
"def",
"InFunction",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"_functions",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/statetracker.py#L591-L597 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/data.py | python | ExtendedProperty.get_xml_blob | (self) | Returns the XML blob as an atom.core.XmlElement.
Returns:
An XmlElement representing the blob's XML, or None if no
blob was set. | Returns the XML blob as an atom.core.XmlElement. | [
"Returns",
"the",
"XML",
"blob",
"as",
"an",
"atom",
".",
"core",
".",
"XmlElement",
"."
] | def get_xml_blob(self):
"""Returns the XML blob as an atom.core.XmlElement.
Returns:
An XmlElement representing the blob's XML, or None if no
blob was set.
"""
if self._other_elements:
return self._other_elements[0]
else:
return None | [
"def",
"get_xml_blob",
"(",
"self",
")",
":",
"if",
"self",
".",
"_other_elements",
":",
"return",
"self",
".",
"_other_elements",
"[",
"0",
"]",
"else",
":",
"return",
"None"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/data.py#L256-L266 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py | python | Globe.ReadDbRoot | (self, path, layer_id) | Returns dbroot.
If dbroot is not found, throws an exception. | Returns dbroot. | [
"Returns",
"dbroot",
"."
] | def ReadDbRoot(self, path, layer_id):
"""Returns dbroot.
If dbroot is not found, throws an exception.
"""
if self.unpacker_.FindLayerFile(path, layer_id, self.file_loc_):
data = self.GetData()
print "path dbroot: ", path, len(data)
return data
elif self.unpacker_.FindQtpPacket(
... | [
"def",
"ReadDbRoot",
"(",
"self",
",",
"path",
",",
"layer_id",
")",
":",
"if",
"self",
".",
"unpacker_",
".",
"FindLayerFile",
"(",
"path",
",",
"layer_id",
",",
"self",
".",
"file_loc_",
")",
":",
"data",
"=",
"self",
".",
"GetData",
"(",
")",
"pri... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py#L209-L224 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Menu.index | (self, index) | return getint(i) | Return the index of a menu item identified by INDEX. | Return the index of a menu item identified by INDEX. | [
"Return",
"the",
"index",
"of",
"a",
"menu",
"item",
"identified",
"by",
"INDEX",
"."
] | def index(self, index):
"""Return the index of a menu item identified by INDEX."""
i = self.tk.call(self._w, 'index', index)
if i == 'none': return None
return getint(i) | [
"def",
"index",
"(",
"self",
",",
"index",
")",
":",
"i",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'index'",
",",
"index",
")",
"if",
"i",
"==",
"'none'",
":",
"return",
"None",
"return",
"getint",
"(",
"i",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2731-L2735 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | buildsystem/pxdgen.py | python | PXDGenerator.get_pxd_lines | (self) | calls self.parse() and processes the pxd annotations to pxd code lines. | calls self.parse() and processes the pxd annotations to pxd code lines. | [
"calls",
"self",
".",
"parse",
"()",
"and",
"processes",
"the",
"pxd",
"annotations",
"to",
"pxd",
"code",
"lines",
"."
] | def get_pxd_lines(self):
"""
calls self.parse() and processes the pxd annotations to pxd code lines.
"""
from datetime import datetime
year = datetime.now().year
yield ("# Copyright 2013-{} the openage authors. "
"See copying.md for legal info.".format(yea... | [
"def",
"get_pxd_lines",
"(",
"self",
")",
":",
"from",
"datetime",
"import",
"datetime",
"year",
"=",
"datetime",
".",
"now",
"(",
")",
".",
"year",
"yield",
"(",
"\"# Copyright 2013-{} the openage authors. \"",
"\"See copying.md for legal info.\"",
".",
"format",
"... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/buildsystem/pxdgen.py#L280-L333 | ||
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/wesnoth/wmltools3.py | python | Forest.generator | (self) | Return a generator that walks through all files. | Return a generator that walks through all files. | [
"Return",
"a",
"generator",
"that",
"walks",
"through",
"all",
"files",
"."
] | def generator(self):
"Return a generator that walks through all files."
for (directory, tree) in zip(self.dirpath, self.forest):
for filename in tree:
yield (directory, filename) | [
"def",
"generator",
"(",
"self",
")",
":",
"for",
"(",
"directory",
",",
"tree",
")",
"in",
"zip",
"(",
"self",
".",
"dirpath",
",",
"self",
".",
"forest",
")",
":",
"for",
"filename",
"in",
"tree",
":",
"yield",
"(",
"directory",
",",
"filename",
... | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmltools3.py#L257-L261 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py | python | SupervisedSession._is_closed | (self) | return self._tf_sess is None | Return True if the supervised session is closed. For tests only.
Returns:
A boolean. | Return True if the supervised session is closed. For tests only. | [
"Return",
"True",
"if",
"the",
"supervised",
"session",
"is",
"closed",
".",
"For",
"tests",
"only",
"."
] | def _is_closed(self):
"""Return True if the supervised session is closed. For tests only.
Returns:
A boolean.
"""
return self._tf_sess is None | [
"def",
"_is_closed",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tf_sess",
"is",
"None"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py#L338-L344 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py | python | XmlTopologyParser.get_base_id_window | (self) | return self.__base_id_window | Return base id window size of topology | Return base id window size of topology | [
"Return",
"base",
"id",
"window",
"size",
"of",
"topology"
] | def get_base_id_window(self):
"""
Return base id window size of topology
"""
return self.__base_id_window | [
"def",
"get_base_id_window",
"(",
"self",
")",
":",
"return",
"self",
".",
"__base_id_window"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py#L364-L368 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py | python | Context.is_canonical | (self, a) | return a.is_canonical() | Return True if the operand is canonical; otherwise return False.
Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal.
>>> ExtendedContext.is_canonical(Decimal('2.50'))
True | Return True if the operand is canonical; otherwise return False. | [
"Return",
"True",
"if",
"the",
"operand",
"is",
"canonical",
";",
"otherwise",
"return",
"False",
"."
] | def is_canonical(self, a):
"""Return True if the operand is canonical; otherwise return False.
Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal.
>>> ExtendedContext.is_canonical(Decimal('2.50'))
True
"""
... | [
"def",
"is_canonical",
"(",
"self",
",",
"a",
")",
":",
"if",
"not",
"isinstance",
"(",
"a",
",",
"Decimal",
")",
":",
"raise",
"TypeError",
"(",
"\"is_canonical requires a Decimal as an argument.\"",
")",
"return",
"a",
".",
"is_canonical",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L4486-L4497 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/magic.py | python | from_buffer | (buffer, mime=False) | return m.from_buffer(buffer) | Accepts a binary string and returns the detected filetype. Return
value is the mimetype if mime=True, otherwise a human readable
name.
>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
'PDF document, version 1.2' | Accepts a binary string and returns the detected filetype. Return
value is the mimetype if mime=True, otherwise a human readable
name. | [
"Accepts",
"a",
"binary",
"string",
"and",
"returns",
"the",
"detected",
"filetype",
".",
"Return",
"value",
"is",
"the",
"mimetype",
"if",
"mime",
"=",
"True",
"otherwise",
"a",
"human",
"readable",
"name",
"."
] | def from_buffer(buffer, mime=False):
"""
Accepts a binary string and returns the detected filetype. Return
value is the mimetype if mime=True, otherwise a human readable
name.
>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
'PDF document, version 1.2'
"""
m = _get_magic_typ... | [
"def",
"from_buffer",
"(",
"buffer",
",",
"mime",
"=",
"False",
")",
":",
"m",
"=",
"_get_magic_type",
"(",
"mime",
")",
"return",
"m",
".",
"from_buffer",
"(",
"buffer",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/magic.py#L138-L148 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/gas.py | python | generate | (env) | Add Builders and construction variables for as to an Environment. | Add Builders and construction variables for as to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"as",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for as to an Environment."""
as_module.generate(env)
env['AS'] = env.Detect(assemblers) or 'as' | [
"def",
"generate",
"(",
"env",
")",
":",
"as_module",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'AS'",
"]",
"=",
"env",
".",
"Detect",
"(",
"assemblers",
")",
"or",
"'as'"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/gas.py#L43-L47 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tix.py | python | Grid.move_column | (self, from_, to, offset) | Moves the range of columns from position FROM through TO by
the distance indicated by OFFSET. For example, move_column(2, 4, 1)
moves the columns 2,3,4 to columns 3,4,5. | Moves the range of columns from position FROM through TO by
the distance indicated by OFFSET. For example, move_column(2, 4, 1)
moves the columns 2,3,4 to columns 3,4,5. | [
"Moves",
"the",
"range",
"of",
"columns",
"from",
"position",
"FROM",
"through",
"TO",
"by",
"the",
"distance",
"indicated",
"by",
"OFFSET",
".",
"For",
"example",
"move_column",
"(",
"2",
"4",
"1",
")",
"moves",
"the",
"columns",
"2",
"3",
"4",
"to",
... | def move_column(self, from_, to, offset):
"""Moves the range of columns from position FROM through TO by
the distance indicated by OFFSET. For example, move_column(2, 4, 1)
moves the columns 2,3,4 to columns 3,4,5."""
self.tk.call(self, 'move', 'column', from_, to, offset) | [
"def",
"move_column",
"(",
"self",
",",
"from_",
",",
"to",
",",
"offset",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
",",
"'move'",
",",
"'column'",
",",
"from_",
",",
"to",
",",
"offset",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tix.py#L1876-L1880 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetWordChars | (*args, **kwargs) | return _stc.StyledTextCtrl_GetWordChars(*args, **kwargs) | GetWordChars(self) -> String | GetWordChars(self) -> String | [
"GetWordChars",
"(",
"self",
")",
"-",
">",
"String"
] | def GetWordChars(*args, **kwargs):
"""GetWordChars(self) -> String"""
return _stc.StyledTextCtrl_GetWordChars(*args, **kwargs) | [
"def",
"GetWordChars",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetWordChars",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L2844-L2846 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/externals/joblib/format_stack.py | python | safe_repr | (value) | Hopefully pretty robust repr equivalent. | Hopefully pretty robust repr equivalent. | [
"Hopefully",
"pretty",
"robust",
"repr",
"equivalent",
"."
] | def safe_repr(value):
"""Hopefully pretty robust repr equivalent."""
# this is pretty horrible but should always return *something*
try:
return pydoc.text.repr(value)
except KeyboardInterrupt:
raise
except:
try:
return repr(value)
except KeyboardInterrupt:... | [
"def",
"safe_repr",
"(",
"value",
")",
":",
"# this is pretty horrible but should always return *something*",
"try",
":",
"return",
"pydoc",
".",
"text",
".",
"repr",
"(",
"value",
")",
"except",
"KeyboardInterrupt",
":",
"raise",
"except",
":",
"try",
":",
"retur... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/joblib/format_stack.py#L42-L68 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/email/generator.py | python | Generator.__init__ | (self, outfp, mangle_from_=True, maxheaderlen=78) | Create the generator for message flattening.
outfp is the output file-like object for writing the message to. It
must have a write() method.
Optional mangle_from_ is a flag that, when True (the default), escapes
From_ lines in the body of the message by putting a `>' in front of
... | Create the generator for message flattening. | [
"Create",
"the",
"generator",
"for",
"message",
"flattening",
"."
] | def __init__(self, outfp, mangle_from_=True, maxheaderlen=78):
"""Create the generator for message flattening.
outfp is the output file-like object for writing the message to. It
must have a write() method.
Optional mangle_from_ is a flag that, when True (the default), escapes
... | [
"def",
"__init__",
"(",
"self",
",",
"outfp",
",",
"mangle_from_",
"=",
"True",
",",
"maxheaderlen",
"=",
"78",
")",
":",
"self",
".",
"_fp",
"=",
"outfp",
"self",
".",
"_mangle_from_",
"=",
"mangle_from_",
"self",
".",
"_maxheaderlen",
"=",
"maxheaderlen"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/generator.py#L43-L62 | ||
dlunion/CC4.0 | 6fb51e494b6a88f0987b9dd99117ec21766e3aee | python/caffe/io.py | python | Transformer.set_input_scale | (self, in_, scale) | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign this scale factor
scale : scale coefficient | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE. | [
"Set",
"the",
"scale",
"of",
"preprocessed",
"inputs",
"s",
".",
"t",
".",
"the",
"blob",
"=",
"blob",
"*",
"scale",
".",
"N",
".",
"B",
".",
"input_scale",
"is",
"done",
"AFTER",
"mean",
"subtraction",
"and",
"other",
"preprocessing",
"while",
"raw_scal... | def set_input_scale(self, in_, scale):
"""
Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign... | [
"def",
"set_input_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"input_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/dlunion/CC4.0/blob/6fb51e494b6a88f0987b9dd99117ec21766e3aee/python/caffe/io.py#L262-L274 | ||
CleverRaven/Cataclysm-DDA | 03e7363df0835ec1b39da973ea29f26f27833b38 | tools/json_tools/util.py | python | value_counter | (data, search_key, where_fn_list) | return stats, len(matching_data) | Takes a search_key {str}, and for values found in data {list of dicts}
that also match each where_fn_list {list of fns} with those keys,
counts the number of times the value appears.
Returns a tuple of data. | Takes a search_key {str}, and for values found in data {list of dicts}
that also match each where_fn_list {list of fns} with those keys,
counts the number of times the value appears. | [
"Takes",
"a",
"search_key",
"{",
"str",
"}",
"and",
"for",
"values",
"found",
"in",
"data",
"{",
"list",
"of",
"dicts",
"}",
"that",
"also",
"match",
"each",
"where_fn_list",
"{",
"list",
"of",
"fns",
"}",
"with",
"those",
"keys",
"counts",
"the",
"num... | def value_counter(data, search_key, where_fn_list):
"""Takes a search_key {str}, and for values found in data {list of dicts}
that also match each where_fn_list {list of fns} with those keys,
counts the number of times the value appears.
Returns a tuple of data.
"""
stats = Counter()
matchi... | [
"def",
"value_counter",
"(",
"data",
",",
"search_key",
",",
"where_fn_list",
")",
":",
"stats",
"=",
"Counter",
"(",
")",
"matching_data",
"=",
"[",
"i",
"for",
"i",
"in",
"data",
"if",
"matches_all_wheres",
"(",
"i",
",",
"where_fn_list",
")",
"]",
"# ... | https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/json_tools/util.py#L235-L288 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/ast/ast_transformer.py | python | ASTTransformer.build_assign_basic | (ctx, target, value, is_static_assign) | return var | Build basic assginment like this: target = value.
Args:
ctx (ast_builder_utils.BuilderContext): The builder context.
target (ast.Name): A variable name. `target.id` holds the name as
a string.
value: A node representing the value.
is_static_assign: A... | Build basic assginment like this: target = value. | [
"Build",
"basic",
"assginment",
"like",
"this",
":",
"target",
"=",
"value",
"."
] | def build_assign_basic(ctx, target, value, is_static_assign):
"""Build basic assginment like this: target = value.
Args:
ctx (ast_builder_utils.BuilderContext): The builder context.
target (ast.Name): A variable name. `target.id` holds the name as
a string.
... | [
"def",
"build_assign_basic",
"(",
"ctx",
",",
"target",
",",
"value",
",",
"is_static_assign",
")",
":",
"is_local",
"=",
"isinstance",
"(",
"target",
",",
"ast",
".",
"Name",
")",
"if",
"is_static_assign",
":",
"if",
"not",
"is_local",
":",
"raise",
"Taic... | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/ast/ast_transformer.py#L121-L149 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQM/Integration/scripts/harvesting_tools/cmsHarvester.py | python | CMSHarvester.option_handler_harvesting_mode | (self, option, opt_str, value, parser) | Set the harvesting mode to be used.
Single-step harvesting can be used for samples that are
located completely at a single site (= SE). Otherwise use
two-step mode. | Set the harvesting mode to be used. | [
"Set",
"the",
"harvesting",
"mode",
"to",
"be",
"used",
"."
] | def option_handler_harvesting_mode(self, option, opt_str, value, parser):
"""Set the harvesting mode to be used.
Single-step harvesting can be used for samples that are
located completely at a single site (= SE). Otherwise use
two-step mode.
"""
# Check for valid mode.... | [
"def",
"option_handler_harvesting_mode",
"(",
"self",
",",
"option",
",",
"opt_str",
",",
"value",
",",
"parser",
")",
":",
"# Check for valid mode.",
"harvesting_mode",
"=",
"value",
".",
"lower",
"(",
")",
"if",
"not",
"harvesting_mode",
"in",
"self",
".",
"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L756-L783 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | TaskBarIcon.IsAvailable | (*args, **kwargs) | return _windows_.TaskBarIcon_IsAvailable(*args, **kwargs) | IsAvailable() -> bool | IsAvailable() -> bool | [
"IsAvailable",
"()",
"-",
">",
"bool"
] | def IsAvailable(*args, **kwargs):
"""IsAvailable() -> bool"""
return _windows_.TaskBarIcon_IsAvailable(*args, **kwargs) | [
"def",
"IsAvailable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TaskBarIcon_IsAvailable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2870-L2872 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsSupplementaryPrivateUseAreaA | (code) | return ret | Check whether the character is part of
SupplementaryPrivateUseArea-A UCS Block | Check whether the character is part of
SupplementaryPrivateUseArea-A UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"SupplementaryPrivateUseArea",
"-",
"A",
"UCS",
"Block"
] | def uCSIsSupplementaryPrivateUseAreaA(code):
"""Check whether the character is part of
SupplementaryPrivateUseArea-A UCS Block """
ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaA(code)
return ret | [
"def",
"uCSIsSupplementaryPrivateUseAreaA",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsSupplementaryPrivateUseAreaA",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2840-L2844 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/connection.py | python | create_connection | (
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
) | Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the... | Connect to *address* and return the socket object. | [
"Connect",
"to",
"*",
"address",
"*",
"and",
"return",
"the",
"socket",
"object",
"."
] | def create_connection(
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the opti... | [
"def",
"create_connection",
"(",
"address",
",",
"timeout",
"=",
"socket",
".",
"_GLOBAL_DEFAULT_TIMEOUT",
",",
"source_address",
"=",
"None",
",",
"socket_options",
"=",
"None",
",",
")",
":",
"host",
",",
"port",
"=",
"address",
"if",
"host",
".",
"startsw... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/connection.py#L38-L98 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/reshape/reshape.py | python | _reorder_for_extension_array_stack | (arr, n_rows: int, n_columns: int) | return arr.take(idx) | Re-orders the values when stacking multiple extension-arrays.
The indirect stacking method used for EAs requires a followup
take to get the order correct.
Parameters
----------
arr : ExtensionArray
n_rows, n_columns : int
The number of rows and columns in the original DataFrame.
R... | Re-orders the values when stacking multiple extension-arrays. | [
"Re",
"-",
"orders",
"the",
"values",
"when",
"stacking",
"multiple",
"extension",
"-",
"arrays",
"."
] | def _reorder_for_extension_array_stack(arr, n_rows: int, n_columns: int):
"""
Re-orders the values when stacking multiple extension-arrays.
The indirect stacking method used for EAs requires a followup
take to get the order correct.
Parameters
----------
arr : ExtensionArray
n_rows, n_... | [
"def",
"_reorder_for_extension_array_stack",
"(",
"arr",
",",
"n_rows",
":",
"int",
",",
"n_columns",
":",
"int",
")",
":",
"# final take to get the order correct.",
"# idx is an indexer like",
"# [c0r0, c1r0, c2r0, ...,",
"# c0r1, c1r1, c2r1, ...]",
"idx",
"=",
"np",
".",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/reshape/reshape.py#L1048-L1080 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/format.py | python | read_magic | (fp) | return major, minor | Read the magic string to get the version of the file format.
Parameters
----------
fp : filelike object
Returns
-------
major : int
minor : int | Read the magic string to get the version of the file format. | [
"Read",
"the",
"magic",
"string",
"to",
"get",
"the",
"version",
"of",
"the",
"file",
"format",
"."
] | def read_magic(fp):
""" Read the magic string to get the version of the file format.
Parameters
----------
fp : filelike object
Returns
-------
major : int
minor : int
"""
magic_str = _read_bytes(fp, MAGIC_LEN, "magic string")
if magic_str[:-2] != MAGIC_PREFIX:
msg ... | [
"def",
"read_magic",
"(",
"fp",
")",
":",
"magic_str",
"=",
"_read_bytes",
"(",
"fp",
",",
"MAGIC_LEN",
",",
"\"magic string\"",
")",
"if",
"magic_str",
"[",
":",
"-",
"2",
"]",
"!=",
"MAGIC_PREFIX",
":",
"msg",
"=",
"\"the magic string is not correct; expecte... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/format.py#L179-L199 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window_GetCapture | (*args) | return _core_.Window_GetCapture(*args) | Window_GetCapture() -> Window
Returns the window which currently captures the mouse or None | Window_GetCapture() -> Window | [
"Window_GetCapture",
"()",
"-",
">",
"Window"
] | def Window_GetCapture(*args):
"""
Window_GetCapture() -> Window
Returns the window which currently captures the mouse or None
"""
return _core_.Window_GetCapture(*args) | [
"def",
"Window_GetCapture",
"(",
"*",
"args",
")",
":",
"return",
"_core_",
".",
"Window_GetCapture",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11756-L11762 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py | python | DependencyFinder.get_matcher | (self, reqt) | return matcher | Get a version matcher for a requirement.
:param reqt: The requirement
:type reqt: str
:return: A version matcher (an instance of
:class:`distlib.version.Matcher`). | Get a version matcher for a requirement.
:param reqt: The requirement
:type reqt: str
:return: A version matcher (an instance of
:class:`distlib.version.Matcher`). | [
"Get",
"a",
"version",
"matcher",
"for",
"a",
"requirement",
".",
":",
"param",
"reqt",
":",
"The",
"requirement",
":",
"type",
"reqt",
":",
"str",
":",
"return",
":",
"A",
"version",
"matcher",
"(",
"an",
"instance",
"of",
":",
"class",
":",
"distlib"... | def get_matcher(self, reqt):
"""
Get a version matcher for a requirement.
:param reqt: The requirement
:type reqt: str
:return: A version matcher (an instance of
:class:`distlib.version.Matcher`).
"""
try:
matcher = self.scheme.matcher... | [
"def",
"get_matcher",
"(",
"self",
",",
"reqt",
")",
":",
"try",
":",
"matcher",
"=",
"self",
".",
"scheme",
".",
"matcher",
"(",
"reqt",
")",
"except",
"UnsupportedVersionError",
":",
"# pragma: no cover",
"# XXX compat-mode if cannot read the version",
"name",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L1114-L1128 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py | python | _TensorArrayGradShape | (op) | return [tensor_shape.vector(2)] | Shape function for ops that take a scalar and produce no outputs. | Shape function for ops that take a scalar and produce no outputs. | [
"Shape",
"function",
"for",
"ops",
"that",
"take",
"a",
"scalar",
"and",
"produce",
"no",
"outputs",
"."
] | def _TensorArrayGradShape(op):
"""Shape function for ops that take a scalar and produce no outputs."""
op.inputs[0].get_shape().merge_with(tensor_shape.vector(2))
return [tensor_shape.vector(2)] | [
"def",
"_TensorArrayGradShape",
"(",
"op",
")",
":",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"merge_with",
"(",
"tensor_shape",
".",
"vector",
"(",
"2",
")",
")",
"return",
"[",
"tensor_shape",
".",
"vector",
"(",
"2",
")... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L417-L420 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathFeatureExtensions.py | python | set_default_property_values | (obj, job) | set_default_property_values(obj, job) ... set default values for feature properties | set_default_property_values(obj, job) ... set default values for feature properties | [
"set_default_property_values",
"(",
"obj",
"job",
")",
"...",
"set",
"default",
"values",
"for",
"feature",
"properties"
] | def set_default_property_values(obj, job):
"""set_default_property_values(obj, job) ... set default values for feature properties"""
obj.ExtensionCorners = True
obj.setExpression("ExtensionLengthDefault", "OpToolDiameter / 2.0") | [
"def",
"set_default_property_values",
"(",
"obj",
",",
"job",
")",
":",
"obj",
".",
"ExtensionCorners",
"=",
"True",
"obj",
".",
"setExpression",
"(",
"\"ExtensionLengthDefault\"",
",",
"\"OpToolDiameter / 2.0\"",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathFeatureExtensions.py#L541-L544 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Geometry3D.setTriangleMesh | (self, arg2: "TriangleMesh") | return _robotsim.Geometry3D_setTriangleMesh(self, arg2) | r"""
setTriangleMesh(Geometry3D self, TriangleMesh arg2)
Sets this Geometry3D to a TriangleMesh. | r"""
setTriangleMesh(Geometry3D self, TriangleMesh arg2) | [
"r",
"setTriangleMesh",
"(",
"Geometry3D",
"self",
"TriangleMesh",
"arg2",
")"
] | def setTriangleMesh(self, arg2: "TriangleMesh") -> "void":
r"""
setTriangleMesh(Geometry3D self, TriangleMesh arg2)
Sets this Geometry3D to a TriangleMesh.
"""
return _robotsim.Geometry3D_setTriangleMesh(self, arg2) | [
"def",
"setTriangleMesh",
"(",
"self",
",",
"arg2",
":",
"\"TriangleMesh\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Geometry3D_setTriangleMesh",
"(",
"self",
",",
"arg2",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2176-L2184 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/os2emxpath.py | python | abspath | (path) | return normpath(path) | Return the absolute version of a path | Return the absolute version of a path | [
"Return",
"the",
"absolute",
"version",
"of",
"a",
"path"
] | def abspath(path):
"""Return the absolute version of a path"""
if not isabs(path):
if isinstance(path, unicode):
cwd = os.getcwdu()
else:
cwd = os.getcwd()
path = join(cwd, path)
return normpath(path) | [
"def",
"abspath",
"(",
"path",
")",
":",
"if",
"not",
"isabs",
"(",
"path",
")",
":",
"if",
"isinstance",
"(",
"path",
",",
"unicode",
")",
":",
"cwd",
"=",
"os",
".",
"getcwdu",
"(",
")",
"else",
":",
"cwd",
"=",
"os",
".",
"getcwd",
"(",
")",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/os2emxpath.py#L146-L154 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/util/tf_inspect.py | python | signature | (obj, *, follow_wrapped=True) | return _inspect.signature(
tf_decorator.unwrap(obj)[1], follow_wrapped=follow_wrapped) | TFDecorator-aware replacement for inspect.signature. | TFDecorator-aware replacement for inspect.signature. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"signature",
"."
] | def signature(obj, *, follow_wrapped=True):
"""TFDecorator-aware replacement for inspect.signature."""
return _inspect.signature(
tf_decorator.unwrap(obj)[1], follow_wrapped=follow_wrapped) | [
"def",
"signature",
"(",
"obj",
",",
"*",
",",
"follow_wrapped",
"=",
"True",
")",
":",
"return",
"_inspect",
".",
"signature",
"(",
"tf_decorator",
".",
"unwrap",
"(",
"obj",
")",
"[",
"1",
"]",
",",
"follow_wrapped",
"=",
"follow_wrapped",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/tf_inspect.py#L29-L32 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/platform.py | python | node | () | return uname()[1] | Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined. | Returns the computer's network name (which may not be fully
qualified) | [
"Returns",
"the",
"computer",
"s",
"network",
"name",
"(",
"which",
"may",
"not",
"be",
"fully",
"qualified",
")"
] | def node():
""" Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined.
"""
return uname()[1] | [
"def",
"node",
"(",
")",
":",
"return",
"uname",
"(",
")",
"[",
"1",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/platform.py#L1323-L1331 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/build_tools/buildbot_common.py | python | RemoveFile | (dst) | Remove the provided file. | Remove the provided file. | [
"Remove",
"the",
"provided",
"file",
"."
] | def RemoveFile(dst):
"""Remove the provided file."""
print 'rm ' + dst
oshelpers.Remove(['-f', dst]) | [
"def",
"RemoveFile",
"(",
"dst",
")",
":",
"print",
"'rm '",
"+",
"dst",
"oshelpers",
".",
"Remove",
"(",
"[",
"'-f'",
",",
"dst",
"]",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/buildbot_common.py#L82-L85 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/utils.py | python | LRUCache.__setitem__ | (self, key, value) | Sets the value for an item. Moves the item up so that it
has the highest priority then. | Sets the value for an item. Moves the item up so that it
has the highest priority then. | [
"Sets",
"the",
"value",
"for",
"an",
"item",
".",
"Moves",
"the",
"item",
"up",
"so",
"that",
"it",
"has",
"the",
"highest",
"priority",
"then",
"."
] | def __setitem__(self, key, value):
"""Sets the value for an item. Moves the item up so that it
has the highest priority then.
"""
self._wlock.acquire()
try:
if key in self._mapping:
self._remove(key)
elif len(self._mapping) == self.capacity... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_wlock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"key",
"in",
"self",
".",
"_mapping",
":",
"self",
".",
"_remove",
"(",
"key",
")",
"elif",
"len",
"(",
"sel... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/utils.py#L414-L427 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cmd.py | python | Cmd.default | (self, line) | Called on an input line when the command prefix is not recognized.
If this method is not overridden, it prints an error message and
returns. | Called on an input line when the command prefix is not recognized. | [
"Called",
"on",
"an",
"input",
"line",
"when",
"the",
"command",
"prefix",
"is",
"not",
"recognized",
"."
] | def default(self, line):
"""Called on an input line when the command prefix is not recognized.
If this method is not overridden, it prints an error message and
returns.
"""
self.stdout.write('*** Unknown syntax: %s\n'%line) | [
"def",
"default",
"(",
"self",
",",
"line",
")",
":",
"self",
".",
"stdout",
".",
"write",
"(",
"'*** Unknown syntax: %s\\n'",
"%",
"line",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cmd.py#L229-L236 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/py2and3.py | python | iterkeys | (d, **kw) | return iter(getattr(d, _iterkeys)(**kw)) | Return an iterator over the keys of a dictionary. | Return an iterator over the keys of a dictionary. | [
"Return",
"an",
"iterator",
"over",
"the",
"keys",
"of",
"a",
"dictionary",
"."
] | def iterkeys(d, **kw):
"""Return an iterator over the keys of a dictionary."""
return iter(getattr(d, _iterkeys)(**kw)) | [
"def",
"iterkeys",
"(",
"d",
",",
"*",
"*",
"kw",
")",
":",
"return",
"iter",
"(",
"getattr",
"(",
"d",
",",
"_iterkeys",
")",
"(",
"*",
"*",
"kw",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/py2and3.py#L429-L431 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/service_registry.py | python | ServiceRegistry.__GetRequestField | (self, method_description, body_type) | return body_field_name | Determine the request field for this method. | Determine the request field for this method. | [
"Determine",
"the",
"request",
"field",
"for",
"this",
"method",
"."
] | def __GetRequestField(self, method_description, body_type):
"""Determine the request field for this method."""
body_field_name = self.__BodyFieldName(body_type)
if body_field_name in method_description.get('parameters', {}):
body_field_name = self.__names.FieldName(
'... | [
"def",
"__GetRequestField",
"(",
"self",
",",
"method_description",
",",
"body_type",
")",
":",
"body_field_name",
"=",
"self",
".",
"__BodyFieldName",
"(",
"body_type",
")",
"if",
"body_field_name",
"in",
"method_description",
".",
"get",
"(",
"'parameters'",
","... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/service_registry.py#L402-L413 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/seq2seq.py | python | embedding_attention_seq2seq | (encoder_inputs, decoder_inputs, cell,
num_encoder_symbols, num_decoder_symbols,
embedding_size,
num_heads=1, output_projection=None,
feed_previous=False, dtype=dtypes.float32,
... | Embedding sequence-to-sequence model with attention.
This model first embeds encoder_inputs by a newly created embedding (of shape
[num_encoder_symbols x input_size]). Then it runs an RNN to encode
embedded encoder_inputs into a state vector. It keeps the outputs of this
RNN at every step to use for attention ... | Embedding sequence-to-sequence model with attention. | [
"Embedding",
"sequence",
"-",
"to",
"-",
"sequence",
"model",
"with",
"attention",
"."
] | def embedding_attention_seq2seq(encoder_inputs, decoder_inputs, cell,
num_encoder_symbols, num_decoder_symbols,
embedding_size,
num_heads=1, output_projection=None,
feed_previous=False, dtype=... | [
"def",
"embedding_attention_seq2seq",
"(",
"encoder_inputs",
",",
"decoder_inputs",
",",
"cell",
",",
"num_encoder_symbols",
",",
"num_decoder_symbols",
",",
"embedding_size",
",",
"num_heads",
"=",
"1",
",",
"output_projection",
"=",
"None",
",",
"feed_previous",
"="... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/seq2seq.py#L696-L796 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/combo.py | python | ComboPopup.__init__ | (self, *args, **kwargs) | __init__(self) -> ComboPopup
Constructor | __init__(self) -> ComboPopup | [
"__init__",
"(",
"self",
")",
"-",
">",
"ComboPopup"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> ComboPopup
Constructor
"""
_combo.ComboPopup_swiginit(self,_combo.new_ComboPopup(*args, **kwargs))
ComboPopup._setCallbackInfo(self, self, ComboPopup) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_combo",
".",
"ComboPopup_swiginit",
"(",
"self",
",",
"_combo",
".",
"new_ComboPopup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"ComboPopup",
".",
"_se... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/combo.py#L596-L603 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/error_fixer.py | python | ErrorFixer.HandleFile | (self, filename, first_token) | Notifies this ErrorPrinter that subsequent errors are in filename.
Args:
filename: The name of the file about to be checked.
first_token: The first token in the file. | Notifies this ErrorPrinter that subsequent errors are in filename. | [
"Notifies",
"this",
"ErrorPrinter",
"that",
"subsequent",
"errors",
"are",
"in",
"filename",
"."
] | def HandleFile(self, filename, first_token):
"""Notifies this ErrorPrinter that subsequent errors are in filename.
Args:
filename: The name of the file about to be checked.
first_token: The first token in the file.
"""
self._file_name = filename
self._file_is_html = filename.endswith('.... | [
"def",
"HandleFile",
"(",
"self",
",",
"filename",
",",
"first_token",
")",
":",
"self",
".",
"_file_name",
"=",
"filename",
"self",
".",
"_file_is_html",
"=",
"filename",
".",
"endswith",
"(",
"'.html'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'.htm... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/error_fixer.py#L80-L91 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/feminout/importZ88O2Results.py | python | read_z88_disp | (
z88_disp_input
) | return {"Nodes": nodes, "Results": results} | read a z88 disp file and extract the nodes and elements
z88 Displacement output file is z88o2.txt
works with Z88OS14 | read a z88 disp file and extract the nodes and elements
z88 Displacement output file is z88o2.txt
works with Z88OS14 | [
"read",
"a",
"z88",
"disp",
"file",
"and",
"extract",
"the",
"nodes",
"and",
"elements",
"z88",
"Displacement",
"output",
"file",
"is",
"z88o2",
".",
"txt",
"works",
"with",
"Z88OS14"
] | def read_z88_disp(
z88_disp_input
):
"""
read a z88 disp file and extract the nodes and elements
z88 Displacement output file is z88o2.txt
works with Z88OS14
"""
nodes = {}
mode_disp = {}
mode_results = {}
results = []
z88_disp_file = pyopen(z88_disp_input, "r")
for no,... | [
"def",
"read_z88_disp",
"(",
"z88_disp_input",
")",
":",
"nodes",
"=",
"{",
"}",
"mode_disp",
"=",
"{",
"}",
"mode_results",
"=",
"{",
"}",
"results",
"=",
"[",
"]",
"z88_disp_file",
"=",
"pyopen",
"(",
"z88_disp_input",
",",
"\"r\"",
")",
"for",
"no",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/feminout/importZ88O2Results.py#L134-L172 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/supervisor.py | python | Supervisor._verify_setup | (self) | Check that all is good.
Raises:
ValueError: If something is not good. | Check that all is good. | [
"Check",
"that",
"all",
"is",
"good",
"."
] | def _verify_setup(self):
"""Check that all is good.
Raises:
ValueError: If something is not good.
"""
# Not running as chief means that replicas are used.
# In that case all Variables must have their device set.
if not self._is_chief:
for op in self._graph.get_operations():
... | [
"def",
"_verify_setup",
"(",
"self",
")",
":",
"# Not running as chief means that replicas are used.",
"# In that case all Variables must have their device set.",
"if",
"not",
"self",
".",
"_is_chief",
":",
"for",
"op",
"in",
"self",
".",
"_graph",
".",
"get_operations",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/supervisor.py#L840-L852 | ||
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | square | (x) | return _F.square(x) | square(x)
Return the x*x, element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The `x*x` of `x`.
Example:
-------
>>> expr.square([-5., 4.5])
var([25., 20.25]) | square(x)
Return the x*x, element-wise. | [
"square",
"(",
"x",
")",
"Return",
"the",
"x",
"*",
"x",
"element",
"-",
"wise",
"."
] | def square(x):
'''
square(x)
Return the x*x, element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The `x*x` of `x`.
Example:
-------
>>> expr.square([-5., 4.5])
var([25., 20.25])
'''
x = _to_var(x)
return _F.square(x) | [
"def",
"square",
"(",
"x",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"return",
"_F",
".",
"square",
"(",
"x",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L248-L267 | |
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | ParseNolintSuppressions | (filename, raw_line, linenum, error) | Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the input file.
raw_line: str, the line of input text, with comments.
... | Updates the global list of error-suppressions. | [
"Updates",
"the",
"global",
"list",
"of",
"error",
"-",
"suppressions",
"."
] | def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the inp... | [
"def",
"ParseNolintSuppressions",
"(",
"filename",
",",
"raw_line",
",",
"linenum",
",",
"error",
")",
":",
"# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).",
"matched",
"=",
"_RE_SUPPRESSION",
".",
"search",
"(",
"raw_line",
")",
"if",
"matched",
":",
"cate... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L364-L390 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_mdlg.py | python | EdFormatEOLDlg.__init__ | (self, parent, msg=u'', title=u'', selection=0) | Create the dialog
@keyword selection: default selection (wx.stc.STC_EOL_*) | Create the dialog
@keyword selection: default selection (wx.stc.STC_EOL_*) | [
"Create",
"the",
"dialog",
"@keyword",
"selection",
":",
"default",
"selection",
"(",
"wx",
".",
"stc",
".",
"STC_EOL_",
"*",
")"
] | def __init__(self, parent, msg=u'', title=u'', selection=0):
"""Create the dialog
@keyword selection: default selection (wx.stc.STC_EOL_*)
"""
choices = [_("Old Machintosh (\\r)"), _("Unix (\\n)"),
_("Windows (\\r\\n)")]
self._eol = [wx.stc.STC_EOL_CR, wx.stc.... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"msg",
"=",
"u''",
",",
"title",
"=",
"u''",
",",
"selection",
"=",
"0",
")",
":",
"choices",
"=",
"[",
"_",
"(",
"\"Old Machintosh (\\\\r)\"",
")",
",",
"_",
"(",
"\"Unix (\\\\n)\"",
")",
",",
"_",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_mdlg.py#L132-L150 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/string.py | python | capitalize | (s) | return s.capitalize() | capitalize(s) -> string
Return a copy of the string s with only its first character
capitalized. | capitalize(s) -> string | [
"capitalize",
"(",
"s",
")",
"-",
">",
"string"
] | def capitalize(s):
"""capitalize(s) -> string
Return a copy of the string s with only its first character
capitalized.
"""
return s.capitalize() | [
"def",
"capitalize",
"(",
"s",
")",
":",
"return",
"s",
".",
"capitalize",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/string.py#L501-L508 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsCatLo | (code) | return ret | Check whether the character is part of Lo UCS Category | Check whether the character is part of Lo UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Lo",
"UCS",
"Category"
] | def uCSIsCatLo(code):
"""Check whether the character is part of Lo UCS Category """
ret = libxml2mod.xmlUCSIsCatLo(code)
return ret | [
"def",
"uCSIsCatLo",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatLo",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2236-L2239 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/data_structures.py | python | Mapping._values | (self) | return [] | Collect values for TrackableDataStructure. | Collect values for TrackableDataStructure. | [
"Collect",
"values",
"for",
"TrackableDataStructure",
"."
] | def _values(self):
"""Collect values for TrackableDataStructure."""
# Sort items deterministically by key
ordered = list(zip(*sorted(self.items(), key=lambda it: it[0])))
if ordered:
return ordered[1]
return [] | [
"def",
"_values",
"(",
"self",
")",
":",
"# Sort items deterministically by key",
"ordered",
"=",
"list",
"(",
"zip",
"(",
"*",
"sorted",
"(",
"self",
".",
"items",
"(",
")",
",",
"key",
"=",
"lambda",
"it",
":",
"it",
"[",
"0",
"]",
")",
")",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/data_structures.py#L614-L620 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Rect2D.Union | (*args, **kwargs) | return _core_.Rect2D_Union(*args, **kwargs) | Union(self, Rect2D otherRect) | Union(self, Rect2D otherRect) | [
"Union",
"(",
"self",
"Rect2D",
"otherRect",
")"
] | def Union(*args, **kwargs):
"""Union(self, Rect2D otherRect)"""
return _core_.Rect2D_Union(*args, **kwargs) | [
"def",
"Union",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect2D_Union",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2014-L2016 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/_trustregion.py | python | BaseQuadraticSubproblem.fun | (self) | return self._f | Value of objective function at current iteration. | Value of objective function at current iteration. | [
"Value",
"of",
"objective",
"function",
"at",
"current",
"iteration",
"."
] | def fun(self):
"""Value of objective function at current iteration."""
if self._f is None:
self._f = self._fun(self._x)
return self._f | [
"def",
"fun",
"(",
"self",
")",
":",
"if",
"self",
".",
"_f",
"is",
"None",
":",
"self",
".",
"_f",
"=",
"self",
".",
"_fun",
"(",
"self",
".",
"_x",
")",
"return",
"self",
".",
"_f"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_trustregion.py#L41-L45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.