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
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/task_generation/generated_config.py
python
GeneratedConfiguration.write_all_to_dir
(self, directory: str)
Write all the configuration files to the given directory. :param directory: Directory to write to.
Write all the configuration files to the given directory.
[ "Write", "all", "the", "configuration", "files", "to", "the", "given", "directory", "." ]
def write_all_to_dir(self, directory: str) -> None: """ Write all the configuration files to the given directory. :param directory: Directory to write to. """ for item in self.file_list: item.write_to_dir(directory)
[ "def", "write_all_to_dir", "(", "self", ",", "directory", ":", "str", ")", "->", "None", ":", "for", "item", "in", "self", ".", "file_list", ":", "item", ".", "write_to_dir", "(", "directory", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/task_generation/generated_config.py#L36-L43
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/thumbnailctrl.py
python
ScrolledThumbnail.__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, thumboutline=THUMB_OUTLINE_IMAGE, thumbfilter=THUMB_FILTER_IMAGES, imagehandler=PILImageHandler)
Default class constructor. :param `parent`: parent window. Must not be ``None``; :param `id`: window identifier. A value of -1 indicates a default value; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPyt...
Default class constructor.
[ "Default", "class", "constructor", "." ]
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, thumboutline=THUMB_OUTLINE_IMAGE, thumbfilter=THUMB_FILTER_IMAGES, imagehandler=PILImageHandler): """ Default class constructor. :param `parent`: parent window. Must not be ``...
[ "def", "__init__", "(", "self", ",", "parent", ",", "id", "=", "wx", ".", "ID_ANY", ",", "pos", "=", "wx", ".", "DefaultPosition", ",", "size", "=", "wx", ".", "DefaultSize", ",", "thumboutline", "=", "THUMB_OUTLINE_IMAGE", ",", "thumbfilter", "=", "THUM...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/thumbnailctrl.py#L1078-L1162
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/numpy/math_ops.py
python
rad2deg
(x, dtype=None)
return _apply_tensor_op(convert, x, dtype=dtype)
Converts angles from radians to degrees. Args: x (Tensor): Angles in radians. dtype (:class:`mindspore.dtype`, optional): Defaults to None. Overrides the dtype of the output Tensor. Returns: Tensor, the corresponding angle in degrees. This is a tensor scalar if `x` ...
Converts angles from radians to degrees.
[ "Converts", "angles", "from", "radians", "to", "degrees", "." ]
def rad2deg(x, dtype=None): """ Converts angles from radians to degrees. Args: x (Tensor): Angles in radians. dtype (:class:`mindspore.dtype`, optional): Defaults to None. Overrides the dtype of the output Tensor. Returns: Tensor, the corresponding angle in degrees....
[ "def", "rad2deg", "(", "x", ",", "dtype", "=", "None", ")", ":", "_check_input_tensor", "(", "x", ")", "def", "convert", "(", "a", ")", ":", "return", "a", "*", "180.0", "/", "pi", "return", "_apply_tensor_op", "(", "convert", ",", "x", ",", "dtype",...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L229-L256
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py
python
_PastaEditVisitor._maybe_rename
(self, parent, node, full_name)
Replace node (Attribute or Name) with a node representing full_name.
Replace node (Attribute or Name) with a node representing full_name.
[ "Replace", "node", "(", "Attribute", "or", "Name", ")", "with", "a", "node", "representing", "full_name", "." ]
def _maybe_rename(self, parent, node, full_name): """Replace node (Attribute or Name) with a node representing full_name.""" new_name = self._api_change_spec.symbol_renames.get(full_name, None) if new_name: self.add_log(INFO, node.lineno, node.col_offset, "Renamed %r to %r" % (full_...
[ "def", "_maybe_rename", "(", "self", ",", "parent", ",", "node", ",", "full_name", ")", ":", "new_name", "=", "self", ".", "_api_change_spec", ".", "symbol_renames", ".", "get", "(", "full_name", ",", "None", ")", "if", "new_name", ":", "self", ".", "add...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py#L419-L430
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/watch_notify_same_primary.py
python
task
(ctx, config)
Run watch_notify_same_primary The config should be as follows: watch_notify_same_primary: clients: [client list] The client list should contain 1 client The test requires 3 osds. example: tasks: - ceph: - watch_notify_same_primary: clients: [client.0] - interact...
Run watch_notify_same_primary
[ "Run", "watch_notify_same_primary" ]
def task(ctx, config): """ Run watch_notify_same_primary The config should be as follows: watch_notify_same_primary: clients: [client list] The client list should contain 1 client The test requires 3 osds. example: tasks: - ceph: - watch_notify_same_primary: ...
[ "def", "task", "(", "ctx", ",", "config", ")", ":", "log", ".", "info", "(", "'Beginning watch_notify_same_primary...'", ")", "assert", "isinstance", "(", "config", ",", "dict", ")", ",", "\"please list clients to run on\"", "clients", "=", "config", ".", "get",...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/watch_notify_same_primary.py#L17-L129
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
utils/vim-lldb/python-vim-lldb/vim_ui.py
python
UI.update_pc
(self, process, buffers, goto_file)
Place the PC sign on the PC location of each thread's selected frame
Place the PC sign on the PC location of each thread's selected frame
[ "Place", "the", "PC", "sign", "on", "the", "PC", "location", "of", "each", "thread", "s", "selected", "frame" ]
def update_pc(self, process, buffers, goto_file): """ Place the PC sign on the PC location of each thread's selected frame """ def GetPCSourceLocation(thread): """ Returns a tuple (thread_index, file, line, column) that represents where the PC sign should be placed for a thr...
[ "def", "update_pc", "(", "self", ",", "process", ",", "buffers", ",", "goto_file", ")", ":", "def", "GetPCSourceLocation", "(", "thread", ")", ":", "\"\"\" Returns a tuple (thread_index, file, line, column) that represents where\n the PC sign should be placed for a...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/vim_ui.py#L70-L148
huzheng001/stardict-3
96b96d89eab5f0ad9246c2569a807d6d7982aa84
tools/src/stardict_images.py
python
create_icon
(origImage, visibleLayers, props)
return iconImage
visibleLayers - a list of layers that must be visible props - tuple of image properties in format ((size, bpp), ...) where: size - size of the icon in pixels, bpp - bits per pixel, None to leave by default return value - new image
visibleLayers - a list of layers that must be visible props - tuple of image properties in format ((size, bpp), ...) where: size - size of the icon in pixels, bpp - bits per pixel, None to leave by default return value - new image
[ "visibleLayers", "-", "a", "list", "of", "layers", "that", "must", "be", "visible", "props", "-", "tuple", "of", "image", "properties", "in", "format", "((", "size", "bpp", ")", "...", ")", "where", ":", "size", "-", "size", "of", "the", "icon", "in", ...
def create_icon(origImage, visibleLayers, props): """visibleLayers - a list of layers that must be visible props - tuple of image properties in format ((size, bpp), ...) where: size - size of the icon in pixels, bpp - bits per pixel, None to leave by default return value - new image """ iconImage =...
[ "def", "create_icon", "(", "origImage", ",", "visibleLayers", ",", "props", ")", ":", "iconImage", "=", "None", "i", "=", "0", "for", "prop", "in", "props", ":", "image", "=", "gimp", ".", "pdb", ".", "gimp_image_duplicate", "(", "origImage", ")", "prepa...
https://github.com/huzheng001/stardict-3/blob/96b96d89eab5f0ad9246c2569a807d6d7982aa84/tools/src/stardict_images.py#L42-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
PyAuiTabArt.GetSelectedFont
(*args, **kwargs)
return _aui.PyAuiTabArt_GetSelectedFont(*args, **kwargs)
GetSelectedFont(self) -> Font
GetSelectedFont(self) -> Font
[ "GetSelectedFont", "(", "self", ")", "-", ">", "Font" ]
def GetSelectedFont(*args, **kwargs): """GetSelectedFont(self) -> Font""" return _aui.PyAuiTabArt_GetSelectedFont(*args, **kwargs)
[ "def", "GetSelectedFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "PyAuiTabArt_GetSelectedFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L2439-L2441
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/internal/python_message.py
python
_AddIsInitializedMethod
(message_descriptor, cls)
Adds the IsInitialized and FindInitializationError methods to the protocol message class.
Adds the IsInitialized and FindInitializationError methods to the protocol message class.
[ "Adds", "the", "IsInitialized", "and", "FindInitializationError", "methods", "to", "the", "protocol", "message", "class", "." ]
def _AddIsInitializedMethod(message_descriptor, cls): """Adds the IsInitialized and FindInitializationError methods to the protocol message class.""" required_fields = [field for field in message_descriptor.fields if field.label == _FieldDescriptor.LABEL_REQUIRED] def IsInitialized(...
[ "def", "_AddIsInitializedMethod", "(", "message_descriptor", ",", "cls", ")", ":", "required_fields", "=", "[", "field", "for", "field", "in", "message_descriptor", ".", "fields", "if", "field", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REQUIRED", "]", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/python_message.py#L1213-L1305
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py
python
MockMethod.InAnyOrder
(self, group_name="default")
return self._CheckAndCreateNewGroup(group_name, UnorderedGroup)
Move this method into a group of unordered calls. A group of unordered calls must be defined together, and must be executed in full before the next expected method can be called. There can be multiple groups that are expected serially, if they are given different group names. The same group name can ...
Move this method into a group of unordered calls.
[ "Move", "this", "method", "into", "a", "group", "of", "unordered", "calls", "." ]
def InAnyOrder(self, group_name="default"): """Move this method into a group of unordered calls. A group of unordered calls must be defined together, and must be executed in full before the next expected method can be called. There can be multiple groups that are expected serially, if they are given ...
[ "def", "InAnyOrder", "(", "self", ",", "group_name", "=", "\"default\"", ")", ":", "return", "self", ".", "_CheckAndCreateNewGroup", "(", "group_name", ",", "UnorderedGroup", ")" ]
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L686-L702
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py
python
matrix.argmin
(self, axis=None, out=None)
return N.ndarray.argmin(self, axis, out)._align(axis)
Return the indices of the minimum values along an axis. Parameters ---------- See `numpy.argmin` for complete descriptions. See Also -------- numpy.argmin Notes ----- This is the same as `ndarray.argmin`, but returns a `matrix` object wh...
Return the indices of the minimum values along an axis.
[ "Return", "the", "indices", "of", "the", "minimum", "values", "along", "an", "axis", "." ]
def argmin(self, axis=None, out=None): """ Return the indices of the minimum values along an axis. Parameters ---------- See `numpy.argmin` for complete descriptions. See Also -------- numpy.argmin Notes ----- This is the same as...
[ "def", "argmin", "(", "self", ",", "axis", "=", "None", ",", "out", "=", "None", ")", ":", "return", "N", ".", "ndarray", ".", "argmin", "(", "self", ",", "axis", ",", "out", ")", ".", "_align", "(", "axis", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py#L760-L793
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
FilesBelongToSameModule
(filename_cc, filename_h)
return files_belong_to_same_module, common_path
Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to...
Check if these two filenames belong to the same module.
[ "Check", "if", "these", "two", "filenames", "belong", "to", "the", "same", "module", "." ]
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
[ "def", "FilesBelongToSameModule", "(", "filename_cc", ",", "filename_h", ")", ":", "if", "not", "filename_cc", ".", "endswith", "(", "'.cc'", ")", ":", "return", "(", "False", ",", "''", ")", "filename_cc", "=", "filename_cc", "[", ":", "-", "len", "(", ...
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L4403-L4455
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py
python
WorkingSet.iter_entry_points
(self, group, name=None)
Yield entry point objects from `group` matching `name` If `name` is None, yields all entry points in `group` from all distributions in the working set, otherwise only ones matching both `group` and `name` are yielded (in distribution order).
Yield entry point objects from `group` matching `name`
[ "Yield", "entry", "point", "objects", "from", "group", "matching", "name" ]
def iter_entry_points(self, group, name=None): """Yield entry point objects from `group` matching `name` If `name` is None, yields all entry points in `group` from all distributions in the working set, otherwise only ones matching both `group` and `name` are yielded (in distribution ord...
[ "def", "iter_entry_points", "(", "self", ",", "group", ",", "name", "=", "None", ")", ":", "for", "dist", "in", "self", ":", "entries", "=", "dist", ".", "get_entry_map", "(", "group", ")", "if", "name", "is", "None", ":", "for", "ep", "in", "entries...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py#L471-L484
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/lexer.py
python
describe_token_expr
(expr: str)
return _describe_token_type(type)
Like `describe_token` but for token expressions.
Like `describe_token` but for token expressions.
[ "Like", "describe_token", "but", "for", "token", "expressions", "." ]
def describe_token_expr(expr: str) -> str: """Like `describe_token` but for token expressions.""" if ":" in expr: type, value = expr.split(":", 1) if type == TOKEN_NAME: return value else: type = expr return _describe_token_type(type)
[ "def", "describe_token_expr", "(", "expr", ":", "str", ")", "->", "str", ":", "if", "\":\"", "in", "expr", ":", "type", ",", "value", "=", "expr", ".", "split", "(", "\":\"", ",", "1", ")", "if", "type", "==", "TOKEN_NAME", ":", "return", "value", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/lexer.py#L191-L201
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pycodegen.py
python
CodeGenerator._implicitNameOp
(self, prefix, name)
Emit name ops for names generated implicitly by for loops The interpreter generates names that start with a period or dollar sign. The symbol table ignores these names because they aren't present in the program text.
Emit name ops for names generated implicitly by for loops
[ "Emit", "name", "ops", "for", "names", "generated", "implicitly", "by", "for", "loops" ]
def _implicitNameOp(self, prefix, name): """Emit name ops for names generated implicitly by for loops The interpreter generates names that start with a period or dollar sign. The symbol table ignores these names because they aren't present in the program text. """ if se...
[ "def", "_implicitNameOp", "(", "self", ",", "prefix", ",", "name", ")", ":", "if", "self", ".", "optimized", ":", "self", ".", "emit", "(", "prefix", "+", "'_FAST'", ",", "name", ")", "else", ":", "self", ".", "emit", "(", "prefix", "+", "'_NAME'", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pycodegen.py#L299-L309
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/lexers/__init__.py
python
get_lexer_for_mimetype
(_mime, **options)
Get a lexer for a mimetype. Raises ClassNotFound if not found.
Get a lexer for a mimetype.
[ "Get", "a", "lexer", "for", "a", "mimetype", "." ]
def get_lexer_for_mimetype(_mime, **options): """Get a lexer for a mimetype. Raises ClassNotFound if not found. """ for modname, name, _, _, mimetypes in LEXERS.values(): if _mime in mimetypes: if name not in _lexer_cache: _load_lexers(modname) return _le...
[ "def", "get_lexer_for_mimetype", "(", "_mime", ",", "*", "*", "options", ")", ":", "for", "modname", ",", "name", ",", "_", ",", "_", ",", "mimetypes", "in", "LEXERS", ".", "values", "(", ")", ":", "if", "_mime", "in", "mimetypes", ":", "if", "name",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/lexers/__init__.py#L213-L226
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/convert_to_constants.py
python
_FunctionConverterDataInGraph.__init__
(self, func, lower_control_flow, aggressive_inlining, variable_names_allowlist=None, variable_names_denylist=None, session=None)
Creates the conversion data for the given function. Args: func: ConcreteFunction. lower_control_flow: Boolean indicating whether or not to lower control flow ops such as If and While. aggressive_inlining: Boolean indicating whether or not to do aggressive function inlining (might ...
Creates the conversion data for the given function.
[ "Creates", "the", "conversion", "data", "for", "the", "given", "function", "." ]
def __init__(self, func, lower_control_flow, aggressive_inlining, variable_names_allowlist=None, variable_names_denylist=None, session=None): """Creates the conversion data for the given function. Args: func: Concre...
[ "def", "__init__", "(", "self", ",", "func", ",", "lower_control_flow", ",", "aggressive_inlining", ",", "variable_names_allowlist", "=", "None", ",", "variable_names_denylist", "=", "None", ",", "session", "=", "None", ")", ":", "self", ".", "_session", "=", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/convert_to_constants.py#L874-L909
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/saving/saved_model/serialized_attributes.py
python
SerializedAttributes.set_and_validate_objects
(self, object_dict)
return self.checkpointable_objects
Saves objects to a dictionary, and validates the values.
Saves objects to a dictionary, and validates the values.
[ "Saves", "objects", "to", "a", "dictionary", "and", "validates", "the", "values", "." ]
def set_and_validate_objects(self, object_dict): """Saves objects to a dictionary, and validates the values.""" for key in self.all_checkpointable_objects: if key in object_dict: if not isinstance(object_dict[key], trackable.Trackable): raise ValueError( 'Object dictionary ...
[ "def", "set_and_validate_objects", "(", "self", ",", "object_dict", ")", ":", "for", "key", "in", "self", ".", "all_checkpointable_objects", ":", "if", "key", "in", "object_dict", ":", "if", "not", "isinstance", "(", "object_dict", "[", "key", "]", ",", "tra...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/serialized_attributes.py#L210-L223
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/formatters.py
python
BaseFormatter.__call__
(self, obj)
Compute the format for an object.
Compute the format for an object.
[ "Compute", "the", "format", "for", "an", "object", "." ]
def __call__(self, obj): """Compute the format for an object.""" if self.enabled: # lookup registered printer try: printer = self.lookup(obj) except KeyError: pass else: return printer(obj) # Fina...
[ "def", "__call__", "(", "self", ",", "obj", ")", ":", "if", "self", ".", "enabled", ":", "# lookup registered printer", "try", ":", "printer", "=", "self", ".", "lookup", "(", "obj", ")", "except", "KeyError", ":", "pass", "else", ":", "return", "printer...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/formatters.py#L325-L341
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/examples/python/symbolication.py
python
Symbolicator.InitWithSBTarget
(cls, target)
return obj
Initialize a new Symbolicator with an existing SBTarget.
Initialize a new Symbolicator with an existing SBTarget.
[ "Initialize", "a", "new", "Symbolicator", "with", "an", "existing", "SBTarget", "." ]
def InitWithSBTarget(cls, target): """Initialize a new Symbolicator with an existing SBTarget.""" obj = cls(target=target) triple = target.triple if triple: arch = triple.split('-')[0] if "arm" in arch: obj.addr_mask = 0xfffffffffffffffe f...
[ "def", "InitWithSBTarget", "(", "cls", ",", "target", ")", ":", "obj", "=", "cls", "(", "target", "=", "target", ")", "triple", "=", "target", ".", "triple", "if", "triple", ":", "arch", "=", "triple", ".", "split", "(", "'-'", ")", "[", "0", "]", ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/examples/python/symbolication.py#L453-L465
kitao/pyxel
f58bd6fe84153219a1e5edc506ae9606614883dc
pyxel/examples/07_snake.py
python
Snake.death_event
(self)
Kill the game (bring up end screen).
Kill the game (bring up end screen).
[ "Kill", "the", "game", "(", "bring", "up", "end", "screen", ")", "." ]
def death_event(self): """Kill the game (bring up end screen).""" self.death = True # Check having run into self pyxel.stop() pyxel.play(0, 1)
[ "def", "death_event", "(", "self", ")", ":", "self", ".", "death", "=", "True", "# Check having run into self", "pyxel", ".", "stop", "(", ")", "pyxel", ".", "play", "(", "0", ",", "1", ")" ]
https://github.com/kitao/pyxel/blob/f58bd6fe84153219a1e5edc506ae9606614883dc/pyxel/examples/07_snake.py#L153-L158
ivansafrin/Polycode
37a40fefe194ec7f6e9d1257f3bb3517b0a168bc
Bindings/Scripts/create_lua_library/CppHeaderParser3.py
python
t_COMMENT_SINGLELINE
(t)
r'\/\/.*\n
r'\/\/.*\n
[ "r", "\\", "/", "\\", "/", ".", "*", "\\", "n" ]
def t_COMMENT_SINGLELINE(t): r'\/\/.*\n' global doxygenCommentCache if t.value.startswith("///") or t.value.startswith("//!"): if doxygenCommentCache: doxygenCommentCache += "\n" if t.value.endswith("\n"): doxygenCommentCache += t.value[:-1] else: ...
[ "def", "t_COMMENT_SINGLELINE", "(", "t", ")", ":", "global", "doxygenCommentCache", "if", "t", ".", "value", ".", "startswith", "(", "\"///\"", ")", "or", "t", ".", "value", ".", "startswith", "(", "\"//!\"", ")", ":", "if", "doxygenCommentCache", ":", "do...
https://github.com/ivansafrin/Polycode/blob/37a40fefe194ec7f6e9d1257f3bb3517b0a168bc/Bindings/Scripts/create_lua_library/CppHeaderParser3.py#L118-L128
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
GridLSTMCell._make_tf_features
(self, input_feat, slice_offset=0)
return freq_inputs
Make the frequency features. Args: input_feat: input Tensor, 2D, [batch, num_units]. slice_offset: (optional) Python int, default 0, the slicing offset is only used for the backward processing in the BidirectionalGridLSTMCell. It specifies a different starting point instead of always 0 ...
Make the frequency features.
[ "Make", "the", "frequency", "features", "." ]
def _make_tf_features(self, input_feat, slice_offset=0): """Make the frequency features. Args: input_feat: input Tensor, 2D, [batch, num_units]. slice_offset: (optional) Python int, default 0, the slicing offset is only used for the backward processing in the BidirectionalGridLSTMCell. It ...
[ "def", "_make_tf_features", "(", "self", ",", "input_feat", ",", "slice_offset", "=", "0", ")", ":", "input_size", "=", "input_feat", ".", "get_shape", "(", ")", ".", "with_rank", "(", "2", ")", "[", "-", "1", "]", ".", "value", "if", "input_size", "is...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L801-L886
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel._missing_error
(self, name, entity)
Tell the user something does not exist and exit.
Tell the user something does not exist and exit.
[ "Tell", "the", "user", "something", "does", "not", "exist", "and", "exit", "." ]
def _missing_error(self, name, entity): """Tell the user something does not exist and exit.""" self._error( entity[0].upper() + entity[1:] + ' does not exist.', 'The specified %s "%s" does not exist.' % (entity, str(name)))
[ "def", "_missing_error", "(", "self", ",", "name", ",", "entity", ")", ":", "self", ".", "_error", "(", "entity", "[", "0", "]", ".", "upper", "(", ")", "+", "entity", "[", "1", ":", "]", "+", "' does not exist.'", ",", "'The specified %s \"%s\" does not...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L6014-L6018
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ast.py
python
_Unparser.require_parens
(self, precedence, node)
return self.delimit_if("(", ")", self.get_precedence(node) > precedence)
Shortcut to adding precedence related parens
Shortcut to adding precedence related parens
[ "Shortcut", "to", "adding", "precedence", "related", "parens" ]
def require_parens(self, precedence, node): """Shortcut to adding precedence related parens""" return self.delimit_if("(", ")", self.get_precedence(node) > precedence)
[ "def", "require_parens", "(", "self", ",", "precedence", ",", "node", ")", ":", "return", "self", ".", "delimit_if", "(", "\"(\"", ",", "\")\"", ",", "self", ".", "get_precedence", "(", "node", ")", ">", "precedence", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ast.py#L758-L760
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_core.py
python
_find_backend
(backend: str)
Find a pandas plotting backend> Parameters ---------- backend : str The identifier for the backend. Either an entrypoint item registered with pkg_resources, or a module name. Notes ----- Modifies _backends with imported backends as a side effect. Returns ------- ty...
Find a pandas plotting backend>
[ "Find", "a", "pandas", "plotting", "backend", ">" ]
def _find_backend(backend: str): """ Find a pandas plotting backend> Parameters ---------- backend : str The identifier for the backend. Either an entrypoint item registered with pkg_resources, or a module name. Notes ----- Modifies _backends with imported backends as a...
[ "def", "_find_backend", "(", "backend", ":", "str", ")", ":", "import", "pkg_resources", "# Delay import for performance.", "for", "entry_point", "in", "pkg_resources", ".", "iter_entry_points", "(", "\"pandas_plotting_backends\"", ")", ":", "if", "entry_point", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_core.py#L1594-L1642
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/load_v1_in_v2.py
python
_EagerSavedModelLoader.load_graph
(self, returns, meta_graph_def)
Called from wrap_function to import `meta_graph_def`.
Called from wrap_function to import `meta_graph_def`.
[ "Called", "from", "wrap_function", "to", "import", "meta_graph_def", "." ]
def load_graph(self, returns, meta_graph_def): """Called from wrap_function to import `meta_graph_def`.""" # pylint: disable=protected-access saver, _ = tf_saver._import_meta_graph_with_return_elements( meta_graph_def) # pylint: enable=protected-access returns[0] = saver
[ "def", "load_graph", "(", "self", ",", "returns", ",", "meta_graph_def", ")", ":", "# pylint: disable=protected-access", "saver", ",", "_", "=", "tf_saver", ".", "_import_meta_graph_with_return_elements", "(", "meta_graph_def", ")", "# pylint: enable=protected-access", "r...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/load_v1_in_v2.py#L85-L91
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
Dialog.GetMainButtonIds
(*args, **kwargs)
return _windows_.Dialog_GetMainButtonIds(*args, **kwargs)
GetMainButtonIds(self) -> wxArrayInt
GetMainButtonIds(self) -> wxArrayInt
[ "GetMainButtonIds", "(", "self", ")", "-", ">", "wxArrayInt" ]
def GetMainButtonIds(*args, **kwargs): """GetMainButtonIds(self) -> wxArrayInt""" return _windows_.Dialog_GetMainButtonIds(*args, **kwargs)
[ "def", "GetMainButtonIds", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_GetMainButtonIds", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L835-L837
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/libs/mpl/preprocessed/boost_mpl_preprocess.py
python
adjust_container_limits_for_variadic_sequences
(headerDir, containers, maxElements)
Adjusts the limits of variadic sequence MPL-containers.
Adjusts the limits of variadic sequence MPL-containers.
[ "Adjusts", "the", "limits", "of", "variadic", "sequence", "MPL", "-", "containers", "." ]
def adjust_container_limits_for_variadic_sequences(headerDir, containers, maxElements): """Adjusts the limits of variadic sequence MPL-containers.""" for container in containers: headerFile = os.path.join( headerDir, "limits", container + ".hpp" ) regexMatch = r'(define\s+BOOST_MPL_LIMIT_' + c...
[ "def", "adjust_container_limits_for_variadic_sequences", "(", "headerDir", ",", "containers", ",", "maxElements", ")", ":", "for", "container", "in", "containers", ":", "headerFile", "=", "os", ".", "path", ".", "join", "(", "headerDir", ",", "\"limits\"", ",", ...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/libs/mpl/preprocessed/boost_mpl_preprocess.py#L70-L78
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/orient.py
python
OrientMols.__init__
(self, molPermanent, molChangeable)
Stores the shift, rotation, axis exchange, axis inversion, and atom remapping necessary to bring the geometry of *molChangeable* into coincidence with the geometry of *molPermanent*. *molPermanent* and *molChangeable* must be :py:class:`qcdb.Molecule` and represent the same geometry.
Stores the shift, rotation, axis exchange, axis inversion, and atom remapping necessary to bring the geometry of *molChangeable* into coincidence with the geometry of *molPermanent*. *molPermanent* and *molChangeable* must be :py:class:`qcdb.Molecule` and represent the same geometry.
[ "Stores", "the", "shift", "rotation", "axis", "exchange", "axis", "inversion", "and", "atom", "remapping", "necessary", "to", "bring", "the", "geometry", "of", "*", "molChangeable", "*", "into", "coincidence", "with", "the", "geometry", "of", "*", "molPermanent"...
def __init__(self, molPermanent, molChangeable): """Stores the shift, rotation, axis exchange, axis inversion, and atom remapping necessary to bring the geometry of *molChangeable* into coincidence with the geometry of *molPermanent*. *molPermanent* and *molChangeable* must be :p...
[ "def", "__init__", "(", "self", ",", "molPermanent", ",", "molChangeable", ")", ":", "# <<< Permanent (Psi4) >>>", "# Molecule", "self", ".", "Pmol", "=", "molPermanent", "# Vector to shift Pmol to center of mass", "self", ".", "Pshift", "=", "[", "]", "# Matrix to ro...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/orient.py#L57-L99
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
python_packaging/src/gmxapi/operation.py
python
Future.result
(self)
Fetch data to the caller's Context. Returns an object of the concrete type specified according to the operation that produces this Result. Ensemble data are returned as a list. Scalar results or results from single member ensembles are returned as scalars.
Fetch data to the caller's Context.
[ "Fetch", "data", "to", "the", "caller", "s", "Context", "." ]
def result(self) -> ResultTypeVar: """Fetch data to the caller's Context. Returns an object of the concrete type specified according to the operation that produces this Result. Ensemble data are returned as a list. Scalar results or results from single member ensembles are retu...
[ "def", "result", "(", "self", ")", "->", "ResultTypeVar", ":", "self", ".", "resource_manager", ".", "update_output", "(", ")", "# Return ownership of concrete data", "handle", "=", "self", ".", "resource_manager", ".", "get", "(", "self", ".", "name", ")", "#...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L1409-L1436
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.GetBorder
(*args)
return _core_.Window_GetBorder(*args)
GetBorder(self, long flags) -> int GetBorder(self) -> int Get border for the flags of this window
GetBorder(self, long flags) -> int GetBorder(self) -> int
[ "GetBorder", "(", "self", "long", "flags", ")", "-", ">", "int", "GetBorder", "(", "self", ")", "-", ">", "int" ]
def GetBorder(*args): """ GetBorder(self, long flags) -> int GetBorder(self) -> int Get border for the flags of this window """ return _core_.Window_GetBorder(*args)
[ "def", "GetBorder", "(", "*", "args", ")", ":", "return", "_core_", ".", "Window_GetBorder", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11096-L11103
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sysconfig.py
python
get_platform
()
return "%s-%s-%s" % (osname, release, machine)
Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included...
Return a string that identifies the current platform.
[ "Return", "a", "string", "that", "identifies", "the", "current", "platform", "." ]
def get_platform(): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the...
[ "def", "get_platform", "(", ")", ":", "import", "re", "if", "os", ".", "name", "==", "'nt'", ":", "# sniff sys.version for architecture.", "prefix", "=", "\" bit (\"", "i", "=", "sys", ".", "version", ".", "find", "(", "prefix", ")", "if", "i", "==", "-"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sysconfig.py#L534-L623
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/minorview/model.py
python
TwoDColours.elems
(self)
return ret
Get a flat list of all elements
Get a flat list of all elements
[ "Get", "a", "flat", "list", "of", "all", "elements" ]
def elems(self): """Get a flat list of all elements""" ret = [] for blocks in self.blockss: ret += blocks return ret
[ "def", "elems", "(", "self", ")", ":", "ret", "=", "[", "]", "for", "blocks", "in", "self", ".", "blockss", ":", "ret", "+=", "blocks", "return", "ret" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/minorview/model.py#L327-L332
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py
python
convert_slice_channel
(node, **kwargs)
return nodes
Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node.
Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node.
[ "Map", "MXNet", "s", "SliceChannel", "operator", "attributes", "to", "onnx", "s", "Squeeze", "or", "Split", "operator", "based", "on", "squeeze_axis", "attribute", "and", "return", "the", "created", "node", "." ]
def convert_slice_channel(node, **kwargs): """Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node. """ from onnx.helper import make_node name, input_nodes, attrs = get_inputs(node, kwargs) num_outputs =...
[ "def", "convert_slice_channel", "(", "node", ",", "*", "*", "kwargs", ")", ":", "from", "onnx", ".", "helper", "import", "make_node", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "num_outputs", "=", "int", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py#L1436-L1466
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops.py
python
Initializer.get_config
(self)
return {}
Returns the configuration of the initializer as a JSON-serializable dict. Returns: A JSON-serializable Python dict.
Returns the configuration of the initializer as a JSON-serializable dict.
[ "Returns", "the", "configuration", "of", "the", "initializer", "as", "a", "JSON", "-", "serializable", "dict", "." ]
def get_config(self): """Returns the configuration of the initializer as a JSON-serializable dict. Returns: A JSON-serializable Python dict. """ return {}
[ "def", "get_config", "(", "self", ")", ":", "return", "{", "}" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops.py#L70-L76
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py
python
CCompiler.find_library_file
(self, dirs, lib, debug=0)
Search the specified list of directories for a static or shared library file 'lib' and return the full path to that file. If 'debug' true, look for a debugging version (if that makes sense on the current platform). Return None if 'lib' wasn't found in any of the specified directories.
Search the specified list of directories for a static or shared library file 'lib' and return the full path to that file. If 'debug' true, look for a debugging version (if that makes sense on the current platform). Return None if 'lib' wasn't found in any of the specified directories.
[ "Search", "the", "specified", "list", "of", "directories", "for", "a", "static", "or", "shared", "library", "file", "lib", "and", "return", "the", "full", "path", "to", "that", "file", ".", "If", "debug", "true", "look", "for", "a", "debugging", "version",...
def find_library_file (self, dirs, lib, debug=0): """Search the specified list of directories for a static or shared library file 'lib' and return the full path to that file. If 'debug' true, look for a debugging version (if that makes sense on the current platform). Return None if 'li...
[ "def", "find_library_file", "(", "self", ",", "dirs", ",", "lib", ",", "debug", "=", "0", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py#L804-L811
kungfu-origin/kungfu
90c84b2b590855654cb9a6395ed050e0f7763512
core/deps/SQLiteCpp-2.3.0/cpplint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L701-L703
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py
python
UIControl.get_key_bindings
(self)
The key bindings that are specific for this user control. Return a :class:`.KeyBindings` object if some key bindings are specified, or `None` otherwise.
The key bindings that are specific for this user control.
[ "The", "key", "bindings", "that", "are", "specific", "for", "this", "user", "control", "." ]
def get_key_bindings(self) -> Optional["KeyBindingsBase"]: """ The key bindings that are specific for this user control. Return a :class:`.KeyBindings` object if some key bindings are specified, or `None` otherwise. """
[ "def", "get_key_bindings", "(", "self", ")", "->", "Optional", "[", "\"KeyBindingsBase\"", "]", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py#L129-L135
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/util/diff_utils.py
python
_GenerateDiffWithOnlyAdditons
(expected_path, actual_data)
return ''.join(filtered_diff)
Generate a diff that only contains additions
Generate a diff that only contains additions
[ "Generate", "a", "diff", "that", "only", "contains", "additions" ]
def _GenerateDiffWithOnlyAdditons(expected_path, actual_data): """Generate a diff that only contains additions""" # Ignore blank lines when creating the diff to cut down on whitespace-only # lines in the diff. Also remove trailing whitespaces and add the new lines # manually (ndiff expects new lines but we don'...
[ "def", "_GenerateDiffWithOnlyAdditons", "(", "expected_path", ",", "actual_data", ")", ":", "# Ignore blank lines when creating the diff to cut down on whitespace-only", "# lines in the diff. Also remove trailing whitespaces and add the new lines", "# manually (ndiff expects new lines but we don...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/util/diff_utils.py#L25-L39
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/supervisor.py
python
Supervisor._init_summary_op
(self, summary_op=USE_DEFAULT)
Initilizes summary_op. Args: summary_op: An Operation that returns a Summary for the event logs. If set to USE_DEFAULT, create an op that merges all the summaries.
Initilizes summary_op.
[ "Initilizes", "summary_op", "." ]
def _init_summary_op(self, summary_op=USE_DEFAULT): """Initilizes summary_op. Args: summary_op: An Operation that returns a Summary for the event logs. If set to USE_DEFAULT, create an op that merges all the summaries. """ if summary_op is Supervisor.USE_DEFAULT: summary_op = self._...
[ "def", "_init_summary_op", "(", "self", ",", "summary_op", "=", "USE_DEFAULT", ")", ":", "if", "summary_op", "is", "Supervisor", ".", "USE_DEFAULT", ":", "summary_op", "=", "self", ".", "_get_first_op_from_collection", "(", "ops", ".", "GraphKeys", ".", "SUMMARY...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/supervisor.py#L426-L439
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
Match
(pattern, s)
return _regexp_compile_cache[pattern].match(s)
Matches the string with the pattern, caching the compiled regexp.
Matches the string with the pattern, caching the compiled regexp.
[ "Matches", "the", "string", "with", "the", "pattern", "caching", "the", "compiled", "regexp", "." ]
def Match(pattern, s): """Matches the string with the pattern, caching the compiled regexp.""" # The regexp compilation caching is inlined in both Match and Search for # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. if not pattern in _regexp_compile_cac...
[ "def", "Match", "(", "pattern", ",", "s", ")", ":", "# The regexp compilation caching is inlined in both Match and Search for", "# performance reasons; factoring it out into a separate function turns out", "# to be noticeably expensive.", "if", "not", "pattern", "in", "_regexp_compile_...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L409-L416
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/lite/python/util.py
python
_convert_tflite_enum_type_to_tf_type
(tflite_enum_type)
return tf_type
Converts tflite enum type (eg: 0) to tf type (eg: tf.float32). Args: tflite_enum_type: tflite enum type (eg: 0, that corresponds to float32) Raises: ValueError: If an invalid tflite enum type is provided. Returns: tf type (eg: tf.float32)
Converts tflite enum type (eg: 0) to tf type (eg: tf.float32).
[ "Converts", "tflite", "enum", "type", "(", "eg", ":", "0", ")", "to", "tf", "type", "(", "eg", ":", "tf", ".", "float32", ")", "." ]
def _convert_tflite_enum_type_to_tf_type(tflite_enum_type): """Converts tflite enum type (eg: 0) to tf type (eg: tf.float32). Args: tflite_enum_type: tflite enum type (eg: 0, that corresponds to float32) Raises: ValueError: If an invalid tflite enum type is provided. Returns: tf type (eg: tf.floa...
[ "def", "_convert_tflite_enum_type_to_tf_type", "(", "tflite_enum_type", ")", ":", "tf_type", "=", "_MAP_TFLITE_ENUM_TO_TF_TYPES", ".", "get", "(", "tflite_enum_type", ")", "if", "tf_type", "is", "None", ":", "raise", "ValueError", "(", "\"Unsupported enum {}. The valid ma...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/util.py#L86-L103
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/variable_scope.py
python
VariableScope.set_regularizer
(self, regularizer)
Set regularizer for this scope.
Set regularizer for this scope.
[ "Set", "regularizer", "for", "this", "scope", "." ]
def set_regularizer(self, regularizer): """Set regularizer for this scope.""" self._regularizer = regularizer
[ "def", "set_regularizer", "(", "self", ",", "regularizer", ")", ":", "self", ".", "_regularizer", "=", "regularizer" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variable_scope.py#L648-L650
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/tensor/math.py
python
clip_
(x, min=None, max=None, name=None)
return _C_ops.clip_(x, "min", min, "max", max)
Inplace version of ``clip`` API, the output Tensor will be inplaced with input ``x``. Please refer to :ref:`api_tensor_clip`.
Inplace version of ``clip`` API, the output Tensor will be inplaced with input ``x``. Please refer to :ref:`api_tensor_clip`.
[ "Inplace", "version", "of", "clip", "API", "the", "output", "Tensor", "will", "be", "inplaced", "with", "input", "x", ".", "Please", "refer", "to", ":", "ref", ":", "api_tensor_clip", "." ]
def clip_(x, min=None, max=None, name=None): """ Inplace version of ``clip`` API, the output Tensor will be inplaced with input ``x``. Please refer to :ref:`api_tensor_clip`. """ fmin = float(np.finfo(np.float32).min) fmax = float(np.finfo(np.float32).max) if isinstance(min, Variable): ...
[ "def", "clip_", "(", "x", ",", "min", "=", "None", ",", "max", "=", "None", ",", "name", "=", "None", ")", ":", "fmin", "=", "float", "(", "np", ".", "finfo", "(", "np", ".", "float32", ")", ".", "min", ")", "fmax", "=", "float", "(", "np", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/math.py#L2256-L2269
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py
python
GetXyzForNodeOrElementParallel
(inParaViewSource, inIdIsNode, inGlobalId, outXyz, inLocalProcessCouldDetect = True)
given a node or element id, get item xyz location in parallel Recurses through all structures on all processes to find a node or element, then does allreduce to spread that information to all processes (for use in pointing cameras at a node or element with a given id; if this process has the element with the ...
given a node or element id, get item xyz location in parallel
[ "given", "a", "node", "or", "element", "id", "get", "item", "xyz", "location", "in", "parallel" ]
def GetXyzForNodeOrElementParallel(inParaViewSource, inIdIsNode, inGlobalId, outXyz, inLocalProcessCouldDetect = True): """given a node or element id, get item xyz location in parallel Recurses through all structures on all processes to find a node or element, then does allreduce to spread that informati...
[ "def", "GetXyzForNodeOrElementParallel", "(", "inParaViewSource", ",", "inIdIsNode", ",", "inGlobalId", ",", "outXyz", ",", "inLocalProcessCouldDetect", "=", "True", ")", ":", "if", "PhactoriDbg", "(", "100", ")", ":", "myDebugPrint3", "(", "\"GetXyzForNodeOrElementPa...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py#L2967-L3006
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/xmlrpc/server.py
python
SimpleXMLRPCDispatcher.system_methodSignature
(self, method_name)
return 'signatures not supported'
system.methodSignature('add') => [double, int, int] Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result. This server does NOT support system.methodSignature.
system.methodSignature('add') => [double, int, int]
[ "system", ".", "methodSignature", "(", "add", ")", "=", ">", "[", "double", "int", "int", "]" ]
def system_methodSignature(self, method_name): """system.methodSignature('add') => [double, int, int] Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result. This server does NOT su...
[ "def", "system_methodSignature", "(", "self", ",", "method_name", ")", ":", "# See http://xmlrpc.usefulinc.com/doc/sysmethodsig.html", "return", "'signatures not supported'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xmlrpc/server.py#L303-L314
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/gradients.py
python
gradients
(ys, xs, grad_ys=None, name="gradients", colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None)
return [_GetGrad(grads, x) for x in xs]
Constructs symbolic partial derivatives of sum of `ys` w.r.t. x in `xs`. `ys` and `xs` are each a `Tensor` or a list of tensors. `grad_ys` is a list of `Tensor`, holding the gradients received by the `ys`. The list must be the same length as `ys`. `gradients()` adds ops to the graph to output the partial d...
Constructs symbolic partial derivatives of sum of `ys` w.r.t. x in `xs`.
[ "Constructs", "symbolic", "partial", "derivatives", "of", "sum", "of", "ys", "w", ".", "r", ".", "t", ".", "x", "in", "xs", "." ]
def gradients(ys, xs, grad_ys=None, name="gradients", colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None): """Constructs symbolic partial derivatives of sum of `ys` w.r.t. x in `xs`. `ys` and `xs` are ...
[ "def", "gradients", "(", "ys", ",", "xs", ",", "grad_ys", "=", "None", ",", "name", "=", "\"gradients\"", ",", "colocate_gradients_with_ops", "=", "False", ",", "gate_gradients", "=", "False", ",", "aggregation_method", "=", "None", ")", ":", "ys", "=", "_...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/gradients.py#L306-L517
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.ReplaceSelection
(*args, **kwargs)
return _stc.StyledTextCtrl_ReplaceSelection(*args, **kwargs)
ReplaceSelection(self, String text) Replace the selected text with the argument text.
ReplaceSelection(self, String text)
[ "ReplaceSelection", "(", "self", "String", "text", ")" ]
def ReplaceSelection(*args, **kwargs): """ ReplaceSelection(self, String text) Replace the selected text with the argument text. """ return _stc.StyledTextCtrl_ReplaceSelection(*args, **kwargs)
[ "def", "ReplaceSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_ReplaceSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3633-L3639
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
PyApp_SetMacExitMenuItemId
(*args, **kwargs)
return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
PyApp_SetMacExitMenuItemId(long val)
PyApp_SetMacExitMenuItemId(long val)
[ "PyApp_SetMacExitMenuItemId", "(", "long", "val", ")" ]
def PyApp_SetMacExitMenuItemId(*args, **kwargs): """PyApp_SetMacExitMenuItemId(long val)""" return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
[ "def", "PyApp_SetMacExitMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_SetMacExitMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8306-L8308
deepdrive/deepdrive-sim
5c260ee7948f38f3ac50be796d2368bfdbf167be
Packaging/old/package.py
python
package_sim
()
Package sim in Development mode to get yummy command line tools but with Shipping performance
Package sim in Development mode to get yummy command line tools but with Shipping performance
[ "Package", "sim", "in", "Development", "mode", "to", "get", "yummy", "command", "line", "tools", "but", "with", "Shipping", "performance" ]
def package_sim(): """ Package sim in Development mode to get yummy command line tools but with Shipping performance """ manager = UnrealManagerFactory.create() # Monkey patch build orig_build = manager.buildProject manager.buildProject = functools.partial(orig_build, dir=SIM_DIR) mana...
[ "def", "package_sim", "(", ")", ":", "manager", "=", "UnrealManagerFactory", ".", "create", "(", ")", "# Monkey patch build", "orig_build", "=", "manager", ".", "buildProject", "manager", ".", "buildProject", "=", "functools", ".", "partial", "(", "orig_build", ...
https://github.com/deepdrive/deepdrive-sim/blob/5c260ee7948f38f3ac50be796d2368bfdbf167be/Packaging/old/package.py#L203-L220
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/saver.py
python
Saver._MetaGraphFilename
(self, checkpoint_filename, meta_graph_suffix="meta")
return meta_graph_filename
Returns the meta graph filename. Args: checkpoint_filename: Name of the checkpoint file. meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'. Returns: MetaGraph file name.
Returns the meta graph filename.
[ "Returns", "the", "meta", "graph", "filename", "." ]
def _MetaGraphFilename(self, checkpoint_filename, meta_graph_suffix="meta"): """Returns the meta graph filename. Args: checkpoint_filename: Name of the checkpoint file. meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'. Returns: MetaGraph file name. """ # If t...
[ "def", "_MetaGraphFilename", "(", "self", ",", "checkpoint_filename", ",", "meta_graph_suffix", "=", "\"meta\"", ")", ":", "# If the checkpoint_filename is sharded, the checkpoint_filename could", "# be of format model.ckpt-step#-?????-of-shard#. For example,", "# model.ckpt-123456-?????...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/saver.py#L1213-L1228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_shelf.py
python
EdShelfBook.OnTabMenu
(self, evt)
Handle tab menu events
Handle tab menu events
[ "Handle", "tab", "menu", "events" ]
def OnTabMenu(self, evt): """Handle tab menu events""" handler = self._menu.GetHandler(evt.Id) if handler is not None: handler(self.GetCurrentPage(), evt) else: evt.Skip()
[ "def", "OnTabMenu", "(", "self", ",", "evt", ")", ":", "handler", "=", "self", ".", "_menu", ".", "GetHandler", "(", "evt", ".", "Id", ")", "if", "handler", "is", "not", "None", ":", "handler", "(", "self", ".", "GetCurrentPage", "(", ")", ",", "ev...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_shelf.py#L190-L196
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bisect.py
python
bisect_right
(a, x, lo=0, hi=None)
return lo
Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already there. Optional args lo (default 0) and h...
Return the index where to insert item x in list a, assuming a is sorted.
[ "Return", "the", "index", "where", "to", "insert", "item", "x", "in", "list", "a", "assuming", "a", "is", "sorted", "." ]
def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already ...
[ "def", "bisect_right", "(", "a", ",", "x", ",", "lo", "=", "0", ",", "hi", "=", "None", ")", ":", "if", "lo", "<", "0", ":", "raise", "ValueError", "(", "'lo must be non-negative'", ")", "if", "hi", "is", "None", ":", "hi", "=", "len", "(", "a", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bisect.py#L24-L43
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py
python
ProcessingInstruction
(target, text=None)
return element
Processing Instruction element factory. This function creates a special element which the standard serializer serializes as an XML comment. *target* is a string containing the processing instruction, *text* is a string containing the processing instruction contents, if any.
Processing Instruction element factory.
[ "Processing", "Instruction", "element", "factory", "." ]
def ProcessingInstruction(target, text=None): """Processing Instruction element factory. This function creates a special element which the standard serializer serializes as an XML comment. *target* is a string containing the processing instruction, *text* is a string containing the processing inst...
[ "def", "ProcessingInstruction", "(", "target", ",", "text", "=", "None", ")", ":", "element", "=", "Element", "(", "ProcessingInstruction", ")", "element", ".", "text", "=", "target", "if", "text", ":", "element", ".", "text", "=", "element", ".", "text", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py#L476-L490
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSUtil.py
python
_SuffixName
(name, suffix)
return '#'.join(parts)
Add a suffix to the end of a target. Arguments: name: name of the target (foo#target) suffix: the suffix to be added Returns: Target name with suffix added (foo_suffix#target)
Add a suffix to the end of a target.
[ "Add", "a", "suffix", "to", "the", "end", "of", "a", "target", "." ]
def _SuffixName(name, suffix): """Add a suffix to the end of a target. Arguments: name: name of the target (foo#target) suffix: the suffix to be added Returns: Target name with suffix added (foo_suffix#target) """ parts = name.rsplit('#', 1) parts[0] = '%s_%s' % (parts[0], suffix) return '#'....
[ "def", "_SuffixName", "(", "name", ",", "suffix", ")", ":", "parts", "=", "name", ".", "rsplit", "(", "'#'", ",", "1", ")", "parts", "[", "0", "]", "=", "'%s_%s'", "%", "(", "parts", "[", "0", "]", ",", "suffix", ")", "return", "'#'", ".", "joi...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSUtil.py#L48-L59
OAID/Caffe-HRT
aae71e498ab842c6f92bcc23fc668423615a4d65
scripts/cpp_lint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal...
https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L4689-L4754
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ipaddress.py
python
_split_optional_netmask
(address)
return addr
Helper to split the netmask and raise AddressValueError if needed
Helper to split the netmask and raise AddressValueError if needed
[ "Helper", "to", "split", "the", "netmask", "and", "raise", "AddressValueError", "if", "needed" ]
def _split_optional_netmask(address): """Helper to split the netmask and raise AddressValueError if needed""" addr = str(address).split('/') if len(addr) > 2: raise AddressValueError("Only one '/' permitted in %r" % address) return addr
[ "def", "_split_optional_netmask", "(", "address", ")", ":", "addr", "=", "str", "(", "address", ")", ".", "split", "(", "'/'", ")", "if", "len", "(", "addr", ")", ">", "2", ":", "raise", "AddressValueError", "(", "\"Only one '/' permitted in %r\"", "%", "a...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ipaddress.py#L158-L163
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/client/timeline.py
python
_ChromeTraceFormatter._create_event
(self, ph, category, name, pid, tid, timestamp)
return event
Creates a new Chrome Trace event. For details of the file format, see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args: ph: The type of event - usually a single character. category: The event category as a string. name: The event name as a string. ...
Creates a new Chrome Trace event.
[ "Creates", "a", "new", "Chrome", "Trace", "event", "." ]
def _create_event(self, ph, category, name, pid, tid, timestamp): """Creates a new Chrome Trace event. For details of the file format, see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args: ph: The type of event - usually a single character. category: The ev...
[ "def", "_create_event", "(", "self", ",", "ph", ",", "category", ",", "name", ",", "pid", ",", "tid", ",", "timestamp", ")", ":", "event", "=", "{", "}", "event", "[", "'ph'", "]", "=", "ph", "event", "[", "'cat'", "]", "=", "category", "event", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/client/timeline.py#L65-L89
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/cmdline.py
python
CmdOptionParser.__init__
(self, action, options=None, defaults=None, usage=None, cmd=None, description=None )
Create an OptionParser for a coverage command. `action` is the slug to put into `options.actions`. `options` is a list of Option's for the command. `defaults` is a dict of default value for options. `usage` is the usage string to display in help. `cmd` is the command name, if di...
Create an OptionParser for a coverage command.
[ "Create", "an", "OptionParser", "for", "a", "coverage", "command", "." ]
def __init__(self, action, options=None, defaults=None, usage=None, cmd=None, description=None ): """Create an OptionParser for a coverage command. `action` is the slug to put into `options.actions`. `options` is a list of Option's for the command. `defau...
[ "def", "__init__", "(", "self", ",", "action", ",", "options", "=", "None", ",", "defaults", "=", "None", ",", "usage", "=", "None", ",", "cmd", "=", "None", ",", "description", "=", "None", ")", ":", "if", "usage", ":", "usage", "=", "\"%prog \"", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/cmdline.py#L199-L222
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sketch.py
python
Sketch.num_elements_processed
(self)
Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far.
Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far.
[ "Returns", "the", "number", "of", "elements", "processed", "so", "far", ".", "If", "the", "sketch", "is", "created", "with", "background", "==", "False", "(", "default", ")", "this", "will", "always", "return", "the", "length", "of", "the", "input", "array...
def num_elements_processed(self): """ Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far. ...
[ "def", "num_elements_processed", "(", "self", ")", ":", "with", "cython_context", "(", ")", ":", "return", "self", ".", "__proxy__", ".", "num_elements_processed", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sketch.py#L502-L510
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__reversed__
(self)
od.__reversed__() <==> reversed(od)
od.__reversed__() <==> reversed(od)
[ "od", ".", "__reversed__", "()", "<", "==", ">", "reversed", "(", "od", ")" ]
def __reversed__(self): 'od.__reversed__() <==> reversed(od)' root = self.__root curr = root[0] while curr is not root: yield curr[2] curr = curr[0]
[ "def", "__reversed__", "(", "self", ")", ":", "root", "=", "self", ".", "__root", "curr", "=", "root", "[", "0", "]", "while", "curr", "is", "not", "root", ":", "yield", "curr", "[", "2", "]", "curr", "=", "curr", "[", "0", "]" ]
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/ordered_dict.py#L98-L104
ppizarro/coursera
b39847928df4d9d5986b801085c025e8e9122b6a
Learn to Program: Crafting Quality Code/assignment 2/rat_race.py
python
main
()
Prompt for a maze file, read the maze, and start the game.
Prompt for a maze file, read the maze, and start the game.
[ "Prompt", "for", "a", "maze", "file", "read", "the", "maze", "and", "start", "the", "game", "." ]
def main(): """ Prompt for a maze file, read the maze, and start the game. """ root = tkinter.Tk() maze_filename = tkinter.filedialog.askopenfilename() with open(maze_filename, 'r') as maze_file: maze_list = read_maze(maze_file) rat_1, rat_2 = find_rats_replace_hallway(maze_list) the...
[ "def", "main", "(", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "maze_filename", "=", "tkinter", ".", "filedialog", ".", "askopenfilename", "(", ")", "with", "open", "(", "maze_filename", ",", "'r'", ")", "as", "maze_file", ":", "maze_list", ...
https://github.com/ppizarro/coursera/blob/b39847928df4d9d5986b801085c025e8e9122b6a/Learn to Program: Crafting Quality Code/assignment 2/rat_race.py#L204-L217
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
MultiChoiceDialog.__init__
(self, *args, **kwargs)
__init__(self, Window parent, String message, String caption, List choices=EmptyList, long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> MultiChoiceDialog Constructor. Use the `ShowModal` method to show the dialog. :param parent: The parent window. :para...
__init__(self, Window parent, String message, String caption, List choices=EmptyList, long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> MultiChoiceDialog
[ "__init__", "(", "self", "Window", "parent", "String", "message", "String", "caption", "List", "choices", "=", "EmptyList", "long", "style", "=", "CHOICEDLG_STYLE", "Point", "pos", "=", "DefaultPosition", ")", "-", ">", "MultiChoiceDialog" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, String message, String caption, List choices=EmptyList, long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> MultiChoiceDialog Constructor. Use the `ShowModal` method to show the dialog. ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_windows_", ".", "MultiChoiceDialog_swiginit", "(", "self", ",", "_windows_", ".", "new_MultiChoiceDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L3281-L3301
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/icebridge_common.py
python
getJpegs
(folder)
return files
Get jpeg files in given directory. This returns the files without sorting or the folder name prepended to them.
Get jpeg files in given directory. This returns the files without sorting or the folder name prepended to them.
[ "Get", "jpeg", "files", "in", "given", "directory", ".", "This", "returns", "the", "files", "without", "sorting", "or", "the", "folder", "name", "prepended", "to", "them", "." ]
def getJpegs(folder): # TODO: This function should not be used as it is not robust. # Rather, look up the index, and read only files listed there. '''Get jpeg files in given directory. This returns the files without sorting or the folder name prepended to them.''' files = [] for f in os.listdir...
[ "def", "getJpegs", "(", "folder", ")", ":", "# TODO: This function should not be used as it is not robust.", "# Rather, look up the index, and read only files listed there.", "files", "=", "[", "]", "for", "f", "in", "os", ".", "listdir", "(", "folder", ")", ":", "ext", ...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L917-L931
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/kudu_util.py
python
check_output
(*popenargs, **kwargs)
return output
r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6.2
r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6.2
[ "r", "Run", "command", "with", "arguments", "and", "return", "its", "output", "as", "a", "byte", "string", ".", "Backported", "from", "Python", "2", ".", "7", "as", "it", "s", "implemented", "as", "pure", "python", "on", "stdlib", ".", ">>>", "check_outp...
def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6.2 """ process = subprocess.Popen(stdout=subprocess.PIPE, *pope...
[ "def", "check_output", "(", "*", "popenargs", ",", "*", "*", "kwargs", ")", ":", "process", "=", "subprocess", ".", "Popen", "(", "stdout", "=", "subprocess", ".", "PIPE", ",", "*", "popenargs", ",", "*", "*", "kwargs", ")", "output", ",", "unused_err"...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/kudu_util.py#L74-L90
google/VoltAir
88bc3c8e09420d600d0b3d6d6c6eea75ebe0c5f2
build/build_android.py
python
RenameApk
(dst_apk)
Run the 'mv' command which moves the APK to a more reasonable name. Args: dst_apk: name of destination apk
Run the 'mv' command which moves the APK to a more reasonable name.
[ "Run", "the", "mv", "command", "which", "moves", "the", "APK", "to", "a", "more", "reasonable", "name", "." ]
def RenameApk(dst_apk): """Run the 'mv' command which moves the APK to a more reasonable name. Args: dst_apk: name of destination apk """ src_apk = os.getcwd() + "/android-build/bin/QtApp-release.apk" print >> sys.stderr, "Renaming %s to %s" % (src_apk, dst_apk) os.rename(src_apk, dst_apk)
[ "def", "RenameApk", "(", "dst_apk", ")", ":", "src_apk", "=", "os", ".", "getcwd", "(", ")", "+", "\"/android-build/bin/QtApp-release.apk\"", "print", ">>", "sys", ".", "stderr", ",", "\"Renaming %s to %s\"", "%", "(", "src_apk", ",", "dst_apk", ")", "os", "...
https://github.com/google/VoltAir/blob/88bc3c8e09420d600d0b3d6d6c6eea75ebe0c5f2/build/build_android.py#L183-L192
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
api/ctpx/ctptd.py
python
CtpTd.onRspQryOrder
(self, OrderField, RspInfoField, requestId, final)
请求查询报单响应
请求查询报单响应
[ "请求查询报单响应" ]
def onRspQryOrder(self, OrderField, RspInfoField, requestId, final): """请求查询报单响应""" if OrderField: #这个字段也可能为空 logger.debug(u"onRspQryOrder --- brokerID:{0}, orderRef:{1}, limitPrice:{2}, volume:{3}, orderPriceType:{4}," u"direction: {5}, combOffsetFlag: {6}, combHedgeFlag:{...
[ "def", "onRspQryOrder", "(", "self", ",", "OrderField", ",", "RspInfoField", ",", "requestId", ",", "final", ")", ":", "if", "OrderField", ":", "#这个字段也可能为空", "logger", ".", "debug", "(", "u\"onRspQryOrder --- brokerID:{0}, orderRef:{1}, limitPrice:{2}, volume:{3}, orderPr...
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/api/ctpx/ctptd.py#L172-L189
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/array_ops.py
python
batch_gather_nd
(params, indices, batch_dims, name=None)
return out
gather_nd implementation with batch support.
gather_nd implementation with batch support.
[ "gather_nd", "implementation", "with", "batch", "support", "." ]
def batch_gather_nd(params, indices, batch_dims, name=None): """gather_nd implementation with batch support.""" with ops.name_scope(name, "BatchGatherND", [params, indices]): indices = ops.convert_to_tensor(indices, name="indices") params = ops.convert_to_tensor(params, name="params") if not isinstance...
[ "def", "batch_gather_nd", "(", "params", ",", "indices", ",", "batch_dims", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"BatchGatherND\"", ",", "[", "params", ",", "indices", "]", ")", ":", "indices", "=", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_ops.py#L5702-L5778
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteList
(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary)
Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style.
Write a variable definition that is a list of values.
[ "Write", "a", "variable", "definition", "that", "is", "a", "list", "of", "values", "." ]
def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ values = "" ...
[ "def", "WriteList", "(", "self", ",", "value_list", ",", "variable", "=", "None", ",", "prefix", "=", "\"\"", ",", "quoter", "=", "QuoteIfNecessary", ")", ":", "values", "=", "\"\"", "if", "value_list", ":", "value_list", "=", "[", "quoter", "(", "prefix...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/make.py#L1899-L1910
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/service_account.py
python
_get_private_key
(private_key_pkcs8_text)
return rsa.PrivateKey.load_pkcs1( asn1_private_key.getComponentByName('privateKey').asOctets(), format='DER')
Get an RSA private key object from a pkcs8 representation.
Get an RSA private key object from a pkcs8 representation.
[ "Get", "an", "RSA", "private", "key", "object", "from", "a", "pkcs8", "representation", "." ]
def _get_private_key(private_key_pkcs8_text): """Get an RSA private key object from a pkcs8 representation.""" if not isinstance(private_key_pkcs8_text, six.binary_type): private_key_pkcs8_text = private_key_pkcs8_text.encode('ascii') der = rsa.pem.load_pem(private_key_pkcs8_text, 'PRIVATE KEY') asn1_priva...
[ "def", "_get_private_key", "(", "private_key_pkcs8_text", ")", ":", "if", "not", "isinstance", "(", "private_key_pkcs8_text", ",", "six", ".", "binary_type", ")", ":", "private_key_pkcs8_text", "=", "private_key_pkcs8_text", ".", "encode", "(", "'ascii'", ")", "der"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/service_account.py#L130-L139
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py
python
WorkingSet.find
(self, req)
return dist
Find a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it does *not* meet the `req` requirem...
Find a distribution matching requirement `req`
[ "Find", "a", "distribution", "matching", "requirement", "req" ]
def find(self, req): """Find a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it do...
[ "def", "find", "(", "self", ",", "req", ")", ":", "dist", "=", "self", ".", "by_key", ".", "get", "(", "req", ".", "key", ")", "if", "dist", "is", "not", "None", "and", "dist", "not", "in", "req", ":", "# XXX add more info", "raise", "VersionConflict...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L631-L645
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/mox.py
python
In.__init__
(self, key)
Initialize. Args: # key is any thing that could be in a list or a key in a dict
Initialize.
[ "Initialize", "." ]
def __init__(self, key): """Initialize. Args: # key is any thing that could be in a list or a key in a dict """ self._key = key
[ "def", "__init__", "(", "self", ",", "key", ")", ":", "self", ".", "_key", "=", "key" ]
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/mox.py#L946-L953
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py
python
BaseMode.backward_delete_char
(self, e)
Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them.
Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them.
[ "Delete", "the", "character", "behind", "the", "cursor", ".", "A", "numeric", "argument", "means", "to", "kill", "the", "characters", "instead", "of", "deleting", "them", "." ]
def backward_delete_char(self, e): # (Rubout) '''Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them.''' self.l_buffer.backward_delete_char(self.argument_reset)
[ "def", "backward_delete_char", "(", "self", ",", "e", ")", ":", "# (Rubout)", "self", ".", "l_buffer", ".", "backward_delete_char", "(", "self", ".", "argument_reset", ")" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py#L353-L356
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/util.py
python
dtype_from_number
(number)
Get the data type from the given int or float number
Get the data type from the given int or float number
[ "Get", "the", "data", "type", "from", "the", "given", "int", "or", "float", "number" ]
def dtype_from_number(number): """Get the data type from the given int or float number """ assert isinstance(number, numeric_types),\ "The input number should be either int for float types" import numpy as _np if isinstance(number, (int, long)): if number > _MAX_VALUE_64_BIT_UNSIGNED...
[ "def", "dtype_from_number", "(", "number", ")", ":", "assert", "isinstance", "(", "number", ",", "numeric_types", ")", ",", "\"The input number should be either int for float types\"", "import", "numpy", "as", "_np", "if", "isinstance", "(", "number", ",", "(", "int...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/util.py#L1336-L1361
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/auto_parallel/completion.py
python
compute_compatible_dims_mapping
(dims_mapping_list)
return compatible_result
Compute the compatible dims mapping given a list of dims mapping. Each of dims mapping is also a list.
Compute the compatible dims mapping given a list of dims mapping. Each of dims mapping is also a list.
[ "Compute", "the", "compatible", "dims", "mapping", "given", "a", "list", "of", "dims", "mapping", ".", "Each", "of", "dims", "mapping", "is", "also", "a", "list", "." ]
def compute_compatible_dims_mapping(dims_mapping_list): """Compute the compatible dims mapping given a list of dims mapping. Each of dims mapping is also a list. """ if not dims_mapping_list: return None length = len(dims_mapping_list[0]) for dims_mapping in dims_mapping_list: ...
[ "def", "compute_compatible_dims_mapping", "(", "dims_mapping_list", ")", ":", "if", "not", "dims_mapping_list", ":", "return", "None", "length", "=", "len", "(", "dims_mapping_list", "[", "0", "]", ")", "for", "dims_mapping", "in", "dims_mapping_list", ":", "if", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/auto_parallel/completion.py#L89-L108
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
python
NextQueuedSequenceBatch.total_length
(self)
return self._state_saver._received_total_length
The lengths of the original (non-truncated) unrolled examples. Returns: An integer vector of length `batch_size`, the total lengths.
The lengths of the original (non-truncated) unrolled examples.
[ "The", "lengths", "of", "the", "original", "(", "non", "-", "truncated", ")", "unrolled", "examples", "." ]
def total_length(self): """The lengths of the original (non-truncated) unrolled examples. Returns: An integer vector of length `batch_size`, the total lengths. """ return self._state_saver._received_total_length
[ "def", "total_length", "(", "self", ")", ":", "return", "self", ".", "_state_saver", ".", "_received_total_length" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py#L369-L375
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py
python
_ImagGrad
(_, grad)
return math_ops.complex(zero, grad)
Returns 'grad' as the imaginary part and set the real part 0.
Returns 'grad' as the imaginary part and set the real part 0.
[ "Returns", "grad", "as", "the", "imaginary", "part", "and", "set", "the", "real", "part", "0", "." ]
def _ImagGrad(_, grad): """Returns 'grad' as the imaginary part and set the real part 0.""" zero = constant_op.constant(0, dtype=grad.dtype) return math_ops.complex(zero, grad)
[ "def", "_ImagGrad", "(", "_", ",", "grad", ")", ":", "zero", "=", "constant_op", ".", "constant", "(", "0", ",", "dtype", "=", "grad", ".", "dtype", ")", "return", "math_ops", ".", "complex", "(", "zero", ",", "grad", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py#L1760-L1763
tpfister/caffe-heatmap
4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e
scripts/cpp_lint.py
python
CheckForHeaderGuard
(filename, lines, error)
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. lines: An array of strings, each representing a line of the file. error: The function to call...
Checks that the file contains a header guard.
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
def CheckForHeaderGuard(filename, lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. lines: An array of strings, each representi...
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "lines", ",", "error", ")", ":", "cppvar", "=", "GetHeaderGuardCPPVariable", "(", "filename", ")", "ifndef", "=", "None", "ifndef_linenum", "=", "0", "define", "=", "None", "endif", "=", "None", "endif_linenu...
https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L1408-L1480
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.lsCountNode
(self)
return ret
Count the children of @node.
Count the children of
[ "Count", "the", "children", "of" ]
def lsCountNode(self): """Count the children of @node. """ ret = libxml2mod.xmlLsCountNode(self._o) return ret
[ "def", "lsCountNode", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlLsCountNode", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3058-L3061
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/packager.py
python
Spec.metadata_gitspec
(self)
Git revision to use for spec+control+init+manpage files. The default is the release tag for the version being packaged.
Git revision to use for spec+control+init+manpage files. The default is the release tag for the version being packaged.
[ "Git", "revision", "to", "use", "for", "spec", "+", "control", "+", "init", "+", "manpage", "files", ".", "The", "default", "is", "the", "release", "tag", "for", "the", "version", "being", "packaged", "." ]
def metadata_gitspec(self): """Git revision to use for spec+control+init+manpage files. The default is the release tag for the version being packaged.""" if(self.gitspec): return self.gitspec else: return 'r' + self.version()
[ "def", "metadata_gitspec", "(", "self", ")", ":", "if", "(", "self", ".", "gitspec", ")", ":", "return", "self", ".", "gitspec", "else", ":", "return", "'r'", "+", "self", ".", "version", "(", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/packager.py#L77-L83
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/config.py
python
ConfigMetadataHandler._parse_version
(self, value)
return version
Parses `version` option value. :param value: :rtype: str
Parses `version` option value.
[ "Parses", "version", "option", "value", "." ]
def _parse_version(self, value): """Parses `version` option value. :param value: :rtype: str """ version = self._parse_attr(value) if callable(version): version = version() if not isinstance(version, string_types): if hasattr(version, '...
[ "def", "_parse_version", "(", "self", ",", "value", ")", ":", "version", "=", "self", ".", "_parse_attr", "(", "value", ")", "if", "callable", "(", "version", ")", ":", "version", "=", "version", "(", ")", "if", "not", "isinstance", "(", "version", ","...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/config.py#L423-L441
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/MetaSearch/pavement.py
python
package
()
return package_file
create zip file of plugin
create zip file of plugin
[ "create", "zip", "file", "of", "plugin" ]
def package(): """create zip file of plugin""" skip_files = [ 'AUTHORS.txt', 'CMakeLists.txt', 'requirements.txt', 'requirements-dev.txt', 'pavement.txt' ] package_file = get_package_filename() if not os.path.exists(options.base.tmp): options.base.t...
[ "def", "package", "(", ")", ":", "skip_files", "=", "[", "'AUTHORS.txt'", ",", "'CMakeLists.txt'", ",", "'requirements.txt'", ",", "'requirements-dev.txt'", ",", "'pavement.txt'", "]", "package_file", "=", "get_package_filename", "(", ")", "if", "not", "os", ".", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/MetaSearch/pavement.py#L103-L128
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/jedi/jedi/api/classes.py
python
defined_names
(evaluator, context)
return [Definition(evaluator, n) for n in _sort_names_by_start_pos(names)]
List sub-definitions (e.g., methods in class). :type scope: Scope :rtype: list of Definition
List sub-definitions (e.g., methods in class).
[ "List", "sub", "-", "definitions", "(", "e", ".", "g", ".", "methods", "in", "class", ")", "." ]
def defined_names(evaluator, context): """ List sub-definitions (e.g., methods in class). :type scope: Scope :rtype: list of Definition """ filter = next(context.get_filters(search_global=True)) names = [name for name in filter.values()] return [Definition(evaluator, n) for n in _sort_n...
[ "def", "defined_names", "(", "evaluator", ",", "context", ")", ":", "filter", "=", "next", "(", "context", ".", "get_filters", "(", "search_global", "=", "True", ")", ")", "names", "=", "[", "name", "for", "name", "in", "filter", ".", "values", "(", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/api/classes.py#L25-L34
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
Indigo.writeFile
(self, filename)
return self.IndigoObject( self, self._checkResult( Indigo._lib.indigoWriteFile(filename.encode(ENCODE_ENCODING)) ), )
Creates file writer object Args: filename (str): full path to the file Returns: IndigoObject: file writer object
Creates file writer object
[ "Creates", "file", "writer", "object" ]
def writeFile(self, filename): """Creates file writer object Args: filename (str): full path to the file Returns: IndigoObject: file writer object """ self._setSessionId() return self.IndigoObject( self, self._checkResult(...
[ "def", "writeFile", "(", "self", ",", "filename", ")", ":", "self", ".", "_setSessionId", "(", ")", "return", "self", ".", "IndigoObject", "(", "self", ",", "self", ".", "_checkResult", "(", "Indigo", ".", "_lib", ".", "indigoWriteFile", "(", "filename", ...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L5440-L5455
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/announcement.py
python
Announcement._date
(self)
return self.__date
Gets the _date of this Announcement. # noqa: E501 :return: The _date of this Announcement. # noqa: E501 :rtype: datetime
Gets the _date of this Announcement. # noqa: E501
[ "Gets", "the", "_date", "of", "this", "Announcement", ".", "#", "noqa", ":", "E501" ]
def _date(self): """Gets the _date of this Announcement. # noqa: E501 :return: The _date of this Announcement. # noqa: E501 :rtype: datetime """ return self.__date
[ "def", "_date", "(", "self", ")", ":", "return", "self", ".", "__date" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/announcement.py#L156-L163
regomne/chinesize
2ae555445046cd28d60a514e30ac1d6eca1c442a
N2System/nsbparser/nsbParser.py
python
NsbParser.p9b
(self)
case
case
[ "case" ]
def p9b(self): 'case' self.text.append('\t'*self.tabcount+'case '+self.readarg()) self.readarg() self.readarg()
[ "def", "p9b", "(", "self", ")", ":", "self", ".", "text", ".", "append", "(", "'\\t'", "*", "self", ".", "tabcount", "+", "'case '", "+", "self", ".", "readarg", "(", ")", ")", "self", ".", "readarg", "(", ")", "self", ".", "readarg", "(", ")" ]
https://github.com/regomne/chinesize/blob/2ae555445046cd28d60a514e30ac1d6eca1c442a/N2System/nsbparser/nsbParser.py#L100-L104
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/rev_block_lib.py
python
RevBlock._forward
(self, x1, x2)
Run forward through the reversible layers.
Run forward through the reversible layers.
[ "Run", "forward", "through", "the", "reversible", "layers", "." ]
def _forward(self, x1, x2): """Run forward through the reversible layers.""" side_inputs = [self.f_side_input, self.g_side_input] flat_side_inputs = nest.flatten(side_inputs) def _forward_wrap(x1_, x2_, *flat_side_inputs): f_side, g_side = nest.pack_sequence_as(side_inputs, flat_side_inputs) ...
[ "def", "_forward", "(", "self", ",", "x1", ",", "x2", ")", ":", "side_inputs", "=", "[", "self", ".", "f_side_input", ",", "self", ".", "g_side_input", "]", "flat_side_inputs", "=", "nest", ".", "flatten", "(", "side_inputs", ")", "def", "_forward_wrap", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/rev_block_lib.py#L335-L362
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py
python
PoolManager.connection_from_context
(self, request_context)
return self.connection_from_pool_key(pool_key, request_context=request_context)
Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context. ``request_context`` must at least contain the ``scheme`` key and its value must be a key in ``key_fn_by_scheme`` instance variable.
[]
def connection_from_context(self, request_context): """ Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context. ``request_context`` must at least contain the ``scheme`` key and its value must be a key in ``key_fn_by_scheme`` instance variable. ""...
[ "def", "connection_from_context", "(", "self", ",", "request_context", ")", ":", "scheme", "=", "request_context", "[", "\"scheme\"", "]", ".", "lower", "(", ")", "pool_key_constructor", "=", "self", ".", "key_fn_by_scheme", ".", "get", "(", "scheme", ")", "if...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py#L493-L519
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/XRCed/presenter.py
python
_Presenter.deleteMany
(self, items)
Delete selected object(s).
Delete selected object(s).
[ "Delete", "selected", "object", "(", "s", ")", "." ]
def deleteMany(self, items): '''Delete selected object(s).''' for item in items: if not item.IsOk(): continue # child already deleted parentItem = view.tree.GetItemParent(item) parentNode = view.tree.GetPyData(parentItem) node = view.tree.GetPyData(item) ...
[ "def", "deleteMany", "(", "self", ",", "items", ")", ":", "for", "item", "in", "items", ":", "if", "not", "item", ".", "IsOk", "(", ")", ":", "continue", "# child already deleted", "parentItem", "=", "view", ".", "tree", ".", "GetItemParent", "(", "item"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/presenter.py#L399-L411
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/__init__.py
python
Filterer.removeFilter
(self, filter)
Remove the specified filter from this handler.
Remove the specified filter from this handler.
[ "Remove", "the", "specified", "filter", "from", "this", "handler", "." ]
def removeFilter(self, filter): """ Remove the specified filter from this handler. """ if filter in self.filters: self.filters.remove(filter)
[ "def", "removeFilter", "(", "self", ",", "filter", ")", ":", "if", "filter", "in", "self", ".", "filters", ":", "self", ".", "filters", ".", "remove", "(", "filter", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L553-L558
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PreTreebook
(*args, **kwargs)
return val
PreTreebook() -> Treebook
PreTreebook() -> Treebook
[ "PreTreebook", "()", "-", ">", "Treebook" ]
def PreTreebook(*args, **kwargs): """PreTreebook() -> Treebook""" val = _controls_.new_PreTreebook(*args, **kwargs) return val
[ "def", "PreTreebook", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreTreebook", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3346-L3349
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/BASIC/basparse.py
python
p_expr_variable
(p)
expr : variable
expr : variable
[ "expr", ":", "variable" ]
def p_expr_variable(p): '''expr : variable''' p[0] = ('VAR',p[1])
[ "def", "p_expr_variable", "(", "p", ")", ":", "p", "[", "0", "]", "=", "(", "'VAR'", ",", "p", "[", "1", "]", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/BASIC/basparse.py#L296-L298
manutdzou/KITTI_SSD
5b620c2f291d36a0fe14489214f22a992f173f44
scripts/cpp_lint.py
python
CheckComment
(comment, filename, linenum, error)
Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for common mistakes in TODO comments.
[ "Checks", "for", "common", "mistakes", "in", "TODO", "comments", "." ]
def CheckComment(comment, filename, linenum, error): """Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found....
[ "def", "CheckComment", "(", "comment", ",", "filename", ",", "linenum", ",", "error", ")", ":", "match", "=", "_RE_PATTERN_TODO", ".", "match", "(", "comment", ")", "if", "match", ":", "# One whitespace is correct; zero whitespace is handled elsewhere.", "leading_whit...
https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/scripts/cpp_lint.py#L2461-L2488
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.FindWindowByName
(*args, **kwargs)
return _core_.Window_FindWindowByName(*args, **kwargs)
FindWindowByName(self, String name) -> Window Find a child of this window by name
FindWindowByName(self, String name) -> Window
[ "FindWindowByName", "(", "self", "String", "name", ")", "-", ">", "Window" ]
def FindWindowByName(*args, **kwargs): """ FindWindowByName(self, String name) -> Window Find a child of this window by name """ return _core_.Window_FindWindowByName(*args, **kwargs)
[ "def", "FindWindowByName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_FindWindowByName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L10339-L10345
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
base/android/jni_generator/jni_generator.py
python
InlHeaderFileGenerator.GetParamsInDeclaration
(self, native)
return ',\n '.join(self.GetJNIFirstParam(native, True) + [JavaDataTypeToCForDeclaration(param.datatype) + ' ' + param.name for param in native.params])
Returns the params for the forward declaration. Args: native: the native dictionary describing the method. Returns: A string containing the params.
Returns the params for the forward declaration.
[ "Returns", "the", "params", "for", "the", "forward", "declaration", "." ]
def GetParamsInDeclaration(self, native): """Returns the params for the forward declaration. Args: native: the native dictionary describing the method. Returns: A string containing the params. """ return ',\n '.join(self.GetJNIFirstParam(native, True) + [Ja...
[ "def", "GetParamsInDeclaration", "(", "self", ",", "native", ")", ":", "return", "',\\n '", ".", "join", "(", "self", ".", "GetJNIFirstParam", "(", "native", ",", "True", ")", "+", "[", "JavaDataTypeToCForDeclaration", "(", "param", ".", "datatype", ")", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/base/android/jni_generator/jni_generator.py#L911-L923
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/feature_column/feature_column.py
python
_DenseColumn._variable_shape
(self)
`TensorShape` of `_get_dense_tensor`, without batch dimension.
`TensorShape` of `_get_dense_tensor`, without batch dimension.
[ "TensorShape", "of", "_get_dense_tensor", "without", "batch", "dimension", "." ]
def _variable_shape(self): """`TensorShape` of `_get_dense_tensor`, without batch dimension.""" pass
[ "def", "_variable_shape", "(", "self", ")", ":", "pass" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/feature_column/feature_column.py#L1372-L1374
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_polygon.py
python
PolygonDomain.getLineWidth
(self, polygonID)
return self._getUniversal(tc.VAR_WIDTH, polygonID)
getLineWidth(string) -> double Returns drawing width of unfilled polygon
getLineWidth(string) -> double Returns drawing width of unfilled polygon
[ "getLineWidth", "(", "string", ")", "-", ">", "double", "Returns", "drawing", "width", "of", "unfilled", "polygon" ]
def getLineWidth(self, polygonID): """getLineWidth(string) -> double Returns drawing width of unfilled polygon """ return self._getUniversal(tc.VAR_WIDTH, polygonID)
[ "def", "getLineWidth", "(", "self", ",", "polygonID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_WIDTH", ",", "polygonID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_polygon.py#L60-L64
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/gelu_ds.py
python
_gelu_ds_tbe
()
return
GeLU TBE register
GeLU TBE register
[ "GeLU", "TBE", "register" ]
def _gelu_ds_tbe(): """GeLU TBE register""" return
[ "def", "_gelu_ds_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/gelu_ds.py#L36-L38
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/internal/python_message.py
python
_IsPresent
(item)
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
[ "Given", "a", "(", "FieldDescriptor", "value", ")", "tuple", "from", "_fields", "return", "true", "if", "the", "value", "should", "be", "included", "in", "the", "list", "returned", "by", "ListFields", "()", "." ]
def _IsPresent(item): """Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().""" if item[0].label == _FieldDescriptor.LABEL_REPEATED: return bool(item[1]) elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE: return ...
[ "def", "_IsPresent", "(", "item", ")", ":", "if", "item", "[", "0", "]", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "return", "bool", "(", "item", "[", "1", "]", ")", "elif", "item", "[", "0", "]", ".", "cpp_type", "==", "_...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/internal/python_message.py#L717-L726