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
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
applications/nlp/transformer/evaluate.py
python
greedy_decode
(tokens_en, embedding_layer, transformer, classifier)
return tokens_de
Generate sequence with transformer. Predict tokens one at a time by choosing the one that maximizes the classification score.
Generate sequence with transformer.
[ "Generate", "sequence", "with", "transformer", "." ]
def greedy_decode(tokens_en, embedding_layer, transformer, classifier): """Generate sequence with transformer. Predict tokens one at a time by choosing the one that maximizes the classification score. """ # Encode English sequence embeddings_en = embedding_layer(tokens_en) memory = transf...
[ "def", "greedy_decode", "(", "tokens_en", ",", "embedding_layer", ",", "transformer", ",", "classifier", ")", ":", "# Encode English sequence", "embeddings_en", "=", "embedding_layer", "(", "tokens_en", ")", "memory", "=", "transformer", ".", "encoder", "(", "add_po...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/nlp/transformer/evaluate.py#L226-L254
eric612/Caffe-YOLOv3-Windows
6736ca6e16781789b828cc64218ff77cc3454e5d
scripts/cpp_lint.py
python
CleansedLines.NumLines
(self)
return self.num_lines
Returns the number of lines represented.
Returns the number of lines represented.
[ "Returns", "the", "number", "of", "lines", "represented", "." ]
def NumLines(self): """Returns the number of lines represented.""" return self.num_lines
[ "def", "NumLines", "(", "self", ")", ":", "return", "self", ".", "num_lines" ]
https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/scripts/cpp_lint.py#L1208-L1210
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
_MaskedPrintOption.enabled
(self)
return self._enabled
Is the use of the display value enabled?
Is the use of the display value enabled?
[ "Is", "the", "use", "of", "the", "display", "value", "enabled?" ]
def enabled (self): "Is the use of the display value enabled?" return self._enabled
[ "def", "enabled", "(", "self", ")", ":", "return", "self", ".", "_enabled" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L73-L75
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
Table.__repr__
(self)
return ( f"{self.pandas_type:12.12}{ver} " f"(typ->{self.table_type_short},nrows->{self.nrows}," f"ncols->{self.ncols},indexers->[{jindex_axes}]{dc})" )
return a pretty representation of myself
return a pretty representation of myself
[ "return", "a", "pretty", "representation", "of", "myself" ]
def __repr__(self) -> str: """ return a pretty representation of myself """ self.infer_axes() jdc = ",".join(self.data_columns) if len(self.data_columns) else "" dc = f",dc->[{jdc}]" ver = "" if self.is_old_version: jver = ".".join(str(x) for x in self.versio...
[ "def", "__repr__", "(", "self", ")", "->", "str", ":", "self", ".", "infer_axes", "(", ")", "jdc", "=", "\",\"", ".", "join", "(", "self", ".", "data_columns", ")", "if", "len", "(", "self", ".", "data_columns", ")", "else", "\"\"", "dc", "=", "f\"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L3173-L3189
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/_json.py
python
dumps
(obj)
return _json.dumps({'data': data, 'schema': schema})
Dumps a serializable object to JSON. This API maps to the Python built-in json dumps method, with a few differences: * The return value is always valid JSON according to RFC 7159. * The input can be any of the following types: - SFrame - SArray - SGraph - single flexible_typ...
Dumps a serializable object to JSON. This API maps to the Python built-in json dumps method, with a few differences:
[ "Dumps", "a", "serializable", "object", "to", "JSON", ".", "This", "API", "maps", "to", "the", "Python", "built", "-", "in", "json", "dumps", "method", "with", "a", "few", "differences", ":" ]
def dumps(obj): """ Dumps a serializable object to JSON. This API maps to the Python built-in json dumps method, with a few differences: * The return value is always valid JSON according to RFC 7159. * The input can be any of the following types: - SFrame - SArray - SGraph ...
[ "def", "dumps", "(", "obj", ")", ":", "from", ".", "import", "extensions", "(", "data", ",", "schema", ")", "=", "to_serializable", "(", "obj", ")", "return", "_json", ".", "dumps", "(", "{", "'data'", ":", "data", ",", "'schema'", ":", "schema", "}"...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/_json.py#L21-L40
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/signal/dct_ops.py
python
dct
(input, type=2, n=None, axis=-1, norm=None, name=None)
Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`. Currently only Types I, II and III are supported. Type I is implemented using a length `2N` padded `tf.signal.rfft`. Type II is implemented using a length `2N` padded `tf.signal.rfft`, as described here: [Type 2 DCT using 2N FFT padded (Makhoul...
Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`.
[ "Computes", "the", "1D", "[", "Discrete", "Cosine", "Transform", "(", "DCT", ")", "]", "[", "dct", "]", "of", "input", "." ]
def dct(input, type=2, n=None, axis=-1, norm=None, name=None): # pylint: disable=redefined-builtin """Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`. Currently only Types I, II and III are supported. Type I is implemented using a length `2N` padded `tf.signal.rfft`. Type II is implemented u...
[ "def", "dct", "(", "input", ",", "type", "=", "2", ",", "n", "=", "None", ",", "axis", "=", "-", "1", ",", "norm", "=", "None", ",", "name", "=", "None", ")", ":", "# pylint: disable=redefined-builtin", "_validate_dct_arguments", "(", "input", ",", "ty...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/signal/dct_ops.py#L52-L163
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/cpplint_1.4.5/cpplint.py
python
CheckEmptyBlockBody
(filename, clean_lines, linenum, error)
Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Look for empty loop/conditional body with only a single semicolon.
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L4238-L4339
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
tools/rb/fix_linux_stack.py
python
separate_debug_file_for
(file)
return None
Finds a separated file with the debug sections for a binary. Such files are commonly installed by debug packages on linux distros. Rules for finding them are documented in: https://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html
Finds a separated file with the debug sections for a binary. Such files are commonly installed by debug packages on linux distros. Rules for finding them are documented in: https://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html
[ "Finds", "a", "separated", "file", "with", "the", "debug", "sections", "for", "a", "binary", ".", "Such", "files", "are", "commonly", "installed", "by", "debug", "packages", "on", "linux", "distros", ".", "Rules", "for", "finding", "them", "are", "documented...
def separate_debug_file_for(file): """ Finds a separated file with the debug sections for a binary. Such files are commonly installed by debug packages on linux distros. Rules for finding them are documented in: https://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html """ ...
[ "def", "separate_debug_file_for", "(", "file", ")", ":", "def", "have_debug_file", "(", "debugfile", ")", ":", "return", "os", ".", "path", ".", "isfile", "(", "debugfile", ")", "endian", "=", "None", "readelf", "=", "subprocess", ".", "Popen", "(", "[", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/tools/rb/fix_linux_stack.py#L161-L239
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/ltisys.py
python
LinearTimeInvariant.__init__
(self)
Initialize the `lti` baseclass. The heavy lifting is done by the subclasses.
Initialize the `lti` baseclass.
[ "Initialize", "the", "lti", "baseclass", "." ]
def __init__(self): """ Initialize the `lti` baseclass. The heavy lifting is done by the subclasses. """ super(LinearTimeInvariant, self).__init__() self.inputs = None self.outputs = None self._dt = None
[ "def", "__init__", "(", "self", ")", ":", "super", "(", "LinearTimeInvariant", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "inputs", "=", "None", "self", ".", "outputs", "=", "None", "self", ".", "_dt", "=", "None" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L58-L68
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/ops.py
python
Graph.get_operations
(self)
Return the list of operations in the graph. You can modify the operations in place, but modifications to the list such as inserts/delete have no effect on the list of operations known to the graph. This method may be called concurrently from multiple threads. Returns: A list of Operations.
Return the list of operations in the graph.
[ "Return", "the", "list", "of", "operations", "in", "the", "graph", "." ]
def get_operations(self): """Return the list of operations in the graph. You can modify the operations in place, but modifications to the list such as inserts/delete have no effect on the list of operations known to the graph. This method may be called concurrently from multiple threads. Retu...
[ "def", "get_operations", "(", "self", ")", ":", "if", "self", ".", "_finalized", ":", "return", "list", "(", "self", ".", "_nodes_by_id", ".", "values", "(", ")", ")", "with", "self", ".", "_lock", ":", "return", "list", "(", "self", ".", "_nodes_by_id...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L2557-L2573
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/format/policy_templates/writers/admx_writer.py
python
ADMXWriter._AddIntPolicy
(self, parent, name)
Generates ADMX elements for an Int-Policy and adds them to the passed parent node.
Generates ADMX elements for an Int-Policy and adds them to the passed parent node.
[ "Generates", "ADMX", "elements", "for", "an", "Int", "-", "Policy", "and", "adds", "them", "to", "the", "passed", "parent", "node", "." ]
def _AddIntPolicy(self, parent, name): '''Generates ADMX elements for an Int-Policy and adds them to the passed parent node. ''' attributes = { 'id': name, 'valueName': name, 'maxValue': '2000000000', } self.AddElement(parent, 'decimal', attributes)
[ "def", "_AddIntPolicy", "(", "self", ",", "parent", ",", "name", ")", ":", "attributes", "=", "{", "'id'", ":", "name", ",", "'valueName'", ":", "name", ",", "'maxValue'", ":", "'2000000000'", ",", "}", "self", ".", "AddElement", "(", "parent", ",", "'...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/admx_writer.py#L175-L184
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/dist.py
python
fix_help_options
(options)
return new_options
Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt.
Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt.
[ "Convert", "a", "4", "-", "tuple", "help_options", "list", "as", "found", "in", "various", "command", "classes", "to", "the", "3", "-", "tuple", "form", "required", "by", "FancyGetopt", "." ]
def fix_help_options(options): """Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. """ new_options = [] for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options
[ "def", "fix_help_options", "(", "options", ")", ":", "new_options", "=", "[", "]", "for", "help_tuple", "in", "options", ":", "new_options", ".", "append", "(", "help_tuple", "[", "0", ":", "3", "]", ")", "return", "new_options" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/dist.py#L1242-L1249
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py
python
Distribution.requires
(self, extras=())
return deps
List of Requirements needed for this distro if `extras` are used
List of Requirements needed for this distro if `extras` are used
[ "List", "of", "Requirements", "needed", "for", "this", "distro", "if", "extras", "are", "used" ]
def requires(self, extras=()): """List of Requirements needed for this distro if `extras` are used""" dm = self._dep_map deps = [] deps.extend(dm.get(None, ())) for ext in extras: try: deps.extend(dm[safe_extra(ext)]) except KeyError: ...
[ "def", "requires", "(", "self", ",", "extras", "=", "(", ")", ")", ":", "dm", "=", "self", ".", "_dep_map", "deps", "=", "[", "]", "deps", ".", "extend", "(", "dm", ".", "get", "(", "None", ",", "(", ")", ")", ")", "for", "ext", "in", "extras...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py#L2744-L2756
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Misc.grab_current
(self)
return self._nametowidget(name)
Return widget which has currently the grab in this application or None.
Return widget which has currently the grab in this application or None.
[ "Return", "widget", "which", "has", "currently", "the", "grab", "in", "this", "application", "or", "None", "." ]
def grab_current(self): """Return widget which has currently the grab in this application or None.""" name = self.tk.call('grab', 'current', self._w) if not name: return None return self._nametowidget(name)
[ "def", "grab_current", "(", "self", ")", ":", "name", "=", "self", ".", "tk", ".", "call", "(", "'grab'", ",", "'current'", ",", "self", ".", "_w", ")", "if", "not", "name", ":", "return", "None", "return", "self", ".", "_nametowidget", "(", "name", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L826-L831
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py
python
inject_into_urllib3
()
Monkey-patch urllib3 with PyOpenSSL-backed SSL-support.
Monkey-patch urllib3 with PyOpenSSL-backed SSL-support.
[ "Monkey", "-", "patch", "urllib3", "with", "PyOpenSSL", "-", "backed", "SSL", "-", "support", "." ]
def inject_into_urllib3(): "Monkey-patch urllib3 with PyOpenSSL-backed SSL-support." _validate_dependencies_met() util.SSLContext = PyOpenSSLContext util.ssl_.SSLContext = PyOpenSSLContext util.HAS_SNI = HAS_SNI util.ssl_.HAS_SNI = HAS_SNI util.IS_PYOPENSSL = True util.ssl_.IS_PYOPENSS...
[ "def", "inject_into_urllib3", "(", ")", ":", "_validate_dependencies_met", "(", ")", "util", ".", "SSLContext", "=", "PyOpenSSLContext", "util", ".", "ssl_", ".", "SSLContext", "=", "PyOpenSSLContext", "util", ".", "HAS_SNI", "=", "HAS_SNI", "util", ".", "ssl_",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py#L115-L125
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/util/variant_utils.py
python
is_biallelic
(variant, exclude_alleles=None)
return len(relevant_alts) == 1
Returns True if variant has exactly one alternate allele. Args: variant: nucleus.genomics.v1.Variant. exclude_alleles: list(str). The alleles in this list will be ignored. Returns: True if the variant has exactly one alternate allele.
Returns True if variant has exactly one alternate allele.
[ "Returns", "True", "if", "variant", "has", "exactly", "one", "alternate", "allele", "." ]
def is_biallelic(variant, exclude_alleles=None): """Returns True if variant has exactly one alternate allele. Args: variant: nucleus.genomics.v1.Variant. exclude_alleles: list(str). The alleles in this list will be ignored. Returns: True if the variant has exactly one alternate allele. """ relev...
[ "def", "is_biallelic", "(", "variant", ",", "exclude_alleles", "=", "None", ")", ":", "relevant_alts", "=", "_non_excluded_alts", "(", "variant", ".", "alternate_bases", ",", "exclude_alleles", ")", "return", "len", "(", "relevant_alts", ")", "==", "1" ]
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/variant_utils.py#L238-L249
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/internal/encoder.py
python
_FloatingPointEncoder
(wire_type, format)
return SpecificEncoder
Return a constructor for an encoder for float fields. This is like StructPackEncoder, but catches errors that may be due to passing non-finite floating-point values to struct.pack, and makes a second attempt to encode those values. Args: wire_type: The field's wire type, for encoding tags. format...
Return a constructor for an encoder for float fields.
[ "Return", "a", "constructor", "for", "an", "encoder", "for", "float", "fields", "." ]
def _FloatingPointEncoder(wire_type, format): """Return a constructor for an encoder for float fields. This is like StructPackEncoder, but catches errors that may be due to passing non-finite floating-point values to struct.pack, and makes a second attempt to encode those values. Args: wire_type: The...
[ "def", "_FloatingPointEncoder", "(", "wire_type", ",", "format", ")", ":", "value_size", "=", "struct", ".", "calcsize", "(", "format", ")", "if", "value_size", "==", "4", ":", "def", "EncodeNonFiniteOrRaise", "(", "write", ",", "value", ")", ":", "# Remembe...
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/encoder.py#L511-L585
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/toasterbox.py
python
ToasterBox.MoveAbove
(self, tb)
If a :class:`ToasterBox` already exists, move the new one above the existing one. :param `tb`: another instance of :class:`ToasterBox`.
If a :class:`ToasterBox` already exists, move the new one above the existing one.
[ "If", "a", ":", "class", ":", "ToasterBox", "already", "exists", "move", "the", "new", "one", "above", "the", "existing", "one", "." ]
def MoveAbove(self, tb): """ If a :class:`ToasterBox` already exists, move the new one above the existing one. :param `tb`: another instance of :class:`ToasterBox`. """ # recalc where to place this popup self._tb.SetPopupPosition((self._popupposition[0], self._popuppo...
[ "def", "MoveAbove", "(", "self", ",", "tb", ")", ":", "# recalc where to place this popup", "self", ".", "_tb", ".", "SetPopupPosition", "(", "(", "self", ".", "_popupposition", "[", "0", "]", ",", "self", ".", "_popupposition", "[", "1", "]", "-", "self",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/toasterbox.py#L556-L566
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
libcxx/utils/libcxx/util.py
python
killProcessAndChildren
(pid)
This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation. TODO: Reimplement this without using psutil so we can remove our dependency on it.
This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation.
[ "This", "function", "kills", "a", "process", "with", "pid", "and", "all", "its", "running", "children", "(", "recursively", ")", ".", "It", "is", "currently", "implemented", "using", "the", "psutil", "module", "which", "provides", "a", "simple", "platform", ...
def killProcessAndChildren(pid): """ This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation. TODO: Reimplement this without using psutil so we can ...
[ "def", "killProcessAndChildren", "(", "pid", ")", ":", "import", "psutil", "try", ":", "psutilProc", "=", "psutil", ".", "Process", "(", "pid", ")", "# Handle the different psutil API versions", "try", ":", "# psutil >= 2.x", "children_iterator", "=", "psutilProc", ...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/libcxx/util.py#L246-L273
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/mount.py
python
CephFSMount.kill_cleanup
(self)
Follow up ``kill`` to get to a clean unmounted state.
Follow up ``kill`` to get to a clean unmounted state.
[ "Follow", "up", "kill", "to", "get", "to", "a", "clean", "unmounted", "state", "." ]
def kill_cleanup(self): """ Follow up ``kill`` to get to a clean unmounted state. """ log.info('Cleaning up killed connection on {0}'.format(self.client_remote.name)) self.umount_wait(force=True)
[ "def", "kill_cleanup", "(", "self", ")", ":", "log", ".", "info", "(", "'Cleaning up killed connection on {0}'", ".", "format", "(", "self", ".", "client_remote", ".", "name", ")", ")", "self", ".", "umount_wait", "(", "force", "=", "True", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/mount.py#L541-L546
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/config.py
python
PyPIRCCommand._read_pypirc
(self)
return {}
Reads the .pypirc file.
Reads the .pypirc file.
[ "Reads", "the", ".", "pypirc", "file", "." ]
def _read_pypirc(self): """Reads the .pypirc file.""" rc = self._get_rc_file() if os.path.exists(rc): self.announce('Using PyPI login from %s' % rc) repository = self.repository or self.DEFAULT_REPOSITORY config = RawConfigParser() config.read(rc)...
[ "def", "_read_pypirc", "(", "self", ")", ":", "rc", "=", "self", ".", "_get_rc_file", "(", ")", "if", "os", ".", "path", ".", "exists", "(", "rc", ")", ":", "self", ".", "announce", "(", "'Using PyPI login from %s'", "%", "rc", ")", "repository", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/config.py#L48-L110
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
python/caffe/io.py
python
Transformer.preprocess
(self, in_, data)
return caffe_in
Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models) - subtract mean...
Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models) - subtract mean...
[ "Format", "input", "for", "Caffe", ":", "-", "convert", "to", "single", "-", "resize", "to", "input", "dimensions", "(", "preserving", "number", "of", "channels", ")", "-", "transpose", "dimensions", "to", "K", "x", "H", "x", "W", "-", "reorder", "channe...
def preprocess(self, in_, data): """ Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to ...
[ "def", "preprocess", "(", "self", ",", "in_", ",", "data", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "caffe_in", "=", "data", ".", "astype", "(", "np", ".", "float32", ",", "copy", "=", "False", ")", "transpose", "=", "self", ".", "t...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/io.py#L122-L162
Kitware/TeleSculptor
84821cabd2fd60c5fbfeaf61a1948cbced716641
scripts/landmark_io.py
python
write_landmarks_ply_file
(landmarks, filename, other_data={}, fields=None)
Open a PLY file and write landmarks as vertices. landmarks is a Nx3 array of (x,y,z) coordinates filename is the path the file to write other_data is an optional dictionary of other data to write fields is a list of properties to write in a specific order The other_data keys are PLY property names...
Open a PLY file and write landmarks as vertices.
[ "Open", "a", "PLY", "file", "and", "write", "landmarks", "as", "vertices", "." ]
def write_landmarks_ply_file(landmarks, filename, other_data={}, fields=None): """Open a PLY file and write landmarks as vertices. landmarks is a Nx3 array of (x,y,z) coordinates filename is the path the file to write other_data is an optional dictionary of other data to write fields is a list of p...
[ "def", "write_landmarks_ply_file", "(", "landmarks", ",", "filename", ",", "other_data", "=", "{", "}", ",", "fields", "=", "None", ")", ":", "L", "=", "np", ".", "array", "(", "landmarks", ")", "other_data", "[", "\"x\"", "]", "=", "L", "[", ":", ",...
https://github.com/Kitware/TeleSculptor/blob/84821cabd2fd60c5fbfeaf61a1948cbced716641/scripts/landmark_io.py#L151-L174
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
dev/scripts/milestone2rst.py
python
_log_msg
(msg: str)
A pseudo logger that prints to stdout without line breaks
A pseudo logger that prints to stdout without line breaks
[ "A", "pseudo", "logger", "that", "prints", "to", "stdout", "without", "line", "breaks" ]
def _log_msg(msg: str): """A pseudo logger that prints to stdout without line breaks""" try: msg = msg.encode(encoding="ascii", errors="ignore") msg = msg.decode() except AttributeError: pass try: print(msg, end='', flush=True) except Exception as e: print(str...
[ "def", "_log_msg", "(", "msg", ":", "str", ")", ":", "try", ":", "msg", "=", "msg", ".", "encode", "(", "encoding", "=", "\"ascii\"", ",", "errors", "=", "\"ignore\"", ")", "msg", "=", "msg", ".", "decode", "(", ")", "except", "AttributeError", ":", ...
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/scripts/milestone2rst.py#L5-L15
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/buildtime_helpers/win_tool.py
python
WinTool.ExecRcWrapper
(self, arch, *args)
return 0
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
[ "Filter", "logo", "banner", "from", "invocations", "of", "rc", ".", "exe", ".", "Older", "versions", "of", "RC", "don", "t", "support", "the", "/", "nologo", "flag", "." ]
def ExecRcWrapper(self, arch, *args): """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" env = self._GetEnv(arch) out = subprocess.check_output(args, shell=True, env=env, stderr=subprocess.STDOUT).decode('utf-8') for line in out.splitlines(): ...
[ "def", "ExecRcWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "out", "=", "subprocess", ".", "check_output", "(", "args", ",", "shell", "=", "True", ",", "env", "=", "env", ",", ...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/buildtime_helpers/win_tool.py#L269-L279
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/encoder.py
python
_ModifiedEncoder
(wire_type, encode_value, compute_value_size, modify_value)
return SpecificEncoder
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
[ "Like", "SimpleEncoder", "but", "additionally", "invokes", "modify_value", "on", "every", "value", "before", "passing", "it", "to", "encode_value", ".", "Usually", "modify_value", "is", "ZigZagEncode", "." ]
def _ModifiedEncoder(wire_type, encode_value, compute_value_size, modify_value): """Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.""" def SpecificEncoder(field_number, is_repeated, is_packed): if is_packed: ...
[ "def", "_ModifiedEncoder", "(", "wire_type", ",", "encode_value", ",", "compute_value_size", ",", "modify_value", ")", ":", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "if", "is_packed", ":", "tag_bytes", "=", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/encoder.py#L439-L470
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/gclient_util.py
python
RunAction
(dir, command)
Runs the action.
Runs the action.
[ "Runs", "the", "action", "." ]
def RunAction(dir, command): """Runs the action.""" try: gclient_utils.CheckCallAndFilter( command, cwd=dir, always_show_header=True, print_stdout=True) except gclient_utils.Error as e: # Use a discrete exit status code of 2 to indicate that a hook action # failed. Users of this script may wi...
[ "def", "RunAction", "(", "dir", ",", "command", ")", ":", "try", ":", "gclient_utils", ".", "CheckCallAndFilter", "(", "command", ",", "cwd", "=", "dir", ",", "always_show_header", "=", "True", ",", "print_stdout", "=", "True", ")", "except", "gclient_utils"...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/gclient_util.py#L32-L42
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
HTMLDataObject.GetHTML
(*args, **kwargs)
return _misc_.HTMLDataObject_GetHTML(*args, **kwargs)
GetHTML(self) -> String
GetHTML(self) -> String
[ "GetHTML", "(", "self", ")", "-", ">", "String" ]
def GetHTML(*args, **kwargs): """GetHTML(self) -> String""" return _misc_.HTMLDataObject_GetHTML(*args, **kwargs)
[ "def", "GetHTML", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "HTMLDataObject_GetHTML", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5451-L5453
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
codegen/cheetah/Cheetah/Template.py
python
Template.generatedModuleCode
(self)
return self._CHEETAH_generatedModuleCode
Return the module code the compiler generated, or None if no compilation took place.
Return the module code the compiler generated, or None if no compilation took place.
[ "Return", "the", "module", "code", "the", "compiler", "generated", "or", "None", "if", "no", "compilation", "took", "place", "." ]
def generatedModuleCode(self): """Return the module code the compiler generated, or None if no compilation took place. """ return self._CHEETAH_generatedModuleCode
[ "def", "generatedModuleCode", "(", "self", ")", ":", "return", "self", ".", "_CHEETAH_generatedModuleCode" ]
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/codegen/cheetah/Cheetah/Template.py#L1261-L1266
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py
python
InstalledDistribution.get_resource_path
(self, relative_path)
NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be f...
NOTE: This API may change in the future.
[ "NOTE", ":", "This", "API", "may", "change", "in", "the", "future", "." ]
def get_resource_path(self, relative_path): """ NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. ...
[ "def", "get_resource_path", "(", "self", ",", "relative_path", ")", ":", "r", "=", "self", ".", "get_distinfo_resource", "(", "'RESOURCES'", ")", "with", "contextlib", ".", "closing", "(", "r", ".", "as_stream", "(", ")", ")", "as", "stream", ":", "with", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L643-L661
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBSymbol.GetName
(self)
return _lldb.SBSymbol_GetName(self)
GetName(SBSymbol self) -> char const *
GetName(SBSymbol self) -> char const *
[ "GetName", "(", "SBSymbol", "self", ")", "-", ">", "char", "const", "*" ]
def GetName(self): """GetName(SBSymbol self) -> char const *""" return _lldb.SBSymbol_GetName(self)
[ "def", "GetName", "(", "self", ")", ":", "return", "_lldb", ".", "SBSymbol_GetName", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9807-L9809
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/tools/graphviz.py
python
WriteGraph
(edges)
Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.
Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.
[ "Print", "a", "graphviz", "graph", "to", "stdout", ".", "|edges|", "is", "a", "map", "of", "target", "to", "a", "list", "of", "other", "targets", "it", "depends", "on", "." ]
def WriteGraph(edges): """Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.""" # Bucket targets by file. files = collections.defaultdict(list) for src, dst in edges.items(): build_file, target_name, toolset = ParseTarget(src) files[build_file].appe...
[ "def", "WriteGraph", "(", "edges", ")", ":", "# Bucket targets by file.", "files", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "src", ",", "dst", "in", "edges", ".", "items", "(", ")", ":", "build_file", ",", "target_name", ",", "tools...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/tools/graphviz.py#L43-L83
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/aoc/genie_unit.py
python
GenieGameEntityGroup.get_class_id
(self)
return self.get_head_unit()["unit_class"].get_value()
Return the class ID for units in the group.
Return the class ID for units in the group.
[ "Return", "the", "class", "ID", "for", "units", "in", "the", "group", "." ]
def get_class_id(self): """ Return the class ID for units in the group. """ return self.get_head_unit()["unit_class"].get_value()
[ "def", "get_class_id", "(", "self", ")", ":", "return", "self", ".", "get_head_unit", "(", ")", "[", "\"unit_class\"", "]", ".", "get_value", "(", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L463-L467
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextPrinting.SetRichTextBufferPrinting
(*args, **kwargs)
return _richtext.RichTextPrinting_SetRichTextBufferPrinting(*args, **kwargs)
SetRichTextBufferPrinting(self, RichTextBuffer buf)
SetRichTextBufferPrinting(self, RichTextBuffer buf)
[ "SetRichTextBufferPrinting", "(", "self", "RichTextBuffer", "buf", ")" ]
def SetRichTextBufferPrinting(*args, **kwargs): """SetRichTextBufferPrinting(self, RichTextBuffer buf)""" return _richtext.RichTextPrinting_SetRichTextBufferPrinting(*args, **kwargs)
[ "def", "SetRichTextBufferPrinting", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_SetRichTextBufferPrinting", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4576-L4578
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/initializer.py
python
xavier
(scale=DefaultParamInitScale, output_rank=SentinelValueForInferParamInitRank, filter_rank=SentinelValueForInferParamInitRank, seed=None)
return cntk_py.xavier_initializer(scale, output_rank, filter_rank, seed)
Xavier initializer Args: scale (float): scale output_rank (int): output rank filter_rank (int): filter rank seed (int): random seed Returns: initializer for :class:`~cntk.variables.Parameter` initialized to Gaussian distribution with mean `0` and standard ...
Xavier initializer
[ "Xavier", "initializer" ]
def xavier(scale=DefaultParamInitScale, output_rank=SentinelValueForInferParamInitRank, filter_rank=SentinelValueForInferParamInitRank, seed=None): ''' Xavier initializer Args: scale (float): scale output_rank (int): output rank filter_rank (int): filter rank seed (int): ran...
[ "def", "xavier", "(", "scale", "=", "DefaultParamInitScale", ",", "output_rank", "=", "SentinelValueForInferParamInitRank", ",", "filter_rank", "=", "SentinelValueForInferParamInitRank", ",", "seed", "=", "None", ")", ":", "if", "seed", "is", "None", ":", "seed", ...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/initializer.py#L53-L71
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPML_DIGEST_VALUES.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.digests = buf.readObjArr(TPMT_HA)
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "digests", "=", "buf", ".", "readObjArr", "(", "TPMT_HA", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4643-L4645
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame.to_clipboard
( self, excel: bool_t = True, sep: Optional[str] = None, **kwargs )
r""" Copy object to the system clipboard. Write a text representation of object to the system clipboard. This can be pasted into Excel, for example. Parameters ---------- excel : bool, default True Produce output in a csv format for easy pasting into excel. ...
r""" Copy object to the system clipboard.
[ "r", "Copy", "object", "to", "the", "system", "clipboard", "." ]
def to_clipboard( self, excel: bool_t = True, sep: Optional[str] = None, **kwargs ) -> None: r""" Copy object to the system clipboard. Write a text representation of object to the system clipboard. This can be pasted into Excel, for example. Parameters -----...
[ "def", "to_clipboard", "(", "self", ",", "excel", ":", "bool_t", "=", "True", ",", "sep", ":", "Optional", "[", "str", "]", "=", "None", ",", "*", "*", "kwargs", ")", "->", "None", ":", "from", "pandas", ".", "io", "import", "clipboards", "clipboards...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L2727-L2785
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/futures.py
python
TransferMeta.user_context
(self)
return self._user_context
A dictionary that requesters can store data in
A dictionary that requesters can store data in
[ "A", "dictionary", "that", "requesters", "can", "store", "data", "in" ]
def user_context(self): """A dictionary that requesters can store data in""" return self._user_context
[ "def", "user_context", "(", "self", ")", ":", "return", "self", ".", "_user_context" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/futures.py#L147-L149
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/sans/eqsans_options_script.py
python
ReductionOptions.to_script
(self)
return script
Generate reduction script @param execute: if true, the script will be executed
Generate reduction script
[ "Generate", "reduction", "script" ]
def to_script(self): """ Generate reduction script @param execute: if true, the script will be executed """ script = super(ReductionOptions, self).to_script() # TOF cutoff if self.use_config_cutoff: script += "UseConfigTOFTailsCutoff(True)\n" ...
[ "def", "to_script", "(", "self", ")", ":", "script", "=", "super", "(", "ReductionOptions", ",", "self", ")", ".", "to_script", "(", ")", "# TOF cutoff", "if", "self", ".", "use_config_cutoff", ":", "script", "+=", "\"UseConfigTOFTailsCutoff(True)\\n\"", "else",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/sans/eqsans_options_script.py#L136-L164
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/client/client.py
python
Client._full_name
(self)
return 'projects/%s/locations/%s/nodes/%s' % ( self._project, self._zone, self._tpu)
Returns the full Cloud name for this TPU.
Returns the full Cloud name for this TPU.
[ "Returns", "the", "full", "Cloud", "name", "for", "this", "TPU", "." ]
def _full_name(self): """Returns the full Cloud name for this TPU.""" return 'projects/%s/locations/%s/nodes/%s' % ( self._project, self._zone, self._tpu)
[ "def", "_full_name", "(", "self", ")", ":", "return", "'projects/%s/locations/%s/nodes/%s'", "%", "(", "self", ".", "_project", ",", "self", ".", "_zone", ",", "self", ".", "_tpu", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/client/client.py#L250-L253
mamedev/mame
02cd26d37ee11191f3e311e19e805d872cb1e3a4
3rdparty/portmidi/pm_python/pyportmidi/midi.py
python
init
()
initialize the midi module pyportmidi.init(): return None Call the initialisation function before using the midi module. It is safe to call this more than once.
initialize the midi module pyportmidi.init(): return None Call the initialisation function before using the midi module. It is safe to call this more than once.
[ "initialize", "the", "midi", "module", "pyportmidi", ".", "init", "()", ":", "return", "None", "Call", "the", "initialisation", "function", "before", "using", "the", "midi", "module", ".", "It", "is", "safe", "to", "call", "this", "more", "than", "once", "...
def init(): """initialize the midi module pyportmidi.init(): return None Call the initialisation function before using the midi module. It is safe to call this more than once. """ global _init, _pypm if not _init: import pyportmidi._pyportmidi _pypm = pyportmidi._py...
[ "def", "init", "(", ")", ":", "global", "_init", ",", "_pypm", "if", "not", "_init", ":", "import", "pyportmidi", ".", "_pyportmidi", "_pypm", "=", "pyportmidi", ".", "_pyportmidi", "_pypm", ".", "Initialize", "(", ")", "_init", "=", "True", "atexit", "....
https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/portmidi/pm_python/pyportmidi/midi.py#L36-L51
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py
python
getitem
(a, b)
return a[b]
Same as a[b].
Same as a[b].
[ "Same", "as", "a", "[", "b", "]", "." ]
def getitem(a, b): "Same as a[b]." return a[b]
[ "def", "getitem", "(", "a", ",", "b", ")", ":", "return", "a", "[", "b", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L169-L171
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathProfile.py
python
ObjectProfile._extractPathWire
(self, obj, base, flatWire, cutShp)
return rtnWIRES
if self.isDebug: PathLog.debug('min0i is {}.'.format(min0i)) PathLog.debug('min1i is {}.'.format(min1i)) PathLog.debug('NEAR0[{}] is {}.'.format(w0, NEAR0[w0])) PathLog.debug('NEAR1[{}] is {}.'.format(w1, NEAR1[w1])) PathLog.debug('NEAR0 is {}.'.format(NEAR0))...
if self.isDebug: PathLog.debug('min0i is {}.'.format(min0i)) PathLog.debug('min1i is {}.'.format(min1i)) PathLog.debug('NEAR0[{}] is {}.'.format(w0, NEAR0[w0])) PathLog.debug('NEAR1[{}] is {}.'.format(w1, NEAR1[w1])) PathLog.debug('NEAR0 is {}.'.format(NEAR0))...
[ "if", "self", ".", "isDebug", ":", "PathLog", ".", "debug", "(", "min0i", "is", "{}", ".", ".", "format", "(", "min0i", "))", "PathLog", ".", "debug", "(", "min1i", "is", "{}", ".", ".", "format", "(", "min1i", "))", "PathLog", ".", "debug", "(", ...
def _extractPathWire(self, obj, base, flatWire, cutShp): PathLog.debug("_extractPathWire()") subLoops = [] rtnWIRES = [] osWrIdxs = [] subDistFactor = ( 1.0 # Raise to include sub wires at greater distance from original ) fdv = obj.FinalDepth.Value ...
[ "def", "_extractPathWire", "(", "self", ",", "obj", ",", "base", ",", "flatWire", ",", "cutShp", ")", ":", "PathLog", ".", "debug", "(", "\"_extractPathWire()\"", ")", "subLoops", "=", "[", "]", "rtnWIRES", "=", "[", "]", "osWrIdxs", "=", "[", "]", "su...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathProfile.py#L894-L1030
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/ipk.py
python
build_specfiles
(source, target, env)
return 0
Filter the targets for the needed files and use the variables in env to create the specfile.
Filter the targets for the needed files and use the variables in env to create the specfile.
[ "Filter", "the", "targets", "for", "the", "needed", "files", "and", "use", "the", "variables", "in", "env", "to", "create", "the", "specfile", "." ]
def build_specfiles(source, target, env): """ Filter the targets for the needed files and use the variables in env to create the specfile. """ # # At first we care for the CONTROL/control file, which is the main file for ipk. # # For this we need to open multiple files in random order, so we...
[ "def", "build_specfiles", "(", "source", ",", "target", ",", "env", ")", ":", "#", "# At first we care for the CONTROL/control file, which is the main file for ipk.", "#", "# For this we need to open multiple files in random order, so we store into", "# a dict so they can be easily acces...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/ipk.py#L108-L183
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/predictor/python/model.py
python
RnnModel.parse
(self, filename)
return feature, label, need_init
parse the file and get the encoded features :param filename: the path of file to parse :return: feature: the features for training label: the labels for training need_init: whether the model need init
parse the file and get the encoded features :param filename: the path of file to parse :return: feature: the features for training label: the labels for training need_init: whether the model need init
[ "parse", "the", "file", "and", "get", "the", "encoded", "features", ":", "param", "filename", ":", "the", "path", "of", "file", "to", "parse", ":", "return", ":", "feature", ":", "the", "features", "for", "training", "label", ":", "the", "labels", "for",...
def parse(self, filename): ''' parse the file and get the encoded features :param filename: the path of file to parse :return: feature: the features for training label: the labels for training need_init: whether the model need init ''' pa...
[ "def", "parse", "(", "self", ",", "filename", ")", ":", "parser", "=", "FeatureParser", "(", "self", ".", "model_info", ",", "filename", ")", "feature_length", ",", "arr_enc", ",", "arr_child", ",", "arr_startup", ",", "arr_total", ",", "arr_row", ",", "ar...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/predictor/python/model.py#L464-L520
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/detector2dview.py
python
Detector2DView.on_mouse_press_event
(self, event)
return
:param event: :return:
[]
def on_mouse_press_event(self, event): """ :param event: :return: """ # return if the cursor position is out of canvas if event.xdata is None or event.ydata is None: return # update mouse' position self._currX = event.xdata self._curr...
[ "def", "on_mouse_press_event", "(", "self", ",", "event", ")", ":", "# return if the cursor position is out of canvas", "if", "event", ".", "xdata", "is", "None", "or", "event", ".", "ydata", "is", "None", ":", "return", "# update mouse' position", "self", ".", "_...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/detector2dview.py#L310-L335
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewCtrl.ExpandAncestors
(*args, **kwargs)
return _dataview.DataViewCtrl_ExpandAncestors(*args, **kwargs)
ExpandAncestors(self, DataViewItem item)
ExpandAncestors(self, DataViewItem item)
[ "ExpandAncestors", "(", "self", "DataViewItem", "item", ")" ]
def ExpandAncestors(*args, **kwargs): """ExpandAncestors(self, DataViewItem item)""" return _dataview.DataViewCtrl_ExpandAncestors(*args, **kwargs)
[ "def", "ExpandAncestors", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_ExpandAncestors", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L1800-L1802
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
backends/ebpf/targets/ebpfenv.py
python
Bridge.ns_proc_append
(self, proc, cmd)
return self.ns_proc_write(proc, " && " + cmd)
Append a command to an open process.
Append a command to an open process.
[ "Append", "a", "command", "to", "an", "open", "process", "." ]
def ns_proc_append(self, proc, cmd): """ Append a command to an open process. """ return self.ns_proc_write(proc, " && " + cmd)
[ "def", "ns_proc_append", "(", "self", ",", "proc", ",", "cmd", ")", ":", "return", "self", ".", "ns_proc_write", "(", "proc", ",", "\" && \"", "+", "cmd", ")" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/backends/ebpf/targets/ebpfenv.py#L86-L88
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/control_flow_ops.py
python
WhileContext.AddValue
(self, val)
return result
Add `val` to the current context and its outer context recursively.
Add `val` to the current context and its outer context recursively.
[ "Add", "val", "to", "the", "current", "context", "and", "its", "outer", "context", "recursively", "." ]
def AddValue(self, val): """Add `val` to the current context and its outer context recursively.""" result = val if val.name not in self._values: self._values.add(val.name) # If we are in a grad context and val is from its forward context, # use GetRealValue(), which adds the logic to save...
[ "def", "AddValue", "(", "self", ",", "val", ")", ":", "result", "=", "val", "if", "val", ".", "name", "not", "in", "self", ".", "_values", ":", "self", ".", "_values", ".", "add", "(", "val", ".", "name", ")", "# If we are in a grad context and val is fr...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/control_flow_ops.py#L2089-L2132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/numbers.py
python
real_sign_impl
(context, builder, sig, args)
return impl_ret_untracked(context, builder, sig.return_type, res)
np.sign(float)
np.sign(float)
[ "np", ".", "sign", "(", "float", ")" ]
def real_sign_impl(context, builder, sig, args): """ np.sign(float) """ [x] = args POS = Constant.real(x.type, 1) NEG = Constant.real(x.type, -1) ZERO = Constant.real(x.type, 0) presult = cgutils.alloca_once(builder, x.type) is_pos = builder.fcmp(lc.FCMP_OGT, x, ZERO) is_neg = ...
[ "def", "real_sign_impl", "(", "context", ",", "builder", ",", "sig", ",", "args", ")", ":", "[", "x", "]", "=", "args", "POS", "=", "Constant", ".", "real", "(", "x", ".", "type", ",", "1", ")", "NEG", "=", "Constant", ".", "real", "(", "x", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/numbers.py#L869-L896
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/qt4.py
python
apply_qt4
(self)
Add MOC_FLAGS which may be necessary for moc:: def build(bld): bld.program(features='qt4', source='main.cpp', target='app', use='QTCORE') The additional parameters are: :param lang: list of translation files (\*.ts) to process :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extensi...
Add MOC_FLAGS which may be necessary for moc::
[ "Add", "MOC_FLAGS", "which", "may", "be", "necessary", "for", "moc", "::" ]
def apply_qt4(self): """ Add MOC_FLAGS which may be necessary for moc:: def build(bld): bld.program(features='qt4', source='main.cpp', target='app', use='QTCORE') The additional parameters are: :param lang: list of translation files (\*.ts) to process :type lang: list of :py:class:`waflib.Node.Node` or str...
[ "def", "apply_qt4", "(", "self", ")", ":", "if", "getattr", "(", "self", ",", "'lang'", ",", "None", ")", ":", "qmtasks", "=", "[", "]", "for", "x", "in", "self", ".", "to_list", "(", "self", ".", "lang", ")", ":", "if", "isinstance", "(", "x", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/qt4.py#L311-L358
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py
python
SourceRange.__contains__
(self, other)
return False
Useful to detect the Token/Lexer bug
Useful to detect the Token/Lexer bug
[ "Useful", "to", "detect", "the", "Token", "/", "Lexer", "bug" ]
def __contains__(self, other): """Useful to detect the Token/Lexer bug""" if not isinstance(other, SourceLocation): return False if other.file is None and self.start.file is None: pass elif ( self.start.file.name != other.file.name or other.file.nam...
[ "def", "__contains__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "SourceLocation", ")", ":", "return", "False", "if", "other", ".", "file", "is", "None", "and", "self", ".", "start", ".", "file", "is", "None", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L269-L290
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/autograd.py
python
asin
(x)
return Asin()(x)[0]
Calculates the arcsine (inverse of sine) of the given input tensor, element-wise. Args: x (Tensor): Input tensor Returns: Tensor, the output
Calculates the arcsine (inverse of sine) of the given input tensor, element-wise. Args: x (Tensor): Input tensor Returns: Tensor, the output
[ "Calculates", "the", "arcsine", "(", "inverse", "of", "sine", ")", "of", "the", "given", "input", "tensor", "element", "-", "wise", ".", "Args", ":", "x", "(", "Tensor", ")", ":", "Input", "tensor", "Returns", ":", "Tensor", "the", "output" ]
def asin(x): """ Calculates the arcsine (inverse of sine) of the given input tensor, element-wise. Args: x (Tensor): Input tensor Returns: Tensor, the output """ return Asin()(x)[0]
[ "def", "asin", "(", "x", ")", ":", "return", "Asin", "(", ")", "(", "x", ")", "[", "0", "]" ]
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L2265-L2274
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
plant-lighting-system/python/iot_plant_lighting_system/runner.py
python
Runner.serve_index
(self)
return output
Serve the 'index.html' file.
Serve the 'index.html' file.
[ "Serve", "the", "index", ".", "html", "file", "." ]
def serve_index(self): """ Serve the 'index.html' file. """ output = template("index", moisture=self.moisture) return output
[ "def", "serve_index", "(", "self", ")", ":", "output", "=", "template", "(", "\"index\"", ",", "moisture", "=", "self", ".", "moisture", ")", "return", "output" ]
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/plant-lighting-system/python/iot_plant_lighting_system/runner.py#L152-L159
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
Geometry3D.setGroup
(self)
return _robotsim.Geometry3D_setGroup(self)
r""" setGroup(Geometry3D self) Sets this Geometry3D to a group geometry. To add sub-geometries, repeatedly call setElement() with increasing indices.
r""" setGroup(Geometry3D self)
[ "r", "setGroup", "(", "Geometry3D", "self", ")" ]
def setGroup(self) -> "void": r""" setGroup(Geometry3D self) Sets this Geometry3D to a group geometry. To add sub-geometries, repeatedly call setElement() with increasing indices. """ return _robotsim.Geometry3D_setGroup(self)
[ "def", "setGroup", "(", "self", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "Geometry3D_setGroup", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2238-L2247
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
PythonAPI/examples/rss/rss_visualization.py
python
RssUnstructuredSceneVisualizer.transform_points
(world_cords, camera_transform, calibration)
return line_to_draw
Returns trajectory set projected to camera view
Returns trajectory set projected to camera view
[ "Returns", "trajectory", "set", "projected", "to", "camera", "view" ]
def transform_points(world_cords, camera_transform, calibration): """ Returns trajectory set projected to camera view """ world_cords = np.transpose(world_cords) cords_x_y_z = RssUnstructuredSceneVisualizer._world_to_sensor(world_cords, camera_transform)[:3, :] cords_y_mi...
[ "def", "transform_points", "(", "world_cords", ",", "camera_transform", ",", "calibration", ")", ":", "world_cords", "=", "np", ".", "transpose", "(", "world_cords", ")", "cords_x_y_z", "=", "RssUnstructuredSceneVisualizer", ".", "_world_to_sensor", "(", "world_cords"...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/rss/rss_visualization.py#L377-L389
acado/acado
b4e28f3131f79cadfd1a001e9fff061f361d3a0f
misc/cpplint.py
python
CheckSpacingForFunctionCall
(filename, line, linenum, error)
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for the correctness of various spacing around function calls.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
def CheckSpacingForFunctionCall(filename, line, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any ...
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "line", ",", "linenum", ",", "error", ")", ":", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have their own, more liberal conventions - we", "# first see if we should be looking inside ...
https://github.com/acado/acado/blob/b4e28f3131f79cadfd1a001e9fff061f361d3a0f/misc/cpplint.py#L2193-L2258
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py
python
AutoScaleConnection.detach_instances
(self, name, instance_ids, decrement_capacity=True)
return self.get_status('DetachInstances', params)
Detach instances from an Auto Scaling group. :type name: str :param name: The name of the Auto Scaling group from which to detach instances. :type instance_ids: list :param instance_ids: Instance ids to be detached from the Auto Scaling group. :type decrement_capacity: bool ...
Detach instances from an Auto Scaling group.
[ "Detach", "instances", "from", "an", "Auto", "Scaling", "group", "." ]
def detach_instances(self, name, instance_ids, decrement_capacity=True): """ Detach instances from an Auto Scaling group. :type name: str :param name: The name of the Auto Scaling group from which to detach instances. :type instance_ids: list :param instance_ids: Instan...
[ "def", "detach_instances", "(", "self", ",", "name", ",", "instance_ids", ",", "decrement_capacity", "=", "True", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "name", "}", "params", "[", "'ShouldDecrementDesiredCapacity'", "]", "=", "'true'", "if...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py#L195-L214
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/__init__.py
python
ToolInitializerMethod.get_builder
(self, env)
return builder
Returns the appropriate real Builder for this method name after having the associated ToolInitializer object apply the appropriate Tool module.
Returns the appropriate real Builder for this method name after having the associated ToolInitializer object apply the appropriate Tool module.
[ "Returns", "the", "appropriate", "real", "Builder", "for", "this", "method", "name", "after", "having", "the", "associated", "ToolInitializer", "object", "apply", "the", "appropriate", "Tool", "module", "." ]
def get_builder(self, env): """ Returns the appropriate real Builder for this method name after having the associated ToolInitializer object apply the appropriate Tool module. """ builder = getattr(env, self.__name__) self.initializer.apply_tools(env) bu...
[ "def", "get_builder", "(", "self", ",", "env", ")", ":", "builder", "=", "getattr", "(", "env", ",", "self", ".", "__name__", ")", "self", ".", "initializer", ".", "apply_tools", "(", "env", ")", "builder", "=", "getattr", "(", "env", ",", "self", "....
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/__init__.py#L574-L594
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ComboBox.SetStringSelection
(*args, **kwargs)
return _controls_.ComboBox_SetStringSelection(*args, **kwargs)
SetStringSelection(self, String string) -> bool Select the item with the specifed string
SetStringSelection(self, String string) -> bool
[ "SetStringSelection", "(", "self", "String", "string", ")", "-", ">", "bool" ]
def SetStringSelection(*args, **kwargs): """ SetStringSelection(self, String string) -> bool Select the item with the specifed string """ return _controls_.ComboBox_SetStringSelection(*args, **kwargs)
[ "def", "SetStringSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ComboBox_SetStringSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L661-L667
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/parse.py
python
splitquery
(url)
return url, None
splitquery('/path?query') --> '/path', 'query'.
splitquery('/path?query') --> '/path', 'query'.
[ "splitquery", "(", "/", "path?query", ")", "--", ">", "/", "path", "query", "." ]
def splitquery(url): """splitquery('/path?query') --> '/path', 'query'.""" path, delim, query = url.rpartition('?') if delim: return path, query return url, None
[ "def", "splitquery", "(", "url", ")", ":", "path", ",", "delim", ",", "query", "=", "url", ".", "rpartition", "(", "'?'", ")", "if", "delim", ":", "return", "path", ",", "query", "return", "url", ",", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/parse.py#L1054-L1059
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/state_management.py
python
_OverridableStateManager.define_loss
(self, model, features, mode)
Switches between explicit start state and managed state.
Switches between explicit start state and managed state.
[ "Switches", "between", "explicit", "start", "state", "and", "managed", "state", "." ]
def define_loss(self, model, features, mode): """Switches between explicit start state and managed state.""" if feature_keys.FilteringFeatures.STATE_TUPLE in features: # Explicit start state has been provided, so we should use that. if mode == estimator_lib.ModeKeys.TRAIN: raise ValueError( ...
[ "def", "define_loss", "(", "self", ",", "model", ",", "features", ",", "mode", ")", ":", "if", "feature_keys", ".", "FilteringFeatures", ".", "STATE_TUPLE", "in", "features", ":", "# Explicit start state has been provided, so we should use that.", "if", "mode", "==", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_management.py#L77-L93
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_CertifyCreation_REQUEST.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPM2_CertifyCreation_REQUEST)
Returns new TPM2_CertifyCreation_REQUEST object constructed from its marshaled representation in the given byte buffer
Returns new TPM2_CertifyCreation_REQUEST object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPM2_CertifyCreation_REQUEST", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPM2_CertifyCreation_REQUEST object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPM2_CertifyCreation_REQUEST)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPM2_CertifyCreation_REQUEST", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L12570-L12574
lyxok1/Tiny-DSOD
94d15450699bea0dd3720e75e2d273e476174fba
scripts/cpp_lint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L703-L705
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/benchmark/mingw.py
python
find_7zip
(log = EmptyLogger())
return path[0]
Attempts to find 7zip for unpacking the mingw-build archives
Attempts to find 7zip for unpacking the mingw-build archives
[ "Attempts", "to", "find", "7zip", "for", "unpacking", "the", "mingw", "-", "build", "archives" ]
def find_7zip(log = EmptyLogger()): ''' Attempts to find 7zip for unpacking the mingw-build archives ''' log.info('finding 7zip') path = find_in_path('7z') if not path: key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\7-Zip') path, _ = winreg.QueryValueEx(key, 'Path') ...
[ "def", "find_7zip", "(", "log", "=", "EmptyLogger", "(", ")", ")", ":", "log", ".", "info", "(", "'finding 7zip'", ")", "path", "=", "find_in_path", "(", "'7z'", ")", "if", "not", "path", ":", "key", "=", "winreg", ".", "OpenKey", "(", "winreg", ".",...
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/benchmark/mingw.py#L99-L110
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/linalg_grad.py
python
_MatrixDeterminantGrad
(op, grad)
return grad * c * a_adj_inv
Gradient for MatrixDeterminant.
Gradient for MatrixDeterminant.
[ "Gradient", "for", "MatrixDeterminant", "." ]
def _MatrixDeterminantGrad(op, grad): """Gradient for MatrixDeterminant.""" a = op.inputs[0] c = op.outputs[0] a_adj_inv = linalg_ops.matrix_inverse(a, adjoint=True) return grad * c * a_adj_inv
[ "def", "_MatrixDeterminantGrad", "(", "op", ",", "grad", ")", ":", "a", "=", "op", ".", "inputs", "[", "0", "]", "c", "=", "op", ".", "outputs", "[", "0", "]", "a_adj_inv", "=", "linalg_ops", ".", "matrix_inverse", "(", "a", ",", "adjoint", "=", "T...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/linalg_grad.py#L66-L71
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.sourceview_hovering_link_get_tooltip
(self, link)
return tooltip
Get the tooltip for the underlying link
Get the tooltip for the underlying link
[ "Get", "the", "tooltip", "for", "the", "underlying", "link" ]
def sourceview_hovering_link_get_tooltip(self, link): """Get the tooltip for the underlying link""" tooltip = "" vector = link.split() if vector[0] in [cons.LINK_TYPE_FILE, cons.LINK_TYPE_FOLD]: tooltip = unicode(base64.b64decode(vector[1]), cons.STR_UTF8, cons.STR_IGNORE) ...
[ "def", "sourceview_hovering_link_get_tooltip", "(", "self", ",", "link", ")", ":", "tooltip", "=", "\"\"", "vector", "=", "link", ".", "split", "(", ")", "if", "vector", "[", "0", "]", "in", "[", "cons", ".", "LINK_TYPE_FILE", ",", "cons", ".", "LINK_TYP...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L4996-L5010
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_transport.py
python
SASL.config_path
(self, path: str)
Set the SASL configuration path. This is used to tell SASL where to look for the configuration file. In the current implementation it can be a colon separated list of directories. The environment variable ``PN_SASL_CONFIG_PATH`` can also be used to set this path, but if both methods are...
Set the SASL configuration path. This is used to tell SASL where to look for the configuration file. In the current implementation it can be a colon separated list of directories.
[ "Set", "the", "SASL", "configuration", "path", ".", "This", "is", "used", "to", "tell", "SASL", "where", "to", "look", "for", "the", "configuration", "file", ".", "In", "the", "current", "implementation", "it", "can", "be", "a", "colon", "separated", "list...
def config_path(self, path: str): """ Set the SASL configuration path. This is used to tell SASL where to look for the configuration file. In the current implementation it can be a colon separated list of directories. The environment variable ``PN_SASL_CONFIG_PATH`` can also be ...
[ "def", "config_path", "(", "self", ",", "path", ":", "str", ")", ":", "pn_sasl_config_path", "(", "self", ".", "_sasl", ",", "path", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_transport.py#L678-L693
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/msvs.py
python
compile_template
(line)
return Task.funex(fun)
Compile a template expression into a python function (like jsps, but way shorter)
Compile a template expression into a python function (like jsps, but way shorter)
[ "Compile", "a", "template", "expression", "into", "a", "python", "function", "(", "like", "jsps", "but", "way", "shorter", ")" ]
def compile_template(line): """ Compile a template expression into a python function (like jsps, but way shorter) """ extr = [] def repl(match): g = match.group if g('dollar'): return "$" elif g('backslash'): return "\\" elif g('subst'): extr.append(g('code')) return "<<|@|>>" return None line...
[ "def", "compile_template", "(", "line", ")", ":", "extr", "=", "[", "]", "def", "repl", "(", "match", ")", ":", "g", "=", "match", ".", "group", "if", "g", "(", "'dollar'", ")", ":", "return", "\"$\"", "elif", "g", "(", "'backslash'", ")", ":", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/msvs.py#L275-L330
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/util/__init__.py
python
value_to_jam
(value, methods=False)
return exported_name
Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually call back to virtual_target.add_suffix_and_...
Makes a token to refer to a Python value inside Jam language code.
[ "Makes", "a", "token", "to", "refer", "to", "a", "Python", "value", "inside", "Jam", "language", "code", "." ]
def value_to_jam(value, methods=False): """Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually ...
[ "def", "value_to_jam", "(", "value", ",", "methods", "=", "False", ")", ":", "global", "__value_id", "r", "=", "__python_to_jam", ".", "get", "(", "value", ",", "None", ")", "if", "r", ":", "return", "r", "exported_name", "=", "'###_'", "+", "str", "("...
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/util/__init__.py#L228-L261
danxuhk/ContinuousCRF-CNN
2b6dcaf179620f118b225ed12c890414ca828e21
scripts/cpp_lint.py
python
CheckLanguage
(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error)
Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum:...
Checks rules from the 'C++ language rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "language", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
[ "def", "CheckLanguage", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "include_state", ",", "nesting_state", ",", "error", ")", ":", "# If the line is empty or consists of entirely a comment, no need to", "# check it.", "line", "=", "cle...
https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L3838-L4136
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGGetFailed
(*args, **kwargs)
return _propgrid.PGGetFailed(*args, **kwargs)
PGGetFailed(PGProperty p, String typestr)
PGGetFailed(PGProperty p, String typestr)
[ "PGGetFailed", "(", "PGProperty", "p", "String", "typestr", ")" ]
def PGGetFailed(*args, **kwargs): """PGGetFailed(PGProperty p, String typestr)""" return _propgrid.PGGetFailed(*args, **kwargs)
[ "def", "PGGetFailed", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGGetFailed", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1085-L1087
DLR-SC/tigl
d1c5901e948e33d10b1f9659ff3e22c4717b455f
thirdparty/nsiqcppstyle/nsiqcppstyle_checker.py
python
CppLexerNavigator.PeekNextTokenSkipWhiteSpaceAndCommentAndPreprocess
(self, offset = 1)
return token
Get Next Token skip whitespace, comment and preprocess. This method doesn't change the current lex position.
Get Next Token skip whitespace, comment and preprocess. This method doesn't change the current lex position.
[ "Get", "Next", "Token", "skip", "whitespace", "comment", "and", "preprocess", ".", "This", "method", "doesn", "t", "change", "the", "current", "lex", "position", "." ]
def PeekNextTokenSkipWhiteSpaceAndCommentAndPreprocess(self, offset = 1): """ Get Next Token skip whitespace, comment and preprocess. This method doesn't change the current lex position. """ self.PushTokenIndex() token = None for x in range(offset) : #@UnusedVaria...
[ "def", "PeekNextTokenSkipWhiteSpaceAndCommentAndPreprocess", "(", "self", ",", "offset", "=", "1", ")", ":", "self", ".", "PushTokenIndex", "(", ")", "token", "=", "None", "for", "x", "in", "range", "(", "offset", ")", ":", "#@UnusedVariable", "token", "=", ...
https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/nsiqcppstyle/nsiqcppstyle_checker.py#L447-L457
daijifeng001/caffe-rfcn
543f8f6a4b7c88256ea1445ae951a12d1ad9cffd
python/caffe/draw.py
python
get_layer_label
(layer, rankdir)
return node_label
Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer
Define node label based on layer type.
[ "Define", "node", "label", "based", "on", "layer", "type", "." ]
def get_layer_label(layer, rankdir): """Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer """ if rankdir in ('TB', 'BT'): ...
[ "def", "get_layer_label", "(", "layer", ",", "rankdir", ")", ":", "if", "rankdir", "in", "(", "'TB'", ",", "'BT'", ")", ":", "# If graph orientation is vertical, horizontal space is free and", "# vertical space is not; separate words with spaces", "separator", "=", "' '", ...
https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/python/caffe/draw.py#L62-L114
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
plugins/wb.admin/backend/wb_admin_perfschema_instrumentation_be.py
python
PSInstruments._get_changes_recursive
(self, path, data, changes, attr)
Retrieves the minimal change sets done on a specific attribute of the instruments.
Retrieves the minimal change sets done on a specific attribute of the instruments.
[ "Retrieves", "the", "minimal", "change", "sets", "done", "on", "a", "specific", "attribute", "of", "the", "instruments", "." ]
def _get_changes_recursive(self, path, data, changes, attr): """ Retrieves the minimal change sets done on a specific attribute of the instruments. """ for item in list(data.keys()): # If there are changes if data[item].changes[attr]: new_p...
[ "def", "_get_changes_recursive", "(", "self", ",", "path", ",", "data", ",", "changes", ",", "attr", ")", ":", "for", "item", "in", "list", "(", "data", ".", "keys", "(", ")", ")", ":", "# If there are changes", "if", "data", "[", "item", "]", ".", "...
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_admin_perfschema_instrumentation_be.py#L257-L282
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/util/set.py
python
difference
(b, a)
return result
Returns the elements of B that are not in A.
Returns the elements of B that are not in A.
[ "Returns", "the", "elements", "of", "B", "that", "are", "not", "in", "A", "." ]
def difference (b, a): """ Returns the elements of B that are not in A. """ a = set(a) result = [] for item in b: if item not in a: result.append(item) return result
[ "def", "difference", "(", "b", ",", "a", ")", ":", "a", "=", "set", "(", "a", ")", "result", "=", "[", "]", "for", "item", "in", "b", ":", "if", "item", "not", "in", "a", ":", "result", ".", "append", "(", "item", ")", "return", "result" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/util/set.py#L10-L18
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/boringssl/src/util/bot/go/bootstrap.py
python
check_hello_world
(toolset_root)
Compiles and runs 'hello world' program to verify that toolset works.
Compiles and runs 'hello world' program to verify that toolset works.
[ "Compiles", "and", "runs", "hello", "world", "program", "to", "verify", "that", "toolset", "works", "." ]
def check_hello_world(toolset_root): """Compiles and runs 'hello world' program to verify that toolset works.""" with temp_dir(toolset_root) as tmp: path = os.path.join(tmp, 'hello.go') write_file([path], r""" package main func main() { println("hello, world\n") } """) out = subproce...
[ "def", "check_hello_world", "(", "toolset_root", ")", ":", "with", "temp_dir", "(", "toolset_root", ")", "as", "tmp", ":", "path", "=", "os", ".", "path", ".", "join", "(", "tmp", ",", "'hello.go'", ")", "write_file", "(", "[", "path", "]", ",", "r\"\"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/boringssl/src/util/bot/go/bootstrap.py#L166-L181
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/special/orthogonal.py
python
la_roots
(n, alpha, mu=False)
return _gen_roots_and_weights(m, mu0, an_func, bn_func, f, df, False, mu)
r"""Gauss-generalized Laguerre quadrature. Computes the sample points and weights for Gauss-generalized Laguerre quadrature. The sample points are the roots of the n-th degree generalized Laguerre polynomial, :math:`L^{\alpha}_n(x)`. These sample points and weights correctly integrate polynomials of d...
r"""Gauss-generalized Laguerre quadrature.
[ "r", "Gauss", "-", "generalized", "Laguerre", "quadrature", "." ]
def la_roots(n, alpha, mu=False): r"""Gauss-generalized Laguerre quadrature. Computes the sample points and weights for Gauss-generalized Laguerre quadrature. The sample points are the roots of the n-th degree generalized Laguerre polynomial, :math:`L^{\alpha}_n(x)`. These sample points and weight...
[ "def", "la_roots", "(", "n", ",", "alpha", ",", "mu", "=", "False", ")", ":", "m", "=", "int", "(", "n", ")", "if", "n", "<", "1", "or", "n", "!=", "m", ":", "raise", "ValueError", "(", "\"n must be a positive integer.\"", ")", "if", "alpha", "<", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/orthogonal.py#L436-L490
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py
python
__select_builder
(lxml_builder, libxml2_builder, cmdline_builder)
return libxml2_builder
Selects a builder, based on which Python modules are present.
Selects a builder, based on which Python modules are present.
[ "Selects", "a", "builder", "based", "on", "which", "Python", "modules", "are", "present", "." ]
def __select_builder(lxml_builder, libxml2_builder, cmdline_builder): """ Selects a builder, based on which Python modules are present. """ if prefer_xsltproc: return cmdline_builder if not has_libxml2: # At the moment we prefer libxml2 over lxml, the latter can lead # to confli...
[ "def", "__select_builder", "(", "lxml_builder", ",", "libxml2_builder", ",", "cmdline_builder", ")", ":", "if", "prefer_xsltproc", ":", "return", "cmdline_builder", "if", "not", "has_libxml2", ":", "# At the moment we prefer libxml2 over lxml, the latter can lead", "# to conf...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py#L98-L111
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/timeit.py
python
Timer.timeit
(self, number=default_number)
return timing
Time 'number' executions of the main statement. To be precise, this executes the setup statement once, and then returns the time it takes to execute the main statement a number of times, as a float measured in seconds. The argument is the number of times through the loop, defaulting ...
Time 'number' executions of the main statement.
[ "Time", "number", "executions", "of", "the", "main", "statement", "." ]
def timeit(self, number=default_number): """Time 'number' executions of the main statement. To be precise, this executes the setup statement once, and then returns the time it takes to execute the main statement a number of times, as a float measured in seconds. The argument is...
[ "def", "timeit", "(", "self", ",", "number", "=", "default_number", ")", ":", "it", "=", "itertools", ".", "repeat", "(", "None", ",", "number", ")", "gcold", "=", "gc", ".", "isenabled", "(", ")", "gc", ".", "disable", "(", ")", "try", ":", "timin...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/timeit.py#L163-L181
libornovax/master_thesis_code
6eca474ed3cae673afde010caef338cf7349f839
scripts/compute_mde_curve.py
python
MDEPlotter.save_plot
(self, path_out)
Saves the current plot to PDF, PNG and CSV. Input: path_out: Path to the output file(s) (without extension)
Saves the current plot to PDF, PNG and CSV.
[ "Saves", "the", "current", "plot", "to", "PDF", "PNG", "and", "CSV", "." ]
def save_plot(self, path_out): """ Saves the current plot to PDF, PNG and CSV. Input: path_out: Path to the output file(s) (without extension) """ # Reference methods plt.plot(self.thresholds_x, [1.55, 1.7, 2.6, 4.25, 6.5], label='SubCNN', color='#FF3300', linewidth=2, linestyle='--') plt.errorbar(sel...
[ "def", "save_plot", "(", "self", ",", "path_out", ")", ":", "# Reference methods", "plt", ".", "plot", "(", "self", ".", "thresholds_x", ",", "[", "1.55", ",", "1.7", ",", "2.6", ",", "4.25", ",", "6.5", "]", ",", "label", "=", "'SubCNN'", ",", "colo...
https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/compute_mde_curve.py#L333-L367
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
Grid.EnableCellEditControl
(*args, **kwargs)
return _grid.Grid_EnableCellEditControl(*args, **kwargs)
EnableCellEditControl(self, bool enable=True)
EnableCellEditControl(self, bool enable=True)
[ "EnableCellEditControl", "(", "self", "bool", "enable", "=", "True", ")" ]
def EnableCellEditControl(*args, **kwargs): """EnableCellEditControl(self, bool enable=True)""" return _grid.Grid_EnableCellEditControl(*args, **kwargs)
[ "def", "EnableCellEditControl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_EnableCellEditControl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1346-L1348
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/extensions.py
python
extension_to_message
(extension: message.Message, message_cls: Type[_T])
return msg
Serializes a provided FHIR extension into a message of type message_cls. This function is a convenience wrapper around add_extension_to_message. Args: extension: The FHIR extension to serialize. message_cls: The type of protobuf message to serialize extension to. Returns: A message of type message_...
Serializes a provided FHIR extension into a message of type message_cls.
[ "Serializes", "a", "provided", "FHIR", "extension", "into", "a", "message", "of", "type", "message_cls", "." ]
def extension_to_message(extension: message.Message, message_cls: Type[_T]) -> _T: """Serializes a provided FHIR extension into a message of type message_cls. This function is a convenience wrapper around add_extension_to_message. Args: extension: The FHIR extension to serialize. ...
[ "def", "extension_to_message", "(", "extension", ":", "message", ".", "Message", ",", "message_cls", ":", "Type", "[", "_T", "]", ")", "->", "_T", ":", "msg", "=", "message_cls", "(", ")", "add_extension_to_message", "(", "extension", ",", "msg", ")", "ret...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/extensions.py#L249-L264
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pipeline/pipeline/pipeline.py
python
_PipelineContext.evaluate
(self, pipeline_key, purpose=None, attempt=0)
Evaluates the given Pipeline and enqueues sub-stages for execution. Args: pipeline_key: The db.Key or stringified key of the _PipelineRecord to run. purpose: Why evaluate was called ('start', 'finalize', or 'abort'). attempt: The attempt number that should be tried.
Evaluates the given Pipeline and enqueues sub-stages for execution.
[ "Evaluates", "the", "given", "Pipeline", "and", "enqueues", "sub", "-", "stages", "for", "execution", "." ]
def evaluate(self, pipeline_key, purpose=None, attempt=0): """Evaluates the given Pipeline and enqueues sub-stages for execution. Args: pipeline_key: The db.Key or stringified key of the _PipelineRecord to run. purpose: Why evaluate was called ('start', 'finalize', or 'abort'). attempt: The a...
[ "def", "evaluate", "(", "self", ",", "pipeline_key", ",", "purpose", "=", "None", ",", "attempt", "=", "0", ")", ":", "After", ".", "_thread_init", "(", ")", "InOrder", ".", "_thread_init", "(", ")", "InOrder", ".", "_local", ".", "_activated", "=", "F...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pipeline/pipeline/pipeline.py#L1984-L2347
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_interp.py
python
concrete_post
(update, state, expr = None)
return res
Apply an update concretely (compute concrete post). ".
Apply an update concretely (compute concrete post). ".
[ "Apply", "an", "update", "concretely", "(", "compute", "concrete", "post", ")", ".", "." ]
def concrete_post(update, state, expr = None): """ Apply an update concretely (compute concrete post). ". """ # TODO: axioms could change as scope changes axioms = state.domain.background_theory(state.in_scope) # print "concrete post: axioms = {}".format(axioms) cons = compose_state_action(s...
[ "def", "concrete_post", "(", "update", ",", "state", ",", "expr", "=", "None", ")", ":", "# TODO: axioms could change as scope changes", "axioms", "=", "state", ".", "domain", ".", "background_theory", "(", "state", ".", "in_scope", ")", "# print \"concrete post:...
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_interp.py#L194-L206
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/python_version/optimization.py
python
_ScipyOptimizerWrapper._optimize_core
(self, **kwargs)
Should return an unshaped point corresponding to the output of the optimizer function from scipy. See :func:`~moe.optimal_learning.python.python_version.optimization.LBFGSOptimizer._optimize_core` or :func:`~moe.optimal_learning.python.python_version.optimization.COBYLAOptimizer._optimize_core` functio...
Should return an unshaped point corresponding to the output of the optimizer function from scipy.
[ "Should", "return", "an", "unshaped", "point", "corresponding", "to", "the", "output", "of", "the", "optimizer", "function", "from", "scipy", "." ]
def _optimize_core(self, **kwargs): """Should return an unshaped point corresponding to the output of the optimizer function from scipy. See :func:`~moe.optimal_learning.python.python_version.optimization.LBFGSOptimizer._optimize_core` or :func:`~moe.optimal_learning.python.python_version.optim...
[ "def", "_optimize_core", "(", "self", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/python_version/optimization.py#L681-L691
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/util/order.py
python
Order.__has_no_dependents
(self, obj, constraints)
return not failed
Returns true if there's no constraint in 'constraints' where 'obj' comes second.
Returns true if there's no constraint in 'constraints' where 'obj' comes second.
[ "Returns", "true", "if", "there", "s", "no", "constraint", "in", "constraints", "where", "obj", "comes", "second", "." ]
def __has_no_dependents (self, obj, constraints): """ Returns true if there's no constraint in 'constraints' where 'obj' comes second. """ failed = False while constraints and not failed: c = constraints [0] if c [1] == obj: failed = T...
[ "def", "__has_no_dependents", "(", "self", ",", "obj", ",", "constraints", ")", ":", "failed", "=", "False", "while", "constraints", "and", "not", "failed", ":", "c", "=", "constraints", "[", "0", "]", "if", "c", "[", "1", "]", "==", "obj", ":", "fai...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/util/order.py#L100-L113
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
TextAttrDimensions.__init__
(self, *args, **kwargs)
__init__(self) -> TextAttrDimensions
__init__(self) -> TextAttrDimensions
[ "__init__", "(", "self", ")", "-", ">", "TextAttrDimensions" ]
def __init__(self, *args, **kwargs): """__init__(self) -> TextAttrDimensions""" _richtext.TextAttrDimensions_swiginit(self,_richtext.new_TextAttrDimensions(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_richtext", ".", "TextAttrDimensions_swiginit", "(", "self", ",", "_richtext", ".", "new_TextAttrDimensions", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L200-L202
fenderglass/Flye
2013acc650356cc934a2a9b82eb90af260c8b52b
flye/polishing/bubbles.py
python
_is_solid_kmer
(profile, position, err_mode)
return True
Checks if the kmer at given position is solid
Checks if the kmer at given position is solid
[ "Checks", "if", "the", "kmer", "at", "given", "position", "is", "solid" ]
def _is_solid_kmer(profile, position, err_mode): """ Checks if the kmer at given position is solid """ MISSMATCH_RATE = cfg.vals["err_modes"][err_mode]["solid_missmatch"] INS_RATE = cfg.vals["err_modes"][err_mode]["solid_indel"] SOLID_LEN = cfg.vals["solid_kmer_length"] for i in range(posit...
[ "def", "_is_solid_kmer", "(", "profile", ",", "position", ",", "err_mode", ")", ":", "MISSMATCH_RATE", "=", "cfg", ".", "vals", "[", "\"err_modes\"", "]", "[", "err_mode", "]", "[", "\"solid_missmatch\"", "]", "INS_RATE", "=", "cfg", ".", "vals", "[", "\"e...
https://github.com/fenderglass/Flye/blob/2013acc650356cc934a2a9b82eb90af260c8b52b/flye/polishing/bubbles.py#L266-L283
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/wallet.py
python
Wallet.delta_amount
(self)
return self._delta_amount
Gets the delta_amount of this Wallet. # noqa: E501 :return: The delta_amount of this Wallet. # noqa: E501 :rtype: float
Gets the delta_amount of this Wallet. # noqa: E501
[ "Gets", "the", "delta_amount", "of", "this", "Wallet", ".", "#", "noqa", ":", "E501" ]
def delta_amount(self): """Gets the delta_amount of this Wallet. # noqa: E501 :return: The delta_amount of this Wallet. # noqa: E501 :rtype: float """ return self._delta_amount
[ "def", "delta_amount", "(", "self", ")", ":", "return", "self", ".", "_delta_amount" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/wallet.py#L425-L432
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py
python
ElastiCacheConnection.describe_cache_subnet_groups
(self, cache_subnet_group_name=None, max_records=None, marker=None)
return self._make_request( action='DescribeCacheSubnetGroups', verb='POST', path='/', params=params)
The DescribeCacheSubnetGroups operation returns a list of cache subnet group descriptions. If a subnet group name is specified, the list will contain only the description of that group. :type cache_subnet_group_name: string :param cache_subnet_group_name: The name of the cache s...
The DescribeCacheSubnetGroups operation returns a list of cache subnet group descriptions. If a subnet group name is specified, the list will contain only the description of that group.
[ "The", "DescribeCacheSubnetGroups", "operation", "returns", "a", "list", "of", "cache", "subnet", "group", "descriptions", ".", "If", "a", "subnet", "group", "name", "is", "specified", "the", "list", "will", "contain", "only", "the", "description", "of", "that",...
def describe_cache_subnet_groups(self, cache_subnet_group_name=None, max_records=None, marker=None): """ The DescribeCacheSubnetGroups operation returns a list of cache subnet group descriptions. If a subnet group name is specified, the list will cont...
[ "def", "describe_cache_subnet_groups", "(", "self", ",", "cache_subnet_group_name", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "}", "if", "cache_subnet_group_name", "is", "not", "None", ":", "params"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py#L813-L851
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py
python
CookieJar._normalized_cookie_tuples
(self, attrs_set)
return cookie_tuples
Return list of tuples containing normalised cookie information. attrs_set is the list of lists of key,value pairs extracted from the Set-Cookie or Set-Cookie2 headers. Tuples are name, value, standard, rest, where name and value are the cookie name and value, standard is a dictionary c...
Return list of tuples containing normalised cookie information.
[ "Return", "list", "of", "tuples", "containing", "normalised", "cookie", "information", "." ]
def _normalized_cookie_tuples(self, attrs_set): """Return list of tuples containing normalised cookie information. attrs_set is the list of lists of key,value pairs extracted from the Set-Cookie or Set-Cookie2 headers. Tuples are name, value, standard, rest, where name and value are th...
[ "def", "_normalized_cookie_tuples", "(", "self", ",", "attrs_set", ")", ":", "cookie_tuples", "=", "[", "]", "boolean_attrs", "=", "\"discard\"", ",", "\"secure\"", "value_attrs", "=", "(", "\"version\"", ",", "\"expires\"", ",", "\"max-age\"", ",", "\"domain\"", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py#L1383-L1478
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/SConf.py
python
SConfBase.pspawn_wrapper
(self, sh, escape, cmd, args, env)
return self.pspawn(sh, escape, cmd, args, env, self.logstream, self.logstream)
Wrapper function for handling piped spawns. This looks to the calling interface (in Action.py) like a "normal" spawn, but associates the call with the PSPAWN variable from the construction environment and with the streams to which we want the output logged. This gets slid into the cons...
Wrapper function for handling piped spawns.
[ "Wrapper", "function", "for", "handling", "piped", "spawns", "." ]
def pspawn_wrapper(self, sh, escape, cmd, args, env): """Wrapper function for handling piped spawns. This looks to the calling interface (in Action.py) like a "normal" spawn, but associates the call with the PSPAWN variable from the construction environment and with the streams to which...
[ "def", "pspawn_wrapper", "(", "self", ",", "sh", ",", "escape", ",", "cmd", ",", "args", ",", "env", ")", ":", "return", "self", ".", "pspawn", "(", "sh", ",", "escape", ",", "cmd", ",", "args", ",", "env", ",", "self", ".", "logstream", ",", "se...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/SConf.py#L532-L542
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
python
LLVMSymbolizer.symbolize
(self, addr, binary, offset)
return result
Overrides Symbolizer.symbolize.
Overrides Symbolizer.symbolize.
[ "Overrides", "Symbolizer", ".", "symbolize", "." ]
def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize.""" if not self.pipe: return None result = [] try: symbolizer_input = '"%s" %s' % (binary, offset) if DEBUG: print(symbolizer_input) self.pipe.stdin.write("%s\n" % symbolizer_input) while T...
[ "def", "symbolize", "(", "self", ",", "addr", ",", "binary", ",", "offset", ")", ":", "if", "not", "self", ".", "pipe", ":", "return", "None", "result", "=", "[", "]", "try", ":", "symbolizer_input", "=", "'\"%s\" %s'", "%", "(", "binary", ",", "offs...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py#L102-L127
daijifeng001/caffe-rfcn
543f8f6a4b7c88256ea1445ae951a12d1ad9cffd
scripts/cpp_lint.py
python
CheckStyle
(filename, clean_lines, linenum, file_extension, nesting_state, error)
Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc. Args: filename: The name of the current file. clean_line...
Checks rules from the 'C++ style rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "style", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths,...
[ "def", "CheckStyle", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want ...
https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L3459-L3563
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/run_perf.py
python
RunnableTraceConfig.Run
(self, runner, trybot)
return ( measurement_with_patch.GetResults(), measurement_no_patch.GetResults(), )
Iterates over several runs and handles the output.
Iterates over several runs and handles the output.
[ "Iterates", "over", "several", "runs", "and", "handles", "the", "output", "." ]
def Run(self, runner, trybot): """Iterates over several runs and handles the output.""" measurement_with_patch = self.CreateMeasurement(trybot, False) measurement_no_patch = self.CreateMeasurement(trybot, True) for stdout_with_patch, stdout_no_patch in runner(): measurement_with_patch.ConsumeOutpu...
[ "def", "Run", "(", "self", ",", "runner", ",", "trybot", ")", ":", "measurement_with_patch", "=", "self", ".", "CreateMeasurement", "(", "trybot", ",", "False", ")", "measurement_no_patch", "=", "self", ".", "CreateMeasurement", "(", "trybot", ",", "True", "...
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/run_perf.py#L496-L506
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/metrics_impl.py
python
_maybe_expand_labels
(labels, predictions)
If necessary, expand `labels` along last dimension to match `predictions`. Args: labels: `Tensor` or `SparseTensor` with shape [D1, ... DN, num_labels] or [D1, ... DN]. The latter implies num_labels=1, in which case the result is an expanded `labels` with shape [D1, ... DN, 1]. predictions:...
If necessary, expand `labels` along last dimension to match `predictions`.
[ "If", "necessary", "expand", "labels", "along", "last", "dimension", "to", "match", "predictions", "." ]
def _maybe_expand_labels(labels, predictions): """If necessary, expand `labels` along last dimension to match `predictions`. Args: labels: `Tensor` or `SparseTensor` with shape [D1, ... DN, num_labels] or [D1, ... DN]. The latter implies num_labels=1, in which case the result is an expanded `labels...
[ "def", "_maybe_expand_labels", "(", "labels", ",", "predictions", ")", ":", "with", "ops", ".", "name_scope", "(", "None", ",", "'expand_labels'", ",", "(", "labels", ",", "predictions", ")", ")", "as", "scope", ":", "labels", "=", "sparse_tensor", ".", "c...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/metrics_impl.py#L123-L171
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/context.py
python
BaseContext.Lock
(self)
return Lock(ctx=self.get_context())
Returns a non-recursive lock object
Returns a non-recursive lock object
[ "Returns", "a", "non", "-", "recursive", "lock", "object" ]
def Lock(self): '''Returns a non-recursive lock object''' from .synchronize import Lock return Lock(ctx=self.get_context())
[ "def", "Lock", "(", "self", ")", ":", "from", ".", "synchronize", "import", "Lock", "return", "Lock", "(", "ctx", "=", "self", ".", "get_context", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/context.py#L64-L67
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py
python
Pdb.do_continue
(self, arg)
return 1
c(ont(inue)) Continue execution, only stop when a breakpoint is encountered.
c(ont(inue)) Continue execution, only stop when a breakpoint is encountered.
[ "c", "(", "ont", "(", "inue", "))", "Continue", "execution", "only", "stop", "when", "a", "breakpoint", "is", "encountered", "." ]
def do_continue(self, arg): """c(ont(inue)) Continue execution, only stop when a breakpoint is encountered. """ if not self.nosigint: try: Pdb._previous_sigint_handler = \ signal.signal(signal.SIGINT, self.sigint_handler) except...
[ "def", "do_continue", "(", "self", ",", "arg", ")", ":", "if", "not", "self", ".", "nosigint", ":", "try", ":", "Pdb", ".", "_previous_sigint_handler", "=", "signal", ".", "signal", "(", "signal", ".", "SIGINT", ",", "self", ".", "sigint_handler", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py#L1038-L1053
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py
python
Task.exception_set
(self, exception=None)
Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact
Records an exception to be raised at the appropriate time.
[ "Records", "an", "exception", "to", "be", "raised", "at", "the", "appropriate", "time", "." ]
def exception_set(self, exception=None): """ Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact """ if not exception: exception = sys.exc_info() self.e...
[ "def", "exception_set", "(", "self", ",", "exception", "=", "None", ")", ":", "if", "not", "exception", ":", "exception", "=", "sys", ".", "exc_info", "(", ")", "self", ".", "exception", "=", "exception", "self", ".", "exception_raise", "=", "self", ".",...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py#L514-L524