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
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/websocket.py
python
WebSocketClientConnection.close
(self, code: Optional[int] = None, reason: Optional[str] = None)
Closes the websocket connection. ``code`` and ``reason`` are documented under `WebSocketHandler.close`. .. versionadded:: 3.2 .. versionchanged:: 4.0 Added the ``code`` and ``reason`` arguments.
Closes the websocket connection.
[ "Closes", "the", "websocket", "connection", "." ]
def close(self, code: Optional[int] = None, reason: Optional[str] = None) -> None: """Closes the websocket connection. ``code`` and ``reason`` are documented under `WebSocketHandler.close`. .. versionadded:: 3.2 .. versionchanged:: 4.0 Added the ``code`` and ``reas...
[ "def", "close", "(", "self", ",", "code", ":", "Optional", "[", "int", "]", "=", "None", ",", "reason", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "None", ":", "if", "self", ".", "protocol", "is", "not", "None", ":", "self", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/websocket.py#L1427-L1441
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/macosx.py
python
isCarbonTk
()
return _tk_type == "carbon"
Returns True if IDLE is using a Carbon Aqua Tk (instead of the newer Cocoa Aqua Tk).
Returns True if IDLE is using a Carbon Aqua Tk (instead of the newer Cocoa Aqua Tk).
[ "Returns", "True", "if", "IDLE", "is", "using", "a", "Carbon", "Aqua", "Tk", "(", "instead", "of", "the", "newer", "Cocoa", "Aqua", "Tk", ")", "." ]
def isCarbonTk(): """ Returns True if IDLE is using a Carbon Aqua Tk (instead of the newer Cocoa Aqua Tk). """ if not _tk_type: _init_tk_type() return _tk_type == "carbon"
[ "def", "isCarbonTk", "(", ")", ":", "if", "not", "_tk_type", ":", "_init_tk_type", "(", ")", "return", "_tk_type", "==", "\"carbon\"" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/macosx.py#L45-L52
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/ShipDesignAI.py
python
recursive_dict_diff
( dict_new: Dict[KT, VT], dict_old: Dict[KT, VT], dict_diff: Dict[KT, VT], diff_level_threshold=0 )
return min_diff_level
Find the entries in dict_new that are not present in dict_old and store them in dict_diff. Example usage: dict_a = {1:2, 2: {2: 3, 3: 4}} dict_b = {2: {2: 3, 3: 3}} diff = {} recursive_dict_diff(dict_a, dict_b, diff) --> diff = {1:2, 2:{3:4}} :param dict_diff: Difference between dict_old a...
Find the entries in dict_new that are not present in dict_old and store them in dict_diff.
[ "Find", "the", "entries", "in", "dict_new", "that", "are", "not", "present", "in", "dict_old", "and", "store", "them", "in", "dict_diff", "." ]
def recursive_dict_diff( dict_new: Dict[KT, VT], dict_old: Dict[KT, VT], dict_diff: Dict[KT, VT], diff_level_threshold=0 ) -> int: """Find the entries in dict_new that are not present in dict_old and store them in dict_diff. Example usage: dict_a = {1:2, 2: {2: 3, 3: 4}} dict_b = {2: {2: 3, 3: 3}} ...
[ "def", "recursive_dict_diff", "(", "dict_new", ":", "Dict", "[", "KT", ",", "VT", "]", ",", "dict_old", ":", "Dict", "[", "KT", ",", "VT", "]", ",", "dict_diff", ":", "Dict", "[", "KT", ",", "VT", "]", ",", "diff_level_threshold", "=", "0", ")", "-...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/ShipDesignAI.py#L2228-L2260
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/parser.py
python
Parser.parse_set
(self)
return nodes.AssignBlock(target, filter_node, body, lineno=lineno)
Parse an assign statement.
Parse an assign statement.
[ "Parse", "an", "assign", "statement", "." ]
def parse_set(self) -> t.Union[nodes.Assign, nodes.AssignBlock]: """Parse an assign statement.""" lineno = next(self.stream).lineno target = self.parse_assign_target(with_namespace=True) if self.stream.skip_if("assign"): expr = self.parse_tuple() return nodes.Assi...
[ "def", "parse_set", "(", "self", ")", "->", "t", ".", "Union", "[", "nodes", ".", "Assign", ",", "nodes", ".", "AssignBlock", "]", ":", "lineno", "=", "next", "(", "self", ".", "stream", ")", ".", "lineno", "target", "=", "self", ".", "parse_assign_t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/parser.py#L223-L232
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexes/multi.py
python
MultiIndex.equal_levels
(self, other)
return True
Return True if the levels of both MultiIndex objects are the same
Return True if the levels of both MultiIndex objects are the same
[ "Return", "True", "if", "the", "levels", "of", "both", "MultiIndex", "objects", "are", "the", "same" ]
def equal_levels(self, other): """ Return True if the levels of both MultiIndex objects are the same """ if self.nlevels != other.nlevels: return False for i in range(self.nlevels): if not self.levels[i].equals(other.levels[i]): return Fa...
[ "def", "equal_levels", "(", "self", ",", "other", ")", ":", "if", "self", ".", "nlevels", "!=", "other", ".", "nlevels", ":", "return", "False", "for", "i", "in", "range", "(", "self", ".", "nlevels", ")", ":", "if", "not", "self", ".", "levels", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/multi.py#L2869-L2880
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
bindings/pydrake/systems/meshcat_visualizer.py
python
MeshcatVisualizer.load
(self, context=None)
Loads ``meshcat`` visualization elements. Precondition: Either the context is a valid Context for this system with the geometry_query port connected or the ``scene_graph`` passed in the constructor must be a valid SceneGraph.
Loads ``meshcat`` visualization elements.
[ "Loads", "meshcat", "visualization", "elements", "." ]
def load(self, context=None): """ Loads ``meshcat`` visualization elements. Precondition: Either the context is a valid Context for this system with the geometry_query port connected or the ``scene_graph`` passed in the constructor must be a valid SceneGraph....
[ "def", "load", "(", "self", ",", "context", "=", "None", ")", ":", "if", "self", ".", "_delete_prefix_on_load", ":", "self", ".", "vis", "[", "self", ".", "prefix", "]", ".", "delete", "(", ")", "if", "context", "and", "self", ".", "get_geometry_query_...
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/systems/meshcat_visualizer.py#L412-L577
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
ci/xbuild/extension.py
python
Extension.build
(self)
Main "build" command: compiles and links a dynamic library of the extension.
Main "build" command: compiles and links a dynamic library of the extension.
[ "Main", "build", "command", ":", "compiles", "and", "links", "a", "dynamic", "library", "of", "the", "extension", "." ]
def build(self): """ Main "build" command: compiles and links a dynamic library of the extension. """ if not self.name: raise ValueError("An extension doesn't have a name") if not self.sources: raise ValueError("No source files were specified for c...
[ "def", "build", "(", "self", ")", ":", "if", "not", "self", ".", "name", ":", "raise", "ValueError", "(", "\"An extension doesn't have a name\"", ")", "if", "not", "self", ".", "sources", ":", "raise", "ValueError", "(", "\"No source files were specified for compi...
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/ci/xbuild/extension.py#L425-L448
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
_DropCommonSuffixes
(filename)
return os.path.splitext(filename)[0]
Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCommonSuffixes('foo/foo_unusualinternal.h')...
Drops common suffixes like _test.cc or -inl.h from filename.
[ "Drops", "common", "suffixes", "like", "_test", ".", "cc", "or", "-", "inl", ".", "h", "from", "filename", "." ]
def _DropCommonSuffixes(filename): """Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCom...
[ "def", "_DropCommonSuffixes", "(", "filename", ")", ":", "for", "suffix", "in", "(", "'test.cc'", ",", "'regtest.cc'", ",", "'unittest.cc'", ",", "'inl.h'", ",", "'impl.h'", ",", "'internal.h'", ")", ":", "if", "(", "filename", ".", "endswith", "(", "suffix"...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L2911-L2935
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/mongosymb.py
python
S3BuildidDbgFileResolver.get_dbg_file
(self, soinfo)
return build_id_path
Return dbg file name.
Return dbg file name.
[ "Return", "dbg", "file", "name", "." ]
def get_dbg_file(self, soinfo): """Return dbg file name.""" build_id = soinfo.get("buildId", None) if build_id is None: return None build_id = build_id.lower() build_id_path = os.path.join(self._cache_dir, build_id + ".debug") if not os.path.exists(build_id_pa...
[ "def", "get_dbg_file", "(", "self", ",", "soinfo", ")", ":", "build_id", "=", "soinfo", ".", "get", "(", "\"buildId\"", ",", "None", ")", "if", "build_id", "is", "None", ":", "return", "None", "build_id", "=", "build_id", ".", "lower", "(", ")", "build...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/mongosymb.py#L66-L83
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/mailbox.py
python
Mailbox._dump_message
(self, message, target, mangle_from_=False)
Dump message contents to target file.
Dump message contents to target file.
[ "Dump", "message", "contents", "to", "target", "file", "." ]
def _dump_message(self, message, target, mangle_from_=False): # This assumes the target file is open in binary mode. """Dump message contents to target file.""" if isinstance(message, email.message.Message): buffer = io.BytesIO() gen = email.generator.BytesGenerator(buffe...
[ "def", "_dump_message", "(", "self", ",", "message", ",", "target", ",", "mangle_from_", "=", "False", ")", ":", "# This assumes the target file is open in binary mode.", "if", "isinstance", "(", "message", ",", "email", ".", "message", ".", "Message", ")", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L210-L262
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py2/more_itertools/more.py
python
difference
(iterable, func=sub)
return chain([item], map(lambda x: func(x[1], x[0]), zip(a, b)))
By default, compute the first difference of *iterable* using :func:`operator.sub`. >>> iterable = [0, 1, 3, 6, 10] >>> list(difference(iterable)) [0, 1, 2, 3, 4] This is the opposite of :func:`accumulate`'s default behavior: >>> from more_itertools import accumulate >>...
By default, compute the first difference of *iterable* using :func:`operator.sub`.
[ "By", "default", "compute", "the", "first", "difference", "of", "*", "iterable", "*", "using", ":", "func", ":", "operator", ".", "sub", "." ]
def difference(iterable, func=sub): """By default, compute the first difference of *iterable* using :func:`operator.sub`. >>> iterable = [0, 1, 3, 6, 10] >>> list(difference(iterable)) [0, 1, 2, 3, 4] This is the opposite of :func:`accumulate`'s default behavior: >>> from ...
[ "def", "difference", "(", "iterable", ",", "func", "=", "sub", ")", ":", "a", ",", "b", "=", "tee", "(", "iterable", ")", "try", ":", "item", "=", "next", "(", "b", ")", "except", "StopIteration", ":", "return", "iter", "(", "[", "]", ")", "retur...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py2/more_itertools/more.py#L1872-L1907
tcpexmachina/remy
687b5db29b81df7ae8737889c78b47e7f9788297
scripts/plot_log.py
python
BaseAnimationGenerator.initial
(self, run_data)
Initializes the animation. This function is passed to FuncAnimation; see the matplotlib animations documentation for details.
Initializes the animation. This function is passed to FuncAnimation; see the matplotlib animations documentation for details.
[ "Initializes", "the", "animation", ".", "This", "function", "is", "passed", "to", "FuncAnimation", ";", "see", "the", "matplotlib", "animations", "documentation", "for", "details", "." ]
def initial(self, run_data): """Initializes the animation. This function is passed to FuncAnimation; see the matplotlib animations documentation for details.""" raise NotImplementedError("Subclasses must implement initial()")
[ "def", "initial", "(", "self", ",", "run_data", ")", ":", "raise", "NotImplementedError", "(", "\"Subclasses must implement initial()\"", ")" ]
https://github.com/tcpexmachina/remy/blob/687b5db29b81df7ae8737889c78b47e7f9788297/scripts/plot_log.py#L156-L159
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
Mass.setCom
(self, _com: "doubleVector")
return _robotsim.Mass_setCom(self, _com)
r""" setCom(Mass self, doubleVector _com)
r""" setCom(Mass self, doubleVector _com)
[ "r", "setCom", "(", "Mass", "self", "doubleVector", "_com", ")" ]
def setCom(self, _com: "doubleVector") -> "void": r""" setCom(Mass self, doubleVector _com) """ return _robotsim.Mass_setCom(self, _com)
[ "def", "setCom", "(", "self", ",", "_com", ":", "\"doubleVector\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "Mass_setCom", "(", "self", ",", "_com", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3906-L3912
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
BookCtrlBase.GetPageText
(*args, **kwargs)
return _core_.BookCtrlBase_GetPageText(*args, **kwargs)
GetPageText(self, size_t n) -> String
GetPageText(self, size_t n) -> String
[ "GetPageText", "(", "self", "size_t", "n", ")", "-", ">", "String" ]
def GetPageText(*args, **kwargs): """GetPageText(self, size_t n) -> String""" return _core_.BookCtrlBase_GetPageText(*args, **kwargs)
[ "def", "GetPageText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "BookCtrlBase_GetPageText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13558-L13560
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.bookmark_curr_node
(self, *args)
Add the Current Node to the Bookmarks List
Add the Current Node to the Bookmarks List
[ "Add", "the", "Current", "Node", "to", "the", "Bookmarks", "List" ]
def bookmark_curr_node(self, *args): """Add the Current Node to the Bookmarks List""" if not self.is_there_selected_node_or_error(): return curr_node_id_str = str(self.get_node_id_from_tree_iter(self.curr_tree_iter)) if not curr_node_id_str in self.bookmarks: self.bookmarks.a...
[ "def", "bookmark_curr_node", "(", "self", ",", "*", "args", ")", ":", "if", "not", "self", ".", "is_there_selected_node_or_error", "(", ")", ":", "return", "curr_node_id_str", "=", "str", "(", "self", ".", "get_node_id_from_tree_iter", "(", "self", ".", "curr_...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L5225-L5234
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextObject_DrawBorder
(*args, **kwargs)
return _richtext.RichTextObject_DrawBorder(*args, **kwargs)
RichTextObject_DrawBorder(DC dc, RichTextBuffer buffer, TextAttrBorders attr, Rect rect, int flags=0) -> bool
RichTextObject_DrawBorder(DC dc, RichTextBuffer buffer, TextAttrBorders attr, Rect rect, int flags=0) -> bool
[ "RichTextObject_DrawBorder", "(", "DC", "dc", "RichTextBuffer", "buffer", "TextAttrBorders", "attr", "Rect", "rect", "int", "flags", "=", "0", ")", "-", ">", "bool" ]
def RichTextObject_DrawBorder(*args, **kwargs): """ RichTextObject_DrawBorder(DC dc, RichTextBuffer buffer, TextAttrBorders attr, Rect rect, int flags=0) -> bool """ return _richtext.RichTextObject_DrawBorder(*args, **kwargs)
[ "def", "RichTextObject_DrawBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_DrawBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1471-L1476
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
_ClassifyInclude
(fileinfo, include, is_system)
return _OTHER_HEADER
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyIn...
Figures out what kind of header 'include' is.
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "is_system", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_cpp_h", "=", "include", "in", "_CPP_HEADERS", "# Headers with C++ extensions shouldn't be c...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L4609-L4671
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mhlib.py
python
Folder.listallsubfolders
(self)
return self.mh.listallsubfolders(self.name)
Return list of all subfolders.
Return list of all subfolders.
[ "Return", "list", "of", "all", "subfolders", "." ]
def listallsubfolders(self): """Return list of all subfolders.""" return self.mh.listallsubfolders(self.name)
[ "def", "listallsubfolders", "(", "self", ")", ":", "return", "self", ".", "mh", ".", "listallsubfolders", "(", "self", ".", "name", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mhlib.py#L276-L278
pmneila/PyMaxflow
ea053dfd0ee6d76969835c7bd87bf520c650c36d
maxflow/fastmin.py
python
abswap_grid
(D, V, max_cycles=None, labels=None)
return labels
Minimize an energy function iterating the alpha-beta-swap until convergence or until a maximum number of cycles, given by ``max_cycles``, is reached. ``D`` must be a N+1-dimensional array with shape (S1,...,SN,L), where L is the number of labels considered. *D[p1,...,pn,lbl]* is the unary cost of a...
Minimize an energy function iterating the alpha-beta-swap until convergence or until a maximum number of cycles, given by ``max_cycles``, is reached.
[ "Minimize", "an", "energy", "function", "iterating", "the", "alpha", "-", "beta", "-", "swap", "until", "convergence", "or", "until", "a", "maximum", "number", "of", "cycles", "given", "by", "max_cycles", "is", "reached", "." ]
def abswap_grid(D, V, max_cycles=None, labels=None): """ Minimize an energy function iterating the alpha-beta-swap until convergence or until a maximum number of cycles, given by ``max_cycles``, is reached. ``D`` must be a N+1-dimensional array with shape (S1,...,SN,L), where L is the number of...
[ "def", "abswap_grid", "(", "D", ",", "V", ",", "max_cycles", "=", "None", ",", "labels", "=", "None", ")", ":", "num_labels", "=", "D", ".", "shape", "[", "-", "1", "]", "if", "labels", "is", "None", ":", "# Avoid using too much memory.", "if", "num_la...
https://github.com/pmneila/PyMaxflow/blob/ea053dfd0ee6d76969835c7bd87bf520c650c36d/maxflow/fastmin.py#L59-L128
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet3Plus/unet_collection/unet_2d.py
python
unet_2d
(input_size, filter_num, n_labels, stack_num_down=2, stack_num_up=2, activation='ReLU', output_activation='Softmax', batch_norm=False, pool=True, unpool=True, name='unet')
return model
U-net unet_2d(input_size, filter_num, n_labels, stack_num_down=2, stack_num_up=2, activation='ReLU', output_activation='Softmax', batch_norm=False, pool=True, unpool=True, name='unet') ---------- Ronneberger, O., Fischer, P. and Brox, T., 2015, October. U-net: ...
U-net unet_2d(input_size, filter_num, n_labels, stack_num_down=2, stack_num_up=2, activation='ReLU', output_activation='Softmax', batch_norm=False, pool=True, unpool=True, name='unet') ---------- Ronneberger, O., Fischer, P. and Brox, T., 2015, October. U-net: ...
[ "U", "-", "net", "unet_2d", "(", "input_size", "filter_num", "n_labels", "stack_num_down", "=", "2", "stack_num_up", "=", "2", "activation", "=", "ReLU", "output_activation", "=", "Softmax", "batch_norm", "=", "False", "pool", "=", "True", "unpool", "=", "True...
def unet_2d(input_size, filter_num, n_labels, stack_num_down=2, stack_num_up=2, activation='ReLU', output_activation='Softmax', batch_norm=False, pool=True, unpool=True, name='unet'): ''' U-net unet_2d(input_size, filter_num, n_labels, stack_num_down=2, ...
[ "def", "unet_2d", "(", "input_size", ",", "filter_num", ",", "n_labels", ",", "stack_num_down", "=", "2", ",", "stack_num_up", "=", "2", ",", "activation", "=", "'ReLU'", ",", "output_activation", "=", "'Softmax'", ",", "batch_norm", "=", "False", ",", "pool...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet3Plus/unet_collection/unet_2d.py#L93-L156
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_base.py
python
BaseFix.transform
(self, node, results)
Returns the transformation for a given parse tree node. Args: node: the root of the parse tree that matched the fixer. results: a dict mapping symbolic names to part of the match. Returns: None, or a node that is a modified copy of the argument node. The node a...
Returns the transformation for a given parse tree node.
[ "Returns", "the", "transformation", "for", "a", "given", "parse", "tree", "node", "." ]
def transform(self, node, results): """Returns the transformation for a given parse tree node. Args: node: the root of the parse tree that matched the fixer. results: a dict mapping symbolic names to part of the match. Returns: None, or a node that is a modified c...
[ "def", "transform", "(", "self", ",", "node", ",", "results", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_base.py#L92-L106
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Misc.winfo_screenheight
(self)
return self.tk.getint( self.tk.call('winfo', 'screenheight', self._w))
Return the number of pixels of the height of the screen of this widget in pixel.
Return the number of pixels of the height of the screen of this widget in pixel.
[ "Return", "the", "number", "of", "pixels", "of", "the", "height", "of", "the", "screen", "of", "this", "widget", "in", "pixel", "." ]
def winfo_screenheight(self): """Return the number of pixels of the height of the screen of this widget in pixel.""" return self.tk.getint( self.tk.call('winfo', 'screenheight', self._w))
[ "def", "winfo_screenheight", "(", "self", ")", ":", "return", "self", ".", "tk", ".", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'screenheight'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1078-L1082
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/cpplint.py
python
_CppLintState.BackupFilters
(self)
Saves the current filter list to backup storage.
Saves the current filter list to backup storage.
[ "Saves", "the", "current", "filter", "list", "to", "backup", "storage", "." ]
def BackupFilters(self): """ Saves the current filter list to backup storage.""" self._filters_backup = self.filters[:]
[ "def", "BackupFilters", "(", "self", ")", ":", "self", ".", "_filters_backup", "=", "self", ".", "filters", "[", ":", "]" ]
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L1322-L1324
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MouseState.SetLeftDown
(*args, **kwargs)
return _core_.MouseState_SetLeftDown(*args, **kwargs)
SetLeftDown(self, bool down)
SetLeftDown(self, bool down)
[ "SetLeftDown", "(", "self", "bool", "down", ")" ]
def SetLeftDown(*args, **kwargs): """SetLeftDown(self, bool down)""" return _core_.MouseState_SetLeftDown(*args, **kwargs)
[ "def", "SetLeftDown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MouseState_SetLeftDown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L4494-L4496
ros-planning/moveit2
dd240ef6fd8b9932a7a53964140f2952786187a9
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.get_planning_time
(self)
return self._g.get_planning_time()
Specify the amount of time to be used for motion planning.
Specify the amount of time to be used for motion planning.
[ "Specify", "the", "amount", "of", "time", "to", "be", "used", "for", "motion", "planning", "." ]
def get_planning_time(self): """ Specify the amount of time to be used for motion planning. """ return self._g.get_planning_time()
[ "def", "get_planning_time", "(", "self", ")", ":", "return", "self", ".", "_g", ".", "get_planning_time", "(", ")" ]
https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L532-L534
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/powercycle/powercycle.py
python
abs_path
(path)
return os.path.abspath(os.path.normpath(path))
Return absolute path for 'path'. Raises an exception on failure.
Return absolute path for 'path'. Raises an exception on failure.
[ "Return", "absolute", "path", "for", "path", ".", "Raises", "an", "exception", "on", "failure", "." ]
def abs_path(path): """Return absolute path for 'path'. Raises an exception on failure.""" if _IS_WINDOWS: # Get the Windows absolute path. cmd = "cygpath -wa {}".format(path) ret, output = execute_cmd(cmd, use_file=True) if ret: raise Exception("Command \"{}\" failed...
[ "def", "abs_path", "(", "path", ")", ":", "if", "_IS_WINDOWS", ":", "# Get the Windows absolute path.", "cmd", "=", "\"cygpath -wa {}\"", ".", "format", "(", "path", ")", "ret", ",", "output", "=", "execute_cmd", "(", "cmd", ",", "use_file", "=", "True", ")"...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/powercycle/powercycle.py#L265-L275
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/chat.py
python
Chat.id
(self)
return self._id
Gets the id of this Chat. # noqa: E501 :return: The id of this Chat. # noqa: E501 :rtype: float
Gets the id of this Chat. # noqa: E501
[ "Gets", "the", "id", "of", "this", "Chat", ".", "#", "noqa", ":", "E501" ]
def id(self): """Gets the id of this Chat. # noqa: E501 :return: The id of this Chat. # noqa: E501 :rtype: float """ return self._id
[ "def", "id", "(", "self", ")", ":", "return", "self", ".", "_id" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/chat.py#L77-L84
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/cgi.py
python
FieldStorage.__len__
(self)
return len(self.keys())
Dictionary style len(x) support.
Dictionary style len(x) support.
[ "Dictionary", "style", "len", "(", "x", ")", "support", "." ]
def __len__(self): """Dictionary style len(x) support.""" return len(self.keys())
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "keys", "(", ")", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cgi.py#L598-L600
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_ocb.py
python
OcbMode.update
(self, assoc_data)
return self
Process the associated data. If there is any associated data, the caller has to invoke this method one or more times, before using ``decrypt`` or ``encrypt``. By *associated data* it is meant any data (e.g. packet headers) that will not be encrypted and will be transmitted in t...
Process the associated data.
[ "Process", "the", "associated", "data", "." ]
def update(self, assoc_data): """Process the associated data. If there is any associated data, the caller has to invoke this method one or more times, before using ``decrypt`` or ``encrypt``. By *associated data* it is meant any data (e.g. packet headers) that will not ...
[ "def", "update", "(", "self", ",", "assoc_data", ")", ":", "if", "self", ".", "update", "not", "in", "self", ".", "_next", ":", "raise", "TypeError", "(", "\"update() can only be called\"", "\" immediately after initialization\"", ")", "self", ".", "_next", "=",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_ocb.py#L199-L242
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/command_args.py
python
CmdArguments.get_targets
(self)
return self.targets
Returns the targets from command line.
Returns the targets from command line.
[ "Returns", "the", "targets", "from", "command", "line", "." ]
def get_targets(self): """Returns the targets from command line.""" return self.targets
[ "def", "get_targets", "(", "self", ")", ":", "return", "self", ".", "targets" ]
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/command_args.py#L387-L389
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
benchmarks/distributed/rpc/rl/observer.py
python
ObserverBase.__init__
(self)
r""" Inits observer class
r""" Inits observer class
[ "r", "Inits", "observer", "class" ]
def __init__(self): r""" Inits observer class """ self.id = rpc.get_worker_info().id
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "id", "=", "rpc", ".", "get_worker_info", "(", ")", ".", "id" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/distributed/rpc/rl/observer.py#L12-L16
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_TAGGED_PROPERTY.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ buf.writeInt(self.property) buf.writeInt(self.value)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "buf", ".", "writeInt", "(", "self", ".", "property", ")", "buf", ".", "writeInt", "(", "self", ".", "value", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4305-L4308
discord/discord-rpc
963aa9f3e5ce81a4682c6ca3d136cddda614db33
build.py
python
sign
()
Do code signing within install directory using our cert
Do code signing within install directory using our cert
[ "Do", "code", "signing", "within", "install", "directory", "using", "our", "cert" ]
def sign(): """ Do code signing within install directory using our cert """ tool = get_signtool() signable_extensions = set() if PLATFORM == 'win': signable_extensions.add('.dll') sign_command_base = [ tool, 'sign', '/n', 'Discord Inc.', ...
[ "def", "sign", "(", ")", ":", "tool", "=", "get_signtool", "(", ")", "signable_extensions", "=", "set", "(", ")", "if", "PLATFORM", "==", "'win'", ":", "signable_extensions", ".", "add", "(", "'.dll'", ")", "sign_command_base", "=", "[", "tool", ",", "'s...
https://github.com/discord/discord-rpc/blob/963aa9f3e5ce81a4682c6ca3d136cddda614db33/build.py#L201-L246
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py
python
EmacsMode.end_kbd_macro
(self, e)
Stop saving the characters typed into the current keyboard macro and save the definition.
Stop saving the characters typed into the current keyboard macro and save the definition.
[ "Stop", "saving", "the", "characters", "typed", "into", "the", "current", "keyboard", "macro", "and", "save", "the", "definition", "." ]
def end_kbd_macro(self, e): # (C-x )) '''Stop saving the characters typed into the current keyboard macro and save the definition.''' pass
[ "def", "end_kbd_macro", "(", "self", ",", "e", ")", ":", "# (C-x ))", "pass" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L444-L447
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextRange.GetEnd
(*args, **kwargs)
return _richtext.RichTextRange_GetEnd(*args, **kwargs)
GetEnd(self) -> long
GetEnd(self) -> long
[ "GetEnd", "(", "self", ")", "-", ">", "long" ]
def GetEnd(*args, **kwargs): """GetEnd(self) -> long""" return _richtext.RichTextRange_GetEnd(*args, **kwargs)
[ "def", "GetEnd", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextRange_GetEnd", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L982-L984
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/transforms/functional.py
python
resize
(img, size, interpolation='bilinear')
Resizes the image to given size Args: input (PIL.Image|np.ndarray): Image to be resized. size (int|list|tuple): Target size of input data, with (height, width) shape. interpolation (int|str, optional): Interpolation method. when use pil backend, support method are as following:...
Resizes the image to given size
[ "Resizes", "the", "image", "to", "given", "size" ]
def resize(img, size, interpolation='bilinear'): """ Resizes the image to given size Args: input (PIL.Image|np.ndarray): Image to be resized. size (int|list|tuple): Target size of input data, with (height, width) shape. interpolation (int|str, optional): Interpolation method. when u...
[ "def", "resize", "(", "img", ",", "size", ",", "interpolation", "=", "'bilinear'", ")", ":", "if", "not", "(", "_is_pil_image", "(", "img", ")", "or", "_is_numpy_image", "(", "img", ")", "or", "_is_tensor_image", "(", "img", ")", ")", ":", "raise", "Ty...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/transforms/functional.py#L89-L142
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/mox.py
python
IsA.__init__
(self, class_name)
Initialize IsA Args: class_name: basic python type or a class
Initialize IsA
[ "Initialize", "IsA" ]
def __init__(self, class_name): """Initialize IsA Args: class_name: basic python type or a class """ self._class_name = class_name
[ "def", "__init__", "(", "self", ",", "class_name", ")", ":", "self", ".", "_class_name", "=", "class_name" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L798-L805
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/lang/ops.py
python
ceil
(a)
return _unary_operation(_ti_core.expr_ceil, math.ceil, a)
The ceil function. Args: a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix. Returns: The least integer greater than or equal to `a`.
The ceil function.
[ "The", "ceil", "function", "." ]
def ceil(a): """The ceil function. Args: a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix. Returns: The least integer greater than or equal to `a`. """ return _unary_operation(_ti_core.expr_ceil, math.ceil, a)
[ "def", "ceil", "(", "a", ")", ":", "return", "_unary_operation", "(", "_ti_core", ".", "expr_ceil", ",", "math", ".", "ceil", ",", "a", ")" ]
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/ops.py#L281-L290
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
shm/lib/nanopb/generator/nanopb_generator.py
python
ExtensionRange.__init__
(self, struct_name, range_start, field_options)
Implements a special pb_extension_t* field in an extensible message structure. The range_start signifies the index at which the extensions start. Not necessarily all tags above this are extensions, it is merely a speed optimization.
Implements a special pb_extension_t* field in an extensible message structure. The range_start signifies the index at which the extensions start. Not necessarily all tags above this are extensions, it is merely a speed optimization.
[ "Implements", "a", "special", "pb_extension_t", "*", "field", "in", "an", "extensible", "message", "structure", ".", "The", "range_start", "signifies", "the", "index", "at", "which", "the", "extensions", "start", ".", "Not", "necessarily", "all", "tags", "above"...
def __init__(self, struct_name, range_start, field_options): '''Implements a special pb_extension_t* field in an extensible message structure. The range_start signifies the index at which the extensions start. Not necessarily all tags above this are extensions, it is merely a speed optim...
[ "def", "__init__", "(", "self", ",", "struct_name", ",", "range_start", ",", "field_options", ")", ":", "self", ".", "tag", "=", "range_start", "self", ".", "struct_name", "=", "struct_name", "self", ".", "name", "=", "'extensions'", "self", ".", "pbtype", ...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/shm/lib/nanopb/generator/nanopb_generator.py#L606-L623
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/jsmin.py
python
JavaScriptMinifier.LookAtIdentifier
(self, m)
Records identifiers or keywords that we see in use. (So we can avoid renaming variables to these strings.) Args: m: The match object returned by re.search. Returns: Nothing.
Records identifiers or keywords that we see in use.
[ "Records", "identifiers", "or", "keywords", "that", "we", "see", "in", "use", "." ]
def LookAtIdentifier(self, m): """Records identifiers or keywords that we see in use. (So we can avoid renaming variables to these strings.) Args: m: The match object returned by re.search. Returns: Nothing. """ identifier = m.group(1) self.seen_identifiers[identifier] = True
[ "def", "LookAtIdentifier", "(", "self", ",", "m", ")", ":", "identifier", "=", "m", ".", "group", "(", "1", ")", "self", ".", "seen_identifiers", "[", "identifier", "]", "=", "True" ]
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/jsmin.py#L63-L74
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py
python
input_producer
(input_tensor, element_shape=None, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, summary_name=None, name=None, cancel_op=N...
Output the rows of `input_tensor` to a queue for an input pipeline. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. Args: input_tensor: A tensor with the rows to produce. Must be at least one-dimensio...
Output the rows of `input_tensor` to a queue for an input pipeline.
[ "Output", "the", "rows", "of", "input_tensor", "to", "a", "queue", "for", "an", "input", "pipeline", "." ]
def input_producer(input_tensor, element_shape=None, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, summary_name=None, name=None, ...
[ "def", "input_producer", "(", "input_tensor", ",", "element_shape", "=", "None", ",", "num_epochs", "=", "None", ",", "shuffle", "=", "True", ",", "seed", "=", "None", ",", "capacity", "=", "32", ",", "shared_name", "=", "None", ",", "summary_name", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py#L123-L202
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py
python
Block.take_nd
(self, indexer, axis, new_mgr_locs=None, fill_tuple=None)
Take values according to indexer and return them as a block.bb
Take values according to indexer and return them as a block.bb
[ "Take", "values", "according", "to", "indexer", "and", "return", "them", "as", "a", "block", ".", "bb" ]
def take_nd(self, indexer, axis, new_mgr_locs=None, fill_tuple=None): """ Take values according to indexer and return them as a block.bb """ # algos.take_nd dispatches for DatetimeTZBlock, CategoricalBlock # so need to preserve types # sparse is treated like an ndarray,...
[ "def", "take_nd", "(", "self", ",", "indexer", ",", "axis", ",", "new_mgr_locs", "=", "None", ",", "fill_tuple", "=", "None", ")", ":", "# algos.take_nd dispatches for DatetimeTZBlock, CategoricalBlock", "# so need to preserve types", "# sparse is treated like an ndarray, but...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py#L1271-L1303
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/git_base.py
python
Repository.git_reset
(self, args)
return self._callgito("reset", args)
Run a git reset command.
Run a git reset command.
[ "Run", "a", "git", "reset", "command", "." ]
def git_reset(self, args): """Run a git reset command.""" return self._callgito("reset", args)
[ "def", "git_reset", "(", "self", ",", "args", ")", ":", "return", "self", ".", "_callgito", "(", "\"reset\"", ",", "args", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/git_base.py#L56-L58
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__reduce__
(self)
return self.__class__, (items,)
Return state information for pickling
Return state information for pickling
[ "Return", "state", "information", "for", "pickling" ]
def __reduce__(self): 'Return state information for pickling' items = [[k, self[k]] for k in self] inst_dict = vars(self).copy() for k in vars(OrderedDict()): inst_dict.pop(k, None) if inst_dict: return (self.__class__, (items,), inst_dict) return ...
[ "def", "__reduce__", "(", "self", ")", ":", "items", "=", "[", "[", "k", ",", "self", "[", "k", "]", "]", "for", "k", "in", "self", "]", "inst_dict", "=", "vars", "(", "self", ")", ".", "copy", "(", ")", "for", "k", "in", "vars", "(", "Ordere...
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/ordered_dict.py#L239-L247
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/archive_functions.py
python
packAndSendOrthos
(run, logger)
Archive the created ortho images.
Archive the created ortho images.
[ "Archive", "the", "created", "ortho", "images", "." ]
def packAndSendOrthos(run, logger): '''Archive the created ortho images.''' logger.info('Archiving ortho images for run ' + str(run)) cwd = os.getcwd() os.chdir(run.parentFolder) runFolder = str(run) fileName = run.getOrthoTarName() lfePath = os.path.join(REMOTE_ORTHO_FOLDER, fileNam...
[ "def", "packAndSendOrthos", "(", "run", ",", "logger", ")", ":", "logger", ".", "info", "(", "'Archiving ortho images for run '", "+", "str", "(", "run", ")", ")", "cwd", "=", "os", ".", "getcwd", "(", ")", "os", ".", "chdir", "(", "run", ".", "parentF...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/archive_functions.py#L350-L373
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geodesy/props.py
python
match
(msg, key_set)
return None
Match message properties. :param msg: Message containing properties. :param key_set: Set of property keys to match. :returns: (key, value) of first property matched; None otherwise. :raises: :exc:`ValueError` if key_set is not a set
Match message properties.
[ "Match", "message", "properties", "." ]
def match(msg, key_set): """ Match message properties. :param msg: Message containing properties. :param key_set: Set of property keys to match. :returns: (key, value) of first property matched; None otherwise. :raises: :exc:`ValueError` if key_set is not a set """ if type(key_set) is n...
[ "def", "match", "(", "msg", ",", "key_set", ")", ":", "if", "type", "(", "key_set", ")", "is", "not", "set", ":", "raise", "ValueError", "(", "'property matching requires a set of keys'", ")", "for", "prop", "in", "msg", ".", "props", ":", "if", "prop", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geodesy/props.py#L59-L72
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/imdb_sentiment_detection/utils/hdf5_format.py
python
load_model_from_hdf5
(filepath, custom_objects=None, compile=True)
return model
Loads a model saved via `save_model_to_hdf5`. Arguments: filepath: One of the following: - String, path to the saved model - `h5py.File` object from which to load the model custom_objects: Optional dictionary mapping names (strings) to custom classes or functions to be ...
Loads a model saved via `save_model_to_hdf5`.
[ "Loads", "a", "model", "saved", "via", "save_model_to_hdf5", "." ]
def load_model_from_hdf5(filepath, custom_objects=None, compile=True): # pylint: disable=redefined-builtin """Loads a model saved via `save_model_to_hdf5`. Arguments: filepath: One of the following: - String, path to the saved model - `h5py.File` object from which to load the model ...
[ "def", "load_model_from_hdf5", "(", "filepath", ",", "custom_objects", "=", "None", ",", "compile", "=", "True", ")", ":", "# pylint: disable=redefined-builtin", "if", "h5py", "is", "None", ":", "raise", "ImportError", "(", "'`load_model` requires h5py.'", ")", "if"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/imdb_sentiment_detection/utils/hdf5_format.py#L137-L225
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/edit_config_handler.py
python
EditConfigHandler._AddEntity
(self)
Adds adds a new entity according to the request parameters.
Adds adds a new entity according to the request parameters.
[ "Adds", "adds", "a", "new", "entity", "according", "to", "the", "request", "parameters", "." ]
def _AddEntity(self): """Adds adds a new entity according to the request parameters.""" name = self.request.get('add-name') if not name: raise request_handler.InvalidInputError('No name given when adding new ') if self._model_class.get_by_id(name): raise request_handler.InvalidInputError( ...
[ "def", "_AddEntity", "(", "self", ")", ":", "name", "=", "self", ".", "request", ".", "get", "(", "'add-name'", ")", "if", "not", "name", ":", "raise", "request_handler", ".", "InvalidInputError", "(", "'No name given when adding new '", ")", "if", "self", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/edit_config_handler.py#L75-L84
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py
python
swap_outputs
(sgv0, sgv1)
return _reroute_sgv_outputs(sgv0, sgv1, _RerouteMode.swap)
Swap all the outputs of sgv0 and sgv1 (see _reroute_outputs).
Swap all the outputs of sgv0 and sgv1 (see _reroute_outputs).
[ "Swap", "all", "the", "outputs", "of", "sgv0", "and", "sgv1", "(", "see", "_reroute_outputs", ")", "." ]
def swap_outputs(sgv0, sgv1): """Swap all the outputs of sgv0 and sgv1 (see _reroute_outputs).""" return _reroute_sgv_outputs(sgv0, sgv1, _RerouteMode.swap)
[ "def", "swap_outputs", "(", "sgv0", ",", "sgv1", ")", ":", "return", "_reroute_sgv_outputs", "(", "sgv0", ",", "sgv1", ",", "_RerouteMode", ".", "swap", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py#L413-L415
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBMemoryRegionInfoList.__init__
(self, *args)
__init__(self) -> SBMemoryRegionInfoList __init__(self, SBMemoryRegionInfoList rhs) -> SBMemoryRegionInfoList
__init__(self) -> SBMemoryRegionInfoList __init__(self, SBMemoryRegionInfoList rhs) -> SBMemoryRegionInfoList
[ "__init__", "(", "self", ")", "-", ">", "SBMemoryRegionInfoList", "__init__", "(", "self", "SBMemoryRegionInfoList", "rhs", ")", "-", ">", "SBMemoryRegionInfoList" ]
def __init__(self, *args): """ __init__(self) -> SBMemoryRegionInfoList __init__(self, SBMemoryRegionInfoList rhs) -> SBMemoryRegionInfoList """ this = _lldb.new_SBMemoryRegionInfoList(*args) try: self.this.append(this) except: self.this = this
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "this", "=", "_lldb", ".", "new_SBMemoryRegionInfoList", "(", "*", "args", ")", "try", ":", "self", ".", "this", ".", "append", "(", "this", ")", "except", ":", "self", ".", "this", "=", "...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5880-L5887
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/_appengine_environ.py
python
is_prod_appengine_mvms
()
return False
Deprecated.
Deprecated.
[ "Deprecated", "." ]
def is_prod_appengine_mvms(): """Deprecated.""" return False
[ "def", "is_prod_appengine_mvms", "(", ")", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/_appengine_environ.py#L34-L36
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py
python
print_tensors_in_checkpoint_file
(file_name, tensor_name)
Prints tensors in a checkpoint file. If no `tensor_name` is provided, prints the tensor names and shapes in the checkpoint file. If `tensor_name` is provided, prints the content of the tensor. Args: file_name: Name of the checkpoint file. tensor_name: Name of the tensor in the checkpoint file to prin...
Prints tensors in a checkpoint file.
[ "Prints", "tensors", "in", "a", "checkpoint", "file", "." ]
def print_tensors_in_checkpoint_file(file_name, tensor_name): """Prints tensors in a checkpoint file. If no `tensor_name` is provided, prints the tensor names and shapes in the checkpoint file. If `tensor_name` is provided, prints the content of the tensor. Args: file_name: Name of the checkpoint file....
[ "def", "print_tensors_in_checkpoint_file", "(", "file_name", ",", "tensor_name", ")", ":", "try", ":", "if", "not", "tensor_name", ":", "variables", "=", "checkpoints", ".", "list_variables", "(", "file_name", ")", "for", "name", ",", "shape", "in", "variables",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py#L33-L57
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/PDF/pdfgen.py
python
PDFTextObject.getCursor
(self)
return (self._x, self._y)
Returns current text position relative to the last origin.
Returns current text position relative to the last origin.
[ "Returns", "current", "text", "position", "relative", "to", "the", "last", "origin", "." ]
def getCursor(self): """Returns current text position relative to the last origin.""" return (self._x, self._y)
[ "def", "getCursor", "(", "self", ")", ":", "return", "(", "self", ".", "_x", ",", "self", ".", "_y", ")" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pdfgen.py#L922-L924
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/async_conn/node.py
python
AsyncNode.get_parent
(self)
return self.conn.get_node(self.node.parent)
Returns an awaitable of AsyncNode representing the parent.
Returns an awaitable of AsyncNode representing the parent.
[ "Returns", "an", "awaitable", "of", "AsyncNode", "representing", "the", "parent", "." ]
def get_parent(self): """ Returns an awaitable of AsyncNode representing the parent. """ return self.conn.get_node(self.node.parent)
[ "def", "get_parent", "(", "self", ")", ":", "return", "self", ".", "conn", ".", "get_node", "(", "self", ".", "node", ".", "parent", ")" ]
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/async_conn/node.py#L38-L42
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/story_runner.py
python
StoriesGroupedByStateClass
(story_set, allow_multiple_groups)
return story_groups
Returns a list of story groups which each contains stories with the same shared_state_class. Example: Assume A1, A2, A3 are stories with same shared story class, and similar for B1, B2. If their orders in story set is A1 A2 B1 B2 A3, then the grouping will be [A1 A2] [B1 B2] [A3]. It's purposefu...
Returns a list of story groups which each contains stories with the same shared_state_class.
[ "Returns", "a", "list", "of", "story", "groups", "which", "each", "contains", "stories", "with", "the", "same", "shared_state_class", "." ]
def StoriesGroupedByStateClass(story_set, allow_multiple_groups): """ Returns a list of story groups which each contains stories with the same shared_state_class. Example: Assume A1, A2, A3 are stories with same shared story class, and similar for B1, B2. If their orders in story set is A1 A2 B1 B2 A...
[ "def", "StoriesGroupedByStateClass", "(", "story_set", ",", "allow_multiple_groups", ")", ":", "story_groups", "=", "[", "]", "story_groups", ".", "append", "(", "StoryGroup", "(", "story_set", "[", "0", "]", ".", "shared_state_class", ")", ")", "for", "story", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/story_runner.py#L138-L171
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/_iotools.py
python
str2bool
(value)
Tries to transform a string supposed to represent a boolean to a boolean. Parameters ---------- value : str The string that is transformed to a boolean. Returns ------- boolval : bool The boolean representation of `value`. Raises ------ ValueError If the st...
Tries to transform a string supposed to represent a boolean to a boolean.
[ "Tries", "to", "transform", "a", "string", "supposed", "to", "represent", "a", "boolean", "to", "a", "boolean", "." ]
def str2bool(value): """ Tries to transform a string supposed to represent a boolean to a boolean. Parameters ---------- value : str The string that is transformed to a boolean. Returns ------- boolval : bool The boolean representation of `value`. Raises ------...
[ "def", "str2bool", "(", "value", ")", ":", "value", "=", "value", ".", "upper", "(", ")", "if", "value", "==", "'TRUE'", ":", "return", "True", "elif", "value", "==", "'FALSE'", ":", "return", "False", "else", ":", "raise", "ValueError", "(", "\"Invali...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/_iotools.py#L386-L419
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rfc822.py
python
Message.__init__
(self, fp, seekable = 1)
Initialize the class instance and read the headers.
Initialize the class instance and read the headers.
[ "Initialize", "the", "class", "instance", "and", "read", "the", "headers", "." ]
def __init__(self, fp, seekable = 1): """Initialize the class instance and read the headers.""" if seekable == 1: # Exercise tell() to make sure it works # (and then assume seek() works, too) try: fp.tell() except (AttributeError, IOError):...
[ "def", "__init__", "(", "self", ",", "fp", ",", "seekable", "=", "1", ")", ":", "if", "seekable", "==", "1", ":", "# Exercise tell() to make sure it works", "# (and then assume seek() works, too)", "try", ":", "fp", ".", "tell", "(", ")", "except", "(", "Attri...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rfc822.py#L88-L114
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/geometric.py
python
Geometric.extend_repr
(self)
return s
Display instance object as string.
Display instance object as string.
[ "Display", "instance", "object", "as", "string", "." ]
def extend_repr(self): """Display instance object as string.""" if not self.is_scalar_batch: s = 'batch_shape = {}'.format(self._broadcast_shape) else: s = 'probs = {}'.format(self.probs) return s
[ "def", "extend_repr", "(", "self", ")", ":", "if", "not", "self", ".", "is_scalar_batch", ":", "s", "=", "'batch_shape = {}'", ".", "format", "(", "self", ".", "_broadcast_shape", ")", "else", ":", "s", "=", "'probs = {}'", ".", "format", "(", "self", "....
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/geometric.py#L184-L190
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/util.py
python
EventMixin.publish
(self, event, *args, **kwargs)
return result
Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's ...
Publish a event and return a list of values returned by its subscribers.
[ "Publish", "a", "event", "and", "return", "a", "list", "of", "values", "returned", "by", "its", "subscribers", "." ]
def publish(self, event, *args, **kwargs): """ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The k...
[ "def", "publish", "(", "self", ",", "event", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "result", "=", "[", "]", "for", "subscriber", "in", "self", ".", "get_subscribers", "(", "event", ")", ":", "try", ":", "value", "=", "subscriber", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/util.py#L1031-L1052
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/interactiveshell.py
python
InteractiveShell.safe_run_module
(self, mod_name, where)
A safe version of runpy.run_module(). This version will never throw an exception, but instead print helpful error messages to the screen. `SystemExit` exceptions with status code 0 or None are ignored. Parameters ---------- mod_name : string The name of the...
A safe version of runpy.run_module().
[ "A", "safe", "version", "of", "runpy", ".", "run_module", "()", "." ]
def safe_run_module(self, mod_name, where): """A safe version of runpy.run_module(). This version will never throw an exception, but instead print helpful error messages to the screen. `SystemExit` exceptions with status code 0 or None are ignored. Parameters ---------...
[ "def", "safe_run_module", "(", "self", ",", "mod_name", ",", "where", ")", ":", "try", ":", "try", ":", "where", ".", "update", "(", "runpy", ".", "run_module", "(", "str", "(", "mod_name", ")", ",", "run_name", "=", "\"__main__\"", ",", "alter_sys", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L2564-L2590
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/numerictypes.py
python
issubclass_
(arg1, arg2)
Determine if a class is a subclass of a second class. `issubclass_` is equivalent to the Python built-in ``issubclass``, except that it returns False instead of raising a TypeError if one of the arguments is not a class. Parameters ---------- arg1 : class Input class. True is returned ...
Determine if a class is a subclass of a second class.
[ "Determine", "if", "a", "class", "is", "a", "subclass", "of", "a", "second", "class", "." ]
def issubclass_(arg1, arg2): """ Determine if a class is a subclass of a second class. `issubclass_` is equivalent to the Python built-in ``issubclass``, except that it returns False instead of raising a TypeError if one of the arguments is not a class. Parameters ---------- arg1 : cla...
[ "def", "issubclass_", "(", "arg1", ",", "arg2", ")", ":", "try", ":", "return", "issubclass", "(", "arg1", ",", "arg2", ")", "except", "TypeError", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/numerictypes.py#L294-L330
yun-liu/RCF
91bfb054ad04187dbbe21e539e165ad9bd3ff00b
scripts/cpp_lint.py
python
FindNextMultiLineCommentStart
(lines, lineix)
return len(lines)
Find the beginning marker for a multiline comment.
Find the beginning marker for a multiline comment.
[ "Find", "the", "beginning", "marker", "for", "a", "multiline", "comment", "." ]
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
[ "def", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "startswith", "(", "'/*'", ")", ":", "# Only return this...
https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L1123-L1131
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/training/monitored_session.py
python
_WrappedSession._check_stop
(self)
return False
Hook for subclasses to provide their own stop condition. Returns: True if the session should stop, False otherwise.
Hook for subclasses to provide their own stop condition.
[ "Hook", "for", "subclasses", "to", "provide", "their", "own", "stop", "condition", "." ]
def _check_stop(self): """Hook for subclasses to provide their own stop condition. Returns: True if the session should stop, False otherwise. """ return False
[ "def", "_check_stop", "(", "self", ")", ":", "return", "False" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/monitored_session.py#L1211-L1217
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py
python
Notebook.index
(self, tab_id)
return self.tk.call(self._w, "index", tab_id)
Returns the numeric index of the tab specified by tab_id, or the total number of tabs if tab_id is the string "end".
Returns the numeric index of the tab specified by tab_id, or the total number of tabs if tab_id is the string "end".
[ "Returns", "the", "numeric", "index", "of", "the", "tab", "specified", "by", "tab_id", "or", "the", "total", "number", "of", "tabs", "if", "tab_id", "is", "the", "string", "end", "." ]
def index(self, tab_id): """Returns the numeric index of the tab specified by tab_id, or the total number of tabs if tab_id is the string "end".""" return self.tk.call(self._w, "index", tab_id)
[ "def", "index", "(", "self", ",", "tab_id", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "\"index\"", ",", "tab_id", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L863-L866
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
Function.MakeTypedOriginalArgString
(self, prefix, add_comma = False)
return self.__MaybePrependComma(arg_string, add_comma)
Gets a list of arguments as they are in GL.
Gets a list of arguments as they are in GL.
[ "Gets", "a", "list", "of", "arguments", "as", "they", "are", "in", "GL", "." ]
def MakeTypedOriginalArgString(self, prefix, add_comma = False): """Gets a list of arguments as they are in GL.""" args = self.GetOriginalArgs() arg_string = ", ".join( ["%s %s%s" % (arg.type, prefix, arg.name) for arg in args]) return self.__MaybePrependComma(arg_string, add_comma)
[ "def", "MakeTypedOriginalArgString", "(", "self", ",", "prefix", ",", "add_comma", "=", "False", ")", ":", "args", "=", "self", ".", "GetOriginalArgs", "(", ")", "arg_string", "=", "\", \"", ".", "join", "(", "[", "\"%s %s%s\"", "%", "(", "arg", ".", "ty...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6436-L6441
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
pyparsing_common.convertToDate
(fmt="%Y-%m-%d")
return cvt_fn
Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_com...
Helper to create a parse action for converting parsed date string to Python datetime.date
[ "Helper", "to", "create", "a", "parse", "action", "for", "converting", "parsed", "date", "string", "to", "Python", "datetime", ".", "date" ]
def convertToDate(fmt="%Y-%m-%d"): """ Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.co...
[ "def", "convertToDate", "(", "fmt", "=", "\"%Y-%m-%d\"", ")", ":", "def", "cvt_fn", "(", "s", ",", "l", ",", "t", ")", ":", "try", ":", "return", "datetime", ".", "strptime", "(", "t", "[", "0", "]", ",", "fmt", ")", ".", "date", "(", ")", "exc...
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/_vendor/pyparsing.py#L5593-L5612
kit-cel/gr-radar
ceebb6d83280526f6e08a8aa0dde486db6898c81
docs/doxygen/swig_doc.py
python
make_entry
(obj, name=None, templ="{description}", description=None, params=[])
return entry_templ.format( name=name, docstring=docstring, )
Create a docstring entry for a swig interface file. obj - a doxyxml object from which documentation will be extracted. name - the name of the C object (defaults to obj.name()) templ - an optional template for the docstring containing only one variable named 'description'. description - if t...
Create a docstring entry for a swig interface file.
[ "Create", "a", "docstring", "entry", "for", "a", "swig", "interface", "file", "." ]
def make_entry(obj, name=None, templ="{description}", description=None, params=[]): """ Create a docstring entry for a swig interface file. obj - a doxyxml object from which documentation will be extracted. name - the name of the C object (defaults to obj.name()) templ - an optional template for th...
[ "def", "make_entry", "(", "obj", ",", "name", "=", "None", ",", "templ", "=", "\"{description}\"", ",", "description", "=", "None", ",", "params", "=", "[", "]", ")", ":", "if", "name", "is", "None", ":", "name", "=", "obj", ".", "name", "(", ")", ...
https://github.com/kit-cel/gr-radar/blob/ceebb6d83280526f6e08a8aa0dde486db6898c81/docs/doxygen/swig_doc.py#L116-L142
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
CheckCheck
(filename, clean_lines, linenum, error)
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks the use of CHECK and EXPECT macros.
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "raw_lines", "=", "clean_lines", ".", "raw_lines", "current_macro", "=", "''", "for", "macro", "in", "_...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L2703-L2733
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdataclass.py
python
is_metaclass
(rdclass)
return False
True if the class is a metaclass. @param rdclass: the rdata class @type rdclass: int @rtype: bool
True if the class is a metaclass.
[ "True", "if", "the", "class", "is", "a", "metaclass", "." ]
def is_metaclass(rdclass): """True if the class is a metaclass. @param rdclass: the rdata class @type rdclass: int @rtype: bool""" if _metaclasses.has_key(rdclass): return True return False
[ "def", "is_metaclass", "(", "rdclass", ")", ":", "if", "_metaclasses", ".", "has_key", "(", "rdclass", ")", ":", "return", "True", "return", "False" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdataclass.py#L106-L114
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/environment.py
python
Environment.call_filter
(self, name, value, args=None, kwargs=None, context=None, eval_ctx=None)
return func(*args, **(kwargs or {}))
Invokes a filter on a value the same way the compiler does it. Note that on Python 3 this might return a coroutine in case the filter is running from an environment in async mode and the filter supports async execution. It's your responsibility to await this if needed. .. vers...
Invokes a filter on a value the same way the compiler does it.
[ "Invokes", "a", "filter", "on", "a", "value", "the", "same", "way", "the", "compiler", "does", "it", "." ]
def call_filter(self, name, value, args=None, kwargs=None, context=None, eval_ctx=None): """Invokes a filter on a value the same way the compiler does it. Note that on Python 3 this might return a coroutine in case the filter is running from an environment in async mode and ...
[ "def", "call_filter", "(", "self", ",", "name", ",", "value", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "context", "=", "None", ",", "eval_ctx", "=", "None", ")", ":", "func", "=", "self", ".", "filters", ".", "get", "(", "name", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L438-L467
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/enum.py
python
_EnumDict.__setitem__
(self, key, value)
Changes anything not dundered or not a descriptor. If an enum member name is used twice, an error is raised; duplicate values are not checked for. Single underscore (sunder) names are reserved.
Changes anything not dundered or not a descriptor.
[ "Changes", "anything", "not", "dundered", "or", "not", "a", "descriptor", "." ]
def __setitem__(self, key, value): """ Changes anything not dundered or not a descriptor. If an enum member name is used twice, an error is raised; duplicate values are not checked for. Single underscore (sunder) names are reserved. """ if _is_private(self._cls_...
[ "def", "__setitem__", "(", "self", ",", "key", ",", "value", ")", ":", "if", "_is_private", "(", "self", ".", "_cls_name", ",", "key", ")", ":", "import", "warnings", "warnings", ".", "warn", "(", "\"private variables, such as %r, will be normal attributes in 3.10...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/enum.py#L88-L152
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
TreeListCtrl.GetPrevExpanded
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetPrevExpanded(*args, **kwargs)
GetPrevExpanded(self, TreeItemId item) -> TreeItemId
GetPrevExpanded(self, TreeItemId item) -> TreeItemId
[ "GetPrevExpanded", "(", "self", "TreeItemId", "item", ")", "-", ">", "TreeItemId" ]
def GetPrevExpanded(*args, **kwargs): """GetPrevExpanded(self, TreeItemId item) -> TreeItemId""" return _gizmos.TreeListCtrl_GetPrevExpanded(*args, **kwargs)
[ "def", "GetPrevExpanded", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetPrevExpanded", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L810-L812
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
scripts/cpp_lint.py
python
CheckCaffeAlternatives
(filename, clean_lines, linenum, error)
Checks for C(++) functions for which a Caffe substitute should be used. For certain native C functions (memset, memcpy), there is a Caffe alternative which should be used instead. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The nu...
Checks for C(++) functions for which a Caffe substitute should be used.
[ "Checks", "for", "C", "(", "++", ")", "functions", "for", "which", "a", "Caffe", "substitute", "should", "be", "used", "." ]
def CheckCaffeAlternatives(filename, clean_lines, linenum, error): """Checks for C(++) functions for which a Caffe substitute should be used. For certain native C functions (memset, memcpy), there is a Caffe alternative which should be used instead. Args: filename: The name of the current file. clean_...
[ "def", "CheckCaffeAlternatives", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "function", ",", "alts", "in", "caffe_alt_function_list", ":", "ix", "=", "li...
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L1572-L1592
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py
python
MHMessage.set_sequences
(self, sequences)
Set the list of sequences that include the message.
Set the list of sequences that include the message.
[ "Set", "the", "list", "of", "sequences", "that", "include", "the", "message", "." ]
def set_sequences(self, sequences): """Set the list of sequences that include the message.""" self._sequences = list(sequences)
[ "def", "set_sequences", "(", "self", ",", "sequences", ")", ":", "self", ".", "_sequences", "=", "list", "(", "sequences", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L1705-L1707
verilator/verilator
7a355d448ab03556ba362ddef293e84260e9c4f0
nodist/fastcov.py
python
addDicts
(dict1, dict2)
return result
Add dicts together by value. i.e. addDicts({"a":1,"b":0}, {"a":2}) == {"a":3,"b":0}.
Add dicts together by value. i.e. addDicts({"a":1,"b":0}, {"a":2}) == {"a":3,"b":0}.
[ "Add", "dicts", "together", "by", "value", ".", "i", ".", "e", ".", "addDicts", "(", "{", "a", ":", "1", "b", ":", "0", "}", "{", "a", ":", "2", "}", ")", "==", "{", "a", ":", "3", "b", ":", "0", "}", "." ]
def addDicts(dict1, dict2): """Add dicts together by value. i.e. addDicts({"a":1,"b":0}, {"a":2}) == {"a":3,"b":0}.""" result = {k:v for k,v in dict1.items()} for k,v in dict2.items(): if k in result: result[k] += v else: result[k] = v return result
[ "def", "addDicts", "(", "dict1", ",", "dict2", ")", ":", "result", "=", "{", "k", ":", "v", "for", "k", ",", "v", "in", "dict1", ".", "items", "(", ")", "}", "for", "k", ",", "v", "in", "dict2", ".", "items", "(", ")", ":", "if", "k", "in",...
https://github.com/verilator/verilator/blob/7a355d448ab03556ba362ddef293e84260e9c4f0/nodist/fastcov.py#L463-L472
alexgkendall/caffe-segnet
344c113bf1832886f1cbe9f33ffe28a3beeaf412
scripts/cpp_lint.py
python
_SetOutputFormat
(output_format)
Sets the module's output format.
Sets the module's output format.
[ "Sets", "the", "module", "s", "output", "format", "." ]
def _SetOutputFormat(output_format): """Sets the module's output format.""" _cpplint_state.SetOutputFormat(output_format)
[ "def", "_SetOutputFormat", "(", "output_format", ")", ":", "_cpplint_state", ".", "SetOutputFormat", "(", "output_format", ")" ]
https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L772-L774
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite.py
python
hermsub
(c1, c2)
return pu._sub(c1, c2)
Subtract one Hermite series from another. Returns the difference of two Hermite series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D arrays of...
Subtract one Hermite series from another.
[ "Subtract", "one", "Hermite", "series", "from", "another", "." ]
def hermsub(c1, c2): """ Subtract one Hermite series from another. Returns the difference of two Hermite series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 :...
[ "def", "hermsub", "(", "c1", ",", "c2", ")", ":", "return", "pu", ".", "_sub", "(", "c1", ",", "c2", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite.py#L331-L368
crosslife/OpenBird
9e0198a1a2295f03fa1e8676e216e22c9c7d380b
cocos2d/tools/bindings-generator/clang/cindex.py
python
Index.read
(self, path)
return TranslationUnit.from_ast(path, self)
Load a TranslationUnit from the given AST file.
Load a TranslationUnit from the given AST file.
[ "Load", "a", "TranslationUnit", "from", "the", "given", "AST", "file", "." ]
def read(self, path): """Load a TranslationUnit from the given AST file.""" return TranslationUnit.from_ast(path, self)
[ "def", "read", "(", "self", ",", "path", ")", ":", "return", "TranslationUnit", ".", "from_ast", "(", "path", ",", "self", ")" ]
https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L2091-L2093
apache/mesos
97d9a4063332aae3825d78de71611657e05cf5e2
support/cpplint.py
python
CheckOperatorSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing around operators. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing around operators.
[ "Checks", "for", "horizontal", "spacing", "around", "operators", "." ]
def CheckOperatorSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around operators. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any...
[ "def", "CheckOperatorSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Don't try to do spacing checks for operator methods. Do this by", "# replacing the troublesome cha...
https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/cpplint.py#L3299-L3411
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
cpplint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L1854-L1929
CMU-Perceptual-Computing-Lab/caffe_rtpose
a4778bb1c3eb74d7250402016047216f77b4dba6
python/caffe/draw.py
python
draw_net_to_file
(caffe_net, filename, rankdir='LR', phase=None)
Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. filename : string The path t...
Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs.
[ "Draws", "a", "caffe", "net", "and", "saves", "it", "to", "file", "using", "the", "format", "given", "as", "the", "file", "extension", ".", "Use", ".", "raw", "to", "output", "raw", "text", "that", "you", "can", "manually", "feed", "to", "graphviz", "t...
def draw_net_to_file(caffe_net, filename, rankdir='LR', phase=None): """Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs. Parameters ---------- caffe_net : a caffe.proto.caff...
[ "def", "draw_net_to_file", "(", "caffe_net", ",", "filename", ",", "rankdir", "=", "'LR'", ",", "phase", "=", "None", ")", ":", "ext", "=", "filename", "[", "filename", ".", "rfind", "(", "'.'", ")", "+", "1", ":", "]", "with", "open", "(", "filename...
https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/blob/a4778bb1c3eb74d7250402016047216f77b4dba6/python/caffe/draw.py#L226-L244
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextObject.GetBuffer
(*args, **kwargs)
return _richtext.RichTextObject_GetBuffer(*args, **kwargs)
GetBuffer(self) -> RichTextBuffer
GetBuffer(self) -> RichTextBuffer
[ "GetBuffer", "(", "self", ")", "-", ">", "RichTextBuffer" ]
def GetBuffer(*args, **kwargs): """GetBuffer(self) -> RichTextBuffer""" return _richtext.RichTextObject_GetBuffer(*args, **kwargs)
[ "def", "GetBuffer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_GetBuffer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1371-L1373
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Variable.trace_vinfo
(self)
return map(self._tk.split, self._tk.splitlist( self._tk.call("trace", "vinfo", self._name)))
Return all trace callback information.
Return all trace callback information.
[ "Return", "all", "trace", "callback", "information", "." ]
def trace_vinfo(self): """Return all trace callback information.""" return map(self._tk.split, self._tk.splitlist( self._tk.call("trace", "vinfo", self._name)))
[ "def", "trace_vinfo", "(", "self", ")", ":", "return", "map", "(", "self", ".", "_tk", ".", "split", ",", "self", ".", "_tk", ".", "splitlist", "(", "self", ".", "_tk", ".", "call", "(", "\"trace\"", ",", "\"vinfo\"", ",", "self", ".", "_name", ")"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L261-L264
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/graph_editor/select.py
python
get_walks_union_ops
(forward_seed_ops, backward_seed_ops, forward_inclusive=True, backward_inclusive=True, within_ops=None, control_inputs=False, control_outputs=None, cont...
return util.concatenate_unique(forward_ops, backward_ops)
Return the union of a forward and a backward walk. Args: forward_seed_ops: an iterable of operations from which the forward graph walk starts. If a list of tensors is given instead, the seed_ops are set to be the consumers of those tensors. backward_seed_ops: an iterable of operations from which ...
Return the union of a forward and a backward walk.
[ "Return", "the", "union", "of", "a", "forward", "and", "a", "backward", "walk", "." ]
def get_walks_union_ops(forward_seed_ops, backward_seed_ops, forward_inclusive=True, backward_inclusive=True, within_ops=None, control_inputs=False, control_outputs=None, ...
[ "def", "get_walks_union_ops", "(", "forward_seed_ops", ",", "backward_seed_ops", ",", "forward_inclusive", "=", "True", ",", "backward_inclusive", "=", "True", ",", "within_ops", "=", "None", ",", "control_inputs", "=", "False", ",", "control_outputs", "=", "None", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/graph_editor/select.py#L567-L616
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/mantid/plots/utility.py
python
col_num
(ax)
Returns the column number of an input axes with relation to a gridspec Version check to avoid calling depreciated method in matplotlib > 3.2
Returns the column number of an input axes with relation to a gridspec Version check to avoid calling depreciated method in matplotlib > 3.2
[ "Returns", "the", "column", "number", "of", "an", "input", "axes", "with", "relation", "to", "a", "gridspec", "Version", "check", "to", "avoid", "calling", "depreciated", "method", "in", "matplotlib", ">", "3", ".", "2" ]
def col_num(ax): """ Returns the column number of an input axes with relation to a gridspec Version check to avoid calling depreciated method in matplotlib > 3.2 """ if LooseVersion(mpl_version_str) >= LooseVersion("3.2.0"): return ax.get_subplotspec().colspan.start else: return ...
[ "def", "col_num", "(", "ax", ")", ":", "if", "LooseVersion", "(", "mpl_version_str", ")", ">=", "LooseVersion", "(", "\"3.2.0\"", ")", ":", "return", "ax", ".", "get_subplotspec", "(", ")", ".", "colspan", ".", "start", "else", ":", "return", "ax", ".", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/plots/utility.py#L173-L181
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py
python
Manifest.clear
(self)
Clear all collected files.
Clear all collected files.
[ "Clear", "all", "collected", "files", "." ]
def clear(self): """Clear all collected files.""" self.files = set() self.allfiles = []
[ "def", "clear", "(", "self", ")", ":", "self", ".", "files", "=", "set", "(", ")", "self", ".", "allfiles", "=", "[", "]" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py#L118-L121
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/distributed_c10d.py
python
send
(tensor, dst, group=None, tag=0)
Sends a tensor synchronously. Args: tensor (Tensor): Tensor to send. dst (int): Destination rank. group (ProcessGroup, optional): The process group to work on. If None, the default process group will be used. tag (int, optional): Tag to match send with remote recv
Sends a tensor synchronously.
[ "Sends", "a", "tensor", "synchronously", "." ]
def send(tensor, dst, group=None, tag=0): """ Sends a tensor synchronously. Args: tensor (Tensor): Tensor to send. dst (int): Destination rank. group (ProcessGroup, optional): The process group to work on. If None, the default process group will be used. tag (int...
[ "def", "send", "(", "tensor", ",", "dst", ",", "group", "=", "None", ",", "tag", "=", "0", ")", ":", "_check_single_tensor", "(", "tensor", ",", "\"tensor\"", ")", "if", "_rank_not_in_group", "(", "group", ")", ":", "_warn_not_in_group", "(", "\"send\"", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/distributed_c10d.py#L940-L962
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py
python
EncodingBytes.jumpTo
(self, bytes)
Look for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the match
Look for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the match
[ "Look", "for", "the", "next", "sequence", "of", "bytes", "matching", "a", "given", "sequence", ".", "If", "a", "match", "is", "found", "advance", "the", "position", "to", "the", "last", "byte", "of", "the", "match" ]
def jumpTo(self, bytes): """Look for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the match""" newPosition = self[self.position:].find(bytes) if newPosition > -1: # XXX: This is ugly, but I can't see a nice...
[ "def", "jumpTo", "(", "self", ",", "bytes", ")", ":", "newPosition", "=", "self", "[", "self", ".", "position", ":", "]", ".", "find", "(", "bytes", ")", "if", "newPosition", ">", "-", "1", ":", "# XXX: This is ugly, but I can't see a nicer way to fix this.", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py#L657-L668
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags_validators.py
python
SimpleValidator.__init__
(self, flag_name, checker, message)
Constructor. Args: flag_name: string, name of the flag. checker: function to verify the validator. input - value of the corresponding flag (string, boolean, etc). output - Boolean. Must return True if validator constraint is satisfied. If constraint is not satisfied, it shoul...
Constructor.
[ "Constructor", "." ]
def __init__(self, flag_name, checker, message): """Constructor. Args: flag_name: string, name of the flag. checker: function to verify the validator. input - value of the corresponding flag (string, boolean, etc). output - Boolean. Must return True if validator constraint is satis...
[ "def", "__init__", "(", "self", ",", "flag_name", ",", "checker", ",", "message", ")", ":", "super", "(", "SimpleValidator", ",", "self", ")", ".", "__init__", "(", "checker", ",", "message", ")", "self", ".", "flag_name", "=", "flag_name" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags_validators.py#L111-L125
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py
python
LegacyMetadata.get
(self, name, default=_MISSING)
return self._fields[name]
Get a metadata field.
Get a metadata field.
[ "Get", "a", "metadata", "field", "." ]
def get(self, name, default=_MISSING): """Get a metadata field.""" name = self._convert_name(name) if name not in self._fields: if default is _MISSING: default = self._default_value(name) return default if name in _UNICODEFIELDS: value ...
[ "def", "get", "(", "self", ",", "name", ",", "default", "=", "_MISSING", ")", ":", "name", "=", "self", ".", "_convert_name", "(", "name", ")", "if", "name", "not", "in", "self", ".", "_fields", ":", "if", "default", "is", "_MISSING", ":", "default",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py#L458-L485
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/shell.py
python
Shell.Paste
(self)
Replace selection with clipboard contents.
Replace selection with clipboard contents.
[ "Replace", "selection", "with", "clipboard", "contents", "." ]
def Paste(self): """Replace selection with clipboard contents.""" if self.CanPaste() and wx.TheClipboard.Open(): ps2 = str(sys.ps2) if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): data = wx.TextDataObject() if wx.TheClipboard.GetData(dat...
[ "def", "Paste", "(", "self", ")", ":", "if", "self", ".", "CanPaste", "(", ")", "and", "wx", ".", "TheClipboard", ".", "Open", "(", ")", ":", "ps2", "=", "str", "(", "sys", ".", "ps2", ")", "if", "wx", ".", "TheClipboard", ".", "IsSupported", "("...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/shell.py#L1344-L1360
hifiberry/hifiberry-os
88c05213fb3e6230645cb4bf8eb8fceda8bd07d4
buildroot/package/lmsmpris/src/mpris.py
python
MPRISController.__str__
(self)
return res
String representation of the current state: all players, playback state and meta data
String representation of the current state: all players, playback state and meta data
[ "String", "representation", "of", "the", "current", "state", ":", "all", "players", "playback", "state", "and", "meta", "data" ]
def __str__(self): """ String representation of the current state: all players, playback state and meta data """ res = "" for p in self.state_table: res = res + "{:30s} - {:10s}: {}/{}\n".format( self.playername(p), self.state_t...
[ "def", "__str__", "(", "self", ")", ":", "res", "=", "\"\"", "for", "p", "in", "self", ".", "state_table", ":", "res", "=", "res", "+", "\"{:30s} - {:10s}: {}/{}\\n\"", ".", "format", "(", "self", ".", "playername", "(", "p", ")", ",", "self", ".", "...
https://github.com/hifiberry/hifiberry-os/blob/88c05213fb3e6230645cb4bf8eb8fceda8bd07d4/buildroot/package/lmsmpris/src/mpris.py#L241-L254
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
llvm/utils/lit/lit/LitConfig.py
python
LitConfig.maxIndividualTestTime
(self)
return self._maxIndividualTestTime
Interface for getting maximum time to spend executing a single test
Interface for getting maximum time to spend executing a single test
[ "Interface", "for", "getting", "maximum", "time", "to", "spend", "executing", "a", "single", "test" ]
def maxIndividualTestTime(self): """ Interface for getting maximum time to spend executing a single test """ return self._maxIndividualTestTime
[ "def", "maxIndividualTestTime", "(", "self", ")", ":", "return", "self", ".", "_maxIndividualTestTime" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/llvm/utils/lit/lit/LitConfig.py#L71-L76
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
Environment.__add__
(self, other)
return new
Add an environment or distribution to an environment
Add an environment or distribution to an environment
[ "Add", "an", "environment", "or", "distribution", "to", "an", "environment" ]
def __add__(self, other): """Add an environment or distribution to an environment""" new = self.__class__([], platform=None, python=None) for env in self, other: new += env return new
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "new", "=", "self", ".", "__class__", "(", "[", "]", ",", "platform", "=", "None", ",", "python", "=", "None", ")", "for", "env", "in", "self", ",", "other", ":", "new", "+=", "env", "return"...
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#L1098-L1103
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py
python
ReflectometryILLPreprocess.PyExec
(self)
Execute the algorithm.
Execute the algorithm.
[ "Execute", "the", "algorithm", "." ]
def PyExec(self): """Execute the algorithm.""" self._subalgLogging = self.getProperty(Prop.SUBALG_LOGGING).value == SubalgLogging.ON cleanupMode = self.getProperty(Prop.CLEANUP).value self._cleanup = utils.Cleanup(cleanupMode, self._subalgLogging) wsPrefix = self.getPropertyValue...
[ "def", "PyExec", "(", "self", ")", ":", "self", ".", "_subalgLogging", "=", "self", ".", "getProperty", "(", "Prop", ".", "SUBALG_LOGGING", ")", ".", "value", "==", "SubalgLogging", ".", "ON", "cleanupMode", "=", "self", ".", "getProperty", "(", "Prop", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py#L97-L128
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/build_env.py
python
BuildEnvironment.check_requirements
(self, reqs)
return conflicting, missing
Return 2 sets: - conflicting requirements: set of (installed, wanted) reqs tuples - missing requirements: set of reqs
Return 2 sets: - conflicting requirements: set of (installed, wanted) reqs tuples - missing requirements: set of reqs
[ "Return", "2", "sets", ":", "-", "conflicting", "requirements", ":", "set", "of", "(", "installed", "wanted", ")", "reqs", "tuples", "-", "missing", "requirements", ":", "set", "of", "reqs" ]
def check_requirements(self, reqs): # type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]] """Return 2 sets: - conflicting requirements: set of (installed, wanted) reqs tuples - missing requirements: set of reqs """ missing = set() conflicting = ...
[ "def", "check_requirements", "(", "self", ",", "reqs", ")", ":", "# type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]", "missing", "=", "set", "(", ")", "conflicting", "=", "set", "(", ")", "if", "reqs", ":", "ws", "=", "WorkingSet", "(", "self", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/build_env.py#L143-L160
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pty.py
python
fork
()
return pid, master_fd
fork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.
fork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.
[ "fork", "()", "-", ">", "(", "pid", "master_fd", ")", "Fork", "and", "make", "the", "child", "a", "session", "leader", "with", "a", "controlling", "terminal", "." ]
def fork(): """fork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.""" try: pid, fd = os.forkpty() except (AttributeError, OSError): pass else: if pid == CHILD: try: os.setsid() except OSErro...
[ "def", "fork", "(", ")", ":", "try", ":", "pid", ",", "fd", "=", "os", ".", "forkpty", "(", ")", "except", "(", "AttributeError", ",", "OSError", ")", ":", "pass", "else", ":", "if", "pid", "==", "CHILD", ":", "try", ":", "os", ".", "setsid", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pty.py#L90-L128
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/graph_util_impl.py
python
_assert_nodes_are_present
(name_to_node, nodes)
Assert that nodes are present in the graph.
Assert that nodes are present in the graph.
[ "Assert", "that", "nodes", "are", "present", "in", "the", "graph", "." ]
def _assert_nodes_are_present(name_to_node, nodes): """Assert that nodes are present in the graph.""" for d in nodes: assert d in name_to_node, "%s is not in graph" % d
[ "def", "_assert_nodes_are_present", "(", "name_to_node", ",", "nodes", ")", ":", "for", "d", "in", "nodes", ":", "assert", "d", "in", "name_to_node", ",", "\"%s is not in graph\"", "%", "d" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/graph_util_impl.py#L149-L152
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBModuleSpec.GetPlatformFileSpec
(self)
return _lldb.SBModuleSpec_GetPlatformFileSpec(self)
GetPlatformFileSpec(SBModuleSpec self) -> SBFileSpec Get accessor for the module platform file. Platform file refers to the path of the module as it is known on the remote system on which it is being debugged. For local debugging this is always the same as Module::GetFileSpec(). But ...
GetPlatformFileSpec(SBModuleSpec self) -> SBFileSpec
[ "GetPlatformFileSpec", "(", "SBModuleSpec", "self", ")", "-", ">", "SBFileSpec" ]
def GetPlatformFileSpec(self): """ GetPlatformFileSpec(SBModuleSpec self) -> SBFileSpec Get accessor for the module platform file. Platform file refers to the path of the module as it is known on the remote system on which it is being debugged. For local debugging this...
[ "def", "GetPlatformFileSpec", "(", "self", ")", ":", "return", "_lldb", ".", "SBModuleSpec_GetPlatformFileSpec", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7768-L7787
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlNode.setContentLen
(self, content, len)
Replace the content of a node. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars().
Replace the content of a node. NOTE:
[ "Replace", "the", "content", "of", "a", "node", ".", "NOTE", ":" ]
def setContentLen(self, content, len): """Replace the content of a node. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """ ...
[ "def", "setContentLen", "(", "self", ",", "content", ",", "len", ")", ":", "libxml2mod", ".", "xmlNodeSetContentLen", "(", "self", ".", "_o", ",", "content", ",", "len", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2754-L2759