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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/wires/WireNetwork.py | python | WireNetwork.load_from_file | (self, wire_file) | Load vertices and edges from a file.
Args:
wire_file (:py:class:`str`): Input wire file name.
The file should have the following format::
# This is a comment
v x y z
v x y z
...
l i j # where i and j are vertex indices (starting ... | Load vertices and edges from a file. | [
"Load",
"vertices",
"and",
"edges",
"from",
"a",
"file",
"."
] | def load_from_file(self, wire_file):
""" Load vertices and edges from a file.
Args:
wire_file (:py:class:`str`): Input wire file name.
The file should have the following format::
# This is a comment
v x y z
v x y z
...
l ... | [
"def",
"load_from_file",
"(",
"self",
",",
"wire_file",
")",
":",
"self",
".",
"raw_wires",
"=",
"PyMesh",
".",
"WireNetwork",
".",
"create",
"(",
"wire_file",
")",
"self",
".",
"__initialize_wires",
"(",
")"
] | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/wires/WireNetwork.py#L102-L120 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/message.py | python | Message.SerializeToString | (self) | Serializes the protocol message to a binary string.
Returns:
A binary string representation of the message if all of the required
fields in the message are set (i.e. the message is initialized).
Raises:
message.EncodeError if the message isn't initialized. | Serializes the protocol message to a binary string. | [
"Serializes",
"the",
"protocol",
"message",
"to",
"a",
"binary",
"string",
"."
] | def SerializeToString(self):
"""Serializes the protocol message to a binary string.
Returns:
A binary string representation of the message if all of the required
fields in the message are set (i.e. the message is initialized).
Raises:
message.EncodeError if the message isn't initialized.... | [
"def",
"SerializeToString",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/message.py#L187-L197 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/msvc.py | python | EnvironmentInfo.UCRTIncludes | (self) | return [join(include, '%sucrt' % self._ucrt_subdir)] | Microsoft Universal C Runtime SDK Include.
Return
------
list of str
paths | Microsoft Universal C Runtime SDK Include. | [
"Microsoft",
"Universal",
"C",
"Runtime",
"SDK",
"Include",
"."
] | def UCRTIncludes(self):
"""
Microsoft Universal C Runtime SDK Include.
Return
------
list of str
paths
"""
if self.vs_ver < 14.0:
return []
include = join(self.si.UniversalCRTSdkDir, 'include')
return [join(include, '%sucr... | [
"def",
"UCRTIncludes",
"(",
"self",
")",
":",
"if",
"self",
".",
"vs_ver",
"<",
"14.0",
":",
"return",
"[",
"]",
"include",
"=",
"join",
"(",
"self",
".",
"si",
".",
"UniversalCRTSdkDir",
",",
"'include'",
")",
"return",
"[",
"join",
"(",
"include",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/msvc.py#L1496-L1509 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/metrics/perplexity.py | python | Perplexity.update | (self, *inputs) | Updates the internal evaluation result: math:preds and :math:labels.
Args:
inputs: Input `preds` and `labels`. `preds` and `labels` are a `Tensor`, list or numpy.ndarray.
`preds` is the predicted values, `labels` is the labels of the data.
The shape of `preds... | Updates the internal evaluation result: math:preds and :math:labels. | [
"Updates",
"the",
"internal",
"evaluation",
"result",
":",
"math",
":",
"preds",
"and",
":",
"math",
":",
"labels",
"."
] | def update(self, *inputs):
"""
Updates the internal evaluation result: math:preds and :math:labels.
Args:
inputs: Input `preds` and `labels`. `preds` and `labels` are a `Tensor`, list or numpy.ndarray.
`preds` is the predicted values, `labels` is the labels of th... | [
"def",
"update",
"(",
"self",
",",
"*",
"inputs",
")",
":",
"if",
"len",
"(",
"inputs",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"\"For 'Perplexity.update', it needs 2 inputs (predicted value, label), but got {}.\"",
".",
"format",
"(",
"len",
"(",
"inputs... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/metrics/perplexity.py#L69-L114 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Environment.py | python | Base.PrependUnique | (self, delete_existing=0, **kw) | Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front. | Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front. | [
"Prepend",
"values",
"to",
"existing",
"construction",
"variables",
"in",
"an",
"Environment",
"if",
"they",
"re",
"not",
"already",
"there",
".",
"If",
"delete_existing",
"is",
"1",
"removes",
"existing",
"values",
"first",
"so",
"values",
"move",
"to",
"fron... | def PrependUnique(self, delete_existing=0, **kw):
"""Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front.
"""
kw = copy_non_reserved_keywords(kw)... | [
"def",
"PrependUnique",
"(",
"self",
",",
"delete_existing",
"=",
"0",
",",
"*",
"*",
"kw",
")",
":",
"kw",
"=",
"copy_non_reserved_keywords",
"(",
"kw",
")",
"for",
"key",
",",
"val",
"in",
"kw",
".",
"items",
"(",
")",
":",
"if",
"is_List",
"(",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Environment.py#L1775-L1813 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/array_ops.py | python | apply_along_axis | (func1d, axis, arr, *args, **kwargs) | return res | Applies a function to 1-D slices along the given axis.
Executes ``func1d(a, *args, **kwargs)`` where `func1d` operates on 1-D arrays and `a` is a
1-D slice of arr along axis.
Args:
func1d (function): Maps `(M,) -> (Nj…)`. This function should accept 1-D arrays. It is
applied to 1-D slic... | Applies a function to 1-D slices along the given axis.
Executes ``func1d(a, *args, **kwargs)`` where `func1d` operates on 1-D arrays and `a` is a
1-D slice of arr along axis. | [
"Applies",
"a",
"function",
"to",
"1",
"-",
"D",
"slices",
"along",
"the",
"given",
"axis",
".",
"Executes",
"func1d",
"(",
"a",
"*",
"args",
"**",
"kwargs",
")",
"where",
"func1d",
"operates",
"on",
"1",
"-",
"D",
"arrays",
"and",
"a",
"is",
"a",
... | def apply_along_axis(func1d, axis, arr, *args, **kwargs):
"""
Applies a function to 1-D slices along the given axis.
Executes ``func1d(a, *args, **kwargs)`` where `func1d` operates on 1-D arrays and `a` is a
1-D slice of arr along axis.
Args:
func1d (function): Maps `(M,) -> (Nj…)`. This fu... | [
"def",
"apply_along_axis",
"(",
"func1d",
",",
"axis",
",",
"arr",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"ndim",
"=",
"F",
".",
"rank",
"(",
"arr",
")",
"shape",
"=",
"F",
".",
"shape",
"(",
"arr",
")",
"axis",
"=",
"_check_axis_in... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/array_ops.py#L2259-L2317 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | Cursor.underlying_typedef_type | (self) | return self._underlying_type | Return the underlying type of a typedef declaration.
Returns a Type for the typedef this cursor is a declaration for. If
the current cursor is not a typedef, this raises. | Return the underlying type of a typedef declaration. | [
"Return",
"the",
"underlying",
"type",
"of",
"a",
"typedef",
"declaration",
"."
] | def underlying_typedef_type(self):
"""Return the underlying type of a typedef declaration.
Returns a Type for the typedef this cursor is a declaration for. If
the current cursor is not a typedef, this raises.
"""
if not hasattr(self, '_underlying_type'):
assert self.... | [
"def",
"underlying_typedef_type",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_underlying_type'",
")",
":",
"assert",
"self",
".",
"kind",
".",
"is_declaration",
"(",
")",
"self",
".",
"_underlying_type",
"=",
"conf",
".",
"lib",
"."... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L1688-L1699 | |
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | tools_webrtc/presubmit_checks_lib/check_package_boundaries.py | python | _CheckBuildFile | (build_file_path, packages) | Iterates over all the targets of the given BUILD.gn file, and verifies that
the source files referenced by it don't belong to any of it's subpackages.
Returns an iterator over PackageBoundaryViolations for this package. | Iterates over all the targets of the given BUILD.gn file, and verifies that
the source files referenced by it don't belong to any of it's subpackages.
Returns an iterator over PackageBoundaryViolations for this package. | [
"Iterates",
"over",
"all",
"the",
"targets",
"of",
"the",
"given",
"BUILD",
".",
"gn",
"file",
"and",
"verifies",
"that",
"the",
"source",
"files",
"referenced",
"by",
"it",
"don",
"t",
"belong",
"to",
"any",
"of",
"it",
"s",
"subpackages",
".",
"Returns... | def _CheckBuildFile(build_file_path, packages):
"""Iterates over all the targets of the given BUILD.gn file, and verifies that
the source files referenced by it don't belong to any of it's subpackages.
Returns an iterator over PackageBoundaryViolations for this package.
"""
package = os.path.dirname(build... | [
"def",
"_CheckBuildFile",
"(",
"build_file_path",
",",
"packages",
")",
":",
"package",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"build_file_path",
")",
"subpackages_re",
"=",
"_BuildSubpackagesPattern",
"(",
"packages",
",",
"package",
")",
"build_file_conten... | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/tools_webrtc/presubmit_checks_lib/check_package_boundaries.py#L59-L79 | ||
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if no Copyright message appears at the top of the file. | Logs an error if no Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"no",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if no Copyright message appears at the top of the file."""
# We'll say it should occur by line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if re.search(r'Copyright', lines[line], re.I): bre... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll say it should occur by line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
","... | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L1627-L1637 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.CanDragColMove | (*args, **kwargs) | return _grid.Grid_CanDragColMove(*args, **kwargs) | CanDragColMove(self) -> bool | CanDragColMove(self) -> bool | [
"CanDragColMove",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanDragColMove(*args, **kwargs):
"""CanDragColMove(self) -> bool"""
return _grid.Grid_CanDragColMove(*args, **kwargs) | [
"def",
"CanDragColMove",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_CanDragColMove",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1638-L1640 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/latex2e/__init__.py | python | LaTeXTranslator.__init__ | (self, document, babel_class=Babel) | Heterogeneous stack.
Used by visit_* and depart_* functions in conjunction with the tree
traversal. Make sure that the pops correspond to the pushes. | Heterogeneous stack. | [
"Heterogeneous",
"stack",
"."
] | def __init__(self, document, babel_class=Babel):
nodes.NodeVisitor.__init__(self, document)
# Reporter
# ~~~~~~~~
self.warn = self.document.reporter.warning
self.error = self.document.reporter.error
# Settings
# ~~~~~~~~
self.settings = settings = documen... | [
"def",
"__init__",
"(",
"self",
",",
"document",
",",
"babel_class",
"=",
"Babel",
")",
":",
"nodes",
".",
"NodeVisitor",
".",
"__init__",
"(",
"self",
",",
"document",
")",
"# Reporter",
"# ~~~~~~~~",
"self",
".",
"warn",
"=",
"self",
".",
"document",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/latex2e/__init__.py#L1185-L1395 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | Constraint.OnlyEnforceIf | (self, boolvar) | return self | Adds an enforcement literal to the constraint.
This method adds one or more literals (that is, a boolean variable or its
negation) as enforcement literals. The conjunction of all these literals
determines whether the constraint is active or not. It acts as an
implication, so if the conjunction is true,... | Adds an enforcement literal to the constraint. | [
"Adds",
"an",
"enforcement",
"literal",
"to",
"the",
"constraint",
"."
] | def OnlyEnforceIf(self, boolvar):
"""Adds an enforcement literal to the constraint.
This method adds one or more literals (that is, a boolean variable or its
negation) as enforcement literals. The conjunction of all these literals
determines whether the constraint is active or not. It acts as an
... | [
"def",
"OnlyEnforceIf",
"(",
"self",
",",
"boolvar",
")",
":",
"if",
"cmh",
".",
"is_integral",
"(",
"boolvar",
")",
"and",
"int",
"(",
"boolvar",
")",
"==",
"1",
":",
"# Always true. Do nothing.",
"pass",
"elif",
"isinstance",
"(",
"boolvar",
",",
"list",... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L799-L828 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/yaml/__init__.py | python | add_path_resolver | (tag, path, kind=None, Loader=Loader, Dumper=Dumper) | Add a path based resolver for the given tag.
A path is a list of keys that forms a path
to a node in the representation tree.
Keys can be string values, integers, or None. | Add a path based resolver for the given tag.
A path is a list of keys that forms a path
to a node in the representation tree.
Keys can be string values, integers, or None. | [
"Add",
"a",
"path",
"based",
"resolver",
"for",
"the",
"given",
"tag",
".",
"A",
"path",
"is",
"a",
"list",
"of",
"keys",
"that",
"forms",
"a",
"path",
"to",
"a",
"node",
"in",
"the",
"representation",
"tree",
".",
"Keys",
"can",
"be",
"string",
"val... | def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):
"""
Add a path based resolver for the given tag.
A path is a list of keys that forms a path
to a node in the representation tree.
Keys can be string values, integers, or None.
"""
Loader.add_path_resolver(tag, path, k... | [
"def",
"add_path_resolver",
"(",
"tag",
",",
"path",
",",
"kind",
"=",
"None",
",",
"Loader",
"=",
"Loader",
",",
"Dumper",
"=",
"Dumper",
")",
":",
"Loader",
".",
"add_path_resolver",
"(",
"tag",
",",
"path",
",",
"kind",
")",
"Dumper",
".",
"add_path... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/yaml/__init__.py#L231-L239 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/Messenger.py | python | Messenger.getAllAccepting | (self, object) | Returns the list of all events accepted by the indicated object. | Returns the list of all events accepted by the indicated object. | [
"Returns",
"the",
"list",
"of",
"all",
"events",
"accepted",
"by",
"the",
"indicated",
"object",
"."
] | def getAllAccepting(self, object):
"""
Returns the list of all events accepted by the indicated object.
"""
self.lock.acquire()
try:
id = self._getMessengerId(object)
# Get the list of events this object is listening to
eventDict = self.__obje... | [
"def",
"getAllAccepting",
"(",
"self",
",",
"object",
")",
":",
"self",
".",
"lock",
".",
"acquire",
"(",
")",
"try",
":",
"id",
"=",
"self",
".",
"_getMessengerId",
"(",
"object",
")",
"# Get the list of events this object is listening to",
"eventDict",
"=",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Messenger.py#L241-L255 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saving_utils.py | python | _deserialize_nested_config | (deserialize_fn, config) | Deserializes arbitrary Keras `config` using `deserialize_fn`. | Deserializes arbitrary Keras `config` using `deserialize_fn`. | [
"Deserializes",
"arbitrary",
"Keras",
"config",
"using",
"deserialize_fn",
"."
] | def _deserialize_nested_config(deserialize_fn, config):
"""Deserializes arbitrary Keras `config` using `deserialize_fn`."""
def _is_single_object(obj):
if isinstance(obj, dict) and 'class_name' in obj:
return True # Serialized Keras object.
if isinstance(obj, str):
return True # Serialized fu... | [
"def",
"_deserialize_nested_config",
"(",
"deserialize_fn",
",",
"config",
")",
":",
"def",
"_is_single_object",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
"and",
"'class_name'",
"in",
"obj",
":",
"return",
"True",
"# Serialized Ke... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saving_utils.py#L241-L263 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Display.IsOk | (*args, **kwargs) | return _misc_.Display_IsOk(*args, **kwargs) | IsOk(self) -> bool
Return true if the object was initialized successfully | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""
IsOk(self) -> bool
Return true if the object was initialized successfully
"""
return _misc_.Display_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Display_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L6113-L6119 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/ccompiler.py | python | CCompiler._compile | (self, obj, src, ext, cc_args, extra_postargs, pp_opts) | Compile 'src' to product 'obj'. | Compile 'src' to product 'obj'. | [
"Compile",
"src",
"to",
"product",
"obj",
"."
] | def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
"""Compile 'src' to product 'obj'."""
# A concrete compiler class that does not override compile()
# should implement _compile().
pass | [
"def",
"_compile",
"(",
"self",
",",
"obj",
",",
"src",
",",
"ext",
",",
"cc_args",
",",
"extra_postargs",
",",
"pp_opts",
")",
":",
"# A concrete compiler class that does not override compile()",
"# should implement _compile().",
"pass"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/ccompiler.py#L626-L631 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Part/BOPTools/JoinFeatures.py | python | makeCutout | (name) | return obj | makeCutout(name): makes an Cutout object. | makeCutout(name): makes an Cutout object. | [
"makeCutout",
"(",
"name",
")",
":",
"makes",
"an",
"Cutout",
"object",
"."
] | def makeCutout(name):
'''makeCutout(name): makes an Cutout object.'''
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
FeatureCutout(obj)
if FreeCAD.GuiUp:
ViewProviderCutout(obj.ViewObject)
return obj | [
"def",
"makeCutout",
"(",
"name",
")",
":",
"obj",
"=",
"FreeCAD",
".",
"ActiveDocument",
".",
"addObject",
"(",
"\"Part::FeaturePython\"",
",",
"name",
")",
"FeatureCutout",
"(",
"obj",
")",
"if",
"FreeCAD",
".",
"GuiUp",
":",
"ViewProviderCutout",
"(",
"ob... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Part/BOPTools/JoinFeatures.py#L321-L327 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/connect/main.py | python | is_connected | () | Returns true if connected to the server. | Returns true if connected to the server. | [
"Returns",
"true",
"if",
"connected",
"to",
"the",
"server",
"."
] | def is_connected():
"""
Returns true if connected to the server.
"""
if (__CLIENT__ is not None and __SERVER__ is not None):
# both client and server are live
return True
elif (__CLIENT__ is None and __SERVER__ is None):
# both client and server are dead
return False
... | [
"def",
"is_connected",
"(",
")",
":",
"if",
"(",
"__CLIENT__",
"is",
"not",
"None",
"and",
"__SERVER__",
"is",
"not",
"None",
")",
":",
"# both client and server are live",
"return",
"True",
"elif",
"(",
"__CLIENT__",
"is",
"None",
"and",
"__SERVER__",
"is",
... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/connect/main.py#L117-L129 | ||
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py | python | BareosFdPluginVMware.parse_plugin_definition | (self, plugindef) | return bareosfd.bRC_OK | Parses the plugin arguments | Parses the plugin arguments | [
"Parses",
"the",
"plugin",
"arguments"
] | def parse_plugin_definition(self, plugindef):
"""
Parses the plugin arguments
"""
bareosfd.DebugMessage(
100,
"parse_plugin_definition() was called in module %s\n" % (__name__),
)
super(BareosFdPluginVMware, self).parse_plugin_definition(plugindef)... | [
"def",
"parse_plugin_definition",
"(",
"self",
",",
"plugindef",
")",
":",
"bareosfd",
".",
"DebugMessage",
"(",
"100",
",",
"\"parse_plugin_definition() was called in module %s\\n\"",
"%",
"(",
"__name__",
")",
",",
")",
"super",
"(",
"BareosFdPluginVMware",
",",
"... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py#L111-L129 | |
espressomd/espresso | 7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a | src/python/espressomd/visualization_opengl.py | python | Shape.draw | (self) | Draw shape via rasterization. Used as a default draw method.
Can and should be overwritten in child classes to implement a better
draw method. | Draw shape via rasterization. Used as a default draw method.
Can and should be overwritten in child classes to implement a better
draw method. | [
"Draw",
"shape",
"via",
"rasterization",
".",
"Used",
"as",
"a",
"default",
"draw",
"method",
".",
"Can",
"and",
"should",
"be",
"overwritten",
"in",
"child",
"classes",
"to",
"implement",
"a",
"better",
"draw",
"method",
"."
] | def draw(self):
"""
Draw shape via rasterization. Used as a default draw method.
Can and should be overwritten in child classes to implement a better
draw method.
"""
# get and store points of rasterized surface if not already present
if self.rasterized_surface_p... | [
"def",
"draw",
"(",
"self",
")",
":",
"# get and store points of rasterized surface if not already present",
"if",
"self",
".",
"rasterized_surface_points",
"is",
"None",
":",
"self",
".",
"rasterized_surface_points",
"=",
"self",
".",
"_rasterize_shape",
"(",
")",
"set... | https://github.com/espressomd/espresso/blob/7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a/src/python/espressomd/visualization_opengl.py#L1899-L1915 | ||
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/widgets/widget.py | python | Widget.requestModalMouseInputFocus | (self) | Requests modal mouse input focus.
When a widget has modal input focus that widget will be the only widget
receiving input even if the input occurs outside of the widget and
no matter what the input is.
The widget must be modal mouse input focusable in order for this to work.
Therefore, no other widget shou... | Requests modal mouse input focus.
When a widget has modal input focus that widget will be the only widget
receiving input even if the input occurs outside of the widget and
no matter what the input is.
The widget must be modal mouse input focusable in order for this to work.
Therefore, no other widget shou... | [
"Requests",
"modal",
"mouse",
"input",
"focus",
".",
"When",
"a",
"widget",
"has",
"modal",
"input",
"focus",
"that",
"widget",
"will",
"be",
"the",
"only",
"widget",
"receiving",
"input",
"even",
"if",
"the",
"input",
"occurs",
"outside",
"of",
"the",
"wi... | def requestModalMouseInputFocus(self):
"""
Requests modal mouse input focus.
When a widget has modal input focus that widget will be the only widget
receiving input even if the input occurs outside of the widget and
no matter what the input is.
The widget must be modal mouse input focusable in order for ... | [
"def",
"requestModalMouseInputFocus",
"(",
"self",
")",
":",
"if",
"self",
".",
"isVisible",
"(",
")",
":",
"if",
"self",
".",
"isModalMouseInputFocusable",
"(",
")",
":",
"self",
".",
"real_widget",
".",
"requestModalMouseInputFocus",
"(",
")"
] | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/widgets/widget.py#L371-L384 | ||
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | IsCppString | (line) | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 | Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string constant. | Does line terminate so, that the next symbol is in string constant. | [
"Does",
"line",
"terminate",
"so",
"that",
"the",
"next",
"symbol",
"is",
"in",
"string",
"constant",
"."
] | def IsCppString(line):
"""Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string c... | [
"def",
"IsCppString",
"(",
"line",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"r'\\\\'",
",",
"'XX'",
")",
"# after this, \\\\\" does not match to \\\"",
"return",
"(",
"(",
"line",
".",
"count",
"(",
"'\"'",
")",
"-",
"line",
".",
"count",
"(",
... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L1045-L1059 | |
cathywu/Sentiment-Analysis | eb501fd1375c0c3f3ab430f963255f1bb858e659 | PyML-0.7.9/PyML/classifiers/svm.py | python | SVM.__init__ | (self, arg = None, **args) | :Parameters:
- `arg` - another SVM object or a kernel object; if no argument is given
the kernel function of the training dataset is used
:Keywords:
- `C` - the svm C parameter
- `Cmode` - the way the C parameter is used; values: 'equal', 'classProb',
... | :Parameters:
- `arg` - another SVM object or a kernel object; if no argument is given
the kernel function of the training dataset is used
:Keywords:
- `C` - the svm C parameter
- `Cmode` - the way the C parameter is used; values: 'equal', 'classProb',
... | [
":",
"Parameters",
":",
"-",
"arg",
"-",
"another",
"SVM",
"object",
"or",
"a",
"kernel",
"object",
";",
"if",
"no",
"argument",
"is",
"given",
"the",
"kernel",
"function",
"of",
"the",
"training",
"dataset",
"is",
"used",
":",
"Keywords",
":",
"-",
"C... | def __init__(self, arg = None, **args):
"""
:Parameters:
- `arg` - another SVM object or a kernel object; if no argument is given
the kernel function of the training dataset is used
:Keywords:
- `C` - the svm C parameter
- `Cmode` - the way the... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"Classifier",
".",
"__init__",
"(",
"self",
",",
"arg",
",",
"*",
"*",
"args",
")",
"self",
".",
"kernel",
"=",
"None",
"if",
"arg",
".",
"__class__",
"==",... | https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/classifiers/svm.py#L46-L84 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/scons.py | python | _SetDependencies | (env, base_dir, res_file, rc_alls, translated_files,
static_files) | Sets dependencies in the environment.
Args:
env: The SCons environment.
base_dir: The base directory for filenames.
res_file: The res_file specified in the RC flags.
rc_alls: All non-rc_header outputs.
translated_files: Files that are structures or skeletons, and get
translated by GRIT.
... | Sets dependencies in the environment. | [
"Sets",
"dependencies",
"in",
"the",
"environment",
"."
] | def _SetDependencies(env, base_dir, res_file, rc_alls, translated_files,
static_files):
"""Sets dependencies in the environment.
Args:
env: The SCons environment.
base_dir: The base directory for filenames.
res_file: The res_file specified in the RC flags.
rc_alls: All non-rc_h... | [
"def",
"_SetDependencies",
"(",
"env",
",",
"base_dir",
",",
"res_file",
",",
"rc_alls",
",",
"translated_files",
",",
"static_files",
")",
":",
"if",
"res_file",
":",
"env",
".",
"Depends",
"(",
"os",
".",
"path",
".",
"join",
"(",
"base_dir",
",",
"res... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/scons.py#L169-L189 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlResource.LoadObject | (*args, **kwargs) | return _xrc.XmlResource_LoadObject(*args, **kwargs) | LoadObject(self, Window parent, String name, String classname) -> Object | LoadObject(self, Window parent, String name, String classname) -> Object | [
"LoadObject",
"(",
"self",
"Window",
"parent",
"String",
"name",
"String",
"classname",
")",
"-",
">",
"Object"
] | def LoadObject(*args, **kwargs):
"""LoadObject(self, Window parent, String name, String classname) -> Object"""
return _xrc.XmlResource_LoadObject(*args, **kwargs) | [
"def",
"LoadObject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_LoadObject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L159-L161 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/algorithms.py | python | _get_hashtable_algo | (values) | return htable, values | Parameters
----------
values : arraylike
Returns
-------
htable : HashTable subclass
values : ndarray | Parameters
----------
values : arraylike | [
"Parameters",
"----------",
"values",
":",
"arraylike"
] | def _get_hashtable_algo(values):
"""
Parameters
----------
values : arraylike
Returns
-------
htable : HashTable subclass
values : ndarray
"""
values, _ = _ensure_data(values)
ndtype = _check_object_for_strings(values)
htable = _hashtables[ndtype]
return htable, val... | [
"def",
"_get_hashtable_algo",
"(",
"values",
")",
":",
"values",
",",
"_",
"=",
"_ensure_data",
"(",
"values",
")",
"ndtype",
"=",
"_check_object_for_strings",
"(",
"values",
")",
"htable",
"=",
"_hashtables",
"[",
"ndtype",
"]",
"return",
"htable",
",",
"va... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/algorithms.py#L229-L244 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/mindrecord/shardwriter.py | python | ShardWriter._merge_blob | (self, blob_data) | return merged | Merge multiple blob data whose type is bytes or ndarray
Args:
blob_data (dict): Dict of blob data
Returns:
bytes, merged blob data | Merge multiple blob data whose type is bytes or ndarray | [
"Merge",
"multiple",
"blob",
"data",
"whose",
"type",
"is",
"bytes",
"or",
"ndarray"
] | def _merge_blob(self, blob_data):
"""
Merge multiple blob data whose type is bytes or ndarray
Args:
blob_data (dict): Dict of blob data
Returns:
bytes, merged blob data
"""
if len(blob_data) == 1:
values = [v for v in blob_data.values(... | [
"def",
"_merge_blob",
"(",
"self",
",",
"blob_data",
")",
":",
"if",
"len",
"(",
"blob_data",
")",
"==",
"1",
":",
"values",
"=",
"[",
"v",
"for",
"v",
"in",
"blob_data",
".",
"values",
"(",
")",
"]",
"return",
"bytes",
"(",
"values",
"[",
"0",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/shardwriter.py#L184-L209 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/objpanel.py | python | BooleanWidgetContainer.get_valuewidget_write | (self) | return widget | Return widget to edit numeric value of attribute
This is effectively the parametrisation of the masked.NumCtrl widget. | Return widget to edit numeric value of attribute
This is effectively the parametrisation of the masked.NumCtrl widget. | [
"Return",
"widget",
"to",
"edit",
"numeric",
"value",
"of",
"attribute",
"This",
"is",
"effectively",
"the",
"parametrisation",
"of",
"the",
"masked",
".",
"NumCtrl",
"widget",
"."
] | def get_valuewidget_write(self):
"""
Return widget to edit numeric value of attribute
This is effectively the parametrisation of the masked.NumCtrl widget.
"""
# print 'get_numeditwidget',value
widget = wx.CheckBox(self.parent, -1)
if self.immediate_apply:
... | [
"def",
"get_valuewidget_write",
"(",
"self",
")",
":",
"# print 'get_numeditwidget',value",
"widget",
"=",
"wx",
".",
"CheckBox",
"(",
"self",
".",
"parent",
",",
"-",
"1",
")",
"if",
"self",
".",
"immediate_apply",
":",
"self",
".",
"parent",
".",
"Bind",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L787-L799 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py | python | head | (url, **kwargs) | return request('head', url, **kwargs) | r"""Sends a HEAD request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes. If
`allow_redirects` is not provided, it will be set to `False` (as
opposed to the default :meth:`request` behavior).
:return: :class:`Response <Respo... | r"""Sends a HEAD request. | [
"r",
"Sends",
"a",
"HEAD",
"request",
"."
] | def head(url, **kwargs):
r"""Sends a HEAD request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes. If
`allow_redirects` is not provided, it will be set to `False` (as
opposed to the default :meth:`request` behavior).
:re... | [
"def",
"head",
"(",
"url",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"setdefault",
"(",
"'allow_redirects'",
",",
"False",
")",
"return",
"request",
"(",
"'head'",
",",
"url",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py#L92-L104 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/head.py | python | _TimeSeriesRegressionHead._train_ops | (self, features) | return estimator_lib.EstimatorSpec(
loss=model_outputs.loss,
mode=estimator_lib.ModeKeys.TRAIN,
train_op=train_op) | Add training ops to the graph. | Add training ops to the graph. | [
"Add",
"training",
"ops",
"to",
"the",
"graph",
"."
] | def _train_ops(self, features):
"""Add training ops to the graph."""
with variable_scope.variable_scope("model"):
model_outputs = self.state_manager.define_loss(
self.model, features, estimator_lib.ModeKeys.TRAIN)
train_op = optimizers.optimize_loss(
model_outputs.loss,
glob... | [
"def",
"_train_ops",
"(",
"self",
",",
"features",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"\"model\"",
")",
":",
"model_outputs",
"=",
"self",
".",
"state_manager",
".",
"define_loss",
"(",
"self",
".",
"model",
",",
"features",
",",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/head.py#L74-L89 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/distributions/python/ops/vector_exponential_linear_operator.py | python | VectorExponentialLinearOperator._mode_mean_shape | (self) | return shape | Shape for the mode/mean Tensors. | Shape for the mode/mean Tensors. | [
"Shape",
"for",
"the",
"mode",
"/",
"mean",
"Tensors",
"."
] | def _mode_mean_shape(self):
"""Shape for the mode/mean Tensors."""
shape = self.batch_shape.concatenate(self.event_shape)
has_static_shape = shape.is_fully_defined()
if not has_static_shape:
shape = array_ops.concat([
self.batch_shape_tensor(),
self.event_shape_tensor(),
... | [
"def",
"_mode_mean_shape",
"(",
"self",
")",
":",
"shape",
"=",
"self",
".",
"batch_shape",
".",
"concatenate",
"(",
"self",
".",
"event_shape",
")",
"has_static_shape",
"=",
"shape",
".",
"is_fully_defined",
"(",
")",
"if",
"not",
"has_static_shape",
":",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/vector_exponential_linear_operator.py#L279-L288 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-server/gen-py/sdhashsrv/sdhashsrv.py | python | Iface.saveSet | (self, num1, filename) | Parameters:
- num1
- filename | Parameters:
- num1
- filename | [
"Parameters",
":",
"-",
"num1",
"-",
"filename"
] | def saveSet(self, num1, filename):
"""
Parameters:
- num1
- filename
"""
pass | [
"def",
"saveSet",
"(",
"self",
",",
"num1",
",",
"filename",
")",
":",
"pass"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-server/gen-py/sdhashsrv/sdhashsrv.py#L76-L82 | ||
bumptop/BumpTop | 466d23597a07ae738f4265262fa01087fc6e257c | trunk/win/Source/bin/jinja2/meta.py | python | TrackingCodeGenerator.write | (self, x) | Don't write. | Don't write. | [
"Don",
"t",
"write",
"."
] | def write(self, x):
"""Don't write.""" | [
"def",
"write",
"(",
"self",
",",
"x",
")",
":"
] | https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/meta.py#L24-L25 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/environment.py | python | Environment.compile | (self, source, name=None, filename=None, raw=False,
defer_init=False) | Compile a node or template source code. The `name` parameter is
the load name of the template after it was joined using
:meth:`join_path` if necessary, not the filename on the file system.
the `filename` parameter is the estimated filename of the template on
the file system. If the tem... | Compile a node or template source code. The `name` parameter is
the load name of the template after it was joined using
:meth:`join_path` if necessary, not the filename on the file system.
the `filename` parameter is the estimated filename of the template on
the file system. If the tem... | [
"Compile",
"a",
"node",
"or",
"template",
"source",
"code",
".",
"The",
"name",
"parameter",
"is",
"the",
"load",
"name",
"of",
"the",
"template",
"after",
"it",
"was",
"joined",
"using",
":",
"meth",
":",
"join_path",
"if",
"necessary",
"not",
"the",
"f... | def compile(self, source, name=None, filename=None, raw=False,
defer_init=False):
"""Compile a node or template source code. The `name` parameter is
the load name of the template after it was joined using
:meth:`join_path` if necessary, not the filename on the file system.
... | [
"def",
"compile",
"(",
"self",
",",
"source",
",",
"name",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"defer_init",
"=",
"False",
")",
":",
"source_hint",
"=",
"None",
"try",
":",
"if",
"isinstance",
"(",
"source",
",",... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/environment.py#L454-L493 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py | python | RExec.s_reload | (self, *args) | return self.s_apply(self.r_reload, args) | Reload the module object, re-parsing and re-initializing it.
This method is implicitly called by code executing in the
restricted environment. Overriding this method in a subclass is
used to change the policies enforced by a restricted environment.
Similar to the r_reload() method, bu... | Reload the module object, re-parsing and re-initializing it. | [
"Reload",
"the",
"module",
"object",
"re",
"-",
"parsing",
"and",
"re",
"-",
"initializing",
"it",
"."
] | def s_reload(self, *args):
"""Reload the module object, re-parsing and re-initializing it.
This method is implicitly called by code executing in the
restricted environment. Overriding this method in a subclass is
used to change the policies enforced by a restricted environment.
... | [
"def",
"s_reload",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"s_apply",
"(",
"self",
".",
"r_reload",
",",
"args",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py#L477-L489 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/check.py | python | check.check_metadata | (self) | Ensures that all required elements of meta-data are supplied.
name, version, URL, (author and author_email) or
(maintainer and maintainer_email)).
Warns if any are missing. | Ensures that all required elements of meta-data are supplied. | [
"Ensures",
"that",
"all",
"required",
"elements",
"of",
"meta",
"-",
"data",
"are",
"supplied",
"."
] | def check_metadata(self):
"""Ensures that all required elements of meta-data are supplied.
name, version, URL, (author and author_email) or
(maintainer and maintainer_email)).
Warns if any are missing.
"""
metadata = self.distribution.metadata
missing = []
... | [
"def",
"check_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"self",
".",
"distribution",
".",
"metadata",
"missing",
"=",
"[",
"]",
"for",
"attr",
"in",
"(",
"'name'",
",",
"'version'",
",",
"'url'",
")",
":",
"if",
"not",
"(",
"hasattr",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/check.py#L80-L108 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shelve.py | python | open | (filename, flag='c', protocol=None, writeback=False) | return DbfilenameShelf(filename, flag, protocol, writeback) | Open a persistent dictionary for reading and writing.
The filename parameter is the base filename for the underlying
database. As a side-effect, an extension may be added to the
filename and more than one file may be created. The optional flag
parameter has the same interpretation as the flag paramet... | Open a persistent dictionary for reading and writing. | [
"Open",
"a",
"persistent",
"dictionary",
"for",
"reading",
"and",
"writing",
"."
] | def open(filename, flag='c', protocol=None, writeback=False):
"""Open a persistent dictionary for reading and writing.
The filename parameter is the base filename for the underlying
database. As a side-effect, an extension may be added to the
filename and more than one file may be created. The option... | [
"def",
"open",
"(",
"filename",
",",
"flag",
"=",
"'c'",
",",
"protocol",
"=",
"None",
",",
"writeback",
"=",
"False",
")",
":",
"return",
"DbfilenameShelf",
"(",
"filename",
",",
"flag",
",",
"protocol",
",",
"writeback",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shelve.py#L226-L239 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/generator.py | python | Html.TransformText | (self, text) | return text | Does character substitution on a string and returns
the html equivalent of the given string.
@param text: text to transform
@return: text with all special characters transformed | Does character substitution on a string and returns
the html equivalent of the given string.
@param text: text to transform
@return: text with all special characters transformed | [
"Does",
"character",
"substitution",
"on",
"a",
"string",
"and",
"returns",
"the",
"html",
"equivalent",
"of",
"the",
"given",
"string",
".",
"@param",
"text",
":",
"text",
"to",
"transform",
"@return",
":",
"text",
"with",
"all",
"special",
"characters",
"t... | def TransformText(self, text):
"""Does character substitution on a string and returns
the html equivalent of the given string.
@param text: text to transform
@return: text with all special characters transformed
"""
text = text.replace('&', "&") # Ampersands
... | [
"def",
"TransformText",
"(",
"self",
",",
"text",
")",
":",
"text",
"=",
"text",
".",
"replace",
"(",
"'&'",
",",
"\"&\"",
")",
"# Ampersands",
"text",
"=",
"text",
".",
"replace",
"(",
"'<'",
",",
"\"<\"",
")",
"# Less Than Symbols",
"text",
"=",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/generator.py#L318-L329 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ImageHandler.GetExtension | (*args, **kwargs) | return _core_.ImageHandler_GetExtension(*args, **kwargs) | GetExtension(self) -> String | GetExtension(self) -> String | [
"GetExtension",
"(",
"self",
")",
"-",
">",
"String"
] | def GetExtension(*args, **kwargs):
"""GetExtension(self) -> String"""
return _core_.ImageHandler_GetExtension(*args, **kwargs) | [
"def",
"GetExtension",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ImageHandler_GetExtension",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2624-L2626 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/tflite_convert.py | python | _get_tflite_converter | (flags) | return converter_fn(**converter_kwargs) | Makes a TFLiteConverter object based on the flags provided.
Args:
flags: argparse.Namespace object containing TFLite flags.
Returns:
TFLiteConverter object.
Raises:
ValueError: Invalid flags. | Makes a TFLiteConverter object based on the flags provided. | [
"Makes",
"a",
"TFLiteConverter",
"object",
"based",
"on",
"the",
"flags",
"provided",
"."
] | def _get_tflite_converter(flags):
"""Makes a TFLiteConverter object based on the flags provided.
Args:
flags: argparse.Namespace object containing TFLite flags.
Returns:
TFLiteConverter object.
Raises:
ValueError: Invalid flags.
"""
# Parse input and output arrays.
input_arrays = _parse_arr... | [
"def",
"_get_tflite_converter",
"(",
"flags",
")",
":",
"# Parse input and output arrays.",
"input_arrays",
"=",
"_parse_array",
"(",
"flags",
".",
"input_arrays",
")",
"input_shapes",
"=",
"None",
"if",
"flags",
".",
"input_shapes",
":",
"input_shapes_list",
"=",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/tflite_convert.py#L106-L151 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/X509.py | python | X509.getCommonName | (self) | Get the Subject's Common Name from the certificate.
The cryptlib_py module must be installed in order to use this
function.
@rtype: str or None
@return: The CN component of the certificate's subject DN, if
present. | Get the Subject's Common Name from the certificate. | [
"Get",
"the",
"Subject",
"s",
"Common",
"Name",
"from",
"the",
"certificate",
"."
] | def getCommonName(self):
"""Get the Subject's Common Name from the certificate.
The cryptlib_py module must be installed in order to use this
function.
@rtype: str or None
@return: The CN component of the certificate's subject DN, if
present.
"""
import ... | [
"def",
"getCommonName",
"(",
"self",
")",
":",
"import",
"cryptlib_py",
"import",
"array",
"c",
"=",
"cryptlib_py",
".",
"cryptImportCert",
"(",
"self",
".",
"bytes",
",",
"cryptlib_py",
".",
"CRYPT_UNUSED",
")",
"name",
"=",
"cryptlib_py",
".",
"CRYPT_CERTINF... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/X509.py#L112-L137 | ||
assimp/assimp | 97c7e084c2f7f8c9355ea42f73605890481bddc5 | port/PyAssimp/scripts/transformations.py | python | Arcball.drag | (self, point) | Update current cursor window coordinates. | Update current cursor window coordinates. | [
"Update",
"current",
"cursor",
"window",
"coordinates",
"."
] | def drag(self, point):
"""Update current cursor window coordinates."""
vnow = arcball_map_to_sphere(point, self._center, self._radius)
if self._axis is not None:
vnow = arcball_constrain_to_axis(vnow, self._axis)
self._qpre = self._qnow
t = numpy.cross(self._vdown,... | [
"def",
"drag",
"(",
"self",
",",
"point",
")",
":",
"vnow",
"=",
"arcball_map_to_sphere",
"(",
"point",
",",
"self",
".",
"_center",
",",
"self",
".",
"_radius",
")",
"if",
"self",
".",
"_axis",
"is",
"not",
"None",
":",
"vnow",
"=",
"arcball_constrain... | https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L1446-L1460 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/bccache.py | python | BytecodeCache.dump_bytecode | (self, bucket) | Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception. | Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception. | [
"Subclasses",
"have",
"to",
"override",
"this",
"method",
"to",
"write",
"the",
"bytecode",
"from",
"a",
"bucket",
"back",
"to",
"the",
"cache",
".",
"If",
"it",
"unable",
"to",
"do",
"so",
"it",
"must",
"not",
"fail",
"silently",
"but",
"raise",
"an",
... | def dump_bytecode(self, bucket):
"""Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception.
"""
raise NotImplementedError() | [
"def",
"dump_bytecode",
"(",
"self",
",",
"bucket",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/bccache.py#L153-L158 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py | python | _ServiceStubBuilder.BuildServiceStub | (self, cls) | Constructs the stub class.
Args:
cls: The class that will be constructed. | Constructs the stub class. | [
"Constructs",
"the",
"stub",
"class",
"."
] | def BuildServiceStub(self, cls):
"""Constructs the stub class.
Args:
cls: The class that will be constructed.
"""
def _ServiceStubInit(stub, rpc_channel):
stub.rpc_channel = rpc_channel
self.cls = cls
cls.__init__ = _ServiceStubInit
for method in self.descriptor.methods:
... | [
"def",
"BuildServiceStub",
"(",
"self",
",",
"cls",
")",
":",
"def",
"_ServiceStubInit",
"(",
"stub",
",",
"rpc_channel",
")",
":",
"stub",
".",
"rpc_channel",
"=",
"rpc_channel",
"self",
".",
"cls",
"=",
"cls",
"cls",
".",
"__init__",
"=",
"_ServiceStubIn... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py#L251-L263 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py | python | read_docstrings | (lang) | Read in docstrings from lang-specific docstring dictionary.
Transfer docstrings, translated to lang, from a dictionary-file
to the methods of classes Screen and Turtle and - in revised form -
to the corresponding functions. | Read in docstrings from lang-specific docstring dictionary. | [
"Read",
"in",
"docstrings",
"from",
"lang",
"-",
"specific",
"docstring",
"dictionary",
"."
] | def read_docstrings(lang):
"""Read in docstrings from lang-specific docstring dictionary.
Transfer docstrings, translated to lang, from a dictionary-file
to the methods of classes Screen and Turtle and - in revised form -
to the corresponding functions.
"""
modname = "turtle_docstringdict_%(lan... | [
"def",
"read_docstrings",
"(",
"lang",
")",
":",
"modname",
"=",
"\"turtle_docstringdict_%(language)s\"",
"%",
"{",
"'language'",
":",
"lang",
".",
"lower",
"(",
")",
"}",
"module",
"=",
"__import__",
"(",
"modname",
")",
"docsdict",
"=",
"module",
".",
"doc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L3854-L3869 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/stats-viewer.py | python | Main | (data_file, name_filter) | Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names. | Run the stats counter. | [
"Run",
"the",
"stats",
"counter",
"."
] | def Main(data_file, name_filter):
"""Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names.
"""
StatsViewer(data_file, name_filter).Run() | [
"def",
"Main",
"(",
"data_file",
",",
"name_filter",
")",
":",
"StatsViewer",
"(",
"data_file",
",",
"name_filter",
")",
".",
"Run",
"(",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/stats-viewer.py#L451-L458 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/learning_rate_decay.py | python | natural_exp_decay | (learning_rate, global_step, decay_steps, decay_rate,
staircase=False, name=None) | Applies natural exponential decay to the initial learning rate.
When training a model, it is often recommended to lower the learning rate as
the training progresses. This function applies an exponential decay function
to a provided initial learning rate. It requires an `global_step` value to
compute the deca... | Applies natural exponential decay to the initial learning rate. | [
"Applies",
"natural",
"exponential",
"decay",
"to",
"the",
"initial",
"learning",
"rate",
"."
] | def natural_exp_decay(learning_rate, global_step, decay_steps, decay_rate,
staircase=False, name=None):
"""Applies natural exponential decay to the initial learning rate.
When training a model, it is often recommended to lower the learning rate as
the training progresses. This function app... | [
"def",
"natural_exp_decay",
"(",
"learning_rate",
",",
"global_step",
",",
"decay_steps",
",",
"decay_rate",
",",
"staircase",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"learning_rate",
",",
"global_step",
",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/learning_rate_decay.py#L244-L300 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBExpressionOptions.GetPlaygroundTransformEnabled | (self) | return _lldb.SBExpressionOptions_GetPlaygroundTransformEnabled(self) | GetPlaygroundTransformEnabled(self) -> bool | GetPlaygroundTransformEnabled(self) -> bool | [
"GetPlaygroundTransformEnabled",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetPlaygroundTransformEnabled(self):
"""GetPlaygroundTransformEnabled(self) -> bool"""
return _lldb.SBExpressionOptions_GetPlaygroundTransformEnabled(self) | [
"def",
"GetPlaygroundTransformEnabled",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBExpressionOptions_GetPlaygroundTransformEnabled",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L4174-L4176 | |
hyperledger-archives/iroha | ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9 | example/python/irohalib.py | python | IrohaGrpc.tx_status | (self, transaction) | return status_name, status_code, error_message | Request a status of a transaction
:param transaction: the transaction, which status is about to be known
:return: a tuple with the symbolic status description,
integral status code, and error message string (will be empty if no error occurred) | Request a status of a transaction
:param transaction: the transaction, which status is about to be known
:return: a tuple with the symbolic status description,
integral status code, and error message string (will be empty if no error occurred) | [
"Request",
"a",
"status",
"of",
"a",
"transaction",
":",
"param",
"transaction",
":",
"the",
"transaction",
"which",
"status",
"is",
"about",
"to",
"be",
"known",
":",
"return",
":",
"a",
"tuple",
"with",
"the",
"symbolic",
"status",
"description",
"integral... | def tx_status(self, transaction):
"""
Request a status of a transaction
:param transaction: the transaction, which status is about to be known
:return: a tuple with the symbolic status description,
integral status code, and error message string (will be empty if no error occurred... | [
"def",
"tx_status",
"(",
"self",
",",
"transaction",
")",
":",
"request",
"=",
"endpoint_pb2",
".",
"TxStatusRequest",
"(",
")",
"request",
".",
"tx_hash",
"=",
"binascii",
".",
"hexlify",
"(",
"IrohaCrypto",
".",
"hash",
"(",
"transaction",
")",
")",
"res... | https://github.com/hyperledger-archives/iroha/blob/ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9/example/python/irohalib.py#L350-L363 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | libcxx/utils/libcxx/util.py | python | capture | (args, env=None) | return out | capture(command) - Run the given command (or argv list) in a shell and
return the standard output. Raises a CalledProcessError if the command
exits with a non-zero status. | capture(command) - Run the given command (or argv list) in a shell and
return the standard output. Raises a CalledProcessError if the command
exits with a non-zero status. | [
"capture",
"(",
"command",
")",
"-",
"Run",
"the",
"given",
"command",
"(",
"or",
"argv",
"list",
")",
"in",
"a",
"shell",
"and",
"return",
"the",
"standard",
"output",
".",
"Raises",
"a",
"CalledProcessError",
"if",
"the",
"command",
"exits",
"with",
"a... | def capture(args, env=None):
"""capture(command) - Run the given command (or argv list) in a shell and
return the standard output. Raises a CalledProcessError if the command
exits with a non-zero status."""
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
... | [
"def",
"capture",
"(",
"args",
",",
"env",
"=",
"None",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIPE",
",",
"env",
"=",
"env",
")",
"out",
... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/libcxx/util.py#L84-L97 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/check.py | python | check.warn | (self, msg) | return Command.warn(self, msg) | Counts the number of warnings that occurs. | Counts the number of warnings that occurs. | [
"Counts",
"the",
"number",
"of",
"warnings",
"that",
"occurs",
"."
] | def warn(self, msg):
"""Counts the number of warnings that occurs."""
self._warnings += 1
return Command.warn(self, msg) | [
"def",
"warn",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"_warnings",
"+=",
"1",
"return",
"Command",
".",
"warn",
"(",
"self",
",",
"msg",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/check.py#L61-L64 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column.py | python | _record_variable_scope_and_name | (embedding_var_name,
embedding_var_name_in_fc,
is_shared_embedding=False) | Add embedding variable name and scope to collection. | Add embedding variable name and scope to collection. | [
"Add",
"embedding",
"variable",
"name",
"and",
"scope",
"to",
"collection",
"."
] | def _record_variable_scope_and_name(embedding_var_name,
embedding_var_name_in_fc,
is_shared_embedding=False):
"""Add embedding variable name and scope to collection."""
g = ops.get_default_graph()
collection = g.get_collection_ref(_TPU_FC_TO_... | [
"def",
"_record_variable_scope_and_name",
"(",
"embedding_var_name",
",",
"embedding_var_name_in_fc",
",",
"is_shared_embedding",
"=",
"False",
")",
":",
"g",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"collection",
"=",
"g",
".",
"get_collection_ref",
"(",
"_T... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column.py#L585-L615 | ||
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/busco/GeneSetAnalysis.py | python | GeneSetAnalysis.run_analysis | (self) | This function calls all needed steps for running the analysis. | This function calls all needed steps for running the analysis. | [
"This",
"function",
"calls",
"all",
"needed",
"steps",
"for",
"running",
"the",
"analysis",
"."
] | def run_analysis(self):
"""
This function calls all needed steps for running the analysis.
"""
super(GeneSetAnalysis, self).run_analysis()
# validate sequence file
if super(GeneSetAnalysis, self).check_protein_file() is False:
GeneSetAnalysis._logger.error('Pl... | [
"def",
"run_analysis",
"(",
"self",
")",
":",
"super",
"(",
"GeneSetAnalysis",
",",
"self",
")",
".",
"run_analysis",
"(",
")",
"# validate sequence file",
"if",
"super",
"(",
"GeneSetAnalysis",
",",
"self",
")",
".",
"check_protein_file",
"(",
")",
"is",
"F... | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/busco/GeneSetAnalysis.py#L50-L65 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/egg_info.py | python | FileList.prune | (self, dir) | return self._remove_files(match.match) | Filter out files from 'dir/'. | Filter out files from 'dir/'. | [
"Filter",
"out",
"files",
"from",
"dir",
"/",
"."
] | def prune(self, dir):
"""Filter out files from 'dir/'."""
match = translate_pattern(os.path.join(dir, '**'))
return self._remove_files(match.match) | [
"def",
"prune",
"(",
"self",
",",
"dir",
")",
":",
"match",
"=",
"translate_pattern",
"(",
"os",
".",
"path",
".",
"join",
"(",
"dir",
",",
"'**'",
")",
")",
"return",
"self",
".",
"_remove_files",
"(",
"match",
".",
"match",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/egg_info.py#L450-L453 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/debugging/__init__.py | python | dump_signature | (root, tag=None) | Debug helper that prints the signature of a Function. | Debug helper that prints the signature of a Function. | [
"Debug",
"helper",
"that",
"prints",
"the",
"signature",
"of",
"a",
"Function",
"."
] | def dump_signature(root, tag=None):
'''
Debug helper that prints the signature of a Function.
'''
print(str(root)) | [
"def",
"dump_signature",
"(",
"root",
",",
"tag",
"=",
"None",
")",
":",
"print",
"(",
"str",
"(",
"root",
")",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/debugging/__init__.py#L29-L33 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/c_config.py | python | cxx_add_flags | (conf) | Adds CXXFLAGS / CPPFLAGS from os.environ to conf.env | Adds CXXFLAGS / CPPFLAGS from os.environ to conf.env | [
"Adds",
"CXXFLAGS",
"/",
"CPPFLAGS",
"from",
"os",
".",
"environ",
"to",
"conf",
".",
"env"
] | def cxx_add_flags(conf):
"""
Adds CXXFLAGS / CPPFLAGS from os.environ to conf.env
"""
conf.add_os_flags('CPPFLAGS', dup=False)
conf.add_os_flags('CXXFLAGS', dup=False) | [
"def",
"cxx_add_flags",
"(",
"conf",
")",
":",
"conf",
".",
"add_os_flags",
"(",
"'CPPFLAGS'",
",",
"dup",
"=",
"False",
")",
"conf",
".",
"add_os_flags",
"(",
"'CXXFLAGS'",
",",
"dup",
"=",
"False",
")"
] | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/c_config.py#L985-L990 | ||
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/ext/pybind11/tools/clang/cindex.py | python | CompileCommand.directory | (self) | return conf.lib.clang_CompileCommand_getDirectory(self.cmd) | Get the working directory for this CompileCommand | Get the working directory for this CompileCommand | [
"Get",
"the",
"working",
"directory",
"for",
"this",
"CompileCommand"
] | def directory(self):
"""Get the working directory for this CompileCommand"""
return conf.lib.clang_CompileCommand_getDirectory(self.cmd) | [
"def",
"directory",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CompileCommand_getDirectory",
"(",
"self",
".",
"cmd",
")"
] | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L2759-L2761 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/profiler.py | python | Tracemalloc.report | (self, sortby='lineno', cumulative=True, limit=100) | Return the snapshot statistics to the console. | Return the snapshot statistics to the console. | [
"Return",
"the",
"snapshot",
"statistics",
"to",
"the",
"console",
"."
] | def report(self, sortby='lineno', cumulative=True, limit=100):
"""
Return the snapshot statistics to the console.
"""
for stat in self.snapshot.statistics(sortby, cumulative)[:limit]:
print(stat) | [
"def",
"report",
"(",
"self",
",",
"sortby",
"=",
"'lineno'",
",",
"cumulative",
"=",
"True",
",",
"limit",
"=",
"100",
")",
":",
"for",
"stat",
"in",
"self",
".",
"snapshot",
".",
"statistics",
"(",
"sortby",
",",
"cumulative",
")",
"[",
":",
"limit... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/profiler.py#L108-L113 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/slim/python/slim/model_analyzer.py | python | analyze_ops | (graph, print_info=False) | return total_size | Compute the estimated size of the ops.outputs in the graph.
Args:
graph: the graph containing the operations.
print_info: Optional, if true print ops and their outputs.
Returns:
total size of the ops.outputs | Compute the estimated size of the ops.outputs in the graph. | [
"Compute",
"the",
"estimated",
"size",
"of",
"the",
"ops",
".",
"outputs",
"in",
"the",
"graph",
"."
] | def analyze_ops(graph, print_info=False):
"""Compute the estimated size of the ops.outputs in the graph.
Args:
graph: the graph containing the operations.
print_info: Optional, if true print ops and their outputs.
Returns:
total size of the ops.outputs
"""
if print_info:
print('---------')
... | [
"def",
"analyze_ops",
"(",
"graph",
",",
"print_info",
"=",
"False",
")",
":",
"if",
"print_info",
":",
"print",
"(",
"'---------'",
")",
"print",
"(",
"'Operations: name -> (type shapes) [size]'",
")",
"print",
"(",
"'---------'",
")",
"total_size",
"=",
"0",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/slim/python/slim/model_analyzer.py#L53-L80 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/ide/activegrid/tool/AbstractEditor.py | python | EditorCanvasShapeEvtHandler.OnMovePre | (self, dc, x, y, oldX, oldY, display) | return ogl.ShapeEvtHandler.OnMovePre(self, dc, x, y, oldX, oldY, display) | Prevent objects from being dragged outside of viewable area | Prevent objects from being dragged outside of viewable area | [
"Prevent",
"objects",
"from",
"being",
"dragged",
"outside",
"of",
"viewable",
"area"
] | def OnMovePre(self, dc, x, y, oldX, oldY, display):
""" Prevent objects from being dragged outside of viewable area """
if (x < 0) or (y < 0) or (x > self._view._maxWidth) or (y > self._view._maxHeight):
return False
return ogl.ShapeEvtHandler.OnMovePre(self, dc, x, y, oldX, oldY, d... | [
"def",
"OnMovePre",
"(",
"self",
",",
"dc",
",",
"x",
",",
"y",
",",
"oldX",
",",
"oldY",
",",
"display",
")",
":",
"if",
"(",
"x",
"<",
"0",
")",
"or",
"(",
"y",
"<",
"0",
")",
"or",
"(",
"x",
">",
"self",
".",
"_view",
".",
"_maxWidth",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/AbstractEditor.py#L814-L819 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py | python | EquivSet.insert_equiv | (self, *objs) | return self._insert(objs) | Insert a set of equivalent objects by modifying self. This
method can be overloaded to transform object type before insertion. | Insert a set of equivalent objects by modifying self. This
method can be overloaded to transform object type before insertion. | [
"Insert",
"a",
"set",
"of",
"equivalent",
"objects",
"by",
"modifying",
"self",
".",
"This",
"method",
"can",
"be",
"overloaded",
"to",
"transform",
"object",
"type",
"before",
"insertion",
"."
] | def insert_equiv(self, *objs):
"""Insert a set of equivalent objects by modifying self. This
method can be overloaded to transform object type before insertion.
"""
return self._insert(objs) | [
"def",
"insert_equiv",
"(",
"self",
",",
"*",
"objs",
")",
":",
"return",
"self",
".",
"_insert",
"(",
"objs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py#L279-L283 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/fft/_pocketfft.py | python | irfft2 | (a, s=None, axes=(-2, -1), norm=None) | return irfftn(a, s, axes, norm) | Compute the 2-dimensional inverse FFT of a real array.
Parameters
----------
a : array_like
The input array
s : sequence of ints, optional
Shape of the real output to the inverse FFT.
axes : sequence of ints, optional
The axes over which to compute the inverse fft.
D... | Compute the 2-dimensional inverse FFT of a real array. | [
"Compute",
"the",
"2",
"-",
"dimensional",
"inverse",
"FFT",
"of",
"a",
"real",
"array",
"."
] | def irfft2(a, s=None, axes=(-2, -1), norm=None):
"""
Compute the 2-dimensional inverse FFT of a real array.
Parameters
----------
a : array_like
The input array
s : sequence of ints, optional
Shape of the real output to the inverse FFT.
axes : sequence of ints, optional
... | [
"def",
"irfft2",
"(",
"a",
",",
"s",
"=",
"None",
",",
"axes",
"=",
"(",
"-",
"2",
",",
"-",
"1",
")",
",",
"norm",
"=",
"None",
")",
":",
"return",
"irfftn",
"(",
"a",
",",
"s",
",",
"axes",
",",
"norm",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/fft/_pocketfft.py#L1273-L1307 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/service/read/string_resource.py | python | read_age2_hd_3x_stringresources | (stringres, srcdir) | return count | HD Edition 3.x and below store language .txt files
in the Bin/ folder.
Specific language strings are in Bin/$LANG/*.txt.
The data is stored in the `stringres` storage. | HD Edition 3.x and below store language .txt files
in the Bin/ folder.
Specific language strings are in Bin/$LANG/*.txt. | [
"HD",
"Edition",
"3",
".",
"x",
"and",
"below",
"store",
"language",
".",
"txt",
"files",
"in",
"the",
"Bin",
"/",
"folder",
".",
"Specific",
"language",
"strings",
"are",
"in",
"Bin",
"/",
"$LANG",
"/",
"*",
".",
"txt",
"."
] | def read_age2_hd_3x_stringresources(stringres, srcdir):
"""
HD Edition 3.x and below store language .txt files
in the Bin/ folder.
Specific language strings are in Bin/$LANG/*.txt.
The data is stored in the `stringres` storage.
"""
count = 0
for lang in srcdir["bin"].list():
l... | [
"def",
"read_age2_hd_3x_stringresources",
"(",
"stringres",
",",
"srcdir",
")",
":",
"count",
"=",
"0",
"for",
"lang",
"in",
"srcdir",
"[",
"\"bin\"",
"]",
".",
"list",
"(",
")",
":",
"lang_path",
"=",
"srcdir",
"[",
"\"bin\"",
",",
"lang",
".",
"decode"... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/service/read/string_resource.py#L94-L137 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/decoder/beam_search_decoder.py | python | BeamSearchDecoder.read_array | (self, init, is_ids=False, is_scores=False) | return read_value | Read an array to get the decoded ids and scores generated by previous
RNN step. At the first step of RNN, the init variable mut be used to
initialize the array.
Args:
init (Variable): The initial variable for first step usage. init
must be provided.
is_id... | Read an array to get the decoded ids and scores generated by previous
RNN step. At the first step of RNN, the init variable mut be used to
initialize the array. | [
"Read",
"an",
"array",
"to",
"get",
"the",
"decoded",
"ids",
"and",
"scores",
"generated",
"by",
"previous",
"RNN",
"step",
".",
"At",
"the",
"first",
"step",
"of",
"RNN",
"the",
"init",
"variable",
"mut",
"be",
"used",
"to",
"initialize",
"the",
"array"... | def read_array(self, init, is_ids=False, is_scores=False):
"""
Read an array to get the decoded ids and scores generated by previous
RNN step. At the first step of RNN, the init variable mut be used to
initialize the array.
Args:
init (Variable): The initial variable... | [
"def",
"read_array",
"(",
"self",
",",
"init",
",",
"is_ids",
"=",
"False",
",",
"is_scores",
"=",
"False",
")",
":",
"self",
".",
"_assert_in_decoder_block",
"(",
"'read_array'",
")",
"if",
"is_ids",
"and",
"is_scores",
":",
"raise",
"ValueError",
"(",
"'... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/decoder/beam_search_decoder.py#L733-L780 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.Set | (*args, **kwargs) | return _misc_.DateTime_Set(*args, **kwargs) | Set(self, int day, int month=Inv_Month, int year=Inv_Year, int hour=0,
int minute=0, int second=0, int millisec=0) -> DateTime | Set(self, int day, int month=Inv_Month, int year=Inv_Year, int hour=0,
int minute=0, int second=0, int millisec=0) -> DateTime | [
"Set",
"(",
"self",
"int",
"day",
"int",
"month",
"=",
"Inv_Month",
"int",
"year",
"=",
"Inv_Year",
"int",
"hour",
"=",
"0",
"int",
"minute",
"=",
"0",
"int",
"second",
"=",
"0",
"int",
"millisec",
"=",
"0",
")",
"-",
">",
"DateTime"
] | def Set(*args, **kwargs):
"""
Set(self, int day, int month=Inv_Month, int year=Inv_Year, int hour=0,
int minute=0, int second=0, int millisec=0) -> DateTime
"""
return _misc_.DateTime_Set(*args, **kwargs) | [
"def",
"Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3802-L3807 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/image_tool.py | python | ImageTool.color_cast | (self, offset=20, inplace=True) | Add a random value from [-offset, offset] to each channel
Args:
offset: cast offset, >0 and <255
inplace: inplace imgs or not ( return new_imgs) | Add a random value from [-offset, offset] to each channel | [
"Add",
"a",
"random",
"value",
"from",
"[",
"-",
"offset",
"offset",
"]",
"to",
"each",
"channel"
] | def color_cast(self, offset=20, inplace=True):
'''Add a random value from [-offset, offset] to each channel
Args:
offset: cast offset, >0 and <255
inplace: inplace imgs or not ( return new_imgs)
'''
new_imgs = []
if offset < 0 or offset > 255:
... | [
"def",
"color_cast",
"(",
"self",
",",
"offset",
"=",
"20",
",",
"inplace",
"=",
"True",
")",
":",
"new_imgs",
"=",
"[",
"]",
"if",
"offset",
"<",
"0",
"or",
"offset",
">",
"255",
":",
"raise",
"Exception",
"(",
"'offset must be >0 and <255'",
")",
"fo... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/image_tool.py#L594-L612 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/compare-version-numbers.py | python | Solution2.compareVersion2 | (self, version1, version2) | return cmp(v1, v2) | :type version1: str
:type version2: str
:rtype: int | :type version1: str
:type version2: str
:rtype: int | [
":",
"type",
"version1",
":",
"str",
":",
"type",
"version2",
":",
"str",
":",
"rtype",
":",
"int"
] | def compareVersion2(self, version1, version2):
"""
:type version1: str
:type version2: str
:rtype: int
"""
v1 = [int(x) for x in version1.split('.')]
v2 = [int(x) for x in version2.split('.')]
while len(v1) != len(v2):
if len(v1) > len(v2):
... | [
"def",
"compareVersion2",
"(",
"self",
",",
"version1",
",",
"version2",
")",
":",
"v1",
"=",
"[",
"int",
"(",
"x",
")",
"for",
"x",
"in",
"version1",
".",
"split",
"(",
"'.'",
")",
"]",
"v2",
"=",
"[",
"int",
"(",
"x",
")",
"for",
"x",
"in",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/compare-version-numbers.py#L60-L73 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSSettings.py | python | ConvertVCMacrosToMSBuild | (s) | return s | Convert the the MSVS macros found in the string to the MSBuild equivalent.
This list is probably not exhaustive. Add as needed. | Convert the the MSVS macros found in the string to the MSBuild equivalent. | [
"Convert",
"the",
"the",
"MSVS",
"macros",
"found",
"in",
"the",
"string",
"to",
"the",
"MSBuild",
"equivalent",
"."
] | def ConvertVCMacrosToMSBuild(s):
"""Convert the the MSVS macros found in the string to the MSBuild equivalent.
This list is probably not exhaustive. Add as needed.
"""
if '$' in s:
replace_map = {
'$(ConfigurationName)': '$(Configuration)',
'$(InputDir)': '%(RelativeDir)',
'$(Input... | [
"def",
"ConvertVCMacrosToMSBuild",
"(",
"s",
")",
":",
"if",
"'$'",
"in",
"s",
":",
"replace_map",
"=",
"{",
"'$(ConfigurationName)'",
":",
"'$(Configuration)'",
",",
"'$(InputDir)'",
":",
"'%(RelativeDir)'",
",",
"'$(InputExt)'",
":",
"'%(Extension)'",
",",
"'$(I... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSSettings.py#L419-L439 | |
ideawu/ssdb | f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4 | deps/cpy/antlr3/tree.py | python | CommonTreeNodeStream.push | (self, index) | Make stream jump to a new location, saving old location.
Switch back with pop(). | Make stream jump to a new location, saving old location.
Switch back with pop(). | [
"Make",
"stream",
"jump",
"to",
"a",
"new",
"location",
"saving",
"old",
"location",
".",
"Switch",
"back",
"with",
"pop",
"()",
"."
] | def push(self, index):
"""
Make stream jump to a new location, saving old location.
Switch back with pop().
"""
self.calls.append(self.p) # save current index
self.seek(index) | [
"def",
"push",
"(",
"self",
",",
"index",
")",
":",
"self",
".",
"calls",
".",
"append",
"(",
"self",
".",
"p",
")",
"# save current index",
"self",
".",
"seek",
"(",
"index",
")"
] | https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/tree.py#L1909-L1916 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py | python | _l2_loss_flops | (graph, node) | return ops.OpStats("flops", in_shape.num_elements() * 3 - 1) | Compute flops for L2Loss operation. | Compute flops for L2Loss operation. | [
"Compute",
"flops",
"for",
"L2Loss",
"operation",
"."
] | def _l2_loss_flops(graph, node):
"""Compute flops for L2Loss operation."""
in_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0])
in_shape.assert_is_fully_defined()
# Tensorflow uses inefficient implementation, with (3*N-1) flops:
# Optimal implementation is 2*N flops
return ops.OpStats... | [
"def",
"_l2_loss_flops",
"(",
"graph",
",",
"node",
")",
":",
"in_shape",
"=",
"graph_util",
".",
"tensor_shape_from_node_def_name",
"(",
"graph",
",",
"node",
".",
"input",
"[",
"0",
"]",
")",
"in_shape",
".",
"assert_is_fully_defined",
"(",
")",
"# Tensorflo... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L115-L121 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | FileProperty_GetClassValidator | (*args) | return _propgrid.FileProperty_GetClassValidator(*args) | FileProperty_GetClassValidator() -> Validator | FileProperty_GetClassValidator() -> Validator | [
"FileProperty_GetClassValidator",
"()",
"-",
">",
"Validator"
] | def FileProperty_GetClassValidator(*args):
"""FileProperty_GetClassValidator() -> Validator"""
return _propgrid.FileProperty_GetClassValidator(*args) | [
"def",
"FileProperty_GetClassValidator",
"(",
"*",
"args",
")",
":",
"return",
"_propgrid",
".",
"FileProperty_GetClassValidator",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3086-L3088 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | StateSetNamedParameter.WriteHandlerImplementation | (self, func, file) | Overridden from TypeHandler. | Overridden from TypeHandler. | [
"Overridden",
"from",
"TypeHandler",
"."
] | def WriteHandlerImplementation(self, func, file):
"""Overridden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
states = state['states']
args = func.GetOriginalArgs()
num_args = len(args)
assert num_args == 2
file.Write(" switch (%s) {\n" % args[0].na... | [
"def",
"WriteHandlerImplementation",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"state_name",
"=",
"func",
".",
"GetInfo",
"(",
"'state'",
")",
"state",
"=",
"_STATES",
"[",
"state_name",
"]",
"states",
"=",
"state",
"[",
"'states'",
"]",
"args",
"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3400-L3421 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py | python | Base.get_entry | (self, filename) | return self.entries[filename] | Fetch the specified entry attribute. | Fetch the specified entry attribute. | [
"Fetch",
"the",
"specified",
"entry",
"attribute",
"."
] | def get_entry(self, filename):
"""
Fetch the specified entry attribute.
"""
return self.entries[filename] | [
"def",
"get_entry",
"(",
"self",
",",
"filename",
")",
":",
"return",
"self",
".",
"entries",
"[",
"filename",
"]"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py#L173-L177 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py | python | MWSConnection.list_carts | (self, request, response, **kw) | return self._post_request(request, kw, response) | Returns a list of shopping carts in your Webstore that were last
updated during the time range that you specify. | Returns a list of shopping carts in your Webstore that were last
updated during the time range that you specify. | [
"Returns",
"a",
"list",
"of",
"shopping",
"carts",
"in",
"your",
"Webstore",
"that",
"were",
"last",
"updated",
"during",
"the",
"time",
"range",
"that",
"you",
"specify",
"."
] | def list_carts(self, request, response, **kw):
"""Returns a list of shopping carts in your Webstore that were last
updated during the time range that you specify.
"""
return self._post_request(request, kw, response) | [
"def",
"list_carts",
"(",
"self",
",",
"request",
",",
"response",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_post_request",
"(",
"request",
",",
"kw",
",",
"response",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py#L956-L960 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | CursorKind.is_preprocessing | (self) | return conf.lib.clang_isPreprocessing(self) | Test if this is a preprocessing kind. | Test if this is a preprocessing kind. | [
"Test",
"if",
"this",
"is",
"a",
"preprocessing",
"kind",
"."
] | def is_preprocessing(self):
"""Test if this is a preprocessing kind."""
return conf.lib.clang_isPreprocessing(self) | [
"def",
"is_preprocessing",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isPreprocessing",
"(",
"self",
")"
] | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L660-L662 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SetHScrollBar | (*args, **kwargs) | return _stc.StyledTextCtrl_SetHScrollBar(*args, **kwargs) | SetHScrollBar(self, ScrollBar bar)
Set the horizontal scrollbar to use instead of the ont that's built-in. | SetHScrollBar(self, ScrollBar bar) | [
"SetHScrollBar",
"(",
"self",
"ScrollBar",
"bar",
")"
] | def SetHScrollBar(*args, **kwargs):
"""
SetHScrollBar(self, ScrollBar bar)
Set the horizontal scrollbar to use instead of the ont that's built-in.
"""
return _stc.StyledTextCtrl_SetHScrollBar(*args, **kwargs) | [
"def",
"SetHScrollBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetHScrollBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6637-L6643 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/telnet/server.py | python | TelnetServer._handle_incoming_data | (self, conn) | Handle incoming data on socket. | Handle incoming data on socket. | [
"Handle",
"incoming",
"data",
"on",
"socket",
"."
] | def _handle_incoming_data(self, conn):
"""
Handle incoming data on socket.
"""
connection = [c for c in self.connections if c.conn == conn][0]
data = conn.recv(1024)
if data:
connection.feed(data)
else:
self.connections.remove(connection) | [
"def",
"_handle_incoming_data",
"(",
"self",
",",
"conn",
")",
":",
"connection",
"=",
"[",
"c",
"for",
"c",
"in",
"self",
".",
"connections",
"if",
"c",
".",
"conn",
"==",
"conn",
"]",
"[",
"0",
"]",
"data",
"=",
"conn",
".",
"recv",
"(",
"1024",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/telnet/server.py#L398-L407 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/ftplib.py | python | parse229 | (resp, peer) | return host, port | Parse the '229' response for a EPSV request.
Raises error_proto if it does not contain '(|||port|)'
Return ('host.addr.as.numbers', port#) tuple. | Parse the '229' response for a EPSV request.
Raises error_proto if it does not contain '(|||port|)'
Return ('host.addr.as.numbers', port#) tuple. | [
"Parse",
"the",
"229",
"response",
"for",
"a",
"EPSV",
"request",
".",
"Raises",
"error_proto",
"if",
"it",
"does",
"not",
"contain",
"(",
"|||port|",
")",
"Return",
"(",
"host",
".",
"addr",
".",
"as",
".",
"numbers",
"port#",
")",
"tuple",
"."
] | def parse229(resp, peer):
'''Parse the '229' response for a EPSV request.
Raises error_proto if it does not contain '(|||port|)'
Return ('host.addr.as.numbers', port#) tuple.'''
if resp[:3] != '229':
raise error_reply, resp
left = resp.find('(')
if left < 0: raise error_proto, resp
... | [
"def",
"parse229",
"(",
"resp",
",",
"peer",
")",
":",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'229'",
":",
"raise",
"error_reply",
",",
"resp",
"left",
"=",
"resp",
".",
"find",
"(",
"'('",
")",
"if",
"left",
"<",
"0",
":",
"raise",
"error_prot... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ftplib.py#L814-L833 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/c_lexer.py | python | CLexer.t_ppline_NEWLINE | (self, t) | r'\n | r'\n | [
"r",
"\\",
"n"
] | def t_ppline_NEWLINE(self, t):
r'\n'
if self.pp_line is None:
self._error('line number missing in #line', t)
else:
self.lexer.lineno = int(self.pp_line)
if self.pp_filename is not None:
self.filename = self.pp_filename
t.lexer.begin('... | [
"def",
"t_ppline_NEWLINE",
"(",
"self",
",",
"t",
")",
":",
"if",
"self",
".",
"pp_line",
"is",
"None",
":",
"self",
".",
"_error",
"(",
"'line number missing in #line'",
",",
"t",
")",
"else",
":",
"self",
".",
"lexer",
".",
"lineno",
"=",
"int",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/c_lexer.py#L303-L313 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/wire_format.py | python | IsTypePackable | (field_type) | return field_type not in NON_PACKABLE_TYPES | Return true iff packable = true is valid for fields of this type.
Args:
field_type: a FieldDescriptor::Type value.
Returns:
True iff fields of this type are packable. | Return true iff packable = true is valid for fields of this type. | [
"Return",
"true",
"iff",
"packable",
"=",
"true",
"is",
"valid",
"for",
"fields",
"of",
"this",
"type",
"."
] | def IsTypePackable(field_type):
"""Return true iff packable = true is valid for fields of this type.
Args:
field_type: a FieldDescriptor::Type value.
Returns:
True iff fields of this type are packable.
"""
return field_type not in NON_PACKABLE_TYPES | [
"def",
"IsTypePackable",
"(",
"field_type",
")",
":",
"return",
"field_type",
"not",
"in",
"NON_PACKABLE_TYPES"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/wire_format.py#L259-L268 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/queue.py | python | Queue.join | (self) | Blocks until all items in the Queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer thread calls task_done()
to indicate the item was retrieved and all work on it is complete.
When the... | Blocks until all items in the Queue have been gotten and processed. | [
"Blocks",
"until",
"all",
"items",
"in",
"the",
"Queue",
"have",
"been",
"gotten",
"and",
"processed",
"."
] | def join(self):
'''Blocks until all items in the Queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer thread calls task_done()
to indicate the item was retrieved and all work on it is ... | [
"def",
"join",
"(",
"self",
")",
":",
"with",
"self",
".",
"all_tasks_done",
":",
"while",
"self",
".",
"unfinished_tasks",
":",
"self",
".",
"all_tasks_done",
".",
"wait",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/queue.py#L78-L89 | ||
NVIDIAGameWorks/kaolin | e5148d05e9c1e2ce92a07881ce3593b1c5c3f166 | kaolin/io/usd.py | python | export_meshes | (file_path, scene_paths=None, vertices=None, faces=None,
uvs=None, face_uvs_idx=None, face_normals=None, materials_order=None, materials=None,
up_axis='Y', times=None) | return stage | r"""Export multiple meshes to a new USD stage.
Export multiple meshes defined by lists vertices and faces and save the stage to disk.
Args:
file_path (str): Path to usd file (\*.usd, \*.usda).
scene_paths (list of str, optional): Absolute paths of meshes within the USD file scene. Must have th... | r"""Export multiple meshes to a new USD stage. | [
"r",
"Export",
"multiple",
"meshes",
"to",
"a",
"new",
"USD",
"stage",
"."
] | def export_meshes(file_path, scene_paths=None, vertices=None, faces=None,
uvs=None, face_uvs_idx=None, face_normals=None, materials_order=None, materials=None,
up_axis='Y', times=None):
r"""Export multiple meshes to a new USD stage.
Export multiple meshes defined by lists ve... | [
"def",
"export_meshes",
"(",
"file_path",
",",
"scene_paths",
"=",
"None",
",",
"vertices",
"=",
"None",
",",
"faces",
"=",
"None",
",",
"uvs",
"=",
"None",
",",
"face_uvs_idx",
"=",
"None",
",",
"face_normals",
"=",
"None",
",",
"materials_order",
"=",
... | https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/io/usd.py#L736-L790 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/Maze/environment.py | python | MazeEnvironment.mark_maze | (self, r, c, marker) | mark a maze cell with the specified color | mark a maze cell with the specified color | [
"mark",
"a",
"maze",
"cell",
"with",
"the",
"specified",
"color"
] | def mark_maze(self, r, c, marker):
""" mark a maze cell with the specified color """
# remove the previous object, if necessary
if (r,c) in self.marker_map:
removeObject(self.marker_map[(r,c)])
# remember the ID of the marker
self.marker_map[(r,c)] = addObject(marker,... | [
"def",
"mark_maze",
"(",
"self",
",",
"r",
",",
"c",
",",
"marker",
")",
":",
"# remove the previous object, if necessary",
"if",
"(",
"r",
",",
"c",
")",
"in",
"self",
".",
"marker_map",
":",
"removeObject",
"(",
"self",
".",
"marker_map",
"[",
"(",
"r"... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Maze/environment.py#L300-L306 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/plots/plotfunctions.py | python | _validate_plot_inputs | (workspaces, spectrum_nums, wksp_indices, tiled=False, overplot=False) | Raises a ValueError if any arguments have the incorrect types | Raises a ValueError if any arguments have the incorrect types | [
"Raises",
"a",
"ValueError",
"if",
"any",
"arguments",
"have",
"the",
"incorrect",
"types"
] | def _validate_plot_inputs(workspaces, spectrum_nums, wksp_indices, tiled=False, overplot=False):
"""Raises a ValueError if any arguments have the incorrect types"""
if spectrum_nums is not None and wksp_indices is not None:
raise ValueError("Both spectrum_nums and wksp_indices supplied. "
... | [
"def",
"_validate_plot_inputs",
"(",
"workspaces",
",",
"spectrum_nums",
",",
"wksp_indices",
",",
"tiled",
"=",
"False",
",",
"overplot",
"=",
"False",
")",
":",
"if",
"spectrum_nums",
"is",
"not",
"None",
"and",
"wksp_indices",
"is",
"not",
"None",
":",
"r... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/plots/plotfunctions.py#L438-L454 | ||
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/bisection_search/bisection_search.py | python | EqualsOutputCheck.__init__ | (self, expected_output) | Constructor.
Args:
expected_output: string, expected output. | Constructor. | [
"Constructor",
"."
] | def __init__(self, expected_output):
"""Constructor.
Args:
expected_output: string, expected output.
"""
self._expected_output = expected_output | [
"def",
"__init__",
"(",
"self",
",",
"expected_output",
")",
":",
"self",
".",
"_expected_output",
"=",
"expected_output"
] | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/bisection_search/bisection_search.py#L205-L211 | ||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/text_format.py | python | Tokenizer.ParseErrorPreviousToken | (self, message) | return ParseError(message, self._previous_line + 1,
self._previous_column + 1) | Creates and *returns* a ParseError for the previously read token.
Args:
message: A message to set for the exception.
Returns:
A ParseError instance. | Creates and *returns* a ParseError for the previously read token. | [
"Creates",
"and",
"*",
"returns",
"*",
"a",
"ParseError",
"for",
"the",
"previously",
"read",
"token",
"."
] | def ParseErrorPreviousToken(self, message):
"""Creates and *returns* a ParseError for the previously read token.
Args:
message: A message to set for the exception.
Returns:
A ParseError instance.
"""
return ParseError(message, self._previous_line + 1,
self._previo... | [
"def",
"ParseErrorPreviousToken",
"(",
"self",
",",
"message",
")",
":",
"return",
"ParseError",
"(",
"message",
",",
"self",
".",
"_previous_line",
"+",
"1",
",",
"self",
".",
"_previous_column",
"+",
"1",
")"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/text_format.py#L1207-L1217 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | MockMethod._PopNextMethod | (self) | Pop the next method from our call queue. | Pop the next method from our call queue. | [
"Pop",
"the",
"next",
"method",
"from",
"our",
"call",
"queue",
"."
] | def _PopNextMethod(self):
"""Pop the next method from our call queue."""
try:
return self._call_queue.popleft()
except IndexError:
raise UnexpectedMethodCallError(self, None) | [
"def",
"_PopNextMethod",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_call_queue",
".",
"popleft",
"(",
")",
"except",
"IndexError",
":",
"raise",
"UnexpectedMethodCallError",
"(",
"self",
",",
"None",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L581-L586 | ||
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/tools/extra/extract_seconds.py | python | get_log_created_year | (input_file) | return log_created_year | Get year from log file system timestamp | Get year from log file system timestamp | [
"Get",
"year",
"from",
"log",
"file",
"system",
"timestamp"
] | def get_log_created_year(input_file):
"""Get year from log file system timestamp
"""
log_created_time = os.path.getctime(input_file)
log_created_year = datetime.datetime.fromtimestamp(log_created_time).year
return log_created_year | [
"def",
"get_log_created_year",
"(",
"input_file",
")",
":",
"log_created_time",
"=",
"os",
".",
"path",
".",
"getctime",
"(",
"input_file",
")",
"log_created_year",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"log_created_time",
")",
".",
"year"... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/tools/extra/extract_seconds.py#L22-L28 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/method.py | python | document_custom_method | (section, method_name, method) | Documents a non-data driven method
:param section: The section to write the documentation to.
:param method_name: The name of the method
:param method: The handle to the method being documented | Documents a non-data driven method | [
"Documents",
"a",
"non",
"-",
"data",
"driven",
"method"
] | def document_custom_method(section, method_name, method):
"""Documents a non-data driven method
:param section: The section to write the documentation to.
:param method_name: The name of the method
:param method: The handle to the method being documented
"""
document_custom_signature(
... | [
"def",
"document_custom_method",
"(",
"section",
",",
"method_name",
",",
"method",
")",
":",
"document_custom_signature",
"(",
"section",
",",
"method_name",
",",
"method",
")",
"method_intro_section",
"=",
"section",
".",
"add_new_section",
"(",
"'method-intro'",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/method.py#L108-L123 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | _DomainTan.__init__ | (self, eps) | domain_tan(eps) = true where abs(cos(x)) < eps) | domain_tan(eps) = true where abs(cos(x)) < eps) | [
"domain_tan",
"(",
"eps",
")",
"=",
"true",
"where",
"abs",
"(",
"cos",
"(",
"x",
"))",
"<",
"eps",
")"
] | def __init__(self, eps):
"domain_tan(eps) = true where abs(cos(x)) < eps)"
self.eps = eps | [
"def",
"__init__",
"(",
"self",
",",
"eps",
")",
":",
"self",
".",
"eps",
"=",
"eps"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L757-L759 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/sync_replicas_optimizer.py | python | SyncReplicasOptimizer.get_chief_queue_runner | (self) | return self._chief_queue_runner | Returns the QueueRunner for the chief to execute.
This includes the operations to synchronize replicas: aggregate gradients,
apply to variables, increment global step, insert tokens to token queue.
Note that this can only be called after calling apply_gradients() which
actually generates this queuerun... | Returns the QueueRunner for the chief to execute. | [
"Returns",
"the",
"QueueRunner",
"for",
"the",
"chief",
"to",
"execute",
"."
] | def get_chief_queue_runner(self):
"""Returns the QueueRunner for the chief to execute.
This includes the operations to synchronize replicas: aggregate gradients,
apply to variables, increment global step, insert tokens to token queue.
Note that this can only be called after calling apply_gradients() w... | [
"def",
"get_chief_queue_runner",
"(",
"self",
")",
":",
"if",
"self",
".",
"_gradients_applied",
"is",
"False",
":",
"raise",
"ValueError",
"(",
"\"Should be called after apply_gradients().\"",
")",
"return",
"self",
".",
"_chief_queue_runner"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/sync_replicas_optimizer.py#L343-L361 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | cpp/build-support/cpplint.py | python | NestingState.SeenOpenBrace | (self) | return (not self.stack) or self.stack[-1].seen_open_brace | Check if we have seen the opening brace for the innermost block.
Returns:
True if we have seen the opening brace, False if the innermost
block is still expecting an opening brace. | Check if we have seen the opening brace for the innermost block. | [
"Check",
"if",
"we",
"have",
"seen",
"the",
"opening",
"brace",
"for",
"the",
"innermost",
"block",
"."
] | def SeenOpenBrace(self):
"""Check if we have seen the opening brace for the innermost block.
Returns:
True if we have seen the opening brace, False if the innermost
block is still expecting an opening brace.
"""
return (not self.stack) or self.stack[-1].seen_open_brace | [
"def",
"SeenOpenBrace",
"(",
"self",
")",
":",
"return",
"(",
"not",
"self",
".",
"stack",
")",
"or",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
".",
"seen_open_brace"
] | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L2540-L2547 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/compatibility/tf_upgrade_v2.py | python | _add_uniform_scaling_initializer_transformer | (
parent, node, full_name, name, logs) | return node | Updates references to uniform_unit_scaling_initializer.
Transforms:
tf.uniform_unit_scaling_initializer(factor, seed, dtype) to
tf.compat.v1.keras.initializers.VarianceScaling(
scale=factor, distribution="uniform", seed=seed)
Note: to apply this transformation, symbol must be added
to reordered_functi... | Updates references to uniform_unit_scaling_initializer. | [
"Updates",
"references",
"to",
"uniform_unit_scaling_initializer",
"."
] | def _add_uniform_scaling_initializer_transformer(
parent, node, full_name, name, logs):
"""Updates references to uniform_unit_scaling_initializer.
Transforms:
tf.uniform_unit_scaling_initializer(factor, seed, dtype) to
tf.compat.v1.keras.initializers.VarianceScaling(
scale=factor, distribution="unifo... | [
"def",
"_add_uniform_scaling_initializer_transformer",
"(",
"parent",
",",
"node",
",",
"full_name",
",",
"name",
",",
"logs",
")",
":",
"for",
"keyword_arg",
"in",
"node",
".",
"keywords",
":",
"if",
"keyword_arg",
".",
"arg",
"==",
"\"factor\"",
":",
"keywor... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/compatibility/tf_upgrade_v2.py#L2207-L2234 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_PolicyCounterTimer_REQUEST.fromTpm | (buf) | return buf.createObj(TPM2_PolicyCounterTimer_REQUEST) | Returns new TPM2_PolicyCounterTimer_REQUEST object constructed from
its marshaled representation in the given TpmBuffer buffer | Returns new TPM2_PolicyCounterTimer_REQUEST object constructed from
its marshaled representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPM2_PolicyCounterTimer_REQUEST",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPM2_PolicyCounterTimer_REQUEST object constructed from
its marshaled representation in the given TpmBuffer buffer
"""
return buf.createObj(TPM2_PolicyCounterTimer_REQUEST) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPM2_PolicyCounterTimer_REQUEST",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L14666-L14670 | |
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | scripts/cpp_lint.py | python | RemoveMultiLineCommentsFromRange | (lines, begin, end) | Clears a range of lines for multi-line comments. | Clears a range of lines for multi-line comments. | [
"Clears",
"a",
"range",
"of",
"lines",
"for",
"multi",
"-",
"line",
"comments",
"."
] | def RemoveMultiLineCommentsFromRange(lines, begin, end):
"""Clears a range of lines for multi-line comments."""
# Having // dummy comments makes the lines non-empty, so we will not get
# unnecessary blank line warnings later in the code.
for i in range(begin, end):
lines[i] = '// dummy' | [
"def",
"RemoveMultiLineCommentsFromRange",
"(",
"lines",
",",
"begin",
",",
"end",
")",
":",
"# Having // dummy comments makes the lines non-empty, so we will not get",
"# unnecessary blank line warnings later in the code.",
"for",
"i",
"in",
"range",
"(",
"begin",
",",
"end",
... | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L1143-L1148 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/collection.py | python | ResourceCollection.page_size | (self, count) | return self._clone(page_size=count) | Fetch at most this many resources per service request.
>>> for obj in s3.Bucket('boto3').objects.page_size(100):
... print(obj.key)
:type count: int
:param count: Fetch this many items per request
:rtype: :py:class:`ResourceCollection` | Fetch at most this many resources per service request. | [
"Fetch",
"at",
"most",
"this",
"many",
"resources",
"per",
"service",
"request",
"."
] | def page_size(self, count):
"""
Fetch at most this many resources per service request.
>>> for obj in s3.Bucket('boto3').objects.page_size(100):
... print(obj.key)
:type count: int
:param count: Fetch this many items per request
:rtype: :py:class:`Re... | [
"def",
"page_size",
"(",
"self",
",",
"count",
")",
":",
"return",
"self",
".",
"_clone",
"(",
"page_size",
"=",
"count",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/collection.py#L246-L257 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/series.py | python | Series.unstack | (self, level=-1, fill_value=None) | return unstack(self, level, fill_value) | Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.
Parameters
----------
level : int, str, or list of these, default last level
Level(s) to unstack, can pass level name.
fill_value : scalar value, default None
Value to use when replacing N... | Unstack, also known as pivot, Series with MultiIndex to produce DataFrame. | [
"Unstack",
"also",
"known",
"as",
"pivot",
"Series",
"with",
"MultiIndex",
"to",
"produce",
"DataFrame",
"."
] | def unstack(self, level=-1, fill_value=None) -> DataFrame:
"""
Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.
Parameters
----------
level : int, str, or list of these, default last level
Level(s) to unstack, can pass level name.
fi... | [
"def",
"unstack",
"(",
"self",
",",
"level",
"=",
"-",
"1",
",",
"fill_value",
"=",
"None",
")",
"->",
"DataFrame",
":",
"from",
"pandas",
".",
"core",
".",
"reshape",
".",
"reshape",
"import",
"unstack",
"return",
"unstack",
"(",
"self",
",",
"level",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L4041-L4081 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/stride_tricks.py | python | broadcast_arrays | (*args) | return broadcasted | Broadcast any number of arrays against each other.
Parameters
----------
`*args` : array_likes
The arrays to broadcast.
Returns
-------
broadcasted : list of arrays
These arrays are views on the original arrays. They are typically
not contiguous. Furthermore, more tha... | Broadcast any number of arrays against each other. | [
"Broadcast",
"any",
"number",
"of",
"arrays",
"against",
"each",
"other",
"."
] | def broadcast_arrays(*args):
"""
Broadcast any number of arrays against each other.
Parameters
----------
`*args` : array_likes
The arrays to broadcast.
Returns
-------
broadcasted : list of arrays
These arrays are views on the original arrays. They are typically
... | [
"def",
"broadcast_arrays",
"(",
"*",
"args",
")",
":",
"args",
"=",
"map",
"(",
"np",
".",
"asarray",
",",
"args",
")",
"shapes",
"=",
"[",
"x",
".",
"shape",
"for",
"x",
"in",
"args",
"]",
"if",
"len",
"(",
"set",
"(",
"shapes",
")",
")",
"=="... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/stride_tricks.py#L30-L115 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | external/marcopede-face-eval-f2870fd85d48/database.py | python | getRecord | (data, total=-1, pos=True, pose=False, facial=False) | return arrPos | return all the gt data in a record | return all the gt data in a record | [
"return",
"all",
"the",
"gt",
"data",
"in",
"a",
"record"
] | def getRecord(data, total=-1, pos=True, pose=False, facial=False):
"""return all the gt data in a record"""
if total == -1:
total = data.getTotal()
else:
total = min(data.getTotal(), total)
arrPos = numpy.zeros(
total, dtype=[("id", numpy.int32), ("name", object), ("bbox", list)]... | [
"def",
"getRecord",
"(",
"data",
",",
"total",
"=",
"-",
"1",
",",
"pos",
"=",
"True",
",",
"pose",
"=",
"False",
",",
"facial",
"=",
"False",
")",
":",
"if",
"total",
"==",
"-",
"1",
":",
"total",
"=",
"data",
".",
"getTotal",
"(",
")",
"else"... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/external/marcopede-face-eval-f2870fd85d48/database.py#L121-L143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.