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
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
infra/bots/recipe_modules/gold_upload/api.py
python
GoldUploadApi.upload
(self)
Attempt to upload files to Gold. This module assumes setup has occurred for the vars and flavor modules.
Attempt to upload files to Gold. This module assumes setup has occurred for the vars and flavor modules.
[ "Attempt", "to", "upload", "files", "to", "Gold", ".", "This", "module", "assumes", "setup", "has", "occurred", "for", "the", "vars", "and", "flavor", "modules", "." ]
def upload(self): """Attempt to upload files to Gold. This module assumes setup has occurred for the vars and flavor modules. """ revision = self.m.properties['revision'] results_dir = self.m.flavor.host_dirs.dm_dir # Upload the images. It is preferred that the images are uploaded first # s...
[ "def", "upload", "(", "self", ")", ":", "revision", "=", "self", ".", "m", ".", "properties", "[", "'revision'", "]", "results_dir", "=", "self", ".", "m", ".", "flavor", ".", "host_dirs", ".", "dm_dir", "# Upload the images. It is preferred that the images are ...
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipe_modules/gold_upload/api.py#L12-L58
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py
python
PopenSpawn.writelines
(self, sequence)
This calls write() for each element in the sequence. The sequence can be any iterable object producing strings, typically a list of strings. This does not add line separators. There is no return value.
This calls write() for each element in the sequence.
[ "This", "calls", "write", "()", "for", "each", "element", "in", "the", "sequence", "." ]
def writelines(self, sequence): '''This calls write() for each element in the sequence. The sequence can be any iterable object producing strings, typically a list of strings. This does not add line separators. There is no return value. ''' for s in sequence: ...
[ "def", "writelines", "(", "self", ",", "sequence", ")", ":", "for", "s", "in", "sequence", ":", "self", ".", "send", "(", "s", ")" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py#L122-L130
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTypeSummary.SetFunctionCode
(self, *args)
return _lldb.SBTypeSummary_SetFunctionCode(self, *args)
SetFunctionCode(self, str data)
SetFunctionCode(self, str data)
[ "SetFunctionCode", "(", "self", "str", "data", ")" ]
def SetFunctionCode(self, *args): """SetFunctionCode(self, str data)""" return _lldb.SBTypeSummary_SetFunctionCode(self, *args)
[ "def", "SetFunctionCode", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBTypeSummary_SetFunctionCode", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11463-L11465
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/sdb/db/manager/sdbmanager.py
python
SDBManager._build_filter_part
(self, cls, filters, order_by=None, select=None)
Build the filter part
Build the filter part
[ "Build", "the", "filter", "part" ]
def _build_filter_part(self, cls, filters, order_by=None, select=None): """ Build the filter part """ import types query_parts = [] order_by_filtered = False if order_by: if order_by[0] == "-": order_by_method = "DESC" ...
[ "def", "_build_filter_part", "(", "self", ",", "cls", ",", "filters", ",", "order_by", "=", "None", ",", "select", "=", "None", ")", ":", "import", "types", "query_parts", "=", "[", "]", "order_by_filtered", "=", "False", "if", "order_by", ":", "if", "or...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/sdb/db/manager/sdbmanager.py#L565-L644
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py
python
one_hot_encoding
(labels, num_classes, on_value=1.0, off_value=0.0, outputs_collections=None, scope=None)
Transform numeric labels into onehot_labels using `tf.one_hot`. Args: labels: [batch_size] target labels. num_classes: Total number of classes. on_value: A scalar defining the on-value. off_value: A scalar defining the off-value. outputs_collections: Collection to add the outputs. scope: Opti...
Transform numeric labels into onehot_labels using `tf.one_hot`.
[ "Transform", "numeric", "labels", "into", "onehot_labels", "using", "tf", ".", "one_hot", "." ]
def one_hot_encoding(labels, num_classes, on_value=1.0, off_value=0.0, outputs_collections=None, scope=None): """Transform numeric labels into onehot_labels using `tf.one_hot`. Args: labels: [batch_size] ta...
[ "def", "one_hot_encoding", "(", "labels", ",", "num_classes", ",", "on_value", "=", "1.0", ",", "off_value", "=", "0.0", ",", "outputs_collections", "=", "None", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "scope", ",", "'...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py#L2541-L2566
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/wsgiserver/ssl_pyopenssl.py
python
pyOpenSSLAdapter.get_context
(self)
return c
Return an SSL.Context from self attributes.
Return an SSL.Context from self attributes.
[ "Return", "an", "SSL", ".", "Context", "from", "self", "attributes", "." ]
def get_context(self): """Return an SSL.Context from self attributes.""" # See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442473 c = SSL.Context(SSL.SSLv23_METHOD) c.use_privatekey_file(self.private_key) if self.certificate_chain: c.load_verify_locations(...
[ "def", "get_context", "(", "self", ")", ":", "# See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442473", "c", "=", "SSL", ".", "Context", "(", "SSL", ".", "SSLv23_METHOD", ")", "c", ".", "use_privatekey_file", "(", "self", ".", "private_key", ")", "if", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/wsgiserver/ssl_pyopenssl.py#L193-L201
KhronosGroup/SPIRV-Tools
940127a77d3ad795a4a1422fbeaad50c9f19f2ea
utils/generate_grammar_tables.py
python
generate_capability_arrays
(caps)
return '\n'.join(arrays)
Returns the arrays of capabilities. Arguments: - caps: a sequence of sequence of capability names
Returns the arrays of capabilities.
[ "Returns", "the", "arrays", "of", "capabilities", "." ]
def generate_capability_arrays(caps): """Returns the arrays of capabilities. Arguments: - caps: a sequence of sequence of capability names """ caps = sorted(set([tuple(c) for c in caps if c])) arrays = [ 'static const SpvCapability {}[] = {};'.format( get_capability_array_...
[ "def", "generate_capability_arrays", "(", "caps", ")", ":", "caps", "=", "sorted", "(", "set", "(", "[", "tuple", "(", "c", ")", "for", "c", "in", "caps", "if", "c", "]", ")", ")", "arrays", "=", "[", "'static const SpvCapability {}[] = {};'", ".", "form...
https://github.com/KhronosGroup/SPIRV-Tools/blob/940127a77d3ad795a4a1422fbeaad50c9f19f2ea/utils/generate_grammar_tables.py#L95-L106
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
EvtHandler.ProcessEventLocally
(*args, **kwargs)
return _core_.EvtHandler_ProcessEventLocally(*args, **kwargs)
ProcessEventLocally(self, Event event) -> bool
ProcessEventLocally(self, Event event) -> bool
[ "ProcessEventLocally", "(", "self", "Event", "event", ")", "-", ">", "bool" ]
def ProcessEventLocally(*args, **kwargs): """ProcessEventLocally(self, Event event) -> bool""" return _core_.EvtHandler_ProcessEventLocally(*args, **kwargs)
[ "def", "ProcessEventLocally", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "EvtHandler_ProcessEventLocally", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L4160-L4162
rtbkit/rtbkit
502d06acc3f8d90438946b6ae742190f2f4b4fbb
jml-build/jmlbuild.py
python
Parser.parse_func_default
(self, line)
return line
Function which don't have special handlers are parsed here.
Function which don't have special handlers are parsed here.
[ "Function", "which", "don", "t", "have", "special", "handlers", "are", "parsed", "here", "." ]
def parse_func_default(self, line): """ Function which don't have special handlers are parsed here. """ print_dbg("\tdefault_func: " + line) params, line = self.parse_func_params(line) return line
[ "def", "parse_func_default", "(", "self", ",", "line", ")", ":", "print_dbg", "(", "\"\\tdefault_func: \"", "+", "line", ")", "params", ",", "line", "=", "self", ".", "parse_func_params", "(", "line", ")", "return", "line" ]
https://github.com/rtbkit/rtbkit/blob/502d06acc3f8d90438946b6ae742190f2f4b4fbb/jml-build/jmlbuild.py#L532-L538
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MenuBar.FindItemById
(*args, **kwargs)
return _core_.MenuBar_FindItemById(*args, **kwargs)
FindItemById(self, int id) -> MenuItem
FindItemById(self, int id) -> MenuItem
[ "FindItemById", "(", "self", "int", "id", ")", "-", ">", "MenuItem" ]
def FindItemById(*args, **kwargs): """FindItemById(self, int id) -> MenuItem""" return _core_.MenuBar_FindItemById(*args, **kwargs)
[ "def", "FindItemById", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuBar_FindItemById", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12319-L12321
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/model_pruning/python/layers/rnn_cells.py
python
MaskedLSTMCell.call
(self, inputs, state)
return m, new_state
Run one step of LSTM. Args: inputs: input Tensor, 2D, `[batch, num_units]. state: if `state_is_tuple` is False, this must be a state Tensor, `2-D, [batch, state_size]`. If `state_is_tuple` is True, this must be a tuple of state Tensors, both `2-D`, with column sizes `c_state` and ...
Run one step of LSTM.
[ "Run", "one", "step", "of", "LSTM", "." ]
def call(self, inputs, state): """Run one step of LSTM. Args: inputs: input Tensor, 2D, `[batch, num_units]. state: if `state_is_tuple` is False, this must be a state Tensor, `2-D, [batch, state_size]`. If `state_is_tuple` is True, this must be a tuple of state Tensors, both `2-D`,...
[ "def", "call", "(", "self", ",", "inputs", ",", "state", ")", ":", "num_proj", "=", "self", ".", "_num_units", "if", "self", ".", "_num_proj", "is", "None", "else", "self", ".", "_num_proj", "sigmoid", "=", "math_ops", ".", "sigmoid", "if", "self", "."...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/model_pruning/python/layers/rnn_cells.py#L273-L348
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/util/binary.py
python
pack_be16
(value)
return bytearray([(value >> 8) & 0xFF, value & 0xFF])
:param value: input value :return: 16-bit big endian bytearray representation of the input value
:param value: input value :return: 16-bit big endian bytearray representation of the input value
[ ":", "param", "value", ":", "input", "value", ":", "return", ":", "16", "-", "bit", "big", "endian", "bytearray", "representation", "of", "the", "input", "value" ]
def pack_be16(value): """ :param value: input value :return: 16-bit big endian bytearray representation of the input value """ _check_input_value(value, 16) return bytearray([(value >> 8) & 0xFF, value & 0xFF])
[ "def", "pack_be16", "(", "value", ")", ":", "_check_input_value", "(", "value", ",", "16", ")", "return", "bytearray", "(", "[", "(", "value", ">>", "8", ")", "&", "0xFF", ",", "value", "&", "0xFF", "]", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/util/binary.py#L71-L77
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py
python
arange
(start, stop=None, step=1, dtype='int32')
return result
Creates a 1D tensor containing a sequence of integers. The function arguments use the same convention as Theano's arange: if only one argument is provided, it is in fact the "stop" argument and "start" is 0. The default type of the returned tensor is `'int32'` to match TensorFlow's default. Arguments: ...
Creates a 1D tensor containing a sequence of integers.
[ "Creates", "a", "1D", "tensor", "containing", "a", "sequence", "of", "integers", "." ]
def arange(start, stop=None, step=1, dtype='int32'): """Creates a 1D tensor containing a sequence of integers. The function arguments use the same convention as Theano's arange: if only one argument is provided, it is in fact the "stop" argument and "start" is 0. The default type of the returned tensor is `...
[ "def", "arange", "(", "start", ",", "stop", "=", "None", ",", "step", "=", "1", ",", "dtype", "=", "'int32'", ")", ":", "# Match the behavior of numpy and Theano by returning an empty sequence.", "if", "stop", "is", "None", "and", "start", "<", "0", ":", "star...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L2849-L2883
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftfunctions/dxf.py
python
getDXF
(obj, direction=None)
return get_dxf(obj, direction=direction)
Return DXF string of the object. DEPRECATED. Use 'get_dxf'.
Return DXF string of the object. DEPRECATED. Use 'get_dxf'.
[ "Return", "DXF", "string", "of", "the", "object", ".", "DEPRECATED", ".", "Use", "get_dxf", "." ]
def getDXF(obj, direction=None): """Return DXF string of the object. DEPRECATED. Use 'get_dxf'.""" utils.use_instead("get_dxf") return get_dxf(obj, direction=direction)
[ "def", "getDXF", "(", "obj", ",", "direction", "=", "None", ")", ":", "utils", ".", "use_instead", "(", "\"get_dxf\"", ")", "return", "get_dxf", "(", "obj", ",", "direction", "=", "direction", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftfunctions/dxf.py#L136-L141
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/common/tokenizer.py
python
Tokenizer.__CreateNormalToken
(self, mode, string, line, line_number)
return self._CreateToken(string, type, line, line_number)
Creates a normal token. Args: mode: The current mode. string: The string to tokenize. line: The line of text. line_number: The line number within the file. Returns: A Token object, of the default type for the current mode.
Creates a normal token.
[ "Creates", "a", "normal", "token", "." ]
def __CreateNormalToken(self, mode, string, line, line_number): """Creates a normal token. Args: mode: The current mode. string: The string to tokenize. line: The line of text. line_number: The line number within the file. Returns: A Token object, of the default type for the ...
[ "def", "__CreateNormalToken", "(", "self", ",", "mode", ",", "string", ",", "line", ",", "line_number", ")", ":", "type", "=", "Type", ".", "NORMAL", "if", "mode", "in", "self", ".", "default_types", ":", "type", "=", "self", ".", "default_types", "[", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/common/tokenizer.py#L149-L164
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py
python
train
()
Train CIFAR-10 for a number of steps.
Train CIFAR-10 for a number of steps.
[ "Train", "CIFAR", "-", "10", "for", "a", "number", "of", "steps", "." ]
def train(): """Train CIFAR-10 for a number of steps.""" with tf.Graph().as_default(), tf.device('/cpu:0'): # Create a variable to count the number of train() calls. This equals the # number of batches processed * FLAGS.num_gpus. global_step = tf.get_variable( 'global_step', [], initiali...
[ "def", "train", "(", ")", ":", "with", "tf", ".", "Graph", "(", ")", ".", "as_default", "(", ")", ",", "tf", ".", "device", "(", "'/cpu:0'", ")", ":", "# Create a variable to count the number of train() calls. This equals the", "# number of batches processed * FLAGS.n...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py#L148-L268
ucb-bar/esp-llvm
8aec2ae754fd66d4e73b9b777a9f20c4583a0f03
bindings/python/llvm/object.py
python
Symbol.expire
(self)
Mark the object as expired to prevent future API accesses. This is called internally by this module and it is unlikely that external callers have a legitimate reason for using it.
Mark the object as expired to prevent future API accesses.
[ "Mark", "the", "object", "as", "expired", "to", "prevent", "future", "API", "accesses", "." ]
def expire(self): """Mark the object as expired to prevent future API accesses. This is called internally by this module and it is unlikely that external callers have a legitimate reason for using it. """ self.expired = True
[ "def", "expire", "(", "self", ")", ":", "self", ".", "expired", "=", "True" ]
https://github.com/ucb-bar/esp-llvm/blob/8aec2ae754fd66d4e73b9b777a9f20c4583a0f03/bindings/python/llvm/object.py#L350-L356
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/_multivariate.py
python
wishart_gen.rvs
(self, df, scale, size=1, random_state=None)
return _squeeze_output(out)
Draw random samples from a Wishart distribution. Parameters ---------- %(_doc_default_callparams)s size : integer or iterable of integers, optional Number of samples to draw (default 1). %(_doc_random_state)s Returns ------- rvs : ndarray ...
Draw random samples from a Wishart distribution.
[ "Draw", "random", "samples", "from", "a", "Wishart", "distribution", "." ]
def rvs(self, df, scale, size=1, random_state=None): """ Draw random samples from a Wishart distribution. Parameters ---------- %(_doc_default_callparams)s size : integer or iterable of integers, optional Number of samples to draw (default 1). %(_doc_...
[ "def", "rvs", "(", "self", ",", "df", ",", "scale", ",", "size", "=", "1", ",", "random_state", "=", "None", ")", ":", "n", ",", "shape", "=", "self", ".", "_process_size", "(", "size", ")", "dim", ",", "df", ",", "scale", "=", "self", ".", "_p...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_multivariate.py#L1915-L1945
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsYiSyllables
(code)
return ret
Check whether the character is part of YiSyllables UCS Block
Check whether the character is part of YiSyllables UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "YiSyllables", "UCS", "Block" ]
def uCSIsYiSyllables(code): """Check whether the character is part of YiSyllables UCS Block """ ret = libxml2mod.xmlUCSIsYiSyllables(code) return ret
[ "def", "uCSIsYiSyllables", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsYiSyllables", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2984-L2987
may0324/DeepCompression-caffe
0aff6c1287bda4cfc7f378ed8a16524e1afabd8c
scripts/cpp_lint.py
python
ParseNolintSuppressions
(filename, raw_line, linenum, error)
Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. ...
Updates the global list of error-suppressions.
[ "Updates", "the", "global", "list", "of", "error", "-", "suppressions", "." ]
def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the inp...
[ "def", "ParseNolintSuppressions", "(", "filename", ",", "raw_line", ",", "linenum", ",", "error", ")", ":", "# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).", "matched", "=", "_RE_SUPPRESSION", ".", "search", "(", "raw_line", ")", "if", "matched", ":", "if",...
https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L464-L492
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/encoder.py
python
_StructPackEncoder
(wire_type, format)
return SpecificEncoder
Return a constructor for an encoder for a fixed-width field. Args: wire_type: The field's wire type, for encoding tags. format: The format string to pass to struct.pack().
Return a constructor for an encoder for a fixed-width field.
[ "Return", "a", "constructor", "for", "an", "encoder", "for", "a", "fixed", "-", "width", "field", "." ]
def _StructPackEncoder(wire_type, format): """Return a constructor for an encoder for a fixed-width field. Args: wire_type: The field's wire type, for encoding tags. format: The format string to pass to struct.pack(). """ value_size = struct.calcsize(format) def SpecificEncoder(field_number, ...
[ "def", "_StructPackEncoder", "(", "wire_type", ",", "format", ")", ":", "value_size", "=", "struct", ".", "calcsize", "(", "format", ")", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "local_struct_pack", "=", "...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/encoder.py#L505-L540
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/gxx.py
python
generate
(env)
Add Builders and construction variables for g++ to an Environment.
Add Builders and construction variables for g++ to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "g", "++", "to", "an", "Environment", "." ]
def generate(env): """Add Builders and construction variables for g++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) if 'CXX' not in env: env['CXX'] = env.Detect(compilers) or compilers[0] cxx.generate(env) # platform specific settings if env['PLATFOR...
[ "def", "generate", "(", "env", ")", ":", "static_obj", ",", "shared_obj", "=", "SCons", ".", "Tool", ".", "createObjBuilders", "(", "env", ")", "if", "'CXX'", "not", "in", "env", ":", "env", "[", "'CXX'", "]", "=", "env", ".", "Detect", "(", "compile...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/gxx.py#L46-L67
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/datetime.py
python
timezone.__getinitargs__
(self)
return (self._offset, self._name)
pickle support
pickle support
[ "pickle", "support" ]
def __getinitargs__(self): """pickle support""" if self._name is None: return (self._offset,) return (self._offset, self._name)
[ "def", "__getinitargs__", "(", "self", ")", ":", "if", "self", ".", "_name", "is", "None", ":", "return", "(", "self", ".", "_offset", ",", ")", "return", "(", "self", ".", "_offset", ",", "self", ".", "_name", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/datetime.py#L2163-L2167
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextBuffer_GetFloatingLayoutMode
(*args)
return _richtext.RichTextBuffer_GetFloatingLayoutMode(*args)
RichTextBuffer_GetFloatingLayoutMode() -> bool
RichTextBuffer_GetFloatingLayoutMode() -> bool
[ "RichTextBuffer_GetFloatingLayoutMode", "()", "-", ">", "bool" ]
def RichTextBuffer_GetFloatingLayoutMode(*args): """RichTextBuffer_GetFloatingLayoutMode() -> bool""" return _richtext.RichTextBuffer_GetFloatingLayoutMode(*args)
[ "def", "RichTextBuffer_GetFloatingLayoutMode", "(", "*", "args", ")", ":", "return", "_richtext", ".", "RichTextBuffer_GetFloatingLayoutMode", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2729-L2731
eclipse/omr
056e7c9ce9d503649190bc5bd9931fac30b4e4bc
jitbuilder/apigen/genutils.py
python
APIClass.as_type
(self)
return APIType(self.name(), self.api)
Returns an instance of APIType corresponding to the described class.
Returns an instance of APIType corresponding to the described class.
[ "Returns", "an", "instance", "of", "APIType", "corresponding", "to", "the", "described", "class", "." ]
def as_type(self): """Returns an instance of APIType corresponding to the described class.""" return APIType(self.name(), self.api)
[ "def", "as_type", "(", "self", ")", ":", "return", "APIType", "(", "self", ".", "name", "(", ")", ",", "self", ".", "api", ")" ]
https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/genutils.py#L346-L348
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/osr.py
python
SpatialReference.SetOS
(self, *args, **kwargs)
return _osr.SpatialReference_SetOS(self, *args, **kwargs)
r"""SetOS(SpatialReference self, double dfOriginLat, double dfCMeridian, double scale, double fe, double fn) -> OGRErr
r"""SetOS(SpatialReference self, double dfOriginLat, double dfCMeridian, double scale, double fe, double fn) -> OGRErr
[ "r", "SetOS", "(", "SpatialReference", "self", "double", "dfOriginLat", "double", "dfCMeridian", "double", "scale", "double", "fe", "double", "fn", ")", "-", ">", "OGRErr" ]
def SetOS(self, *args, **kwargs): r"""SetOS(SpatialReference self, double dfOriginLat, double dfCMeridian, double scale, double fe, double fn) -> OGRErr""" return _osr.SpatialReference_SetOS(self, *args, **kwargs)
[ "def", "SetOS", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_osr", ".", "SpatialReference_SetOS", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L646-L648
google/swiftshader
8ccc63f045d5975fb67f9dfd3d2b8235b0526990
third_party/SPIRV-Tools/utils/generate_grammar_tables.py
python
InstInitializer.__init__
(self, opname, caps, exts, operands, version, lastVersion)
Initialization. Arguments: - opname: opcode name (with the 'Op' prefix) - caps: a sequence of capability names required by this opcode - exts: a sequence of names of extensions enabling this enumerant - operands: a sequence of (operand-kind, operand-quantifier) tuples ...
Initialization.
[ "Initialization", "." ]
def __init__(self, opname, caps, exts, operands, version, lastVersion): """Initialization. Arguments: - opname: opcode name (with the 'Op' prefix) - caps: a sequence of capability names required by this opcode - exts: a sequence of names of extensions enabling this enumera...
[ "def", "__init__", "(", "self", ",", "opname", ",", "caps", ",", "exts", ",", "operands", ",", "version", ",", "lastVersion", ")", ":", "assert", "opname", ".", "startswith", "(", "'Op'", ")", "self", ".", "opname", "=", "opname", "[", "2", ":", "]",...
https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/generate_grammar_tables.py#L216-L243
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py
python
RawTurtle.onrelease
(self, fun, btn=1, add=None)
Bind fun to mouse-button-release event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). Example ...
Bind fun to mouse-button-release event on this turtle on canvas.
[ "Bind", "fun", "to", "mouse", "-", "button", "-", "release", "event", "on", "this", "turtle", "on", "canvas", "." ]
def onrelease(self, fun, btn=1, add=None): """Bind fun to mouse-button-release event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-butto...
[ "def", "onrelease", "(", "self", ",", "fun", ",", "btn", "=", "1", ",", "add", "=", "None", ")", ":", "self", ".", "screen", ".", "_onrelease", "(", "self", ".", "turtle", ".", "_item", ",", "fun", ",", "btn", ",", "add", ")", "self", ".", "_up...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L3435-L3458
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/scripts/cpp_lint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L1045-L1059
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/deephol/prover.py
python
Prover.prove_one
(self, search_tree: proof_search_tree.ProofSearchTree, task: proof_assistant_pb2.ProverTask)
Prove a single-goal task. This method can assume an already initialized search tree with node 0 being the sing goal specified in the task. Args: search_tree: The pre-initialized search tree. task: Task to be performed. Returns: Error message on error, None otherwise.
Prove a single-goal task.
[ "Prove", "a", "single", "-", "goal", "task", "." ]
def prove_one(self, search_tree: proof_search_tree.ProofSearchTree, task: proof_assistant_pb2.ProverTask) -> Optional[Text]: """Prove a single-goal task. This method can assume an already initialized search tree with node 0 being the sing goal specified in the task. Args: search_...
[ "def", "prove_one", "(", "self", ",", "search_tree", ":", "proof_search_tree", ".", "ProofSearchTree", ",", "task", ":", "proof_assistant_pb2", ".", "ProverTask", ")", "->", "Optional", "[", "Text", "]", ":", "raise", "NotImplementedError", "(", "'Must define this...
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/prover.py#L110-L124
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py
python
Fraction.__str__
(self)
str(self)
str(self)
[ "str", "(", "self", ")" ]
def __str__(self): """str(self)""" if self._denominator == 1: return str(self._numerator) else: return '%s/%s' % (self._numerator, self._denominator)
[ "def", "__str__", "(", "self", ")", ":", "if", "self", ".", "_denominator", "==", "1", ":", "return", "str", "(", "self", ".", "_numerator", ")", "else", ":", "return", "'%s/%s'", "%", "(", "self", ".", "_numerator", ",", "self", ".", "_denominator", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py#L273-L278
15172658790/Blog
46e5036f5fbcad535af2255dc0e095cebcd8d710
计算机与信息类/数据结构/students/mbinary/allOone/allOone.py
python
AllOne.inc
(self, key,n=1)
Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void
Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void
[ "Inserts", "a", "new", "key", "<Key", ">", "with", "value", "1", ".", "Or", "increments", "an", "existing", "key", "by", "1", ".", ":", "type", "key", ":", "str", ":", "rtype", ":", "void" ]
def inc(self, key,n=1): """ Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void """ if key in self: self[key]+=n else:self[key]=n for i in range(n): self.dll.incTo(key, self[key])
[ "def", "inc", "(", "self", ",", "key", ",", "n", "=", "1", ")", ":", "if", "key", "in", "self", ":", "self", "[", "key", "]", "+=", "n", "else", ":", "self", "[", "key", "]", "=", "n", "for", "i", "in", "range", "(", "n", ")", ":", "self"...
https://github.com/15172658790/Blog/blob/46e5036f5fbcad535af2255dc0e095cebcd8d710/计算机与信息类/数据结构/students/mbinary/allOone/allOone.py#L111-L120
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/extension_dict.py
python
_ExtensionDict.__init__
(self, extended_message)
Args: extended_message: Message instance for which we are the Extensions dict.
Args: extended_message: Message instance for which we are the Extensions dict.
[ "Args", ":", "extended_message", ":", "Message", "instance", "for", "which", "we", "are", "the", "Extensions", "dict", "." ]
def __init__(self, extended_message): """ Args: extended_message: Message instance for which we are the Extensions dict. """ self._extended_message = extended_message
[ "def", "__init__", "(", "self", ",", "extended_message", ")", ":", "self", ".", "_extended_message", "=", "extended_message" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/extension_dict.py#L71-L76
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/npytypes.py
python
Record.typeof
(self, key)
return self.fields[key].type
Get the type of a field.
Get the type of a field.
[ "Get", "the", "type", "of", "a", "field", "." ]
def typeof(self, key): """Get the type of a field. """ return self.fields[key].type
[ "def", "typeof", "(", "self", ",", "key", ")", ":", "return", "self", ".", "fields", "[", "key", "]", ".", "type" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/npytypes.py#L173-L176
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py
python
Decimal.is_subnormal
(self, context=None)
return self.adjusted() < context.Emin
Return True if self is subnormal; otherwise return False.
Return True if self is subnormal; otherwise return False.
[ "Return", "True", "if", "self", "is", "subnormal", ";", "otherwise", "return", "False", "." ]
def is_subnormal(self, context=None): """Return True if self is subnormal; otherwise return False.""" if self._is_special or not self: return False if context is None: context = getcontext() return self.adjusted() < context.Emin
[ "def", "is_subnormal", "(", "self", ",", "context", "=", "None", ")", ":", "if", "self", ".", "_is_special", "or", "not", "self", ":", "return", "False", "if", "context", "is", "None", ":", "context", "=", "getcontext", "(", ")", "return", "self", ".",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L3051-L3057
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/cpp_wrappers/optimization.py
python
GradientDescentOptimizer.optimize
(self, **kwargs)
C++ does not expose this endpoint.
C++ does not expose this endpoint.
[ "C", "++", "does", "not", "expose", "this", "endpoint", "." ]
def optimize(self, **kwargs): """C++ does not expose this endpoint.""" raise NotImplementedError("C++ wrapper currently does not support optimization member functions.")
[ "def", "optimize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError", "(", "\"C++ wrapper currently does not support optimization member functions.\"", ")" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/optimization.py#L436-L438
tensorflow/ngraph-bridge
ea6422491ec75504e78a63db029e7f74ec3479a5
examples/mnist/mnist_deep_simplified_distributed.py
python
weight_variable
(shape, name)
return weight_var
weight_variable generates a weight variable of a given shape.
weight_variable generates a weight variable of a given shape.
[ "weight_variable", "generates", "a", "weight", "variable", "of", "a", "given", "shape", "." ]
def weight_variable(shape, name): """weight_variable generates a weight variable of a given shape.""" weight_var = tf.compat.v1.get_variable(name, shape) return weight_var
[ "def", "weight_variable", "(", "shape", ",", "name", ")", ":", "weight_var", "=", "tf", ".", "compat", ".", "v1", ".", "get_variable", "(", "name", ",", "shape", ")", "return", "weight_var" ]
https://github.com/tensorflow/ngraph-bridge/blob/ea6422491ec75504e78a63db029e7f74ec3479a5/examples/mnist/mnist_deep_simplified_distributed.py#L136-L139
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/decomposition/_dict_learning.py
python
dict_learning_online
(X, n_components=2, alpha=1, n_iter=100, return_code=True, dict_init=None, callback=None, batch_size=3, verbose=False, shuffle=True, n_jobs=None, method='lars', iter_offset=0, random_state=None, return_inner_stats=False,...
Solves a dictionary learning matrix factorization problem online. Finds the best dictionary and the corresponding sparse code for approximating the data matrix X by solving:: (U^*, V^*) = argmin 0.5 || X - U V ||_2^2 + alpha * || U ||_1 (U,V) with || V_k ||_2 ...
Solves a dictionary learning matrix factorization problem online.
[ "Solves", "a", "dictionary", "learning", "matrix", "factorization", "problem", "online", "." ]
def dict_learning_online(X, n_components=2, alpha=1, n_iter=100, return_code=True, dict_init=None, callback=None, batch_size=3, verbose=False, shuffle=True, n_jobs=None, method='lars', iter_offset=0, random_state=None, r...
[ "def", "dict_learning_online", "(", "X", ",", "n_components", "=", "2", ",", "alpha", "=", "1", ",", "n_iter", "=", "100", ",", "return_code", "=", "True", ",", "dict_init", "=", "None", ",", "callback", "=", "None", ",", "batch_size", "=", "3", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_dict_learning.py#L620-L875
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/index.py
python
DatetimeIndex.year
(self)
return self._get_dt_field("year")
The year of the datetime. Examples -------- >>> import cudf >>> import pandas as pd >>> datetime_index = cudf.Index(pd.date_range("2000-01-01", ... periods=3, freq="Y")) >>> datetime_index DatetimeIndex(['2000-12-31', '2001-12-31', '2002-12-31...
The year of the datetime.
[ "The", "year", "of", "the", "datetime", "." ]
def year(self): """ The year of the datetime. Examples -------- >>> import cudf >>> import pandas as pd >>> datetime_index = cudf.Index(pd.date_range("2000-01-01", ... periods=3, freq="Y")) >>> datetime_index DatetimeIndex(['20...
[ "def", "year", "(", "self", ")", ":", "# noqa: E501", "return", "self", ".", "_get_dt_field", "(", "\"year\"", ")" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/index.py#L1597-L1612
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/linalg/blas.py
python
find_best_blas_type
(arrays=(), dtype=None)
return prefix, dtype, prefer_fortran
Find best-matching BLAS/LAPACK type. Arrays are used to determine the optimal prefix of BLAS routines. Parameters ---------- arrays : sequence of ndarrays, optional Arrays can be given to determine optimal prefix of BLAS routines. If not given, double-precision routines will be ...
Find best-matching BLAS/LAPACK type.
[ "Find", "best", "-", "matching", "BLAS", "/", "LAPACK", "type", "." ]
def find_best_blas_type(arrays=(), dtype=None): """Find best-matching BLAS/LAPACK type. Arrays are used to determine the optimal prefix of BLAS routines. Parameters ---------- arrays : sequence of ndarrays, optional Arrays can be given to determine optimal prefix of BLAS routines. ...
[ "def", "find_best_blas_type", "(", "arrays", "=", "(", ")", ",", "dtype", "=", "None", ")", ":", "dtype", "=", "_np", ".", "dtype", "(", "dtype", ")", "prefer_fortran", "=", "False", "if", "arrays", ":", "# use the most generic type in arrays", "dtypes", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/blas.py#L236-L294
mitsuba-renderer/mitsuba2
4e7628c6eed365904ca2ba536b795d1b03410344
src/python/__init__.py
python
variant
()
return getattr(_tls, 'variant', None)
Returns the currently active variant
Returns the currently active variant
[ "Returns", "the", "currently", "active", "variant" ]
def variant(): 'Returns the currently active variant' return getattr(_tls, 'variant', None)
[ "def", "variant", "(", ")", ":", "return", "getattr", "(", "_tls", ",", "'variant'", ",", "None", ")" ]
https://github.com/mitsuba-renderer/mitsuba2/blob/4e7628c6eed365904ca2ba536b795d1b03410344/src/python/__init__.py#L178-L180
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
PyLocale.__init__
(self, *args, **kwargs)
__init__(self, int language=-1, int flags=LOCALE_LOAD_DEFAULT) -> PyLocale
__init__(self, int language=-1, int flags=LOCALE_LOAD_DEFAULT) -> PyLocale
[ "__init__", "(", "self", "int", "language", "=", "-", "1", "int", "flags", "=", "LOCALE_LOAD_DEFAULT", ")", "-", ">", "PyLocale" ]
def __init__(self, *args, **kwargs): """__init__(self, int language=-1, int flags=LOCALE_LOAD_DEFAULT) -> PyLocale""" _gdi_.PyLocale_swiginit(self,_gdi_.new_PyLocale(*args, **kwargs)) PyLocale._setCallbackInfo(self, self, PyLocale)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "PyLocale_swiginit", "(", "self", ",", "_gdi_", ".", "new_PyLocale", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "PyLocale", ".", "_setCallbac...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3152-L3155
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
NotificationMessage.__init__
(self, *args)
__init__(self) -> NotificationMessage __init__(self, String title, String message=wxEmptyString, Window parent=None) -> NotificationMessage
__init__(self) -> NotificationMessage __init__(self, String title, String message=wxEmptyString, Window parent=None) -> NotificationMessage
[ "__init__", "(", "self", ")", "-", ">", "NotificationMessage", "__init__", "(", "self", "String", "title", "String", "message", "=", "wxEmptyString", "Window", "parent", "=", "None", ")", "-", ">", "NotificationMessage" ]
def __init__(self, *args): """ __init__(self) -> NotificationMessage __init__(self, String title, String message=wxEmptyString, Window parent=None) -> NotificationMessage """ _misc_.NotificationMessage_swiginit(self,_misc_.new_NotificationMessage(*args))
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_misc_", ".", "NotificationMessage_swiginit", "(", "self", ",", "_misc_", ".", "new_NotificationMessage", "(", "*", "args", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1210-L1215
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_graph.py
python
GraphBase.children
(self, node)
Get successors of a node in graph Returns: list: list of successors
Get successors of a node in graph
[ "Get", "successors", "of", "a", "node", "in", "graph" ]
def children(self, node): """Get successors of a node in graph Returns: list: list of successors """
[ "def", "children", "(", "self", ",", "node", ")", ":" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_graph.py#L27-L32
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py
python
Executor.get_timestamp
(self)
return 0
Fetch a time stamp for this Executor. We don't have one, of course (only files do), but this is the interface used by the timestamp module.
Fetch a time stamp for this Executor. We don't have one, of course (only files do), but this is the interface used by the timestamp module.
[ "Fetch", "a", "time", "stamp", "for", "this", "Executor", ".", "We", "don", "t", "have", "one", "of", "course", "(", "only", "files", "do", ")", "but", "this", "is", "the", "interface", "used", "by", "the", "timestamp", "module", "." ]
def get_timestamp(self): """Fetch a time stamp for this Executor. We don't have one, of course (only files do), but this is the interface used by the timestamp module. """ return 0
[ "def", "get_timestamp", "(", "self", ")", ":", "return", "0" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py#L465-L470
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/get.py
python
TransactionHistoryGetter.get_symbol
(self)
return clib.get_str(self._abi('GetSymbol'), self._obj)
Returns search symbol being used.
Returns search symbol being used.
[ "Returns", "search", "symbol", "being", "used", "." ]
def get_symbol(self): """Returns search symbol being used.""" return clib.get_str(self._abi('GetSymbol'), self._obj)
[ "def", "get_symbol", "(", "self", ")", ":", "return", "clib", ".", "get_str", "(", "self", ".", "_abi", "(", "'GetSymbol'", ")", ",", "self", ".", "_obj", ")" ]
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L1181-L1183
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/muelu/doc/Tutorial/tex/prepareTexTutorial.py
python
deleteDir
(path)
deletes the path entirely
deletes the path entirely
[ "deletes", "the", "path", "entirely" ]
def deleteDir(path): """deletes the path entirely""" cmd = "rm -rf "+path result = getstatusoutput(cmd) if(result[0]!=0): raise RuntimeError(result[1])
[ "def", "deleteDir", "(", "path", ")", ":", "cmd", "=", "\"rm -rf \"", "+", "path", "result", "=", "getstatusoutput", "(", "cmd", ")", "if", "(", "result", "[", "0", "]", "!=", "0", ")", ":", "raise", "RuntimeError", "(", "result", "[", "1", "]", ")...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/doc/Tutorial/tex/prepareTexTutorial.py#L17-L22
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/roslib/src/roslib/names.py
python
resource_name_package
(name)
return name[:name.find(PRN_SEPARATOR)]
pkg/typeName -> pkg, typeName -> None @param name: package resource name, e.g. 'std_msgs/String' @type name: str @return: package name of resource @rtype: str
pkg/typeName -> pkg, typeName -> None
[ "pkg", "/", "typeName", "-", ">", "pkg", "typeName", "-", ">", "None" ]
def resource_name_package(name): """ pkg/typeName -> pkg, typeName -> None @param name: package resource name, e.g. 'std_msgs/String' @type name: str @return: package name of resource @rtype: str """ if not PRN_SEPARATOR in name: return None return name[:name.find(...
[ "def", "resource_name_package", "(", "name", ")", ":", "if", "not", "PRN_SEPARATOR", "in", "name", ":", "return", "None", "return", "name", "[", ":", "name", ".", "find", "(", "PRN_SEPARATOR", ")", "]" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/names.py#L242-L254
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/sparse_ops.py
python
sparse_maximum
(sp_a, sp_b, name=None)
return sparse_tensor.SparseTensor(out_indices, out_values, sp_a.dense_shape)
Returns the element-wise max of two SparseTensors. Assumes the two SparseTensors have the same shape, i.e., no broadcasting. Example: ```python sp_zero = sparse_tensor.SparseTensor([[0]], [0], [7]) sp_one = sparse_tensor.SparseTensor([[1]], [1], [7]) res = tf.sparse_maximum(sp_zero, sp_one).eval() # "re...
Returns the element-wise max of two SparseTensors.
[ "Returns", "the", "element", "-", "wise", "max", "of", "two", "SparseTensors", "." ]
def sparse_maximum(sp_a, sp_b, name=None): """Returns the element-wise max of two SparseTensors. Assumes the two SparseTensors have the same shape, i.e., no broadcasting. Example: ```python sp_zero = sparse_tensor.SparseTensor([[0]], [0], [7]) sp_one = sparse_tensor.SparseTensor([[1]], [1], [7]) res = t...
[ "def", "sparse_maximum", "(", "sp_a", ",", "sp_b", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"SparseSparseMaximum\"", ",", "[", "sp_a", ".", "indices", ",", "sp_a", ".", "values", ",", "sp_b", ".", "indic...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/sparse_ops.py#L1774-L1807
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/_osx_support.py
python
_find_executable
(executable, path=None)
Tries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the complete filename or None if not found.
Tries to find 'executable' in the directories listed in 'path'.
[ "Tries", "to", "find", "executable", "in", "the", "directories", "listed", "in", "path", "." ]
def _find_executable(executable, path=None): """Tries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the complete filename or None if not found. """ if path is None: path = os.environ...
[ "def", "_find_executable", "(", "executable", ",", "path", "=", "None", ")", ":", "if", "path", "is", "None", ":", "path", "=", "os", ".", "environ", "[", "'PATH'", "]", "paths", "=", "path", ".", "split", "(", "os", ".", "pathsep", ")", "base", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_osx_support.py#L29-L52
tcpexmachina/remy
687b5db29b81df7ae8737889c78b47e7f9788297
scripts/plot.py
python
process_replot_argument
(replot_dir, results_dir)
return remyccs, link_ppt_range, console_dir
Reads the args.json file in a results directory, copies it to an appropriate location in the current results directory and returns the link speed range and a list of RemyCC files.
Reads the args.json file in a results directory, copies it to an appropriate location in the current results directory and returns the link speed range and a list of RemyCC files.
[ "Reads", "the", "args", ".", "json", "file", "in", "a", "results", "directory", "copies", "it", "to", "an", "appropriate", "location", "in", "the", "current", "results", "directory", "and", "returns", "the", "link", "speed", "range", "and", "a", "list", "o...
def process_replot_argument(replot_dir, results_dir): """Reads the args.json file in a results directory, copies it to an appropriate location in the current results directory and returns the link speed range and a list of RemyCC files.""" argsfilename = os.path.join(replot_dir, "args.json") argsfil...
[ "def", "process_replot_argument", "(", "replot_dir", ",", "results_dir", ")", ":", "argsfilename", "=", "os", ".", "path", ".", "join", "(", "replot_dir", ",", "\"args.json\"", ")", "argsfile", "=", "open", "(", "argsfilename", ")", "jsondict", "=", "json", ...
https://github.com/tcpexmachina/remy/blob/687b5db29b81df7ae8737889c78b47e7f9788297/scripts/plot.py#L226-L244
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
FileTypeInfoSequence
(*args, **kwargs)
return val
FileTypeInfoSequence(wxArrayString sArray) -> FileTypeInfo
FileTypeInfoSequence(wxArrayString sArray) -> FileTypeInfo
[ "FileTypeInfoSequence", "(", "wxArrayString", "sArray", ")", "-", ">", "FileTypeInfo" ]
def FileTypeInfoSequence(*args, **kwargs): """FileTypeInfoSequence(wxArrayString sArray) -> FileTypeInfo""" val = _misc_.new_FileTypeInfoSequence(*args, **kwargs) return val
[ "def", "FileTypeInfoSequence", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_misc_", ".", "new_FileTypeInfoSequence", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2562-L2565
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/base/service.py
python
GBaseService.__init__
(self, email=None, password=None, source=None, server='base.google.com', api_key=None, additional_headers=None, handler=None, **kwargs)
Creates a client for the Google Base service. Args: email: string (optional) The user's email address, used for authentication. password: string (optional) The user's password. source: string (optional) The name of the user's application. server: string (optional) The name of the ...
Creates a client for the Google Base service.
[ "Creates", "a", "client", "for", "the", "Google", "Base", "service", "." ]
def __init__(self, email=None, password=None, source=None, server='base.google.com', api_key=None, additional_headers=None, handler=None, **kwargs): """Creates a client for the Google Base service. Args: email: string (optional) The user's email address, used for a...
[ "def", "__init__", "(", "self", ",", "email", "=", "None", ",", "password", "=", "None", ",", "source", "=", "None", ",", "server", "=", "'base.google.com'", ",", "api_key", "=", "None", ",", "additional_headers", "=", "None", ",", "handler", "=", "None"...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/base/service.py#L52-L72
danxuhk/ContinuousCRF-CNN
2b6dcaf179620f118b225ed12c890414ca828e21
scripts/cpp_lint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L934-L946
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/FakeIt/2.0.2/build/coveralls.py
python
Repository.git
(self, *arguments)
return process.communicate()[0].decode('UTF-8')
Return output from git.
Return output from git.
[ "Return", "output", "from", "git", "." ]
def git(self, *arguments): """Return output from git.""" process = subprocess.Popen(['git'] + list(arguments), stdout=subprocess.PIPE, cwd=self.cwd) return process.communicate()[0].decode('UTF-8')
[ "def", "git", "(", "self", ",", "*", "arguments", ")", ":", "process", "=", "subprocess", ".", "Popen", "(", "[", "'git'", "]", "+", "list", "(", "arguments", ")", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "cwd", "=", "self", ".", "cwd", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/FakeIt/2.0.2/build/coveralls.py#L63-L68
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
PrintPreview.GetFrame
(*args, **kwargs)
return _windows_.PrintPreview_GetFrame(*args, **kwargs)
GetFrame(self) -> Frame
GetFrame(self) -> Frame
[ "GetFrame", "(", "self", ")", "-", ">", "Frame" ]
def GetFrame(*args, **kwargs): """GetFrame(self) -> Frame""" return _windows_.PrintPreview_GetFrame(*args, **kwargs)
[ "def", "GetFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintPreview_GetFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5593-L5595
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/text_format.py
python
_Parser._MergeMessageField
(self, tokenizer, message, field)
Merges a single scalar field into a message. Args: tokenizer: A tokenizer to parse the field value. message: The message of which field is a member. field: The descriptor of the field to be merged. Raises: ParseError: In case of text parsing problems.
Merges a single scalar field into a message.
[ "Merges", "a", "single", "scalar", "field", "into", "a", "message", "." ]
def _MergeMessageField(self, tokenizer, message, field): """Merges a single scalar field into a message. Args: tokenizer: A tokenizer to parse the field value. message: The message of which field is a member. field: The descriptor of the field to be merged. Raises: ParseError: In c...
[ "def", "_MergeMessageField", "(", "self", ",", "tokenizer", ",", "message", ",", "field", ")", ":", "is_map_entry", "=", "_IsMapEntry", "(", "field", ")", "if", "tokenizer", ".", "TryConsume", "(", "'<'", ")", ":", "end_token", "=", "'>'", "else", ":", "...
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/text_format.py#L710-L781
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/utils.py
python
LRUCache.__delitem__
(self, key)
Remove an item from the cache dict. Raise a `KeyError` if it does not exist.
Remove an item from the cache dict. Raise a `KeyError` if it does not exist.
[ "Remove", "an", "item", "from", "the", "cache", "dict", ".", "Raise", "a", "KeyError", "if", "it", "does", "not", "exist", "." ]
def __delitem__(self, key): """Remove an item from the cache dict. Raise a `KeyError` if it does not exist. """ self._wlock.acquire() try: del self._mapping[key] try: self._remove(key) except ValueError: # __geti...
[ "def", "__delitem__", "(", "self", ",", "key", ")", ":", "self", ".", "_wlock", ".", "acquire", "(", ")", "try", ":", "del", "self", ".", "_mapping", "[", "key", "]", "try", ":", "self", ".", "_remove", "(", "key", ")", "except", "ValueError", ":",...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/utils.py#L429-L442
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/Resources/ST1.14/Tools/sentrytribe.py
python
Sentrytribe.resend_message
(self, msg_id)
Resend fragments requires a ping done first to find missing fragments
Resend fragments requires a ping done first to find missing fragments
[ "Resend", "fragments", "requires", "a", "ping", "done", "first", "to", "find", "missing", "fragments" ]
def resend_message(self, msg_id): """ Resend fragments requires a ping done first to find missing fragments """ if self.pending_msg_id == msg_id and msg_id in self.pending_messages.keys(): print "[+] Found saved message, only resending missing fragments" for i in self.pending_messages[msg_id].keys(): ...
[ "def", "resend_message", "(", "self", ",", "msg_id", ")", ":", "if", "self", ".", "pending_msg_id", "==", "msg_id", "and", "msg_id", "in", "self", ".", "pending_messages", ".", "keys", "(", ")", ":", "print", "\"[+] Found saved message, only resending missing frag...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/Resources/ST1.14/Tools/sentrytribe.py#L302-L320
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
NestingState.InNamespaceBody
(self)
return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise.
Check if we are currently one level inside a namespace body.
[ "Check", "if", "we", "are", "currently", "one", "level", "inside", "a", "namespace", "body", "." ]
def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
[ "def", "InNamespaceBody", "(", "self", ")", ":", "return", "self", ".", "stack", "and", "isinstance", "(", "self", ".", "stack", "[", "-", "1", "]", ",", "_NamespaceInfo", ")" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L2940-L2946
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
access-control/python/iot_access_control/log.py
python
log
(event)
Publish message to MQTT server and data store.
Publish message to MQTT server and data store.
[ "Publish", "message", "to", "MQTT", "server", "and", "data", "store", "." ]
def log(event): """ Publish message to MQTT server and data store. """ message = "{0} {1}".format(datetime.utcnow().isoformat(), event) payload = {"value": message} print(message) send(payload)
[ "def", "log", "(", "event", ")", ":", "message", "=", "\"{0} {1}\"", ".", "format", "(", "datetime", ".", "utcnow", "(", ")", ".", "isoformat", "(", ")", ",", "event", ")", "payload", "=", "{", "\"value\"", ":", "message", "}", "print", "(", "message...
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/access-control/python/iot_access_control/log.py#L45-L54
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
scripts/cpp_lint.py
python
ProcessFileData
(filename, file_extension, lines, error, extra_check_functions=[])
Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the last element being emp...
Performs lint checks and reports any errors to the given error function.
[ "Performs", "lint", "checks", "and", "reports", "any", "errors", "to", "the", "given", "error", "function", "." ]
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=[]): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. ...
[ "def", "ProcessFileData", "(", "filename", ",", "file_extension", ",", "lines", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "lines", "=", "(", "[", "'// marker so line numbers and indices both start at 1'", "]", "+", "lines", "+", "[", "...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/scripts/cpp_lint.py#L4648-L4691
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewRenderer.GetAlignment
(*args, **kwargs)
return _dataview.DataViewRenderer_GetAlignment(*args, **kwargs)
GetAlignment(self) -> int
GetAlignment(self) -> int
[ "GetAlignment", "(", "self", ")", "-", ">", "int" ]
def GetAlignment(*args, **kwargs): """GetAlignment(self) -> int""" return _dataview.DataViewRenderer_GetAlignment(*args, **kwargs)
[ "def", "GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewRenderer_GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1193-L1195
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/collections.py
python
Counter.__init__
(self, iterable=None, **kwds)
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new co...
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
[ "Create", "a", "new", "empty", "Counter", "object", ".", "And", "if", "given", "count", "elements", "from", "an", "input", "iterable", ".", "Or", "initialize", "the", "count", "from", "another", "mapping", "of", "elements", "to", "their", "counts", "." ]
def __init__(self, iterable=None, **kwds): '''Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. >>> c = Counter() # a new, empty counter ...
[ "def", "__init__", "(", "self", ",", "iterable", "=", "None", ",", "*", "*", "kwds", ")", ":", "super", "(", "Counter", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "update", "(", "iterable", ",", "*", "*", "kwds", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/collections.py#L432-L444
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py
python
RequestHeaders.get_list
(self, key, default=missing)
Get all the header values for a particular field name as a list
Get all the header values for a particular field name as a list
[ "Get", "all", "the", "header", "values", "for", "a", "particular", "field", "name", "as", "a", "list" ]
def get_list(self, key, default=missing): """Get all the header values for a particular field name as a list""" try: return dict.__getitem__(self, key.lower()) except KeyError: if default is not missing: return default else: ...
[ "def", "get_list", "(", "self", ",", "key", ",", "default", "=", "missing", ")", ":", "try", ":", "return", "dict", ".", "__getitem__", "(", "self", ",", "key", ".", "lower", "(", ")", ")", "except", "KeyError", ":", "if", "default", "is", "not", "...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py#L369-L378
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/pyproject.py
python
load_pyproject_toml
( use_pep517, # type: Optional[bool] pyproject_toml, # type: str setup_py, # type: str req_name # type: str )
return (requires, backend, check)
Load the pyproject.toml file. Parameters: use_pep517 - Has the user requested PEP 517 processing? None means the user hasn't explicitly specified. pyproject_toml - Location of the project's pyproject.toml file setup_py - Location of the project's setup.py file r...
Load the pyproject.toml file.
[ "Load", "the", "pyproject", ".", "toml", "file", "." ]
def load_pyproject_toml( use_pep517, # type: Optional[bool] pyproject_toml, # type: str setup_py, # type: str req_name # type: str ): # type: (...) -> Optional[Tuple[List[str], str, List[str]]] """Load the pyproject.toml file. Parameters: use_pep517 - Has the user requested PEP ...
[ "def", "load_pyproject_toml", "(", "use_pep517", ",", "# type: Optional[bool]", "pyproject_toml", ",", "# type: str", "setup_py", ",", "# type: str", "req_name", "# type: str", ")", ":", "# type: (...) -> Optional[Tuple[List[str], str, List[str]]]", "has_pyproject", "=", "os", ...
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/_internal/pyproject.py#L35-L171
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
StockGDI.GetCursor
(*args, **kwargs)
return _gdi_.StockGDI_GetCursor(*args, **kwargs)
GetCursor(int item) -> Cursor
GetCursor(int item) -> Cursor
[ "GetCursor", "(", "int", "item", ")", "-", ">", "Cursor" ]
def GetCursor(*args, **kwargs): """GetCursor(int item) -> Cursor""" return _gdi_.StockGDI_GetCursor(*args, **kwargs)
[ "def", "GetCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "StockGDI_GetCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6854-L6856
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/exec_util.py
python
exec_cmd
(cmd, path, input_string=None)
return {'out': out.decode('utf-8'), 'err': err.decode('utf-8'), 'ret': ret}
Execute the specified command and return the result.
Execute the specified command and return the result.
[ "Execute", "the", "specified", "command", "and", "return", "the", "result", "." ]
def exec_cmd(cmd, path, input_string=None): """ Execute the specified command and return the result. """ out = '' err = '' ret = -1 parts = cmd.split() try: if input_string is None: process = Popen( parts, cwd=path, stdout=PIPE, stderr=PIPE, shell=...
[ "def", "exec_cmd", "(", "cmd", ",", "path", ",", "input_string", "=", "None", ")", ":", "out", "=", "''", "err", "=", "''", "ret", "=", "-", "1", "parts", "=", "cmd", ".", "split", "(", ")", "try", ":", "if", "input_string", "is", "None", ":", ...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/exec_util.py#L10-L41
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/photos/__init__.py
python
TagEntry.GetAlbumUri
(self)
return href[:pos]
Return the uri to the AlbumEntry containing this tag
Return the uri to the AlbumEntry containing this tag
[ "Return", "the", "uri", "to", "the", "AlbumEntry", "containing", "this", "tag" ]
def GetAlbumUri(self): """Return the uri to the AlbumEntry containing this tag""" href = self.GetSelfLink().href pos = href.find('/photoid') if pos == -1: return None return href[:pos]
[ "def", "GetAlbumUri", "(", "self", ")", ":", "href", "=", "self", ".", "GetSelfLink", "(", ")", ".", "href", "pos", "=", "href", ".", "find", "(", "'/photoid'", ")", "if", "pos", "==", "-", "1", ":", "return", "None", "return", "href", "[", ":", ...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/photos/__init__.py#L844-L851
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/jinja2/utils.py
python
generate_lorem_ipsum
(n=5, html=True, min=20, max=100)
return Markup(u'\n'.join(u'<p>%s</p>' % escape(x) for x in result))
Generate some lorem impsum for the template.
Generate some lorem impsum for the template.
[ "Generate", "some", "lorem", "impsum", "for", "the", "template", "." ]
def generate_lorem_ipsum(n=5, html=True, min=20, max=100): """Generate some lorem impsum for the template.""" from jinja2.constants import LOREM_IPSUM_WORDS from random import choice, randrange words = LOREM_IPSUM_WORDS.split() result = [] for _ in range(n): next_capitalized = True ...
[ "def", "generate_lorem_ipsum", "(", "n", "=", "5", ",", "html", "=", "True", ",", "min", "=", "20", ",", "max", "=", "100", ")", ":", "from", "jinja2", ".", "constants", "import", "LOREM_IPSUM_WORDS", "from", "random", "import", "choice", ",", "randrange...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/utils.py#L230-L276
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/parso/py3/parso/tree.py
python
search_ancestor
(node: 'NodeOrLeaf', *node_types: str)
return None
Recursively looks at the parents of a node and returns the first found node that matches ``node_types``. Returns ``None`` if no matching node is found. This function is deprecated, use :meth:`NodeOrLeaf.search_ancestor` instead. :param node: The ancestors of this node will be checked. :param node_type...
Recursively looks at the parents of a node and returns the first found node that matches ``node_types``. Returns ``None`` if no matching node is found.
[ "Recursively", "looks", "at", "the", "parents", "of", "a", "node", "and", "returns", "the", "first", "found", "node", "that", "matches", "node_types", ".", "Returns", "None", "if", "no", "matching", "node", "is", "found", "." ]
def search_ancestor(node: 'NodeOrLeaf', *node_types: str) -> 'Optional[BaseNode]': """ Recursively looks at the parents of a node and returns the first found node that matches ``node_types``. Returns ``None`` if no matching node is found. This function is deprecated, use :meth:`NodeOrLeaf.search_ancest...
[ "def", "search_ancestor", "(", "node", ":", "'NodeOrLeaf'", ",", "*", "node_types", ":", "str", ")", "->", "'Optional[BaseNode]'", ":", "n", "=", "node", ".", "parent", "while", "n", "is", "not", "None", ":", "if", "n", ".", "type", "in", "node_types", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py3/parso/tree.py#L7-L22
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
cnx/tickds.py
python
TickDataSeries.getHighDataSeries
(self)
return self.__highDS
Returns a :class:`pyalgotrade.dataseries.DataSeries` with the high prices.
Returns a :class:`pyalgotrade.dataseries.DataSeries` with the high prices.
[ "Returns", "a", ":", "class", ":", "pyalgotrade", ".", "dataseries", ".", "DataSeries", "with", "the", "high", "prices", "." ]
def getHighDataSeries(self): """Returns a :class:`pyalgotrade.dataseries.DataSeries` with the high prices.""" return self.__highDS
[ "def", "getHighDataSeries", "(", "self", ")", ":", "return", "self", ".", "__highDS" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/cnx/tickds.py#L141-L143
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/MSVSSettings.py
python
ConvertVCMacrosToMSBuild
(s)
return s
Convert the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed.
Convert the MSVS macros found in the string to the MSBuild equivalent.
[ "Convert", "the", "MSVS", "macros", "found", "in", "the", "string", "to", "the", "MSBuild", "equivalent", "." ]
def ConvertVCMacrosToMSBuild(s): """Convert the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed. """ if "$" in s: replace_map = { "$(ConfigurationName)": "$(Configuration)", "$(InputDir)": "%(RelativeDir)", ...
[ "def", "ConvertVCMacrosToMSBuild", "(", "s", ")", ":", "if", "\"$\"", "in", "s", ":", "replace_map", "=", "{", "\"$(ConfigurationName)\"", ":", "\"$(Configuration)\"", ",", "\"$(InputDir)\"", ":", "\"%(RelativeDir)\"", ",", "\"$(InputExt)\"", ":", "\"%(Extension)\"", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/MSVSSettings.py#L422-L442
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.expand_pool
(self, pool_name, by, max_pgs)
Increase the number of pgs in a pool
Increase the number of pgs in a pool
[ "Increase", "the", "number", "of", "pgs", "in", "a", "pool" ]
def expand_pool(self, pool_name, by, max_pgs): """ Increase the number of pgs in a pool """ with self.lock: assert isinstance(pool_name, str) assert isinstance(by, int) assert pool_name in self.pools if self.get_num_creating() > 0: ...
[ "def", "expand_pool", "(", "self", ",", "pool_name", ",", "by", ",", "max_pgs", ")", ":", "with", "self", ".", "lock", ":", "assert", "isinstance", "(", "pool_name", ",", "str", ")", "assert", "isinstance", "(", "by", ",", "int", ")", "assert", "pool_n...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L2234-L2250
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
BitmapFromBuffer
(width, height, dataBuffer, alphaBuffer=None)
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc. The dataBuffer object is expected to contain a series of RGB bytes and be width*height*3 bytes long. A buffer object can optionally b...
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc. The dataBuffer object is expected to contain a series of RGB bytes and be width*height*3 bytes long. A buffer object can optionally b...
[ "Creates", "a", "wx", ".", "Bitmap", "from", "the", "data", "in", "dataBuffer", ".", "The", "dataBuffer", "parameter", "must", "be", "a", "Python", "object", "that", "implements", "the", "buffer", "interface", "such", "as", "a", "string", "array", "etc", "...
def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None): """ Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc. The dataBuffer object is expected to contain a series of RG...
[ "def", "BitmapFromBuffer", "(", "width", ",", "height", ",", "dataBuffer", ",", "alphaBuffer", "=", "None", ")", ":", "if", "alphaBuffer", "is", "not", "None", ":", "return", "_gdi_", ".", "_BitmapFromBufferAlpha", "(", "width", ",", "height", ",", "dataBuff...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L912-L938
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Pen.SetJoin
(*args, **kwargs)
return _gdi_.Pen_SetJoin(*args, **kwargs)
SetJoin(self, int join_style)
SetJoin(self, int join_style)
[ "SetJoin", "(", "self", "int", "join_style", ")" ]
def SetJoin(*args, **kwargs): """SetJoin(self, int join_style)""" return _gdi_.Pen_SetJoin(*args, **kwargs)
[ "def", "SetJoin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Pen_SetJoin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L433-L435
NicknineTheEagle/TF2-Base
20459c5a7fbc995b6bf54fa85c2f62a101e9fb64
src/thirdparty/protobuf-2.3.0/python/google/protobuf/service.py
python
RpcController.Reset
(self)
Resets the RpcController to its initial state. After the RpcController has been reset, it may be reused in a new call. Must not be called while an RPC is in progress.
Resets the RpcController to its initial state.
[ "Resets", "the", "RpcController", "to", "its", "initial", "state", "." ]
def Reset(self): """Resets the RpcController to its initial state. After the RpcController has been reset, it may be reused in a new call. Must not be called while an RPC is in progress. """ raise NotImplementedError
[ "def", "Reset", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service.py#L132-L138
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
PythonAPI/carla/agents/navigation/local_planner.py
python
LocalPlanner.__init__
(self, vehicle, opt_dict={})
:param vehicle: actor to apply to local planner logic onto :param opt_dict: dictionary of arguments with different parameters: dt: time between simulation steps target_speed: desired cruise speed in Km/h sampling_radius: distance between the waypoints part of the plan ...
:param vehicle: actor to apply to local planner logic onto :param opt_dict: dictionary of arguments with different parameters: dt: time between simulation steps target_speed: desired cruise speed in Km/h sampling_radius: distance between the waypoints part of the plan ...
[ ":", "param", "vehicle", ":", "actor", "to", "apply", "to", "local", "planner", "logic", "onto", ":", "param", "opt_dict", ":", "dictionary", "of", "arguments", "with", "different", "parameters", ":", "dt", ":", "time", "between", "simulation", "steps", "tar...
def __init__(self, vehicle, opt_dict={}): """ :param vehicle: actor to apply to local planner logic onto :param opt_dict: dictionary of arguments with different parameters: dt: time between simulation steps target_speed: desired cruise speed in Km/h sampling_r...
[ "def", "__init__", "(", "self", ",", "vehicle", ",", "opt_dict", "=", "{", "}", ")", ":", "self", ".", "_vehicle", "=", "vehicle", "self", ".", "_world", "=", "self", ".", "_vehicle", ".", "get_world", "(", ")", "self", ".", "_map", "=", "self", "....
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/carla/agents/navigation/local_planner.py#L43-L108
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.extend
(self, elem_seq)
Extends by appending the given sequence. Similar to list.extend().
Extends by appending the given sequence. Similar to list.extend().
[ "Extends", "by", "appending", "the", "given", "sequence", ".", "Similar", "to", "list", ".", "extend", "()", "." ]
def extend(self, elem_seq): """Extends by appending the given sequence. Similar to list.extend().""" if not elem_seq: return new_values = [] for elem in elem_seq: self._type_checker.CheckValue(elem) new_values.append(elem) self._values.extend(new_values) self._message_listener...
[ "def", "extend", "(", "self", ",", "elem_seq", ")", ":", "if", "not", "elem_seq", ":", "return", "new_values", "=", "[", "]", "for", "elem", "in", "elem_seq", ":", "self", ".", "_type_checker", ".", "CheckValue", "(", "elem", ")", "new_values", ".", "a...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/containers.py#L118-L128
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py2/traitlets/traitlets.py
python
_validate_link
(*tuples)
Validate arguments for traitlet link functions
Validate arguments for traitlet link functions
[ "Validate", "arguments", "for", "traitlet", "link", "functions" ]
def _validate_link(*tuples): """Validate arguments for traitlet link functions""" for t in tuples: if not len(t) == 2: raise TypeError("Each linked traitlet must be specified as (HasTraits, 'trait_name'), not %r" % t) obj, trait_name = t if not isinstance(obj, HasTraits): ...
[ "def", "_validate_link", "(", "*", "tuples", ")", ":", "for", "t", "in", "tuples", ":", "if", "not", "len", "(", "t", ")", "==", "2", ":", "raise", "TypeError", "(", "\"Each linked traitlet must be specified as (HasTraits, 'trait_name'), not %r\"", "%", "t", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/traitlets.py#L243-L252
kiwix/kiwix-xulrunner
38f4a10ae4b1585c16cb11730bb0dcc4924ae19f
android/gen-std-icon.py
python
copy_to
(src, dst)
copy source content (local or remote) to local file
copy source content (local or remote) to local file
[ "copy", "source", "content", "(", "local", "or", "remote", ")", "to", "local", "file" ]
def copy_to(src, dst): ''' copy source content (local or remote) to local file ''' local = None if is_remote_path(src): local = tempfile.NamedTemporaryFile(delete=False) download_remote_file(src, local.name) src = local.name shutil.copy(src, dst) if local is not None: ...
[ "def", "copy_to", "(", "src", ",", "dst", ")", ":", "local", "=", "None", "if", "is_remote_path", "(", "src", ")", ":", "local", "=", "tempfile", ".", "NamedTemporaryFile", "(", "delete", "=", "False", ")", "download_remote_file", "(", "src", ",", "local...
https://github.com/kiwix/kiwix-xulrunner/blob/38f4a10ae4b1585c16cb11730bb0dcc4924ae19f/android/gen-std-icon.py#L123-L132
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/etree/ElementTree.py
python
Element.iterfind
(self, path, namespaces=None)
return ElementPath.iterfind(self, path, namespaces)
Find all matching subelements by tag name or path. *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return an iterable yielding all matching elements in document order.
Find all matching subelements by tag name or path.
[ "Find", "all", "matching", "subelements", "by", "tag", "name", "or", "path", "." ]
def iterfind(self, path, namespaces=None): """Find all matching subelements by tag name or path. *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return an iterable yielding all matching elements in doc...
[ "def", "iterfind", "(", "self", ",", "path", ",", "namespaces", "=", "None", ")", ":", "return", "ElementPath", ".", "iterfind", "(", "self", ",", "path", ",", "namespaces", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/etree/ElementTree.py#L319-L328
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib2to3/fixes/fix_import.py
python
traverse_imports
(names)
Walks over all the names imported in a dotted_as_names node.
Walks over all the names imported in a dotted_as_names node.
[ "Walks", "over", "all", "the", "names", "imported", "in", "a", "dotted_as_names", "node", "." ]
def traverse_imports(names): """ Walks over all the names imported in a dotted_as_names node. """ pending = [names] while pending: node = pending.pop() if node.type == token.NAME: yield node.value elif node.type == syms.dotted_name: yield "".join([ch.v...
[ "def", "traverse_imports", "(", "names", ")", ":", "pending", "=", "[", "names", "]", "while", "pending", ":", "node", "=", "pending", ".", "pop", "(", ")", "if", "node", ".", "type", "==", "token", ".", "NAME", ":", "yield", "node", ".", "value", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/fixes/fix_import.py#L19-L35
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/GUIOPT.py
python
OpenVideoOptionsWindow
()
return
Open video options window
Open video options window
[ "Open", "video", "options", "window" ]
def OpenVideoOptionsWindow (): """Open video options window""" global HelpTextArea #GemRB.GetView("SUB_WIN", 0).Close() Window = GemRB.LoadWindow (6, "GUIOPT") Window.AddAlias("SUB_WIN", 0) Window.SetFlags (WF_BORDERLESS, OP_OR) HelpTextArea = GUIOPTControls.OptHelpText ('VideoOptions', Window, 33, 18038) G...
[ "def", "OpenVideoOptionsWindow", "(", ")", ":", "global", "HelpTextArea", "#GemRB.GetView(\"SUB_WIN\", 0).Close()", "Window", "=", "GemRB", ".", "LoadWindow", "(", "6", ",", "\"GUIOPT\"", ")", "Window", ".", "AddAlias", "(", "\"SUB_WIN\"", ",", "0", ")", "Window",...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/GUIOPT.py#L124-L154
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/client.py
python
Client.load_op
(self, so_path: str, proto_path: str = None)
r"""Loads a custom op into the Scanner runtime. Parameters ---------- so_path Path to the custom op's shared library (.so). proto_path Path to the custom op's arguments protobuf if one exists. Raises ------ ScannerException Raised ...
r"""Loads a custom op into the Scanner runtime.
[ "r", "Loads", "a", "custom", "op", "into", "the", "Scanner", "runtime", "." ]
def load_op(self, so_path: str, proto_path: str = None): r"""Loads a custom op into the Scanner runtime. Parameters ---------- so_path Path to the custom op's shared library (.so). proto_path Path to the custom op's arguments protobuf if one exists. ...
[ "def", "load_op", "(", "self", ",", "so_path", ":", "str", ",", "proto_path", ":", "str", "=", "None", ")", ":", "if", "proto_path", "is", "not", "None", ":", "protobufs", ".", "add_module", "(", "proto_path", ")", "op_path", "=", "protobufs", ".", "Op...
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/client.py#L514-L537
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py
python
Condition.wait
(self)
Wait until notified. If the calling coroutine has not acquired the lock when this method is called, a RuntimeError is raised. This method releases the underlying lock, and then blocks until it is awakened by a notify() or notify_all() call for the same condition variable in ano...
Wait until notified.
[ "Wait", "until", "notified", "." ]
async def wait(self): """Wait until notified. If the calling coroutine has not acquired the lock when this method is called, a RuntimeError is raised. This method releases the underlying lock, and then blocks until it is awakened by a notify() or notify_all() call for t...
[ "async", "def", "wait", "(", "self", ")", ":", "if", "not", "self", ".", "locked", "(", ")", ":", "raise", "RuntimeError", "(", "'cannot wait on un-acquired lock'", ")", "self", ".", "release", "(", ")", "try", ":", "fut", "=", "self", ".", "_loop", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py#L335-L370
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/configure/libstdcxx.py
python
find_version
(e)
return encode_ver(last_version)
Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses.
Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses.
[ "Given", "the", "value", "of", "environment", "variable", "CXX", "or", "HOST_CXX", "find", "the", "version", "of", "the", "libstdc", "++", "it", "uses", "." ]
def find_version(e): """Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses. """ args = e.split() args += ['-shared', '-Wl,-t'] p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) candidates = [x for x in p.stdout if 'l...
[ "def", "find_version", "(", "e", ")", ":", "args", "=", "e", ".", "split", "(", ")", "args", "+=", "[", "'-shared'", ",", "'-Wl,-t'", "]", "p", "=", "subprocess", ".", "Popen", "(", "args", ",", "stderr", "=", "subprocess", ".", "STDOUT", ",", "std...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/configure/libstdcxx.py#L56-L73
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/hang_analyzer/dumper.py
python
Dumper._find_debugger
(self, debugger)
Find the installed debugger. :param debugger: debugger executable.
Find the installed debugger.
[ "Find", "the", "installed", "debugger", "." ]
def _find_debugger(self, debugger): """ Find the installed debugger. :param debugger: debugger executable. """ raise NotImplementedError("_find_debugger must be implemented in OS-specific subclasses")
[ "def", "_find_debugger", "(", "self", ",", "debugger", ")", ":", "raise", "NotImplementedError", "(", "\"_find_debugger must be implemented in OS-specific subclasses\"", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/hang_analyzer/dumper.py#L74-L80
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sframe.py
python
SFrame.__getitem__
(self, key)
This method does things based on the type of `key`. If `key` is: * str selects column with name 'key' * type selects all columns with types matching the type * list of str or type selects all columns with names or type in the l...
This method does things based on the type of `key`.
[ "This", "method", "does", "things", "based", "on", "the", "type", "of", "key", "." ]
def __getitem__(self, key): """ This method does things based on the type of `key`. If `key` is: * str selects column with name 'key' * type selects all columns with types matching the type * list of str or type ...
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "if", "type", "(", "key", ")", "is", "SArray", ":", "return", "self", ".", "_row_selector", "(", "key", ")", "elif", "type", "(", "key", ")", "is", "str", ":", "return", "self", ".", "select_...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sframe.py#L3974-L4060
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/estimators/dnn_sampled_softmax_classifier.py
python
_DNNSampledSoftmaxClassifier.export
(self, export_dir, signature_fn=None, input_fn=None, default_batch_size=1, exports_to_keep=None)
return self._estimator.export(export_dir=export_dir, signature_fn=signature_fn, input_fn=input_fn or default_input_fn, default_batch_size=default_batch_size, exports_to_keep=exports_to...
Exports inference graph into given dir. Args: export_dir: A string containing a directory to write the exported graph and checkpoints. signature_fn: Function that returns a default signature and a named signature map, given `Tensor` of `Example` strings, `dict` of `Tensor`s for ...
Exports inference graph into given dir.
[ "Exports", "inference", "graph", "into", "given", "dir", "." ]
def export(self, export_dir, signature_fn=None, input_fn=None, default_batch_size=1, exports_to_keep=None): """Exports inference graph into given dir. Args: export_dir: A string containing a directory to write the exported graph and checkpoints. signature_fn: Funct...
[ "def", "export", "(", "self", ",", "export_dir", ",", "signature_fn", "=", "None", ",", "input_fn", "=", "None", ",", "default_batch_size", "=", "1", ",", "exports_to_keep", "=", "None", ")", ":", "def", "default_input_fn", "(", "unused_estimator", ",", "exa...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/dnn_sampled_softmax_classifier.py#L528-L561
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
PixelDataBase.GetRowStride
(*args, **kwargs)
return _gdi_.PixelDataBase_GetRowStride(*args, **kwargs)
GetRowStride(self) -> int
GetRowStride(self) -> int
[ "GetRowStride", "(", "self", ")", "-", ">", "int" ]
def GetRowStride(*args, **kwargs): """GetRowStride(self) -> int""" return _gdi_.PixelDataBase_GetRowStride(*args, **kwargs)
[ "def", "GetRowStride", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PixelDataBase_GetRowStride", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1006-L1008
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.high_price
(self, high_price)
Sets the high_price of this Instrument. :param high_price: The high_price of this Instrument. # noqa: E501 :type: float
Sets the high_price of this Instrument.
[ "Sets", "the", "high_price", "of", "this", "Instrument", "." ]
def high_price(self, high_price): """Sets the high_price of this Instrument. :param high_price: The high_price of this Instrument. # noqa: E501 :type: float """ self._high_price = high_price
[ "def", "high_price", "(", "self", ",", "high_price", ")", ":", "self", ".", "_high_price", "=", "high_price" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L2189-L2197
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aquabutton.py
python
__ToggleMixin.SetToggle
(self, flag)
Sets the button as toggled/not toggled. :param bool `flag`: ``True`` to set the button as toggled, ``False`` otherwise.
Sets the button as toggled/not toggled.
[ "Sets", "the", "button", "as", "toggled", "/", "not", "toggled", "." ]
def SetToggle(self, flag): """ Sets the button as toggled/not toggled. :param bool `flag`: ``True`` to set the button as toggled, ``False`` otherwise. """ self.up = not flag self.Refresh()
[ "def", "SetToggle", "(", "self", ",", "flag", ")", ":", "self", ".", "up", "=", "not", "flag", "self", ".", "Refresh", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aquabutton.py#L872-L880
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/treewizard.py
python
TreeWizard._visitPattern
(self, tree, pattern, visitor)
For all subtrees that match the pattern, execute the visit action.
For all subtrees that match the pattern, execute the visit action.
[ "For", "all", "subtrees", "that", "match", "the", "pattern", "execute", "the", "visit", "action", "." ]
def _visitPattern(self, tree, pattern, visitor): """ For all subtrees that match the pattern, execute the visit action. """ # Create a TreePattern from the pattern tokenizer = TreePatternLexer(pattern) parser = TreePatternParser(tokenizer, self, TreePatternTreeAdaptor())...
[ "def", "_visitPattern", "(", "self", ",", "tree", ",", "pattern", ",", "visitor", ")", ":", "# Create a TreePattern from the pattern", "tokenizer", "=", "TreePatternLexer", "(", "pattern", ")", "parser", "=", "TreePatternParser", "(", "tokenizer", ",", "self", ","...
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/treewizard.py#L491-L513
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/utils/e2e_utils/extract_textpoint_slow.py
python
add_id
(pos_list, image_id=0)
return new_list
Add id for gather feature, for inference.
Add id for gather feature, for inference.
[ "Add", "id", "for", "gather", "feature", "for", "inference", "." ]
def add_id(pos_list, image_id=0): """ Add id for gather feature, for inference. """ new_list = [] for item in pos_list: new_list.append((image_id, item[0], item[1])) return new_list
[ "def", "add_id", "(", "pos_list", ",", "image_id", "=", "0", ")", ":", "new_list", "=", "[", "]", "for", "item", "in", "pos_list", ":", "new_list", ".", "append", "(", "(", "image_id", ",", "item", "[", "0", "]", ",", "item", "[", "1", "]", ")", ...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/utils/e2e_utils/extract_textpoint_slow.py#L218-L225
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetLdflags
(self, configname, product_dir, gyp_to_build_path, arch=None)
return ldflags
Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries are placed. This is added to the library search path. gyp_to_build_path: A functio...
Returns flags that need to be passed to the linker.
[ "Returns", "flags", "that", "need", "to", "be", "passed", "to", "the", "linker", "." ]
def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): """Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries are pl...
[ "def", "GetLdflags", "(", "self", ",", "configname", ",", "product_dir", ",", "gyp_to_build_path", ",", "arch", "=", "None", ")", ":", "self", ".", "configname", "=", "configname", "ldflags", "=", "[", "]", "# The xcode build is relative to a gyp file's directory, a...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py#L845-L940
blocknetdx/blocknet
f85bdf3eeebb1ed8c2321ebd928232d4885b30b6
contrib/devtools/security-check.py
python
check_ELF_Canary
(executable)
return ok
Check for use of stack canary
Check for use of stack canary
[ "Check", "for", "use", "of", "stack", "canary" ]
def check_ELF_Canary(executable): ''' Check for use of stack canary ''' p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) (stdout, stderr) = p.communicate() if p.returncode: ...
[ "def", "check_ELF_Canary", "(", "executable", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "READELF_CMD", ",", "'--dyn-syms'", ",", "'-W'", ",", "executable", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess"...
https://github.com/blocknetdx/blocknet/blob/f85bdf3eeebb1ed8c2321ebd928232d4885b30b6/contrib/devtools/security-check.py#L104-L116
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/training/session_manager.py
python
SessionManager.recover_session
(self, master, saver=None, checkpoint_dir=None, wait_for_checkpoint=False, max_wait_secs=7200, config=None)
Creates a `Session`, recovering if possible. Creates a new session on 'master'. If the session is not initialized and can be recovered from a checkpoint, recover it. Args: master: `String` representation of the TensorFlow master to use. saver: A `Saver` object used to restore a model. c...
Creates a `Session`, recovering if possible.
[ "Creates", "a", "Session", "recovering", "if", "possible", "." ]
def recover_session(self, master, saver=None, checkpoint_dir=None, wait_for_checkpoint=False, max_wait_secs=7200, config=None): """Creates a `Session`, recovering if possible. Creates a new session on 'master'. If the session is not initialized and can be recove...
[ "def", "recover_session", "(", "self", ",", "master", ",", "saver", "=", "None", ",", "checkpoint_dir", "=", "None", ",", "wait_for_checkpoint", "=", "False", ",", "max_wait_secs", "=", "7200", ",", "config", "=", "None", ")", ":", "self", ".", "_target", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/session_manager.py#L180-L239
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/mixins/rubberband.py
python
normalizeBox
(box)
return (x, y, w, h)
Convert any negative measurements in the current box to positive, and adjust the origin.
Convert any negative measurements in the current box to positive, and adjust the origin.
[ "Convert", "any", "negative", "measurements", "in", "the", "current", "box", "to", "positive", "and", "adjust", "the", "origin", "." ]
def normalizeBox(box): """ Convert any negative measurements in the current box to positive, and adjust the origin. """ x, y, w, h = box if w < 0: x += (w+1) w *= -1 if h < 0: y += (h+1) h *= -1 return (x, y, w, h)
[ "def", "normalizeBox", "(", "box", ")", ":", "x", ",", "y", ",", "w", ",", "h", "=", "box", "if", "w", "<", "0", ":", "x", "+=", "(", "w", "+", "1", ")", "w", "*=", "-", "1", "if", "h", "<", "0", ":", "y", "+=", "(", "h", "+", "1", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/mixins/rubberband.py#L38-L50
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlCell.IsBefore
(*args, **kwargs)
return _html.HtmlCell_IsBefore(*args, **kwargs)
IsBefore(self, HtmlCell cell) -> bool
IsBefore(self, HtmlCell cell) -> bool
[ "IsBefore", "(", "self", "HtmlCell", "cell", ")", "-", ">", "bool" ]
def IsBefore(*args, **kwargs): """IsBefore(self, HtmlCell cell) -> bool""" return _html.HtmlCell_IsBefore(*args, **kwargs)
[ "def", "IsBefore", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlCell_IsBefore", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L738-L740