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
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/apps/adminsettings/service.py
python
AdminSettingsService.IsUserMigrationEnabled
(self)
Is User Migration Enabled Args: None Returns: boolean, is user migration enabled
Is User Migration Enabled
[ "Is", "User", "Migration", "Enabled" ]
def IsUserMigrationEnabled(self): """Is User Migration Enabled Args: None Returns: boolean, is user migration enabled""" result = self.genericGet('email/migration') if result['enableUserMigration'] == 'true': return True else: return False
[ "def", "IsUserMigrationEnabled", "(", "self", ")", ":", "result", "=", "self", ".", "genericGet", "(", "'email/migration'", ")", "if", "result", "[", "'enableUserMigration'", "]", "==", "'true'", ":", "return", "True", "else", ":", "return", "False" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/apps/adminsettings/service.py#L382-L395
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/ide/activegrid/tool/ProjectEditor.py
python
ProjectView.FilesHasFocus
(self)
return False
Does Project Tree have focus
Does Project Tree have focus
[ "Does", "Project", "Tree", "have", "focus" ]
def FilesHasFocus(self): """ Does Project Tree have focus """ winWithFocus = wx.Window.FindFocus() if not winWithFocus: return False while winWithFocus: if winWithFocus == self._treeCtrl: return True winWithFocus = winWithFocus.GetParen...
[ "def", "FilesHasFocus", "(", "self", ")", ":", "winWithFocus", "=", "wx", ".", "Window", ".", "FindFocus", "(", ")", "if", "not", "winWithFocus", ":", "return", "False", "while", "winWithFocus", ":", "if", "winWithFocus", "==", "self", ".", "_treeCtrl", ":...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/ProjectEditor.py#L2184-L2193
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py
python
BaseHistGradientBoosting._clear_state
(self)
Clear the state of the gradient boosting model.
Clear the state of the gradient boosting model.
[ "Clear", "the", "state", "of", "the", "gradient", "boosting", "model", "." ]
def _clear_state(self): """Clear the state of the gradient boosting model.""" for var in ('train_score_', 'validation_score_'): if hasattr(self, var): delattr(self, var)
[ "def", "_clear_state", "(", "self", ")", ":", "for", "var", "in", "(", "'train_score_'", ",", "'validation_score_'", ")", ":", "if", "hasattr", "(", "self", ",", "var", ")", ":", "delattr", "(", "self", ",", "var", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py#L401-L405
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py
python
Reset
()
Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.
Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.
[ "Reset", "global", "state", ".", "Used", "by", "unit", "tests", "that", "end", "up", "using", "SConsign", "multiple", "times", "to", "get", "a", "clean", "slate", "for", "each", "test", "." ]
def Reset(): """Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.""" global sig_files, DB_sync_list sig_files = [] DB_sync_list = []
[ "def", "Reset", "(", ")", ":", "global", "sig_files", ",", "DB_sync_list", "sig_files", "=", "[", "]", "DB_sync_list", "=", "[", "]" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py#L90-L95
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TUNGraph.DelEdge
(self, *args)
return _snap.TUNGraph_DelEdge(self, *args)
DelEdge(TUNGraph self, int const & SrcNId, int const & DstNId) Parameters: SrcNId: int const & DstNId: int const &
DelEdge(TUNGraph self, int const & SrcNId, int const & DstNId)
[ "DelEdge", "(", "TUNGraph", "self", "int", "const", "&", "SrcNId", "int", "const", "&", "DstNId", ")" ]
def DelEdge(self, *args): """ DelEdge(TUNGraph self, int const & SrcNId, int const & DstNId) Parameters: SrcNId: int const & DstNId: int const & """ return _snap.TUNGraph_DelEdge(self, *args)
[ "def", "DelEdge", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TUNGraph_DelEdge", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L3607-L3616
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
TextDataObject.GetText
(*args, **kwargs)
return _misc_.TextDataObject_GetText(*args, **kwargs)
GetText(self) -> String Returns the text associated with the data object.
GetText(self) -> String
[ "GetText", "(", "self", ")", "-", ">", "String" ]
def GetText(*args, **kwargs): """ GetText(self) -> String Returns the text associated with the data object. """ return _misc_.TextDataObject_GetText(*args, **kwargs)
[ "def", "GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TextDataObject_GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5201-L5207
yue/yue
619d62c191b13c51c01be451dc48917c34a5aefc
building/tools/cpplint.py
python
CheckForMultilineCommentsAndStrings
(filename, clean_lines, linenum, error)
Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backsla...
Logs an error if we see /* ... */ or "..." that extend past one line.
[ "Logs", "an", "error", "if", "we", "see", "/", "*", "...", "*", "/", "or", "...", "that", "extend", "past", "one", "line", "." ]
def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings...
[ "def", "CheckForMultilineCommentsAndStrings", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the", "# secon...
https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L2045-L2080
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/ndarray/ndarray.py
python
NDArray.broadcast_axes
(self, *args, **kwargs)
return op.broadcast_axes(self, *args, **kwargs)
Convenience fluent method for :py:func:`broadcast_axes`. The arguments are the same as for :py:func:`broadcast_axes`, with this array as data.
Convenience fluent method for :py:func:`broadcast_axes`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "broadcast_axes", "." ]
def broadcast_axes(self, *args, **kwargs): """Convenience fluent method for :py:func:`broadcast_axes`. The arguments are the same as for :py:func:`broadcast_axes`, with this array as data. """ return op.broadcast_axes(self, *args, **kwargs)
[ "def", "broadcast_axes", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "broadcast_axes", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L1590-L1596
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/mount.py
python
CephFSMount.kill
(self)
Suspend the netns veth interface to make the client disconnected from the ceph cluster
Suspend the netns veth interface to make the client disconnected from the ceph cluster
[ "Suspend", "the", "netns", "veth", "interface", "to", "make", "the", "client", "disconnected", "from", "the", "ceph", "cluster" ]
def kill(self): """ Suspend the netns veth interface to make the client disconnected from the ceph cluster """ log.info('Killing connection on {0}...'.format(self.client_remote.name)) self.suspend_netns()
[ "def", "kill", "(", "self", ")", ":", "log", ".", "info", "(", "'Killing connection on {0}...'", ".", "format", "(", "self", ".", "client_remote", ".", "name", ")", ")", "self", ".", "suspend_netns", "(", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/mount.py#L533-L539
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/resample.py
python
_get_timestamp_range_edges
( first, last, freq, closed="left", origin="start_day", offset=None )
return first, last
Adjust the `first` Timestamp to the preceding Timestamp that resides on the provided offset. Adjust the `last` Timestamp to the following Timestamp that resides on the provided offset. Input Timestamps that already reside on the offset will be adjusted depending on the type of offset and the `closed` pa...
Adjust the `first` Timestamp to the preceding Timestamp that resides on the provided offset. Adjust the `last` Timestamp to the following Timestamp that resides on the provided offset. Input Timestamps that already reside on the offset will be adjusted depending on the type of offset and the `closed` pa...
[ "Adjust", "the", "first", "Timestamp", "to", "the", "preceding", "Timestamp", "that", "resides", "on", "the", "provided", "offset", ".", "Adjust", "the", "last", "Timestamp", "to", "the", "following", "Timestamp", "that", "resides", "on", "the", "provided", "o...
def _get_timestamp_range_edges( first, last, freq, closed="left", origin="start_day", offset=None ): """ Adjust the `first` Timestamp to the preceding Timestamp that resides on the provided offset. Adjust the `last` Timestamp to the following Timestamp that resides on the provided offset. Input Time...
[ "def", "_get_timestamp_range_edges", "(", "first", ",", "last", ",", "freq", ",", "closed", "=", "\"left\"", ",", "origin", "=", "\"start_day\"", ",", "offset", "=", "None", ")", ":", "from", "pandas", ".", "tseries", ".", "offsets", "import", "Day", ",", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/resample.py#L215-L292
mitsuba-renderer/mitsuba2
4e7628c6eed365904ca2ba536b795d1b03410344
src/python/python/xml.py
python
WriteXML.transform_matrix
(self, transform)
return params
Converts a mitsuba Transform4f into a dict entry. This dict entry won't have a 'type' because it's handled in a specific case. Params ------ transform: the given transform matrix
Converts a mitsuba Transform4f into a dict entry. This dict entry won't have a 'type' because it's handled in a specific case.
[ "Converts", "a", "mitsuba", "Transform4f", "into", "a", "dict", "entry", ".", "This", "dict", "entry", "won", "t", "have", "a", "type", "because", "it", "s", "handled", "in", "a", "specific", "case", "." ]
def transform_matrix(self, transform): ''' Converts a mitsuba Transform4f into a dict entry. This dict entry won't have a 'type' because it's handled in a specific case. Params ------ transform: the given transform matrix ''' value = " ".join(["%f" % x ...
[ "def", "transform_matrix", "(", "self", ",", "transform", ")", ":", "value", "=", "\" \"", ".", "join", "(", "[", "\"%f\"", "%", "x", "for", "x", "in", "transform", ".", "matrix", ".", "numpy", "(", ")", ".", "flatten", "(", ")", "]", ")", "params"...
https://github.com/mitsuba-renderer/mitsuba2/blob/4e7628c6eed365904ca2ba536b795d1b03410344/src/python/python/xml.py#L652-L671
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cryptography/hazmat/backends/openssl/encode_asn1.py
python
_encode_asn1_int
(backend, x)
return i
Converts a python integer to an ASN1_INTEGER. The returned ASN1_INTEGER will not be garbage collected (to support adding them to structs that take ownership of the object). Be sure to register it for GC if it will be discarded after use.
Converts a python integer to an ASN1_INTEGER. The returned ASN1_INTEGER will not be garbage collected (to support adding them to structs that take ownership of the object). Be sure to register it for GC if it will be discarded after use.
[ "Converts", "a", "python", "integer", "to", "an", "ASN1_INTEGER", ".", "The", "returned", "ASN1_INTEGER", "will", "not", "be", "garbage", "collected", "(", "to", "support", "adding", "them", "to", "structs", "that", "take", "ownership", "of", "the", "object", ...
def _encode_asn1_int(backend, x): """ Converts a python integer to an ASN1_INTEGER. The returned ASN1_INTEGER will not be garbage collected (to support adding them to structs that take ownership of the object). Be sure to register it for GC if it will be discarded after use. """ # Convert P...
[ "def", "_encode_asn1_int", "(", "backend", ",", "x", ")", ":", "# Convert Python integer to OpenSSL \"bignum\" in case value exceeds", "# machine's native integer limits (note: `int_to_bn` doesn't automatically", "# GC).", "i", "=", "backend", ".", "_int_to_bn", "(", "x", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cryptography/hazmat/backends/openssl/encode_asn1.py#L23-L40
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/blocks.py
python
Block.array_values
(self)
return PandasArray(self.values)
The array that Series.array returns. Always an ExtensionArray.
The array that Series.array returns. Always an ExtensionArray.
[ "The", "array", "that", "Series", ".", "array", "returns", ".", "Always", "an", "ExtensionArray", "." ]
def array_values(self) -> ExtensionArray: """ The array that Series.array returns. Always an ExtensionArray. """ # error: Argument 1 to "PandasArray" has incompatible type "Union[ndarray, # ExtensionArray]"; expected "Union[ndarray, PandasArray]" return PandasArray(self.v...
[ "def", "array_values", "(", "self", ")", "->", "ExtensionArray", ":", "# error: Argument 1 to \"PandasArray\" has incompatible type \"Union[ndarray,", "# ExtensionArray]\"; expected \"Union[ndarray, PandasArray]\"", "return", "PandasArray", "(", "self", ".", "values", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L213-L219
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Irnn.py
python
Irnn.input_weight_std
(self)
return self._internal.get_input_weight_std()
Gets the standard deviation for input weights.
Gets the standard deviation for input weights.
[ "Gets", "the", "standard", "deviation", "for", "input", "weights", "." ]
def input_weight_std(self): """Gets the standard deviation for input weights. """ return self._internal.get_input_weight_std()
[ "def", "input_weight_std", "(", "self", ")", ":", "return", "self", ".", "_internal", ".", "get_input_weight_std", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Irnn.py#L116-L119
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextBuffer.BeginStyle
(*args, **kwargs)
return _richtext.RichTextBuffer_BeginStyle(*args, **kwargs)
BeginStyle(self, RichTextAttr style) -> bool
BeginStyle(self, RichTextAttr style) -> bool
[ "BeginStyle", "(", "self", "RichTextAttr", "style", ")", "-", ">", "bool" ]
def BeginStyle(*args, **kwargs): """BeginStyle(self, RichTextAttr style) -> bool""" return _richtext.RichTextBuffer_BeginStyle(*args, **kwargs)
[ "def", "BeginStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_BeginStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2313-L2315
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py
python
_SparseColumn.weight_tensor
(self, input_tensor)
return None
Returns the weight tensor from the given transformed input_tensor.
Returns the weight tensor from the given transformed input_tensor.
[ "Returns", "the", "weight", "tensor", "from", "the", "given", "transformed", "input_tensor", "." ]
def weight_tensor(self, input_tensor): """Returns the weight tensor from the given transformed input_tensor.""" return None
[ "def", "weight_tensor", "(", "self", ",", "input_tensor", ")", ":", "return", "None" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L257-L259
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/parsers/base_parser.py
python
_get_na_values
(col, na_values, na_fvalues, keep_default_na)
Get the NaN values for a given column. Parameters ---------- col : str The name of the column. na_values : array-like, dict The object listing the NaN values as strings. na_fvalues : array-like, dict The object listing the NaN values as floats. keep_default_na : bool ...
Get the NaN values for a given column.
[ "Get", "the", "NaN", "values", "for", "a", "given", "column", "." ]
def _get_na_values(col, na_values, na_fvalues, keep_default_na): """ Get the NaN values for a given column. Parameters ---------- col : str The name of the column. na_values : array-like, dict The object listing the NaN values as strings. na_fvalues : array-like, dict ...
[ "def", "_get_na_values", "(", "col", ",", "na_values", ",", "na_fvalues", ",", "keep_default_na", ")", ":", "if", "isinstance", "(", "na_values", ",", "dict", ")", ":", "if", "col", "in", "na_values", ":", "return", "na_values", "[", "col", "]", ",", "na...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/parsers/base_parser.py#L1148-L1180
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf_kafka/versioneer.py
python
plus_or_dot
(pieces)
return "+"
Return a + if we don't already have one, else return a .
Return a + if we don't already have one, else return a .
[ "Return", "a", "+", "if", "we", "don", "t", "already", "have", "one", "else", "return", "a", "." ]
def plus_or_dot(pieces): """Return a + if we don't already have one, else return a .""" if "+" in pieces.get("closest-tag", ""): return "." return "+"
[ "def", "plus_or_dot", "(", "pieces", ")", ":", "if", "\"+\"", "in", "pieces", ".", "get", "(", "\"closest-tag\"", ",", "\"\"", ")", ":", "return", "\".\"", "return", "\"+\"" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf_kafka/versioneer.py#L1276-L1280
zerotier/libzt
41eb9aebc80a5f1c816fa26a06cefde9de906676
src/bindings/python/sockets.py
python
socket.ioctl
(self, request, arg=0, mutate_flag=True)
return libzt.zts_py_ioctl(self._fd, request, arg, mutate_flag)
Perform I/O control operations
Perform I/O control operations
[ "Perform", "I", "/", "O", "control", "operations" ]
def ioctl(self, request, arg=0, mutate_flag=True): """Perform I/O control operations""" return libzt.zts_py_ioctl(self._fd, request, arg, mutate_flag)
[ "def", "ioctl", "(", "self", ",", "request", ",", "arg", "=", "0", ",", "mutate_flag", "=", "True", ")", ":", "return", "libzt", ".", "zts_py_ioctl", "(", "self", ".", "_fd", ",", "request", ",", "arg", ",", "mutate_flag", ")" ]
https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L307-L309
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/__init__.py
python
resource
(*args, **kwargs)
return _get_default_session().resource(*args, **kwargs)
Create a resource service client by name using the default session. See :py:meth:`boto3.session.Session.resource`.
Create a resource service client by name using the default session.
[ "Create", "a", "resource", "service", "client", "by", "name", "using", "the", "default", "session", "." ]
def resource(*args, **kwargs): """ Create a resource service client by name using the default session. See :py:meth:`boto3.session.Session.resource`. """ return _get_default_session().resource(*args, **kwargs)
[ "def", "resource", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_get_default_session", "(", ")", ".", "resource", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/__init__.py#L94-L100
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Util.py
python
Proxy.__init__
(self, subject)
Wrap an object as a Proxy object
Wrap an object as a Proxy object
[ "Wrap", "an", "object", "as", "a", "Proxy", "object" ]
def __init__(self, subject): """Wrap an object as a Proxy object""" self._subject = subject
[ "def", "__init__", "(", "self", ",", "subject", ")", ":", "self", ".", "_subject", "=", "subject" ]
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Util.py#L598-L600
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/basic_fitting_context.py
python
BasicFittingContext.dataset_names
(self)
return self._dataset_names
Returns the names of all the datasets stored in the model.
Returns the names of all the datasets stored in the model.
[ "Returns", "the", "names", "of", "all", "the", "datasets", "stored", "in", "the", "model", "." ]
def dataset_names(self) -> list: """Returns the names of all the datasets stored in the model.""" return self._dataset_names
[ "def", "dataset_names", "(", "self", ")", "->", "list", ":", "return", "self", ".", "_dataset_names" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/basic_fitting_context.py#L113-L115
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/script/scons-time.py
python
SConsTimer.get_function_time
(self, file, function)
return self.get_function_profile(file, function)[3]
Returns just the cumulative time for the specified function.
Returns just the cumulative time for the specified function.
[ "Returns", "just", "the", "cumulative", "time", "for", "the", "specified", "function", "." ]
def get_function_time(self, file, function): """ Returns just the cumulative time for the specified function. """ return self.get_function_profile(file, function)[3]
[ "def", "get_function_time", "(", "self", ",", "file", ",", "function", ")", ":", "return", "self", ".", "get_function_profile", "(", "file", ",", "function", ")", "[", "3", "]" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/script/scons-time.py#L661-L665
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/calc/calc.py
python
p_expression_group
(p)
expression : '(' expression ')
expression : '(' expression ')
[ "expression", ":", "(", "expression", ")" ]
def p_expression_group(p): "expression : '(' expression ')'" p[0] = p[2]
[ "def", "p_expression_group", "(", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "2", "]" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/calc/calc.py#L76-L78
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py
python
SocketIO.pollresponse
(self, myseq, wait)
Handle messages received on the socket. Some messages received may be asynchronous 'call' or 'queue' requests, and some may be responses for other threads. 'call' requests are passed to self.localcall() with the expectation of immediate execution, during which time the socket is not se...
Handle messages received on the socket.
[ "Handle", "messages", "received", "on", "the", "socket", "." ]
def pollresponse(self, myseq, wait): """Handle messages received on the socket. Some messages received may be asynchronous 'call' or 'queue' requests, and some may be responses for other threads. 'call' requests are passed to self.localcall() with the expectation of immediate e...
[ "def", "pollresponse", "(", "self", ",", "myseq", ",", "wait", ")", ":", "while", "1", ":", "# send queued response if there is one available", "try", ":", "qmsg", "=", "response_queue", ".", "get", "(", "0", ")", "except", "Queue", ".", "Empty", ":", "pass"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py#L389-L460
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/utils/multiclass.py
python
check_classification_targets
(y)
Ensure that target y is of a non-regression type. Only the following target types (as defined in type_of_target) are allowed: 'binary', 'multiclass', 'multiclass-multioutput', 'multilabel-indicator', 'multilabel-sequences' Parameters ---------- y : array-like
Ensure that target y is of a non-regression type.
[ "Ensure", "that", "target", "y", "is", "of", "a", "non", "-", "regression", "type", "." ]
def check_classification_targets(y): """Ensure that target y is of a non-regression type. Only the following target types (as defined in type_of_target) are allowed: 'binary', 'multiclass', 'multiclass-multioutput', 'multilabel-indicator', 'multilabel-sequences' Parameters ---------- ...
[ "def", "check_classification_targets", "(", "y", ")", ":", "y_type", "=", "type_of_target", "(", "y", ")", "if", "y_type", "not", "in", "[", "'binary'", ",", "'multiclass'", ",", "'multiclass-multioutput'", ",", "'multilabel-indicator'", ",", "'multilabel-sequences'...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/utils/multiclass.py#L158-L172
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py
python
Dirichlet.alpha
(self)
return self._alpha
Shape parameter.
Shape parameter.
[ "Shape", "parameter", "." ]
def alpha(self): """Shape parameter.""" return self._alpha
[ "def", "alpha", "(", "self", ")", ":", "return", "self", ".", "_alpha" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py#L157-L159
kevin-ssy/Optical-Flow-Guided-Feature
07d4501a29002ee7821c38c1820e4a64c1acf6e8
lib/caffe-action/scripts/cpp_lint.py
python
_IncludeState.CheckNextIncludeOrder
(self, header_type)
return ''
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
Returns a non-empty error message if the next header is out of order.
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L633-L684
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py
python
_NNTPBase.last
(self)
return self._statcmd('LAST')
Process a LAST command. No arguments. Return as for STAT.
Process a LAST command. No arguments. Return as for STAT.
[ "Process", "a", "LAST", "command", ".", "No", "arguments", ".", "Return", "as", "for", "STAT", "." ]
def last(self): """Process a LAST command. No arguments. Return as for STAT.""" return self._statcmd('LAST')
[ "def", "last", "(", "self", ")", ":", "return", "self", ".", "_statcmd", "(", "'LAST'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py#L720-L722
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
Type.is_pod
(self)
return conf.lib.clang_isPODType(self)
Determine whether this Type represents plain old data (POD).
Determine whether this Type represents plain old data (POD).
[ "Determine", "whether", "this", "Type", "represents", "plain", "old", "data", "(", "POD", ")", "." ]
def is_pod(self): """Determine whether this Type represents plain old data (POD).""" return conf.lib.clang_isPODType(self)
[ "def", "is_pod", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isPODType", "(", "self", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L2068-L2070
line/stellite
5bd1c1f5f0cdc22a65319068f4f8b2ca7769bfa1
tools/build.py
python
LinuxBuild.install_build_deps
(self)
return True
execute chromium/src/build/install_build_deps.sh
execute chromium/src/build/install_build_deps.sh
[ "execute", "chromium", "/", "src", "/", "build", "/", "install_build_deps", ".", "sh" ]
def install_build_deps(self): """execute chromium/src/build/install_build_deps.sh""" command = [ os.path.join(self.chromium_src_path, 'build', 'install-build-deps.sh') ] self.execute(command) return True
[ "def", "install_build_deps", "(", "self", ")", ":", "command", "=", "[", "os", ".", "path", ".", "join", "(", "self", ".", "chromium_src_path", ",", "'build'", ",", "'install-build-deps.sh'", ")", "]", "self", ".", "execute", "(", "command", ")", "return",...
https://github.com/line/stellite/blob/5bd1c1f5f0cdc22a65319068f4f8b2ca7769bfa1/tools/build.py#L1698-L1704
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_convert2ma.getdoc
(self)
return doc
Return the doc of the function (from the doc of the method).
Return the doc of the function (from the doc of the method).
[ "Return", "the", "doc", "of", "the", "function", "(", "from", "the", "doc", "of", "the", "method", ")", "." ]
def getdoc(self): "Return the doc of the function (from the doc of the method)." doc = getattr(self._func, '__doc__', None) sig = get_object_signature(self._func) if doc: # Add the signature of the function at the beginning of the doc if sig: sig =...
[ "def", "getdoc", "(", "self", ")", ":", "doc", "=", "getattr", "(", "self", ".", "_func", ",", "'__doc__'", ",", "None", ")", "sig", "=", "get_object_signature", "(", "self", ".", "_func", ")", "if", "doc", ":", "# Add the signature of the function at the be...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L8001-L8010
calamares/calamares
9f6f82405b3074af7c99dc26487d2e46e4ece3e5
src/modules/bootloader/main.py
python
get_efi_suffix_generator
(name)
return generator
Handle EFI bootloader Ids with @@<something>@@ for suffix-processing.
Handle EFI bootloader Ids with
[ "Handle", "EFI", "bootloader", "Ids", "with" ]
def get_efi_suffix_generator(name): """ Handle EFI bootloader Ids with @@<something>@@ for suffix-processing. """ if "@@" not in name: raise ValueError("Misplaced call to get_efi_suffix_generator, no @@") parts = name.split("@@") if len(parts) != 3: raise ValueError("EFI Id {!r} ...
[ "def", "get_efi_suffix_generator", "(", "name", ")", ":", "if", "\"@@\"", "not", "in", "name", ":", "raise", "ValueError", "(", "\"Misplaced call to get_efi_suffix_generator, no @@\"", ")", "parts", "=", "name", ".", "split", "(", "\"@@\"", ")", "if", "len", "("...
https://github.com/calamares/calamares/blob/9f6f82405b3074af7c99dc26487d2e46e4ece3e5/src/modules/bootloader/main.py#L377-L402
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMT_TK_CREATION.__init__
(self, hierarchy = TPM_HANDLE(), digest = None)
This ticket is produced by TPM2_Create() or TPM2_CreatePrimary(). It is used to bind the creation data to the object to which it applies. The ticket is computed by Attributes: hierarchy (TPM_HANDLE): The hierarchy containing name digest (bytes): This shall be the HMAC pr...
This ticket is produced by TPM2_Create() or TPM2_CreatePrimary(). It is used to bind the creation data to the object to which it applies. The ticket is computed by
[ "This", "ticket", "is", "produced", "by", "TPM2_Create", "()", "or", "TPM2_CreatePrimary", "()", ".", "It", "is", "used", "to", "bind", "the", "creation", "data", "to", "the", "object", "to", "which", "it", "applies", ".", "The", "ticket", "is", "computed"...
def __init__(self, hierarchy = TPM_HANDLE(), digest = None): """ This ticket is produced by TPM2_Create() or TPM2_CreatePrimary(). It is used to bind the creation data to the object to which it applies. The ticket is computed by Attributes: hierarchy (TPM_HANDLE): The hierar...
[ "def", "__init__", "(", "self", ",", "hierarchy", "=", "TPM_HANDLE", "(", ")", ",", "digest", "=", "None", ")", ":", "self", ".", "hierarchy", "=", "hierarchy", "self", ".", "digest", "=", "digest" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4088-L4099
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/base64.py
python
decode
(input, output)
Decode a file; input and output are binary files.
Decode a file; input and output are binary files.
[ "Decode", "a", "file", ";", "input", "and", "output", "are", "binary", "files", "." ]
def decode(input, output): """Decode a file; input and output are binary files.""" while True: line = input.readline() if not line: break s = binascii.a2b_base64(line) output.write(s)
[ "def", "decode", "(", "input", ",", "output", ")", ":", "while", "True", ":", "line", "=", "input", ".", "readline", "(", ")", "if", "not", "line", ":", "break", "s", "=", "binascii", ".", "a2b_base64", "(", "line", ")", "output", ".", "write", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/base64.py#L499-L506
sumoprojects/sumokoin
2857d0bffd36bf2aa579ef80518f4cb099c98b05
thirdparty/unbound/pythonmod/examples/inplace_callbacks.py
python
inplace_servfail_callback
(qinfo, qstate, rep, rcode, edns, opt_list_out, region)
return True
Function that will be registered as an inplace callback function. It will be called when answering with SERVFAIL. :param qinfo: query_info struct; :param qstate: module qstate. If not None the relevant opt_lists are available here; :param rep: reply_info struct. None; :param rcode...
Function that will be registered as an inplace callback function. It will be called when answering with SERVFAIL. :param qinfo: query_info struct; :param qstate: module qstate. If not None the relevant opt_lists are available here; :param rep: reply_info struct. None; :param rcode...
[ "Function", "that", "will", "be", "registered", "as", "an", "inplace", "callback", "function", ".", "It", "will", "be", "called", "when", "answering", "with", "SERVFAIL", ".", ":", "param", "qinfo", ":", "query_info", "struct", ";", ":", "param", "qstate", ...
def inplace_servfail_callback(qinfo, qstate, rep, rcode, edns, opt_list_out, region): """Function that will be registered as an inplace callback function. It will be called when answering with SERVFAIL. :param qinfo: query_info struct; :param qstate: module qstate. If not N...
[ "def", "inplace_servfail_callback", "(", "qinfo", ",", "qstate", ",", "rep", ",", "rcode", ",", "edns", ",", "opt_list_out", ",", "region", ")", ":", "log_info", "(", "\"python: called back while servfail.\"", ")", "b", "=", "bytearray", ".", "fromhex", "(", "...
https://github.com/sumoprojects/sumokoin/blob/2857d0bffd36bf2aa579ef80518f4cb099c98b05/thirdparty/unbound/pythonmod/examples/inplace_callbacks.py#L158-L181
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/bintrees/bintrees/avltree.py
python
Node.__getitem__
(self, key)
return self.left if key == 0 else self.right
x.__getitem__(key) <==> x[key], where key is 0 (left) or 1 (right)
x.__getitem__(key) <==> x[key], where key is 0 (left) or 1 (right)
[ "x", ".", "__getitem__", "(", "key", ")", "<", "==", ">", "x", "[", "key", "]", "where", "key", "is", "0", "(", "left", ")", "or", "1", "(", "right", ")" ]
def __getitem__(self, key): """ x.__getitem__(key) <==> x[key], where key is 0 (left) or 1 (right) """ return self.left if key == 0 else self.right
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "return", "self", ".", "left", "if", "key", "==", "0", "else", "self", ".", "right" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/bintrees/bintrees/avltree.py#L51-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Thread_IsMain
(*args)
return _misc_.Thread_IsMain(*args)
Thread_IsMain() -> bool
Thread_IsMain() -> bool
[ "Thread_IsMain", "()", "-", ">", "bool" ]
def Thread_IsMain(*args): """Thread_IsMain() -> bool""" return _misc_.Thread_IsMain(*args)
[ "def", "Thread_IsMain", "(", "*", "args", ")", ":", "return", "_misc_", ".", "Thread_IsMain", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L653-L655
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/service_reflection.py
python
_ServiceBuilder._CallMethod
(self, srvc, method_descriptor, rpc_controller, request, callback)
return method(rpc_controller, request, callback)
Calls the method described by a given method descriptor. Args: srvc: Instance of the service for which this method is called. method_descriptor: Descriptor that represent the method to call. rpc_controller: RPC controller to use for this method's execution. request: Request protocol message...
Calls the method described by a given method descriptor.
[ "Calls", "the", "method", "described", "by", "a", "given", "method", "descriptor", "." ]
def _CallMethod(self, srvc, method_descriptor, rpc_controller, request, callback): """Calls the method described by a given method descriptor. Args: srvc: Instance of the service for which this method is called. method_descriptor: Descriptor that represent the method to call. ...
[ "def", "_CallMethod", "(", "self", ",", "srvc", ",", "method_descriptor", ",", "rpc_controller", ",", "request", ",", "callback", ")", ":", "if", "method_descriptor", ".", "containing_service", "!=", "self", ".", "descriptor", ":", "raise", "RuntimeError", "(", ...
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/service_reflection.py#L156-L171
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/copy.py
python
deepcopy
(x, memo=None, _nil=[])
return y
Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info.
Deep copy operation on arbitrary Python objects.
[ "Deep", "copy", "operation", "on", "arbitrary", "Python", "objects", "." ]
def deepcopy(x, memo=None, _nil=[]): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) y = memo.get(d, _nil) if y is not _nil: return y cls = type(x) copier = _deepcopy_disp...
[ "def", "deepcopy", "(", "x", ",", "memo", "=", "None", ",", "_nil", "=", "[", "]", ")", ":", "if", "memo", "is", "None", ":", "memo", "=", "{", "}", "d", "=", "id", "(", "x", ")", "y", "=", "memo", ".", "get", "(", "d", ",", "_nil", ")", ...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/copy.py#L144-L193
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ConfigParser.py
python
RawConfigParser.options
(self, section)
return opts.keys()
Return a list of option names for the given section name.
Return a list of option names for the given section name.
[ "Return", "a", "list", "of", "option", "names", "for", "the", "given", "section", "name", "." ]
def options(self, section): """Return a list of option names for the given section name.""" try: opts = self._sections[section].copy() except KeyError: raise NoSectionError(section) opts.update(self._defaults) if '__name__' in opts: del opts['_...
[ "def", "options", "(", "self", ",", "section", ")", ":", "try", ":", "opts", "=", "self", ".", "_sections", "[", "section", "]", ".", "copy", "(", ")", "except", "KeyError", ":", "raise", "NoSectionError", "(", "section", ")", "opts", ".", "update", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ConfigParser.py#L274-L283
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
scripts/cpp_lint.py
python
FindNextMultiLineCommentStart
(lines, lineix)
return len(lines)
Find the beginning marker for a multiline comment.
Find the beginning marker for a multiline comment.
[ "Find", "the", "beginning", "marker", "for", "a", "multiline", "comment", "." ]
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
[ "def", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "startswith", "(", "'/*'", ")", ":", "# Only return this...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/scripts/cpp_lint.py#L1123-L1131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGProperty.ChangeFlag
(*args, **kwargs)
return _propgrid.PGProperty_ChangeFlag(*args, **kwargs)
ChangeFlag(self, int flag, bool set)
ChangeFlag(self, int flag, bool set)
[ "ChangeFlag", "(", "self", "int", "flag", "bool", "set", ")" ]
def ChangeFlag(*args, **kwargs): """ChangeFlag(self, int flag, bool set)""" return _propgrid.PGProperty_ChangeFlag(*args, **kwargs)
[ "def", "ChangeFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_ChangeFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L739-L741
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/ctc_ops.py
python
_CTCLossGrad
(op, grad_loss, _)
return [_BroadcastMul(grad_loss, grad_without_gradient), None, None, None]
The derivative provided by CTC Loss. Args: op: the CTCLoss op. grad_loss: The backprop for cost. Returns: The CTC Loss gradient.
The derivative provided by CTC Loss.
[ "The", "derivative", "provided", "by", "CTC", "Loss", "." ]
def _CTCLossGrad(op, grad_loss, _): """The derivative provided by CTC Loss. Args: op: the CTCLoss op. grad_loss: The backprop for cost. Returns: The CTC Loss gradient. """ # Outputs are: loss, grad # # Currently there is no way to take the second derivative of this op # due to the fused...
[ "def", "_CTCLossGrad", "(", "op", ",", "grad_loss", ",", "_", ")", ":", "# Outputs are: loss, grad", "#", "# Currently there is no way to take the second derivative of this op", "# due to the fused implementation's interaction with tf.gradients(),", "# so we make sure we prevent silently...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/ctc_ops.py#L159-L181
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
third_party/toolchains/gpu/find_cuda_config.py
python
_get_legacy_path
(env_name, default=[])
return _list_from_env(env_name, default)
Returns a path specified by a legacy environment variable. CUDNN_INSTALL_PATH, NCCL_INSTALL_PATH, TENSORRT_INSTALL_PATH set to '/usr/lib/x86_64-linux-gnu' would previously find both library and header paths. Detect those and return '/usr', otherwise forward to _list_from_env().
Returns a path specified by a legacy environment variable.
[ "Returns", "a", "path", "specified", "by", "a", "legacy", "environment", "variable", "." ]
def _get_legacy_path(env_name, default=[]): """Returns a path specified by a legacy environment variable. CUDNN_INSTALL_PATH, NCCL_INSTALL_PATH, TENSORRT_INSTALL_PATH set to '/usr/lib/x86_64-linux-gnu' would previously find both library and header paths. Detect those and return '/usr', otherwise forward to _li...
[ "def", "_get_legacy_path", "(", "env_name", ",", "default", "=", "[", "]", ")", ":", "if", "env_name", "in", "os", ".", "environ", ":", "match", "=", "re", ".", "match", "(", "\"^(/[^/ ]*)+/lib/\\w+-linux-gnu/?$\"", ",", "os", ".", "environ", "[", "env_nam...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/third_party/toolchains/gpu/find_cuda_config.py#L424-L435
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py
python
array_to_datum
(arr, label=None)
return datum
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
[ "Converts", "a", "3", "-", "dimensional", "array", "to", "datum", ".", "If", "the", "array", "has", "dtype", "uint8", "the", "output", "data", "will", "be", "encoded", "as", "a", "string", ".", "Otherwise", "the", "output", "data", "will", "be", "stored"...
def array_to_datum(arr, label=None): """Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format. """ if arr.ndim != 3: raise ValueError('Incorrect array shape.') datum = ...
[ "def", "array_to_datum", "(", "arr", ",", "label", "=", "None", ")", ":", "if", "arr", ".", "ndim", "!=", "3", ":", "raise", "ValueError", "(", "'Incorrect array shape.'", ")", "datum", "=", "caffe_pb2", ".", "Datum", "(", ")", "datum", ".", "channels", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py#L66-L81
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
docs/examples/use_cases/tensorflow/efficientdet/pipeline/tf/dataloader.py
python
pad_to_fixed_size
(data, pad_value, output_shape)
return padded_data
Pad data to a fixed length at the first dimension. Args: data: Tensor to be padded to output_shape. pad_value: A constant value assigned to the paddings. output_shape: The output shape of a 2D tensor. Returns: The Padded tensor with output_shape [max_instances_per_image, dimension].
Pad data to a fixed length at the first dimension.
[ "Pad", "data", "to", "a", "fixed", "length", "at", "the", "first", "dimension", "." ]
def pad_to_fixed_size(data, pad_value, output_shape): """Pad data to a fixed length at the first dimension. Args: data: Tensor to be padded to output_shape. pad_value: A constant value assigned to the paddings. output_shape: The output shape of a 2D tensor. Returns: The Padded tenso...
[ "def", "pad_to_fixed_size", "(", "data", ",", "pad_value", ",", "output_shape", ")", ":", "max_instances_per_image", "=", "output_shape", "[", "0", "]", "dimension", "=", "output_shape", "[", "1", "]", "data", "=", "tf", ".", "reshape", "(", "data", ",", "...
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/tensorflow/efficientdet/pipeline/tf/dataloader.py#L212-L234
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/random-pick-with-blacklist.py
python
Solution2.__init__
(self, N, blacklist)
:type N: int :type blacklist: List[int]
:type N: int :type blacklist: List[int]
[ ":", "type", "N", ":", "int", ":", "type", "blacklist", ":", "List", "[", "int", "]" ]
def __init__(self, N, blacklist): """ :type N: int :type blacklist: List[int] """ self.__n = N-len(blacklist) blacklist.sort() self.__blacklist = blacklist
[ "def", "__init__", "(", "self", ",", "N", ",", "blacklist", ")", ":", "self", ".", "__n", "=", "N", "-", "len", "(", "blacklist", ")", "blacklist", ".", "sort", "(", ")", "self", ".", "__blacklist", "=", "blacklist" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/random-pick-with-blacklist.py#L38-L45
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/models.py
python
Response.content
(self)
return self._content
Content of the response, in bytes.
Content of the response, in bytes.
[ "Content", "of", "the", "response", "in", "bytes", "." ]
def content(self): """Content of the response, in bytes.""" if self._content is False: # Read the contents. try: if self._content_consumed: raise RuntimeError( 'The content for this response was already consumed') ...
[ "def", "content", "(", "self", ")", ":", "if", "self", ".", "_content", "is", "False", ":", "# Read the contents.", "try", ":", "if", "self", ".", "_content_consumed", ":", "raise", "RuntimeError", "(", "'The content for this response was already consumed'", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/models.py#L737-L758
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
third-party/benchmark/bindings/python/google_benchmark/__init__.py
python
__OptionMaker.make
(cls, func_or_options)
return cls.Options(func_or_options)
Make Options from Options or the benchmarked function.
Make Options from Options or the benchmarked function.
[ "Make", "Options", "from", "Options", "or", "the", "benchmarked", "function", "." ]
def make(cls, func_or_options): """Make Options from Options or the benchmarked function.""" if isinstance(func_or_options, cls.Options): return func_or_options return cls.Options(func_or_options)
[ "def", "make", "(", "cls", ",", "func_or_options", ")", ":", "if", "isinstance", "(", "func_or_options", ",", "cls", ".", "Options", ")", ":", "return", "func_or_options", "return", "cls", ".", "Options", "(", "func_or_options", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/third-party/benchmark/bindings/python/google_benchmark/__init__.py#L86-L90
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/mxnet/monitor.py
python
Monitor.toc_print
(self)
End collecting and print results
End collecting and print results
[ "End", "collecting", "and", "print", "results" ]
def toc_print(self): """End collecting and print results""" res = self.toc() for n, k, v in res: logging.info('Batch: {:7d} {:30s} {:s}'.format(n, k, v))
[ "def", "toc_print", "(", "self", ")", ":", "res", "=", "self", ".", "toc", "(", ")", "for", "n", ",", "k", ",", "v", "in", "res", ":", "logging", ".", "info", "(", "'Batch: {:7d} {:30s} {:s}'", ".", "format", "(", "n", ",", "k", ",", "v", ")", ...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/monitor.py#L112-L116
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/cloud/frontend/frontend_job.py
python
FrontendJob.DeleteForTag
(cls, tag)
Deletes the frontend job assowiated with tag.
Deletes the frontend job assowiated with tag.
[ "Deletes", "the", "frontend", "job", "assowiated", "with", "tag", "." ]
def DeleteForTag(cls, tag): """Deletes the frontend job assowiated with tag.""" parent_key = cls._GetParentKeyFromTag(tag) frontend_job = cls.query(ancestor=parent_key).get(keys_only=True) if frontend_job: frontend_job.delete()
[ "def", "DeleteForTag", "(", "cls", ",", "tag", ")", ":", "parent_key", "=", "cls", ".", "_GetParentKeyFromTag", "(", "tag", ")", "frontend_job", "=", "cls", ".", "query", "(", "ancestor", "=", "parent_key", ")", ".", "get", "(", "keys_only", "=", "True",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/frontend/frontend_job.py#L52-L57
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/graph_transformations/model_transformer.py
python
ModelTransformer.recursive_transform
(self)
return ModelTransformer(transformed_model, self.transforms, self.candidate_layers, self.layer_metadata).transform()
Transforms the Keras model recursively by applying all the specified transforms. This is the main entry point function used to apply the transformations to the Keras model. Not suitable for multi-threaded use. Creates and manipulates internal state. Returns: (Keras model after transformation, U...
Transforms the Keras model recursively by applying all the specified transforms.
[ "Transforms", "the", "Keras", "model", "recursively", "by", "applying", "all", "the", "specified", "transforms", "." ]
def recursive_transform(self): """Transforms the Keras model recursively by applying all the specified transforms. This is the main entry point function used to apply the transformations to the Keras model. Not suitable for multi-threaded use. Creates and manipulates internal state. Returns: ...
[ "def", "recursive_transform", "(", "self", ")", ":", "def", "_make_transform_fn", "(", ")", ":", "def", "transform_fn", "(", "layer", ")", ":", "if", "self", ".", "_is_sequential_or_functional_model", "(", "layer", ")", ":", "transformed_layer", ",", "self", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/graph_transformations/model_transformer.py#L708-L738
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/wubi/backends/win32/backend.py
python
WindowsBackend.extract_file_from_iso
(self, iso_path, file_path, output_dir=None, overwrite=False)
platform specific
platform specific
[ "platform", "specific" ]
def extract_file_from_iso(self, iso_path, file_path, output_dir=None, overwrite=False): ''' platform specific ''' log.debug(" extracting %s from %s" % (file_path, iso_path)) if not iso_path or not os.path.exists(iso_path): raise Exception('Invalid path %s' % iso_path...
[ "def", "extract_file_from_iso", "(", "self", ",", "iso_path", ",", "file_path", ",", "output_dir", "=", "None", ",", "overwrite", "=", "False", ")", ":", "log", ".", "debug", "(", "\" extracting %s from %s\"", "%", "(", "file_path", ",", "iso_path", ")", ")...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/wubi/backends/win32/backend.py#L413-L437
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dataset.py
python
FileInstantDataset.local_shuffle
(self)
Local shuffle FileInstantDataset does not support local shuffle
Local shuffle FileInstantDataset does not support local shuffle
[ "Local", "shuffle", "FileInstantDataset", "does", "not", "support", "local", "shuffle" ]
def local_shuffle(self): """ Local shuffle FileInstantDataset does not support local shuffle """ raise NotImplementedError( "FileInstantDataset does not support local shuffle, " "please use InMemoryDataset for local_shuffle")
[ "def", "local_shuffle", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "\"FileInstantDataset does not support local shuffle, \"", "\"please use InMemoryDataset for local_shuffle\"", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dataset.py#L1152-L1159
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Wrapping/Generators/Python/itk/support/extras.py
python
pipeline.clear
(self)
Clear the filter list
Clear the filter list
[ "Clear", "the", "filter", "list" ]
def clear(self) -> None: """Clear the filter list""" self.filters = []
[ "def", "clear", "(", "self", ")", "->", "None", ":", "self", ".", "filters", "=", "[", "]" ]
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/extras.py#L1505-L1507
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/checkpoint_utils.py
python
_get_checkpoint_filename
(ckpt_dir_or_file)
return ckpt_dir_or_file
Returns checkpoint filename given directory or specific checkpoint file.
Returns checkpoint filename given directory or specific checkpoint file.
[ "Returns", "checkpoint", "filename", "given", "directory", "or", "specific", "checkpoint", "file", "." ]
def _get_checkpoint_filename(ckpt_dir_or_file): """Returns checkpoint filename given directory or specific checkpoint file.""" if gfile.IsDirectory(ckpt_dir_or_file): return checkpoint_management.latest_checkpoint(ckpt_dir_or_file) return ckpt_dir_or_file
[ "def", "_get_checkpoint_filename", "(", "ckpt_dir_or_file", ")", ":", "if", "gfile", ".", "IsDirectory", "(", "ckpt_dir_or_file", ")", ":", "return", "checkpoint_management", ".", "latest_checkpoint", "(", "ckpt_dir_or_file", ")", "return", "ckpt_dir_or_file" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/checkpoint_utils.py#L381-L385
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/tarfile.py
python
TarFile.add
(self, name, arcname=None, recursive=True, *, filter=None)
Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' t...
Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' t...
[ "Add", "the", "file", "name", "to", "the", "archive", ".", "name", "may", "be", "any", "type", "of", "file", "(", "directory", "fifo", "symbolic", "link", "etc", ".", ")", ".", "If", "given", "arcname", "specifies", "an", "alternative", "name", "for", ...
def add(self, name, arcname=None, recursive=True, *, filter=None): """Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added r...
[ "def", "add", "(", "self", ",", "name", ",", "arcname", "=", "None", ",", "recursive", "=", "True", ",", "*", ",", "filter", "=", "None", ")", ":", "self", ".", "_check", "(", "\"awx\"", ")", "if", "arcname", "is", "None", ":", "arcname", "=", "n...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/tarfile.py#L1940-L1989
kevin-ssy/Optical-Flow-Guided-Feature
07d4501a29002ee7821c38c1820e4a64c1acf6e8
lib/caffe-action/scripts/cpp_lint.py
python
_SetFilters
(filters)
Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die.
Sets the module's error-message filters.
[ "Sets", "the", "module", "s", "error", "-", "message", "filters", "." ]
def _SetFilters(filters): """Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint...
[ "def", "_SetFilters", "(", "filters", ")", ":", "_cpplint_state", ".", "SetFilters", "(", "filters", ")" ]
https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L797-L807
gklz1982/caffe-yolov2
ebb27029db4ddc0d40e520634633b0fa9cdcc10d
scripts/cpp_lint.py
python
Search
(pattern, s)
return _regexp_compile_cache[pattern].search(s)
Searches the string for the pattern, caching the compiled regexp.
Searches the string for the pattern, caching the compiled regexp.
[ "Searches", "the", "string", "for", "the", "pattern", "caching", "the", "compiled", "regexp", "." ]
def Search(pattern, s): """Searches the string for the pattern, caching the compiled regexp.""" if pattern not in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].search(s)
[ "def", "Search", "(", "pattern", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_cache", "[", "pat...
https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L543-L547
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py
python
AbstractEventLoopPolicy.get_event_loop
(self)
Get the event loop for the current context. Returns an event loop object implementing the BaseEventLoop interface, or raises an exception in case no event loop has been set for the current context and the current policy does not specify to create one. It should never return None.
Get the event loop for the current context.
[ "Get", "the", "event", "loop", "for", "the", "current", "context", "." ]
def get_event_loop(self): """Get the event loop for the current context. Returns an event loop object implementing the BaseEventLoop interface, or raises an exception in case no event loop has been set for the current context and the current policy does not specify to create one. ...
[ "def", "get_event_loop", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py#L579-L587
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
tst/regression/scripts/utils/EquationOfState/eos.py
python
Ideal.p_of_rho_ei
(self, rho, ei)
return ei * self._gm1
Pressure as a function of density (rho) and internal energy density (ei)
Pressure as a function of density (rho) and internal energy density (ei)
[ "Pressure", "as", "a", "function", "of", "density", "(", "rho", ")", "and", "internal", "energy", "density", "(", "ei", ")" ]
def p_of_rho_ei(self, rho, ei): """Pressure as a function of density (rho) and internal energy density (ei)""" return ei * self._gm1
[ "def", "p_of_rho_ei", "(", "self", ",", "rho", ",", "ei", ")", ":", "return", "ei", "*", "self", ".", "_gm1" ]
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/regression/scripts/utils/EquationOfState/eos.py#L177-L179
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py
python
RepeatedCompositeProperty
(cdescriptor, message_type)
return property(Getter, Setter, doc=doc)
Returns a Python property for the given repeated composite field.
Returns a Python property for the given repeated composite field.
[ "Returns", "a", "Python", "property", "for", "the", "given", "repeated", "composite", "field", "." ]
def RepeatedCompositeProperty(cdescriptor, message_type): """Returns a Python property for the given repeated composite field.""" def Getter(self): container = self._composite_fields.get(cdescriptor.name, None) if container is None: container = RepeatedCompositeContainer( self, cdescriptor,...
[ "def", "RepeatedCompositeProperty", "(", "cdescriptor", ",", "message_type", ")", ":", "def", "Getter", "(", "self", ")", ":", "container", "=", "self", ".", "_composite_fields", ".", "get", "(", "cdescriptor", ".", "name", ",", "None", ")", "if", "container...
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py#L262-L278
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/build/project.py
python
ProjectRegistry.current
(self)
return self.current_project
Returns the project which is currently being loaded.
Returns the project which is currently being loaded.
[ "Returns", "the", "project", "which", "is", "currently", "being", "loaded", "." ]
def current(self): """Returns the project which is currently being loaded.""" return self.current_project
[ "def", "current", "(", "self", ")", ":", "return", "self", ".", "current_project" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/project.py#L522-L524
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/dtypes.py
python
DType.real_dtype
(self)
Returns the dtype correspond to this dtype's real part.
Returns the dtype correspond to this dtype's real part.
[ "Returns", "the", "dtype", "correspond", "to", "this", "dtype", "s", "real", "part", "." ]
def real_dtype(self): """Returns the dtype correspond to this dtype's real part.""" base = self.base_dtype if base == complex64: return float32 elif base == complex128: return float64 else: return self
[ "def", "real_dtype", "(", "self", ")", ":", "base", "=", "self", ".", "base_dtype", "if", "base", "==", "complex64", ":", "return", "float32", "elif", "base", "==", "complex128", ":", "return", "float64", "else", ":", "return", "self" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/dtypes.py#L118-L126
wjakob/tbb
9e219e24fe223b299783200f217e9d27790a87b0
python/tbb/pool.py
python
Pool.imap_async
(self, func, iterable, chunksize=None, callback=None)
return apply_result
A variant of the imap() method which returns an ApplyResult object that provides an iterator (next method(timeout) available). If callback is specified then it should be a callable which accepts a single argument. When the resulting iterator becomes ready, callback is applied to...
A variant of the imap() method which returns an ApplyResult object that provides an iterator (next method(timeout) available).
[ "A", "variant", "of", "the", "imap", "()", "method", "which", "returns", "an", "ApplyResult", "object", "that", "provides", "an", "iterator", "(", "next", "method", "(", "timeout", ")", "available", ")", "." ]
def imap_async(self, func, iterable, chunksize=None, callback=None): """A variant of the imap() method which returns an ApplyResult object that provides an iterator (next method(timeout) available). If callback is specified then it should be a callable which accepts a single arg...
[ "def", "imap_async", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", "=", "None", ",", "callback", "=", "None", ")", ":", "apply_result", "=", "ApplyResult", "(", "callback", "=", "callback", ")", "collector", "=", "OrderedResultCollector", "(",...
https://github.com/wjakob/tbb/blob/9e219e24fe223b299783200f217e9d27790a87b0/python/tbb/pool.py#L173-L187
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/_inputstream.py
python
EncodingParser.__init__
(self, data)
string - the data to work on for encoding detection
string - the data to work on for encoding detection
[ "string", "-", "the", "data", "to", "work", "on", "for", "encoding", "detection" ]
def __init__(self, data): """string - the data to work on for encoding detection""" self.data = EncodingBytes(data) self.encoding = None
[ "def", "__init__", "(", "self", ",", "data", ")", ":", "self", ".", "data", "=", "EncodingBytes", "(", "data", ")", "self", ".", "encoding", "=", "None" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/_inputstream.py#L691-L694
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/e_weblib.py
python
SOAP12Message.Send
(self)
Send the message
Send the message
[ "Send", "the", "message" ]
def Send(self): """Send the message""" # Create the SOAP message soapmsg = self.MessageBody # Setup Headers self._http.putrequest("POST", self._request) self._http.putheader("Host", self._host) # self._http.putheader("User-Agent", "Python post") self._http...
[ "def", "Send", "(", "self", ")", ":", "# Create the SOAP message", "soapmsg", "=", "self", ".", "MessageBody", "# Setup Headers", "self", ".", "_http", ".", "putrequest", "(", "\"POST\"", ",", "self", ".", "_request", ")", "self", ".", "_http", ".", "puthead...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/e_weblib.py#L78-L93
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/logging/config.py
python
_install_loggers
(cp, handlers, disable_existing)
Create and install loggers
Create and install loggers
[ "Create", "and", "install", "loggers" ]
def _install_loggers(cp, handlers, disable_existing): """Create and install loggers""" # configure the root first llist = cp["loggers"]["keys"] llist = llist.split(",") llist = list(_strip_spaces(llist)) llist.remove("root") section = cp["logger_root"] root = logging.root log = root...
[ "def", "_install_loggers", "(", "cp", ",", "handlers", ",", "disable_existing", ")", ":", "# configure the root first", "llist", "=", "cp", "[", "\"loggers\"", "]", "[", "\"keys\"", "]", "llist", "=", "llist", ".", "split", "(", "\",\"", ")", "llist", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/config.py#L183-L267
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/build/targets.py
python
ProjectTarget.has_main_target
(self, name)
return name in self.main_target_
Tells if a main target with the specified name exists.
Tells if a main target with the specified name exists.
[ "Tells", "if", "a", "main", "target", "with", "the", "specified", "name", "exists", "." ]
def has_main_target (self, name): """Tells if a main target with the specified name exists.""" assert isinstance(name, basestring) if not self.built_main_targets_: self.build_main_targets() return name in self.main_target_
[ "def", "has_main_target", "(", "self", ",", "name", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "if", "not", "self", ".", "built_main_targets_", ":", "self", ".", "build_main_targets", "(", ")", "return", "name", "in", "self", "....
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/targets.py#L500-L506
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/process/plugins.py
python
SignalHandler.set_handler
(self, signal, listener=None)
Subscribe a handler for the given signal (number or name). If the optional 'listener' argument is provided, it will be subscribed as a listener for the given signal's channel. If the given signal name or number is not available on the current platform, ValueError is rai...
Subscribe a handler for the given signal (number or name). If the optional 'listener' argument is provided, it will be subscribed as a listener for the given signal's channel. If the given signal name or number is not available on the current platform, ValueError is rai...
[ "Subscribe", "a", "handler", "for", "the", "given", "signal", "(", "number", "or", "name", ")", ".", "If", "the", "optional", "listener", "argument", "is", "provided", "it", "will", "be", "subscribed", "as", "a", "listener", "for", "the", "given", "signal"...
def set_handler(self, signal, listener=None): """Subscribe a handler for the given signal (number or name). If the optional 'listener' argument is provided, it will be subscribed as a listener for the given signal's channel. If the given signal name or number is not ava...
[ "def", "set_handler", "(", "self", ",", "signal", ",", "listener", "=", "None", ")", ":", "if", "isinstance", "(", "signal", ",", "basestring", ")", ":", "signum", "=", "getattr", "(", "_signal", ",", "signal", ",", "None", ")", "if", "signum", "is", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/plugins.py#L144-L170
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/ops/__init__.py
python
element_min
(left, right, name='')
return cntk_py_element_min(left, right, name)
The output of this operation is the element-wise min of the two or more input tensors. It supports broadcasting. Args: arg1: left side tensor arg2: right side tensor *more_args: additional inputs name (str, optional): the name of the Function instance in the network Returns:...
The output of this operation is the element-wise min of the two or more input tensors. It supports broadcasting.
[ "The", "output", "of", "this", "operation", "is", "the", "element", "-", "wise", "min", "of", "the", "two", "or", "more", "input", "tensors", ".", "It", "supports", "broadcasting", "." ]
def element_min(left, right, name=''): ''' The output of this operation is the element-wise min of the two or more input tensors. It supports broadcasting. Args: arg1: left side tensor arg2: right side tensor *more_args: additional inputs name (str, optional): the name o...
[ "def", "element_min", "(", "left", ",", "right", ",", "name", "=", "''", ")", ":", "from", "cntk", ".", "cntk_py", "import", "element_min", "as", "cntk_py_element_min", "dtype", "=", "get_data_type", "(", "left", ",", "right", ")", "left", "=", "sanitize_i...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L1043-L1060
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/client/timeline.py
python
_TensorTracker.allocator
(self)
return self._allocator
Name of the allocator used to create this tensor (string).
Name of the allocator used to create this tensor (string).
[ "Name", "of", "the", "allocator", "used", "to", "create", "this", "tensor", "(", "string", ")", "." ]
def allocator(self): """Name of the allocator used to create this tensor (string).""" return self._allocator
[ "def", "allocator", "(", "self", ")", ":", "return", "self", ".", "_allocator" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/client/timeline.py#L321-L323
sfzhang15/FaceBoxes
b52cc92f9362d3adc08d54666aeb9ebb62fdb7da
python/caffe/draw.py
python
draw_net
(caffe_net, rankdir, ext='png', phase=None)
return get_pydot_graph(caffe_net, rankdir, phase=phase).create(format=ext)
Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image extension (the default is 'png'). phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TE...
Draws a caffe net and returns the image string encoded using the given extension.
[ "Draws", "a", "caffe", "net", "and", "returns", "the", "image", "string", "encoded", "using", "the", "given", "extension", "." ]
def draw_net(caffe_net, rankdir, ext='png', phase=None): """Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image extension (the default i...
[ "def", "draw_net", "(", "caffe_net", ",", "rankdir", ",", "ext", "=", "'png'", ",", "phase", "=", "None", ")", ":", "return", "get_pydot_graph", "(", "caffe_net", ",", "rankdir", ",", "phase", "=", "phase", ")", ".", "create", "(", "format", "=", "ext"...
https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/python/caffe/draw.py#L205-L223
facebookresearch/mvfst-rl
778bc4259ae7277e67c2ead593a493845c93db83
train/learner.py
python
make_train_model
(flags, device=None)
return model if device is None else model.to(device)
Create the intended model according to options in `flags`
Create the intended model according to options in `flags`
[ "Create", "the", "intended", "model", "according", "to", "options", "in", "flags" ]
def make_train_model(flags, device=None): """Create the intended model according to options in `flags`""" model = SimpleNet( input_size=flags.observation_length, hidden_size=flags.hidden_size, num_actions=flags.num_actions, use_lstm=flags.use_lstm, n_train_jobs=get_n_jobs...
[ "def", "make_train_model", "(", "flags", ",", "device", "=", "None", ")", ":", "model", "=", "SimpleNet", "(", "input_size", "=", "flags", ".", "observation_length", ",", "hidden_size", "=", "flags", ".", "hidden_size", ",", "num_actions", "=", "flags", ".",...
https://github.com/facebookresearch/mvfst-rl/blob/778bc4259ae7277e67c2ead593a493845c93db83/train/learner.py#L519-L530
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/generic.py
python
NDFrame.to_json
(self, path_or_buf=None, orient=None, date_format=None, double_precision=10, force_ascii=True, date_unit='ms', default_handler=None, lines=False, compression='infer', index=True)
return json.to_json(path_or_buf=path_or_buf, obj=self, orient=orient, date_format=date_format, double_precision=double_precision, force_ascii=force_ascii, date_unit=date_unit, default_handler=default_handler,...
Convert the object to a JSON string. Note NaN's and None will be converted to null and datetime objects will be converted to UNIX timestamps. Parameters ---------- path_or_buf : string or file handle, optional File path or object. If not specified, the result is ret...
Convert the object to a JSON string.
[ "Convert", "the", "object", "to", "a", "JSON", "string", "." ]
def to_json(self, path_or_buf=None, orient=None, date_format=None, double_precision=10, force_ascii=True, date_unit='ms', default_handler=None, lines=False, compression='infer', index=True): """ Convert the object to a JSON string. Note NaN's and ...
[ "def", "to_json", "(", "self", ",", "path_or_buf", "=", "None", ",", "orient", "=", "None", ",", "date_format", "=", "None", ",", "double_precision", "=", "10", ",", "force_ascii", "=", "True", ",", "date_unit", "=", "'ms'", ",", "default_handler", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L2129-L2273
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py
python
rnn_seq2seq
(encoder_inputs, decoder_inputs, encoder_cell, decoder_cell=None, dtype=dtypes.float32, scope=None)
RNN Sequence to Sequence model. Args: encoder_inputs: List of tensors, inputs for encoder. decoder_inputs: List of tensors, inputs for decoder. encoder_cell: RNN cell to use for encoder. decoder_cell: RNN cell to use for decoder, if None encoder_cell is used. dtype: Type to initialize encoder sta...
RNN Sequence to Sequence model.
[ "RNN", "Sequence", "to", "Sequence", "model", "." ]
def rnn_seq2seq(encoder_inputs, decoder_inputs, encoder_cell, decoder_cell=None, dtype=dtypes.float32, scope=None): """RNN Sequence to Sequence model. Args: encoder_inputs: List of tensors, inputs for encoder. decoder_inputs: L...
[ "def", "rnn_seq2seq", "(", "encoder_inputs", ",", "decoder_inputs", ",", "encoder_cell", ",", "decoder_cell", "=", "None", ",", "dtype", "=", "dtypes", ".", "float32", ",", "scope", "=", "None", ")", ":", "with", "vs", ".", "variable_scope", "(", "scope", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py#L136-L159
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/framework/python/ops/variables.py
python
local_variable
(initial_value, validate_shape=True, name=None)
return variables.Variable( initial_value, trainable=False, collections=[ops.GraphKeys.LOCAL_VARIABLES], validate_shape=validate_shape, name=name)
Create variable and add it to `GraphKeys.LOCAL_VARIABLES` collection. Args: initial_value: See variables.Variable.__init__. validate_shape: See variables.Variable.__init__. name: See variables.Variable.__init__. Returns: New variable.
Create variable and add it to `GraphKeys.LOCAL_VARIABLES` collection.
[ "Create", "variable", "and", "add", "it", "to", "GraphKeys", ".", "LOCAL_VARIABLES", "collection", "." ]
def local_variable(initial_value, validate_shape=True, name=None): """Create variable and add it to `GraphKeys.LOCAL_VARIABLES` collection. Args: initial_value: See variables.Variable.__init__. validate_shape: See variables.Variable.__init__. name: See variables.Variable.__init__. Returns: New va...
[ "def", "local_variable", "(", "initial_value", ",", "validate_shape", "=", "True", ",", "name", "=", "None", ")", ":", "return", "variables", ".", "Variable", "(", "initial_value", ",", "trainable", "=", "False", ",", "collections", "=", "[", "ops", ".", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/framework/python/ops/variables.py#L177-L190
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/block.py
python
compress_it
( inputfile, outputfile )
Make Huffman code for blocks, and Compress from file (possibly stdin).
Make Huffman code for blocks, and Compress from file (possibly stdin).
[ "Make", "Huffman", "code", "for", "blocks", "and", "Compress", "from", "file", "(", "possibly", "stdin", ")", "." ]
def compress_it( inputfile, outputfile ): """ Make Huffman code for blocks, and Compress from file (possibly stdin). """ probs = findprobs(f,N) symbols = makenodes(probs) # if len(probs) > 999 : # sys.setrecursionlimit( len(probs)+100 ) root = iterate(symbols) # make huffman code ...
[ "def", "compress_it", "(", "inputfile", ",", "outputfile", ")", ":", "probs", "=", "findprobs", "(", "f", ",", "N", ")", "symbols", "=", "makenodes", "(", "probs", ")", "# if len(probs) > 999 :", "# sys.setrecursionlimit( len(probs)+100 )", "root", "=", ...
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/block.py#L401-L414
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
SearchCtrl.ShowSearchButton
(*args, **kwargs)
return _controls_.SearchCtrl_ShowSearchButton(*args, **kwargs)
ShowSearchButton(self, bool show) Sets the search button visibility value on the search control. If there is a menu attached, the search button will be visible regardless of the search button visibility value. This has no effect in Mac OS X v10.3
ShowSearchButton(self, bool show)
[ "ShowSearchButton", "(", "self", "bool", "show", ")" ]
def ShowSearchButton(*args, **kwargs): """ ShowSearchButton(self, bool show) Sets the search button visibility value on the search control. If there is a menu attached, the search button will be visible regardless of the search button visibility value. This has no effect in Mac...
[ "def", "ShowSearchButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SearchCtrl_ShowSearchButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L7436-L7445
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/PyScripts/stats_analysis/statistics.py
python
Statistics.__getMode
(self)
Determine the most repeated value(s) in the data set.
Determine the most repeated value(s) in the data set.
[ "Determine", "the", "most", "repeated", "value", "(", "s", ")", "in", "the", "data", "set", "." ]
def __getMode(self): """Determine the most repeated value(s) in the data set.""" # Initialize a dictionary to store frequency data. frequency = {} # Build dictionary: key - data set values; item - data frequency. for x in self.sample: if (x in frequency): frequency[x...
[ "def", "__getMode", "(", "self", ")", ":", "# Initialize a dictionary to store frequency data.", "frequency", "=", "{", "}", "# Build dictionary: key - data set values; item - data frequency.", "for", "x", "in", "self", ".", "sample", ":", "if", "(", "x", "in", "frequen...
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/PyScripts/stats_analysis/statistics.py#L109-L140
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/utils.py
python
pass_context
(f: F)
return f
Pass the :class:`~jinja2.runtime.Context` as the first argument to the decorated function when called while rendering a template. Can be used on functions, filters, and tests. If only ``Context.eval_context`` is needed, use :func:`pass_eval_context`. If only ``Context.environment`` is needed, use ...
Pass the :class:`~jinja2.runtime.Context` as the first argument to the decorated function when called while rendering a template.
[ "Pass", "the", ":", "class", ":", "~jinja2", ".", "runtime", ".", "Context", "as", "the", "first", "argument", "to", "the", "decorated", "function", "when", "called", "while", "rendering", "a", "template", "." ]
def pass_context(f: F) -> F: """Pass the :class:`~jinja2.runtime.Context` as the first argument to the decorated function when called while rendering a template. Can be used on functions, filters, and tests. If only ``Context.eval_context`` is needed, use :func:`pass_eval_context`. If only ``Conte...
[ "def", "pass_context", "(", "f", ":", "F", ")", "->", "F", ":", "f", ".", "jinja_pass_arg", "=", "_PassArg", ".", "context", "# type: ignore", "return", "f" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/utils.py#L30-L44
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py
python
Client.will_clear
(self)
Removes a will that was previously configured with will_set(). Must be called before connect() to have any effect.
Removes a will that was previously configured with will_set().
[ "Removes", "a", "will", "that", "was", "previously", "configured", "with", "will_set", "()", "." ]
def will_clear(self): """ Removes a will that was previously configured with will_set(). Must be called before connect() to have any effect.""" self._will = False self._will_topic = "" self._will_payload = None self._will_qos = 0 self._will_retain = False
[ "def", "will_clear", "(", "self", ")", ":", "self", ".", "_will", "=", "False", "self", ".", "_will_topic", "=", "\"\"", "self", ".", "_will_payload", "=", "None", "self", ".", "_will_qos", "=", "0", "self", ".", "_will_retain", "=", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py#L1306-L1314
FirebirdSQL/firebird
95e3e71622ab0b26cafa8b184ce08500f2eb613f
extern/re2/re2/unicode.py
python
ReadUnicodeTable
(filename, nfields, doline)
Generic Unicode table text file reader. The reader takes care of stripping out comments and also parsing the two different ways that the Unicode tables specify code ranges (using the .. notation and splitting the range across multiple lines). Each non-comment line in the table is expected to have the given ...
Generic Unicode table text file reader.
[ "Generic", "Unicode", "table", "text", "file", "reader", "." ]
def ReadUnicodeTable(filename, nfields, doline): """Generic Unicode table text file reader. The reader takes care of stripping out comments and also parsing the two different ways that the Unicode tables specify code ranges (using the .. notation and splitting the range across multiple lines). Each non-co...
[ "def", "ReadUnicodeTable", "(", "filename", ",", "nfields", ",", "doline", ")", ":", "if", "nfields", "<", "2", ":", "raise", "InputError", "(", "\"invalid number of fields %d\"", "%", "(", "nfields", ",", ")", ")", "if", "type", "(", "filename", ")", "=="...
https://github.com/FirebirdSQL/firebird/blob/95e3e71622ab0b26cafa8b184ce08500f2eb613f/extern/re2/re2/unicode.py#L124-L222
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py
python
matchOnlyAtCol
(n)
return verifyCol
Helper method for defining parse actions that require matching at a specific column in the input text.
Helper method for defining parse actions that require matching at a specific column in the input text.
[ "Helper", "method", "for", "defining", "parse", "actions", "that", "require", "matching", "at", "a", "specific", "column", "in", "the", "input", "text", "." ]
def matchOnlyAtCol(n): """ Helper method for defining parse actions that require matching at a specific column in the input text. """ def verifyCol(strg,locn,toks): if col(locn,strg) != n: raise ParseException(strg,locn,"matched token not at column %d" % n) return verifyCol
[ "def", "matchOnlyAtCol", "(", "n", ")", ":", "def", "verifyCol", "(", "strg", ",", "locn", ",", "toks", ")", ":", "if", "col", "(", "locn", ",", "strg", ")", "!=", "n", ":", "raise", "ParseException", "(", "strg", ",", "locn", ",", "\"matched token n...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L4787-L4795
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py
python
Base.SideEffect
(self, side_effect, target)
return side_effects
Tell scons that side_effects are built as side effects of building targets.
Tell scons that side_effects are built as side effects of building targets.
[ "Tell", "scons", "that", "side_effects", "are", "built", "as", "side", "effects", "of", "building", "targets", "." ]
def SideEffect(self, side_effect, target): """Tell scons that side_effects are built as side effects of building targets.""" side_effects = self.arg2nodes(side_effect, self.fs.Entry) targets = self.arg2nodes(target, self.fs.Entry) for side_effect in side_effects: if ...
[ "def", "SideEffect", "(", "self", ",", "side_effect", ",", "target", ")", ":", "side_effects", "=", "self", ".", "arg2nodes", "(", "side_effect", ",", "self", ".", "fs", ".", "Entry", ")", "targets", "=", "self", ".", "arg2nodes", "(", "target", ",", "...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py#L2135-L2149
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
_FunctionState.Check
(self, error, filename, linenum)
Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check.
Report if too many lines in function body.
[ "Report", "if", "too", "many", "lines", "in", "function", "body", "." ]
def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check. """ if not self.in_a_function: return if Match...
[ "def", "Check", "(", "self", ",", "error", ",", "filename", ",", "linenum", ")", ":", "if", "not", "self", ".", "in_a_function", ":", "return", "if", "Match", "(", "r'T(EST|est)'", ",", "self", ".", "current_function", ")", ":", "base_trigger", "=", "sel...
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1258-L1284
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/HeppyCore/python/framework/chain.py
python
Chain.__getattr__
(self, attr)
return getattr(self.chain, attr)
All functions of the wrapped TChain are made available
All functions of the wrapped TChain are made available
[ "All", "functions", "of", "the", "wrapped", "TChain", "are", "made", "available" ]
def __getattr__(self, attr): """ All functions of the wrapped TChain are made available """ return getattr(self.chain, attr)
[ "def", "__getattr__", "(", "self", ",", "attr", ")", ":", "return", "getattr", "(", "self", ".", "chain", ",", "attr", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/HeppyCore/python/framework/chain.py#L92-L96
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py
python
NNTP.getline
(self)
return line
Internal: return one line from the server, stripping CRLF. Raise EOFError if the connection is closed.
Internal: return one line from the server, stripping CRLF. Raise EOFError if the connection is closed.
[ "Internal", ":", "return", "one", "line", "from", "the", "server", "stripping", "CRLF", ".", "Raise", "EOFError", "if", "the", "connection", "is", "closed", "." ]
def getline(self): """Internal: return one line from the server, stripping CRLF. Raise EOFError if the connection is closed.""" line = self.file.readline() if self.debugging > 1: print '*get*', repr(line) if not line: raise EOFError if line[-2:] == CRLF: line ...
[ "def", "getline", "(", "self", ")", ":", "line", "=", "self", ".", "file", ".", "readline", "(", ")", "if", "self", ".", "debugging", ">", "1", ":", "print", "'*get*'", ",", "repr", "(", "line", ")", "if", "not", "line", ":", "raise", "EOFError", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py#L200-L209
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/platform/benchmark.py
python
benchmarks_main
(true_main, argv=None)
Run benchmarks as declared in argv. Args: true_main: True main function to run if benchmarks are not requested. argv: the command line arguments (if None, uses sys.argv).
Run benchmarks as declared in argv.
[ "Run", "benchmarks", "as", "declared", "in", "argv", "." ]
def benchmarks_main(true_main, argv=None): """Run benchmarks as declared in argv. Args: true_main: True main function to run if benchmarks are not requested. argv: the command line arguments (if None, uses sys.argv). """ if argv is None: argv = sys.argv found_arg = [arg for arg in argv ...
[ "def", "benchmarks_main", "(", "true_main", ",", "argv", "=", "None", ")", ":", "if", "argv", "is", "None", ":", "argv", "=", "sys", ".", "argv", "found_arg", "=", "[", "arg", "for", "arg", "in", "argv", "if", "arg", ".", "startswith", "(", "\"--benc...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/platform/benchmark.py#L388-L407
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/laguerre.py
python
lagsub
(c1, c2)
return pu._sub(c1, c2)
Subtract one Laguerre series from another. Returns the difference of two Laguerre series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D arrays ...
Subtract one Laguerre series from another.
[ "Subtract", "one", "Laguerre", "series", "from", "another", "." ]
def lagsub(c1, c2): """ Subtract one Laguerre series from another. Returns the difference of two Laguerre series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 ...
[ "def", "lagsub", "(", "c1", ",", "c2", ")", ":", "return", "pu", ".", "_sub", "(", "c1", ",", "c2", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/laguerre.py#L348-L385
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
TreeListCtrl.Collapse
(*args, **kwargs)
return _gizmos.TreeListCtrl_Collapse(*args, **kwargs)
Collapse(self, TreeItemId item)
Collapse(self, TreeItemId item)
[ "Collapse", "(", "self", "TreeItemId", "item", ")" ]
def Collapse(*args, **kwargs): """Collapse(self, TreeItemId item)""" return _gizmos.TreeListCtrl_Collapse(*args, **kwargs)
[ "def", "Collapse", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_Collapse", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L879-L881
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/json_format/wrappers/_primitive_wrappers.py
python
PrimitiveWrapper.merge_into
(self, target: message.Message)
Merges the underlying wrapped primitive into target.
Merges the underlying wrapped primitive into target.
[ "Merges", "the", "underlying", "wrapped", "primitive", "into", "target", "." ]
def merge_into(self, target: message.Message) -> None: """Merges the underlying wrapped primitive into target.""" if not proto_utils.are_same_message_type(self.wrapped.DESCRIPTOR, target.DESCRIPTOR): raise ValueError(f'Type mismatch in merge_into. Attempted to ...
[ "def", "merge_into", "(", "self", ",", "target", ":", "message", ".", "Message", ")", "->", "None", ":", "if", "not", "proto_utils", ".", "are_same_message_type", "(", "self", ".", "wrapped", ".", "DESCRIPTOR", ",", "target", ".", "DESCRIPTOR", ")", ":", ...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/json_format/wrappers/_primitive_wrappers.py#L272-L279
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.flush
(self)
This does nothing. It is here to support the interface for a File-like object.
This does nothing. It is here to support the interface for a File-like object.
[ "This", "does", "nothing", ".", "It", "is", "here", "to", "support", "the", "interface", "for", "a", "File", "-", "like", "object", "." ]
def flush(self): '''This does nothing. It is here to support the interface for a File-like object. ''' pass
[ "def", "flush", "(", "self", ")", ":", "pass" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L405-L409
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.GypPathToNinja
(self, path, env=None)
return os.path.normpath(os.path.join(self.build_to_base, path))
Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.
Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|.
[ "Translate", "a", "gyp", "path", "to", "a", "ninja", "path", "optionally", "expanding", "environment", "variable", "references", "in", "|path|", "with", "|env|", "." ]
def GypPathToNinja(self, path, env=None): """Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.""" if env: if self.flavor == "mac": path = gyp.xcode_emu...
[ "def", "GypPathToNinja", "(", "self", ",", "path", ",", "env", "=", "None", ")", ":", "if", "env", ":", "if", "self", ".", "flavor", "==", "\"mac\"", ":", "path", "=", "gyp", ".", "xcode_emulation", ".", "ExpandEnvVars", "(", "path", ",", "env", ")",...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L300-L318
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/bisect_utils.py
python
SetupGitDepot
(opts, custom_deps)
return passed
Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'. Args: opts: The options parsed from the command line through parse_args(). custom_deps: A dictionary of additional dependencies to add to .gclient. Returns: True if gclient successfully created the conf...
Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'.
[ "Sets", "up", "the", "depot", "for", "the", "bisection", ".", "The", "depot", "will", "be", "located", "in", "a", "subdirectory", "called", "bisect", "." ]
def SetupGitDepot(opts, custom_deps): """Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'. Args: opts: The options parsed from the command line through parse_args(). custom_deps: A dictionary of additional dependencies to add to .gclient. Returns: Tr...
[ "def", "SetupGitDepot", "(", "opts", ",", "custom_deps", ")", ":", "name", "=", "'Setting up Bisection Depot'", "if", "opts", ".", "output_buildbot_annotations", ":", "OutputAnnotationStepStart", "(", "name", ")", "passed", "=", "False", "if", "not", "RunGClientAndC...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L333-L376
OAID/Caffe-HRT
aae71e498ab842c6f92bcc23fc668423615a4d65
scripts/cpp_lint.py
python
_CppLintState.PrintErrorCounts
(self)
Print a summary of errors by category, and the total.
Print a summary of errors by category, and the total.
[ "Print", "a", "summary", "of", "errors", "by", "category", "and", "the", "total", "." ]
def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in self.errors_by_category.iteritems(): sys.stderr.write('Category \'%s\' errors found: %d\n' % (category, count)) sys.stderr.write('Total errors found: %d\n' % self.error...
[ "def", "PrintErrorCounts", "(", "self", ")", ":", "for", "category", ",", "count", "in", "self", ".", "errors_by_category", ".", "iteritems", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'Category \\'%s\\' errors found: %d\\n'", "%", "(", "category...
https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L757-L762
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/emma_coverage_stats.py
python
GenerateCoverageReport
(line_coverage_file, out_file_path, coverage_dir)
Generates a coverage report for a given set of lines. Writes the results of the coverage analysis to the file specified by |out_file_path|. Args: line_coverage_file: The path to a file which contains a dict mapping file names to lists of line numbers. Example: {file1: [1, 2, 3], ...} means that ...
Generates a coverage report for a given set of lines.
[ "Generates", "a", "coverage", "report", "for", "a", "given", "set", "of", "lines", "." ]
def GenerateCoverageReport(line_coverage_file, out_file_path, coverage_dir): """Generates a coverage report for a given set of lines. Writes the results of the coverage analysis to the file specified by |out_file_path|. Args: line_coverage_file: The path to a file which contains a dict mapping file ...
[ "def", "GenerateCoverageReport", "(", "line_coverage_file", ",", "out_file_path", ",", "coverage_dir", ")", ":", "with", "open", "(", "line_coverage_file", ")", "as", "f", ":", "potential_files_for_coverage", "=", "json", ".", "load", "(", "f", ")", "files_for_cov...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/emma_coverage_stats.py#L427-L457
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/youtube/service.py
python
YouTubeService.DeleteVideoEntryFromFavorites
(self, video_id, username='default')
return self.Delete(edit_link)
Delete a video entry from the users favorite feed. Needs authentication. Args: video_id: A string representing the ID of the video that is to be removed username: An optional string representing the username of the user's favorite feed. Defaults to the currently authenticated user. ...
Delete a video entry from the users favorite feed.
[ "Delete", "a", "video", "entry", "from", "the", "users", "favorite", "feed", "." ]
def DeleteVideoEntryFromFavorites(self, video_id, username='default'): """Delete a video entry from the users favorite feed. Needs authentication. Args: video_id: A string representing the ID of the video that is to be removed username: An optional string representing the username of the user'...
[ "def", "DeleteVideoEntryFromFavorites", "(", "self", ",", "video_id", ",", "username", "=", "'default'", ")", ":", "edit_link", "=", "'%s/%s/%s/%s'", "%", "(", "YOUTUBE_USER_FEED_URI", ",", "username", ",", "'favorites'", ",", "video_id", ")", "return", "self", ...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/youtube/service.py#L892-L907
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/gradient_checker_v2.py
python
compute_gradient
(f, x, delta=None)
return _compute_gradient_list(f, x, delta)
Computes the theoretical and numeric Jacobian of `f`. With y = f(x), computes the theoretical and numeric Jacobian dy/dx. Args: f: the function. x: the arguments for the function as a list or tuple of values convertible to a Tensor. delta: (optional) perturbation used to compute numeric Jacobian...
Computes the theoretical and numeric Jacobian of `f`.
[ "Computes", "the", "theoretical", "and", "numeric", "Jacobian", "of", "f", "." ]
def compute_gradient(f, x, delta=None): """Computes the theoretical and numeric Jacobian of `f`. With y = f(x), computes the theoretical and numeric Jacobian dy/dx. Args: f: the function. x: the arguments for the function as a list or tuple of values convertible to a Tensor. delta: (optional) ...
[ "def", "compute_gradient", "(", "f", ",", "x", ",", "delta", "=", "None", ")", ":", "if", "not", "isinstance", "(", "x", ",", "(", "list", ",", "tuple", ")", ")", ":", "raise", "ValueError", "(", "\"`x` must be a list or tuple of values convertible to a Tensor...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/gradient_checker_v2.py#L294-L342