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
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py
python
FileCookieJar.revert
(self, filename=None, ignore_discard=False, ignore_expires=False)
Clear all cookies and reload cookies from a saved file. Raises LoadError (or IOError) if reversion is not successful; the object's state will not be altered if this happens.
Clear all cookies and reload cookies from a saved file.
[ "Clear", "all", "cookies", "and", "reload", "cookies", "from", "a", "saved", "file", "." ]
def revert(self, filename=None, ignore_discard=False, ignore_expires=False): """Clear all cookies and reload cookies from a saved file. Raises LoadError (or IOError) if reversion is not successful; the object's state will not be altered if this happens. """ if fi...
[ "def", "revert", "(", "self", ",", "filename", "=", "None", ",", "ignore_discard", "=", "False", ",", "ignore_expires", "=", "False", ")", ":", "if", "filename", "is", "None", ":", "if", "self", ".", "filename", "is", "not", "None", ":", "filename", "=...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py#L1767-L1791
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/logging/__init__.py
python
setLoggerClass
(klass)
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
[ "Set", "the", "class", "to", "be", "used", "when", "instantiating", "a", "logger", ".", "The", "class", "should", "define", "__init__", "()", "such", "that", "only", "a", "name", "argument", "is", "required", "and", "the", "__init__", "()", "should", "call...
def setLoggerClass(klass): """ Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__() """ if klass != Logger: if not issubclass(klass, Logger): raise...
[ "def", "setLoggerClass", "(", "klass", ")", ":", "if", "klass", "!=", "Logger", ":", "if", "not", "issubclass", "(", "klass", ",", "Logger", ")", ":", "raise", "TypeError", "(", "\"logger not derived from logging.Logger: \"", "+", "klass", ".", "__name__", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L1241-L1252
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py
python
ConfigCompatChecker.in_range
(self, ver, req)
Checks if a version satisfies a version and/or compatibility requirement. Args: ver: List whose first item is a config version that needs to be checked for support status and version compatibility. e.g. ver = [`1.0`] req: `_Reqs` class instance that represents a configuration ve...
Checks if a version satisfies a version and/or compatibility requirement.
[ "Checks", "if", "a", "version", "satisfies", "a", "version", "and", "/", "or", "compatibility", "requirement", "." ]
def in_range(self, ver, req): """Checks if a version satisfies a version and/or compatibility requirement. Args: ver: List whose first item is a config version that needs to be checked for support status and version compatibility. e.g. ver = [`1.0`] req: `_Reqs` class instan...
[ "def", "in_range", "(", "self", ",", "ver", ",", "req", ")", ":", "# If `req.exclude` is not empty and `ver` is in `req.exclude`,", "# no need to proceed to next set of checks as it is explicitly", "# NOT supported.", "if", "req", ".", "exclude", "is", "not", "None", ":", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py#L657-L726
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
TimeSpan_Minutes
(*args, **kwargs)
return _misc_.TimeSpan_Minutes(*args, **kwargs)
TimeSpan_Minutes(long min) -> TimeSpan
TimeSpan_Minutes(long min) -> TimeSpan
[ "TimeSpan_Minutes", "(", "long", "min", ")", "-", ">", "TimeSpan" ]
def TimeSpan_Minutes(*args, **kwargs): """TimeSpan_Minutes(long min) -> TimeSpan""" return _misc_.TimeSpan_Minutes(*args, **kwargs)
[ "def", "TimeSpan_Minutes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TimeSpan_Minutes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4572-L4574
ppizarro/coursera
b39847928df4d9d5986b801085c025e8e9122b6a
Learn to Program: Crafting Quality Code/assignment 2/a2.py
python
Maze.get_character
(self, row, col)
return self.maze[row][col]
(Maze, int, int) -> str Precondition: 0 <= row < len(maze) Precondition: 0 <= col < len(maze[0]) Return the character in the maze at the given row and column. If there is a rat at that location, then its character should be returned rather than HALL. >>> maze = Maze([['#', '#', '#',...
(Maze, int, int) -> str
[ "(", "Maze", "int", "int", ")", "-", ">", "str" ]
def get_character(self, row, col): """ (Maze, int, int) -> str Precondition: 0 <= row < len(maze) Precondition: 0 <= col < len(maze[0]) Return the character in the maze at the given row and column. If there is a rat at that location, then its character should be returned rather than ...
[ "def", "get_character", "(", "self", ",", "row", ",", "col", ")", ":", "assert", "0", "<=", "row", "<", "len", "(", "self", ".", "maze", ")", ",", "'row not in the maze.'", "assert", "0", "<=", "col", "<", "len", "(", "self", ".", "maze", "[", "0",...
https://github.com/ppizarro/coursera/blob/b39847928df4d9d5986b801085c025e8e9122b6a/Learn to Program: Crafting Quality Code/assignment 2/a2.py#L194-L230
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sgmllib.py
python
SGMLParser.handle_charref
(self, name)
Handle character reference, no need to override.
Handle character reference, no need to override.
[ "Handle", "character", "reference", "no", "need", "to", "override", "." ]
def handle_charref(self, name): """Handle character reference, no need to override.""" replacement = self.convert_charref(name) if replacement is None: self.unknown_charref(name) else: self.handle_data(replacement)
[ "def", "handle_charref", "(", "self", ",", "name", ")", ":", "replacement", "=", "self", ".", "convert_charref", "(", "name", ")", "if", "replacement", "is", "None", ":", "self", ".", "unknown_charref", "(", "name", ")", "else", ":", "self", ".", "handle...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sgmllib.py#L406-L412
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py
python
maybe_download
(filename, work_directory, source_url)
return filepath
Download the data from source url, unless it's already here. Args: filename: string, name of the file in the directory. work_directory: string, path to working directory. source_url: url to download from if file doesn't exist. Returns: Path to resulting file.
Download the data from source url, unless it's already here.
[ "Download", "the", "data", "from", "source", "url", "unless", "it", "s", "already", "here", "." ]
def maybe_download(filename, work_directory, source_url): """Download the data from source url, unless it's already here. Args: filename: string, name of the file in the directory. work_directory: string, path to working directory. source_url: url to download from if file doesn't exist. Return...
[ "def", "maybe_download", "(", "filename", ",", "work_directory", ",", "source_url", ")", ":", "if", "not", "gfile", ".", "Exists", "(", "work_directory", ")", ":", "gfile", ".", "MakeDirs", "(", "work_directory", ")", "filepath", "=", "os", ".", "path", "....
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py#L140-L162
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.SetToolTip
(*args, **kwargs)
return _core_.Window_SetToolTip(*args, **kwargs)
SetToolTip(self, ToolTip tip) Attach a tooltip to the window.
SetToolTip(self, ToolTip tip)
[ "SetToolTip", "(", "self", "ToolTip", "tip", ")" ]
def SetToolTip(*args, **kwargs): """ SetToolTip(self, ToolTip tip) Attach a tooltip to the window. """ return _core_.Window_SetToolTip(*args, **kwargs)
[ "def", "SetToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11388-L11394
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py
python
RegistryInfo.microsoft
(self, key, x86=False)
return join('Software', node64, 'Microsoft', key)
Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key
Return key in Microsoft software registry.
[ "Return", "key", "in", "Microsoft", "software", "registry", "." ]
def microsoft(self, key, x86=False): """ Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry ...
[ "def", "microsoft", "(", "self", ",", "key", ",", "x86", "=", "False", ")", ":", "node64", "=", "''", "if", "self", ".", "pi", ".", "current_is_x86", "(", ")", "or", "x86", "else", "'Wow6432Node'", "return", "join", "(", "'Software'", ",", "node64", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py#L609-L626
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
uCSIsTags
(code)
return ret
Check whether the character is part of Tags UCS Block
Check whether the character is part of Tags UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Tags", "UCS", "Block" ]
def uCSIsTags(code): """Check whether the character is part of Tags UCS Block """ ret = libxml2mod.xmlUCSIsTags(code) return ret
[ "def", "uCSIsTags", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsTags", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2129-L2132
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/number-of-nodes-in-the-sub-tree-with-the-same-label.py
python
Solution.countSubTrees
(self, n, edges, labels)
return result
:type n: int :type edges: List[List[int]] :type labels: str :rtype: List[int]
:type n: int :type edges: List[List[int]] :type labels: str :rtype: List[int]
[ ":", "type", "n", ":", "int", ":", "type", "edges", ":", "List", "[", "List", "[", "int", "]]", ":", "type", "labels", ":", "str", ":", "rtype", ":", "List", "[", "int", "]" ]
def countSubTrees(self, n, edges, labels): """ :type n: int :type edges: List[List[int]] :type labels: str :rtype: List[int] """ def iter_dfs(labels, adj, node, parent, result): stk = [(1, (node, parent, [0]*26))] while stk: ...
[ "def", "countSubTrees", "(", "self", ",", "n", ",", "edges", ",", "labels", ")", ":", "def", "iter_dfs", "(", "labels", ",", "adj", ",", "node", ",", "parent", ",", "result", ")", ":", "stk", "=", "[", "(", "1", ",", "(", "node", ",", "parent", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/number-of-nodes-in-the-sub-tree-with-the-same-label.py#L5-L44
lightvector/KataGo
20d34784703c5b4000643d3ccc43bb37d418f3b5
python/sgfmill/sgf_properties.py
python
interpret_ARLN_list
(values, context)
return result
Interpret an AR (arrow) or LN (line) property value. Returns a list of pairs (point, point), where point is a pair (row, col)
Interpret an AR (arrow) or LN (line) property value.
[ "Interpret", "an", "AR", "(", "arrow", ")", "or", "LN", "(", "line", ")", "property", "value", "." ]
def interpret_ARLN_list(values, context): """Interpret an AR (arrow) or LN (line) property value. Returns a list of pairs (point, point), where point is a pair (row, col) """ result = [] for s in values: p1, p2 = sgf_grammar.parse_compose(s) result.append((interpret_point(p1, conte...
[ "def", "interpret_ARLN_list", "(", "values", ",", "context", ")", ":", "result", "=", "[", "]", "for", "s", "in", "values", ":", "p1", ",", "p2", "=", "sgf_grammar", ".", "parse_compose", "(", "s", ")", "result", ".", "append", "(", "(", "interpret_poi...
https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf_properties.py#L389-L400
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/tree/html.py
python
Tag.copy
(self, _parent=None)
return root
Copy the tree from this node.
Copy the tree from this node.
[ "Copy", "the", "tree", "from", "this", "node", "." ]
def copy(self, _parent=None): """Copy the tree from this node.""" root = Tag(_parent, self.name, **self.attributes) for child in self.children: child.copy(_parent=root) return root
[ "def", "copy", "(", "self", ",", "_parent", "=", "None", ")", ":", "root", "=", "Tag", "(", "_parent", ",", "self", ".", "name", ",", "*", "*", "self", ".", "attributes", ")", "for", "child", "in", "self", ".", "children", ":", "child", ".", "cop...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/tree/html.py#L91-L96
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
MouseState.RightIsDown
(*args, **kwargs)
return _core_.MouseState_RightIsDown(*args, **kwargs)
RightIsDown(self) -> bool
RightIsDown(self) -> bool
[ "RightIsDown", "(", "self", ")", "-", ">", "bool" ]
def RightIsDown(*args, **kwargs): """RightIsDown(self) -> bool""" return _core_.MouseState_RightIsDown(*args, **kwargs)
[ "def", "RightIsDown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MouseState_RightIsDown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L4462-L4464
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGridInterface.GetPropertyCategory
(*args, **kwargs)
return _propgrid.PropertyGridInterface_GetPropertyCategory(*args, **kwargs)
GetPropertyCategory(self, PGPropArg id)
GetPropertyCategory(self, PGPropArg id)
[ "GetPropertyCategory", "(", "self", "PGPropArg", "id", ")" ]
def GetPropertyCategory(*args, **kwargs): """GetPropertyCategory(self, PGPropArg id)""" return _propgrid.PropertyGridInterface_GetPropertyCategory(*args, **kwargs)
[ "def", "GetPropertyCategory", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_GetPropertyCategory", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1202-L1204
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/arrayprint.py
python
_formatArray
(a, format_function, line_width, next_line_prefix, separator, edge_items, summary_insert, legacy)
formatArray is designed for two modes of operation: 1. Full output 2. Summarized output
formatArray is designed for two modes of operation:
[ "formatArray", "is", "designed", "for", "two", "modes", "of", "operation", ":" ]
def _formatArray(a, format_function, line_width, next_line_prefix, separator, edge_items, summary_insert, legacy): """formatArray is designed for two modes of operation: 1. Full output 2. Summarized output """ def recurser(index, hanging_indent, curr_width): """ B...
[ "def", "_formatArray", "(", "a", ",", "format_function", ",", "line_width", ",", "next_line_prefix", ",", "separator", ",", "edge_items", ",", "summary_insert", ",", "legacy", ")", ":", "def", "recurser", "(", "index", ",", "hanging_indent", ",", "curr_width", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/arrayprint.py#L729-L845
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_TRPYCommand.py
python
TRPYCommand._get_types
(self)
return self._slot_types
internal API method
internal API method
[ "internal", "API", "method" ]
def _get_types(self): """ internal API method """ return self._slot_types
[ "def", "_get_types", "(", "self", ")", ":", "return", "self", ".", "_slot_types" ]
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_TRPYCommand.py#L88-L92
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/backprop.py
python
implicit_val_and_grad
(f)
return grad_fn
Returns a function which differentiates f with respect to variables. The wrapped function returns the value and the gradient of f when called with the same arguments. The gradient is with respect to all trainable TFE variables accessed by `f`. This function is useful when the exact set of variables to differe...
Returns a function which differentiates f with respect to variables.
[ "Returns", "a", "function", "which", "differentiates", "f", "with", "respect", "to", "variables", "." ]
def implicit_val_and_grad(f): """Returns a function which differentiates f with respect to variables. The wrapped function returns the value and the gradient of f when called with the same arguments. The gradient is with respect to all trainable TFE variables accessed by `f`. This function is useful when th...
[ "def", "implicit_val_and_grad", "(", "f", ")", ":", "# TODO(cais): Remove calls to tf.constant() once the gradients functions", "# accept lists and np.ndarrays.", "def", "grad_fn", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "\"\"\"Computes the gradient of the wrapped fu...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/backprop.py#L187-L263
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window Construct and show a generic Window.
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "String", "name", "=", "PanelNameStr", ")", "-", ">", "Window" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window Construct and show a generic Window. """ _core_.Window_swiginit(self,_core_.new_Win...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "Window_swiginit", "(", "self", ",", "_core_", ".", "new_Window", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORInfo", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9138-L9146
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
FileInfo.Extension
(self)
return self.Split()[2]
File extension - text following the final period, includes that period.
File extension - text following the final period, includes that period.
[ "File", "extension", "-", "text", "following", "the", "final", "period", "includes", "that", "period", "." ]
def Extension(self): """File extension - text following the final period, includes that period.""" return self.Split()[2]
[ "def", "Extension", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "2", "]" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L1645-L1647
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/automate/automate-git.py
python
get_git_date
(path, branch)
return 'Unknown'
Returns the date for the specified branch/tag/hash.
Returns the date for the specified branch/tag/hash.
[ "Returns", "the", "date", "for", "the", "specified", "branch", "/", "tag", "/", "hash", "." ]
def get_git_date(path, branch): """ Returns the date for the specified branch/tag/hash. """ cmd = "%s show -s --format=%%ct %s" % (git_exe, branch) result = exec_cmd(cmd, path) if result['out'] != '': return datetime.utcfromtimestamp( int(result['out'].strip())).strftime('%Y-%m-%d %H:%M:%S UTC') r...
[ "def", "get_git_date", "(", "path", ",", "branch", ")", ":", "cmd", "=", "\"%s show -s --format=%%ct %s\"", "%", "(", "git_exe", ",", "branch", ")", "result", "=", "exec_cmd", "(", "cmd", ",", "path", ")", "if", "result", "[", "'out'", "]", "!=", "''", ...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/automate/automate-git.py#L162-L169
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py
python
Channel.has_user
(self, nick)
return nick in self.userdict
Check whether the channel has a user.
Check whether the channel has a user.
[ "Check", "whether", "the", "channel", "has", "a", "user", "." ]
def has_user(self, nick): """Check whether the channel has a user.""" return nick in self.userdict
[ "def", "has_user", "(", "self", ",", "nick", ")", ":", "return", "nick", "in", "self", ".", "userdict" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py#L336-L338
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/document.py
python
Document.lines
(self)
return self._cache.lines
Array of all the lines.
Array of all the lines.
[ "Array", "of", "all", "the", "lines", "." ]
def lines(self) -> List[str]: """ Array of all the lines. """ # Cache, because this one is reused very often. if self._cache.lines is None: self._cache.lines = _ImmutableLineList(self.text.split("\n")) return self._cache.lines
[ "def", "lines", "(", "self", ")", "->", "List", "[", "str", "]", ":", "# Cache, because this one is reused very often.", "if", "self", ".", "_cache", ".", "lines", "is", "None", ":", "self", ".", "_cache", ".", "lines", "=", "_ImmutableLineList", "(", "self"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/document.py#L198-L206
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/wire_format.py
python
IsTypePackable
(field_type)
return field_type not in NON_PACKABLE_TYPES
Return true iff packable = true is valid for fields of this type. Args: field_type: a FieldDescriptor::Type value. Returns: True iff fields of this type are packable.
Return true iff packable = true is valid for fields of this type.
[ "Return", "true", "iff", "packable", "=", "true", "is", "valid", "for", "fields", "of", "this", "type", "." ]
def IsTypePackable(field_type): """Return true iff packable = true is valid for fields of this type. Args: field_type: a FieldDescriptor::Type value. Returns: True iff fields of this type are packable. """ return field_type not in NON_PACKABLE_TYPES
[ "def", "IsTypePackable", "(", "field_type", ")", ":", "return", "field_type", "not", "in", "NON_PACKABLE_TYPES" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/wire_format.py#L259-L268
OpenNebula/one
982e09706fc444ae60a8ad2f818d6a795cbbdab4
share/websockify/websockify/websocket.py
python
WebSocketServer.do_handshake
(self, sock, address)
return retsock
do_handshake does the following: - Peek at the first few bytes from the socket. - If the connection is Flash policy request then answer it, close the socket and return. - If the connection is an HTTPS/SSL/TLS connection then SSL wrap the socket. - Read from the (possi...
do_handshake does the following: - Peek at the first few bytes from the socket. - If the connection is Flash policy request then answer it, close the socket and return. - If the connection is an HTTPS/SSL/TLS connection then SSL wrap the socket. - Read from the (possi...
[ "do_handshake", "does", "the", "following", ":", "-", "Peek", "at", "the", "first", "few", "bytes", "from", "the", "socket", ".", "-", "If", "the", "connection", "is", "Flash", "policy", "request", "then", "answer", "it", "close", "the", "socket", "and", ...
def do_handshake(self, sock, address): """ do_handshake does the following: - Peek at the first few bytes from the socket. - If the connection is Flash policy request then answer it, close the socket and return. - If the connection is an HTTPS/SSL/TLS connection then SS...
[ "def", "do_handshake", "(", "self", ",", "sock", ",", "address", ")", ":", "ready", "=", "select", ".", "select", "(", "[", "sock", "]", ",", "[", "]", ",", "[", "]", ",", "3", ")", "[", "0", "]", "if", "not", "ready", ":", "raise", "self", "...
https://github.com/OpenNebula/one/blob/982e09706fc444ae60a8ad2f818d6a795cbbdab4/share/websockify/websockify/websocket.py#L788-L863
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/core.py
python
register_signals
()
register system signal handlers for SIGTERM and SIGINT
register system signal handlers for SIGTERM and SIGINT
[ "register", "system", "signal", "handlers", "for", "SIGTERM", "and", "SIGINT" ]
def register_signals(): """ register system signal handlers for SIGTERM and SIGINT """ _signalChain[signal.SIGTERM] = signal.signal(signal.SIGTERM, _ros_signal) _signalChain[signal.SIGINT] = signal.signal(signal.SIGINT, _ros_signal)
[ "def", "register_signals", "(", ")", ":", "_signalChain", "[", "signal", ".", "SIGTERM", "]", "=", "signal", ".", "signal", "(", "signal", ".", "SIGTERM", ",", "_ros_signal", ")", "_signalChain", "[", "signal", ".", "SIGINT", "]", "=", "signal", ".", "si...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/core.py#L514-L519
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibook.py
python
AuiNotebook.GetPage
(self, page_idx)
return self._tabs.GetWindowFromIdx(page_idx)
Returns the page specified by the given index. :param integer `page_idx`: the page index.
Returns the page specified by the given index.
[ "Returns", "the", "page", "specified", "by", "the", "given", "index", "." ]
def GetPage(self, page_idx): """ Returns the page specified by the given index. :param integer `page_idx`: the page index. """ if page_idx >= self._tabs.GetPageCount(): raise Exception("invalid notebook page") return self._tabs.GetWindowFromIdx(page_idx)
[ "def", "GetPage", "(", "self", ",", "page_idx", ")", ":", "if", "page_idx", ">=", "self", ".", "_tabs", ".", "GetPageCount", "(", ")", ":", "raise", "Exception", "(", "\"invalid notebook page\"", ")", "return", "self", ".", "_tabs", ".", "GetWindowFromIdx", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L4242-L4252
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_ClockRateAdjust_REQUEST.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPM2_ClockRateAdjust_REQUEST)
Returns new TPM2_ClockRateAdjust_REQUEST object constructed from its marshaled representation in the given byte buffer
Returns new TPM2_ClockRateAdjust_REQUEST object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPM2_ClockRateAdjust_REQUEST", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPM2_ClockRateAdjust_REQUEST object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPM2_ClockRateAdjust_REQUEST)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPM2_ClockRateAdjust_REQUEST", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L16412-L16416
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py
python
guess_all_extensions
(type, strict=True)
return _db.guess_all_extensions(type, strict)
Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by ...
Guess the extensions for a file based on its MIME type.
[ "Guess", "the", "extensions", "for", "a", "file", "based", "on", "its", "MIME", "type", "." ]
def guess_all_extensions(type, strict=True): """Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data strea...
[ "def", "guess_all_extensions", "(", "type", ",", "strict", "=", "True", ")", ":", "if", "_db", "is", "None", ":", "init", "(", ")", "return", "_db", ".", "guess_all_extensions", "(", "type", ",", "strict", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py#L295-L310
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/imp.py
python
load_package
(name, path)
**DEPRECATED**
**DEPRECATED**
[ "**", "DEPRECATED", "**" ]
def load_package(name, path): """**DEPRECATED**""" if os.path.isdir(path): extensions = (machinery.SOURCE_SUFFIXES[:] + machinery.BYTECODE_SUFFIXES[:]) for extension in extensions: init_path = os.path.join(path, '__init__' + extension) if os.path.exi...
[ "def", "load_package", "(", "name", ",", "path", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "extensions", "=", "(", "machinery", ".", "SOURCE_SUFFIXES", "[", ":", "]", "+", "machinery", ".", "BYTECODE_SUFFIXES", "[", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/imp.py#L199-L216
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py
python
_weight_tensor
(features, weight_column_name)
Returns weights as `Tensor` of rank 0, or at least 2.
Returns weights as `Tensor` of rank 0, or at least 2.
[ "Returns", "weights", "as", "Tensor", "of", "rank", "0", "or", "at", "least", "2", "." ]
def _weight_tensor(features, weight_column_name): """Returns weights as `Tensor` of rank 0, or at least 2.""" if not weight_column_name: return None if weight_column_name not in features: raise ValueError("Weights {} missing from features.".format( weight_column_name)) with ops.name_scope(None, ...
[ "def", "_weight_tensor", "(", "features", ",", "weight_column_name", ")", ":", "if", "not", "weight_column_name", ":", "return", "None", "if", "weight_column_name", "not", "in", "features", ":", "raise", "ValueError", "(", "\"Weights {} missing from features.\"", ".",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py#L1779-L1799
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/integrate/odepack.py
python
odeint
(func, y0, t, args=(), Dfun=None, col_deriv=0, full_output=0, ml=None, mu=None, rtol=None, atol=None, tcrit=None, h0=0.0, hmax=0.0, hmin=0.0, ixpr=0, mxstep=0, mxhnil=0, mxordn=12, mxords=5, printmessg=0, tfirst=False)
Integrate a system of ordinary differential equations. .. note:: For new code, use `scipy.integrate.solve_ivp` to solve a differential equation. Solve a system of ordinary differential equations using lsoda from the FORTRAN library odepack. Solves the initial value problem for stiff...
Integrate a system of ordinary differential equations. .. note:: For new code, use `scipy.integrate.solve_ivp` to solve a differential equation.
[ "Integrate", "a", "system", "of", "ordinary", "differential", "equations", ".", "..", "note", "::", "For", "new", "code", "use", "scipy", ".", "integrate", ".", "solve_ivp", "to", "solve", "a", "differential", "equation", "." ]
def odeint(func, y0, t, args=(), Dfun=None, col_deriv=0, full_output=0, ml=None, mu=None, rtol=None, atol=None, tcrit=None, h0=0.0, hmax=0.0, hmin=0.0, ixpr=0, mxstep=0, mxhnil=0, mxordn=12, mxords=5, printmessg=0, tfirst=False): """ Integrate a system of ordinary differential e...
[ "def", "odeint", "(", "func", ",", "y0", ",", "t", ",", "args", "=", "(", ")", ",", "Dfun", "=", "None", ",", "col_deriv", "=", "0", ",", "full_output", "=", "0", ",", "ml", "=", "None", ",", "mu", "=", "None", ",", "rtol", "=", "None", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/odepack.py#L28-L259
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/twodim_base.py
python
tri
(N, M=None, k=0, dtype=float)
return m.astype(dtype)
An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`. k : int, optional The sub-diagonal at and below...
An array with ones at and below the given diagonal and zeros elsewhere.
[ "An", "array", "with", "ones", "at", "and", "below", "the", "given", "diagonal", "and", "zeros", "elsewhere", "." ]
def tri(N, M=None, k=0, dtype=float): """ An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`. k : i...
[ "def", "tri", "(", "N", ",", "M", "=", "None", ",", "k", "=", "0", ",", "dtype", "=", "float", ")", ":", "if", "M", "is", "None", ":", "M", "=", "N", "m", "=", "greater_equal", "(", "subtract", ".", "outer", "(", "arange", "(", "N", ")", ",...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/twodim_base.py#L349-L389
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListBox.SetFirstItem
(*args, **kwargs)
return _controls_.ListBox_SetFirstItem(*args, **kwargs)
SetFirstItem(self, int n)
SetFirstItem(self, int n)
[ "SetFirstItem", "(", "self", "int", "n", ")" ]
def SetFirstItem(*args, **kwargs): """SetFirstItem(self, int n)""" return _controls_.ListBox_SetFirstItem(*args, **kwargs)
[ "def", "SetFirstItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListBox_SetFirstItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1221-L1223
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py
python
is_any_int_dtype
(arr_or_dtype)
return _is_dtype_type(arr_or_dtype, classes(np.integer, np.timedelta64))
Check whether the provided array or dtype is of an integer dtype. In this function, timedelta64 instances are also considered "any-integer" type objects and will return True. This function is internal and should not be exposed in the public API. .. versionchanged:: 0.24.0 The nullable Integer...
Check whether the provided array or dtype is of an integer dtype.
[ "Check", "whether", "the", "provided", "array", "or", "dtype", "is", "of", "an", "integer", "dtype", "." ]
def is_any_int_dtype(arr_or_dtype) -> bool: """ Check whether the provided array or dtype is of an integer dtype. In this function, timedelta64 instances are also considered "any-integer" type objects and will return True. This function is internal and should not be exposed in the public API. ...
[ "def", "is_any_int_dtype", "(", "arr_or_dtype", ")", "->", "bool", ":", "return", "_is_dtype_type", "(", "arr_or_dtype", ",", "classes", "(", "np", ".", "integer", ",", "np", ".", "timedelta64", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py#L724-L772
vmware/concord-bft
ec036a384b4c81be0423d4b429bd37900b13b864
util/pyclient/bft_client.py
python
BftClient._send_data
(self, data, replica, endpoint_num=0xFFFFFFFFFFFFFFFF)
Send data to a replica by the client specific implementation
Send data to a replica by the client specific implementation
[ "Send", "data", "to", "a", "replica", "by", "the", "client", "specific", "implementation" ]
async def _send_data(self, data, replica, endpoint_num=0xFFFFFFFFFFFFFFFF): """ Send data to a replica by the client specific implementation """ pass
[ "async", "def", "_send_data", "(", "self", ",", "data", ",", "replica", ",", "endpoint_num", "=", "0xFFFFFFFFFFFFFFFF", ")", ":", "pass" ]
https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/util/pyclient/bft_client.py#L112-L114
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/utils/spirv/gen_spirv_dialect.py
python
update_td_enum_attrs
(path, operand_kinds, filter_list)
Updates SPIRBase.td with new generated enum definitions. Arguments: - path: the path to SPIRBase.td - operand_kinds: a list containing all operand kinds' grammar - filter_list: a list containing new enums to add
Updates SPIRBase.td with new generated enum definitions.
[ "Updates", "SPIRBase", ".", "td", "with", "new", "generated", "enum", "definitions", "." ]
def update_td_enum_attrs(path, operand_kinds, filter_list): """Updates SPIRBase.td with new generated enum definitions. Arguments: - path: the path to SPIRBase.td - operand_kinds: a list containing all operand kinds' grammar - filter_list: a list containing new enums to add """ with open(path, 'r')...
[ "def", "update_td_enum_attrs", "(", "path", ",", "operand_kinds", ",", "filter_list", ")", ":", "with", "open", "(", "path", ",", "'r'", ")", "as", "f", ":", "content", "=", "f", ".", "read", "(", ")", "content", "=", "content", ".", "split", "(", "A...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/utils/spirv/gen_spirv_dialect.py#L568-L609
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pdfviewer/dcgraphics.py
python
dcGraphicsState.Get_angle
(self)
return self.rotDegrees
Return rotation angle in degrees
Return rotation angle in degrees
[ "Return", "rotation", "angle", "in", "degrees" ]
def Get_angle(self): """ Return rotation angle in degrees """ return self.rotDegrees
[ "def", "Get_angle", "(", "self", ")", ":", "return", "self", ".", "rotDegrees" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pdfviewer/dcgraphics.py#L96-L98
lmb-freiburg/flownet2
b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc
python/caffe/pycaffe.py
python
_Net_forward_all
(self, blobs=None, **kwargs)
return all_outs
Run net forward in batches. Parameters ---------- blobs : list of blobs to extract as in forward() kwargs : Keys are input blob names and values are blob ndarrays. Refer to forward(). Returns ------- all_outs : {blob name: list of blobs} dict.
Run net forward in batches.
[ "Run", "net", "forward", "in", "batches", "." ]
def _Net_forward_all(self, blobs=None, **kwargs): """ Run net forward in batches. Parameters ---------- blobs : list of blobs to extract as in forward() kwargs : Keys are input blob names and values are blob ndarrays. Refer to forward(). Returns ------- all_outs : {blo...
[ "def", "_Net_forward_all", "(", "self", ",", "blobs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Collect outputs from batches", "all_outs", "=", "{", "out", ":", "[", "]", "for", "out", "in", "set", "(", "self", ".", "outputs", "+", "(", "blobs...
https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/python/caffe/pycaffe.py#L175-L203
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py
python
DescriptorPool.FindFileByName
(self, file_name)
return self._ConvertFileProtoToFileDescriptor(file_proto)
Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file can not be found in the pool.
Gets a FileDescriptor by file name.
[ "Gets", "a", "FileDescriptor", "by", "file", "name", "." ]
def FindFileByName(self, file_name): """Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file can not be found in the pool. """ try: file_proto = s...
[ "def", "FindFileByName", "(", "self", ",", "file_name", ")", ":", "try", ":", "file_proto", "=", "self", ".", "_internal_db", ".", "FindFileByName", "(", "file_name", ")", "except", "KeyError", "as", "error", ":", "if", "self", ".", "_descriptor_db", ":", ...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py#L92-L114
neo-ai/neo-ai-dlr
bf397aa0367a5207654c00d2985f900d94ad1543
python/dlr/counter/deviceinfo.py
python
ARMDevice.get_info
(self)
return dict_arm
Prepare a dictionary of data member in sequence. 1. Processor 2. Speed 3. Arch Parameters ---------- self : return a dictionary of data members
Prepare a dictionary of data member in sequence. 1. Processor 2. Speed 3. Arch Parameters ---------- self : return a dictionary of data members
[ "Prepare", "a", "dictionary", "of", "data", "member", "in", "sequence", ".", "1", ".", "Processor", "2", ".", "Speed", "3", ".", "Arch", "Parameters", "----------", "self", ":", "return", "a", "dictionary", "of", "data", "members" ]
def get_info(self): """ Prepare a dictionary of data member in sequence. 1. Processor 2. Speed 3. Arch Parameters ---------- self : return a dictionary of data members """ dict_arm = { "processor": self.processor, ...
[ "def", "get_info", "(", "self", ")", ":", "dict_arm", "=", "{", "\"processor\"", ":", "self", ".", "processor", ",", "\"speed\"", ":", "self", ".", "speed", ",", "\"arch\"", ":", "self", ".", "arch", "}", "return", "dict_arm" ]
https://github.com/neo-ai/neo-ai-dlr/blob/bf397aa0367a5207654c00d2985f900d94ad1543/python/dlr/counter/deviceinfo.py#L53-L70
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/frameworks/modelling.py
python
Modelling.setDataSpace
(self, **kwargs)
Set data space, e.g., DataContainer, times, coordinates.
Set data space, e.g., DataContainer, times, coordinates.
[ "Set", "data", "space", "e", ".", "g", ".", "DataContainer", "times", "coordinates", "." ]
def setDataSpace(self, **kwargs): """Set data space, e.g., DataContainer, times, coordinates.""" if self.fop is not None: pg.critical('in use?') self.fop.setDataSpace(**kwargs) else: data = kwargs.pop('dataContainer', None) if isinstance(data, pg.D...
[ "def", "setDataSpace", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "fop", "is", "not", "None", ":", "pg", ".", "critical", "(", "'in use?'", ")", "self", ".", "fop", ".", "setDataSpace", "(", "*", "*", "kwargs", ")", "else", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/modelling.py#L336-L348
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBThread.GetDescription
(self, *args)
return _lldb.SBThread_GetDescription(self, *args)
GetDescription(SBThread self, SBStream description) -> bool GetDescription(SBThread self, SBStream description, bool stop_format) -> bool Get the description strings for this thread that match what the lldb driver will present, using the thread-format (stop_format==false) or thread-sto...
GetDescription(SBThread self, SBStream description) -> bool GetDescription(SBThread self, SBStream description, bool stop_format) -> bool
[ "GetDescription", "(", "SBThread", "self", "SBStream", "description", ")", "-", ">", "bool", "GetDescription", "(", "SBThread", "self", "SBStream", "description", "bool", "stop_format", ")", "-", ">", "bool" ]
def GetDescription(self, *args): """ GetDescription(SBThread self, SBStream description) -> bool GetDescription(SBThread self, SBStream description, bool stop_format) -> bool Get the description strings for this thread that match what the lldb driver will present, using the thr...
[ "def", "GetDescription", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBThread_GetDescription", "(", "self", ",", "*", "args", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L11855-L11865
uber/neuropod
de304c40ec0634a868d7ef41ba7bf89ebc364f10
source/python/neuropod/utils/config_utils.py
python
read_neuropod_config
(neuropod_path)
Reads a neuropod config :param neuropod_path: The path to a neuropod package
Reads a neuropod config
[ "Reads", "a", "neuropod", "config" ]
def read_neuropod_config(neuropod_path): """ Reads a neuropod config :param neuropod_path: The path to a neuropod package """ with open(os.path.join(neuropod_path, "config.json"), "r") as config_file: config = json.load(config_file) # For backwards compatibility # TODO(vi...
[ "def", "read_neuropod_config", "(", "neuropod_path", ")", ":", "with", "open", "(", "os", ".", "path", ".", "join", "(", "neuropod_path", ",", "\"config.json\"", ")", ",", "\"r\"", ")", "as", "config_file", ":", "config", "=", "json", ".", "load", "(", "...
https://github.com/uber/neuropod/blob/de304c40ec0634a868d7ef41ba7bf89ebc364f10/source/python/neuropod/utils/config_utils.py#L261-L282
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetProductType
(self)
Returns the PRODUCT_TYPE of this target.
Returns the PRODUCT_TYPE of this target.
[ "Returns", "the", "PRODUCT_TYPE", "of", "this", "target", "." ]
def GetProductType(self): """Returns the PRODUCT_TYPE of this target.""" if self._IsIosAppExtension(): assert self._IsBundle(), ('ios_app_extension flag requires mac_bundle ' '(target %s)' % self.spec['target_name']) return 'com.apple.product-type.app-extension' if self._IsIosWatchKitE...
[ "def", "GetProductType", "(", "self", ")", ":", "if", "self", ".", "_IsIosAppExtension", "(", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", ",", "(", "'ios_app_extension flag requires mac_bundle '", "'(target %s)'", "%", "self", ".", "spec", "[", "'t...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L318-L344
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/roslaunch/src/roslaunch/rlutil.py
python
check_roslaunch
(f)
Check roslaunch file for errors, returning error message if check fails. This routine is mainly to support rostest's roslaunch_check. :param f: roslaunch file name, ``str`` :returns: error message or ``None``
Check roslaunch file for errors, returning error message if check fails. This routine is mainly to support rostest's roslaunch_check.
[ "Check", "roslaunch", "file", "for", "errors", "returning", "error", "message", "if", "check", "fails", ".", "This", "routine", "is", "mainly", "to", "support", "rostest", "s", "roslaunch_check", "." ]
def check_roslaunch(f): """ Check roslaunch file for errors, returning error message if check fails. This routine is mainly to support rostest's roslaunch_check. :param f: roslaunch file name, ``str`` :returns: error message or ``None`` """ try: rl_config = roslaunch.config.load_con...
[ "def", "check_roslaunch", "(", "f", ")", ":", "try", ":", "rl_config", "=", "roslaunch", ".", "config", ".", "load_config_default", "(", "[", "f", "]", ",", "DEFAULT_MASTER_PORT", ",", "verbose", "=", "False", ")", "except", "roslaunch", ".", "core", ".", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/rlutil.py#L183-L251
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/HyperParser.py
python
HyperParser.get_expression
(self)
return rawtext[last_identifier_pos:self.indexinrawtext]
Return a string with the Python expression which ends at the given index, which is empty if there is no real one.
Return a string with the Python expression which ends at the given index, which is empty if there is no real one.
[ "Return", "a", "string", "with", "the", "Python", "expression", "which", "ends", "at", "the", "given", "index", "which", "is", "empty", "if", "there", "is", "no", "real", "one", "." ]
def get_expression(self): """Return a string with the Python expression which ends at the given index, which is empty if there is no real one. """ if not self.is_in_code(): raise ValueError("get_expression should only be called if index "\ "is ins...
[ "def", "get_expression", "(", "self", ")", ":", "if", "not", "self", ".", "is_in_code", "(", ")", ":", "raise", "ValueError", "(", "\"get_expression should only be called if index \"", "\"is inside a code.\"", ")", "rawtext", "=", "self", ".", "rawtext", "bracketing...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/HyperParser.py#L161-L246
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftgeoutils/geo_arrays.py
python
get_init_values
(path, count=6)
return norm, edge, step, inc
Set values needed to create the array.
Set values needed to create the array.
[ "Set", "values", "needed", "to", "create", "the", "array", "." ]
def get_init_values(path, count=6): """Set values needed to create the array.""" norm = App.Vector(0, 0, 1) # Currently this works with a sketch that has a single edge. # Here we need a more general function to extract all edges from a shape, # so that the array uses all of them. edge = path.Sh...
[ "def", "get_init_values", "(", "path", ",", "count", "=", "6", ")", ":", "norm", "=", "App", ".", "Vector", "(", "0", ",", "0", ",", "1", ")", "# Currently this works with a sketch that has a single edge.", "# Here we need a more general function to extract all edges fr...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/geo_arrays.py#L57-L70
amd/OpenCL-caffe
638543108517265366c18ae5821f3096cf5cf34a
scripts/cpp_lint.py
python
UpdateIncludeState
(filename, include_state, io=codecs)
return True
Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was succesful...
Fill up the include_state with new includes found from the file.
[ "Fill", "up", "the", "include_state", "with", "new", "includes", "found", "from", "the", "file", "." ]
def UpdateIncludeState(filename, include_state, io=codecs): """Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provide...
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_state", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "excep...
https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L4454-L4480
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/framework.py
python
convert_np_dtype_to_dtype_
(np_dtype)
Convert the data type in numpy to the data type in Paddle Args: np_dtype(np.dtype): the data type in numpy. Returns: core.VarDesc.VarType: the data type in Paddle.
Convert the data type in numpy to the data type in Paddle
[ "Convert", "the", "data", "type", "in", "numpy", "to", "the", "data", "type", "in", "Paddle" ]
def convert_np_dtype_to_dtype_(np_dtype): """ Convert the data type in numpy to the data type in Paddle Args: np_dtype(np.dtype): the data type in numpy. Returns: core.VarDesc.VarType: the data type in Paddle. """ dtype = np.dtype(np_dtype) if dtype == np.float32: ...
[ "def", "convert_np_dtype_to_dtype_", "(", "np_dtype", ")", ":", "dtype", "=", "np", ".", "dtype", "(", "np_dtype", ")", "if", "dtype", "==", "np", ".", "float32", ":", "return", "core", ".", "VarDesc", ".", "VarType", ".", "FP32", "elif", "dtype", "==", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L969-L1008
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
scripts/cpp_lint.py
python
CleanseRawStrings
(raw_lines)
return lines_without_raw_strings
Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Returns: list of lines with C++11 raw str...
Removes C++11 raw strings from lines.
[ "Removes", "C", "++", "11", "raw", "strings", "from", "lines", "." ]
def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Return...
[ "def", "CleanseRawStrings", "(", "raw_lines", ")", ":", "delimiter", "=", "None", "lines_without_raw_strings", "=", "[", "]", "for", "line", "in", "raw_lines", ":", "if", "delimiter", ":", "# Inside a raw string, look for the end", "end", "=", "line", ".", "find",...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L1062-L1120
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_PropertyName
(proto_field_name)
return proto_field_name
Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field. Args: proto_field_name: The protocol message field name, exactly as it appears (or would appear) in a .proto file.
Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field.
[ "Returns", "the", "name", "of", "the", "public", "property", "attribute", "which", "clients", "can", "use", "to", "get", "and", "(", "in", "some", "cases", ")", "set", "the", "value", "of", "a", "protocol", "message", "field", "." ]
def _PropertyName(proto_field_name): """Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field. Args: proto_field_name: The protocol message field name, exactly as it appears (or would appear) in a .proto file. ""...
[ "def", "_PropertyName", "(", "proto_field_name", ")", ":", "# TODO(robinson): Escape Python keywords (e.g., yield), and test this support.", "# nnorwitz makes my day by writing:", "# \"\"\"", "# FYI. See the keyword module in the stdlib. This could be as simple as:", "#", "# if keyword.iskeyw...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/python_message.py#L200-L226
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
SizerItem.CalcMin
(*args, **kwargs)
return _core_.SizerItem_CalcMin(*args, **kwargs)
CalcMin(self) -> Size Calculates the minimum desired size for the item, including any space needed by borders.
CalcMin(self) -> Size
[ "CalcMin", "(", "self", ")", "-", ">", "Size" ]
def CalcMin(*args, **kwargs): """ CalcMin(self) -> Size Calculates the minimum desired size for the item, including any space needed by borders. """ return _core_.SizerItem_CalcMin(*args, **kwargs)
[ "def", "CalcMin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItem_CalcMin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14064-L14071
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiPaneInfo.Hide
(*args, **kwargs)
return _aui.AuiPaneInfo_Hide(*args, **kwargs)
Hide(self) -> AuiPaneInfo
Hide(self) -> AuiPaneInfo
[ "Hide", "(", "self", ")", "-", ">", "AuiPaneInfo" ]
def Hide(*args, **kwargs): """Hide(self) -> AuiPaneInfo""" return _aui.AuiPaneInfo_Hide(*args, **kwargs)
[ "def", "Hide", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_Hide", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L425-L427
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py
python
CCompiler.set_library_dirs
(self, dirs)
Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default.
Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default.
[ "Set", "the", "list", "of", "library", "search", "directories", "to", "dirs", "(", "a", "list", "of", "strings", ")", ".", "This", "does", "not", "affect", "any", "standard", "library", "search", "path", "that", "the", "linker", "may", "search", "by", "d...
def set_library_dirs(self, dirs): """Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default. """ self.library_dirs = dirs[:]
[ "def", "set_library_dirs", "(", "self", ",", "dirs", ")", ":", "self", ".", "library_dirs", "=", "dirs", "[", ":", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py#L267-L272
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/targets.py
python
AbstractTarget.full_name
(self)
return location + '/' + self.name_
Returns a user-readable name for this target.
Returns a user-readable name for this target.
[ "Returns", "a", "user", "-", "readable", "name", "for", "this", "target", "." ]
def full_name (self): """ Returns a user-readable name for this target. """ location = self.project ().get ('location') return location + '/' + self.name_
[ "def", "full_name", "(", "self", ")", ":", "location", "=", "self", ".", "project", "(", ")", ".", "get", "(", "'location'", ")", "return", "location", "+", "'/'", "+", "self", ".", "name_" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/targets.py#L334-L338
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.HitTestXY
(*args, **kwargs)
return _richtext.RichTextCtrl_HitTestXY(*args, **kwargs)
HitTestRC(self, Point pt) --> (result, col, row) Returns the column and row of the given point in pixels. Note that ``pt`` should be given in device coordinates, and not be adjusted for the client area origin nor for scrolling. The return value is a tuple of the hit test result and th...
HitTestRC(self, Point pt) --> (result, col, row)
[ "HitTestRC", "(", "self", "Point", "pt", ")", "--", ">", "(", "result", "col", "row", ")" ]
def HitTestXY(*args, **kwargs): """ HitTestRC(self, Point pt) --> (result, col, row) Returns the column and row of the given point in pixels. Note that ``pt`` should be given in device coordinates, and not be adjusted for the client area origin nor for scrolling. The return va...
[ "def", "HitTestXY", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_HitTestXY", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3210-L3219
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/generator.py
python
RtfColorTbl.AddColor
(self, si_color)
Takes a style item and adds it to the table if has not already been defined in the table. @param si_color: hex color string
Takes a style item and adds it to the table if has not already been defined in the table. @param si_color: hex color string
[ "Takes", "a", "style", "item", "and", "adds", "it", "to", "the", "table", "if", "has", "not", "already", "been", "defined", "in", "the", "table", ".", "@param", "si_color", ":", "hex", "color", "string" ]
def AddColor(self, si_color): """Takes a style item and adds it to the table if has not already been defined in the table. @param si_color: hex color string """ if si_color not in self._index: rgb = eclib.HexToRGB(si_color.split(u',')[0]) color = "\\red%d...
[ "def", "AddColor", "(", "self", ",", "si_color", ")", ":", "if", "si_color", "not", "in", "self", ".", "_index", ":", "rgb", "=", "eclib", ".", "HexToRGB", "(", "si_color", ".", "split", "(", "u','", ")", "[", "0", "]", ")", "color", "=", "\"\\\\re...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/generator.py#L914-L926
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/algorithm_detail/single_execution.py
python
perform_can_subtraction
(sample, can, parent_alg)
return output_workspace
Subtracts the can from the sample workspace. We need to manually take care of the q resolution issue here. :param sample: the sample workspace :param can: the can workspace. :param parent_alg: a handle to the parent algorithm. :return: the subtracted workspace.
Subtracts the can from the sample workspace.
[ "Subtracts", "the", "can", "from", "the", "sample", "workspace", "." ]
def perform_can_subtraction(sample, can, parent_alg): """ Subtracts the can from the sample workspace. We need to manually take care of the q resolution issue here. :param sample: the sample workspace :param can: the can workspace. :param parent_alg: a handle to the parent algorithm. :retur...
[ "def", "perform_can_subtraction", "(", "sample", ",", "can", ",", "parent_alg", ")", ":", "subtraction_name", "=", "\"Minus\"", "subtraction_options", "=", "{", "\"LHSWorkspace\"", ":", "sample", ",", "\"RHSWorkspace\"", ":", "can", ",", "\"OutputWorkspace\"", ":", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/single_execution.py#L218-L240
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/encoder.py
python
_SignedVarintSize
(value)
return 10
Compute the size of a signed varint value.
Compute the size of a signed varint value.
[ "Compute", "the", "size", "of", "a", "signed", "varint", "value", "." ]
def _SignedVarintSize(value): """Compute the size of a signed varint value.""" if value < 0: return 10 if value <= 0x7f: return 1 if value <= 0x3fff: return 2 if value <= 0x1fffff: return 3 if value <= 0xfffffff: return 4 if value <= 0x7ffffffff: return 5 if value <= 0x3ffffffffff: return 6 if value <...
[ "def", "_SignedVarintSize", "(", "value", ")", ":", "if", "value", "<", "0", ":", "return", "10", "if", "value", "<=", "0x7f", ":", "return", "1", "if", "value", "<=", "0x3fff", ":", "return", "2", "if", "value", "<=", "0x1fffff", ":", "return", "3",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/encoder.py#L96-L108
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/pySketch/pySketch.py
python
TextObjectValidator.Clone
(self)
return TextObjectValidator()
Standard cloner. Note that every validator must implement the Clone() method.
Standard cloner.
[ "Standard", "cloner", "." ]
def Clone(self): """ Standard cloner. Note that every validator must implement the Clone() method. """ return TextObjectValidator()
[ "def", "Clone", "(", "self", ")", ":", "return", "TextObjectValidator", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pySketch/pySketch.py#L3418-L3423
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
python_packaging/src/gmxapi/abc.py
python
OperationReference.output
(self)
Get a proxy collection to the output of the operation. Developer note: The 'output' property exists to isolate the namespace of output data from other operation handle attributes and we should consider whether it is actually necessary or helpful. To facilitate its possible future remova...
Get a proxy collection to the output of the operation.
[ "Get", "a", "proxy", "collection", "to", "the", "output", "of", "the", "operation", "." ]
def output(self) -> OutputDataProxy: """Get a proxy collection to the output of the operation. Developer note: The 'output' property exists to isolate the namespace of output data from other operation handle attributes and we should consider whether it is actually necessary or helpful. ...
[ "def", "output", "(", "self", ")", "->", "OutputDataProxy", ":", "..." ]
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/abc.py#L285-L296
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/impala_client.py
python
ImpalaClient.get_runtime_profile
(self, last_query_handle)
Get the runtime profile string from the server. Returns None if an error was encountered. If the query was retried, returns the profile of the failed attempt as well; the tuple (profile, failed_profile) is returned where 'profile' is the profile of the most recent query attempt and 'failed_profile' is the p...
Get the runtime profile string from the server. Returns None if an error was encountered. If the query was retried, returns the profile of the failed attempt as well; the tuple (profile, failed_profile) is returned where 'profile' is the profile of the most recent query attempt and 'failed_profile' is the p...
[ "Get", "the", "runtime", "profile", "string", "from", "the", "server", ".", "Returns", "None", "if", "an", "error", "was", "encountered", ".", "If", "the", "query", "was", "retried", "returns", "the", "profile", "of", "the", "failed", "attempt", "as", "wel...
def get_runtime_profile(self, last_query_handle): """Get the runtime profile string from the server. Returns None if an error was encountered. If the query was retried, returns the profile of the failed attempt as well; the tuple (profile, failed_profile) is returned where 'profile' is the profile of th...
[ "def", "get_runtime_profile", "(", "self", ",", "last_query_handle", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_client.py#L319-L326
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
GMBot/gmbot/apps/smsg_r/smsapp/idgen.py
python
generate_naive
(passwordlength=8, vowel_interlace=False, alphabet=_lowercase, vowels=_vowels)
return "".join(pw)
naive implementation. Set vowel_interlace=True to simulate pronouncable passwords
naive implementation. Set vowel_interlace=True to simulate pronouncable passwords
[ "naive", "implementation", ".", "Set", "vowel_interlace", "=", "True", "to", "simulate", "pronouncable", "passwords" ]
def generate_naive(passwordlength=8, vowel_interlace=False, alphabet=_lowercase, vowels=_vowels): '''naive implementation. Set vowel_interlace=True to simulate pronouncable passwords''' pw = [] for pos in xrange(passwordlength): # if vowel_interlace, dont allow two consonants in a row if vow...
[ "def", "generate_naive", "(", "passwordlength", "=", "8", ",", "vowel_interlace", "=", "False", ",", "alphabet", "=", "_lowercase", ",", "vowels", "=", "_vowels", ")", ":", "pw", "=", "[", "]", "for", "pos", "in", "xrange", "(", "passwordlength", ")", ":...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/GMBot/gmbot/apps/smsg_r/smsapp/idgen.py#L163-L172
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/second-largest-digit-in-a-string.py
python
Solution.secondHighest
(self, s)
return second
:type s: str :rtype: int
:type s: str :rtype: int
[ ":", "type", "s", ":", "str", ":", "rtype", ":", "int" ]
def secondHighest(self, s): """ :type s: str :rtype: int """ first = second = -1 for c in s: if not c.isdigit(): continue d = int(c) if d > first: first, second = d, first elif first > d > sec...
[ "def", "secondHighest", "(", "self", ",", "s", ")", ":", "first", "=", "second", "=", "-", "1", "for", "c", "in", "s", ":", "if", "not", "c", ".", "isdigit", "(", ")", ":", "continue", "d", "=", "int", "(", "c", ")", "if", "d", ">", "first", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/second-largest-digit-in-a-string.py#L5-L19
blchinezu/pocketbook-coolreader
d032f332ea2e392b04276d3c13ff07e98d4462f3
thirdparty/freetype/src/tools/glnames.py
python
dump_encoding
( file, encoding_name, encoding_list )
dump a given encoding
dump a given encoding
[ "dump", "a", "given", "encoding" ]
def dump_encoding( file, encoding_name, encoding_list ): """dump a given encoding""" write = file.write write( " /* the following are indices into the SID name table */\n" ) write( "#ifndef DEFINE_PS_TABLES_DATA\n" ) write( "#ifdef __cplusplus\n" ) write( ' extern "C"\n' ) write( "#else\n" ) write(...
[ "def", "dump_encoding", "(", "file", ",", "encoding_name", ",", "encoding_list", ")", ":", "write", "=", "file", ".", "write", "write", "(", "\" /* the following are indices into the SID name table */\\n\"", ")", "write", "(", "\"#ifndef DEFINE_PS_TABLES_DATA\\n\"", ")"...
https://github.com/blchinezu/pocketbook-coolreader/blob/d032f332ea2e392b04276d3c13ff07e98d4462f3/thirdparty/freetype/src/tools/glnames.py#L5211-L5245
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/sandbox.py
python
SandboxedEnvironment.call
(__self, __context, __obj, *args, **kwargs)
return __context.call(__obj, *args, **kwargs)
Call an object from sandboxed code.
Call an object from sandboxed code.
[ "Call", "an", "object", "from", "sandboxed", "code", "." ]
def call(__self, __context, __obj, *args, **kwargs): """Call an object from sandboxed code.""" # the double prefixes are to avoid double keyword argument # errors when proxying the call. if not __self.is_safe_callable(__obj): raise SecurityError('%r is not safely callable' % ...
[ "def", "call", "(", "__self", ",", "__context", ",", "__obj", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# the double prefixes are to avoid double keyword argument", "# errors when proxying the call.", "if", "not", "__self", ".", "is_safe_callable", "(", ...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/sandbox.py#L350-L356
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
is_masked
(x)
return False
Determine whether input has masked values. Accepts any object as input, but always returns False unless the input is a MaskedArray containing masked values. Parameters ---------- x : array_like Array to check for masked values. Returns ------- result : bool True if `x`...
Determine whether input has masked values.
[ "Determine", "whether", "input", "has", "masked", "values", "." ]
def is_masked(x): """ Determine whether input has masked values. Accepts any object as input, but always returns False unless the input is a MaskedArray containing masked values. Parameters ---------- x : array_like Array to check for masked values. Returns ------- res...
[ "def", "is_masked", "(", "x", ")", ":", "m", "=", "getmask", "(", "x", ")", "if", "m", "is", "nomask", ":", "return", "False", "elif", "m", ".", "any", "(", ")", ":", "return", "True", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L6474-L6524
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
RadioBox.SetItemToolTip
(*args, **kwargs)
return _controls_.RadioBox_SetItemToolTip(*args, **kwargs)
SetItemToolTip(self, unsigned int item, String text)
SetItemToolTip(self, unsigned int item, String text)
[ "SetItemToolTip", "(", "self", "unsigned", "int", "item", "String", "text", ")" ]
def SetItemToolTip(*args, **kwargs): """SetItemToolTip(self, unsigned int item, String text)""" return _controls_.RadioBox_SetItemToolTip(*args, **kwargs)
[ "def", "SetItemToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "RadioBox_SetItemToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2657-L2659
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py
python
Buffer.go_to_completion
(self, index)
Select a completion from the list of current completions.
Select a completion from the list of current completions.
[ "Select", "a", "completion", "from", "the", "list", "of", "current", "completions", "." ]
def go_to_completion(self, index): """ Select a completion from the list of current completions. """ assert index is None or isinstance(index, int) assert self.complete_state # Set new completion state = self.complete_state.go_to_index(index) # Set text/...
[ "def", "go_to_completion", "(", "self", ",", "index", ")", ":", "assert", "index", "is", "None", "or", "isinstance", "(", "index", ",", "int", ")", "assert", "self", ".", "complete_state", "# Set new completion", "state", "=", "self", ".", "complete_state", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py#L816-L831
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/manifold/mds.py
python
MDS.fit_transform
(self, X, y=None, init=None)
return self.embedding_
Fit the data from X, and returns the embedded coordinates Parameters ---------- X : array, shape=[n_samples, n_features], or [n_samples, n_samples] \ if dissimilarity='precomputed' Input data. init : {None or ndarray, shape (n_samples,)}, optional ...
Fit the data from X, and returns the embedded coordinates
[ "Fit", "the", "data", "from", "X", "and", "returns", "the", "embedded", "coordinates" ]
def fit_transform(self, X, y=None, init=None): """ Fit the data from X, and returns the embedded coordinates Parameters ---------- X : array, shape=[n_samples, n_features], or [n_samples, n_samples] \ if dissimilarity='precomputed' Input data. ...
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ",", "init", "=", "None", ")", ":", "X", "=", "check_array", "(", "X", ")", "if", "X", ".", "shape", "[", "0", "]", "==", "X", ".", "shape", "[", "1", "]", "and", "self", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/manifold/mds.py#L379-L416
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py
python
MessageReceiver.stop
(self)
Request to stop this instance. The instance will be stopped after receiving the next message. This method may not be very useful, but there is no clean way in Python to forcefully stop a running thread.
Request to stop this instance.
[ "Request", "to", "stop", "this", "instance", "." ]
def stop(self): """Request to stop this instance. The instance will be stopped after receiving the next message. This method may not be very useful, but there is no clean way in Python to forcefully stop a running thread. """ self._stop_requested = True
[ "def", "stop", "(", "self", ")", ":", "self", ".", "_stop_requested", "=", "True" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py#L164-L171
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/zipfile.py
python
ZipFile.infolist
(self)
return self.filelist
Return a list of class ZipInfo instances for files in the archive.
Return a list of class ZipInfo instances for files in the archive.
[ "Return", "a", "list", "of", "class", "ZipInfo", "instances", "for", "files", "in", "the", "archive", "." ]
def infolist(self): """Return a list of class ZipInfo instances for files in the archive.""" return self.filelist
[ "def", "infolist", "(", "self", ")", ":", "return", "self", ".", "filelist" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/zipfile.py#L875-L878
junhyukoh/caffe-lstm
598d45456fa2a1b127a644f4aa38daa8fb9fc722
scripts/cpp_lint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L1045-L1059
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
VarVScrollHelper.RefreshRow
(*args, **kwargs)
return _windows_.VarVScrollHelper_RefreshRow(*args, **kwargs)
RefreshRow(self, size_t row)
RefreshRow(self, size_t row)
[ "RefreshRow", "(", "self", "size_t", "row", ")" ]
def RefreshRow(*args, **kwargs): """RefreshRow(self, size_t row)""" return _windows_.VarVScrollHelper_RefreshRow(*args, **kwargs)
[ "def", "RefreshRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarVScrollHelper_RefreshRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2289-L2291
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.wait
(self)
return self.exitstatus
This waits until the child exits. This is a blocking call. This will not read any data from the child, so this will block forever if the child has unread output and has terminated. In other words, the child may have printed output then called exit(), but, the child is technically still a...
This waits until the child exits. This is a blocking call. This will not read any data from the child, so this will block forever if the child has unread output and has terminated. In other words, the child may have printed output then called exit(), but, the child is technically still a...
[ "This", "waits", "until", "the", "child", "exits", ".", "This", "is", "a", "blocking", "call", ".", "This", "will", "not", "read", "any", "data", "from", "the", "child", "so", "this", "will", "block", "forever", "if", "the", "child", "has", "unread", "...
def wait(self): '''This waits until the child exits. This is a blocking call. This will not read any data from the child, so this will block forever if the child has unread output and has terminated. In other words, the child may have printed output then called exit(), but, the child is ...
[ "def", "wait", "(", "self", ")", ":", "if", "self", ".", "isalive", "(", ")", ":", "pid", ",", "status", "=", "os", ".", "waitpid", "(", "self", ".", "pid", ",", "0", ")", "else", ":", "return", "self", ".", "exitstatus", "self", ".", "exitstatus...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L656-L683
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
scripts/cpp_lint.py
python
ProcessFileData
(filename, file_extension, lines, error, extra_check_functions=[])
Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the last element being emp...
Performs lint checks and reports any errors to the given error function.
[ "Performs", "lint", "checks", "and", "reports", "any", "errors", "to", "the", "given", "error", "function", "." ]
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=[]): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. ...
[ "def", "ProcessFileData", "(", "filename", ",", "file_extension", ",", "lines", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "lines", "=", "(", "[", "'// marker so line numbers and indices both start at 1'", "]", "+", "lines", "+", "[", "...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/scripts/cpp_lint.py#L4644-L4687
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/distributions/normal.py
python
Normal._inv_z
(self, z)
Reconstruct input `x` from a its normalized version.
Reconstruct input `x` from a its normalized version.
[ "Reconstruct", "input", "x", "from", "a", "its", "normalized", "version", "." ]
def _inv_z(self, z): """Reconstruct input `x` from a its normalized version.""" with ops.name_scope("reconstruct", values=[z]): return z * self.scale + self.loc
[ "def", "_inv_z", "(", "self", ",", "z", ")", ":", "with", "ops", ".", "name_scope", "(", "\"reconstruct\"", ",", "values", "=", "[", "z", "]", ")", ":", "return", "z", "*", "self", ".", "scale", "+", "self", ".", "loc" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/normal.py#L232-L235
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
_load_namedtuple
(name, fields)
return namedtuple(name, fields)
Loads a class generated by namedtuple
Loads a class generated by namedtuple
[ "Loads", "a", "class", "generated", "by", "namedtuple" ]
def _load_namedtuple(name, fields): """ Loads a class generated by namedtuple """ from collections import namedtuple return namedtuple(name, fields)
[ "def", "_load_namedtuple", "(", "name", ",", "fields", ")", ":", "from", "collections", "import", "namedtuple", "return", "namedtuple", "(", "name", ",", "fields", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L1244-L1250
nightingale-media-player/nightingale-hacking
7a4e3d2d5ea52e3623e2f9c2d10ee544a5530c35
tools/scripts/aes.py
python
append_PKCS7_padding
(s)
return s + numpads*chr(numpads)
return s padded to a multiple of 16-bytes by PKCS7 padding
return s padded to a multiple of 16-bytes by PKCS7 padding
[ "return", "s", "padded", "to", "a", "multiple", "of", "16", "-", "bytes", "by", "PKCS7", "padding" ]
def append_PKCS7_padding(s): """return s padded to a multiple of 16-bytes by PKCS7 padding""" numpads = 16 - (len(s)%16) return s + numpads*chr(numpads)
[ "def", "append_PKCS7_padding", "(", "s", ")", ":", "numpads", "=", "16", "-", "(", "len", "(", "s", ")", "%", "16", ")", "return", "s", "+", "numpads", "*", "chr", "(", "numpads", ")" ]
https://github.com/nightingale-media-player/nightingale-hacking/blob/7a4e3d2d5ea52e3623e2f9c2d10ee544a5530c35/tools/scripts/aes.py#L18-L21
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Canvas.find_enclosed
(self, x1, y1, x2, y2)
return self.find('enclosed', x1, y1, x2, y2)
Return all items in rectangle defined by X1,Y1,X2,Y2.
Return all items in rectangle defined by X1,Y1,X2,Y2.
[ "Return", "all", "items", "in", "rectangle", "defined", "by", "X1", "Y1", "X2", "Y2", "." ]
def find_enclosed(self, x1, y1, x2, y2): """Return all items in rectangle defined by X1,Y1,X2,Y2.""" return self.find('enclosed', x1, y1, x2, y2)
[ "def", "find_enclosed", "(", "self", ",", "x1", ",", "y1", ",", "x2", ",", "y2", ")", ":", "return", "self", ".", "find", "(", "'enclosed'", ",", "x1", ",", "y1", ",", "x2", ",", "y2", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2309-L2312
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/_custom_op/img2col_impl.py
python
height7_width7
(tik_instance, input_x, res, input_shape, shape_info)
return tik_instance, res
height7_width7
height7_width7
[ "height7_width7" ]
def height7_width7(tik_instance, input_x, res, input_shape, shape_info): """height7_width7""" if input_shape == ((32, 32, 7, 7, 16), 'float16', (3, 3), (1, 1)): tik_instance, res = shape7_0(tik_instance, input_x, res, input_shape, shape_info) if input_shape == ((32, 128, 7, 7, 16), 'float16', (1, 1...
[ "def", "height7_width7", "(", "tik_instance", ",", "input_x", ",", "res", ",", "input_shape", ",", "shape_info", ")", ":", "if", "input_shape", "==", "(", "(", "32", ",", "32", ",", "7", ",", "7", ",", "16", ")", ",", "'float16'", ",", "(", "3", ",...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/img2col_impl.py#L803-L814
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py
python
idz_estrank
(eps, A)
return k
Estimate rank of a complex matrix to a specified relative precision using random sampling. The output rank is typically about 8 higher than the actual rank. :param eps: Relative precision. :type eps: float :param A: Matrix. :type A: :class:`numpy.ndarray` :return: ...
Estimate rank of a complex matrix to a specified relative precision using random sampling.
[ "Estimate", "rank", "of", "a", "complex", "matrix", "to", "a", "specified", "relative", "precision", "using", "random", "sampling", "." ]
def idz_estrank(eps, A): """ Estimate rank of a complex matrix to a specified relative precision using random sampling. The output rank is typically about 8 higher than the actual rank. :param eps: Relative precision. :type eps: float :param A: Matrix. :type A: :class:`...
[ "def", "idz_estrank", "(", "eps", ",", "A", ")", ":", "A", "=", "np", ".", "asfortranarray", "(", "A", ")", "m", ",", "n", "=", "A", ".", "shape", "n2", ",", "w", "=", "idz_frmi", "(", "m", ")", "ra", "=", "np", ".", "empty", "(", "n", "*",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py#L1309-L1332
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Parser/asdl.py
python
ASDLParser.p_definition_0
(self, (definition,))
return definition
definitions ::= definition
definitions ::= definition
[ "definitions", "::", "=", "definition" ]
def p_definition_0(self, (definition,)): " definitions ::= definition " return definition
[ "def", "p_definition_0", "(", "self", ",", "(", "definition", ",", ")", ")", ":", "return", "definition" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Parser/asdl.py#L132-L134
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/hpmc/external/wall.py
python
wall.get_num_sphere_walls
(self)
return self.cpp_compute.getNumSphereWalls()
R"""Get the current number of sphere walls in the simulation. # noqa Returns: the current number of sphere walls in the simulation Example:: mc = hpmc.integrate.sphere(seed = 415236); ext_wall = hpmc.compute.wall(mc); ext_wall.add_sphere_wall(radius = 1.0, origin ...
R"""Get the current number of sphere walls in the simulation. # noqa
[ "R", "Get", "the", "current", "number", "of", "sphere", "walls", "in", "the", "simulation", ".", "#", "noqa" ]
def get_num_sphere_walls(self): R"""Get the current number of sphere walls in the simulation. # noqa Returns: the current number of sphere walls in the simulation Example:: mc = hpmc.integrate.sphere(seed = 415236); ext_wall = hpmc.compute.wall(mc); ext_wa...
[ "def", "get_num_sphere_walls", "(", "self", ")", ":", "return", "self", ".", "cpp_compute", ".", "getNumSphereWalls", "(", ")" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/external/wall.py#L186-L199
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/cookies.py
python
RequestsCookieJar.update
(self, other)
Updates this jar with cookies from another CookieJar or dict-like
Updates this jar with cookies from another CookieJar or dict-like
[ "Updates", "this", "jar", "with", "cookies", "from", "another", "CookieJar", "or", "dict", "-", "like" ]
def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super(RequestsCookieJar, self).update(other)
[ "def", "update", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "cookielib", ".", "CookieJar", ")", ":", "for", "cookie", "in", "other", ":", "self", ".", "set_cookie", "(", "copy", ".", "copy", "(", "cookie", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/cookies.py#L348-L354
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/transforms/functional_cv2.py
python
adjust_hue
(img, hue_factor)
return cv2.cvtColor(hsv_img, cv2.COLOR_HSV2BGR_FULL).astype(dtype)
Adjusts hue of an image. The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (H). The image is then converted back to original image mode. `hue_factor` is the amount of shift in H channel and must be in the interval `[-0.5, 0.5]`. ...
Adjusts hue of an image.
[ "Adjusts", "hue", "of", "an", "image", "." ]
def adjust_hue(img, hue_factor): """Adjusts hue of an image. The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (H). The image is then converted back to original image mode. `hue_factor` is the amount of shift in H channel and must b...
[ "def", "adjust_hue", "(", "img", ",", "hue_factor", ")", ":", "cv2", "=", "try_import", "(", "'cv2'", ")", "if", "not", "(", "-", "0.5", "<=", "hue_factor", "<=", "0.5", ")", ":", "raise", "ValueError", "(", "'hue_factor:{} is not in [-0.5, 0.5].'", ".", "...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/transforms/functional_cv2.py#L372-L411
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py
python
FitFunctionOptionsView.plot_guess_end_x
(self, value: float)
Sets the selected start X.
Sets the selected start X.
[ "Sets", "the", "selected", "start", "X", "." ]
def plot_guess_end_x(self, value: float) -> None: """Sets the selected start X.""" self.plot_guess_end_x_validator.last_valid_value = f"{value:.3f}" self.plot_guess_end_x_line_edit.setText(f"{value:.3f}")
[ "def", "plot_guess_end_x", "(", "self", ",", "value", ":", "float", ")", "->", "None", ":", "self", ".", "plot_guess_end_x_validator", ".", "last_valid_value", "=", "f\"{value:.3f}\"", "self", ".", "plot_guess_end_x_line_edit", ".", "setText", "(", "f\"{value:.3f}\"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L293-L296
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/special/orthogonal.py
python
roots_sh_jacobi
(n, p1, q1, mu=False)
Gauss-Jacobi (shifted) quadrature. Computes the sample points and weights for Gauss-Jacobi (shifted) quadrature. The sample points are the roots of the n-th degree shifted Jacobi polynomial, :math:`G^{p,q}_n(x)`. These sample points and weights correctly integrate polynomials of degree :math:`2n - 1` ...
Gauss-Jacobi (shifted) quadrature.
[ "Gauss", "-", "Jacobi", "(", "shifted", ")", "quadrature", "." ]
def roots_sh_jacobi(n, p1, q1, mu=False): """Gauss-Jacobi (shifted) quadrature. Computes the sample points and weights for Gauss-Jacobi (shifted) quadrature. The sample points are the roots of the n-th degree shifted Jacobi polynomial, :math:`G^{p,q}_n(x)`. These sample points and weights correctl...
[ "def", "roots_sh_jacobi", "(", "n", ",", "p1", ",", "q1", ",", "mu", "=", "False", ")", ":", "if", "(", "p1", "-", "q1", ")", "<=", "-", "1", "or", "q1", "<=", "0", ":", "raise", "ValueError", "(", "\"(p - q) must be greater than -1, and q must be greate...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/orthogonal.py#L343-L388
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/summary_ops_v2.py
python
generic
(name, tensor, metadata=None, family=None, step=None)
return summary_writer_function(name, tensor, function, family=family)
Writes a tensor summary if possible.
Writes a tensor summary if possible.
[ "Writes", "a", "tensor", "summary", "if", "possible", "." ]
def generic(name, tensor, metadata=None, family=None, step=None): """Writes a tensor summary if possible.""" def function(tag, scope): if metadata is None: serialized_metadata = constant_op.constant("") elif hasattr(metadata, "SerializeToString"): serialized_metadata = constant_op.constant(meta...
[ "def", "generic", "(", "name", ",", "tensor", ",", "metadata", "=", "None", ",", "family", "=", "None", ",", "step", "=", "None", ")", ":", "def", "function", "(", "tag", ",", "scope", ")", ":", "if", "metadata", "is", "None", ":", "serialized_metada...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/summary_ops_v2.py#L861-L879
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/core/programs.py
python
_apply_set_parameters
(args, set_parameter)
Convert key-value pairs from 'kwargs' into --setParameter key=value arguments. This result is appended to 'args'.
Convert key-value pairs from 'kwargs' into --setParameter key=value arguments.
[ "Convert", "key", "-", "value", "pairs", "from", "kwargs", "into", "--", "setParameter", "key", "=", "value", "arguments", "." ]
def _apply_set_parameters(args, set_parameter): """Convert key-value pairs from 'kwargs' into --setParameter key=value arguments. This result is appended to 'args'. """ for param_name in set_parameter: param_value = set_parameter[param_name] # --setParameter takes boolean values as low...
[ "def", "_apply_set_parameters", "(", "args", ",", "set_parameter", ")", ":", "for", "param_name", "in", "set_parameter", ":", "param_value", "=", "set_parameter", "[", "param_name", "]", "# --setParameter takes boolean values as lowercase strings.", "if", "isinstance", "(...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/core/programs.py#L377-L389
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/expatbuilder.py
python
ExpatBuilder._setup_subset
(self, buffer)
Load the internal subset if there might be one.
Load the internal subset if there might be one.
[ "Load", "the", "internal", "subset", "if", "there", "might", "be", "one", "." ]
def _setup_subset(self, buffer): """Load the internal subset if there might be one.""" if self.document.doctype: extractor = InternalSubsetExtractor() extractor.parseString(buffer) subset = extractor.getSubset() self.document.doctype.internalSubset = subse...
[ "def", "_setup_subset", "(", "self", ",", "buffer", ")", ":", "if", "self", ".", "document", ".", "doctype", ":", "extractor", "=", "InternalSubsetExtractor", "(", ")", "extractor", ".", "parseString", "(", "buffer", ")", "subset", "=", "extractor", ".", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/expatbuilder.py#L232-L238
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/image/image.py
python
scale_down
(src_size, size)
return int(w), int(h)
Scales down crop size if it's larger than image size. If width/height of the crop is larger than the width/height of the image, sets the width/height to the width/height of the image. Parameters ---------- src_size : tuple of int Size of the image in (width, height) format. size : tupl...
Scales down crop size if it's larger than image size.
[ "Scales", "down", "crop", "size", "if", "it", "s", "larger", "than", "image", "size", "." ]
def scale_down(src_size, size): """Scales down crop size if it's larger than image size. If width/height of the crop is larger than the width/height of the image, sets the width/height to the width/height of the image. Parameters ---------- src_size : tuple of int Size of the image in ...
[ "def", "scale_down", "(", "src_size", ",", "size", ")", ":", "w", ",", "h", "=", "size", "sw", ",", "sh", "=", "src_size", "if", "sh", "<", "h", ":", "w", ",", "h", "=", "float", "(", "w", "*", "sh", ")", "/", "h", ",", "sh", "if", "sw", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L214-L246
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Environment.py
python
Base.ParseConfig
(self, command, function=None, unique=True)
return function(self, self.backtick(command))
Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can be a string or a list of strings representing a command and its arguments. 'Function' is an optional argument that takes the environment, the output of the comman...
Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can be a string or a list of strings representing a command and its arguments. 'Function' is an optional argument that takes the environment, the output of the comman...
[ "Use", "the", "specified", "function", "to", "parse", "the", "output", "of", "the", "command", "in", "order", "to", "modify", "the", "current", "environment", ".", "The", "command", "can", "be", "a", "string", "or", "a", "list", "of", "strings", "represent...
def ParseConfig(self, command, function=None, unique=True): """ Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can be a string or a list of strings representing a command and its arguments. 'Function' is a...
[ "def", "ParseConfig", "(", "self", ",", "command", ",", "function", "=", "None", ",", "unique", "=", "True", ")", ":", "if", "function", "is", "None", ":", "def", "parse_conf", "(", "env", ",", "cmd", ",", "unique", "=", "unique", ")", ":", "return",...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Environment.py#L1622-L1640
kevinlin311tw/caffe-cvprw15
45c2a1bf0368569c54e0be4edf8d34285cf79e70
scripts/cpp_lint.py
python
Match
(pattern, s)
return _regexp_compile_cache[pattern].match(s)
Matches the string with the pattern, caching the compiled regexp.
Matches the string with the pattern, caching the compiled regexp.
[ "Matches", "the", "string", "with", "the", "pattern", "caching", "the", "compiled", "regexp", "." ]
def Match(pattern, s): """Matches the string with the pattern, caching the compiled regexp.""" # The regexp compilation caching is inlined in both Match and Search for # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. if pattern not in _regexp_compile_cac...
[ "def", "Match", "(", "pattern", ",", "s", ")", ":", "# The regexp compilation caching is inlined in both Match and Search for", "# performance reasons; factoring it out into a separate function turns out", "# to be noticeably expensive.", "if", "pattern", "not", "in", "_regexp_compile_...
https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L515-L522
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/util/__init__.py
python
abbreviate_dashed
(s)
return '-'.join(r)
Abbreviates each part of string that is delimited by a '-'.
Abbreviates each part of string that is delimited by a '-'.
[ "Abbreviates", "each", "part", "of", "string", "that", "is", "delimited", "by", "a", "-", "." ]
def abbreviate_dashed(s): """Abbreviates each part of string that is delimited by a '-'.""" r = [] for part in s.split('-'): r.append(abbreviate(part)) return '-'.join(r)
[ "def", "abbreviate_dashed", "(", "s", ")", ":", "r", "=", "[", "]", "for", "part", "in", "s", ".", "split", "(", "'-'", ")", ":", "r", ".", "append", "(", "abbreviate", "(", "part", ")", ")", "return", "'-'", ".", "join", "(", "r", ")" ]
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/util/__init__.py#L281-L286
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/efficientdet/infer.py
python
TensorRTInfer.infer
(self, batch, scales=None, nms_threshold=None)
return detections
Execute inference on a batch of images. The images should already be batched and preprocessed, as prepared by the ImageBatcher class. Memory copying to and from the GPU device will be performed here. :param batch: A numpy array holding the image batch. :param scales: The image resize scales for ...
Execute inference on a batch of images. The images should already be batched and preprocessed, as prepared by the ImageBatcher class. Memory copying to and from the GPU device will be performed here. :param batch: A numpy array holding the image batch. :param scales: The image resize scales for ...
[ "Execute", "inference", "on", "a", "batch", "of", "images", ".", "The", "images", "should", "already", "be", "batched", "and", "preprocessed", "as", "prepared", "by", "the", "ImageBatcher", "class", ".", "Memory", "copying", "to", "and", "from", "the", "GPU"...
def infer(self, batch, scales=None, nms_threshold=None): """ Execute inference on a batch of images. The images should already be batched and preprocessed, as prepared by the ImageBatcher class. Memory copying to and from the GPU device will be performed here. :param batch: A numpy array...
[ "def", "infer", "(", "self", ",", "batch", ",", "scales", "=", "None", ",", "nms_threshold", "=", "None", ")", ":", "# Prepare the output data", "outputs", "=", "[", "]", "for", "shape", ",", "dtype", "in", "self", ".", "output_spec", "(", ")", ":", "o...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/efficientdet/infer.py#L102-L144
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/go/__init__.py
python
Toolkit.run
(self, cmd, host = False)
return subprocess.check_output([self.go] + cmd, env = env).decode('utf-8').strip()
Run the given command in the toolkit environment. :param cmd: Same as __run. :type cmd: Same as __run. :return: Same as __run :rtype: Same as __run
Run the given command in the toolkit environment.
[ "Run", "the", "given", "command", "in", "the", "toolkit", "environment", "." ]
def run(self, cmd, host = False): """ Run the given command in the toolkit environment. :param cmd: Same as __run. :type cmd: Same as __run. :return: Same as __run :rtype: Same as __run """ env = self.host_env if host else self.env return subprocess.check_output([self.go] + cmd, ...
[ "def", "run", "(", "self", ",", "cmd", ",", "host", "=", "False", ")", ":", "env", "=", "self", ".", "host_env", "if", "host", "else", "self", ".", "env", "return", "subprocess", ".", "check_output", "(", "[", "self", ".", "go", "]", "+", "cmd", ...
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/go/__init__.py#L282-L294
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/gdb/mongo_printers.py
python
AbslHashSetPrinterBase.display_hint
()
return 'array'
Display hint.
Display hint.
[ "Display", "hint", "." ]
def display_hint(): """Display hint.""" return 'array'
[ "def", "display_hint", "(", ")", ":", "return", "'array'" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo_printers.py#L481-L483
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py
python
_shuffle_batch_join
(tensors_list, batch_size, capacity, min_after_dequeue, keep_input, seed=None, enqueue_many=False, shapes=None, allow_smaller_final_batch=False, shared_name=None, name=None)
Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`.
Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`.
[ "Helper", "function", "for", "shuffle_batch_join", "and", "maybe_shuffle_batch_join", "." ]
def _shuffle_batch_join(tensors_list, batch_size, capacity, min_after_dequeue, keep_input, seed=None, enqueue_many=False, shapes=None, allow_smaller_final_batch=False, shared_name=None, name=None): """Helper function for `...
[ "def", "_shuffle_batch_join", "(", "tensors_list", ",", "batch_size", ",", "capacity", ",", "min_after_dequeue", ",", "keep_input", ",", "seed", "=", "None", ",", "enqueue_many", "=", "False", ",", "shapes", "=", "None", ",", "allow_smaller_final_batch", "=", "F...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py#L879-L919