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
mapsme/omim
1892903b63f2c85b16ed4966d21fe76aba06b9ba
tools/python/maps_generator/generator/stages.py
python
country_stage_status
(stage: Type[Stage])
return stage
It's helper decorator that works with status file.
It's helper decorator that works with status file.
[ "It", "s", "helper", "decorator", "that", "works", "with", "status", "file", "." ]
def country_stage_status(stage: Type[Stage]) -> Type[Stage]: """It's helper decorator that works with status file.""" def new_apply(method): def apply(obj: Stage, env: "Env", country: AnyStr, *args, **kwargs): name = get_stage_name(obj) _logger = DummyObject() countr...
[ "def", "country_stage_status", "(", "stage", ":", "Type", "[", "Stage", "]", ")", "->", "Type", "[", "Stage", "]", ":", "def", "new_apply", "(", "method", ")", ":", "def", "apply", "(", "obj", ":", "Stage", ",", "env", ":", "\"Env\"", ",", "country",...
https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/maps_generator/generator/stages.py#L215-L248
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py
python
unpack_directory
(filename, extract_dir, progress_filter=default_filter)
Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory
Unpack" a directory, using the same interface as for archives
[ "Unpack", "a", "directory", "using", "the", "same", "interface", "as", "for", "archives" ]
def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory """ if not os.path.isdir(filename): raise UnrecognizedFormat("%s is not a directory" % fi...
[ "def", "unpack_directory", "(", "filename", ",", "extract_dir", ",", "progress_filter", "=", "default_filter", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "filename", ")", ":", "raise", "UnrecognizedFormat", "(", "\"%s is not a directory\"", "%"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py#L64-L88
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
scripts/build/output-distance.py
python
FileLink.name
(self)
return os.path.join(self.prefix(), base)
Returns the \\sourcefilename for this test file
Returns the \\sourcefilename for this test file
[ "Returns", "the", "\\\\", "sourcefilename", "for", "this", "test", "file" ]
def name(self) -> str: """Returns the \\sourcefilename for this test file""" base = os.path.basename(self.file_names[1]) base = os.path.splitext(base)[0] base = hash_to_original_name.get(base, base) base = os.path.splitext(base)[0] return os.path.join(self.prefix(), base)
[ "def", "name", "(", "self", ")", "->", "str", ":", "base", "=", "os", ".", "path", ".", "basename", "(", "self", ".", "file_names", "[", "1", "]", ")", "base", "=", "os", ".", "path", ".", "splitext", "(", "base", ")", "[", "0", "]", "base", ...
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/scripts/build/output-distance.py#L487-L493
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/graph_editor/edit.py
python
detach_outputs
(sgv, control_outputs=None)
return sgv_, output_placeholders
Detach the output of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. Note that sgv is modified in place. control_outputs: a util.ControlOutputs instance or None. If not None the c...
Detach the output of a subgraph view.
[ "Detach", "the", "output", "of", "a", "subgraph", "view", "." ]
def detach_outputs(sgv, control_outputs=None): """Detach the output of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. Note that sgv is modified in place. control_outputs: a util.Cont...
[ "def", "detach_outputs", "(", "sgv", ",", "control_outputs", "=", "None", ")", ":", "sgv", "=", "subgraph", ".", "make_view", "(", "sgv", ")", "# only select outputs with consumers", "sgv_", "=", "sgv", ".", "remap_outputs", "(", "[", "output_id", "for", "outp...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/edit.py#L101-L138
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/datasets/_twenty_newsgroups.py
python
strip_newsgroup_header
(text)
return after
Given text in "news" format, strip the headers, by removing everything before the first blank line. Parameters ---------- text : string The text from which to remove the signature block.
Given text in "news" format, strip the headers, by removing everything before the first blank line.
[ "Given", "text", "in", "news", "format", "strip", "the", "headers", "by", "removing", "everything", "before", "the", "first", "blank", "line", "." ]
def strip_newsgroup_header(text): """ Given text in "news" format, strip the headers, by removing everything before the first blank line. Parameters ---------- text : string The text from which to remove the signature block. """ _before, _blankline, after = text.partition('\n\n'...
[ "def", "strip_newsgroup_header", "(", "text", ")", ":", "_before", ",", "_blankline", ",", "after", "=", "text", ".", "partition", "(", "'\\n\\n'", ")", "return", "after" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/datasets/_twenty_newsgroups.py#L90-L101
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/lookup_ops.py
python
InitializableLookupTableBase.__init__
(self, default_value, initializer)
Construct a table object from a table reference. If requires a table initializer object (subclass of `TableInitializerBase`). It provides the table key and value types, as well as the op to initialize the table. The caller is responsible to execute the initialization op. Args: default_value: The...
Construct a table object from a table reference.
[ "Construct", "a", "table", "object", "from", "a", "table", "reference", "." ]
def __init__(self, default_value, initializer): """Construct a table object from a table reference. If requires a table initializer object (subclass of `TableInitializerBase`). It provides the table key and value types, as well as the op to initialize the table. The caller is responsible to execute the...
[ "def", "__init__", "(", "self", ",", "default_value", ",", "initializer", ")", ":", "super", "(", "InitializableLookupTableBase", ",", "self", ")", ".", "__init__", "(", "initializer", ".", "key_dtype", ",", "initializer", ".", "value_dtype", ")", "self", ".",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/lookup_ops.py#L154-L179
themighty1/lpfw
7880c0a1aac26ecc33259633c0f866a157ab491e
gui/gui.py
python
queryDialog.closeEvent
(self, event)
in case when user closed the dialog without pressing allow or deny
in case when user closed the dialog without pressing allow or deny
[ "in", "case", "when", "user", "closed", "the", "dialog", "without", "pressing", "allow", "or", "deny" ]
def closeEvent(self, event): "in case when user closed the dialog without pressing allow or deny" print "in closeEvent" msgQueue.put('ADD ' + b64encode(bytearray(self.path, encoding='utf-8')) + ' ' + self.pid + ' IGNORED')
[ "def", "closeEvent", "(", "self", ",", "event", ")", ":", "print", "\"in closeEvent\"", "msgQueue", ".", "put", "(", "'ADD '", "+", "b64encode", "(", "bytearray", "(", "self", ".", "path", ",", "encoding", "=", "'utf-8'", ")", ")", "+", "' '", "+", "se...
https://github.com/themighty1/lpfw/blob/7880c0a1aac26ecc33259633c0f866a157ab491e/gui/gui.py#L81-L84
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py2/more_itertools/more.py
python
divide
(n, iterable)
return ret
Divide the elements from *iterable* into *n* parts, maintaining order. >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6]) >>> list(group_1) [1, 2, 3] >>> list(group_2) [4, 5, 6] If the length of *iterable* is not evenly divisible by *n*, then the length of the ret...
Divide the elements from *iterable* into *n* parts, maintaining order.
[ "Divide", "the", "elements", "from", "*", "iterable", "*", "into", "*", "n", "*", "parts", "maintaining", "order", "." ]
def divide(n, iterable): """Divide the elements from *iterable* into *n* parts, maintaining order. >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6]) >>> list(group_1) [1, 2, 3] >>> list(group_2) [4, 5, 6] If the length of *iterable* is not evenly divisible by *n*...
[ "def", "divide", "(", "n", ",", "iterable", ")", ":", "if", "n", "<", "1", ":", "raise", "ValueError", "(", "'n must be at least 1'", ")", "seq", "=", "tuple", "(", "iterable", ")", "q", ",", "r", "=", "divmod", "(", "len", "(", "seq", ")", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py2/more_itertools/more.py#L1339-L1380
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py
python
_RerouteMode.check
(cls, mode)
Check swap mode. Args: mode: an integer representing one of the modes. Returns: True if a is rerouted to b (mode is swap or a2b). True if b is rerouted to a (mode is swap or b2a). Raises: ValueError: if mode is outside the enum range.
Check swap mode.
[ "Check", "swap", "mode", "." ]
def check(cls, mode): """Check swap mode. Args: mode: an integer representing one of the modes. Returns: True if a is rerouted to b (mode is swap or a2b). True if b is rerouted to a (mode is swap or b2a). Raises: ValueError: if mode is outside the enum range. """ if mode...
[ "def", "check", "(", "cls", ",", "mode", ")", ":", "if", "mode", "==", "cls", ".", "swap", ":", "return", "True", ",", "True", "elif", "mode", "==", "cls", ".", "b2a", ":", "return", "False", ",", "True", "elif", "mode", "==", "cls", ".", "a2b", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py#L66-L84
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/distribute/distributed_training_utils_v1.py
python
_build_network_on_replica
(model, mode, inputs=None, targets=None)
return updated_model
Build an updated model on replicas. We create a new Keras model while sharing the variables from the old graph. Building a new sub-graph is required since the original keras model creates placeholders for the input and the output that are not accessible till we call iterator.get_next() inside the step_fn for `...
Build an updated model on replicas.
[ "Build", "an", "updated", "model", "on", "replicas", "." ]
def _build_network_on_replica(model, mode, inputs=None, targets=None): """Build an updated model on replicas. We create a new Keras model while sharing the variables from the old graph. Building a new sub-graph is required since the original keras model creates placeholders for the input and the output that ar...
[ "def", "_build_network_on_replica", "(", "model", ",", "mode", ",", "inputs", "=", "None", ",", "targets", "=", "None", ")", ":", "# Need to do imports here since we run into a circular dependency error.", "from", "tensorflow", ".", "python", ".", "keras", "import", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/distribute/distributed_training_utils_v1.py#L684-L751
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
JoystickEvent.SetButtonState
(*args, **kwargs)
return _misc_.JoystickEvent_SetButtonState(*args, **kwargs)
SetButtonState(self, int state)
SetButtonState(self, int state)
[ "SetButtonState", "(", "self", "int", "state", ")" ]
def SetButtonState(*args, **kwargs): """SetButtonState(self, int state)""" return _misc_.JoystickEvent_SetButtonState(*args, **kwargs)
[ "def", "SetButtonState", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "JoystickEvent_SetButtonState", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2366-L2368
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py
python
CWSCDReductionControl.get_raw_data_workspace
(self, exp_no, scan_no, pt_no)
return ws
Get raw workspace
Get raw workspace
[ "Get", "raw", "workspace" ]
def get_raw_data_workspace(self, exp_no, scan_no, pt_no): """ Get raw workspace """ try: ws = self._myRawDataWSDict[(exp_no, scan_no, pt_no)] assert isinstance(ws, mantid.dataobjects.Workspace2D) except KeyError: return None return ws
[ "def", "get_raw_data_workspace", "(", "self", ",", "exp_no", ",", "scan_no", ",", "pt_no", ")", ":", "try", ":", "ws", "=", "self", ".", "_myRawDataWSDict", "[", "(", "exp_no", ",", "scan_no", ",", "pt_no", ")", "]", "assert", "isinstance", "(", "ws", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py#L3548-L3557
yuxng/DA-RNN
77fbb50b4272514588a10a9f90b7d5f8d46974fb
lib/datasets/shapenet_single.py
python
shapenet_single.gt_roidb
(self)
return gt_roidb
Return the database of ground-truth regions of interest. This function loads/saves from/to a cache file to speed up future calls.
Return the database of ground-truth regions of interest.
[ "Return", "the", "database", "of", "ground", "-", "truth", "regions", "of", "interest", "." ]
def gt_roidb(self): """ Return the database of ground-truth regions of interest. This function loads/saves from/to a cache file to speed up future calls. """ cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl') if os.path.exists(cache_file): ...
[ "def", "gt_roidb", "(", "self", ")", ":", "cache_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "cache_path", ",", "self", ".", "name", "+", "'_gt_roidb.pkl'", ")", "if", "os", ".", "path", ".", "exists", "(", "cache_file", ")", ":", ...
https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/shapenet_single.py#L148-L169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py
python
TNavigator.xcor
(self)
return self._position[0]
Return the turtle's x coordinate. No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.xcor() 50.0
Return the turtle's x coordinate.
[ "Return", "the", "turtle", "s", "x", "coordinate", "." ]
def xcor(self): """ Return the turtle's x coordinate. No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.xcor() 50.0 """ return self._position[0]
[ "def", "xcor", "(", "self", ")", ":", "return", "self", ".", "_position", "[", "0", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L1714-L1726
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
python
FS.Repository
(self, *dirs)
Specify Repository directories to search.
Specify Repository directories to search.
[ "Specify", "Repository", "directories", "to", "search", "." ]
def Repository(self, *dirs): """Specify Repository directories to search.""" for d in dirs: if not isinstance(d, SCons.Node.Node): d = self.Dir(d) self.Top.addRepository(d)
[ "def", "Repository", "(", "self", ",", "*", "dirs", ")", ":", "for", "d", "in", "dirs", ":", "if", "not", "isinstance", "(", "d", ",", "SCons", ".", "Node", ".", "Node", ")", ":", "d", "=", "self", ".", "Dir", "(", "d", ")", "self", ".", "Top...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L1443-L1448
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/metrics/cluster/bicluster.py
python
consensus_score
(a, b, similarity="jaccard")
return matrix[indices[:, 0], indices[:, 1]].sum() / max(n_a, n_b)
The similarity of two sets of biclusters. Similarity between individual biclusters is computed. Then the best matching between sets is found using the Hungarian algorithm. The final score is the sum of similarities divided by the size of the larger set. Read more in the :ref:`User Guide <bicluster...
The similarity of two sets of biclusters.
[ "The", "similarity", "of", "two", "sets", "of", "biclusters", "." ]
def consensus_score(a, b, similarity="jaccard"): """The similarity of two sets of biclusters. Similarity between individual biclusters is computed. Then the best matching between sets is found using the Hungarian algorithm. The final score is the sum of similarities divided by the size of the large...
[ "def", "consensus_score", "(", "a", ",", "b", ",", "similarity", "=", "\"jaccard\"", ")", ":", "if", "similarity", "==", "\"jaccard\"", ":", "similarity", "=", "_jaccard", "matrix", "=", "_pairwise_similarity", "(", "a", ",", "b", ",", "similarity", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/metrics/cluster/bicluster.py#L49-L86
libfive/libfive
ab5e354cf6fd992f80aaa9432c52683219515c8a
libfive/bind/python/libfive/stdlib/transforms.py
python
rotate_y
(t, angle, center=(0, 0, 0))
return Shape(stdlib.rotate_y( args[0].ptr, args[1].ptr, tvec3(*[a.ptr for a in args[2]])))
Rotate the given shape by an angle in radians The center of rotation is [0 0 0] or specified by the optional argument
Rotate the given shape by an angle in radians The center of rotation is [0 0 0] or specified by the optional argument
[ "Rotate", "the", "given", "shape", "by", "an", "angle", "in", "radians", "The", "center", "of", "rotation", "is", "[", "0", "0", "0", "]", "or", "specified", "by", "the", "optional", "argument" ]
def rotate_y(t, angle, center=(0, 0, 0)): """ Rotate the given shape by an angle in radians The center of rotation is [0 0 0] or specified by the optional argument """ args = [Shape.wrap(t), Shape.wrap(angle), list([Shape.wrap(i) for i in center])] return Shape(stdlib.rotate_y( args[0].p...
[ "def", "rotate_y", "(", "t", ",", "angle", ",", "center", "=", "(", "0", ",", "0", ",", "0", ")", ")", ":", "args", "=", "[", "Shape", ".", "wrap", "(", "t", ")", ",", "Shape", ".", "wrap", "(", "angle", ")", ",", "list", "(", "[", "Shape",...
https://github.com/libfive/libfive/blob/ab5e354cf6fd992f80aaa9432c52683219515c8a/libfive/bind/python/libfive/stdlib/transforms.py#L172-L180
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
Float16
(ctx=None)
return FPSortRef(Z3_mk_fpa_sort_16(ctx.ref()), ctx)
Floating-point 16-bit (half) sort.
Floating-point 16-bit (half) sort.
[ "Floating", "-", "point", "16", "-", "bit", "(", "half", ")", "sort", "." ]
def Float16(ctx=None): """Floating-point 16-bit (half) sort.""" ctx = _get_ctx(ctx) return FPSortRef(Z3_mk_fpa_sort_16(ctx.ref()), ctx)
[ "def", "Float16", "(", "ctx", "=", "None", ")", ":", "ctx", "=", "_get_ctx", "(", "ctx", ")", "return", "FPSortRef", "(", "Z3_mk_fpa_sort_16", "(", "ctx", ".", "ref", "(", ")", ")", ",", "ctx", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L9274-L9277
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TMemOut_New
(*args)
return _snap.TMemOut_New(*args)
TMemOut_New(PMem const & Mem) -> PSOut Parameters: Mem: PMem const &
TMemOut_New(PMem const & Mem) -> PSOut
[ "TMemOut_New", "(", "PMem", "const", "&", "Mem", ")", "-", ">", "PSOut" ]
def TMemOut_New(*args): """ TMemOut_New(PMem const & Mem) -> PSOut Parameters: Mem: PMem const & """ return _snap.TMemOut_New(*args)
[ "def", "TMemOut_New", "(", "*", "args", ")", ":", "return", "_snap", ".", "TMemOut_New", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L8424-L8432
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/zipfile.py
python
_EndRecData
(fpin)
return None
Return data from the "End of Central Directory" record, or None. The data is a list of the nine items in the ZIP "End of central dir" record followed by a tenth item, the file seek offset of this record.
Return data from the "End of Central Directory" record, or None.
[ "Return", "data", "from", "the", "End", "of", "Central", "Directory", "record", "or", "None", "." ]
def _EndRecData(fpin): """Return data from the "End of Central Directory" record, or None. The data is a list of the nine items in the ZIP "End of central dir" record followed by a tenth item, the file seek offset of this record.""" # Determine file size fpin.seek(0, 2) filesize = fpin.tell() ...
[ "def", "_EndRecData", "(", "fpin", ")", ":", "# Determine file size", "fpin", ".", "seek", "(", "0", ",", "2", ")", "filesize", "=", "fpin", ".", "tell", "(", ")", "# Check to see if this is ZIP file with no archive comment (the", "# \"end of central directory\" structu...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/zipfile.py#L201-L259
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/compiler.py
python
Frame.soft
(self)
return rv
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements.
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer.
[ "Return", "a", "soft", "frame", ".", "A", "soft", "frame", "may", "not", "be", "modified", "as", "standalone", "thing", "as", "it", "shares", "the", "resources", "with", "the", "frame", "it", "was", "created", "of", "but", "it", "s", "not", "a", "rootl...
def soft(self): """Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements. """ rv = self.copy() ...
[ "def", "soft", "(", "self", ")", ":", "rv", "=", "self", ".", "copy", "(", ")", "rv", ".", "rootlevel", "=", "False", "return", "rv" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/compiler.py#L178-L187
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/pylinters.py
python
lint_all
(linters, config_dict, file_names)
Lint files command entry point based on working tree.
Lint files command entry point based on working tree.
[ "Lint", "files", "command", "entry", "point", "based", "on", "working", "tree", "." ]
def lint_all(linters, config_dict, file_names): # type: (str, Dict[str, str], List[str]) -> None # pylint: disable=unused-argument """Lint files command entry point based on working tree.""" all_file_names = git.get_files_to_check_working_tree(is_interesting_file) _lint_files(linters, config_dict, ...
[ "def", "lint_all", "(", "linters", ",", "config_dict", ",", "file_names", ")", ":", "# type: (str, Dict[str, str], List[str]) -> None", "# pylint: disable=unused-argument", "all_file_names", "=", "git", ".", "get_files_to_check_working_tree", "(", "is_interesting_file", ")", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/pylinters.py#L122-L128
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.RootGroupsTakeOverOnlyChildren
(self, recurse=False)
Calls TakeOverOnlyChild for all groups in the main group.
Calls TakeOverOnlyChild for all groups in the main group.
[ "Calls", "TakeOverOnlyChild", "for", "all", "groups", "in", "the", "main", "group", "." ]
def RootGroupsTakeOverOnlyChildren(self, recurse=False): """Calls TakeOverOnlyChild for all groups in the main group.""" for group in self._properties['mainGroup']._properties['children']: if isinstance(group, PBXGroup): group.TakeOverOnlyChild(recurse)
[ "def", "RootGroupsTakeOverOnlyChildren", "(", "self", ",", "recurse", "=", "False", ")", ":", "for", "group", "in", "self", ".", "_properties", "[", "'mainGroup'", "]", ".", "_properties", "[", "'children'", "]", ":", "if", "isinstance", "(", "group", ",", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcodeproj_file.py#L2694-L2699
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__delitem__
(self, key, dict_delitem=dict.__delitem__)
od.__delitem__(y) <==> del od[y]
od.__delitem__(y) <==> del od[y]
[ "od", ".", "__delitem__", "(", "y", ")", "<", "==", ">", "del", "od", "[", "y", "]" ]
def __delitem__(self, key, dict_delitem=dict.__delitem__): 'od.__delitem__(y) <==> del od[y]' # Deleting an existing item uses self.__map to find the link which is # then removed by updating the links in the predecessor and successor nodes. dict_delitem(self, key) link_prev, link...
[ "def", "__delitem__", "(", "self", ",", "key", ",", "dict_delitem", "=", "dict", ".", "__delitem__", ")", ":", "# Deleting an existing item uses self.__map to find the link which is", "# then removed by updating the links in the predecessor and successor nodes.", "dict_delitem", "(...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py#L81-L88
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/dumbdbm.py
python
open
(file, flag=None, mode=0666)
return _Database(file, mode)
Open the database file, filename, and return corresponding object. The flag argument, used to control how the database is opened in the other DBM implementations, is ignored in the dumbdbm module; the database is always opened for update, and will be created if it does not exist. The optional mode...
Open the database file, filename, and return corresponding object.
[ "Open", "the", "database", "file", "filename", "and", "return", "corresponding", "object", "." ]
def open(file, flag=None, mode=0666): """Open the database file, filename, and return corresponding object. The flag argument, used to control how the database is opened in the other DBM implementations, is ignored in the dumbdbm module; the database is always opened for update, and will be created if ...
[ "def", "open", "(", "file", ",", "flag", "=", "None", ",", "mode", "=", "0666", ")", ":", "# flag argument is currently ignored", "# Modify mode depending on the umask", "try", ":", "um", "=", "_os", ".", "umask", "(", "0", ")", "_os", ".", "umask", "(", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/dumbdbm.py#L225-L250
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/optimize/lbfgsb.py
python
LbfgsInvHessProduct.__init__
(self, sk, yk)
Construct the operator.
Construct the operator.
[ "Construct", "the", "operator", "." ]
def __init__(self, sk, yk): """Construct the operator.""" if sk.shape != yk.shape or sk.ndim != 2: raise ValueError('sk and yk must have matching shape, (n_corrs, n)') n_corrs, n = sk.shape super(LbfgsInvHessProduct, self).__init__( dtype=np.float64, shape=(n, n)...
[ "def", "__init__", "(", "self", ",", "sk", ",", "yk", ")", ":", "if", "sk", ".", "shape", "!=", "yk", ".", "shape", "or", "sk", ".", "ndim", "!=", "2", ":", "raise", "ValueError", "(", "'sk and yk must have matching shape, (n_corrs, n)'", ")", "n_corrs", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/lbfgsb.py#L395-L407
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_MeanGrad
(op, grad)
return math_ops.truediv(sum_grad, math_ops.cast(factor, sum_grad.dtype)), None
Gradient for Mean.
Gradient for Mean.
[ "Gradient", "for", "Mean", "." ]
def _MeanGrad(op, grad): """Gradient for Mean.""" sum_grad = _SumGrad(op, grad)[0] input_shape = op.inputs[0]._shape_tuple() # pylint: disable=protected-access output_shape = op.outputs[0]._shape_tuple() # pylint: disable=protected-access if (input_shape is not None and output_shape is not None and No...
[ "def", "_MeanGrad", "(", "op", ",", "grad", ")", ":", "sum_grad", "=", "_SumGrad", "(", "op", ",", "grad", ")", "[", "0", "]", "input_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "_shape_tuple", "(", ")", "# pylint: disable=protected-access", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L250-L266
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dataflow.py
python
DataFlowAnalysis.op_STORE_SLICE_1
(self, info, inst)
TOS1[TOS:] = TOS2
TOS1[TOS:] = TOS2
[ "TOS1", "[", "TOS", ":", "]", "=", "TOS2" ]
def op_STORE_SLICE_1(self, info, inst): """ TOS1[TOS:] = TOS2 """ tos = info.pop() tos1 = info.pop() value = info.pop() slicevar = info.make_temp() indexvar = info.make_temp() nonevar = info.make_temp() info.append(inst, base=tos1, start=to...
[ "def", "op_STORE_SLICE_1", "(", "self", ",", "info", ",", "inst", ")", ":", "tos", "=", "info", ".", "pop", "(", ")", "tos1", "=", "info", ".", "pop", "(", ")", "value", "=", "info", ".", "pop", "(", ")", "slicevar", "=", "info", ".", "make_temp"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dataflow.py#L523-L534
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py
python
DNNClassifier.__init__
(self, hidden_units, feature_columns=None, model_dir=None, n_classes=2, weight_column_name=None, optimizer=None, activation_fn=nn.relu, dropout=None, gradient_clip_norm=None, ...
Initializes a DNNClassifier instance. Args: hidden_units: List of hidden units per layer. All layers are fully connected. Ex. `[64, 32]` means first layer has 64 nodes and second one has 32. feature_columns: An iterable containing all the feature columns used by the model. All i...
Initializes a DNNClassifier instance.
[ "Initializes", "a", "DNNClassifier", "instance", "." ]
def __init__(self, hidden_units, feature_columns=None, model_dir=None, n_classes=2, weight_column_name=None, optimizer=None, activation_fn=nn.relu, dropout=None, gradient_clip_norm=None...
[ "def", "__init__", "(", "self", ",", "hidden_units", ",", "feature_columns", "=", "None", ",", "model_dir", "=", "None", ",", "n_classes", "=", "2", ",", "weight_column_name", "=", "None", ",", "optimizer", "=", "None", ",", "activation_fn", "=", "nn", "."...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py#L101-L165
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntHI.IsEnd
(self)
return _snap.TIntHI_IsEnd(self)
IsEnd(TIntHI self) -> bool Parameters: self: THashKeyDatI< TInt,TInt > const *
IsEnd(TIntHI self) -> bool
[ "IsEnd", "(", "TIntHI", "self", ")", "-", ">", "bool" ]
def IsEnd(self): """ IsEnd(TIntHI self) -> bool Parameters: self: THashKeyDatI< TInt,TInt > const * """ return _snap.TIntHI_IsEnd(self)
[ "def", "IsEnd", "(", "self", ")", ":", "return", "_snap", ".", "TIntHI_IsEnd", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19047-L19055
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBAddress.GetOffset
(self)
return _lldb.SBAddress_GetOffset(self)
GetOffset(self) -> addr_t
GetOffset(self) -> addr_t
[ "GetOffset", "(", "self", ")", "-", ">", "addr_t" ]
def GetOffset(self): """GetOffset(self) -> addr_t""" return _lldb.SBAddress_GetOffset(self)
[ "def", "GetOffset", "(", "self", ")", ":", "return", "_lldb", ".", "SBAddress_GetOffset", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L892-L894
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
uCSIsOsmanya
(code)
return ret
Check whether the character is part of Osmanya UCS Block
Check whether the character is part of Osmanya UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Osmanya", "UCS", "Block" ]
def uCSIsOsmanya(code): """Check whether the character is part of Osmanya UCS Block """ ret = libxml2mod.xmlUCSIsOsmanya(code) return ret
[ "def", "uCSIsOsmanya", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsOsmanya", "(", "code", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2762-L2765
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
BaseNode.name_relative
(self)
return self.__name.name_relative
Node name, relative to the current drakefile.
Node name, relative to the current drakefile.
[ "Node", "name", "relative", "to", "the", "current", "drakefile", "." ]
def name_relative(self): """Node name, relative to the current drakefile.""" return self.__name.name_relative
[ "def", "name_relative", "(", "self", ")", ":", "return", "self", ".", "__name", ".", "name_relative" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1402-L1404
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saver.py
python
saver_from_object_based_checkpoint
(checkpoint_path, var_list=None, builder=None, names_to_keys=None, cached_saver=None)
return cached_saver
Return a `Saver` which reads from an object-based checkpoint. This function validates that all variables in the variables list are remapped in the object-based checkpoint (or `names_to_keys` dict if provided). A saver will be created with the list of remapped variables. The `cached_saver` argument allows the ...
Return a `Saver` which reads from an object-based checkpoint.
[ "Return", "a", "Saver", "which", "reads", "from", "an", "object", "-", "based", "checkpoint", "." ]
def saver_from_object_based_checkpoint(checkpoint_path, var_list=None, builder=None, names_to_keys=None, cached_saver=None): """Return a `Saver` which reads from ...
[ "def", "saver_from_object_based_checkpoint", "(", "checkpoint_path", ",", "var_list", "=", "None", ",", "builder", "=", "None", ",", "names_to_keys", "=", "None", ",", "cached_saver", "=", "None", ")", ":", "if", "names_to_keys", "is", "None", ":", "try", ":",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saver.py#L1628-L1719
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/_strptime.py
python
TimeRE.__init__
(self, locale_time=None)
Create keys/values. Order of execution is important for dependency reasons.
Create keys/values.
[ "Create", "keys", "/", "values", "." ]
def __init__(self, locale_time=None): """Create keys/values. Order of execution is important for dependency reasons. """ if locale_time: self.locale_time = locale_time else: self.locale_time = LocaleTime() base = super(TimeRE, self) base....
[ "def", "__init__", "(", "self", ",", "locale_time", "=", "None", ")", ":", "if", "locale_time", ":", "self", ".", "locale_time", "=", "locale_time", "else", ":", "self", ".", "locale_time", "=", "LocaleTime", "(", ")", "base", "=", "super", "(", "TimeRE"...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/_strptime.py#L179-L219
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/gem5art/artifact/gem5art/artifact/_artifactdb.py
python
ArtifactMongoDB.__init__
(self, uri: str)
Initialize the mongodb connection and grab pointers to the databases uri is the location of the database in a mongodb compatible form. http://dochub.mongodb.org/core/connections.
Initialize the mongodb connection and grab pointers to the databases uri is the location of the database in a mongodb compatible form. http://dochub.mongodb.org/core/connections.
[ "Initialize", "the", "mongodb", "connection", "and", "grab", "pointers", "to", "the", "databases", "uri", "is", "the", "location", "of", "the", "database", "in", "a", "mongodb", "compatible", "form", ".", "http", ":", "//", "dochub", ".", "mongodb", ".", "...
def __init__(self, uri: str) -> None: """Initialize the mongodb connection and grab pointers to the databases uri is the location of the database in a mongodb compatible form. http://dochub.mongodb.org/core/connections. """ # Note: Need "connect=False" so that we don't connect un...
[ "def", "__init__", "(", "self", ",", "uri", ":", "str", ")", "->", "None", ":", "# Note: Need \"connect=False\" so that we don't connect until the first", "# time we interact with the database. Required for the gem5 running", "# celery server", "self", ".", "db", "=", "MongoCli...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/gem5art/artifact/gem5art/artifact/_artifactdb.py#L137-L147
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/scripts/cpp_lint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L3603-L3617
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/_multivariate.py
python
ortho_group_gen._process_parameters
(self, dim)
return dim
Dimension N must be specified; it cannot be inferred.
Dimension N must be specified; it cannot be inferred.
[ "Dimension", "N", "must", "be", "specified", ";", "it", "cannot", "be", "inferred", "." ]
def _process_parameters(self, dim): """ Dimension N must be specified; it cannot be inferred. """ if dim is None or not np.isscalar(dim) or dim <= 1 or dim != int(dim): raise ValueError("Dimension of rotation must be specified," "and must be a sc...
[ "def", "_process_parameters", "(", "self", ",", "dim", ")", ":", "if", "dim", "is", "None", "or", "not", "np", ".", "isscalar", "(", "dim", ")", "or", "dim", "<=", "1", "or", "dim", "!=", "int", "(", "dim", ")", ":", "raise", "ValueError", "(", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/_multivariate.py#L3490-L3499
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
get_supported_platform
()
return plat
Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version of Mac OS X that we are *running*. To...
Return this platform's maximum compatible version.
[ "Return", "this", "platform", "s", "maximum", "compatible", "version", "." ]
def get_supported_platform(): """Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version o...
[ "def", "get_supported_platform", "(", ")", ":", "plat", "=", "get_build_platform", "(", ")", "m", "=", "macosVersionString", ".", "match", "(", "plat", ")", "if", "m", "is", "not", "None", "and", "sys", ".", "platform", "==", "\"darwin\"", ":", "try", ":...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L175-L196
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
CleanseComments
(line)
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
Removes //-comments and single-line C-style /* */ comments.
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L1381-L1394
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/ndarray/ndarray.py
python
NDArray.square
(self, *args, **kwargs)
return op.square(self, *args, **kwargs)
Convenience fluent method for :py:func:`square`. The arguments are the same as for :py:func:`square`, with this array as data.
Convenience fluent method for :py:func:`square`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "square", "." ]
def square(self, *args, **kwargs): """Convenience fluent method for :py:func:`square`. The arguments are the same as for :py:func:`square`, with this array as data. """ return op.square(self, *args, **kwargs)
[ "def", "square", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "square", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1500-L1506
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/web.py
python
Application.add_handlers
(self, host_pattern: str, host_handlers: _RuleList)
Appends the given handlers to our handler list. Host patterns are processed sequentially in the order they were added. All matching patterns will be considered.
Appends the given handlers to our handler list.
[ "Appends", "the", "given", "handlers", "to", "our", "handler", "list", "." ]
def add_handlers(self, host_pattern: str, host_handlers: _RuleList) -> None: """Appends the given handlers to our handler list. Host patterns are processed sequentially in the order they were added. All matching patterns will be considered. """ host_matcher = HostMatches(host_pa...
[ "def", "add_handlers", "(", "self", ",", "host_pattern", ":", "str", ",", "host_handlers", ":", "_RuleList", ")", "->", "None", ":", "host_matcher", "=", "HostMatches", "(", "host_pattern", ")", "rule", "=", "Rule", "(", "host_matcher", ",", "_ApplicationRoute...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/web.py#L2112-L2126
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py
python
TransferManager.download
(self, bucket, key, fileobj, extra_args=None, subscribers=None)
return self._submit_transfer( call_args, DownloadSubmissionTask, extra_main_kwargs)
Downloads a file from S3 :type bucket: str :param bucket: The name of the bucket to download from :type key: str :param key: The name of the key to download from :type fileobj: str or seekable file-like object :param fileobj: The name of a file to download or a seekabl...
Downloads a file from S3
[ "Downloads", "a", "file", "from", "S3" ]
def download(self, bucket, key, fileobj, extra_args=None, subscribers=None): """Downloads a file from S3 :type bucket: str :param bucket: The name of the bucket to download from :type key: str :param key: The name of the key to download from :type file...
[ "def", "download", "(", "self", ",", "bucket", ",", "key", ",", "fileobj", ",", "extra_args", "=", "None", ",", "subscribers", "=", "None", ")", ":", "if", "extra_args", "is", "None", ":", "extra_args", "=", "{", "}", "if", "subscribers", "is", "None",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py#L315-L355
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/fx/experimental/unification/multipledispatch/dispatcher.py
python
Dispatcher.help
(self, *args, **kwargs)
Print docstring for the function corresponding to inputs
Print docstring for the function corresponding to inputs
[ "Print", "docstring", "for", "the", "function", "corresponding", "to", "inputs" ]
def help(self, *args, **kwargs): """ Print docstring for the function corresponding to inputs """ print(self._help(*args))
[ "def", "help", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "print", "(", "self", ".", "_help", "(", "*", "args", ")", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/unification/multipledispatch/dispatcher.py#L362-L364
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py
python
__validate_event
(event)
Validate content of event received.
Validate content of event received.
[ "Validate", "content", "of", "event", "received", "." ]
def __validate_event(event): ''' Validate content of event received. ''' if 'Records' not in event: raise RuntimeError('Malformed event received. (Records)')
[ "def", "__validate_event", "(", "event", ")", ":", "if", "'Records'", "not", "in", "event", ":", "raise", "RuntimeError", "(", "'Malformed event received. (Records)'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py#L52-L56
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/quopri.py
python
decode
(input, output, header=False)
Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).
Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).
[ "Read", "input", "apply", "quoted", "-", "printable", "decoding", "and", "write", "to", "output", ".", "input", "and", "output", "are", "binary", "file", "objects", ".", "If", "header", "is", "true", "decode", "underscore", "as", "space", "(", "per", "RFC"...
def decode(input, output, header=False): """Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).""" if a2b_qp is not None: data = input.read() odata = a2b_qp(da...
[ "def", "decode", "(", "input", ",", "output", ",", "header", "=", "False", ")", ":", "if", "a2b_qp", "is", "not", "None", ":", "data", "=", "input", ".", "read", "(", ")", "odata", "=", "a2b_qp", "(", "data", ",", "header", "=", "header", ")", "o...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/quopri.py#L117-L158
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/symbolic_io.py
python
exprFromStr
(context,string,fmt=None,add=False)
Returns an Expression from a string. In auto mode, this reads in constants in klampt.loader JSON- compatible format, standard variables in the form "x", user data in the form of strings prepended with $ (e.g., "$x"), and named expression references in the form of strings prepended with @. Args: co...
Returns an Expression from a string. In auto mode, this reads in constants in klampt.loader JSON- compatible format, standard variables in the form "x", user data in the form of strings prepended with $ (e.g., "$x"), and named expression references in the form of strings prepended with @.
[ "Returns", "an", "Expression", "from", "a", "string", ".", "In", "auto", "mode", "this", "reads", "in", "constants", "in", "klampt", ".", "loader", "JSON", "-", "compatible", "format", "standard", "variables", "in", "the", "form", "x", "user", "data", "in"...
def exprFromStr(context,string,fmt=None,add=False): """Returns an Expression from a string. In auto mode, this reads in constants in klampt.loader JSON- compatible format, standard variables in the form "x", user data in the form of strings prepended with $ (e.g., "$x"), and named expression references in ...
[ "def", "exprFromStr", "(", "context", ",", "string", ",", "fmt", "=", "None", ",", "add", "=", "False", ")", ":", "if", "len", "(", "string", ")", "==", "0", ":", "raise", "ValueError", "(", "\"Empty string provided\"", ")", "if", "fmt", "==", "None", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic_io.py#L317-L444
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py
python
GetPlatformSpecificSettings
(ctx, dict, entry, _platform, configuration)
return returnValue
Util function to apply flags based on current platform
Util function to apply flags based on current platform
[ "Util", "function", "to", "apply", "flags", "based", "on", "current", "platform" ]
def GetPlatformSpecificSettings(ctx, dict, entry, _platform, configuration): """ Util function to apply flags based on current platform """ def _to_list( value ): if isinstance(value,list): return value return [ value ] returnValue = [] platforms = ctx.get_current_p...
[ "def", "GetPlatformSpecificSettings", "(", "ctx", ",", "dict", ",", "entry", ",", "_platform", ",", "configuration", ")", ":", "def", "_to_list", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "list", ")", ":", "return", "value", "return", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py#L2446-L2507
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py
python
TNavigator.pos
(self)
return self._position
Return the turtle's current location (x,y), as a Vec2D-vector. Aliases: pos | position No arguments. Example (for a Turtle instance named turtle): >>> turtle.pos() (0.00, 240.00)
Return the turtle's current location (x,y), as a Vec2D-vector.
[ "Return", "the", "turtle", "s", "current", "location", "(", "x", "y", ")", "as", "a", "Vec2D", "-", "vector", "." ]
def pos(self): """Return the turtle's current location (x,y), as a Vec2D-vector. Aliases: pos | position No arguments. Example (for a Turtle instance named turtle): >>> turtle.pos() (0.00, 240.00) """ return self._position
[ "def", "pos", "(", "self", ")", ":", "return", "self", ".", "_position" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L1616-L1627
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/search_services/search_service_geplaces.py
python
RegisterSearchService
(search_services)
return search_services[SEARCH_SERVICE_NAME]
Creates a new search service object and adds it by name to the dict. Args: search_services: dict to which the new search service should be added using its name as the key. Returns: the new search service object.
Creates a new search service object and adds it by name to the dict.
[ "Creates", "a", "new", "search", "service", "object", "and", "adds", "it", "by", "name", "to", "the", "dict", "." ]
def RegisterSearchService(search_services): """Creates a new search service object and adds it by name to the dict. Args: search_services: dict to which the new search service should be added using its name as the key. Returns: the new search service object. """ if SEARCH_SERVICE_NAME in sear...
[ "def", "RegisterSearchService", "(", "search_services", ")", ":", "if", "SEARCH_SERVICE_NAME", "in", "search_services", ".", "keys", "(", ")", ":", "print", "\"Warning: replacing existing %s service.\"", "%", "SEARCH_SERVICE_NAME", "search_services", "[", "SEARCH_SERVICE_NA...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/search_services/search_service_geplaces.py#L127-L140
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py
python
normal_congugates_known_sigma_predictive
(prior, sigma, s, n)
return Normal( mu=(prior.mu/sigma0_2 + s/sigma_2) * sigmap_2, sigma=math_ops.sqrt(sigmap_2 + sigma_2))
Posterior predictive Normal distribution w. conjugate prior on the mean. This model assumes that `n` observations (with sum `s`) come from a Normal with unknown mean `mu` (described by the Normal `prior`) and known variance `sigma^2`. The "known sigma predictive" is the distribution of new observations, condi...
Posterior predictive Normal distribution w. conjugate prior on the mean.
[ "Posterior", "predictive", "Normal", "distribution", "w", ".", "conjugate", "prior", "on", "the", "mean", "." ]
def normal_congugates_known_sigma_predictive(prior, sigma, s, n): """Posterior predictive Normal distribution w. conjugate prior on the mean. This model assumes that `n` observations (with sum `s`) come from a Normal with unknown mean `mu` (described by the Normal `prior`) and known variance `sigma^2`. The "k...
[ "def", "normal_congugates_known_sigma_predictive", "(", "prior", ",", "sigma", ",", "s", ",", "n", ")", ":", "if", "not", "isinstance", "(", "prior", ",", "Normal", ")", ":", "raise", "TypeError", "(", "\"Expected prior to be an instance of type Normal\"", ")", "i...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py#L85-L148
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/saver.py
python
BaseSaverBuilder._AddShardedSaveOpsForV2
(self, checkpoint_prefix, per_device)
Add ops to save the params per shard, for the V2 format. Note that the sharded save procedure for the V2 format is different from V1: there is a special "merge" step that merges the small metadata produced from each device. Args: checkpoint_prefix: scalar String Tensor. Interpreted *NOT AS A ...
Add ops to save the params per shard, for the V2 format.
[ "Add", "ops", "to", "save", "the", "params", "per", "shard", "for", "the", "V2", "format", "." ]
def _AddShardedSaveOpsForV2(self, checkpoint_prefix, per_device): """Add ops to save the params per shard, for the V2 format. Note that the sharded save procedure for the V2 format is different from V1: there is a special "merge" step that merges the small metadata produced from each device. Args:...
[ "def", "_AddShardedSaveOpsForV2", "(", "self", ",", "checkpoint_prefix", ",", "per_device", ")", ":", "# IMPLEMENTATION DETAILS: most clients should skip.", "#", "# Suffix for any well-formed \"checkpoint_prefix\", when sharded.", "# Transformations:", "# * Users pass in \"save_path\" in...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/saver.py#L233-L301
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/utils/asynchronous.py
python
BlockingAsyncTaskWithCallback.abort
(self)
Cancel an asynchronous execution
Cancel an asynchronous execution
[ "Cancel", "an", "asynchronous", "execution" ]
def abort(self): """Cancel an asynchronous execution""" # Implementation is based on # https://stackoverflow.com/questions/5019436/python-how-to-terminate-a-blocking-thread ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(self.task.ident), ...
[ "def", "abort", "(", "self", ")", ":", "# Implementation is based on", "# https://stackoverflow.com/questions/5019436/python-how-to-terminate-a-blocking-thread", "ctypes", ".", "pythonapi", ".", "PyThreadState_SetAsyncExc", "(", "ctypes", ".", "c_long", "(", "self", ".", "tas...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/utils/asynchronous.py#L155-L165
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py
python
BasicFittingView.current_dataset_name
(self)
return self.workspace_selector.current_dataset_name
Returns the selected dataset name.
Returns the selected dataset name.
[ "Returns", "the", "selected", "dataset", "name", "." ]
def current_dataset_name(self) -> str: """Returns the selected dataset name.""" return self.workspace_selector.current_dataset_name
[ "def", "current_dataset_name", "(", "self", ")", "->", "str", ":", "return", "self", ".", "workspace_selector", ".", "current_dataset_name" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py#L169-L171
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
_CppLintState.ResetErrorCounts
(self)
Sets the module's error statistic back to zero.
Sets the module's error statistic back to zero.
[ "Sets", "the", "module", "s", "error", "statistic", "back", "to", "zero", "." ]
def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 self.errors_by_category = {}
[ "def", "ResetErrorCounts", "(", "self", ")", ":", "self", ".", "error_count", "=", "0", "self", ".", "errors_by_category", "=", "{", "}" ]
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1078-L1081
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/PRESUBMIT.py
python
_CheckWatchlist
(input_api, output_api)
return errors
Check that the WATCHLIST file parses correctly.
Check that the WATCHLIST file parses correctly.
[ "Check", "that", "the", "WATCHLIST", "file", "parses", "correctly", "." ]
def _CheckWatchlist(input_api, output_api): """Check that the WATCHLIST file parses correctly.""" errors = [] for f in input_api.AffectedFiles(): if f.LocalPath() != 'WATCHLISTS': continue import StringIO import logging import watchlists log_buffer = Stri...
[ "def", "_CheckWatchlist", "(", "input_api", ",", "output_api", ")", ":", "errors", "=", "[", "]", "for", "f", "in", "input_api", ".", "AffectedFiles", "(", ")", ":", "if", "f", ".", "LocalPath", "(", ")", "!=", "'WATCHLISTS'", ":", "continue", "import", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/PRESUBMIT.py#L39-L66
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/fx/experimental/schema_type_annotation.py
python
AnnotateTypesWithSchema._extract_python_return_type
(self, target : Target)
return sig.return_annotation if sig.return_annotation is not inspect.Signature.empty else None
Given a Python call target, try to extract the Python return annotation if it is available, otherwise return None Args: target (Callable): Python callable to get return annotation for Returns: Optional[Any]: Return annotation from the `target`, or None if it was ...
Given a Python call target, try to extract the Python return annotation if it is available, otherwise return None
[ "Given", "a", "Python", "call", "target", "try", "to", "extract", "the", "Python", "return", "annotation", "if", "it", "is", "available", "otherwise", "return", "None" ]
def _extract_python_return_type(self, target : Target) -> Optional[Any]: """ Given a Python call target, try to extract the Python return annotation if it is available, otherwise return None Args: target (Callable): Python callable to get return annotation for Retu...
[ "def", "_extract_python_return_type", "(", "self", ",", "target", ":", "Target", ")", "->", "Optional", "[", "Any", "]", ":", "assert", "callable", "(", "target", ")", "try", ":", "sig", "=", "inspect", ".", "signature", "(", "target", ")", "except", "("...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/schema_type_annotation.py#L91-L111
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/p4util/fcidump.py
python
write_eigenvalues
(eigs, mo_idx)
return eigs_dump
Prepare multi-line string with one-particle eigenvalues to be written to the FCIDUMP file.
Prepare multi-line string with one-particle eigenvalues to be written to the FCIDUMP file.
[ "Prepare", "multi", "-", "line", "string", "with", "one", "-", "particle", "eigenvalues", "to", "be", "written", "to", "the", "FCIDUMP", "file", "." ]
def write_eigenvalues(eigs, mo_idx): """Prepare multi-line string with one-particle eigenvalues to be written to the FCIDUMP file. """ eigs_dump = '' iorb = 0 for h, block in enumerate(eigs): for idx, x in np.ndenumerate(block): eigs_dump += '{:29.20E}{:4d}{:4d}{:4d}{:4d}\n'.form...
[ "def", "write_eigenvalues", "(", "eigs", ",", "mo_idx", ")", ":", "eigs_dump", "=", "''", "iorb", "=", "0", "for", "h", ",", "block", "in", "enumerate", "(", "eigs", ")", ":", "for", "idx", ",", "x", "in", "np", ".", "ndenumerate", "(", "block", ")...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/fcidump.py#L206-L215
ros-planning/moveit
ee48dc5cedc981d0869352aa3db0b41469c2735c
moveit_commander/src/moveit_commander/robot.py
python
RobotCommander.get_robot_markers
(self, *args)
return mrkr
Get a MarkerArray of the markers that make up this robot Usage: (): get's all markers for current state state (RobotState): gets markers for a particular state values (dict): get markers with given values values, links (dict, list): get markers with given values ...
Get a MarkerArray of the markers that make up this robot
[ "Get", "a", "MarkerArray", "of", "the", "markers", "that", "make", "up", "this", "robot" ]
def get_robot_markers(self, *args): """Get a MarkerArray of the markers that make up this robot Usage: (): get's all markers for current state state (RobotState): gets markers for a particular state values (dict): get markers with given values values, lin...
[ "def", "get_robot_markers", "(", "self", ",", "*", "args", ")", ":", "mrkr", "=", "MarkerArray", "(", ")", "if", "not", "args", ":", "conversions", ".", "msg_from_string", "(", "mrkr", ",", "self", ".", "_r", ".", "get_robot_markers", "(", ")", ")", "e...
https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/robot.py#L168-L192
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py
python
adb_copy_output.set_device
(self, device)
Sets the android device (serial number from adb devices command) to copy the file to
Sets the android device (serial number from adb devices command) to copy the file to
[ "Sets", "the", "android", "device", "(", "serial", "number", "from", "adb", "devices", "command", ")", "to", "copy", "the", "file", "to" ]
def set_device(self, device): '''Sets the android device (serial number from adb devices command) to copy the file to''' self.device = device
[ "def", "set_device", "(", "self", ",", "device", ")", ":", "self", ".", "device", "=", "device" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py#L2639-L2641
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/pkg_resources/__init__.py
python
find_eggs_in_zip
(importer, path_item, only=False)
Find eggs in zip files; possibly multiple nested eggs.
Find eggs in zip files; possibly multiple nested eggs.
[ "Find", "eggs", "in", "zip", "files", ";", "possibly", "multiple", "nested", "eggs", "." ]
def find_eggs_in_zip(importer, path_item, only=False): """ Find eggs in zip files; possibly multiple nested eggs. """ if importer.archive.endswith('.whl'): # wheels are not supported with this finder # they don't have PKG-INFO metadata, and won't ever contain eggs return meta...
[ "def", "find_eggs_in_zip", "(", "importer", ",", "path_item", ",", "only", "=", "False", ")", ":", "if", "importer", ".", "archive", ".", "endswith", "(", "'.whl'", ")", ":", "# wheels are not supported with this finder", "# they don't have PKG-INFO metadata, and won't ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L1974-L1998
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/arrays/datetimes.py
python
DatetimeArray._local_timestamps
(self)
return tzconversion.tz_convert_from_utc(self.asi8, self.tz)
Convert to an i8 (unix-like nanosecond timestamp) representation while keeping the local timezone and not using UTC. This is used to calculate time-of-day information as if the timestamps were timezone-naive.
Convert to an i8 (unix-like nanosecond timestamp) representation while keeping the local timezone and not using UTC. This is used to calculate time-of-day information as if the timestamps were timezone-naive.
[ "Convert", "to", "an", "i8", "(", "unix", "-", "like", "nanosecond", "timestamp", ")", "representation", "while", "keeping", "the", "local", "timezone", "and", "not", "using", "UTC", ".", "This", "is", "used", "to", "calculate", "time", "-", "of", "-", "...
def _local_timestamps(self) -> np.ndarray: """ Convert to an i8 (unix-like nanosecond timestamp) representation while keeping the local timezone and not using UTC. This is used to calculate time-of-day information as if the timestamps were timezone-naive. """ if s...
[ "def", "_local_timestamps", "(", "self", ")", "->", "np", ".", "ndarray", ":", "if", "self", ".", "tz", "is", "None", "or", "timezones", ".", "is_utc", "(", "self", ".", "tz", ")", ":", "return", "self", ".", "asi8", "return", "tzconversion", ".", "t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/datetimes.py#L776-L785
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/utils.py
python
get_include
()
return d
Return the directory that contains the NumPy \\*.h header files. Extension modules that need to compile against NumPy should use this function to locate the appropriate include directory. Notes ----- When using ``distutils``, for example in ``setup.py``. :: import numpy as np ...
Return the directory that contains the NumPy \\*.h header files.
[ "Return", "the", "directory", "that", "contains", "the", "NumPy", "\\\\", "*", ".", "h", "header", "files", "." ]
def get_include(): """ Return the directory that contains the NumPy \\*.h header files. Extension modules that need to compile against NumPy should use this function to locate the appropriate include directory. Notes ----- When using ``distutils``, for example in ``setup.py``. :: ...
[ "def", "get_include", "(", ")", ":", "import", "numpy", "if", "numpy", ".", "show_config", "is", "None", ":", "# running from numpy source directory", "d", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "numpy", ".", "_...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/utils.py#L23-L50
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/requests/requests/api.py
python
get
(url, **kwargs)
return request('get', url, **kwargs)
Sends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes.
Sends a GET request. Returns :class:`Response` object.
[ "Sends", "a", "GET", "request", ".", "Returns", ":", "class", ":", "Response", "object", "." ]
def get(url, **kwargs): """Sends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. """ kwargs.setdefault('allow_redirects', True) return request('get', url, **kwargs)
[ "def", "get", "(", "url", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'allow_redirects'", ",", "True", ")", "return", "request", "(", "'get'", ",", "url", ",", "*", "*", "kwargs", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/api.py#L57-L65
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/javaw.py
python
javac.post_run
(self)
List class files created
List class files created
[ "List", "class", "files", "created" ]
def post_run(self): """ List class files created """ for node in self.generator.outdir.ant_glob('**/*.class', quiet=True): self.generator.bld.node_sigs[node] = self.uid() self.generator.bld.task_sigs[self.uid()] = self.cache_sig
[ "def", "post_run", "(", "self", ")", ":", "for", "node", "in", "self", ".", "generator", ".", "outdir", ".", "ant_glob", "(", "'**/*.class'", ",", "quiet", "=", "True", ")", ":", "self", ".", "generator", ".", "bld", ".", "node_sigs", "[", "node", "]...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/javaw.py#L414-L420
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/bindings/python/clang/cindex.py
python
Cursor.get_num_template_arguments
(self)
return conf.lib.clang_Cursor_getNumTemplateArguments(self)
Returns the number of template args associated with this cursor.
Returns the number of template args associated with this cursor.
[ "Returns", "the", "number", "of", "template", "args", "associated", "with", "this", "cursor", "." ]
def get_num_template_arguments(self): """Returns the number of template args associated with this cursor.""" return conf.lib.clang_Cursor_getNumTemplateArguments(self)
[ "def", "get_num_template_arguments", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_Cursor_getNumTemplateArguments", "(", "self", ")" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L1806-L1808
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Scripts/UpdateBuildVersions.py
python
ParseOptions
()
return(parser.parse_args())
Parse the command-line options. The options for this tool will be passed along to the MkBinPkg tool.
Parse the command-line options. The options for this tool will be passed along to the MkBinPkg tool.
[ "Parse", "the", "command", "-", "line", "options", ".", "The", "options", "for", "this", "tool", "will", "be", "passed", "along", "to", "the", "MkBinPkg", "tool", "." ]
def ParseOptions(): """ Parse the command-line options. The options for this tool will be passed along to the MkBinPkg tool. """ parser = ArgumentParser( usage=("%s [options]" % __execname__), description=__copyright__, conflict_handler='resolve') # Standard Tool Options...
[ "def", "ParseOptions", "(", ")", ":", "parser", "=", "ArgumentParser", "(", "usage", "=", "(", "\"%s [options]\"", "%", "__execname__", ")", ",", "description", "=", "__copyright__", ",", "conflict_handler", "=", "'resolve'", ")", "# Standard Tool Options", "parse...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Scripts/UpdateBuildVersions.py#L42-L72
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/interfaces/TaskManipulation.py
python
TaskManipulation.ReleaseActive
(self,movingdir=None,execute=None,outputtraj=None,outputfinal=None,translationstepmult=None,finestep=None,outputtrajobj=None)
return final,traj
See :ref:`module-taskmanipulation-releaseactive`
See :ref:`module-taskmanipulation-releaseactive`
[ "See", ":", "ref", ":", "module", "-", "taskmanipulation", "-", "releaseactive" ]
def ReleaseActive(self,movingdir=None,execute=None,outputtraj=None,outputfinal=None,translationstepmult=None,finestep=None,outputtrajobj=None): """See :ref:`module-taskmanipulation-releaseactive` """ cmd = 'ReleaseActive ' if movingdir is not None: assert(len(movingdir) == se...
[ "def", "ReleaseActive", "(", "self", ",", "movingdir", "=", "None", ",", "execute", "=", "None", ",", "outputtraj", "=", "None", ",", "outputfinal", "=", "None", ",", "translationstepmult", "=", "None", ",", "finestep", "=", "None", ",", "outputtrajobj", "...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/interfaces/TaskManipulation.py#L262-L297
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/graph_editor/transform.py
python
_TmpInfo.new_name
(self, name)
return name_
Compute a destination name from a source name. Args: name: the name to be "transformed". Returns: The transformed name. Raises: ValueError: if the source scope is used (that is, not an empty string) and the source name does not belong to the source scope.
Compute a destination name from a source name.
[ "Compute", "a", "destination", "name", "from", "a", "source", "name", "." ]
def new_name(self, name): """Compute a destination name from a source name. Args: name: the name to be "transformed". Returns: The transformed name. Raises: ValueError: if the source scope is used (that is, not an empty string) and the source name does not belong to the source...
[ "def", "new_name", "(", "self", ",", "name", ")", ":", "scope", "=", "self", ".", "scope", "if", "not", "name", ".", "startswith", "(", "scope", ")", ":", "raise", "ValueError", "(", "\"{} does not belong to source scope: {}.\"", ".", "format", "(", "name", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/transform.py#L332-L349
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/generator/eclipse.py
python
GetJavaSourceDirs
(target_list, target_dicts, toplevel_dir)
Generates a sequence of all likely java package root directories.
Generates a sequence of all likely java package root directories.
[ "Generates", "a", "sequence", "of", "all", "likely", "java", "package", "root", "directories", "." ]
def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): '''Generates a sequence of all likely java package root directories.''' for target_name in target_list: target = target_dicts[target_name] for action in target.get('actions', []): for input_ in action['inputs']: if (os.path.splite...
[ "def", "GetJavaSourceDirs", "(", "target_list", ",", "target_dicts", ",", "toplevel_dir", ")", ":", "for", "target_name", "in", "target_list", ":", "target", "=", "target_dicts", "[", "target_name", "]", "for", "action", "in", "target", ".", "get", "(", "'acti...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/eclipse.py#L384-L407
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_endpoints.py
python
Connection.remote_desired_capabilities
(self)
return dat2obj(pn_connection_remote_desired_capabilities(self._impl))
The capabilities desired by the remote peer for this connection. This operation will return a :class:`Data` object that is valid until the connection object is freed. This :class:`Data` object will be empty until the remote connection is opened as indicated by the :const:`REMOTE_ACTIVE`...
The capabilities desired by the remote peer for this connection.
[ "The", "capabilities", "desired", "by", "the", "remote", "peer", "for", "this", "connection", "." ]
def remote_desired_capabilities(self): """ The capabilities desired by the remote peer for this connection. This operation will return a :class:`Data` object that is valid until the connection object is freed. This :class:`Data` object will be empty until the remote connection i...
[ "def", "remote_desired_capabilities", "(", "self", ")", ":", "return", "dat2obj", "(", "pn_connection_remote_desired_capabilities", "(", "self", ".", "_impl", ")", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_endpoints.py#L336-L347
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_vendor/packaging/specifiers.py
python
BaseSpecifier.__hash__
(self)
Returns a hash value for this Specifier like object.
Returns a hash value for this Specifier like object.
[ "Returns", "a", "hash", "value", "for", "this", "Specifier", "like", "object", "." ]
def __hash__(self) -> int: """ Returns a hash value for this Specifier like object. """
[ "def", "__hash__", "(", "self", ")", "->", "int", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/packaging/specifiers.py#L48-L51
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.getApparentPoint
(self, x, y)
return pt
Return a 3D point, projected on the current working plane.
Return a 3D point, projected on the current working plane.
[ "Return", "a", "3D", "point", "projected", "on", "the", "current", "working", "plane", "." ]
def getApparentPoint(self, x, y): """Return a 3D point, projected on the current working plane.""" view = Draft.get3DView() pt = view.getPoint(x, y) if self.mask != "z": if hasattr(App,"DraftWorkingPlane"): if view.getCameraType() == "Perspective": ...
[ "def", "getApparentPoint", "(", "self", ",", "x", ",", "y", ")", ":", "view", "=", "Draft", ".", "get3DView", "(", ")", "pt", "=", "view", ".", "getPoint", "(", "x", ",", "y", ")", "if", "self", ".", "mask", "!=", "\"z\"", ":", "if", "hasattr", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L543-L556
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/statedatareporter.py
python
StateDataReporter.report
(self, simulation, state)
Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation
Generate a report.
[ "Generate", "a", "report", "." ]
def report(self, simulation, state): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation """ if not self._hasInitialized: ...
[ "def", "report", "(", "self", ",", "simulation", ",", "state", ")", ":", "if", "not", "self", ".", "_hasInitialized", ":", "self", ".", "_initializeConstants", "(", "simulation", ")", "headers", "=", "self", ".", "_constructHeaders", "(", ")", "if", "not",...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/statedatareporter.py#L181-L216
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
ContextLoadResponse.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(ContextLoadResponse)
Returns new ContextLoadResponse object constructed from its marshaled representation in the given byte buffer
Returns new ContextLoadResponse object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "ContextLoadResponse", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new ContextLoadResponse object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(ContextLoadResponse)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "ContextLoadResponse", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L16185-L16189
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/tools/scan-build-py/libscanbuild/arguments.py
python
parse_args_for_scan_build
()
return args
Parse and validate command-line arguments for scan-build.
Parse and validate command-line arguments for scan-build.
[ "Parse", "and", "validate", "command", "-", "line", "arguments", "for", "scan", "-", "build", "." ]
def parse_args_for_scan_build(): """ Parse and validate command-line arguments for scan-build. """ from_build_command = True parser = create_analyze_parser(from_build_command) args = parser.parse_args() reconfigure_logging(args.verbose) logging.debug('Raw arguments %s', sys.argv) normaliz...
[ "def", "parse_args_for_scan_build", "(", ")", ":", "from_build_command", "=", "True", "parser", "=", "create_analyze_parser", "(", "from_build_command", ")", "args", "=", "parser", ".", "parse_args", "(", ")", "reconfigure_logging", "(", "args", ".", "verbose", ")...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/tools/scan-build-py/libscanbuild/arguments.py#L62-L75
JavierIH/zowi
830c1284154b8167c9131deb9c45189fd9e67b54
code/python-client/Oscillator.py
python
Oscillator.O
(self, value)
Attribute: Set the offset
Attribute: Set the offset
[ "Attribute", ":", "Set", "the", "offset" ]
def O(self, value): """Attribute: Set the offset""" self.set_O(value)
[ "def", "O", "(", "self", ",", "value", ")", ":", "self", ".", "set_O", "(", "value", ")" ]
https://github.com/JavierIH/zowi/blob/830c1284154b8167c9131deb9c45189fd9e67b54/code/python-client/Oscillator.py#L124-L126
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/query_crbug.py
python
QuerySingleIssue
(issue_id, url_template=SINGLE_ISSUE_URL)
return json.loads(response)
Queries the tracker for a specific issue. Returns a dict. This uses the deprecated Issue Tracker API to fetch a JSON representation of the issue details. Args: issue_id: An int or string representing the issue id. url_template: URL to query the tracker with '%s' instead of the bug id. Returns: A ...
Queries the tracker for a specific issue. Returns a dict.
[ "Queries", "the", "tracker", "for", "a", "specific", "issue", ".", "Returns", "a", "dict", "." ]
def QuerySingleIssue(issue_id, url_template=SINGLE_ISSUE_URL): """Queries the tracker for a specific issue. Returns a dict. This uses the deprecated Issue Tracker API to fetch a JSON representation of the issue details. Args: issue_id: An int or string representing the issue id. url_template: URL to q...
[ "def", "QuerySingleIssue", "(", "issue_id", ",", "url_template", "=", "SINGLE_ISSUE_URL", ")", ":", "assert", "str", "(", "issue_id", ")", ".", "isdigit", "(", ")", "response", "=", "urllib2", ".", "urlopen", "(", "url_template", "%", "issue_id", ")", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/query_crbug.py#L24-L42
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/volume.py
python
Volume.create_snapshot
(self, description=None, dry_run=False)
return self.connection.create_snapshot( self.id, description, dry_run=dry_run )
Create a snapshot of this EBS Volume. :type description: str :param description: A description of the snapshot. Limited to 256 characters. :rtype: :class:`boto.ec2.snapshot.Snapshot` :return: The created Snapshot object
Create a snapshot of this EBS Volume.
[ "Create", "a", "snapshot", "of", "this", "EBS", "Volume", "." ]
def create_snapshot(self, description=None, dry_run=False): """ Create a snapshot of this EBS Volume. :type description: str :param description: A description of the snapshot. Limited to 256 characters. :rtype: :class:`boto.ec2.snapshot.Snapshot` :return: Th...
[ "def", "create_snapshot", "(", "self", ",", "description", "=", "None", ",", "dry_run", "=", "False", ")", ":", "return", "self", ".", "connection", ".", "create_snapshot", "(", "self", ".", "id", ",", "description", ",", "dry_run", "=", "dry_run", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/volume.py#L190-L205
fabianschenk/REVO
eb949c0fdbcdf0be09a38464eb0592a90803947f
thirdparty/Sophus/py/sophus/se2.py
python
Se2.__init__
(self, so2, t)
internally represented by a unit complex number z and a translation 2-vector
internally represented by a unit complex number z and a translation 2-vector
[ "internally", "represented", "by", "a", "unit", "complex", "number", "z", "and", "a", "translation", "2", "-", "vector" ]
def __init__(self, so2, t): """ internally represented by a unit complex number z and a translation 2-vector """ self.so2 = so2 self.t = t
[ "def", "__init__", "(", "self", ",", "so2", ",", "t", ")", ":", "self", ".", "so2", "=", "so2", "self", ".", "t", "=", "t" ]
https://github.com/fabianschenk/REVO/blob/eb949c0fdbcdf0be09a38464eb0592a90803947f/thirdparty/Sophus/py/sophus/se2.py#L11-L15
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/extern/__init__.py
python
VendorImporter.find_module
(self, fullname, path=None)
return self
Return self when fullname starts with root_name and the target module is one vendored through this importer.
Return self when fullname starts with root_name and the target module is one vendored through this importer.
[ "Return", "self", "when", "fullname", "starts", "with", "root_name", "and", "the", "target", "module", "is", "one", "vendored", "through", "this", "importer", "." ]
def find_module(self, fullname, path=None): """ Return self when fullname starts with root_name and the target module is one vendored through this importer. """ root, base, target = fullname.partition(self.root_name + '.') if root: return if not any(ma...
[ "def", "find_module", "(", "self", ",", "fullname", ",", "path", "=", "None", ")", ":", "root", ",", "base", ",", "target", "=", "fullname", ".", "partition", "(", "self", ".", "root_name", "+", "'.'", ")", "if", "root", ":", "return", "if", "not", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/extern/__init__.py#L23-L33
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_math_ops.py
python
get_bprop_truncate_div
(self)
return bprop
Grad definition for `TruncateDiv` operation.
Grad definition for `TruncateDiv` operation.
[ "Grad", "definition", "for", "TruncateDiv", "operation", "." ]
def get_bprop_truncate_div(self): """Grad definition for `TruncateDiv` operation.""" def bprop(x, y, out, dout): return zeros_like(x), zeros_like(y) return bprop
[ "def", "get_bprop_truncate_div", "(", "self", ")", ":", "def", "bprop", "(", "x", ",", "y", ",", "out", ",", "dout", ")", ":", "return", "zeros_like", "(", "x", ")", ",", "zeros_like", "(", "y", ")", "return", "bprop" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_math_ops.py#L400-L406
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/exponential.py
python
Exponential._mode
(self, rate=None)
return self.fill(self.dtype, self.shape(rate), 0.)
r""" .. math:: MODE(EXP) = 0.
r""" .. math:: MODE(EXP) = 0.
[ "r", "..", "math", "::", "MODE", "(", "EXP", ")", "=", "0", "." ]
def _mode(self, rate=None): r""" .. math:: MODE(EXP) = 0. """ rate = self._check_param_type(rate) return self.fill(self.dtype, self.shape(rate), 0.)
[ "def", "_mode", "(", "self", ",", "rate", "=", "None", ")", ":", "rate", "=", "self", ".", "_check_param_type", "(", "rate", ")", "return", "self", ".", "fill", "(", "self", ".", "dtype", ",", "self", ".", "shape", "(", "rate", ")", ",", "0.", ")...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/exponential.py#L218-L224
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlDoc.addDocEntity
(self, name, type, ExternalID, SystemID, content)
return __tmp
Register a new entity for this document.
Register a new entity for this document.
[ "Register", "a", "new", "entity", "for", "this", "document", "." ]
def addDocEntity(self, name, type, ExternalID, SystemID, content): """Register a new entity for this document. """ ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content) if ret is None:raise treeError('xmlAddDocEntity() failed') __tmp = xmlEntity(_obj=ret) ...
[ "def", "addDocEntity", "(", "self", ",", "name", ",", "type", ",", "ExternalID", ",", "SystemID", ",", "content", ")", ":", "ret", "=", "libxml2mod", ".", "xmlAddDocEntity", "(", "self", ".", "_o", ",", "name", ",", "type", ",", "ExternalID", ",", "Sys...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L3313-L3318
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.selection_own
(self, **kw)
Become owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).
Become owner of X selection.
[ "Become", "owner", "of", "X", "selection", "." ]
def selection_own(self, **kw): """Become owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).""" self.tk.call(('selection', 'own') + self._options(kw) + (self._w,))
[ "def", "selection_own", "(", "self", ",", "*", "*", "kw", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "'selection'", ",", "'own'", ")", "+", "self", ".", "_options", "(", "kw", ")", "+", "(", "self", ".", "_w", ",", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L693-L699
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/tools/extra/parse_log.py
python
write_csv
(output_filename, dict_list, delimiter, verbose=False)
Write a CSV file
Write a CSV file
[ "Write", "a", "CSV", "file" ]
def write_csv(output_filename, dict_list, delimiter, verbose=False): """Write a CSV file """ if not dict_list: if verbose: print('Not writing %s; no lines to write' % output_filename) return dialect = csv.excel dialect.delimiter = delimiter with open(output_filenam...
[ "def", "write_csv", "(", "output_filename", ",", "dict_list", ",", "delimiter", ",", "verbose", "=", "False", ")", ":", "if", "not", "dict_list", ":", "if", "verbose", ":", "print", "(", "'Not writing %s; no lines to write'", "%", "output_filename", ")", "return...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/tools/extra/parse_log.py#L148-L166
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/proto_library_target.py
python
ProtoLibrary._check_proto_srcs_name
(self, srcs_list)
_check_proto_srcs_name. Checks whether the proto file's name ends with 'proto'.
_check_proto_srcs_name.
[ "_check_proto_srcs_name", "." ]
def _check_proto_srcs_name(self, srcs_list): """_check_proto_srcs_name. Checks whether the proto file's name ends with 'proto'. """ err = 0 for src in srcs_list: base_name = os.path.basename(src) pos = base_name.rfind('.') if pos == -1: ...
[ "def", "_check_proto_srcs_name", "(", "self", ",", "srcs_list", ")", ":", "err", "=", "0", "for", "src", "in", "srcs_list", ":", "base_name", "=", "os", ".", "path", ".", "basename", "(", "src", ")", "pos", "=", "base_name", ".", "rfind", "(", "'.'", ...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/proto_library_target.py#L59-L75
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/tools/docs/py_guide_parser.py
python
md_files_in_dir
(py_guide_src_dir)
return [(full, f) for full, f in all_in_dir if os.path.isfile(full) and f.endswith('.md')]
Returns a list of filename (full_path, base) pairs for guide files.
Returns a list of filename (full_path, base) pairs for guide files.
[ "Returns", "a", "list", "of", "filename", "(", "full_path", "base", ")", "pairs", "for", "guide", "files", "." ]
def md_files_in_dir(py_guide_src_dir): """Returns a list of filename (full_path, base) pairs for guide files.""" all_in_dir = [(os.path.join(py_guide_src_dir, f), f) for f in os.listdir(py_guide_src_dir)] return [(full, f) for full, f in all_in_dir if os.path.isfile(full) and f.endswith(...
[ "def", "md_files_in_dir", "(", "py_guide_src_dir", ")", ":", "all_in_dir", "=", "[", "(", "os", ".", "path", ".", "join", "(", "py_guide_src_dir", ",", "f", ")", ",", "f", ")", "for", "f", "in", "os", ".", "listdir", "(", "py_guide_src_dir", ")", "]", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/py_guide_parser.py#L26-L31
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGrid.SelectProperty
(*args, **kwargs)
return _propgrid.PropertyGrid_SelectProperty(*args, **kwargs)
SelectProperty(self, PGPropArg id, bool focus=False) -> bool
SelectProperty(self, PGPropArg id, bool focus=False) -> bool
[ "SelectProperty", "(", "self", "PGPropArg", "id", "bool", "focus", "=", "False", ")", "-", ">", "bool" ]
def SelectProperty(*args, **kwargs): """SelectProperty(self, PGPropArg id, bool focus=False) -> bool""" return _propgrid.PropertyGrid_SelectProperty(*args, **kwargs)
[ "def", "SelectProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_SelectProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2195-L2197
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/cpplint/cpplint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L348-L350
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/ops.py
python
roi_align
(x, boxes, boxes_num, output_size, spatial_scale=1.0, sampling_ratio=-1, aligned=True, name=None)
This operator implements the roi_align layer. Region of Interest (RoI) Align operator (also known as RoI Align) is to perform bilinear interpolation on inputs of nonuniform sizes to obtain fixed-size feature maps (e.g. 7*7), as described in Mask R-CNN. Dividing each region proposal into equal-sized sec...
This operator implements the roi_align layer. Region of Interest (RoI) Align operator (also known as RoI Align) is to perform bilinear interpolation on inputs of nonuniform sizes to obtain fixed-size feature maps (e.g. 7*7), as described in Mask R-CNN.
[ "This", "operator", "implements", "the", "roi_align", "layer", ".", "Region", "of", "Interest", "(", "RoI", ")", "Align", "operator", "(", "also", "known", "as", "RoI", "Align", ")", "is", "to", "perform", "bilinear", "interpolation", "on", "inputs", "of", ...
def roi_align(x, boxes, boxes_num, output_size, spatial_scale=1.0, sampling_ratio=-1, aligned=True, name=None): """ This operator implements the roi_align layer. Region of Interest (RoI) Align operator (also kn...
[ "def", "roi_align", "(", "x", ",", "boxes", ",", "boxes_num", ",", "output_size", ",", "spatial_scale", "=", "1.0", ",", "sampling_ratio", "=", "-", "1", ",", "aligned", "=", "True", ",", "name", "=", "None", ")", ":", "check_type", "(", "output_size", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/ops.py#L1145-L1252
google/orbit
7c0a530f402f0c3753d0bc52f8e3eb620f65d017
third_party/include-what-you-use/fix_includes.py
python
ParseOneFile
(f, iwyu_record)
return file_lines
Given a file object, read and classify the lines of the file. For each file that iwyu_output mentions, we return a list of LineInfo objects, which is a parsed version of each line, including not only its content but its 'type', its 'key', etc. Arguments: f: an iterable object returning lines from a file. ...
Given a file object, read and classify the lines of the file.
[ "Given", "a", "file", "object", "read", "and", "classify", "the", "lines", "of", "the", "file", "." ]
def ParseOneFile(f, iwyu_record): """Given a file object, read and classify the lines of the file. For each file that iwyu_output mentions, we return a list of LineInfo objects, which is a parsed version of each line, including not only its content but its 'type', its 'key', etc. Arguments: f: an iterab...
[ "def", "ParseOneFile", "(", "f", ",", "iwyu_record", ")", ":", "file_lines", "=", "[", "LineInfo", "(", "None", ")", "]", "for", "line", "in", "f", ":", "file_lines", ".", "append", "(", "LineInfo", "(", "line", ")", ")", "_CalculateLineTypesAndKeys", "(...
https://github.com/google/orbit/blob/7c0a530f402f0c3753d0bc52f8e3eb620f65d017/third_party/include-what-you-use/fix_includes.py#L965-L987
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
ConfigBase.Exists
(*args, **kwargs)
return _misc_.ConfigBase_Exists(*args, **kwargs)
Exists(self, String name) -> bool Returns True if either a group or an entry with a given name exists
Exists(self, String name) -> bool
[ "Exists", "(", "self", "String", "name", ")", "-", ">", "bool" ]
def Exists(*args, **kwargs): """ Exists(self, String name) -> bool Returns True if either a group or an entry with a given name exists """ return _misc_.ConfigBase_Exists(*args, **kwargs)
[ "def", "Exists", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ConfigBase_Exists", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3239-L3245
citizenfx/fivem
88276d40cc7baf8285d02754cc5ae42ec7a8563f
vendor/chromium/base/win/embedded_i18n/create_string_rc.py
python
GrdHandler.__init__
(self, string_id_set)
Constructs a handler that reads selected strings from a .grd file. The dict attribute |messages| is populated with the strings that are read. Args: string_id_set: An optional set of message identifiers to extract; all messages are extracted if empty.
Constructs a handler that reads selected strings from a .grd file.
[ "Constructs", "a", "handler", "that", "reads", "selected", "strings", "from", "a", ".", "grd", "file", "." ]
def __init__(self, string_id_set): """Constructs a handler that reads selected strings from a .grd file. The dict attribute |messages| is populated with the strings that are read. Args: string_id_set: An optional set of message identifiers to extract; all messages are extracted if empty. "...
[ "def", "__init__", "(", "self", ",", "string_id_set", ")", ":", "sax", ".", "handler", ".", "ContentHandler", ".", "__init__", "(", "self", ")", "self", ".", "messages", "=", "{", "}", "self", ".", "referenced_xtb_files", "=", "[", "]", "self", ".", "_...
https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/vendor/chromium/base/win/embedded_i18n/create_string_rc.py#L84-L100
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0142-Linked-List-Cycle-II/0142.py
python
Solution.findDuplicate
(self, nums)
return -1
:type nums: List[int] :rtype: int
:type nums: List[int] :rtype: int
[ ":", "type", "nums", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def findDuplicate(self, nums): """ :type nums: List[int] :rtype: int """ if len(nums) > 1: slow = nums[0] fast = nums[nums[0]] while slow != fast: slow = nums[slow] fast = nums[nums[fast]] ...
[ "def", "findDuplicate", "(", "self", ",", "nums", ")", ":", "if", "len", "(", "nums", ")", ">", "1", ":", "slow", "=", "nums", "[", "0", "]", "fast", "=", "nums", "[", "nums", "[", "0", "]", "]", "while", "slow", "!=", "fast", ":", "slow", "=...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0142-Linked-List-Cycle-II/0142.py#L8-L27
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_scripts/adstash/utils.py
python
time_remaining
(starttime, timeout, positive=True)
return timeout - elapsed
Return the remaining time (in seconds) until starttime + timeout Returns 0 if there is no time remaining
Return the remaining time (in seconds) until starttime + timeout Returns 0 if there is no time remaining
[ "Return", "the", "remaining", "time", "(", "in", "seconds", ")", "until", "starttime", "+", "timeout", "Returns", "0", "if", "there", "is", "no", "time", "remaining" ]
def time_remaining(starttime, timeout, positive=True): """ Return the remaining time (in seconds) until starttime + timeout Returns 0 if there is no time remaining """ elapsed = time.time() - starttime if positive: return max(0, timeout - elapsed) return timeout - elapsed
[ "def", "time_remaining", "(", "starttime", ",", "timeout", ",", "positive", "=", "True", ")", ":", "elapsed", "=", "time", ".", "time", "(", ")", "-", "starttime", "if", "positive", ":", "return", "max", "(", "0", ",", "timeout", "-", "elapsed", ")", ...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_scripts/adstash/utils.py#L118-L126
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/strings.py
python
cat_core
(list_of_columns: List, sep: str)
return np.sum(arr_with_sep, axis=0)
Auxiliary function for :meth:`str.cat` Parameters ---------- list_of_columns : list of numpy arrays List of arrays to be concatenated with sep; these arrays may not contain NaNs! sep : string The separator string for concatenating the columns. Returns ------- nd.arr...
Auxiliary function for :meth:`str.cat`
[ "Auxiliary", "function", "for", ":", "meth", ":", "str", ".", "cat" ]
def cat_core(list_of_columns: List, sep: str): """ Auxiliary function for :meth:`str.cat` Parameters ---------- list_of_columns : list of numpy arrays List of arrays to be concatenated with sep; these arrays may not contain NaNs! sep : string The separator string for con...
[ "def", "cat_core", "(", "list_of_columns", ":", "List", ",", "sep", ":", "str", ")", ":", "if", "sep", "==", "\"\"", ":", "# no need to interleave sep if it is empty", "arr_of_cols", "=", "np", ".", "asarray", "(", "list_of_columns", ",", "dtype", "=", "object...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/strings.py#L59-L83
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignment/python/svgfig.py
python
Ticks.interpret
(self)
Evaluate and return optimal ticks and miniticks according to the standard minitick specification. Normally only used internally.
Evaluate and return optimal ticks and miniticks according to the standard minitick specification.
[ "Evaluate", "and", "return", "optimal", "ticks", "and", "miniticks", "according", "to", "the", "standard", "minitick", "specification", "." ]
def interpret(self): """Evaluate and return optimal ticks and miniticks according to the standard minitick specification. Normally only used internally. """ if self.labels == None or self.labels == False: format = lambda x: "" elif self.labels == True: format = unumber elif i...
[ "def", "interpret", "(", "self", ")", ":", "if", "self", ".", "labels", "==", "None", "or", "self", ".", "labels", "==", "False", ":", "format", "=", "lambda", "x", ":", "\"\"", "elif", "self", ".", "labels", "==", "True", ":", "format", "=", "unum...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L2508-L2600
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotModel.interpolate
(self, a, b, u)
return _robotsim.RobotModel_interpolate(self, a, b, u)
interpolate(RobotModel self, doubleVector a, doubleVector b, double u) Interpolates smoothly between two configurations, properly taking into account nonstandard joints. Returns: (list of n floats): The configuration that is u fraction of the way from a to b
interpolate(RobotModel self, doubleVector a, doubleVector b, double u)
[ "interpolate", "(", "RobotModel", "self", "doubleVector", "a", "doubleVector", "b", "double", "u", ")" ]
def interpolate(self, a, b, u): """ interpolate(RobotModel self, doubleVector a, doubleVector b, double u) Interpolates smoothly between two configurations, properly taking into account nonstandard joints. Returns: (list of n floats): The configuration that i...
[ "def", "interpolate", "(", "self", ",", "a", ",", "b", ",", "u", ")", ":", "return", "_robotsim", ".", "RobotModel_interpolate", "(", "self", ",", "a", ",", "b", ",", "u", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L5053-L5068
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/linear_model/base.py
python
LinearClassifierMixin._predict_proba_lr
(self, X)
Probability estimation for OvR logistic regression. Positive class probabilities are computed as 1. / (1. + np.exp(-self.decision_function(X))); multiclass is handled by normalizing that over all classes.
Probability estimation for OvR logistic regression.
[ "Probability", "estimation", "for", "OvR", "logistic", "regression", "." ]
def _predict_proba_lr(self, X): """Probability estimation for OvR logistic regression. Positive class probabilities are computed as 1. / (1. + np.exp(-self.decision_function(X))); multiclass is handled by normalizing that over all classes. """ prob = self.decision_functi...
[ "def", "_predict_proba_lr", "(", "self", ",", "X", ")", ":", "prob", "=", "self", ".", "decision_function", "(", "X", ")", "prob", "*=", "-", "1", "np", ".", "exp", "(", "prob", ",", "prob", ")", "prob", "+=", "1", "np", ".", "reciprocal", "(", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/base.py#L343-L360