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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
facebookresearch/faiss | eb8781557f556505ca93f6f21fff932e17f0d9e0 | benchs/link_and_code/bench_link_and_code.py | python | get_neighbors | (hnsw, i, level) | return [hnsw.neighbors.at(j) for j in range(be[0], be[1])] | list the neighbors for node i at level | list the neighbors for node i at level | [
"list",
"the",
"neighbors",
"for",
"node",
"i",
"at",
"level"
] | def get_neighbors(hnsw, i, level):
" list the neighbors for node i at level "
assert i < hnsw.levels.size()
assert level < hnsw.levels.at(i)
be = np.empty(2, 'uint64')
hnsw.neighbor_range(i, level, faiss.swig_ptr(be), faiss.swig_ptr(be[1:]))
return [hnsw.neighbors.at(j) for j in range(be[0], be[... | [
"def",
"get_neighbors",
"(",
"hnsw",
",",
"i",
",",
"level",
")",
":",
"assert",
"i",
"<",
"hnsw",
".",
"levels",
".",
"size",
"(",
")",
"assert",
"level",
"<",
"hnsw",
".",
"levels",
".",
"at",
"(",
"i",
")",
"be",
"=",
"np",
".",
"empty",
"("... | https://github.com/facebookresearch/faiss/blob/eb8781557f556505ca93f6f21fff932e17f0d9e0/benchs/link_and_code/bench_link_and_code.py#L262-L268 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py | python | Target | (filename) | return os.path.splitext(filename)[0] + '.o' | Translate a compilable filename to its .o target. | Translate a compilable filename to its .o target. | [
"Translate",
"a",
"compilable",
"filename",
"to",
"its",
".",
"o",
"target",
"."
] | def Target(filename):
"""Translate a compilable filename to its .o target."""
return os.path.splitext(filename)[0] + '.o' | [
"def",
"Target",
"(",
"filename",
")",
":",
"return",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
"0",
"]",
"+",
"'.o'"
] | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py#L566-L568 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/freeview.py | python | Freeview.vol | (self, volume, swap_batch_dim=False, lut=None, **kwargs) | Loads a volume in the sessions. If the volume provided is not a filepath,
then the input will be saved as a volume in a temporary directory. Any
key/value tags allowed on the command line can be provided as arguments.
Args:
volume: An existing volume filename, numpy array, or fs arr... | Loads a volume in the sessions. If the volume provided is not a filepath,
then the input will be saved as a volume in a temporary directory. Any
key/value tags allowed on the command line can be provided as arguments. | [
"Loads",
"a",
"volume",
"in",
"the",
"sessions",
".",
"If",
"the",
"volume",
"provided",
"is",
"not",
"a",
"filepath",
"then",
"the",
"input",
"will",
"be",
"saved",
"as",
"a",
"volume",
"in",
"a",
"temporary",
"directory",
".",
"Any",
"key",
"/",
"val... | def vol(self, volume, swap_batch_dim=False, lut=None, **kwargs):
'''
Loads a volume in the sessions. If the volume provided is not a filepath,
then the input will be saved as a volume in a temporary directory. Any
key/value tags allowed on the command line can be provided as arguments.
... | [
"def",
"vol",
"(",
"self",
",",
"volume",
",",
"swap_batch_dim",
"=",
"False",
",",
"lut",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# convert the input to a proper file (if it's not one already)",
"filename",
"=",
"self",
".",
"_vol_to_file",
"(",
"volum... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/freeview.py#L73-L92 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | python | Retry.get_backoff_time | (self) | return min(self.BACKOFF_MAX, backoff_value) | Formula for computing the current backoff
:rtype: float | Formula for computing the current backoff | [
"Formula",
"for",
"computing",
"the",
"current",
"backoff"
] | def get_backoff_time(self):
""" Formula for computing the current backoff
:rtype: float
"""
if self._observed_errors <= 1:
return 0
backoff_value = self.backoff_factor * (2 ** (self._observed_errors - 1))
return min(self.BACKOFF_MAX, backoff_value) | [
"def",
"get_backoff_time",
"(",
"self",
")",
":",
"if",
"self",
".",
"_observed_errors",
"<=",
"1",
":",
"return",
"0",
"backoff_value",
"=",
"self",
".",
"backoff_factor",
"*",
"(",
"2",
"**",
"(",
"self",
".",
"_observed_errors",
"-",
"1",
")",
")",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py#L158-L167 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py | python | ValidateChecksums | (reference_checksums,
new_checksums,
allow_missing_projects=False) | return True | Validates that reference_checksums and new_checksums match.
Args:
reference_checksums: a dict of reference checksums, mapping from a project
name to a project checksum.
new_checksums: a dict of checksums to be checked, mapping from a project
name to a project checksum.
allow_missing_projects:... | Validates that reference_checksums and new_checksums match. | [
"Validates",
"that",
"reference_checksums",
"and",
"new_checksums",
"match",
"."
] | def ValidateChecksums(reference_checksums,
new_checksums,
allow_missing_projects=False):
"""Validates that reference_checksums and new_checksums match.
Args:
reference_checksums: a dict of reference checksums, mapping from a project
name to a project checksum.
... | [
"def",
"ValidateChecksums",
"(",
"reference_checksums",
",",
"new_checksums",
",",
"allow_missing_projects",
"=",
"False",
")",
":",
"if",
"not",
"allow_missing_projects",
":",
"if",
"len",
"(",
"new_checksums",
")",
"!=",
"len",
"(",
"reference_checksums",
")",
"... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py#L160-L194 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | IMetadataProvider.has_metadata | (name) | Does the package's distribution contain the named metadata? | Does the package's distribution contain the named metadata? | [
"Does",
"the",
"package",
"s",
"distribution",
"contain",
"the",
"named",
"metadata?"
] | def has_metadata(name):
"""Does the package's distribution contain the named metadata?""" | [
"def",
"has_metadata",
"(",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L1005-L1007 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | _GetWhileContext | (op) | return ctxt | Get the WhileContext to which this op belongs. | Get the WhileContext to which this op belongs. | [
"Get",
"the",
"WhileContext",
"to",
"which",
"this",
"op",
"belongs",
"."
] | def _GetWhileContext(op):
"""Get the WhileContext to which this op belongs."""
ctxt = op._get_control_flow_context()
if ctxt:
ctxt = ctxt.GetWhileContext()
return ctxt | [
"def",
"_GetWhileContext",
"(",
"op",
")",
":",
"ctxt",
"=",
"op",
".",
"_get_control_flow_context",
"(",
")",
"if",
"ctxt",
":",
"ctxt",
"=",
"ctxt",
".",
"GetWhileContext",
"(",
")",
"return",
"ctxt"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L795-L800 | |
pybox2d/pybox2d | 09643321fd363f0850087d1bde8af3f4afd82163 | library/Box2D/examples/pgu/gui/app.py | python | App.init | (self, widget=None, screen=None, area=None) | Initialize the application.
Keyword arguments:
widget -- the top-level widget in the application
screen -- the pygame surface to render to
area -- the rectangle (within 'screen') to use for rendering | Initialize the application. | [
"Initialize",
"the",
"application",
"."
] | def init(self, widget=None, screen=None, area=None):
"""Initialize the application.
Keyword arguments:
widget -- the top-level widget in the application
screen -- the pygame surface to render to
area -- the rectangle (within 'screen') to use for rendering
"""... | [
"def",
"init",
"(",
"self",
",",
"widget",
"=",
"None",
",",
"screen",
"=",
"None",
",",
"area",
"=",
"None",
")",
":",
"self",
".",
"set_global_app",
"(",
")",
"if",
"(",
"widget",
")",
":",
"# Set the top-level widget",
"self",
".",
"widget",
"=",
... | https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/pgu/gui/app.py#L99-L136 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/profiling.py | python | Profiler._parse_parameter_for_ascend | (self, **kwargs) | Parse parameter in Proflier when the device target is Ascend. | Parse parameter in Proflier when the device target is Ascend. | [
"Parse",
"parameter",
"in",
"Proflier",
"when",
"the",
"device",
"target",
"is",
"Ascend",
"."
] | def _parse_parameter_for_ascend(self, **kwargs):
"""Parse parameter in Proflier when the device target is Ascend."""
if 'optypes_not_deal' in kwargs:
deprecated('optypes_not_deal', '1.6')
optypes_not_deal = kwargs.pop("optypes_not_deal", "Variable")
if not isinstance(optypes_... | [
"def",
"_parse_parameter_for_ascend",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'optypes_not_deal'",
"in",
"kwargs",
":",
"deprecated",
"(",
"'optypes_not_deal'",
",",
"'1.6'",
")",
"optypes_not_deal",
"=",
"kwargs",
".",
"pop",
"(",
"\"optypes_not_... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/profiling.py#L237-L278 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/outbuff.py | python | ProcessThreadBase.DoPopen | (self) | Open the process
Override in a subclass to implement custom process opening
@return: subprocess.Popen instance | Open the process
Override in a subclass to implement custom process opening
@return: subprocess.Popen instance | [
"Open",
"the",
"process",
"Override",
"in",
"a",
"subclass",
"to",
"implement",
"custom",
"process",
"opening",
"@return",
":",
"subprocess",
".",
"Popen",
"instance"
] | def DoPopen(self):
"""Open the process
Override in a subclass to implement custom process opening
@return: subprocess.Popen instance
"""
raise NotImplementedError("Must implement DoPopen in subclasses!") | [
"def",
"DoPopen",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Must implement DoPopen in subclasses!\"",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/outbuff.py#L818-L824 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_basestc.py | python | EditraBaseStc.BackTab | (self) | Unindent or remove excess whitespace to left of cursor | Unindent or remove excess whitespace to left of cursor | [
"Unindent",
"or",
"remove",
"excess",
"whitespace",
"to",
"left",
"of",
"cursor"
] | def BackTab(self):
"""Unindent or remove excess whitespace to left of cursor"""
sel = self.GetSelection()
if sel[0] == sel[1]:
# There is no selection
cpos = self.GetCurrentPos()
cline = self.GetCurrentLine()
cipos = self.GetLineIndentPosition(clin... | [
"def",
"BackTab",
"(",
"self",
")",
":",
"sel",
"=",
"self",
".",
"GetSelection",
"(",
")",
"if",
"sel",
"[",
"0",
"]",
"==",
"sel",
"[",
"1",
"]",
":",
"# There is no selection",
"cpos",
"=",
"self",
".",
"GetCurrentPos",
"(",
")",
"cline",
"=",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_basestc.py#L258-L308 | ||
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/lib/hl_api_spatial.py | python | SelectNodesByMask | (layer, anchor, mask_obj) | return NodeCollection(sorted(node_id_list)) | Obtain the node IDs inside a masked area of a spatially distributed population.
The function finds and returns all the node IDs inside a given mask of a
`layer`. The node IDs are returned as a `NodeCollection`. The function works on both 2-dimensional and
3-dimensional masks and layers. All mask types are ... | Obtain the node IDs inside a masked area of a spatially distributed population. | [
"Obtain",
"the",
"node",
"IDs",
"inside",
"a",
"masked",
"area",
"of",
"a",
"spatially",
"distributed",
"population",
"."
] | def SelectNodesByMask(layer, anchor, mask_obj):
"""
Obtain the node IDs inside a masked area of a spatially distributed population.
The function finds and returns all the node IDs inside a given mask of a
`layer`. The node IDs are returned as a `NodeCollection`. The function works on both 2-dimensional... | [
"def",
"SelectNodesByMask",
"(",
"layer",
",",
"anchor",
",",
"mask_obj",
")",
":",
"if",
"not",
"isinstance",
"(",
"layer",
",",
"NodeCollection",
")",
":",
"raise",
"TypeError",
"(",
"\"layer must be a NodeCollection.\"",
")",
"mask_datum",
"=",
"mask_obj",
".... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_spatial.py#L813-L846 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/sax/xmlreader.py | python | XMLReader.getDTDHandler | (self) | return self._dtd_handler | Returns the current DTD handler. | Returns the current DTD handler. | [
"Returns",
"the",
"current",
"DTD",
"handler",
"."
] | def getDTDHandler(self):
"Returns the current DTD handler."
return self._dtd_handler | [
"def",
"getDTDHandler",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dtd_handler"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/xmlreader.py#L42-L44 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/warn.py | python | fatal | (msg,exit_val=1) | Deprecated
Equivalent to warn(msg,exit_val=exit_val,level=4). | Deprecated
Equivalent to warn(msg,exit_val=exit_val,level=4). | [
"Deprecated",
"Equivalent",
"to",
"warn",
"(",
"msg",
"exit_val",
"=",
"exit_val",
"level",
"=",
"4",
")",
"."
] | def fatal(msg,exit_val=1):
"""Deprecated
Equivalent to warn(msg,exit_val=exit_val,level=4)."""
warn(msg,exit_val=exit_val,level=4) | [
"def",
"fatal",
"(",
"msg",
",",
"exit_val",
"=",
"1",
")",
":",
"warn",
"(",
"msg",
",",
"exit_val",
"=",
"exit_val",
",",
"level",
"=",
"4",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/warn.py#L60-L65 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/block.py | python | Block.get_dot_string | (
self,
function_name="main",
prefix_id=0,
highlight_debug_op_types=None,
highlight_debug_op_names=None,
) | return dotstring | Return the dot string that can be used to show the block
with dot. Const ops are not added to the dot string.
* Input vars : yellow
* output vars : goldenrod2
* op names that user wants to highlight, provided in "highlight_debug_op_names": cyan
* op types that user wants to high... | Return the dot string that can be used to show the block
with dot. Const ops are not added to the dot string. | [
"Return",
"the",
"dot",
"string",
"that",
"can",
"be",
"used",
"to",
"show",
"the",
"block",
"with",
"dot",
".",
"Const",
"ops",
"are",
"not",
"added",
"to",
"the",
"dot",
"string",
"."
] | def get_dot_string(
self,
function_name="main",
prefix_id=0,
highlight_debug_op_types=None,
highlight_debug_op_names=None,
):
"""
Return the dot string that can be used to show the block
with dot. Const ops are not added to the dot string.
* I... | [
"def",
"get_dot_string",
"(",
"self",
",",
"function_name",
"=",
"\"main\"",
",",
"prefix_id",
"=",
"0",
",",
"highlight_debug_op_types",
"=",
"None",
",",
"highlight_debug_op_names",
"=",
"None",
",",
")",
":",
"if",
"highlight_debug_op_types",
"is",
"None",
":... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/block.py#L772-L822 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/property_set.py | python | create | (raw_properties = []) | return __cache [key] | Creates a new 'PropertySet' instance for the given raw properties,
or returns an already existing one. | Creates a new 'PropertySet' instance for the given raw properties,
or returns an already existing one. | [
"Creates",
"a",
"new",
"PropertySet",
"instance",
"for",
"the",
"given",
"raw",
"properties",
"or",
"returns",
"an",
"already",
"existing",
"one",
"."
] | def create (raw_properties = []):
""" Creates a new 'PropertySet' instance for the given raw properties,
or returns an already existing one.
"""
# FIXME: propagate to callers.
if len(raw_properties) > 0 and isinstance(raw_properties[0], property.Property):
x = raw_properties
else: ... | [
"def",
"create",
"(",
"raw_properties",
"=",
"[",
"]",
")",
":",
"# FIXME: propagate to callers.",
"if",
"len",
"(",
"raw_properties",
")",
">",
"0",
"and",
"isinstance",
"(",
"raw_properties",
"[",
"0",
"]",
",",
"property",
".",
"Property",
")",
":",
"x"... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/property_set.py#L32-L51 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/sim/settle.py | python | settle | (world,obj,
forcedir=(0,0,-1),forcept=(0,0,0),
settletol=1e-4,orientationDamping=0.0,
perturb=0,margin=None,
debug=False) | return (body.getObjectTransform(),tdict) | Assuming that all other elements in the world besides object are frozen,
this "settles" the object by applying a force in the direction forcedir
and simulating until the object stops moving.
An exception is raised if the object is already colliding with the world.
Args:
world (WorldModel): the... | Assuming that all other elements in the world besides object are frozen,
this "settles" the object by applying a force in the direction forcedir
and simulating until the object stops moving. | [
"Assuming",
"that",
"all",
"other",
"elements",
"in",
"the",
"world",
"besides",
"object",
"are",
"frozen",
"this",
"settles",
"the",
"object",
"by",
"applying",
"a",
"force",
"in",
"the",
"direction",
"forcedir",
"and",
"simulating",
"until",
"the",
"object",... | def settle(world,obj,
forcedir=(0,0,-1),forcept=(0,0,0),
settletol=1e-4,orientationDamping=0.0,
perturb=0,margin=None,
debug=False):
"""Assuming that all other elements in the world besides object are frozen,
this "settles" the object by applying a force in the direction forcedir
and simulat... | [
"def",
"settle",
"(",
"world",
",",
"obj",
",",
"forcedir",
"=",
"(",
"0",
",",
"0",
",",
"-",
"1",
")",
",",
"forcept",
"=",
"(",
"0",
",",
"0",
",",
"0",
")",
",",
"settletol",
"=",
"1e-4",
",",
"orientationDamping",
"=",
"0.0",
",",
"perturb... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/sim/settle.py#L11-L291 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/numbers.py | python | Integral.__pow__ | (self, exponent, modulus=None) | self ** exponent % modulus, but maybe faster.
Accept the modulus argument if you want to support the
3-argument version of pow(). Raise a TypeError if exponent < 0
or any argument isn't Integral. Otherwise, just implement the
2-argument version described in Complex. | self ** exponent % modulus, but maybe faster. | [
"self",
"**",
"exponent",
"%",
"modulus",
"but",
"maybe",
"faster",
"."
] | def __pow__(self, exponent, modulus=None):
"""self ** exponent % modulus, but maybe faster.
Accept the modulus argument if you want to support the
3-argument version of pow(). Raise a TypeError if exponent < 0
or any argument isn't Integral. Otherwise, just implement the
2-argum... | [
"def",
"__pow__",
"(",
"self",
",",
"exponent",
",",
"modulus",
"=",
"None",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/numbers.py#L310-L318 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/report.py | python | assemble_cover | (output_dir, prefix, args, fragments) | Put together the fragments into a final report. | Put together the fragments into a final report. | [
"Put",
"together",
"the",
"fragments",
"into",
"a",
"final",
"report",
"."
] | def assemble_cover(output_dir, prefix, args, fragments):
""" Put together the fragments into a final report. """
import getpass
import socket
import datetime
if args.html_title is None:
args.html_title = os.path.basename(prefix) + ' - analyzer results'
with open(os.path.join(output_di... | [
"def",
"assemble_cover",
"(",
"output_dir",
",",
"prefix",
",",
"args",
",",
"fragments",
")",
":",
"import",
"getpass",
"import",
"socket",
"import",
"datetime",
"if",
"args",
".",
"html_title",
"is",
"None",
":",
"args",
".",
"html_title",
"=",
"os",
"."... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/report.py#L101-L146 | ||
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Iface.checkpoint | (self, session, table_id) | Parameters:
- session
- table_id | Parameters:
- session
- table_id | [
"Parameters",
":",
"-",
"session",
"-",
"table_id"
] | def checkpoint(self, session, table_id):
"""
Parameters:
- session
- table_id
"""
pass | [
"def",
"checkpoint",
"(",
"self",
",",
"session",
",",
"table_id",
")",
":",
"pass"
] | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L836-L843 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/encoding.py | python | read_plain_boolean | (raw_bytes, count) | return out[:count] | Read `count` booleans using the plain encoding. | Read `count` booleans using the plain encoding. | [
"Read",
"count",
"booleans",
"using",
"the",
"plain",
"encoding",
"."
] | def read_plain_boolean(raw_bytes, count):
"""Read `count` booleans using the plain encoding."""
data = np.frombuffer(raw_bytes, dtype='uint8')
padded = len(raw_bytes) * 8
out = np.empty(padded, dtype=bool)
unpack_boolean(data, out)
return out[:count] | [
"def",
"read_plain_boolean",
"(",
"raw_bytes",
",",
"count",
")",
":",
"data",
"=",
"np",
".",
"frombuffer",
"(",
"raw_bytes",
",",
"dtype",
"=",
"'uint8'",
")",
"padded",
"=",
"len",
"(",
"raw_bytes",
")",
"*",
"8",
"out",
"=",
"np",
".",
"empty",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/encoding.py#L25-L31 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/configobj.py | python | Section.__getitem__ | (self, key) | return val | Fetch the item and do string interpolation. | Fetch the item and do string interpolation. | [
"Fetch",
"the",
"item",
"and",
"do",
"string",
"interpolation",
"."
] | def __getitem__(self, key):
"""Fetch the item and do string interpolation."""
val = dict.__getitem__(self, key)
if self.main.interpolation:
if isinstance(val, basestring):
return self._interpolate(key, val)
if isinstance(val, list):
def _c... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"val",
"=",
"dict",
".",
"__getitem__",
"(",
"self",
",",
"key",
")",
"if",
"self",
".",
"main",
".",
"interpolation",
":",
"if",
"isinstance",
"(",
"val",
",",
"basestring",
")",
":",
"return"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/configobj.py#L565-L579 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/toolset.py | python | requirements | () | return __requirements | Return the list of global 'toolset requirements'.
Those requirements will be automatically added to the requirements of any main target. | Return the list of global 'toolset requirements'.
Those requirements will be automatically added to the requirements of any main target. | [
"Return",
"the",
"list",
"of",
"global",
"toolset",
"requirements",
".",
"Those",
"requirements",
"will",
"be",
"automatically",
"added",
"to",
"the",
"requirements",
"of",
"any",
"main",
"target",
"."
] | def requirements():
"""Return the list of global 'toolset requirements'.
Those requirements will be automatically added to the requirements of any main target."""
return __requirements | [
"def",
"requirements",
"(",
")",
":",
"return",
"__requirements"
] | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/toolset.py#L368-L371 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/turtle.py | python | ScrolledCanvas.cget | (self, *args, **kwargs) | return self._canvas.cget(*args, **kwargs) | 'forward' method, which canvas itself has inherited... | 'forward' method, which canvas itself has inherited... | [
"forward",
"method",
"which",
"canvas",
"itself",
"has",
"inherited",
"..."
] | def cget(self, *args, **kwargs):
""" 'forward' method, which canvas itself has inherited...
"""
return self._canvas.cget(*args, **kwargs) | [
"def",
"cget",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_canvas",
".",
"cget",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L403-L406 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Entry.icursor | (self, index) | Insert cursor at INDEX. | Insert cursor at INDEX. | [
"Insert",
"cursor",
"at",
"INDEX",
"."
] | def icursor(self, index):
"""Insert cursor at INDEX."""
self.tk.call(self._w, 'icursor', index) | [
"def",
"icursor",
"(",
"self",
",",
"index",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'icursor'",
",",
"index",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L2683-L2685 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | PyEvent.__init__ | (self, *args, **kwargs) | __init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent | __init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent | [
"__init__",
"(",
"self",
"int",
"winid",
"=",
"0",
"EventType",
"eventType",
"=",
"wxEVT_NULL",
")",
"-",
">",
"PyEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
_core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
self._SetSelf(self) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"PyEvent_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_PyEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_SetSelf",
"(... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7583-L7586 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/NonIDF_Properties.py | python | NonIDF_Properties.print_diag_results | (self) | return True | property-sink used in diagnostics | property-sink used in diagnostics | [
"property",
"-",
"sink",
"used",
"in",
"diagnostics"
] | def print_diag_results(self):
""" property-sink used in diagnostics """
return True | [
"def",
"print_diag_results",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/NonIDF_Properties.py#L168-L170 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/minpack.py | python | curve_fit | (f, xdata, ydata, p0=None, sigma=None, absolute_sigma=False,
check_finite=True, bounds=(-np.inf, np.inf), method=None,
jac=None, **kwargs) | Use non-linear least squares to fit a function, f, to data.
Assumes ``ydata = f(xdata, *params) + eps``
Parameters
----------
f : callable
The model function, f(x, ...). It must take the independent
variable as the first argument and the parameters to fit as
separate remaining... | Use non-linear least squares to fit a function, f, to data. | [
"Use",
"non",
"-",
"linear",
"least",
"squares",
"to",
"fit",
"a",
"function",
"f",
"to",
"data",
"."
] | def curve_fit(f, xdata, ydata, p0=None, sigma=None, absolute_sigma=False,
check_finite=True, bounds=(-np.inf, np.inf), method=None,
jac=None, **kwargs):
"""
Use non-linear least squares to fit a function, f, to data.
Assumes ``ydata = f(xdata, *params) + eps``
Parameters
... | [
"def",
"curve_fit",
"(",
"f",
",",
"xdata",
",",
"ydata",
",",
"p0",
"=",
"None",
",",
"sigma",
"=",
"None",
",",
"absolute_sigma",
"=",
"False",
",",
"check_finite",
"=",
"True",
",",
"bounds",
"=",
"(",
"-",
"np",
".",
"inf",
",",
"np",
".",
"i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/minpack.py#L502-L768 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_constant_expression_opt_1 | (t) | constant_expression_opt : empty | constant_expression_opt : empty | [
"constant_expression_opt",
":",
"empty"
] | def p_constant_expression_opt_1(t):
'constant_expression_opt : empty'
pass | [
"def",
"p_constant_expression_opt_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L435-L437 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal._round_half_even | (self, prec) | Round 5 to even, rest to nearest. | Round 5 to even, rest to nearest. | [
"Round",
"5",
"to",
"even",
"rest",
"to",
"nearest",
"."
] | def _round_half_even(self, prec):
"""Round 5 to even, rest to nearest."""
if _exact_half(self._int, prec) and \
(prec == 0 or self._int[prec-1] in '02468'):
return -1
else:
return self._round_half_up(prec) | [
"def",
"_round_half_even",
"(",
"self",
",",
"prec",
")",
":",
"if",
"_exact_half",
"(",
"self",
".",
"_int",
",",
"prec",
")",
"and",
"(",
"prec",
"==",
"0",
"or",
"self",
".",
"_int",
"[",
"prec",
"-",
"1",
"]",
"in",
"'02468'",
")",
":",
"retu... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L1790-L1796 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/openpgp/sap/list.py | python | list_msgs | (pkts, **kw) | return msgs | List OpenPGP message instances given a list of packet instances.
:Parameters:
- `pkts`: list of packet instances
:Keywords:
- `code`: optional message type code to match listed messages
- `leftover`: a list used to append extraneous packets found after
those which comprised v... | List OpenPGP message instances given a list of packet instances. | [
"List",
"OpenPGP",
"message",
"instances",
"given",
"a",
"list",
"of",
"packet",
"instances",
"."
] | def list_msgs(pkts, **kw):
"""List OpenPGP message instances given a list of packet instances.
:Parameters:
- `pkts`: list of packet instances
:Keywords:
- `code`: optional message type code to match listed messages
- `leftover`: a list used to append extraneous packets found after... | [
"def",
"list_msgs",
"(",
"pkts",
",",
"*",
"*",
"kw",
")",
":",
"pkts",
"=",
"copy",
".",
"deepcopy",
"(",
"pkts",
")",
"# see if this is necessary",
"leftover",
"=",
"kw",
".",
"get",
"(",
"'leftover'",
",",
"[",
"]",
")",
"code",
"=",
"kw",
".",
... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/list.py#L544-L582 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/threading.py | python | Thread.__delete | (self) | Remove current thread from the dict of currently running threads. | Remove current thread from the dict of currently running threads. | [
"Remove",
"current",
"thread",
"from",
"the",
"dict",
"of",
"currently",
"running",
"threads",
"."
] | def __delete(self):
"Remove current thread from the dict of currently running threads."
# Notes about running with dummy_thread:
#
# Must take care to not raise an exception if dummy_thread is being
# used (and thus this module is being used as an instance of
# dummy_thr... | [
"def",
"__delete",
"(",
"self",
")",
":",
"# Notes about running with dummy_thread:",
"#",
"# Must take care to not raise an exception if dummy_thread is being",
"# used (and thus this module is being used as an instance of",
"# dummy_threading). dummy_thread.get_ident() always returns -1 since... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/threading.py#L874-L907 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | TurtleScreen.getshapes | (self) | return sorted(self._shapes.keys()) | Return a list of names of all currently available turtle shapes.
No argument.
Example (for a TurtleScreen instance named screen):
>>> screen.getshapes()
['arrow', 'blank', 'circle', ... , 'turtle'] | Return a list of names of all currently available turtle shapes. | [
"Return",
"a",
"list",
"of",
"names",
"of",
"all",
"currently",
"available",
"turtle",
"shapes",
"."
] | def getshapes(self):
"""Return a list of names of all currently available turtle shapes.
No argument.
Example (for a TurtleScreen instance named screen):
>>> screen.getshapes()
['arrow', 'blank', 'circle', ... , 'turtle']
"""
return sorted(self._shapes.keys()) | [
"def",
"getshapes",
"(",
"self",
")",
":",
"return",
"sorted",
"(",
"self",
".",
"_shapes",
".",
"keys",
"(",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L1285-L1294 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/mxnet/metric.py | python | np | (numpy_feval, name=None) | return CustomMetric(feval, name) | Create a customized metric from numpy function.
Parameters
----------
numpy_feval : callable(label, pred)
Customized evaluation function.
name : str, optional
The name of the metric. | Create a customized metric from numpy function. | [
"Create",
"a",
"customized",
"metric",
"from",
"numpy",
"function",
"."
] | def np(numpy_feval, name=None):
"""Create a customized metric from numpy function.
Parameters
----------
numpy_feval : callable(label, pred)
Customized evaluation function.
name : str, optional
The name of the metric.
"""
def feval(label, pred):
"""Internal eval fun... | [
"def",
"np",
"(",
"numpy_feval",
",",
"name",
"=",
"None",
")",
":",
"def",
"feval",
"(",
"label",
",",
"pred",
")",
":",
"\"\"\"Internal eval function.\"\"\"",
"return",
"numpy_feval",
"(",
"label",
",",
"pred",
")",
"feval",
".",
"__name__",
"=",
"numpy_... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/metric.py#L342-L357 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/tutorials/mnist_tflite.py | python | run_eval | (interpreter, input_image) | return output | Performs evaluation for input image over specified model.
Args:
interpreter: TFLite interpreter initialized with model to execute.
input_image: Image input to the model.
Returns:
output: output tensor of model being executed. | Performs evaluation for input image over specified model. | [
"Performs",
"evaluation",
"for",
"input",
"image",
"over",
"specified",
"model",
"."
] | def run_eval(interpreter, input_image):
"""Performs evaluation for input image over specified model.
Args:
interpreter: TFLite interpreter initialized with model to execute.
input_image: Image input to the model.
Returns:
output: output tensor of model being executed.
"""
# Get input and ... | [
"def",
"run_eval",
"(",
"interpreter",
",",
"input_image",
")",
":",
"# Get input and output tensors.",
"input_details",
"=",
"interpreter",
".",
"get_input_details",
"(",
")",
"output_details",
"=",
"interpreter",
".",
"get_output_details",
"(",
")",
"# Test model on t... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/tutorials/mnist_tflite.py#L43-L65 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/data_flow_ops.py | python | Barrier.barrier_ref | (self) | return self._barrier_ref | Get the underlying barrier reference. | Get the underlying barrier reference. | [
"Get",
"the",
"underlying",
"barrier",
"reference",
"."
] | def barrier_ref(self):
"""Get the underlying barrier reference."""
return self._barrier_ref | [
"def",
"barrier_ref",
"(",
"self",
")",
":",
"return",
"self",
".",
"_barrier_ref"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/data_flow_ops.py#L885-L887 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py | python | _GetUniquePlatforms | (spec) | return platforms | Returns the list of unique platforms for this spec, e.g ['win32', ...].
Arguments:
spec: The target dictionary containing the properties of the target.
Returns:
The MSVSUserFile object created. | Returns the list of unique platforms for this spec, e.g ['win32', ...]. | [
"Returns",
"the",
"list",
"of",
"unique",
"platforms",
"for",
"this",
"spec",
"e",
".",
"g",
"[",
"win32",
"...",
"]",
"."
] | def _GetUniquePlatforms(spec):
"""Returns the list of unique platforms for this spec, e.g ['win32', ...].
Arguments:
spec: The target dictionary containing the properties of the target.
Returns:
The MSVSUserFile object created.
"""
# Gather list of unique platforms.
platforms = set()
for configur... | [
"def",
"_GetUniquePlatforms",
"(",
"spec",
")",
":",
"# Gather list of unique platforms.",
"platforms",
"=",
"set",
"(",
")",
"for",
"configuration",
"in",
"spec",
"[",
"'configurations'",
"]",
":",
"platforms",
".",
"add",
"(",
"_ConfigPlatform",
"(",
"spec",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L949-L962 | |
happynear/caffe-windows | 967eedf25009e334b7f6f933bb5e17aaaff5bef6 | python/caffe/pycaffe.py | python | _Net_layer_dict | (self) | return self._layer_dict | An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"layers",
"indexed",
"by",
"name"
] | def _Net_layer_dict(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name
"""
if not hasattr(self, '_layer_dict'):
self._layer_dict = OrderedDict(zip(self._layer_names, self.layers))
return self._layer_dict | [
"def",
"_Net_layer_dict",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_layer_dict'",
")",
":",
"self",
".",
"_layer_dict",
"=",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_layer_names",
",",
"self",
".",
"layers",
")",
")",
"r... | https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/python/caffe/pycaffe.py#L47-L54 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py | python | Text.underline | (self, match, context, next_state) | return [], next_state, [] | Section title. | Section title. | [
"Section",
"title",
"."
] | def underline(self, match, context, next_state):
"""Section title."""
lineno = self.state_machine.abs_line_number()
title = context[0].rstrip()
underline = match.string.rstrip()
source = title + '\n' + underline
messages = []
if column_width(title) > len(underline... | [
"def",
"underline",
"(",
"self",
",",
"match",
",",
"context",
",",
"next_state",
")",
":",
"lineno",
"=",
"self",
".",
"state_machine",
".",
"abs_line_number",
"(",
")",
"title",
"=",
"context",
"[",
"0",
"]",
".",
"rstrip",
"(",
")",
"underline",
"="... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py#L2716-L2754 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Rect.SetTop | (*args, **kwargs) | return _core_.Rect_SetTop(*args, **kwargs) | SetTop(self, int top) | SetTop(self, int top) | [
"SetTop",
"(",
"self",
"int",
"top",
")"
] | def SetTop(*args, **kwargs):
"""SetTop(self, int top)"""
return _core_.Rect_SetTop(*args, **kwargs) | [
"def",
"SetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_SetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1377-L1379 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/util.py | python | setup_testing_defaults | (environ) | Update 'environ' with trivial defaults for testing purposes
This adds various parameters required for WSGI, including HTTP_HOST,
SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
and all of the wsgi.* variables. It only supplies default values,
and does not replace any existing setting... | Update 'environ' with trivial defaults for testing purposes | [
"Update",
"environ",
"with",
"trivial",
"defaults",
"for",
"testing",
"purposes"
] | def setup_testing_defaults(environ):
"""Update 'environ' with trivial defaults for testing purposes
This adds various parameters required for WSGI, including HTTP_HOST,
SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
and all of the wsgi.* variables. It only supplies default values,
... | [
"def",
"setup_testing_defaults",
"(",
"environ",
")",
":",
"environ",
".",
"setdefault",
"(",
"'SERVER_NAME'",
",",
"'127.0.0.1'",
")",
"environ",
".",
"setdefault",
"(",
"'SERVER_PROTOCOL'",
",",
"'HTTP/1.0'",
")",
"environ",
".",
"setdefault",
"(",
"'HTTP_HOST'"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/util.py#L117-L153 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/apps/adminsettings/service.py | python | AdminSettingsService.IsDomainVerified | (self) | Is the domain verified
Args:
None
Returns: Boolean, is domain verified | Is the domain verified | [
"Is",
"the",
"domain",
"verified"
] | def IsDomainVerified(self):
"""Is the domain verified
Args:
None
Returns: Boolean, is domain verified"""
result = self.genericGet('accountInformation/isVerified')
if result['isVerified'] == 'true':
return True
else:
return False | [
"def",
"IsDomainVerified",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"genericGet",
"(",
"'accountInformation/isVerified'",
")",
"if",
"result",
"[",
"'isVerified'",
"]",
"==",
"'true'",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/apps/adminsettings/service.py#L135-L147 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/prefdlg.py | python | ExtListCtrl.UpdateExtensions | (self) | Updates the values in the EXT_COL to reflect changes
in the ExtensionRegister.
@postcondition: Any configuration changes made in the control are
set in the Extension register.
@see: L{syntax.syntax.ExtensionRegister} | Updates the values in the EXT_COL to reflect changes
in the ExtensionRegister.
@postcondition: Any configuration changes made in the control are
set in the Extension register.
@see: L{syntax.syntax.ExtensionRegister} | [
"Updates",
"the",
"values",
"in",
"the",
"EXT_COL",
"to",
"reflect",
"changes",
"in",
"the",
"ExtensionRegister",
".",
"@postcondition",
":",
"Any",
"configuration",
"changes",
"made",
"in",
"the",
"control",
"are",
"set",
"in",
"the",
"Extension",
"register",
... | def UpdateExtensions(self):
"""Updates the values in the EXT_COL to reflect changes
in the ExtensionRegister.
@postcondition: Any configuration changes made in the control are
set in the Extension register.
@see: L{syntax.syntax.ExtensionRegister}
"""
... | [
"def",
"UpdateExtensions",
"(",
"self",
")",
":",
"for",
"row",
"in",
"range",
"(",
"self",
".",
"GetItemCount",
"(",
")",
")",
":",
"ftype",
"=",
"self",
".",
"GetItem",
"(",
"row",
",",
"ExtListCtrl",
".",
"FILE_COL",
")",
".",
"GetText",
"(",
")",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/prefdlg.py#L2151-L2162 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py | python | URLopener.open_file | (self, url) | Use local file or FTP depending on form of URL. | Use local file or FTP depending on form of URL. | [
"Use",
"local",
"file",
"or",
"FTP",
"depending",
"on",
"form",
"of",
"URL",
"."
] | def open_file(self, url):
"""Use local file or FTP depending on form of URL."""
if not isinstance(url, str):
raise IOError, ('file error', 'proxy support for file protocol currently not implemented')
if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
... | [
"def",
"open_file",
"(",
"self",
",",
"url",
")",
":",
"if",
"not",
"isinstance",
"(",
"url",
",",
"str",
")",
":",
"raise",
"IOError",
",",
"(",
"'file error'",
",",
"'proxy support for file protocol currently not implemented'",
")",
"if",
"url",
"[",
":",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py#L456-L463 | ||
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/meshrenderer/pysixd/transform.py | python | Arcball.constrain | (self) | return self._constrain | Return state of constrain to axis mode. | Return state of constrain to axis mode. | [
"Return",
"state",
"of",
"constrain",
"to",
"axis",
"mode",
"."
] | def constrain(self):
"""Return state of constrain to axis mode."""
return self._constrain | [
"def",
"constrain",
"(",
"self",
")",
":",
"return",
"self",
".",
"_constrain"
] | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/pysixd/transform.py#L1575-L1577 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | shutdown | (handlerList=_handlerList) | Perform any cleanup actions in the logging system (e.g. flushing
buffers).
Should be called at application exit. | Perform any cleanup actions in the logging system (e.g. flushing
buffers). | [
"Perform",
"any",
"cleanup",
"actions",
"in",
"the",
"logging",
"system",
"(",
"e",
".",
"g",
".",
"flushing",
"buffers",
")",
"."
] | def shutdown(handlerList=_handlerList):
"""
Perform any cleanup actions in the logging system (e.g. flushing
buffers).
Should be called at application exit.
"""
for wr in reversed(handlerList[:]):
#errors might occur, for example, if files are locked
#we just ignore them if rais... | [
"def",
"shutdown",
"(",
"handlerList",
"=",
"_handlerList",
")",
":",
"for",
"wr",
"in",
"reversed",
"(",
"handlerList",
"[",
":",
"]",
")",
":",
"#errors might occur, for example, if files are locked",
"#we just ignore them if raiseExceptions is not set",
"try",
":",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1635-L1662 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py | python | ComponentWriterBase.initPortParams | (self, obj, c) | Port function parameters for code generation | Port function parameters for code generation | [
"Port",
"function",
"parameters",
"for",
"code",
"generation"
] | def initPortParams(self, obj, c):
"""
Port function parameters for code generation
"""
c.param_portNum = ("portNum", "const NATIVE_INT_TYPE", "The port number", "")
c.param_Buffer = (
"Buffer",
"Fw::SerializeBufferBase",
"The serialization buff... | [
"def",
"initPortParams",
"(",
"self",
",",
"obj",
",",
"c",
")",
":",
"c",
".",
"param_portNum",
"=",
"(",
"\"portNum\"",
",",
"\"const NATIVE_INT_TYPE\"",
",",
"\"The port number\"",
",",
"\"\"",
")",
"c",
".",
"param_Buffer",
"=",
"(",
"\"Buffer\"",
",",
... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py#L731-L750 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/mesh.py | python | Mesh.__idiv__ | (self, other) | return self._do_op(other, tags, "/") | Divides the common tags of other to the mesh object. | Divides the common tags of other to the mesh object. | [
"Divides",
"the",
"common",
"tags",
"of",
"other",
"to",
"the",
"mesh",
"object",
"."
] | def __idiv__(self, other):
"""Divides the common tags of other to the mesh object."""
tags = self.common_ve_tags(other)
return self._do_op(other, tags, "/") | [
"def",
"__idiv__",
"(",
"self",
",",
"other",
")",
":",
"tags",
"=",
"self",
".",
"common_ve_tags",
"(",
"other",
")",
"return",
"self",
".",
"_do_op",
"(",
"other",
",",
"tags",
",",
"\"/\"",
")"
] | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mesh.py#L1179-L1182 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | ppapi/generators/idl_parser.py | python | IDLParser.p_expression_symbol | (self, p) | expression : SYMBOL | expression : SYMBOL | [
"expression",
":",
"SYMBOL"
] | def p_expression_symbol(self, p):
"expression : SYMBOL"
p[0] = p[1]
if self.parse_debug: DumpReduction('expression_symbol', p) | [
"def",
"p_expression_symbol",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"if",
"self",
".",
"parse_debug",
":",
"DumpReduction",
"(",
"'expression_symbol'",
",",
"p",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_parser.py#L494-L497 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py | python | Context.to_eng_string | (self, a) | return a.to_eng_string(context=self) | Converts a number to a string, using scientific notation.
The operation is not affected by the context. | Converts a number to a string, using scientific notation. | [
"Converts",
"a",
"number",
"to",
"a",
"string",
"using",
"scientific",
"notation",
"."
] | def to_eng_string(self, a):
"""Converts a number to a string, using scientific notation.
The operation is not affected by the context.
"""
a = _convert_other(a, raiseit=True)
return a.to_eng_string(context=self) | [
"def",
"to_eng_string",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"to_eng_string",
"(",
"context",
"=",
"self",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L5340-L5346 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/codebrowser/codebrowser/cbrowser.py | python | CodeBrowserTree.OnStartJob | (self, evt) | Start the tree update job
@param evt: wxTimerEvent | Start the tree update job
@param evt: wxTimerEvent | [
"Start",
"the",
"tree",
"update",
"job",
"@param",
"evt",
":",
"wxTimerEvent"
] | def OnStartJob(self, evt):
"""Start the tree update job
@param evt: wxTimerEvent
"""
if self._cpage is None or not isinstance(self._cpage, wx.Window):
self._cpage = None
return
else:
# Check if its still the current page
p... | [
"def",
"OnStartJob",
"(",
"self",
",",
"evt",
")",
":",
"if",
"self",
".",
"_cpage",
"is",
"None",
"or",
"not",
"isinstance",
"(",
"self",
".",
"_cpage",
",",
"wx",
".",
"Window",
")",
":",
"self",
".",
"_cpage",
"=",
"None",
"return",
"else",
":",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/codebrowser/codebrowser/cbrowser.py#L527-L564 | ||
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/descriptor.py | python | DescriptorBase.GetOptions | (self) | return self._options | Retrieves descriptor options.
This method returns the options set or creates the default options for the
descriptor. | Retrieves descriptor options. | [
"Retrieves",
"descriptor",
"options",
"."
] | def GetOptions(self):
"""Retrieves descriptor options.
This method returns the options set or creates the default options for the
descriptor.
"""
if self._options:
return self._options
from google.protobuf import descriptor_pb2
try:
options_class = getattr(descriptor_pb2, self._... | [
"def",
"GetOptions",
"(",
"self",
")",
":",
"if",
"self",
".",
"_options",
":",
"return",
"self",
".",
"_options",
"from",
"google",
".",
"protobuf",
"import",
"descriptor_pb2",
"try",
":",
"options_class",
"=",
"getattr",
"(",
"descriptor_pb2",
",",
"self",... | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/descriptor.py#L75-L90 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py | python | Integral.__float__ | (self) | return float(long(self)) | float(self) == float(long(self)) | float(self) == float(long(self)) | [
"float",
"(",
"self",
")",
"==",
"float",
"(",
"long",
"(",
"self",
"))"
] | def __float__(self):
"""float(self) == float(long(self))"""
return float(long(self)) | [
"def",
"__float__",
"(",
"self",
")",
":",
"return",
"float",
"(",
"long",
"(",
"self",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py#L376-L378 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | examples/ex-python/ex_sample.py | python | foo | () | Demonstrate decorator and context-manager with auto_timer
Sleep for 2 seconds then run fibonacci calculation within context-manager | Demonstrate decorator and context-manager with auto_timer
Sleep for 2 seconds then run fibonacci calculation within context-manager | [
"Demonstrate",
"decorator",
"and",
"context",
"-",
"manager",
"with",
"auto_timer",
"Sleep",
"for",
"2",
"seconds",
"then",
"run",
"fibonacci",
"calculation",
"within",
"context",
"-",
"manager"
] | def foo():
"""
Demonstrate decorator and context-manager with auto_timer
Sleep for 2 seconds then run fibonacci calculation within context-manager
"""
time.sleep(2)
with timemory.bundle.auto_timer(key="[fibonacci]"):
print("fibonacci({}) = {}".format(nfib, fibonacci(nfib))) | [
"def",
"foo",
"(",
")",
":",
"time",
".",
"sleep",
"(",
"2",
")",
"with",
"timemory",
".",
"bundle",
".",
"auto_timer",
"(",
"key",
"=",
"\"[fibonacci]\"",
")",
":",
"print",
"(",
"\"fibonacci({}) = {}\"",
".",
"format",
"(",
"nfib",
",",
"fibonacci",
... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/examples/ex-python/ex_sample.py#L58-L65 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py | python | CookieJar.set_cookie_if_ok | (self, cookie, request) | Set a cookie if policy says it's OK to do so. | Set a cookie if policy says it's OK to do so. | [
"Set",
"a",
"cookie",
"if",
"policy",
"says",
"it",
"s",
"OK",
"to",
"do",
"so",
"."
] | def set_cookie_if_ok(self, cookie, request):
"""Set a cookie if policy says it's OK to do so."""
self._cookies_lock.acquire()
try:
self._policy._now = self._now = int(time.time())
if self._policy.set_ok(cookie, request):
self.set_cookie(cookie)
... | [
"def",
"set_cookie_if_ok",
"(",
"self",
",",
"cookie",
",",
"request",
")",
":",
"self",
".",
"_cookies_lock",
".",
"acquire",
"(",
")",
"try",
":",
"self",
".",
"_policy",
".",
"_now",
"=",
"self",
".",
"_now",
"=",
"int",
"(",
"time",
".",
"time",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py#L1609-L1620 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchProfile.py | python | Arch_Profile.taskbox | (self) | return w | sets up a taskbox widget | sets up a taskbox widget | [
"sets",
"up",
"a",
"taskbox",
"widget"
] | def taskbox(self):
"sets up a taskbox widget"
w = QtGui.QWidget()
ui = FreeCADGui.UiLoader()
w.setWindowTitle(translate("Arch","Profile settings"))
grid = QtGui.QGridLayout(w)
# categories box
labelc = QtGui.QLabel(translate("Arch","Category"))
self.vCa... | [
"def",
"taskbox",
"(",
"self",
")",
":",
"w",
"=",
"QtGui",
".",
"QWidget",
"(",
")",
"ui",
"=",
"FreeCADGui",
".",
"UiLoader",
"(",
")",
"w",
".",
"setWindowTitle",
"(",
"translate",
"(",
"\"Arch\"",
",",
"\"Profile settings\"",
")",
")",
"grid",
"=",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchProfile.py#L136-L177 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | build/plugins/mx_archive.py | python | onmx_formulas | (unit, *args) | @usage: MX_FORMULAS(BinFiles...) # deprecated, matrixnet
Create MatrixNet formulas archive | [] | def onmx_formulas(unit, *args):
"""
@usage: MX_FORMULAS(BinFiles...) # deprecated, matrixnet
Create MatrixNet formulas archive
"""
def iter_infos():
for a in args:
if a.endswith('.bin'):
unit.on_mx_bin_to_info([a])
yield a[:-3] + 'info'
... | [
"def",
"onmx_formulas",
"(",
"unit",
",",
"*",
"args",
")",
":",
"def",
"iter_infos",
"(",
")",
":",
"for",
"a",
"in",
"args",
":",
"if",
"a",
".",
"endswith",
"(",
"'.bin'",
")",
":",
"unit",
".",
"on_mx_bin_to_info",
"(",
"[",
"a",
"]",
")",
"y... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/plugins/mx_archive.py#L1-L16 | |||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py | python | _MatMulGrad | (op, grad) | return grad_a, grad_b | Gradient for MatMul. | Gradient for MatMul. | [
"Gradient",
"for",
"MatMul",
"."
] | def _MatMulGrad(op, grad):
"""Gradient for MatMul."""
try:
skip_input_indices = op.skip_input_indices
if skip_input_indices is not None:
if 1 in skip_input_indices:
return _MatMulGradAgainstFirstOnly(op, grad)
elif 0 in skip_input_indices:
return _MatMulGradAgainstSecondOnly(op, ... | [
"def",
"_MatMulGrad",
"(",
"op",
",",
"grad",
")",
":",
"try",
":",
"skip_input_indices",
"=",
"op",
".",
"skip_input_indices",
"if",
"skip_input_indices",
"is",
"not",
"None",
":",
"if",
"1",
"in",
"skip_input_indices",
":",
"return",
"_MatMulGradAgainstFirstOn... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py#L1567-L1596 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py | python | FTP.voidcmd | (self, cmd) | return self.voidresp() | Send a command and expect a response beginning with '2'. | Send a command and expect a response beginning with '2'. | [
"Send",
"a",
"command",
"and",
"expect",
"a",
"response",
"beginning",
"with",
"2",
"."
] | def voidcmd(self, cmd):
"""Send a command and expect a response beginning with '2'."""
self.putcmd(cmd)
return self.voidresp() | [
"def",
"voidcmd",
"(",
"self",
",",
"cmd",
")",
":",
"self",
".",
"putcmd",
"(",
"cmd",
")",
"return",
"self",
".",
"voidresp",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py#L246-L249 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fft.py | python | irfftn | (x, s=None, axes=None, norm="backward", name=None) | return fftn_c2r(x, s, axes, norm, forward=False, name=name) | Computes the inverse of `rfftn`.
This function computes the inverse of the N-D discrete
Fourier Transform for real input over any number of axes in an
M-D array by means of the Fast Fourier Transform (FFT). In
other words, ``irfftn(rfftn(x), x.shape) == x`` to within numerical
accuracy. (The ``a.sh... | Computes the inverse of `rfftn`. | [
"Computes",
"the",
"inverse",
"of",
"rfftn",
"."
] | def irfftn(x, s=None, axes=None, norm="backward", name=None):
"""
Computes the inverse of `rfftn`.
This function computes the inverse of the N-D discrete
Fourier Transform for real input over any number of axes in an
M-D array by means of the Fast Fourier Transform (FFT). In
other words, ``irff... | [
"def",
"irfftn",
"(",
"x",
",",
"s",
"=",
"None",
",",
"axes",
"=",
"None",
",",
"norm",
"=",
"\"backward\"",
",",
"name",
"=",
"None",
")",
":",
"return",
"fftn_c2r",
"(",
"x",
",",
"s",
",",
"axes",
",",
"norm",
",",
"forward",
"=",
"False",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fft.py#L669-L726 | |
facebook/proxygen | a9ca025af207787815cb01eee1971cd572c7a81e | build/fbcode_builder/fbcode_builder.py | python | FBCodeBuilder.run | (self, shell_cmd) | Run this bash command | Run this bash command | [
"Run",
"this",
"bash",
"command"
] | def run(self, shell_cmd):
"Run this bash command"
raise NotImplementedError | [
"def",
"run",
"(",
"self",
",",
"shell_cmd",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/fbcode_builder.py#L172-L174 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | toolkit/mozapps/installer/packager.py | python | precompile_cache | (formatter, source_path, gre_path, app_path) | Create startup cache for the given application directory, using the
given GRE path.
- formatter is a Formatter instance where to add the startup cache.
- source_path is the base path of the package.
- gre_path is the GRE path, relative to source_path.
- app_path is the application path, relative to ... | Create startup cache for the given application directory, using the
given GRE path.
- formatter is a Formatter instance where to add the startup cache.
- source_path is the base path of the package.
- gre_path is the GRE path, relative to source_path.
- app_path is the application path, relative to ... | [
"Create",
"startup",
"cache",
"for",
"the",
"given",
"application",
"directory",
"using",
"the",
"given",
"GRE",
"path",
".",
"-",
"formatter",
"is",
"a",
"Formatter",
"instance",
"where",
"to",
"add",
"the",
"startup",
"cache",
".",
"-",
"source_path",
"is"... | def precompile_cache(formatter, source_path, gre_path, app_path):
'''
Create startup cache for the given application directory, using the
given GRE path.
- formatter is a Formatter instance where to add the startup cache.
- source_path is the base path of the package.
- gre_path is the GRE path,... | [
"def",
"precompile_cache",
"(",
"formatter",
",",
"source_path",
",",
"gre_path",
",",
"app_path",
")",
":",
"from",
"tempfile",
"import",
"mkstemp",
"source_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"source_path",
")",
"if",
"app_path",
"!=",
"gre... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/toolkit/mozapps/installer/packager.py#L116-L171 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.IsSelectionItalics | (*args, **kwargs) | return _richtext.RichTextCtrl_IsSelectionItalics(*args, **kwargs) | IsSelectionItalics(self) -> bool
Is all of the selection italics? | IsSelectionItalics(self) -> bool | [
"IsSelectionItalics",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsSelectionItalics(*args, **kwargs):
"""
IsSelectionItalics(self) -> bool
Is all of the selection italics?
"""
return _richtext.RichTextCtrl_IsSelectionItalics(*args, **kwargs) | [
"def",
"IsSelectionItalics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_IsSelectionItalics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3923-L3929 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/special_matrices.py | python | dft | (n, scale=None) | return m | Discrete Fourier transform matrix.
Create the matrix that computes the discrete Fourier transform of a
sequence [1]_. The n-th primitive root of unity used to generate the
matrix is exp(-2*pi*i/n), where i = sqrt(-1).
Parameters
----------
n : int
Size the matrix to create.
scale ... | Discrete Fourier transform matrix. | [
"Discrete",
"Fourier",
"transform",
"matrix",
"."
] | def dft(n, scale=None):
"""
Discrete Fourier transform matrix.
Create the matrix that computes the discrete Fourier transform of a
sequence [1]_. The n-th primitive root of unity used to generate the
matrix is exp(-2*pi*i/n), where i = sqrt(-1).
Parameters
----------
n : int
S... | [
"def",
"dft",
"(",
"n",
",",
"scale",
"=",
"None",
")",
":",
"if",
"scale",
"not",
"in",
"[",
"None",
",",
"'sqrtn'",
",",
"'n'",
"]",
":",
"raise",
"ValueError",
"(",
"\"scale must be None, 'sqrtn', or 'n'; \"",
"\"%r is not valid.\"",
"%",
"(",
"scale",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/special_matrices.py#L975-L1038 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | setup.py | python | BuildExt._check_build_environment | (self) | Check for required build tools: CMake, C++ compiler, and python dev. | Check for required build tools: CMake, C++ compiler, and python dev. | [
"Check",
"for",
"required",
"build",
"tools",
":",
"CMake",
"C",
"++",
"compiler",
"and",
"python",
"dev",
"."
] | def _check_build_environment(self):
"""Check for required build tools: CMake, C++ compiler, and python dev."""
try:
subprocess.check_call(["cmake", "--version"])
except OSError as e:
ext_names = ", ".join(e.name for e in self.extensions)
raise RuntimeError(
f"CMake must be instal... | [
"def",
"_check_build_environment",
"(",
"self",
")",
":",
"try",
":",
"subprocess",
".",
"check_call",
"(",
"[",
"\"cmake\"",
",",
"\"--version\"",
"]",
")",
"except",
"OSError",
"as",
"e",
":",
"ext_names",
"=",
"\", \"",
".",
"join",
"(",
"e",
".",
"na... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/setup.py#L52-L75 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/xml/sax/_exceptions.py | python | SAXParseException.getColumnNumber | (self) | return self._colnum | The column number of the end of the text where the exception
occurred. | The column number of the end of the text where the exception
occurred. | [
"The",
"column",
"number",
"of",
"the",
"end",
"of",
"the",
"text",
"where",
"the",
"exception",
"occurred",
"."
] | def getColumnNumber(self):
"""The column number of the end of the text where the exception
occurred."""
return self._colnum | [
"def",
"getColumnNumber",
"(",
"self",
")",
":",
"return",
"self",
".",
"_colnum"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/xml/sax/_exceptions.py#L72-L75 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_groovy.py | python | SyntaxData.GetCommentPattern | (self) | return [ u'//' ] | Returns a list of characters used to comment a block of code | Returns a list of characters used to comment a block of code | [
"Returns",
"a",
"list",
"of",
"characters",
"used",
"to",
"comment",
"a",
"block",
"of",
"code"
] | def GetCommentPattern(self):
"""Returns a list of characters used to comment a block of code """
return [ u'//' ] | [
"def",
"GetCommentPattern",
"(",
"self",
")",
":",
"return",
"[",
"u'//'",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_groovy.py#L115-L117 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | DELnHandler.WriteImmediateHandlerImplementation | (self, func, f) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteImmediateHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
f.write(" %sHelper(n, %s);\n" %
(func.original_name, func.GetLastOriginalArg().name)) | [
"def",
"WriteImmediateHandlerImplementation",
"(",
"self",
",",
"func",
",",
"f",
")",
":",
"f",
".",
"write",
"(",
"\" %sHelper(n, %s);\\n\"",
"%",
"(",
"func",
".",
"original_name",
",",
"func",
".",
"GetLastOriginalArg",
"(",
")",
".",
"name",
")",
")"
] | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L6493-L6496 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | PanedWindow.__init__ | (self, master=None, cnf={}, **kw) | Construct a panedwindow widget with the parent MASTER.
STANDARD OPTIONS
background, borderwidth, cursor, height,
orient, relief, width
WIDGET-SPECIFIC OPTIONS
handlepad, handlesize, opaqueresize,
sashcursor, sashpad, sashrelief,
sashwidth, ... | Construct a panedwindow widget with the parent MASTER. | [
"Construct",
"a",
"panedwindow",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct a panedwindow widget with the parent MASTER.
STANDARD OPTIONS
background, borderwidth, cursor, height,
orient, relief, width
WIDGET-SPECIFIC OPTIONS
handlepad, handlesize, opaqueresize,
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'panedwindow'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3553-L3567 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/errorcodes.py | python | is_terminated | (lines) | return ';' in code_block or code_block.count('(') - code_block.count(')') <= 0 | Determine if assert is terminated, from .cpp/.h source lines as text. | Determine if assert is terminated, from .cpp/.h source lines as text. | [
"Determine",
"if",
"assert",
"is",
"terminated",
"from",
".",
"cpp",
"/",
".",
"h",
"source",
"lines",
"as",
"text",
"."
] | def is_terminated(lines):
"""Determine if assert is terminated, from .cpp/.h source lines as text."""
code_block = " ".join(lines)
return ';' in code_block or code_block.count('(') - code_block.count(')') <= 0 | [
"def",
"is_terminated",
"(",
"lines",
")",
":",
"code_block",
"=",
"\" \"",
".",
"join",
"(",
"lines",
")",
"return",
"';'",
"in",
"code_block",
"or",
"code_block",
".",
"count",
"(",
"'('",
")",
"-",
"code_block",
".",
"count",
"(",
"')'",
")",
"<=",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/errorcodes.py#L136-L139 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | FileInfo.IsSource | (self) | return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
"in",
"(",
"'c'",
",",
"'cc'",
",",
"'cpp'",
",",
"'cxx'",
")"
] | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L960-L962 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aquabutton.py | python | AquaButton.SetBackgroundColour | (self, colour) | Sets the :class:`AquaButton` background colour.
:param `colour`: a valid :class:`Colour` object.
:note: Overridden from :class:`PyControl`. | Sets the :class:`AquaButton` background colour. | [
"Sets",
"the",
":",
"class",
":",
"AquaButton",
"background",
"colour",
"."
] | def SetBackgroundColour(self, colour):
"""
Sets the :class:`AquaButton` background colour.
:param `colour`: a valid :class:`Colour` object.
:note: Overridden from :class:`PyControl`.
"""
wx.PyControl.SetBackgroundColour(self, colour)
self._backColour = colour
... | [
"def",
"SetBackgroundColour",
"(",
"self",
",",
"colour",
")",
":",
"wx",
".",
"PyControl",
".",
"SetBackgroundColour",
"(",
"self",
",",
"colour",
")",
"self",
".",
"_backColour",
"=",
"colour",
"self",
".",
"Invalidate",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aquabutton.py#L674-L685 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/subsetgenerator.py | python | genset_MXuDD | (dbinstance) | return ssA.union(ssB) | mxdd
near-equilibrium systems also in mxdd | mxdd
near-equilibrium systems also in mxdd | [
"mxdd",
"near",
"-",
"equilibrium",
"systems",
"also",
"in",
"mxdd"
] | def genset_MXuDD(dbinstance):
"""mxdd
near-equilibrium systems also in mxdd
"""
try:
ssA = set(dbinstance.sset['mx'].keys())
except KeyError:
ssA = set()
try:
ssB = set(dbinstance.sset['dd'].keys())
except KeyError:
ssB = set()
return ssA.union(ssB) | [
"def",
"genset_MXuDD",
"(",
"dbinstance",
")",
":",
"try",
":",
"ssA",
"=",
"set",
"(",
"dbinstance",
".",
"sset",
"[",
"'mx'",
"]",
".",
"keys",
"(",
")",
")",
"except",
"KeyError",
":",
"ssA",
"=",
"set",
"(",
")",
"try",
":",
"ssB",
"=",
"set"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/subsetgenerator.py#L39-L52 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/labeled_tensor/python/ops/ops.py | python | boolean_mask | (labeled_tensor, mask, name=None) | Apply a boolean mask to a labeled tensor.
Unlike `tf.boolean_mask`, this currently only works on 1-dimensional masks.
The mask is applied to the first axis of `labeled_tensor`. Labels on the first
axis are removed, because True indices in `mask` may not be known dynamically.
Args:
labeled_tensor: The inpu... | Apply a boolean mask to a labeled tensor. | [
"Apply",
"a",
"boolean",
"mask",
"to",
"a",
"labeled",
"tensor",
"."
] | def boolean_mask(labeled_tensor, mask, name=None):
"""Apply a boolean mask to a labeled tensor.
Unlike `tf.boolean_mask`, this currently only works on 1-dimensional masks.
The mask is applied to the first axis of `labeled_tensor`. Labels on the first
axis are removed, because True indices in `mask` may not be ... | [
"def",
"boolean_mask",
"(",
"labeled_tensor",
",",
"mask",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"'lt_boolean_mask'",
",",
"[",
"labeled_tensor",
",",
"mask",
"]",
")",
"as",
"scope",
":",
"labeled_tensor",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/labeled_tensor/python/ops/ops.py#L1215-L1249 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py | python | BackgroundCorrectionsPresenter._update_displayed_corrections_data | (self) | Updates the displayed corrections data using the data stored in the model. | Updates the displayed corrections data using the data stored in the model. | [
"Updates",
"the",
"displayed",
"corrections",
"data",
"using",
"the",
"data",
"stored",
"in",
"the",
"model",
"."
] | def _update_displayed_corrections_data(self) -> None:
"""Updates the displayed corrections data using the data stored in the model."""
runs, groups, use_raws, start_xs, end_xs, backgrounds, background_errors, statuses = \
self.model.selected_correction_data()
self.view.populate_corre... | [
"def",
"_update_displayed_corrections_data",
"(",
"self",
")",
"->",
"None",
":",
"runs",
",",
"groups",
",",
"use_raws",
",",
"start_xs",
",",
"end_xs",
",",
"backgrounds",
",",
"background_errors",
",",
"statuses",
"=",
"self",
".",
"model",
".",
"selected_c... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py#L160-L166 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ctypes/__init__.py | python | string_at | (ptr, size=-1) | return _string_at(ptr, size) | string_at(addr[, size]) -> string
Return the string at addr. | string_at(addr[, size]) -> string | [
"string_at",
"(",
"addr",
"[",
"size",
"]",
")",
"-",
">",
"string"
] | def string_at(ptr, size=-1):
"""string_at(addr[, size]) -> string
Return the string at addr."""
return _string_at(ptr, size) | [
"def",
"string_at",
"(",
"ptr",
",",
"size",
"=",
"-",
"1",
")",
":",
"return",
"_string_at",
"(",
"ptr",
",",
"size",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ctypes/__init__.py#L505-L509 | |
lilypond/lilypond | 2a14759372979f5b796ee802b0ee3bc15d28b06b | release/binaries/lib/build.py | python | Package.src_directory | (self, c: Config) | return os.path.join(c.dependencies_src_dir, self.directory) | Return the source directory for this package | Return the source directory for this package | [
"Return",
"the",
"source",
"directory",
"for",
"this",
"package"
] | def src_directory(self, c: Config) -> str:
"""Return the source directory for this package"""
return os.path.join(c.dependencies_src_dir, self.directory) | [
"def",
"src_directory",
"(",
"self",
",",
"c",
":",
"Config",
")",
"->",
"str",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"c",
".",
"dependencies_src_dir",
",",
"self",
".",
"directory",
")"
] | https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/release/binaries/lib/build.py#L62-L64 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compileall.py | python | compile_dir | (dir, maxlevels=10, ddir=None,
force=0, rx=None, quiet=0) | return success | Byte-compile all modules in the given directory tree.
Arguments (only dir is required):
dir: the directory to byte-compile
maxlevels: maximum recursion level (default 10)
ddir: the directory that will be prepended to the path to the
file as it is compiled into each byte-code ... | Byte-compile all modules in the given directory tree. | [
"Byte",
"-",
"compile",
"all",
"modules",
"in",
"the",
"given",
"directory",
"tree",
"."
] | def compile_dir(dir, maxlevels=10, ddir=None,
force=0, rx=None, quiet=0):
"""Byte-compile all modules in the given directory tree.
Arguments (only dir is required):
dir: the directory to byte-compile
maxlevels: maximum recursion level (default 10)
ddir: the directory tha... | [
"def",
"compile_dir",
"(",
"dir",
",",
"maxlevels",
"=",
"10",
",",
"ddir",
"=",
"None",
",",
"force",
"=",
"0",
",",
"rx",
"=",
"None",
",",
"quiet",
"=",
"0",
")",
":",
"if",
"not",
"quiet",
":",
"print",
"'Listing'",
",",
"dir",
",",
"'...'",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compileall.py#L21-L61 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | TimeSpan.__neg__ | (*args, **kwargs) | return _misc_.TimeSpan___neg__(*args, **kwargs) | __neg__(self) -> TimeSpan | __neg__(self) -> TimeSpan | [
"__neg__",
"(",
"self",
")",
"-",
">",
"TimeSpan"
] | def __neg__(*args, **kwargs):
"""__neg__(self) -> TimeSpan"""
return _misc_.TimeSpan___neg__(*args, **kwargs) | [
"def",
"__neg__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TimeSpan___neg__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4446-L4448 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/default_options.py | python | get_default_override | (function_or_class, **kwargs) | return value.value | Looks up an option default override.
Meant to be used inside functions that use this facility.
Args:
function: the function that calls this.
For example::
def Convolution(args, init=default_override_or(glorot_uniform()), activation=default_override_or(identity), pad=default_overr... | Looks up an option default override.
Meant to be used inside functions that use this facility. | [
"Looks",
"up",
"an",
"option",
"default",
"override",
".",
"Meant",
"to",
"be",
"used",
"inside",
"functions",
"that",
"use",
"this",
"facility",
"."
] | def get_default_override(function_or_class, **kwargs):
'''
Looks up an option default override.
Meant to be used inside functions that use this facility.
Args:
function: the function that calls this.
For example::
def Convolution(args, init=default_override_or(glorot_unif... | [
"def",
"get_default_override",
"(",
"function_or_class",
",",
"*",
"*",
"kwargs",
")",
":",
"# parameter checking and casting",
"if",
"len",
"(",
"kwargs",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"\"get_default_override() takes 1 keyword argument but %s were given... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/default_options.py#L65-L102 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/session.py | python | Session.client | (self, service_name, region_name=None, api_version=None,
use_ssl=True, verify=None, endpoint_url=None,
aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, config=None) | return self._session.create_client(
service_name, region_name=region_name, api_version=api_version,
use_ssl=use_ssl, verify=verify, endpoint_url=endpoint_url,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
aws_session_token=a... | Create a low-level service client by name.
:type service_name: string
:param service_name: The name of a service, e.g. 's3' or 'ec2'. You
can get a list of available services via
:py:meth:`get_available_services`.
:type region_name: string
:param region_name: Th... | Create a low-level service client by name. | [
"Create",
"a",
"low",
"-",
"level",
"service",
"client",
"by",
"name",
"."
] | def client(self, service_name, region_name=None, api_version=None,
use_ssl=True, verify=None, endpoint_url=None,
aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, config=None):
"""
Create a low-level service client by name.
... | [
"def",
"client",
"(",
"self",
",",
"service_name",
",",
"region_name",
"=",
"None",
",",
"api_version",
"=",
"None",
",",
"use_ssl",
"=",
"True",
",",
"verify",
"=",
"None",
",",
"endpoint_url",
"=",
"None",
",",
"aws_access_key_id",
"=",
"None",
",",
"a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/session.py#L185-L263 | |
google/flatbuffers | b3006913369e0a7550795e477011ac5bebb93497 | python/flatbuffers/table.py | python | Table.Get | (self, flags, off) | return flags.py_type(encode.Get(flags.packer_type, self.Bytes, off)) | Get retrieves a value of the type specified by `flags` at the
given offset. | Get retrieves a value of the type specified by `flags` at the
given offset. | [
"Get",
"retrieves",
"a",
"value",
"of",
"the",
"type",
"specified",
"by",
"flags",
"at",
"the",
"given",
"offset",
"."
] | def Get(self, flags, off):
"""
Get retrieves a value of the type specified by `flags` at the
given offset.
"""
N.enforce_number(off, N.UOffsetTFlags)
return flags.py_type(encode.Get(flags.packer_type, self.Bytes, off)) | [
"def",
"Get",
"(",
"self",
",",
"flags",
",",
"off",
")",
":",
"N",
".",
"enforce_number",
"(",
"off",
",",
"N",
".",
"UOffsetTFlags",
")",
"return",
"flags",
".",
"py_type",
"(",
"encode",
".",
"Get",
"(",
"flags",
".",
"packer_type",
",",
"self",
... | https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/table.py#L87-L93 | |
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.is_default_constructor | (self) | return conf.lib.clang_CXXConstructor_isDefaultConstructor(self) | Returns True if the cursor refers to a C++ default constructor. | Returns True if the cursor refers to a C++ default constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"default",
"constructor",
"."
] | def is_default_constructor(self):
"""Returns True if the cursor refers to a C++ default constructor.
"""
return conf.lib.clang_CXXConstructor_isDefaultConstructor(self) | [
"def",
"is_default_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isDefaultConstructor",
"(",
"self",
")"
] | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1331-L1334 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/symbol_database.py | python | SymbolDatabase.RegisterServiceDescriptor | (self, service_descriptor) | Registers the given service descriptor in the local database.
Args:
service_descriptor: a descriptor.ServiceDescriptor.
Returns:
The provided descriptor. | Registers the given service descriptor in the local database. | [
"Registers",
"the",
"given",
"service",
"descriptor",
"in",
"the",
"local",
"database",
"."
] | def RegisterServiceDescriptor(self, service_descriptor):
"""Registers the given service descriptor in the local database.
Args:
service_descriptor: a descriptor.ServiceDescriptor.
Returns:
The provided descriptor.
"""
self.pool.AddServiceDescriptor(service_descriptor) | [
"def",
"RegisterServiceDescriptor",
"(",
"self",
",",
"service_descriptor",
")",
":",
"self",
".",
"pool",
".",
"AddServiceDescriptor",
"(",
"service_descriptor",
")"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/symbol_database.py#L97-L106 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | GradLoopState.history_map | (self) | return self._history_map | The map that records all the tensors needed for backprop. | The map that records all the tensors needed for backprop. | [
"The",
"map",
"that",
"records",
"all",
"the",
"tensors",
"needed",
"for",
"backprop",
"."
] | def history_map(self):
"""The map that records all the tensors needed for backprop."""
return self._history_map | [
"def",
"history_map",
"(",
"self",
")",
":",
"return",
"self",
".",
"_history_map"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L614-L616 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/markdown/extensions/codehilite.py | python | CodeHiliteExtension.extendMarkdown | (self, md, md_globals) | Add HilitePostprocessor to Markdown instance. | Add HilitePostprocessor to Markdown instance. | [
"Add",
"HilitePostprocessor",
"to",
"Markdown",
"instance",
"."
] | def extendMarkdown(self, md, md_globals):
""" Add HilitePostprocessor to Markdown instance. """
hiliter = HiliteTreeprocessor(md)
hiliter.config = self.getConfigs()
md.treeprocessors.add("hilite", hiliter, "<inline")
md.registerExtension(self) | [
"def",
"extendMarkdown",
"(",
"self",
",",
"md",
",",
"md_globals",
")",
":",
"hiliter",
"=",
"HiliteTreeprocessor",
"(",
"md",
")",
"hiliter",
".",
"config",
"=",
"self",
".",
"getConfigs",
"(",
")",
"md",
".",
"treeprocessors",
".",
"add",
"(",
"\"hili... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/markdown/extensions/codehilite.py#L255-L261 | ||
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | wrap/gtwrap/pybind_wrapper.py | python | PybindWrapper.wrap_enums | (self, enums, instantiated_class, prefix=' ' * 4) | return res | Wrap multiple enums defined in a class. | Wrap multiple enums defined in a class. | [
"Wrap",
"multiple",
"enums",
"defined",
"in",
"a",
"class",
"."
] | def wrap_enums(self, enums, instantiated_class, prefix=' ' * 4):
"""Wrap multiple enums defined in a class."""
cpp_class = instantiated_class.to_cpp()
module_var = instantiated_class.name.lower()
res = ''
for enum in enums:
res += "\n" + self.wrap_enum(
... | [
"def",
"wrap_enums",
"(",
"self",
",",
"enums",
",",
"instantiated_class",
",",
"prefix",
"=",
"' '",
"*",
"4",
")",
":",
"cpp_class",
"=",
"instantiated_class",
".",
"to_cpp",
"(",
")",
"module_var",
"=",
"instantiated_class",
".",
"name",
".",
"lower",
"... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/pybind_wrapper.py#L346-L355 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | third_party/cpplint.py | python | FindNextMultiLineCommentEnd | (lines, lineix) | return len(lines) | We are inside a comment, find the end marker. | We are inside a comment, find the end marker. | [
"We",
"are",
"inside",
"a",
"comment",
"find",
"the",
"end",
"marker",
"."
] | def FindNextMultiLineCommentEnd(lines, lineix):
"""We are inside a comment, find the end marker."""
while lineix < len(lines):
if lines[lineix].strip().endswith('*/'):
return lineix
lineix += 1
return len(lines) | [
"def",
"FindNextMultiLineCommentEnd",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"endswith",
"(",
"'*/'",
")",
":",
"return",
"lineix",
... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L1373-L1379 | |
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/coord_map.py | python | crop_params | (fn) | return (axis, offset) | Extract the crop layer parameters with defaults. | Extract the crop layer parameters with defaults. | [
"Extract",
"the",
"crop",
"layer",
"parameters",
"with",
"defaults",
"."
] | def crop_params(fn):
"""
Extract the crop layer parameters with defaults.
"""
params = fn.params.get('crop_param', fn.params)
axis = params.get('axis', 2) # default to spatial crop for N, C, H, W
offset = np.array(params.get('offset', 0), ndmin=1)
return (axis, offset) | [
"def",
"crop_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'crop_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"2",
")",
"# default to spatial crop for N, C, H, W",
"o... | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/coord_map.py#L40-L47 | |
illuz/leetcode | 75f5b46edfc37366eab45fc3db0f7c5916f80bcc | solutions/290.Word_Pattern/AC_map_nlogn.py | python | Solution.wordPattern | (self, pattern, str) | return True | :type pattern: str
:type str: str
:rtype: bool | :type pattern: str
:type str: str
:rtype: bool | [
":",
"type",
"pattern",
":",
"str",
":",
"type",
"str",
":",
"str",
":",
"rtype",
":",
"bool"
] | def wordPattern(self, pattern, str):
"""
:type pattern: str
:type str: str
:rtype: bool
"""
mp = ["" for _ in xrange(26)]
strs = str.split()
if len(strs) != len(pattern):
return False
for i, c in enumerate(pattern):
idx = or... | [
"def",
"wordPattern",
"(",
"self",
",",
"pattern",
",",
"str",
")",
":",
"mp",
"=",
"[",
"\"\"",
"for",
"_",
"in",
"xrange",
"(",
"26",
")",
"]",
"strs",
"=",
"str",
".",
"split",
"(",
")",
"if",
"len",
"(",
"strs",
")",
"!=",
"len",
"(",
"pa... | https://github.com/illuz/leetcode/blob/75f5b46edfc37366eab45fc3db0f7c5916f80bcc/solutions/290.Word_Pattern/AC_map_nlogn.py#L10-L30 | |
Constellation/iv | 64c3a9c7c517063f29d90d449180ea8f6f4d946f | tools/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/cpplint.py#L2082-L2186 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/win_tool.py | python | WinTool.Dispatch | (self, args) | return getattr(self, method)(*args[1:]) | Dispatches a string command to a method. | Dispatches a string command to a method. | [
"Dispatches",
"a",
"string",
"command",
"to",
"a",
"method",
"."
] | def Dispatch(self, args):
"""Dispatches a string command to a method."""
if len(args) < 1:
raise Exception("Not enough arguments")
method = "Exec%s" % self._CommandifyName(args[0])
return getattr(self, method)(*args[1:]) | [
"def",
"Dispatch",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"1",
":",
"raise",
"Exception",
"(",
"\"Not enough arguments\"",
")",
"method",
"=",
"\"Exec%s\"",
"%",
"self",
".",
"_CommandifyName",
"(",
"args",
"[",
"0",
"]... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/win_tool.py#L64-L70 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/openvino/runtime/opset1/ops.py | python | reverse_sequence | (
input: NodeInput,
seq_lengths: NodeInput,
batch_axis: NumericData,
seq_axis: NumericData,
name: Optional[str] = None,
) | return _get_node_factory_opset1().create(
"ReverseSequence",
as_nodes(input, seq_lengths),
{"batch_axis": batch_axis, "seq_axis": seq_axis},
) | Return a node which produces a ReverseSequence operation.
@param input: tensor with input data to reverse
@param seq_lengths: 1D tensor of integers with sequence lengths in the input tensor.
@param batch_axis: index of the batch dimension.
@param seq_axis: index of the sequence dimension.
@return R... | Return a node which produces a ReverseSequence operation. | [
"Return",
"a",
"node",
"which",
"produces",
"a",
"ReverseSequence",
"operation",
"."
] | def reverse_sequence(
input: NodeInput,
seq_lengths: NodeInput,
batch_axis: NumericData,
seq_axis: NumericData,
name: Optional[str] = None,
) -> Node:
"""Return a node which produces a ReverseSequence operation.
@param input: tensor with input data to reverse
@param seq_lengths: 1D tens... | [
"def",
"reverse_sequence",
"(",
"input",
":",
"NodeInput",
",",
"seq_lengths",
":",
"NodeInput",
",",
"batch_axis",
":",
"NumericData",
",",
"seq_axis",
":",
"NumericData",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Node",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/opset1/ops.py#L2435-L2454 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py | python | Index._isnan | (self) | Return if each value is NaN. | Return if each value is NaN. | [
"Return",
"if",
"each",
"value",
"is",
"NaN",
"."
] | def _isnan(self):
"""
Return if each value is NaN.
"""
if self._can_hold_na:
return isna(self)
else:
# shouldn't reach to this condition by checking hasnans beforehand
values = np.empty(len(self), dtype=np.bool_)
values.fill(False)
... | [
"def",
"_isnan",
"(",
"self",
")",
":",
"if",
"self",
".",
"_can_hold_na",
":",
"return",
"isna",
"(",
"self",
")",
"else",
":",
"# shouldn't reach to this condition by checking hasnans beforehand",
"values",
"=",
"np",
".",
"empty",
"(",
"len",
"(",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py#L1756-L1766 | ||
tzutalin/dlib-android | 989627cb7fe81cd1d41d73434b0e91ce1dd2683f | tools/lint/cpplint.py | python | CheckCStyleCast | (filename, clean_lines, linenum, cast_type, pattern, error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The string for the C++ cast to recommend. This is either
reinterpret_cast, static_c... | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The string for the C++ cast to recommend. This is either
reinterpret_cast, static_c... | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
".",
"Args",
":",
"filename",
":",
"The",
"name",
"of",
"the",
"current",
"file",
".",
"clean_lines",
":",
"A",
"CleansedLines",
"instance",
"containing",
"the",
"... | def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The s... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
... | https://github.com/tzutalin/dlib-android/blob/989627cb7fe81cd1d41d73434b0e91ce1dd2683f/tools/lint/cpplint.py#L5006-L5054 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | BookCtrlBase.DeletePage | (*args, **kwargs) | return _core_.BookCtrlBase_DeletePage(*args, **kwargs) | DeletePage(self, size_t n) -> bool | DeletePage(self, size_t n) -> bool | [
"DeletePage",
"(",
"self",
"size_t",
"n",
")",
"-",
">",
"bool"
] | def DeletePage(*args, **kwargs):
"""DeletePage(self, size_t n) -> bool"""
return _core_.BookCtrlBase_DeletePage(*args, **kwargs) | [
"def",
"DeletePage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_DeletePage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13610-L13612 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/bs4/builder/__init__.py | python | TreeBuilder.test_fragment_to_document | (self, fragment) | return fragment | Wrap an HTML fragment to make it look like a document.
Different parsers do this differently. For instance, lxml
introduces an empty <head> tag, and html5lib
doesn't. Abstracting this away lets us write simple tests
which run HTML fragments through the parser and compare the
res... | Wrap an HTML fragment to make it look like a document. | [
"Wrap",
"an",
"HTML",
"fragment",
"to",
"make",
"it",
"look",
"like",
"a",
"document",
"."
] | def test_fragment_to_document(self, fragment):
"""Wrap an HTML fragment to make it look like a document.
Different parsers do this differently. For instance, lxml
introduces an empty <head> tag, and html5lib
doesn't. Abstracting this away lets us write simple tests
which run HTM... | [
"def",
"test_fragment_to_document",
"(",
"self",
",",
"fragment",
")",
":",
"return",
"fragment"
] | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/bs4/builder/__init__.py#L129-L140 | |
p4lang/p4c | 3272e79369f20813cc1a555a5eb26f44432f84a4 | tools/cpplint.py | python | CheckVlogArguments | (filename, clean_lines, linenum, error) | Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | Checks that VLOG() is only used for defining a logging level. | [
"Checks",
"that",
"VLOG",
"()",
"is",
"only",
"used",
"for",
"defining",
"a",
"logging",
"level",
"."
] | def CheckVlogArguments(filename, clean_lines, linenum, error):
"""Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines i... | [
"def",
"CheckVlogArguments",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"Search",
"(",
"r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'",
",",
"line",
")",
... | https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L2644-L2660 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | PyControl.DoGetSize | (*args, **kwargs) | return _controls_.PyControl_DoGetSize(*args, **kwargs) | DoGetSize() -> (width, height) | DoGetSize() -> (width, height) | [
"DoGetSize",
"()",
"-",
">",
"(",
"width",
"height",
")"
] | def DoGetSize(*args, **kwargs):
"""DoGetSize() -> (width, height)"""
return _controls_.PyControl_DoGetSize(*args, **kwargs) | [
"def",
"DoGetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"PyControl_DoGetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5858-L5860 | |
google/filament | d21f092645b8e1e312307cbf89f1484891347c63 | third_party/spirv-tools/utils/check_copyright.py | python | comment | (text, prefix) | return '\n'.join(accum) | Returns commented-out text.
Each line of text will be prefixed by prefix and a space character. Any
trailing whitespace will be trimmed. | Returns commented-out text. | [
"Returns",
"commented",
"-",
"out",
"text",
"."
] | def comment(text, prefix):
"""Returns commented-out text.
Each line of text will be prefixed by prefix and a space character. Any
trailing whitespace will be trimmed.
"""
accum = ['{} {}'.format(prefix, line).rstrip() for line in text.split('\n')]
return '\n'.join(accum) | [
"def",
"comment",
"(",
"text",
",",
"prefix",
")",
":",
"accum",
"=",
"[",
"'{} {}'",
".",
"format",
"(",
"prefix",
",",
"line",
")",
".",
"rstrip",
"(",
")",
"for",
"line",
"in",
"text",
".",
"split",
"(",
"'\\n'",
")",
"]",
"return",
"'\\n'",
"... | https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/spirv-tools/utils/check_copyright.py#L102-L109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.