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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/foldpanelbar.py | python | FoldPanelItem.OnPressCaption | (self, event) | Handles the ``wx.EVT_CAPTIONBAR`` event for :class:`FoldPanelItem`.
:param `event`: a :class:`CaptionBarEvent` event to be processed. | Handles the ``wx.EVT_CAPTIONBAR`` event for :class:`FoldPanelItem`. | [
"Handles",
"the",
"wx",
".",
"EVT_CAPTIONBAR",
"event",
"for",
":",
"class",
":",
"FoldPanelItem",
"."
] | def OnPressCaption(self, event):
"""
Handles the ``wx.EVT_CAPTIONBAR`` event for :class:`FoldPanelItem`.
:param `event`: a :class:`CaptionBarEvent` event to be processed.
"""
# tell the upper container we are responsible
# for this event, so it can fold the pane... | [
"def",
"OnPressCaption",
"(",
"self",
",",
"event",
")",
":",
"# tell the upper container we are responsible",
"# for this event, so it can fold the panel item",
"# and do a refresh",
"event",
".",
"SetTag",
"(",
"self",
")",
"event",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/foldpanelbar.py#L1876-L1888 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.AddToSelection | (*args, **kwargs) | return _propgrid.PropertyGrid_AddToSelection(*args, **kwargs) | AddToSelection(self, PGPropArg id) -> bool | AddToSelection(self, PGPropArg id) -> bool | [
"AddToSelection",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"bool"
] | def AddToSelection(*args, **kwargs):
"""AddToSelection(self, PGPropArg id) -> bool"""
return _propgrid.PropertyGrid_AddToSelection(*args, **kwargs) | [
"def",
"AddToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_AddToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2203-L2205 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/commands/search.py | python | transform_hits | (hits) | return list(packages.values()) | The list from pypi is really a list of versions. We want a list of
packages with the list of versions stored inline. This converts the
list from pypi into one we can use. | The list from pypi is really a list of versions. We want a list of
packages with the list of versions stored inline. This converts the
list from pypi into one we can use. | [
"The",
"list",
"from",
"pypi",
"is",
"really",
"a",
"list",
"of",
"versions",
".",
"We",
"want",
"a",
"list",
"of",
"packages",
"with",
"the",
"list",
"of",
"versions",
"stored",
"inline",
".",
"This",
"converts",
"the",
"list",
"from",
"pypi",
"into",
... | def transform_hits(hits):
"""
The list from pypi is really a list of versions. We want a list of
packages with the list of versions stored inline. This converts the
list from pypi into one we can use.
"""
packages = OrderedDict()
for hit in hits:
name = hit['name']
summary = ... | [
"def",
"transform_hits",
"(",
"hits",
")",
":",
"packages",
"=",
"OrderedDict",
"(",
")",
"for",
"hit",
"in",
"hits",
":",
"name",
"=",
"hit",
"[",
"'name'",
"]",
"summary",
"=",
"hit",
"[",
"'summary'",
"]",
"version",
"=",
"hit",
"[",
"'version'",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/commands/search.py#L69-L94 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/de2/nyan_subprocessor.py | python | DE2NyanSubprocessor.terrain_group_to_terrain | (terrain_group) | Creates raw API objects for a terrain group.
:param terrain_group: Terrain group that gets converted to a tech.
:type terrain_group: ..dataformat.converter_object.ConverterObjectGroup | Creates raw API objects for a terrain group. | [
"Creates",
"raw",
"API",
"objects",
"for",
"a",
"terrain",
"group",
"."
] | def terrain_group_to_terrain(terrain_group):
"""
Creates raw API objects for a terrain group.
:param terrain_group: Terrain group that gets converted to a tech.
:type terrain_group: ..dataformat.converter_object.ConverterObjectGroup
"""
terrain_index = terrain_group.get_... | [
"def",
"terrain_group_to_terrain",
"(",
"terrain_group",
")",
":",
"terrain_index",
"=",
"terrain_group",
".",
"get_id",
"(",
")",
"dataset",
"=",
"terrain_group",
".",
"data",
"# name_lookup_dict = internal_name_lookups.get_entity_lookups(dataset.game_version)",
"terrain_looku... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/de2/nyan_subprocessor.py#L634-L798 | ||
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | gtsam/3rdparty/GeographicLib/python/geographiclib/polygonarea.py | python | PolygonArea.Compute | (self, reverse = False, sign = True) | return self.num, perimeter, area | Compute the properties of the polygon
:param reverse: if true then clockwise (instead of
counter-clockwise) traversal counts as a positive area
:param sign: if true then return a signed result for the area if the
polygon is traversed in the "wrong" direction instead of returning
the area for ... | Compute the properties of the polygon | [
"Compute",
"the",
"properties",
"of",
"the",
"polygon"
] | def Compute(self, reverse = False, sign = True):
"""Compute the properties of the polygon
:param reverse: if true then clockwise (instead of
counter-clockwise) traversal counts as a positive area
:param sign: if true then return a signed result for the area if the
polygon is traversed in the "w... | [
"def",
"Compute",
"(",
"self",
",",
"reverse",
"=",
"False",
",",
"sign",
"=",
"True",
")",
":",
"if",
"self",
".",
"polyline",
":",
"area",
"=",
"Math",
".",
"nan",
"if",
"self",
".",
"num",
"<",
"2",
":",
"perimeter",
"=",
"0.0",
"if",
"not",
... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/polygonarea.py#L162-L213 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py | python | DfjDxi | (DN,f) | return sympy_fe_utilities.DfjDxi(DN, f) | This method defines a gradient. This returns a matrix D such that D(i,j) = D(fj)/D(xi)
Keyword arguments:
DN -- The shape function derivatives
f-- The variable to compute the gradient | This method defines a gradient. This returns a matrix D such that D(i,j) = D(fj)/D(xi) | [
"This",
"method",
"defines",
"a",
"gradient",
".",
"This",
"returns",
"a",
"matrix",
"D",
"such",
"that",
"D",
"(",
"i",
"j",
")",
"=",
"D",
"(",
"fj",
")",
"/",
"D",
"(",
"xi",
")"
] | def DfjDxi(DN,f):
""" This method defines a gradient. This returns a matrix D such that D(i,j) = D(fj)/D(xi)
Keyword arguments:
DN -- The shape function derivatives
f-- The variable to compute the gradient
"""
return sympy_fe_utilities.DfjDxi(DN, f) | [
"def",
"DfjDxi",
"(",
"DN",
",",
"f",
")",
":",
"return",
"sympy_fe_utilities",
".",
"DfjDxi",
"(",
"DN",
",",
"f",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py#L131-L138 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py | python | OpsWorksConnection.describe_user_profiles | (self, iam_user_arns=None) | return self.make_request(action='DescribeUserProfiles',
body=json.dumps(params)) | Describe specified users.
**Required Permissions**: To use this action, an IAM user must
have an attached policy that explicitly grants permissions.
For more information on user permissions, see `Managing User
Permissions`_.
:type iam_user_arns: list
:param iam_user_arn... | Describe specified users. | [
"Describe",
"specified",
"users",
"."
] | def describe_user_profiles(self, iam_user_arns=None):
"""
Describe specified users.
**Required Permissions**: To use this action, an IAM user must
have an attached policy that explicitly grants permissions.
For more information on user permissions, see `Managing User
Per... | [
"def",
"describe_user_profiles",
"(",
"self",
",",
"iam_user_arns",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"iam_user_arns",
"is",
"not",
"None",
":",
"params",
"[",
"'IamUserArns'",
"]",
"=",
"iam_user_arns",
"return",
"self",
".",
"make_reque... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L1867-L1885 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.dot | (self, size=None, *color) | Draw a dot with diameter size, using color.
Optional arguments:
size -- an integer >= 1 (if given)
color -- a colorstring or a numeric color tuple
Draw a circular dot with diameter size, using color.
If size is not given, the maximum of pensize+4 and 2*pensize is used.
... | Draw a dot with diameter size, using color. | [
"Draw",
"a",
"dot",
"with",
"diameter",
"size",
"using",
"color",
"."
] | def dot(self, size=None, *color):
"""Draw a dot with diameter size, using color.
Optional arguments:
size -- an integer >= 1 (if given)
color -- a colorstring or a numeric color tuple
Draw a circular dot with diameter size, using color.
If size is not given, the maximum... | [
"def",
"dot",
"(",
"self",
",",
"size",
"=",
"None",
",",
"*",
"color",
")",
":",
"#print \"dot-1:\", size, color",
"if",
"not",
"color",
":",
"if",
"isinstance",
"(",
"size",
",",
"(",
"str",
",",
"tuple",
")",
")",
":",
"color",
"=",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L3215-L3264 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pathlib2/pathlib2/__init__.py | python | PurePath.as_uri | (self) | return self._flavour.make_uri(self) | Return the path as a 'file' URI. | Return the path as a 'file' URI. | [
"Return",
"the",
"path",
"as",
"a",
"file",
"URI",
"."
] | def as_uri(self):
"""Return the path as a 'file' URI."""
if not self.is_absolute():
raise ValueError("relative path can't be expressed as a file URI")
return self._flavour.make_uri(self) | [
"def",
"as_uri",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_absolute",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"relative path can't be expressed as a file URI\"",
")",
"return",
"self",
".",
"_flavour",
".",
"make_uri",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pathlib2/pathlib2/__init__.py#L971-L975 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Utilities/RelMon/python/utils.py | python | get_relval_version | (file) | Returns tuple (CMSSW version, run version) for specified file. | Returns tuple (CMSSW version, run version) for specified file. | [
"Returns",
"tuple",
"(",
"CMSSW",
"version",
"run",
"version",
")",
"for",
"specified",
"file",
"."
] | def get_relval_version(file):
"""Returns tuple (CMSSW version, run version) for specified file."""
cmssw_version = re.findall('DQM_V(\d*)_', file)
run_version = re.findall('CMSSW_\d*_\d*_\d*(?:_[\w\d]*)?-[\w\d]*_V\d*\w?(?:_[\w\d]*)?-v(\d*)__', file)
if cmssw_version and run_version:
return (int(... | [
"def",
"get_relval_version",
"(",
"file",
")",
":",
"cmssw_version",
"=",
"re",
".",
"findall",
"(",
"'DQM_V(\\d*)_'",
",",
"file",
")",
"run_version",
"=",
"re",
".",
"findall",
"(",
"'CMSSW_\\d*_\\d*_\\d*(?:_[\\w\\d]*)?-[\\w\\d]*_V\\d*\\w?(?:_[\\w\\d]*)?-v(\\d*)__'",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Utilities/RelMon/python/utils.py#L525-L530 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/grappler/controller.py | python | Controller.get_placements | (self, *args, **kwargs) | Returns: Two TF ops.
Args:
*args: "".
**kwargs: "".
Returns:
y_preds: tensor of size [batch_size, num_ops]
log_probs: python dict of at least two fields: "sample", "target" each
containing a tensor of size [batch_size], corresponding to the log_probs. | Returns: Two TF ops. | [
"Returns",
":",
"Two",
"TF",
"ops",
"."
] | def get_placements(self, *args, **kwargs):
"""Returns: Two TF ops.
Args:
*args: "".
**kwargs: "".
Returns:
y_preds: tensor of size [batch_size, num_ops]
log_probs: python dict of at least two fields: "sample", "target" each
containing a tensor of size [batch_size], correspond... | [
"def",
"get_placements",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/grappler/controller.py#L95-L107 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/utils.py | python | LRUCache.setdefault | (self, key, default=None) | Set `default` if the key is not in the cache otherwise
leave unchanged. Return the value of this key. | Set `default` if the key is not in the cache otherwise
leave unchanged. Return the value of this key. | [
"Set",
"default",
"if",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"otherwise",
"leave",
"unchanged",
".",
"Return",
"the",
"value",
"of",
"this",
"key",
"."
] | def setdefault(self, key, default=None):
"""Set `default` if the key is not in the cache otherwise
leave unchanged. Return the value of this key.
"""
self._wlock.acquire()
try:
try:
return self[key]
except KeyError:
self[key... | [
"def",
"setdefault",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"self",
".",
"_wlock",
".",
"acquire",
"(",
")",
"try",
":",
"try",
":",
"return",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"self",
"[",
"key",
"]",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/utils.py#L355-L367 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Script/SConsOptions.py | python | SConsIndentedHelpFormatter.format_heading | (self, heading) | return optparse.IndentedHelpFormatter.format_heading(self, heading) | This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls. | This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls. | [
"This",
"translates",
"any",
"heading",
"of",
"options",
"or",
"Options",
"into",
"SCons",
"Options",
".",
"Unfortunately",
"we",
"have",
"to",
"do",
"this",
"here",
"because",
"those",
"titles",
"are",
"hard",
"-",
"coded",
"in",
"the",
"optparse",
"calls",... | def format_heading(self, heading):
"""
This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls.
"""
if heading == 'Options':
heading = "SCons... | [
"def",
"format_heading",
"(",
"self",
",",
"heading",
")",
":",
"if",
"heading",
"==",
"'Options'",
":",
"heading",
"=",
"\"SCons Options\"",
"return",
"optparse",
".",
"IndentedHelpFormatter",
".",
"format_heading",
"(",
"self",
",",
"heading",
")"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/SConsOptions.py#L430-L438 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | caffe/scripts/cpp_lint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L1171-L1184 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py | python | PastaAnalyzeVisitor.visit_ImportFrom | (self, node) | Handle visiting an import-from node in the AST.
Args:
node: Current Node | Handle visiting an import-from node in the AST. | [
"Handle",
"visiting",
"an",
"import",
"-",
"from",
"node",
"in",
"the",
"AST",
"."
] | def visit_ImportFrom(self, node): # pylint: disable=invalid-name
"""Handle visiting an import-from node in the AST.
Args:
node: Current Node
"""
if not node.module:
self.generic_visit(node)
return
from_import = node.module
for import_alias in node.names:
# Detect base... | [
"def",
"visit_ImportFrom",
"(",
"self",
",",
"node",
")",
":",
"# pylint: disable=invalid-name",
"if",
"not",
"node",
".",
"module",
":",
"self",
".",
"generic_visit",
"(",
"node",
")",
"return",
"from_import",
"=",
"node",
".",
"module",
"for",
"import_alias"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py#L849-L873 | ||
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | utils/vim-lldb/python-vim-lldb/vim_panes.py | python | FrameKeyValuePane.format_pair | (self, key, value, changed=False) | return "%s %s = %s\n" % (marker, key, value) | Formats a key/value pair. Appends a '*' if changed == True | Formats a key/value pair. Appends a '*' if changed == True | [
"Formats",
"a",
"key",
"/",
"value",
"pair",
".",
"Appends",
"a",
"*",
"if",
"changed",
"==",
"True"
] | def format_pair(self, key, value, changed=False):
""" Formats a key/value pair. Appends a '*' if changed == True """
marker = '*' if changed else ' '
return "%s %s = %s\n" % (marker, key, value) | [
"def",
"format_pair",
"(",
"self",
",",
"key",
",",
"value",
",",
"changed",
"=",
"False",
")",
":",
"marker",
"=",
"'*'",
"if",
"changed",
"else",
"' '",
"return",
"\"%s %s = %s\\n\"",
"%",
"(",
"marker",
",",
"key",
",",
"value",
")"
] | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/utils/vim-lldb/python-vim-lldb/vim_panes.py#L421-L424 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Image.SetAlphaData | (*args, **kwargs) | return _core_.Image_SetAlphaData(*args, **kwargs) | SetAlphaData(self, buffer alpha)
Resets the Image's alpha data from a buffer of bytes. Accepts either
a string or a buffer object holding the data and the length of the
data must be width*height. | SetAlphaData(self, buffer alpha) | [
"SetAlphaData",
"(",
"self",
"buffer",
"alpha",
")"
] | def SetAlphaData(*args, **kwargs):
"""
SetAlphaData(self, buffer alpha)
Resets the Image's alpha data from a buffer of bytes. Accepts either
a string or a buffer object holding the data and the length of the
data must be width*height.
"""
return _core_.Image_Set... | [
"def",
"SetAlphaData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_SetAlphaData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L3403-L3411 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/shutil.py | python | copy | (src, dst) | Copy data and mode bits ("cp src dst").
The destination may be a directory. | Copy data and mode bits ("cp src dst"). | [
"Copy",
"data",
"and",
"mode",
"bits",
"(",
"cp",
"src",
"dst",
")",
"."
] | def copy(src, dst):
"""Copy data and mode bits ("cp src dst").
The destination may be a directory.
"""
if os.path.isdir(dst):
dst = os.path.join(dst, os.path.basename(src))
copyfile(src, dst)
copymode(src, dst) | [
"def",
"copy",
"(",
"src",
",",
"dst",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"dst",
")",
":",
"dst",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dst",
",",
"os",
".",
"path",
".",
"basename",
"(",
"src",
")",
")",
"copyfile",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/shutil.py#L111-L120 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/gather/skeleton_gatherer.py | python | SkeletonGatherer._AddNontranslateableChunk | (self, chunk) | Adds a nontranslateable chunk. | Adds a nontranslateable chunk. | [
"Adds",
"a",
"nontranslateable",
"chunk",
"."
] | def _AddNontranslateableChunk(self, chunk):
'''Adds a nontranslateable chunk.'''
if self.single_message_:
ph = tclib.Placeholder('XX%02dXX' % self.ph_counter_, chunk, chunk)
self.ph_counter_ += 1
self.single_message_.AppendPlaceholder(ph)
else:
self.skeleton_.append(chunk) | [
"def",
"_AddNontranslateableChunk",
"(",
"self",
",",
"chunk",
")",
":",
"if",
"self",
".",
"single_message_",
":",
"ph",
"=",
"tclib",
".",
"Placeholder",
"(",
"'XX%02dXX'",
"%",
"self",
".",
"ph_counter_",
",",
"chunk",
",",
"chunk",
")",
"self",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/gather/skeleton_gatherer.py#L104-L111 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlDCRenderer.__init__ | (self, *args, **kwargs) | __init__(self) -> HtmlDCRenderer | __init__(self) -> HtmlDCRenderer | [
"__init__",
"(",
"self",
")",
"-",
">",
"HtmlDCRenderer"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> HtmlDCRenderer"""
_html.HtmlDCRenderer_swiginit(self,_html.new_HtmlDCRenderer(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlDCRenderer_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlDCRenderer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1224-L1226 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/sampcd_processor.py | python | get_api_md5 | (path) | return api_md5 | read the api spec file, and scratch the md5sum value of every api's docstring.
Args:
path: the api spec file. ATTENTION the path relative
Returns:
api_md5(dict): key is the api's real fullname, value is the md5sum. | read the api spec file, and scratch the md5sum value of every api's docstring. | [
"read",
"the",
"api",
"spec",
"file",
"and",
"scratch",
"the",
"md5sum",
"value",
"of",
"every",
"api",
"s",
"docstring",
"."
] | def get_api_md5(path):
"""
read the api spec file, and scratch the md5sum value of every api's docstring.
Args:
path: the api spec file. ATTENTION the path relative
Returns:
api_md5(dict): key is the api's real fullname, value is the md5sum.
"""
api_md5 = {}
API_spec = ... | [
"def",
"get_api_md5",
"(",
"path",
")",
":",
"api_md5",
"=",
"{",
"}",
"API_spec",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"getcwd",
"(",
")",
",",
"\"..\"",
",",
"path",
")",
")",
"if",
"not... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/sampcd_processor.py#L470-L494 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/tool/diff_structures.py | python | DiffStructures.MakeStaticTranslation | (self, original_filename, encoding) | return fname | Given the name of the structure type (self.structure_type), the filename
of the file holding the original structure, and optionally the "section" key
identifying the part of the file to look at (self.section), creates a
temporary file holding a "static" translation of the original structure
(i.e. one wh... | Given the name of the structure type (self.structure_type), the filename
of the file holding the original structure, and optionally the "section" key
identifying the part of the file to look at (self.section), creates a
temporary file holding a "static" translation of the original structure
(i.e. one wh... | [
"Given",
"the",
"name",
"of",
"the",
"structure",
"type",
"(",
"self",
".",
"structure_type",
")",
"the",
"filename",
"of",
"the",
"file",
"holding",
"the",
"original",
"structure",
"and",
"optionally",
"the",
"section",
"key",
"identifying",
"the",
"part",
... | def MakeStaticTranslation(self, original_filename, encoding):
"""Given the name of the structure type (self.structure_type), the filename
of the file holding the original structure, and optionally the "section" key
identifying the part of the file to look at (self.section), creates a
temporary file hold... | [
"def",
"MakeStaticTranslation",
"(",
"self",
",",
"original_filename",
",",
"encoding",
")",
":",
"original",
"=",
"structure",
".",
"_GATHERERS",
"[",
"self",
".",
"structure_type",
"]",
"(",
"original_filename",
",",
"extkey",
"=",
"self",
".",
"section",
",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/tool/diff_structures.py#L87-L114 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/statetracker.py | python | StateTracker.InObjectLiteralDescendant | (self) | return self.OBJECT_LITERAL in self._block_types | Returns true if the current token has an object literal ancestor.
Returns:
True if the current token has an object literal ancestor. | Returns true if the current token has an object literal ancestor. | [
"Returns",
"true",
"if",
"the",
"current",
"token",
"has",
"an",
"object",
"literal",
"ancestor",
"."
] | def InObjectLiteralDescendant(self):
"""Returns true if the current token has an object literal ancestor.
Returns:
True if the current token has an object literal ancestor.
"""
return self.OBJECT_LITERAL in self._block_types | [
"def",
"InObjectLiteralDescendant",
"(",
"self",
")",
":",
"return",
"self",
".",
"OBJECT_LITERAL",
"in",
"self",
".",
"_block_types"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/statetracker.py#L685-L691 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/settings_manager.py | python | apply_optional_callback | (default_value, attribute) | Given a default value, see if it references an attribute callback or not and apply the callback result if so.
Otherwise accept the default value as is
:param default_value: The default value to return or apply the callback for the result
:param attribute: The name of the attribute to apply the value to
... | Given a default value, see if it references an attribute callback or not and apply the callback result if so.
Otherwise accept the default value as is
:param default_value: The default value to return or apply the callback for the result
:param attribute: The name of the attribute to apply the value to
... | [
"Given",
"a",
"default",
"value",
"see",
"if",
"it",
"references",
"an",
"attribute",
"callback",
"or",
"not",
"and",
"apply",
"the",
"callback",
"result",
"if",
"so",
".",
"Otherwise",
"accept",
"the",
"default",
"value",
"as",
"is",
":",
"param",
"defaul... | def apply_optional_callback(default_value, attribute):
"""
Given a default value, see if it references an attribute callback or not and apply the callback result if so.
Otherwise accept the default value as is
:param default_value: The default value to return or apply the callback for the result
:pa... | [
"def",
"apply_optional_callback",
"(",
"default_value",
",",
"attribute",
")",
":",
"if",
"isinstance",
"(",
"default_value",
",",
"str",
")",
"and",
"default_value",
".",
"startswith",
"(",
"'@'",
")",
":",
"value",
"=",
"default_value",
"[",
"1",
":",
"]",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/settings_manager.py#L87-L104 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/package_index.py | python | PackageIndex.fetch | (self, requirement, tmpdir, force_scan=False, source=False) | return None | Obtain a file suitable for fulfilling `requirement`
DEPRECATED; use the ``fetch_distribution()`` method now instead. For
backward compatibility, this routine is identical but returns the
``location`` of the downloaded distribution instead of a distribution
object. | Obtain a file suitable for fulfilling `requirement` | [
"Obtain",
"a",
"file",
"suitable",
"for",
"fulfilling",
"requirement"
] | def fetch(self, requirement, tmpdir, force_scan=False, source=False):
"""Obtain a file suitable for fulfilling `requirement`
DEPRECATED; use the ``fetch_distribution()`` method now instead. For
backward compatibility, this routine is identical but returns the
``location`` of the downlo... | [
"def",
"fetch",
"(",
"self",
",",
"requirement",
",",
"tmpdir",
",",
"force_scan",
"=",
"False",
",",
"source",
"=",
"False",
")",
":",
"dist",
"=",
"self",
".",
"fetch_distribution",
"(",
"requirement",
",",
"tmpdir",
",",
"force_scan",
",",
"source",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/package_index.py#L657-L668 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/PyMol.py | python | MolViewer.GetSelectedAtoms | (self, whichSelection=None) | return items | returns the selected atoms | returns the selected atoms | [
"returns",
"the",
"selected",
"atoms"
] | def GetSelectedAtoms(self, whichSelection=None):
" returns the selected atoms "
if not whichSelection:
sels = self.server.getNames('selections')
if sels:
whichSelection = sels[-1]
else:
whichSelection = None
if whichSelection:
items = self.server.index(whichSelection)... | [
"def",
"GetSelectedAtoms",
"(",
"self",
",",
"whichSelection",
"=",
"None",
")",
":",
"if",
"not",
"whichSelection",
":",
"sels",
"=",
"self",
".",
"server",
".",
"getNames",
"(",
"'selections'",
")",
"if",
"sels",
":",
"whichSelection",
"=",
"sels",
"[",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/PyMol.py#L112-L124 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | Appearance.set | (self, arg2) | return _robotsim.Appearance_set(self, arg2) | set(Appearance self, Appearance arg2)
Copies the appearance of the argument into this appearance. | set(Appearance self, Appearance arg2) | [
"set",
"(",
"Appearance",
"self",
"Appearance",
"arg2",
")"
] | def set(self, arg2):
"""
set(Appearance self, Appearance arg2)
Copies the appearance of the argument into this appearance.
"""
return _robotsim.Appearance_set(self, arg2) | [
"def",
"set",
"(",
"self",
",",
"arg2",
")",
":",
"return",
"_robotsim",
".",
"Appearance_set",
"(",
"self",
",",
"arg2",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L2561-L2570 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | distrib/all/subprocess.py | python | Popen.__init__ | (self, args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
cwd=None, env=None, universal_newlines=False,
startupinfo=None, creationflags=0) | Create new Popen instance. | Create new Popen instance. | [
"Create",
"new",
"Popen",
"instance",
"."
] | def __init__(self, args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
cwd=None, env=None, universal_newlines=False,
startupinfo=None, creationflags=0):
"""Create new Popen inst... | [
"def",
"__init__",
"(",
"self",
",",
"args",
",",
"bufsize",
"=",
"0",
",",
"executable",
"=",
"None",
",",
"stdin",
"=",
"None",
",",
"stdout",
"=",
"None",
",",
"stderr",
"=",
"None",
",",
"preexec_fn",
"=",
"None",
",",
"close_fds",
"=",
"False",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/distrib/all/subprocess.py#L500-L570 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_nn_ops.py | python | get_bprop_prelu | (self) | return bprop | Grad definition for `PReLU` operation. | Grad definition for `PReLU` operation. | [
"Grad",
"definition",
"for",
"PReLU",
"operation",
"."
] | def get_bprop_prelu(self):
"""Grad definition for `PReLU` operation."""
grad = G.PReLUGrad()
def bprop(x, w, out, dout):
dx, dw = grad(dout, x, w)
return dx, dw
return bprop | [
"def",
"get_bprop_prelu",
"(",
"self",
")",
":",
"grad",
"=",
"G",
".",
"PReLUGrad",
"(",
")",
"def",
"bprop",
"(",
"x",
",",
"w",
",",
"out",
",",
"dout",
")",
":",
"dx",
",",
"dw",
"=",
"grad",
"(",
"dout",
",",
"x",
",",
"w",
")",
"return"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_nn_ops.py#L899-L907 | |
jubatus/jubatus | 1251ce551bac980488a6313728e72b3fe0b79a9f | tools/codestyle/cpplint/cpplint.py | python | CheckSpacing | (filename, clean_lines, linenum, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with ... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"raw",
"=",
"clean_lines",
".",
"raw_lines",
"line",
"=",
"raw",
"[",
"linenum",
"]",
"# Before nixing comments, check if the line is blank for no good",
"# reason. Th... | https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L1687-L1930 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | documentation/doxygen/converttonotebook.py | python | processmain | (text) | return text, argumentsCell | Evaluates whether the main function returns a TCanvas or requires input. If it
does then the keepfunction flag is True, meaning the function wont be extracted
by cppFunction. If the initial condition is true then an extra cell is added
before at the end that calls the main function is returned, and added la... | Evaluates whether the main function returns a TCanvas or requires input. If it
does then the keepfunction flag is True, meaning the function wont be extracted
by cppFunction. If the initial condition is true then an extra cell is added
before at the end that calls the main function is returned, and added la... | [
"Evaluates",
"whether",
"the",
"main",
"function",
"returns",
"a",
"TCanvas",
"or",
"requires",
"input",
".",
"If",
"it",
"does",
"then",
"the",
"keepfunction",
"flag",
"is",
"True",
"meaning",
"the",
"function",
"wont",
"be",
"extracted",
"by",
"cppFunction",... | def processmain(text):
"""
Evaluates whether the main function returns a TCanvas or requires input. If it
does then the keepfunction flag is True, meaning the function wont be extracted
by cppFunction. If the initial condition is true then an extra cell is added
before at the end that calls the main... | [
"def",
"processmain",
"(",
"text",
")",
":",
"argumentsCell",
"=",
"''",
"if",
"text",
":",
"argumentsre",
"=",
"re",
".",
"compile",
"(",
"r'(?<=\\().*?(?=\\))'",
",",
"flags",
"=",
"re",
".",
"DOTALL",
"|",
"re",
".",
"MULTILINE",
")",
"arguments",
"="... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/documentation/doxygen/converttonotebook.py#L505-L556 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/CallTips.py | python | CallTips.try_open_calltip_event | (self, event) | Happens when it would be nice to open a CallTip, but not really
necessary, for example after an opening bracket, so function calls
won't be made. | Happens when it would be nice to open a CallTip, but not really
necessary, for example after an opening bracket, so function calls
won't be made. | [
"Happens",
"when",
"it",
"would",
"be",
"nice",
"to",
"open",
"a",
"CallTip",
"but",
"not",
"really",
"necessary",
"for",
"example",
"after",
"an",
"opening",
"bracket",
"so",
"function",
"calls",
"won",
"t",
"be",
"made",
"."
] | def try_open_calltip_event(self, event):
"""Happens when it would be nice to open a CallTip, but not really
necessary, for example after an opening bracket, so function calls
won't be made.
"""
self.open_calltip(False) | [
"def",
"try_open_calltip_event",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"open_calltip",
"(",
"False",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/CallTips.py#L52-L57 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/construction.py | python | init_dict | (data, index, columns, dtype=None) | return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype) | Segregate Series based on type and coerce into matrices.
Needs to handle a lot of exceptional cases. | Segregate Series based on type and coerce into matrices.
Needs to handle a lot of exceptional cases. | [
"Segregate",
"Series",
"based",
"on",
"type",
"and",
"coerce",
"into",
"matrices",
".",
"Needs",
"to",
"handle",
"a",
"lot",
"of",
"exceptional",
"cases",
"."
] | def init_dict(data, index, columns, dtype=None):
"""
Segregate Series based on type and coerce into matrices.
Needs to handle a lot of exceptional cases.
"""
if columns is not None:
from pandas.core.series import Series
arrays = Series(data, index=columns, dtype=object)
data... | [
"def",
"init_dict",
"(",
"data",
",",
"index",
",",
"columns",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"columns",
"is",
"not",
"None",
":",
"from",
"pandas",
".",
"core",
".",
"series",
"import",
"Series",
"arrays",
"=",
"Series",
"(",
"data",
","... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/construction.py#L213-L254 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | VarHScrollHelper.IsColumnVisible | (*args, **kwargs) | return _windows_.VarHScrollHelper_IsColumnVisible(*args, **kwargs) | IsColumnVisible(self, size_t column) -> bool | IsColumnVisible(self, size_t column) -> bool | [
"IsColumnVisible",
"(",
"self",
"size_t",
"column",
")",
"-",
">",
"bool"
] | def IsColumnVisible(*args, **kwargs):
"""IsColumnVisible(self, size_t column) -> bool"""
return _windows_.VarHScrollHelper_IsColumnVisible(*args, **kwargs) | [
"def",
"IsColumnVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarHScrollHelper_IsColumnVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2356-L2358 | |
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | scripts/cpp_lint.py | python | RemoveMultiLineComments | (filename, lines, error) | Removes multiline (c-style) comments from lines. | Removes multiline (c-style) comments from lines. | [
"Removes",
"multiline",
"(",
"c",
"-",
"style",
")",
"comments",
"from",
"lines",
"."
] | def RemoveMultiLineComments(filename, lines, error):
"""Removes multiline (c-style) comments from lines."""
lineix = 0
while lineix < len(lines):
lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
if lineix_begin >= len(lines):
return
lineix_end = FindNextMultiLineCommentEnd(lines, line... | [
"def",
"RemoveMultiLineComments",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"lineix",
"=",
"0",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"lineix_begin",
"=",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
"if",
... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L1151-L1164 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/vault.py | python | Vault.delete | (self) | Delete's this vault. WARNING! | Delete's this vault. WARNING! | [
"Delete",
"s",
"this",
"vault",
".",
"WARNING!"
] | def delete(self):
"""
Delete's this vault. WARNING!
"""
self.layer1.delete_vault(self.name) | [
"def",
"delete",
"(",
"self",
")",
":",
"self",
".",
"layer1",
".",
"delete_vault",
"(",
"self",
".",
"name",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/vault.py#L66-L70 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/python_gflags/gflags.py | python | Flag.SetDefault | (self, value) | Changes the default value (and current value too) for this Flag. | Changes the default value (and current value too) for this Flag. | [
"Changes",
"the",
"default",
"value",
"(",
"and",
"current",
"value",
"too",
")",
"for",
"this",
"Flag",
"."
] | def SetDefault(self, value):
"""Changes the default value (and current value too) for this Flag."""
# We can't allow a None override because it may end up not being
# passed to C++ code when we're overriding C++ flags. So we
# cowardly bail out until someone fixes the semantics of trying to
# pass ... | [
"def",
"SetDefault",
"(",
"self",
",",
"value",
")",
":",
"# We can't allow a None override because it may end up not being",
"# passed to C++ code when we're overriding C++ flags. So we",
"# cowardly bail out until someone fixes the semantics of trying to",
"# pass None to a C++ flag. See s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/python_gflags/gflags.py#L1910-L1928 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py | python | Mailbox.get | (self, key, default=None) | Return the keyed message, or default if it doesn't exist. | Return the keyed message, or default if it doesn't exist. | [
"Return",
"the",
"keyed",
"message",
"or",
"default",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def get(self, key, default=None):
"""Return the keyed message, or default if it doesn't exist."""
try:
return self.__getitem__(key)
except KeyError:
return default | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"__getitem__",
"(",
"key",
")",
"except",
"KeyError",
":",
"return",
"default"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L72-L77 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateSpan_Years | (*args, **kwargs) | return _misc_.DateSpan_Years(*args, **kwargs) | DateSpan_Years(int years) -> DateSpan | DateSpan_Years(int years) -> DateSpan | [
"DateSpan_Years",
"(",
"int",
"years",
")",
"-",
">",
"DateSpan"
] | def DateSpan_Years(*args, **kwargs):
"""DateSpan_Years(int years) -> DateSpan"""
return _misc_.DateSpan_Years(*args, **kwargs) | [
"def",
"DateSpan_Years",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_Years",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4776-L4778 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | BeautifulStoneSoup.__init__ | (self, markup="", parseOnlyThese=None, fromEncoding=None,
markupMassage=True, smartQuotesTo=XML_ENTITIES,
convertEntities=None, selfClosingTags=None, isHTML=False) | The Soup object is initialized as the 'root tag', and the
provided markup (which can be a string or a file-like object)
is fed into the underlying parser.
sgmllib will process most bad HTML, and the BeautifulSoup
class has some tricks for dealing with some HTML that kills
sgmlli... | The Soup object is initialized as the 'root tag', and the
provided markup (which can be a string or a file-like object)
is fed into the underlying parser. | [
"The",
"Soup",
"object",
"is",
"initialized",
"as",
"the",
"root",
"tag",
"and",
"the",
"provided",
"markup",
"(",
"which",
"can",
"be",
"a",
"string",
"or",
"a",
"file",
"-",
"like",
"object",
")",
"is",
"fed",
"into",
"the",
"underlying",
"parser",
"... | def __init__(self, markup="", parseOnlyThese=None, fromEncoding=None,
markupMassage=True, smartQuotesTo=XML_ENTITIES,
convertEntities=None, selfClosingTags=None, isHTML=False):
"""The Soup object is initialized as the 'root tag', and the
provided markup (which can be a ... | [
"def",
"__init__",
"(",
"self",
",",
"markup",
"=",
"\"\"",
",",
"parseOnlyThese",
"=",
"None",
",",
"fromEncoding",
"=",
"None",
",",
"markupMassage",
"=",
"True",
",",
"smartQuotesTo",
"=",
"XML_ENTITIES",
",",
"convertEntities",
"=",
"None",
",",
"selfClo... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L1080-L1147 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/__init__.py | python | Process.nice | (self) | return self.get_nice() | Get or set process niceness (priority).
Deprecated, use get_nice() instead. | Get or set process niceness (priority).
Deprecated, use get_nice() instead. | [
"Get",
"or",
"set",
"process",
"niceness",
"(",
"priority",
")",
".",
"Deprecated",
"use",
"get_nice",
"()",
"instead",
"."
] | def nice(self):
"""Get or set process niceness (priority).
Deprecated, use get_nice() instead.
"""
msg = "this property is deprecated; use Process.get_nice() method instead"
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
return self.get_nice() | [
"def",
"nice",
"(",
"self",
")",
":",
"msg",
"=",
"\"this property is deprecated; use Process.get_nice() method instead\"",
"warnings",
".",
"warn",
"(",
"msg",
",",
"category",
"=",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"self",
".",
"g... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L808-L814 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py | python | Base.scanner_map_delete | (self, kw=None) | Delete the cached scanner map (if we need to). | Delete the cached scanner map (if we need to). | [
"Delete",
"the",
"cached",
"scanner",
"map",
"(",
"if",
"we",
"need",
"to",
")",
"."
] | def scanner_map_delete(self, kw=None):
"""Delete the cached scanner map (if we need to).
"""
try:
del self._memo['_gsm']
except KeyError:
pass | [
"def",
"scanner_map_delete",
"(",
"self",
",",
"kw",
"=",
"None",
")",
":",
"try",
":",
"del",
"self",
".",
"_memo",
"[",
"'_gsm'",
"]",
"except",
"KeyError",
":",
"pass"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py#L1090-L1096 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResource.LoadIcon | (*args, **kwargs) | return _xrc.XmlResource_LoadIcon(*args, **kwargs) | LoadIcon(self, String name) -> Icon | LoadIcon(self, String name) -> Icon | [
"LoadIcon",
"(",
"self",
"String",
"name",
")",
"-",
">",
"Icon"
] | def LoadIcon(*args, **kwargs):
"""LoadIcon(self, String name) -> Icon"""
return _xrc.XmlResource_LoadIcon(*args, **kwargs) | [
"def",
"LoadIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_LoadIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L179-L181 | |
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/bulk_extractor_reader.py | python | get_property_line | (line) | return None | If it is a property line return the (property, value) | If it is a property line return the (property, value) | [
"If",
"it",
"is",
"a",
"property",
"line",
"return",
"the",
"(",
"property",
"value",
")"
] | def get_property_line(line):
"""If it is a property line return the (property, value)"""
if line[0:1]=='#':
m = property_re.search(line)
if m:
return (m.group(1),m.group(2))
return None | [
"def",
"get_property_line",
"(",
"line",
")",
":",
"if",
"line",
"[",
"0",
":",
"1",
"]",
"==",
"'#'",
":",
"m",
"=",
"property_re",
".",
"search",
"(",
"line",
")",
"if",
"m",
":",
"return",
"(",
"m",
".",
"group",
"(",
"1",
")",
",",
"m",
"... | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/bulk_extractor_reader.py#L87-L93 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Simulator.getStatusString | (self, s: int=-1) | return _robotsim.Simulator_getStatusString(self, s) | r"""
Returns a string indicating the simulator's status. If s is provided and >= 0,
this function maps the indicator code s to a string.
Args:
s (int, optional): default value -1 | r"""
Returns a string indicating the simulator's status. If s is provided and >= 0,
this function maps the indicator code s to a string. | [
"r",
"Returns",
"a",
"string",
"indicating",
"the",
"simulator",
"s",
"status",
".",
"If",
"s",
"is",
"provided",
"and",
">",
"=",
"0",
"this",
"function",
"maps",
"the",
"indicator",
"code",
"s",
"to",
"a",
"string",
"."
] | def getStatusString(self, s: int=-1) ->str:
r"""
Returns a string indicating the simulator's status. If s is provided and >= 0,
this function maps the indicator code s to a string.
Args:
s (int, optional): default value -1
"""
return _robotsim.Simulator_get... | [
"def",
"getStatusString",
"(",
"self",
",",
"s",
":",
"int",
"=",
"-",
"1",
")",
"->",
"str",
":",
"return",
"_robotsim",
".",
"Simulator_getStatusString",
"(",
"self",
",",
"s",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7799-L7807 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddPropertiesForNonRepeatedScalarField | (field, cls) | Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits are set as a side-effect, and we also perform
type-checking.... | Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits are set as a side-effect, and we also perform
type-checking. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"nonrepeated",
"scalar",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"and",
"directly",
"set",
"the",
"value",
"of",
"the",
"field",
".",
"Note",
"that",
"whe... | def _AddPropertiesForNonRepeatedScalarField(field, cls):
"""Adds a public property for a nonrepeated, scalar protocol message field.
Clients can use this property to get and directly set the value of the field.
Note that when the client sets the value of a field by using this property,
all necessary "has" bits ... | [
"def",
"_AddPropertiesForNonRepeatedScalarField",
"(",
"field",
",",
"cls",
")",
":",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_field_name",
")",
"type_checker",
"=",
"type_checkers",
".",
"GetTypeChecker",
"(",
... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L489-L521 | ||
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/schema.py | python | _select_cols | (val, select_fields) | return tuple(ret) | 内部函数 | 内部函数 | [
"内部函数"
] | def _select_cols(val, select_fields):
""" 内部函数 """
def _get_field(field):
return val.map(lambda v: v[field],
serde=_get_serde_of_field(
val.serde(),
field,
val.pipeline().default_objector()))
r... | [
"def",
"_select_cols",
"(",
"val",
",",
"select_fields",
")",
":",
"def",
"_get_field",
"(",
"field",
")",
":",
"return",
"val",
".",
"map",
"(",
"lambda",
"v",
":",
"v",
"[",
"field",
"]",
",",
"serde",
"=",
"_get_serde_of_field",
"(",
"val",
".",
"... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/schema.py#L114-L124 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBDebugger.GetNumCategories | (self) | return _lldb.SBDebugger_GetNumCategories(self) | GetNumCategories(self) -> uint32_t | GetNumCategories(self) -> uint32_t | [
"GetNumCategories",
"(",
"self",
")",
"-",
">",
"uint32_t"
] | def GetNumCategories(self):
"""GetNumCategories(self) -> uint32_t"""
return _lldb.SBDebugger_GetNumCategories(self) | [
"def",
"GetNumCategories",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_GetNumCategories",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3495-L3497 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/reflection.py | python | _AddInitMethod | (message_descriptor, cls) | Adds an __init__ method to cls. | Adds an __init__ method to cls. | [
"Adds",
"an",
"__init__",
"method",
"to",
"cls",
"."
] | def _AddInitMethod(message_descriptor, cls):
"""Adds an __init__ method to cls."""
fields = message_descriptor.fields
def init(self, **kwargs):
self._cached_byte_size = 0
self._cached_byte_size_dirty = False
self._listener = message_listener_mod.NullMessageListener()
self._called_transition_to_non... | [
"def",
"_AddInitMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"fields",
"=",
"message_descriptor",
".",
"fields",
"def",
"init",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_cached_byte_size",
"=",
"0",
"self",
".",
"_cached_b... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L292-L316 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | modules/thermal_hydraulics/python/peacock/UnitConversion.py | python | Unit.name | (self) | return None | Human readable name of the unit
@return[string] Unit name | Human readable name of the unit | [
"Human",
"readable",
"name",
"of",
"the",
"unit"
] | def name(self):
"""
Human readable name of the unit
@return[string] Unit name
"""
return None | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/modules/thermal_hydraulics/python/peacock/UnitConversion.py#L15-L21 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/seq2seq.py | python | tied_rnn_seq2seq | (encoder_inputs, decoder_inputs, cell,
loop_function=None, dtype=dtypes.float32, scope=None) | RNN sequence-to-sequence model with tied encoder and decoder parameters.
This model first runs an RNN to encode encoder_inputs into a state vector, and
then runs decoder, initialized with the last encoder state, on decoder_inputs.
Encoder and decoder use the same RNN cell and share parameters.
Args:
encod... | RNN sequence-to-sequence model with tied encoder and decoder parameters. | [
"RNN",
"sequence",
"-",
"to",
"-",
"sequence",
"model",
"with",
"tied",
"encoder",
"and",
"decoder",
"parameters",
"."
] | def tied_rnn_seq2seq(encoder_inputs, decoder_inputs, cell,
loop_function=None, dtype=dtypes.float32, scope=None):
"""RNN sequence-to-sequence model with tied encoder and decoder parameters.
This model first runs an RNN to encode encoder_inputs into a state vector, and
then runs decoder, init... | [
"def",
"tied_rnn_seq2seq",
"(",
"encoder_inputs",
",",
"decoder_inputs",
",",
"cell",
",",
"loop_function",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"scope",
"=",
"None",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/seq2seq.py#L179-L211 | ||
google/shaka-player-embedded | dabbeb5b47cc257b37b9a254661546352aaf0afe | shaka/tools/webidl/webidl/parser.py | python | IdlParser.p_StringType | (self, p) | return types.IdlType(
name=p[1], nullable=False, element_type=None, extensions=[]) | r"""StringType : BYTESTRING
| DOMSTRING
| USVSTRING | r"""StringType : BYTESTRING
| DOMSTRING
| USVSTRING | [
"r",
"StringType",
":",
"BYTESTRING",
"|",
"DOMSTRING",
"|",
"USVSTRING"
] | def p_StringType(self, p):
r"""StringType : BYTESTRING
| DOMSTRING
| USVSTRING"""
return types.IdlType(
name=p[1], nullable=False, element_type=None, extensions=[]) | [
"def",
"p_StringType",
"(",
"self",
",",
"p",
")",
":",
"return",
"types",
".",
"IdlType",
"(",
"name",
"=",
"p",
"[",
"1",
"]",
",",
"nullable",
"=",
"False",
",",
"element_type",
"=",
"None",
",",
"extensions",
"=",
"[",
"]",
")"
] | https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/webidl/webidl/parser.py#L436-L441 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/experiment.py | python | Experiment.extend_train_hooks | (self, additional_hooks) | Extends the hooks for training. | Extends the hooks for training. | [
"Extends",
"the",
"hooks",
"for",
"training",
"."
] | def extend_train_hooks(self, additional_hooks):
"""Extends the hooks for training."""
self._train_monitors.extend(additional_hooks) | [
"def",
"extend_train_hooks",
"(",
"self",
",",
"additional_hooks",
")",
":",
"self",
".",
"_train_monitors",
".",
"extend",
"(",
"additional_hooks",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/experiment.py#L293-L295 | ||
keyboardio/Kaleidoscope | d59604e98b2439d108647f15be52984a6837d360 | bin/cpplint.py | python | FindEndOfExpressionInLine | (line, startpos, stack) | return (-1, stack) | Find the position just after the end of current parenthesized expression.
Args:
line: a CleansedLines line.
startpos: start searching at this position.
stack: nesting stack at startpos.
Returns:
On finding matching end: (index just after matching end, None)
On finding an unclosed expression: (... | Find the position just after the end of current parenthesized expression. | [
"Find",
"the",
"position",
"just",
"after",
"the",
"end",
"of",
"current",
"parenthesized",
"expression",
"."
] | def FindEndOfExpressionInLine(line, startpos, stack):
"""Find the position just after the end of current parenthesized expression.
Args:
line: a CleansedLines line.
startpos: start searching at this position.
stack: nesting stack at startpos.
Returns:
On finding matching end: (index just after m... | [
"def",
"FindEndOfExpressionInLine",
"(",
"line",
",",
"startpos",
",",
"stack",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"startpos",
",",
"len",
"(",
"line",
")",
")",
":",
"char",
"=",
"line",
"[",
"i",
"]",
"if",
"char",
"in",
"'([{'",
":",
"# ... | https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1735-L1810 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | GetOsDescription | (*args) | return _misc_.GetOsDescription(*args) | GetOsDescription() -> String | GetOsDescription() -> String | [
"GetOsDescription",
"()",
"-",
">",
"String"
] | def GetOsDescription(*args):
"""GetOsDescription() -> String"""
return _misc_.GetOsDescription(*args) | [
"def",
"GetOsDescription",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"GetOsDescription",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L340-L342 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/symbol/symbol.py | python | Symbol.prod | (self, *args, **kwargs) | return op.prod(self, *args, **kwargs) | Convenience fluent method for :py:func:`prod`.
The arguments are the same as for :py:func:`prod`, with
this array as data. | Convenience fluent method for :py:func:`prod`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"prod",
"."
] | def prod(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`prod`.
The arguments are the same as for :py:func:`prod`, with
this array as data.
"""
return op.prod(self, *args, **kwargs) | [
"def",
"prod",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"prod",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L1999-L2005 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | api-reference-examples/python/pytx/pytx/batch.py | python | Batch.__init__ | (self, **kwargs) | Initialized the object. | Initialized the object. | [
"Initialized",
"the",
"object",
"."
] | def __init__(self, **kwargs):
"""
Initialized the object.
""" | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":"
] | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/batch.py#L20-L23 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | BookCtrlBase.DeletePage | (*args, **kwargs) | return _core_.BookCtrlBase_DeletePage(*args, **kwargs) | DeletePage(self, size_t n) -> bool | DeletePage(self, size_t n) -> bool | [
"DeletePage",
"(",
"self",
"size_t",
"n",
")",
"-",
">",
"bool"
] | def DeletePage(*args, **kwargs):
"""DeletePage(self, size_t n) -> bool"""
return _core_.BookCtrlBase_DeletePage(*args, **kwargs) | [
"def",
"DeletePage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_DeletePage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13606-L13608 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | utils/lit/lit/run.py | python | Run.execute_tests | (self, display, jobs, max_time=None) | execute_tests(display, jobs, [max_time])
Execute each of the tests in the run, using up to jobs number of
parallel tasks, and inform the display of each individual result. The
provided tests should be a subset of the tests available in this run
object.
If max_time is non-None, ... | execute_tests(display, jobs, [max_time]) | [
"execute_tests",
"(",
"display",
"jobs",
"[",
"max_time",
"]",
")"
] | def execute_tests(self, display, jobs, max_time=None):
"""
execute_tests(display, jobs, [max_time])
Execute each of the tests in the run, using up to jobs number of
parallel tasks, and inform the display of each individual result. The
provided tests should be a subset of the tes... | [
"def",
"execute_tests",
"(",
"self",
",",
"display",
",",
"jobs",
",",
"max_time",
"=",
"None",
")",
":",
"# Don't do anything if we aren't going to run any tests.",
"if",
"not",
"self",
".",
"tests",
"or",
"jobs",
"==",
"0",
":",
"return",
"# Save the display obj... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/utils/lit/lit/run.py#L114-L157 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ItemContainer.InsertItems | (*args, **kwargs) | return _core_.ItemContainer_InsertItems(*args, **kwargs) | InsertItems(self, List strings, int pos) --> int
Inserts several items at once into the control. Returns the index of
the last item inserted. | InsertItems(self, List strings, int pos) --> int | [
"InsertItems",
"(",
"self",
"List",
"strings",
"int",
"pos",
")",
"--",
">",
"int"
] | def InsertItems(*args, **kwargs):
"""
InsertItems(self, List strings, int pos) --> int
Inserts several items at once into the control. Returns the index of
the last item inserted.
"""
return _core_.ItemContainer_InsertItems(*args, **kwargs) | [
"def",
"InsertItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ItemContainer_InsertItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12885-L12892 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/sql.py | python | SQLTable._query_iterator | (
self, result, chunksize, columns, coerce_float=True, parse_dates=None
) | Return generator through chunked result set. | Return generator through chunked result set. | [
"Return",
"generator",
"through",
"chunked",
"result",
"set",
"."
] | def _query_iterator(
self, result, chunksize, columns, coerce_float=True, parse_dates=None
):
"""Return generator through chunked result set."""
while True:
data = result.fetchmany(chunksize)
if not data:
break
else:
self.f... | [
"def",
"_query_iterator",
"(",
"self",
",",
"result",
",",
"chunksize",
",",
"columns",
",",
"coerce_float",
"=",
"True",
",",
"parse_dates",
"=",
"None",
")",
":",
"while",
"True",
":",
"data",
"=",
"result",
".",
"fetchmany",
"(",
"chunksize",
")",
"if... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/sql.py#L757-L776 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | Tag.__eq__ | (self, other) | return True | Returns true iff this tag has the same name, the same attributes,
and the same contents (recursively) as the given tag.
NOTE: right now this will return false if two tags have the
same attributes in a different order. Should this be fixed? | Returns true iff this tag has the same name, the same attributes,
and the same contents (recursively) as the given tag. | [
"Returns",
"true",
"iff",
"this",
"tag",
"has",
"the",
"same",
"name",
"the",
"same",
"attributes",
"and",
"the",
"same",
"contents",
"(",
"recursively",
")",
"as",
"the",
"given",
"tag",
"."
] | def __eq__(self, other):
"""Returns true iff this tag has the same name, the same attributes,
and the same contents (recursively) as the given tag.
NOTE: right now this will return false if two tags have the
same attributes in a different order. Should this be fixed?"""
if other... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"is",
"self",
":",
"return",
"True",
"if",
"not",
"hasattr",
"(",
"other",
",",
"'name'",
")",
"or",
"not",
"hasattr",
"(",
"other",
",",
"'attrs'",
")",
"or",
"not",
"hasattr",
"... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L657-L670 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.terminate | (self, force=False) | This forces a child process to terminate. It starts nicely with
SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
returns True if the child was terminated. This returns False if the
child could not be terminated. | This forces a child process to terminate. It starts nicely with
SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
returns True if the child was terminated. This returns False if the
child could not be terminated. | [
"This",
"forces",
"a",
"child",
"process",
"to",
"terminate",
".",
"It",
"starts",
"nicely",
"with",
"SIGHUP",
"and",
"SIGINT",
".",
"If",
"force",
"is",
"True",
"then",
"moves",
"onto",
"SIGKILL",
".",
"This",
"returns",
"True",
"if",
"the",
"child",
"w... | def terminate(self, force=False):
'''This forces a child process to terminate. It starts nicely with
SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
returns True if the child was terminated. This returns False if the
child could not be terminated. '''
if not ... | [
"def",
"terminate",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"isalive",
"(",
")",
":",
"return",
"True",
"try",
":",
"self",
".",
"kill",
"(",
"signal",
".",
"SIGHUP",
")",
"time",
".",
"sleep",
"(",
"self",
".... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L616-L654 | ||
tiny-dnn/tiny-dnn | c0f576f5cb7b35893f62127cb7aec18f77a3bcc5 | examples/char_rnn/python/utils/encoder.py | python | Encoder.encode | (self, input, output) | Encodes input with the dictionary
Args:
input: input string to encode
output: string output path | Encodes input with the dictionary
Args:
input: input string to encode
output: string output path | [
"Encodes",
"input",
"with",
"the",
"dictionary",
"Args",
":",
"input",
":",
"input",
"string",
"to",
"encode",
"output",
":",
"string",
"output",
"path"
] | def encode(self, input, output):
"""
Encodes input with the dictionary
Args:
input: input string to encode
output: string output path
"""
assert (len(self.dec_dict) > 0 and len(self.enc_dict.keys()) > 0)
with io.FileIO(output.split('.')[0] + '.raw'... | [
"def",
"encode",
"(",
"self",
",",
"input",
",",
"output",
")",
":",
"assert",
"(",
"len",
"(",
"self",
".",
"dec_dict",
")",
">",
"0",
"and",
"len",
"(",
"self",
".",
"enc_dict",
".",
"keys",
"(",
")",
")",
">",
"0",
")",
"with",
"io",
".",
... | https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/examples/char_rnn/python/utils/encoder.py#L60-L70 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/server.py | python | CGIHTTPRequestHandler.send_head | (self) | Version of send_head that support CGI scripts | Version of send_head that support CGI scripts | [
"Version",
"of",
"send_head",
"that",
"support",
"CGI",
"scripts"
] | def send_head(self):
"""Version of send_head that support CGI scripts"""
if self.is_cgi():
return self.run_cgi()
else:
return SimpleHTTPRequestHandler.send_head(self) | [
"def",
"send_head",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_cgi",
"(",
")",
":",
"return",
"self",
".",
"run_cgi",
"(",
")",
"else",
":",
"return",
"SimpleHTTPRequestHandler",
".",
"send_head",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/server.py#L985-L990 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/io_ops.py | python | ReaderBase.read_up_to | (self, queue, num_records, # pylint: disable=invalid-name
name=None) | Returns up to num_records (key, value) pairs produced by a reader.
Will dequeue a work unit from queue if necessary (e.g., when the
Reader needs to start reading from a new file since it has
finished with the previous file).
It may return less than num_records even before the last batch.
Args:
... | Returns up to num_records (key, value) pairs produced by a reader. | [
"Returns",
"up",
"to",
"num_records",
"(",
"key",
"value",
")",
"pairs",
"produced",
"by",
"a",
"reader",
"."
] | def read_up_to(self, queue, num_records, # pylint: disable=invalid-name
name=None):
"""Returns up to num_records (key, value) pairs produced by a reader.
Will dequeue a work unit from queue if necessary (e.g., when the
Reader needs to start reading from a new file since it has
finishe... | [
"def",
"read_up_to",
"(",
"self",
",",
"queue",
",",
"num_records",
",",
"# pylint: disable=invalid-name",
"name",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"queue",
",",
"ops",
".",
"Tensor",
")",
":",
"queue_ref",
"=",
"queue",
"else",
":",
"queue_... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/io_ops.py#L202-L238 | ||
xiaohaoChen/rrc_detection | 4f2b110cd122da7f55e8533275a9b4809a88785a | scripts/download_model_binary.py | python | reporthook | (count, block_size, total_size) | From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ | From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ | [
"From",
"http",
":",
"//",
"blog",
".",
"moleculea",
".",
"com",
"/",
"2012",
"/",
"10",
"/",
"04",
"/",
"urlretrieve",
"-",
"progres",
"-",
"indicator",
"/"
] | def reporthook(count, block_size, total_size):
"""
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
"""
global start_time
if count == 0:
start_time = time.time()
return
duration = (time.time() - start_time) or 0.01
progress_size = int(count * block_siz... | [
"def",
"reporthook",
"(",
"count",
",",
"block_size",
",",
"total_size",
")",
":",
"global",
"start_time",
"if",
"count",
"==",
"0",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"return",
"duration",
"=",
"(",
"time",
".",
"time",
"(",
")",
... | https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/scripts/download_model_binary.py#L13-L27 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py | python | OperatorPDIdentity.verify_pd | (self) | return self._verify_pd | Whether to verify that this `Operator` is positive definite. | Whether to verify that this `Operator` is positive definite. | [
"Whether",
"to",
"verify",
"that",
"this",
"Operator",
"is",
"positive",
"definite",
"."
] | def verify_pd(self):
"""Whether to verify that this `Operator` is positive definite."""
return self._verify_pd | [
"def",
"verify_pd",
"(",
"self",
")",
":",
"return",
"self",
".",
"_verify_pd"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py#L129-L131 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | report_failure | (opts) | Create report when analyzer failed.
The major report is the preprocessor output. The output filename generated
randomly. The compiler output also captured into '.stderr.txt' file.
And some more execution context also saved into '.info.txt' file. | Create report when analyzer failed. | [
"Create",
"report",
"when",
"analyzer",
"failed",
"."
] | def report_failure(opts):
""" Create report when analyzer failed.
The major report is the preprocessor output. The output filename generated
randomly. The compiler output also captured into '.stderr.txt' file.
And some more execution context also saved into '.info.txt' file. """
def extension():
... | [
"def",
"report_failure",
"(",
"opts",
")",
":",
"def",
"extension",
"(",
")",
":",
"\"\"\" Generate preprocessor file extension. \"\"\"",
"mapping",
"=",
"{",
"'objective-c++'",
":",
"'.mii'",
",",
"'objective-c'",
":",
"'.mi'",
",",
"'c++'",
":",
"'.ii'",
"}",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libscanbuild/analyze.py#L466-L519 | ||
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/scripts/build_binaries.py | python | build_binaries.board_options | (self, board) | return [] | return board-specific options | return board-specific options | [
"return",
"board",
"-",
"specific",
"options"
] | def board_options(self, board):
'''return board-specific options'''
if board in ["bebop", "disco"]:
return ["--static"]
return [] | [
"def",
"board_options",
"(",
"self",
",",
"board",
")",
":",
"if",
"board",
"in",
"[",
"\"bebop\"",
",",
"\"disco\"",
"]",
":",
"return",
"[",
"\"--static\"",
"]",
"return",
"[",
"]"
] | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/build_binaries.py#L89-L93 | |
bristolcrypto/SPDZ-2 | 721abfae849625a02ea49aabc534f9cf41ca643f | Compiler/program.py | python | Program.read_memory | (self, filename) | Read the clear and shared memory from a file | Read the clear and shared memory from a file | [
"Read",
"the",
"clear",
"and",
"shared",
"memory",
"from",
"a",
"file"
] | def read_memory(self, filename):
""" Read the clear and shared memory from a file """
f = open(filename)
n = int(f.next())
self.mem_c = [0]*n
self.mem_s = [0]*n
mem = self.mem_c
done_c = False
for line in f:
line = line.split(' ')
a... | [
"def",
"read_memory",
"(",
"self",
",",
"filename",
")",
":",
"f",
"=",
"open",
"(",
"filename",
")",
"n",
"=",
"int",
"(",
"f",
".",
"next",
"(",
")",
")",
"self",
".",
"mem_c",
"=",
"[",
"0",
"]",
"*",
"n",
"self",
".",
"mem_s",
"=",
"[",
... | https://github.com/bristolcrypto/SPDZ-2/blob/721abfae849625a02ea49aabc534f9cf41ca643f/Compiler/program.py#L194-L212 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/stats.py | python | fisher_exact | (table, alternative='two-sided') | return oddsratio, pvalue | Performs a Fisher exact test on a 2x2 contingency table.
Parameters
----------
table : array_like of ints
A 2x2 contingency table. Elements should be non-negative integers.
alternative : {'two-sided', 'less', 'greater'}, optional
Which alternative hypothesis to the null hypothesis the ... | Performs a Fisher exact test on a 2x2 contingency table. | [
"Performs",
"a",
"Fisher",
"exact",
"test",
"on",
"a",
"2x2",
"contingency",
"table",
"."
] | def fisher_exact(table, alternative='two-sided'):
"""Performs a Fisher exact test on a 2x2 contingency table.
Parameters
----------
table : array_like of ints
A 2x2 contingency table. Elements should be non-negative integers.
alternative : {'two-sided', 'less', 'greater'}, optional
... | [
"def",
"fisher_exact",
"(",
"table",
",",
"alternative",
"=",
"'two-sided'",
")",
":",
"hypergeom",
"=",
"distributions",
".",
"hypergeom",
"c",
"=",
"np",
".",
"asarray",
"(",
"table",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
"# int32 is not enough for t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/stats.py#L3044-L3201 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py | python | wrap_index | (typingctx, idx, size) | return signature(unified_ty, idx, size), codegen | Calculate index value "idx" relative to a size "size" value as
(idx % size), where "size" is known to be positive.
Note that we use the mod(%) operation here instead of
(idx < 0 ? idx + size : idx) because we may have situations
where idx > size due to the way indices are calculated
during slice/ran... | Calculate index value "idx" relative to a size "size" value as
(idx % size), where "size" is known to be positive.
Note that we use the mod(%) operation here instead of
(idx < 0 ? idx + size : idx) because we may have situations
where idx > size due to the way indices are calculated
during slice/ran... | [
"Calculate",
"index",
"value",
"idx",
"relative",
"to",
"a",
"size",
"size",
"value",
"as",
"(",
"idx",
"%",
"size",
")",
"where",
"size",
"is",
"known",
"to",
"be",
"positive",
".",
"Note",
"that",
"we",
"use",
"the",
"mod",
"(",
"%",
")",
"operatio... | def wrap_index(typingctx, idx, size):
"""
Calculate index value "idx" relative to a size "size" value as
(idx % size), where "size" is known to be positive.
Note that we use the mod(%) operation here instead of
(idx < 0 ? idx + size : idx) because we may have situations
where idx > size due to t... | [
"def",
"wrap_index",
"(",
"typingctx",
",",
"idx",
",",
"size",
")",
":",
"unified_ty",
"=",
"typingctx",
".",
"unify_types",
"(",
"idx",
",",
"size",
")",
"if",
"not",
"unified_ty",
":",
"raise",
"ValueError",
"(",
"\"Argument types for wrap_index must match\""... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py#L62-L89 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | Index.read | (self, path) | return TranslationUnit.from_ast_file(path, self) | Load a TranslationUnit from the given AST file. | Load a TranslationUnit from the given AST file. | [
"Load",
"a",
"TranslationUnit",
"from",
"the",
"given",
"AST",
"file",
"."
] | def read(self, path):
"""Load a TranslationUnit from the given AST file."""
return TranslationUnit.from_ast_file(path, self) | [
"def",
"read",
"(",
"self",
",",
"path",
")",
":",
"return",
"TranslationUnit",
".",
"from_ast_file",
"(",
"path",
",",
"self",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L2703-L2705 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/console/ironpython_console.py | python | Console.cursor | (self, visible=True, size=None) | Set cursor on or off. | Set cursor on or off. | [
"Set",
"cursor",
"on",
"or",
"off",
"."
] | def cursor(self, visible=True, size=None):
'''Set cursor on or off.'''
System.Console.CursorVisible = visible | [
"def",
"cursor",
"(",
"self",
",",
"visible",
"=",
"True",
",",
"size",
"=",
"None",
")",
":",
"System",
".",
"Console",
".",
"CursorVisible",
"=",
"visible"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/console/ironpython_console.py#L359-L361 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pluggy/py2/pluggy/callers.py | python | _Result.get_result | (self) | Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned otherwise a list of results. | Get the result(s) for this hook call. | [
"Get",
"the",
"result",
"(",
"s",
")",
"for",
"this",
"hook",
"call",
"."
] | def get_result(self):
"""Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned otherwise a list of results.
"""
__tracebackhide__ = True
if self._excinfo is None:
return self._result
els... | [
"def",
"get_result",
"(",
"self",
")",
":",
"__tracebackhide__",
"=",
"True",
"if",
"self",
".",
"_excinfo",
"is",
"None",
":",
"return",
"self",
".",
"_result",
"else",
":",
"ex",
"=",
"self",
".",
"_excinfo",
"if",
"_py3",
":",
"raise",
"ex",
"[",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pluggy/py2/pluggy/callers.py#L68-L81 | ||
GrammaTech/gtirb | 415dd72e1e3c475004d013723c16cdcb29c0826e | python/gtirb/ir.py | python | IR.cfg_nodes | (self) | return itertools.chain.from_iterable(m.cfg_nodes for m in self.modules) | The :class:`CfgNode`\\s in this IR. | The :class:`CfgNode`\\s in this IR. | [
"The",
":",
"class",
":",
"CfgNode",
"\\\\",
"s",
"in",
"this",
"IR",
"."
] | def cfg_nodes(self) -> typing.Iterator[CfgNode]:
"""The :class:`CfgNode`\\s in this IR."""
return itertools.chain.from_iterable(m.cfg_nodes for m in self.modules) | [
"def",
"cfg_nodes",
"(",
"self",
")",
"->",
"typing",
".",
"Iterator",
"[",
"CfgNode",
"]",
":",
"return",
"itertools",
".",
"chain",
".",
"from_iterable",
"(",
"m",
".",
"cfg_nodes",
"for",
"m",
"in",
"self",
".",
"modules",
")"
] | https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/ir.py#L242-L245 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | execer.py | python | execipynb | (filename, glb=None, loc=None) | A function equivalent to the Python 2.x execfile statement but for IPython
notebooks. | A function equivalent to the Python 2.x execfile statement but for IPython
notebooks. | [
"A",
"function",
"equivalent",
"to",
"the",
"Python",
"2",
".",
"x",
"execfile",
"statement",
"but",
"for",
"IPython",
"notebooks",
"."
] | def execipynb(filename, glb=None, loc=None):
"""A function equivalent to the Python 2.x execfile statement but for IPython
notebooks."""
glb = {} if glb is None else glb
glb['get_ipython'] = get_ipython
out = NamedTemporaryFile()
err = NamedTemporaryFile()
env = os.environ.copy()
env['T... | [
"def",
"execipynb",
"(",
"filename",
",",
"glb",
"=",
"None",
",",
"loc",
"=",
"None",
")",
":",
"glb",
"=",
"{",
"}",
"if",
"glb",
"is",
"None",
"else",
"glb",
"glb",
"[",
"'get_ipython'",
"]",
"=",
"get_ipython",
"out",
"=",
"NamedTemporaryFile",
"... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/execer.py#L23-L39 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewEvent.GetColumn | (*args, **kwargs) | return _dataview.DataViewEvent_GetColumn(*args, **kwargs) | GetColumn(self) -> int | GetColumn(self) -> int | [
"GetColumn",
"(",
"self",
")",
"-",
">",
"int"
] | def GetColumn(*args, **kwargs):
"""GetColumn(self) -> int"""
return _dataview.DataViewEvent_GetColumn(*args, **kwargs) | [
"def",
"GetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewEvent_GetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1908-L1910 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/client/session.py | python | Session.reset | (target, containers=None, config=None) | Resets resource containers on `target`, and close all connected sessions.
A resource container is distributed across all workers in the
same cluster as `target`. When a resource container on `target`
is reset, resources associated with that container will be cleared.
In particular, all Variables in th... | Resets resource containers on `target`, and close all connected sessions. | [
"Resets",
"resource",
"containers",
"on",
"target",
"and",
"close",
"all",
"connected",
"sessions",
"."
] | def reset(target, containers=None, config=None):
"""Resets resource containers on `target`, and close all connected sessions.
A resource container is distributed across all workers in the
same cluster as `target`. When a resource container on `target`
is reset, resources associated with that container... | [
"def",
"reset",
"(",
"target",
",",
"containers",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"if",
"target",
"is",
"not",
"None",
":",
"target",
"=",
"compat",
".",
"as_bytes",
"(",
"target",
")",
"if",
"containers",
"is",
"not",
"None",
":",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/client/session.py#L1512-L1543 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py | python | print_environ_usage | () | Dump a list of environment variables used by CGI as HTML. | Dump a list of environment variables used by CGI as HTML. | [
"Dump",
"a",
"list",
"of",
"environment",
"variables",
"used",
"by",
"CGI",
"as",
"HTML",
"."
] | def print_environ_usage():
"""Dump a list of environment variables used by CGI as HTML."""
print """
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTER... | [
"def",
"print_environ_usage",
"(",
")",
":",
"print",
"\"\"\"\n<H3>These environment variables could have been set:</H3>\n<UL>\n<LI>AUTH_TYPE\n<LI>CONTENT_LENGTH\n<LI>CONTENT_TYPE\n<LI>DATE_GMT\n<LI>DATE_LOCAL\n<LI>DOCUMENT_NAME\n<LI>DOCUMENT_ROOT\n<LI>DOCUMENT_URI\n<LI>GATEWAY_INTERFACE\n<LI>LAST_MODIF... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py#L983-L1024 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/282.expression-add-operators.py | python | Solution.addOperators | (self, num, target) | return res | :type num: str
:type target: int
:rtype: List[str] | :type num: str
:type target: int
:rtype: List[str] | [
":",
"type",
"num",
":",
"str",
":",
"type",
"target",
":",
"int",
":",
"rtype",
":",
"List",
"[",
"str",
"]"
] | def addOperators(self, num, target):
"""
:type num: str
:type target: int
:rtype: List[str]
"""
if num is None or len(num) == 0:
return []
self.num = num
self.target = target
res = []
self.dfs(0, 0, 0, '', res)
retur... | [
"def",
"addOperators",
"(",
"self",
",",
"num",
",",
"target",
")",
":",
"if",
"num",
"is",
"None",
"or",
"len",
"(",
"num",
")",
"==",
"0",
":",
"return",
"[",
"]",
"self",
".",
"num",
"=",
"num",
"self",
".",
"target",
"=",
"target",
"res",
"... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/282.expression-add-operators.py#L7-L23 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/evaluation.py | python | _MultiStepStopAfterNEvalsHook.__init__ | (self, num_evals, steps_per_run=1) | Constructs the run hook.
Args:
num_evals: The number of evaluations to run for. if set to None, will
iterate the dataset until all inputs are exhausted.
steps_per_run: Number of steps executed per run call. | Constructs the run hook. | [
"Constructs",
"the",
"run",
"hook",
"."
] | def __init__(self, num_evals, steps_per_run=1):
"""Constructs the run hook.
Args:
num_evals: The number of evaluations to run for. if set to None, will
iterate the dataset until all inputs are exhausted.
steps_per_run: Number of steps executed per run call.
"""
self._num_evals = num... | [
"def",
"__init__",
"(",
"self",
",",
"num_evals",
",",
"steps_per_run",
"=",
"1",
")",
":",
"self",
".",
"_num_evals",
"=",
"num_evals",
"self",
".",
"_evals_completed",
"=",
"None",
"self",
".",
"_steps_per_run_initial_value",
"=",
"steps_per_run"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/evaluation.py#L84-L94 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_pathtwistedarray.py | python | PathTwistedLinkArray.GetResources | (self) | return {'Pixmap': 'Draft_PathTwistedLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Path twisted Link array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Like the PathTwistedArray tool, but creates a 'Link array' instead.\nA 'Link array' is more ef... | Set icon, menu and tooltip. | Set icon, menu and tooltip. | [
"Set",
"icon",
"menu",
"and",
"tooltip",
"."
] | def GetResources(self):
"""Set icon, menu and tooltip."""
return {'Pixmap': 'Draft_PathTwistedLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Path twisted Link array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Like the PathTwiste... | [
"def",
"GetResources",
"(",
"self",
")",
":",
"return",
"{",
"'Pixmap'",
":",
"'Draft_PathTwistedLinkArray'",
",",
"'MenuText'",
":",
"QT_TRANSLATE_NOOP",
"(",
"\"Draft_PathTwistedLinkArray\"",
",",
"\"Path twisted Link array\"",
")",
",",
"'ToolTip'",
":",
"QT_TRANSLAT... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py#L117-L122 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TMemIn.__init__ | (self, *args) | __init__(TMemIn self, TMem _Mem, int const & _BfC=0) -> TMemIn
Parameters:
_Mem: TMem const &
_BfC: int const &
__init__(TMemIn self, TMem _Mem) -> TMemIn
Parameters:
_Mem: TMem const & | __init__(TMemIn self, TMem _Mem, int const & _BfC=0) -> TMemIn | [
"__init__",
"(",
"TMemIn",
"self",
"TMem",
"_Mem",
"int",
"const",
"&",
"_BfC",
"=",
"0",
")",
"-",
">",
"TMemIn"
] | def __init__(self, *args):
"""
__init__(TMemIn self, TMem _Mem, int const & _BfC=0) -> TMemIn
Parameters:
_Mem: TMem const &
_BfC: int const &
__init__(TMemIn self, TMem _Mem) -> TMemIn
Parameters:
_Mem: TMem const &
"""
_s... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_snap",
".",
"TMemIn_swiginit",
"(",
"self",
",",
"_snap",
".",
"new_TMemIn",
"(",
"*",
"args",
")",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L8346-L8360 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/external/bazel_tools/tools/objc/j2objc_dead_code_pruner.py | python | BuildReachableFileSet | (entry_classes, reachability_tree, header_mapping,
archive_source_file_mapping=None) | return reachable_files | Builds a set of reachable translated files from entry Java classes.
Args:
entry_classes: A comma separated list of Java entry classes.
reachability_tree: A dict mapping translated files to their direct
dependencies.
header_mapping: A dict mapping Java class names to translated source files.
a... | Builds a set of reachable translated files from entry Java classes. | [
"Builds",
"a",
"set",
"of",
"reachable",
"translated",
"files",
"from",
"entry",
"Java",
"classes",
"."
] | def BuildReachableFileSet(entry_classes, reachability_tree, header_mapping,
archive_source_file_mapping=None):
"""Builds a set of reachable translated files from entry Java classes.
Args:
entry_classes: A comma separated list of Java entry classes.
reachability_tree: A dict mappin... | [
"def",
"BuildReachableFileSet",
"(",
"entry_classes",
",",
"reachability_tree",
",",
"header_mapping",
",",
"archive_source_file_mapping",
"=",
"None",
")",
":",
"transpiled_entry_files",
"=",
"[",
"]",
"for",
"entry_class",
"in",
"entry_classes",
".",
"split",
"(",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/objc/j2objc_dead_code_pruner.py#L88-L151 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py | python | JarFileReader.seek | (self, pos, whence=os.SEEK_SET) | return self.uncompressed_data.seek(pos, whence) | Change the current position in the uncompressed data. Subsequent reads
will start from there. | Change the current position in the uncompressed data. Subsequent reads
will start from there. | [
"Change",
"the",
"current",
"position",
"in",
"the",
"uncompressed",
"data",
".",
"Subsequent",
"reads",
"will",
"start",
"from",
"there",
"."
] | def seek(self, pos, whence=os.SEEK_SET):
'''
Change the current position in the uncompressed data. Subsequent reads
will start from there.
'''
return self.uncompressed_data.seek(pos, whence) | [
"def",
"seek",
"(",
"self",
",",
"pos",
",",
"whence",
"=",
"os",
".",
"SEEK_SET",
")",
":",
"return",
"self",
".",
"uncompressed_data",
".",
"seek",
"(",
"pos",
",",
"whence",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py#L290-L295 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/prefdlg.py | python | PreferencesDialog.__init__ | (self, parent, id_=wx.ID_ANY,
style=wx.DEFAULT_DIALOG_STYLE | wx.TAB_TRAVERSAL) | Initializes the preference dialog
@param parent: The parent window of this window
@keyword id_: The id of this window
@keyword style: Window Style bitmask | Initializes the preference dialog
@param parent: The parent window of this window
@keyword id_: The id of this window
@keyword style: Window Style bitmask | [
"Initializes",
"the",
"preference",
"dialog",
"@param",
"parent",
":",
"The",
"parent",
"window",
"of",
"this",
"window",
"@keyword",
"id_",
":",
"The",
"id",
"of",
"this",
"window",
"@keyword",
"style",
":",
"Window",
"Style",
"bitmask"
] | def __init__(self, parent, id_=wx.ID_ANY,
style=wx.DEFAULT_DIALOG_STYLE | wx.TAB_TRAVERSAL):
"""Initializes the preference dialog
@param parent: The parent window of this window
@keyword id_: The id of this window
@keyword style: Window Style bitmask
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"id_",
"=",
"wx",
".",
"ID_ANY",
",",
"style",
"=",
"wx",
".",
"DEFAULT_DIALOG_STYLE",
"|",
"wx",
".",
"TAB_TRAVERSAL",
")",
":",
"super",
"(",
"PreferencesDialog",
",",
"self",
")",
".",
"__init__",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/prefdlg.py#L101-L133 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py | python | ZipExtFile.readline | (self, limit=-1) | return io.BufferedIOBase.readline(self, limit) | Read and return a line from the stream.
If limit is specified, at most limit bytes will be read. | Read and return a line from the stream. | [
"Read",
"and",
"return",
"a",
"line",
"from",
"the",
"stream",
"."
] | def readline(self, limit=-1):
"""Read and return a line from the stream.
If limit is specified, at most limit bytes will be read.
"""
if limit < 0:
# Shortcut common case - newline found in buffer.
i = self._readbuffer.find(b'\n', self._offset) + 1
i... | [
"def",
"readline",
"(",
"self",
",",
"limit",
"=",
"-",
"1",
")",
":",
"if",
"limit",
"<",
"0",
":",
"# Shortcut common case - newline found in buffer.",
"i",
"=",
"self",
".",
"_readbuffer",
".",
"find",
"(",
"b'\\n'",
",",
"self",
".",
"_offset",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py#L875-L889 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/ctml_writer.py | python | isnum | (a) | True if a is an integer or floating-point number. | True if a is an integer or floating-point number. | [
"True",
"if",
"a",
"is",
"an",
"integer",
"or",
"floating",
"-",
"point",
"number",
"."
] | def isnum(a):
"""True if a is an integer or floating-point number."""
if isinstance(a, (int, float)):
return 1
else:
return 0 | [
"def",
"isnum",
"(",
"a",
")",
":",
"if",
"isinstance",
"(",
"a",
",",
"(",
"int",
",",
"float",
")",
")",
":",
"return",
"1",
"else",
":",
"return",
"0"
] | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml_writer.py#L300-L305 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/dashboard/services/access_control.py | python | ac_user_set_password | (_, username: str, inbuf: str,
force_password: bool = False) | Set user password from -i <file> | Set user password from -i <file> | [
"Set",
"user",
"password",
"from",
"-",
"i",
"<file",
">"
] | def ac_user_set_password(_, username: str, inbuf: str,
force_password: bool = False):
'''
Set user password from -i <file>
'''
password = inbuf
try:
user = mgr.ACCESS_CTRL_DB.get_user(username)
if not force_password:
pw_check = PasswordPolicy(pass... | [
"def",
"ac_user_set_password",
"(",
"_",
",",
"username",
":",
"str",
",",
"inbuf",
":",
"str",
",",
"force_password",
":",
"bool",
"=",
"False",
")",
":",
"password",
"=",
"inbuf",
"try",
":",
"user",
"=",
"mgr",
".",
"ACCESS_CTRL_DB",
".",
"get_user",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/services/access_control.py#L872-L889 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | FontData.GetInitialFont | (*args, **kwargs) | return _windows_.FontData_GetInitialFont(*args, **kwargs) | GetInitialFont(self) -> Font
Gets the font that will be initially used by the font dialog. This
should have previously been set by the application. | GetInitialFont(self) -> Font | [
"GetInitialFont",
"(",
"self",
")",
"-",
">",
"Font"
] | def GetInitialFont(*args, **kwargs):
"""
GetInitialFont(self) -> Font
Gets the font that will be initially used by the font dialog. This
should have previously been set by the application.
"""
return _windows_.FontData_GetInitialFont(*args, **kwargs) | [
"def",
"GetInitialFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"FontData_GetInitialFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L3501-L3508 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | Maildir._lookup | (self, key) | Use TOC to return subpath for given key, or raise a KeyError. | Use TOC to return subpath for given key, or raise a KeyError. | [
"Use",
"TOC",
"to",
"return",
"subpath",
"for",
"given",
"key",
"or",
"raise",
"a",
"KeyError",
"."
] | def _lookup(self, key):
"""Use TOC to return subpath for given key, or raise a KeyError."""
try:
if os.path.exists(os.path.join(self._path, self._toc[key])):
return self._toc[key]
except KeyError:
pass
self._refresh()
try:
retur... | [
"def",
"_lookup",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"self",
".",
"_toc",
"[",
"key",
"]",
")",
")",
":",
"return",
"self... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L547-L558 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xpathParserContext.xpathBooleanFunction | (self, nargs) | Implement the boolean() XPath function boolean
boolean(object) The boolean function converts its argument
to a boolean as follows: - a number is true if and only if
it is neither positive or negative zero nor NaN - a
node-set is true if and only if it is non-empty - a string
... | Implement the boolean() XPath function boolean
boolean(object) The boolean function converts its argument
to a boolean as follows: - a number is true if and only if
it is neither positive or negative zero nor NaN - a
node-set is true if and only if it is non-empty - a string
... | [
"Implement",
"the",
"boolean",
"()",
"XPath",
"function",
"boolean",
"boolean",
"(",
"object",
")",
"The",
"boolean",
"function",
"converts",
"its",
"argument",
"to",
"a",
"boolean",
"as",
"follows",
":",
"-",
"a",
"number",
"is",
"true",
"if",
"and",
"onl... | def xpathBooleanFunction(self, nargs):
"""Implement the boolean() XPath function boolean
boolean(object) The boolean function converts its argument
to a boolean as follows: - a number is true if and only if
it is neither positive or negative zero nor NaN - a
node-set is t... | [
"def",
"xpathBooleanFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathBooleanFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7438-L7445 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py | python | BufferingFormatter.formatHeader | (self, records) | return "" | Return the header string for the specified records. | Return the header string for the specified records. | [
"Return",
"the",
"header",
"string",
"for",
"the",
"specified",
"records",
"."
] | def formatHeader(self, records):
"""
Return the header string for the specified records.
"""
return "" | [
"def",
"formatHeader",
"(",
"self",
",",
"records",
")",
":",
"return",
"\"\""
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L646-L650 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py | python | _SignedVarintEncoder | () | return EncodeSignedVarint | Return an encoder for a basic signed varint value (does not include
tag). | Return an encoder for a basic signed varint value (does not include
tag). | [
"Return",
"an",
"encoder",
"for",
"a",
"basic",
"signed",
"varint",
"value",
"(",
"does",
"not",
"include",
"tag",
")",
"."
] | def _SignedVarintEncoder():
"""Return an encoder for a basic signed varint value (does not include
tag)."""
local_chr = chr
def EncodeSignedVarint(write, value):
if value < 0:
value += (1 << 64)
bits = value & 0x7f
value >>= 7
while value:
write(local_chr(0x80|bits))
bits = va... | [
"def",
"_SignedVarintEncoder",
"(",
")",
":",
"local_chr",
"=",
"chr",
"def",
"EncodeSignedVarint",
"(",
"write",
",",
"value",
")",
":",
"if",
"value",
"<",
"0",
":",
"value",
"+=",
"(",
"1",
"<<",
"64",
")",
"bits",
"=",
"value",
"&",
"0x7f",
"valu... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py#L355-L371 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/SConsign.py | python | Base.get_entry | (self, filename) | return self.entries[filename] | Fetch the specified entry attribute. | Fetch the specified entry attribute. | [
"Fetch",
"the",
"specified",
"entry",
"attribute",
"."
] | def get_entry(self, filename):
"""
Fetch the specified entry attribute.
"""
return self.entries[filename] | [
"def",
"get_entry",
"(",
"self",
",",
"filename",
")",
":",
"return",
"self",
".",
"entries",
"[",
"filename",
"]"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/SConsign.py#L177-L181 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | UpdateUIEvent.GetSetEnabled | (*args, **kwargs) | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) | GetSetEnabled(self) -> bool
Returns ``True`` if the application has called `Enable`. For wxWidgets
internal use only. | GetSetEnabled(self) -> bool | [
"GetSetEnabled",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetSetEnabled(*args, **kwargs):
"""
GetSetEnabled(self) -> bool
Returns ``True`` if the application has called `Enable`. For wxWidgets
internal use only.
"""
return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) | [
"def",
"GetSetEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"UpdateUIEvent_GetSetEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6799-L6806 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.size | (self) | return size | Number of elements in the array.
Equivalent to the product of the array's dimensions.
Examples
--------
>>> import numpy as np
>>> x = mx.nd.zeros((3, 5, 2))
>>> x.size
30
>>> np.prod(x.shape)
30 | Number of elements in the array. | [
"Number",
"of",
"elements",
"in",
"the",
"array",
"."
] | def size(self):
"""Number of elements in the array.
Equivalent to the product of the array's dimensions.
Examples
--------
>>> import numpy as np
>>> x = mx.nd.zeros((3, 5, 2))
>>> x.size
30
>>> np.prod(x.shape)
30
"""
siz... | [
"def",
"size",
"(",
"self",
")",
":",
"size",
"=",
"1",
"for",
"i",
"in",
"self",
".",
"shape",
":",
"size",
"*=",
"i",
"return",
"size"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1657-L1674 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/special/orthogonal.py | python | laguerre | (n, monic=False) | return p | r"""Laguerre polynomial.
Defined to be the solution of
.. math::
x\frac{d^2}{dx^2}L_n + (1 - x)\frac{d}{dx}L_n + nL_n = 0;
:math:`L_n` is a polynomial of degree :math:`n`.
Parameters
----------
n : int
Degree of the polynomial.
monic : bool, optional
If `True`, sc... | r"""Laguerre polynomial. | [
"r",
"Laguerre",
"polynomial",
"."
] | def laguerre(n, monic=False):
r"""Laguerre polynomial.
Defined to be the solution of
.. math::
x\frac{d^2}{dx^2}L_n + (1 - x)\frac{d}{dx}L_n + nL_n = 0;
:math:`L_n` is a polynomial of degree :math:`n`.
Parameters
----------
n : int
Degree of the polynomial.
monic : bo... | [
"def",
"laguerre",
"(",
"n",
",",
"monic",
"=",
"False",
")",
":",
"if",
"n",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"n must be nonnegative.\"",
")",
"if",
"n",
"==",
"0",
":",
"n1",
"=",
"n",
"+",
"1",
"else",
":",
"n1",
"=",
"n",
"x",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/orthogonal.py#L601-L644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.