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
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2738-L2767
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
CheckPosixThreading
(filename, clean_lines, linenum, error)
Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when us...
Checks for calls to thread-unsafe functions.
[ "Checks", "for", "calls", "to", "thread", "-", "unsafe", "functions", "." ]
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
[ "def", "CheckPosixThreading", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "single_thread_function", ",", "multithread_safe_function", "in", "threading_list", ":...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L1300-L1324
Cantera/cantera
0119484b261967ccb55a0066c020599cacc312e4
interfaces/cython/cantera/cti2yaml.py
python
SRI.__init__
(self, A=0.0, B=0.0, C=0.0, D=None, E=None)
Parameters: *A*, *B*, *C*, *D*, *E*. These must be entered as pure numbers without attached dimensions.
Parameters: *A*, *B*, *C*, *D*, *E*. These must be entered as pure numbers without attached dimensions.
[ "Parameters", ":", "*", "A", "*", "*", "B", "*", "*", "C", "*", "*", "D", "*", "*", "E", "*", ".", "These", "must", "be", "entered", "as", "pure", "numbers", "without", "attached", "dimensions", "." ]
def __init__(self, A=0.0, B=0.0, C=0.0, D=None, E=None): """ Parameters: *A*, *B*, *C*, *D*, *E*. These must be entered as pure numbers without attached dimensions. """ self.A = A self.B = B self.C = C self.D = D self.E = E
[ "def", "__init__", "(", "self", ",", "A", "=", "0.0", ",", "B", "=", "0.0", ",", "C", "=", "0.0", ",", "D", "=", "None", ",", "E", "=", "None", ")", ":", "self", ".", "A", "=", "A", "self", ".", "B", "=", "B", "self", ".", "C", "=", "C"...
https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/cti2yaml.py#L1530-L1539
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
sort/oddeven.py
python
main
()
operational function
operational function
[ "operational", "function" ]
def main(): """ operational function """ arr = [34, 56, 23, 67, 3, 68] print(f"unsorted array: {arr}") oddeven(arr) print(f" sorted array: {arr}")
[ "def", "main", "(", ")", ":", "arr", "=", "[", "34", ",", "56", ",", "23", ",", "67", ",", "3", ",", "68", "]", "print", "(", "f\"unsorted array: {arr}\"", ")", "oddeven", "(", "arr", ")", "print", "(", "f\" sorted array: {arr}\"", ")" ]
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/sort/oddeven.py#L31-L36
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py
python
_SSLPipe.wrapped
(self)
return self._state == _WRAPPED
Whether a security layer is currently in effect. Return False during handshake.
Whether a security layer is currently in effect.
[ "Whether", "a", "security", "layer", "is", "currently", "in", "effect", "." ]
def wrapped(self): """ Whether a security layer is currently in effect. Return False during handshake. """ return self._state == _WRAPPED
[ "def", "wrapped", "(", "self", ")", ":", "return", "self", ".", "_state", "==", "_WRAPPED" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py#L98-L104
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py
python
_print_tensor_info
(tensor_info, indent=0)
Prints details of the given tensor_info. Args: tensor_info: TensorInfo object to be printed. indent: How far (in increments of 2 spaces) to indent each line output
Prints details of the given tensor_info.
[ "Prints", "details", "of", "the", "given", "tensor_info", "." ]
def _print_tensor_info(tensor_info, indent=0): """Prints details of the given tensor_info. Args: tensor_info: TensorInfo object to be printed. indent: How far (in increments of 2 spaces) to indent each line output """ indent_str = ' ' * indent def in_print(s): print(indent_str + s) in_print('...
[ "def", "_print_tensor_info", "(", "tensor_info", ",", "indent", "=", "0", ")", ":", "indent_str", "=", "' '", "*", "indent", "def", "in_print", "(", "s", ")", ":", "print", "(", "indent_str", "+", "s", ")", "in_print", "(", "' dtype: '", "+", "{", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py#L238-L260
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/base_layer_utils.py
python
enable_v2_dtype_behavior
()
Enable the V2 dtype behavior for Keras layers. By default, the V2 dtype behavior is enabled in TensorFlow 2, so this function is only useful if `tf.compat.v1.disable_v2_behavior` has been called. Since mixed precision requires V2 dtype behavior to be enabled, this function allows you to use mixed precision in ...
Enable the V2 dtype behavior for Keras layers.
[ "Enable", "the", "V2", "dtype", "behavior", "for", "Keras", "layers", "." ]
def enable_v2_dtype_behavior(): """Enable the V2 dtype behavior for Keras layers. By default, the V2 dtype behavior is enabled in TensorFlow 2, so this function is only useful if `tf.compat.v1.disable_v2_behavior` has been called. Since mixed precision requires V2 dtype behavior to be enabled, this function al...
[ "def", "enable_v2_dtype_behavior", "(", ")", ":", "global", "V2_DTYPE_BEHAVIOR", "V2_DTYPE_BEHAVIOR", "=", "True" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/base_layer_utils.py#L731-L762
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBType.get_vbases_array
(self)
return vbases
An accessor function that returns a list() that contains all fields in a lldb.SBType object.
An accessor function that returns a list() that contains all fields in a lldb.SBType object.
[ "An", "accessor", "function", "that", "returns", "a", "list", "()", "that", "contains", "all", "fields", "in", "a", "lldb", ".", "SBType", "object", "." ]
def get_vbases_array(self): '''An accessor function that returns a list() that contains all fields in a lldb.SBType object.''' vbases = [] for idx in range(self.GetNumberOfVirtualBaseClasses()): vbases.append(self.GetVirtualBaseClassAtIndex(idx)) return vbases
[ "def", "get_vbases_array", "(", "self", ")", ":", "vbases", "=", "[", "]", "for", "idx", "in", "range", "(", "self", ".", "GetNumberOfVirtualBaseClasses", "(", ")", ")", ":", "vbases", ".", "append", "(", "self", ".", "GetVirtualBaseClassAtIndex", "(", "id...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10565-L10570
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/ANSI.py
python
ANSI.process
(self, c)
Process a single character. Called by :meth:`write`.
Process a single character. Called by :meth:`write`.
[ "Process", "a", "single", "character", ".", "Called", "by", ":", "meth", ":", "write", "." ]
def process (self, c): """Process a single character. Called by :meth:`write`.""" if isinstance(c, bytes): c = self._decode(c) self.state.process(c)
[ "def", "process", "(", "self", ",", "c", ")", ":", "if", "isinstance", "(", "c", ",", "bytes", ")", ":", "c", "=", "self", ".", "_decode", "(", "c", ")", "self", ".", "state", ".", "process", "(", "c", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/ANSI.py#L281-L285
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/models/embedding/word2vec_optimized.py
python
Word2Vec.build_eval_graph
(self)
Build the evaluation graph.
Build the evaluation graph.
[ "Build", "the", "evaluation", "graph", "." ]
def build_eval_graph(self): """Build the evaluation graph.""" # Eval graph opts = self._options # Each analogy task is to predict the 4th word (d) given three # words: a, b, c. E.g., a=italy, b=rome, c=france, we should # predict d=paris. # The eval feeds three vectors of word ids for a, ...
[ "def", "build_eval_graph", "(", "self", ")", ":", "# Eval graph", "opts", "=", "self", ".", "_options", "# Each analogy task is to predict the 4th word (d) given three", "# words: a, b, c. E.g., a=italy, b=rome, c=france, we should", "# predict d=paris.", "# The eval feeds three vecto...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/models/embedding/word2vec_optimized.py#L244-L301
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py
python
AbstractEventLoop.close
(self)
Close the loop. The loop should not be running. This is idempotent and irreversible. No other methods should be called after this one.
Close the loop.
[ "Close", "the", "loop", "." ]
def close(self): """Close the loop. The loop should not be running. This is idempotent and irreversible. No other methods should be called after this one. """ raise NotImplementedError
[ "def", "close", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py#L242-L251
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/sonnx.py
python
SingaBackend._create_tile
(cls, onnx_node, operator, opset_version=_opset_version)
return operator(None)
get the Tile operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Returns: singa operator instance
get the Tile operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Returns: singa operator instance
[ "get", "the", "Tile", "operator", "from", "onnx", "node", "Args", ":", "onnx_node", "(", "OnnxNode", ")", ":", "a", "given", "onnx", "node", "operator", "(", "Operator", "Class", ")", ":", "a", "singa", "operator", "class", "opset_version", "(", "int", "...
def _create_tile(cls, onnx_node, operator, opset_version=_opset_version): """ get the Tile operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Re...
[ "def", "_create_tile", "(", "cls", ",", "onnx_node", ",", "operator", ",", "opset_version", "=", "_opset_version", ")", ":", "onnx_node", ".", "set_attr_inputs", "(", "onnx_node", ".", "inputs", "[", "1", "]", ",", "'repeats'", ")", "return", "operator", "("...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L1538-L1549
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0494-Target-Sum/0494.py
python
Solution.findTargetSumWays
(self, nums, S)
return mem[target]
:type nums: List[int] :type S: int :rtype: int
:type nums: List[int] :type S: int :rtype: int
[ ":", "type", "nums", ":", "List", "[", "int", "]", ":", "type", "S", ":", "int", ":", "rtype", ":", "int" ]
def findTargetSumWays(self, nums, S): """ :type nums: List[int] :type S: int :rtype: int """ sum_nums = sum(nums) if sum_nums < S or (S + sum_nums)%2 != 0: return 0 target = (S + sum_nums) >> 1 mem = [0]*(target + 1) mem[0] = 1...
[ "def", "findTargetSumWays", "(", "self", ",", "nums", ",", "S", ")", ":", "sum_nums", "=", "sum", "(", "nums", ")", "if", "sum_nums", "<", "S", "or", "(", "S", "+", "sum_nums", ")", "%", "2", "!=", "0", ":", "return", "0", "target", "=", "(", "...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0494-Target-Sum/0494.py#L2-L18
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_7_5/tools/release/git_recipes.py
python
GetCommitMessageFooterMap
(message)
return footers
Returns: (dict) A dictionary of commit message footer entries.
Returns: (dict) A dictionary of commit message footer entries.
[ "Returns", ":", "(", "dict", ")", "A", "dictionary", "of", "commit", "message", "footer", "entries", "." ]
def GetCommitMessageFooterMap(message): """Returns: (dict) A dictionary of commit message footer entries. """ footers = {} # Extract the lines in the footer block. lines = [] for line in message.strip().splitlines(): line = line.strip() if len(line) == 0: del(lines[:]) continue line...
[ "def", "GetCommitMessageFooterMap", "(", "message", ")", ":", "footers", "=", "{", "}", "# Extract the lines in the footer block.", "lines", "=", "[", "]", "for", "line", "in", "message", ".", "strip", "(", ")", ".", "splitlines", "(", ")", ":", "line", "=",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_7_5/tools/release/git_recipes.py#L52-L74
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qmmm.py
python
Diffuse.fitScf
(self)
Function to run scf and fit a system of diffuse charges to resulting density.
Function to run scf and fit a system of diffuse charges to resulting density.
[ "Function", "to", "run", "scf", "and", "fit", "a", "system", "of", "diffuse", "charges", "to", "resulting", "density", "." ]
def fitScf(self): """Function to run scf and fit a system of diffuse charges to resulting density. """ basisChanged = core.has_option_changed("BASIS") ribasisChanged = core.has_option_changed("DF_BASIS_SCF") scftypeChanged = core.has_option_changed("SCF_TYPE") b...
[ "def", "fitScf", "(", "self", ")", ":", "basisChanged", "=", "core", ".", "has_option_changed", "(", "\"BASIS\"", ")", "ribasisChanged", "=", "core", ".", "has_option_changed", "(", "\"DF_BASIS_SCF\"", ")", "scftypeChanged", "=", "core", ".", "has_option_changed",...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qmmm.py#L60-L95
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/wizard.py
python
PyWizardPage.DoSetSize
(*args, **kwargs)
return _wizard.PyWizardPage_DoSetSize(*args, **kwargs)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
[ "DoSetSize", "(", "self", "int", "x", "int", "y", "int", "width", "int", "height", "int", "sizeFlags", "=", "SIZE_AUTO", ")" ]
def DoSetSize(*args, **kwargs): """DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)""" return _wizard.PyWizardPage_DoSetSize(*args, **kwargs)
[ "def", "DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "PyWizardPage_DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/wizard.py#L155-L157
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
thirdparty/gflags/gflags.py
python
DEFINE_integer
(name, default, help, lower_bound=None, upper_bound=None, flag_values=FLAGS, **args)
Registers a flag whose value must be an integer. If lower_bound, or upper_bound are set, then this flag must be within the given range.
Registers a flag whose value must be an integer.
[ "Registers", "a", "flag", "whose", "value", "must", "be", "an", "integer", "." ]
def DEFINE_integer(name, default, help, lower_bound=None, upper_bound=None, flag_values=FLAGS, **args): """Registers a flag whose value must be an integer. If lower_bound, or upper_bound are set, then this flag must be within the given range. """ parser = IntegerParser(lower_bound, upper_b...
[ "def", "DEFINE_integer", "(", "name", ",", "default", ",", "help", ",", "lower_bound", "=", "None", ",", "upper_bound", "=", "None", ",", "flag_values", "=", "FLAGS", ",", "*", "*", "args", ")", ":", "parser", "=", "IntegerParser", "(", "lower_bound", ",...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L2489-L2499
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosmaster/src/rosmaster/registrations.py
python
RegistrationManager.__init__
(self, thread_pool)
ctor. @param thread_pool: thread pool for queueing tasks @type thread_pool: ThreadPool
ctor.
[ "ctor", "." ]
def __init__(self, thread_pool): """ ctor. @param thread_pool: thread pool for queueing tasks @type thread_pool: ThreadPool """ self.nodes = {} self.thread_pool = thread_pool self.publishers = Registrations(Registrations.TOPIC_PUBLICATIONS) self...
[ "def", "__init__", "(", "self", ",", "thread_pool", ")", ":", "self", ".", "nodes", "=", "{", "}", "self", ".", "thread_pool", "=", "thread_pool", "self", ".", "publishers", "=", "Registrations", "(", "Registrations", ".", "TOPIC_PUBLICATIONS", ")", "self", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmaster/src/rosmaster/registrations.py#L354-L366
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/bisect-builds.py
python
PathContext.IsAuraBuild
(self, build)
return build.split('.')[3] == '1'
Check the given build is Aura.
Check the given build is Aura.
[ "Check", "the", "given", "build", "is", "Aura", "." ]
def IsAuraBuild(self, build): """Check the given build is Aura.""" return build.split('.')[3] == '1'
[ "def", "IsAuraBuild", "(", "self", ",", "build", ")", ":", "return", "build", ".", "split", "(", "'.'", ")", "[", "3", "]", "==", "'1'" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect-builds.py#L156-L158
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/db_file_reader.py
python
DBFileReader._extract_db_name_from_db_path
(self)
return os.path.basename(self.db_path).rsplit('.', 1)[0]
Extract DB name from DB path E.g. given self.db_path=`/tmp/sample.db`, or self.db_path = `dper_test_data/cached_reader/sample.db` it returns `sample`. Returns: db_name: str.
Extract DB name from DB path
[ "Extract", "DB", "name", "from", "DB", "path" ]
def _extract_db_name_from_db_path(self): """Extract DB name from DB path E.g. given self.db_path=`/tmp/sample.db`, or self.db_path = `dper_test_data/cached_reader/sample.db` it returns `sample`. Returns: db_name: str. """ return o...
[ "def", "_extract_db_name_from_db_path", "(", "self", ")", ":", "return", "os", ".", "path", ".", "basename", "(", "self", ".", "db_path", ")", ".", "rsplit", "(", "'.'", ",", "1", ")", "[", "0", "]" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/db_file_reader.py#L172-L182
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/xml/sax/_exceptions.py
python
SAXParseException.__str__
(self)
return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg)
Create a string representation of the exception.
Create a string representation of the exception.
[ "Create", "a", "string", "representation", "of", "the", "exception", "." ]
def __str__(self): "Create a string representation of the exception." sysid = self.getSystemId() if sysid is None: sysid = "<unknown>" linenum = self.getLineNumber() if linenum is None: linenum = "?" colnum = self.getColumnNumber() if colnu...
[ "def", "__str__", "(", "self", ")", ":", "sysid", "=", "self", ".", "getSystemId", "(", ")", "if", "sysid", "is", "None", ":", "sysid", "=", "\"<unknown>\"", "linenum", "=", "self", ".", "getLineNumber", "(", ")", "if", "linenum", "is", "None", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/sax/_exceptions.py#L89-L100
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/generate.py
python
templates_in
(path)
return ( Template(f[0:-len(ext)], load_file(os.path.join(path, f))) for f in os.listdir(path) if f.endswith(ext) )
Enumerate the templates found in path
Enumerate the templates found in path
[ "Enumerate", "the", "templates", "found", "in", "path" ]
def templates_in(path): """Enumerate the templates found in path""" ext = '.cpp' return ( Template(f[0:-len(ext)], load_file(os.path.join(path, f))) for f in os.listdir(path) if f.endswith(ext) )
[ "def", "templates_in", "(", "path", ")", ":", "ext", "=", "'.cpp'", "return", "(", "Template", "(", "f", "[", "0", ":", "-", "len", "(", "ext", ")", "]", ",", "load_file", "(", "os", ".", "path", ".", "join", "(", "path", ",", "f", ")", ")", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/generate.py#L186-L192
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/mox.py
python
StrContains.equals
(self, rhs)
Check to see if the search_string is contained in the rhs string. Args: # rhs: the right hand side of the test rhs: object Returns: bool
Check to see if the search_string is contained in the rhs string.
[ "Check", "to", "see", "if", "the", "search_string", "is", "contained", "in", "the", "rhs", "string", "." ]
def equals(self, rhs): """Check to see if the search_string is contained in the rhs string. Args: # rhs: the right hand side of the test rhs: object Returns: bool """ try: return rhs.find(self._search_string) > -1 except Exception: return False
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "try", ":", "return", "rhs", ".", "find", "(", "self", ".", "_search_string", ")", ">", "-", "1", "except", "Exception", ":", "return", "False" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/mox.py#L884-L898
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/bounding_box.py
python
makeGlobal
()
return bbox
Create a global bounding box, which matches any valid coordinate. :returns: `geographic_msgs/BoundingBox`_ object.
Create a global bounding box, which matches any valid coordinate.
[ "Create", "a", "global", "bounding", "box", "which", "matches", "any", "valid", "coordinate", "." ]
def makeGlobal(): """ Create a global bounding box, which matches any valid coordinate. :returns: `geographic_msgs/BoundingBox`_ object. """ bbox = BoundingBox() bbox.min_pt.latitude = float('nan') bbox.min_pt.longitude = float('nan') bbox.min_pt.altitude = float('nan') bbox.max_pt....
[ "def", "makeGlobal", "(", ")", ":", "bbox", "=", "BoundingBox", "(", ")", "bbox", ".", "min_pt", ".", "latitude", "=", "float", "(", "'nan'", ")", "bbox", ".", "min_pt", ".", "longitude", "=", "float", "(", "'nan'", ")", "bbox", ".", "min_pt", ".", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/bounding_box.py#L113-L126
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/pyserial/serial/rfc2217.py
python
RFC2217Serial.getRI
(self)
return bool(self.getModemState() & MODEMSTATE_MASK_RI)
Read terminal status line: Ring Indicator.
Read terminal status line: Ring Indicator.
[ "Read", "terminal", "status", "line", ":", "Ring", "Indicator", "." ]
def getRI(self): """Read terminal status line: Ring Indicator.""" if not self._isOpen: raise portNotOpenError return bool(self.getModemState() & MODEMSTATE_MASK_RI)
[ "def", "getRI", "(", "self", ")", ":", "if", "not", "self", ".", "_isOpen", ":", "raise", "portNotOpenError", "return", "bool", "(", "self", ".", "getModemState", "(", ")", "&", "MODEMSTATE_MASK_RI", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/rfc2217.py#L669-L672
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/memory_cache_http_server.py
python
_MemoryCacheHTTPServerImpl.AddFileToResourceMap
(self, file_path)
Loads file_path into the in-memory resource map.
Loads file_path into the in-memory resource map.
[ "Loads", "file_path", "into", "the", "in", "-", "memory", "resource", "map", "." ]
def AddFileToResourceMap(self, file_path): """Loads file_path into the in-memory resource map.""" file_path = os.path.realpath(file_path) if file_path in self.resource_map: return with open(file_path, 'rb') as fd: response = fd.read() fs = os.fstat(fd.fileno()) content_type = mime...
[ "def", "AddFileToResourceMap", "(", "self", ",", "file_path", ")", ":", "file_path", "=", "os", ".", "path", ".", "realpath", "(", "file_path", ")", "if", "file_path", "in", "self", ".", "resource_map", ":", "return", "with", "open", "(", "file_path", ",",...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/memory_cache_http_server.py#L162-L192
makefile/frcnn
8d9b9ebf8be8315ba2f374d460121b0adf1df29c
python/caffe/pycaffe.py
python
_Net_blob_loss_weights
(self)
return self._blob_loss_weights_dict
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "blob", "loss", "weights", "indexed", "by", "name" ]
def _Net_blob_loss_weights(self): """ An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name """ if not hasattr(self, '_blobs_loss_weights_dict'): self._blob_loss_weights_dict = OrderedDict(zip(self._blob_names, ...
[ "def", "_Net_blob_loss_weights", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_blobs_loss_weights_dict'", ")", ":", "self", ".", "_blob_loss_weights_dict", "=", "OrderedDict", "(", "zip", "(", "self", ".", "_blob_names", ",", "self", ".",...
https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/python/caffe/pycaffe.py#L36-L44
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/tpu/python/tpu/tpu_feed.py
python
InfeedQueue.number_of_shards
(self)
return self._sharding_policies[0].number_of_shards
Gets the number of shards to use for the InfeedQueue. Returns: Number of shards or None if the number of shards has not been set.
Gets the number of shards to use for the InfeedQueue.
[ "Gets", "the", "number", "of", "shards", "to", "use", "for", "the", "InfeedQueue", "." ]
def number_of_shards(self): """Gets the number of shards to use for the InfeedQueue. Returns: Number of shards or None if the number of shards has not been set. """ # The number of shards is always the same for all the policies. return self._sharding_policies[0].number_of_shards
[ "def", "number_of_shards", "(", "self", ")", ":", "# The number of shards is always the same for all the policies.", "return", "self", ".", "_sharding_policies", "[", "0", "]", ".", "number_of_shards" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tpu/python/tpu/tpu_feed.py#L250-L257
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pipes.py
python
Template.append
(self, cmd, kind)
t.append(cmd, kind) adds a new step at the end.
t.append(cmd, kind) adds a new step at the end.
[ "t", ".", "append", "(", "cmd", "kind", ")", "adds", "a", "new", "step", "at", "the", "end", "." ]
def append(self, cmd, kind): """t.append(cmd, kind) adds a new step at the end.""" if type(cmd) is not type(''): raise TypeError, \ 'Template.append: cmd must be a string' if kind not in stepkinds: raise ValueError, \ 'Template.append: ...
[ "def", "append", "(", "self", ",", "cmd", ",", "kind", ")", ":", "if", "type", "(", "cmd", ")", "is", "not", "type", "(", "''", ")", ":", "raise", "TypeError", ",", "'Template.append: cmd must be a string'", "if", "kind", "not", "in", "stepkinds", ":", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pipes.py#L108-L128
zhaoweicai/mscnn
534bcac5710a579d60827f192035f7eef6d8c585
python/caffe/detector.py
python
Detector.configure_crop
(self, context_pad)
Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding. Parameters ---------- context_pad : amount of context for cropping.
Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding.
[ "Configure", "crop", "dimensions", "and", "amount", "of", "context", "for", "cropping", ".", "If", "context", "is", "included", "make", "the", "special", "input", "mean", "for", "context", "padding", "." ]
def configure_crop(self, context_pad): """ Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding. Parameters ---------- context_pad : amount of context for cropping. """ # cro...
[ "def", "configure_crop", "(", "self", ",", "context_pad", ")", ":", "# crop dimensions", "in_", "=", "self", ".", "inputs", "[", "0", "]", "tpose", "=", "self", ".", "transformer", ".", "transpose", "[", "in_", "]", "inv_tpose", "=", "[", "tpose", "[", ...
https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/detector.py#L181-L216
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
urllib3/connectionpool.py
python
HTTPConnectionPool._put_conn
(self, conn)
Put a connection back into the pool. :param conn: Connection object for the current host and port as returned by :meth:`._new_conn` or :meth:`._get_conn`. If the pool is already full, the connection is closed and discarded because we exceeded maxsize. If connections are...
Put a connection back into the pool.
[ "Put", "a", "connection", "back", "into", "the", "pool", "." ]
def _put_conn(self, conn): """ Put a connection back into the pool. :param conn: Connection object for the current host and port as returned by :meth:`._new_conn` or :meth:`._get_conn`. If the pool is already full, the connection is closed and discarded ...
[ "def", "_put_conn", "(", "self", ",", "conn", ")", ":", "try", ":", "self", ".", "pool", ".", "put", "(", "conn", ",", "block", "=", "False", ")", "return", "# Everything is dandy, done.", "except", "AttributeError", ":", "# self.pool is None.", "pass", "exc...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/urllib3/connectionpool.py#L216-L244
f4exb/sdrangel
fce235b2bc59b932f93d2cb8784055d51b3b8424
scriptsapi/qo100_datv.py
python
get_device_sr_and_decim
(hwtype, settings)
return sr, 1<<log2_decim
Return device sample rate and decimation
Return device sample rate and decimation
[ "Return", "device", "sample", "rate", "and", "decimation" ]
def get_device_sr_and_decim(hwtype, settings): """ Return device sample rate and decimation """ # ---------------------------------------------------------------------- if hwtype == "Airspy" or hwtype == "AirspyHF": sr_index = settings.get("devSampleRateIndex", 0) if sr_index == 1: s...
[ "def", "get_device_sr_and_decim", "(", "hwtype", ",", "settings", ")", ":", "# ----------------------------------------------------------------------", "if", "hwtype", "==", "\"Airspy\"", "or", "hwtype", "==", "\"AirspyHF\"", ":", "sr_index", "=", "settings", ".", "get", ...
https://github.com/f4exb/sdrangel/blob/fce235b2bc59b932f93d2cb8784055d51b3b8424/scriptsapi/qo100_datv.py#L80-L93
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/FSM.py
python
FSM.process_list
(self, input_symbols)
This takes a list and sends each element to process(). The list may be a string or any iterable object.
This takes a list and sends each element to process(). The list may be a string or any iterable object.
[ "This", "takes", "a", "list", "and", "sends", "each", "element", "to", "process", "()", ".", "The", "list", "may", "be", "a", "string", "or", "any", "iterable", "object", "." ]
def process_list(self, input_symbols): """This takes a list and sends each element to process(). The list may be a string or any iterable object. """ for s in input_symbols: self.process(s)
[ "def", "process_list", "(", "self", ",", "input_symbols", ")", ":", "for", "s", "in", "input_symbols", ":", "self", ".", "process", "(", "s", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/FSM.py#L232-L237
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pygments/lexers/text.py
python
YamlLexer.parse_block_scalar_indent
(token_class)
return callback
Process indentation spaces in a block scalar.
Process indentation spaces in a block scalar.
[ "Process", "indentation", "spaces", "in", "a", "block", "scalar", "." ]
def parse_block_scalar_indent(token_class): """Process indentation spaces in a block scalar.""" def callback(lexer, match, context): text = match.group() if context.block_scalar_indent is None: if len(text) <= max(context.indent, 0): context.st...
[ "def", "parse_block_scalar_indent", "(", "token_class", ")", ":", "def", "callback", "(", "lexer", ",", "match", ",", "context", ")", ":", "text", "=", "match", ".", "group", "(", ")", "if", "context", ".", "block_scalar_indent", "is", "None", ":", "if", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pygments/lexers/text.py#L1171-L1189
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
equal
(a, b)
return a_val == b_val
Return True if ByteStores a == b. Not part of public interface.
Return True if ByteStores a == b.
[ "Return", "True", "if", "ByteStores", "a", "==", "b", "." ]
def equal(a, b): """Return True if ByteStores a == b. Not part of public interface. """ # We want to return False for inequality as soon as possible, which # means we get lots of special cases. # First the easy one - compare lengths: a_bitlength = a.bitlength b_bitlength = b.bitlength ...
[ "def", "equal", "(", "a", ",", "b", ")", ":", "# We want to return False for inequality as soon as possible, which", "# means we get lots of special cases.", "# First the easy one - compare lengths:", "a_bitlength", "=", "a", ".", "bitlength", "b_bitlength", "=", "b", ".", "b...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L290-L391
apple/swift-clang
d7403439fc6641751840b723e7165fb02f52db95
tools/scan-build-py/libscanbuild/analyze.py
python
analyze_build
()
Entry point for analyze-build command.
Entry point for analyze-build command.
[ "Entry", "point", "for", "analyze", "-", "build", "command", "." ]
def analyze_build(): """ Entry point for analyze-build command. """ args = parse_args_for_analyze_build() # will re-assign the report directory as new output with report_directory(args.output, args.keep_empty) as args.output: # Run the analyzer against a compilation db. govern_analyzer_...
[ "def", "analyze_build", "(", ")", ":", "args", "=", "parse_args_for_analyze_build", "(", ")", "# will re-assign the report directory as new output", "with", "report_directory", "(", "args", ".", "output", ",", "args", ".", "keep_empty", ")", "as", "args", ".", "outp...
https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/analyze.py#L76-L87
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
python
ValidateTargetType
(target, target_dict)
Ensures the 'type' field on the target is one of the known types. Arguments: target: string, name of target. target_dict: dict, target spec. Raises an exception on error.
Ensures the 'type' field on the target is one of the known types.
[ "Ensures", "the", "type", "field", "on", "the", "target", "is", "one", "of", "the", "known", "types", "." ]
def ValidateTargetType(target, target_dict): """Ensures the 'type' field on the target is one of the known types. Arguments: target: string, name of target. target_dict: dict, target spec. Raises an exception on error. """ VALID_TARGET_TYPES = ('executable', 'loadable_module', ...
[ "def", "ValidateTargetType", "(", "target", ",", "target_dict", ")", ":", "VALID_TARGET_TYPES", "=", "(", "'executable'", ",", "'loadable_module'", ",", "'static_library'", ",", "'shared_library'", ",", "'mac_kernel_extension'", ",", "'none'", ")", "target_type", "=",...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py#L2485-L2506
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGTextCtrlEditor.GetTextCtrlValueFromControl
(*args, **kwargs)
return _propgrid.PGTextCtrlEditor_GetTextCtrlValueFromControl(*args, **kwargs)
GetTextCtrlValueFromControl(wxVariant variant, PGProperty property, Window ctrl) -> bool
GetTextCtrlValueFromControl(wxVariant variant, PGProperty property, Window ctrl) -> bool
[ "GetTextCtrlValueFromControl", "(", "wxVariant", "variant", "PGProperty", "property", "Window", "ctrl", ")", "-", ">", "bool" ]
def GetTextCtrlValueFromControl(*args, **kwargs): """GetTextCtrlValueFromControl(wxVariant variant, PGProperty property, Window ctrl) -> bool""" return _propgrid.PGTextCtrlEditor_GetTextCtrlValueFromControl(*args, **kwargs)
[ "def", "GetTextCtrlValueFromControl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGTextCtrlEditor_GetTextCtrlValueFromControl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2738-L2740
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/dom/minidom.py
python
Element.getAttribute
(self, attname)
Returns the value of the specified attribute. Returns the value of the element's attribute named attname as a string. An empty string is returned if the element does not have such an attribute. Note that an empty string may also be returned as an explicitly given attribute value, use th...
Returns the value of the specified attribute.
[ "Returns", "the", "value", "of", "the", "specified", "attribute", "." ]
def getAttribute(self, attname): """Returns the value of the specified attribute. Returns the value of the element's attribute named attname as a string. An empty string is returned if the element does not have such an attribute. Note that an empty string may also be returned as...
[ "def", "getAttribute", "(", "self", ",", "attname", ")", ":", "if", "self", ".", "_attrs", "is", "None", ":", "return", "\"\"", "try", ":", "return", "self", ".", "_attrs", "[", "attname", "]", ".", "value", "except", "KeyError", ":", "return", "\"\"" ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/dom/minidom.py#L721-L735
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/sans/stitcher.py
python
StitcherWidget._data_updated
(self, key, value)
Respond to application-level key/value pair updates. @param key: key string @param value: value string
Respond to application-level key/value pair updates.
[ "Respond", "to", "application", "-", "level", "key", "/", "value", "pair", "updates", "." ]
def _data_updated(self, key, value): """ Respond to application-level key/value pair updates. @param key: key string @param value: value string """ if key == "OUTPUT_DIR": self._output_dir = value
[ "def", "_data_updated", "(", "self", ",", "key", ",", "value", ")", ":", "if", "key", "==", "\"OUTPUT_DIR\"", ":", "self", ".", "_output_dir", "=", "value" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/sans/stitcher.py#L399-L406
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/docs/service.py
python
DocsService.UploadDocument
(self, media_source, title, folder_or_uri=None)
return self._UploadFile( media_source, title, self._MakeKindCategory(DOCUMENT_LABEL), folder_or_uri=folder_or_uri)
Uploads a document inside of a MediaSource object to the Document List feed with the given title. This method is deprecated, use Upload instead. Args: media_source: MediaSource The gdata.MediaSource object containing a document file to be uploaded. title: string The title o...
Uploads a document inside of a MediaSource object to the Document List feed with the given title. This method is deprecated, use Upload instead.
[ "Uploads", "a", "document", "inside", "of", "a", "MediaSource", "object", "to", "the", "Document", "List", "feed", "with", "the", "given", "title", ".", "This", "method", "is", "deprecated", "use", "Upload", "instead", "." ]
def UploadDocument(self, media_source, title, folder_or_uri=None): """Uploads a document inside of a MediaSource object to the Document List feed with the given title. This method is deprecated, use Upload instead. Args: media_source: MediaSource The gdata.MediaSource object containing...
[ "def", "UploadDocument", "(", "self", ",", "media_source", ",", "title", ",", "folder_or_uri", "=", "None", ")", ":", "return", "self", ".", "_UploadFile", "(", "media_source", ",", "title", ",", "self", ".", "_MakeKindCategory", "(", "DOCUMENT_LABEL", ")", ...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/docs/service.py#L465-L487
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/__init__.py
python
findall
(dir=os.curdir)
return list(files)
Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended.
Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended.
[ "Find", "all", "files", "under", "dir", "and", "return", "the", "list", "of", "full", "filenames", ".", "Unless", "dir", "is", ".", "return", "full", "filenames", "with", "dir", "prepended", "." ]
def findall(dir=os.curdir): """ Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. """ files = _find_all_simple(dir) if dir == os.curdir: make_rel = functools.partial(os.path.relpath, start=dir) files = m...
[ "def", "findall", "(", "dir", "=", "os", ".", "curdir", ")", ":", "files", "=", "_find_all_simple", "(", "dir", ")", "if", "dir", "==", "os", ".", "curdir", ":", "make_rel", "=", "functools", ".", "partial", "(", "os", ".", "path", ".", "relpath", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/__init__.py#L215-L224
vusec/vuzzer64
2b1b0ed757a3dca114db0192fa4ab1add92348bc
fuzzer-code/bb-weight-new.py
python
get_children
(BB)
return child
This function returns a list of BB ids which are children (transitive) of given BB.
This function returns a list of BB ids which are children (transitive) of given BB.
[ "This", "function", "returns", "a", "list", "of", "BB", "ids", "which", "are", "children", "(", "transitive", ")", "of", "given", "BB", "." ]
def get_children(BB): ''' This function returns a list of BB ids which are children (transitive) of given BB. ''' print "[*] finding childrens of BB: %x"%(BB.startEA,) child=[] tmp=deque([]) tmpShadow=deque([]) #visited=[] for sbb in BB.succs(): tmp.append(sbb) tmpSha...
[ "def", "get_children", "(", "BB", ")", ":", "print", "\"[*] finding childrens of BB: %x\"", "%", "(", "BB", ".", "startEA", ",", ")", "child", "=", "[", "]", "tmp", "=", "deque", "(", "[", "]", ")", "tmpShadow", "=", "deque", "(", "[", "]", ")", "#vi...
https://github.com/vusec/vuzzer64/blob/2b1b0ed757a3dca114db0192fa4ab1add92348bc/fuzzer-code/bb-weight-new.py#L68-L95
SIPp/sipp
f44d0cf5dec0013eff8fd7b4da885d455aa82e0e
cpplint.py
python
CheckComment
(comment, filename, linenum, error)
Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for common mistakes in TODO comments.
[ "Checks", "for", "common", "mistakes", "in", "TODO", "comments", "." ]
def CheckComment(comment, filename, linenum, error): """Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found....
[ "def", "CheckComment", "(", "comment", ",", "filename", ",", "linenum", ",", "error", ")", ":", "match", "=", "_RE_PATTERN_TODO", ".", "match", "(", "comment", ")", "if", "match", ":", "# One whitespace is correct; zero whitespace is handled elsewhere.", "leading_whit...
https://github.com/SIPp/sipp/blob/f44d0cf5dec0013eff8fd7b4da885d455aa82e0e/cpplint.py#L2012-L2039
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py
python
clear_caches
()
Jinja2 keeps internal caches for environments and lexers. These are used so that Jinja2 doesn't have to recreate environments and lexers all the time. Normally you don't have to care about that but if you are messuring memory consumption you may want to clean the caches.
Jinja2 keeps internal caches for environments and lexers. These are used so that Jinja2 doesn't have to recreate environments and lexers all the time. Normally you don't have to care about that but if you are messuring memory consumption you may want to clean the caches.
[ "Jinja2", "keeps", "internal", "caches", "for", "environments", "and", "lexers", ".", "These", "are", "used", "so", "that", "Jinja2", "doesn", "t", "have", "to", "recreate", "environments", "and", "lexers", "all", "the", "time", ".", "Normally", "you", "don"...
def clear_caches(): """Jinja2 keeps internal caches for environments and lexers. These are used so that Jinja2 doesn't have to recreate environments and lexers all the time. Normally you don't have to care about that but if you are messuring memory consumption you may want to clean the caches. """...
[ "def", "clear_caches", "(", ")", ":", "from", "jinja2", ".", "environment", "import", "_spontaneous_environments", "from", "jinja2", ".", "lexer", "import", "_lexer_cache", "_spontaneous_environments", ".", "clear", "(", ")", "_lexer_cache", ".", "clear", "(", ")"...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py#L108-L117
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/stat.py
python
S_ISREG
(mode)
return S_IFMT(mode) == S_IFREG
Return True if mode is from a regular file.
Return True if mode is from a regular file.
[ "Return", "True", "if", "mode", "is", "from", "a", "regular", "file", "." ]
def S_ISREG(mode): """Return True if mode is from a regular file.""" return S_IFMT(mode) == S_IFREG
[ "def", "S_ISREG", "(", "mode", ")", ":", "return", "S_IFMT", "(", "mode", ")", "==", "S_IFREG" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/stat.py#L62-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
EnableTopLevelWindows
(*args, **kwargs)
return _misc_.EnableTopLevelWindows(*args, **kwargs)
EnableTopLevelWindows(bool enable)
EnableTopLevelWindows(bool enable)
[ "EnableTopLevelWindows", "(", "bool", "enable", ")" ]
def EnableTopLevelWindows(*args, **kwargs): """EnableTopLevelWindows(bool enable)""" return _misc_.EnableTopLevelWindows(*args, **kwargs)
[ "def", "EnableTopLevelWindows", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "EnableTopLevelWindows", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L377-L379
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
KeyEvent.IsKeyInCategory
(*args, **kwargs)
return _core_.KeyEvent_IsKeyInCategory(*args, **kwargs)
IsKeyInCategory(self, int category) -> bool
IsKeyInCategory(self, int category) -> bool
[ "IsKeyInCategory", "(", "self", "int", "category", ")", "-", ">", "bool" ]
def IsKeyInCategory(*args, **kwargs): """IsKeyInCategory(self, int category) -> bool""" return _core_.KeyEvent_IsKeyInCategory(*args, **kwargs)
[ "def", "IsKeyInCategory", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "KeyEvent_IsKeyInCategory", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6017-L6019
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/modules/python/src2/hdr_parser.py
python
CppHeaderParser.print_decls
(self, decls)
Prints the list of declarations, retrieived by the parse() method
Prints the list of declarations, retrieived by the parse() method
[ "Prints", "the", "list", "of", "declarations", "retrieived", "by", "the", "parse", "()", "method" ]
def print_decls(self, decls): """ Prints the list of declarations, retrieived by the parse() method """ for d in decls: print(d[0], d[1], ";".join(d[2])) for a in d[3]: print(" ", a[0], a[1], a[2], end="") if a[3]: ...
[ "def", "print_decls", "(", "self", ",", "decls", ")", ":", "for", "d", "in", "decls", ":", "print", "(", "d", "[", "0", "]", ",", "d", "[", "1", "]", ",", "\";\"", ".", "join", "(", "d", "[", "2", "]", ")", ")", "for", "a", "in", "d", "["...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/modules/python/src2/hdr_parser.py#L858-L869
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
PreFilePickerCtrl
(*args, **kwargs)
return val
PreFilePickerCtrl() -> FilePickerCtrl
PreFilePickerCtrl() -> FilePickerCtrl
[ "PreFilePickerCtrl", "()", "-", ">", "FilePickerCtrl" ]
def PreFilePickerCtrl(*args, **kwargs): """PreFilePickerCtrl() -> FilePickerCtrl""" val = _controls_.new_PreFilePickerCtrl(*args, **kwargs) return val
[ "def", "PreFilePickerCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreFilePickerCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L7065-L7068
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/configobj.py
python
Section.__init__
(self, parent, depth, main, indict=None, name=None)
* parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with
* parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with
[ "*", "parent", "is", "the", "section", "above", "*", "depth", "is", "the", "depth", "level", "of", "this", "section", "*", "main", "is", "the", "main", "ConfigObj", "*", "indict", "is", "a", "dictionary", "to", "initialise", "the", "section", "with" ]
def __init__(self, parent, depth, main, indict=None, name=None): """ * parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with """ if indict is None: in...
[ "def", "__init__", "(", "self", ",", "parent", ",", "depth", ",", "main", ",", "indict", "=", "None", ",", "name", "=", "None", ")", ":", "if", "indict", "is", "None", ":", "indict", "=", "{", "}", "dict", ".", "__init__", "(", "self", ")", "# us...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/configobj.py#L468-L506
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/httplib2/python2/httplib2/socks.py
python
socksocket.getproxypeername
(self)
return _orgsocket.getpeername(self)
getproxypeername() -> address info Returns the IP and port number of the proxy.
getproxypeername() -> address info Returns the IP and port number of the proxy.
[ "getproxypeername", "()", "-", ">", "address", "info", "Returns", "the", "IP", "and", "port", "number", "of", "the", "proxy", "." ]
def getproxypeername(self): """getproxypeername() -> address info Returns the IP and port number of the proxy. """ return _orgsocket.getpeername(self)
[ "def", "getproxypeername", "(", "self", ")", ":", "return", "_orgsocket", ".", "getpeername", "(", "self", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/httplib2/python2/httplib2/socks.py#L297-L301
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py
python
Popen._remaining_time
(self, endtime)
Convenience for _communicate when computing timeouts.
Convenience for _communicate when computing timeouts.
[ "Convenience", "for", "_communicate", "when", "computing", "timeouts", "." ]
def _remaining_time(self, endtime): """Convenience for _communicate when computing timeouts.""" if endtime is None: return None else: return endtime - _time()
[ "def", "_remaining_time", "(", "self", ",", "endtime", ")", ":", "if", "endtime", "is", "None", ":", "return", "None", "else", ":", "return", "endtime", "-", "_time", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py#L994-L999
Dobiasd/FunctionalPlus
659020561daf0fbd35e6fe658a8e72dc87fb6180
generate/auto_generate.py
python
write_fwd_defines
(all_function_and_bind_counts)
Writes the include/fplus/fwd_instances.autogenerated_defines file
Writes the include/fplus/fwd_instances.autogenerated_defines file
[ "Writes", "the", "include", "/", "fplus", "/", "fwd_instances", ".", "autogenerated_defines", "file" ]
def write_fwd_defines(all_function_and_bind_counts): """ Writes the include/fplus/fwd_instances.autogenerated_defines file """ def make_fplus_fwd_define_fn_line(function_and_bind_count): return "fplus_fwd_define_fn_" + str(function_and_bind_count.bind_count) + "(" + function_and_bind_count.f...
[ "def", "write_fwd_defines", "(", "all_function_and_bind_counts", ")", ":", "def", "make_fplus_fwd_define_fn_line", "(", "function_and_bind_count", ")", ":", "return", "\"fplus_fwd_define_fn_\"", "+", "str", "(", "function_and_bind_count", ".", "bind_count", ")", "+", "\"(...
https://github.com/Dobiasd/FunctionalPlus/blob/659020561daf0fbd35e6fe658a8e72dc87fb6180/generate/auto_generate.py#L156-L176
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/repeated_domain.py
python
RepeatedDomain.__init__
(self, num_repeats, domain)
Construct a RepeatedDomain with the specified input (kernel) domain and number of repeats. :param num_repeats: number of times to repeat the input domain :type num_repeats: int > 0 :param domain: the domain to repeat :type domain: DomainInterface subclass
Construct a RepeatedDomain with the specified input (kernel) domain and number of repeats.
[ "Construct", "a", "RepeatedDomain", "with", "the", "specified", "input", "(", "kernel", ")", "domain", "and", "number", "of", "repeats", "." ]
def __init__(self, num_repeats, domain): """Construct a RepeatedDomain with the specified input (kernel) domain and number of repeats. :param num_repeats: number of times to repeat the input domain :type num_repeats: int > 0 :param domain: the domain to repeat :type domain: Doma...
[ "def", "__init__", "(", "self", ",", "num_repeats", ",", "domain", ")", ":", "self", ".", "num_repeats", "=", "num_repeats", "self", ".", "_domain", "=", "domain" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/repeated_domain.py#L50-L60
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/fractions.py
python
Fraction.__rmod__
(b, a)
return a - b * div
a % b
a % b
[ "a", "%", "b" ]
def __rmod__(b, a): """a % b""" div = a // b return a - b * div
[ "def", "__rmod__", "(", "b", ",", "a", ")", ":", "div", "=", "a", "//", "b", "return", "a", "-", "b", "*", "div" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/fractions.py#L446-L449
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/otci/otci/otci.py
python
OTCI.set_router_upgrade_threshold
(self, threshold: int)
Set the ROUTER_UPGRADE_THRESHOLD value.
Set the ROUTER_UPGRADE_THRESHOLD value.
[ "Set", "the", "ROUTER_UPGRADE_THRESHOLD", "value", "." ]
def set_router_upgrade_threshold(self, threshold: int): """Set the ROUTER_UPGRADE_THRESHOLD value.""" self.execute_command(f'routerupgradethreshold {threshold}')
[ "def", "set_router_upgrade_threshold", "(", "self", ",", "threshold", ":", "int", ")", ":", "self", ".", "execute_command", "(", "f'routerupgradethreshold {threshold}'", ")" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L618-L620
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStrV.BegI
(self)
return _snap.TStrV_BegI(self)
BegI(TStrV self) -> TStr Parameters: self: TVec< TStr,int > const *
BegI(TStrV self) -> TStr
[ "BegI", "(", "TStrV", "self", ")", "-", ">", "TStr" ]
def BegI(self): """ BegI(TStrV self) -> TStr Parameters: self: TVec< TStr,int > const * """ return _snap.TStrV_BegI(self)
[ "def", "BegI", "(", "self", ")", ":", "return", "_snap", ".", "TStrV_BegI", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19417-L19425
Kitware/VTK
5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8
Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py
python
gradient
(narray, dataset=None)
return ans
Returns the gradient of an array of scalars/vectors.
Returns the gradient of an array of scalars/vectors.
[ "Returns", "the", "gradient", "of", "an", "array", "of", "scalars", "/", "vectors", "." ]
def gradient(narray, dataset=None): "Returns the gradient of an array of scalars/vectors." if not dataset: dataset = narray.DataSet if not dataset: raise RuntimeError('Need a dataset to compute gradient') try: ncomp = narray.shape[1] except IndexError: ncomp = 1 if ncomp != 1 and nc...
[ "def", "gradient", "(", "narray", ",", "dataset", "=", "None", ")", ":", "if", "not", "dataset", ":", "dataset", "=", "narray", ".", "DataSet", "if", "not", "dataset", ":", "raise", "RuntimeError", "(", "'Need a dataset to compute gradient'", ")", "try", ":"...
https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py#L303-L336
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py
python
BackendInfo.get_all_backends
(cls)
return [BackendInfo(backend_name) for backend_name in cls._name_to_info]
Returns a list of all BackendInfo configurations.
Returns a list of all BackendInfo configurations.
[ "Returns", "a", "list", "of", "all", "BackendInfo", "configurations", "." ]
def get_all_backends(cls) -> Sequence["BackendInfo"]: """Returns a list of all BackendInfo configurations.""" return [BackendInfo(backend_name) for backend_name in cls._name_to_info]
[ "def", "get_all_backends", "(", "cls", ")", "->", "Sequence", "[", "\"BackendInfo\"", "]", ":", "return", "[", "BackendInfo", "(", "backend_name", ")", "for", "backend_name", "in", "cls", ".", "_name_to_info", "]" ]
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py#L966-L968
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_concat_ops.py
python
_concat_ragged_splits
(splits_list)
return array_ops.concat(pieces, axis=0)
Concatenates a list of RaggedTensor splits to form a single splits.
Concatenates a list of RaggedTensor splits to form a single splits.
[ "Concatenates", "a", "list", "of", "RaggedTensor", "splits", "to", "form", "a", "single", "splits", "." ]
def _concat_ragged_splits(splits_list): """Concatenates a list of RaggedTensor splits to form a single splits.""" pieces = [splits_list[0]] splits_offset = splits_list[0][-1] for splits in splits_list[1:]: pieces.append(splits[1:] + splits_offset) splits_offset += splits[-1] return array_ops.concat(pi...
[ "def", "_concat_ragged_splits", "(", "splits_list", ")", ":", "pieces", "=", "[", "splits_list", "[", "0", "]", "]", "splits_offset", "=", "splits_list", "[", "0", "]", "[", "-", "1", "]", "for", "splits", "in", "splits_list", "[", "1", ":", "]", ":", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_concat_ops.py#L302-L309
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py
python
BlinkIDLParser.p_ExceptionOperation
(self, p)
ExceptionOperation : Type identifier '(' ')' ';
ExceptionOperation : Type identifier '(' ')' ';
[ "ExceptionOperation", ":", "Type", "identifier", "(", ")", ";" ]
def p_ExceptionOperation(self, p): """ExceptionOperation : Type identifier '(' ')' ';'""" # Needed to handle one case in DOMException.idl: # // Override in a Mozilla compatible format # [NotEnumerable] DOMString toString(); # Limited form of Operation to prevent others from being...
[ "def", "p_ExceptionOperation", "(", "self", ",", "p", ")", ":", "# Needed to handle one case in DOMException.idl:", "# // Override in a Mozilla compatible format", "# [NotEnumerable] DOMString toString();", "# Limited form of Operation to prevent others from being added.", "# FIXME: Should b...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py#L264-L271
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/shutil.py
python
_get_gid
(name)
return None
Returns a gid, given a group name.
Returns a gid, given a group name.
[ "Returns", "a", "gid", "given", "a", "group", "name", "." ]
def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: return None try: result = getgrnam(name) except KeyError: result = None if result is not None: return result[2] return None
[ "def", "_get_gid", "(", "name", ")", ":", "if", "getgrnam", "is", "None", "or", "name", "is", "None", ":", "return", "None", "try", ":", "result", "=", "getgrnam", "(", "name", ")", "except", "KeyError", ":", "result", "=", "None", "if", "result", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/shutil.py#L703-L723
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/interactiveshell.py
python
InteractiveShell.transform_ast
(self, node)
return node
Apply the AST transformations from self.ast_transformers Parameters ---------- node : ast.Node The root node to be transformed. Typically called with the ast.Module produced by parsing user input. Returns ------- An ast.Node correspon...
Apply the AST transformations from self.ast_transformers Parameters ---------- node : ast.Node The root node to be transformed. Typically called with the ast.Module produced by parsing user input. Returns ------- An ast.Node correspon...
[ "Apply", "the", "AST", "transformations", "from", "self", ".", "ast_transformers", "Parameters", "----------", "node", ":", "ast", ".", "Node", "The", "root", "node", "to", "be", "transformed", ".", "Typically", "called", "with", "the", "ast", ".", "Module", ...
def transform_ast(self, node): """Apply the AST transformations from self.ast_transformers Parameters ---------- node : ast.Node The root node to be transformed. Typically called with the ast.Module produced by parsing user input. Returns ...
[ "def", "transform_ast", "(", "self", ",", "node", ")", ":", "for", "transformer", "in", "self", ".", "ast_transformers", ":", "try", ":", "node", "=", "transformer", ".", "visit", "(", "node", ")", "except", "InputRejected", ":", "# User-supplied AST transform...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L2735-L2764
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStr.GetFExt
(self)
return _snap.TStr_GetFExt(self)
GetFExt(TStr self) -> TStr Parameters: self: TStr const *
GetFExt(TStr self) -> TStr
[ "GetFExt", "(", "TStr", "self", ")", "-", ">", "TStr" ]
def GetFExt(self): """ GetFExt(TStr self) -> TStr Parameters: self: TStr const * """ return _snap.TStr_GetFExt(self)
[ "def", "GetFExt", "(", "self", ")", ":", "return", "_snap", ".", "TStr_GetFExt", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L10755-L10763
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py
python
Standard_Suite_Events.delete
(self, _object, _attributes={}, **_arguments)
delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes. Required argument: the element to delete Keyword argument _attributes: AppleEvent attribute dictionary
delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes. Required argument: the element to delete Keyword argument _attributes: AppleEvent attribute dictionary
[ "delete", ":", "Delete", "an", "object", "from", "its", "container", ".", "Note", "this", "does", "not", "work", "on", "script", "variables", "only", "on", "elements", "of", "application", "classes", ".", "Required", "argument", ":", "the", "element", "to", ...
def delete(self, _object, _attributes={}, **_arguments): """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes. Required argument: the element to delete Keyword argument _attributes: AppleEvent attribute dictionary ...
[ "def", "delete", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'delo'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expected'", "_...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py#L122-L140
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/_feature_engineering/_feature_engineering.py
python
TransformerBase.fit
(self, data)
Fits a transformer using the SFrame `data`. Parameters ---------- data : SFrame The data used to fit the transformer. Returns ------- self (A fitted object) See Also -------- transform, fit_transform Examples -------...
Fits a transformer using the SFrame `data`.
[ "Fits", "a", "transformer", "using", "the", "SFrame", "data", "." ]
def fit(self, data): """ Fits a transformer using the SFrame `data`. Parameters ---------- data : SFrame The data used to fit the transformer. Returns ------- self (A fitted object) See Also -------- transform, fit_tr...
[ "def", "fit", "(", "self", ",", "data", ")", ":", "pass" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_feature_engineering.py#L123-L147
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/EditorLib/HelperBox.py
python
HelperBox.create
(self)
create the segmentation helper box
create the segmentation helper box
[ "create", "the", "segmentation", "helper", "box" ]
def create(self): """create the segmentation helper box""" # # Master Frame # self.masterFrame = qt.QFrame(self.parent) self.masterFrame.setLayout(qt.QVBoxLayout()) self.parent.layout().addWidget(self.masterFrame) # # the master volume selector # self.masterSelectorFrame = ...
[ "def", "create", "(", "self", ")", ":", "#", "# Master Frame", "#", "self", ".", "masterFrame", "=", "qt", ".", "QFrame", "(", "self", ".", "parent", ")", "self", ".", "masterFrame", ".", "setLayout", "(", "qt", ".", "QVBoxLayout", "(", ")", ")", "se...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/HelperBox.py#L215-L311
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/response/scf_products.py
python
ProductCache.reset
(self)
Resets the ProductCache by clearing all data.
Resets the ProductCache by clearing all data.
[ "Resets", "the", "ProductCache", "by", "clearing", "all", "data", "." ]
def reset(self): """Resets the ProductCache by clearing all data. """ for pkey in self._products.keys(): self._products[pkey].clear()
[ "def", "reset", "(", "self", ")", ":", "for", "pkey", "in", "self", ".", "_products", ".", "keys", "(", ")", ":", "self", ".", "_products", "[", "pkey", "]", ".", "clear", "(", ")" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/response/scf_products.py#L151-L155
RoboJackets/robocup-software
bce13ce53ddb2ecb9696266d980722c34617dc15
docs/src/conf.py
python
setup
(app: sphinx.application.Sphinx)
Adds generate_doxygen_xml hook to generate the doxygen XML for breathe. :param app: Application object representing the Sphinx process
Adds generate_doxygen_xml hook to generate the doxygen XML for breathe. :param app: Application object representing the Sphinx process
[ "Adds", "generate_doxygen_xml", "hook", "to", "generate", "the", "doxygen", "XML", "for", "breathe", ".", ":", "param", "app", ":", "Application", "object", "representing", "the", "Sphinx", "process" ]
def setup(app: sphinx.application.Sphinx) -> None: """Adds generate_doxygen_xml hook to generate the doxygen XML for breathe. :param app: Application object representing the Sphinx process """ app.connect("builder-inited", generate_doxygen_xml)
[ "def", "setup", "(", "app", ":", "sphinx", ".", "application", ".", "Sphinx", ")", "->", "None", ":", "app", ".", "connect", "(", "\"builder-inited\"", ",", "generate_doxygen_xml", ")" ]
https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/docs/src/conf.py#L236-L240
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py
python
Environment.__iter__
(self)
Yield the unique project names of the available distributions
Yield the unique project names of the available distributions
[ "Yield", "the", "unique", "project", "names", "of", "the", "available", "distributions" ]
def __iter__(self): """Yield the unique project names of the available distributions""" for key in self._distmap.keys(): if self[key]: yield key
[ "def", "__iter__", "(", "self", ")", ":", "for", "key", "in", "self", ".", "_distmap", ".", "keys", "(", ")", ":", "if", "self", "[", "key", "]", ":", "yield", "key" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L1077-L1081
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/utils/mpi/primitives.py
python
mpi_all
(x, *, comm=MPI_py_comm)
return ar
Computes the elementwise logical AND of an array or a scalar across all MPI processes. Args: a: The input array, which will usually be overwritten in place. Returns: out: The reduced array.
Computes the elementwise logical AND of an array or a scalar across all MPI processes.
[ "Computes", "the", "elementwise", "logical", "AND", "of", "an", "array", "or", "a", "scalar", "across", "all", "MPI", "processes", "." ]
def mpi_all(x, *, comm=MPI_py_comm): """ Computes the elementwise logical AND of an array or a scalar across all MPI processes. Args: a: The input array, which will usually be overwritten in place. Returns: out: The reduced array. """ ar = np.asarray(x) if n_nodes > 1: ...
[ "def", "mpi_all", "(", "x", ",", "*", ",", "comm", "=", "MPI_py_comm", ")", ":", "ar", "=", "np", ".", "asarray", "(", "x", ")", "if", "n_nodes", ">", "1", ":", "comm", ".", "Allreduce", "(", "MPI", ".", "IN_PLACE", ",", "ar", ".", "reshape", "...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/mpi/primitives.py#L172-L187
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/stringold.py
python
replace
(s, old, new, maxsplit=0)
return s.replace(old, new, maxsplit)
replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced.
replace (str, old, new[, maxsplit]) -> string
[ "replace", "(", "str", "old", "new", "[", "maxsplit", "]", ")", "-", ">", "string" ]
def replace(s, old, new, maxsplit=0): """replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced. """ return s.replace(old, new,...
[ "def", "replace", "(", "s", ",", "old", ",", "new", ",", "maxsplit", "=", "0", ")", ":", "return", "s", ".", "replace", "(", "old", ",", "new", ",", "maxsplit", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/stringold.py#L402-L410
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TSOut.EnableLnTrunc
(self, *args)
return _snap.TSOut_EnableLnTrunc(self, *args)
EnableLnTrunc(TSOut self, int const & _MxLnLen) Parameters: _MxLnLen: int const &
EnableLnTrunc(TSOut self, int const & _MxLnLen)
[ "EnableLnTrunc", "(", "TSOut", "self", "int", "const", "&", "_MxLnLen", ")" ]
def EnableLnTrunc(self, *args): """ EnableLnTrunc(TSOut self, int const & _MxLnLen) Parameters: _MxLnLen: int const & """ return _snap.TSOut_EnableLnTrunc(self, *args)
[ "def", "EnableLnTrunc", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TSOut_EnableLnTrunc", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L2092-L2100
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChopGui.py
python
PyChopGui.saveText
(self)
Saves the generated text to a file (opens file dialog).
Saves the generated text to a file (opens file dialog).
[ "Saves", "the", "generated", "text", "to", "a", "file", "(", "opens", "file", "dialog", ")", "." ]
def saveText(self): """ Saves the generated text to a file (opens file dialog). """ try: generatedText = self.genText() except ValueError as err: self.errormessage(err) return fname = QFileDialog.getSaveFileName(self, 'Open file', '') ...
[ "def", "saveText", "(", "self", ")", ":", "try", ":", "generatedText", "=", "self", ".", "genText", "(", ")", "except", "ValueError", "as", "err", ":", "self", ".", "errormessage", "(", "err", ")", "return", "fname", "=", "QFileDialog", ".", "getSaveFile...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChopGui.py#L722-L736
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBModule.GetTriple
(self)
return _lldb.SBModule_GetTriple(self)
GetTriple(self) -> str
GetTriple(self) -> str
[ "GetTriple", "(", "self", ")", "-", ">", "str" ]
def GetTriple(self): """GetTriple(self) -> str""" return _lldb.SBModule_GetTriple(self)
[ "def", "GetTriple", "(", "self", ")", ":", "return", "_lldb", ".", "SBModule_GetTriple", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6249-L6251
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/GUICommon.py
python
IsDualClassed
(actor, verbose)
Returns an array containing the dual class information. Return[0] is 0 if not dualclassed, 1 if the old class is a kit, 3 if the new class is a kit, 2 otherwise. Return[1] contains either the kit or class index of the old class. Return[2] contains the class index of the new class. If verbose is false, only Return[...
Returns an array containing the dual class information.
[ "Returns", "an", "array", "containing", "the", "dual", "class", "information", "." ]
def IsDualClassed(actor, verbose): """Returns an array containing the dual class information. Return[0] is 0 if not dualclassed, 1 if the old class is a kit, 3 if the new class is a kit, 2 otherwise. Return[1] contains either the kit or class index of the old class. Return[2] contains the class index of the new cl...
[ "def", "IsDualClassed", "(", "actor", ",", "verbose", ")", ":", "Multi", "=", "HasMultiClassBits", "(", "actor", ")", "if", "Multi", "==", "0", ":", "# also catches iwd2", "return", "(", "0", ",", "-", "1", ",", "-", "1", ")", "DualedFrom", "=", "GemRB...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/GUICommon.py#L395-L443
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py
python
_Bucket.__init__
(self, api, path, options)
Initialize. Args: api: storage_api instance. path: bucket path of form '/bucket'. options: a dict of listbucket options. Please see listbucket doc.
Initialize.
[ "Initialize", "." ]
def __init__(self, api, path, options): """Initialize. Args: api: storage_api instance. path: bucket path of form '/bucket'. options: a dict of listbucket options. Please see listbucket doc. """ self._init(api, path, options)
[ "def", "__init__", "(", "self", ",", "api", ",", "path", ",", "options", ")", ":", "self", ".", "_init", "(", "api", ",", "path", ",", "options", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py#L276-L284
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel._cubic_interpolation
(x, x0, x1, x2, x3)
return values
Return proportions using the cubic interpolation formula. Find the proportions of 'y0', 'y1', 'y2', 'y3' to take to find 'y(x)' for 'x1 <= x <= x2'. This requires 'x0 < x1 < x2 < x3'. Example: >>> model._cubic_interpolation(1.71, 0.0, 1.0, 2.0, 3.0) [-0.0298555, 0.2766165, 0.8...
Return proportions using the cubic interpolation formula.
[ "Return", "proportions", "using", "the", "cubic", "interpolation", "formula", "." ]
def _cubic_interpolation(x, x0, x1, x2, x3): """ Return proportions using the cubic interpolation formula. Find the proportions of 'y0', 'y1', 'y2', 'y3' to take to find 'y(x)' for 'x1 <= x <= x2'. This requires 'x0 < x1 < x2 < x3'. Example: >>> model._cubic_interpolat...
[ "def", "_cubic_interpolation", "(", "x", ",", "x0", ",", "x1", ",", "x2", ",", "x3", ")", ":", "assert", "x0", "<", "x1", "<", "x2", "<", "x3", "assert", "x1", "<=", "x", "<=", "x2", "values", "=", "[", "]", "# proportion of y0", "values", ".", "...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L451-L483
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
scripts/cpp_lint.py
python
CheckCheck
(filename, clean_lines, linenum, error)
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks the use of CHECK and EXPECT macros.
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "lines", "=", "clean_lines", ".", "elided", "check_macro", "=", "None", "start_pos", "=", "-", "1", "...
https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L3278-L3402
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_data_selector_view.py
python
ModelFittingDataSelectorView.update_result_table_names
(self, table_names: list)
Update the data in the parameter display combo box.
Update the data in the parameter display combo box.
[ "Update", "the", "data", "in", "the", "parameter", "display", "combo", "box", "." ]
def update_result_table_names(self, table_names: list) -> None: """Update the data in the parameter display combo box.""" self.result_table_selector.update_dataset_name_combo_box(table_names)
[ "def", "update_result_table_names", "(", "self", ",", "table_names", ":", "list", ")", "->", "None", ":", "self", ".", "result_table_selector", ".", "update_dataset_name_combo_box", "(", "table_names", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_data_selector_view.py#L52-L54
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py
python
HighPage.create_new
(self, new_theme_name)
Create a new custom theme with the given name. Create the new theme based on the previously active theme with the current changes applied. Once it is saved, then activate the new theme. Attributes accessed: builtin_name custom_name Attributes updated: ...
Create a new custom theme with the given name.
[ "Create", "a", "new", "custom", "theme", "with", "the", "given", "name", "." ]
def create_new(self, new_theme_name): """Create a new custom theme with the given name. Create the new theme based on the previously active theme with the current changes applied. Once it is saved, then activate the new theme. Attributes accessed: builtin_name ...
[ "def", "create_new", "(", "self", ",", "new_theme_name", ")", ":", "if", "self", ".", "theme_source", ".", "get", "(", ")", ":", "theme_type", "=", "'default'", "theme_name", "=", "self", ".", "builtin_name", ".", "get", "(", ")", "else", ":", "theme_typ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L1148-L1186
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/yapf/yapf/yapflib/format_token.py
python
FormatToken.column
(self)
return self.node.column
The original column number of the node in the source.
The original column number of the node in the source.
[ "The", "original", "column", "number", "of", "the", "node", "in", "the", "source", "." ]
def column(self): """The original column number of the node in the source.""" return self.node.column
[ "def", "column", "(", "self", ")", ":", "return", "self", ".", "node", ".", "column" ]
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/format_token.py#L208-L210
BertaBescos/DynaSLAM
8f894a8b9d63c0a608fd871d63c10796491b9312
src/python/model.py
python
refine_detections
(rois, probs, deltas, window, config)
return result
Refine classified proposals and filter overlaps and return final detections. Inputs: rois: [N, (y1, x1, y2, x2)] in normalized coordinates probs: [N, num_classes]. Class probabilities. deltas: [N, num_classes, (dy, dx, log(dh), log(dw))]. Class-specific bounding box delt...
Refine classified proposals and filter overlaps and return final detections.
[ "Refine", "classified", "proposals", "and", "filter", "overlaps", "and", "return", "final", "detections", "." ]
def refine_detections(rois, probs, deltas, window, config): """Refine classified proposals and filter overlaps and return final detections. Inputs: rois: [N, (y1, x1, y2, x2)] in normalized coordinates probs: [N, num_classes]. Class probabilities. deltas: [N, num_classes, (dy, dx, l...
[ "def", "refine_detections", "(", "rois", ",", "probs", ",", "deltas", ",", "window", ",", "config", ")", ":", "# Class IDs per ROI", "class_ids", "=", "np", ".", "argmax", "(", "probs", ",", "axis", "=", "1", ")", "# Class probability of the top class of each RO...
https://github.com/BertaBescos/DynaSLAM/blob/8f894a8b9d63c0a608fd871d63c10796491b9312/src/python/model.py#L641-L710
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Compiler/ExprNodes.py
python
PyCFunctionNode.analyse_default_args
(self, env)
Handle non-literal function's default arguments.
Handle non-literal function's default arguments.
[ "Handle", "non", "-", "literal", "function", "s", "default", "arguments", "." ]
def analyse_default_args(self, env): """ Handle non-literal function's default arguments. """ nonliteral_objects = [] nonliteral_other = [] default_args = [] default_kwargs = [] annotations = [] # For global cpdef functions and def/cpdef methods i...
[ "def", "analyse_default_args", "(", "self", ",", "env", ")", ":", "nonliteral_objects", "=", "[", "]", "nonliteral_other", "=", "[", "]", "default_args", "=", "[", "]", "default_kwargs", "=", "[", "]", "annotations", "=", "[", "]", "# For global cpdef function...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/ExprNodes.py#L9233-L9352
BSVino/DoubleAction
c550b168a3e919926c198c30240f506538b92e75
mp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
MockAnything.__eq__
(self, rhs)
return (isinstance(rhs, MockAnything) and self._replay_mode == rhs._replay_mode and self._expected_calls_queue == rhs._expected_calls_queue)
Provide custom logic to compare objects.
Provide custom logic to compare objects.
[ "Provide", "custom", "logic", "to", "compare", "objects", "." ]
def __eq__(self, rhs): """Provide custom logic to compare objects.""" return (isinstance(rhs, MockAnything) and self._replay_mode == rhs._replay_mode and self._expected_calls_queue == rhs._expected_calls_queue)
[ "def", "__eq__", "(", "self", ",", "rhs", ")", ":", "return", "(", "isinstance", "(", "rhs", ",", "MockAnything", ")", "and", "self", ".", "_replay_mode", "==", "rhs", ".", "_replay_mode", "and", "self", ".", "_expected_calls_queue", "==", "rhs", ".", "_...
https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L314-L319
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
FileType.SetDefaultIcon
(*args, **kwargs)
return _misc_.FileType_SetDefaultIcon(*args, **kwargs)
SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool
SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool
[ "SetDefaultIcon", "(", "self", "String", "cmd", "=", "EmptyString", "int", "index", "=", "0", ")", "-", ">", "bool" ]
def SetDefaultIcon(*args, **kwargs): """SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool""" return _misc_.FileType_SetDefaultIcon(*args, **kwargs)
[ "def", "SetDefaultIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileType_SetDefaultIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2621-L2623
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py
python
EnumDescriptor.__init__
(self, name, full_name, filename, values, containing_type=None, options=None, file=None, serialized_start=None, serialized_end=None)
Arguments are as described in the attribute description above. Note that filename is an obsolete argument, that is not used anymore. Please use file.name to access this as an attribute.
Arguments are as described in the attribute description above.
[ "Arguments", "are", "as", "described", "in", "the", "attribute", "description", "above", "." ]
def __init__(self, name, full_name, filename, values, containing_type=None, options=None, file=None, serialized_start=None, serialized_end=None): """Arguments are as described in the attribute description above. Note that filename is an obsolete argument, that is not used anymore....
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "filename", ",", "values", ",", "containing_type", "=", "None", ",", "options", "=", "None", ",", "file", "=", "None", ",", "serialized_start", "=", "None", ",", "serialized_end", "=", "...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L426-L446
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeBool
(self)
Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Consumes a boolean value.
[ "Consumes", "a", "boolean", "value", "." ]
def ConsumeBool(self): """Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed. """ if self.token == 'true': self.NextToken() return True elif self.token == 'false': self.NextToken() return False ...
[ "def", "ConsumeBool", "(", "self", ")", ":", "if", "self", ".", "token", "==", "'true'", ":", "self", ".", "NextToken", "(", ")", "return", "True", "elif", "self", ".", "token", "==", "'false'", ":", "self", ".", "NextToken", "(", ")", "return", "Fal...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py#L501-L517
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py
python
Path.is_socket
(self)
Whether this path is a socket.
Whether this path is a socket.
[ "Whether", "this", "path", "is", "a", "socket", "." ]
def is_socket(self): """ Whether this path is a socket. """ try: return S_ISSOCK(self.stat().st_mode) except OSError as e: if not _ignore_error(e): raise # Path doesn't exist or is a broken symlink # (see https://bit...
[ "def", "is_socket", "(", "self", ")", ":", "try", ":", "return", "S_ISSOCK", "(", "self", ".", "stat", "(", ")", ".", "st_mode", ")", "except", "OSError", "as", "e", ":", "if", "not", "_ignore_error", "(", "e", ")", ":", "raise", "# Path doesn't exist ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L1467-L1478
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env.py
python
MinitaurGymEnv._get_observation_lower_bound
(self)
return -self._get_observation_upper_bound()
Get the lower bound of the observation.
Get the lower bound of the observation.
[ "Get", "the", "lower", "bound", "of", "the", "observation", "." ]
def _get_observation_lower_bound(self): """Get the lower bound of the observation.""" return -self._get_observation_upper_bound()
[ "def", "_get_observation_lower_bound", "(", "self", ")", ":", "return", "-", "self", ".", "_get_observation_upper_bound", "(", ")" ]
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env.py#L539-L541
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
python/pyarrow/parquet.py
python
ParquetDataset.read
(self, columns=None, use_threads=True, use_pandas_metadata=False)
return all_data
Read multiple Parquet files as a single pyarrow.Table. Parameters ---------- columns : List[str] Names of columns to read from the file. use_threads : bool, default True Perform multi-threaded column reads use_pandas_metadata : bool, default False ...
Read multiple Parquet files as a single pyarrow.Table.
[ "Read", "multiple", "Parquet", "files", "as", "a", "single", "pyarrow", ".", "Table", "." ]
def read(self, columns=None, use_threads=True, use_pandas_metadata=False): """ Read multiple Parquet files as a single pyarrow.Table. Parameters ---------- columns : List[str] Names of columns to read from the file. use_threads : bool, default True ...
[ "def", "read", "(", "self", ",", "columns", "=", "None", ",", "use_threads", "=", "True", ",", "use_pandas_metadata", "=", "False", ")", ":", "tables", "=", "[", "]", "for", "piece", "in", "self", ".", "_pieces", ":", "table", "=", "piece", ".", "rea...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/python/pyarrow/parquet.py#L1496-L1534
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/blahp/src/scripts/slurm_status.py
python
get_finished_job_stats
(jobid, cluster)
return return_dict
Get a completed job's statistics such as used RAM and cpu usage.
Get a completed job's statistics such as used RAM and cpu usage.
[ "Get", "a", "completed", "job", "s", "statistics", "such", "as", "used", "RAM", "and", "cpu", "usage", "." ]
def get_finished_job_stats(jobid, cluster): """ Get a completed job's statistics such as used RAM and cpu usage. """ # First, list the attributes that we want return_dict = { "ImageSize": 0, "ExitCode": 0, "RemoteUserCpu": 0, "RemoteSysCpu": 0 } # Next, query the appropriate interfaces for...
[ "def", "get_finished_job_stats", "(", "jobid", ",", "cluster", ")", ":", "# First, list the attributes that we want", "return_dict", "=", "{", "\"ImageSize\"", ":", "0", ",", "\"ExitCode\"", ":", "0", ",", "\"RemoteUserCpu\"", ":", "0", ",", "\"RemoteSysCpu\"", ":",...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/blahp/src/scripts/slurm_status.py#L310-L397
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/learn/python/learn/estimators/svm.py
python
SVM.predict_proba
(self, x=None, input_fn=None, batch_size=None, outputs=None, as_iterable=True)
return preds[key]
Runs inference to determine the class probability predictions.
Runs inference to determine the class probability predictions.
[ "Runs", "inference", "to", "determine", "the", "class", "probability", "predictions", "." ]
def predict_proba(self, x=None, input_fn=None, batch_size=None, outputs=None, as_iterable=True): """Runs inference to determine the class probability predictions.""" key = prediction_key.PredictionKey.PROBABILITIES preds = super(SVM, self).predict( x=x, input_fn=input_fn,...
[ "def", "predict_proba", "(", "self", ",", "x", "=", "None", ",", "input_fn", "=", "None", ",", "batch_size", "=", "None", ",", "outputs", "=", "None", ",", "as_iterable", "=", "True", ")", ":", "key", "=", "prediction_key", ".", "PredictionKey", ".", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/svm.py#L172-L184
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/modeller.py
python
Modeller.addMembrane
(self, forcefield, lipidType='POPC', membraneCenterZ=0*nanometer, minimumPadding=1*nanometer, positiveIon='Na+', negativeIon='Cl-', ionicStrength=0*molar, neutralize=True)
Add a lipid membrane to the model. This method actually adds both a membrane and a water box. It is best to build them together, both to avoid adding waters inside the membrane and to ensure that lipid head groups are properly solvated. For that reason, this method includes many of the same a...
Add a lipid membrane to the model.
[ "Add", "a", "lipid", "membrane", "to", "the", "model", "." ]
def addMembrane(self, forcefield, lipidType='POPC', membraneCenterZ=0*nanometer, minimumPadding=1*nanometer, positiveIon='Na+', negativeIon='Cl-', ionicStrength=0*molar, neutralize=True): """Add a lipid membrane to the model. This method actually adds both a membrane and a water box. It is best to bui...
[ "def", "addMembrane", "(", "self", ",", "forcefield", ",", "lipidType", "=", "'POPC'", ",", "membraneCenterZ", "=", "0", "*", "nanometer", ",", "minimumPadding", "=", "1", "*", "nanometer", ",", "positiveIon", "=", "'Na+'", ",", "negativeIon", "=", "'Cl-'", ...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/modeller.py#L1210-L1557
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/importer.py
python
_ProcessReturnElementsParam
(return_elements)
return tuple(compat.as_str(x) for x in return_elements)
Type-checks and possibly canonicalizes `return_elements`.
Type-checks and possibly canonicalizes `return_elements`.
[ "Type", "-", "checks", "and", "possibly", "canonicalizes", "return_elements", "." ]
def _ProcessReturnElementsParam(return_elements): """Type-checks and possibly canonicalizes `return_elements`.""" if return_elements is None: return None if not all( isinstance(x, compat.bytes_or_text_types) for x in return_elements): raise TypeError('Argument `return_elements` must be a list of str...
[ "def", "_ProcessReturnElementsParam", "(", "return_elements", ")", ":", "if", "return_elements", "is", "None", ":", "return", "None", "if", "not", "all", "(", "isinstance", "(", "x", ",", "compat", ".", "bytes_or_text_types", ")", "for", "x", "in", "return_ele...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/importer.py#L131-L139
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/descriptor_pool.py
python
DescriptorPool.__init__
(self, descriptor_db=None)
Initializes a Pool of proto buffs. The descriptor_db argument to the constructor is provided to allow specialized file descriptor proto lookup code to be triggered on demand. An example would be an implementation which will read and compile a file specified in a call to FindFileByName() and not require...
Initializes a Pool of proto buffs.
[ "Initializes", "a", "Pool", "of", "proto", "buffs", "." ]
def __init__(self, descriptor_db=None): """Initializes a Pool of proto buffs. The descriptor_db argument to the constructor is provided to allow specialized file descriptor proto lookup code to be triggered on demand. An example would be an implementation which will read and compile a file specifie...
[ "def", "__init__", "(", "self", ",", "descriptor_db", "=", "None", ")", ":", "self", ".", "_internal_db", "=", "descriptor_database", ".", "DescriptorDatabase", "(", ")", "self", ".", "_descriptor_db", "=", "descriptor_db", "self", ".", "_descriptors", "=", "{...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/descriptor_pool.py#L127-L155
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/google/protobuf/reflection.py
python
_ExtensionDict._AddMissingNonRepeatedCompositeHandle
(self, extension_handle, handle_id)
Helper internal to ExtensionDict.
Helper internal to ExtensionDict.
[ "Helper", "internal", "to", "ExtensionDict", "." ]
def _AddMissingNonRepeatedCompositeHandle(self, extension_handle, handle_id): """Helper internal to ExtensionDict.""" # REQUIRES: _lock already held. value = extension_handle.message_type._concrete_class() value._SetListener(_ExtensionDict._ExtensionListener(self, handle_id)) self._values[handle_id]...
[ "def", "_AddMissingNonRepeatedCompositeHandle", "(", "self", ",", "extension_handle", ",", "handle_id", ")", ":", "# REQUIRES: _lock already held.", "value", "=", "extension_handle", ".", "message_type", ".", "_concrete_class", "(", ")", "value", ".", "_SetListener", "(...
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L1556-L1561
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/dispatcher.py
python
BoundMethodWeakref.__init__
(self, boundMethod)
Return a weak-reference-like instance for a bound method.
Return a weak-reference-like instance for a bound method.
[ "Return", "a", "weak", "-", "reference", "-", "like", "instance", "for", "a", "bound", "method", "." ]
def __init__(self, boundMethod): """Return a weak-reference-like instance for a bound method.""" self.isDead = 0 def remove(object, self=self): """Set self.isDead to true when method or instance is destroyed.""" self.isDead = 1 _removeReceiver(receiver=self) ...
[ "def", "__init__", "(", "self", ",", "boundMethod", ")", ":", "self", ".", "isDead", "=", "0", "def", "remove", "(", "object", ",", "self", "=", "self", ")", ":", "\"\"\"Set self.isDead to true when method or instance is destroyed.\"\"\"", "self", ".", "isDead", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/dispatcher.py#L204-L212
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
MessageDialog.SetOKLabel
(*args, **kwargs)
return _windows_.MessageDialog_SetOKLabel(*args, **kwargs)
SetOKLabel(self, String ok) -> bool
SetOKLabel(self, String ok) -> bool
[ "SetOKLabel", "(", "self", "String", "ok", ")", "-", ">", "bool" ]
def SetOKLabel(*args, **kwargs): """SetOKLabel(self, String ok) -> bool""" return _windows_.MessageDialog_SetOKLabel(*args, **kwargs)
[ "def", "SetOKLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "MessageDialog_SetOKLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3642-L3644