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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/javac_output_processor.py | python | JavacOutputProcessor.Process | (self, lines) | return (self._ApplyColors(l) for l in lines) | Processes javac output.
- Applies colors to output.
- Suggests GN dep to add for 'unresolved symbol in Java import' errors. | Processes javac output. | [
"Processes",
"javac",
"output",
"."
] | def Process(self, lines):
""" Processes javac output.
- Applies colors to output.
- Suggests GN dep to add for 'unresolved symbol in Java import' errors.
"""
lines = self._ElaborateLinesForUnknownSymbol(iter(lines))
return (self._ApplyColors(l) for l in lines) | [
"def",
"Process",
"(",
"self",
",",
"lines",
")",
":",
"lines",
"=",
"self",
".",
"_ElaborateLinesForUnknownSymbol",
"(",
"iter",
"(",
"lines",
")",
")",
"return",
"(",
"self",
".",
"_ApplyColors",
"(",
"l",
")",
"for",
"l",
"in",
"lines",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/javac_output_processor.py#L76-L83 | |
WagicProject/wagic | 8e551bb287668c285a41206cf10f1a3197887ca2 | projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py | python | Properties.getProperty | (self, key) | return self._props.get(key,'') | Return a property for the given key | Return a property for the given key | [
"Return",
"a",
"property",
"for",
"the",
"given",
"key"
] | def getProperty(self, key):
""" Return a property for the given key """
return self._props.get(key,'') | [
"def",
"getProperty",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
".",
"_props",
".",
"get",
"(",
"key",
",",
"''",
")"
] | https://github.com/WagicProject/wagic/blob/8e551bb287668c285a41206cf10f1a3197887ca2/projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py#L249-L252 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/win_tool.py | python | WinTool.ExecLinkWrapper | (self, arch, use_separate_mspdbsrv, *args) | return link.returncode | Filter diagnostic output from link that looks like:
' Creating library ui.dll.lib and object ui.dll.exp'
This happens when there are exports from the dll or exe. | Filter diagnostic output from link that looks like:
' Creating library ui.dll.lib and object ui.dll.exp'
This happens when there are exports from the dll or exe. | [
"Filter",
"diagnostic",
"output",
"from",
"link",
"that",
"looks",
"like",
":",
"Creating",
"library",
"ui",
".",
"dll",
".",
"lib",
"and",
"object",
"ui",
".",
"dll",
".",
"exp",
"This",
"happens",
"when",
"there",
"are",
"exports",
"from",
"the",
"dll"... | def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args):
"""Filter diagnostic output from link that looks like:
' Creating library ui.dll.lib and object ui.dll.exp'
This happens when there are exports from the dll or exe.
"""
env = self._GetEnv(arch)
if use_separate_mspdbsrv ... | [
"def",
"ExecLinkWrapper",
"(",
"self",
",",
"arch",
",",
"use_separate_mspdbsrv",
",",
"*",
"args",
")",
":",
"env",
"=",
"self",
".",
"_GetEnv",
"(",
"arch",
")",
"if",
"use_separate_mspdbsrv",
"==",
"\"True\"",
":",
"self",
".",
"_UseSeparateMspdbsrv",
"("... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/win_tool.py#L116-L150 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.pretty | (self) | return top_bot + u'\n'.join([u'|'+line+u'|' for line in unicode(self).split(u'\n')]) + u'\n' + top_bot | This returns a copy of the screen as a unicode string with an ASCII
text box around the screen border. This is similar to
__str__/__unicode__ except that it adds a box. | This returns a copy of the screen as a unicode string with an ASCII
text box around the screen border. This is similar to
__str__/__unicode__ except that it adds a box. | [
"This",
"returns",
"a",
"copy",
"of",
"the",
"screen",
"as",
"a",
"unicode",
"string",
"with",
"an",
"ASCII",
"text",
"box",
"around",
"the",
"screen",
"border",
".",
"This",
"is",
"similar",
"to",
"__str__",
"/",
"__unicode__",
"except",
"that",
"it",
"... | def pretty (self):
'''This returns a copy of the screen as a unicode string with an ASCII
text box around the screen border. This is similar to
__str__/__unicode__ except that it adds a box.'''
top_bot = u'+' + u'-'*self.cols + u'+\n'
return top_bot + u'\n'.join([u'|'+line+u'|' ... | [
"def",
"pretty",
"(",
"self",
")",
":",
"top_bot",
"=",
"u'+'",
"+",
"u'-'",
"*",
"self",
".",
"cols",
"+",
"u'+\\n'",
"return",
"top_bot",
"+",
"u'\\n'",
".",
"join",
"(",
"[",
"u'|'",
"+",
"line",
"+",
"u'|'",
"for",
"line",
"in",
"unicode",
"(",... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L138-L144 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Context.max | (self, a, b) | return a.max(b, context=self) | max compares two values numerically and returns the maximum.
If either operand is a NaN then the general rules apply.
Otherwise, the operands are compared as though by the compare
operation. If they are numerically equal then the left-hand operand
is chosen as the result. Otherwise th... | max compares two values numerically and returns the maximum. | [
"max",
"compares",
"two",
"values",
"numerically",
"and",
"returns",
"the",
"maximum",
"."
] | def max(self, a, b):
"""max compares two values numerically and returns the maximum.
If either operand is a NaN then the general rules apply.
Otherwise, the operands are compared as though by the compare
operation. If they are numerically equal then the left-hand operand
is cho... | [
"def",
"max",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"max",
"(",
"b",
",",
"context",
"=",
"self",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L4662-L4687 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | _SparseSegmentReductionGradShape | (op) | return [tensor_shape.TensorShape([dim0]).concatenate(input_shape[1:])] | Shape function for the SparseSegment[Mean|SqrtN]Grad ops. | Shape function for the SparseSegment[Mean|SqrtN]Grad ops. | [
"Shape",
"function",
"for",
"the",
"SparseSegment",
"[",
"Mean|SqrtN",
"]",
"Grad",
"ops",
"."
] | def _SparseSegmentReductionGradShape(op):
"""Shape function for the SparseSegment[Mean|SqrtN]Grad ops."""
input_shape = op.inputs[0].get_shape()
indices_shape = op.inputs[1].get_shape().with_rank(1)
unused_segment_ids_shape = op.inputs[2].get_shape().merge_with(indices_shape)
unused_output_dim0_shape = op.inp... | [
"def",
"_SparseSegmentReductionGradShape",
"(",
"op",
")",
":",
"input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"indices_shape",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1957-L1965 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShell.execStartupScript | (self, startupScript) | Execute the user's PYTHONSTARTUP script if they have one. | Execute the user's PYTHONSTARTUP script if they have one. | [
"Execute",
"the",
"user",
"s",
"PYTHONSTARTUP",
"script",
"if",
"they",
"have",
"one",
"."
] | def execStartupScript(self, startupScript):
"""Execute the user's PYTHONSTARTUP script if they have one."""
if startupScript and os.path.isfile(startupScript):
text = 'Startup script executed: ' + startupScript
self.push('print %r; execfile(%r)' % (text, startupScript))
... | [
"def",
"execStartupScript",
"(",
"self",
",",
"startupScript",
")",
":",
"if",
"startupScript",
"and",
"os",
".",
"path",
".",
"isfile",
"(",
"startupScript",
")",
":",
"text",
"=",
"'Startup script executed: '",
"+",
"startupScript",
"self",
".",
"push",
"(",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L996-L1003 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/linter/base.py | python | LinterBase.get_lint_cmd_args | (self, file_name) | Get the command to run a linter. | Get the command to run a linter. | [
"Get",
"the",
"command",
"to",
"run",
"a",
"linter",
"."
] | def get_lint_cmd_args(self, file_name):
# type: (str) -> List[str]
"""Get the command to run a linter."""
pass | [
"def",
"get_lint_cmd_args",
"(",
"self",
",",
"file_name",
")",
":",
"# type: (str) -> List[str]",
"pass"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/base.py#L24-L27 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/mixins/rubberband.py | python | RubberBand.__mouseMoved | (self, x, y) | Called when the mouse moved without any buttons pressed
or dragging being done. | Called when the mouse moved without any buttons pressed
or dragging being done. | [
"Called",
"when",
"the",
"mouse",
"moved",
"without",
"any",
"buttons",
"pressed",
"or",
"dragging",
"being",
"done",
"."
] | def __mouseMoved(self, x, y):
"""
Called when the mouse moved without any buttons pressed
or dragging being done.
"""
# Are we on the bounding box?
if pointOnBox(x, y, self.currentBox, thickness=self.__THICKNESS):
position = getCursorPosition(x, y, self.curren... | [
"def",
"__mouseMoved",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"# Are we on the bounding box?",
"if",
"pointOnBox",
"(",
"x",
",",
"y",
",",
"self",
".",
"currentBox",
",",
"thickness",
"=",
"self",
".",
"__THICKNESS",
")",
":",
"position",
"=",
"getC... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/mixins/rubberband.py#L275-L297 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py | python | _WriteSimpleXMLElement | (outfile, name, value, indent) | Writes a simple XML element.
Args:
outfile: File object we write the XML element to.
name: A string, the name of XML element.
value: A Python object, whose string representation will be used
as the value of the XML element.
indent: A string, prepended to each line of generated output. | Writes a simple XML element. | [
"Writes",
"a",
"simple",
"XML",
"element",
"."
] | def _WriteSimpleXMLElement(outfile, name, value, indent):
"""Writes a simple XML element.
Args:
outfile: File object we write the XML element to.
name: A string, the name of XML element.
value: A Python object, whose string representation will be used
as the value of the XML element.
indent: ... | [
"def",
"_WriteSimpleXMLElement",
"(",
"outfile",
",",
"name",
",",
"value",
",",
"indent",
")",
":",
"value_str",
"=",
"_StrOrUnicode",
"(",
"value",
")",
"if",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"# Display boolean values as the C++ flag library do... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L1789-L1804 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/page.py | python | RibbonPage.DoSetSize | (self, x, y, width, height, sizeFlags=wx.SIZE_AUTO) | Sets the size of the window in pixels.
:param integer `x`: required `x` position in pixels, or ``wx.DefaultCoord`` to
indicate that the existing value should be used;
:param integer `y`: required `y` position in pixels, or ``wx.DefaultCoord`` to
indicate that the existing value should... | Sets the size of the window in pixels. | [
"Sets",
"the",
"size",
"of",
"the",
"window",
"in",
"pixels",
"."
] | def DoSetSize(self, x, y, width, height, sizeFlags=wx.SIZE_AUTO):
"""
Sets the size of the window in pixels.
:param integer `x`: required `x` position in pixels, or ``wx.DefaultCoord`` to
indicate that the existing value should be used;
:param integer `y`: required `y` position... | [
"def",
"DoSetSize",
"(",
"self",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
",",
"sizeFlags",
"=",
"wx",
".",
"SIZE_AUTO",
")",
":",
"# When a resize triggers the scroll buttons to become visible, the page is resized.",
"# This resize from within a resize event can ca... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/page.py#L374-L427 | ||
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/site_packages/jsontemplate/jsontemplate.py | python | _Section.__init__ | (self, section_name=None) | Args:
section_name: name given as an argument to the section
token_type: The token type that created this section (e.g.
PREDICATE_TOKEN) | Args:
section_name: name given as an argument to the section
token_type: The token type that created this section (e.g.
PREDICATE_TOKEN) | [
"Args",
":",
"section_name",
":",
"name",
"given",
"as",
"an",
"argument",
"to",
"the",
"section",
"token_type",
":",
"The",
"token",
"type",
"that",
"created",
"this",
"section",
"(",
"e",
".",
"g",
".",
"PREDICATE_TOKEN",
")"
] | def __init__(self, section_name=None):
"""
Args:
section_name: name given as an argument to the section
token_type: The token type that created this section (e.g.
PREDICATE_TOKEN)
"""
_AbstractSection.__init__(self)
self.section_name = section_name
# Clauses is just a stri... | [
"def",
"__init__",
"(",
"self",
",",
"section_name",
"=",
"None",
")",
":",
"_AbstractSection",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"section_name",
"=",
"section_name",
"# Clauses is just a string and a list of statements.",
"self",
".",
"statements",
"=... | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/jsontemplate/jsontemplate.py#L377-L388 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/optimize.py | python | OptimizationProblemBuilder.addFeasibilityTest | (self,f,weight=None) | Adds an additional feasibility test. | Adds an additional feasibility test. | [
"Adds",
"an",
"additional",
"feasibility",
"test",
"."
] | def addFeasibilityTest(self,f,weight=None):
"""Adds an additional feasibility test."""
if isinstance(f,symbolic.Function):
return self.addFeasibilityTest(self.context.bindFunction(f,self.optimizationVariables),weight)
else:
assert isinstance(f,symbolic.Expression)
... | [
"def",
"addFeasibilityTest",
"(",
"self",
",",
"f",
",",
"weight",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"f",
",",
"symbolic",
".",
"Function",
")",
":",
"return",
"self",
".",
"addFeasibilityTest",
"(",
"self",
".",
"context",
".",
"bindFuncti... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/optimize.py#L838-L845 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosunit/src/rosunit/junitxml.py | python | TestCaseResult._description | (self) | @return: description of testcase result
@rtype: str | [] | def _description(self):
"""
@return: description of testcase result
@rtype: str
"""
if self.passed:
return "[%s][passed]\n"%self.name
else:
return self._failure_description()+\
self._error_description() | [
"def",
"_description",
"(",
"self",
")",
":",
"if",
"self",
".",
"passed",
":",
"return",
"\"[%s][passed]\\n\"",
"%",
"self",
".",
"name",
"else",
":",
"return",
"self",
".",
"_failure_description",
"(",
")",
"+",
"self",
".",
"_error_description",
"(",
")... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosunit/src/rosunit/junitxml.py#L147-L156 | |||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/actor/Actor.py | python | Actor.loadAnims | (self, anims, partName="modelRoot", lodName="lodRoot") | loadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim loader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults
to 'lodRoot' for non-LOD actors) and dict of corresponding
anims in the form animName:anim... | loadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim loader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults
to 'lodRoot' for non-LOD actors) and dict of corresponding
anims in the form animName:anim... | [
"loadAnims",
"(",
"self",
"string",
":",
"string",
"{}",
"string",
"=",
"modelRoot",
"string",
"=",
"lodRoot",
")",
"Actor",
"anim",
"loader",
".",
"Takes",
"an",
"optional",
"partName",
"(",
"defaults",
"to",
"modelRoot",
"for",
"non",
"-",
"multipart",
"... | def loadAnims(self, anims, partName="modelRoot", lodName="lodRoot"):
"""loadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim loader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults
to 'lodRoot' for n... | [
"def",
"loadAnims",
"(",
"self",
",",
"anims",
",",
"partName",
"=",
"\"modelRoot\"",
",",
"lodName",
"=",
"\"lodRoot\"",
")",
":",
"reload",
"=",
"True",
"if",
"self",
".",
"mergeLODBundles",
":",
"lodNames",
"=",
"[",
"'common'",
"]",
"elif",
"lodName",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L2122-L2174 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _FixPaths | (paths) | return [_FixPath(i) for i in paths] | Fix each of the paths of the list. | Fix each of the paths of the list. | [
"Fix",
"each",
"of",
"the",
"paths",
"of",
"the",
"list",
"."
] | def _FixPaths(paths):
"""Fix each of the paths of the list."""
return [_FixPath(i) for i in paths] | [
"def",
"_FixPaths",
"(",
"paths",
")",
":",
"return",
"[",
"_FixPath",
"(",
"i",
")",
"for",
"i",
"in",
"paths",
"]"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L174-L176 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.set_child_supervision_interval | (self, val: int) | Set the Child Supervision Interval value.
This command can only be used with FTD devices. | Set the Child Supervision Interval value.
This command can only be used with FTD devices. | [
"Set",
"the",
"Child",
"Supervision",
"Interval",
"value",
".",
"This",
"command",
"can",
"only",
"be",
"used",
"with",
"FTD",
"devices",
"."
] | def set_child_supervision_interval(self, val: int):
"""Set the Child Supervision Interval value.
This command can only be used with FTD devices.
"""
self.execute_command(f'childsupervision interval {val}') | [
"def",
"set_child_supervision_interval",
"(",
"self",
",",
"val",
":",
"int",
")",
":",
"self",
".",
"execute_command",
"(",
"f'childsupervision interval {val}'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L1271-L1275 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/vision/transforms/functional_tensor.py | python | resize | (img, size, interpolation='bilinear', data_format='CHW') | return img.squeeze(0) | Resizes the image to given size
Args:
input (paddle.Tensor): Image to be resized.
size (int|list|tuple): Target size of input data, with (height, width) shape.
interpolation (int|str, optional): Interpolation method. when use paddle backend,
support method are as following:
... | Resizes the image to given size | [
"Resizes",
"the",
"image",
"to",
"given",
"size"
] | def resize(img, size, interpolation='bilinear', data_format='CHW'):
"""
Resizes the image to given size
Args:
input (paddle.Tensor): Image to be resized.
size (int|list|tuple): Target size of input data, with (height, width) shape.
interpolation (int|str, optional): Interpolation me... | [
"def",
"resize",
"(",
"img",
",",
"size",
",",
"interpolation",
"=",
"'bilinear'",
",",
"data_format",
"=",
"'CHW'",
")",
":",
"_assert_image_tensor",
"(",
"img",
",",
"data_format",
")",
"if",
"not",
"(",
"isinstance",
"(",
"size",
",",
"int",
")",
"or"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/transforms/functional_tensor.py#L468-L516 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/synextreg.py | python | GetFileExtensions | () | return extreg.GetAllExtensions() | Gets a sorted list of all file extensions the editor is configured
to handle.
@return: all registered file extensions | Gets a sorted list of all file extensions the editor is configured
to handle.
@return: all registered file extensions | [
"Gets",
"a",
"sorted",
"list",
"of",
"all",
"file",
"extensions",
"the",
"editor",
"is",
"configured",
"to",
"handle",
".",
"@return",
":",
"all",
"registered",
"file",
"extensions"
] | def GetFileExtensions():
"""Gets a sorted list of all file extensions the editor is configured
to handle.
@return: all registered file extensions
"""
extreg = ExtensionRegister()
return extreg.GetAllExtensions() | [
"def",
"GetFileExtensions",
"(",
")",
":",
"extreg",
"=",
"ExtensionRegister",
"(",
")",
"return",
"extreg",
".",
"GetAllExtensions",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/synextreg.py#L576-L583 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlDoc.ID | (self, ID) | return __tmp | Search the attribute declaring the given ID | Search the attribute declaring the given ID | [
"Search",
"the",
"attribute",
"declaring",
"the",
"given",
"ID"
] | def ID(self, ID):
"""Search the attribute declaring the given ID """
ret = libxml2mod.xmlGetID(self._o, ID)
if ret is None:raise treeError('xmlGetID() failed')
__tmp = xmlAttr(_obj=ret)
return __tmp | [
"def",
"ID",
"(",
"self",
",",
"ID",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlGetID",
"(",
"self",
".",
"_o",
",",
"ID",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlGetID() failed'",
")",
"__tmp",
"=",
"xmlAttr",
"(",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4593-L4598 | |
openalpr/openalpr | 736ab0e608cf9b20d92f36a873bb1152240daa98 | src/bindings/python/openalpr/openalpr.py | python | Alpr.recognize_file | (self, file_path) | return response_obj | This causes OpenALPR to attempt to recognize an image by opening a file on
disk.
:param file_path: The path to the image that will be analyzed
:return: An OpenALPR analysis in the form of a response dictionary | This causes OpenALPR to attempt to recognize an image by opening a file on
disk. | [
"This",
"causes",
"OpenALPR",
"to",
"attempt",
"to",
"recognize",
"an",
"image",
"by",
"opening",
"a",
"file",
"on",
"disk",
"."
] | def recognize_file(self, file_path):
"""
This causes OpenALPR to attempt to recognize an image by opening a file on
disk.
:param file_path: The path to the image that will be analyzed
:return: An OpenALPR analysis in the form of a response dictionary
"""
file_pat... | [
"def",
"recognize_file",
"(",
"self",
",",
"file_path",
")",
":",
"file_path",
"=",
"_convert_to_charp",
"(",
"file_path",
")",
"ptr",
"=",
"self",
".",
"_recognize_file_func",
"(",
"self",
".",
"alpr_pointer",
",",
"file_path",
")",
"json_data",
"=",
"ctypes"... | https://github.com/openalpr/openalpr/blob/736ab0e608cf9b20d92f36a873bb1152240daa98/src/bindings/python/openalpr/openalpr.py#L140-L154 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.nodes | (self, device_name=None) | Get a list of all nodes from the partition graphs.
Args:
device_name: (`str`) name of device. If None, all nodes from all available
devices will be included.
Returns:
All nodes' names, as a list of str.
Raises:
LookupError: If no partition graphs have been loaded.
ValueErr... | Get a list of all nodes from the partition graphs. | [
"Get",
"a",
"list",
"of",
"all",
"nodes",
"from",
"the",
"partition",
"graphs",
"."
] | def nodes(self, device_name=None):
"""Get a list of all nodes from the partition graphs.
Args:
device_name: (`str`) name of device. If None, all nodes from all available
devices will be included.
Returns:
All nodes' names, as a list of str.
Raises:
LookupError: If no partiti... | [
"def",
"nodes",
"(",
"self",
",",
"device_name",
"=",
"None",
")",
":",
"if",
"self",
".",
"_partition_graphs",
"is",
"None",
":",
"raise",
"LookupError",
"(",
"\"No partition graphs have been loaded.\"",
")",
"if",
"device_name",
"is",
"None",
":",
"nodes",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/lib/debug_data.py#L1367-L1391 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py | python | IMAP4.send | (self, data) | Send data to remote. | Send data to remote. | [
"Send",
"data",
"to",
"remote",
"."
] | def send(self, data):
"""Send data to remote."""
self.sock.sendall(data) | [
"def",
"send",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"sock",
".",
"sendall",
"(",
"data",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py#L316-L318 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/wiredtiger/src/docs/tools/doxypy.py | python | Doxypy.startCommentSearch | (self, match) | Starts a new comment search.
Saves the triggering line, resets the current comment and saves
the current indentation. | Starts a new comment search.
Saves the triggering line, resets the current comment and saves
the current indentation. | [
"Starts",
"a",
"new",
"comment",
"search",
".",
"Saves",
"the",
"triggering",
"line",
"resets",
"the",
"current",
"comment",
"and",
"saves",
"the",
"current",
"indentation",
"."
] | def startCommentSearch(self, match):
"""Starts a new comment search.
Saves the triggering line, resets the current comment and saves
the current indentation.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: startCommentSearch"
self.defclass = [self.fsm.current_input]
self.comment = []
self.i... | [
"def",
"startCommentSearch",
"(",
"self",
",",
"match",
")",
":",
"if",
"options",
".",
"debug",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"\"# CALLBACK: startCommentSearch\"",
"self",
".",
"defclass",
"=",
"[",
"self",
".",
"fsm",
".",
"current_input",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/wiredtiger/src/docs/tools/doxypy.py#L235-L245 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/pkgconfig.py | python | parse | (package) | return result | Return a dict containing compile-time definitions | Return a dict containing compile-time definitions | [
"Return",
"a",
"dict",
"containing",
"compile",
"-",
"time",
"definitions"
] | def parse(package):
"Return a dict containing compile-time definitions"
parse_map = {
'-D': 'define_macros',
'-I': 'include_dirs',
'-L': 'library_dirs',
'-l': 'libraries'
}
result = {x: [] for x in parse_map.values()}
# Execute the query to pkg-config and clean the ... | [
"def",
"parse",
"(",
"package",
")",
":",
"parse_map",
"=",
"{",
"'-D'",
":",
"'define_macros'",
",",
"'-I'",
":",
"'include_dirs'",
",",
"'-L'",
":",
"'library_dirs'",
",",
"'-l'",
":",
"'libraries'",
"}",
"result",
"=",
"{",
"x",
":",
"[",
"]",
"for"... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/pkgconfig.py#L32-L54 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/message.py | python | Message.get_payload | (self, i=None, decode=False) | return payload | Return a reference to the payload.
The payload will either be a list object or a string. If you mutate
the list object, you modify the message's payload in place. Optional
i returns that index into the payload.
Optional decode is a flag indicating whether the payload should be
... | Return a reference to the payload. | [
"Return",
"a",
"reference",
"to",
"the",
"payload",
"."
] | def get_payload(self, i=None, decode=False):
"""Return a reference to the payload.
The payload will either be a list object or a string. If you mutate
the list object, you modify the message's payload in place. Optional
i returns that index into the payload.
Optional decode i... | [
"def",
"get_payload",
"(",
"self",
",",
"i",
"=",
"None",
",",
"decode",
"=",
"False",
")",
":",
"if",
"i",
"is",
"None",
":",
"payload",
"=",
"self",
".",
"_payload",
"elif",
"not",
"isinstance",
"(",
"self",
".",
"_payload",
",",
"list",
")",
":"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/message.py#L168-L216 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py | python | _ContextSwitchStack.pop | (self) | Pop the stack. | Pop the stack. | [
"Pop",
"the",
"stack",
"."
] | def pop(self):
"""Pop the stack."""
self.stack.pop() | [
"def",
"pop",
"(",
"self",
")",
":",
"self",
".",
"stack",
".",
"pop",
"(",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L234-L237 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextBuffer.InitStandardHandlers | (*args, **kwargs) | return _richtext.RichTextBuffer_InitStandardHandlers(*args, **kwargs) | InitStandardHandlers() | InitStandardHandlers() | [
"InitStandardHandlers",
"()"
] | def InitStandardHandlers(*args, **kwargs):
"""InitStandardHandlers()"""
return _richtext.RichTextBuffer_InitStandardHandlers(*args, **kwargs) | [
"def",
"InitStandardHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_InitStandardHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2600-L2602 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/__init__.py | python | space_to_depth | (operand, block_size, name='') | return space_to_depth(operand, block_size, name) | Rearranges elements in the input tensor from the spatial dimensions to the depth dimension.
This is the reverse transformation of depth_to_space. This operation is useful for implementing
and testing sub-pixel convolution that is part of models for image super-resolution (see [1]).
It rearranges elements ... | Rearranges elements in the input tensor from the spatial dimensions to the depth dimension. | [
"Rearranges",
"elements",
"in",
"the",
"input",
"tensor",
"from",
"the",
"spatial",
"dimensions",
"to",
"the",
"depth",
"dimension",
"."
] | def space_to_depth(operand, block_size, name=''):
'''
Rearranges elements in the input tensor from the spatial dimensions to the depth dimension.
This is the reverse transformation of depth_to_space. This operation is useful for implementing
and testing sub-pixel convolution that is part of models for... | [
"def",
"space_to_depth",
"(",
"operand",
",",
"block_size",
",",
"name",
"=",
"''",
")",
":",
"from",
"cntk",
".",
"cntk_py",
"import",
"space_to_depth",
"operand",
"=",
"sanitize_input",
"(",
"operand",
",",
"get_data_type",
"(",
"operand",
")",
")",
"if",
... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L4031-L4075 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/common/walterWidgets/walterBaseTreeView.py | python | BaseModel.rowCount | (self, parent=QtCore.QModelIndex()) | return item.childCount() | The number of rows under the given parent. | The number of rows under the given parent. | [
"The",
"number",
"of",
"rows",
"under",
"the",
"given",
"parent",
"."
] | def rowCount(self, parent=QtCore.QModelIndex()):
"""The number of rows under the given parent."""
if parent.column() > 0:
return 0
if not parent.isValid():
item = self.rootItem
else:
item = parent.internalPointer()
if not item:
ret... | [
"def",
"rowCount",
"(",
"self",
",",
"parent",
"=",
"QtCore",
".",
"QModelIndex",
"(",
")",
")",
":",
"if",
"parent",
".",
"column",
"(",
")",
">",
"0",
":",
"return",
"0",
"if",
"not",
"parent",
".",
"isValid",
"(",
")",
":",
"item",
"=",
"self"... | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterBaseTreeView.py#L134-L146 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/freetype/__init__.py | python | Face.load_char | (self, char, flags=FT_LOAD_RENDER) | A function used to load a single glyph into the glyph slot of a face
object, according to its character code.
:param char: The glyph's character code, according to the current
charmap used in the face.
:param flags: A flag indicating what to load for this glyph. The
... | A function used to load a single glyph into the glyph slot of a face
object, according to its character code. | [
"A",
"function",
"used",
"to",
"load",
"a",
"single",
"glyph",
"into",
"the",
"glyph",
"slot",
"of",
"a",
"face",
"object",
"according",
"to",
"its",
"character",
"code",
"."
] | def load_char(self, char, flags=FT_LOAD_RENDER):
'''
A function used to load a single glyph into the glyph slot of a face
object, according to its character code.
:param char: The glyph's character code, according to the current
charmap used in the face.
:p... | [
"def",
"load_char",
"(",
"self",
",",
"char",
",",
"flags",
"=",
"FT_LOAD_RENDER",
")",
":",
"if",
"len",
"(",
"char",
")",
"==",
"1",
":",
"char",
"=",
"ord",
"(",
"char",
")",
"error",
"=",
"FT_Load_Char",
"(",
"self",
".",
"_FT_Face",
",",
"char... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/freetype/__init__.py#L1283-L1305 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_concat_ops.py | python | stack | (values, axis=0, name=None) | Stacks a list of rank-`R` tensors into one rank-`(R+1)` `RaggedTensor`.
Given a list of tensors or ragged tensors with the same rank `R`
(`R >= axis`), returns a rank-`R+1` `RaggedTensor` `result` such that
`result[i0...iaxis]` is `[value[i0...iaxis] for value in values]`.
#### Example:
```python
>>> ... | Stacks a list of rank-`R` tensors into one rank-`(R+1)` `RaggedTensor`. | [
"Stacks",
"a",
"list",
"of",
"rank",
"-",
"R",
"tensors",
"into",
"one",
"rank",
"-",
"(",
"R",
"+",
"1",
")",
"RaggedTensor",
"."
] | def stack(values, axis=0, name=None):
"""Stacks a list of rank-`R` tensors into one rank-`(R+1)` `RaggedTensor`.
Given a list of tensors or ragged tensors with the same rank `R`
(`R >= axis`), returns a rank-`R+1` `RaggedTensor` `result` such that
`result[i0...iaxis]` is `[value[i0...iaxis] for value in values... | [
"def",
"stack",
"(",
"values",
",",
"axis",
"=",
"0",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"values",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"values",
"=",
"[",
"values",
"]",
"with",
"ops",
".",
"name_scope"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_concat_ops.py#L75-L113 | ||
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | 3party/freetype/src/tools/docmaker/content.py | python | DocBlock.get_markup | ( self, tag_name ) | return None | Return the DocMarkup corresponding to a given tag in a block. | Return the DocMarkup corresponding to a given tag in a block. | [
"Return",
"the",
"DocMarkup",
"corresponding",
"to",
"a",
"given",
"tag",
"in",
"a",
"block",
"."
] | def get_markup( self, tag_name ):
"""Return the DocMarkup corresponding to a given tag in a block."""
for m in self.markups:
if m.tag == string.lower( tag_name ):
return m
return None | [
"def",
"get_markup",
"(",
"self",
",",
"tag_name",
")",
":",
"for",
"m",
"in",
"self",
".",
"markups",
":",
"if",
"m",
".",
"tag",
"==",
"string",
".",
"lower",
"(",
"tag_name",
")",
":",
"return",
"m",
"return",
"None"
] | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/3party/freetype/src/tools/docmaker/content.py#L598-L603 | |
faasm/faasm | b3bc196d887adbd0bb9802bcb93323543bad59cb | faasmcli/faasmcli/tasks/redis.py | python | clear_queue | (ctx, local=False, docker=False, knative=True) | Clear the message queue in Redis | Clear the message queue in Redis | [
"Clear",
"the",
"message",
"queue",
"in",
"Redis"
] | def clear_queue(ctx, local=False, docker=False, knative=True):
"""
Clear the message queue in Redis
"""
_do_redis_command("flushall", local, docker, knative) | [
"def",
"clear_queue",
"(",
"ctx",
",",
"local",
"=",
"False",
",",
"docker",
"=",
"False",
",",
"knative",
"=",
"True",
")",
":",
"_do_redis_command",
"(",
"\"flushall\"",
",",
"local",
",",
"docker",
",",
"knative",
")"
] | https://github.com/faasm/faasm/blob/b3bc196d887adbd0bb9802bcb93323543bad59cb/faasmcli/faasmcli/tasks/redis.py#L36-L40 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/samplelogs/presenter.py | python | SampleLogs.log_changed | (self) | Update interface aspects | Update interface aspects | [
"Update",
"interface",
"aspects"
] | def log_changed(self):
"""Update interface aspects
"""
#determine if any of the logs might support filtering
are_any_logs_filtered = False
for row in self.view.get_selected_row_indexes():
if self.model.get_is_log_filtered(self.view.get_row_log_name(row)):
... | [
"def",
"log_changed",
"(",
"self",
")",
":",
"#determine if any of the logs might support filtering",
"are_any_logs_filtered",
"=",
"False",
"for",
"row",
"in",
"self",
".",
"view",
".",
"get_selected_row_indexes",
"(",
")",
":",
"if",
"self",
".",
"model",
".",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/samplelogs/presenter.py#L45-L54 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/waveforms.py | python | gausspulse | (t, fc=1000, bw=0.5, bwr=-6, tpr=-60, retquad=False,
retenv=False) | Return a Gaussian modulated sinusoid:
``exp(-a t^2) exp(1j*2*pi*fc*t).``
If `retquad` is True, then return the real and imaginary parts
(in-phase and quadrature).
If `retenv` is True, then return the envelope (unmodulated signal).
Otherwise, return the real part of the modulated sinusoid.
... | Return a Gaussian modulated sinusoid: | [
"Return",
"a",
"Gaussian",
"modulated",
"sinusoid",
":"
] | def gausspulse(t, fc=1000, bw=0.5, bwr=-6, tpr=-60, retquad=False,
retenv=False):
"""
Return a Gaussian modulated sinusoid:
``exp(-a t^2) exp(1j*2*pi*fc*t).``
If `retquad` is True, then return the real and imaginary parts
(in-phase and quadrature).
If `retenv` is True, then ... | [
"def",
"gausspulse",
"(",
"t",
",",
"fc",
"=",
"1000",
",",
"bw",
"=",
"0.5",
",",
"bwr",
"=",
"-",
"6",
",",
"tpr",
"=",
"-",
"60",
",",
"retquad",
"=",
"False",
",",
"retenv",
"=",
"False",
")",
":",
"if",
"fc",
"<",
"0",
":",
"raise",
"V... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/waveforms.py#L165-L262 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/extensions/reveal.py | python | RevealExtension._getNodeIDs | (root) | return keys | Return all 'ids' in a node tree. | Return all 'ids' in a node tree. | [
"Return",
"all",
"ids",
"in",
"a",
"node",
"tree",
"."
] | def _getNodeIDs(root):
"""Return all 'ids' in a node tree."""
keys = []
id_ = root.get('id', None)
if id_:
keys.append(id_)
for node in moosetree.iterate(root, method=moosetree.IterMethod.PRE_ORDER):
id_ = node.get('id', None)
if id_:
... | [
"def",
"_getNodeIDs",
"(",
"root",
")",
":",
"keys",
"=",
"[",
"]",
"id_",
"=",
"root",
".",
"get",
"(",
"'id'",
",",
"None",
")",
"if",
"id_",
":",
"keys",
".",
"append",
"(",
"id_",
")",
"for",
"node",
"in",
"moosetree",
".",
"iterate",
"(",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/reveal.py#L119-L131 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/handlers.py | python | QueueHandler.enqueue | (self, record) | Enqueue a record.
The base implementation uses put_nowait. You may want to override
this method if you want to use blocking, timeouts or custom queue
implementations. | Enqueue a record. | [
"Enqueue",
"a",
"record",
"."
] | def enqueue(self, record):
"""
Enqueue a record.
The base implementation uses put_nowait. You may want to override
this method if you want to use blocking, timeouts or custom queue
implementations.
"""
self.queue.put_nowait(record) | [
"def",
"enqueue",
"(",
"self",
",",
"record",
")",
":",
"self",
".",
"queue",
".",
"put_nowait",
"(",
"record",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/handlers.py#L1351-L1359 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/program_members/varying.py | python | Varying.number | (self) | return self._number | int: The number of the varying. | int: The number of the varying. | [
"int",
":",
"The",
"number",
"of",
"the",
"varying",
"."
] | def number(self) -> int:
'''
int: The number of the varying.
'''
return self._number | [
"def",
"number",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_number"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/program_members/varying.py#L26-L31 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/directconnect/layer1.py | python | DirectConnectConnection.describe_connections_on_interconnect | (self, interconnect_id) | return self.make_request(action='DescribeConnectionsOnInterconnect',
body=json.dumps(params)) | Return a list of connections that have been provisioned on the
given interconnect.
:type interconnect_id: string
:param interconnect_id: ID of the interconnect on which a list of
connection is provisioned.
Example: dxcon-abc123
Default: None | Return a list of connections that have been provisioned on the
given interconnect. | [
"Return",
"a",
"list",
"of",
"connections",
"that",
"have",
"been",
"provisioned",
"on",
"the",
"given",
"interconnect",
"."
] | def describe_connections_on_interconnect(self, interconnect_id):
"""
Return a list of connections that have been provisioned on the
given interconnect.
:type interconnect_id: string
:param interconnect_id: ID of the interconnect on which a list of
connection is provi... | [
"def",
"describe_connections_on_interconnect",
"(",
"self",
",",
"interconnect_id",
")",
":",
"params",
"=",
"{",
"'interconnectId'",
":",
"interconnect_id",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'DescribeConnectionsOnInterconnect'",
",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/directconnect/layer1.py#L506-L521 | |
brave/brave-core | ceaa3de4735789d355b6fa80c21d4709e2c1d0e8 | build/ios/mojom/mojom_objc_generator.py | python | Generator._ObjCEnumFormatter | (self, value) | return UnderToCamel(name) | Formats uppercased, k-prefixed & snake case to upper camel case | Formats uppercased, k-prefixed & snake case to upper camel case | [
"Formats",
"uppercased",
"k",
"-",
"prefixed",
"&",
"snake",
"case",
"to",
"upper",
"camel",
"case"
] | def _ObjCEnumFormatter(self, value):
""" Formats uppercased, k-prefixed & snake case to upper camel case """
name = value
if len(value) >= 2 and value[0] == "k" and value[1].isupper():
# k-prefixed
name = value[1:]
return UnderToCamel(name) | [
"def",
"_ObjCEnumFormatter",
"(",
"self",
",",
"value",
")",
":",
"name",
"=",
"value",
"if",
"len",
"(",
"value",
")",
">=",
"2",
"and",
"value",
"[",
"0",
"]",
"==",
"\"k\"",
"and",
"value",
"[",
"1",
"]",
".",
"isupper",
"(",
")",
":",
"# k-pr... | https://github.com/brave/brave-core/blob/ceaa3de4735789d355b6fa80c21d4709e2c1d0e8/build/ios/mojom/mojom_objc_generator.py#L476-L482 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_matplotlib/style.py | python | _is_single_string_color | (color: Color) | Check if `color` is a single string color.
Examples of single string colors:
- 'r'
- 'g'
- 'red'
- 'green'
- 'C3'
- 'firebrick'
Parameters
----------
color : Color
Color string or sequence of floats.
Returns
-------
bool
True... | Check if `color` is a single string color. | [
"Check",
"if",
"color",
"is",
"a",
"single",
"string",
"color",
"."
] | def _is_single_string_color(color: Color) -> bool:
"""Check if `color` is a single string color.
Examples of single string colors:
- 'r'
- 'g'
- 'red'
- 'green'
- 'C3'
- 'firebrick'
Parameters
----------
color : Color
Color string or sequence... | [
"def",
"_is_single_string_color",
"(",
"color",
":",
"Color",
")",
"->",
"bool",
":",
"conv",
"=",
"matplotlib",
".",
"colors",
".",
"ColorConverter",
"(",
")",
"try",
":",
"conv",
".",
"to_rgba",
"(",
"color",
")",
"except",
"ValueError",
":",
"return",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_matplotlib/style.py#L247-L275 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/DifferentialEvolution.py | python | BaseTraits.mutate | (self, base, left, right, fluctuation, min_value, max_value) | Performs mutation for the differential evolution algorithm.
:param base: a member of the original population.
:type base: any type
:param left: another member of the original population.
:type left: any type
:param right: another member of the original population.
:typ... | Performs mutation for the differential evolution algorithm. | [
"Performs",
"mutation",
"for",
"the",
"differential",
"evolution",
"algorithm",
"."
] | def mutate(self, base, left, right, fluctuation, min_value, max_value):
"""Performs mutation for the differential evolution algorithm.
:param base: a member of the original population.
:type base: any type
:param left: another member of the original population.
:type left: any ... | [
"def",
"mutate",
"(",
"self",
",",
"base",
",",
"left",
",",
"right",
",",
"fluctuation",
",",
"min_value",
",",
"max_value",
")",
":"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/DifferentialEvolution.py#L49-L69 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Diffraction/isis_powder/hrpd.py | python | HRPD._mask_prompt_pulses | (self, ws) | HRPD has a long flight path from the moderator resulting
in sharp peaks from the proton pulse that maintain their
sharp resolution. Here we mask these pulses out that occur
at 20ms intervals.
:param ws: The workspace containing the pulses. It is
masked in place. | HRPD has a long flight path from the moderator resulting
in sharp peaks from the proton pulse that maintain their
sharp resolution. Here we mask these pulses out that occur
at 20ms intervals. | [
"HRPD",
"has",
"a",
"long",
"flight",
"path",
"from",
"the",
"moderator",
"resulting",
"in",
"sharp",
"peaks",
"from",
"the",
"proton",
"pulse",
"that",
"maintain",
"their",
"sharp",
"resolution",
".",
"Here",
"we",
"mask",
"these",
"pulses",
"out",
"that",
... | def _mask_prompt_pulses(self, ws):
"""
HRPD has a long flight path from the moderator resulting
in sharp peaks from the proton pulse that maintain their
sharp resolution. Here we mask these pulses out that occur
at 20ms intervals.
:param ws: The workspace containing the ... | [
"def",
"_mask_prompt_pulses",
"(",
"self",
",",
"ws",
")",
":",
"# The number of pulse can vary depending on the data range",
"# Compute number of pulses that occur at each 20ms interval.",
"x_data",
"=",
"ws",
".",
"readX",
"(",
"0",
")",
"pulse_min",
"=",
"int",
"(",
"r... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Diffraction/isis_powder/hrpd.py#L161-L180 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Pen.GetDashCount | (*args, **kwargs) | return _gdi_.Pen_GetDashCount(*args, **kwargs) | GetDashCount(self) -> int | GetDashCount(self) -> int | [
"GetDashCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetDashCount(*args, **kwargs):
"""GetDashCount(self) -> int"""
return _gdi_.Pen_GetDashCount(*args, **kwargs) | [
"def",
"GetDashCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_GetDashCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L463-L465 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/distributed/server.py | python | Client.set_is_grad | (self, key, is_grad) | r"""Mark send/recv need gradiants by key.
Args:
key: key to match send/recv op.
is_grad: whether this op need grad. | r"""Mark send/recv need gradiants by key. | [
"r",
"Mark",
"send",
"/",
"recv",
"need",
"gradiants",
"by",
"key",
"."
] | def set_is_grad(self, key, is_grad):
r"""Mark send/recv need gradiants by key.
Args:
key: key to match send/recv op.
is_grad: whether this op need grad.
"""
self.proxy.set_is_grad(key, is_grad) | [
"def",
"set_is_grad",
"(",
"self",
",",
"key",
",",
"is_grad",
")",
":",
"self",
".",
"proxy",
".",
"set_is_grad",
"(",
"key",
",",
"is_grad",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/distributed/server.py#L236-L243 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpointList.Clear | (self) | return _lldb.SBBreakpointList_Clear(self) | Clear(SBBreakpointList self) | Clear(SBBreakpointList self) | [
"Clear",
"(",
"SBBreakpointList",
"self",
")"
] | def Clear(self):
"""Clear(SBBreakpointList self)"""
return _lldb.SBBreakpointList_Clear(self) | [
"def",
"Clear",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBBreakpointList_Clear",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1926-L1928 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | Display.IsOk | (*args, **kwargs) | return _misc_.Display_IsOk(*args, **kwargs) | IsOk(self) -> bool
Return true if the object was initialized successfully | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""
IsOk(self) -> bool
Return true if the object was initialized successfully
"""
return _misc_.Display_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Display_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6121-L6127 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | SelectionDataModel.addComputedPropPath | (self, primPath, propName) | Add a computed property to the selection. | Add a computed property to the selection. | [
"Add",
"a",
"computed",
"property",
"to",
"the",
"selection",
"."
] | def addComputedPropPath(self, primPath, propName):
"""Add a computed property to the selection."""
primPath = self._ensureValidPrimPath(primPath)
self._validateComputedPropName(propName)
self._computedPropSelection.addPropPath(primPath, propName)
self._computedPropSelectionChan... | [
"def",
"addComputedPropPath",
"(",
"self",
",",
"primPath",
",",
"propName",
")",
":",
"primPath",
"=",
"self",
".",
"_ensureValidPrimPath",
"(",
"primPath",
")",
"self",
".",
"_validateComputedPropName",
"(",
"propName",
")",
"self",
".",
"_computedPropSelection"... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L973-L980 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/tz/win.py | python | valuestodict | (key) | return dout | Convert a registry key's values to a dictionary. | Convert a registry key's values to a dictionary. | [
"Convert",
"a",
"registry",
"key",
"s",
"values",
"to",
"a",
"dictionary",
"."
] | def valuestodict(key):
"""Convert a registry key's values to a dictionary."""
dout = {}
size = winreg.QueryInfoKey(key)[1]
tz_res = None
for i in range(size):
key_name, value, dtype = winreg.EnumValue(key, i)
if dtype == winreg.REG_DWORD or dtype == winreg.REG_DWORD_LITTLE_ENDIAN:
... | [
"def",
"valuestodict",
"(",
"key",
")",
":",
"dout",
"=",
"{",
"}",
"size",
"=",
"winreg",
".",
"QueryInfoKey",
"(",
"key",
")",
"[",
"1",
"]",
"tz_res",
"=",
"None",
"for",
"i",
"in",
"range",
"(",
"size",
")",
":",
"key_name",
",",
"value",
","... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/tz/win.py#L347-L370 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/mailbox.py | python | _mboxMMDFMessage.remove_flag | (self, flag) | Unset the given string flag(s) without changing others. | Unset the given string flag(s) without changing others. | [
"Unset",
"the",
"given",
"string",
"flag",
"(",
"s",
")",
"without",
"changing",
"others",
"."
] | def remove_flag(self, flag):
"""Unset the given string flag(s) without changing others."""
if 'Status' in self or 'X-Status' in self:
self.set_flags(''.join(set(self.get_flags()) - set(flag))) | [
"def",
"remove_flag",
"(",
"self",
",",
"flag",
")",
":",
"if",
"'Status'",
"in",
"self",
"or",
"'X-Status'",
"in",
"self",
":",
"self",
".",
"set_flags",
"(",
"''",
".",
"join",
"(",
"set",
"(",
"self",
".",
"get_flags",
"(",
")",
")",
"-",
"set",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1691-L1694 | ||
facebookarchive/LogDevice | ce7726050edc49a1e15d9160e81c890736b779e2 | logdevice/ops/ldshell/autoload/commands/status.py | python | status | (
format="tabular",
sort="node_id",
nodes=None,
hosts=None,
hostnames=None,
extended=False,
force: bool = False,
) | Next gen status command using the Thrift interfaces | Next gen status command using the Thrift interfaces | [
"Next",
"gen",
"status",
"command",
"using",
"the",
"Thrift",
"interfaces"
] | async def status(
format="tabular",
sort="node_id",
nodes=None,
hosts=None,
hostnames=None,
extended=False,
force: bool = False,
):
"""
Next gen status command using the Thrift interfaces
"""
hostnames = set(chain.from_iterable((hostnames or [], hosts or [])))
await add... | [
"async",
"def",
"status",
"(",
"format",
"=",
"\"tabular\"",
",",
"sort",
"=",
"\"node_id\"",
",",
"nodes",
"=",
"None",
",",
"hosts",
"=",
"None",
",",
"hostnames",
"=",
"None",
",",
"extended",
"=",
"False",
",",
"force",
":",
"bool",
"=",
"False",
... | https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/logdevice/ops/ldshell/autoload/commands/status.py#L505-L534 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextEvent.GetLParam | (*args, **kwargs) | return _stc.StyledTextEvent_GetLParam(*args, **kwargs) | GetLParam(self) -> int | GetLParam(self) -> int | [
"GetLParam",
"(",
"self",
")",
"-",
">",
"int"
] | def GetLParam(*args, **kwargs):
"""GetLParam(self) -> int"""
return _stc.StyledTextEvent_GetLParam(*args, **kwargs) | [
"def",
"GetLParam",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_GetLParam",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L7174-L7176 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuButton.GetTimerId | (self) | return self._timerID | Returns the timer object identifier. | Returns the timer object identifier. | [
"Returns",
"the",
"timer",
"object",
"identifier",
"."
] | def GetTimerId(self):
""" Returns the timer object identifier. """
return self._timerID | [
"def",
"GetTimerId",
"(",
"self",
")",
":",
"return",
"self",
".",
"_timerID"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4070-L4073 | |
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | tools_webrtc/clang_tidy.py | python | ValidateCC | (filepath) | We can only analyze .cc files. Provide explicit message about that. | We can only analyze .cc files. Provide explicit message about that. | [
"We",
"can",
"only",
"analyze",
".",
"cc",
"files",
".",
"Provide",
"explicit",
"message",
"about",
"that",
"."
] | def ValidateCC(filepath):
"""We can only analyze .cc files. Provide explicit message about that."""
if filepath.endswith('.cc'):
return filepath
msg = ('%s not supported.\n'
'For now, we can only analyze translation units (.cc files).' %
filepath)
raise argparse.ArgumentTyp... | [
"def",
"ValidateCC",
"(",
"filepath",
")",
":",
"if",
"filepath",
".",
"endswith",
"(",
"'.cc'",
")",
":",
"return",
"filepath",
"msg",
"=",
"(",
"'%s not supported.\\n'",
"'For now, we can only analyze translation units (.cc files).'",
"%",
"filepath",
")",
"raise",
... | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/tools_webrtc/clang_tidy.py#L70-L77 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py | python | bytes_to_long | (s) | return acc | Convert a byte string to a long integer (big endian).
In Python 3.2+, use the native method instead::
>>> int.from_bytes(s, 'big')
For instance::
>>> int.from_bytes(b'\x00P', 'big')
80
This is (essentially) the inverse of :func:`long_to_bytes`. | Convert a byte string to a long integer (big endian). | [
"Convert",
"a",
"byte",
"string",
"to",
"a",
"long",
"integer",
"(",
"big",
"endian",
")",
"."
] | def bytes_to_long(s):
"""Convert a byte string to a long integer (big endian).
In Python 3.2+, use the native method instead::
>>> int.from_bytes(s, 'big')
For instance::
>>> int.from_bytes(b'\x00P', 'big')
80
This is (essentially) the inverse of :func:`long_to_bytes`.
"... | [
"def",
"bytes_to_long",
"(",
"s",
")",
":",
"acc",
"=",
"0",
"unpack",
"=",
"struct",
".",
"unpack",
"# Up to Python 2.7.4, struct.unpack can't work with bytearrays nor",
"# memoryviews",
"if",
"sys",
".",
"version_info",
"[",
"0",
":",
"3",
"]",
"<",
"(",
"2",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py#L416-L449 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | GradLoopState.outer_grad_state | (self) | return self._outer_grad_state | The grad loop state for outer loop. | The grad loop state for outer loop. | [
"The",
"grad",
"loop",
"state",
"for",
"outer",
"loop",
"."
] | def outer_grad_state(self):
"""The grad loop state for outer loop."""
return self._outer_grad_state | [
"def",
"outer_grad_state",
"(",
"self",
")",
":",
"return",
"self",
".",
"_outer_grad_state"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L561-L563 | |
s9xie/hed | 94fb22f10cbfec8d84fbc0642b224022014b6bd6 | scripts/cpp_lint.py | python | ReplaceAll | (pattern, rep, s) | return _regexp_compile_cache[pattern].sub(rep, s) | Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if no replacements) | Replaces instances of pattern in a string with a replacement. | [
"Replaces",
"instances",
"of",
"pattern",
"in",
"a",
"string",
"with",
"a",
"replacement",
"."
] | def ReplaceAll(pattern, rep, s):
"""Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if... | [
"def",
"ReplaceAll",
"(",
"pattern",
",",
"rep",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_c... | https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L525-L540 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/internal/_parameterized.py | python | _ParameterDecorator | (naming_type, testcases) | return _Apply | Implementation of the parameterization decorators.
Args:
naming_type: The naming type.
testcases: Testcase parameters.
Returns:
A function for modifying the decorated object. | Implementation of the parameterization decorators. | [
"Implementation",
"of",
"the",
"parameterization",
"decorators",
"."
] | def _ParameterDecorator(naming_type, testcases):
"""Implementation of the parameterization decorators.
Args:
naming_type: The naming type.
testcases: Testcase parameters.
Returns:
A function for modifying the decorated object.
"""
def _Apply(obj):
if isinstance(obj, type):
_ModifyClass... | [
"def",
"_ParameterDecorator",
"(",
"naming_type",
",",
"testcases",
")",
":",
"def",
"_Apply",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"type",
")",
":",
"_ModifyClass",
"(",
"obj",
",",
"list",
"(",
"testcases",
")",
"if",
"not",
"is... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/_parameterized.py#L281-L307 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/math_ops.py | python | reduce_mean | (input_tensor,
axis=None,
keep_dims=False,
name=None,
reduction_indices=None) | return gen_math_ops._mean(
input_tensor,
_ReductionDims(input_tensor, axis, reduction_indices),
keep_dims,
name=name) | Computes the mean of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each
entry in `axis`. If `keep_dims` is true, the reduced dimensions
are retained with length 1.
If `axis` has no e... | Computes the mean of elements across dimensions of a tensor. | [
"Computes",
"the",
"mean",
"of",
"elements",
"across",
"dimensions",
"of",
"a",
"tensor",
"."
] | def reduce_mean(input_tensor,
axis=None,
keep_dims=False,
name=None,
reduction_indices=None):
"""Computes the mean of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keep_dims` is true, th... | [
"def",
"reduce_mean",
"(",
"input_tensor",
",",
"axis",
"=",
"None",
",",
"keep_dims",
"=",
"False",
",",
"name",
"=",
"None",
",",
"reduction_indices",
"=",
"None",
")",
":",
"return",
"gen_math_ops",
".",
"_mean",
"(",
"input_tensor",
",",
"_ReductionDims"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_ops.py#L1373-L1417 | |
apache/parquet-cpp | 642da055adf009652689b20e68a198cffb857651 | build-support/cpplint.py | python | _FunctionState.Begin | (self, function_name) | Start analyzing function body.
Args:
function_name: The name of the function being tracked. | Start analyzing function body. | [
"Start",
"analyzing",
"function",
"body",
"."
] | def Begin(self, function_name):
"""Start analyzing function body.
Args:
function_name: The name of the function being tracked.
"""
self.in_a_function = True
self.lines_in_function = 0
self.current_function = function_name | [
"def",
"Begin",
"(",
"self",
",",
"function_name",
")",
":",
"self",
".",
"in_a_function",
"=",
"True",
"self",
".",
"lines_in_function",
"=",
"0",
"self",
".",
"current_function",
"=",
"function_name"
] | https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L924-L932 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | orttraining/orttraining/python/training/checkpoint.py | python | _aggregate_over_ranks | (ordered_paths, ranks, sharded_states_original_dims = None, mode = _AGGREGATION_MODE.Zero, partial_aggregation = False, pytorch_format=True) | return _to_pytorch_format(state_dict) if pytorch_format else state_dict | Aggregate checkpoint files over set of ranks and return a single state dictionary
Args:
ordered_paths: list of paths in the order in which they must be aggregated
ranks: list of ranks that are to be aggregated
sharded_states_original_dims: dict containing the original dims for sharded state... | Aggregate checkpoint files over set of ranks and return a single state dictionary | [
"Aggregate",
"checkpoint",
"files",
"over",
"set",
"of",
"ranks",
"and",
"return",
"a",
"single",
"state",
"dictionary"
] | def _aggregate_over_ranks(ordered_paths, ranks, sharded_states_original_dims = None, mode = _AGGREGATION_MODE.Zero, partial_aggregation = False, pytorch_format=True):
"""Aggregate checkpoint files over set of ranks and return a single state dictionary
Args:
ordered_paths: list of paths in the order in ... | [
"def",
"_aggregate_over_ranks",
"(",
"ordered_paths",
",",
"ranks",
",",
"sharded_states_original_dims",
"=",
"None",
",",
"mode",
"=",
"_AGGREGATION_MODE",
".",
"Zero",
",",
"partial_aggregation",
"=",
"False",
",",
"pytorch_format",
"=",
"True",
")",
":",
"state... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/checkpoint.py#L321-L409 | |
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | CheckMakePairUsesDeduction | (filename, clean_lines, linenum, error) | Check that make_pair's template arguments are deduced.
G++ 4.6 in C++0x mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linen... | Check that make_pair's template arguments are deduced. | [
"Check",
"that",
"make_pair",
"s",
"template",
"arguments",
"are",
"deduced",
"."
] | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
"""Check that make_pair's template arguments are deduced.
G++ 4.6 in C++0x mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current fi... | [
"def",
"CheckMakePairUsesDeduction",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"raw",
"=",
"clean_lines",
".",
"raw_lines",
"line",
"=",
"raw",
"[",
"linenum",
"]",
"match",
"=",
"_RE_PATTERN_EXPLICIT_MAKEPAIR",
".",
"search",
... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L3796-L3815 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py | python | ImmutableSet.__init__ | (self, iterable=None) | Construct an immutable set from an optional iterable. | Construct an immutable set from an optional iterable. | [
"Construct",
"an",
"immutable",
"set",
"from",
"an",
"optional",
"iterable",
"."
] | def __init__(self, iterable=None):
"""Construct an immutable set from an optional iterable."""
self._hashcode = None
self._data = {}
if iterable is not None:
self._update(iterable) | [
"def",
"__init__",
"(",
"self",
",",
"iterable",
"=",
"None",
")",
":",
"self",
".",
"_hashcode",
"=",
"None",
"self",
".",
"_data",
"=",
"{",
"}",
"if",
"iterable",
"is",
"not",
"None",
":",
"self",
".",
"_update",
"(",
"iterable",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L385-L390 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/strings/accessor.py | python | StringMethods.repeat | (self, repeats) | return self._wrap_result(result) | Duplicate each string in the Series or Index.
Parameters
----------
repeats : int or sequence of int
Same value for all (int) or different value per (sequence).
Returns
-------
Series or Index of object
Series or Index of repeated string objects ... | Duplicate each string in the Series or Index. | [
"Duplicate",
"each",
"string",
"in",
"the",
"Series",
"or",
"Index",
"."
] | def repeat(self, repeats):
"""
Duplicate each string in the Series or Index.
Parameters
----------
repeats : int or sequence of int
Same value for all (int) or different value per (sequence).
Returns
-------
Series or Index of object
... | [
"def",
"repeat",
"(",
"self",
",",
"repeats",
")",
":",
"result",
"=",
"self",
".",
"_data",
".",
"array",
".",
"_str_repeat",
"(",
"repeats",
")",
"return",
"self",
".",
"_wrap_result",
"(",
"result",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/strings/accessor.py#L1407-L1448 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVV.GetDat | (self, *args) | return _snap.TIntIntVV_GetDat(self, *args) | GetDat(TIntIntVV self, TIntV Val) -> TIntV
Parameters:
Val: TVec< TInt,int > const & | GetDat(TIntIntVV self, TIntV Val) -> TIntV | [
"GetDat",
"(",
"TIntIntVV",
"self",
"TIntV",
"Val",
")",
"-",
">",
"TIntV"
] | def GetDat(self, *args):
"""
GetDat(TIntIntVV self, TIntV Val) -> TIntV
Parameters:
Val: TVec< TInt,int > const &
"""
return _snap.TIntIntVV_GetDat(self, *args) | [
"def",
"GetDat",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TIntIntVV_GetDat",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L17343-L17351 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/traced_module/traced_module.py | python | NodeFilter.node_id | (self, node_id: List[int]) | return NodeFilterNodeId(self, node_id) | r"""Filter Nodes by their ``id``.
See :meth:`~.InternalGraph.get_node_by_id` for details. | r"""Filter Nodes by their ``id``.
See :meth:`~.InternalGraph.get_node_by_id` for details. | [
"r",
"Filter",
"Nodes",
"by",
"their",
"id",
".",
"See",
":",
"meth",
":",
"~",
".",
"InternalGraph",
".",
"get_node_by_id",
"for",
"details",
"."
] | def node_id(self, node_id: List[int]):
r"""Filter Nodes by their ``id``.
See :meth:`~.InternalGraph.get_node_by_id` for details.
"""
return NodeFilterNodeId(self, node_id) | [
"def",
"node_id",
"(",
"self",
",",
"node_id",
":",
"List",
"[",
"int",
"]",
")",
":",
"return",
"NodeFilterNodeId",
"(",
"self",
",",
"node_id",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/traced_module/traced_module.py#L1828-L1832 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/trajectory.py | python | HermiteTrajectory.extractDofs | (self,dofs) | return self.constructor([t for t in self.times],[[m[j] for j in dofs] + [m[n+j] for j in dofs] for m in self.milestones]) | Returns a trajectory just over the given DOFs.
Args:
dofs (list of int): the (primary) indices to extract. Each entry
must be < len(milestones[0])/2.
Returns:
HermiteTrajectory: a copy of this trajectory but only over the
given DOFs. | Returns a trajectory just over the given DOFs. | [
"Returns",
"a",
"trajectory",
"just",
"over",
"the",
"given",
"DOFs",
"."
] | def extractDofs(self,dofs):
"""Returns a trajectory just over the given DOFs.
Args:
dofs (list of int): the (primary) indices to extract. Each entry
must be < len(milestones[0])/2.
Returns:
HermiteTrajectory: a copy of this trajectory but only over the
... | [
"def",
"extractDofs",
"(",
"self",
",",
"dofs",
")",
":",
"if",
"len",
"(",
"self",
".",
"times",
")",
"==",
"0",
":",
"return",
"self",
".",
"constructor",
"(",
")",
"n",
"=",
"len",
"(",
"self",
".",
"milestones",
"[",
"0",
"]",
")",
"//",
"2... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/trajectory.py#L1017-L1034 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pexpect.py | python | ExceptionPexpect.__filter_not_pexpect | (self, trace_list_item) | This returns True if list item 0 the string 'pexpect.py' in it. | This returns True if list item 0 the string 'pexpect.py' in it. | [
"This",
"returns",
"True",
"if",
"list",
"item",
"0",
"the",
"string",
"pexpect",
".",
"py",
"in",
"it",
"."
] | def __filter_not_pexpect(self, trace_list_item):
"""This returns True if list item 0 the string 'pexpect.py' in it. """
if trace_list_item[0].find('pexpect.py') == -1:
return True
else:
return False | [
"def",
"__filter_not_pexpect",
"(",
"self",
",",
"trace_list_item",
")",
":",
"if",
"trace_list_item",
"[",
"0",
"]",
".",
"find",
"(",
"'pexpect.py'",
")",
"==",
"-",
"1",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pexpect.py#L122-L128 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/browser/browser.py | python | Browser.Foreground | (self) | return self._browser_backend.Foreground() | Ensure the browser application is moved to the foreground. | Ensure the browser application is moved to the foreground. | [
"Ensure",
"the",
"browser",
"application",
"is",
"moved",
"to",
"the",
"foreground",
"."
] | def Foreground(self):
"""Ensure the browser application is moved to the foreground."""
return self._browser_backend.Foreground() | [
"def",
"Foreground",
"(",
"self",
")",
":",
"return",
"self",
".",
"_browser_backend",
".",
"Foreground",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/browser/browser.py#L268-L270 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/bug_reducer/bug_reducer/swift_tools.py | python | SwiftTools.sil_passpipeline_dumper | (self) | return self._get_tool('sil-passpipeline-dumper') | Return the path to sil-passpipeline-dumper in the specified swift build
directory. Throws a runtime error if the tool does not exist | Return the path to sil-passpipeline-dumper in the specified swift build
directory. Throws a runtime error if the tool does not exist | [
"Return",
"the",
"path",
"to",
"sil",
"-",
"passpipeline",
"-",
"dumper",
"in",
"the",
"specified",
"swift",
"build",
"directory",
".",
"Throws",
"a",
"runtime",
"error",
"if",
"the",
"tool",
"does",
"not",
"exist"
] | def sil_passpipeline_dumper(self):
"""Return the path to sil-passpipeline-dumper in the specified swift build
directory. Throws a runtime error if the tool does not exist
"""
return self._get_tool('sil-passpipeline-dumper') | [
"def",
"sil_passpipeline_dumper",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_tool",
"(",
"'sil-passpipeline-dumper'",
")"
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/bug_reducer/bug_reducer/swift_tools.py#L68-L73 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/metrics/pairwise.py | python | _precompute_metric_params | (X, Y, metric=None, **kwds) | return {} | Precompute data-derived metric parameters if not provided | Precompute data-derived metric parameters if not provided | [
"Precompute",
"data",
"-",
"derived",
"metric",
"parameters",
"if",
"not",
"provided"
] | def _precompute_metric_params(X, Y, metric=None, **kwds):
"""Precompute data-derived metric parameters if not provided
"""
if metric == "seuclidean" and 'V' not in kwds:
if X is Y:
V = np.var(X, axis=0, ddof=1)
else:
V = np.var(np.vstack([X, Y]), axis=0, ddof=1)
... | [
"def",
"_precompute_metric_params",
"(",
"X",
",",
"Y",
",",
"metric",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"metric",
"==",
"\"seuclidean\"",
"and",
"'V'",
"not",
"in",
"kwds",
":",
"if",
"X",
"is",
"Y",
":",
"V",
"=",
"np",
".",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/pairwise.py#L1429-L1444 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGrid.DedicateKey | (*args, **kwargs) | return _propgrid.PropertyGrid_DedicateKey(*args, **kwargs) | DedicateKey(self, int keycode) | DedicateKey(self, int keycode) | [
"DedicateKey",
"(",
"self",
"int",
"keycode",
")"
] | def DedicateKey(*args, **kwargs):
"""DedicateKey(self, int keycode)"""
return _propgrid.PropertyGrid_DedicateKey(*args, **kwargs) | [
"def",
"DedicateKey",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_DedicateKey",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1986-L1988 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Task.py | python | compile_fun | (line, shell=False) | Parse a string expression such as "${CC} ${SRC} -o ${TGT}" and return a pair containing:
* the function created (compiled) for use as :py:meth:`waflib.Task.TaskBase.run`
* the list of variables that imply a dependency from self.env
for example::
from waflib.Task import compile_fun
compile_fun('cxx', '${CXX} -... | Parse a string expression such as "${CC} ${SRC} -o ${TGT}" and return a pair containing: | [
"Parse",
"a",
"string",
"expression",
"such",
"as",
"$",
"{",
"CC",
"}",
"$",
"{",
"SRC",
"}",
"-",
"o",
"$",
"{",
"TGT",
"}",
"and",
"return",
"a",
"pair",
"containing",
":"
] | def compile_fun(line, shell=False):
"""
Parse a string expression such as "${CC} ${SRC} -o ${TGT}" and return a pair containing:
* the function created (compiled) for use as :py:meth:`waflib.Task.TaskBase.run`
* the list of variables that imply a dependency from self.env
for example::
from waflib.Task import ... | [
"def",
"compile_fun",
"(",
"line",
",",
"shell",
"=",
"False",
")",
":",
"if",
"line",
".",
"find",
"(",
"'<'",
")",
">",
"0",
"or",
"line",
".",
"find",
"(",
"'>'",
")",
">",
"0",
"or",
"line",
".",
"find",
"(",
"'&&'",
")",
">",
"0",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L1215-L1240 | ||
facebook/fboss | 60063db1df37c2ec0e7dcd0955c54885ea9bf7f0 | fboss/py/fboss/cli/commands/port.py | python | PortStatusDetailCmd._print_transceiver_details | (self, tid) | Print details about transceiver | Print details about transceiver | [
"Print",
"details",
"about",
"transceiver"
] | def _print_transceiver_details(self, tid): # noqa
"""Print details about transceiver"""
info = self._info_resp.get(tid)
ch_to_port = self._t_to_p[tid]
if not info or info.present is False:
self._print_transceiver_ports(ch_to_port.values(), info)
return
... | [
"def",
"_print_transceiver_details",
"(",
"self",
",",
"tid",
")",
":",
"# noqa",
"info",
"=",
"self",
".",
"_info_resp",
".",
"get",
"(",
"tid",
")",
"ch_to_port",
"=",
"self",
".",
"_t_to_p",
"[",
"tid",
"]",
"if",
"not",
"info",
"or",
"info",
".",
... | https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/fboss/py/fboss/cli/commands/port.py#L923-L993 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/bindings/python/clang/cindex.py | python | Token.spelling | (self) | return conf.lib.clang_getTokenSpelling(self._tu, self) | The spelling of this token.
This is the textual representation of the token in source. | The spelling of this token. | [
"The",
"spelling",
"of",
"this",
"token",
"."
] | def spelling(self):
"""The spelling of this token.
This is the textual representation of the token in source.
"""
return conf.lib.clang_getTokenSpelling(self._tu, self) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenSpelling",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L3287-L3292 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | ez_setup.py | python | _parse_args | () | return options | Parse the command line for options. | Parse the command line for options. | [
"Parse",
"the",
"command",
"line",
"for",
"options",
"."
] | def _parse_args():
"""Parse the command line for options."""
parser = optparse.OptionParser()
parser.add_option(
'--user', dest='user_install', action='store_true', default=False,
help='install in user site package')
parser.add_option(
'--download-base', dest='download_base', met... | [
"def",
"_parse_args",
"(",
")",
":",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
")",
"parser",
".",
"add_option",
"(",
"'--user'",
",",
"dest",
"=",
"'user_install'",
",",
"action",
"=",
"'store_true'",
",",
"default",
"=",
"False",
",",
"help",
... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/ez_setup.py#L368-L394 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetRectangularSelectionCaretVirtualSpace | (*args, **kwargs) | return _stc.StyledTextCtrl_GetRectangularSelectionCaretVirtualSpace(*args, **kwargs) | GetRectangularSelectionCaretVirtualSpace(self) -> int | GetRectangularSelectionCaretVirtualSpace(self) -> int | [
"GetRectangularSelectionCaretVirtualSpace",
"(",
"self",
")",
"-",
">",
"int"
] | def GetRectangularSelectionCaretVirtualSpace(*args, **kwargs):
"""GetRectangularSelectionCaretVirtualSpace(self) -> int"""
return _stc.StyledTextCtrl_GetRectangularSelectionCaretVirtualSpace(*args, **kwargs) | [
"def",
"GetRectangularSelectionCaretVirtualSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetRectangularSelectionCaretVirtualSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6228-L6230 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/auto_bisect/fetch_build.py | python | Unzip | (file_path, output_dir, verbose=True) | Extracts a zip archive's contents into the given output directory.
This was based on ExtractZip from build/scripts/common/chromium_utils.py.
Args:
file_path: Path of the zip file to extract.
output_dir: Path to the destination directory.
verbose: Whether to print out what is being extracted.
Raises... | Extracts a zip archive's contents into the given output directory. | [
"Extracts",
"a",
"zip",
"archive",
"s",
"contents",
"into",
"the",
"given",
"output",
"directory",
"."
] | def Unzip(file_path, output_dir, verbose=True):
"""Extracts a zip archive's contents into the given output directory.
This was based on ExtractZip from build/scripts/common/chromium_utils.py.
Args:
file_path: Path of the zip file to extract.
output_dir: Path to the destination directory.
verbose: Wh... | [
"def",
"Unzip",
"(",
"file_path",
",",
"output_dir",
",",
"verbose",
"=",
"True",
")",
":",
"_MakeDirectory",
"(",
"output_dir",
")",
"# On Linux and Mac, we use the unzip command because it handles links and",
"# file permissions bits, so achieving this behavior is easier than wit... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/fetch_build.py#L385-L425 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_declaration_list_2 | (t) | declaration_list : declaration_list declaration | declaration_list : declaration_list declaration | [
"declaration_list",
":",
"declaration_list",
"declaration"
] | def p_declaration_list_2(t):
'declaration_list : declaration_list declaration '
pass | [
"def",
"p_declaration_list_2",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L68-L70 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/graph_editor/util.py | python | get_generating_ops | (ts) | return [t.op for t in ts] | Return all the generating ops of the tensors in ts.
Args:
ts: a list of tf.Tensor
Returns:
A list of all the generating tf.Operation of the tensors in ts.
Raises:
TypeError: if ts cannot be converted to a list of tf.Tensor. | Return all the generating ops of the tensors in ts. | [
"Return",
"all",
"the",
"generating",
"ops",
"of",
"the",
"tensors",
"in",
"ts",
"."
] | def get_generating_ops(ts):
"""Return all the generating ops of the tensors in ts.
Args:
ts: a list of tf.Tensor
Returns:
A list of all the generating tf.Operation of the tensors in ts.
Raises:
TypeError: if ts cannot be converted to a list of tf.Tensor.
"""
ts = make_list_of_t(ts, allow_graph=... | [
"def",
"get_generating_ops",
"(",
"ts",
")",
":",
"ts",
"=",
"make_list_of_t",
"(",
"ts",
",",
"allow_graph",
"=",
"False",
")",
"return",
"[",
"t",
".",
"op",
"for",
"t",
"in",
"ts",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/util.py#L199-L210 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/cell.py | python | Cell._recompute_slice_activation | (self, slice_activation=False) | Slice the cell output which would remains in memory. | Slice the cell output which would remains in memory. | [
"Slice",
"the",
"cell",
"output",
"which",
"would",
"remains",
"in",
"memory",
"."
] | def _recompute_slice_activation(self, slice_activation=False):
"""
Slice the cell output which would remains in memory.
"""
for _, value in self._primitives.items():
if value:
value.add_prim_attr("slice_activation", slice_activation)
for cell in self.c... | [
"def",
"_recompute_slice_activation",
"(",
"self",
",",
"slice_activation",
"=",
"False",
")",
":",
"for",
"_",
",",
"value",
"in",
"self",
".",
"_primitives",
".",
"items",
"(",
")",
":",
"if",
"value",
":",
"value",
".",
"add_prim_attr",
"(",
"\"slice_ac... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/cell.py#L1549-L1557 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/dateutil/dateutil/rrule.py | python | rrule.__str__ | (self) | return '\n'.join(output) | Output a string that would generate this RRULE if passed to rrulestr.
This is mostly compatible with RFC5545, except for the
dateutil-specific extension BYEASTER. | Output a string that would generate this RRULE if passed to rrulestr.
This is mostly compatible with RFC5545, except for the
dateutil-specific extension BYEASTER. | [
"Output",
"a",
"string",
"that",
"would",
"generate",
"this",
"RRULE",
"if",
"passed",
"to",
"rrulestr",
".",
"This",
"is",
"mostly",
"compatible",
"with",
"RFC5545",
"except",
"for",
"the",
"dateutil",
"-",
"specific",
"extension",
"BYEASTER",
"."
] | def __str__(self):
"""
Output a string that would generate this RRULE if passed to rrulestr.
This is mostly compatible with RFC5545, except for the
dateutil-specific extension BYEASTER.
"""
output = []
h, m, s = [None] * 3
if self._dtstart:
ou... | [
"def",
"__str__",
"(",
"self",
")",
":",
"output",
"=",
"[",
"]",
"h",
",",
"m",
",",
"s",
"=",
"[",
"None",
"]",
"*",
"3",
"if",
"self",
".",
"_dtstart",
":",
"output",
".",
"append",
"(",
"self",
".",
"_dtstart",
".",
"strftime",
"(",
"'DTSTA... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/dateutil/dateutil/rrule.py#L700-L760 | |
peteanderson80/Matterport3DSimulator | 589d091b111333f9e9f9d6cfd021b2eb68435925 | tasks/R2R/agent.py | python | Seq2SeqAgent.load | (self, encoder_path, decoder_path) | Loads parameters (but not training state) | Loads parameters (but not training state) | [
"Loads",
"parameters",
"(",
"but",
"not",
"training",
"state",
")"
] | def load(self, encoder_path, decoder_path):
''' Loads parameters (but not training state) '''
self.encoder.load_state_dict(torch.load(encoder_path))
self.decoder.load_state_dict(torch.load(decoder_path)) | [
"def",
"load",
"(",
"self",
",",
"encoder_path",
",",
"decoder_path",
")",
":",
"self",
".",
"encoder",
".",
"load_state_dict",
"(",
"torch",
".",
"load",
"(",
"encoder_path",
")",
")",
"self",
".",
"decoder",
".",
"load_state_dict",
"(",
"torch",
".",
"... | https://github.com/peteanderson80/Matterport3DSimulator/blob/589d091b111333f9e9f9d6cfd021b2eb68435925/tasks/R2R/agent.py#L317-L320 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/ops.py | python | Graph.get_all_collection_keys | (self) | Returns a list of collections used in this graph. | Returns a list of collections used in this graph. | [
"Returns",
"a",
"list",
"of",
"collections",
"used",
"in",
"this",
"graph",
"."
] | def get_all_collection_keys(self):
"""Returns a list of collections used in this graph."""
with self._lock:
return [x for x in self._collections if isinstance(x, six.string_types)] | [
"def",
"get_all_collection_keys",
"(",
"self",
")",
":",
"with",
"self",
".",
"_lock",
":",
"return",
"[",
"x",
"for",
"x",
"in",
"self",
".",
"_collections",
"if",
"isinstance",
"(",
"x",
",",
"six",
".",
"string_types",
")",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L2686-L2689 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/MRGetTheta.py | python | MRGetTheta.PyExec | (self) | return | Main execution body | Main execution body | [
"Main",
"execution",
"body"
] | def PyExec(self):
""" Main execution body """
_w=self.getProperty("Workspace").value
angle_offset = self.getProperty("AngleOffset").value
dirpix_overwrite = self.getProperty("DirectPixelOverwrite").value
dangle0_overwrite = self.getProperty("DAngle0Overwrite").value
use_... | [
"def",
"PyExec",
"(",
"self",
")",
":",
"_w",
"=",
"self",
".",
"getProperty",
"(",
"\"Workspace\"",
")",
".",
"value",
"angle_offset",
"=",
"self",
".",
"getProperty",
"(",
"\"AngleOffset\"",
")",
".",
"value",
"dirpix_overwrite",
"=",
"self",
".",
"getPr... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/MRGetTheta.py#L40-L76 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mhlib.py | python | MH.__repr__ | (self) | return 'MH(%r, %r)' % (self.path, self.profile) | String representation. | String representation. | [
"String",
"representation",
"."
] | def __repr__(self):
"""String representation."""
return 'MH(%r, %r)' % (self.path, self.profile) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"'MH(%r, %r)'",
"%",
"(",
"self",
".",
"path",
",",
"self",
".",
"profile",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mhlib.py#L114-L116 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/error_interpolation.py | python | interpolate | (error_message, graph) | return "".join(
itertools.chain(*six.moves.zip_longest(seps, subs, fillvalue=""))) | Interpolates an error message.
The error message can contain tags of the form `{{type name}}` which will be
replaced. For example: "{{node <name>}}" would get expanded to:
"node <name>(defined at <path>)".
Args:
error_message: A string to interpolate.
graph: ops.Graph object containing all nodes refer... | Interpolates an error message. | [
"Interpolates",
"an",
"error",
"message",
"."
] | def interpolate(error_message, graph):
"""Interpolates an error message.
The error message can contain tags of the form `{{type name}}` which will be
replaced. For example: "{{node <name>}}" would get expanded to:
"node <name>(defined at <path>)".
Args:
error_message: A string to interpolate.
graph:... | [
"def",
"interpolate",
"(",
"error_message",
",",
"graph",
")",
":",
"seps",
",",
"tags",
"=",
"parse_message",
"(",
"error_message",
")",
"subs",
"=",
"[",
"]",
"end_msg",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"tagged_ops",
"=",
"[",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/error_interpolation.py#L424-L480 | |
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/ext/pybind11/tools/clang/cindex.py | python | TranslationUnit.spelling | (self) | return conf.lib.clang_getTranslationUnitSpelling(self) | Get the original translation unit source file name. | Get the original translation unit source file name. | [
"Get",
"the",
"original",
"translation",
"unit",
"source",
"file",
"name",
"."
] | def spelling(self):
"""Get the original translation unit source file name."""
return conf.lib.clang_getTranslationUnitSpelling(self) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTranslationUnitSpelling",
"(",
"self",
")"
] | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L2456-L2458 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | syzygy/build/variable_expansion.py | python | _GetVar | (vars, key_match) | return value | Looks up a variable (in the first group of the RE match |key_match|) and
returns its value. If the variable has a prefix specifying encoding then the
encodings are first applied before returning the value. | Looks up a variable (in the first group of the RE match |key_match|) and
returns its value. If the variable has a prefix specifying encoding then the
encodings are first applied before returning the value. | [
"Looks",
"up",
"a",
"variable",
"(",
"in",
"the",
"first",
"group",
"of",
"the",
"RE",
"match",
"|key_match|",
")",
"and",
"returns",
"its",
"value",
".",
"If",
"the",
"variable",
"has",
"a",
"prefix",
"specifying",
"encoding",
"then",
"the",
"encodings",
... | def _GetVar(vars, key_match):
"""Looks up a variable (in the first group of the RE match |key_match|) and
returns its value. If the variable has a prefix specifying encoding then the
encodings are first applied before returning the value.
"""
# Get the key.
key = key_match.group(1)
# Extract the encodin... | [
"def",
"_GetVar",
"(",
"vars",
",",
"key_match",
")",
":",
"# Get the key.",
"key",
"=",
"key_match",
".",
"group",
"(",
"1",
")",
"# Extract the encoding if one is specified.",
"enc",
"=",
"''",
"m",
"=",
"re",
".",
"match",
"(",
"'^([^:]+):(.*)$'",
",",
"k... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/build/variable_expansion.py#L86-L115 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/quantized/modules/conv.py | python | _ConvNd.get_qconv | (cls, mod, activation_post_process, weight_post_process=None) | r"""Creates a qconv object and returns it. | r"""Creates a qconv object and returns it. | [
"r",
"Creates",
"a",
"qconv",
"object",
"and",
"returns",
"it",
"."
] | def get_qconv(cls, mod, activation_post_process, weight_post_process=None):
r"""Creates a qconv object and returns it.
"""
if weight_post_process is None:
weight_post_process = mod.qconfig.weight()
weight_post_process(mod.weight)
assert weight_post_process.dtype == to... | [
"def",
"get_qconv",
"(",
"cls",
",",
"mod",
",",
"activation_post_process",
",",
"weight_post_process",
"=",
"None",
")",
":",
"if",
"weight_post_process",
"is",
"None",
":",
"weight_post_process",
"=",
"mod",
".",
"qconfig",
".",
"weight",
"(",
")",
"weight_p... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/quantized/modules/conv.py#L192-L212 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._HasExplicitRuleForExtension | (self, spec, extension) | return False | Determine if there's an explicit rule for a particular extension. | Determine if there's an explicit rule for a particular extension. | [
"Determine",
"if",
"there",
"s",
"an",
"explicit",
"rule",
"for",
"a",
"particular",
"extension",
"."
] | def _HasExplicitRuleForExtension(self, spec, extension):
"""Determine if there's an explicit rule for a particular extension."""
for rule in spec.get('rules', []):
if rule['extension'] == extension:
return True
return False | [
"def",
"_HasExplicitRuleForExtension",
"(",
"self",
",",
"spec",
",",
"extension",
")",
":",
"for",
"rule",
"in",
"spec",
".",
"get",
"(",
"'rules'",
",",
"[",
"]",
")",
":",
"if",
"rule",
"[",
"'extension'",
"]",
"==",
"extension",
":",
"return",
"Tru... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py#L829-L834 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py | python | wait | (fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED) | return await _wait(fs, timeout, return_when, loop) | Wait for the Futures and coroutines given by fs to complete.
The sequence futures must not be empty.
Coroutines will be wrapped in Tasks.
Returns two sets of Future: (done, pending).
Usage:
done, pending = await asyncio.wait(fs)
Note: This does not raise TimeoutError! Futures that aren... | Wait for the Futures and coroutines given by fs to complete. | [
"Wait",
"for",
"the",
"Futures",
"and",
"coroutines",
"given",
"by",
"fs",
"to",
"complete",
"."
] | async def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
"""Wait for the Futures and coroutines given by fs to complete.
The sequence futures must not be empty.
Coroutines will be wrapped in Tasks.
Returns two sets of Future: (done, pending).
Usage:
done, pending = awa... | [
"async",
"def",
"wait",
"(",
"fs",
",",
"*",
",",
"loop",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"return_when",
"=",
"ALL_COMPLETED",
")",
":",
"if",
"futures",
".",
"isfuture",
"(",
"fs",
")",
"or",
"coroutines",
".",
"iscoroutine",
"(",
"fs... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py#L361-L389 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py | python | virtual_memory | () | return ret | Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes:
- total:
total physical memory available.
- available:
the memory that can be given instantly to processes without the
system going into swap.
This is calculated by... | Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes: | [
"Return",
"statistics",
"about",
"system",
"memory",
"usage",
"as",
"a",
"namedtuple",
"including",
"the",
"following",
"fields",
"expressed",
"in",
"bytes",
":"
] | def virtual_memory():
"""Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes:
- total:
total physical memory available.
- available:
the memory that can be given instantly to processes without the
system going into swap.... | [
"def",
"virtual_memory",
"(",
")",
":",
"global",
"_TOTAL_PHYMEM",
"ret",
"=",
"_psplatform",
".",
"virtual_memory",
"(",
")",
"# cached for later use in Process.memory_percent()",
"_TOTAL_PHYMEM",
"=",
"ret",
".",
"total",
"return",
"ret"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py#L1928-L1984 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/control_flow_ops.py | python | _Enter | (data, frame_name, is_constant=False, parallel_iterations=10,
use_ref=True, use_input_shape=True, name=None) | Creates or finds a child frame, and makes `data` available to it.
The unique `frame_name` is used by the `Executor` to identify frames. If
`is_constant` is true, `data` is a constant in the child frame; otherwise
it may be changed in the child frame. At most `parallel_iterations`
iterations are run in parallel... | Creates or finds a child frame, and makes `data` available to it. | [
"Creates",
"or",
"finds",
"a",
"child",
"frame",
"and",
"makes",
"data",
"available",
"to",
"it",
"."
] | def _Enter(data, frame_name, is_constant=False, parallel_iterations=10,
use_ref=True, use_input_shape=True, name=None):
"""Creates or finds a child frame, and makes `data` available to it.
The unique `frame_name` is used by the `Executor` to identify frames. If
`is_constant` is true, `data` is a const... | [
"def",
"_Enter",
"(",
"data",
",",
"frame_name",
",",
"is_constant",
"=",
"False",
",",
"parallel_iterations",
"=",
"10",
",",
"use_ref",
"=",
"True",
",",
"use_input_shape",
"=",
"True",
",",
"name",
"=",
"None",
")",
":",
"data",
"=",
"ops",
".",
"in... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/control_flow_ops.py#L188-L242 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | GetStockLabel | (*args, **kwargs) | return _misc_.GetStockLabel(*args, **kwargs) | GetStockLabel(int id, long flags=STOCK_WITH_MNEMONIC) -> String | GetStockLabel(int id, long flags=STOCK_WITH_MNEMONIC) -> String | [
"GetStockLabel",
"(",
"int",
"id",
"long",
"flags",
"=",
"STOCK_WITH_MNEMONIC",
")",
"-",
">",
"String"
] | def GetStockLabel(*args, **kwargs):
"""GetStockLabel(int id, long flags=STOCK_WITH_MNEMONIC) -> String"""
return _misc_.GetStockLabel(*args, **kwargs) | [
"def",
"GetStockLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"GetStockLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L307-L309 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/nn_ops.py | python | erosion2d | (value, kernel, strides, rates, padding, name=None) | Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors.
The `value` tensor has shape `[batch, in_height, in_width, depth]` and the
`kernel` tensor has shape `[kernel_height, kernel_width, depth]`, i.e.,
each input channel is processed independently of the others with its own
structuring functio... | Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors. | [
"Computes",
"the",
"grayscale",
"erosion",
"of",
"4",
"-",
"D",
"value",
"and",
"3",
"-",
"D",
"kernel",
"tensors",
"."
] | def erosion2d(value, kernel, strides, rates, padding, name=None):
"""Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors.
The `value` tensor has shape `[batch, in_height, in_width, depth]` and the
`kernel` tensor has shape `[kernel_height, kernel_width, depth]`, i.e.,
each input channel is p... | [
"def",
"erosion2d",
"(",
"value",
",",
"kernel",
",",
"strides",
",",
"rates",
",",
"padding",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"erosion2d\"",
",",
"[",
"value",
",",
"kernel",
"]",
")",
"as",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/nn_ops.py#L1872-L1926 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/expression.py | python | Expression.is_psd | (self) | return False | Is the expression a positive semidefinite matrix? | Is the expression a positive semidefinite matrix? | [
"Is",
"the",
"expression",
"a",
"positive",
"semidefinite",
"matrix?"
] | def is_psd(self) -> bool:
"""Is the expression a positive semidefinite matrix?
"""
# Default to False.
return False | [
"def",
"is_psd",
"(",
"self",
")",
"->",
"bool",
":",
"# Default to False.",
"return",
"False"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L296-L300 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/kernel/environment.py | python | is_64bit | () | Returns True if the current platform is 64-bit | Returns True if the current platform is 64-bit | [
"Returns",
"True",
"if",
"the",
"current",
"platform",
"is",
"64",
"-",
"bit"
] | def is_64bit():
"""
Returns True if the current platform is 64-bit
"""
if is_mac():
# See Python documentation on platform module for why this is different
return _sys.maxsize > 2**32
else:
bits = _platform.architecture()[0]
return bits == '64bit' | [
"def",
"is_64bit",
"(",
")",
":",
"if",
"is_mac",
"(",
")",
":",
"# See Python documentation on platform module for why this is different",
"return",
"_sys",
".",
"maxsize",
">",
"2",
"**",
"32",
"else",
":",
"bits",
"=",
"_platform",
".",
"architecture",
"(",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/kernel/environment.py#L52-L61 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/functions.py | python | Function.find_all_with_name | (self, name, depth=0) | return graph.find_all_with_name(self, name, depth) | Returns a list of primitive function with ``name`` in the graph
starting from this node. Throws an exception if ``name`` occurs
multiple times. If you expect only one function to be returned, use
:func:`find_by_name`.
Example:
>>> a = C.input_variable(shape=1, name='i')
... | Returns a list of primitive function with ``name`` in the graph
starting from this node. Throws an exception if ``name`` occurs
multiple times. If you expect only one function to be returned, use
:func:`find_by_name`. | [
"Returns",
"a",
"list",
"of",
"primitive",
"function",
"with",
"name",
"in",
"the",
"graph",
"starting",
"from",
"this",
"node",
".",
"Throws",
"an",
"exception",
"if",
"name",
"occurs",
"multiple",
"times",
".",
"If",
"you",
"expect",
"only",
"one",
"func... | def find_all_with_name(self, name, depth=0):
'''
Returns a list of primitive function with ``name`` in the graph
starting from this node. Throws an exception if ``name`` occurs
multiple times. If you expect only one function to be returned, use
:func:`find_by_name`.
Exam... | [
"def",
"find_all_with_name",
"(",
"self",
",",
"name",
",",
"depth",
"=",
"0",
")",
":",
"from",
"cntk",
".",
"logging",
"import",
"graph",
"return",
"graph",
".",
"find_all_with_name",
"(",
"self",
",",
"name",
",",
"depth",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/functions.py#L1230-L1258 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.