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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/trafodion | 8455c839ad6b6d7b6e04edda5715053095b78046 | install/python-installer/scripts/traf_start.py | python | run | () | start trafodion instance | start trafodion instance | [
"start",
"trafodion",
"instance"
] | def run():
""" start trafodion instance """
dbcfgs = json.loads(dbcfgs_json)
print 'Starting trafodion'
traf_home = os.environ['TRAF_HOME']
if os.path.exists('%s/sql/scripts/trafstart' % traf_home):
run_cmd('trafstart')
else:
run_cmd('sqstart')
# set a uniq file name
tm... | [
"def",
"run",
"(",
")",
":",
"dbcfgs",
"=",
"json",
".",
"loads",
"(",
"dbcfgs_json",
")",
"print",
"'Starting trafodion'",
"traf_home",
"=",
"os",
".",
"environ",
"[",
"'TRAF_HOME'",
"]",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"'%s/sql/scripts/trafs... | https://github.com/apache/trafodion/blob/8455c839ad6b6d7b6e04edda5715053095b78046/install/python-installer/scripts/traf_start.py#L32-L79 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/docs/build/directory.py | python | ApiManifest.getDocumentationLinks | (self) | return api_dict | Parses the extension API JSON manifest and returns a dict of all
events and methods for every module, mapped to relative documentation links.
Returns:
A dict of methods/events => partial doc links for every module. | Parses the extension API JSON manifest and returns a dict of all
events and methods for every module, mapped to relative documentation links. | [
"Parses",
"the",
"extension",
"API",
"JSON",
"manifest",
"and",
"returns",
"a",
"dict",
"of",
"all",
"events",
"and",
"methods",
"for",
"every",
"module",
"mapped",
"to",
"relative",
"documentation",
"links",
"."
] | def getDocumentationLinks(self):
""" Parses the extension API JSON manifest and returns a dict of all
events and methods for every module, mapped to relative documentation links.
Returns:
A dict of methods/events => partial doc links for every module.
"""
api_dict = {}
for module in self.... | [
"def",
"getDocumentationLinks",
"(",
"self",
")",
":",
"api_dict",
"=",
"{",
"}",
"for",
"module",
"in",
"self",
".",
"_manifest",
":",
"api_dict",
".",
"update",
"(",
"self",
".",
"_parseModuleDocLinksByKey",
"(",
"module",
",",
"'functions'",
")",
")",
"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/docs/build/directory.py#L227-L240 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextRange.Swap | (*args, **kwargs) | return _richtext.RichTextRange_Swap(*args, **kwargs) | Swap(self)
Swaps the start and end | Swap(self) | [
"Swap",
"(",
"self",
")"
] | def Swap(*args, **kwargs):
"""
Swap(self)
Swaps the start and end
"""
return _richtext.RichTextRange_Swap(*args, **kwargs) | [
"def",
"Swap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextRange_Swap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1029-L1035 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/xrc.py | python | XmlResource.GetResourceNode | (*args, **kwargs) | return _xrc.XmlResource_GetResourceNode(*args, **kwargs) | GetResourceNode(self, String name) -> XmlNode | GetResourceNode(self, String name) -> XmlNode | [
"GetResourceNode",
"(",
"self",
"String",
"name",
")",
"-",
">",
"XmlNode"
] | def GetResourceNode(*args, **kwargs):
"""GetResourceNode(self, String name) -> XmlNode"""
return _xrc.XmlResource_GetResourceNode(*args, **kwargs) | [
"def",
"GetResourceNode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_GetResourceNode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L226-L228 | |
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/scripts/apj_tool.py | python | embedded_defaults.contents | (self) | return contents | return current contents | return current contents | [
"return",
"current",
"contents"
] | def contents(self):
'''return current contents'''
contents = self.firmware[self.offset+20:self.offset+20+self.length]
# remove carriage returns
contents = contents.replace(b'\r',b'')
return contents | [
"def",
"contents",
"(",
"self",
")",
":",
"contents",
"=",
"self",
".",
"firmware",
"[",
"self",
".",
"offset",
"+",
"20",
":",
"self",
".",
"offset",
"+",
"20",
"+",
"self",
".",
"length",
"]",
"# remove carriage returns",
"contents",
"=",
"contents",
... | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/apj_tool.py#L130-L135 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/dummy.py | python | DummyRegressor.score | (self, X, y, sample_weight=None) | return super().score(X, y, sample_weight) | Returns the coefficient of determination R^2 of the prediction.
The coefficient R^2 is defined as (1 - u/v), where u is the residual
sum of squares ((y_true - y_pred) ** 2).sum() and v is the total
sum of squares ((y_true - y_true.mean()) ** 2).sum().
The best possible score is 1.0 and ... | Returns the coefficient of determination R^2 of the prediction. | [
"Returns",
"the",
"coefficient",
"of",
"determination",
"R^2",
"of",
"the",
"prediction",
"."
] | def score(self, X, y, sample_weight=None):
"""Returns the coefficient of determination R^2 of the prediction.
The coefficient R^2 is defined as (1 - u/v), where u is the residual
sum of squares ((y_true - y_pred) ** 2).sum() and v is the total
sum of squares ((y_true - y_true.mean()) **... | [
"def",
"score",
"(",
"self",
",",
"X",
",",
"y",
",",
"sample_weight",
"=",
"None",
")",
":",
"if",
"X",
"is",
"None",
":",
"X",
"=",
"np",
".",
"zeros",
"(",
"shape",
"=",
"(",
"len",
"(",
"y",
")",
",",
"1",
")",
")",
"return",
"super",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/dummy.py#L578-L614 | |
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/scripts/cpp_lint.py | python | _NestingState.Update | (self, filename, clean_lines, linenum, error) | Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Update nesting state with current line. | [
"Update",
"nesting",
"state",
"with",
"current",
"line",
"."
] | def Update(self, filename, clean_lines, linenum, error):
"""Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any err... | [
"def",
"Update",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Update pp_stack first",
"self",
".",
"UpdatePreprocessor",
"(",
"line",
")",
"# Coun... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L2008-L2162 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListCtrl.GetCountPerPage | (*args, **kwargs) | return _controls_.ListCtrl_GetCountPerPage(*args, **kwargs) | GetCountPerPage(self) -> int | GetCountPerPage(self) -> int | [
"GetCountPerPage",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCountPerPage(*args, **kwargs):
"""GetCountPerPage(self) -> int"""
return _controls_.ListCtrl_GetCountPerPage(*args, **kwargs) | [
"def",
"GetCountPerPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetCountPerPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4497-L4499 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Conv.py | python | Conv.stride_size | (self, stride_size) | Sets the convolution stride. | Sets the convolution stride. | [
"Sets",
"the",
"convolution",
"stride",
"."
] | def stride_size(self, stride_size):
"""Sets the convolution stride.
"""
if len(stride_size) != 2:
raise ValueError('`stride_size` must contain two values (h, w).')
self._internal.set_stride_height(int(stride_size[0]))
self._internal.set_stride_width(int(stride_size[1... | [
"def",
"stride_size",
"(",
"self",
",",
"stride_size",
")",
":",
"if",
"len",
"(",
"stride_size",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"'`stride_size` must contain two values (h, w).'",
")",
"self",
".",
"_internal",
".",
"set_stride_height",
"(",
"i... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Conv.py#L135-L142 | ||
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/site_packages/joblib3/logger.py | python | Logger.__init__ | (self, depth=3) | Parameters
----------
depth: int, optional
The depth of objects printed. | Parameters
----------
depth: int, optional
The depth of objects printed. | [
"Parameters",
"----------",
"depth",
":",
"int",
"optional",
"The",
"depth",
"of",
"objects",
"printed",
"."
] | def __init__(self, depth=3):
"""
Parameters
----------
depth: int, optional
The depth of objects printed.
"""
self.depth = depth | [
"def",
"__init__",
"(",
"self",
",",
"depth",
"=",
"3",
")",
":",
"self",
".",
"depth",
"=",
"depth"
] | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib3/logger.py#L67-L74 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/health/service.py | python | HealthProfileListQuery.ToUri | (self) | return '/%s' % ('/'.join([self.service, self.feed]),) | Generates a URI from the query parameters set in the object.
Returns:
A string containing the URI used to retrieve entries from the
profile list feed. | Generates a URI from the query parameters set in the object. | [
"Generates",
"a",
"URI",
"from",
"the",
"query",
"parameters",
"set",
"in",
"the",
"object",
"."
] | def ToUri(self):
"""Generates a URI from the query parameters set in the object.
Returns:
A string containing the URI used to retrieve entries from the
profile list feed.
"""
return '/%s' % ('/'.join([self.service, self.feed]),) | [
"def",
"ToUri",
"(",
"self",
")",
":",
"return",
"'/%s'",
"%",
"(",
"'/'",
".",
"join",
"(",
"[",
"self",
".",
"service",
",",
"self",
".",
"feed",
"]",
")",
",",
")"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/health/service.py#L217-L224 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py | python | SocketIO.mainloop | (self) | Listen on socket until I/O not ready or EOF
pollresponse() will loop looking for seq number None, which
never comes, and exit on EOFError. | Listen on socket until I/O not ready or EOF | [
"Listen",
"on",
"socket",
"until",
"I",
"/",
"O",
"not",
"ready",
"or",
"EOF"
] | def mainloop(self):
"""Listen on socket until I/O not ready or EOF
pollresponse() will loop looking for seq number None, which
never comes, and exit on EOFError.
"""
try:
self.getresponse(myseq=None, wait=0.05)
except EOFError:
self.debug("mainlo... | [
"def",
"mainloop",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"getresponse",
"(",
"myseq",
"=",
"None",
",",
"wait",
"=",
"0.05",
")",
"except",
"EOFError",
":",
"self",
".",
"debug",
"(",
"\"mainloop:return\"",
")",
"return"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py#L266-L277 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/BASIC/basparse.py | python | p_command_let_bad | (p) | command : LET variable EQUALS error | command : LET variable EQUALS error | [
"command",
":",
"LET",
"variable",
"EQUALS",
"error"
] | def p_command_let_bad(p):
'''command : LET variable EQUALS error'''
p[0] = "BAD EXPRESSION IN LET" | [
"def",
"p_command_let_bad",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"BAD EXPRESSION IN LET\""
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/BASIC/basparse.py#L87-L89 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsBopomofoExtended | (code) | return ret | Check whether the character is part of BopomofoExtended UCS
Block | Check whether the character is part of BopomofoExtended UCS
Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"BopomofoExtended",
"UCS",
"Block"
] | def uCSIsBopomofoExtended(code):
"""Check whether the character is part of BopomofoExtended UCS
Block """
ret = libxml2mod.xmlUCSIsBopomofoExtended(code)
return ret | [
"def",
"uCSIsBopomofoExtended",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsBopomofoExtended",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1371-L1375 | |
rrwick/Porechop | 109e437280436d1ec27e5a5b7a34ffb752176390 | porechop/misc.py | python | int_to_str | (num, max_num=0) | return num_str.rjust(len(max_str)) | Converts a number to a string. Will add left padding based on the max value to ensure numbers
align well. | Converts a number to a string. Will add left padding based on the max value to ensure numbers
align well. | [
"Converts",
"a",
"number",
"to",
"a",
"string",
".",
"Will",
"add",
"left",
"padding",
"based",
"on",
"the",
"max",
"value",
"to",
"ensure",
"numbers",
"align",
"well",
"."
] | def int_to_str(num, max_num=0):
"""
Converts a number to a string. Will add left padding based on the max value to ensure numbers
align well.
"""
if num is None:
num_str = 'n/a'
else:
num_str = '{:,}'.format(num)
max_str = '{:,}'.format(int(max_num))
return num_str.rjust(... | [
"def",
"int_to_str",
"(",
"num",
",",
"max_num",
"=",
"0",
")",
":",
"if",
"num",
"is",
"None",
":",
"num_str",
"=",
"'n/a'",
"else",
":",
"num_str",
"=",
"'{:,}'",
".",
"format",
"(",
"num",
")",
"max_str",
"=",
"'{:,}'",
".",
"format",
"(",
"int"... | https://github.com/rrwick/Porechop/blob/109e437280436d1ec27e5a5b7a34ffb752176390/porechop/misc.py#L47-L57 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/tensor_array_ops.py | python | _GraphTensorArrayV2.grad | (self, source, flow=None, name=None) | Not supported. | Not supported. | [
"Not",
"supported",
"."
] | def grad(self, source, flow=None, name=None):
"""Not supported."""
raise NotImplementedError() | [
"def",
"grad",
"(",
"self",
",",
"source",
",",
"flow",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/tensor_array_ops.py#L522-L524 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | normalize_path | (filename) | return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename)))) | Normalize a file/dir name for comparison purposes | Normalize a file/dir name for comparison purposes | [
"Normalize",
"a",
"file",
"/",
"dir",
"name",
"for",
"comparison",
"purposes"
] | def normalize_path(filename):
"""Normalize a file/dir name for comparison purposes"""
return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename)))) | [
"def",
"normalize_path",
"(",
"filename",
")",
":",
"return",
"os",
".",
"path",
".",
"normcase",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"os",
".",
"path",
".",
"normpath",
"(",
"_cygwin_patch",
"(",
"filename",
")",
")",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L4657-L4661 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl_compatibility_errors.py | python | IDLCompatibilityContext.add_type_not_array_error | (self, symbol: str, command_name: str, symbol_name: str,
new_type: str, old_type: str, file: str) | Add an error about type not being an ArrayType when it should be.
This is a general error for each case where ArrayType is missing from (command type,
command parameter type). | Add an error about type not being an ArrayType when it should be. | [
"Add",
"an",
"error",
"about",
"type",
"not",
"being",
"an",
"ArrayType",
"when",
"it",
"should",
"be",
"."
] | def add_type_not_array_error(self, symbol: str, command_name: str, symbol_name: str,
new_type: str, old_type: str, file: str) -> None:
# pylint: disable=too-many-arguments
"""
Add an error about type not being an ArrayType when it should be.
This is a ge... | [
"def",
"add_type_not_array_error",
"(",
"self",
",",
"symbol",
":",
"str",
",",
"command_name",
":",
"str",
",",
"symbol_name",
":",
"str",
",",
"new_type",
":",
"str",
",",
"old_type",
":",
"str",
",",
"file",
":",
"str",
")",
"->",
"None",
":",
"# py... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl_compatibility_errors.py#L956-L968 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/NetMessenger.py | python | NetMessenger.__init__ | (self, air, channels) | air is the AI Repository.
channels is a list of channel IDs (uint32 values) | air is the AI Repository.
channels is a list of channel IDs (uint32 values) | [
"air",
"is",
"the",
"AI",
"Repository",
".",
"channels",
"is",
"a",
"list",
"of",
"channel",
"IDs",
"(",
"uint32",
"values",
")"
] | def __init__(self, air, channels):
"""
air is the AI Repository.
channels is a list of channel IDs (uint32 values)
"""
assert self.notify.debugCall()
Messenger.__init__(self)
self.air=air
self.channels=channels
for i in self.channels:
s... | [
"def",
"__init__",
"(",
"self",
",",
"air",
",",
"channels",
")",
":",
"assert",
"self",
".",
"notify",
".",
"debugCall",
"(",
")",
"Messenger",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"air",
"=",
"air",
"self",
".",
"channels",
"=",
"channel... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/NetMessenger.py#L36-L46 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/supertooltip.py | python | SuperToolTip.DoShowNow | (self) | Create the :class:`SuperToolTip` immediately. | Create the :class:`SuperToolTip` immediately. | [
"Create",
"the",
":",
"class",
":",
"SuperToolTip",
"immediately",
"."
] | def DoShowNow(self):
""" Create the :class:`SuperToolTip` immediately. """
if self._superToolTip:
# need to destroy it if already exists,
# otherwise we might end up with many of them
self._superToolTip.Destroy()
tip = ToolTipWindow(self._widget, self)
... | [
"def",
"DoShowNow",
"(",
"self",
")",
":",
"if",
"self",
".",
"_superToolTip",
":",
"# need to destroy it if already exists,",
"# otherwise we might end up with many of them",
"self",
".",
"_superToolTip",
".",
"Destroy",
"(",
")",
"tip",
"=",
"ToolTipWindow",
"(",
"s... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/supertooltip.py#L927-L949 | ||
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/IceBridge/run_helper.py | python | RunHelper.deleteLocalData | (self) | Delete everything which has not been archived | Delete everything which has not been archived | [
"Delete",
"everything",
"which",
"has",
"not",
"been",
"archived"
] | def deleteLocalData(self):
'''Delete everything which has not been archived'''
os.system('rm -rf ' + self.getFolder()) | [
"def",
"deleteLocalData",
"(",
"self",
")",
":",
"os",
".",
"system",
"(",
"'rm -rf '",
"+",
"self",
".",
"getFolder",
"(",
")",
")"
] | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/run_helper.py#L512-L514 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/utils/check_cfc/check_cfc.py | python | remove_dir_from_path | (path_var, directory) | return os.pathsep.join(pathlist) | Remove the specified directory from path_var, a string representing
PATH | Remove the specified directory from path_var, a string representing
PATH | [
"Remove",
"the",
"specified",
"directory",
"from",
"path_var",
"a",
"string",
"representing",
"PATH"
] | def remove_dir_from_path(path_var, directory):
"""Remove the specified directory from path_var, a string representing
PATH"""
pathlist = path_var.split(os.pathsep)
norm_directory = os.path.normpath(os.path.normcase(directory))
pathlist = [x for x in pathlist if os.path.normpath(
os.path.norm... | [
"def",
"remove_dir_from_path",
"(",
"path_var",
",",
"directory",
")",
":",
"pathlist",
"=",
"path_var",
".",
"split",
"(",
"os",
".",
"pathsep",
")",
"norm_directory",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"normcase",
"("... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/utils/check_cfc/check_cfc.py#L96-L103 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBPlatform.GetOSUpdateVersion | (self) | return _lldb.SBPlatform_GetOSUpdateVersion(self) | GetOSUpdateVersion(SBPlatform self) -> uint32_t | GetOSUpdateVersion(SBPlatform self) -> uint32_t | [
"GetOSUpdateVersion",
"(",
"SBPlatform",
"self",
")",
"-",
">",
"uint32_t"
] | def GetOSUpdateVersion(self):
"""GetOSUpdateVersion(SBPlatform self) -> uint32_t"""
return _lldb.SBPlatform_GetOSUpdateVersion(self) | [
"def",
"GetOSUpdateVersion",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBPlatform_GetOSUpdateVersion",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8176-L8178 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/matplotlib_draw.py | python | iplot | (
indicator,
new=True,
axes=None,
kref=None,
legend_on=False,
text_on=False,
text_color='k',
zero_on=False,
label=None,
*args,
**kwargs
) | 绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: 是否在新窗口中显示,只在没有指定axes时生效
:param kref: 参考的K线数据,以便绘制日期X坐标
:param legend_on: 是否打开图例
:param text_on: 是否在左上角显示指标名称及其参数
:param text_color: 指标名称解释文字的颜色,默认为黑... | 绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: 是否在新窗口中显示,只在没有指定axes时生效
:param kref: 参考的K线数据,以便绘制日期X坐标
:param legend_on: 是否打开图例
:param text_on: 是否在左上角显示指标名称及其参数
:param text_color: 指标名称解释文字的颜色,默认为黑... | [
"绘制indicator曲线",
":",
"param",
"Indicator",
"indicator",
":",
"indicator实例",
":",
"param",
"axes",
":",
"指定的坐标轴",
":",
"param",
"new",
":",
"是否在新窗口中显示,只在没有指定axes时生效",
":",
"param",
"kref",
":",
"参考的K线数据,以便绘制日期X坐标",
":",
"param",
"legend_on",
":",
"是否打开图例",
":",
... | def iplot(
indicator,
new=True,
axes=None,
kref=None,
legend_on=False,
text_on=False,
text_color='k',
zero_on=False,
label=None,
*args,
**kwargs
):
"""绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: ... | [
"def",
"iplot",
"(",
"indicator",
",",
"new",
"=",
"True",
",",
"axes",
"=",
"None",
",",
"kref",
"=",
"None",
",",
"legend_on",
"=",
"False",
",",
"text_on",
"=",
"False",
",",
"text_color",
"=",
"'k'",
",",
"zero_on",
"=",
"False",
",",
"label",
... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/matplotlib_draw.py#L350-L419 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/supervisor.py | python | Supervisor._init_saver | (self, saver=USE_DEFAULT) | Initializes saver.
Args:
saver: A `Saver` object. If set to USE_DEFAULT, create one that
saves all the variables. | Initializes saver. | [
"Initializes",
"saver",
"."
] | def _init_saver(self, saver=USE_DEFAULT):
"""Initializes saver.
Args:
saver: A `Saver` object. If set to USE_DEFAULT, create one that
saves all the variables.
"""
if saver is Supervisor.USE_DEFAULT:
saver = self._get_first_op_from_collection(ops.GraphKeys.SAVERS)
if saver is N... | [
"def",
"_init_saver",
"(",
"self",
",",
"saver",
"=",
"USE_DEFAULT",
")",
":",
"if",
"saver",
"is",
"Supervisor",
".",
"USE_DEFAULT",
":",
"saver",
"=",
"self",
".",
"_get_first_op_from_collection",
"(",
"ops",
".",
"GraphKeys",
".",
"SAVERS",
")",
"if",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/supervisor.py#L412-L424 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/sysconfig.py | python | get_include | () | return os.path.join(os.path.dirname(paddle.__file__), 'include') | Get the directory containing the PaddlePaddle C++ header files.
Returns:
The directory as string.
Examples:
.. code-block:: python
import paddle
include_dir = paddle.sysconfig.get_include() | Get the directory containing the PaddlePaddle C++ header files.
Returns:
The directory as string. | [
"Get",
"the",
"directory",
"containing",
"the",
"PaddlePaddle",
"C",
"++",
"header",
"files",
".",
"Returns",
":",
"The",
"directory",
"as",
"string",
"."
] | def get_include():
"""
Get the directory containing the PaddlePaddle C++ header files.
Returns:
The directory as string.
Examples:
.. code-block:: python
import paddle
include_dir = paddle.sysconfig.get_include()
"""
import paddle
return os.path.join(... | [
"def",
"get_include",
"(",
")",
":",
"import",
"paddle",
"return",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"paddle",
".",
"__file__",
")",
",",
"'include'",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/sysconfig.py#L20-L34 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/utils.py | python | LRUCache.items | (self) | return result | Return a list of items. | Return a list of items. | [
"Return",
"a",
"list",
"of",
"items",
"."
] | def items(self):
"""Return a list of items."""
result = [(key, self._mapping[key]) for key in list(self._queue)]
result.reverse()
return result | [
"def",
"items",
"(",
"self",
")",
":",
"result",
"=",
"[",
"(",
"key",
",",
"self",
".",
"_mapping",
"[",
"key",
"]",
")",
"for",
"key",
"in",
"list",
"(",
"self",
".",
"_queue",
")",
"]",
"result",
".",
"reverse",
"(",
")",
"return",
"result"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/utils.py#L444-L448 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/distribution.py | python | Distribution._calc_var_from_sd | (self, *args, **kwargs) | return self.sq_base(self._sd(*args, **kwargs)) | r"""
Evaluate log probability from probability.
.. math::
VAR(x) = STD(x) ^ 2 | r"""
Evaluate log probability from probability. | [
"r",
"Evaluate",
"log",
"probability",
"from",
"probability",
"."
] | def _calc_var_from_sd(self, *args, **kwargs):
r"""
Evaluate log probability from probability.
.. math::
VAR(x) = STD(x) ^ 2
"""
return self.sq_base(self._sd(*args, **kwargs)) | [
"def",
"_calc_var_from_sd",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"sq_base",
"(",
"self",
".",
"_sd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/distribution.py#L677-L684 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/rpc.py | python | RPCServer.server_bind | (self) | Override TCPServer method, no bind() phase for connecting entity | Override TCPServer method, no bind() phase for connecting entity | [
"Override",
"TCPServer",
"method",
"no",
"bind",
"()",
"phase",
"for",
"connecting",
"entity"
] | def server_bind(self):
"Override TCPServer method, no bind() phase for connecting entity"
pass | [
"def",
"server_bind",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/rpc.py#L76-L78 | ||
allenyangyl/Face_Liveness_Detection | 9e92d3353e8a865873ac195d1769e6e2ad6b5e75 | Matlab/libsvm-3.19/python/svmutil.py | python | svm_predict | (y, x, m, options="") | return pred_labels, (ACC, MSE, SCC), pred_values | svm_predict(y, x, m [, options]) -> (p_labels, p_acc, p_vals)
Predict data (y, x) with the SVM model m.
options:
-b probability_estimates: whether to predict probability estimates,
0 or 1 (default 0); for one-class SVM only 0 is supported.
-q : quiet mode (no outputs).
The return tuple contains
... | svm_predict(y, x, m [, options]) -> (p_labels, p_acc, p_vals) | [
"svm_predict",
"(",
"y",
"x",
"m",
"[",
"options",
"]",
")",
"-",
">",
"(",
"p_labels",
"p_acc",
"p_vals",
")"
] | def svm_predict(y, x, m, options=""):
"""
svm_predict(y, x, m [, options]) -> (p_labels, p_acc, p_vals)
Predict data (y, x) with the SVM model m.
options:
-b probability_estimates: whether to predict probability estimates,
0 or 1 (default 0); for one-class SVM only 0 is supported.
-q : quiet mod... | [
"def",
"svm_predict",
"(",
"y",
",",
"x",
",",
"m",
",",
"options",
"=",
"\"\"",
")",
":",
"def",
"info",
"(",
"s",
")",
":",
"print",
"(",
"s",
")",
"predict_probability",
"=",
"0",
"argv",
"=",
"options",
".",
"split",
"(",
")",
"i",
"=",
"0"... | https://github.com/allenyangyl/Face_Liveness_Detection/blob/9e92d3353e8a865873ac195d1769e6e2ad6b5e75/Matlab/libsvm-3.19/python/svmutil.py#L173-L260 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr_GetChStr | (*args) | return _snap.TStr_GetChStr(*args) | TStr_GetChStr(char const & Ch) -> TStr
Parameters:
Ch: char const & | TStr_GetChStr(char const & Ch) -> TStr | [
"TStr_GetChStr",
"(",
"char",
"const",
"&",
"Ch",
")",
"-",
">",
"TStr"
] | def TStr_GetChStr(*args):
"""
TStr_GetChStr(char const & Ch) -> TStr
Parameters:
Ch: char const &
"""
return _snap.TStr_GetChStr(*args) | [
"def",
"TStr_GetChStr",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStr_GetChStr",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11310-L11318 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/coprocessing.py | python | CoProcessor.__AppendCViewToCinemaDTable | (self, time, producer, filelist) | This is called every time catalyst writes any cinema image result
to update the Cinema D index of outputs table.
Note, we aggregate file operations later with __FinalizeCinemaDTable. | This is called every time catalyst writes any cinema image result
to update the Cinema D index of outputs table.
Note, we aggregate file operations later with __FinalizeCinemaDTable. | [
"This",
"is",
"called",
"every",
"time",
"catalyst",
"writes",
"any",
"cinema",
"image",
"result",
"to",
"update",
"the",
"Cinema",
"D",
"index",
"of",
"outputs",
"table",
".",
"Note",
"we",
"aggregate",
"file",
"operations",
"later",
"with",
"__FinalizeCinema... | def __AppendCViewToCinemaDTable(self, time, producer, filelist):
"""
This is called every time catalyst writes any cinema image result
to update the Cinema D index of outputs table.
Note, we aggregate file operations later with __FinalizeCinemaDTable.
"""
if self.__Cinema... | [
"def",
"__AppendCViewToCinemaDTable",
"(",
"self",
",",
"time",
",",
"producer",
",",
"filelist",
")",
":",
"if",
"self",
".",
"__CinemaDHelper",
"is",
"None",
":",
"return",
"import",
"vtk",
"comm",
"=",
"vtk",
".",
"vtkMultiProcessController",
".",
"GetGloba... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/coprocessing.py#L845-L856 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/ansic/cparse.py | python | p_postfix_expression_6 | (t) | postfix_expression : postfix_expression ARROW ID | postfix_expression : postfix_expression ARROW ID | [
"postfix_expression",
":",
"postfix_expression",
"ARROW",
"ID"
] | def p_postfix_expression_6(t):
'postfix_expression : postfix_expression ARROW ID'
pass | [
"def",
"p_postfix_expression_6",
"(",
"t",
")",
":",
"pass"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/ansic/cparse.py#L813-L815 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | followCamera | (target,translate=True,rotate=False,center=False) | Sets the camera to follow a target. The camera starts from its current
location and keeps the target in the same position on screen.
It can operate in the following modes:
- translation (``translate=True, rotate=False``): the camera moves with the
object. This is default.
- look-at (``transla... | Sets the camera to follow a target. The camera starts from its current
location and keeps the target in the same position on screen. | [
"Sets",
"the",
"camera",
"to",
"follow",
"a",
"target",
".",
"The",
"camera",
"starts",
"from",
"its",
"current",
"location",
"and",
"keeps",
"the",
"target",
"in",
"the",
"same",
"position",
"on",
"screen",
"."
] | def followCamera(target,translate=True,rotate=False,center=False) -> None:
"""Sets the camera to follow a target. The camera starts from its current
location and keeps the target in the same position on screen.
It can operate in the following modes:
- translation (``translate=True, rotate=False``): ... | [
"def",
"followCamera",
"(",
"target",
",",
"translate",
"=",
"True",
",",
"rotate",
"=",
"False",
",",
"center",
"=",
"False",
")",
"->",
"None",
":",
"scene",
"(",
")",
".",
"followCamera",
"(",
"target",
",",
"translate",
",",
"rotate",
",",
"center"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1661-L1684 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py | python | PosixSerial.setXON | (self, level=True) | \
Manually control flow - when software flow control is enabled.
This will send XON (true) and XOFF (false) to the other device.
WARNING: this function is not portable to different platforms! | \
Manually control flow - when software flow control is enabled.
This will send XON (true) and XOFF (false) to the other device.
WARNING: this function is not portable to different platforms! | [
"\\",
"Manually",
"control",
"flow",
"-",
"when",
"software",
"flow",
"control",
"is",
"enabled",
".",
"This",
"will",
"send",
"XON",
"(",
"true",
")",
"and",
"XOFF",
"(",
"false",
")",
"to",
"the",
"other",
"device",
".",
"WARNING",
":",
"this",
"func... | def setXON(self, level=True):
"""\
Manually control flow - when software flow control is enabled.
This will send XON (true) and XOFF (false) to the other device.
WARNING: this function is not portable to different platforms!
"""
if not self.hComPort: raise portNotOpenErro... | [
"def",
"setXON",
"(",
"self",
",",
"level",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"hComPort",
":",
"raise",
"portNotOpenError",
"if",
"enable",
":",
"termios",
".",
"tcflow",
"(",
"self",
".",
"fd",
",",
"TERMIOS",
".",
"TCION",
")",
"else... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py#L616-L626 | ||
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/preprocess/op_out.py | python | OperationOut.get_qid | (self) | return self._qid | Return qid | Return qid | [
"Return",
"qid"
] | def get_qid(self):
"""
Return qid
"""
return self._qid | [
"def",
"get_qid",
"(",
"self",
")",
":",
"return",
"self",
".",
"_qid"
] | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/preprocess/op_out.py#L88-L92 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.__iter__ | (self) | return iter(self.readline, self.string_type()) | This is to support iterators over a file-like object. | This is to support iterators over a file-like object. | [
"This",
"is",
"to",
"support",
"iterators",
"over",
"a",
"file",
"-",
"like",
"object",
"."
] | def __iter__(self):
'''This is to support iterators over a file-like object.
'''
return iter(self.readline, self.string_type()) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"readline",
",",
"self",
".",
"string_type",
"(",
")",
")"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L480-L483 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/_utils.py | python | ensure_list | (thing) | return thing | Wrap ``thing`` in a list if it's a single str.
Otherwise, return it unchanged. | Wrap ``thing`` in a list if it's a single str. | [
"Wrap",
"thing",
"in",
"a",
"list",
"if",
"it",
"s",
"a",
"single",
"str",
"."
] | def ensure_list(thing):
"""
Wrap ``thing`` in a list if it's a single str.
Otherwise, return it unchanged.
"""
if isinstance(thing, str_types):
return [thing]
return thing | [
"def",
"ensure_list",
"(",
"thing",
")",
":",
"if",
"isinstance",
"(",
"thing",
",",
"str_types",
")",
":",
"return",
"[",
"thing",
"]",
"return",
"thing"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/_utils.py#L156-L165 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | scripts/cpp_lint.py | python | _NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L1952-L2006 | ||
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | platforms/nuttx/NuttX/tools/kconfiglib.py | python | Variable.expanded_value | (self) | return self.expanded_value_w_args() | See the class documentation. | See the class documentation. | [
"See",
"the",
"class",
"documentation",
"."
] | def expanded_value(self):
"""
See the class documentation.
"""
return self.expanded_value_w_args() | [
"def",
"expanded_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"expanded_value_w_args",
"(",
")"
] | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/NuttX/tools/kconfiglib.py#L5437-L5441 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythplugins/mytharchive/mythburn/scripts/mythburn.py | python | getStreamInformation | (filename, xmlFilename, lenMethod) | create a stream.xml file for filename | create a stream.xml file for filename | [
"create",
"a",
"stream",
".",
"xml",
"file",
"for",
"filename"
] | def getStreamInformation(filename, xmlFilename, lenMethod):
"""create a stream.xml file for filename"""
command = "mytharchivehelper -q -q --getfileinfo --infile %s --outfile %s --method %d" % (quoteCmdArg(filename), quoteCmdArg(xmlFilename), lenMethod)
result = runCommand(command)
if result != 0:
... | [
"def",
"getStreamInformation",
"(",
"filename",
",",
"xmlFilename",
",",
"lenMethod",
")",
":",
"command",
"=",
"\"mytharchivehelper -q -q --getfileinfo --infile %s --outfile %s --method %d\"",
"%",
"(",
"quoteCmdArg",
"(",
"filename",
")",
",",
"quoteCmdArg",
"(",
"xmlFi... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mytharchive/mythburn/scripts/mythburn.py#L1722-L1736 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/utils/lit/lit/LitConfig.py | python | LitConfig.load_config | (self, config, path) | return config | load_config(config, path) - Load a config object from an alternate
path. | load_config(config, path) - Load a config object from an alternate
path. | [
"load_config",
"(",
"config",
"path",
")",
"-",
"Load",
"a",
"config",
"object",
"from",
"an",
"alternate",
"path",
"."
] | def load_config(self, config, path):
"""load_config(config, path) - Load a config object from an alternate
path."""
if self.debug:
self.note('load_config from %r' % path)
config.load_from_path(path, self)
return config | [
"def",
"load_config",
"(",
"self",
",",
"config",
",",
"path",
")",
":",
"if",
"self",
".",
"debug",
":",
"self",
".",
"note",
"(",
"'load_config from %r'",
"%",
"path",
")",
"config",
".",
"load_from_path",
"(",
"path",
",",
"self",
")",
"return",
"co... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/utils/lit/lit/LitConfig.py#L95-L101 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Loss.py | python | BinaryFocalLoss.force | (self) | return self._internal.get_force() | Gets the focal force multiplier. | Gets the focal force multiplier. | [
"Gets",
"the",
"focal",
"force",
"multiplier",
"."
] | def force(self):
"""Gets the focal force multiplier.
"""
return self._internal.get_force() | [
"def",
"force",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_force",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Loss.py#L554-L557 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/utils/public_utils.py | python | is_safe_to_upgrade | () | return not contains_locked_file(get_rlbot_directory()) | Reports whether it's currently safe to upgrade the rlbot package, e.g. via pip. An example of when it's
unsafe is when one of the dlls is in use, which can cause the upgrade to fail half way through.
See https://github.com/RLBot/RLBot/issues/130 | Reports whether it's currently safe to upgrade the rlbot package, e.g. via pip. An example of when it's
unsafe is when one of the dlls is in use, which can cause the upgrade to fail half way through.
See https://github.com/RLBot/RLBot/issues/130 | [
"Reports",
"whether",
"it",
"s",
"currently",
"safe",
"to",
"upgrade",
"the",
"rlbot",
"package",
"e",
".",
"g",
".",
"via",
"pip",
".",
"An",
"example",
"of",
"when",
"it",
"s",
"unsafe",
"is",
"when",
"one",
"of",
"the",
"dlls",
"is",
"in",
"use",
... | def is_safe_to_upgrade():
"""
Reports whether it's currently safe to upgrade the rlbot package, e.g. via pip. An example of when it's
unsafe is when one of the dlls is in use, which can cause the upgrade to fail half way through.
See https://github.com/RLBot/RLBot/issues/130
"""
return not conta... | [
"def",
"is_safe_to_upgrade",
"(",
")",
":",
"return",
"not",
"contains_locked_file",
"(",
"get_rlbot_directory",
"(",
")",
")"
] | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/utils/public_utils.py#L13-L19 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py | python | FieldStorage.getfirst | (self, key, default=None) | Return the first value received. | Return the first value received. | [
"Return",
"the",
"first",
"value",
"received",
"."
] | def getfirst(self, key, default=None):
""" Return the first value received."""
if key in self:
value = self[key]
if type(value) is type([]):
return value[0].value
else:
return value.value
else:
return default | [
"def",
"getfirst",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"key",
"in",
"self",
":",
"value",
"=",
"self",
"[",
"key",
"]",
"if",
"type",
"(",
"value",
")",
"is",
"type",
"(",
"[",
"]",
")",
":",
"return",
"value",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py#L557-L566 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/prefilter.py | python | IPyAutocallChecker.check | (self, line_info) | Instances of IPyAutocall in user_ns get autocalled immediately | Instances of IPyAutocall in user_ns get autocalled immediately | [
"Instances",
"of",
"IPyAutocall",
"in",
"user_ns",
"get",
"autocalled",
"immediately"
] | def check(self, line_info):
"Instances of IPyAutocall in user_ns get autocalled immediately"
obj = self.shell.user_ns.get(line_info.ifun, None)
if isinstance(obj, IPyAutocall):
obj.set_ip(self.shell)
return self.prefilter_manager.get_handler_by_name('auto')
else:
... | [
"def",
"check",
"(",
"self",
",",
"line_info",
")",
":",
"obj",
"=",
"self",
".",
"shell",
".",
"user_ns",
".",
"get",
"(",
"line_info",
".",
"ifun",
",",
"None",
")",
"if",
"isinstance",
"(",
"obj",
",",
"IPyAutocall",
")",
":",
"obj",
".",
"set_i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/prefilter.py#L426-L433 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/TaskGen.py | python | declare_chain | (name='', rule=None, reentrant=None, color='BLUE',
ext_in=[], ext_out=[], before=[], after=[], decider=None, scan=None, install_path=None, shell=False) | return x_file | Creates a new mapping and a task class for processing files by extension.
See Tools/flex.py for an example.
:param name: name for the task class
:type name: string
:param rule: function to execute or string to be compiled in a function
:type rule: string or function
:param reentrant: re-inject the output file in... | Creates a new mapping and a task class for processing files by extension.
See Tools/flex.py for an example. | [
"Creates",
"a",
"new",
"mapping",
"and",
"a",
"task",
"class",
"for",
"processing",
"files",
"by",
"extension",
".",
"See",
"Tools",
"/",
"flex",
".",
"py",
"for",
"an",
"example",
"."
] | def declare_chain(name='', rule=None, reentrant=None, color='BLUE',
ext_in=[], ext_out=[], before=[], after=[], decider=None, scan=None, install_path=None, shell=False):
"""
Creates a new mapping and a task class for processing files by extension.
See Tools/flex.py for an example.
:param name: name for the task c... | [
"def",
"declare_chain",
"(",
"name",
"=",
"''",
",",
"rule",
"=",
"None",
",",
"reentrant",
"=",
"None",
",",
"color",
"=",
"'BLUE'",
",",
"ext_in",
"=",
"[",
"]",
",",
"ext_out",
"=",
"[",
"]",
",",
"before",
"=",
"[",
"]",
",",
"after",
"=",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/TaskGen.py#L315-L379 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py | python | ConfigDialog.activate_config_changes | (self) | Apply configuration changes to current windows.
Dynamically update the current parent window instances
with some of the configuration changes. | Apply configuration changes to current windows. | [
"Apply",
"configuration",
"changes",
"to",
"current",
"windows",
"."
] | def activate_config_changes(self):
"""Apply configuration changes to current windows.
Dynamically update the current parent window instances
with some of the configuration changes.
"""
win_instances = self.parent.instance_dict.keys()
for instance in win_instances:
... | [
"def",
"activate_config_changes",
"(",
"self",
")",
":",
"win_instances",
"=",
"self",
".",
"parent",
".",
"instance_dict",
".",
"keys",
"(",
")",
"for",
"instance",
"in",
"win_instances",
":",
"instance",
".",
"ResetColorizer",
"(",
")",
"instance",
".",
"R... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py#L228-L243 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/floordiv_impl.py | python | _floordiv_scalar | (x, y) | return F.scalar_floordiv(x, y) | Returns x // y where x and y are all scalars. | Returns x // y where x and y are all scalars. | [
"Returns",
"x",
"//",
"y",
"where",
"x",
"and",
"y",
"are",
"all",
"scalars",
"."
] | def _floordiv_scalar(x, y):
"""Returns x // y where x and y are all scalars."""
return F.scalar_floordiv(x, y) | [
"def",
"_floordiv_scalar",
"(",
"x",
",",
"y",
")",
":",
"return",
"F",
".",
"scalar_floordiv",
"(",
"x",
",",
"y",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/floordiv_impl.py#L31-L33 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python_api/xla_shape.py | python | CreateShapeFromNumpy | (value) | Create a Shape from a Numpy array or a nested tuple structure thereof.
Args:
value: Numpy array or (possibly nested) tuple structure that bottoms out in
Numpy arrays.
Returns:
A Shape object. | Create a Shape from a Numpy array or a nested tuple structure thereof. | [
"Create",
"a",
"Shape",
"from",
"a",
"Numpy",
"array",
"or",
"a",
"nested",
"tuple",
"structure",
"thereof",
"."
] | def CreateShapeFromNumpy(value): # pylint: disable=invalid-name
"""Create a Shape from a Numpy array or a nested tuple structure thereof.
Args:
value: Numpy array or (possibly nested) tuple structure that bottoms out in
Numpy arrays.
Returns:
A Shape object.
"""
if isinstance(value, tuple):
... | [
"def",
"CreateShapeFromNumpy",
"(",
"value",
")",
":",
"# pylint: disable=invalid-name",
"if",
"isinstance",
"(",
"value",
",",
"tuple",
")",
":",
"return",
"Shape",
"(",
"xla_data_pb2",
".",
"TUPLE",
",",
"[",
"CreateShapeFromNumpy",
"(",
"component",
")",
"for... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python_api/xla_shape.py#L129-L144 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/__init__.py | python | create_command | (name, **kwargs) | return command | Create an instance of the Command class with the given name. | Create an instance of the Command class with the given name. | [
"Create",
"an",
"instance",
"of",
"the",
"Command",
"class",
"with",
"the",
"given",
"name",
"."
] | def create_command(name, **kwargs):
# type: (str, **Any) -> Command
"""
Create an instance of the Command class with the given name.
"""
module_path, class_name, summary = commands_dict[name]
module = importlib.import_module(module_path)
command_class = getattr(module, class_name)
comman... | [
"def",
"create_command",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"# type: (str, **Any) -> Command",
"module_path",
",",
"class_name",
",",
"summary",
"=",
"commands_dict",
"[",
"name",
"]",
"module",
"=",
"importlib",
".",
"import_module",
"(",
"module_p... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/__init__.py#L90-L100 | |
Kitt-AI/snowboy | c9ff036e2ef3f9c422a3b8c9a01361dbad7a9bd4 | examples/Python/snowboydecoder_arecord.py | python | play_audio_file | (fname=DETECT_DING) | Simple callback function to play a wave file. By default it plays
a Ding sound.
:param str fname: wave file name
:return: None | Simple callback function to play a wave file. By default it plays
a Ding sound. | [
"Simple",
"callback",
"function",
"to",
"play",
"a",
"wave",
"file",
".",
"By",
"default",
"it",
"plays",
"a",
"Ding",
"sound",
"."
] | def play_audio_file(fname=DETECT_DING):
"""Simple callback function to play a wave file. By default it plays
a Ding sound.
:param str fname: wave file name
:return: None
"""
os.system("aplay " + fname + " > /dev/null 2>&1") | [
"def",
"play_audio_file",
"(",
"fname",
"=",
"DETECT_DING",
")",
":",
"os",
".",
"system",
"(",
"\"aplay \"",
"+",
"fname",
"+",
"\" > /dev/null 2>&1\"",
")"
] | https://github.com/Kitt-AI/snowboy/blob/c9ff036e2ef3f9c422a3b8c9a01361dbad7a9bd4/examples/Python/snowboydecoder_arecord.py#L38-L45 | ||
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/layers/driver.py | python | blur_test | (lottie) | return False | This function will test if this layer has already been blurred or not
Args:
lottie (dict) : Lottie dictionary of effects in a layer
Returns:
(True if layer has already been blurred) | This function will test if this layer has already been blurred or not | [
"This",
"function",
"will",
"test",
"if",
"this",
"layer",
"has",
"already",
"been",
"blurred",
"or",
"not"
] | def blur_test(lottie):
"""
This function will test if this layer has already been blurred or not
Args:
lottie (dict) : Lottie dictionary of effects in a layer
Returns:
(True if layer has already been blurred)
"""
for effects in lottie:
if effects["ty"] == 29:
return True
return False | [
"def",
"blur_test",
"(",
"lottie",
")",
":",
"for",
"effects",
"in",
"lottie",
":",
"if",
"effects",
"[",
"\"ty\"",
"]",
"==",
"29",
":",
"return",
"True",
"return",
"False"
] | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/layers/driver.py#L19-L34 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | build/fbcode_builder/CMake/make_fbpy_archive.py | python | build_zipapp | (args, path_map) | Create a self executing python binary using Python 3's built-in
zipapp module.
This type of Python binary is relatively simple, as zipapp is part of the
standard library, but it does not support native language extensions
(.so/.dll files). | Create a self executing python binary using Python 3's built-in
zipapp module. | [
"Create",
"a",
"self",
"executing",
"python",
"binary",
"using",
"Python",
"3",
"s",
"built",
"-",
"in",
"zipapp",
"module",
"."
] | def build_zipapp(args, path_map):
"""Create a self executing python binary using Python 3's built-in
zipapp module.
This type of Python binary is relatively simple, as zipapp is part of the
standard library, but it does not support native language extensions
(.so/.dll files).
"""
dest_dir =... | [
"def",
"build_zipapp",
"(",
"args",
",",
"path_map",
")",
":",
"dest_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"args",
".",
"output",
")",
"with",
"tempfile",
".",
"TemporaryDirectory",
"(",
"prefix",
"=",
"\"make_fbpy.\"",
",",
"dir",
"=",
"des... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/CMake/make_fbpy_archive.py#L126-L143 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiManager.CalculateHintRect | (*args, **kwargs) | return _aui.AuiManager_CalculateHintRect(*args, **kwargs) | CalculateHintRect(self, Window paneWindow, Point pt, Point offset) -> Rect | CalculateHintRect(self, Window paneWindow, Point pt, Point offset) -> Rect | [
"CalculateHintRect",
"(",
"self",
"Window",
"paneWindow",
"Point",
"pt",
"Point",
"offset",
")",
"-",
">",
"Rect"
] | def CalculateHintRect(*args, **kwargs):
"""CalculateHintRect(self, Window paneWindow, Point pt, Point offset) -> Rect"""
return _aui.AuiManager_CalculateHintRect(*args, **kwargs) | [
"def",
"CalculateHintRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiManager_CalculateHintRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L715-L717 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/build_tools/build_utils.py | python | BotAnnotator.BuildStepFailure | (self) | Signal a failure in the current build step to the annotator | Signal a failure in the current build step to the annotator | [
"Signal",
"a",
"failure",
"in",
"the",
"current",
"build",
"step",
"to",
"the",
"annotator"
] | def BuildStepFailure(self):
'''Signal a failure in the current build step to the annotator'''
self.Print("@@@STEP_FAILURE@@@") | [
"def",
"BuildStepFailure",
"(",
"self",
")",
":",
"self",
".",
"Print",
"(",
"\"@@@STEP_FAILURE@@@\"",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/build_utils.py#L234-L236 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/turtle.py | python | TNavigator._goto | (self, end) | move turtle to position end. | move turtle to position end. | [
"move",
"turtle",
"to",
"position",
"end",
"."
] | def _goto(self, end):
"""move turtle to position end."""
self._position = end | [
"def",
"_goto",
"(",
"self",
",",
"end",
")",
":",
"self",
".",
"_position",
"=",
"end"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L1613-L1615 | ||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._GetDeps | (self, dependencies) | Recursively finds dependencies for file protos.
Args:
dependencies: The names of the files being depended on.
Yields:
Each direct and indirect dependency. | Recursively finds dependencies for file protos. | [
"Recursively",
"finds",
"dependencies",
"for",
"file",
"protos",
"."
] | def _GetDeps(self, dependencies):
"""Recursively finds dependencies for file protos.
Args:
dependencies: The names of the files being depended on.
Yields:
Each direct and indirect dependency.
"""
for dependency in dependencies:
dep_desc = self.FindFileByName(dependency)
yi... | [
"def",
"_GetDeps",
"(",
"self",
",",
"dependencies",
")",
":",
"for",
"dependency",
"in",
"dependencies",
":",
"dep_desc",
"=",
"self",
".",
"FindFileByName",
"(",
"dependency",
")",
"yield",
"dep_desc",
"for",
"parent_dep",
"in",
"dep_desc",
".",
"dependencie... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/descriptor_pool.py#L761-L775 | ||
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/grokdump.py | python | InspectionShell.do_u | (self, args) | return self.do_disassemble(args) | see disassemble | see disassemble | [
"see",
"disassemble"
] | def do_u(self, args):
""" see disassemble """
return self.do_disassemble(args) | [
"def",
"do_u",
"(",
"self",
",",
"args",
")",
":",
"return",
"self",
".",
"do_disassemble",
"(",
"args",
")"
] | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/grokdump.py#L3808-L3810 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/contrib/crosstalkcaffe/adapter/bvlccaffe/caffeadapter.py | python | CaffeAdapter.load_model | (self, global_conf) | return self._uni_model | Load prototxt and weights of Caffe, parsing them into uniform model
Args:
global_conf (:class:`~cntk.contrib.crosstalkcaffe.utils.globalconf.GlobalConf`):
The global configurations
Return:
None | Load prototxt and weights of Caffe, parsing them into uniform model | [
"Load",
"prototxt",
"and",
"weights",
"of",
"Caffe",
"parsing",
"them",
"into",
"uniform",
"model"
] | def load_model(self, global_conf):
'''
Load prototxt and weights of Caffe, parsing them into uniform model
Args:
global_conf (:class:`~cntk.contrib.crosstalkcaffe.utils.globalconf.GlobalConf`):
The global configurations
Return:
None
... | [
"def",
"load_model",
"(",
"self",
",",
"global_conf",
")",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"'Start loading model:\\n'",
")",
"self",
".",
"_source_solver",
"=",
"global_conf",
".",
"source_solver",
"# loading the model",
"if",
"not",
"os",
".",
"... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalkcaffe/adapter/bvlccaffe/caffeadapter.py#L355-L394 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | RadioBox.GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.RadioBox_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2673-L2688 | |
BTCGPU/BTCGPU | 163928af05b09a20efe330157fd0dc8a5211e286 | contrib/devtools/github-merge.py | python | git_config_get | (option, default=None) | Get named configuration option from git repository. | Get named configuration option from git repository. | [
"Get",
"named",
"configuration",
"option",
"from",
"git",
"repository",
"."
] | def git_config_get(option, default=None):
'''
Get named configuration option from git repository.
'''
try:
return subprocess.check_output([GIT,'config','--get',option]).rstrip().decode('utf-8')
except subprocess.CalledProcessError:
return default | [
"def",
"git_config_get",
"(",
"option",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"[",
"GIT",
",",
"'config'",
",",
"'--get'",
",",
"option",
"]",
")",
".",
"rstrip",
"(",
")",
".",
"decode",
... | https://github.com/BTCGPU/BTCGPU/blob/163928af05b09a20efe330157fd0dc8a5211e286/contrib/devtools/github-merge.py#L44-L51 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/posixpath.py | python | isabs | (s) | return s.startswith('/') | Test whether a path is absolute | Test whether a path is absolute | [
"Test",
"whether",
"a",
"path",
"is",
"absolute"
] | def isabs(s):
"""Test whether a path is absolute"""
return s.startswith('/') | [
"def",
"isabs",
"(",
"s",
")",
":",
"return",
"s",
".",
"startswith",
"(",
"'/'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/posixpath.py#L52-L54 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/contextlib2.py | python | ExitStack.close | (self) | Immediately unwind the context stack | Immediately unwind the context stack | [
"Immediately",
"unwind",
"the",
"context",
"stack"
] | def close(self):
"""Immediately unwind the context stack"""
self.__exit__(None, None, None) | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"__exit__",
"(",
"None",
",",
"None",
",",
"None",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/contextlib2.py#L446-L448 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseEvent.GetWheelAxis | (*args, **kwargs) | return _core_.MouseEvent_GetWheelAxis(*args, **kwargs) | GetWheelAxis(self) -> int
Gets the axis the wheel operation concerns, 0 being the y axis as on
most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
or horizontal trackpad scrolling. | GetWheelAxis(self) -> int | [
"GetWheelAxis",
"(",
"self",
")",
"-",
">",
"int"
] | def GetWheelAxis(*args, **kwargs):
"""
GetWheelAxis(self) -> int
Gets the axis the wheel operation concerns, 0 being the y axis as on
most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
or horizontal trackpad scrolling.
"""
return _core_.MouseE... | [
"def",
"GetWheelAxis",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseEvent_GetWheelAxis",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5822-L5830 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py | python | DefaultCookiePolicy.allowed_domains | (self) | return self._allowed_domains | Return None, or the sequence of allowed domains (as a tuple). | Return None, or the sequence of allowed domains (as a tuple). | [
"Return",
"None",
"or",
"the",
"sequence",
"of",
"allowed",
"domains",
"(",
"as",
"a",
"tuple",
")",
"."
] | def allowed_domains(self):
"""Return None, or the sequence of allowed domains (as a tuple)."""
return self._allowed_domains | [
"def",
"allowed_domains",
"(",
"self",
")",
":",
"return",
"self",
".",
"_allowed_domains"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py#L894-L896 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/zhusuan/framework/bn.py | python | BayesianNet.normal | (self,
name,
observation=None,
mean=None,
std=None,
seed=0,
dtype=mstype.float32,
shape=(),
reparameterize=True) | return sample, log_prob | Normal distribution wrapper | Normal distribution wrapper | [
"Normal",
"distribution",
"wrapper"
] | def normal(self,
name,
observation=None,
mean=None,
std=None,
seed=0,
dtype=mstype.float32,
shape=(),
reparameterize=True):
""" Normal distribution wrapper """
if not isinstance(name,... | [
"def",
"normal",
"(",
"self",
",",
"name",
",",
"observation",
"=",
"None",
",",
"mean",
"=",
"None",
",",
"std",
"=",
"None",
",",
"seed",
"=",
"0",
",",
"dtype",
"=",
"mstype",
".",
"float32",
",",
"shape",
"=",
"(",
")",
",",
"reparameterize",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/zhusuan/framework/bn.py#L37-L63 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_ev_parser.py | python | p_optdir_gt | (p) | optdir : GT | optdir : GT | [
"optdir",
":",
"GT"
] | def p_optdir_gt(p):
'optdir : GT'
p[0] = InEvent | [
"def",
"p_optdir_gt",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"InEvent"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_ev_parser.py#L307-L309 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | DialogLayoutAdapter.CanDoLayoutAdaptation | (*args, **kwargs) | return _windows_.DialogLayoutAdapter_CanDoLayoutAdaptation(*args, **kwargs) | CanDoLayoutAdaptation(self, Dialog dialog) -> bool | CanDoLayoutAdaptation(self, Dialog dialog) -> bool | [
"CanDoLayoutAdaptation",
"(",
"self",
"Dialog",
"dialog",
")",
"-",
">",
"bool"
] | def CanDoLayoutAdaptation(*args, **kwargs):
"""CanDoLayoutAdaptation(self, Dialog dialog) -> bool"""
return _windows_.DialogLayoutAdapter_CanDoLayoutAdaptation(*args, **kwargs) | [
"def",
"CanDoLayoutAdaptation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"DialogLayoutAdapter_CanDoLayoutAdaptation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L962-L964 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/global_notification.py | python | GlobalNotification.type | (self, type) | Sets the type of this GlobalNotification.
:param type: The type of this GlobalNotification. # noqa: E501
:type: str | Sets the type of this GlobalNotification. | [
"Sets",
"the",
"type",
"of",
"this",
"GlobalNotification",
"."
] | def type(self, type):
"""Sets the type of this GlobalNotification.
:param type: The type of this GlobalNotification. # noqa: E501
:type: str
"""
allowed_values = ["success", "error", "info"] # noqa: E501
if type not in allowed_values:
raise ValueError(
... | [
"def",
"type",
"(",
"self",
",",
"type",
")",
":",
"allowed_values",
"=",
"[",
"\"success\"",
",",
"\"error\"",
",",
"\"info\"",
"]",
"# noqa: E501",
"if",
"type",
"not",
"in",
"allowed_values",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `type` ({0}),... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/global_notification.py#L215-L229 | ||
MicBosi/VisualizationLibrary | d2a0e321288152008957e29a0bc270ad192f75be | src/external/freetype/src/tools/docmaker/utils.py | python | make_file_list | ( args = None ) | return file_list | builds a list of input files from command-line arguments | builds a list of input files from command-line arguments | [
"builds",
"a",
"list",
"of",
"input",
"files",
"from",
"command",
"-",
"line",
"arguments"
] | def make_file_list( args = None ):
"""builds a list of input files from command-line arguments"""
file_list = []
# sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
if not args:
args = sys.argv[1 :]
for pathname in args:
if string.find( pathname, '*' ) >= 0:
newpath = g... | [
"def",
"make_file_list",
"(",
"args",
"=",
"None",
")",
":",
"file_list",
"=",
"[",
"]",
"# sys.stderr.write( repr( sys.argv[1 :] ) + '\\n' )",
"if",
"not",
"args",
":",
"args",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"for",
"pathname",
"in",
"args",
... | https://github.com/MicBosi/VisualizationLibrary/blob/d2a0e321288152008957e29a0bc270ad192f75be/src/external/freetype/src/tools/docmaker/utils.py#L106-L130 | |
BVLC/caffe | 9b891540183ddc834a02b2bd81b31afae71b2153 | scripts/cpp_lint.py | python | CheckForFunctionLengths | (filename, clean_lines, linenum,
function_state, error) | Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming other style guidelines
(especially spacing) are followed.
Only checks unindented functions, so class members are ... | Reports for long function bodies. | [
"Reports",
"for",
"long",
"function",
"bodies",
"."
] | def CheckForFunctionLengths(filename, clean_lines, linenum,
function_state, error):
"""Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming ... | [
"def",
"CheckForFunctionLengths",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"function_state",
",",
"error",
")",
":",
"lines",
"=",
"clean_lines",
".",
"lines",
"line",
"=",
"lines",
"[",
"linenum",
"]",
"raw",
"=",
"clean_lines",
".",
"raw_l... | https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/scripts/cpp_lint.py#L2388-L2455 | ||
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | scripts/git/cpplint.py | python | CheckDefaultLambdaCaptures | (filename, clean_lines, linenum, error) | Check that default lambda captures are not used.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check that default lambda captures are not used. | [
"Check",
"that",
"default",
"lambda",
"captures",
"are",
"not",
"used",
"."
] | def CheckDefaultLambdaCaptures(filename, clean_lines, linenum, error):
"""Check that default lambda captures are not used.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functi... | [
"def",
"CheckDefaultLambdaCaptures",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# A lambda introducer specifies a default capture if it starts with \"[=\"",
"# or if it starts... | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L6409-L6435 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/ttk.py | python | Style.theme_settings | (self, themename, settings) | Temporarily sets the current theme to themename, apply specified
settings and then restore the previous theme.
Each key in settings is a style and each value may contain the
keys 'configure', 'map', 'layout' and 'element create' and they
are expected to have the same format as specified... | Temporarily sets the current theme to themename, apply specified
settings and then restore the previous theme. | [
"Temporarily",
"sets",
"the",
"current",
"theme",
"to",
"themename",
"apply",
"specified",
"settings",
"and",
"then",
"restore",
"the",
"previous",
"theme",
"."
] | def theme_settings(self, themename, settings):
"""Temporarily sets the current theme to themename, apply specified
settings and then restore the previous theme.
Each key in settings is a style and each value may contain the
keys 'configure', 'map', 'layout' and 'element create' and they... | [
"def",
"theme_settings",
"(",
"self",
",",
"themename",
",",
"settings",
")",
":",
"script",
"=",
"_script_from_settings",
"(",
"settings",
")",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_name",
",",
"\"theme\"",
",",
"\"settings\"",
",",
"themena... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L496-L505 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/speech_recognition/stt_utils.py | python | spectrogram_from_file | (filename, step=10, window=20, max_freq=None,
eps=1e-14, overwrite=False, save_feature_as_csvfile=False) | Calculate the log of linear spectrogram from FFT energy
Params:
filename (str): Path to the audio file
step (int): Step size in milliseconds between windows
window (int): FFT window size in milliseconds
max_freq (int): Only FFT bins corresponding to frequencies between
[0... | Calculate the log of linear spectrogram from FFT energy
Params:
filename (str): Path to the audio file
step (int): Step size in milliseconds between windows
window (int): FFT window size in milliseconds
max_freq (int): Only FFT bins corresponding to frequencies between
[0... | [
"Calculate",
"the",
"log",
"of",
"linear",
"spectrogram",
"from",
"FFT",
"energy",
"Params",
":",
"filename",
"(",
"str",
")",
":",
"Path",
"to",
"the",
"audio",
"file",
"step",
"(",
"int",
")",
":",
"Step",
"size",
"in",
"milliseconds",
"between",
"wind... | def spectrogram_from_file(filename, step=10, window=20, max_freq=None,
eps=1e-14, overwrite=False, save_feature_as_csvfile=False):
""" Calculate the log of linear spectrogram from FFT energy
Params:
filename (str): Path to the audio file
step (int): Step size in millise... | [
"def",
"spectrogram_from_file",
"(",
"filename",
",",
"step",
"=",
"10",
",",
"window",
"=",
"20",
",",
"max_freq",
"=",
"None",
",",
"eps",
"=",
"1e-14",
",",
"overwrite",
"=",
"False",
",",
"save_feature_as_csvfile",
"=",
"False",
")",
":",
"csvfilename"... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/speech_recognition/stt_utils.py#L111-L150 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/util.py | python | CleanDescription | (description) | return description.replace('"""', '" " "') | Return a version of description safe for printing in a docstring. | Return a version of description safe for printing in a docstring. | [
"Return",
"a",
"version",
"of",
"description",
"safe",
"for",
"printing",
"in",
"a",
"docstring",
"."
] | def CleanDescription(description):
"""Return a version of description safe for printing in a docstring."""
if not isinstance(description, six.string_types):
return description
return description.replace('"""', '" " "') | [
"def",
"CleanDescription",
"(",
"description",
")",
":",
"if",
"not",
"isinstance",
"(",
"description",
",",
"six",
".",
"string_types",
")",
":",
"return",
"description",
"return",
"description",
".",
"replace",
"(",
"'\"\"\"'",
",",
"'\" \" \"'",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/util.py#L229-L233 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/categorical.py | python | Categorical.__getitem__ | (self, key) | return self._constructor(result, dtype=self.dtype, fastpath=True) | Return an item. | Return an item. | [
"Return",
"an",
"item",
"."
] | def __getitem__(self, key):
"""
Return an item.
"""
if isinstance(key, (int, np.integer)):
i = self._codes[key]
if i == -1:
return np.nan
else:
return self.categories[i]
key = check_array_indexer(self, key)
... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"(",
"int",
",",
"np",
".",
"integer",
")",
")",
":",
"i",
"=",
"self",
".",
"_codes",
"[",
"key",
"]",
"if",
"i",
"==",
"-",
"1",
":",
"return",
"n... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/categorical.py#L1999-L2016 | |
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/util/ordered_dict.py | python | OrderedDict.__init__ | (self, *args, **kwds) | Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary. | Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary. | [
"Initialize",
"an",
"ordered",
"dictionary",
".",
"Signature",
"is",
"the",
"same",
"as",
"for",
"regular",
"dictionaries",
"but",
"keyword",
"arguments",
"are",
"not",
"recommended",
"because",
"their",
"insertion",
"order",
"is",
"arbitrary",
"."
] | def __init__(self, *args, **kwds):
'''Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary.
'''
if len(args) > 1:
raise TypeError('expected at most 1... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"len",
"(",
"args",
")",
">",
"1",
":",
"raise",
"TypeError",
"(",
"'expected at most 1 arguments, got %d'",
"%",
"len",
"(",
"args",
")",
")",
"try",
":",
"self... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/util/ordered_dict.py#L34-L48 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/smtplib.py | python | SMTP.helo | (self, name='') | return (code, msg) | SMTP 'helo' command.
Hostname to send for this command defaults to the FQDN of the local
host. | SMTP 'helo' command.
Hostname to send for this command defaults to the FQDN of the local
host. | [
"SMTP",
"helo",
"command",
".",
"Hostname",
"to",
"send",
"for",
"this",
"command",
"defaults",
"to",
"the",
"FQDN",
"of",
"the",
"local",
"host",
"."
] | def helo(self, name=''):
"""SMTP 'helo' command.
Hostname to send for this command defaults to the FQDN of the local
host.
"""
self.putcmd("helo", name or self.local_hostname)
(code, msg) = self.getreply()
self.helo_resp = msg
return (code, msg) | [
"def",
"helo",
"(",
"self",
",",
"name",
"=",
"''",
")",
":",
"self",
".",
"putcmd",
"(",
"\"helo\"",
",",
"name",
"or",
"self",
".",
"local_hostname",
")",
"(",
"code",
",",
"msg",
")",
"=",
"self",
".",
"getreply",
"(",
")",
"self",
".",
"helo_... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/smtplib.py#L389-L397 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/metric.py | python | EvalMetric.update | (self, labels, preds) | Updates the internal evaluation result.
Parameters
----------
labels : list of `NDArray`
The labels of the data.
preds : list of `NDArray`
Predicted values. | Updates the internal evaluation result. | [
"Updates",
"the",
"internal",
"evaluation",
"result",
"."
] | def update(self, labels, preds):
"""Updates the internal evaluation result.
Parameters
----------
labels : list of `NDArray`
The labels of the data.
preds : list of `NDArray`
Predicted values.
"""
raise NotImplementedError() | [
"def",
"update",
"(",
"self",
",",
"labels",
",",
"preds",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/metric.py#L110-L121 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/json_format.py | python | ParseDict | (js_dict,
message,
ignore_unknown_fields=False,
descriptor_pool=None) | return message | Parses a JSON dictionary representation into a message.
Args:
js_dict: Dict representation of a JSON message.
message: A protocol buffer message to merge into.
ignore_unknown_fields: If True, do not raise errors for unknown fields.
descriptor_pool: A Descriptor Pool for resolving types. If None use t... | Parses a JSON dictionary representation into a message. | [
"Parses",
"a",
"JSON",
"dictionary",
"representation",
"into",
"a",
"message",
"."
] | def ParseDict(js_dict,
message,
ignore_unknown_fields=False,
descriptor_pool=None):
"""Parses a JSON dictionary representation into a message.
Args:
js_dict: Dict representation of a JSON message.
message: A protocol buffer message to merge into.
ignore_unknown... | [
"def",
"ParseDict",
"(",
"js_dict",
",",
"message",
",",
"ignore_unknown_fields",
"=",
"False",
",",
"descriptor_pool",
"=",
"None",
")",
":",
"parser",
"=",
"_Parser",
"(",
"ignore_unknown_fields",
",",
"descriptor_pool",
")",
"parser",
".",
"ConvertMessage",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/json_format.py#L437-L455 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | doc/userdoc/_ext/HoverXTooltip.py | python | setup | (app) | return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
} | Adds the necessary routines to Sphinx.
Args:
app (TYPE): Description
Returns:
TYPE: Description | Adds the necessary routines to Sphinx. | [
"Adds",
"the",
"necessary",
"routines",
"to",
"Sphinx",
"."
] | def setup(app):
"""Adds the necessary routines to Sphinx.
Args:
app (TYPE): Description
Returns:
TYPE: Description
"""
# add external css/js files
app.add_js_file('js/jquery-2.0.3.min.js')
app.add_js_file('js/bootstrap.min.js')
app.add_css_file('css/bootstrap.min.css')
... | [
"def",
"setup",
"(",
"app",
")",
":",
"# add external css/js files",
"app",
".",
"add_js_file",
"(",
"'js/jquery-2.0.3.min.js'",
")",
"app",
".",
"add_js_file",
"(",
"'js/bootstrap.min.js'",
")",
"app",
".",
"add_css_file",
"(",
"'css/bootstrap.min.css'",
")",
"# ad... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/doc/userdoc/_ext/HoverXTooltip.py#L235-L265 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/fft/helper.py | python | fftfreq | (n,d=1.0) | return results * val | Return the Discrete Fourier Transform sample frequencies.
The returned float array contains the frequency bins in
cycles/unit (with zero at the start) given a window length `n` and a
sample spacing `d`::
f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n) if n is even
f = [0, 1, ..., (n-1)/2... | Return the Discrete Fourier Transform sample frequencies. | [
"Return",
"the",
"Discrete",
"Fourier",
"Transform",
"sample",
"frequencies",
"."
] | def fftfreq(n,d=1.0):
"""
Return the Discrete Fourier Transform sample frequencies.
The returned float array contains the frequency bins in
cycles/unit (with zero at the start) given a window length `n` and a
sample spacing `d`::
f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n) if n is ... | [
"def",
"fftfreq",
"(",
"n",
",",
"d",
"=",
"1.0",
")",
":",
"assert",
"isinstance",
"(",
"n",
",",
"types",
".",
"IntType",
")",
"or",
"isinstance",
"(",
"n",
",",
"integer",
")",
"val",
"=",
"1.0",
"/",
"(",
"n",
"*",
"d",
")",
"results",
"=",... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/fft/helper.py#L119-L161 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/multiarray.py | python | busday_offset | (dates, offsets, roll=None, weekmask=None, holidays=None,
busdaycal=None, out=None) | return (dates, offsets, weekmask, holidays, out) | busday_offset(dates, offsets, roll='raise', weekmask='1111100', holidays=None, busdaycal=None, out=None)
First adjusts the date to fall on a valid day according to
the ``roll`` rule, then applies offsets to the given dates
counted in valid days.
.. versionadded:: 1.7.0
Parameters
----------
... | busday_offset(dates, offsets, roll='raise', weekmask='1111100', holidays=None, busdaycal=None, out=None) | [
"busday_offset",
"(",
"dates",
"offsets",
"roll",
"=",
"raise",
"weekmask",
"=",
"1111100",
"holidays",
"=",
"None",
"busdaycal",
"=",
"None",
"out",
"=",
"None",
")"
] | def busday_offset(dates, offsets, roll=None, weekmask=None, holidays=None,
busdaycal=None, out=None):
"""
busday_offset(dates, offsets, roll='raise', weekmask='1111100', holidays=None, busdaycal=None, out=None)
First adjusts the date to fall on a valid day according to
the ``roll`` ru... | [
"def",
"busday_offset",
"(",
"dates",
",",
"offsets",
",",
"roll",
"=",
"None",
",",
"weekmask",
"=",
"None",
",",
"holidays",
"=",
"None",
",",
"busdaycal",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"(",
"dates",
",",
"offsets",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/multiarray.py#L1464-L1554 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/plistlib.py | python | writePlist | (value, pathOrFile) | Write 'value' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object.
This function is deprecated, use dump instead. | Write 'value' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object. | [
"Write",
"value",
"to",
"a",
".",
"plist",
"file",
".",
"pathOrFile",
"may",
"either",
"be",
"a",
"file",
"name",
"or",
"a",
"(",
"writable",
")",
"file",
"object",
"."
] | def writePlist(value, pathOrFile):
"""
Write 'value' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object.
This function is deprecated, use dump instead.
"""
warn("The writePlist function is deprecated, use dump() instead",
DeprecationWarning, 2)
with... | [
"def",
"writePlist",
"(",
"value",
",",
"pathOrFile",
")",
":",
"warn",
"(",
"\"The writePlist function is deprecated, use dump() instead\"",
",",
"DeprecationWarning",
",",
"2",
")",
"with",
"_maybe_open",
"(",
"pathOrFile",
",",
"'wb'",
")",
"as",
"fp",
":",
"du... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/plistlib.py#L102-L112 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchStairs.py | python | _Stairs.makeStraightStairsWithLanding | (self,obj,edge) | builds a straight staircase with/without a landing in the middle | builds a straight staircase with/without a landing in the middle | [
"builds",
"a",
"straight",
"staircase",
"with",
"/",
"without",
"a",
"landing",
"in",
"the",
"middle"
] | def makeStraightStairsWithLanding(self,obj,edge):
"builds a straight staircase with/without a landing in the middle"
if obj.NumberOfSteps < 3:
return
v = DraftGeomUtils.vec(edge)
landing = 0
if obj.TreadDepthEnforce == 0:
if obj.Landings == "At center":... | [
"def",
"makeStraightStairsWithLanding",
"(",
"self",
",",
"obj",
",",
"edge",
")",
":",
"if",
"obj",
".",
"NumberOfSteps",
"<",
"3",
":",
"return",
"v",
"=",
"DraftGeomUtils",
".",
"vec",
"(",
"edge",
")",
"landing",
"=",
"0",
"if",
"obj",
".",
"TreadD... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchStairs.py#L1307-L1409 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py | python | cc_load_tools | (conf) | Load the c tool | Load the c tool | [
"Load",
"the",
"c",
"tool"
] | def cc_load_tools(conf):
"""
Load the c tool
"""
if not conf.env.DEST_OS:
conf.env.DEST_OS = Utils.unversioned_sys_platform()
conf.load('c') | [
"def",
"cc_load_tools",
"(",
"conf",
")",
":",
"if",
"not",
"conf",
".",
"env",
".",
"DEST_OS",
":",
"conf",
".",
"env",
".",
"DEST_OS",
"=",
"Utils",
".",
"unversioned_sys_platform",
"(",
")",
"conf",
".",
"load",
"(",
"'c'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py#L1019-L1025 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/tools/miniterm.py | python | Transform.echo | (self, text) | return text | text to be sent but displayed on console | text to be sent but displayed on console | [
"text",
"to",
"be",
"sent",
"but",
"displayed",
"on",
"console"
] | def echo(self, text):
"""text to be sent but displayed on console"""
return text | [
"def",
"echo",
"(",
"self",
",",
"text",
")",
":",
"return",
"text"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/tools/miniterm.py#L187-L189 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/math_grad.py | python | _InvGrad | (op, grad) | return gen_math_ops._reciprocal_grad(y, grad) | Returns -grad * (1 / x^2). | Returns -grad * (1 / x^2). | [
"Returns",
"-",
"grad",
"*",
"(",
"1",
"/",
"x^2",
")",
"."
] | def _InvGrad(op, grad):
"""Returns -grad * (1 / x^2)."""
y = op.outputs[0] # y = 1 / x
# pylint: disable=protected-access
return gen_math_ops._reciprocal_grad(y, grad) | [
"def",
"_InvGrad",
"(",
"op",
",",
"grad",
")",
":",
"y",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
"# y = 1 / x",
"# pylint: disable=protected-access",
"return",
"gen_math_ops",
".",
"_reciprocal_grad",
"(",
"y",
",",
"grad",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_grad.py#L255-L259 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | hasnext | (it) | return it.__ms_hasnext__() | Implementation of `hasnext`. | Implementation of `hasnext`. | [
"Implementation",
"of",
"hasnext",
"."
] | def hasnext(it):
"""Implementation of `hasnext`."""
return it.__ms_hasnext__() | [
"def",
"hasnext",
"(",
"it",
")",
":",
"return",
"it",
".",
"__ms_hasnext__",
"(",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L1438-L1440 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/integrate/_bvp.py | python | compute_jac_indices | (n, m, k) | return i, j | Compute indices for the collocation system Jacobian construction.
See `construct_global_jac` for the explanation. | Compute indices for the collocation system Jacobian construction. | [
"Compute",
"indices",
"for",
"the",
"collocation",
"system",
"Jacobian",
"construction",
"."
] | def compute_jac_indices(n, m, k):
"""Compute indices for the collocation system Jacobian construction.
See `construct_global_jac` for the explanation.
"""
i_col = np.repeat(np.arange((m - 1) * n), n)
j_col = (np.tile(np.arange(n), n * (m - 1)) +
np.repeat(np.arange(m - 1) * n, n**2))
... | [
"def",
"compute_jac_indices",
"(",
"n",
",",
"m",
",",
"k",
")",
":",
"i_col",
"=",
"np",
".",
"repeat",
"(",
"np",
".",
"arange",
"(",
"(",
"m",
"-",
"1",
")",
"*",
"n",
")",
",",
"n",
")",
"j_col",
"=",
"(",
"np",
".",
"tile",
"(",
"np",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_bvp.py#L119-L142 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/elastic/agent/server/api.py | python | SimpleElasticAgent._rendezvous | (self, worker_group: WorkerGroup) | r"""
Runs rendezvous for the workers specified by worker spec.
Assigns workers a new global rank and world size.
Updates the rendezvous store for the worker group. | r"""
Runs rendezvous for the workers specified by worker spec.
Assigns workers a new global rank and world size.
Updates the rendezvous store for the worker group. | [
"r",
"Runs",
"rendezvous",
"for",
"the",
"workers",
"specified",
"by",
"worker",
"spec",
".",
"Assigns",
"workers",
"a",
"new",
"global",
"rank",
"and",
"world",
"size",
".",
"Updates",
"the",
"rendezvous",
"store",
"for",
"the",
"worker",
"group",
"."
] | def _rendezvous(self, worker_group: WorkerGroup) -> None:
r"""
Runs rendezvous for the workers specified by worker spec.
Assigns workers a new global rank and world size.
Updates the rendezvous store for the worker group.
"""
spec = worker_group.spec
store, grou... | [
"def",
"_rendezvous",
"(",
"self",
",",
"worker_group",
":",
"WorkerGroup",
")",
"->",
"None",
":",
"spec",
"=",
"worker_group",
".",
"spec",
"store",
",",
"group_rank",
",",
"group_world_size",
"=",
"spec",
".",
"rdzv_handler",
".",
"next_rendezvous",
"(",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/agent/server/api.py#L529-L564 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextParagraphLayoutBox.GetLineCount | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_GetLineCount(*args, **kwargs) | GetLineCount(self) -> int | GetLineCount(self) -> int | [
"GetLineCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetLineCount(*args, **kwargs):
"""GetLineCount(self) -> int"""
return _richtext.RichTextParagraphLayoutBox_GetLineCount(*args, **kwargs) | [
"def",
"GetLineCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_GetLineCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1712-L1714 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.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",
")",
":",
"return",
"a",
".",
"is_canonical",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L4047-L4056 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | SourceRange.end | (self) | return conf.lib.clang_getRangeEnd(self) | Return a SourceLocation representing the last character within a
source range. | Return a SourceLocation representing the last character within a
source range. | [
"Return",
"a",
"SourceLocation",
"representing",
"the",
"last",
"character",
"within",
"a",
"source",
"range",
"."
] | def end(self):
"""
Return a SourceLocation representing the last character within a
source range.
"""
return conf.lib.clang_getRangeEnd(self) | [
"def",
"end",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getRangeEnd",
"(",
"self",
")"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L329-L334 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/descriptor.py | python | FieldDescriptor.ProtoTypeToCppProtoType | (proto_type) | Converts from a Python proto type to a C++ Proto Type.
The Python ProtocolBuffer classes specify both the 'Python' datatype and the
'C++' datatype - and they're not the same. This helper method should
translate from one to another.
Args:
proto_type: the Python proto type (descriptor.FieldDescrip... | Converts from a Python proto type to a C++ Proto Type. | [
"Converts",
"from",
"a",
"Python",
"proto",
"type",
"to",
"a",
"C",
"++",
"Proto",
"Type",
"."
] | def ProtoTypeToCppProtoType(proto_type):
"""Converts from a Python proto type to a C++ Proto Type.
The Python ProtocolBuffer classes specify both the 'Python' datatype and the
'C++' datatype - and they're not the same. This helper method should
translate from one to another.
Args:
proto_type... | [
"def",
"ProtoTypeToCppProtoType",
"(",
"proto_type",
")",
":",
"try",
":",
"return",
"FieldDescriptor",
".",
"_PYTHON_TO_CPP_PROTO_TYPE_MAP",
"[",
"proto_type",
"]",
"except",
"KeyError",
":",
"raise",
"TypeTransformationError",
"(",
"'Unknown proto_type: %s'",
"%",
"pr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/descriptor.py#L622-L639 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py | python | _GroupBy.__iter__ | (self) | return self.grouper.get_iterator(self.obj, axis=self.axis) | Groupby iterator.
Returns
-------
Generator yielding sequence of (name, subsetted object)
for each group | Groupby iterator. | [
"Groupby",
"iterator",
"."
] | def __iter__(self):
"""
Groupby iterator.
Returns
-------
Generator yielding sequence of (name, subsetted object)
for each group
"""
return self.grouper.get_iterator(self.obj, axis=self.axis) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"self",
".",
"grouper",
".",
"get_iterator",
"(",
"self",
".",
"obj",
",",
"axis",
"=",
"self",
".",
"axis",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py#L690-L699 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/coverage/pull_request.py | python | get_files | (args) | Args:
args (argparse.ArgumentParser().parse_args()): Arguments.
Returns:
None. | Args:
args (argparse.ArgumentParser().parse_args()): Arguments. | [
"Args",
":",
"args",
"(",
"argparse",
".",
"ArgumentParser",
"()",
".",
"parse_args",
"()",
")",
":",
"Arguments",
"."
] | def get_files(args):
"""
Args:
args (argparse.ArgumentParser().parse_args()): Arguments.
Returns:
None.
"""
pull = get_pull(args.pull_id)
for file in pull.get_files():
print('/paddle/{}'.format(file.filename)) | [
"def",
"get_files",
"(",
"args",
")",
":",
"pull",
"=",
"get_pull",
"(",
"args",
".",
"pull_id",
")",
"for",
"file",
"in",
"pull",
".",
"get_files",
"(",
")",
":",
"print",
"(",
"'/paddle/{}'",
".",
"format",
"(",
"file",
".",
"filename",
")",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/coverage/pull_request.py#L45-L57 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/dom/minidom.py | python | _clone_node | (node, deep, newOwnerDocument) | return clone | Clone a node and give it the new owner document.
Called by Node.cloneNode and Document.importNode | Clone a node and give it the new owner document.
Called by Node.cloneNode and Document.importNode | [
"Clone",
"a",
"node",
"and",
"give",
"it",
"the",
"new",
"owner",
"document",
".",
"Called",
"by",
"Node",
".",
"cloneNode",
"and",
"Document",
".",
"importNode"
] | def _clone_node(node, deep, newOwnerDocument):
"""
Clone a node and give it the new owner document.
Called by Node.cloneNode and Document.importNode
"""
if node.ownerDocument.isSameNode(newOwnerDocument):
operation = xml.dom.UserDataHandler.NODE_CLONED
else:
operation = xml.dom.U... | [
"def",
"_clone_node",
"(",
"node",
",",
"deep",
",",
"newOwnerDocument",
")",
":",
"if",
"node",
".",
"ownerDocument",
".",
"isSameNode",
"(",
"newOwnerDocument",
")",
":",
"operation",
"=",
"xml",
".",
"dom",
".",
"UserDataHandler",
".",
"NODE_CLONED",
"els... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/dom/minidom.py#L1815-L1894 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/intelc.py | python | get_intel_compiler_top | (version, abi) | return top | Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc. | Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc. | [
"Return",
"the",
"main",
"path",
"to",
"the",
"top",
"-",
"level",
"dir",
"of",
"the",
"Intel",
"compiler",
"using",
"the",
"given",
"version",
".",
"The",
"compiler",
"will",
"be",
"in",
"<top",
">",
"/",
"bin",
"/",
"icl",
".",
"exe",
"(",
"icc",
... | def get_intel_compiler_top(version, abi):
"""
Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc.
"""
if is_windows:
if not SCons.Util.can_read_reg:... | [
"def",
"get_intel_compiler_top",
"(",
"version",
",",
"abi",
")",
":",
"if",
"is_windows",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"can_read_reg",
":",
"raise",
"NoRegistryModuleError",
"(",
"\"No Windows registry module was found\"",
")",
"top",
"=",
"get_in... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/intelc.py#L298-L386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.