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
ispc/ispc
0a7ee59b6ec50e54d545eb2a31056e54c4891d51
utils/lit/lit/LitConfig.py
python
LitConfig.load_config
(self, config, path)
return config
load_config(config, path) - Load a config object from an alternate path.
load_config(config, path) - Load a config object from an alternate path.
[ "load_config", "(", "config", "path", ")", "-", "Load", "a", "config", "object", "from", "an", "alternate", "path", "." ]
def load_config(self, config, path): """load_config(config, path) - Load a config object from an alternate path.""" if self.debug: self.note('load_config from %r' % path) config.load_from_path(path, self) return config
[ "def", "load_config", "(", "self", ",", "config", ",", "path", ")", ":", "if", "self", ".", "debug", ":", "self", ".", "note", "(", "'load_config from %r'", "%", "path", ")", "config", ".", "load_from_path", "(", "path", ",", "self", ")", "return", "co...
https://github.com/ispc/ispc/blob/0a7ee59b6ec50e54d545eb2a31056e54c4891d51/utils/lit/lit/LitConfig.py#L103-L109
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/output.py
python
SequenceFile.as_type
(self, kv_serializer)
return self
通过kv_serializer将数据序列化为(Key, Value) Args: kv_serializer (callable): 序列化函数 Returns: SequenceFile: 返回self .. note:: kv_deserializer的期望签名为: kv_deserializer(object) => (str, str)
通过kv_serializer将数据序列化为(Key, Value)
[ "通过kv_serializer将数据序列化为", "(", "Key", "Value", ")" ]
def as_type(self, kv_serializer): """ 通过kv_serializer将数据序列化为(Key, Value) Args: kv_serializer (callable): 序列化函数 Returns: SequenceFile: 返回self .. note:: kv_deserializer的期望签名为: kv_deserializer(object) => (str, str) """ self.kv_serial...
[ "def", "as_type", "(", "self", ",", "kv_serializer", ")", ":", "self", ".", "kv_serializer", "=", "kv_serializer", "return", "self" ]
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/output.py#L387-L402
zeakey/DeepSkeleton
dc70170f8fd2ec8ca1157484ce66129981104486
scripts/cpp_lint.py
python
_GetTextInside
(text, start_pattern)
return text[start_position:position - 1]
r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of...
r"""Retrieves all the text between matching open and close parentheses.
[ "r", "Retrieves", "all", "the", "text", "between", "matching", "open", "and", "close", "parentheses", "." ]
def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation sy...
[ "def", "_GetTextInside", "(", "text", ",", "start_pattern", ")", ":", "# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably", "# rewritten to use _GetTextInside (and use inferior regexp matching today).", "# Give opening punctuations to get the matching close-punctuations....
https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/scripts/cpp_lint.py#L3752-L3805
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/internal/decoder.py
python
_StructPackDecoder
(wire_type, format)
return _SimpleDecoder(wire_type, InnerDecode)
Return a constructor for a decoder for a fixed-width field. Args: wire_type: The field's wire type. format: The format string to pass to struct.unpack().
Return a constructor for a decoder for a fixed-width field.
[ "Return", "a", "constructor", "for", "a", "decoder", "for", "a", "fixed", "-", "width", "field", "." ]
def _StructPackDecoder(wire_type, format): """Return a constructor for a decoder for a fixed-width field. Args: wire_type: The field's wire type. format: The format string to pass to struct.unpack(). """ value_size = struct.calcsize(format) local_unpack = struct.unpack # Reusing _SimpleDeco...
[ "def", "_StructPackDecoder", "(", "wire_type", ",", "format", ")", ":", "value_size", "=", "struct", ".", "calcsize", "(", "format", ")", "local_unpack", "=", "struct", ".", "unpack", "# Reusing _SimpleDecoder is slightly slower than copying a bunch of code, but", "# not ...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/decoder.py#L271-L293
qt/qt
0a2f2382541424726168804be2c90b91381608c6
src/3rdparty/freetype/src/tools/docmaker/content.py
python
ContentProcessor.__init__
( self )
initialize a block content processor
initialize a block content processor
[ "initialize", "a", "block", "content", "processor" ]
def __init__( self ): """initialize a block content processor""" self.reset() self.sections = {} # dictionary of documentation sections self.section = None # current documentation section self.chapters = [] # list of chapters self.headers = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "reset", "(", ")", "self", ".", "sections", "=", "{", "}", "# dictionary of documentation sections", "self", ".", "section", "=", "None", "# current documentation section", "self", ".", "chapters", "=", "[...
https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/freetype/src/tools/docmaker/content.py#L342-L351
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
parserCtxt.htmlParseDocument
(self)
return ret
parse an HTML document (and build a tree if using the standard SAX interface).
parse an HTML document (and build a tree if using the standard SAX interface).
[ "parse", "an", "HTML", "document", "(", "and", "build", "a", "tree", "if", "using", "the", "standard", "SAX", "interface", ")", "." ]
def htmlParseDocument(self): """parse an HTML document (and build a tree if using the standard SAX interface). """ ret = libxml2mod.htmlParseDocument(self._o) return ret
[ "def", "htmlParseDocument", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "htmlParseDocument", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L5010-L5014
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/webencodings/__init__.py
python
IncrementalDecoder.decode
(self, input, final=False)
return decoder(input, final)
Decode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string.
Decode one chunk of the input.
[ "Decode", "one", "chunk", "of", "the", "input", "." ]
def decode(self, input, final=False): """Decode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string. """ decoder = ...
[ "def", "decode", "(", "self", ",", "input", ",", "final", "=", "False", ")", ":", "decoder", "=", "self", ".", "_decoder", "if", "decoder", "is", "not", "None", ":", "return", "decoder", "(", "input", ",", "final", ")", "input", "=", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/webencodings/__init__.py#L295-L320
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Event.WasProcessed
(*args, **kwargs)
return _core_.Event_WasProcessed(*args, **kwargs)
WasProcessed(self) -> bool
WasProcessed(self) -> bool
[ "WasProcessed", "(", "self", ")", "-", ">", "bool" ]
def WasProcessed(*args, **kwargs): """WasProcessed(self) -> bool""" return _core_.Event_WasProcessed(*args, **kwargs)
[ "def", "WasProcessed", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Event_WasProcessed", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L5100-L5102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py
python
get_encodings_from_content
(content)
return (charset_re.findall(content) + pragma_re.findall(content) + xml_re.findall(content))
Returns encodings from given content string. :param content: bytestring to extract encodings from.
Returns encodings from given content string.
[ "Returns", "encodings", "from", "given", "content", "string", "." ]
def get_encodings_from_content(content): """Returns encodings from given content string. :param content: bytestring to extract encodings from. """ warnings.warn(( 'In requests 3.0, get_encodings_from_content will be removed. For ' 'more information, please see the discussion on i...
[ "def", "get_encodings_from_content", "(", "content", ")", ":", "warnings", ".", "warn", "(", "(", "'In requests 3.0, get_encodings_from_content will be removed. For '", "'more information, please see the discussion on issue #2266. (This'", "' warning should only appear once.)'", ")", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L881-L915
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/loaders.py
python
Loader.load_service_model
(self, service_name, type_name, api_version=None)
return model
Load a botocore service model This is the main method for loading botocore models (e.g. a service model, pagination configs, waiter configs, etc.). :type service_name: str :param service_name: The name of the service (e.g ``ec2``, ``s3``). :type type_name: str :param t...
Load a botocore service model
[ "Load", "a", "botocore", "service", "model" ]
def load_service_model(self, service_name, type_name, api_version=None): """Load a botocore service model This is the main method for loading botocore models (e.g. a service model, pagination configs, waiter configs, etc.). :type service_name: str :param service_name: The name ...
[ "def", "load_service_model", "(", "self", ",", "service_name", ",", "type_name", ",", "api_version", "=", "None", ")", ":", "# Wrapper around the load_data. This will calculate the path", "# to call load_data with.", "known_services", "=", "self", ".", "list_available_servic...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/loaders.py#L343-L389
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/metrics/cluster/_unsupervised.py
python
silhouette_samples
(X, labels, metric='euclidean', **kwds)
return np.nan_to_num(sil_samples)
Compute the Silhouette Coefficient for each sample. The Silhouette Coefficient is a measure of how well samples are clustered with samples that are similar to themselves. Clustering models with a high Silhouette Coefficient are said to be dense, where samples in the same cluster are similar to each oth...
Compute the Silhouette Coefficient for each sample.
[ "Compute", "the", "Silhouette", "Coefficient", "for", "each", "sample", "." ]
def silhouette_samples(X, labels, metric='euclidean', **kwds): """Compute the Silhouette Coefficient for each sample. The Silhouette Coefficient is a measure of how well samples are clustered with samples that are similar to themselves. Clustering models with a high Silhouette Coefficient are said to b...
[ "def", "silhouette_samples", "(", "X", ",", "labels", ",", "metric", "=", "'euclidean'", ",", "*", "*", "kwds", ")", ":", "X", ",", "labels", "=", "check_X_y", "(", "X", ",", "labels", ",", "accept_sparse", "=", "[", "'csc'", ",", "'csr'", "]", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/cluster/_unsupervised.py#L152-L247
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
HyperlinkCtrl.SetVisited
(*args, **kwargs)
return _controls_.HyperlinkCtrl_SetVisited(*args, **kwargs)
SetVisited(self, bool visited=True)
SetVisited(self, bool visited=True)
[ "SetVisited", "(", "self", "bool", "visited", "=", "True", ")" ]
def SetVisited(*args, **kwargs): """SetVisited(self, bool visited=True)""" return _controls_.HyperlinkCtrl_SetVisited(*args, **kwargs)
[ "def", "SetVisited", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "HyperlinkCtrl_SetVisited", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6662-L6664
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TDbStr.__eq__
(self, *args)
return _snap.TDbStr___eq__(self, *args)
__eq__(TDbStr self, TDbStr DbStr) -> bool Parameters: DbStr: TDbStr const &
__eq__(TDbStr self, TDbStr DbStr) -> bool
[ "__eq__", "(", "TDbStr", "self", "TDbStr", "DbStr", ")", "-", ">", "bool" ]
def __eq__(self, *args): """ __eq__(TDbStr self, TDbStr DbStr) -> bool Parameters: DbStr: TDbStr const & """ return _snap.TDbStr___eq__(self, *args)
[ "def", "__eq__", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TDbStr___eq__", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11445-L11453
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/commands/rsync.py
python
_DecodeUrl
(enc_url_string)
return urllib.unquote_plus(enc_url_string).decode(UTF8)
Inverts encoding from EncodeUrl. Args: enc_url_string: String URL to decode. Returns: decoded URL.
Inverts encoding from EncodeUrl.
[ "Inverts", "encoding", "from", "EncodeUrl", "." ]
def _DecodeUrl(enc_url_string): """Inverts encoding from EncodeUrl. Args: enc_url_string: String URL to decode. Returns: decoded URL. """ return urllib.unquote_plus(enc_url_string).decode(UTF8)
[ "def", "_DecodeUrl", "(", "enc_url_string", ")", ":", "return", "urllib", ".", "unquote_plus", "(", "enc_url_string", ")", ".", "decode", "(", "UTF8", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/rsync.py#L598-L607
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
llvm/bindings/python/llvm/core.py
python
Module.target
(self, new_target)
new_target is a string.
new_target is a string.
[ "new_target", "is", "a", "string", "." ]
def target(self, new_target): """new_target is a string.""" lib.LLVMSetTarget(self, new_target)
[ "def", "target", "(", "self", ",", "new_target", ")", ":", "lib", ".", "LLVMSetTarget", "(", "self", ",", "new_target", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/llvm/bindings/python/llvm/core.py#L221-L223
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParserElement.__mul__
(self,other)
return ret
Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)}...
[]
def __mul__(self,other): """ Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as i...
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "int", ")", ":", "minElements", ",", "optElements", "=", "other", ",", "0", "elif", "isinstance", "(", "other", ",", "tuple", ")", ":", "other", "=", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L3753-L3885
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/code_coverage/croc_html.py
python
HtmlElement.Text
(self, text)
return self
Adds a text node. Args: text: Text to add. Returns: self.
Adds a text node.
[ "Adds", "a", "text", "node", "." ]
def Text(self, text): """Adds a text node. Args: text: Text to add. Returns: self. """ t = self.doc.createTextNode(str(text)) self.element.appendChild(t) return self
[ "def", "Text", "(", "self", ",", "text", ")", ":", "t", "=", "self", ".", "doc", ".", "createTextNode", "(", "str", "(", "text", ")", ")", "self", ".", "element", ".", "appendChild", "(", "t", ")", "return", "self" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/code_coverage/croc_html.py#L54-L65
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
hamming
(M, dtype=None, device=None)
return _mx_nd_np.hamming(M, dtype=dtype, device=device)
r"""Return the hamming window. The hamming window is a taper formed by using a weighted cosine. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. device : Device, optional Device context on which the memory is ...
r"""Return the hamming window.
[ "r", "Return", "the", "hamming", "window", "." ]
def hamming(M, dtype=None, device=None): r"""Return the hamming window. The hamming window is a taper formed by using a weighted cosine. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. device : Device, optional ...
[ "def", "hamming", "(", "M", ",", "dtype", "=", "None", ",", "device", "=", "None", ")", ":", "return", "_mx_nd_np", ".", "hamming", "(", "M", ",", "dtype", "=", "dtype", ",", "device", "=", "device", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L9041-L9116
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/training_utils_v1.py
python
SliceAggregator._slice_assign
(self, batch_element, batch_start, batch_end, is_finished)
Legacy utility method to slice input arrays.
Legacy utility method to slice input arrays.
[ "Legacy", "utility", "method", "to", "slice", "input", "arrays", "." ]
def _slice_assign(self, batch_element, batch_start, batch_end, is_finished): """Legacy utility method to slice input arrays.""" try: self.results[batch_start:batch_end] = batch_element except Exception as e: # pylint: disable=broad-except # `_slice_assign` should only be called in threads and ...
[ "def", "_slice_assign", "(", "self", ",", "batch_element", ",", "batch_start", ",", "batch_end", ",", "is_finished", ")", ":", "try", ":", "self", ".", "results", "[", "batch_start", ":", "batch_end", "]", "=", "batch_element", "except", "Exception", "as", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_utils_v1.py#L399-L412
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Build.py
python
BuildContext.get_targets
(self)
return (min_grp, to_post)
This method returns a pair containing the index of the last build group to post, and the list of task generator objects corresponding to the target names. This is used internally by :py:meth:`waflib.Build.BuildContext.get_build_iterator` to perform partial builds:: $ waf --targets=myprogram,myshlib :retur...
This method returns a pair containing the index of the last build group to post, and the list of task generator objects corresponding to the target names.
[ "This", "method", "returns", "a", "pair", "containing", "the", "index", "of", "the", "last", "build", "group", "to", "post", "and", "the", "list", "of", "task", "generator", "objects", "corresponding", "to", "the", "target", "names", "." ]
def get_targets(self): """ This method returns a pair containing the index of the last build group to post, and the list of task generator objects corresponding to the target names. This is used internally by :py:meth:`waflib.Build.BuildContext.get_build_iterator` to perform partial builds:: $ waf --targ...
[ "def", "get_targets", "(", "self", ")", ":", "to_post", "=", "[", "]", "min_grp", "=", "0", "for", "name", "in", "self", ".", "targets", ".", "split", "(", "','", ")", ":", "tg", "=", "self", ".", "get_tgen_by_name", "(", "name", ")", "m", "=", "...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Build.py#L696-L719
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reduction_steps.py
python
ConvertToQISIS._set_up_q_resolution_parameters
(self)
Prepare the parameters which need preparing
Prepare the parameters which need preparing
[ "Prepare", "the", "parameters", "which", "need", "preparing" ]
def _set_up_q_resolution_parameters(self): ''' Prepare the parameters which need preparing ''' # If we have values for H1 and W1 then set A1 to the correct value if self._q_resolution_h1 and self._q_resolution_w1 and self._q_resolution_h2 and self._q_resolution_w2: se...
[ "def", "_set_up_q_resolution_parameters", "(", "self", ")", ":", "# If we have values for H1 and W1 then set A1 to the correct value", "if", "self", ".", "_q_resolution_h1", "and", "self", ".", "_q_resolution_w1", "and", "self", ".", "_q_resolution_h2", "and", "self", ".", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L2994-L3001
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
Context.is_qnan
(self, a)
return a.is_qnan()
Return True if the operand is a quiet NaN; otherwise return False. >>> ExtendedContext.is_qnan(Decimal('2.50')) False >>> ExtendedContext.is_qnan(Decimal('NaN')) True >>> ExtendedContext.is_qnan(Decimal('sNaN')) False >>> ExtendedContext.is_qnan(1) False
Return True if the operand is a quiet NaN; otherwise return False.
[ "Return", "True", "if", "the", "operand", "is", "a", "quiet", "NaN", ";", "otherwise", "return", "False", "." ]
def is_qnan(self, a): """Return True if the operand is a quiet NaN; otherwise return False. >>> ExtendedContext.is_qnan(Decimal('2.50')) False >>> ExtendedContext.is_qnan(Decimal('NaN')) True >>> ExtendedContext.is_qnan(Decimal('sNaN')) False >>> Extended...
[ "def", "is_qnan", "(", "self", ",", "a", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "is_qnan", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L4399-L4412
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snaps.py
python
Draft_Snap_Angle.Activated
(self)
Execute when the command is called.
Execute when the command is called.
[ "Execute", "when", "the", "command", "is", "called", "." ]
def Activated(self): """Execute when the command is called.""" super(Draft_Snap_Angle, self).Activated() if hasattr(Gui, "Snapper"): status = Gui.Snapper.toggle_snap('Angle') # change interface consistently sync_snap_toolbar_button("Draft_Snap_Angle"+"_Button...
[ "def", "Activated", "(", "self", ")", ":", "super", "(", "Draft_Snap_Angle", ",", "self", ")", ".", "Activated", "(", ")", "if", "hasattr", "(", "Gui", ",", "\"Snapper\"", ")", ":", "status", "=", "Gui", ".", "Snapper", ".", "toggle_snap", "(", "'Angle...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snaps.py#L347-L355
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/sparse_ops.py
python
sparse_merge
(sp_ids, sp_values, vocab_size, name=None, already_sorted=False)
Combines a batch of feature ids and values into a single `SparseTensor`. The most common use case for this function occurs when feature ids and their corresponding values are stored in `Example` protos on disk. `parse_example` will return a batch of ids and a batch of values, and this function joins them into ...
Combines a batch of feature ids and values into a single `SparseTensor`.
[ "Combines", "a", "batch", "of", "feature", "ids", "and", "values", "into", "a", "single", "SparseTensor", "." ]
def sparse_merge(sp_ids, sp_values, vocab_size, name=None, already_sorted=False): """Combines a batch of feature ids and values into a single `SparseTensor`. The most common use case for this function occurs when feature ids and their corresponding values are stored in `Example` protos on disk. ...
[ "def", "sparse_merge", "(", "sp_ids", ",", "sp_values", ",", "vocab_size", ",", "name", "=", "None", ",", "already_sorted", "=", "False", ")", ":", "if", "not", "isinstance", "(", "sp_ids", ",", "ops", ".", "SparseTensor", ")", ":", "raise", "TypeError", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/sparse_ops.py#L778-L882
telefonicaid/fiware-orion
27c3202b9ddcfb9e3635a0af8d373f76e89b1d24
scripts/cpplint.py
python
RemoveMultiLineComments
(filename, lines, error)
Removes multiline (c-style) comments from lines.
Removes multiline (c-style) comments from lines.
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, line...
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", "if", ...
https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/cpplint.py#L891-L904
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
tools/codestyle/cpplint/cpplint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, class_state, error)
Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const static")...
Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, class_state, error): """Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "class_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "if"...
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L1333-L1500
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/utils/generic_utils.py
python
has_arg
(fn, name, accept_all=False)
return name in arg_spec.args
Checks if a callable accepts a given keyword argument. Arguments: fn: Callable to inspect. name: Check if `fn` can be called with `name` as a keyword argument. accept_all: What to return if there is no parameter called `name` but the function accepts a `**kwargs` argument. Retu...
Checks if a callable accepts a given keyword argument.
[ "Checks", "if", "a", "callable", "accepts", "a", "given", "keyword", "argument", "." ]
def has_arg(fn, name, accept_all=False): """Checks if a callable accepts a given keyword argument. Arguments: fn: Callable to inspect. name: Check if `fn` can be called with `name` as a keyword argument. accept_all: What to return if there is no parameter called `name` but the f...
[ "def", "has_arg", "(", "fn", ",", "name", ",", "accept_all", "=", "False", ")", ":", "arg_spec", "=", "tf_inspect", ".", "getargspec", "(", "fn", ")", "if", "accept_all", "and", "arg_spec", ".", "keywords", "is", "not", "None", ":", "return", "True", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/utils/generic_utils.py#L230-L245
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/hang_analyzer/process_list.py
python
_WindowsProcessList.__find_ps
()
return os.path.join(os.environ["WINDIR"], "system32", "tasklist.exe")
Find tasklist.
Find tasklist.
[ "Find", "tasklist", "." ]
def __find_ps(): """Find tasklist.""" return os.path.join(os.environ["WINDIR"], "system32", "tasklist.exe")
[ "def", "__find_ps", "(", ")", ":", "return", "os", ".", "path", ".", "join", "(", "os", ".", "environ", "[", "\"WINDIR\"", "]", ",", "\"system32\"", ",", "\"tasklist.exe\"", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/hang_analyzer/process_list.py#L112-L114
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/console.py
python
colors
(name)
return ''
Return ansi console control sequence from color name
Return ansi console control sequence from color name
[ "Return", "ansi", "console", "control", "sequence", "from", "color", "name" ]
def colors(name): """Return ansi console control sequence from color name""" if color_enabled: return _colors[name] return ''
[ "def", "colors", "(", "name", ")", ":", "if", "color_enabled", ":", "return", "_colors", "[", "name", "]", "return", "''" ]
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/console.py#L29-L33
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/msvc.py
python
_augment_exception
(exc, version, arch='')
Add details to the exception message to help guide the user as to what action will resolve it.
Add details to the exception message to help guide the user as to what action will resolve it.
[ "Add", "details", "to", "the", "exception", "message", "to", "help", "guide", "the", "user", "as", "to", "what", "action", "will", "resolve", "it", "." ]
def _augment_exception(exc, version, arch=''): """ Add details to the exception message to help guide the user as to what action will resolve it. """ # Error if MSVC++ directory not found or environment not set message = exc.args[0] if "vcvarsall" in message.lower() or "visual c" in message...
[ "def", "_augment_exception", "(", "exc", ",", "version", ",", "arch", "=", "''", ")", ":", "# Error if MSVC++ directory not found or environment not set", "message", "=", "exc", ".", "args", "[", "0", "]", "if", "\"vcvarsall\"", "in", "message", ".", "lower", "(...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/msvc.py#L335-L369
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/git.py
python
Repo.get_my_candidate_files
(self, filter_function, origin_branch)
return list(file_set)
Query git to get a list of files in the repo from a diff.
Query git to get a list of files in the repo from a diff.
[ "Query", "git", "to", "get", "a", "list", "of", "files", "in", "the", "repo", "from", "a", "diff", "." ]
def get_my_candidate_files(self, filter_function, origin_branch): # type: (Callable[[str], bool], str) -> List[str] """Query git to get a list of files in the repo from a diff.""" # There are 3 diffs we run: # 1. List of commits between origin/master and HEAD of current branch # ...
[ "def", "get_my_candidate_files", "(", "self", ",", "filter_function", ",", "origin_branch", ")", ":", "# type: (Callable[[str], bool], str) -> List[str]", "# There are 3 diffs we run:", "# 1. List of commits between origin/master and HEAD of current branch", "# 2. Cached/Staged files (--ca...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/git.py#L102-L121
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/tomviz/io/dm.py
python
FileDM._readTagEntry
(self)
Read one entry in a tag group.
Read one entry in a tag group.
[ "Read", "one", "entry", "in", "a", "tag", "group", "." ]
def _readTagEntry(self): """Read one entry in a tag group. """ dataType = self.fromfile(self.fid, dtype=np.dtype('>u1'), count=1)[0] # Record tag at this level self._curTagAtLevelX[self._curGroupLevel] += 1 # get the tag lenTagLabel = self.fromfile(self.fid, dt...
[ "def", "_readTagEntry", "(", "self", ")", ":", "dataType", "=", "self", ".", "fromfile", "(", "self", ".", "fid", ",", "dtype", "=", "np", ".", "dtype", "(", "'>u1'", ")", ",", "count", "=", "1", ")", "[", "0", "]", "# Record tag at this level", "sel...
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/io/dm.py#L460-L503
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/wms/ogc/common/tilecalcs.py
python
TotalTilepixelExtent
(zoom)
return total
Number of pixels on a side, at a given zoom. Args: zoom: zoom level. Returns: Whole tilepixel space extent for this zoom level. Height == width so, just one number is returned.
Number of pixels on a side, at a given zoom.
[ "Number", "of", "pixels", "on", "a", "side", "at", "a", "given", "zoom", "." ]
def TotalTilepixelExtent(zoom): """Number of pixels on a side, at a given zoom. Args: zoom: zoom level. Returns: Whole tilepixel space extent for this zoom level. Height == width so, just one number is returned. """ utils.Assert(geom.IsNumber(zoom)) total = _TILE_PIXEL_SIZE * (2 ** zoom) log...
[ "def", "TotalTilepixelExtent", "(", "zoom", ")", ":", "utils", ".", "Assert", "(", "geom", ".", "IsNumber", "(", "zoom", ")", ")", "total", "=", "_TILE_PIXEL_SIZE", "*", "(", "2", "**", "zoom", ")", "logger", ".", "debug", "(", "\"Total pixels:%d\"", ","...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/tilecalcs.py#L104-L118
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Dialog.CreateStdDialogButtonSizer
(*args, **kwargs)
return _windows_.Dialog_CreateStdDialogButtonSizer(*args, **kwargs)
CreateStdDialogButtonSizer(self, long flags) -> StdDialogButtonSizer
CreateStdDialogButtonSizer(self, long flags) -> StdDialogButtonSizer
[ "CreateStdDialogButtonSizer", "(", "self", "long", "flags", ")", "-", ">", "StdDialogButtonSizer" ]
def CreateStdDialogButtonSizer(*args, **kwargs): """CreateStdDialogButtonSizer(self, long flags) -> StdDialogButtonSizer""" return _windows_.Dialog_CreateStdDialogButtonSizer(*args, **kwargs)
[ "def", "CreateStdDialogButtonSizer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_CreateStdDialogButtonSizer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L795-L797
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/nyan/nyan_structs.py
python
NyanPatch.is_abstract
(self)
return super().is_abstract() or not self._target
Returns True if unique or inherited members were not initialized or the patch target is not set.
Returns True if unique or inherited members were not initialized or the patch target is not set.
[ "Returns", "True", "if", "unique", "or", "inherited", "members", "were", "not", "initialized", "or", "the", "patch", "target", "is", "not", "set", "." ]
def is_abstract(self): """ Returns True if unique or inherited members were not initialized or the patch target is not set. """ return super().is_abstract() or not self._target
[ "def", "is_abstract", "(", "self", ")", ":", "return", "super", "(", ")", ".", "is_abstract", "(", ")", "or", "not", "self", ".", "_target" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/nyan/nyan_structs.py#L493-L498
opengm/opengm
decdacf4caad223b0ab5478d38a855f8767a394f
src/interfaces/python/opengm/__init__.py
python
saveGm
(gm, f, d='gm')
save a graphical model to a hdf5 file: Args: gm : graphical model to save f : filepath g : dataset (defaut : 'gm')
save a graphical model to a hdf5 file: Args: gm : graphical model to save f : filepath g : dataset (defaut : 'gm')
[ "save", "a", "graphical", "model", "to", "a", "hdf5", "file", ":", "Args", ":", "gm", ":", "graphical", "model", "to", "save", "f", ":", "filepath", "g", ":", "dataset", "(", "defaut", ":", "gm", ")" ]
def saveGm(gm, f, d='gm'): """ save a graphical model to a hdf5 file: Args: gm : graphical model to save f : filepath g : dataset (defaut : 'gm') """ hdf5.saveGraphicalModel(gm, f, d)
[ "def", "saveGm", "(", "gm", ",", "f", ",", "d", "=", "'gm'", ")", ":", "hdf5", ".", "saveGraphicalModel", "(", "gm", ",", "f", ",", "d", ")" ]
https://github.com/opengm/opengm/blob/decdacf4caad223b0ab5478d38a855f8767a394f/src/interfaces/python/opengm/__init__.py#L72-L79
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Bitmap.CopyFromBufferRGBA
(self, buffer)
Copy data from a RGBA buffer object to replace the bitmap pixel data. This method is now just a compatibility wrapper around CopyFromBuffer.
Copy data from a RGBA buffer object to replace the bitmap pixel data. This method is now just a compatibility wrapper around CopyFromBuffer.
[ "Copy", "data", "from", "a", "RGBA", "buffer", "object", "to", "replace", "the", "bitmap", "pixel", "data", ".", "This", "method", "is", "now", "just", "a", "compatibility", "wrapper", "around", "CopyFromBuffer", "." ]
def CopyFromBufferRGBA(self, buffer): """ Copy data from a RGBA buffer object to replace the bitmap pixel data. This method is now just a compatibility wrapper around CopyFromBuffer. """ self.CopyFromBuffer(buffer, wx.BitmapBufferFormat_RGBA)
[ "def", "CopyFromBufferRGBA", "(", "self", ",", "buffer", ")", ":", "self", ".", "CopyFromBuffer", "(", "buffer", ",", "wx", ".", "BitmapBufferFormat_RGBA", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L841-L847
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
File.time
(self)
return conf.lib.clang_getFileTime(self)
Return the last modification time of the file.
Return the last modification time of the file.
[ "Return", "the", "last", "modification", "time", "of", "the", "file", "." ]
def time(self): """Return the last modification time of the file.""" return conf.lib.clang_getFileTime(self)
[ "def", "time", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getFileTime", "(", "self", ")" ]
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L2501-L2503
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/generic.py
python
NDFrame.to_hdf
( self, path_or_buf, key: str, mode: str = "a", complevel: int | None = None, complib: str | None = None, append: bool_t = False, format: str | None = None, index: bool_t = True, min_itemsize: int | dict[str, int] | None = None, nan...
Write the contained data to an HDF5 file using HDFStore. Hierarchical Data Format (HDF) is self-describing, allowing an application to interpret the structure and contents of a file with no outside information. One HDF file can hold a mix of related objects which can be accessed as a gr...
Write the contained data to an HDF5 file using HDFStore.
[ "Write", "the", "contained", "data", "to", "an", "HDF5", "file", "using", "HDFStore", "." ]
def to_hdf( self, path_or_buf, key: str, mode: str = "a", complevel: int | None = None, complib: str | None = None, append: bool_t = False, format: str | None = None, index: bool_t = True, min_itemsize: int | dict[str, int] | None = None, ...
[ "def", "to_hdf", "(", "self", ",", "path_or_buf", ",", "key", ":", "str", ",", "mode", ":", "str", "=", "\"a\"", ",", "complevel", ":", "int", "|", "None", "=", "None", ",", "complib", ":", "str", "|", "None", "=", "None", ",", "append", ":", "bo...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L2575-L2719
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGProperty.SetFlagsFromString
(*args, **kwargs)
return _propgrid.PGProperty_SetFlagsFromString(*args, **kwargs)
SetFlagsFromString(self, String str)
SetFlagsFromString(self, String str)
[ "SetFlagsFromString", "(", "self", "String", "str", ")" ]
def SetFlagsFromString(*args, **kwargs): """SetFlagsFromString(self, String str)""" return _propgrid.PGProperty_SetFlagsFromString(*args, **kwargs)
[ "def", "SetFlagsFromString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetFlagsFromString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L710-L712
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py
python
TensorFlowDataFrame.from_csv_with_feature_spec
(cls, filepatterns, feature_spec, has_header=True, column_names=None, num_threads=1, enqueue_size=None, ...
return dataframe
Create a `DataFrame` from CSV files, given a feature_spec. If `has_header` is false, then `column_names` must be specified. If `has_header` is true and `column_names` are specified, then `column_names` overrides the names in the header. Args: filepatterns: a list of file patterns that resolve to...
Create a `DataFrame` from CSV files, given a feature_spec.
[ "Create", "a", "DataFrame", "from", "CSV", "files", "given", "a", "feature_spec", "." ]
def from_csv_with_feature_spec(cls, filepatterns, feature_spec, has_header=True, column_names=None, num_threads=1, enqueue...
[ "def", "from_csv_with_feature_spec", "(", "cls", ",", "filepatterns", ",", "feature_spec", ",", "has_header", "=", "True", ",", "column_names", "=", "None", ",", "num_threads", "=", "1", ",", "enqueue_size", "=", "None", ",", "batch_size", "=", "32", ",", "q...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py#L381-L438
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/processing/tools/vector.py
python
convert_nulls
(values, replacement=None)
return [i if i != NULL else replacement for i in values]
Converts NULL items in a list of values to a replacement value (usually None) :param values: list of values :param replacement: value to use in place of NULL :return: converted list
Converts NULL items in a list of values to a replacement value (usually None) :param values: list of values :param replacement: value to use in place of NULL :return: converted list
[ "Converts", "NULL", "items", "in", "a", "list", "of", "values", "to", "a", "replacement", "value", "(", "usually", "None", ")", ":", "param", "values", ":", "list", "of", "values", ":", "param", "replacement", ":", "value", "to", "use", "in", "place", ...
def convert_nulls(values, replacement=None): """ Converts NULL items in a list of values to a replacement value (usually None) :param values: list of values :param replacement: value to use in place of NULL :return: converted list """ return [i if i != NULL else replacement for i in values]
[ "def", "convert_nulls", "(", "values", ",", "replacement", "=", "None", ")", ":", "return", "[", "i", "if", "i", "!=", "NULL", "else", "replacement", "for", "i", "in", "values", "]" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/tools/vector.py#L87-L94
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/base.py
python
BuildBackend._write_file
(self, path=None, fh=None)
Context manager to write a file. This is a glorified wrapper around FileAvoidWrite with integration to update the BackendConsumeSummary on this instance. Example usage: with self._write_file('foo.txt') as fh: fh.write('hello world')
Context manager to write a file.
[ "Context", "manager", "to", "write", "a", "file", "." ]
def _write_file(self, path=None, fh=None): """Context manager to write a file. This is a glorified wrapper around FileAvoidWrite with integration to update the BackendConsumeSummary on this instance. Example usage: with self._write_file('foo.txt') as fh: fh...
[ "def", "_write_file", "(", "self", ",", "path", "=", "None", ",", "fh", "=", "None", ")", ":", "if", "path", "is", "not", "None", ":", "assert", "fh", "is", "None", "fh", "=", "FileAvoidWrite", "(", "path", ",", "capture_diff", "=", "True", ")", "e...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/base.py#L249-L285
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/parser.py
python
ByteParser._all_arcs
(self)
return arcs
Get the set of all arcs in this code object and its children. See `_arcs` for details.
Get the set of all arcs in this code object and its children.
[ "Get", "the", "set", "of", "all", "arcs", "in", "this", "code", "object", "and", "its", "children", "." ]
def _all_arcs(self): """Get the set of all arcs in this code object and its children. See `_arcs` for details. """ arcs = set() for bp in self.child_parsers(): arcs.update(bp._arcs()) return arcs
[ "def", "_all_arcs", "(", "self", ")", ":", "arcs", "=", "set", "(", ")", "for", "bp", "in", "self", ".", "child_parsers", "(", ")", ":", "arcs", ".", "update", "(", "bp", ".", "_arcs", "(", ")", ")", "return", "arcs" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/parser.py#L611-L621
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/svrg_module/api_usage_example/example_inference.py
python
create_network
(batch_size, update_freq)
return di, val_iter, mod
Create a linear regression network for performing SVRG optimization. :return: an instance of mx.io.NDArrayIter :return: an instance of mx.mod.svrgmodule for performing SVRG optimization
Create a linear regression network for performing SVRG optimization. :return: an instance of mx.io.NDArrayIter :return: an instance of mx.mod.svrgmodule for performing SVRG optimization
[ "Create", "a", "linear", "regression", "network", "for", "performing", "SVRG", "optimization", ".", ":", "return", ":", "an", "instance", "of", "mx", ".", "io", ".", "NDArrayIter", ":", "return", ":", "an", "instance", "of", "mx", ".", "mod", ".", "svrgm...
def create_network(batch_size, update_freq): """Create a linear regression network for performing SVRG optimization. :return: an instance of mx.io.NDArrayIter :return: an instance of mx.mod.svrgmodule for performing SVRG optimization """ head = '%(asctime)-15s %(message)s' logging.basicConfig(le...
[ "def", "create_network", "(", "batch_size", ",", "update_freq", ")", ":", "head", "=", "'%(asctime)-15s %(message)s'", "logging", ".", "basicConfig", "(", "level", "=", "logging", ".", "INFO", ",", "format", "=", "head", ")", "data", "=", "np", ".", "random"...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/svrg_module/api_usage_example/example_inference.py#L64-L91
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
MessageDialog.SetHelpLabel
(*args, **kwargs)
return _windows_.MessageDialog_SetHelpLabel(*args, **kwargs)
SetHelpLabel(self, String help) -> bool
SetHelpLabel(self, String help) -> bool
[ "SetHelpLabel", "(", "self", "String", "help", ")", "-", ">", "bool" ]
def SetHelpLabel(*args, **kwargs): """SetHelpLabel(self, String help) -> bool""" return _windows_.MessageDialog_SetHelpLabel(*args, **kwargs)
[ "def", "SetHelpLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "MessageDialog_SetHelpLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L3650-L3652
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
JoystickEvent.__init__
(self, *args, **kwargs)
__init__(self, EventType type=wxEVT_NULL, int state=0, int joystick=JOYSTICK1, int change=0) -> JoystickEvent
__init__(self, EventType type=wxEVT_NULL, int state=0, int joystick=JOYSTICK1, int change=0) -> JoystickEvent
[ "__init__", "(", "self", "EventType", "type", "=", "wxEVT_NULL", "int", "state", "=", "0", "int", "joystick", "=", "JOYSTICK1", "int", "change", "=", "0", ")", "-", ">", "JoystickEvent" ]
def __init__(self, *args, **kwargs): """ __init__(self, EventType type=wxEVT_NULL, int state=0, int joystick=JOYSTICK1, int change=0) -> JoystickEvent """ _misc_.JoystickEvent_swiginit(self,_misc_.new_JoystickEvent(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_misc_", ".", "JoystickEvent_swiginit", "(", "self", ",", "_misc_", ".", "new_JoystickEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2336-L2341
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/cast.py
python
maybe_infer_dtype_type
(element)
return tipo
Try to infer an object's dtype, for use in arithmetic ops. Uses `element.dtype` if that's available. Objects implementing the iterator protocol are cast to a NumPy array, and from there the array's type is used. Parameters ---------- element : object Possibly has a `.dtype` attribute, ...
Try to infer an object's dtype, for use in arithmetic ops.
[ "Try", "to", "infer", "an", "object", "s", "dtype", "for", "use", "in", "arithmetic", "ops", "." ]
def maybe_infer_dtype_type(element): """ Try to infer an object's dtype, for use in arithmetic ops. Uses `element.dtype` if that's available. Objects implementing the iterator protocol are cast to a NumPy array, and from there the array's type is used. Parameters ---------- element : o...
[ "def", "maybe_infer_dtype_type", "(", "element", ")", ":", "tipo", "=", "None", "if", "hasattr", "(", "element", ",", "\"dtype\"", ")", ":", "tipo", "=", "element", ".", "dtype", "elif", "is_list_like", "(", "element", ")", ":", "element", "=", "np", "."...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/cast.py#L682-L713
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/publish/search/search_publish_handler.py
python
SearchPublishHandler.__init__
(self)
Inits SearchPublishServlet.
Inits SearchPublishServlet.
[ "Inits", "SearchPublishServlet", "." ]
def __init__(self): """Inits SearchPublishServlet.""" try: self._search_publish_manager = ( search_publish_manager.SearchPublishManager()) except exceptions.Error as e: self._search_publish_manager = None logger.error(e)
[ "def", "__init__", "(", "self", ")", ":", "try", ":", "self", ".", "_search_publish_manager", "=", "(", "search_publish_manager", ".", "SearchPublishManager", "(", ")", ")", "except", "exceptions", ".", "Error", "as", "e", ":", "self", ".", "_search_publish_ma...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/search/search_publish_handler.py#L36-L43
plaidml/plaidml
f3c6681db21460e5fdc11ae651d6d7b6c27f8262
cmake/git-clang-format.py
python
get_object_type
(value)
return convert_string(stdout.strip())
Returns a string description of an object's type, or None if it is not a valid git object.
Returns a string description of an object's type, or None if it is not a valid git object.
[ "Returns", "a", "string", "description", "of", "an", "object", "s", "type", "or", "None", "if", "it", "is", "not", "a", "valid", "git", "object", "." ]
def get_object_type(value): """Returns a string description of an object's type, or None if it is not a valid git object.""" cmd = ['git', 'cat-file', '-t', value] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() if p.returncode != 0: ...
[ "def", "get_object_type", "(", "value", ")", ":", "cmd", "=", "[", "'git'", ",", "'cat-file'", ",", "'-t'", ",", "value", "]", "p", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subpr...
https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/cmake/git-clang-format.py#L264-L272
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parse/parser.py
python
get_operation_symbol
(obj)
return ops_symbol
Get obj operation symbol.
Get obj operation symbol.
[ "Get", "obj", "operation", "symbol", "." ]
def get_operation_symbol(obj): """Get obj operation symbol.""" ops_symbol = ops_symbol_map.get(type(obj), SYMBOL_UNDEFINE) logger.debug("ops symbol: %s", ops_symbol) return ops_symbol
[ "def", "get_operation_symbol", "(", "obj", ")", ":", "ops_symbol", "=", "ops_symbol_map", ".", "get", "(", "type", "(", "obj", ")", ",", "SYMBOL_UNDEFINE", ")", "logger", ".", "debug", "(", "\"ops symbol: %s\"", ",", "ops_symbol", ")", "return", "ops_symbol" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/parser.py#L467-L471
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_shapestrings.py
python
ShapeString.validSString
(self, sstring)
Validate the string value in the user interface. This function is called by the toolbar or taskpanel interface when a valid string value has been entered in the input field.
Validate the string value in the user interface.
[ "Validate", "the", "string", "value", "in", "the", "user", "interface", "." ]
def validSString(self, sstring): """Validate the string value in the user interface. This function is called by the toolbar or taskpanel interface when a valid string value has been entered in the input field. """ self.SString = sstring self.ui.SSizeUi()
[ "def", "validSString", "(", "self", ",", "sstring", ")", ":", "self", ".", "SString", "=", "sstring", "self", ".", "ui", ".", "SSizeUi", "(", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_shapestrings.py#L201-L208
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
FileCtrl.SetFilterIndex
(*args, **kwargs)
return _controls_.FileCtrl_SetFilterIndex(*args, **kwargs)
SetFilterIndex(self, int filterindex)
SetFilterIndex(self, int filterindex)
[ "SetFilterIndex", "(", "self", "int", "filterindex", ")" ]
def SetFilterIndex(*args, **kwargs): """SetFilterIndex(self, int filterindex)""" return _controls_.FileCtrl_SetFilterIndex(*args, **kwargs)
[ "def", "SetFilterIndex", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "FileCtrl_SetFilterIndex", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L7659-L7661
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/dateutil/tz/_common.py
python
_tzinfo._fromutc
(self, dt)
return dt + dtdst
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. Since this is the one time that we *know* we have an unambiguous datetime object, we take this opportunity to determine whether the datetime is ambiguous and in a "fold" state (e...
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone.
[ "Given", "a", "timezone", "-", "aware", "datetime", "in", "a", "given", "timezone", "calculates", "a", "timezone", "-", "aware", "datetime", "in", "a", "new", "timezone", "." ]
def _fromutc(self, dt): """ Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. Since this is the one time that we *know* we have an unambiguous datetime object, we take this opportunity to determine whether the da...
[ "def", "_fromutc", "(", "self", ",", "dt", ")", ":", "# Re-implement the algorithm from Python's datetime.py", "dtoff", "=", "dt", ".", "utcoffset", "(", ")", "if", "dtoff", "is", "None", ":", "raise", "ValueError", "(", "\"fromutc() requires a non-None utcoffset() \"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/dateutil/tz/_common.py#L207-L242
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMT_SYM_DEF.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.algorithm = buf.readShort() if self.algorithm == TPM_ALG_ID.NULL: return self.keyBits = buf.readShort() self.mode = buf.readShort()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "algorithm", "=", "buf", ".", "readShort", "(", ")", "if", "self", ".", "algorithm", "==", "TPM_ALG_ID", ".", "NULL", ":", "return", "self", ".", "keyBits", "=", "buf", ".", "readS...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5817-L5822
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py
python
MaskedArray.__sub__
(self, other)
return subtract(self, other)
Subtract other to self, and return a new masked array.
Subtract other to self, and return a new masked array.
[ "Subtract", "other", "to", "self", "and", "return", "a", "new", "masked", "array", "." ]
def __sub__(self, other): "Subtract other to self, and return a new masked array." return subtract(self, other)
[ "def", "__sub__", "(", "self", ",", "other", ")", ":", "return", "subtract", "(", "self", ",", "other", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3697-L3699
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/GradientMagnitude2D_Sobel.py
python
transform
(dataset)
Calculate gradient magnitude of each tilt image using Sobel operator
Calculate gradient magnitude of each tilt image using Sobel operator
[ "Calculate", "gradient", "magnitude", "of", "each", "tilt", "image", "using", "Sobel", "operator" ]
def transform(dataset): """Calculate gradient magnitude of each tilt image using Sobel operator""" import numpy as np import scipy.ndimage.filters array = dataset.active_scalars array = array.astype(np.float32) # Transform the dataset along the third axis. aaSobelX = np.empty_like(array) ...
[ "def", "transform", "(", "dataset", ")", ":", "import", "numpy", "as", "np", "import", "scipy", ".", "ndimage", ".", "filters", "array", "=", "dataset", ".", "active_scalars", "array", "=", "array", ".", "astype", "(", "np", ".", "float32", ")", "# Trans...
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/GradientMagnitude2D_Sobel.py#L1-L22
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert-gpu/fp16_utils.py
python
float32_variable_storage_getter
(getter, name, shape=None, dtype=None, initializer=None, regularizer=None, trainable=True, *args, **kwargs)
return variable
Custom variable getter that forces trainable variables to be stored in float32 precision and then casts them to the training precision.
Custom variable getter that forces trainable variables to be stored in float32 precision and then casts them to the training precision.
[ "Custom", "variable", "getter", "that", "forces", "trainable", "variables", "to", "be", "stored", "in", "float32", "precision", "and", "then", "casts", "them", "to", "the", "training", "precision", "." ]
def float32_variable_storage_getter(getter, name, shape=None, dtype=None, initializer=None, regularizer=None, trainable=True, *args, **kwargs): """Custom variable getter that forces trainable variables to be ...
[ "def", "float32_variable_storage_getter", "(", "getter", ",", "name", ",", "shape", "=", "None", ",", "dtype", "=", "None", ",", "initializer", "=", "None", ",", "regularizer", "=", "None", ",", "trainable", "=", "True", ",", "*", "args", ",", "*", "*", ...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/fp16_utils.py#L20-L34
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
Trace.message
(cls, message)
Show a trace message
Show a trace message
[ "Show", "a", "trace", "message" ]
def message(cls, message): "Show a trace message" if Trace.quietmode: return if Trace.prefix and Trace.showlinesmode: message = Trace.prefix + message Trace.show(message, sys.stdout)
[ "def", "message", "(", "cls", ",", "message", ")", ":", "if", "Trace", ".", "quietmode", ":", "return", "if", "Trace", ".", "prefix", "and", "Trace", ".", "showlinesmode", ":", "message", "=", "Trace", ".", "prefix", "+", "message", "Trace", ".", "show...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L43-L49
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/response/scf_products.py
python
ProductCache.__init__
(self, *product_types)
Creates a new Product Cache Parameters ---------- *product_types, list of str A list of product labels
Creates a new Product Cache
[ "Creates", "a", "new", "Product", "Cache" ]
def __init__(self, *product_types): """Creates a new Product Cache Parameters ---------- *product_types, list of str A list of product labels """ self._products = {p: [] for p in product_types}
[ "def", "__init__", "(", "self", ",", "*", "product_types", ")", ":", "self", ".", "_products", "=", "{", "p", ":", "[", "]", "for", "p", "in", "product_types", "}" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/response/scf_products.py#L122-L130
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Appearance.setTexture2D_channels
(self, format: str, np_array3: "ndarray", topdown: bool=True)
return _robotsim.Appearance_setTexture2D_channels(self, format, np_array3, topdown)
r""" Sets a 2D texture of the given width/height from a 3D array of channels. See :func:`setTexture1D_channels` for valid format strings. Args: format (str) np_array3 (:obj:`unsigned char *`) topdown (bool, optional): default value True The array i...
r""" Sets a 2D texture of the given width/height from a 3D array of channels. See :func:`setTexture1D_channels` for valid format strings.
[ "r", "Sets", "a", "2D", "texture", "of", "the", "given", "width", "/", "height", "from", "a", "3D", "array", "of", "channels", ".", "See", ":", "func", ":", "setTexture1D_channels", "for", "valid", "format", "strings", "." ]
def setTexture2D_channels(self, format: str, np_array3: "ndarray", topdown: bool=True) ->None: r""" Sets a 2D texture of the given width/height from a 3D array of channels. See :func:`setTexture1D_channels` for valid format strings. Args: format (str) np_array3...
[ "def", "setTexture2D_channels", "(", "self", ",", "format", ":", "str", ",", "np_array3", ":", "\"ndarray\"", ",", "topdown", ":", "bool", "=", "True", ")", "->", "None", ":", "return", "_robotsim", ".", "Appearance_setTexture2D_channels", "(", "self", ",", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3007-L3021
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/lib/io/tf_record.py
python
tf_record_iterator
(path, options=None)
An iterator that read the records from a TFRecords file. Args: path: The path to the TFRecords file. options: (optional) A TFRecordOptions object. Yields: Strings. Raises: IOError: If `path` cannot be opened for reading.
An iterator that read the records from a TFRecords file.
[ "An", "iterator", "that", "read", "the", "records", "from", "a", "TFRecords", "file", "." ]
def tf_record_iterator(path, options=None): """An iterator that read the records from a TFRecords file. Args: path: The path to the TFRecords file. options: (optional) A TFRecordOptions object. Yields: Strings. Raises: IOError: If `path` cannot be opened for reading. """ compression_type ...
[ "def", "tf_record_iterator", "(", "path", ",", "options", "=", "None", ")", ":", "compression_type", "=", "TFRecordOptions", ".", "get_compression_type_string", "(", "options", ")", "with", "errors", ".", "raise_exception_on_not_ok_status", "(", ")", "as", "status",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/lib/io/tf_record.py#L53-L75
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.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/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L2301-L2366
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py
python
EmacsMode.overwrite_mode
(self, e)
Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only emacs mode; vi mode does overwrite differently. Each call to readline() starts in insert mode....
Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only emacs mode; vi mode does overwrite differently. Each call to readline() starts in insert mode....
[ "Toggle", "overwrite", "mode", ".", "With", "an", "explicit", "positive", "numeric", "argument", "switches", "to", "overwrite", "mode", ".", "With", "an", "explicit", "non", "-", "positive", "numeric", "argument", "switches", "to", "insert", "mode", ".", "This...
def overwrite_mode(self, e): # () '''Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only emacs mode; vi mode does overwrite differently. Each call...
[ "def", "overwrite_mode", "(", "self", ",", "e", ")", ":", "# ()", "pass" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L298-L307
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py
python
_create_link_from_element
( anchor, # type: HTMLElement page_url, # type: str base_url, # type: str )
return link
Convert an anchor element in a simple repository page to a Link.
Convert an anchor element in a simple repository page to a Link.
[ "Convert", "an", "anchor", "element", "in", "a", "simple", "repository", "page", "to", "a", "Link", "." ]
def _create_link_from_element( anchor, # type: HTMLElement page_url, # type: str base_url, # type: str ): # type: (...) -> Optional[Link] """ Convert an anchor element in a simple repository page to a Link. """ href = anchor.get("href") if not href: return None url ...
[ "def", "_create_link_from_element", "(", "anchor", ",", "# type: HTMLElement", "page_url", ",", "# type: str", "base_url", ",", "# type: str", ")", ":", "# type: (...) -> Optional[Link]", "href", "=", "anchor", ".", "get", "(", "\"href\"", ")", "if", "not", "href", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py#L255-L284
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/pyshell.py
python
PyShellEditorWindow.update_breakpoints
(self)
Retrieves all the breakpoints in the current window
Retrieves all the breakpoints in the current window
[ "Retrieves", "all", "the", "breakpoints", "in", "the", "current", "window" ]
def update_breakpoints(self): "Retrieves all the breakpoints in the current window" text = self.text ranges = text.tag_ranges("BREAK") linenumber_list = self.ranges_to_linenumbers(ranges) self.breakpoints = linenumber_list
[ "def", "update_breakpoints", "(", "self", ")", ":", "text", "=", "self", ".", "text", "ranges", "=", "text", ".", "tag_ranges", "(", "\"BREAK\"", ")", "linenumber_list", "=", "self", ".", "ranges_to_linenumbers", "(", "ranges", ")", "self", ".", "breakpoints...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/pyshell.py#L286-L291
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
common/thrift/generate_metrics.py
python
generate_mdl
()
Generates the CM compatible metric definition (MDL) file.
Generates the CM compatible metric definition (MDL) file.
[ "Generates", "the", "CM", "compatible", "metric", "definition", "(", "MDL", ")", "file", "." ]
def generate_mdl(): """Generates the CM compatible metric definition (MDL) file.""" metrics = [] input_file = open(options.input_schema_path) try: metrics = json.load(input_file) finally: input_file.close() # A map of entity type -> [metric dicts]. metrics_by_role = collections.defaultdict(lambda...
[ "def", "generate_mdl", "(", ")", ":", "metrics", "=", "[", "]", "input_file", "=", "open", "(", "options", ".", "input_schema_path", ")", "try", ":", "metrics", "=", "json", ".", "load", "(", "input_file", ")", "finally", ":", "input_file", ".", "close",...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/common/thrift/generate_metrics.py#L210-L243
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/conv2d.py
python
_conv2d_tbe
()
return
Conv2D TBE register
Conv2D TBE register
[ "Conv2D", "TBE", "register" ]
def _conv2d_tbe(): """Conv2D TBE register""" return
[ "def", "_conv2d_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/conv2d.py#L45-L47
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/exponential.py
python
Exponential._log_prob
(self, value, rate=None)
return self.select(comp, neginf, prob)
r""" Log probability density function of Exponential distributions. Args: Args: value (Tensor): The value to be evaluated. rate (Tensor): The rate of the distribution. Default: self.rate. Note: `value` must be greater or equal to zero. ....
r""" Log probability density function of Exponential distributions.
[ "r", "Log", "probability", "density", "function", "of", "Exponential", "distributions", "." ]
def _log_prob(self, value, rate=None): r""" Log probability density function of Exponential distributions. Args: Args: value (Tensor): The value to be evaluated. rate (Tensor): The rate of the distribution. Default: self.rate. Note: `valu...
[ "def", "_log_prob", "(", "self", ",", "value", ",", "rate", "=", "None", ")", ":", "value", "=", "self", ".", "_check_value", "(", "value", ",", "\"value\"", ")", "value", "=", "self", ".", "cast", "(", "value", ",", "self", ".", "dtype", ")", "rat...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/exponential.py#L254-L276
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
CursorKind.get_all_kinds
()
return filter(None, CursorKind._kinds)
Return all CursorKind enumeration instances.
Return all CursorKind enumeration instances.
[ "Return", "all", "CursorKind", "enumeration", "instances", "." ]
def get_all_kinds(): """Return all CursorKind enumeration instances.""" return filter(None, CursorKind._kinds)
[ "def", "get_all_kinds", "(", ")", ":", "return", "filter", "(", "None", ",", "CursorKind", ".", "_kinds", ")" ]
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L515-L517
NervanaSystems/ngraph
f677a119765ca30636cf407009dabd118664951f
python/src/ngraph/ops.py
python
subtract
( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, )
return _get_node_factory().create( "Subtract", [left_node, right_node], {"auto_broadcast": auto_broadcast.upper()} )
Return node which applies f(x) = A-B to the input nodes element-wise. :param left_node: The node providing data for left hand side of operator. :param right_node: The node providing data for right hand side of operator. :param auto_broadcast: The type of broadcasting that specifies mapping of input tensor ...
Return node which applies f(x) = A-B to the input nodes element-wise.
[ "Return", "node", "which", "applies", "f", "(", "x", ")", "=", "A", "-", "B", "to", "the", "input", "nodes", "element", "-", "wise", "." ]
def subtract( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, ) -> Node: """Return node which applies f(x) = A-B to the input nodes element-wise. :param left_node: The node providing data for left hand side of operator. :param right_no...
[ "def", "subtract", "(", "left_node", ":", "NodeInput", ",", "right_node", ":", "NodeInput", ",", "auto_broadcast", ":", "str", "=", "\"NUMPY\"", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ",", ")", "->", "Node", ":", "return", "_get_node...
https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L1066-L1083
DaFuCoding/MTCNN_Caffe
09c30c3ff391bd9cb6b249c1910afaf147767ab3
python/caffe/io.py
python
datum_to_array
(datum)
Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label.
Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label.
[ "Converts", "a", "datum", "to", "an", "array", ".", "Note", "that", "the", "label", "is", "not", "returned", "as", "one", "can", "easily", "get", "it", "by", "calling", "datum", ".", "label", "." ]
def datum_to_array(datum): """Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label. """ if len(datum.data): return np.fromstring(datum.data, dtype=np.uint8).reshape( datum.channels, datum.height, datum.width) else: ...
[ "def", "datum_to_array", "(", "datum", ")", ":", "if", "len", "(", "datum", ".", "data", ")", ":", "return", "np", ".", "fromstring", "(", "datum", ".", "data", ",", "dtype", "=", "np", ".", "uint8", ")", ".", "reshape", "(", "datum", ".", "channel...
https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/python/caffe/io.py#L84-L93
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/swgbcc/upgrade_resource_subprocessor.py
python
SWGBCCUpgradeResourceSubprocessor.monk_conversion_upgrade
(converter_group, value, operator, team=False)
return patches
Creates a patch for the monk conversion effect (ID: 27). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param value: Value used for patching the member. :type value: MemberOperator :param operator...
Creates a patch for the monk conversion effect (ID: 27).
[ "Creates", "a", "patch", "for", "the", "monk", "conversion", "effect", "(", "ID", ":", "27", ")", "." ]
def monk_conversion_upgrade(converter_group, value, operator, team=False): """ Creates a patch for the monk conversion effect (ID: 27). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param value: ...
[ "def", "monk_conversion_upgrade", "(", "converter_group", ",", "value", ",", "operator", ",", "team", "=", "False", ")", ":", "force_ids", "=", "[", "115", ",", "180", "]", "dataset", "=", "converter_group", ".", "data", "patches", "=", "[", "]", "for", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/swgbcc/upgrade_resource_subprocessor.py#L480-L564
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_shape2dview.py
python
Shape2DView.GetResources
(self)
return {'Pixmap': 'Draft_2DShapeView', 'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Shape 2D view"), 'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Creates a 2D projection of the selected objects on the XY plane.\nThe initial projection direction is the negative of the current...
Set icon, menu and tooltip.
Set icon, menu and tooltip.
[ "Set", "icon", "menu", "and", "tooltip", "." ]
def GetResources(self): """Set icon, menu and tooltip.""" return {'Pixmap': 'Draft_2DShapeView', 'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Shape 2D view"), 'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Creates a 2D projection of the selected objects on the...
[ "def", "GetResources", "(", "self", ")", ":", "return", "{", "'Pixmap'", ":", "'Draft_2DShapeView'", ",", "'MenuText'", ":", "QT_TRANSLATE_NOOP", "(", "\"Draft_Shape2DView\"", ",", "\"Shape 2D view\"", ")", ",", "'ToolTip'", ":", "QT_TRANSLATE_NOOP", "(", "\"Draft_S...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_shape2dview.py#L55-L60
avast/retdec
b9879088a5f0278508185ec645494e6c5c57a455
scripts/type_extractor/type_extractor/json_types.py
python
convert_func_types_to_type_for_json
(functions, types)
Converts parameters and return type of function declaration to json representation.
Converts parameters and return type of function declaration to json representation.
[ "Converts", "parameters", "and", "return", "type", "of", "function", "declaration", "to", "json", "representation", "." ]
def convert_func_types_to_type_for_json(functions, types): """Converts parameters and return type of function declaration to json representation.""" for name, f_info in functions.items(): t = parse_type_to_type_for_json(f_info.ret_type_text, types) if t.type_hash not in types: types[...
[ "def", "convert_func_types_to_type_for_json", "(", "functions", ",", "types", ")", ":", "for", "name", ",", "f_info", "in", "functions", ".", "items", "(", ")", ":", "t", "=", "parse_type_to_type_for_json", "(", "f_info", ".", "ret_type_text", ",", "types", ")...
https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/json_types.py#L316-L323
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/r4/json_format.py
python
json_fhir_string_to_proto
( raw_json: str, proto_cls: Type[_T], *, validate: bool = True, default_timezone: str = _primitive_time_utils.SIMPLE_ZULU)
return resource
Creates a resource of proto_cls and merges contents of raw_json into it. Args: raw_json: The raw FHIR JSON string to convert. proto_cls: A subclass of message.Message to instantiate and return. validate: A Boolean value indicating if validation should be performed on the resultant Message. Validati...
Creates a resource of proto_cls and merges contents of raw_json into it.
[ "Creates", "a", "resource", "of", "proto_cls", "and", "merges", "contents", "of", "raw_json", "into", "it", "." ]
def json_fhir_string_to_proto( raw_json: str, proto_cls: Type[_T], *, validate: bool = True, default_timezone: str = _primitive_time_utils.SIMPLE_ZULU) -> _T: """Creates a resource of proto_cls and merges contents of raw_json into it. Args: raw_json: The raw FHIR JSON string to convert. ...
[ "def", "json_fhir_string_to_proto", "(", "raw_json", ":", "str", ",", "proto_cls", ":", "Type", "[", "_T", "]", ",", "*", ",", "validate", ":", "bool", "=", "True", ",", "default_timezone", ":", "str", "=", "_primitive_time_utils", ".", "SIMPLE_ZULU", ")", ...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/r4/json_format.py#L64-L92
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/skype_api.py
python
SkypeAPI.poll_events
(self, wait = 0)
Polls for events from Skype
Polls for events from Skype
[ "Polls", "for", "events", "from", "Skype" ]
def poll_events(self, wait = 0): """Polls for events from Skype""" # TODO disconnection handling self.run_queue() self.run_poll_for_events(wait) self.run_queue()
[ "def", "poll_events", "(", "self", ",", "wait", "=", "0", ")", ":", "# TODO disconnection handling", "self", ".", "run_queue", "(", ")", "self", ".", "run_poll_for_events", "(", "wait", ")", "self", ".", "run_queue", "(", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/skype_api.py#L165-L170
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Rect2D.MoveTopTo
(*args, **kwargs)
return _core_.Rect2D_MoveTopTo(*args, **kwargs)
MoveTopTo(self, Double n)
MoveTopTo(self, Double n)
[ "MoveTopTo", "(", "self", "Double", "n", ")" ]
def MoveTopTo(*args, **kwargs): """MoveTopTo(self, Double n)""" return _core_.Rect2D_MoveTopTo(*args, **kwargs)
[ "def", "MoveTopTo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_MoveTopTo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1875-L1877
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/telnetlib.py
python
Telnet.listener
(self)
Helper for mt_interact() -- this executes in the other thread.
Helper for mt_interact() -- this executes in the other thread.
[ "Helper", "for", "mt_interact", "()", "--", "this", "executes", "in", "the", "other", "thread", "." ]
def listener(self): """Helper for mt_interact() -- this executes in the other thread.""" while 1: try: data = self.read_eager() except EOFError: print '*** Connection closed by remote host ***' return if data: ...
[ "def", "listener", "(", "self", ")", ":", "while", "1", ":", "try", ":", "data", "=", "self", ".", "read_eager", "(", ")", "except", "EOFError", ":", "print", "'*** Connection closed by remote host ***'", "return", "if", "data", ":", "sys", ".", "stdout", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/telnetlib.py#L614-L625
physercoe/starquant
c00cad64d1de2da05081b3dc320ef264c6295e08
source/gui/ui_basic.py
python
BaseMonitor.init_table
(self)
Initialize table.
Initialize table.
[ "Initialize", "table", "." ]
def init_table(self): """ Initialize table. """ self.setColumnCount(len(self.headers)) labels = [d["display"] for d in self.headers.values()] self.setHorizontalHeaderLabels(labels) self.verticalHeader().setVisible(False) self.setEditTriggers(self.NoEditT...
[ "def", "init_table", "(", "self", ")", ":", "self", ".", "setColumnCount", "(", "len", "(", "self", ".", "headers", ")", ")", "labels", "=", "[", "d", "[", "\"display\"", "]", "for", "d", "in", "self", ".", "headers", ".", "values", "(", ")", "]", ...
https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/gui/ui_basic.py#L256-L268
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/examples/urbanczik_synapse_example.py
python
h
(U, nrn_params)
return 15.0 * beta / (1.0 + np.exp(-beta * (theta - U)) / k)
derivative of the rate function phi
derivative of the rate function phi
[ "derivative", "of", "the", "rate", "function", "phi" ]
def h(U, nrn_params): """ derivative of the rate function phi """ k = nrn_params['rate_slope'] beta = nrn_params['beta'] theta = nrn_params['theta'] return 15.0 * beta / (1.0 + np.exp(-beta * (theta - U)) / k)
[ "def", "h", "(", "U", ",", "nrn_params", ")", ":", "k", "=", "nrn_params", "[", "'rate_slope'", "]", "beta", "=", "nrn_params", "[", "'beta'", "]", "theta", "=", "nrn_params", "[", "'theta'", "]", "return", "15.0", "*", "beta", "/", "(", "1.0", "+", ...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/examples/urbanczik_synapse_example.py#L95-L102
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/sat/python/cp_model.py
python
CpSolver.SufficientAssumptionsForInfeasibility
(self)
return self.__solution.sufficient_assumptions_for_infeasibility
Returns the indices of the infeasible assumptions.
Returns the indices of the infeasible assumptions.
[ "Returns", "the", "indices", "of", "the", "infeasible", "assumptions", "." ]
def SufficientAssumptionsForInfeasibility(self): """Returns the indices of the infeasible assumptions.""" return self.__solution.sufficient_assumptions_for_infeasibility
[ "def", "SufficientAssumptionsForInfeasibility", "(", "self", ")", ":", "return", "self", ".", "__solution", ".", "sufficient_assumptions_for_infeasibility" ]
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L2209-L2211
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py
python
_read_platforms_for_host
()
return validated_platforms_for_host, alias_to_platforms_map
Private initializer function to initialize the map of platform names to their PlatformDetails instance and a map of aliases to their platform names :return: Tuple of : [0] Map of platform names to their PlatformDetails object [1] Map of aliases to a list of platform names that belong i...
Private initializer function to initialize the map of platform names to their PlatformDetails instance and a map of aliases to their platform names :return: Tuple of : [0] Map of platform names to their PlatformDetails object [1] Map of aliases to a list of platform names that belong i...
[ "Private", "initializer", "function", "to", "initialize", "the", "map", "of", "platform", "names", "to", "their", "PlatformDetails", "instance", "and", "a", "map", "of", "aliases", "to", "their", "platform", "names", ":", "return", ":", "Tuple", "of", ":", "...
def _read_platforms_for_host(): """ Private initializer function to initialize the map of platform names to their PlatformDetails instance and a map of aliases to their platform names :return: Tuple of : [0] Map of platform names to their PlatformDetails object [1] Map of alias...
[ "def", "_read_platforms_for_host", "(", ")", ":", "validated_platforms_for_host", "=", "{", "}", "alias_to_platforms_map", "=", "{", "}", "for", "platform_setting", "in", "settings_manager", ".", "LUMBERYARD_SETTINGS", ".", "get_all_platform_settings", "(", ")", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py#L462-L523
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/datasets/base.py
python
load_csv_with_header
(filename, target_dtype, features_dtype, target_column=-1)
return Dataset(data=data, target=target)
Load dataset from CSV file with a header row.
Load dataset from CSV file with a header row.
[ "Load", "dataset", "from", "CSV", "file", "with", "a", "header", "row", "." ]
def load_csv_with_header(filename, target_dtype, features_dtype, target_column=-1): """Load dataset from CSV file with a header row.""" with gfile.Open(filename) as csv_file: data_file = csv.reader(csv_file) header = next(data_file) ...
[ "def", "load_csv_with_header", "(", "filename", ",", "target_dtype", ",", "features_dtype", ",", "target_column", "=", "-", "1", ")", ":", "with", "gfile", ".", "Open", "(", "filename", ")", "as", "csv_file", ":", "data_file", "=", "csv", ".", "reader", "(...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/datasets/base.py#L40-L56
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
SimpleHtmlListBox._Clear
(*args, **kwargs)
return _windows_.SimpleHtmlListBox__Clear(*args, **kwargs)
_Clear(self)
_Clear(self)
[ "_Clear", "(", "self", ")" ]
def _Clear(*args, **kwargs): """_Clear(self)""" return _windows_.SimpleHtmlListBox__Clear(*args, **kwargs)
[ "def", "_Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SimpleHtmlListBox__Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2788-L2790
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl_compatibility_errors.py
python
IDLCompatibilityContext.add_new_param_or_command_type_field_missing_error
(self, command_name: str, field_name: str, file: str, type_name: str, is_command_parameter: bool)
Add an error about a parameter or command type field that is missing in the new command.
Add an error about a parameter or command type field that is missing in the new command.
[ "Add", "an", "error", "about", "a", "parameter", "or", "command", "type", "field", "that", "is", "missing", "in", "the", "new", "command", "." ]
def add_new_param_or_command_type_field_missing_error(self, command_name: str, field_name: str, file: str, type_name: str, is_command_parameter: bool) -> None: # pylint: disable=too-many-arguments...
[ "def", "add_new_param_or_command_type_field_missing_error", "(", "self", ",", "command_name", ":", "str", ",", "field_name", ":", "str", ",", "file", ":", "str", ",", "type_name", ":", "str", ",", "is_command_parameter", ":", "bool", ")", "->", "None", ":", "#...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl_compatibility_errors.py#L443-L458
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/msvs.py
python
_AddActionStep
(actions_dict, inputs, outputs, description, command)
Merge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. Arguments: actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached...
Merge action into an existing list of actions.
[ "Merge", "action", "into", "an", "existing", "list", "of", "actions", "." ]
def _AddActionStep(actions_dict, inputs, outputs, description, command): """Merge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. Arguments: actions_dict: dictionary keyed on i...
[ "def", "_AddActionStep", "(", "actions_dict", ",", "inputs", ",", "outputs", ",", "description", ",", "command", ")", ":", "# Require there to be at least one input (call sites will ensure this).", "assert", "inputs", "action", "=", "{", "'inputs'", ":", "inputs", ",", ...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L334-L366
eric1688/sphinx
514317761b35c07eb9f36db55a1ff365c4a9f0bc
api/sphinxapi.py
python
SphinxClient._GetResponse
(self, sock, client_ver)
return response
INTERNAL METHOD, DO NOT CALL. Gets and checks response packet from searchd server.
INTERNAL METHOD, DO NOT CALL. Gets and checks response packet from searchd server.
[ "INTERNAL", "METHOD", "DO", "NOT", "CALL", ".", "Gets", "and", "checks", "response", "packet", "from", "searchd", "server", "." ]
def _GetResponse (self, sock, client_ver): """ INTERNAL METHOD, DO NOT CALL. Gets and checks response packet from searchd server. """ (status, ver, length) = unpack('>2HL', sock.recv(8)) response = '' left = length while left>0: chunk = sock.recv(left) if chunk: response += chunk left -= len...
[ "def", "_GetResponse", "(", "self", ",", "sock", ",", "client_ver", ")", ":", "(", "status", ",", "ver", ",", "length", ")", "=", "unpack", "(", "'>2HL'", ",", "sock", ".", "recv", "(", "8", ")", ")", "response", "=", "''", "left", "=", "length", ...
https://github.com/eric1688/sphinx/blob/514317761b35c07eb9f36db55a1ff365c4a9f0bc/api/sphinxapi.py#L255-L306
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
afanasy/python/af.py
python
Cmd.getJobList
(self, verbose=False, ids=None)
return None
Missing DocString :param bool verbose: :return:
Missing DocString
[ "Missing", "DocString" ]
def getJobList(self, verbose=False, ids=None): """Missing DocString :param bool verbose: :return: """ self.action = 'get' self.data['type'] = 'jobs' if ids is not None: self.data['ids'] = ids data = self._sendRequest(verbose) if data i...
[ "def", "getJobList", "(", "self", ",", "verbose", "=", "False", ",", "ids", "=", "None", ")", ":", "self", ".", "action", "=", "'get'", "self", ".", "data", "[", "'type'", "]", "=", "'jobs'", "if", "ids", "is", "not", "None", ":", "self", ".", "d...
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/af.py#L930-L944
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetExtraPlistItems
(self, configname=None)
return items
Returns a dictionary with extra items to insert into Info.plist.
Returns a dictionary with extra items to insert into Info.plist.
[ "Returns", "a", "dictionary", "with", "extra", "items", "to", "insert", "into", "Info", ".", "plist", "." ]
def GetExtraPlistItems(self, configname=None): """Returns a dictionary with extra items to insert into Info.plist.""" if configname not in XcodeSettings._plist_cache: cache = {} cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() xcode, xcode_build = XcodeVersion() cache['DTXcode...
[ "def", "GetExtraPlistItems", "(", "self", ",", "configname", "=", "None", ")", ":", "if", "configname", "not", "in", "XcodeSettings", ".", "_plist_cache", ":", "cache", "=", "{", "}", "cache", "[", "'BuildMachineOSBuild'", "]", "=", "self", ".", "_BuildMachi...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/xcode_emulation.py#L1090-L1137
tcpexmachina/remy
687b5db29b81df7ae8737889c78b47e7f9788297
scripts/plot_log.py
python
BaseSingleAnimationGenerator.get_plot_data
(self, run_data)
Must be impelemented by subclasses. Returns a tuple of two elements (x, y) each being a list of data points. The two lists must have the same length.
Must be impelemented by subclasses. Returns a tuple of two elements (x, y) each being a list of data points. The two lists must have the same length.
[ "Must", "be", "impelemented", "by", "subclasses", ".", "Returns", "a", "tuple", "of", "two", "elements", "(", "x", "y", ")", "each", "being", "a", "list", "of", "data", "points", ".", "The", "two", "lists", "must", "have", "the", "same", "length", "." ...
def get_plot_data(self, run_data): """Must be impelemented by subclasses. Returns a tuple of two elements (x, y) each being a list of data points. The two lists must have the same length.""" raise NotImplementedError("Subclasses must implement get_plot_data()")
[ "def", "get_plot_data", "(", "self", ",", "run_data", ")", ":", "raise", "NotImplementedError", "(", "\"Subclasses must implement get_plot_data()\"", ")" ]
https://github.com/tcpexmachina/remy/blob/687b5db29b81df7ae8737889c78b47e7f9788297/scripts/plot_log.py#L197-L201
google/ion
ef47f3b824050499ce5c6f774b366f6c4dbce0af
ion/build.py
python
_PrintTestHeader
(test_target_name)
Print a unified test header to identify the start of a test. Args: test_target_name: The name of the test.
Print a unified test header to identify the start of a test.
[ "Print", "a", "unified", "test", "header", "to", "identify", "the", "start", "of", "a", "test", "." ]
def _PrintTestHeader(test_target_name): """Print a unified test header to identify the start of a test. Args: test_target_name: The name of the test. """ print '=' * 30, test_target_name, '=' * 30
[ "def", "_PrintTestHeader", "(", "test_target_name", ")", ":", "print", "'='", "*", "30", ",", "test_target_name", ",", "'='", "*", "30" ]
https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/build.py#L197-L203
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBStream.Print
(self, str)
return _lldb.SBStream_Print(self, str)
Print(SBStream self, char const * str)
Print(SBStream self, char const * str)
[ "Print", "(", "SBStream", "self", "char", "const", "*", "str", ")" ]
def Print(self, str): """Print(SBStream self, char const * str)""" return _lldb.SBStream_Print(self, str)
[ "def", "Print", "(", "self", ",", "str", ")", ":", "return", "_lldb", ".", "SBStream_Print", "(", "self", ",", "str", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9538-L9540
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/split-lib.py
python
TimingScriptGenerator.writeTimingCall
(self, irname, callname)
Echo some comments and invoke both versions of toy
Echo some comments and invoke both versions of toy
[ "Echo", "some", "comments", "and", "invoke", "both", "versions", "of", "toy" ]
def writeTimingCall(self, irname, callname): """Echo some comments and invoke both versions of toy""" rootname = irname if '.' in irname: rootname = irname[:irname.rfind('.')] self.shfile.write("echo \"%s: Calls %s\" >> %s\n" % (callname, irname, self.timeFile)) self....
[ "def", "writeTimingCall", "(", "self", ",", "irname", ",", "callname", ")", ":", "rootname", "=", "irname", "if", "'.'", "in", "irname", ":", "rootname", "=", "irname", "[", ":", "irname", ".", "rfind", "(", "'.'", ")", "]", "self", ".", "shfile", "....
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/split-lib.py#L10-L32
ros/geometry2
c0cb44e5315abc6067d7640cf58487e61d8d680a
tf2_ros/src/tf2_ros/buffer_interface.py
python
BufferInterface.can_transform_full
(self, target_frame, target_time, source_frame, source_time, fixed_frame, timeout=rospy.Duration(0.0))
Check if a transform from the source frame to the target frame is possible (advanced API). Must be implemented by a subclass of BufferInterface. :param target_frame: Name of the frame to transform into. :param target_time: The time to transform to. (0 will get the latest) :param sourc...
Check if a transform from the source frame to the target frame is possible (advanced API).
[ "Check", "if", "a", "transform", "from", "the", "source", "frame", "to", "the", "target", "frame", "is", "possible", "(", "advanced", "API", ")", "." ]
def can_transform_full(self, target_frame, target_time, source_frame, source_time, fixed_frame, timeout=rospy.Duration(0.0)): """ Check if a transform from the source frame to the target frame is possible (advanced API). Must be implemented by a subclass of BufferInterface. :param targ...
[ "def", "can_transform_full", "(", "self", ",", "target_frame", ",", "target_time", ",", "source_frame", ",", "source_time", ",", "fixed_frame", ",", "timeout", "=", "rospy", ".", "Duration", "(", "0.0", ")", ")", ":", "raise", "NotImplementedException", "(", "...
https://github.com/ros/geometry2/blob/c0cb44e5315abc6067d7640cf58487e61d8d680a/tf2_ros/src/tf2_ros/buffer_interface.py#L151-L166
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/external/daemon/daemon.py
python
change_root_directory
(directory)
Change the root directory of this process. Sets the current working directory, then the process root directory, to the specified `directory`. Requires appropriate OS privileges for this process.
Change the root directory of this process.
[ "Change", "the", "root", "directory", "of", "this", "process", "." ]
def change_root_directory(directory): """ Change the root directory of this process. Sets the current working directory, then the process root directory, to the specified `directory`. Requires appropriate OS privileges for this process. """ try: os.chdir(directory) ...
[ "def", "change_root_directory", "(", "directory", ")", ":", "try", ":", "os", ".", "chdir", "(", "directory", ")", "os", ".", "chroot", "(", "directory", ")", "except", ":", "error", "=", "DaemonOSEnvironmentError", "(", "\"Unable to change root directory (%(exc)s...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/daemon/daemon.py#L512-L527
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/jedi/jedi/parser/representation.py
python
Simple.get_parent_until
(self, classes=(), reverse=False, include_current=True)
return scope
Takes always the parent, until one class (not a Class)
Takes always the parent, until one class (not a Class)
[ "Takes", "always", "the", "parent", "until", "one", "class", "(", "not", "a", "Class", ")" ]
def get_parent_until(self, classes=(), reverse=False, include_current=True): """ Takes always the parent, until one class (not a Class) """ if type(classes) not in (tuple, list): classes = (classes,) scope = self if include_current else self.parent wh...
[ "def", "get_parent_until", "(", "self", ",", "classes", "=", "(", ")", ",", "reverse", "=", "False", ",", "include_current", "=", "True", ")", ":", "if", "type", "(", "classes", ")", "not", "in", "(", "tuple", ",", "list", ")", ":", "classes", "=", ...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/parser/representation.py#L112-L122
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/tensorboard/backend/handler.py
python
TensorboardHandler._image_response_for_run
(self, run_images, run, tag)
return response
Builds a JSON-serializable object with information about run_images. Args: run_images: A list of event_accumulator.ImageValueEvent objects. run: The name of the run. tag: The name of the tag the images all belong to. Returns: A list of dictionaries containing the wall time, step, URL, ...
Builds a JSON-serializable object with information about run_images.
[ "Builds", "a", "JSON", "-", "serializable", "object", "with", "information", "about", "run_images", "." ]
def _image_response_for_run(self, run_images, run, tag): """Builds a JSON-serializable object with information about run_images. Args: run_images: A list of event_accumulator.ImageValueEvent objects. run: The name of the run. tag: The name of the tag the images all belong to. Returns: ...
[ "def", "_image_response_for_run", "(", "self", ",", "run_images", ",", "run", ",", "tag", ")", ":", "response", "=", "[", "]", "for", "index", ",", "run_image", "in", "enumerate", "(", "run_images", ")", ":", "response", ".", "append", "(", "{", "'wall_t...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/tensorboard/backend/handler.py#L111-L134
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/Data/MLData.py
python
MLQuantDataSet.GetResults
(self)
return res
Returns the result fields from each example
Returns the result fields from each example
[ "Returns", "the", "result", "fields", "from", "each", "example" ]
def GetResults(self): """ Returns the result fields from each example """ if self.GetNResults() > 1: v = self.GetNResults() res = [x[-v:] for x in self.data] else: res = [x[-1] for x in self.data] return res
[ "def", "GetResults", "(", "self", ")", ":", "if", "self", ".", "GetNResults", "(", ")", ">", "1", ":", "v", "=", "self", ".", "GetNResults", "(", ")", "res", "=", "[", "x", "[", "-", "v", ":", "]", "for", "x", "in", "self", ".", "data", "]", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Data/MLData.py#L264-L273
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
Notebook.GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.Notebook_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific co...
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Notebook_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3116-L3131