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
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/models/Channel.py
python
Channel.get_limits
(self)
return self.__limits
Return the channel limits
Return the channel limits
[ "Return", "the", "channel", "limits" ]
def get_limits(self): """ Return the channel limits """ return self.__limits
[ "def", "get_limits", "(", "self", ")", ":", "return", "self", ".", "__limits" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/Channel.py#L129-L133
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
tst/style/cpplint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*coun...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L2413-L2432
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/re.py
python
match
(pattern, string, flags=0)
return _compile(pattern, flags).match(string)
Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.
Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.
[ "Try", "to", "apply", "the", "pattern", "at", "the", "start", "of", "the", "string", "returning", "a", "match", "object", "or", "None", "if", "no", "match", "was", "found", "." ]
def match(pattern, string, flags=0): """Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.""" return _compile(pattern, flags).match(string)
[ "def", "match", "(", "pattern", ",", "string", ",", "flags", "=", "0", ")", ":", "return", "_compile", "(", "pattern", ",", "flags", ")", ".", "match", "(", "string", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/re.py#L134-L137
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._compile_ui_status_summary
(self)
return info
Compile status summary about this Curses UI instance. The information includes: scroll status and mouse ON/OFF status. Returns: (str) A single text line summarizing the UI status, adapted to the current screen width.
Compile status summary about this Curses UI instance.
[ "Compile", "status", "summary", "about", "this", "Curses", "UI", "instance", "." ]
def _compile_ui_status_summary(self): """Compile status summary about this Curses UI instance. The information includes: scroll status and mouse ON/OFF status. Returns: (str) A single text line summarizing the UI status, adapted to the current screen width. """ info = "" if self...
[ "def", "_compile_ui_status_summary", "(", "self", ")", ":", "info", "=", "\"\"", "if", "self", ".", "_output_pad_height", ">", "self", ".", "_output_pad_screen_height", "+", "1", ":", "# Display information about the scrolling of tall screen output.", "scroll_percentage", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/curses_ui.py#L1360-L1410
edvardHua/PoseEstimationForMobile
e31fb850c92ba7e220f861e9484b9cd1bdd5696f
training/docker/cocoapi/PythonAPI/pycocotools/coco.py
python
COCO.__init__
(self, annotation_file=None)
Constructor of Microsoft COCO helper class for reading and visualizing annotations. :param annotation_file (str): location of annotation file :param image_folder (str): location to the folder that hosts images. :return:
Constructor of Microsoft COCO helper class for reading and visualizing annotations. :param annotation_file (str): location of annotation file :param image_folder (str): location to the folder that hosts images. :return:
[ "Constructor", "of", "Microsoft", "COCO", "helper", "class", "for", "reading", "and", "visualizing", "annotations", ".", ":", "param", "annotation_file", "(", "str", ")", ":", "location", "of", "annotation", "file", ":", "param", "image_folder", "(", "str", ")...
def __init__(self, annotation_file=None): """ Constructor of Microsoft COCO helper class for reading and visualizing annotations. :param annotation_file (str): location of annotation file :param image_folder (str): location to the folder that hosts images. :return: """ ...
[ "def", "__init__", "(", "self", ",", "annotation_file", "=", "None", ")", ":", "# load dataset", "self", ".", "dataset", ",", "self", ".", "anns", ",", "self", ".", "cats", ",", "self", ".", "imgs", "=", "dict", "(", ")", ",", "dict", "(", ")", ","...
https://github.com/edvardHua/PoseEstimationForMobile/blob/e31fb850c92ba7e220f861e9484b9cd1bdd5696f/training/docker/cocoapi/PythonAPI/pycocotools/coco.py#L71-L88
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/validate-ip-address.py
python
Solution.validIPAddress
(self, IP)
return "Neither"
:type IP: str :rtype: str
:type IP: str :rtype: str
[ ":", "type", "IP", ":", "str", ":", "rtype", ":", "str" ]
def validIPAddress(self, IP): """ :type IP: str :rtype: str """ blocks = IP.split('.') if len(blocks) == 4: for i in xrange(len(blocks)): if not blocks[i].isdigit() or not 0 <= int(blocks[i]) < 256 or \ (blocks[i][0] == '0' a...
[ "def", "validIPAddress", "(", "self", ",", "IP", ")", ":", "blocks", "=", "IP", ".", "split", "(", "'.'", ")", "if", "len", "(", "blocks", ")", "==", "4", ":", "for", "i", "in", "xrange", "(", "len", "(", "blocks", ")", ")", ":", "if", "not", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/validate-ip-address.py#L8-L28
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
Operation._set_control_flow_context
(self, context)
Sets the current control flow context of this op. Args: context: a context object.
Sets the current control flow context of this op.
[ "Sets", "the", "current", "control", "flow", "context", "of", "this", "op", "." ]
def _set_control_flow_context(self, context): """Sets the current control flow context of this op. Args: context: a context object. """ self._control_flow_context = context
[ "def", "_set_control_flow_context", "(", "self", ",", "context", ")", ":", "self", ".", "_control_flow_context", "=", "context" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L1340-L1346
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
config/expandlibs.py
python
LibDescriptor.__str__
(self)
return '\n'.join('%s = %s' % (k, ' '.join(self[k])) for k in self.KEYS if len(self[k]))
Serializes the lib descriptor
Serializes the lib descriptor
[ "Serializes", "the", "lib", "descriptor" ]
def __str__(self): '''Serializes the lib descriptor''' return '\n'.join('%s = %s' % (k, ' '.join(self[k])) for k in self.KEYS if len(self[k]))
[ "def", "__str__", "(", "self", ")", ":", "return", "'\\n'", ".", "join", "(", "'%s = %s'", "%", "(", "k", ",", "' '", ".", "join", "(", "self", "[", "k", "]", ")", ")", "for", "k", "in", "self", ".", "KEYS", "if", "len", "(", "self", "[", "k"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/config/expandlibs.py#L98-L100
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/bisect_utils.py
python
SetupGitDepot
(opts, custom_deps)
Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'. Args: opts: The options parsed from the command line through parse_args(). custom_deps: A dictionary of additional dependencies to add to .gclient. Returns: True if gclient successfully created the con...
Sets up the depot for the bisection.
[ "Sets", "up", "the", "depot", "for", "the", "bisection", "." ]
def SetupGitDepot(opts, custom_deps): """Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'. Args: opts: The options parsed from the command line through parse_args(). custom_deps: A dictionary of additional dependencies to add to .gclient. Returns: T...
[ "def", "SetupGitDepot", "(", "opts", ",", "custom_deps", ")", ":", "name", "=", "'Setting up Bisection Depot'", "try", ":", "if", "opts", ".", "output_buildbot_annotations", ":", "OutputAnnotationStepStart", "(", "name", ")", "if", "RunGClientAndCreateConfig", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_utils.py#L378-L404
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/addins/excel.py
python
ExcelAddin.generateFunction
(self, func)
return self.bufferFunction_.set({ 'cppConversions' : func.parameterList().generate(self.cppConversions_), 'enumConversions' : func.parameterList().generate(self.enumConversions_), 'functionBody' : func.generateBody(self), 'functionDeclaration' : func.parameterList().gener...
Generate source code for a given function.
Generate source code for a given function.
[ "Generate", "source", "code", "for", "a", "given", "function", "." ]
def generateFunction(self, func): """Generate source code for a given function.""" if func.parameterList().parameterCount() > MAXPARAM: raise excelexceptions.ExcelParameterCountException( func.name(), func.parameterList().parameterCount(), MAXPARAM) if self.cellNameCo...
[ "def", "generateFunction", "(", "self", ",", "func", ")", ":", "if", "func", ".", "parameterList", "(", ")", ".", "parameterCount", "(", ")", ">", "MAXPARAM", ":", "raise", "excelexceptions", ".", "ExcelParameterCountException", "(", "func", ".", "name", "("...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/excel.py#L138-L165
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py
python
Context.__getitem__
(self, key)
return item
Lookup a variable or raise `KeyError` if the variable is undefined.
Lookup a variable or raise `KeyError` if the variable is undefined.
[ "Lookup", "a", "variable", "or", "raise", "KeyError", "if", "the", "variable", "is", "undefined", "." ]
def __getitem__(self, key): """Lookup a variable or raise `KeyError` if the variable is undefined. """ item = self.resolve(key) if isinstance(item, Undefined): raise KeyError(key) return item
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "item", "=", "self", ".", "resolve", "(", "key", ")", "if", "isinstance", "(", "item", ",", "Undefined", ")", ":", "raise", "KeyError", "(", "key", ")", "return", "item" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py#L231-L238
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
hasher-matcher-actioner/hmalib/lambdas/ddb_stream_counter.py
python
lambda_handler
(event: GetRecordsOutputTypeDef, _context)
# How do entity counts work in HMA? Without blocking ddb edits. So we do it as a stream processor. Lambda ddb_stream_counter will do the following: a) listen to stream updates to all configured datastores b) determine if the update matches increment or decrement condition for any tracked counts. ...
# How do entity counts work in HMA?
[ "#", "How", "do", "entity", "counts", "work", "in", "HMA?" ]
def lambda_handler(event: GetRecordsOutputTypeDef, _context): """ # How do entity counts work in HMA? Without blocking ddb edits. So we do it as a stream processor. Lambda ddb_stream_counter will do the following: a) listen to stream updates to all configured datastores b) determine if the upda...
[ "def", "lambda_handler", "(", "event", ":", "GetRecordsOutputTypeDef", ",", "_context", ")", ":", "counts_table", "=", "get_counts_table", "(", ")", "count_buffer", "=", "CountBuffer", "(", "counts_table", ")", "current_stream_counter", ".", "update_increments_for_recor...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/lambdas/ddb_stream_counter.py#L140-L158
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.insert
(self, key, value)
Inserts the item at the specified position. Similar to list.insert().
Inserts the item at the specified position. Similar to list.insert().
[ "Inserts", "the", "item", "at", "the", "specified", "position", ".", "Similar", "to", "list", ".", "insert", "()", "." ]
def insert(self, key, value): """Inserts the item at the specified position. Similar to list.insert().""" self._type_checker.CheckValue(value) self._values.insert(key, value) if not self._message_listener.dirty: self._message_listener.Modified()
[ "def", "insert", "(", "self", ",", "key", ",", "value", ")", ":", "self", ".", "_type_checker", ".", "CheckValue", "(", "value", ")", "self", ".", "_values", ".", "insert", "(", "key", ",", "value", ")", "if", "not", "self", ".", "_message_listener", ...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L116-L121
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/generator/msvs.py
python
_GetOutputTargetExt
(spec)
return None
Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing the properties of the target. Ret...
Returns the extension for this target, including the dot
[ "Returns", "the", "extension", "for", "this", "target", "including", "the", "dot" ]
def _GetOutputTargetExt(spec): """Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing...
[ "def", "_GetOutputTargetExt", "(", "spec", ")", ":", "target_extension", "=", "spec", ".", "get", "(", "'product_extension'", ")", "if", "target_extension", ":", "return", "'.'", "+", "target_extension", "return", "None" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/msvs.py#L1340-L1355
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py
python
Label.__init__
(self, master=None, **kw)
Construct a Ttk Label with parent master. STANDARD OPTIONS class, compound, cursor, image, style, takefocus, text, textvariable, underline, width WIDGET-SPECIFIC OPTIONS anchor, background, font, foreground, justify, padding, relief, text, wraplength
Construct a Ttk Label with parent master.
[ "Construct", "a", "Ttk", "Label", "with", "parent", "master", "." ]
def __init__(self, master=None, **kw): """Construct a Ttk Label with parent master. STANDARD OPTIONS class, compound, cursor, image, style, takefocus, text, textvariable, underline, width WIDGET-SPECIFIC OPTIONS anchor, background, font, foreground, justif...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "\"ttk::label\"", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L741-L754
pytorch/ELF
e851e786ced8d26cf470f08a6b9bf7e413fc63f7
src_py/rlpytorch/runner/eval_iters.py
python
EvalItersBasic.__init__
(self, option_map)
Initialization for Evaluation.
Initialization for Evaluation.
[ "Initialization", "for", "Evaluation", "." ]
def __init__(self, option_map): """Initialization for Evaluation.""" self.count = 0
[ "def", "__init__", "(", "self", ",", "option_map", ")", ":", "self", ".", "count", "=", "0" ]
https://github.com/pytorch/ELF/blob/e851e786ced8d26cf470f08a6b9bf7e413fc63f7/src_py/rlpytorch/runner/eval_iters.py#L26-L28
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/ext/pybind11/tools/clang/cindex.py
python
Cursor.get_definition
(self)
return conf.lib.clang_getCursorDefinition(self)
If the cursor is a reference to a declaration or a declaration of some entity, return a cursor that points to the definition of that entity.
If the cursor is a reference to a declaration or a declaration of some entity, return a cursor that points to the definition of that entity.
[ "If", "the", "cursor", "is", "a", "reference", "to", "a", "declaration", "or", "a", "declaration", "of", "some", "entity", "return", "a", "cursor", "that", "points", "to", "the", "definition", "of", "that", "entity", "." ]
def get_definition(self): """ If the cursor is a reference to a declaration or a declaration of some entity, return a cursor that points to the definition of that entity. """ # TODO: Should probably check that this is either a reference or # declaration prior to i...
[ "def", "get_definition", "(", "self", ")", ":", "# TODO: Should probably check that this is either a reference or", "# declaration prior to issuing the lookup.", "return", "conf", ".", "lib", ".", "clang_getCursorDefinition", "(", "self", ")" ]
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L1247-L1255
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/structured/structured_array_ops.py
python
expand_dims_v2
(input, axis, name=None)
return _expand_dims_impl(input, axis, name=name)
Creates a StructuredTensor with a length 1 axis inserted at index `axis`. This is an implementation of tf.expand_dims for StructuredTensor. Note that the `axis` must be less than or equal to rank. >>> st = StructuredTensor.from_pyval([[{"x": 1}, {"x": 2}], [{"x": 3}]]) >>> tf.expand_dims(st, 0).to_pyval() [...
Creates a StructuredTensor with a length 1 axis inserted at index `axis`.
[ "Creates", "a", "StructuredTensor", "with", "a", "length", "1", "axis", "inserted", "at", "index", "axis", "." ]
def expand_dims_v2(input, axis, name=None): # pylint: disable=redefined-builtin """Creates a StructuredTensor with a length 1 axis inserted at index `axis`. This is an implementation of tf.expand_dims for StructuredTensor. Note that the `axis` must be less than or equal to rank. >>> st = StructuredTensor.fro...
[ "def", "expand_dims_v2", "(", "input", ",", "axis", ",", "name", "=", "None", ")", ":", "# pylint: disable=redefined-builtin", "return", "_expand_dims_impl", "(", "input", ",", "axis", ",", "name", "=", "name", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/structured/structured_array_ops.py#L68-L95
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGridInterface.Properties
(self)
This attribute is a pythonic iterator over all properties in this `PropertyGrid` property container. It will only skip categories and private child properties. Usage is simple:: for prop in propGrid.Properties: print(prop) :see: `wx.propgrid.PropertyGridInterface.It...
This attribute is a pythonic iterator over all properties in this `PropertyGrid` property container. It will only skip categories and private child properties. Usage is simple::
[ "This", "attribute", "is", "a", "pythonic", "iterator", "over", "all", "properties", "in", "this", "PropertyGrid", "property", "container", ".", "It", "will", "only", "skip", "categories", "and", "private", "child", "properties", ".", "Usage", "is", "simple", ...
def Properties(self): """ This attribute is a pythonic iterator over all properties in this `PropertyGrid` property container. It will only skip categories and private child properties. Usage is simple:: for prop in propGrid.Properties: print(prop) :...
[ "def", "Properties", "(", "self", ")", ":", "it", "=", "self", ".", "GetVIterator", "(", "PG_ITERATE_NORMAL", ")", "while", "not", "it", ".", "AtEnd", "(", ")", ":", "yield", "it", ".", "GetProperty", "(", ")", "it", ".", "Next", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1766-L1781
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/docview.py
python
DocManager.OnPrint
(self, event)
Prints the current document by calling its View's OnCreatePrintout method.
Prints the current document by calling its View's OnCreatePrintout method.
[ "Prints", "the", "current", "document", "by", "calling", "its", "View", "s", "OnCreatePrintout", "method", "." ]
def OnPrint(self, event): """ Prints the current document by calling its View's OnCreatePrintout method. """ view = self.GetCurrentView() if not view: return printout = view.OnCreatePrintout() if printout: if not hasattr(self, "pri...
[ "def", "OnPrint", "(", "self", ",", "event", ")", ":", "view", "=", "self", ".", "GetCurrentView", "(", ")", "if", "not", "view", ":", "return", "printout", "=", "view", ".", "OnCreatePrintout", "(", ")", "if", "printout", ":", "if", "not", "hasattr", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L1496-L1514
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
RigidObjectModel.drawGL
(self, keepAppearance: "bool"=True)
return _robotsim.RigidObjectModel_drawGL(self, keepAppearance)
r""" drawGL(RigidObjectModel self, bool keepAppearance=True) Draws the object's geometry. If keepAppearance=true, the current appearance is honored. Otherwise, only the raw geometry is drawn. PERFORMANCE WARNING: if keepAppearance is false, then this does not properly reuse ...
r""" drawGL(RigidObjectModel self, bool keepAppearance=True)
[ "r", "drawGL", "(", "RigidObjectModel", "self", "bool", "keepAppearance", "=", "True", ")" ]
def drawGL(self, keepAppearance: "bool"=True) -> "void": r""" drawGL(RigidObjectModel self, bool keepAppearance=True) Draws the object's geometry. If keepAppearance=true, the current appearance is honored. Otherwise, only the raw geometry is drawn. PERFORMANCE WARNING: if ke...
[ "def", "drawGL", "(", "self", ",", "keepAppearance", ":", "\"bool\"", "=", "True", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "RigidObjectModel_drawGL", "(", "self", ",", "keepAppearance", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L5725-L5738
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py
python
Maildir._create_tmp
(self)
Create a file in the tmp subdirectory and open and return it.
Create a file in the tmp subdirectory and open and return it.
[ "Create", "a", "file", "in", "the", "tmp", "subdirectory", "and", "open", "and", "return", "it", "." ]
def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', ...
[ "def", "_create_tmp", "(", "self", ")", ":", "now", "=", "time", ".", "time", "(", ")", "hostname", "=", "socket", ".", "gethostname", "(", ")", "if", "'/'", "in", "hostname", ":", "hostname", "=", "hostname", ".", "replace", "(", "'/'", ",", "r'\\05...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L467-L493
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py
python
RequestsCookieJar.update
(self, other)
Updates this jar with cookies from another CookieJar or dict-like
Updates this jar with cookies from another CookieJar or dict-like
[ "Updates", "this", "jar", "with", "cookies", "from", "another", "CookieJar", "or", "dict", "-", "like" ]
def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super(RequestsCookieJar, self).update(other)
[ "def", "update", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "cookielib", ".", "CookieJar", ")", ":", "for", "cookie", "in", "other", ":", "self", ".", "set_cookie", "(", "copy", ".", "copy", "(", "cookie", ")", ")", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L302-L308
zeakey/DeepSkeleton
dc70170f8fd2ec8ca1157484ce66129981104486
scripts/cpp_lint.py
python
ParseNolintSuppressions
(filename, raw_line, linenum, error)
Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. ...
Updates the global list of error-suppressions.
[ "Updates", "the", "global", "list", "of", "error", "-", "suppressions", "." ]
def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the inp...
[ "def", "ParseNolintSuppressions", "(", "filename", ",", "raw_line", ",", "linenum", ",", "error", ")", ":", "# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).", "matched", "=", "_RE_SUPPRESSION", ".", "search", "(", "raw_line", ")", "if", "matched", ":", "if",...
https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/scripts/cpp_lint.py#L464-L492
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/reroute.py
python
_reroute_sgv_inputs
(sgv0, sgv1, mode)
return sgv0, sgv1
Re-route all the inputs of two subgraphs. Args: sgv0: the first subgraph to have its inputs swapped. This argument is converted to a subgraph using the same rules than the function subgraph.make_view. sgv1: the second subgraph to have its inputs swapped. This argument is converted to a subg...
Re-route all the inputs of two subgraphs.
[ "Re", "-", "route", "all", "the", "inputs", "of", "two", "subgraphs", "." ]
def _reroute_sgv_inputs(sgv0, sgv1, mode): """Re-route all the inputs of two subgraphs. Args: sgv0: the first subgraph to have its inputs swapped. This argument is converted to a subgraph using the same rules than the function subgraph.make_view. sgv1: the second subgraph to have its inputs swa...
[ "def", "_reroute_sgv_inputs", "(", "sgv0", ",", "sgv1", ",", "mode", ")", ":", "sgv0", "=", "_subgraph", ".", "make_view", "(", "sgv0", ")", "sgv1", "=", "_subgraph", ".", "make_view", "(", "sgv1", ")", "_util", ".", "check_graphs", "(", "sgv0", ",", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/reroute.py#L314-L341
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
tools/filelock.py
python
BaseFileLock._acquire
(self)
Platform dependent. If the file lock could be acquired, self._lock_file_fd holds the file descriptor of the lock file.
Platform dependent. If the file lock could be acquired, self._lock_file_fd holds the file descriptor of the lock file.
[ "Platform", "dependent", ".", "If", "the", "file", "lock", "could", "be", "acquired", "self", ".", "_lock_file_fd", "holds", "the", "file", "descriptor", "of", "the", "lock", "file", "." ]
def _acquire(self): """ Platform dependent. If the file lock could be acquired, self._lock_file_fd holds the file descriptor of the lock file. """ raise NotImplementedError()
[ "def", "_acquire", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/tools/filelock.py#L198-L204
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py
python
raw_memmove
(builder, dst, src, count, itemsize, align=1)
return _raw_memcpy(builder, 'llvm.memmove', dst, src, count, itemsize, align)
Emit a raw memmove() call for `count` items of size `itemsize` from `src` to `dest`.
Emit a raw memmove() call for `count` items of size `itemsize` from `src` to `dest`.
[ "Emit", "a", "raw", "memmove", "()", "call", "for", "count", "items", "of", "size", "itemsize", "from", "src", "to", "dest", "." ]
def raw_memmove(builder, dst, src, count, itemsize, align=1): """ Emit a raw memmove() call for `count` items of size `itemsize` from `src` to `dest`. """ return _raw_memcpy(builder, 'llvm.memmove', dst, src, count, itemsize, align)
[ "def", "raw_memmove", "(", "builder", ",", "dst", ",", "src", ",", "count", ",", "itemsize", ",", "align", "=", "1", ")", ":", "return", "_raw_memcpy", "(", "builder", ",", "'llvm.memmove'", ",", "dst", ",", "src", ",", "count", ",", "itemsize", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py#L1013-L1019
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/plugin.py
python
PluginData.GetVersion
(self)
return self._version
@return: Plugin's version string
[]
def GetVersion(self): """@return: Plugin's version string""" return self._version
[ "def", "GetVersion", "(", "self", ")", ":", "return", "self", ".", "_version" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L346-L348
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py
python
ScanSurveyTable.set_survey_result
(self, scan_summary_list)
return
:param scan_summary_list: :return:
[]
def set_survey_result(self, scan_summary_list): """ :param scan_summary_list: :return: """ # check assert isinstance(scan_summary_list, list) # Sort and set to class variable scan_summary_list.sort(reverse=True) self._myScanSummaryList = scan_sum...
[ "def", "set_survey_result", "(", "self", ",", "scan_summary_list", ")", ":", "# check", "assert", "isinstance", "(", "scan_summary_list", ",", "list", ")", "# Sort and set to class variable", "scan_summary_list", ".", "sort", "(", "reverse", "=", "True", ")", "self"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L1335-L1348
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/ctypes/_endian.py
python
_other_endian
(typ)
Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types only arrays are supported.
Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types only arrays are supported.
[ "Return", "the", "type", "with", "the", "other", "byte", "order", ".", "Simple", "types", "like", "c_int", "and", "so", "on", "already", "have", "__ctype_be__", "and", "__ctype_le__", "attributes", "which", "contain", "the", "types", "for", "more", "complicate...
def _other_endian(typ): """Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types only arrays are supported. """ try: return getattr(typ, _OTHER_ENDIAN) ...
[ "def", "_other_endian", "(", "typ", ")", ":", "try", ":", "return", "getattr", "(", "typ", ",", "_OTHER_ENDIAN", ")", "except", "AttributeError", ":", "if", "type", "(", "typ", ")", "==", "_array_type", ":", "return", "_other_endian", "(", "typ", ".", "_...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ctypes/_endian.py#L9-L20
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
PcrValue.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(PcrValue)
Returns new PcrValue object constructed from its marshaled representation in the given byte buffer
Returns new PcrValue object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "PcrValue", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new PcrValue object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(PcrValue)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "PcrValue", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L18065-L18069
hcdth011/ROS-Hydro-SLAM
629448eecd2c9a3511158115fa53ea9e4ae41359
rpg_vikit/vikit_py/src/vikit_py/transformations.py
python
quaternion_multiply
(quaternion1, quaternion0)
return numpy.array(( x1*w0 + y1*z0 - z1*y0 + w1*x0, -x1*z0 + y1*w0 + z1*x0 + w1*y0, x1*y0 - y1*x0 + z1*w0 + w1*z0, -x1*x0 - y1*y0 - z1*z0 + w1*w0), dtype=numpy.float64)
Return multiplication of two quaternions. >>> q = quaternion_multiply([1, -2, 3, 4], [-5, 6, 7, 8]) >>> numpy.allclose(q, [-44, -14, 48, 28]) True
Return multiplication of two quaternions.
[ "Return", "multiplication", "of", "two", "quaternions", "." ]
def quaternion_multiply(quaternion1, quaternion0): """Return multiplication of two quaternions. >>> q = quaternion_multiply([1, -2, 3, 4], [-5, 6, 7, 8]) >>> numpy.allclose(q, [-44, -14, 48, 28]) True """ x0, y0, z0, w0 = quaternion0 x1, y1, z1, w1 = quaternion1 return numpy.array(( ...
[ "def", "quaternion_multiply", "(", "quaternion1", ",", "quaternion0", ")", ":", "x0", ",", "y0", ",", "z0", ",", "w0", "=", "quaternion0", "x1", ",", "y1", ",", "z1", ",", "w1", "=", "quaternion1", "return", "numpy", ".", "array", "(", "(", "x1", "*"...
https://github.com/hcdth011/ROS-Hydro-SLAM/blob/629448eecd2c9a3511158115fa53ea9e4ae41359/rpg_vikit/vikit_py/src/vikit_py/transformations.py#L1232-L1246
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/_precompute/gammainc_asy.py
python
compute_d
(K, N)
return d
d_{k, n} from DLMF 8.12.12
d_{k, n} from DLMF 8.12.12
[ "d_", "{", "k", "n", "}", "from", "DLMF", "8", ".", "12", ".", "12" ]
def compute_d(K, N): """d_{k, n} from DLMF 8.12.12""" M = N + 2*K d0 = [-mp.mpf(1)/3] alpha = compute_alpha(M + 2) for n in range(1, M): d0.append((n + 2)*alpha[n+2]) d = [d0] g = compute_g(K) for k in range(1, K): dk = [] for n in range(M - 2*k): dk.a...
[ "def", "compute_d", "(", "K", ",", "N", ")", ":", "M", "=", "N", "+", "2", "*", "K", "d0", "=", "[", "-", "mp", ".", "mpf", "(", "1", ")", "/", "3", "]", "alpha", "=", "compute_alpha", "(", "M", "+", "2", ")", "for", "n", "in", "range", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/_precompute/gammainc_asy.py#L59-L75
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/concurrent/futures/process.py
python
_queue_management_worker
(executor_reference, processes, pending_work_items, work_ids_queue, call_queue, result_queue)
Manages the communication between this process and the worker processes. This function is run in a local thread. Args: executor_reference: A weakref.ref to the ProcessPoolExecutor that owns this thread. Used to determine if the ProcessPoolExecutor has been garbage collected and...
Manages the communication between this process and the worker processes.
[ "Manages", "the", "communication", "between", "this", "process", "and", "the", "worker", "processes", "." ]
def _queue_management_worker(executor_reference, processes, pending_work_items, work_ids_queue, call_queue, result_queue): """Manages the communication between this proces...
[ "def", "_queue_management_worker", "(", "executor_reference", ",", "processes", ",", "pending_work_items", ",", "work_ids_queue", ",", "call_queue", ",", "result_queue", ")", ":", "nb_shutdown_processes", "=", "[", "0", "]", "def", "shutdown_one_process", "(", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/concurrent/futures/process.py#L174-L238
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/mxnet/metric.py
python
CompositeEvalMetric.add
(self, metric)
Add a child metric.
Add a child metric.
[ "Add", "a", "child", "metric", "." ]
def add(self, metric): """Add a child metric.""" self.metrics.append(metric)
[ "def", "add", "(", "self", ",", "metric", ")", ":", "self", ".", "metrics", ".", "append", "(", "metric", ")" ]
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/metric.py#L91-L93
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py
python
Configuration.add_extension
(self,name,sources,**kw)
return ext
Add extension to configuration. Create and add an Extension instance to the ext_modules list. This method also takes the following optional keyword arguments that are passed on to the Extension constructor. Parameters ---------- name : str name of the extens...
Add extension to configuration.
[ "Add", "extension", "to", "configuration", "." ]
def add_extension(self,name,sources,**kw): """Add extension to configuration. Create and add an Extension instance to the ext_modules list. This method also takes the following optional keyword arguments that are passed on to the Extension constructor. Parameters ------...
[ "def", "add_extension", "(", "self", ",", "name", ",", "sources", ",", "*", "*", "kw", ")", ":", "ext_args", "=", "copy", ".", "copy", "(", "kw", ")", "ext_args", "[", "'name'", "]", "=", "dot_join", "(", "self", ".", "name", ",", "name", ")", "e...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py#L1358-L1459
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsmolecule.py
python
LibmintsMolecule.get_coord_value
(self, vstr)
Attempts to interpret a string as a double, if not it assumes it's a variable.
Attempts to interpret a string as a double, if not it assumes it's a variable.
[ "Attempts", "to", "interpret", "a", "string", "as", "a", "double", "if", "not", "it", "assumes", "it", "s", "a", "variable", "." ]
def get_coord_value(self, vstr): """Attempts to interpret a string as a double, if not it assumes it's a variable. """ vstr = vstr.upper() realNumber = re.compile(r"""[-+]?(?:(?:\d*\.\d+)|(?:\d+\.?))(?:[Ee][+-]?\d+)?""", re.VERBOSE) # handle number values if realNumber....
[ "def", "get_coord_value", "(", "self", ",", "vstr", ")", ":", "vstr", "=", "vstr", ".", "upper", "(", ")", "realNumber", "=", "re", ".", "compile", "(", "r\"\"\"[-+]?(?:(?:\\d*\\.\\d+)|(?:\\d+\\.?))(?:[Ee][+-]?\\d+)?\"\"\"", ",", "re", ".", "VERBOSE", ")", "# ha...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L994-L1018
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Irnn.py
python
Irnn.hidden_size
(self)
return self._internal.get_hidden_size()
Gets the hidden layer size.
Gets the hidden layer size.
[ "Gets", "the", "hidden", "layer", "size", "." ]
def hidden_size(self): """Gets the hidden layer size. """ return self._internal.get_hidden_size()
[ "def", "hidden_size", "(", "self", ")", ":", "return", "self", ".", "_internal", ".", "get_hidden_size", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Irnn.py#L92-L95
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/checkpoints.py
python
list_variables
(checkpoint_dir)
return checkpoint_utils.list_variables(checkpoint_dir)
See `tf.contrib.framework.list_variables`.
See `tf.contrib.framework.list_variables`.
[ "See", "tf", ".", "contrib", ".", "framework", ".", "list_variables", "." ]
def list_variables(checkpoint_dir): """See `tf.contrib.framework.list_variables`.""" return checkpoint_utils.list_variables(checkpoint_dir)
[ "def", "list_variables", "(", "checkpoint_dir", ")", ":", "return", "checkpoint_utils", ".", "list_variables", "(", "checkpoint_dir", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/checkpoints.py#L42-L44
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
logical_and
(x1, x2, out=None)
return _ufunc_helper(x1, x2, _npi.logical_and, _np.logical_and, _npi.logical_and_scalar, None, out)
r""" Compute the truth value of x1 AND x2 element-wise. Parameters ---------- x1, x2 : array_like Logical AND is applied to the elements of `x1` and `x2`. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : ...
r""" Compute the truth value of x1 AND x2 element-wise. Parameters ---------- x1, x2 : array_like Logical AND is applied to the elements of `x1` and `x2`. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : ...
[ "r", "Compute", "the", "truth", "value", "of", "x1", "AND", "x2", "element", "-", "wise", ".", "Parameters", "----------", "x1", "x2", ":", "array_like", "Logical", "AND", "is", "applied", "to", "the", "elements", "of", "x1", "and", "x2", ".", "If", "x...
def logical_and(x1, x2, out=None): r""" Compute the truth value of x1 AND x2 element-wise. Parameters ---------- x1, x2 : array_like Logical AND is applied to the elements of `x1` and `x2`. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becom...
[ "def", "logical_and", "(", "x1", ",", "x2", ",", "out", "=", "None", ")", ":", "return", "_ufunc_helper", "(", "x1", ",", "x2", ",", "_npi", ".", "logical_and", ",", "_np", ".", "logical_and", ",", "_npi", ".", "logical_and_scalar", ",", "None", ",", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L6571-L6601
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/dist/commands.py
python
build_apps.expand_path
(self, path, platform)
Substitutes variables in the given path string.
Substitutes variables in the given path string.
[ "Substitutes", "variables", "in", "the", "given", "path", "string", "." ]
def expand_path(self, path, platform): "Substitutes variables in the given path string." if path is None: return None t = string.Template(path) if platform.startswith('win'): return t.substitute(HOME='~', USER_APPDATA='~/AppData/Local') elif platform.sta...
[ "def", "expand_path", "(", "self", ",", "path", ",", "platform", ")", ":", "if", "path", "is", "None", ":", "return", "None", "t", "=", "string", ".", "Template", "(", "path", ")", "if", "platform", ".", "startswith", "(", "'win'", ")", ":", "return"...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/dist/commands.py#L1576-L1588
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/visualization.py
python
customUI
(func)
Tells the next created window/dialog to use a custom UI function. Args: func (function): a 1-argument function that takes a configured Klamp't QtWindow as its argument and returns a QDialog, QMainWindow, or QWidget. (Could also be used with GLUT, but what would you do...
Tells the next created window/dialog to use a custom UI function.
[ "Tells", "the", "next", "created", "window", "/", "dialog", "to", "use", "a", "custom", "UI", "function", "." ]
def customUI(func): """Tells the next created window/dialog to use a custom UI function. Args: func (function): a 1-argument function that takes a configured Klamp't QtWindow as its argument and returns a QDialog, QMainWindow, or QWidget. (Could also be used with ...
[ "def", "customUI", "(", "func", ")", ":", "global", "_globalLock", "_globalLock", ".", "acquire", "(", ")", "_set_custom_ui", "(", "func", ")", "_globalLock", ".", "release", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/visualization.py#L642-L656
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_GenerateMSBuildRuleTargetsFile
(targets_path, msbuild_rules)
Generate the .targets file.
Generate the .targets file.
[ "Generate", "the", ".", "targets", "file", "." ]
def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): """Generate the .targets file.""" content = ['Project', {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' } ] item_group = [ 'ItemGroup', ['PropertyPageSchema', {'Include': '$(M...
[ "def", "_GenerateMSBuildRuleTargetsFile", "(", "targets_path", ",", "msbuild_rules", ")", ":", "content", "=", "[", "'Project'", ",", "{", "'xmlns'", ":", "'http://schemas.microsoft.com/developer/msbuild/2003'", "}", "]", "item_group", "=", "[", "'ItemGroup'", ",", "[...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L2292-L2454
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/FrameDecorator.py
python
SymValueWrapper.symbol
(self)
return self.sym
Return the symbol, or Python text, associated with this symbol, or None
Return the symbol, or Python text, associated with this symbol, or None
[ "Return", "the", "symbol", "or", "Python", "text", "associated", "with", "this", "symbol", "or", "None" ]
def symbol(self): """ Return the symbol, or Python text, associated with this symbol, or None""" return self.sym
[ "def", "symbol", "(", "self", ")", ":", "return", "self", ".", "sym" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/FrameDecorator.py#L217-L220
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTypeCategory.get_formats_access_object
(self)
return self.formatters_access_class (self,self.__class__.GetNumFormats,self.__class__.GetFormatAtIndex,self.__class__.GetFormatForType)
An accessor function that returns an accessor object which allows lazy format access from a lldb.SBTypeCategory object.
An accessor function that returns an accessor object which allows lazy format access from a lldb.SBTypeCategory object.
[ "An", "accessor", "function", "that", "returns", "an", "accessor", "object", "which", "allows", "lazy", "format", "access", "from", "a", "lldb", ".", "SBTypeCategory", "object", "." ]
def get_formats_access_object(self): '''An accessor function that returns an accessor object which allows lazy format access from a lldb.SBTypeCategory object.''' return self.formatters_access_class (self,self.__class__.GetNumFormats,self.__class__.GetFormatAtIndex,self.__class__.GetFormatForType)
[ "def", "get_formats_access_object", "(", "self", ")", ":", "return", "self", ".", "formatters_access_class", "(", "self", ",", "self", ".", "__class__", ".", "GetNumFormats", ",", "self", ".", "__class__", ".", "GetFormatAtIndex", ",", "self", ".", "__class__", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10892-L10894
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py
python
_Printer.PrintFieldValue
(self, field, value)
Print a single field value (not including name). For repeated fields, the value should be a single element. Args: field: The descriptor of the field to be printed. value: The value of the field.
Print a single field value (not including name).
[ "Print", "a", "single", "field", "value", "(", "not", "including", "name", ")", "." ]
def PrintFieldValue(self, field, value): """Print a single field value (not including name). For repeated fields, the value should be a single element. Args: field: The descriptor of the field to be printed. value: The value of the field. """ out = self.out if field.cpp_type == des...
[ "def", "PrintFieldValue", "(", "self", ",", "field", ",", "value", ")", ":", "out", "=", "self", ".", "out", "if", "field", ".", "cpp_type", "==", "descriptor", ".", "FieldDescriptor", ".", "CPPTYPE_MESSAGE", ":", "self", ".", "_PrintMessageFieldValue", "(",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py#L380-L419
rrwick/Porechop
109e437280436d1ec27e5a5b7a34ffb752176390
porechop/misc.py
python
float_to_str
(num, decimals, max_num=0)
return num_str
Converts a number to a string. Will add left padding based on the max value to ensure numbers align well.
Converts a number to a string. Will add left padding based on the max value to ensure numbers align well.
[ "Converts", "a", "number", "to", "a", "string", ".", "Will", "add", "left", "padding", "based", "on", "the", "max", "value", "to", "ensure", "numbers", "align", "well", "." ]
def float_to_str(num, decimals, max_num=0): """ Converts a number to a string. Will add left padding based on the max value to ensure numbers align well. """ if decimals == 0: return int_to_str(int(round(num)), max_num=max_num) if num is None: num_str = 'n/a' else: nu...
[ "def", "float_to_str", "(", "num", ",", "decimals", ",", "max_num", "=", "0", ")", ":", "if", "decimals", "==", "0", ":", "return", "int_to_str", "(", "int", "(", "round", "(", "num", ")", ")", ",", "max_num", "=", "max_num", ")", "if", "num", "is"...
https://github.com/rrwick/Porechop/blob/109e437280436d1ec27e5a5b7a34ffb752176390/porechop/misc.py#L25-L44
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pytree.py
python
Node._eq
(self, other)
return (self.type, self.children) == (other.type, other.children)
Compare two nodes for equality.
Compare two nodes for equality.
[ "Compare", "two", "nodes", "for", "equality", "." ]
def _eq(self, other): """Compare two nodes for equality.""" return (self.type, self.children) == (other.type, other.children)
[ "def", "_eq", "(", "self", ",", "other", ")", ":", "return", "(", "self", ".", "type", ",", "self", ".", "children", ")", "==", "(", "other", ".", "type", ",", "other", ".", "children", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pytree.py#L285-L287
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetMapFileName
(self, config, expand_special)
return map_file
Gets the explicitly overriden map file name for a target or returns None if it's not set.
Gets the explicitly overriden map file name for a target or returns None if it's not set.
[ "Gets", "the", "explicitly", "overriden", "map", "file", "name", "for", "a", "target", "or", "returns", "None", "if", "it", "s", "not", "set", "." ]
def GetMapFileName(self, config, expand_special): """Gets the explicitly overriden map file name for a target or returns None if it's not set.""" config = self._TargetConfig(config) map_file = self._Setting(('VCLinkerTool', 'MapFileName'), config) if map_file: map_file = expand_special(self.Co...
[ "def", "GetMapFileName", "(", "self", ",", "config", ",", "expand_special", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "map_file", "=", "self", ".", "_Setting", "(", "(", "'VCLinkerTool'", ",", "'MapFileName'", ")", ",", "co...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L373-L380
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
python
File.alter_targets
(self)
return self.fs.variant_dir_target_climb(self, self.dir, [self.name])
Return any corresponding targets in a variant directory.
Return any corresponding targets in a variant directory.
[ "Return", "any", "corresponding", "targets", "in", "a", "variant", "directory", "." ]
def alter_targets(self): """Return any corresponding targets in a variant directory. """ if self.is_derived(): return [], None return self.fs.variant_dir_target_climb(self, self.dir, [self.name])
[ "def", "alter_targets", "(", "self", ")", ":", "if", "self", ".", "is_derived", "(", ")", ":", "return", "[", "]", ",", "None", "return", "self", ".", "fs", ".", "variant_dir_target_climb", "(", "self", ",", "self", ".", "dir", ",", "[", "self", ".",...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L3058-L3063
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py
python
bug_summary
(output_dir, bug_counter)
return name
Bug summary is a HTML table to give a better overview of the bugs.
Bug summary is a HTML table to give a better overview of the bugs.
[ "Bug", "summary", "is", "a", "HTML", "table", "to", "give", "a", "better", "overview", "of", "the", "bugs", "." ]
def bug_summary(output_dir, bug_counter): """ Bug summary is a HTML table to give a better overview of the bugs. """ name = os.path.join(output_dir, 'summary.html.fragment') with open(name, 'w') as handle: indent = 4 handle.write(reindent(""" |<h2>Bug Summary</h2> |<table> ...
[ "def", "bug_summary", "(", "output_dir", ",", "bug_counter", ")", ":", "name", "=", "os", ".", "path", ".", "join", "(", "output_dir", ",", "'summary.html.fragment'", ")", "with", "open", "(", "name", ",", "'w'", ")", "as", "handle", ":", "indent", "=", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py#L149-L198
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
plant-lighting-system/python/iot_plant_lighting_system/runner.py
python
Runner.serve_css
(self)
return static_file(resource_path, root=package_root)
Serve the 'styles.css' file.
Serve the 'styles.css' file.
[ "Serve", "the", "styles", ".", "css", "file", "." ]
def serve_css(self): """ Serve the 'styles.css' file. """ resource_package = __name__ resource_path = "styles.css" package_root = resource_filename(resource_package, "") return static_file(resource_path, root=package_root)
[ "def", "serve_css", "(", "self", ")", ":", "resource_package", "=", "__name__", "resource_path", "=", "\"styles.css\"", "package_root", "=", "resource_filename", "(", "resource_package", ",", "\"\"", ")", "return", "static_file", "(", "resource_path", ",", "root", ...
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/plant-lighting-system/python/iot_plant_lighting_system/runner.py#L161-L170
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect.GetY
(*args, **kwargs)
return _core_.Rect_GetY(*args, **kwargs)
GetY(self) -> int
GetY(self) -> int
[ "GetY", "(", "self", ")", "-", ">", "int" ]
def GetY(*args, **kwargs): """GetY(self) -> int""" return _core_.Rect_GetY(*args, **kwargs)
[ "def", "GetY", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_GetY", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1277-L1279
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
library/python/workbench/os_utils.py
python
FileUtils.create_directory
(self, path)
Function Type : Success
Function Type : Success
[ "Function", "Type", ":", "Success" ]
def create_directory(self, path): """ Function Type : Success """ try: os.mkdir(path) except (IOError, OSError) as err: if err.errno == errno.EACCES: raise PermissionDeniedError("Could not create directory %s" % path) raise
[ "def", "create_directory", "(", "self", ",", "path", ")", ":", "try", ":", "os", ".", "mkdir", "(", "path", ")", "except", "(", "IOError", ",", "OSError", ")", "as", "err", ":", "if", "err", ".", "errno", "==", "errno", ".", "EACCES", ":", "raise",...
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/library/python/workbench/os_utils.py#L131-L140
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/cygwinccompiler.py
python
check_config_h
()
Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good ...
Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good ...
[ "Check", "if", "the", "current", "Python", "installation", "(", "specifically", "pyconfig", ".", "h", ")", "appears", "amenable", "to", "building", "extensions", "with", "GCC", ".", "Returns", "a", "tuple", "(", "status", "details", ")", "where", "status", "...
def check_config_h(): """Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOT...
[ "def", "check_config_h", "(", ")", ":", "# XXX since this function also checks sys.version, it's not strictly a", "# \"pyconfig.h\" check -- should probably be renamed...", "from", "distutils", "import", "sysconfig", "import", "string", "# if sys.version contains GCC then python was compil...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/cygwinccompiler.py#L384-L433
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-utils/modtool/cli/makeyaml.py
python
get_pattern
(self)
Get the regex pattern for block(s) to be parsed
Get the regex pattern for block(s) to be parsed
[ "Get", "the", "regex", "pattern", "for", "block", "(", "s", ")", "to", "be", "parsed" ]
def get_pattern(self): """ Get the regex pattern for block(s) to be parsed """ if self.info['pattern'] is None: block_candidates = get_block_candidates() with SequenceCompleter(block_candidates): self.info['pattern'] = cli_input( 'Which blocks do you want to parse? (R...
[ "def", "get_pattern", "(", "self", ")", ":", "if", "self", ".", "info", "[", "'pattern'", "]", "is", "None", ":", "block_candidates", "=", "get_block_candidates", "(", ")", "with", "SequenceCompleter", "(", "block_candidates", ")", ":", "self", ".", "info", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/cli/makeyaml.py#L65-L73
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/receptive_field/python/util/graph_compute_order.py
python
parse_graph_nodes
(graph_def)
return name_to_node
Helper function to parse GraphDef's nodes. It returns a dict mapping from node name to NodeDef. Args: graph_def: A GraphDef object. Returns: name_to_node: Dict keyed by node name, each entry containing the node's NodeDef.
Helper function to parse GraphDef's nodes.
[ "Helper", "function", "to", "parse", "GraphDef", "s", "nodes", "." ]
def parse_graph_nodes(graph_def): """Helper function to parse GraphDef's nodes. It returns a dict mapping from node name to NodeDef. Args: graph_def: A GraphDef object. Returns: name_to_node: Dict keyed by node name, each entry containing the node's NodeDef. """ name_to_node = {} for node...
[ "def", "parse_graph_nodes", "(", "graph_def", ")", ":", "name_to_node", "=", "{", "}", "for", "node_def", "in", "graph_def", ".", "node", ":", "name_to_node", "[", "node_def", ".", "name", "]", "=", "node_def", "return", "name_to_node" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/receptive_field/python/util/graph_compute_order.py#L28-L43
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings._GetAdditionalManifestFiles
(self, config, gyp_to_build_path)
return [os.path.normpath( gyp_to_build_path(self.ConvertVSMacros(f, config=config))) for f in files]
Gets additional manifest files that are added to the default one generated by the linker.
Gets additional manifest files that are added to the default one generated by the linker.
[ "Gets", "additional", "manifest", "files", "that", "are", "added", "to", "the", "default", "one", "generated", "by", "the", "linker", "." ]
def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): """Gets additional manifest files that are added to the default one generated by the linker.""" files = self._Setting(('VCManifestTool', 'AdditionalManifestFiles'), config, default=[]) if (self._Setting( ...
[ "def", "_GetAdditionalManifestFiles", "(", "self", ",", "config", ",", "gyp_to_build_path", ")", ":", "files", "=", "self", ".", "_Setting", "(", "(", "'VCManifestTool'", ",", "'AdditionalManifestFiles'", ")", ",", "config", ",", "default", "=", "[", "]", ")",...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/msvs_emulation.py#L452-L464
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/distributions/python/ops/bijectors/affine_impl.py
python
_as_tensor
(x, name)
return None if x is None else ops.convert_to_tensor(x, name=name)
Convenience to convert to `Tensor` or leave as `None`.
Convenience to convert to `Tensor` or leave as `None`.
[ "Convenience", "to", "convert", "to", "Tensor", "or", "leave", "as", "None", "." ]
def _as_tensor(x, name): """Convenience to convert to `Tensor` or leave as `None`.""" return None if x is None else ops.convert_to_tensor(x, name=name)
[ "def", "_as_tensor", "(", "x", ",", "name", ")", ":", "return", "None", "if", "x", "is", "None", "else", "ops", ".", "convert_to_tensor", "(", "x", ",", "name", "=", "name", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/bijectors/affine_impl.py#L42-L44
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/internal.py
python
Manager.getFont
(self,name)
B{pending deprecation} Returns a GuiFont identified by its name. @param name: A string identifier from the font definitions in pychans config files.
B{pending deprecation}
[ "B", "{", "pending", "deprecation", "}" ]
def getFont(self,name): """ B{pending deprecation} Returns a GuiFont identified by its name. @param name: A string identifier from the font definitions in pychans config files. """ if in_fife: font = self.fonts.get(name) if isinstance(font,fife.GuiFont): return font if hasattr(font,"font") an...
[ "def", "getFont", "(", "self", ",", "name", ")", ":", "if", "in_fife", ":", "font", "=", "self", ".", "fonts", ".", "get", "(", "name", ")", "if", "isinstance", "(", "font", ",", "fife", ".", "GuiFont", ")", ":", "return", "font", "if", "hasattr", ...
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/internal.py#L154-L170
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
Conv1DLSTMCell.__init__
(self, name="conv_1d_lstm_cell", **kwargs)
Construct Conv1DLSTM. See `ConvLSTMCell` for more details.
Construct Conv1DLSTM. See `ConvLSTMCell` for more details.
[ "Construct", "Conv1DLSTM", ".", "See", "ConvLSTMCell", "for", "more", "details", "." ]
def __init__(self, name="conv_1d_lstm_cell", **kwargs): """Construct Conv1DLSTM. See `ConvLSTMCell` for more details.""" super(Conv1DLSTMCell, self).__init__(conv_ndims=1, name=name, **kwargs)
[ "def", "__init__", "(", "self", ",", "name", "=", "\"conv_1d_lstm_cell\"", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Conv1DLSTMCell", ",", "self", ")", ".", "__init__", "(", "conv_ndims", "=", "1", ",", "name", "=", "name", ",", "*", "*", "kw...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L2157-L2159
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Compiler/UtilityCode.py
python
CythonUtilityCode.declare_in_scope
(self, dest_scope, used=False, cython_scope=None, whitelist=None)
return original_scope
Declare all entries from the utility code in dest_scope. Code will only be included for used entries. If module_name is given, declare the type entries with that name.
Declare all entries from the utility code in dest_scope. Code will only be included for used entries. If module_name is given, declare the type entries with that name.
[ "Declare", "all", "entries", "from", "the", "utility", "code", "in", "dest_scope", ".", "Code", "will", "only", "be", "included", "for", "used", "entries", ".", "If", "module_name", "is", "given", "declare", "the", "type", "entries", "with", "that", "name", ...
def declare_in_scope(self, dest_scope, used=False, cython_scope=None, whitelist=None): """ Declare all entries from the utility code in dest_scope. Code will only be included for used entries. If module_name is given, declare the type entries with that name. ...
[ "def", "declare_in_scope", "(", "self", ",", "dest_scope", ",", "used", "=", "False", ",", "cython_scope", "=", "None", ",", "whitelist", "=", "None", ")", ":", "tree", "=", "self", ".", "get_tree", "(", "entries_only", "=", "True", ",", "cython_scope", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/UtilityCode.py#L201-L228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/xrc.py
python
XmlNode.AddAttribute
(*args)
return _xrc.XmlNode_AddAttribute(*args)
AddAttribute(self, wxXmlAttribute attr) AddAttribute(self, String attrName, String value)
AddAttribute(self, wxXmlAttribute attr) AddAttribute(self, String attrName, String value)
[ "AddAttribute", "(", "self", "wxXmlAttribute", "attr", ")", "AddAttribute", "(", "self", "String", "attrName", "String", "value", ")" ]
def AddAttribute(*args): """ AddAttribute(self, wxXmlAttribute attr) AddAttribute(self, String attrName, String value) """ return _xrc.XmlNode_AddAttribute(*args)
[ "def", "AddAttribute", "(", "*", "args", ")", ":", "return", "_xrc", ".", "XmlNode_AddAttribute", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L474-L479
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/cef_parser.py
python
str_to_dict
(str)
return dict
Convert a string to a dictionary. If the same key has multiple values the values will be stored in a list.
Convert a string to a dictionary. If the same key has multiple values the values will be stored in a list.
[ "Convert", "a", "string", "to", "a", "dictionary", ".", "If", "the", "same", "key", "has", "multiple", "values", "the", "values", "will", "be", "stored", "in", "a", "list", "." ]
def str_to_dict(str): """ Convert a string to a dictionary. If the same key has multiple values the values will be stored in a list. """ dict = {} parts = str.split(',') for part in parts: part = part.strip() if len(part) == 0: continue sparts = part.split('=') if len(sparts) > 2: ...
[ "def", "str_to_dict", "(", "str", ")", ":", "dict", "=", "{", "}", "parts", "=", "str", ".", "split", "(", "','", ")", "for", "part", "in", "parts", ":", "part", "=", "part", ".", "strip", "(", ")", "if", "len", "(", "part", ")", "==", "0", "...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L304-L330
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
tools/buildgen/plugins/expand_version.py
python
mako_plugin
(dictionary)
Expand version numbers: - for each language, ensure there's a language_version tag in settings (defaulting to the master version tag) - expand version strings to major, minor, patch, and tag
Expand version numbers: - for each language, ensure there's a language_version tag in settings (defaulting to the master version tag) - expand version strings to major, minor, patch, and tag
[ "Expand", "version", "numbers", ":", "-", "for", "each", "language", "ensure", "there", "s", "a", "language_version", "tag", "in", "settings", "(", "defaulting", "to", "the", "master", "version", "tag", ")", "-", "expand", "version", "strings", "to", "major"...
def mako_plugin(dictionary): """Expand version numbers: - for each language, ensure there's a language_version tag in settings (defaulting to the master version tag) - expand version strings to major, minor, patch, and tag """ settings = dictionary['settings'] version_str = settings['ver...
[ "def", "mako_plugin", "(", "dictionary", ")", ":", "settings", "=", "dictionary", "[", "'settings'", "]", "version_str", "=", "settings", "[", "'version'", "]", "master_version", "=", "Version", "(", "version_str", ")", "settings", "[", "'version'", "]", "=", ...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/tools/buildgen/plugins/expand_version.py#L110-L131
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py
python
ByteProcessor.fit
(self, x)
Does nothing. No fitting required.
Does nothing. No fitting required.
[ "Does", "nothing", ".", "No", "fitting", "required", "." ]
def fit(self, x): """Does nothing. No fitting required.""" pass
[ "def", "fit", "(", "self", ",", "x", ")", ":", "pass" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py#L60-L62
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateTime.MakeGMT
(*args, **kwargs)
return _misc_.DateTime_MakeGMT(*args, **kwargs)
MakeGMT(self, bool noDST=False) -> DateTime
MakeGMT(self, bool noDST=False) -> DateTime
[ "MakeGMT", "(", "self", "bool", "noDST", "=", "False", ")", "-", ">", "DateTime" ]
def MakeGMT(*args, **kwargs): """MakeGMT(self, bool noDST=False) -> DateTime""" return _misc_.DateTime_MakeGMT(*args, **kwargs)
[ "def", "MakeGMT", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_MakeGMT", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3950-L3952
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/mozjs-45/extract/js/src/jit/arm/gen-double-encoder-table.py
python
encodeDouble
(value)
return (a << 31) | (B << 30) | (rep(b, 8) << 22) | cdefgh << 16
Generate an ARM ARM 'VFP modified immediate constant' with format: aBbbbbbb bbcdefgh 000... We will return the top 32 bits of the double; the rest are 0.
Generate an ARM ARM 'VFP modified immediate constant' with format: aBbbbbbb bbcdefgh 000...
[ "Generate", "an", "ARM", "ARM", "VFP", "modified", "immediate", "constant", "with", "format", ":", "aBbbbbbb", "bbcdefgh", "000", "..." ]
def encodeDouble(value): """Generate an ARM ARM 'VFP modified immediate constant' with format: aBbbbbbb bbcdefgh 000... We will return the top 32 bits of the double; the rest are 0.""" assert (0 <= value) and (value <= 255) a = value >> 7 b = (value >> 6) & 1 B = int(b == 0) cdefgh = va...
[ "def", "encodeDouble", "(", "value", ")", ":", "assert", "(", "0", "<=", "value", ")", "and", "(", "value", "<=", "255", ")", "a", "=", "value", ">>", "7", "b", "=", "(", "value", ">>", "6", ")", "&", "1", "B", "=", "int", "(", "b", "==", "...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/mozjs-45/extract/js/src/jit/arm/gen-double-encoder-table.py#L18-L28
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reducer.py
python
ISISReducer.step_num
(self, step)
return self._reduction_steps.index(step)
Returns the index number of a step in the list of steps that have _so_ _far_ been added to the chain
Returns the index number of a step in the list of steps that have _so_ _far_ been added to the chain
[ "Returns", "the", "index", "number", "of", "a", "step", "in", "the", "list", "of", "steps", "that", "have", "_so_", "_far_", "been", "added", "to", "the", "chain" ]
def step_num(self, step): """ Returns the index number of a step in the list of steps that have _so_ _far_ been added to the chain """ return self._reduction_steps.index(step)
[ "def", "step_num", "(", "self", ",", "step", ")", ":", "return", "self", ".", "_reduction_steps", ".", "index", "(", "step", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reducer.py#L676-L682
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Executor.py
python
get_NullEnvironment
()
return nullenv
Use singleton pattern for Null Environments.
Use singleton pattern for Null Environments.
[ "Use", "singleton", "pattern", "for", "Null", "Environments", "." ]
def get_NullEnvironment(): """Use singleton pattern for Null Environments.""" global nullenv if nullenv is None: nullenv = NullEnvironment() return nullenv
[ "def", "get_NullEnvironment", "(", ")", ":", "global", "nullenv", "if", "nullenv", "is", "None", ":", "nullenv", "=", "NullEnvironment", "(", ")", "return", "nullenv" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Executor.py#L582-L588
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py
python
Fraction._div
(a, b)
return Fraction(a.numerator * b.denominator, a.denominator * b.numerator)
a / b
a / b
[ "a", "/", "b" ]
def _div(a, b): """a / b""" return Fraction(a.numerator * b.denominator, a.denominator * b.numerator)
[ "def", "_div", "(", "a", ",", "b", ")", ":", "return", "Fraction", "(", "a", ".", "numerator", "*", "b", ".", "denominator", ",", "a", ".", "denominator", "*", "b", ".", "numerator", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py#L409-L412
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/util/resource_utils.py
python
ExtractBinaryManifestValues
(aapt2_path, apk_path)
return version_code, version_name, package_name
Returns (version_code, version_name, package_name) for the given apk.
Returns (version_code, version_name, package_name) for the given apk.
[ "Returns", "(", "version_code", "version_name", "package_name", ")", "for", "the", "given", "apk", "." ]
def ExtractBinaryManifestValues(aapt2_path, apk_path): """Returns (version_code, version_name, package_name) for the given apk.""" output = subprocess.check_output([ aapt2_path, 'dump', 'xmltree', apk_path, '--file', 'AndroidManifest.xml' ]).decode('utf-8') version_code = re.search(r'versionCode.*?=(\d*)'...
[ "def", "ExtractBinaryManifestValues", "(", "aapt2_path", ",", "apk_path", ")", ":", "output", "=", "subprocess", ".", "check_output", "(", "[", "aapt2_path", ",", "'dump'", ",", "'xmltree'", ",", "apk_path", ",", "'--file'", ",", "'AndroidManifest.xml'", "]", ")...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/util/resource_utils.py#L791-L799
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py
python
AssumeRoleProvider.__init__
(self, load_config, client_creator, cache, profile_name, prompter=getpass.getpass, credential_sourcer=None, profile_provider_builder=None)
:type load_config: callable :param load_config: A function that accepts no arguments, and when called, will return the full configuration dictionary for the session (``session.full_config``). :type client_creator: callable :param client_creator: A factory function that w...
:type load_config: callable :param load_config: A function that accepts no arguments, and when called, will return the full configuration dictionary for the session (``session.full_config``).
[ ":", "type", "load_config", ":", "callable", ":", "param", "load_config", ":", "A", "function", "that", "accepts", "no", "arguments", "and", "when", "called", "will", "return", "the", "full", "configuration", "dictionary", "for", "the", "session", "(", "sessio...
def __init__(self, load_config, client_creator, cache, profile_name, prompter=getpass.getpass, credential_sourcer=None, profile_provider_builder=None): """ :type load_config: callable :param load_config: A function that accepts no arguments, and when...
[ "def", "__init__", "(", "self", ",", "load_config", ",", "client_creator", ",", "cache", ",", "profile_name", ",", "prompter", "=", "getpass", ".", "getpass", ",", "credential_sourcer", "=", "None", ",", "profile_provider_builder", "=", "None", ")", ":", "#: T...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py#L1321-L1374
microsoft/clang
86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5
tools/scan-build-py/libscanbuild/arguments.py
python
create_intercept_parser
()
return parser
Creates a parser for command-line arguments to 'intercept'.
Creates a parser for command-line arguments to 'intercept'.
[ "Creates", "a", "parser", "for", "command", "-", "line", "arguments", "to", "intercept", "." ]
def create_intercept_parser(): """ Creates a parser for command-line arguments to 'intercept'. """ parser = create_default_parser() parser_add_cdb(parser) parser_add_prefer_wrapper(parser) parser_add_compilers(parser) advanced = parser.add_argument_group('advanced options') group = advanc...
[ "def", "create_intercept_parser", "(", ")", ":", "parser", "=", "create_default_parser", "(", ")", "parser_add_cdb", "(", "parser", ")", "parser_add_prefer_wrapper", "(", "parser", ")", "parser_add_compilers", "(", "parser", ")", "advanced", "=", "parser", ".", "a...
https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/tools/scan-build-py/libscanbuild/arguments.py#L143-L164
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/quopri.py
python
quote
(c)
return ESCAPE + HEX[i//16] + HEX[i%16]
Quote a single character.
Quote a single character.
[ "Quote", "a", "single", "character", "." ]
def quote(c): """Quote a single character.""" i = ord(c) return ESCAPE + HEX[i//16] + HEX[i%16]
[ "def", "quote", "(", "c", ")", ":", "i", "=", "ord", "(", "c", ")", "return", "ESCAPE", "+", "HEX", "[", "i", "//", "16", "]", "+", "HEX", "[", "i", "%", "16", "]" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/quopri.py#L35-L38
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGProperty.SetFlagRecursively
(*args, **kwargs)
return _propgrid.PGProperty_SetFlagRecursively(*args, **kwargs)
SetFlagRecursively(self, int flag, bool set)
SetFlagRecursively(self, int flag, bool set)
[ "SetFlagRecursively", "(", "self", "int", "flag", "bool", "set", ")" ]
def SetFlagRecursively(*args, **kwargs): """SetFlagRecursively(self, int flag, bool set)""" return _propgrid.PGProperty_SetFlagRecursively(*args, **kwargs)
[ "def", "SetFlagRecursively", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetFlagRecursively", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L743-L745
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/libdeps/libdeps/analyzer.py
python
InDegreeOne.run
(self)
return sorted(in_degree_one_nodes)
Search the graph for in degree 1 or 0 nodes.
Search the graph for in degree 1 or 0 nodes.
[ "Search", "the", "graph", "for", "in", "degree", "1", "or", "0", "nodes", "." ]
def run(self): """Search the graph for in degree 1 or 0 nodes.""" in_degree_one_nodes = [] for node, data in self._dependency_graph.nodes(data=True): if (len(self._dependents_graph[node]) < 2 and data[NodeProps.bin_type.name] == 'SharedLibrary'): ...
[ "def", "run", "(", "self", ")", ":", "in_degree_one_nodes", "=", "[", "]", "for", "node", ",", "data", "in", "self", ".", "_dependency_graph", ".", "nodes", "(", "data", "=", "True", ")", ":", "if", "(", "len", "(", "self", ".", "_dependents_graph", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/libdeps/libdeps/analyzer.py#L473-L488
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListHeaderData.SetText
(self, text)
Sets the header/footer item text. :param `text`: the new header/footer text.
Sets the header/footer item text.
[ "Sets", "the", "header", "/", "footer", "item", "text", "." ]
def SetText(self, text): """ Sets the header/footer item text. :param `text`: the new header/footer text. """ self._text = text
[ "def", "SetText", "(", "self", ",", "text", ")", ":", "self", ".", "_text", "=", "text" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L3233-L3240
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow2/load.py
python
TF2Loader._populate_sub_graph_input_shapes
(self, graph, graph_fns)
return sg_input_shapes
Populate function (sub-graph) input shapes from control flow op's inputs Note that the functions (sub-graphs) are not nested but the control flow ops are nested. The input shapes are used to extract sub-graphs from the parent graph (as the input of function_def_to_graph). Parameter ...
Populate function (sub-graph) input shapes from control flow op's inputs Note that the functions (sub-graphs) are not nested but the control flow ops are nested. The input shapes are used to extract sub-graphs from the parent graph (as the input of function_def_to_graph).
[ "Populate", "function", "(", "sub", "-", "graph", ")", "input", "shapes", "from", "control", "flow", "op", "s", "inputs", "Note", "that", "the", "functions", "(", "sub", "-", "graphs", ")", "are", "not", "nested", "but", "the", "control", "flow", "ops", ...
def _populate_sub_graph_input_shapes(self, graph, graph_fns): """ Populate function (sub-graph) input shapes from control flow op's inputs Note that the functions (sub-graphs) are not nested but the control flow ops are nested. The input shapes are used to extract sub-graphs from the ...
[ "def", "_populate_sub_graph_input_shapes", "(", "self", ",", "graph", ",", "graph_fns", ")", ":", "sg_input_shapes", "=", "{", "}", "sub_graphs", "=", "[", "]", "for", "op", "in", "graph", ".", "get_operations", "(", ")", ":", "if", "op", ".", "type", "n...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow2/load.py#L183-L231
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py
python
FunctionEvaluator.__call__
(self, *values)
return eval(statement, globals(), locals)
Evaluates the expansion of a #define macro function called with the specified values.
Evaluates the expansion of a #define macro function called with the specified values.
[ "Evaluates", "the", "expansion", "of", "a", "#define", "macro", "function", "called", "with", "the", "specified", "values", "." ]
def __call__(self, *values): """ Evaluates the expansion of a #define macro function called with the specified values. """ if len(self.args) != len(values): raise ValueError("Incorrect number of arguments to `%s'" % self.name) # Create a dictionary that maps t...
[ "def", "__call__", "(", "self", ",", "*", "values", ")", ":", "if", "len", "(", "self", ".", "args", ")", "!=", "len", "(", "values", ")", ":", "raise", "ValueError", "(", "\"Incorrect number of arguments to `%s'\"", "%", "self", ".", "name", ")", "# Cre...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py#L194-L216
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/pylib/utils/emulator.py
python
KillAllEmulators
()
Kill all running emulators that look like ones we started. There are odd 'sticky' cases where there can be no emulator process running but a device slot is taken. A little bot trouble and we're out of room forever.
Kill all running emulators that look like ones we started.
[ "Kill", "all", "running", "emulators", "that", "look", "like", "ones", "we", "started", "." ]
def KillAllEmulators(): """Kill all running emulators that look like ones we started. There are odd 'sticky' cases where there can be no emulator process running but a device slot is taken. A little bot trouble and we're out of room forever. """ logging.info('Killing all existing emulators and existing th...
[ "def", "KillAllEmulators", "(", ")", ":", "logging", ".", "info", "(", "'Killing all existing emulators and existing the program'", ")", "emulators", "=", "[", "device_utils", ".", "DeviceUtils", "(", "a", ")", "for", "a", "in", "adb_wrapper", ".", "AdbWrapper", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/utils/emulator.py#L117-L136
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/_generate_pyx.py
python
double_complex_from_npy_cdouble
(var)
return res
Cast a numpy cdouble to a cython double complex.
Cast a numpy cdouble to a cython double complex.
[ "Cast", "a", "numpy", "cdouble", "to", "a", "cython", "double", "complex", "." ]
def double_complex_from_npy_cdouble(var): """Cast a numpy cdouble to a cython double complex.""" res = "_complexstuff.double_complex_from_npy_cdouble({})".format(var) return res
[ "def", "double_complex_from_npy_cdouble", "(", "var", ")", ":", "res", "=", "\"_complexstuff.double_complex_from_npy_cdouble({})\"", ".", "format", "(", "var", ")", "return", "res" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/_generate_pyx.py#L455-L458
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_ninja.py
python
_WriteWorkspace
(main_gyp, sources_gyp, params)
Create a workspace to wrap main and sources gyp paths.
Create a workspace to wrap main and sources gyp paths.
[ "Create", "a", "workspace", "to", "wrap", "main", "and", "sources", "gyp", "paths", "." ]
def _WriteWorkspace(main_gyp, sources_gyp, params): """ Create a workspace to wrap main and sources gyp paths. """ (build_file_root, build_file_ext) = os.path.splitext(main_gyp) workspace_path = build_file_root + '.xcworkspace' options = params['options'] if options.generator_output: workspace_path = os.p...
[ "def", "_WriteWorkspace", "(", "main_gyp", ",", "sources_gyp", ",", "params", ")", ":", "(", "build_file_root", ",", "build_file_ext", ")", "=", "os", ".", "path", ".", "splitext", "(", "main_gyp", ")", "workspace_path", "=", "build_file_root", "+", "'.xcworks...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_ninja.py#L22-L54
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/ansic/cparse.py
python
p_direct_declarator_4
(t)
direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN
direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN
[ "direct_declarator", ":", "direct_declarator", "LPAREN", "parameter_type_list", "RPAREN" ]
def p_direct_declarator_4(t): 'direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN ' pass
[ "def", "p_direct_declarator_4", "(", "t", ")", ":", "pass" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L285-L287
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
cpplint.py
python
CheckStyle
(filename, clean_lines, linenum, file_extension, error)
Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc. Args: filename: The name of the current file. clean_line...
Checks rules from the 'C++ style rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "style", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckStyle(filename, clean_lines, linenum, file_extension, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside co...
[ "def", "CheckStyle", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "error", ")", ":", "raw_lines", "=", "clean_lines", ".", "raw_lines", "line", "=", "raw_lines", "[", "linenum", "]", "if", "line", ".", "find", "(", "'\\t...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L2022-L2115
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/ops.py
python
decode_jpeg
(x, mode='unchanged', name=None)
return out
Decodes a JPEG image into a 3 dimensional RGB Tensor or 1 dimensional Gray Tensor. Optionally converts the image to the desired format. The values of the output tensor are uint8 between 0 and 255. Args: x (Tensor): A one dimensional uint8 tensor containing the raw bytes of the JPEG i...
Decodes a JPEG image into a 3 dimensional RGB Tensor or 1 dimensional Gray Tensor. Optionally converts the image to the desired format. The values of the output tensor are uint8 between 0 and 255.
[ "Decodes", "a", "JPEG", "image", "into", "a", "3", "dimensional", "RGB", "Tensor", "or", "1", "dimensional", "Gray", "Tensor", ".", "Optionally", "converts", "the", "image", "to", "the", "desired", "format", ".", "The", "values", "of", "the", "output", "te...
def decode_jpeg(x, mode='unchanged', name=None): """ Decodes a JPEG image into a 3 dimensional RGB Tensor or 1 dimensional Gray Tensor. Optionally converts the image to the desired format. The values of the output tensor are uint8 between 0 and 255. Args: x (Tensor): A one dimensional uin...
[ "def", "decode_jpeg", "(", "x", ",", "mode", "=", "'unchanged'", ",", "name", "=", "None", ")", ":", "if", "in_dygraph_mode", "(", ")", ":", "return", "_C_ops", ".", "decode_jpeg", "(", "x", ",", "\"mode\"", ",", "mode", ")", "inputs", "=", "{", "'X'...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/ops.py#L864-L908
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsbasisset.py
python
BasisSet.allclose
(self, other, atol: float=1.e-8, verbose: int=1)
return False
Equality test. Sorts the coefficients so handles different shell orderings. Print any failed exp/coeff differences if verbose > 1.
Equality test. Sorts the coefficients so handles different shell orderings. Print any failed exp/coeff differences if verbose > 1.
[ "Equality", "test", ".", "Sorts", "the", "coefficients", "so", "handles", "different", "shell", "orderings", ".", "Print", "any", "failed", "exp", "/", "coeff", "differences", "if", "verbose", ">", "1", "." ]
def allclose(self, other, atol: float=1.e-8, verbose: int=1): """Equality test. Sorts the coefficients so handles different shell orderings. Print any failed exp/coeff differences if verbose > 1.""" sc, se = (list(t) for t in zip(*sorted(zip(self.uoriginal_coefficients, self.uexponents)))) oc, o...
[ "def", "allclose", "(", "self", ",", "other", ",", "atol", ":", "float", "=", "1.e-8", ",", "verbose", ":", "int", "=", "1", ")", ":", "sc", ",", "se", "=", "(", "list", "(", "t", ")", "for", "t", "in", "zip", "(", "*", "sorted", "(", "zip", ...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsbasisset.py#L170-L191
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/cmd.py
python
Command.announce
(self, msg, level=1)
If the current verbosity level is of greater than or equal to 'level' print 'msg' to stdout.
If the current verbosity level is of greater than or equal to 'level' print 'msg' to stdout.
[ "If", "the", "current", "verbosity", "level", "is", "of", "greater", "than", "or", "equal", "to", "level", "print", "msg", "to", "stdout", "." ]
def announce(self, msg, level=1): """If the current verbosity level is of greater than or equal to 'level' print 'msg' to stdout. """ log.log(level, msg)
[ "def", "announce", "(", "self", ",", "msg", ",", "level", "=", "1", ")", ":", "log", ".", "log", "(", "level", ",", "msg", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/cmd.py#L180-L184
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/difflib.py
python
HtmlDiff.make_file
(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5)
return self._file_template % dict( styles = self._styles, legend = self._legend, table = self.make_table(fromlines,tolines,fromdesc,todesc, context=context,numlines=numlines))
Returns HTML file of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file column header string todesc -- "to" file column header string context -- set to True for contextual diff...
Returns HTML file of side by side comparison with change highlights
[ "Returns", "HTML", "file", "of", "side", "by", "side", "comparison", "with", "change", "highlights" ]
def make_file(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5): """Returns HTML file of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file colu...
[ "def", "make_file", "(", "self", ",", "fromlines", ",", "tolines", ",", "fromdesc", "=", "''", ",", "todesc", "=", "''", ",", "context", "=", "False", ",", "numlines", "=", "5", ")", ":", "return", "self", ".", "_file_template", "%", "dict", "(", "st...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/difflib.py#L1676-L1698
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGrid.ChangePropertyValue
(*args, **kwargs)
return _propgrid.PropertyGrid_ChangePropertyValue(*args, **kwargs)
ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool
ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool
[ "ChangePropertyValue", "(", "self", "PGPropArg", "id", "wxVariant", "newValue", ")", "-", ">", "bool" ]
def ChangePropertyValue(*args, **kwargs): """ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool""" return _propgrid.PropertyGrid_ChangePropertyValue(*args, **kwargs)
[ "def", "ChangePropertyValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_ChangePropertyValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1995-L1997
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
GLGenerator.WritePepperGLES2Implementation
(self, filename)
Writes the Pepper OpenGLES interface implementation.
Writes the Pepper OpenGLES interface implementation.
[ "Writes", "the", "Pepper", "OpenGLES", "interface", "implementation", "." ]
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation.""" file = CWriter(filename) file.Write(_LICENSE) file.Write(_DO_NOT_EDIT_WARNING) file.Write("#include \"ppapi/shared_impl/ppb_opengles2_shared.h\"\n\n") file.Write("#include \"base/logg...
[ "def", "WritePepperGLES2Implementation", "(", "self", ",", "filename", ")", ":", "file", "=", "CWriter", "(", "filename", ")", "file", ".", "Write", "(", "_LICENSE", ")", "file", ".", "Write", "(", "_DO_NOT_EDIT_WARNING", ")", "file", ".", "Write", "(", "\...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6021-L6082
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py
python
KernelCenterer.transform
(self, K, y=None, copy=True)
return K
Center kernel matrix. Parameters ---------- K : numpy array of shape [n_samples1, n_samples2] Kernel matrix. copy : boolean, optional, default True Set to False to perform inplace computation. Returns ------- K_new : numpy array of shape...
Center kernel matrix.
[ "Center", "kernel", "matrix", "." ]
def transform(self, K, y=None, copy=True): """Center kernel matrix. Parameters ---------- K : numpy array of shape [n_samples1, n_samples2] Kernel matrix. copy : boolean, optional, default True Set to False to perform inplace computation. Return...
[ "def", "transform", "(", "self", ",", "K", ",", "y", "=", "None", ",", "copy", "=", "True", ")", ":", "check_is_fitted", "(", "self", ",", "'K_fit_all_'", ")", "K", "=", "check_array", "(", "K", ",", "copy", "=", "copy", ",", "dtype", "=", "FLOAT_D...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py#L1584-L1610
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/configure.py
python
B
(value)
return 1 if value else 0
Returns 1 if value is truthy, 0 otherwise.
Returns 1 if value is truthy, 0 otherwise.
[ "Returns", "1", "if", "value", "is", "truthy", "0", "otherwise", "." ]
def B(value): """Returns 1 if value is truthy, 0 otherwise.""" return 1 if value else 0
[ "def", "B", "(", "value", ")", ":", "return", "1", "if", "value", "else", "0" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/configure.py#L848-L850
KhronosGroup/Vulkan-Headers
b32da5329b50e3cb96229aaecba9ded032fe29cc
registry/conventions.py
python
ProseListFormats.quantifier
(self, n)
return ''
Return the desired quantifier for a list of a given length.
Return the desired quantifier for a list of a given length.
[ "Return", "the", "desired", "quantifier", "for", "a", "list", "of", "a", "given", "length", "." ]
def quantifier(self, n): """Return the desired quantifier for a list of a given length.""" if self == ProseListFormats.ANY_OR: if n > 1: return 'any of ' elif self == ProseListFormats.EACH_AND: if n > 2: return 'each of ' if n =...
[ "def", "quantifier", "(", "self", ",", "n", ")", ":", "if", "self", "==", "ProseListFormats", ".", "ANY_OR", ":", "if", "n", ">", "1", ":", "return", "'any of '", "elif", "self", "==", "ProseListFormats", ".", "EACH_AND", ":", "if", "n", ">", "2", ":...
https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/conventions.py#L53-L63
sccn/lsl_archived
2ff44b7a5172b02fe845b1fc72b9ab5578a489ed
LSL/liblsl-Python/pylsl/pylsl.py
python
StreamInfo.session_id
(self)
return lib.lsl_get_session_id(self.obj).decode('utf-8')
Session ID for the given stream. The session id is an optional human-assigned identifier of the recording session. While it is rarely used, it can be used to prevent concurrent recording activitites on the same sub-network (e.g., in multiple experiment areas) from seeing each other's...
Session ID for the given stream.
[ "Session", "ID", "for", "the", "given", "stream", "." ]
def session_id(self): """Session ID for the given stream. The session id is an optional human-assigned identifier of the recording session. While it is rarely used, it can be used to prevent concurrent recording activitites on the same sub-network (e.g., in multiple experimen...
[ "def", "session_id", "(", "self", ")", ":", "return", "lib", ".", "lsl_get_session_id", "(", "self", ".", "obj", ")", ".", "decode", "(", "'utf-8'", ")" ]
https://github.com/sccn/lsl_archived/blob/2ff44b7a5172b02fe845b1fc72b9ab5578a489ed/LSL/liblsl-Python/pylsl/pylsl.py#L313-L324
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/mount.py
python
CephFSMount.create_n_files
(self, fs_path, count, sync=False, dirsync=False, unlink=False, finaldirsync=False)
Create n files. :param sync: sync the file after writing :param dirsync: sync the containing directory after closing the file :param unlink: unlink the file after closing :param finaldirsync: sync the containing directory after closing the last file
Create n files.
[ "Create", "n", "files", "." ]
def create_n_files(self, fs_path, count, sync=False, dirsync=False, unlink=False, finaldirsync=False): """ Create n files. :param sync: sync the file after writing :param dirsync: sync the containing directory after closing the file :param unlink: unlink the file after closing ...
[ "def", "create_n_files", "(", "self", ",", "fs_path", ",", "count", ",", "sync", "=", "False", ",", "dirsync", "=", "False", ",", "unlink", "=", "False", ",", "finaldirsync", "=", "False", ")", ":", "assert", "(", "self", ".", "is_mounted", "(", ")", ...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/mount.py#L1067-L1111
cybermaggedon/cyberprobe
f826dbc35ad3a79019cb871c0bc3fb1236130b3e
indicators/cyberprobe/logictree.py
python
Or.record_end
(self, state)
Records the end of scanning, and works out the impact on state.
Records the end of scanning, and works out the impact on state.
[ "Records", "the", "end", "of", "scanning", "and", "works", "out", "the", "impact", "on", "state", "." ]
def record_end(self, state): """ Records the end of scanning, and works out the impact on state. """ for v in self.e: v.record_end(state)
[ "def", "record_end", "(", "self", ",", "state", ")", ":", "for", "v", "in", "self", ".", "e", ":", "v", ".", "record_end", "(", "state", ")" ]
https://github.com/cybermaggedon/cyberprobe/blob/f826dbc35ad3a79019cb871c0bc3fb1236130b3e/indicators/cyberprobe/logictree.py#L147-L150
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py
python
Quaternion.conj
(self)
return Quaternion(self.real, -self.vec)
quaternion conjugate
quaternion conjugate
[ "quaternion", "conjugate" ]
def conj(self): """ quaternion conjugate """ return Quaternion(self.real, -self.vec)
[ "def", "conj", "(", "self", ")", ":", "return", "Quaternion", "(", "self", ".", "real", ",", "-", "self", ".", "vec", ")" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py#L51-L53
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py
python
TurtleScreen.tracer
(self, n=None, delay=None)
Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) ...
Turns turtle animation on/off and set delay for update drawings.
[ "Turns", "turtle", "animation", "on", "/", "off", "and", "set", "delay", "for", "update", "drawings", "." ]
def tracer(self, n=None, delay=None): """Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to...
[ "def", "tracer", "(", "self", ",", "n", "=", "None", ",", "delay", "=", "None", ")", ":", "if", "n", "is", "None", ":", "return", "self", ".", "_tracing", "self", ".", "_tracing", "=", "int", "(", "n", ")", "self", ".", "_updatecounter", "=", "0"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L1245-L1271
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/config.py
python
ConfigChanges.__init__
(self)
Create a page for each configuration file
Create a page for each configuration file
[ "Create", "a", "page", "for", "each", "configuration", "file" ]
def __init__(self): "Create a page for each configuration file" self.pages = [] # List of unhashable dicts. for config_type in idleConf.config_types: self[config_type] = {} self.pages.append(self[config_type])
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "pages", "=", "[", "]", "# List of unhashable dicts.", "for", "config_type", "in", "idleConf", ".", "config_types", ":", "self", "[", "config_type", "]", "=", "{", "}", "self", ".", "pages", ".", "ap...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/config.py#L798-L803