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
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/frontend/gyp_reader.py
python
read_from_gyp
(config, path, output, vars, non_unified_sources = set())
Read a gyp configuration and emits GypContexts for the backend to process. config is a ConfigEnvironment, path is the path to a root gyp configuration file, output is the base path under which the objdir for the various gyp dependencies will be, and vars a dict of variables to pass to the gyp proce...
Read a gyp configuration and emits GypContexts for the backend to process.
[ "Read", "a", "gyp", "configuration", "and", "emits", "GypContexts", "for", "the", "backend", "to", "process", "." ]
def read_from_gyp(config, path, output, vars, non_unified_sources = set()): """Read a gyp configuration and emits GypContexts for the backend to process. config is a ConfigEnvironment, path is the path to a root gyp configuration file, output is the base path under which the objdir for the various gyp ...
[ "def", "read_from_gyp", "(", "config", ",", "path", ",", "output", ",", "vars", ",", "non_unified_sources", "=", "set", "(", ")", ")", ":", "time_start", "=", "time", ".", "time", "(", ")", "all_sources", "=", "set", "(", ")", "# gyp expects plain str inst...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/frontend/gyp_reader.py#L85-L218
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/nn.py
python
py_func
(func, x, out, backward_func=None, skip_vars_in_backward_input=None)
return out
:api_attr: Static Graph This OP is used to register customized Python OP to Paddle. The design principe of py_func is that Tensor and numpy array can be converted to each other easily. So you can use Python and numpy API to register a python OP. The forward function of the registered OP is ``func`` an...
:api_attr: Static Graph
[ ":", "api_attr", ":", "Static", "Graph" ]
def py_func(func, x, out, backward_func=None, skip_vars_in_backward_input=None): """ :api_attr: Static Graph This OP is used to register customized Python OP to Paddle. The design principe of py_func is that Tensor and numpy array can be converted to each other easily. So you can use Python and num...
[ "def", "py_func", "(", "func", ",", "x", ",", "out", ",", "backward_func", "=", "None", ",", "skip_vars_in_backward_input", "=", "None", ")", ":", "helper", "=", "LayerHelper", "(", "'py_func'", ",", "*", "*", "locals", "(", ")", ")", "check_type", "(", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L13729-L13962
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/bytecode.py
python
_unpack_opargs
(code)
Returns a 4-int-tuple of (bytecode offset, opcode, argument, offset of next bytecode).
Returns a 4-int-tuple of (bytecode offset, opcode, argument, offset of next bytecode).
[ "Returns", "a", "4", "-", "int", "-", "tuple", "of", "(", "bytecode", "offset", "opcode", "argument", "offset", "of", "next", "bytecode", ")", "." ]
def _unpack_opargs(code): """ Returns a 4-int-tuple of (bytecode offset, opcode, argument, offset of next bytecode). """ if sys.version_info[0] < 3: code = list(map(ord, code)) extended_arg = 0 n = len(code) offset = i = 0 while i < n: op = code[i] i += CODE_...
[ "def", "_unpack_opargs", "(", "code", ")", ":", "if", "sys", ".", "version_info", "[", "0", "]", "<", "3", ":", "code", "=", "list", "(", "map", "(", "ord", ",", "code", ")", ")", "extended_arg", "=", "0", "n", "=", "len", "(", "code", ")", "of...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/bytecode.py#L128-L156
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/backend.py
python
get_session
()
return session
Returns the TF session to be used by the backend. If a default TensorFlow session is available, we will return it. Else, we will return the global Keras session. If no global Keras session exists at this point: we will create a new global session. Note that you can manually set the global session via `K...
Returns the TF session to be used by the backend.
[ "Returns", "the", "TF", "session", "to", "be", "used", "by", "the", "backend", "." ]
def get_session(): """Returns the TF session to be used by the backend. If a default TensorFlow session is available, we will return it. Else, we will return the global Keras session. If no global Keras session exists at this point: we will create a new global session. Note that you can manually set the...
[ "def", "get_session", "(", ")", ":", "global", "_SESSION", "if", "ops", ".", "get_default_session", "(", ")", "is", "not", "None", ":", "session", "=", "ops", ".", "get_default_session", "(", ")", "else", ":", "if", "_SESSION", "is", "None", ":", "if", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L345-L377
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/merge_files.py
python
typedef_loops_with_already_inserted_typedefs
(new_type, merged_types)
return False
Checks if new type would create circular typedefs in merged_types.
Checks if new type would create circular typedefs in merged_types.
[ "Checks", "if", "new", "type", "would", "create", "circular", "typedefs", "in", "merged_types", "." ]
def typedef_loops_with_already_inserted_typedefs(new_type, merged_types): """Checks if new type would create circular typedefs in merged_types.""" if new_type['typedefed_type'] not in merged_types: return False aliased_type = merged_types[new_type['typedefed_type']] new_type_name = new_type['nam...
[ "def", "typedef_loops_with_already_inserted_typedefs", "(", "new_type", ",", "merged_types", ")", ":", "if", "new_type", "[", "'typedefed_type'", "]", "not", "in", "merged_types", ":", "return", "False", "aliased_type", "=", "merged_types", "[", "new_type", "[", "'t...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/merge_files.py#L7-L21
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.SendSizeEventToParent
(*args, **kwargs)
return _core_.Window_SendSizeEventToParent(*args, **kwargs)
SendSizeEventToParent(self, int flags=0) This is a safe wrapper for GetParent().SendSizeEvent(): it checks that we have a parent window and it's not in process of being deleted.
SendSizeEventToParent(self, int flags=0)
[ "SendSizeEventToParent", "(", "self", "int", "flags", "=", "0", ")" ]
def SendSizeEventToParent(*args, **kwargs): """ SendSizeEventToParent(self, int flags=0) This is a safe wrapper for GetParent().SendSizeEvent(): it checks that we have a parent window and it's not in process of being deleted. """ return _core_.Window_SendSizeEventToParen...
[ "def", "SendSizeEventToParent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SendSizeEventToParent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9887-L9894
realm/realm-core
5b2ee26683b4dc6a99afdea4d7a8b54888b89d02
evergreen/hang_analyzer/src/dumper.py
python
WindowsDumper.dump_info
( # pylint: disable=too-many-arguments self, root_logger, logger, pinfo, take_dump)
Dump useful information to the console.
Dump useful information to the console.
[ "Dump", "useful", "information", "to", "the", "console", "." ]
def dump_info( # pylint: disable=too-many-arguments self, root_logger, logger, pinfo, take_dump): """Dump useful information to the console.""" debugger = "cdb.exe" dbg = self.__find_debugger(root_logger, debugger) if dbg is None: root_logger.warning("Debugger %...
[ "def", "dump_info", "(", "# pylint: disable=too-many-arguments", "self", ",", "root_logger", ",", "logger", ",", "pinfo", ",", "take_dump", ")", ":", "debugger", "=", "\"cdb.exe\"", "dbg", "=", "self", ".", "__find_debugger", "(", "root_logger", ",", "debugger", ...
https://github.com/realm/realm-core/blob/5b2ee26683b4dc6a99afdea4d7a8b54888b89d02/evergreen/hang_analyzer/src/dumper.py#L79-L116
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_AddReprMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddReprMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __repr__(self): return text_format.MessageToString(self) cls.__repr__ = __repr__
[ "def", "_AddReprMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "__repr__", "(", "self", ")", ":", "return", "text_format", ".", "MessageToString", "(", "self", ")", "cls", ".", "__repr__", "=", "__repr__" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/python_message.py#L986-L990
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib2to3/pytree.py
python
WildcardPattern.optimize
(self)
return self
Optimize certain stacked wildcard patterns.
Optimize certain stacked wildcard patterns.
[ "Optimize", "certain", "stacked", "wildcard", "patterns", "." ]
def optimize(self): """Optimize certain stacked wildcard patterns.""" subpattern = None if (self.content is not None and len(self.content) == 1 and len(self.content[0]) == 1): subpattern = self.content[0][0] if self.min == 1 and self.max == 1: if self....
[ "def", "optimize", "(", "self", ")", ":", "subpattern", "=", "None", "if", "(", "self", ".", "content", "is", "not", "None", "and", "len", "(", "self", ".", "content", ")", "==", "1", "and", "len", "(", "self", ".", "content", "[", "0", "]", ")",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/pytree.py#L688-L705
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/common_shapes.py
python
unchanged_shape_with_rank_at_most
(rank)
return _ShapeFunction
Returns a shape function for ops that constrain the rank of their input. Args: rank: An upper bound on the rank of the input and output. Returns: A shape function for ops that output a tensor of the same size as their input, with a particular rank.
Returns a shape function for ops that constrain the rank of their input.
[ "Returns", "a", "shape", "function", "for", "ops", "that", "constrain", "the", "rank", "of", "their", "input", "." ]
def unchanged_shape_with_rank_at_most(rank): """Returns a shape function for ops that constrain the rank of their input. Args: rank: An upper bound on the rank of the input and output. Returns: A shape function for ops that output a tensor of the same size as their input, with a particular rank. "...
[ "def", "unchanged_shape_with_rank_at_most", "(", "rank", ")", ":", "def", "_ShapeFunction", "(", "op", ")", ":", "return", "[", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "with_rank_at_most", "(", "rank", ")", "]", "return", "_S...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/common_shapes.py#L74-L88
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/tools/build/win/sln_deps.py
python
ScanSlnFile
(filename)
return projects
Scan a Visual Studio .sln and extract the project dependencies.
Scan a Visual Studio .sln and extract the project dependencies.
[ "Scan", "a", "Visual", "Studio", ".", "sln", "and", "extract", "the", "project", "dependencies", "." ]
def ScanSlnFile(filename): """Scan a Visual Studio .sln and extract the project dependencies.""" try: sln = open(filename, "r") except IOError: sys.stderr.write("Unable to open " + filename + " for reading.\n") return 1 projects = {} project = None while 1: line = sln.readline().strip() ...
[ "def", "ScanSlnFile", "(", "filename", ")", ":", "try", ":", "sln", "=", "open", "(", "filename", ",", "\"r\"", ")", "except", "IOError", ":", "sys", ".", "stderr", ".", "write", "(", "\"Unable to open \"", "+", "filename", "+", "\" for reading.\\n\"", ")"...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/build/win/sln_deps.py#L28-L63
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.wait_variable
(self, name='PY_VAR')
Wait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.
Wait until the variable is modified.
[ "Wait", "until", "the", "variable", "is", "modified", "." ]
def wait_variable(self, name='PY_VAR'): """Wait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.""" self.tk.call('tkwait', 'variable', name)
[ "def", "wait_variable", "(", "self", ",", "name", "=", "'PY_VAR'", ")", ":", "self", ".", "tk", ".", "call", "(", "'tkwait'", ",", "'variable'", ",", "name", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L427-L432
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/data/imaug/operators.py
python
E2EResizeForTest.resize_image
(self, im, max_side_len=512)
return im, (ratio_h, ratio_w)
resize image to a size multiple of max_stride which is required by the network :param im: the resized image :param max_side_len: limit of max image size to avoid out of memory in gpu :return: the resized image and the resize ratio
resize image to a size multiple of max_stride which is required by the network :param im: the resized image :param max_side_len: limit of max image size to avoid out of memory in gpu :return: the resized image and the resize ratio
[ "resize", "image", "to", "a", "size", "multiple", "of", "max_stride", "which", "is", "required", "by", "the", "network", ":", "param", "im", ":", "the", "resized", "image", ":", "param", "max_side_len", ":", "limit", "of", "max", "image", "size", "to", "...
def resize_image(self, im, max_side_len=512): """ resize image to a size multiple of max_stride which is required by the network :param im: the resized image :param max_side_len: limit of max image size to avoid out of memory in gpu :return: the resized image and the resize ratio...
[ "def", "resize_image", "(", "self", ",", "im", ",", "max_side_len", "=", "512", ")", ":", "h", ",", "w", ",", "_", "=", "im", ".", "shape", "resize_w", "=", "w", "resize_h", "=", "h", "# Fix the longer side", "if", "resize_h", ">", "resize_w", ":", "...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/data/imaug/operators.py#L340-L368
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Rect2D.Get
(*args, **kwargs)
return _core_.Rect2D_Get(*args, **kwargs)
Get() -> (x,y, width, height) Return x, y, width and height y properties as a tuple.
Get() -> (x,y, width, height)
[ "Get", "()", "-", ">", "(", "x", "y", "width", "height", ")" ]
def Get(*args, **kwargs): """ Get() -> (x,y, width, height) Return x, y, width and height y properties as a tuple. """ return _core_.Rect2D_Get(*args, **kwargs)
[ "def", "Get", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_Get", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2053-L2059
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pexpect/pexpect/utils.py
python
split_command_line
(command_line)
return arg_list
This splits a command line into a list of arguments. It splits arguments on spaces, but handles embedded quotes, doublequotes, and escaped characters. It's impossible to do this with a regular expression, so I wrote a little state machine to parse the command line.
This splits a command line into a list of arguments. It splits arguments on spaces, but handles embedded quotes, doublequotes, and escaped characters. It's impossible to do this with a regular expression, so I wrote a little state machine to parse the command line.
[ "This", "splits", "a", "command", "line", "into", "a", "list", "of", "arguments", ".", "It", "splits", "arguments", "on", "spaces", "but", "handles", "embedded", "quotes", "doublequotes", "and", "escaped", "characters", ".", "It", "s", "impossible", "to", "d...
def split_command_line(command_line): '''This splits a command line into a list of arguments. It splits arguments on spaces, but handles embedded quotes, doublequotes, and escaped characters. It's impossible to do this with a regular expression, so I wrote a little state machine to parse the command li...
[ "def", "split_command_line", "(", "command_line", ")", ":", "arg_list", "=", "[", "]", "arg", "=", "''", "# Constants to name the states we can be in.", "state_basic", "=", "0", "state_esc", "=", "1", "state_singlequote", "=", "2", "state_doublequote", "=", "3", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/utils.py#L69-L127
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/profiler/pprof_profiler.py
python
Samples.add
(self, datum, location_ids)
Adds a sample data point. Args: datum: `ProfileDatum` to add a sample for. location_ids: List of numberic location ids for this sample.
Adds a sample data point.
[ "Adds", "a", "sample", "data", "point", "." ]
def add(self, datum, location_ids): """Adds a sample data point. Args: datum: `ProfileDatum` to add a sample for. location_ids: List of numberic location ids for this sample. """ node_name = datum.node_exec_stats.node_name if node_name in self._node_name_to_sample: sample ...
[ "def", "add", "(", "self", ",", "datum", ",", "location_ids", ")", ":", "node_name", "=", "datum", ".", "node_exec_stats", ".", "node_name", "if", "node_name", "in", "self", ".", "_node_name_to_sample", ":", "sample", "=", "self", ".", "_node_name_to_sample", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/profiler/pprof_profiler.py#L219-L247
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/gdb/mongo_printers.py
python
AbslFlatHashMapPrinter.children
(self)
Children.
Children.
[ "Children", "." ]
def children(self): """Children.""" for kvp in absl_get_nodes(self.val): yield ('key', kvp['key']) yield ('value', kvp['value'])
[ "def", "children", "(", "self", ")", ":", "for", "kvp", "in", "absl_get_nodes", "(", "self", ".", "val", ")", ":", "yield", "(", "'key'", ",", "kvp", "[", "'key'", "]", ")", "yield", "(", "'value'", ",", "kvp", "[", "'value'", "]", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo_printers.py#L562-L566
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/containers.py
python
WindowRenderInfo.input_line_to_visible_line
(self)
return result
Return the dictionary mapping the line numbers of the input buffer to the lines of the screen. When a line spans several rows at the screen, the first row appears in the dictionary.
Return the dictionary mapping the line numbers of the input buffer to the lines of the screen. When a line spans several rows at the screen, the first row appears in the dictionary.
[ "Return", "the", "dictionary", "mapping", "the", "line", "numbers", "of", "the", "input", "buffer", "to", "the", "lines", "of", "the", "screen", ".", "When", "a", "line", "spans", "several", "rows", "at", "the", "screen", "the", "first", "row", "appears", ...
def input_line_to_visible_line(self): """ Return the dictionary mapping the line numbers of the input buffer to the lines of the screen. When a line spans several rows at the screen, the first row appears in the dictionary. """ result = {} for k, v in self.visible...
[ "def", "input_line_to_visible_line", "(", "self", ")", ":", "result", "=", "{", "}", "for", "k", ",", "v", "in", "self", ".", "visible_line_to_input_line", ".", "items", "(", ")", ":", "if", "v", "in", "result", ":", "result", "[", "v", "]", "=", "mi...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/containers.py#L700-L712
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/extras/codelite.py
python
vsnode_project.dirs
(self)
return lst
Get the list of parent folders of the source files (header files included) for writing the filters
Get the list of parent folders of the source files (header files included) for writing the filters
[ "Get", "the", "list", "of", "parent", "folders", "of", "the", "source", "files", "(", "header", "files", "included", ")", "for", "writing", "the", "filters" ]
def dirs(self): """ Get the list of parent folders of the source files (header files included) for writing the filters """ lst = [] def add(x): if x.height() > self.tg.path.height() and x not in lst: ...
[ "def", "dirs", "(", "self", ")", ":", "lst", "=", "[", "]", "def", "add", "(", "x", ")", ":", "if", "x", ".", "height", "(", ")", ">", "self", ".", "tg", ".", "path", ".", "height", "(", ")", "and", "x", "not", "in", "lst", ":", "lst", "....
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/codelite.py#L459-L471
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/rfcn/lib/rpn/generate_anchors.py
python
_scale_enum
(anchor, scales)
return anchors
Enumerate a set of anchors for each scale wrt an anchor.
Enumerate a set of anchors for each scale wrt an anchor.
[ "Enumerate", "a", "set", "of", "anchors", "for", "each", "scale", "wrt", "an", "anchor", "." ]
def _scale_enum(anchor, scales): """ Enumerate a set of anchors for each scale wrt an anchor. """ w, h, x_ctr, y_ctr = _whctrs(anchor) ws = w * scales hs = h * scales anchors = _mkanchors(ws, hs, x_ctr, y_ctr) return anchors
[ "def", "_scale_enum", "(", "anchor", ",", "scales", ")", ":", "w", ",", "h", ",", "x_ctr", ",", "y_ctr", "=", "_whctrs", "(", "anchor", ")", "ws", "=", "w", "*", "scales", "hs", "=", "h", "*", "scales", "anchors", "=", "_mkanchors", "(", "ws", ",...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/rpn/generate_anchors.py#L88-L97
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/tensor_util.py
python
TensorShapeProtoToList
(shape)
return [dim.size for dim in shape.dim]
Convert a TensorShape to a list. Args: shape: A TensorShapeProto. Returns: List of integers representing the dimensions of the tensor.
Convert a TensorShape to a list.
[ "Convert", "a", "TensorShape", "to", "a", "list", "." ]
def TensorShapeProtoToList(shape): """Convert a TensorShape to a list. Args: shape: A TensorShapeProto. Returns: List of integers representing the dimensions of the tensor. """ return [dim.size for dim in shape.dim]
[ "def", "TensorShapeProtoToList", "(", "shape", ")", ":", "return", "[", "dim", ".", "size", "for", "dim", "in", "shape", ".", "dim", "]" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/tensor_util.py#L158-L167
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/_ffi/_ctypes/function.py
python
_make_tvm_args
(args, temp_args)
return values, type_codes, num_args
Pack arguments into c args tvm call accept
Pack arguments into c args tvm call accept
[ "Pack", "arguments", "into", "c", "args", "tvm", "call", "accept" ]
def _make_tvm_args(args, temp_args): """Pack arguments into c args tvm call accept""" num_args = len(args) values = (TVMValue * num_args)() type_codes = (ctypes.c_int * num_args)() for i, arg in enumerate(args): if isinstance(arg, NodeBase): values[i].v_handle = arg.handle ...
[ "def", "_make_tvm_args", "(", "args", ",", "temp_args", ")", ":", "num_args", "=", "len", "(", "args", ")", "values", "=", "(", "TVMValue", "*", "num_args", ")", "(", ")", "type_codes", "=", "(", "ctypes", ".", "c_int", "*", "num_args", ")", "(", ")"...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/_ffi/_ctypes/function.py#L83-L146
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
Colour.__eq__
(*args, **kwargs)
return _gdi_.Colour___eq__(*args, **kwargs)
__eq__(self, PyObject other) -> bool Compare colours for equality.
__eq__(self, PyObject other) -> bool
[ "__eq__", "(", "self", "PyObject", "other", ")", "-", ">", "bool" ]
def __eq__(*args, **kwargs): """ __eq__(self, PyObject other) -> bool Compare colours for equality. """ return _gdi_.Colour___eq__(*args, **kwargs)
[ "def", "__eq__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Colour___eq__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L244-L250
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextBuffer.SendEvent
(*args, **kwargs)
return _richtext.RichTextBuffer_SendEvent(*args, **kwargs)
SendEvent(self, Event event, bool sendToAll=True) -> bool
SendEvent(self, Event event, bool sendToAll=True) -> bool
[ "SendEvent", "(", "self", "Event", "event", "bool", "sendToAll", "=", "True", ")", "-", ">", "bool" ]
def SendEvent(*args, **kwargs): """SendEvent(self, Event event, bool sendToAll=True) -> bool""" return _richtext.RichTextBuffer_SendEvent(*args, **kwargs)
[ "def", "SendEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_SendEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2495-L2497
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/examples/python/file_extract.py
python
FileExtract.get_n_sint8
(self, n, fail_value=0)
Extract "n" int8_t integers from the binary file at the current file position, returns a list of integers
Extract "n" int8_t integers from the binary file at the current file position, returns a list of integers
[ "Extract", "n", "int8_t", "integers", "from", "the", "binary", "file", "at", "the", "current", "file", "position", "returns", "a", "list", "of", "integers" ]
def get_n_sint8(self, n, fail_value=0): '''Extract "n" int8_t integers from the binary file at the current file position, returns a list of integers''' s = self.read_size(n) if s: return struct.unpack(self.byte_order + ("%u" % n) + 'b', s) else: return (fail_value...
[ "def", "get_n_sint8", "(", "self", ",", "n", ",", "fail_value", "=", "0", ")", ":", "s", "=", "self", ".", "read_size", "(", "n", ")", "if", "s", ":", "return", "struct", ".", "unpack", "(", "self", ".", "byte_order", "+", "(", "\"%u\"", "%", "n"...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/examples/python/file_extract.py#L164-L170
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py
python
AddrlistClass.getdomain
(self)
return ''.join(sdlist)
Get the complete domain name from an address.
Get the complete domain name from an address.
[ "Get", "the", "complete", "domain", "name", "from", "an", "address", "." ]
def getdomain(self): """Get the complete domain name from an address.""" sdlist = [] while self.pos < len(self.field): if self.field[self.pos] in self.LWS: self.pos += 1 elif self.field[self.pos] == '(': self.commentlist.append(self.getcomm...
[ "def", "getdomain", "(", "self", ")", ":", "sdlist", "=", "[", "]", "while", "self", ".", "pos", "<", "len", "(", "self", ".", "field", ")", ":", "if", "self", ".", "field", "[", "self", ".", "pos", "]", "in", "self", ".", "LWS", ":", "self", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py#L661-L677
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/gluon/probability/distributions/utils.py
python
constraint_check
()
return _check
Unified check_constraint interface for both scalar and tensor
Unified check_constraint interface for both scalar and tensor
[ "Unified", "check_constraint", "interface", "for", "both", "scalar", "and", "tensor" ]
def constraint_check(): """Unified check_constraint interface for both scalar and tensor """ def _check(condition, err_msg): if isinstance(condition, bool): if not condition: raise ValueError(err_msg) return 1.0 return npx.constraint_check(condition, e...
[ "def", "constraint_check", "(", ")", ":", "def", "_check", "(", "condition", ",", "err_msg", ")", ":", "if", "isinstance", "(", "condition", ",", "bool", ")", ":", "if", "not", "condition", ":", "raise", "ValueError", "(", "err_msg", ")", "return", "1.0"...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/probability/distributions/utils.py#L34-L43
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/basic.py
python
ellipk
(m)
return ellipkm1(1 - asarray(m))
r"""Complete elliptic integral of the first kind. This function is defined as .. math:: K(m) = \int_0^{\pi/2} [1 - m \sin(t)^2]^{-1/2} dt Parameters ---------- m : array_like The parameter of the elliptic integral. Returns ------- K : array_like Value of the elliptic ...
r"""Complete elliptic integral of the first kind.
[ "r", "Complete", "elliptic", "integral", "of", "the", "first", "kind", "." ]
def ellipk(m): r"""Complete elliptic integral of the first kind. This function is defined as .. math:: K(m) = \int_0^{\pi/2} [1 - m \sin(t)^2]^{-1/2} dt Parameters ---------- m : array_like The parameter of the elliptic integral. Returns ------- K : array_like Val...
[ "def", "ellipk", "(", "m", ")", ":", "return", "ellipkm1", "(", "1", "-", "asarray", "(", "m", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/basic.py#L1847-L1889
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/compute_shader.py
python
ComputeShader.__eq__
(self, other)
return type(self) is type(other) and self.mglo is other.mglo
Compares to compute shaders ensuring the internal opengl name/id is the same
Compares to compute shaders ensuring the internal opengl name/id is the same
[ "Compares", "to", "compute", "shaders", "ensuring", "the", "internal", "opengl", "name", "/", "id", "is", "the", "same" ]
def __eq__(self, other): """Compares to compute shaders ensuring the internal opengl name/id is the same""" return type(self) is type(other) and self.mglo is other.mglo
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "type", "(", "self", ")", "is", "type", "(", "other", ")", "and", "self", ".", "mglo", "is", "other", ".", "mglo" ]
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/compute_shader.py#L42-L44
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
infer_real_valued_columns_from_input
(x)
return infer_real_valued_columns_from_input_fn(input_fn)
Creates `FeatureColumn` objects for inputs defined by input `x`. This interprets all inputs as dense, fixed-length float values. Args: x: Real-valued matrix of shape [n_samples, n_features...]. Can be iterator that returns arrays of features. Returns: List of `FeatureColumn` objects.
Creates `FeatureColumn` objects for inputs defined by input `x`.
[ "Creates", "FeatureColumn", "objects", "for", "inputs", "defined", "by", "input", "x", "." ]
def infer_real_valued_columns_from_input(x): """Creates `FeatureColumn` objects for inputs defined by input `x`. This interprets all inputs as dense, fixed-length float values. Args: x: Real-valued matrix of shape [n_samples, n_features...]. Can be iterator that returns arrays of features. Returns...
[ "def", "infer_real_valued_columns_from_input", "(", "x", ")", ":", "input_fn", ",", "_", "=", "_get_input_fn", "(", "x", "=", "x", ",", "y", "=", "None", ",", "input_fn", "=", "None", ",", "feed_fn", "=", "None", ",", "batch_size", "=", "None", ")", "r...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L169-L183
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
_FieldMaskTree.ToFieldMask
(self, field_mask)
Converts the tree to a FieldMask.
Converts the tree to a FieldMask.
[ "Converts", "the", "tree", "to", "a", "FieldMask", "." ]
def ToFieldMask(self, field_mask): """Converts the tree to a FieldMask.""" field_mask.Clear() _AddFieldPaths(self._root, '', field_mask)
[ "def", "ToFieldMask", "(", "self", ",", "field_mask", ")", ":", "field_mask", ".", "Clear", "(", ")", "_AddFieldPaths", "(", "self", ".", "_root", ",", "''", ",", "field_mask", ")" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L524-L527
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/common.py
python
RerouteTensor
(t0, t1, can_modify=None)
return nb_update_inputs
Reroute the end of the tensor t0 to the ends of the tensor t1. Args: t0: a tf.Tensor. t1: a tf.Tensor. can_modify: iterable of operations which can be modified. Any operation outside within_ops will be left untouched by this function. Returns: The number of individual modifications made by t...
Reroute the end of the tensor t0 to the ends of the tensor t1.
[ "Reroute", "the", "end", "of", "the", "tensor", "t0", "to", "the", "ends", "of", "the", "tensor", "t1", "." ]
def RerouteTensor(t0, t1, can_modify=None): """Reroute the end of the tensor t0 to the ends of the tensor t1. Args: t0: a tf.Tensor. t1: a tf.Tensor. can_modify: iterable of operations which can be modified. Any operation outside within_ops will be left untouched by this function. Returns: ...
[ "def", "RerouteTensor", "(", "t0", ",", "t1", ",", "can_modify", "=", "None", ")", ":", "nb_update_inputs", "=", "0", "consumers", "=", "t1", ".", "consumers", "(", ")", "if", "can_modify", "is", "not", "None", ":", "consumers", "=", "[", "c", "for", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/common.py#L137-L160
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py
python
Decimal.__hash__
(self)
return -2 if ans == -1 else ans
x.__hash__() <==> hash(x)
x.__hash__() <==> hash(x)
[ "x", ".", "__hash__", "()", "<", "==", ">", "hash", "(", "x", ")" ]
def __hash__(self): """x.__hash__() <==> hash(x)""" # In order to make sure that the hash of a Decimal instance # agrees with the hash of a numerically equal integer, float # or Fraction, we follow the rules for numeric hashes outlined # in the documentation. (See library docs,...
[ "def", "__hash__", "(", "self", ")", ":", "# In order to make sure that the hash of a Decimal instance", "# agrees with the hash of a numerically equal integer, float", "# or Fraction, we follow the rules for numeric hashes outlined", "# in the documentation. (See library docs, 'Built-in Types')....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L943-L967
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/calendar.py
python
timegm
(tuple)
return seconds
Unrelated but handy function to calculate Unix timestamp from GMT.
Unrelated but handy function to calculate Unix timestamp from GMT.
[ "Unrelated", "but", "handy", "function", "to", "calculate", "Unix", "timestamp", "from", "GMT", "." ]
def timegm(tuple): """Unrelated but handy function to calculate Unix timestamp from GMT.""" year, month, day, hour, minute, second = tuple[:6] days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1 hours = days*24 + hour minutes = hours*60 + minute seconds = minutes*60 + second ...
[ "def", "timegm", "(", "tuple", ")", ":", "year", ",", "month", ",", "day", ",", "hour", ",", "minute", ",", "second", "=", "tuple", "[", ":", "6", "]", "days", "=", "datetime", ".", "date", "(", "year", ",", "month", ",", "1", ")", ".", "toordi...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/calendar.py#L610-L617
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextParagraphLayoutBox.GetLineAtYPosition
(*args, **kwargs)
return _richtext.RichTextParagraphLayoutBox_GetLineAtYPosition(*args, **kwargs)
GetLineAtYPosition(self, int y) -> RichTextLine
GetLineAtYPosition(self, int y) -> RichTextLine
[ "GetLineAtYPosition", "(", "self", "int", "y", ")", "-", ">", "RichTextLine" ]
def GetLineAtYPosition(*args, **kwargs): """GetLineAtYPosition(self, int y) -> RichTextLine""" return _richtext.RichTextParagraphLayoutBox_GetLineAtYPosition(*args, **kwargs)
[ "def", "GetLineAtYPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraphLayoutBox_GetLineAtYPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1672-L1674
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py
python
QuotedLiteralBlock.initial_quoted
(self, match, context, next_state)
return [match.string], next_state, []
Match arbitrary quote character on the first line only.
Match arbitrary quote character on the first line only.
[ "Match", "arbitrary", "quote", "character", "on", "the", "first", "line", "only", "." ]
def initial_quoted(self, match, context, next_state): """Match arbitrary quote character on the first line only.""" self.remove_transition('initial_quoted') quote = match.string[0] pattern = re.compile(re.escape(quote), re.UNICODE) # New transition matches consistent quotes only:...
[ "def", "initial_quoted", "(", "self", ",", "match", ",", "context", ",", "next_state", ")", ":", "self", ".", "remove_transition", "(", "'initial_quoted'", ")", "quote", "=", "match", ".", "string", "[", "0", "]", "pattern", "=", "re", ".", "compile", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py#L3071-L3080
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py
python
idd_frm
(n, w, x)
return _id.idd_frm(n, w, x)
Transform real vector via a composition of Rokhlin's random transform, random subselection, and an FFT. In contrast to :func:`idd_sfrm`, this routine works best when the length of the transformed vector is the power-of-two integer output by :func:`idd_frmi`, or when the length is not specified but inst...
Transform real vector via a composition of Rokhlin's random transform, random subselection, and an FFT.
[ "Transform", "real", "vector", "via", "a", "composition", "of", "Rokhlin", "s", "random", "transform", "random", "subselection", "and", "an", "FFT", "." ]
def idd_frm(n, w, x): """ Transform real vector via a composition of Rokhlin's random transform, random subselection, and an FFT. In contrast to :func:`idd_sfrm`, this routine works best when the length of the transformed vector is the power-of-two integer output by :func:`idd_frmi`, or when th...
[ "def", "idd_frm", "(", "n", ",", "w", ",", "x", ")", ":", "return", "_id", ".", "idd_frm", "(", "n", ",", "w", ",", "x", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py#L84-L110
Atarity/Lightpack
4dee73a443cba4c4073291febe450e6c1941f3af
Software/apiexamples/liOSC/OSC.py
python
getRegEx
(pattern)
return re.compile(pattern)
Compiles and returns a 'regular expression' object for the given address-pattern.
Compiles and returns a 'regular expression' object for the given address-pattern.
[ "Compiles", "and", "returns", "a", "regular", "expression", "object", "for", "the", "given", "address", "-", "pattern", "." ]
def getRegEx(pattern): """Compiles and returns a 'regular expression' object for the given address-pattern. """ # Translate OSC-address syntax to python 're' syntax pattern = pattern.replace(".", r"\.") # first, escape all '.'s in the pattern. pattern = pattern.replace("(", r"\(") # escape all '('s. pattern = p...
[ "def", "getRegEx", "(", "pattern", ")", ":", "# Translate OSC-address syntax to python 're' syntax", "pattern", "=", "pattern", ".", "replace", "(", "\".\"", ",", "r\"\\.\"", ")", "# first, escape all '.'s in the pattern.", "pattern", "=", "pattern", ".", "replace", "("...
https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L1222-L1232
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiMDIParentFrame.OnCreateClient
(*args, **kwargs)
return _aui.AuiMDIParentFrame_OnCreateClient(*args, **kwargs)
OnCreateClient(self) -> AuiMDIClientWindow
OnCreateClient(self) -> AuiMDIClientWindow
[ "OnCreateClient", "(", "self", ")", "-", ">", "AuiMDIClientWindow" ]
def OnCreateClient(*args, **kwargs): """OnCreateClient(self) -> AuiMDIClientWindow""" return _aui.AuiMDIParentFrame_OnCreateClient(*args, **kwargs)
[ "def", "OnCreateClient", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIParentFrame_OnCreateClient", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1461-L1463
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction/instruments/sans/sans_reducer.py
python
SANSReducer.get_beam_center
(self)
return self._beam_finder.get_beam_center()
Return the beam center position
Return the beam center position
[ "Return", "the", "beam", "center", "position" ]
def get_beam_center(self): """ Return the beam center position """ return self._beam_finder.get_beam_center()
[ "def", "get_beam_center", "(", "self", ")", ":", "return", "self", ".", "_beam_finder", ".", "get_beam_center", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction/instruments/sans/sans_reducer.py#L164-L168
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
build-support/cpplint.py
python
IsOutOfLineMethodDefinition
(clean_lines, linenum)
return False
Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition.
Check if current line contains an out-of-line method definition.
[ "Check", "if", "current", "line", "contains", "an", "out", "-", "of", "-", "line", "method", "definition", "." ]
def IsOutOfLineMethodDefinition(clean_lines, linenum): """Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definiti...
[ "def", "IsOutOfLineMethodDefinition", "(", "clean_lines", ",", "linenum", ")", ":", "# Scan back a few lines for start of current function", "for", "i", "in", "xrange", "(", "linenum", ",", "max", "(", "-", "1", ",", "linenum", "-", "10", ")", ",", "-", "1", "...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L5226-L5239
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py
python
PDeque.popleft
(self, count=1)
return PDeque(new_left_list, new_right_list, max(self._length - count, 0), self._maxlen)
Return new deque with leftmost element removed. Otherwise functionally equivalent to pop(). >>> pdeque([1, 2]).popleft() pdeque([2])
Return new deque with leftmost element removed. Otherwise functionally equivalent to pop().
[ "Return", "new", "deque", "with", "leftmost", "element", "removed", ".", "Otherwise", "functionally", "equivalent", "to", "pop", "()", "." ]
def popleft(self, count=1): """ Return new deque with leftmost element removed. Otherwise functionally equivalent to pop(). >>> pdeque([1, 2]).popleft() pdeque([2]) """ if count < 0: return self.pop(-count) new_left_list, new_right_list = PDe...
[ "def", "popleft", "(", "self", ",", "count", "=", "1", ")", ":", "if", "count", "<", "0", ":", "return", "self", ".", "pop", "(", "-", "count", ")", "new_left_list", ",", "new_right_list", "=", "PDeque", ".", "_pop_lists", "(", "self", ".", "_left_li...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L125-L137
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/generator/analyzer.py
python
_LookupTargets
(names, mapping)
return [mapping[name] for name in names if name in mapping]
Returns a list of the mapping[name] for each value in |names| that is in |mapping|.
Returns a list of the mapping[name] for each value in |names| that is in |mapping|.
[ "Returns", "a", "list", "of", "the", "mapping", "[", "name", "]", "for", "each", "value", "in", "|names|", "that", "is", "in", "|mapping|", "." ]
def _LookupTargets(names, mapping): """Returns a list of the mapping[name] for each value in |names| that is in |mapping|.""" return [mapping[name] for name in names if name in mapping]
[ "def", "_LookupTargets", "(", "names", ",", "mapping", ")", ":", "return", "[", "mapping", "[", "name", "]", "for", "name", "in", "names", "if", "name", "in", "mapping", "]" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/analyzer.py#L569-L572
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py
python
filter_sources
(sources)
return c_sources, cxx_sources, f_sources, fmodule_sources
Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively.
Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively.
[ "Return", "four", "lists", "of", "filenames", "containing", "C", "C", "++", "Fortran", "and", "Fortran", "90", "module", "sources", "respectively", "." ]
def filter_sources(sources): """Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively. """ c_sources = [] cxx_sources = [] f_sources = [] fmodule_sources = [] for source in sources: if fortran_ext_match(source): mod...
[ "def", "filter_sources", "(", "sources", ")", ":", "c_sources", "=", "[", "]", "cxx_sources", "=", "[", "]", "f_sources", "=", "[", "]", "fmodule_sources", "=", "[", "]", "for", "source", "in", "sources", ":", "if", "fortran_ext_match", "(", "source", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L510-L530
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/labeled_tensor/python/ops/core.py
python
Axes.__init__
(self, axes)
Construct an Axes. Args: axes: A list of Axis objects or (axis_name, axis_value) tuples. Raises: ValueError: If the user provides empty or duplicate axis names.
Construct an Axes.
[ "Construct", "an", "Axes", "." ]
def __init__(self, axes): """Construct an Axes. Args: axes: A list of Axis objects or (axis_name, axis_value) tuples. Raises: ValueError: If the user provides empty or duplicate axis names. """ self._axes = collections.OrderedDict() for axis_data in axes: axis = as_axis(axis...
[ "def", "__init__", "(", "self", ",", "axes", ")", ":", "self", ".", "_axes", "=", "collections", ".", "OrderedDict", "(", ")", "for", "axis_data", "in", "axes", ":", "axis", "=", "as_axis", "(", "axis_data", ")", "name", "=", "axis", ".", "name", "if...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/labeled_tensor/python/ops/core.py#L206-L224
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/cephadm/inventory.py
python
HostCache.get_daemon_types
(self, hostname: str)
return cast(Set[str], {d.daemon_type for d in self.daemons[hostname].values()})
Provide a list of the types of daemons on the host
Provide a list of the types of daemons on the host
[ "Provide", "a", "list", "of", "the", "types", "of", "daemons", "on", "the", "host" ]
def get_daemon_types(self, hostname: str) -> Set[str]: """Provide a list of the types of daemons on the host""" return cast(Set[str], {d.daemon_type for d in self.daemons[hostname].values()})
[ "def", "get_daemon_types", "(", "self", ",", "hostname", ":", "str", ")", "->", "Set", "[", "str", "]", ":", "return", "cast", "(", "Set", "[", "str", "]", ",", "{", "d", ".", "daemon_type", "for", "d", "in", "self", ".", "daemons", "[", "hostname"...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/cephadm/inventory.py#L856-L858
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2/io/tools.py
python
get_dvID
( kindName )
get design variable kind id number from name
get design variable kind id number from name
[ "get", "design", "variable", "kind", "id", "number", "from", "name" ]
def get_dvID( kindName ): """ get design variable kind id number from name """ dv_map = get_dvMap() id_map = dict((v,k) for (k,v) in dv_map.items()) try: return id_map[ kindName ] except KeyError: raise Exception('Unrecognized Design Variable Name: %s' , kindName)
[ "def", "get_dvID", "(", "kindName", ")", ":", "dv_map", "=", "get_dvMap", "(", ")", "id_map", "=", "dict", "(", "(", "v", ",", "k", ")", "for", "(", "k", ",", "v", ")", "in", "dv_map", ".", "items", "(", ")", ")", "try", ":", "return", "id_map"...
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/io/tools.py#L573-L580
dmtcp/dmtcp
48a23686e1ce6784829b783ced9c62a14d620507
util/cpplint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L6049-L6055
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
python/lbann/contrib/launcher.py
python
run
( trainer, model, data_reader, optimizer, lbann_exe=lbann.lbann_exe(), lbann_args=[], procs_per_trainer=None, overwrite_script=False, setup_only=False, batch_job=False, proto_file_name='experiment.prototext', nvprof=False, nvprof_output_name=None, *args, **kwa...
return status
Run LBANN with system-specific optimizations. This is intended to match the behavior of `lbann.run`, with defaults and optimizations for the current system. See that function for a full list of options.
Run LBANN with system-specific optimizations.
[ "Run", "LBANN", "with", "system", "-", "specific", "optimizations", "." ]
def run( trainer, model, data_reader, optimizer, lbann_exe=lbann.lbann_exe(), lbann_args=[], procs_per_trainer=None, overwrite_script=False, setup_only=False, batch_job=False, proto_file_name='experiment.prototext', nvprof=False, nvprof_output_name=None, *args, ...
[ "def", "run", "(", "trainer", ",", "model", ",", "data_reader", ",", "optimizer", ",", "lbann_exe", "=", "lbann", ".", "lbann_exe", "(", ")", ",", "lbann_args", "=", "[", "]", ",", "procs_per_trainer", "=", "None", ",", "overwrite_script", "=", "False", ...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/contrib/launcher.py#L77-L139
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/lookup/lookup_ops.py
python
MutableHashTable.size
(self, name=None)
Compute the number of elements in this table. Args: name: A name for the operation (optional). Returns: A scalar tensor containing the number of elements in this table.
Compute the number of elements in this table.
[ "Compute", "the", "number", "of", "elements", "in", "this", "table", "." ]
def size(self, name=None): """Compute the number of elements in this table. Args: name: A name for the operation (optional). Returns: A scalar tensor containing the number of elements in this table. """ with ops.name_scope(name, "%s_Size" % self._name, [self._ta...
[ "def", "size", "(", "self", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"%s_Size\"", "%", "self", ".", "_name", ",", "[", "self", ".", "_table_ref", "]", ")", "as", "name", ":", "# pylint: disable=protected...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/lookup/lookup_ops.py#L770-L782
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
build/fbcode_builder/CMake/make_fbpy_archive.py
python
build_install_dir
(args, path_map)
Create a directory that contains all of the sources, with a __main__ module to run the program.
Create a directory that contains all of the sources, with a __main__ module to run the program.
[ "Create", "a", "directory", "that", "contains", "all", "of", "the", "sources", "with", "a", "__main__", "module", "to", "run", "the", "program", "." ]
def build_install_dir(args, path_map): """Create a directory that contains all of the sources, with a __main__ module to run the program. """ # Populate a temporary directory first, then rename to the destination # location. This ensures that we don't ever leave a halfway-built # directory behi...
[ "def", "build_install_dir", "(", "args", ",", "path_map", ")", ":", "# Populate a temporary directory first, then rename to the destination", "# location. This ensures that we don't ever leave a halfway-built", "# directory behind at the output path if something goes wrong.", "dest_dir", "=...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/CMake/make_fbpy_archive.py#L167-L179
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/blocks.py
python
external_values
(values: ArrayLike)
The array that Series.values returns (public attribute). This has some historical constraints, and is overridden in block subclasses to return the correct array (e.g. period returns object ndarray and datetimetz a datetime64[ns] ndarray instead of proper extension array).
The array that Series.values returns (public attribute).
[ "The", "array", "that", "Series", ".", "values", "returns", "(", "public", "attribute", ")", "." ]
def external_values(values: ArrayLike) -> ArrayLike: """ The array that Series.values returns (public attribute). This has some historical constraints, and is overridden in block subclasses to return the correct array (e.g. period returns object ndarray and datetimetz a datetime64[ns] ndarray inste...
[ "def", "external_values", "(", "values", ":", "ArrayLike", ")", "->", "ArrayLike", ":", "if", "isinstance", "(", "values", ",", "(", "PeriodArray", ",", "IntervalArray", ")", ")", ":", "return", "values", ".", "astype", "(", "object", ")", "elif", "isinsta...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L2114-L2131
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/base_pane/base_pane_view.py
python
BasePaneView.setup_plot_type_options
(self, options)
Setup the options which are displayed in the plot type combo box
Setup the options which are displayed in the plot type combo box
[ "Setup", "the", "options", "which", "are", "displayed", "in", "the", "plot", "type", "combo", "box" ]
def setup_plot_type_options(self, options): """ Setup the options which are displayed in the plot type combo box """ self.plot_type_combo.blockSignals(True) self.plot_type_combo.clear() self.plot_type_combo.addItems(options) self.plot_type_combo.blockSignals(False...
[ "def", "setup_plot_type_options", "(", "self", ",", "options", ")", ":", "self", ".", "plot_type_combo", ".", "blockSignals", "(", "True", ")", "self", ".", "plot_type_combo", ".", "clear", "(", ")", "self", ".", "plot_type_combo", ".", "addItems", "(", "opt...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/base_pane/base_pane_view.py#L42-L49
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
_ilog
(x, M, L = 8)
return _div_nearest(w*y, M)
Integer approximation to M*log(x/M), with absolute error boundable in terms only of x/M. Given positive integers x and M, return an integer approximation to M * log(x/M). For L = 8 and 0.1 <= x/M <= 10 the difference between the approximation and the exact result is at most 22. For L = 8 and 1.0 ...
Integer approximation to M*log(x/M), with absolute error boundable in terms only of x/M.
[ "Integer", "approximation", "to", "M", "*", "log", "(", "x", "/", "M", ")", "with", "absolute", "error", "boundable", "in", "terms", "only", "of", "x", "/", "M", "." ]
def _ilog(x, M, L = 8): """Integer approximation to M*log(x/M), with absolute error boundable in terms only of x/M. Given positive integers x and M, return an integer approximation to M * log(x/M). For L = 8 and 0.1 <= x/M <= 10 the difference between the approximation and the exact result is at m...
[ "def", "_ilog", "(", "x", ",", "M", ",", "L", "=", "8", ")", ":", "# The basic algorithm is the following: let log1p be the function", "# log1p(x) = log(1+x). Then log(x/M) = log1p((x-M)/M). We use", "# the reduction", "#", "# log1p(y) = 2*log1p(y/(1+sqrt(1+y)))", "#", "# re...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L5546-L5592
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/httplib.py
python
HTTPResponse.getheaders
(self)
return self.msg.items()
Return list of (header, value) tuples.
Return list of (header, value) tuples.
[ "Return", "list", "of", "(", "header", "value", ")", "tuples", "." ]
def getheaders(self): """Return list of (header, value) tuples.""" if self.msg is None: raise ResponseNotReady() return self.msg.items()
[ "def", "getheaders", "(", "self", ")", ":", "if", "self", ".", "msg", "is", "None", ":", "raise", "ResponseNotReady", "(", ")", "return", "self", ".", "msg", ".", "items", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/httplib.py#L673-L677
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pdb.py
python
Pdb.lookupmodule
(self, filename)
return None
Helper function for break/clear parsing -- may be overridden. lookupmodule() translates (possibly incomplete) file or module name into an absolute file name.
Helper function for break/clear parsing -- may be overridden.
[ "Helper", "function", "for", "break", "/", "clear", "parsing", "--", "may", "be", "overridden", "." ]
def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden. lookupmodule() translates (possibly incomplete) file or module name into an absolute file name. """ if os.path.isabs(filename) and os.path.exists(filename): return fil...
[ "def", "lookupmodule", "(", "self", ",", "filename", ")", ":", "if", "os", ".", "path", ".", "isabs", "(", "filename", ")", "and", "os", ".", "path", ".", "exists", "(", "filename", ")", ":", "return", "filename", "f", "=", "os", ".", "path", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pdb.py#L1517-L1539
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/rfc822.py
python
Message.keys
(self)
return self.dict.keys()
Get all of a message's header field names.
Get all of a message's header field names.
[ "Get", "all", "of", "a", "message", "s", "header", "field", "names", "." ]
def keys(self): """Get all of a message's header field names.""" return self.dict.keys()
[ "def", "keys", "(", "self", ")", ":", "return", "self", ".", "dict", ".", "keys", "(", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/rfc822.py#L446-L448
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/tools/scan-build-py/lib/libscanbuild/clang.py
python
get_version
(clang)
return output[0]
Returns the compiler version as string. :param clang: the compiler we are using :return: the version string printed to stderr
Returns the compiler version as string.
[ "Returns", "the", "compiler", "version", "as", "string", "." ]
def get_version(clang): """ Returns the compiler version as string. :param clang: the compiler we are using :return: the version string printed to stderr """ output = run_command([clang, '-v']) # the relevant version info is in the first line return output[0]
[ "def", "get_version", "(", "clang", ")", ":", "output", "=", "run_command", "(", "[", "clang", ",", "'-v'", "]", ")", "# the relevant version info is in the first line", "return", "output", "[", "0", "]" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/tools/scan-build-py/lib/libscanbuild/clang.py#L27-L35
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/module/sequential_module.py
python
SequentialModule.get_params
(self)
return (arg_params, aux_params)
Gets current parameters. Returns ------- (arg_params, aux_params) A pair of dictionaries each mapping parameter names to NDArray values. This is a merged dictionary of all the parameters in the modules.
Gets current parameters.
[ "Gets", "current", "parameters", "." ]
def get_params(self): """Gets current parameters. Returns ------- (arg_params, aux_params) A pair of dictionaries each mapping parameter names to NDArray values. This is a merged dictionary of all the parameters in the modules. """ assert self.bin...
[ "def", "get_params", "(", "self", ")", ":", "assert", "self", ".", "binded", "and", "self", ".", "params_initialized", "arg_params", "=", "dict", "(", ")", "aux_params", "=", "dict", "(", ")", "for", "module", "in", "self", ".", "_modules", ":", "arg", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/sequential_module.py#L153-L172
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py
python
rfc822_escape
(header)
return header
Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline.
Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline.
[ "Return", "a", "version", "of", "the", "string", "escaped", "for", "inclusion", "in", "an", "RFC", "-", "822", "header", "by", "ensuring", "there", "are", "8", "spaces", "space", "after", "each", "newline", "." ]
def rfc822_escape (header): """Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline. """ lines = string.split(header, '\n') header = string.join(lines, '\n' + 8*' ') return header
[ "def", "rfc822_escape", "(", "header", ")", ":", "lines", "=", "string", ".", "split", "(", "header", ",", "'\\n'", ")", "header", "=", "string", ".", "join", "(", "lines", ",", "'\\n'", "+", "8", "*", "' '", ")", "return", "header" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py#L493-L499
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/deNovoQualityScore/denovo.py
python
paste
(elements, sep='')
return sep.join(map(str, elements))
Simplified joining of objects with conversion
Simplified joining of objects with conversion
[ "Simplified", "joining", "of", "objects", "with", "conversion" ]
def paste(elements, sep=''): """Simplified joining of objects with conversion""" return sep.join(map(str, elements))
[ "def", "paste", "(", "elements", ",", "sep", "=", "''", ")", ":", "return", "sep", ".", "join", "(", "map", "(", "str", ",", "elements", ")", ")" ]
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/deNovoQualityScore/denovo.py#L186-L189
crosslife/OpenBird
9e0198a1a2295f03fa1e8676e216e22c9c7d380b
cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Config.set_library_file
(filename)
Set the exact location of libclang
Set the exact location of libclang
[ "Set", "the", "exact", "location", "of", "libclang" ]
def set_library_file(filename): """Set the exact location of libclang""" if Config.loaded: raise Exception("library file must be set before before using " \ "any other functionalities in libclang.") Config.library_file = filename
[ "def", "set_library_file", "(", "filename", ")", ":", "if", "Config", ".", "loaded", ":", "raise", "Exception", "(", "\"library file must be set before before using \"", "\"any other functionalities in libclang.\"", ")", "Config", ".", "library_file", "=", "filename" ]
https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L3149-L3155
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/ssl_support.py
python
opener_for
(ca_bundle=None)
return urllib.request.build_opener( VerifyingHTTPSHandler(ca_bundle or find_ca_bundle()) ).open
Get a urlopen() replacement that uses ca_bundle for verification
Get a urlopen() replacement that uses ca_bundle for verification
[ "Get", "a", "urlopen", "()", "replacement", "that", "uses", "ca_bundle", "for", "verification" ]
def opener_for(ca_bundle=None): """Get a urlopen() replacement that uses ca_bundle for verification""" return urllib.request.build_opener( VerifyingHTTPSHandler(ca_bundle or find_ca_bundle()) ).open
[ "def", "opener_for", "(", "ca_bundle", "=", "None", ")", ":", "return", "urllib", ".", "request", ".", "build_opener", "(", "VerifyingHTTPSHandler", "(", "ca_bundle", "or", "find_ca_bundle", "(", ")", ")", ")", ".", "open" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/ssl_support.py#L205-L209
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/python/caffe/draw.py
python
get_layer_label
(layer, rankdir)
return node_label
Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer
Define node label based on layer type.
[ "Define", "node", "label", "based", "on", "layer", "type", "." ]
def get_layer_label(layer, rankdir): """Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer """ if rankdir in ('TB', 'BT'): ...
[ "def", "get_layer_label", "(", "layer", ",", "rankdir", ")", ":", "if", "rankdir", "in", "(", "'TB'", ",", "'BT'", ")", ":", "# If graph orientation is vertical, horizontal space is free and", "# vertical space is not; separate words with spaces", "separator", "=", "' '", ...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/python/caffe/draw.py#L62-L114
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pkg_resources.py
python
Requirement.__init__
(self, project_name, specs, extras)
DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!
DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!
[ "DO", "NOT", "CALL", "THIS", "UNDOCUMENTED", "METHOD", ";", "use", "Requirement", ".", "parse", "()", "!" ]
def __init__(self, project_name, specs, extras): """DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!""" self.unsafe_name, project_name = project_name, safe_name(project_name) self.project_name, self.key = project_name, project_name.lower() index = [(parse_version(v),state_m...
[ "def", "__init__", "(", "self", ",", "project_name", ",", "specs", ",", "extras", ")", ":", "self", ".", "unsafe_name", ",", "project_name", "=", "project_name", ",", "safe_name", "(", "project_name", ")", "self", ".", "project_name", ",", "self", ".", "ke...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pkg_resources.py#L2345-L2357
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2containerservice/layer1.py
python
EC2ContainerServiceConnection.stop_task
(self, task, cluster=None)
return self._make_request( action='StopTask', verb='POST', path='/', params=params)
Stops a running task. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to stop. If you do not specify a cluster, the default cluster is assumed.. :type task: string :param task: T...
Stops a running task.
[ "Stops", "a", "running", "task", "." ]
def stop_task(self, task, cluster=None): """ Stops a running task. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to stop. If you do not specify a cluster, the default cluster is...
[ "def", "stop_task", "(", "self", ",", "task", ",", "cluster", "=", "None", ")", ":", "params", "=", "{", "'task'", ":", "task", ",", "}", "if", "cluster", "is", "not", "None", ":", "params", "[", "'cluster'", "]", "=", "cluster", "return", "self", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2containerservice/layer1.py#L617-L637
google-ar/WebARonTango
e86965d2cbc652156b480e0fcf77c716745578cd
chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py
python
SizeNotNegativeArgument.GetInvalidArg
(self, index)
return ("-1", "kOutOfBounds", "GL_NO_ERROR")
overridden from SizeArgument.
overridden from SizeArgument.
[ "overridden", "from", "SizeArgument", "." ]
def GetInvalidArg(self, index): """overridden from SizeArgument.""" return ("-1", "kOutOfBounds", "GL_NO_ERROR")
[ "def", "GetInvalidArg", "(", "self", ",", "index", ")", ":", "return", "(", "\"-1\"", ",", "\"kOutOfBounds\"", ",", "\"GL_NO_ERROR\"", ")" ]
https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L8732-L8734
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pydocview.py
python
DocMDIParentFrame.__init__
(self, docManager, parent, id, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name="DocMDIFrame", embeddedWindows=0, minSize=20)
Initializes the DocMDIParentFrame with the default menubar, toolbar, and status bar. Use the optional embeddedWindows parameter with the embedded window constants to create embedded windows around the edges of the DocMDIParentFrame.
Initializes the DocMDIParentFrame with the default menubar, toolbar, and status bar. Use the optional embeddedWindows parameter with the embedded window constants to create embedded windows around the edges of the DocMDIParentFrame.
[ "Initializes", "the", "DocMDIParentFrame", "with", "the", "default", "menubar", "toolbar", "and", "status", "bar", ".", "Use", "the", "optional", "embeddedWindows", "parameter", "with", "the", "embedded", "window", "constants", "to", "create", "embedded", "windows",...
def __init__(self, docManager, parent, id, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name="DocMDIFrame", embeddedWindows=0, minSize=20): """ Initializes the DocMDIParentFrame with the default menubar, toolbar, and status bar. Use the optional embeddedWind...
[ "def", "__init__", "(", "self", ",", "docManager", ",", "parent", ",", "id", ",", "title", ",", "pos", "=", "wx", ".", "DefaultPosition", ",", "size", "=", "wx", ".", "DefaultSize", ",", "style", "=", "wx", ".", "DEFAULT_FRAME_STYLE", ",", "name", "=",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L2227-L2235
NVIDIA/MDL-SDK
aa9642b2546ad7b6236b5627385d882c2ed83c5d
src/mdl/jit/generator_jit/gen_intrinsic_func.py
python
SignatureParser.is_tex_supported
(self, name, signature)
return False
Checks if the given tex intrinsic is supported.
Checks if the given tex intrinsic is supported.
[ "Checks", "if", "the", "given", "tex", "intrinsic", "is", "supported", "." ]
def is_tex_supported(self, name, signature): """Checks if the given tex intrinsic is supported.""" ret_type, params = self.split_signature(signature) if name == "width" or name == "height" or name == "depth": if (len(params) == 1): # support width(), height(), depth(), without extra parameters self.in...
[ "def", "is_tex_supported", "(", "self", ",", "name", ",", "signature", ")", ":", "ret_type", ",", "params", "=", "self", ".", "split_signature", "(", "signature", ")", "if", "name", "==", "\"width\"", "or", "name", "==", "\"height\"", "or", "name", "==", ...
https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/generator_jit/gen_intrinsic_func.py#L581-L671
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py
python
Integral.denominator
(self)
return 1
Integers have a denominator of 1.
Integers have a denominator of 1.
[ "Integers", "have", "a", "denominator", "of", "1", "." ]
def denominator(self): """Integers have a denominator of 1.""" return 1
[ "def", "denominator", "(", "self", ")", ":", "return", "1" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L386-L388
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py
python
CCompiler.library_option
(self, lib)
Return the compiler option to add 'dir' to the list of libraries linked into the shared library or executable.
Return the compiler option to add 'dir' to the list of libraries linked into the shared library or executable.
[ "Return", "the", "compiler", "option", "to", "add", "dir", "to", "the", "list", "of", "libraries", "linked", "into", "the", "shared", "library", "or", "executable", "." ]
def library_option(self, lib): """Return the compiler option to add 'dir' to the list of libraries linked into the shared library or executable. """ raise NotImplementedError
[ "def", "library_option", "(", "self", ",", "lib", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py#L720-L724
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecCodeSignBundle
(self, key, entitlements, provisioning)
Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobileprovision, 2. copy Entitlements.plist from user or SDK next to th...
Code sign a bundle.
[ "Code", "sign", "a", "bundle", "." ]
def ExecCodeSignBundle(self, key, entitlements, provisioning): """Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobilep...
[ "def", "ExecCodeSignBundle", "(", "self", ",", "key", ",", "entitlements", ",", "provisioning", ")", ":", "substitutions", ",", "overrides", "=", "self", ".", "_InstallProvisioningProfile", "(", "provisioning", ",", "self", ".", "_GetCFBundleIdentifier", "(", ")",...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/mac_tool.py#L371-L389
ot/ds2i
2cf8237f638f45da0b25caebd2b3c1fbfebf9149
ext/baker.py
python
Baker.usage
(self, cmd=None, scriptname=None, exception=None, fobj=sys.stdout)
Prints usage of the specified command.
Prints usage of the specified command.
[ "Prints", "usage", "of", "the", "specified", "command", "." ]
def usage(self, cmd=None, scriptname=None, exception=None, fobj=sys.stdout): """ Prints usage of the specified command. """ if exception is not None: scriptname, cmd = exception.scriptname, exception.cmd if scriptname is None: scriptname = s...
[ "def", "usage", "(", "self", ",", "cmd", "=", "None", ",", "scriptname", "=", "None", ",", "exception", "=", "None", ",", "fobj", "=", "sys", ".", "stdout", ")", ":", "if", "exception", "is", "not", "None", ":", "scriptname", ",", "cmd", "=", "exce...
https://github.com/ot/ds2i/blob/2cf8237f638f45da0b25caebd2b3c1fbfebf9149/ext/baker.py#L324-L341
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchengine.py
python
SearchEngine.__init__
(self, root)
Initialize Variables that save search state. The dialogs bind these to the UI elements present in the dialogs.
Initialize Variables that save search state.
[ "Initialize", "Variables", "that", "save", "search", "state", "." ]
def __init__(self, root): '''Initialize Variables that save search state. The dialogs bind these to the UI elements present in the dialogs. ''' self.root = root # need for report_error() self.patvar = StringVar(root, '') # search pattern self.revar = BooleanVar(root, ...
[ "def", "__init__", "(", "self", ",", "root", ")", ":", "self", ".", "root", "=", "root", "# need for report_error()", "self", ".", "patvar", "=", "StringVar", "(", "root", ",", "''", ")", "# search pattern", "self", ".", "revar", "=", "BooleanVar", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchengine.py#L22-L33
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.NewLine
(*args, **kwargs)
return _stc.StyledTextCtrl_NewLine(*args, **kwargs)
NewLine(self) Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
NewLine(self)
[ "NewLine", "(", "self", ")" ]
def NewLine(*args, **kwargs): """ NewLine(self) Insert a new line, may use a CRLF, CR or LF depending on EOL mode. """ return _stc.StyledTextCtrl_NewLine(*args, **kwargs)
[ "def", "NewLine", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_NewLine", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L4563-L4569
yun-liu/RCF
91bfb054ad04187dbbe21e539e165ad9bd3ff00b
scripts/cpp_lint.py
python
Error
(filename, linenum, category, confidence, message)
Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use of "cpplint(categor...
Logs the fact we've found a lint error.
[ "Logs", "the", "fact", "we", "ve", "found", "a", "lint", "error", "." ]
def Error(filename, linenum, category, confidence, message): """Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. ...
[ "def", "Error", "(", "filename", ",", "linenum", ",", "category", ",", "confidence", ",", "message", ")", ":", "if", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "_cpplint_state", ".", "IncrementErrorCount", "(", "category...
https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L988-L1020
BVLC/caffe
9b891540183ddc834a02b2bd81b31afae71b2153
scripts/cpp_lint.py
python
_ShouldPrintError
(category, confidence, linenum)
return True
If confidence >= verbose, category passes filter and is not suppressed.
If confidence >= verbose, category passes filter and is not suppressed.
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/scripts/cpp_lint.py#L965-L989
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/client/session.py
python
_FetchMapper.unique_fetches
(self)
Return the list of unique tensors or ops needed by this fetch mapper. Returns: A list of tensors or ops.
Return the list of unique tensors or ops needed by this fetch mapper.
[ "Return", "the", "list", "of", "unique", "tensors", "or", "ops", "needed", "by", "this", "fetch", "mapper", "." ]
def unique_fetches(self): """Return the list of unique tensors or ops needed by this fetch mapper. Returns: A list of tensors or ops. """ raise NotImplementedError( 'unique_fetches must be implemented by subclasses')
[ "def", "unique_fetches", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "'unique_fetches must be implemented by subclasses'", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/session.py#L224-L231
bigtreetech/BIGTREETECH-SKR-V1.3
b238aa402753e81d551b7d34a181a262a138ae9e
BTT SKR V1.3/firmware/Marlin-2.0.x/buildroot/share/scripts/createTemperatureLookupMarlin.py
python
Thermistor.resist
(self, adc)
return r
Convert ADC reading into a resistance in Ohms
Convert ADC reading into a resistance in Ohms
[ "Convert", "ADC", "reading", "into", "a", "resistance", "in", "Ohms" ]
def resist(self, adc): "Convert ADC reading into a resistance in Ohms" r = self.rp * self.voltage(adc) / (VCC - self.voltage(adc)) # resistance of thermistor return r
[ "def", "resist", "(", "self", ",", "adc", ")", ":", "r", "=", "self", ".", "rp", "*", "self", ".", "voltage", "(", "adc", ")", "/", "(", "VCC", "-", "self", ".", "voltage", "(", "adc", ")", ")", "# resistance of thermistor", "return", "r" ]
https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/b238aa402753e81d551b7d34a181a262a138ae9e/BTT SKR V1.3/firmware/Marlin-2.0.x/buildroot/share/scripts/createTemperatureLookupMarlin.py#L71-L74
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
bindings/experimental/distrdf/python/DistRDF/Backends/Base.py
python
BaseBackend.make_dataframe
(self, *args, **kwargs)
Distributed backends have to take care of creating an RDataFrame object that can run distributedly.
Distributed backends have to take care of creating an RDataFrame object that can run distributedly.
[ "Distributed", "backends", "have", "to", "take", "care", "of", "creating", "an", "RDataFrame", "object", "that", "can", "run", "distributedly", "." ]
def make_dataframe(self, *args, **kwargs): """ Distributed backends have to take care of creating an RDataFrame object that can run distributedly. """
[ "def", "make_dataframe", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":" ]
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/experimental/distrdf/python/DistRDF/Backends/Base.py#L344-L348
Genius-x/genius-x
9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0
cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
TranslationUnit.from_ast_file
(cls, filename, index=None)
return cls(ptr=ptr, index=index)
Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will be raised. index is optional and is the...
Create a TranslationUnit instance from a saved AST file.
[ "Create", "a", "TranslationUnit", "instance", "from", "a", "saved", "AST", "file", "." ]
def from_ast_file(cls, filename, index=None): """Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will...
[ "def", "from_ast_file", "(", "cls", ",", "filename", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "index", "=", "Index", ".", "create", "(", ")", "ptr", "=", "conf", ".", "lib", ".", "clang_createTranslationUnit", "(", "index"...
https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L2054-L2073
ducha-aiki/LSUVinit
a42ecdc0d44c217a29b65e98748d80b90d5c6279
scripts/cpp_lint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/ducha-aiki/LSUVinit/blob/a42ecdc0d44c217a29b65e98748d80b90d5c6279/scripts/cpp_lint.py#L1483-L1505
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/PythonAnalysis/python/rootplot/utilities.py
python
get
(object_name)
return Hist(ROOT.gDirectory.Get(object_name))
Return a Hist object with the given name.
Return a Hist object with the given name.
[ "Return", "a", "Hist", "object", "with", "the", "given", "name", "." ]
def get(object_name): """Return a Hist object with the given name.""" return Hist(ROOT.gDirectory.Get(object_name))
[ "def", "get", "(", "object_name", ")", ":", "return", "Hist", "(", "ROOT", ".", "gDirectory", ".", "Get", "(", "object_name", ")", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/rootplot/utilities.py#L428-L430
jiangxiluning/FOTS.PyTorch
b1851c170b4f1ad18406766352cb5171648ce603
FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py
python
main_validation
(default_evaluation_params_fn,validate_data_fn)
This process validates a method Params: default_evaluation_params_fn: points to a function that returns a dictionary with the default parameters used for the evaluation validate_data_fn: points to a method that validates the corrct format of the submission
This process validates a method Params: default_evaluation_params_fn: points to a function that returns a dictionary with the default parameters used for the evaluation validate_data_fn: points to a method that validates the corrct format of the submission
[ "This", "process", "validates", "a", "method", "Params", ":", "default_evaluation_params_fn", ":", "points", "to", "a", "function", "that", "returns", "a", "dictionary", "with", "the", "default", "parameters", "used", "for", "the", "evaluation", "validate_data_fn", ...
def main_validation(default_evaluation_params_fn,validate_data_fn): """ This process validates a method Params: default_evaluation_params_fn: points to a function that returns a dictionary with the default parameters used for the evaluation validate_data_fn: points to a method that validates the cor...
[ "def", "main_validation", "(", "default_evaluation_params_fn", ",", "validate_data_fn", ")", ":", "try", ":", "p", "=", "dict", "(", "[", "s", "[", "1", ":", "]", ".", "split", "(", "'='", ")", "for", "s", "in", "sys", ".", "argv", "[", "1", ":", "...
https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py#L438-L456
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
Co-Simulation/Sumo/sumo_integration/sumo_simulation.py
python
SumoTLManager.set_state
(self, landmark_id, state)
return True
Updates the state of all the signals associated with the given landmark.
Updates the state of all the signals associated with the given landmark.
[ "Updates", "the", "state", "of", "all", "the", "signals", "associated", "with", "the", "given", "landmark", "." ]
def set_state(self, landmark_id, state): """ Updates the state of all the signals associated with the given landmark. """ for tlid, link_index in self.get_all_associated_signals(landmark_id): traci.trafficlight.setLinkState(tlid, link_index, state) return True
[ "def", "set_state", "(", "self", ",", "landmark_id", ",", "state", ")", ":", "for", "tlid", ",", "link_index", "in", "self", ".", "get_all_associated_signals", "(", "landmark_id", ")", ":", "traci", ".", "trafficlight", ".", "setLinkState", "(", "tlid", ",",...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py#L252-L258
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/joblib/joblib/_parallel_backends.py
python
LokyBackend.abort_everything
(self, ensure_ready=True)
Shutdown the workers and restart a new one with the same parameters
Shutdown the workers and restart a new one with the same parameters
[ "Shutdown", "the", "workers", "and", "restart", "a", "new", "one", "with", "the", "same", "parameters" ]
def abort_everything(self, ensure_ready=True): """Shutdown the workers and restart a new one with the same parameters """ self._workers.terminate(kill_workers=True) self._workers = None if ensure_ready: self.configure(n_jobs=self.parallel.n_jobs, parallel=self.parall...
[ "def", "abort_everything", "(", "self", ",", "ensure_ready", "=", "True", ")", ":", "self", ".", "_workers", ".", "terminate", "(", "kill_workers", "=", "True", ")", "self", ".", "_workers", "=", "None", "if", "ensure_ready", ":", "self", ".", "configure",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/_parallel_backends.py#L558-L565
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
Gauge.Pulse
(*args, **kwargs)
return _controls_.Gauge_Pulse(*args, **kwargs)
Pulse(self)
Pulse(self)
[ "Pulse", "(", "self", ")" ]
def Pulse(*args, **kwargs): """Pulse(self)""" return _controls_.Gauge_Pulse(*args, **kwargs)
[ "def", "Pulse", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Gauge_Pulse", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L763-L765
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/data/python/ops/dataset_ops.py
python
Dataset.zip
(datasets)
return Dataset(dataset_ops.ZipDataset(datasets))
Creates a `Dataset` by zipping together the given datasets. This method has similar semantics to the built-in `zip()` function in Python, with the main difference being that the `datasets` argument can be an arbitrary nested structure of `Dataset` objects. For example: ```python # NOTE: The fo...
Creates a `Dataset` by zipping together the given datasets.
[ "Creates", "a", "Dataset", "by", "zipping", "together", "the", "given", "datasets", "." ]
def zip(datasets): """Creates a `Dataset` by zipping together the given datasets. This method has similar semantics to the built-in `zip()` function in Python, with the main difference being that the `datasets` argument can be an arbitrary nested structure of `Dataset` objects. For example: ``...
[ "def", "zip", "(", "datasets", ")", ":", "return", "Dataset", "(", "dataset_ops", ".", "ZipDataset", "(", "datasets", ")", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/data/python/ops/dataset_ops.py#L174-L212
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py
python
BasicFittingModel._filter_functions_by_dataset_string
(self, display_type: str, fit_functions: list)
Filters out the fit functions corresponding to dataset names that do not contain a string.
Filters out the fit functions corresponding to dataset names that do not contain a string.
[ "Filters", "out", "the", "fit", "functions", "corresponding", "to", "dataset", "names", "that", "do", "not", "contain", "a", "string", "." ]
def _filter_functions_by_dataset_string(self, display_type: str, fit_functions: list) -> list: """Filters out the fit functions corresponding to dataset names that do not contain a string.""" if display_type == "All": return self.get_all_fit_functions() else: _, filtered_...
[ "def", "_filter_functions_by_dataset_string", "(", "self", ",", "display_type", ":", "str", ",", "fit_functions", ":", "list", ")", "->", "list", ":", "if", "display_type", "==", "\"All\"", ":", "return", "self", ".", "get_all_fit_functions", "(", ")", "else", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L940-L946
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/isolate_driver.py
python
prepare_isolate_call
(args, output)
Gathers all information required to run isolate.py later. Dumps it as JSON to |output| file.
Gathers all information required to run isolate.py later.
[ "Gathers", "all", "information", "required", "to", "run", "isolate", ".", "py", "later", "." ]
def prepare_isolate_call(args, output): """Gathers all information required to run isolate.py later. Dumps it as JSON to |output| file. """ with open(output, 'wb') as f: json.dump({ 'args': args, 'dir': os.getcwd(), 'version': 1, }, f, indent=2, sort_keys=True)
[ "def", "prepare_isolate_call", "(", "args", ",", "output", ")", ":", "with", "open", "(", "output", ",", "'wb'", ")", "as", "f", ":", "json", ".", "dump", "(", "{", "'args'", ":", "args", ",", "'dir'", ":", "os", ".", "getcwd", "(", ")", ",", "'v...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/isolate_driver.py#L21-L31
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
SAXCallback.comment
(self, content)
called when a comment has been found, content contains the comment
called when a comment has been found, content contains the comment
[ "called", "when", "a", "comment", "has", "been", "found", "content", "contains", "the", "comment" ]
def comment(self, content): """called when a comment has been found, content contains the comment""" pass
[ "def", "comment", "(", "self", ",", "content", ")", ":", "pass" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L207-L209
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/interpolate/interpolate.py
python
PPoly.solve
(self, y=0., discontinuity=True, extrapolate=None)
Find real solutions of the the equation ``pp(x) == y``. Parameters ---------- y : float, optional Right-hand side. Default is zero. discontinuity : bool, optional Whether to report sign changes across discontinuities at breakpoints as roots. e...
Find real solutions of the the equation ``pp(x) == y``.
[ "Find", "real", "solutions", "of", "the", "the", "equation", "pp", "(", "x", ")", "==", "y", "." ]
def solve(self, y=0., discontinuity=True, extrapolate=None): """ Find real solutions of the the equation ``pp(x) == y``. Parameters ---------- y : float, optional Right-hand side. Default is zero. discontinuity : bool, optional Whether to report s...
[ "def", "solve", "(", "self", ",", "y", "=", "0.", ",", "discontinuity", "=", "True", ",", "extrapolate", "=", "None", ")", ":", "if", "extrapolate", "is", "None", ":", "extrapolate", "=", "self", ".", "extrapolate", "self", ".", "_ensure_c_contiguous", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/interpolate/interpolate.py#L1170-L1240
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/optimize/_trustregion_dogleg.py
python
_minimize_dogleg
(fun, x0, args=(), jac=None, hess=None, **trust_region_options)
return _minimize_trust_region(fun, x0, args=args, jac=jac, hess=hess, subproblem=DoglegSubproblem, **trust_region_options)
Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm. Options ------- initial_trust_radius : float Initial trust-region radius. max_trust_radius : float Maximum value of the trust-region radius. No steps that are longer than this ...
Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm.
[ "Minimization", "of", "scalar", "function", "of", "one", "or", "more", "variables", "using", "the", "dog", "-", "leg", "trust", "-", "region", "algorithm", "." ]
def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None, **trust_region_options): """ Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm. Options ------- initial_trust_radius : float Initial trust-region radius. ...
[ "def", "_minimize_dogleg", "(", "fun", ",", "x0", ",", "args", "=", "(", ")", ",", "jac", "=", "None", ",", "hess", "=", "None", ",", "*", "*", "trust_region_options", ")", ":", "if", "jac", "is", "None", ":", "raise", "ValueError", "(", "'Jacobian i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_trustregion_dogleg.py#L11-L37
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/graph_editor/select.py
python
make_regex
(obj)
Return a compiled regular expression. Args: obj: a string or a regular expression. Returns: A compiled regular expression. Raises: ValueError: if obj could not be converted to a regular expression.
Return a compiled regular expression.
[ "Return", "a", "compiled", "regular", "expression", "." ]
def make_regex(obj): """Return a compiled regular expression. Args: obj: a string or a regular expression. Returns: A compiled regular expression. Raises: ValueError: if obj could not be converted to a regular expression. """ if not can_be_regex(obj): raise ValueError("Expected a string or ...
[ "def", "make_regex", "(", "obj", ")", ":", "if", "not", "can_be_regex", "(", "obj", ")", ":", "raise", "ValueError", "(", "\"Expected a string or a regex, got: {}\"", ".", "format", "(", "type", "(", "obj", ")", ")", ")", "if", "isinstance", "(", "obj", ",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/select.py#L58-L74
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/ART_skeletonBuilder_UI.py
python
SkeletonBuilder_UI.lock_phase2
(self, deleteProxy, skinWeight, *args)
#CRA NEW CODE ################### self.assumeRigPose() import Tools.ART_OrientJointWithUp as ornt # This section will set the LRA values on the arms to be correctly pointing at the child joints for the arms. # It is currently hard-coded for just the uparm, lowarm, and twists. fo...
#CRA NEW CODE ################### self.assumeRigPose()
[ "#CRA", "NEW", "CODE", "###################", "self", ".", "assumeRigPose", "()" ]
def lock_phase2(self, deleteProxy, skinWeight, *args): #set joint mover and skeleton to model pose constraints = [] for mover in self.geoMovers: #ignore facial movers if utils.attrExists(mover + '.lra'): continue mover = mover.partition("|")[...
[ "def", "lock_phase2", "(", "self", ",", "deleteProxy", ",", "skinWeight", ",", "*", "args", ")", ":", "#set joint mover and skeleton to model pose", "constraints", "=", "[", "]", "for", "mover", "in", "self", ".", "geoMovers", ":", "#ignore facial movers", "if", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/ART_skeletonBuilder_UI.py#L7191-L7442
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nccl_ops.py
python
all_min
(tensors)
return _apply_all_reduce('min', tensors)
Returns a list of tensors with the all-reduce min across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. Args: tensors: The input tensors across which to reduce; must be assigned to GPU devices. R...
Returns a list of tensors with the all-reduce min across `tensors`.
[ "Returns", "a", "list", "of", "tensors", "with", "the", "all", "-", "reduce", "min", "across", "tensors", "." ]
def all_min(tensors): """Returns a list of tensors with the all-reduce min across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. Args: tensors: The input tensors across which to reduce; must be assigned...
[ "def", "all_min", "(", "tensors", ")", ":", "return", "_apply_all_reduce", "(", "'min'", ",", "tensors", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nccl_ops.py#L96-L110
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/index.py
python
IntervalIndex.from_breaks
(breaks, closed="right", name=None, copy=False, dtype=None)
return IntervalIndex(interval_col, name=name)
Construct an IntervalIndex from an array of splits. Parameters ---------- breaks : array-like (1-dimensional) Left and right bounds for each interval. closed : {"left", "right", "both", "neither"}, default "right" Whether the intervals are closed on the left-side...
Construct an IntervalIndex from an array of splits.
[ "Construct", "an", "IntervalIndex", "from", "an", "array", "of", "splits", "." ]
def from_breaks(breaks, closed="right", name=None, copy=False, dtype=None): """ Construct an IntervalIndex from an array of splits. Parameters ---------- breaks : array-like (1-dimensional) Left and right bounds for each interval. closed : {"left", "right", "...
[ "def", "from_breaks", "(", "breaks", ",", "closed", "=", "\"right\"", ",", "name", "=", "None", ",", "copy", "=", "False", ",", "dtype", "=", "None", ")", ":", "if", "copy", ":", "breaks", "=", "column", ".", "as_column", "(", "breaks", ",", "dtype",...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/index.py#L2420-L2458
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
CustomHandler.WriteBucketServiceImplementation
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteBucketServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" pass
[ "def", "WriteBucketServiceImplementation", "(", "self", ",", "func", ",", "file", ")", ":", "pass" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2341-L2343
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/descriptor.py
python
Descriptor.EnumValueName
(self, enum, value)
return self.enum_types_by_name[enum].values_by_number[value].name
Returns the string name of an enum value. This is just a small helper method to simplify a common operation. Args: enum: string name of the Enum. value: int, value of the enum. Returns: string name of the enum value. Raises: KeyError if either the Enum doesn't exist or the va...
Returns the string name of an enum value.
[ "Returns", "the", "string", "name", "of", "an", "enum", "value", "." ]
def EnumValueName(self, enum, value): """Returns the string name of an enum value. This is just a small helper method to simplify a common operation. Args: enum: string name of the Enum. value: int, value of the enum. Returns: string name of the enum value. Raises: KeyErr...
[ "def", "EnumValueName", "(", "self", ",", "enum", ",", "value", ")", ":", "return", "self", ".", "enum_types_by_name", "[", "enum", "]", ".", "values_by_number", "[", "value", "]", ".", "name" ]
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/descriptor.py#L290-L306
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/copyreg.py
python
add_extension
(module, name, code)
Register an extension code.
Register an extension code.
[ "Register", "an", "extension", "code", "." ]
def add_extension(module, name, code): """Register an extension code.""" code = int(code) if not 1 <= code <= 0x7fffffff: raise ValueError("code out of range") key = (module, name) if (_extension_registry.get(key) == code and _inverted_registry.get(code) == key): return # Red...
[ "def", "add_extension", "(", "module", ",", "name", ",", "code", ")", ":", "code", "=", "int", "(", "code", ")", "if", "not", "1", "<=", "code", "<=", "0x7fffffff", ":", "raise", "ValueError", "(", "\"code out of range\"", ")", "key", "=", "(", "module...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/copyreg.py#L169-L185