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 sequence | function stringlengths 34 151k | function_tokens sequence | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/auth.py | python | set_certificate_bundle_path | (path) | Set certificate bundle file(.pem) path for ssl/tls host authentication.
If library is built against default ssl/tls library the default certificate
store should be used. If not(a connection error is returned) you'll have to
provide a certificate bundle to the connection libraries.
def set_ce... | Set certificate bundle file(.pem) path for ssl/tls host authentication.
If library is built against default ssl/tls library the default certificate
store should be used. If not(a connection error is returned) you'll have to
provide a certificate bundle to the connection libraries.
def set_ce... | [
"Set",
"certificate",
"bundle",
"file",
"(",
".",
"pem",
")",
"path",
"for",
"ssl",
"/",
"tls",
"host",
"authentication",
".",
"If",
"library",
"is",
"built",
"against",
"default",
"ssl",
"/",
"tls",
"library",
"the",
"default",
"certificate",
"store",
"sh... | def set_certificate_bundle_path(path):
"""Set certificate bundle file(.pem) path for ssl/tls host authentication.
If library is built against default ssl/tls library the default certificate
store should be used. If not(a connection error is returned) you'll have to
provide a certificate bundle to ... | [
"def",
"set_certificate_bundle_path",
"(",
"path",
")",
":",
"clib",
".",
"set_str",
"(",
"'SetCertificateBundlePath_ABI'",
",",
"path",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/auth.py#L145-L160 | ||
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/opt/scipy_tools.py | python | obj_df | (x,project) | return dobj | dobj = obj_df(x,project)
Objective Function Gradients
SU2 Project interface to scipy.fmin_slsqp
su2: df(x), list[nobj x dim]
scipy_slsqp: df(x), ndarray[dim] | dobj = obj_df(x,project)
Objective Function Gradients
SU2 Project interface to scipy.fmin_slsqp
su2: df(x), list[nobj x dim]
scipy_slsqp: df(x), ndarray[dim] | [
"dobj",
"=",
"obj_df",
"(",
"x",
"project",
")",
"Objective",
"Function",
"Gradients",
"SU2",
"Project",
"interface",
"to",
"scipy",
".",
"fmin_slsqp",
"su2",
":",
"df",
"(",
"x",
")",
"list",
"[",
"nobj",
"x",
"dim",
"]",
"scipy_slsqp",
":",
"df",
"("... | def obj_df(x,project):
""" dobj = obj_df(x,project)
Objective Function Gradients
SU2 Project interface to scipy.fmin_slsqp
su2: df(x), list[nobj x dim]
scipy_slsqp: df(x), ndarray[dim]
"""
dobj_list = project.obj_df(x)
dobj=[0.0]*len(dob... | [
"def",
"obj_df",
"(",
"x",
",",
"project",
")",
":",
"dobj_list",
"=",
"project",
".",
"obj_df",
"(",
"x",
")",
"dobj",
"=",
"[",
"0.0",
"]",
"*",
"len",
"(",
"dobj_list",
"[",
"0",
"]",
")",
"for",
"this_dobj",
"in",
"dobj_list",
":",
"idv",
"="... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/opt/scipy_tools.py#L390-L410 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/apiclient/googleapiclient/model.py | python | BaseModel.deserialize | (self, content) | Perform the actual deserialization from response string to Python
object.
Args:
content: string, the body of the HTTP response
Returns:
The body de-serialized as a Python object. | Perform the actual deserialization from response string to Python
object. | [
"Perform",
"the",
"actual",
"deserialization",
"from",
"response",
"string",
"to",
"Python",
"object",
"."
] | def deserialize(self, content):
"""Perform the actual deserialization from response string to Python
object.
Args:
content: string, the body of the HTTP response
Returns:
The body de-serialized as a Python object.
"""
_abstract() | [
"def",
"deserialize",
"(",
"self",
",",
"content",
")",
":",
"_abstract",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/model.py#L223-L233 | ||
nucleic/atom | 9f0cb2a8101dd63c354a98ebc7489b2c616dc82a | examples/tutorial/person.py | python | Person.debug_print | (self, change) | Prints out a debug message whenever the person's age changes. | Prints out a debug message whenever the person's age changes. | [
"Prints",
"out",
"a",
"debug",
"message",
"whenever",
"the",
"person",
"s",
"age",
"changes",
"."
] | def debug_print(self, change):
"""Prints out a debug message whenever the person's age changes."""
if self.debug:
templ = "{first} {last} is {age} years old."
s = templ.format(
first=self.first_name,
last=self.last_name,
age=self.ag... | [
"def",
"debug_print",
"(",
"self",
",",
"change",
")",
":",
"if",
"self",
".",
"debug",
":",
"templ",
"=",
"\"{first} {last} is {age} years old.\"",
"s",
"=",
"templ",
".",
"format",
"(",
"first",
"=",
"self",
".",
"first_name",
",",
"last",
"=",
"self",
... | https://github.com/nucleic/atom/blob/9f0cb2a8101dd63c354a98ebc7489b2c616dc82a/examples/tutorial/person.py#L26-L35 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/evaluate/arguments.py | python | try_iter_content | (types, depth=0) | Helper method for static analysis. | Helper method for static analysis. | [
"Helper",
"method",
"for",
"static",
"analysis",
"."
] | def try_iter_content(types, depth=0):
"""Helper method for static analysis."""
if depth > 10:
# It's possible that a loop has references on itself (especially with
# CompiledObject). Therefore don't loop infinitely.
return
for typ in types:
try:
f = typ.py__iter_... | [
"def",
"try_iter_content",
"(",
"types",
",",
"depth",
"=",
"0",
")",
":",
"if",
"depth",
">",
"10",
":",
"# It's possible that a loop has references on itself (especially with",
"# CompiledObject). Therefore don't loop infinitely.",
"return",
"for",
"typ",
"in",
"types",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/arguments.py#L16-L30 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateSpan.SetWeeks | (*args, **kwargs) | return _misc_.DateSpan_SetWeeks(*args, **kwargs) | SetWeeks(self, int n) -> DateSpan | SetWeeks(self, int n) -> DateSpan | [
"SetWeeks",
"(",
"self",
"int",
"n",
")",
"-",
">",
"DateSpan"
] | def SetWeeks(*args, **kwargs):
"""SetWeeks(self, int n) -> DateSpan"""
return _misc_.DateSpan_SetWeeks(*args, **kwargs) | [
"def",
"SetWeeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_SetWeeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4661-L4663 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/swf/layer1.py | python | Layer1.describe_activity_type | (self, domain, activity_name, activity_version) | return self.json_request('DescribeActivityType', {
'domain': domain,
'activityType': {'name': activity_name,
'version': activity_version}
}) | Returns information about the specified activity type. This
includes configuration settings provided at registration time
as well as other general information about the type.
:type domain: string
:param domain: The name of the domain in which the activity
type is registered.... | Returns information about the specified activity type. This
includes configuration settings provided at registration time
as well as other general information about the type. | [
"Returns",
"information",
"about",
"the",
"specified",
"activity",
"type",
".",
"This",
"includes",
"configuration",
"settings",
"provided",
"at",
"registration",
"time",
"as",
"well",
"as",
"other",
"general",
"information",
"about",
"the",
"type",
"."
] | def describe_activity_type(self, domain, activity_name, activity_version):
"""
Returns information about the specified activity type. This
includes configuration settings provided at registration time
as well as other general information about the type.
:type domain: string
... | [
"def",
"describe_activity_type",
"(",
"self",
",",
"domain",
",",
"activity_name",
",",
"activity_version",
")",
":",
"return",
"self",
".",
"json_request",
"(",
"'DescribeActivityType'",
",",
"{",
"'domain'",
":",
"domain",
",",
"'activityType'",
":",
"{",
"'na... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/swf/layer1.py#L909-L931 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/wizard.py | python | PyWizardPage.DoGetSize | (*args, **kwargs) | return _wizard.PyWizardPage_DoGetSize(*args, **kwargs) | DoGetSize() -> (width, height) | DoGetSize() -> (width, height) | [
"DoGetSize",
"()",
"-",
">",
"(",
"width",
"height",
")"
] | def DoGetSize(*args, **kwargs):
"""DoGetSize() -> (width, height)"""
return _wizard.PyWizardPage_DoGetSize(*args, **kwargs) | [
"def",
"DoGetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"PyWizardPage_DoGetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/wizard.py#L167-L169 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py | python | DocComment.GetTargetToken | (self) | Get this comment's target token.
Returns:
The token that is the target of this comment, or None if there isn't one. | Get this comment's target token. | [
"Get",
"this",
"comment",
"s",
"target",
"token",
"."
] | def GetTargetToken(self):
"""Get this comment's target token.
Returns:
The token that is the target of this comment, or None if there isn't one.
"""
# File overviews describe the file, not a token.
if self.HasFlag('fileoverview'):
return
skip_types = frozenset([
Type.WHITE... | [
"def",
"GetTargetToken",
"(",
"self",
")",
":",
"# File overviews describe the file, not a token.",
"if",
"self",
".",
"HasFlag",
"(",
"'fileoverview'",
")",
":",
"return",
"skip_types",
"=",
"frozenset",
"(",
"[",
"Type",
".",
"WHITESPACE",
",",
"Type",
".",
"B... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L452-L505 | ||
nlohmann/json | eb2182414749825be086c825edb5229e5c28503d | third_party/cpplint/cpplint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L3513-L3525 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_Ellipsis | (self, p) | Ellipsis : ELLIPSIS | Ellipsis : ELLIPSIS | [
"Ellipsis",
":",
"ELLIPSIS"
] | def p_Ellipsis(self, p):
"""
Ellipsis : ELLIPSIS
"""
p[0] = True | [
"def",
"p_Ellipsis",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"True"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5016-L5020 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests_toolbelt/multipart/encoder.py | python | Part.from_field | (cls, field, encoding) | return cls(headers, body) | Create a part from a Request Field generated by urllib3. | Create a part from a Request Field generated by urllib3. | [
"Create",
"a",
"part",
"from",
"a",
"Request",
"Field",
"generated",
"by",
"urllib3",
"."
] | def from_field(cls, field, encoding):
"""Create a part from a Request Field generated by urllib3."""
headers = encode_with(field.render_headers(), encoding)
body = coerce_data(field.data, encoding)
return cls(headers, body) | [
"def",
"from_field",
"(",
"cls",
",",
"field",
",",
"encoding",
")",
":",
"headers",
"=",
"encode_with",
"(",
"field",
".",
"render_headers",
"(",
")",
",",
"encoding",
")",
"body",
"=",
"coerce_data",
"(",
"field",
".",
"data",
",",
"encoding",
")",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests_toolbelt/multipart/encoder.py#L485-L489 | |
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/lib/configureUtil.py | python | validateFixExistingDirArg | (argDir,label) | return _validateFixArgHelper(argDir,label,os.path.isdir) | convert directory arg to absolute path and check that it exists | convert directory arg to absolute path and check that it exists | [
"convert",
"directory",
"arg",
"to",
"absolute",
"path",
"and",
"check",
"that",
"it",
"exists"
] | def validateFixExistingDirArg(argDir,label) :
"""
convert directory arg to absolute path and check that it exists
"""
return _validateFixArgHelper(argDir,label,os.path.isdir) | [
"def",
"validateFixExistingDirArg",
"(",
"argDir",
",",
"label",
")",
":",
"return",
"_validateFixArgHelper",
"(",
"argDir",
",",
"label",
",",
"os",
".",
"path",
".",
"isdir",
")"
] | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/configureUtil.py#L186-L190 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | scripts/record_map_data.py | python | ArgManager.args | (self) | return self._args | Get parsed args. | Get parsed args. | [
"Get",
"parsed",
"args",
"."
] | def args(self):
"""Get parsed args."""
if self._args is None:
self._args = self.parser.parse_args()
return self._args | [
"def",
"args",
"(",
"self",
")",
":",
"if",
"self",
".",
"_args",
"is",
"None",
":",
"self",
".",
"_args",
"=",
"self",
".",
"parser",
".",
"parse_args",
"(",
")",
"return",
"self",
".",
"_args"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/scripts/record_map_data.py#L94-L98 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | MajorObject.SetMetadata | (self, *args) | return _ogr.MajorObject_SetMetadata(self, *args) | r"""
SetMetadata(MajorObject self, char ** papszMetadata, char const * pszDomain="") -> CPLErr
SetMetadata(MajorObject self, char * pszMetadataString, char const * pszDomain="") -> CPLErr | r"""
SetMetadata(MajorObject self, char ** papszMetadata, char const * pszDomain="") -> CPLErr
SetMetadata(MajorObject self, char * pszMetadataString, char const * pszDomain="") -> CPLErr | [
"r",
"SetMetadata",
"(",
"MajorObject",
"self",
"char",
"**",
"papszMetadata",
"char",
"const",
"*",
"pszDomain",
"=",
")",
"-",
">",
"CPLErr",
"SetMetadata",
"(",
"MajorObject",
"self",
"char",
"*",
"pszMetadataString",
"char",
"const",
"*",
"pszDomain",
"=",... | def SetMetadata(self, *args):
r"""
SetMetadata(MajorObject self, char ** papszMetadata, char const * pszDomain="") -> CPLErr
SetMetadata(MajorObject self, char * pszMetadataString, char const * pszDomain="") -> CPLErr
"""
return _ogr.MajorObject_SetMetadata(self, *args) | [
"def",
"SetMetadata",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"MajorObject_SetMetadata",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L436-L441 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/networking/03-distributed-node/AIDGameObject.py | python | AIDGameObject.announceGenerate | (self) | The AI has created this object, so we send it's distributed object ID
over to the client. That way the client can actually grab the object
and use it to communicate with the AI. Alternatively store it in the
Client Repository in self.cr | The AI has created this object, so we send it's distributed object ID
over to the client. That way the client can actually grab the object
and use it to communicate with the AI. Alternatively store it in the
Client Repository in self.cr | [
"The",
"AI",
"has",
"created",
"this",
"object",
"so",
"we",
"send",
"it",
"s",
"distributed",
"object",
"ID",
"over",
"to",
"the",
"client",
".",
"That",
"way",
"the",
"client",
"can",
"actually",
"grab",
"the",
"object",
"and",
"use",
"it",
"to",
"co... | def announceGenerate(self):
""" The AI has created this object, so we send it's distributed object ID
over to the client. That way the client can actually grab the object
and use it to communicate with the AI. Alternatively store it in the
Client Repository in self.cr """
base.... | [
"def",
"announceGenerate",
"(",
"self",
")",
":",
"base",
".",
"messenger",
".",
"send",
"(",
"self",
".",
"cr",
".",
"uniqueName",
"(",
"'AIDGameObjectGenerated'",
")",
",",
"[",
"self",
".",
"doId",
"]",
")",
"# call the base class method",
"DistributedObjec... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/03-distributed-node/AIDGameObject.py#L10-L17 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/clang/scripts/run_tool.py | python | _CompilerDispatcher.__ProcessResult | (self, result) | Handles result processing.
Args:
result: The result dictionary returned by _ExecuteTool. | Handles result processing. | [
"Handles",
"result",
"processing",
"."
] | def __ProcessResult(self, result):
"""Handles result processing.
Args:
result: The result dictionary returned by _ExecuteTool.
"""
if result['status']:
self.__success_count += 1
for k, v in result['edits'].iteritems():
self.__edits[k].extend(v)
else:
self.__failed_co... | [
"def",
"__ProcessResult",
"(",
"self",
",",
"result",
")",
":",
"if",
"result",
"[",
"'status'",
"]",
":",
"self",
".",
"__success_count",
"+=",
"1",
"for",
"k",
",",
"v",
"in",
"result",
"[",
"'edits'",
"]",
".",
"iteritems",
"(",
")",
":",
"self",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/clang/scripts/run_tool.py#L163-L183 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/command/build_py.py | python | build_py.find_data_files | (self, package, src_dir) | return files | Return filenames for package's data files in 'src_dir | Return filenames for package's data files in 'src_dir | [
"Return",
"filenames",
"for",
"package",
"s",
"data",
"files",
"in",
"src_dir"
] | def find_data_files (self, package, src_dir):
"""Return filenames for package's data files in 'src_dir'"""
globs = (self.package_data.get('', [])
+ self.package_data.get(package, []))
files = []
for pattern in globs:
# Each pattern has to be converted to a pl... | [
"def",
"find_data_files",
"(",
"self",
",",
"package",
",",
"src_dir",
")",
":",
"globs",
"=",
"(",
"self",
".",
"package_data",
".",
"get",
"(",
"''",
",",
"[",
"]",
")",
"+",
"self",
".",
"package_data",
".",
"get",
"(",
"package",
",",
"[",
"]",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/command/build_py.py#L129-L139 | |
kichik/nsis | e39fe70400b823ac3d00321e338cf3410634b10a | SCons/Tools/mstoolkit.py | python | pch_emitter | (target, source, env) | return (target, source) | Sets up the PDB dependencies for a pch file, and adds the object
file target. | Sets up the PDB dependencies for a pch file, and adds the object
file target. | [
"Sets",
"up",
"the",
"PDB",
"dependencies",
"for",
"a",
"pch",
"file",
"and",
"adds",
"the",
"object",
"file",
"target",
"."
] | def pch_emitter(target, source, env):
"""Sets up the PDB dependencies for a pch file, and adds the object
file target."""
validate_vars(env)
pch = None
obj = None
for t in target:
if SCons.Util.splitext(str(t))[1] == '.pch':
pch = t
if SCons.Util.splitext(str(t))[1] == '.obj':
obj = t
if not obj:
... | [
"def",
"pch_emitter",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"validate_vars",
"(",
"env",
")",
"pch",
"=",
"None",
"obj",
"=",
"None",
"for",
"t",
"in",
"target",
":",
"if",
"SCons",
".",
"Util",
".",
"splitext",
"(",
"str",
"(",
"t",
... | https://github.com/kichik/nsis/blob/e39fe70400b823ac3d00321e338cf3410634b10a/SCons/Tools/mstoolkit.py#L104-L128 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | WindowCreateEvent.__init__ | (self, *args, **kwargs) | __init__(self, Window win=None) -> WindowCreateEvent
The EVT_WINDOW_CREATE event is sent as soon as the window object (the
underlying GUI object) exists. | __init__(self, Window win=None) -> WindowCreateEvent | [
"__init__",
"(",
"self",
"Window",
"win",
"=",
"None",
")",
"-",
">",
"WindowCreateEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, Window win=None) -> WindowCreateEvent
The EVT_WINDOW_CREATE event is sent as soon as the window object (the
underlying GUI object) exists.
"""
_core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*ar... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"WindowCreateEvent_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_WindowCreateEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L7332-L7339 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.__eol_test__ | (val) | Default function for end of list test takes an SBValue object.
Return True if val is invalid or it corresponds to a null pointer.
Otherwise, return False. | Default function for end of list test takes an SBValue object. | [
"Default",
"function",
"for",
"end",
"of",
"list",
"test",
"takes",
"an",
"SBValue",
"object",
"."
] | def __eol_test__(val):
"""Default function for end of list test takes an SBValue object.
Return True if val is invalid or it corresponds to a null pointer.
Otherwise, return False.
"""
if not val or val.GetValueAsUnsigned() == 0:
return True
else:
... | [
"def",
"__eol_test__",
"(",
"val",
")",
":",
"if",
"not",
"val",
"or",
"val",
".",
"GetValueAsUnsigned",
"(",
")",
"==",
"0",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11724-L11733 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.SetErrorFileHandle | (self, f, transfer_ownership) | return _lldb.SBDebugger_SetErrorFileHandle(self, f, transfer_ownership) | SetErrorFileHandle(SBDebugger self, FILE * f, bool transfer_ownership) | SetErrorFileHandle(SBDebugger self, FILE * f, bool transfer_ownership) | [
"SetErrorFileHandle",
"(",
"SBDebugger",
"self",
"FILE",
"*",
"f",
"bool",
"transfer_ownership",
")"
] | def SetErrorFileHandle(self, f, transfer_ownership):
"""SetErrorFileHandle(SBDebugger self, FILE * f, bool transfer_ownership)"""
return _lldb.SBDebugger_SetErrorFileHandle(self, f, transfer_ownership) | [
"def",
"SetErrorFileHandle",
"(",
"self",
",",
"f",
",",
"transfer_ownership",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_SetErrorFileHandle",
"(",
"self",
",",
"f",
",",
"transfer_ownership",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3887-L3889 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/reader_source.py | python | ReaderSource.__init__ | (self,
reader_cls,
work_units,
reader_kwargs=None,
enqueue_size=None,
batch_size=1,
queue_capacity=None,
shuffle=False,
min_after_dequeue=None,
num_threads=1,
seed=None) | Initializes a ReaderSource.
Args:
reader_cls: A subclass of `tesorflow.ReaderBase` that will be used to read
from `work_units`.
work_units: A list that describes the source(s) of data to read.
Typically, this is a list of filenames.
reader_kwargs: A dictionary of kwargs to be pass... | Initializes a ReaderSource. | [
"Initializes",
"a",
"ReaderSource",
"."
] | def __init__(self,
reader_cls,
work_units,
reader_kwargs=None,
enqueue_size=None,
batch_size=1,
queue_capacity=None,
shuffle=False,
min_after_dequeue=None,
num_threads=1,
... | [
"def",
"__init__",
"(",
"self",
",",
"reader_cls",
",",
"work_units",
",",
"reader_kwargs",
"=",
"None",
",",
"enqueue_size",
"=",
"None",
",",
"batch_size",
"=",
"1",
",",
"queue_capacity",
"=",
"None",
",",
"shuffle",
"=",
"False",
",",
"min_after_dequeue"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/reader_source.py#L29-L76 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py | python | Policy.header_fetch_parse | (self, name, value) | Given the header name and the value from the model, return the value
to be returned to the application program that is requesting that
header. The value passed in by the email package may contain
surrogateescaped binary data if the lines were parsed by a BytesParser.
The returned value ... | Given the header name and the value from the model, return the value
to be returned to the application program that is requesting that
header. The value passed in by the email package may contain
surrogateescaped binary data if the lines were parsed by a BytesParser.
The returned value ... | [
"Given",
"the",
"header",
"name",
"and",
"the",
"value",
"from",
"the",
"model",
"return",
"the",
"value",
"to",
"be",
"returned",
"to",
"the",
"application",
"program",
"that",
"is",
"requesting",
"that",
"header",
".",
"The",
"value",
"passed",
"in",
"by... | def header_fetch_parse(self, name, value):
"""Given the header name and the value from the model, return the value
to be returned to the application program that is requesting that
header. The value passed in by the email package may contain
surrogateescaped binary data if the lines wer... | [
"def",
"header_fetch_parse",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py#L238-L246 | ||
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/meshrenderer/pysixd/transform.py | python | is_same_transform | (matrix0, matrix1) | return numpy.allclose(matrix0, matrix1) | Return True if two matrices perform same transformation.
>>> is_same_transform(numpy.identity(4), numpy.identity(4))
True
>>> is_same_transform(numpy.identity(4), random_rotation_matrix())
False | Return True if two matrices perform same transformation. | [
"Return",
"True",
"if",
"two",
"matrices",
"perform",
"same",
"transformation",
"."
] | def is_same_transform(matrix0, matrix1):
"""Return True if two matrices perform same transformation.
>>> is_same_transform(numpy.identity(4), numpy.identity(4))
True
>>> is_same_transform(numpy.identity(4), random_rotation_matrix())
False
"""
matrix0 = numpy.array(matrix0, dtype=numpy.floa... | [
"def",
"is_same_transform",
"(",
"matrix0",
",",
"matrix1",
")",
":",
"matrix0",
"=",
"numpy",
".",
"array",
"(",
"matrix0",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
"matrix0",
"/=",
"matrix0",
"[",
"3",
",",
"3",
"]... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/pysixd/transform.py#L1861-L1874 | |
flink-extended/dl-on-flink | 60646aa9520f49619b64e9ff03ce73959e8a3858 | flink-ml-tensorflow/python/flink_ml_tensorflow/gpu_info.py | python | _get_free_gpu | (max_gpu_utilization=40, min_free_memory=0.5, num_gpu=1) | return gpus_to_use, free_memory | Get available GPUs according to utilization thresholds.
Args:
:max_gpu_utilization: percent utilization threshold to consider a GPU "free"
:min_free_memory: percent free memory to consider a GPU "free"
:num_gpu: number of requested GPUs
Returns:
A tuple of (available_gpus, minimum_free... | Get available GPUs according to utilization thresholds. | [
"Get",
"available",
"GPUs",
"according",
"to",
"utilization",
"thresholds",
"."
] | def _get_free_gpu(max_gpu_utilization=40, min_free_memory=0.5, num_gpu=1):
"""Get available GPUs according to utilization thresholds.
Args:
:max_gpu_utilization: percent utilization threshold to consider a GPU "free"
:min_free_memory: percent free memory to consider a GPU "free"
:num_gpu: num... | [
"def",
"_get_free_gpu",
"(",
"max_gpu_utilization",
"=",
"40",
",",
"min_free_memory",
"=",
"0.5",
",",
"num_gpu",
"=",
"1",
")",
":",
"def",
"get_gpu_info",
"(",
")",
":",
"# Get the gpu information",
"gpu_info",
"=",
"subprocess",
".",
"check_output",
"(",
"... | https://github.com/flink-extended/dl-on-flink/blob/60646aa9520f49619b64e9ff03ce73959e8a3858/flink-ml-tensorflow/python/flink_ml_tensorflow/gpu_info.py#L128-L202 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py | python | validate_argsort_with_ascending | (ascending, args, kwargs) | return ascending | If 'Categorical.argsort' is called via the 'numpy' library, the
first parameter in its signature is 'axis', which takes either
an integer or 'None', so check if the 'ascending' parameter has
either integer type or is None, since 'ascending' itself should
be a boolean | If 'Categorical.argsort' is called via the 'numpy' library, the
first parameter in its signature is 'axis', which takes either
an integer or 'None', so check if the 'ascending' parameter has
either integer type or is None, since 'ascending' itself should
be a boolean | [
"If",
"Categorical",
".",
"argsort",
"is",
"called",
"via",
"the",
"numpy",
"library",
"the",
"first",
"parameter",
"in",
"its",
"signature",
"is",
"axis",
"which",
"takes",
"either",
"an",
"integer",
"or",
"None",
"so",
"check",
"if",
"the",
"ascending",
... | def validate_argsort_with_ascending(ascending, args, kwargs):
"""
If 'Categorical.argsort' is called via the 'numpy' library, the
first parameter in its signature is 'axis', which takes either
an integer or 'None', so check if the 'ascending' parameter has
either integer type or is None, since 'asce... | [
"def",
"validate_argsort_with_ascending",
"(",
"ascending",
",",
"args",
",",
"kwargs",
")",
":",
"if",
"is_integer",
"(",
"ascending",
")",
"or",
"ascending",
"is",
"None",
":",
"args",
"=",
"(",
"ascending",
",",
")",
"+",
"args",
"ascending",
"=",
"True... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py#L133-L147 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/graph_editor/util.py | python | get_tensors | (graph) | return ts | get all the tensors which are input or output of an op in the graph.
Args:
graph: a tf.Graph.
Returns:
A list of tf.Tensor.
Raises:
TypeError: if graph is not a tf.Graph. | get all the tensors which are input or output of an op in the graph. | [
"get",
"all",
"the",
"tensors",
"which",
"are",
"input",
"or",
"output",
"of",
"an",
"op",
"in",
"the",
"graph",
"."
] | def get_tensors(graph):
"""get all the tensors which are input or output of an op in the graph.
Args:
graph: a tf.Graph.
Returns:
A list of tf.Tensor.
Raises:
TypeError: if graph is not a tf.Graph.
"""
if not isinstance(graph, tf_ops.Graph):
raise TypeError("Expected a graph, got: {}".forma... | [
"def",
"get_tensors",
"(",
"graph",
")",
":",
"if",
"not",
"isinstance",
"(",
"graph",
",",
"tf_ops",
".",
"Graph",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected a graph, got: {}\"",
".",
"format",
"(",
"type",
"(",
"graph",
")",
")",
")",
"ts",
"=",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/util.py#L152-L168 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/ns/fx/graph_passes.py | python | create_a_shadows_b | (
name_a: str,
gm_a: GraphModule,
name_b: str,
gm_b: GraphModule,
matched_subgraph_pairs: Dict[str, Tuple[NSSubgraph, NSSubgraph]],
logger_cls: Callable,
should_log_inputs: bool,
node_type_to_io_type_map: Optional[Dict[str, Set[NSNodeTargetType]]] = None,
) | return gm_c | Creates a new GraphModule consisting of the graph of C, with the meaningful
nodes of A shadowing the corresponding nodes of B. For example,
Graph A:
a0 -> op0_fp32 -> a1 -> op1_fp32 -> a2
Graph B:
b0 -> op0_int8 -> b1 -> op1_int8 -> b2
matched_node_pairs: {'op0': (op0_fp32, op0_int8), 'op1':... | Creates a new GraphModule consisting of the graph of C, with the meaningful
nodes of A shadowing the corresponding nodes of B. For example, | [
"Creates",
"a",
"new",
"GraphModule",
"consisting",
"of",
"the",
"graph",
"of",
"C",
"with",
"the",
"meaningful",
"nodes",
"of",
"A",
"shadowing",
"the",
"corresponding",
"nodes",
"of",
"B",
".",
"For",
"example"
] | def create_a_shadows_b(
name_a: str,
gm_a: GraphModule,
name_b: str,
gm_b: GraphModule,
matched_subgraph_pairs: Dict[str, Tuple[NSSubgraph, NSSubgraph]],
logger_cls: Callable,
should_log_inputs: bool,
node_type_to_io_type_map: Optional[Dict[str, Set[NSNodeTargetType]]] = None,
) -> Graph... | [
"def",
"create_a_shadows_b",
"(",
"name_a",
":",
"str",
",",
"gm_a",
":",
"GraphModule",
",",
"name_b",
":",
"str",
",",
"gm_b",
":",
"GraphModule",
",",
"matched_subgraph_pairs",
":",
"Dict",
"[",
"str",
",",
"Tuple",
"[",
"NSSubgraph",
",",
"NSSubgraph",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/ns/fx/graph_passes.py#L514-L819 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py | python | MultiIndex._hashed_values | (self) | return hash_tuples(self) | return a uint64 ndarray of my hashed values | return a uint64 ndarray of my hashed values | [
"return",
"a",
"uint64",
"ndarray",
"of",
"my",
"hashed",
"values"
] | def _hashed_values(self):
""" return a uint64 ndarray of my hashed values """
return hash_tuples(self) | [
"def",
"_hashed_values",
"(",
"self",
")",
":",
"return",
"hash_tuples",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L1408-L1410 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | utils/cpplint.py | python | FileInfo.NoExtension | (self) | return '/'.join(self.Split()[0:2]) | File has no source file extension. | File has no source file extension. | [
"File",
"has",
"no",
"source",
"file",
"extension",
"."
] | def NoExtension(self):
"""File has no source file extension."""
return '/'.join(self.Split()[0:2]) | [
"def",
"NoExtension",
"(",
"self",
")",
":",
"return",
"'/'",
".",
"join",
"(",
"self",
".",
"Split",
"(",
")",
"[",
"0",
":",
"2",
"]",
")"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L1055-L1057 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Dnn.py | python | Dnn.initializer | (self, new_initializer) | Sets the initializer that will fill in the weight values
before training starts. | Sets the initializer that will fill in the weight values
before training starts. | [
"Sets",
"the",
"initializer",
"that",
"will",
"fill",
"in",
"the",
"weight",
"values",
"before",
"training",
"starts",
"."
] | def initializer(self, new_initializer):
"""Sets the initializer that will fill in the weight values
before training starts.
"""
self.set_initializer(new_initializer._internal) | [
"def",
"initializer",
"(",
"self",
",",
"new_initializer",
")",
":",
"self",
".",
"set_initializer",
"(",
"new_initializer",
".",
"_internal",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Dnn.py#L106-L110 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | llvm/utils/lit/lit/LitConfig.py | python | LitConfig.maxIndividualTestTimeIsSupported | (self) | return lit.util.killProcessAndChildrenIsSupported() | Returns a tuple (<supported> , <error message>)
where
`<supported>` is True if setting maxIndividualTestTime is supported
on the current host, returns False otherwise.
`<error message>` is an empty string if `<supported>` is True,
otherwise is contains... | Returns a tuple (<supported> , <error message>)
where
`<supported>` is True if setting maxIndividualTestTime is supported
on the current host, returns False otherwise.
`<error message>` is an empty string if `<supported>` is True,
otherwise is contains... | [
"Returns",
"a",
"tuple",
"(",
"<supported",
">",
"<error",
"message",
">",
")",
"where",
"<supported",
">",
"is",
"True",
"if",
"setting",
"maxIndividualTestTime",
"is",
"supported",
"on",
"the",
"current",
"host",
"returns",
"False",
"otherwise",
".",
"<error... | def maxIndividualTestTimeIsSupported(self):
"""
Returns a tuple (<supported> , <error message>)
where
`<supported>` is True if setting maxIndividualTestTime is supported
on the current host, returns False otherwise.
`<error message>` is an empty st... | [
"def",
"maxIndividualTestTimeIsSupported",
"(",
"self",
")",
":",
"return",
"lit",
".",
"util",
".",
"killProcessAndChildrenIsSupported",
"(",
")"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/llvm/utils/lit/lit/LitConfig.py#L79-L89 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | CondContext.BuildCondBranch | (self, fn) | return original_r, result | Add the subgraph defined by fn() to the graph. | Add the subgraph defined by fn() to the graph. | [
"Add",
"the",
"subgraph",
"defined",
"by",
"fn",
"()",
"to",
"the",
"graph",
"."
] | def BuildCondBranch(self, fn):
"""Add the subgraph defined by fn() to the graph."""
r = fn()
original_r = r
result = []
if r is not None:
if not isinstance(r, list) and not isinstance(r, _basetuple):
r = [r]
original_r = [original_r]
r = _convert_tensorarrays_to_flows(r)
... | [
"def",
"BuildCondBranch",
"(",
"self",
",",
"fn",
")",
":",
"r",
"=",
"fn",
"(",
")",
"original_r",
"=",
"r",
"result",
"=",
"[",
"]",
"if",
"r",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"r",
",",
"list",
")",
"and",
"not",
"is... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1244-L1272 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/packager.py | python | Distro.repo_os_version | (self, build_os) | Return an OS version suitable for package repo directory
naming - e.g. 5, 6 or 7 for redhat/centos, "precise," "wheezy," etc.
for Ubuntu/Debian, 11 for suse, "2013.03" for amazon | Return an OS version suitable for package repo directory
naming - e.g. 5, 6 or 7 for redhat/centos, "precise," "wheezy," etc.
for Ubuntu/Debian, 11 for suse, "2013.03" for amazon | [
"Return",
"an",
"OS",
"version",
"suitable",
"for",
"package",
"repo",
"directory",
"naming",
"-",
"e",
".",
"g",
".",
"5",
"6",
"or",
"7",
"for",
"redhat",
"/",
"centos",
"precise",
"wheezy",
"etc",
".",
"for",
"Ubuntu",
"/",
"Debian",
"11",
"for",
... | def repo_os_version(self, build_os):
"""Return an OS version suitable for package repo directory
naming - e.g. 5, 6 or 7 for redhat/centos, "precise," "wheezy," etc.
for Ubuntu/Debian, 11 for suse, "2013.03" for amazon"""
if self.n == 'suse':
return re.sub(r'^suse(\d+)$', r'\... | [
"def",
"repo_os_version",
"(",
"self",
",",
"build_os",
")",
":",
"if",
"self",
".",
"n",
"==",
"'suse'",
":",
"return",
"re",
".",
"sub",
"(",
"r'^suse(\\d+)$'",
",",
"r'\\1'",
",",
"build_os",
")",
"if",
"self",
".",
"n",
"==",
"'redhat'",
":",
"re... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/packager.py#L197-L224 | ||
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | BaseNode.drake_type | (self) | return '%s.%s' % (self.__module__, self.__name__) | The qualified name of this type. | The qualified name of this type. | [
"The",
"qualified",
"name",
"of",
"this",
"type",
"."
] | def drake_type(self):
"""The qualified name of this type."""
return '%s.%s' % (self.__module__, self.__name__) | [
"def",
"drake_type",
"(",
"self",
")",
":",
"return",
"'%s.%s'",
"%",
"(",
"self",
".",
"__module__",
",",
"self",
".",
"__name__",
")"
] | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L1391-L1393 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/distributions/python/ops/binomial.py | python | Binomial.probs | (self) | return self._probs | Probability of drawing a `1`. | Probability of drawing a `1`. | [
"Probability",
"of",
"drawing",
"a",
"1",
"."
] | def probs(self):
"""Probability of drawing a `1`."""
return self._probs | [
"def",
"probs",
"(",
"self",
")",
":",
"return",
"self",
".",
"_probs"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/binomial.py#L198-L200 | |
Kitware/kwiver | 7ed70308905698b6e88d27ae3dc028c9b016ca0a | python/kwiver/sprokit/processes/kwiver_process.py | python | KwiverProcess.config_value_using_trait | (self, name) | return self.config_value(ct.name) | Get value from config using trait.
An exception will be thrown if the config trait has not been registered
with the process.
:param name: Name of the configuration trait. | Get value from config using trait.
An exception will be thrown if the config trait has not been registered
with the process. | [
"Get",
"value",
"from",
"config",
"using",
"trait",
".",
"An",
"exception",
"will",
"be",
"thrown",
"if",
"the",
"config",
"trait",
"has",
"not",
"been",
"registered",
"with",
"the",
"process",
"."
] | def config_value_using_trait(self, name):
"""
Get value from config using trait.
An exception will be thrown if the config trait has not been registered
with the process.
:param name: Name of the configuration trait.
"""
ct = self._config_trait_set.get(name, Non... | [
"def",
"config_value_using_trait",
"(",
"self",
",",
"name",
")",
":",
"ct",
"=",
"self",
".",
"_config_trait_set",
".",
"get",
"(",
"name",
",",
"None",
")",
"if",
"ct",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'config trait name \\\"%s\\\" not registe... | https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/sprokit/processes/kwiver_process.py#L369-L382 | |
luliyucoordinate/Leetcode | 96afcdc54807d1d184e881a075d1dbf3371e31fb | src/0019-Remove-Nth-Node-From-End-of-List/0019.py | python | Solution.removeNthFromEnd | (self, head, n) | return h.next | :type head: ListNode
:type n: int
:rtype: ListNode | :type head: ListNode
:type n: int
:rtype: ListNode | [
":",
"type",
"head",
":",
"ListNode",
":",
"type",
"n",
":",
"int",
":",
"rtype",
":",
"ListNode"
] | def removeNthFromEnd(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
h = ListNode(-1)
h.next = head
p, q = h, h
for _ in range(n + 1):
assert (q)
q = q.next
while q != None:
p... | [
"def",
"removeNthFromEnd",
"(",
"self",
",",
"head",
",",
"n",
")",
":",
"h",
"=",
"ListNode",
"(",
"-",
"1",
")",
"h",
".",
"next",
"=",
"head",
"p",
",",
"q",
"=",
"h",
",",
"h",
"for",
"_",
"in",
"range",
"(",
"n",
"+",
"1",
")",
":",
... | https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0019-Remove-Nth-Node-From-End-of-List/0019.py#L8-L27 | |
stulp/dmpbbo | ca900e3b851d25faaf59ea296650370c70ed7d0f | python/bbo/updaters.py | python | costsToWeights | (costs, weighting_method, eliteness) | return weights | Convert costs to weights using different weighting methods.
\param[in] costs A vector of costs.
\param[in] weighting_method The weighting method ('PI-BB','CMA-ES','CEM')
\param[in] eliteness The eliteness parameter (h in PI-BB, mu in CMA-ES)
\return A vector of weights (they always sum to 1). | Convert costs to weights using different weighting methods.
\param[in] costs A vector of costs.
\param[in] weighting_method The weighting method ('PI-BB','CMA-ES','CEM')
\param[in] eliteness The eliteness parameter (h in PI-BB, mu in CMA-ES)
\return A vector of weights (they always sum to 1). | [
"Convert",
"costs",
"to",
"weights",
"using",
"different",
"weighting",
"methods",
".",
"\\",
"param",
"[",
"in",
"]",
"costs",
"A",
"vector",
"of",
"costs",
".",
"\\",
"param",
"[",
"in",
"]",
"weighting_method",
"The",
"weighting",
"method",
"(",
"PI",
... | def costsToWeights(costs, weighting_method, eliteness):
""" Convert costs to weights using different weighting methods.
\param[in] costs A vector of costs.
\param[in] weighting_method The weighting method ('PI-BB','CMA-ES','CEM')
\param[in] eliteness The eliteness parameter (h in PI-BB, mu in CMA-ES)
... | [
"def",
"costsToWeights",
"(",
"costs",
",",
"weighting_method",
",",
"eliteness",
")",
":",
"# Costs can be a 2D array or a list of lists. In this case, the first",
"# column is the sum of the other columns (which contain the different cost",
"# components). In this case, we should use only... | https://github.com/stulp/dmpbbo/blob/ca900e3b851d25faaf59ea296650370c70ed7d0f/python/bbo/updaters.py#L199-L254 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/ops.py | python | convert_block | (context, block, inputs) | return outputs | Convert a block (sub-graph) to MIL. Conversion happens within a new
context frame.
Arguments:
context: A TranscriptionContext object to pull node inputs and
assign node outputs.
block: An InternalTorchIRBlock object.
inputs: List of Vars from the oute... | Convert a block (sub-graph) to MIL. Conversion happens within a new
context frame. | [
"Convert",
"a",
"block",
"(",
"sub",
"-",
"graph",
")",
"to",
"MIL",
".",
"Conversion",
"happens",
"within",
"a",
"new",
"context",
"frame",
"."
] | def convert_block(context, block, inputs):
"""Convert a block (sub-graph) to MIL. Conversion happens within a new
context frame.
Arguments:
context: A TranscriptionContext object to pull node inputs and
assign node outputs.
block: An InternalTorchIRBlock obje... | [
"def",
"convert_block",
"(",
"context",
",",
"block",
",",
"inputs",
")",
":",
"assert",
"len",
"(",
"block",
".",
"inputs",
")",
"==",
"len",
"(",
"inputs",
")",
"# Start a new context frame.",
"context",
".",
"push",
"(",
"(",
"block",
".",
"inputs",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/ops.py#L62-L88 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | Type.get_ref_qualifier | (self) | return RefQualifierKind.from_id(
conf.lib.clang_Type_getCXXRefQualifier(self)) | Retrieve the ref-qualifier of the type. | Retrieve the ref-qualifier of the type. | [
"Retrieve",
"the",
"ref",
"-",
"qualifier",
"of",
"the",
"type",
"."
] | def get_ref_qualifier(self):
"""
Retrieve the ref-qualifier of the type.
"""
return RefQualifierKind.from_id(
conf.lib.clang_Type_getCXXRefQualifier(self)) | [
"def",
"get_ref_qualifier",
"(",
"self",
")",
":",
"return",
"RefQualifierKind",
".",
"from_id",
"(",
"conf",
".",
"lib",
".",
"clang_Type_getCXXRefQualifier",
"(",
"self",
")",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L2396-L2401 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/math.py | python | dot | (inp1: Tensor, inp2: Tensor) | return result | r"""Computes dot-product of two vectors ``inp1`` and ``inp2``.
inputs must be 1-dimensional or scalar. A scalar input is automatically broadcasted.
Refer to :func:`~.matmul` for more general usage.
Args:
inp1: first vector.
inp2: second vector.
Returns:
output value.
Examp... | r"""Computes dot-product of two vectors ``inp1`` and ``inp2``.
inputs must be 1-dimensional or scalar. A scalar input is automatically broadcasted.
Refer to :func:`~.matmul` for more general usage. | [
"r",
"Computes",
"dot",
"-",
"product",
"of",
"two",
"vectors",
"inp1",
"and",
"inp2",
".",
"inputs",
"must",
"be",
"1",
"-",
"dimensional",
"or",
"scalar",
".",
"A",
"scalar",
"input",
"is",
"automatically",
"broadcasted",
".",
"Refer",
"to",
":",
"func... | def dot(inp1: Tensor, inp2: Tensor) -> Tensor:
r"""Computes dot-product of two vectors ``inp1`` and ``inp2``.
inputs must be 1-dimensional or scalar. A scalar input is automatically broadcasted.
Refer to :func:`~.matmul` for more general usage.
Args:
inp1: first vector.
inp2: second vec... | [
"def",
"dot",
"(",
"inp1",
":",
"Tensor",
",",
"inp2",
":",
"Tensor",
")",
"->",
"Tensor",
":",
"op",
"=",
"builtin",
".",
"Dot",
"(",
")",
"assert",
"(",
"inp1",
".",
"ndim",
"<=",
"1",
"and",
"inp2",
".",
"ndim",
"<=",
"1",
")",
",",
"\"Input... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/math.py#L1116-L1152 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | SourceLocation.offset | (self) | return self._get_instantiation()[3] | Get the file offset represented by this source location. | Get the file offset represented by this source location. | [
"Get",
"the",
"file",
"offset",
"represented",
"by",
"this",
"source",
"location",
"."
] | def offset(self):
"""Get the file offset represented by this source location."""
return self._get_instantiation()[3] | [
"def",
"offset",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"3",
"]"
] | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L213-L215 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_py.py | python | build_py.build_package_data | (self) | Copy data files into build directory | Copy data files into build directory | [
"Copy",
"data",
"files",
"into",
"build",
"directory"
] | def build_package_data(self):
"""Copy data files into build directory"""
lastdir = None
for package, src_dir, build_dir, filenames in self.data_files:
for filename in filenames:
target = os.path.join(build_dir, filename)
self.mkpath(os.path.dirname(tar... | [
"def",
"build_package_data",
"(",
"self",
")",
":",
"lastdir",
"=",
"None",
"for",
"package",
",",
"src_dir",
",",
"build_dir",
",",
"filenames",
"in",
"self",
".",
"data_files",
":",
"for",
"filename",
"in",
"filenames",
":",
"target",
"=",
"os",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_py.py#L134-L142 | ||
google/brunsli | e811197ab1ad8ddde3e3cf444548e42e2bdacf92 | contrib/py/jxl_library_patches/jxl_utils.py | python | is_jpegxl_recompressed_jpeg_file | (filename) | Returns True iff the given filename is a genuine JPEG-XL file. | Returns True iff the given filename is a genuine JPEG-XL file. | [
"Returns",
"True",
"iff",
"the",
"given",
"filename",
"is",
"a",
"genuine",
"JPEG",
"-",
"XL",
"file",
"."
] | def is_jpegxl_recompressed_jpeg_file(filename):
"""Returns True iff the given filename is a genuine JPEG-XL file."""
try:
with open(filename, 'rb') as h:
header = h.read(len(JPEGXL_RECOMPRESSED_JPEG_HEADER))
# Cf. https://arxiv.org/pdf/1908.03565.pdf, section 9.1,
# on recompressed-JPEG header... | [
"def",
"is_jpegxl_recompressed_jpeg_file",
"(",
"filename",
")",
":",
"try",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"h",
":",
"header",
"=",
"h",
".",
"read",
"(",
"len",
"(",
"JPEGXL_RECOMPRESSED_JPEG_HEADER",
")",
")",
"# Cf. https:/... | https://github.com/google/brunsli/blob/e811197ab1ad8ddde3e3cf444548e42e2bdacf92/contrib/py/jxl_library_patches/jxl_utils.py#L44-L55 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/process/servers.py | python | client_host | (server_host) | return server_host | Return the host on which a client can connect to the given listener. | Return the host on which a client can connect to the given listener. | [
"Return",
"the",
"host",
"on",
"which",
"a",
"client",
"can",
"connect",
"to",
"the",
"given",
"listener",
"."
] | def client_host(server_host):
"""Return the host on which a client can connect to the given listener."""
if server_host == '0.0.0.0':
# 0.0.0.0 is INADDR_ANY, which should answer on localhost.
return '127.0.0.1'
if server_host in ('::', '::0', '::0.0.0.0'):
# :: is IN6ADDR_ANY, which... | [
"def",
"client_host",
"(",
"server_host",
")",
":",
"if",
"server_host",
"==",
"'0.0.0.0'",
":",
"# 0.0.0.0 is INADDR_ANY, which should answer on localhost.",
"return",
"'127.0.0.1'",
"if",
"server_host",
"in",
"(",
"'::'",
",",
"'::0'",
",",
"'::0.0.0.0'",
")",
":",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/servers.py#L340-L349 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/waveforms.py | python | unit_impulse | (shape, idx=None, dtype=float) | return out | Unit impulse signal (discrete delta function) or unit basis vector.
Parameters
----------
shape : int or tuple of int
Number of samples in the output (1-D), or a tuple that represents the
shape of the output (N-D).
idx : None or int or tuple of int or 'mid', optional
Index at wh... | Unit impulse signal (discrete delta function) or unit basis vector. | [
"Unit",
"impulse",
"signal",
"(",
"discrete",
"delta",
"function",
")",
"or",
"unit",
"basis",
"vector",
"."
] | def unit_impulse(shape, idx=None, dtype=float):
"""
Unit impulse signal (discrete delta function) or unit basis vector.
Parameters
----------
shape : int or tuple of int
Number of samples in the output (1-D), or a tuple that represents the
shape of the output (N-D).
idx : None o... | [
"def",
"unit_impulse",
"(",
"shape",
",",
"idx",
"=",
"None",
",",
"dtype",
"=",
"float",
")",
":",
"out",
"=",
"zeros",
"(",
"shape",
",",
"dtype",
")",
"shape",
"=",
"np",
".",
"atleast_1d",
"(",
"shape",
")",
"if",
"idx",
"is",
"None",
":",
"i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/waveforms.py#L596-L681 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/optimization.py | python | AdamWeightDecayOptimizer._do_use_weight_decay | (self, param_name) | return True | Whether to use L2 weight decay for `param_name`. | Whether to use L2 weight decay for `param_name`. | [
"Whether",
"to",
"use",
"L2",
"weight",
"decay",
"for",
"param_name",
"."
] | def _do_use_weight_decay(self, param_name):
"""Whether to use L2 weight decay for `param_name`."""
if not self.weight_decay_rate:
return False
if self.exclude_from_weight_decay:
for r in self.exclude_from_weight_decay:
if re.search(r, param_name) is not None:
return False
r... | [
"def",
"_do_use_weight_decay",
"(",
"self",
",",
"param_name",
")",
":",
"if",
"not",
"self",
".",
"weight_decay_rate",
":",
"return",
"False",
"if",
"self",
".",
"exclude_from_weight_decay",
":",
"for",
"r",
"in",
"self",
".",
"exclude_from_weight_decay",
":",
... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/optimization.py#L159-L167 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/quantization/quant_strategy.py | python | QuantStrategyBase._get_default_quant_config | (self,
quant_info_mgr,
lstm=False) | return config | 1. unified activation bits
2 .mixed bits for lstm | 1. unified activation bits
2 .mixed bits for lstm | [
"1",
".",
"unified",
"activation",
"bits",
"2",
".",
"mixed",
"bits",
"for",
"lstm"
] | def _get_default_quant_config(self,
quant_info_mgr,
lstm=False):
"""
1. unified activation bits
2 .mixed bits for lstm
"""
# import ipdb
# ipdb.set_trace()
config = {'param': {}, 'output': {}, 'input': {}}
for node in ... | [
"def",
"_get_default_quant_config",
"(",
"self",
",",
"quant_info_mgr",
",",
"lstm",
"=",
"False",
")",
":",
"# import ipdb",
"# ipdb.set_trace()",
"config",
"=",
"{",
"'param'",
":",
"{",
"}",
",",
"'output'",
":",
"{",
"}",
",",
"'input'",
":",
"{",
"}",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/quantization/quant_strategy.py#L56-L132 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/scripter.py | python | BaseScriptElement.apply | (self) | return NotImplemented | Method called to apply the reduction script element
to a Mantid Reducer | Method called to apply the reduction script element
to a Mantid Reducer | [
"Method",
"called",
"to",
"apply",
"the",
"reduction",
"script",
"element",
"to",
"a",
"Mantid",
"Reducer"
] | def apply(self):
"""
Method called to apply the reduction script element
to a Mantid Reducer
"""
return NotImplemented | [
"def",
"apply",
"(",
"self",
")",
":",
"return",
"NotImplemented"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/scripter.py#L66-L71 | |
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/completers/language_server/language_server_completer.py | python | LanguageServerCompleter.WorkspaceConfigurationResponse | ( self, request ) | return None | If the concrete completer wants to respond to workspace/configuration
requests, it should override this method. | If the concrete completer wants to respond to workspace/configuration
requests, it should override this method. | [
"If",
"the",
"concrete",
"completer",
"wants",
"to",
"respond",
"to",
"workspace",
"/",
"configuration",
"requests",
"it",
"should",
"override",
"this",
"method",
"."
] | def WorkspaceConfigurationResponse( self, request ):
"""If the concrete completer wants to respond to workspace/configuration
requests, it should override this method."""
return None | [
"def",
"WorkspaceConfigurationResponse",
"(",
"self",
",",
"request",
")",
":",
"return",
"None"
] | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/language_server/language_server_completer.py#L1597-L1600 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/pystache/renderer.py | python | Renderer._bytes_to_str | (self, _bytes) | return str(_bytes, self.string_encoding, self.decode_errors) | Convert a byte string to str, using string_encoding and decode_errors. | Convert a byte string to str, using string_encoding and decode_errors. | [
"Convert",
"a",
"byte",
"string",
"to",
"str",
"using",
"string_encoding",
"and",
"decode_errors",
"."
] | def _bytes_to_str(self, _bytes):
"""Convert a byte string to str, using string_encoding and decode_errors.
"""
assert type(_bytes) == bytes
return str(_bytes, self.string_encoding, self.decode_errors) | [
"def",
"_bytes_to_str",
"(",
"self",
",",
"_bytes",
")",
":",
"assert",
"type",
"(",
"_bytes",
")",
"==",
"bytes",
"return",
"str",
"(",
"_bytes",
",",
"self",
".",
"string_encoding",
",",
"self",
".",
"decode_errors",
")"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/pystache/renderer.py#L182-L187 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pexpect/pexpect/screen.py | python | screen._decode | (self, s) | This converts from the external coding system (as passed to
the constructor) to the internal one (unicode). | This converts from the external coding system (as passed to
the constructor) to the internal one (unicode). | [
"This",
"converts",
"from",
"the",
"external",
"coding",
"system",
"(",
"as",
"passed",
"to",
"the",
"constructor",
")",
"to",
"the",
"internal",
"one",
"(",
"unicode",
")",
"."
] | def _decode(self, s):
'''This converts from the external coding system (as passed to
the constructor) to the internal one (unicode). '''
if self.decoder is not None:
return self.decoder.decode(s)
else:
raise TypeError("This screen was constructed with encoding=Non... | [
"def",
"_decode",
"(",
"self",
",",
"s",
")",
":",
"if",
"self",
".",
"decoder",
"is",
"not",
"None",
":",
"return",
"self",
".",
"decoder",
".",
"decode",
"(",
"s",
")",
"else",
":",
"raise",
"TypeError",
"(",
"\"This screen was constructed with encoding=... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/screen.py#L104-L111 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/muelu/utils/analysis/tableau.py | python | tableau10 | () | return rgb2float(colors) | Tableau 10' colors as RGB | Tableau 10' colors as RGB | [
"Tableau",
"10",
"colors",
"as",
"RGB"
] | def tableau10():
"""'Tableau 10' colors as RGB"""
colors = [
( 31, 119, 180), (255, 127, 14), ( 44, 160, 44), (214, 39, 40),
(148, 103, 189), (140, 86, 75), (227, 119, 194), (127, 127, 127),
(188, 189, 34), ( 23, 190, 207)
]
return rgb2float(colors) | [
"def",
"tableau10",
"(",
")",
":",
"colors",
"=",
"[",
"(",
"31",
",",
"119",
",",
"180",
")",
",",
"(",
"255",
",",
"127",
",",
"14",
")",
",",
"(",
"44",
",",
"160",
",",
"44",
")",
",",
"(",
"214",
",",
"39",
",",
"40",
")",
",",
"("... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/utils/analysis/tableau.py#L10-L17 | |
takemaru/graphillion | 51879f92bb96b53ef8f914ef37a05252ce383617 | graphillion/graphset.py | python | GraphSet.paths | (terminal1, terminal2, is_hamilton=False, graphset=None) | return GraphSet.graphs(vertex_groups=[[terminal1, terminal2]],
degree_constraints=dc,
no_loop=True, graphset=graphset) | Returns a GraphSet of paths.
This method can be parallelized with OpenMP by specifying the
environmental variable `OMP_NUM_THREADS`:
`$ OMP_NUM_THREADS=4 python your_graphillion_script.py`
Examples:
>>> GraphSet.paths(1, 6)
GraphSet([[(1, 2), (2, 3), (3, 6)], [(1... | Returns a GraphSet of paths. | [
"Returns",
"a",
"GraphSet",
"of",
"paths",
"."
] | def paths(terminal1, terminal2, is_hamilton=False, graphset=None):
"""Returns a GraphSet of paths.
This method can be parallelized with OpenMP by specifying the
environmental variable `OMP_NUM_THREADS`:
`$ OMP_NUM_THREADS=4 python your_graphillion_script.py`
Examples:
... | [
"def",
"paths",
"(",
"terminal1",
",",
"terminal2",
",",
"is_hamilton",
"=",
"False",
",",
"graphset",
"=",
"None",
")",
":",
"dc",
"=",
"{",
"}",
"for",
"v",
"in",
"GraphSet",
".",
"_vertices",
":",
"if",
"v",
"in",
"(",
"terminal1",
",",
"terminal2... | https://github.com/takemaru/graphillion/blob/51879f92bb96b53ef8f914ef37a05252ce383617/graphillion/graphset.py#L1941-L1973 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/plistlib.py | python | _BinaryPlistParser._get_size | (self, tokenL) | return tokenL | return the size of the next object. | return the size of the next object. | [
"return",
"the",
"size",
"of",
"the",
"next",
"object",
"."
] | def _get_size(self, tokenL):
""" return the size of the next object."""
if tokenL == 0xF:
m = self._fp.read(1)[0] & 0x3
s = 1 << m
f = '>' + _BINARY_FORMAT[s]
return struct.unpack(f, self._fp.read(s))[0]
return tokenL | [
"def",
"_get_size",
"(",
"self",
",",
"tokenL",
")",
":",
"if",
"tokenL",
"==",
"0xF",
":",
"m",
"=",
"self",
".",
"_fp",
".",
"read",
"(",
"1",
")",
"[",
"0",
"]",
"&",
"0x3",
"s",
"=",
"1",
"<<",
"m",
"f",
"=",
"'>'",
"+",
"_BINARY_FORMAT",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/plistlib.py#L574-L582 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32_pipe.py | python | Win32PipeInput.send_bytes | (self, data: bytes) | Send bytes to the input. | Send bytes to the input. | [
"Send",
"bytes",
"to",
"the",
"input",
"."
] | def send_bytes(self, data: bytes) -> None:
"Send bytes to the input."
self.send_text(data.decode("utf-8", "ignore")) | [
"def",
"send_bytes",
"(",
"self",
",",
"data",
":",
"bytes",
")",
"->",
"None",
":",
"self",
".",
"send_text",
"(",
"data",
".",
"decode",
"(",
"\"utf-8\"",
",",
"\"ignore\"",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32_pipe.py#L108-L110 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tensor_forest/client/eval_metrics.py | python | get_metric | (metric_name) | return _EVAL_METRICS[metric_name] | Given a metric name, return the corresponding metric function. | Given a metric name, return the corresponding metric function. | [
"Given",
"a",
"metric",
"name",
"return",
"the",
"corresponding",
"metric",
"function",
"."
] | def get_metric(metric_name):
"""Given a metric name, return the corresponding metric function."""
return _EVAL_METRICS[metric_name] | [
"def",
"get_metric",
"(",
"metric_name",
")",
":",
"return",
"_EVAL_METRICS",
"[",
"metric_name",
"]"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/client/eval_metrics.py#L154-L156 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/pipeline/sync/phony.py | python | get_phony | (device: torch.device, *, requires_grad: bool) | return phony | Gets a phony. Phony is tensor without space. It is useful to make
arbitrary dependency in a autograd graph because it doesn't require any
gradient accumulation.
.. note::
Phonies for each device are cached. If an autograd function gets a phony
internally, the phony must be detached to be r... | Gets a phony. Phony is tensor without space. It is useful to make
arbitrary dependency in a autograd graph because it doesn't require any
gradient accumulation. | [
"Gets",
"a",
"phony",
".",
"Phony",
"is",
"tensor",
"without",
"space",
".",
"It",
"is",
"useful",
"to",
"make",
"arbitrary",
"dependency",
"in",
"a",
"autograd",
"graph",
"because",
"it",
"doesn",
"t",
"require",
"any",
"gradient",
"accumulation",
"."
] | def get_phony(device: torch.device, *, requires_grad: bool) -> Tensor:
"""Gets a phony. Phony is tensor without space. It is useful to make
arbitrary dependency in a autograd graph because it doesn't require any
gradient accumulation.
.. note::
Phonies for each device are cached. If an autogra... | [
"def",
"get_phony",
"(",
"device",
":",
"torch",
".",
"device",
",",
"*",
",",
"requires_grad",
":",
"bool",
")",
"->",
"Tensor",
":",
"key",
"=",
"(",
"device",
",",
"requires_grad",
")",
"try",
":",
"phony",
"=",
"_phonies",
"[",
"key",
"]",
"excep... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/phony.py#L21-L49 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Control_RemoveMnemonics | (*args, **kwargs) | return _core_.Control_RemoveMnemonics(*args, **kwargs) | Control_RemoveMnemonics(String str) -> String
removes the mnemonics characters | Control_RemoveMnemonics(String str) -> String | [
"Control_RemoveMnemonics",
"(",
"String",
"str",
")",
"-",
">",
"String"
] | def Control_RemoveMnemonics(*args, **kwargs):
"""
Control_RemoveMnemonics(String str) -> String
removes the mnemonics characters
"""
return _core_.Control_RemoveMnemonics(*args, **kwargs) | [
"def",
"Control_RemoveMnemonics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Control_RemoveMnemonics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12781-L12787 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py | python | slice_input_producer | (tensor_list, num_epochs=None, shuffle=True, seed=None,
capacity=32, shared_name=None, name=None) | Produces a slice of each `Tensor` in `tensor_list`.
Implemented using a Queue -- a `QueueRunner` for the Queue
is added to the current `Graph`'s `QUEUE_RUNNER` collection.
Args:
tensor_list: A list of `Tensor` objects. Every `Tensor` in
`tensor_list` must have the same size in the first dimension.
... | Produces a slice of each `Tensor` in `tensor_list`. | [
"Produces",
"a",
"slice",
"of",
"each",
"Tensor",
"in",
"tensor_list",
"."
] | def slice_input_producer(tensor_list, num_epochs=None, shuffle=True, seed=None,
capacity=32, shared_name=None, name=None):
"""Produces a slice of each `Tensor` in `tensor_list`.
Implemented using a Queue -- a `QueueRunner` for the Queue
is added to the current `Graph`'s `QUEUE_RUNNER` co... | [
"def",
"slice_input_producer",
"(",
"tensor_list",
",",
"num_epochs",
"=",
"None",
",",
"shuffle",
"=",
"True",
",",
"seed",
"=",
"None",
",",
"capacity",
"=",
"32",
",",
"shared_name",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py#L328-L376 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DataObjectComposite.GetObject | (*args, **kwargs) | return _misc_.DataObjectComposite_GetObject(*args, **kwargs) | GetObject(self, DataFormat format, wxDataObjectBase::Direction dir=Get) -> DataObjectSimple
Returns the pointer to the object which supports this format or None.
TODO: Fix this to use OOR and return the right object type. | GetObject(self, DataFormat format, wxDataObjectBase::Direction dir=Get) -> DataObjectSimple | [
"GetObject",
"(",
"self",
"DataFormat",
"format",
"wxDataObjectBase",
"::",
"Direction",
"dir",
"=",
"Get",
")",
"-",
">",
"DataObjectSimple"
] | def GetObject(*args, **kwargs):
"""
GetObject(self, DataFormat format, wxDataObjectBase::Direction dir=Get) -> DataObjectSimple
Returns the pointer to the object which supports this format or None.
TODO: Fix this to use OOR and return the right object type.
"""
return _m... | [
"def",
"GetObject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DataObjectComposite_GetObject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5154-L5161 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | ZipDataset.__init__ | (self, datasets) | See `Dataset.zip()` for details. | See `Dataset.zip()` for details. | [
"See",
"Dataset",
".",
"zip",
"()",
"for",
"details",
"."
] | def __init__(self, datasets):
"""See `Dataset.zip()` for details."""
super(ZipDataset, self).__init__()
self._datasets = datasets | [
"def",
"__init__",
"(",
"self",
",",
"datasets",
")",
":",
"super",
"(",
"ZipDataset",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_datasets",
"=",
"datasets"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L1171-L1174 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/bindings/python/clang/cindex.py | python | Type.get_offset | (self, fieldname) | return conf.lib.clang_Type_getOffsetOf(self, fieldname) | Retrieve the offset of a field in the record. | Retrieve the offset of a field in the record. | [
"Retrieve",
"the",
"offset",
"of",
"a",
"field",
"in",
"the",
"record",
"."
] | def get_offset(self, fieldname):
"""
Retrieve the offset of a field in the record.
"""
return conf.lib.clang_Type_getOffsetOf(self, fieldname) | [
"def",
"get_offset",
"(",
"self",
",",
"fieldname",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Type_getOffsetOf",
"(",
"self",
",",
"fieldname",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L2384-L2388 | |
strasdat/Sophus | 36b08885e094fda63e92ad89d65be380c288265a | sympy/sophus/complex.py | python | Complex.Da_a_mul_b | (a, b) | return sympy.Matrix([[b.real, -b.imag],
[b.imag, b.real]]) | derivatice of complex muliplication wrt left multiplier a | derivatice of complex muliplication wrt left multiplier a | [
"derivatice",
"of",
"complex",
"muliplication",
"wrt",
"left",
"multiplier",
"a"
] | def Da_a_mul_b(a, b):
""" derivatice of complex muliplication wrt left multiplier a """
return sympy.Matrix([[b.real, -b.imag],
[b.imag, b.real]]) | [
"def",
"Da_a_mul_b",
"(",
"a",
",",
"b",
")",
":",
"return",
"sympy",
".",
"Matrix",
"(",
"[",
"[",
"b",
".",
"real",
",",
"-",
"b",
".",
"imag",
"]",
",",
"[",
"b",
".",
"imag",
",",
"b",
".",
"real",
"]",
"]",
")"
] | https://github.com/strasdat/Sophus/blob/36b08885e094fda63e92ad89d65be380c288265a/sympy/sophus/complex.py#L72-L75 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/platform.py | python | linux_distribution | (distname='', version='', id='',
supported_dists=_supported_dists,
full_distribution_name=1) | return distname, version, id | Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.
supported_dists may be given to define the set of Linux
distributions to l... | Tries to determine the name of the Linux OS distribution name. | [
"Tries",
"to",
"determine",
"the",
"name",
"of",
"the",
"Linux",
"OS",
"distribution",
"name",
"."
] | def linux_distribution(distname='', version='', id='',
supported_dists=_supported_dists,
full_distribution_name=1):
""" Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and... | [
"def",
"linux_distribution",
"(",
"distname",
"=",
"''",
",",
"version",
"=",
"''",
",",
"id",
"=",
"''",
",",
"supported_dists",
"=",
"_supported_dists",
",",
"full_distribution_name",
"=",
"1",
")",
":",
"try",
":",
"etc",
"=",
"os",
".",
"listdir",
"(... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/platform.py#L293-L345 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/swift_build_support/swift_build_support/products/swiftsyntax.py | python | SwiftSyntax.product_source_name | (cls) | return "swift-syntax" | product_source_name() -> str
The name of the source code directory of this product. | product_source_name() -> str | [
"product_source_name",
"()",
"-",
">",
"str"
] | def product_source_name(cls):
"""product_source_name() -> str
The name of the source code directory of this product.
"""
return "swift-syntax" | [
"def",
"product_source_name",
"(",
"cls",
")",
":",
"return",
"\"swift-syntax\""
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/products/swiftsyntax.py#L33-L38 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/control-examples/system_id.py | python | LinearSystemID.fixC | (self,i,value) | Sets the i'th entry of the C vector to a fixed value | Sets the i'th entry of the C vector to a fixed value | [
"Sets",
"the",
"i",
"th",
"entry",
"of",
"the",
"C",
"vector",
"to",
"a",
"fixed",
"value"
] | def fixC(self,i,value):
"""Sets the i'th entry of the C vector to a fixed value"""
if self.coeffPattern[2] == None:
m,n=self.m,self.n
self.coeffPattern[2] = [None]*m
self.coeffPattern[2][i]=value
self._updateEstimatorSize(i) | [
"def",
"fixC",
"(",
"self",
",",
"i",
",",
"value",
")",
":",
"if",
"self",
".",
"coeffPattern",
"[",
"2",
"]",
"==",
"None",
":",
"m",
",",
"n",
"=",
"self",
".",
"m",
",",
"self",
".",
"n",
"self",
".",
"coeffPattern",
"[",
"2",
"]",
"=",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/system_id.py#L39-L45 | ||
facebook/proxygen | a9ca025af207787815cb01eee1971cd572c7a81e | build/fbcode_builder/shell_quoting.py | python | ShellQuoted.__new__ | (cls, s) | return super(ShellQuoted, cls).__new__(
cls, s.do_not_use_raw_str if isinstance(s, ShellQuoted) else s
) | No need to nest ShellQuoted. | No need to nest ShellQuoted. | [
"No",
"need",
"to",
"nest",
"ShellQuoted",
"."
] | def __new__(cls, s):
"No need to nest ShellQuoted."
return super(ShellQuoted, cls).__new__(
cls, s.do_not_use_raw_str if isinstance(s, ShellQuoted) else s
) | [
"def",
"__new__",
"(",
"cls",
",",
"s",
")",
":",
"return",
"super",
"(",
"ShellQuoted",
",",
"cls",
")",
".",
"__new__",
"(",
"cls",
",",
"s",
".",
"do_not_use_raw_str",
"if",
"isinstance",
"(",
"s",
",",
"ShellQuoted",
")",
"else",
"s",
")"
] | https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/shell_quoting.py#L34-L38 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/screen.py | python | screen.cr | (self) | This moves the cursor to the beginning (col 1) of the current row. | This moves the cursor to the beginning (col 1) of the current row. | [
"This",
"moves",
"the",
"cursor",
"to",
"the",
"beginning",
"(",
"col",
"1",
")",
"of",
"the",
"current",
"row",
"."
] | def cr(self):
"""This moves the cursor to the beginning (col 1) of the current row.
"""
self.cursor_home(self.cur_r, 1) | [
"def",
"cr",
"(",
"self",
")",
":",
"self",
".",
"cursor_home",
"(",
"self",
".",
"cur_r",
",",
"1",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/screen.py#L101-L105 | ||
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/meshrenderer/gl_utils/camera.py | python | Camera.setIntrinsic | (self, I, W, H, near, far, scale=1.0, originIsInTopLeft=True) | Args:
I: 3x3 intrinsic camera matrix from real camera (without any OpenGL stuff)
W: Width of the camera image
H: Height of the camera image
near: Near plane
far: Far plane
... | Args:
I: 3x3 intrinsic camera matrix from real camera (without any OpenGL stuff)
W: Width of the camera image
H: Height of the camera image
near: Near plane
far: Far plane
... | [
"Args",
":",
"I",
":",
"3x3",
"intrinsic",
"camera",
"matrix",
"from",
"real",
"camera",
"(",
"without",
"any",
"OpenGL",
"stuff",
")",
"W",
":",
"Width",
"of",
"the",
"camera",
"image",
"H",
":",
"Height",
"of",
"the",
"camera",
"image",
"near",
":",
... | def setIntrinsic(self, I, W, H, near, far, scale=1.0, originIsInTopLeft=True):
'''
Args:
I: 3x3 intrinsic camera matrix from real camera (without any OpenGL stuff)
W: Width of the camera image
H: Height of the camera ... | [
"def",
"setIntrinsic",
"(",
"self",
",",
"I",
",",
"W",
",",
"H",
",",
"near",
",",
"far",
",",
"scale",
"=",
"1.0",
",",
"originIsInTopLeft",
"=",
"True",
")",
":",
"Camera",
".",
"__check_matrix__",
"(",
"I",
")",
"A",
"=",
"near",
"+",
"far",
... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/gl_utils/camera.py#L139-L166 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/pseudo.py | python | PseudoFile.__init__ | (self) | Create a file-like object. | Create a file-like object. | [
"Create",
"a",
"file",
"-",
"like",
"object",
"."
] | def __init__(self):
"""Create a file-like object."""
pass | [
"def",
"__init__",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/pseudo.py#L46-L48 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/text.py | python | strip_ansi | (source) | return re.sub(r'\033\[(\d|;)+?m', '', source) | Remove ansi escape codes from text.
Parameters
----------
source : str
Source to remove the ansi from | Remove ansi escape codes from text.
Parameters
----------
source : str
Source to remove the ansi from | [
"Remove",
"ansi",
"escape",
"codes",
"from",
"text",
".",
"Parameters",
"----------",
"source",
":",
"str",
"Source",
"to",
"remove",
"the",
"ansi",
"from"
] | def strip_ansi(source):
"""
Remove ansi escape codes from text.
Parameters
----------
source : str
Source to remove the ansi from
"""
return re.sub(r'\033\[(\d|;)+?m', '', source) | [
"def",
"strip_ansi",
"(",
"source",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'\\033\\[(\\d|;)+?m'",
",",
"''",
",",
"source",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/text.py#L479-L488 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/sensor_calibration/extract_data.py | python | Extractor.generate_compressed_file | (input_path,
input_name,
output_path,
compressed_file='sensor_data') | Compress data extraction directory as a single tar.gz archive | Compress data extraction directory as a single tar.gz archive | [
"Compress",
"data",
"extraction",
"directory",
"as",
"a",
"single",
"tar",
".",
"gz",
"archive"
] | def generate_compressed_file(input_path,
input_name,
output_path,
compressed_file='sensor_data'):
"""
Compress data extraction directory as a single tar.gz archive
"""
cwd_path = os.getcwd(... | [
"def",
"generate_compressed_file",
"(",
"input_path",
",",
"input_name",
",",
"output_path",
",",
"compressed_file",
"=",
"'sensor_data'",
")",
":",
"cwd_path",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"input_path",
")",
"shutil",
".",
"m... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/sensor_calibration/extract_data.py#L323-L337 | ||
DmitryKoterov/dklab_realplexor | 01281d42fddcf7b9efe763b3ab50191c4429debc | api/python/Dklab/realplexor.py | python | Dklab_Realplexor.send | (self, idsAndCursors, data, showOnlyForIds=None) | Send data to realplexor.
Throw Dklab_Realplexor_Exception in case of error.
idsAndCursors -- Target IDs in form of: dictionary(id1 => cursor1, id2 => cursor2, ...)
of dictionary(id1, id2, id3, ...). If sending to a single ID,
you... | Send data to realplexor.
Throw Dklab_Realplexor_Exception in case of error. | [
"Send",
"data",
"to",
"realplexor",
".",
"Throw",
"Dklab_Realplexor_Exception",
"in",
"case",
"of",
"error",
"."
] | def send(self, idsAndCursors, data, showOnlyForIds=None):
"""
Send data to realplexor.
Throw Dklab_Realplexor_Exception in case of error.
idsAndCursors -- Target IDs in form of: dictionary(id1 => cursor1, id2 => cursor2, ...)
of dictionary(id1, id2, ... | [
"def",
"send",
"(",
"self",
",",
"idsAndCursors",
",",
"data",
",",
"showOnlyForIds",
"=",
"None",
")",
":",
"data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
"pairs",
"=",
"[",
"]",
"for",
"id",
"in",
"idsAndCursors",
":",
"if",
"type",
"(",
"i... | https://github.com/DmitryKoterov/dklab_realplexor/blob/01281d42fddcf7b9efe763b3ab50191c4429debc/api/python/Dklab/realplexor.py#L36-L74 |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 10