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
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/memory_inspector/memory_inspector/core/backends.py
python
Device.GetProcess
(self, pid)
Returns an instance of |Process| or None (if not found).
Returns an instance of |Process| or None (if not found).
[ "Returns", "an", "instance", "of", "|Process|", "or", "None", "(", "if", "not", "found", ")", "." ]
def GetProcess(self, pid): """Returns an instance of |Process| or None (if not found).""" raise NotImplementedError()
[ "def", "GetProcess", "(", "self", ",", "pid", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/core/backends.py#L100-L102
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/serialized_attributes.py
python
SerializedAttributes.set_and_validate_objects
(self, object_dict)
return self.checkpointable_objects
Saves objects to a dictionary, and validates the values.
Saves objects to a dictionary, and validates the values.
[ "Saves", "objects", "to", "a", "dictionary", "and", "validates", "the", "values", "." ]
def set_and_validate_objects(self, object_dict): """Saves objects to a dictionary, and validates the values.""" for key in self.all_checkpointable_objects: if key in object_dict: if not isinstance(object_dict[key], trackable.Trackable): raise ValueError( 'Object dictionary ...
[ "def", "set_and_validate_objects", "(", "self", ",", "object_dict", ")", ":", "for", "key", "in", "self", ".", "all_checkpointable_objects", ":", "if", "key", "in", "object_dict", ":", "if", "not", "isinstance", "(", "object_dict", "[", "key", "]", ",", "tra...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/serialized_attributes.py#L195-L207
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/sumolib/net/edge.py
python
Edge.getConnections
(self, toEdge)
return self._outgoing.get(toEdge, [])
Returns all connections to the given target edge
Returns all connections to the given target edge
[ "Returns", "all", "connections", "to", "the", "given", "target", "edge" ]
def getConnections(self, toEdge): """Returns all connections to the given target edge""" return self._outgoing.get(toEdge, [])
[ "def", "getConnections", "(", "self", ",", "toEdge", ")", ":", "return", "self", ".", "_outgoing", ".", "get", "(", "toEdge", ",", "[", "]", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/sumolib/net/edge.py#L128-L130
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Listbox.insert
(self, index, *elements)
Insert ELEMENTS at INDEX.
Insert ELEMENTS at INDEX.
[ "Insert", "ELEMENTS", "at", "INDEX", "." ]
def insert(self, index, *elements): """Insert ELEMENTS at INDEX.""" self.tk.call((self._w, 'insert', index) + elements)
[ "def", "insert", "(", "self", ",", "index", ",", "*", "elements", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'insert'", ",", "index", ")", "+", "elements", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2578-L2580
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/checkout_idl_files_from_past_releases.py
python
get_release_tags
()
return list(gen_release_tags())
Get a list of release git tags since API Version 1 was introduced.
Get a list of release git tags since API Version 1 was introduced.
[ "Get", "a", "list", "of", "release", "git", "tags", "since", "API", "Version", "1", "was", "introduced", "." ]
def get_release_tags() -> List[str]: """Get a list of release git tags since API Version 1 was introduced.""" # Use packaging.version.Version's parsing and comparison logic. min_version = Version(FIRST_API_V1_RELEASE) max_version = get_current_git_version() def gen_versions_and_tags(): for ...
[ "def", "get_release_tags", "(", ")", "->", "List", "[", "str", "]", ":", "# Use packaging.version.Version's parsing and comparison logic.", "min_version", "=", "Version", "(", "FIRST_API_V1_RELEASE", ")", "max_version", "=", "get_current_git_version", "(", ")", "def", "...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/checkout_idl_files_from_past_releases.py#L59-L90
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/cygprofile/symbolize.py
python
ParseLogLines
(log_file_lines)
return call_info
Parse a log file produced by the profiled run of clank. Args: log_file_lines: array of lines in log file produced by profiled run lib_name: library or executable containing symbols Below is an example of a small log file: 5086e000-52e92000 r-xp 00000000 b3:02 51276 libchromeview.so secs ...
Parse a log file produced by the profiled run of clank.
[ "Parse", "a", "log", "file", "produced", "by", "the", "profiled", "run", "of", "clank", "." ]
def ParseLogLines(log_file_lines): """Parse a log file produced by the profiled run of clank. Args: log_file_lines: array of lines in log file produced by profiled run lib_name: library or executable containing symbols Below is an example of a small log file: 5086e000-52e92000 r-xp 00000000 b3:02 ...
[ "def", "ParseLogLines", "(", "log_file_lines", ")", ":", "call_lines", "=", "[", "]", "has_started", "=", "False", "vm_start", "=", "0", "line", "=", "log_file_lines", "[", "0", "]", "assert", "(", "\"r-xp\"", "in", "line", ")", "end_index", "=", "line", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cygprofile/symbolize.py#L20-L64
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/expressions.py
python
evaluate
(op, op_str, a, b, use_numexpr=True)
return _evaluate_standard(op, op_str, a, b)
Evaluate and return the expression of the op on a and b. Parameters ---------- op : the actual operand op_str : str The string version of the op. a : left operand b : right operand use_numexpr : bool, default True Whether to try to use numexpr.
Evaluate and return the expression of the op on a and b.
[ "Evaluate", "and", "return", "the", "expression", "of", "the", "op", "on", "a", "and", "b", "." ]
def evaluate(op, op_str, a, b, use_numexpr=True): """ Evaluate and return the expression of the op on a and b. Parameters ---------- op : the actual operand op_str : str The string version of the op. a : left operand b : right operand use_numexpr : bool, default True ...
[ "def", "evaluate", "(", "op", ",", "op_str", ",", "a", ",", "b", ",", "use_numexpr", "=", "True", ")", ":", "use_numexpr", "=", "use_numexpr", "and", "_bool_arith_check", "(", "op_str", ",", "a", ",", "b", ")", "if", "use_numexpr", ":", "return", "_eva...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/expressions.py#L191-L209
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/extras.py
python
union1d
(ar1, ar2)
return unique(ma.concatenate((ar1, ar2), axis=None))
Union of two arrays. The output is always a masked array. See `numpy.union1d` for more details. See also -------- numpy.union1d : Equivalent function for ndarrays.
Union of two arrays.
[ "Union", "of", "two", "arrays", "." ]
def union1d(ar1, ar2): """ Union of two arrays. The output is always a masked array. See `numpy.union1d` for more details. See also -------- numpy.union1d : Equivalent function for ndarrays. """ return unique(ma.concatenate((ar1, ar2), axis=None))
[ "def", "union1d", "(", "ar1", ",", "ar2", ")", ":", "return", "unique", "(", "ma", ".", "concatenate", "(", "(", "ar1", ",", "ar2", ")", ",", "axis", "=", "None", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/extras.py#L1221-L1232
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.PageDownRectExtend
(*args, **kwargs)
return _stc.StyledTextCtrl_PageDownRectExtend(*args, **kwargs)
PageDownRectExtend(self) Move caret one page down, extending rectangular selection to new caret position.
PageDownRectExtend(self)
[ "PageDownRectExtend", "(", "self", ")" ]
def PageDownRectExtend(*args, **kwargs): """ PageDownRectExtend(self) Move caret one page down, extending rectangular selection to new caret position. """ return _stc.StyledTextCtrl_PageDownRectExtend(*args, **kwargs)
[ "def", "PageDownRectExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_PageDownRectExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5433-L5439
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/cpp_wrappers/gaussian_process.py
python
GaussianProcess.get_historical_data_copy
(self)
return copy.deepcopy(self._historical_data)
Return the data (points, function values, noise) specifying the prior of the Gaussian Process. :return: object specifying the already-sampled points, the objective value at those points, and the noise variance associated with each observation :rtype: data_containers.HistoricalData
Return the data (points, function values, noise) specifying the prior of the Gaussian Process.
[ "Return", "the", "data", "(", "points", "function", "values", "noise", ")", "specifying", "the", "prior", "of", "the", "Gaussian", "Process", "." ]
def get_historical_data_copy(self): """Return the data (points, function values, noise) specifying the prior of the Gaussian Process. :return: object specifying the already-sampled points, the objective value at those points, and the noise variance associated with each observation :rtype: data_...
[ "def", "get_historical_data_copy", "(", "self", ")", ":", "return", "copy", ".", "deepcopy", "(", "self", ".", "_historical_data", ")" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/gaussian_process.py#L104-L111
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/series.py
python
Series.dt
(self)
Accessor object for datetime-like properties of the Series values. Examples -------- >>> s = cudf.Series(cudf.date_range( ... start='2001-02-03 12:00:00', ... end='2001-02-03 14:00:00', ... freq='1H')) >>> s.dt.hour 0 12 1 13 d...
Accessor object for datetime-like properties of the Series values.
[ "Accessor", "object", "for", "datetime", "-", "like", "properties", "of", "the", "Series", "values", "." ]
def dt(self): """ Accessor object for datetime-like properties of the Series values. Examples -------- >>> s = cudf.Series(cudf.date_range( ... start='2001-02-03 12:00:00', ... end='2001-02-03 14:00:00', ... freq='1H')) >>> s.dt.hour ...
[ "def", "dt", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "_column", ",", "DatetimeColumn", ")", ":", "return", "DatetimeProperties", "(", "self", ")", "elif", "isinstance", "(", "self", ".", "_column", ",", "TimeDeltaColumn", ")", ":", "...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/series.py#L513-L551
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/serde.py
python
ChainSerde.deserialize
(self, buf)
return result
deserialize
deserialize
[ "deserialize" ]
def deserialize(self, buf): """ deserialize """ result = None tmp_buf = buf serde_num = len(self._args) for idx in xrange(0, serde_num): mid_result = self._args[serde_num - idx - 1].deserialize(tmp_buf) if mid_result is not None: tmp_buf = ...
[ "def", "deserialize", "(", "self", ",", "buf", ")", ":", "result", "=", "None", "tmp_buf", "=", "buf", "serde_num", "=", "len", "(", "self", ".", "_args", ")", "for", "idx", "in", "xrange", "(", "0", ",", "serde_num", ")", ":", "mid_result", "=", "...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/serde.py#L427-L439
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/learning_rate_decay.py
python
natural_exp_decay
(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)
Applies natural exponential decay to the initial learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies an exponential decay function to a provided initial learning rate. It requires an `global_step` value to compute the deca...
Applies natural exponential decay to the initial learning rate.
[ "Applies", "natural", "exponential", "decay", "to", "the", "initial", "learning", "rate", "." ]
def natural_exp_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None): """Applies natural exponential decay to the initial learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function app...
[ "def", "natural_exp_decay", "(", "learning_rate", ",", "global_step", ",", "decay_steps", ",", "decay_rate", ",", "staircase", "=", "False", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"NaturalExpDecay\"", ",", "...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/learning_rate_decay.py#L245-L301
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/visualization.py
python
pick
(click_callback : Callable, hover_callback : Callable=None, highlight_color=(1,1,0,0.3), filter : Callable=None, tolerance=0.01)
Picks an item from the scene. ``click_callback`` is called once the user left-clicks on an item. ``hover_callback`` is called when a user hovers over an item. Once the user clicks, callbacks are disabled. To re-enable callbacks, call pick() again. Args: click_callback (callable): a...
Picks an item from the scene. ``click_callback`` is called once the user left-clicks on an item. ``hover_callback`` is called when a user hovers over an item. Once the user clicks, callbacks are disabled. To re-enable callbacks, call pick() again.
[ "Picks", "an", "item", "from", "the", "scene", ".", "click_callback", "is", "called", "once", "the", "user", "left", "-", "clicks", "on", "an", "item", ".", "hover_callback", "is", "called", "when", "a", "user", "hovers", "over", "an", "item", ".", "Once...
def pick(click_callback : Callable, hover_callback : Callable=None, highlight_color=(1,1,0,0.3), filter : Callable=None, tolerance=0.01) -> None: """Picks an item from the scene. ``click_callback`` is called once the user left-clicks on an item. ``hover_callback`` is called when a user hovers ove...
[ "def", "pick", "(", "click_callback", ":", "Callable", ",", "hover_callback", ":", "Callable", "=", "None", ",", "highlight_color", "=", "(", "1", ",", "1", ",", "0", ",", "0.3", ")", ",", "filter", ":", "Callable", "=", "None", ",", "tolerance", "=", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1328-L1351
dicecco1/fpga_caffe
7a191704efd7873071cfef35772d7e7bf3e3cfd6
scripts/cpp_lint.py
python
CheckVlogArguments
(filename, clean_lines, linenum, error)
Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
Checks that VLOG() is only used for defining a logging level.
[ "Checks", "that", "VLOG", "()", "is", "only", "used", "for", "defining", "a", "logging", "level", "." ]
def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines i...
[ "def", "CheckVlogArguments", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "Search", "(", "r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'", ",", "line", ")", ...
https://github.com/dicecco1/fpga_caffe/blob/7a191704efd7873071cfef35772d7e7bf3e3cfd6/scripts/cpp_lint.py#L1712-L1728
sonyxperiadev/WebGL
0299b38196f78c6d5f74bcf6fa312a3daee6de60
Tools/Scripts/webkitpy/common/array_stream.py
python
ArrayStream.flush
(self)
Flush the stream (a no-op implemented for compatibility).
Flush the stream (a no-op implemented for compatibility).
[ "Flush", "the", "stream", "(", "a", "no", "-", "op", "implemented", "for", "compatibility", ")", "." ]
def flush(self): """Flush the stream (a no-op implemented for compatibility).""" pass
[ "def", "flush", "(", "self", ")", ":", "pass" ]
https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/common/array_stream.py#L61-L63
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
SpinEvent.__init__
(self, *args, **kwargs)
__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> SpinEvent
__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> SpinEvent
[ "__init__", "(", "self", "EventType", "commandType", "=", "wxEVT_NULL", "int", "winid", "=", "0", ")", "-", ">", "SpinEvent" ]
def __init__(self, *args, **kwargs): """__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> SpinEvent""" _controls_.SpinEvent_swiginit(self,_controls_.new_SpinEvent(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "SpinEvent_swiginit", "(", "self", ",", "_controls_", ".", "new_SpinEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2441-L2443
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/random.py
python
Random.normalvariate
(self, mu, sigma)
return mu + z*sigma
Normal distribution. mu is the mean, and sigma is the standard deviation.
Normal distribution.
[ "Normal", "distribution", "." ]
def normalvariate(self, mu, sigma): """Normal distribution. mu is the mean, and sigma is the standard deviation. """ # mu = mean, sigma = standard deviation # Uses Kinderman and Monahan method. Reference: Kinderman, # A.J. and Monahan, J.F., "Computer generation of ran...
[ "def", "normalvariate", "(", "self", ",", "mu", ",", "sigma", ")", ":", "# mu = mean, sigma = standard deviation", "# Uses Kinderman and Monahan method. Reference: Kinderman,", "# A.J. and Monahan, J.F., \"Computer generation of random", "# variables using the ratio of uniform deviates\", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/random.py#L380-L401
cocos-creator/engine-native
984c4c9f5838253313b44ccd429bd8fac4ec8a6a
tools/bindings-generator/clang/cindex.py
python
Cursor.is_definition
(self)
return conf.lib.clang_isCursorDefinition(self)
Returns true if the declaration pointed at by the cursor is also a definition of that entity.
Returns true if the declaration pointed at by the cursor is also a definition of that entity.
[ "Returns", "true", "if", "the", "declaration", "pointed", "at", "by", "the", "cursor", "is", "also", "a", "definition", "of", "that", "entity", "." ]
def is_definition(self): """ Returns true if the declaration pointed at by the cursor is also a definition of that entity. """ return conf.lib.clang_isCursorDefinition(self)
[ "def", "is_definition", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isCursorDefinition", "(", "self", ")" ]
https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L1437-L1442
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosmaster/src/rosmaster/master_api.py
python
ROSMasterHandler.getUri
(self, caller_id)
return 1, "", self.uri
Get the XML-RPC URI of this server. @param caller_id str: ROS caller id @return [int, str, str]: [1, "", xmlRpcUri]
Get the XML-RPC URI of this server.
[ "Get", "the", "XML", "-", "RPC", "URI", "of", "this", "server", "." ]
def getUri(self, caller_id): """ Get the XML-RPC URI of this server. @param caller_id str: ROS caller id @return [int, str, str]: [1, "", xmlRpcUri] """ return 1, "", self.uri
[ "def", "getUri", "(", "self", ",", "caller_id", ")", ":", "return", "1", ",", "\"\"", ",", "self", ".", "uri" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmaster/src/rosmaster/master_api.py#L302-L308
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
python
HTTPHeaderDict.pop
(self, key, default=__marker)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
[ "D", ".", "pop", "(", "k", "[", "d", "]", ")", "-", ">", "v", "remove", "specified", "key", "and", "return", "the", "corresponding", "value", ".", "If", "key", "is", "not", "found", "d", "is", "returned", "if", "given", "otherwise", "KeyError", "is",...
def pop(self, key, default=__marker): '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. ''' # Using the MutableMapping function directly fails due to the private marker. # Us...
[ "def", "pop", "(", "self", ",", "key", ",", "default", "=", "__marker", ")", ":", "# Using the MutableMapping function directly fails due to the private marker.", "# Using ordinary dict.pop would expose the internal structures.", "# So let's reinvent the wheel.", "try", ":", "value...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py#L184-L199
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/WebIDL.py
python
Parser.p_InheritanceEmpty
(self, p)
Inheritance :
Inheritance :
[ "Inheritance", ":" ]
def p_InheritanceEmpty(self, p): """ Inheritance : """ pass
[ "def", "p_InheritanceEmpty", "(", "self", ",", "p", ")", ":", "pass" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L3821-L3825
v8/v8
fee3bf095260bf657a3eea4d3d41f90c42c6c857
tools/grokdump.py
python
InspectionShell.do_search
(self, word)
Search for a given word in available memory regions. The given word is expanded to full pointer size and searched at aligned as well as un-aligned memory locations. Use 'sa' to search aligned locations only.
Search for a given word in available memory regions.
[ "Search", "for", "a", "given", "word", "in", "available", "memory", "regions", "." ]
def do_search(self, word): """ Search for a given word in available memory regions. The given word is expanded to full pointer size and searched at aligned as well as un-aligned memory locations. Use 'sa' to search aligned locations only. """ try: word = self.ParseAddressExpr(word...
[ "def", "do_search", "(", "self", ",", "word", ")", ":", "try", ":", "word", "=", "self", ".", "ParseAddressExpr", "(", "word", ")", "except", "ValueError", ":", "print", "(", "\"Malformed word, prefix with '0x' to use hexadecimal format.\"", ")", "return", "print"...
https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/grokdump.py#L3782-L3797
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/element.py
python
Element.getByMass
(mass)
return best_guess
Get the element whose mass is CLOSEST to the requested mass. This method should not be used for repartitioned masses Parameters ---------- mass : float or Quantity Mass of the atom to find the element for. Units assumed to be daltons if not specified Ret...
Get the element whose mass is CLOSEST to the requested mass. This method should not be used for repartitioned masses
[ "Get", "the", "element", "whose", "mass", "is", "CLOSEST", "to", "the", "requested", "mass", ".", "This", "method", "should", "not", "be", "used", "for", "repartitioned", "masses" ]
def getByMass(mass): """ Get the element whose mass is CLOSEST to the requested mass. This method should not be used for repartitioned masses Parameters ---------- mass : float or Quantity Mass of the atom to find the element for. Units assumed to be ...
[ "def", "getByMass", "(", "mass", ")", ":", "# Assume masses are in daltons if they are not units", "if", "is_quantity", "(", "mass", ")", ":", "mass", "=", "mass", ".", "value_in_unit", "(", "daltons", ")", "if", "mass", "<", "0", ":", "raise", "ValueError", "...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/element.py#L110-L153
fontmatrix/fontmatrix
ce9cee8868c3ba38787c26c132fa5d3394d68bf9
OSX-package/linktools/MachO.py
python
Fix.moveLibrary
(self, destBundlePath, stripFW, log)
Copies the library or fw to destBundlePath.
Copies the library or fw to destBundlePath.
[ "Copies", "the", "library", "or", "fw", "to", "destBundlePath", "." ]
def moveLibrary(self, destBundlePath, stripFW, log): "Copies the library or fw to destBundlePath." "Also sets NewLink and NewLocation properties" "Returns a list of copied executables" # dont do this if we are already inside the bundle: if stripPrefix(destBundlePath, self.Location) != self.Location: log...
[ "def", "moveLibrary", "(", "self", ",", "destBundlePath", ",", "stripFW", ",", "log", ")", ":", "\"Also sets NewLink and NewLocation properties\"", "\"Returns a list of copied executables\"", "# dont do this if we are already inside the bundle:", "if", "stripPrefix", "(", "destBu...
https://github.com/fontmatrix/fontmatrix/blob/ce9cee8868c3ba38787c26c132fa5d3394d68bf9/OSX-package/linktools/MachO.py#L176-L213
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/debug_data.py
python
DebugDumpDir.reconstructed_non_debug_partition_graphs
(self)
return non_debug_graphs
Reconstruct partition graphs with the debugger-inserted ops stripped. The reconstructed partition graphs are identical to the original (i.e., non-debugger-decorated) partition graphs except in the following respects: 1) The exact names of the runtime-inserted internal nodes may differ. These inc...
Reconstruct partition graphs with the debugger-inserted ops stripped.
[ "Reconstruct", "partition", "graphs", "with", "the", "debugger", "-", "inserted", "ops", "stripped", "." ]
def reconstructed_non_debug_partition_graphs(self): """Reconstruct partition graphs with the debugger-inserted ops stripped. The reconstructed partition graphs are identical to the original (i.e., non-debugger-decorated) partition graphs except in the following respects: 1) The exact names of the run...
[ "def", "reconstructed_non_debug_partition_graphs", "(", "self", ")", ":", "non_debug_graphs", "=", "dict", "(", ")", "for", "key", "in", "self", ".", "_debug_graphs", ":", "non_debug_graphs", "[", "key", "]", "=", "self", ".", "_debug_graphs", "[", "key", "]",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L937-L954
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.SetEventHandler
(*args, **kwargs)
return _core_.Window_SetEventHandler(*args, **kwargs)
SetEventHandler(self, EvtHandler handler) Sets the event handler for this window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to handler function.) By default, the window is its own event han...
SetEventHandler(self, EvtHandler handler)
[ "SetEventHandler", "(", "self", "EvtHandler", "handler", ")" ]
def SetEventHandler(*args, **kwargs): """ SetEventHandler(self, EvtHandler handler) Sets the event handler for this window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to handler funct...
[ "def", "SetEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10364-L10380
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py
python
BaseSpecifier.prereleases
(self)
Returns whether or not pre-releases as a whole are allowed by this specifier.
Returns whether or not pre-releases as a whole are allowed by this specifier.
[ "Returns", "whether", "or", "not", "pre", "-", "releases", "as", "a", "whole", "are", "allowed", "by", "this", "specifier", "." ]
def prereleases(self): """ Returns whether or not pre-releases as a whole are allowed by this specifier. """
[ "def", "prereleases", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py#L51-L55
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/perf/measurements/media.py
python
Media.DidNavigateToPage
(self, page, tab)
Override to do operations right after the page is navigated.
Override to do operations right after the page is navigated.
[ "Override", "to", "do", "operations", "right", "after", "the", "page", "is", "navigated", "." ]
def DidNavigateToPage(self, page, tab): """Override to do operations right after the page is navigated.""" self._media_metric = media.MediaMetric(tab) self._media_metric.Start(page, tab) self._power_metric.Start(page, tab) # Reset to false for every page. self._add_browser_metrics = False i...
[ "def", "DidNavigateToPage", "(", "self", ",", "page", ",", "tab", ")", ":", "self", ".", "_media_metric", "=", "media", ".", "MediaMetric", "(", "tab", ")", "self", ".", "_media_metric", ".", "Start", "(", "page", ",", "tab", ")", "self", ".", "_power_...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/measurements/media.py#L39-L55
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/walterPanel/walterPropertiesDialog.py
python
WalterPropertiesDialog.showAtPosition
(self, pos, flatPropertiesList)
Show the properties/overrides dialog. The widget automatically hides it-self if the flatPropertiesList is nul or it's shown already.
Show the properties/overrides dialog. The widget automatically hides it-self if the flatPropertiesList is nul or it's shown already.
[ "Show", "the", "properties", "/", "overrides", "dialog", ".", "The", "widget", "automatically", "hides", "it", "-", "self", "if", "the", "flatPropertiesList", "is", "nul", "or", "it", "s", "shown", "already", "." ]
def showAtPosition(self, pos, flatPropertiesList): """Show the properties/overrides dialog. The widget automatically hides it-self if the flatPropertiesList is nul or it's shown already.""" js = json.loads(flatPropertiesList) # Check if the dialog can be displayed/needs to be hidden. ...
[ "def", "showAtPosition", "(", "self", ",", "pos", ",", "flatPropertiesList", ")", ":", "js", "=", "json", ".", "loads", "(", "flatPropertiesList", ")", "# Check if the dialog can be displayed/needs to be hidden.", "if", "'overrides'", "not", "in", "js", "and", "'pro...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterPropertiesDialog.py#L109-L142
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree/0235.py
python
Solution.lowestCommonAncestor
(self, root, p, q)
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
[ ":", "type", "root", ":", "TreeNode", ":", "type", "p", ":", "TreeNode", ":", "type", "q", ":", "TreeNode", ":", "rtype", ":", "TreeNode" ]
def lowestCommonAncestor(self, root, p, q): """ :type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode """ while root: if p.val < root.val > q.val: root = root.left elif p.val > root.val < q.val: ...
[ "def", "lowestCommonAncestor", "(", "self", ",", "root", ",", "p", ",", "q", ")", ":", "while", "root", ":", "if", "p", ".", "val", "<", "root", ".", "val", ">", "q", ".", "val", ":", "root", "=", "root", ".", "left", "elif", "p", ".", "val", ...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree/0235.py#L2-L15
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/plugins/hcprt/hcprt.py
python
PrtBerths.set_prtvehicles
(self, prtvehicles)
Defines attributes which are linked with prtvehicles
Defines attributes which are linked with prtvehicles
[ "Defines", "attributes", "which", "are", "linked", "with", "prtvehicles" ]
def set_prtvehicles(self, prtvehicles): """ Defines attributes which are linked with prtvehicles """ self.add_col(am.IdsArrayConf('ids_veh', prtvehicles, is_save=False, name='Vehicle ID', ...
[ "def", "set_prtvehicles", "(", "self", ",", "prtvehicles", ")", ":", "self", ".", "add_col", "(", "am", ".", "IdsArrayConf", "(", "'ids_veh'", ",", "prtvehicles", ",", "is_save", "=", "False", ",", "name", "=", "'Vehicle ID'", ",", "info", "=", "'ID of veh...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/hcprt/hcprt.py#L2546-L2554
dmtcp/dmtcp
48a23686e1ce6784829b783ced9c62a14d620507
util/cpplint.py
python
_IncludeState.FindHeader
(self, header)
return -1
Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before.
Check if a header has already been included.
[ "Check", "if", "a", "header", "has", "already", "been", "included", "." ]
def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: i...
[ "def", "FindHeader", "(", "self", ",", "header", ")", ":", "for", "section_list", "in", "self", ".", "include_list", ":", "for", "f", "in", "section_list", ":", "if", "f", "[", "0", "]", "==", "header", ":", "return", "f", "[", "1", "]", "return", ...
https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L724-L737
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiPaneInfo.Show
(*args, **kwargs)
return _aui.AuiPaneInfo_Show(*args, **kwargs)
Show(self, bool show=True) -> AuiPaneInfo
Show(self, bool show=True) -> AuiPaneInfo
[ "Show", "(", "self", "bool", "show", "=", "True", ")", "-", ">", "AuiPaneInfo" ]
def Show(*args, **kwargs): """Show(self, bool show=True) -> AuiPaneInfo""" return _aui.AuiPaneInfo_Show(*args, **kwargs)
[ "def", "Show", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_Show", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L429-L431
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/user.py
python
User.owner_id
(self, owner_id)
Sets the owner_id of this User. :param owner_id: The owner_id of this User. # noqa: E501 :type: float
Sets the owner_id of this User.
[ "Sets", "the", "owner_id", "of", "this", "User", "." ]
def owner_id(self, owner_id): """Sets the owner_id of this User. :param owner_id: The owner_id of this User. # noqa: E501 :type: float """ self._owner_id = owner_id
[ "def", "owner_id", "(", "self", ",", "owner_id", ")", ":", "self", ".", "_owner_id", "=", "owner_id" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user.py#L160-L168
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/interactiveshell.py
python
get_default_colors
()
return 'Neutral'
DEPRECATED
DEPRECATED
[ "DEPRECATED" ]
def get_default_colors(): "DEPRECATED" warn('get_default_color is Deprecated, and is `Neutral` on all platforms.', DeprecationWarning, stacklevel=2) return 'Neutral'
[ "def", "get_default_colors", "(", ")", ":", "warn", "(", "'get_default_color is Deprecated, and is `Neutral` on all platforms.'", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ")", "return", "'Neutral'" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L143-L147
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/base/role_maker.py
python
HeterRoleMaker._barrier_xpu
(self)
barrier all workers in current distributed job
barrier all workers in current distributed job
[ "barrier", "all", "workers", "in", "current", "distributed", "job" ]
def _barrier_xpu(self): """ barrier all workers in current distributed job """ if not self._role_is_generated: self.generate_role() if self.is_xpu(): self._node_type_comm.barrier()
[ "def", "_barrier_xpu", "(", "self", ")", ":", "if", "not", "self", ".", "_role_is_generated", ":", "self", ".", "generate_role", "(", ")", "if", "self", ".", "is_xpu", "(", ")", ":", "self", ".", "_node_type_comm", ".", "barrier", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/base/role_maker.py#L1152-L1159
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/libs/metaparse/tools/string_headers.py
python
Namespace.begin
(self)
Generate the beginning part
Generate the beginning part
[ "Generate", "the", "beginning", "part" ]
def begin(self): """Generate the beginning part""" self.out_f.write('\n') for depth, name in enumerate(self.names): self.out_f.write( '{0}namespace {1}\n{0}{{\n'.format(self.prefix(depth), name) )
[ "def", "begin", "(", "self", ")", ":", "self", ".", "out_f", ".", "write", "(", "'\\n'", ")", "for", "depth", ",", "name", "in", "enumerate", "(", "self", ".", "names", ")", ":", "self", ".", "out_f", ".", "write", "(", "'{0}namespace {1}\\n{0}{{\\n'",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/metaparse/tools/string_headers.py#L25-L31
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/syntax.py
python
parse_array_type
(name)
return name
Parse a type name of the form 'array<type>' and extract type.
Parse a type name of the form 'array<type>' and extract type.
[ "Parse", "a", "type", "name", "of", "the", "form", "array<type", ">", "and", "extract", "type", "." ]
def parse_array_type(name): # type: (str) -> str """Parse a type name of the form 'array<type>' and extract type.""" if not name.startswith("array<") and not name.endswith(">"): return None name = name[len("array<"):] name = name[:-1] # V1 restriction, ban nested array types to reduce ...
[ "def", "parse_array_type", "(", "name", ")", ":", "# type: (str) -> str", "if", "not", "name", ".", "startswith", "(", "\"array<\"", ")", "and", "not", "name", ".", "endswith", "(", "\">\"", ")", ":", "return", "None", "name", "=", "name", "[", "len", "(...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L73-L86
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateSpan.Neg
(*args, **kwargs)
return _misc_.DateSpan_Neg(*args, **kwargs)
Neg(self) -> DateSpan
Neg(self) -> DateSpan
[ "Neg", "(", "self", ")", "-", ">", "DateSpan" ]
def Neg(*args, **kwargs): """Neg(self) -> DateSpan""" return _misc_.DateSpan_Neg(*args, **kwargs)
[ "def", "Neg", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateSpan_Neg", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4697-L4699
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/serialwin32.py
python
Serial.cancel_read
(self)
Cancel a blocking read operation, may be called from other thread
Cancel a blocking read operation, may be called from other thread
[ "Cancel", "a", "blocking", "read", "operation", "may", "be", "called", "from", "other", "thread" ]
def cancel_read(self): """Cancel a blocking read operation, may be called from other thread""" self._cancel_overlapped_io(self._overlapped_read)
[ "def", "cancel_read", "(", "self", ")", ":", "self", ".", "_cancel_overlapped_io", "(", "self", ".", "_overlapped_read", ")" ]
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialwin32.py#L461-L463
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py
python
defaultNames
()
return defaultMachine(), defaultSystem()
Return the canonicalized machine and system name.
Return the canonicalized machine and system name.
[ "Return", "the", "canonicalized", "machine", "and", "system", "name", "." ]
def defaultNames(): """ Return the canonicalized machine and system name. """ return defaultMachine(), defaultSystem()
[ "def", "defaultNames", "(", ")", ":", "return", "defaultMachine", "(", ")", ",", "defaultSystem", "(", ")" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py#L468-L470
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
VersionInfo.GetMicro
(*args, **kwargs)
return _core_.VersionInfo_GetMicro(*args, **kwargs)
GetMicro(self) -> int
GetMicro(self) -> int
[ "GetMicro", "(", "self", ")", "-", ">", "int" ]
def GetMicro(*args, **kwargs): """GetMicro(self) -> int""" return _core_.VersionInfo_GetMicro(*args, **kwargs)
[ "def", "GetMicro", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "VersionInfo_GetMicro", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16577-L16579
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Wrapping/Generators/Python/itk/support/init_helpers.py
python
simple_progress_callback
(name: str, p)
Print a message when an object is running This function can be used with itkConfig.ProgressCallback
Print a message when an object is running
[ "Print", "a", "message", "when", "an", "object", "is", "running" ]
def simple_progress_callback(name: str, p): """Print a message when an object is running This function can be used with itkConfig.ProgressCallback """ if p == 0: print(f"Running {name}... ", file=_system_error_stream, end="") elif p == 1: print("done", file=_system_error_stream)
[ "def", "simple_progress_callback", "(", "name", ":", "str", ",", "p", ")", ":", "if", "p", "==", "0", ":", "print", "(", "f\"Running {name}... \"", ",", "file", "=", "_system_error_stream", ",", "end", "=", "\"\"", ")", "elif", "p", "==", "1", ":", "pr...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/init_helpers.py#L100-L108
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py
python
GroupBy.pct_change
(self, periods=1, fill_method="pad", limit=None, freq=None, axis=0)
return (filled / shifted) - 1
Calculate pct_change of each value to previous entry in group. Returns ------- Series or DataFrame Percentage changes within each group.
Calculate pct_change of each value to previous entry in group.
[ "Calculate", "pct_change", "of", "each", "value", "to", "previous", "entry", "in", "group", "." ]
def pct_change(self, periods=1, fill_method="pad", limit=None, freq=None, axis=0): """ Calculate pct_change of each value to previous entry in group. Returns ------- Series or DataFrame Percentage changes within each group. """ if freq is not None or ...
[ "def", "pct_change", "(", "self", ",", "periods", "=", "1", ",", "fill_method", "=", "\"pad\"", ",", "limit", "=", "None", ",", "freq", "=", "None", ",", "axis", "=", "0", ")", ":", "if", "freq", "is", "not", "None", "or", "axis", "!=", "0", ":",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py#L2342-L2367
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/examples/python/mach_o.py
python
TerminalColors.bold
(self, on=True)
return ''
Enable or disable bold depending on the "on" parameter.
Enable or disable bold depending on the "on" parameter.
[ "Enable", "or", "disable", "bold", "depending", "on", "the", "on", "parameter", "." ]
def bold(self, on=True): '''Enable or disable bold depending on the "on" parameter.''' if self.enabled: if on: return "\x1b[1m" else: return "\x1b[22m" return ''
[ "def", "bold", "(", "self", ",", "on", "=", "True", ")", ":", "if", "self", ".", "enabled", ":", "if", "on", ":", "return", "\"\\x1b[1m\"", "else", ":", "return", "\"\\x1b[22m\"", "return", "''" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/examples/python/mach_o.py#L225-L232
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/msvs_emulation.py
python
_ExtractImportantEnvironment
(output_of_set)
return env
Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.
Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.
[ "Extracts", "environment", "variables", "required", "for", "the", "toolchain", "to", "run", "from", "a", "textual", "dump", "output", "by", "the", "cmd", ".", "exe", "set", "command", "." ]
def _ExtractImportantEnvironment(output_of_set): """Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.""" envvars_to_save = ( 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. 'include', 'lib', 'libpath', ...
[ "def", "_ExtractImportantEnvironment", "(", "output_of_set", ")", ":", "envvars_to_save", "=", "(", "'goma_.*'", ",", "# TODO(scottmg): This is ugly, but needed for goma.", "'include'", ",", "'lib'", ",", "'libpath'", ",", "'path'", ",", "'pathext'", ",", "'systemroot'", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/msvs_emulation.py#L949-L984
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/ensemble/_forest.py
python
RandomTreesEmbedding.fit_transform
(self, X, y=None, sample_weight=None)
return self.one_hot_encoder_.fit_transform(self.apply(X))
Fit estimator and transform dataset. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Input data used to build forests. Use ``dtype=np.float32`` for maximum efficiency. sample_weight : array-like of shape (n_samples,), default...
Fit estimator and transform dataset.
[ "Fit", "estimator", "and", "transform", "dataset", "." ]
def fit_transform(self, X, y=None, sample_weight=None): """ Fit estimator and transform dataset. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Input data used to build forests. Use ``dtype=np.float32`` for maximum ef...
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ",", "sample_weight", "=", "None", ")", ":", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "[", "'csc'", "]", ")", "if", "issparse", "(", "X", ")", ":", "# Pre-so...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_forest.py#L2201-L2234
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L3890-L4006
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/orchestrator/module.py
python
OrchestratorCli._host_label_rm
(self, hostname: str, label: str)
return HandleCommandResult(stdout=completion.result_str())
Remove a host label
Remove a host label
[ "Remove", "a", "host", "label" ]
def _host_label_rm(self, hostname: str, label: str) -> HandleCommandResult: """Remove a host label""" completion = self.remove_host_label(hostname, label) raise_if_exception(completion) return HandleCommandResult(stdout=completion.result_str())
[ "def", "_host_label_rm", "(", "self", ",", "hostname", ":", "str", ",", "label", ":", "str", ")", "->", "HandleCommandResult", ":", "completion", "=", "self", ".", "remove_host_label", "(", "hostname", ",", "label", ")", "raise_if_exception", "(", "completion"...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/orchestrator/module.py#L420-L424
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/mozconfig.py
python
MozconfigLoader.read_mozconfig
(self, path=None, moz_build_app=None)
return result
Read the contents of a mozconfig into a data structure. This takes the path to a mozconfig to load. If it is not defined, we will try to find a mozconfig from the environment using find_mozconfig(). mozconfig files are shell scripts. So, we can't just parse them. Instead, we ru...
Read the contents of a mozconfig into a data structure.
[ "Read", "the", "contents", "of", "a", "mozconfig", "into", "a", "data", "structure", "." ]
def read_mozconfig(self, path=None, moz_build_app=None): """Read the contents of a mozconfig into a data structure. This takes the path to a mozconfig to load. If it is not defined, we will try to find a mozconfig from the environment using find_mozconfig(). mozconfig files are...
[ "def", "read_mozconfig", "(", "self", ",", "path", "=", "None", ",", "moz_build_app", "=", "None", ")", ":", "if", "path", "is", "None", ":", "path", "=", "self", ".", "find_mozconfig", "(", ")", "result", "=", "{", "'path'", ":", "path", ",", "'topo...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/mozconfig.py#L181-L313
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/pbs/pbs_api.py
python
Videos.__init__
(self, apikey, mythtv = True, interactive = False, select_first = False, debug = False, custom_ui = None, language = None, search_all_languages = False, )
apikey (str/unicode): Specify the target site API key. Applications need their own key in some cases mythtv (True/False): When True, the returned meta data is being returned has the key and values massaged to match MythTV When False, the returned meta data is being returned...
apikey (str/unicode): Specify the target site API key. Applications need their own key in some cases
[ "apikey", "(", "str", "/", "unicode", ")", ":", "Specify", "the", "target", "site", "API", "key", ".", "Applications", "need", "their", "own", "key", "in", "some", "cases" ]
def __init__(self, apikey, mythtv = True, interactive = False, select_first = False, debug = False, custom_ui = None, language = None, search_all_languages = False, ): ...
[ "def", "__init__", "(", "self", ",", "apikey", ",", "mythtv", "=", "True", ",", "interactive", "=", "False", ",", "select_first", "=", "False", ",", "debug", "=", "False", ",", "custom_ui", "=", "None", ",", "language", "=", "None", ",", "search_all_lang...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/pbs/pbs_api.py#L110-L191
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/user.py
python
User.affiliate_id
(self, affiliate_id)
Sets the affiliate_id of this User. :param affiliate_id: The affiliate_id of this User. # noqa: E501 :type: str
Sets the affiliate_id of this User.
[ "Sets", "the", "affiliate_id", "of", "this", "User", "." ]
def affiliate_id(self, affiliate_id): """Sets the affiliate_id of this User. :param affiliate_id: The affiliate_id of this User. # noqa: E501 :type: str """ if affiliate_id is not None and len(affiliate_id) > 6: raise ValueError("Invalid value for `affiliate_id`, l...
[ "def", "affiliate_id", "(", "self", ",", "affiliate_id", ")", ":", "if", "affiliate_id", "is", "not", "None", "and", "len", "(", "affiliate_id", ")", ">", "6", ":", "raise", "ValueError", "(", "\"Invalid value for `affiliate_id`, length must be less than or equal to `...
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user.py#L374-L384
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/mgr_module.py
python
MgrModule.get_mds_perf_counters
(self, query_id: int)
return self._ceph_get_mds_perf_counters(query_id)
Get stats collected for an MDS perf query. :param int query_id: query ID
Get stats collected for an MDS perf query.
[ "Get", "stats", "collected", "for", "an", "MDS", "perf", "query", "." ]
def get_mds_perf_counters(self, query_id: int) -> Optional[Dict[str, List[PerfCounterT]]]: """ Get stats collected for an MDS perf query. :param int query_id: query ID """ return self._ceph_get_mds_perf_counters(query_id)
[ "def", "get_mds_perf_counters", "(", "self", ",", "query_id", ":", "int", ")", "->", "Optional", "[", "Dict", "[", "str", ",", "List", "[", "PerfCounterT", "]", "]", "]", ":", "return", "self", ".", "_ceph_get_mds_perf_counters", "(", "query_id", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/mgr_module.py#L2207-L2213
NVIDIA/MDL-SDK
aa9642b2546ad7b6236b5627385d882c2ed83c5d
src/mdl/jit/llvm/dist/utils/lint/common_lint.py
python
VerifyLineLength
(filename, lines, max_length)
return lint
Checks to make sure the file has no lines with lines exceeding the length limit. Args: filename: the file under consideration as string lines: contents of the file as string array max_length: maximum acceptable line length as number Returns: A list of tuples with format [(filename, line number, ...
Checks to make sure the file has no lines with lines exceeding the length limit.
[ "Checks", "to", "make", "sure", "the", "file", "has", "no", "lines", "with", "lines", "exceeding", "the", "length", "limit", "." ]
def VerifyLineLength(filename, lines, max_length): """Checks to make sure the file has no lines with lines exceeding the length limit. Args: filename: the file under consideration as string lines: contents of the file as string array max_length: maximum acceptable line length as number Returns: ...
[ "def", "VerifyLineLength", "(", "filename", ",", "lines", ",", "max_length", ")", ":", "lint", "=", "[", "]", "line_num", "=", "1", "for", "line", "in", "lines", ":", "length", "=", "len", "(", "line", ".", "rstrip", "(", "'\\n'", ")", ")", "if", "...
https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/llvm/dist/utils/lint/common_lint.py#L7-L28
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/WANDPowderReduction.py
python
WANDPowderReduction._resample_calibration
( self, current_workspace, mask_name, x_min, x_max, )
return self._to_spectrum_axis_resample(cal, "_ws_cal", mask_name, current_workspace, x_min, x_max)
Perform resample on calibration
Perform resample on calibration
[ "Perform", "resample", "on", "calibration" ]
def _resample_calibration( self, current_workspace, mask_name, x_min, x_max, ): """Perform resample on calibration""" cal = self.getProperty("CalibrationWorkspace").valueAsStr return self._to_spectrum_axis_resample(cal, "_ws_cal", mask_name, current_w...
[ "def", "_resample_calibration", "(", "self", ",", "current_workspace", ",", "mask_name", ",", "x_min", ",", "x_max", ",", ")", ":", "cal", "=", "self", ".", "getProperty", "(", "\"CalibrationWorkspace\"", ")", ".", "valueAsStr", "return", "self", ".", "_to_spe...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/WANDPowderReduction.py#L452-L462
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
EnumArgument.GetLogArg
(self)
return ("GLES2Util::GetString%s(%s)" % (self.type_name, self.name))
Overridden from Argument.
Overridden from Argument.
[ "Overridden", "from", "Argument", "." ]
def GetLogArg(self): """Overridden from Argument.""" return ("GLES2Util::GetString%s(%s)" % (self.type_name, self.name))
[ "def", "GetLogArg", "(", "self", ")", ":", "return", "(", "\"GLES2Util::GetString%s(%s)\"", "%", "(", "self", ".", "type_name", ",", "self", ".", "name", ")", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6035-L6038
raspberrypi/tools
13474ee775d0c5ec8a7da4fb0a9fa84187abfc87
arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/type_printers.py
python
InfoTypePrinter.list_type_printers
(self, type_printers)
Print a list of type printers.
Print a list of type printers.
[ "Print", "a", "list", "of", "type", "printers", "." ]
def list_type_printers(self, type_printers): """Print a list of type printers.""" # A potential enhancement is to provide an option to list printers in # "lookup order" (i.e. unsorted). sorted_type_printers = sorted (copy.copy(type_printers), key = ...
[ "def", "list_type_printers", "(", "self", ",", "type_printers", ")", ":", "# A potential enhancement is to provide an option to list printers in", "# \"lookup order\" (i.e. unsorted).", "sorted_type_printers", "=", "sorted", "(", "copy", ".", "copy", "(", "type_printers", ")", ...
https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/type_printers.py#L32-L43
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/html5lib/treebuilders/_base.py
python
TreeBuilder.insertElementTable
(self, token)
return element
Create an element and insert it into the tree
Create an element and insert it into the tree
[ "Create", "an", "element", "and", "insert", "it", "into", "the", "tree" ]
def insertElementTable(self, token): """Create an element and insert it into the tree""" element = self.createElement(token) if self.openElements[-1].name not in tableInsertModeElements: return self.insertElementNormal(token) else: # We should be in the InTable mo...
[ "def", "insertElementTable", "(", "self", ",", "token", ")", ":", "element", "=", "self", ".", "createElement", "(", "token", ")", "if", "self", ".", "openElements", "[", "-", "1", "]", ".", "name", "not", "in", "tableInsertModeElements", ":", "return", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/html5lib/treebuilders/_base.py#L296-L310
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.SetCaretPosition
(*args, **kwargs)
return _richtext.RichTextCtrl_SetCaretPosition(*args, **kwargs)
SetCaretPosition(self, long position, bool showAtLineStart=False)
SetCaretPosition(self, long position, bool showAtLineStart=False)
[ "SetCaretPosition", "(", "self", "long", "position", "bool", "showAtLineStart", "=", "False", ")" ]
def SetCaretPosition(*args, **kwargs): """SetCaretPosition(self, long position, bool showAtLineStart=False)""" return _richtext.RichTextCtrl_SetCaretPosition(*args, **kwargs)
[ "def", "SetCaretPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_SetCaretPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4068-L4070
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/ndimage/filters.py
python
percentile_filter
(input, percentile, size=None, footprint=None, output=None, mode="reflect", cval=0.0, origin=0)
return _rank_filter(input, percentile, size, footprint, output, mode, cval, origin, 'percentile')
Calculate a multi-dimensional percentile filter. Parameters ---------- %(input)s percentile : scalar The percentile parameter may be less then zero, i.e., percentile = -20 equals percentile = 80 %(size_foot)s %(output)s %(mode_multiple)s %(cval)s %(origin_multiple)s ...
Calculate a multi-dimensional percentile filter.
[ "Calculate", "a", "multi", "-", "dimensional", "percentile", "filter", "." ]
def percentile_filter(input, percentile, size=None, footprint=None, output=None, mode="reflect", cval=0.0, origin=0): """Calculate a multi-dimensional percentile filter. Parameters ---------- %(input)s percentile : scalar The percentile parameter may be less then zero,...
[ "def", "percentile_filter", "(", "input", ",", "percentile", ",", "size", "=", "None", ",", "footprint", "=", "None", ",", "output", "=", "None", ",", "mode", "=", "\"reflect\"", ",", "cval", "=", "0.0", ",", "origin", "=", "0", ")", ":", "return", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/filters.py#L1235-L1271
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
tools/clang/bindings/python/clang/cindex.py
python
CursorKind.is_unexposed
(self)
return conf.lib.clang_isUnexposed(self)
Test if this is an unexposed kind.
Test if this is an unexposed kind.
[ "Test", "if", "this", "is", "an", "unexposed", "kind", "." ]
def is_unexposed(self): """Test if this is an unexposed kind.""" return conf.lib.clang_isUnexposed(self)
[ "def", "is_unexposed", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isUnexposed", "(", "self", ")" ]
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L591-L593
Caffe-MPI/Caffe-MPI.github.io
df5992af571a2a19981b69635115c393f18d1c76
scripts/cpp_lint.py
python
_NestingState.Update
(self, filename, clean_lines, linenum, error)
Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Update nesting state with current line.
[ "Update", "nesting", "state", "with", "current", "line", "." ]
def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any err...
[ "def", "Update", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Update pp_stack first", "self", ".", "UpdatePreprocessor", "(", "line", ")", "# Coun...
https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L2004-L2158
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
ToolBarBase.DoAddTool
(*args, **kwargs)
return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
DoAddTool(self, int id, String label, Bitmap bitmap, Bitmap bmpDisabled=wxNullBitmap, int kind=ITEM_NORMAL, String shortHelp=EmptyString, String longHelp=EmptyString, PyObject clientData=None) -> ToolBarToolBase
DoAddTool(self, int id, String label, Bitmap bitmap, Bitmap bmpDisabled=wxNullBitmap, int kind=ITEM_NORMAL, String shortHelp=EmptyString, String longHelp=EmptyString, PyObject clientData=None) -> ToolBarToolBase
[ "DoAddTool", "(", "self", "int", "id", "String", "label", "Bitmap", "bitmap", "Bitmap", "bmpDisabled", "=", "wxNullBitmap", "int", "kind", "=", "ITEM_NORMAL", "String", "shortHelp", "=", "EmptyString", "String", "longHelp", "=", "EmptyString", "PyObject", "clientD...
def DoAddTool(*args, **kwargs): """ DoAddTool(self, int id, String label, Bitmap bitmap, Bitmap bmpDisabled=wxNullBitmap, int kind=ITEM_NORMAL, String shortHelp=EmptyString, String longHelp=EmptyString, PyObject clientData=None) -> ToolBarToolBase """ ...
[ "def", "DoAddTool", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_DoAddTool", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3593-L3600
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/order.py
python
Order.avg_px
(self)
return self._avg_px
Gets the avg_px of this Order. # noqa: E501 :return: The avg_px of this Order. # noqa: E501 :rtype: float
Gets the avg_px of this Order. # noqa: E501
[ "Gets", "the", "avg_px", "of", "this", "Order", ".", "#", "noqa", ":", "E501" ]
def avg_px(self): """Gets the avg_px of this Order. # noqa: E501 :return: The avg_px of this Order. # noqa: E501 :rtype: float """ return self._avg_px
[ "def", "avg_px", "(", "self", ")", ":", "return", "self", ".", "_avg_px" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/order.py#L800-L807
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/logging.py
python
_get_file_and_line
()
return (code.co_filename, f.f_lineno)
Returns (filename, linenumber) for the stack frame.
Returns (filename, linenumber) for the stack frame.
[ "Returns", "(", "filename", "linenumber", ")", "for", "the", "stack", "frame", "." ]
def _get_file_and_line(): """Returns (filename, linenumber) for the stack frame.""" code, f = _get_caller() if not code: return ('<unknown>', 0) return (code.co_filename, f.f_lineno)
[ "def", "_get_file_and_line", "(", ")", ":", "code", ",", "f", "=", "_get_caller", "(", ")", "if", "not", "code", ":", "return", "(", "'<unknown>'", ",", "0", ")", "return", "(", "code", ".", "co_filename", ",", "f", ".", "f_lineno", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/logging.py#L220-L225
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/mox.py
python
MockMethod.__init__
(self, method_name, call_queue, replay_mode)
Construct a new mock method. Args: # method_name: the name of the method # call_queue: deque of calls, verify this call against the head, or add # this call to the queue. # replay_mode: False if we are recording, True if we are verifying calls # against the call queue. m...
Construct a new mock method.
[ "Construct", "a", "new", "mock", "method", "." ]
def __init__(self, method_name, call_queue, replay_mode): """Construct a new mock method. Args: # method_name: the name of the method # call_queue: deque of calls, verify this call against the head, or add # this call to the queue. # replay_mode: False if we are recording, True if w...
[ "def", "__init__", "(", "self", ",", "method_name", ",", "call_queue", ",", "replay_mode", ")", ":", "self", ".", "_name", "=", "method_name", "self", ".", "_call_queue", "=", "call_queue", "if", "not", "isinstance", "(", "call_queue", ",", "deque", ")", "...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/mox.py#L519-L543
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py
python
avg_pool3d
(inputs, kernel_size, stride=2, padding='VALID', data_format=DATA_FORMAT_NDHWC, outputs_collections=None, scope=None)
Adds a 3D average pooling op. It is assumed that the pooling is done per image but not in batch or channels. Args: inputs: A 5-D tensor of shape `[batch_size, depth, height, width, channels]` if `data_format` is `NDHWC`, and `[batch_size, channels, depth, height, width]` if `data_format` is `NCDHW...
Adds a 3D average pooling op.
[ "Adds", "a", "3D", "average", "pooling", "op", "." ]
def avg_pool3d(inputs, kernel_size, stride=2, padding='VALID', data_format=DATA_FORMAT_NDHWC, outputs_collections=None, scope=None): """Adds a 3D average pooling op. It is assumed that the pooling is done per image but not in...
[ "def", "avg_pool3d", "(", "inputs", ",", "kernel_size", ",", "stride", "=", "2", ",", "padding", "=", "'VALID'", ",", "data_format", "=", "DATA_FORMAT_NDHWC", ",", "outputs_collections", "=", "None", ",", "scope", "=", "None", ")", ":", "if", "data_format", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py#L127-L172
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
scribus/plugins/scriptplugin/scripts/FontSample.py
python
build_toc
(tocList)
Creates all the Table of Contents pages. Calls tocPageFramesBuild() to write the header and empty frame for the toc rows each time a new page is added. Then calls tocRowAdd() to add each line to the toc frame. Creates new page each time it completes last row on page.
Creates all the Table of Contents pages.
[ "Creates", "all", "the", "Table", "of", "Contents", "pages", "." ]
def build_toc(tocList): """Creates all the Table of Contents pages. Calls tocPageFramesBuild() to write the header and empty frame for the toc rows each time a new page is added. Then calls tocRowAdd() to add each line to the toc frame. Creates new page each time it completes last row on page. ...
[ "def", "build_toc", "(", "tocList", ")", ":", "rowCount", "=", "0", "yPos", "=", "0", "tocPageNum", "=", "1", "tocPageCount", "=", "1", "scribus", ".", "newPage", "(", "tocPageNum", ")", "isEvenPage", "=", "set_odd_even", "(", "tocPageNum", ")", "body", ...
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin/scripts/FontSample.py#L598-L636
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
BrushFromBitmap
(*args, **kwargs)
return val
BrushFromBitmap(Bitmap stippleBitmap) -> Brush Constructs a stippled brush using a bitmap.
BrushFromBitmap(Bitmap stippleBitmap) -> Brush
[ "BrushFromBitmap", "(", "Bitmap", "stippleBitmap", ")", "-", ">", "Brush" ]
def BrushFromBitmap(*args, **kwargs): """ BrushFromBitmap(Bitmap stippleBitmap) -> Brush Constructs a stippled brush using a bitmap. """ val = _gdi_.new_BrushFromBitmap(*args, **kwargs) return val
[ "def", "BrushFromBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_gdi_", ".", "new_BrushFromBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L604-L611
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
tutorials/from_mxnet_to_webgl.py
python
load_mxnet_resnet
()
return sym, params, (1, 3, 224, 224), (1, 1000)
Load a pretrained resnet model from MXNet and transform that into NNVM format. Returns ------- net : nnvm.Symbol The loaded resnet computation graph. params : dict[str -> NDArray] The pretrained model parameters. data_shape: tuple The shape of the input tensor (...
Load a pretrained resnet model from MXNet and transform that into NNVM format.
[ "Load", "a", "pretrained", "resnet", "model", "from", "MXNet", "and", "transform", "that", "into", "NNVM", "format", "." ]
def load_mxnet_resnet(): """Load a pretrained resnet model from MXNet and transform that into NNVM format. Returns ------- net : nnvm.Symbol The loaded resnet computation graph. params : dict[str -> NDArray] The pretrained model parameters. data_shape: tuple ...
[ "def", "load_mxnet_resnet", "(", ")", ":", "print", "(", "\"Loading pretrained resnet model from MXNet...\"", ")", "# Download a pre-trained mxnet resnet18_v1 model.", "from", "mxnet", ".", "gluon", ".", "model_zoo", ".", "vision", "import", "get_model", "block", "=", "ge...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/tutorials/from_mxnet_to_webgl.py#L67-L98
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.CrossHair
(*args, **kwargs)
return _gdi_.DC_CrossHair(*args, **kwargs)
CrossHair(self, int x, int y) Displays a cross hair using the current pen. This is a vertical and horizontal line the height and width of the window, centred on the given point.
CrossHair(self, int x, int y)
[ "CrossHair", "(", "self", "int", "x", "int", "y", ")" ]
def CrossHair(*args, **kwargs): """ CrossHair(self, int x, int y) Displays a cross hair using the current pen. This is a vertical and horizontal line the height and width of the window, centred on the given point. """ return _gdi_.DC_CrossHair(*args, **kwargs)
[ "def", "CrossHair", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_CrossHair", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L3428-L3436
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.DescribeProperty
(*args, **kwargs)
return _stc.StyledTextCtrl_DescribeProperty(*args, **kwargs)
DescribeProperty(self, String name) -> String
DescribeProperty(self, String name) -> String
[ "DescribeProperty", "(", "self", "String", "name", ")", "-", ">", "String" ]
def DescribeProperty(*args, **kwargs): """DescribeProperty(self, String name) -> String""" return _stc.StyledTextCtrl_DescribeProperty(*args, **kwargs)
[ "def", "DescribeProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_DescribeProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6507-L6509
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.GetYear
(*args, **kwargs)
return _misc_.DateTime_GetYear(*args, **kwargs)
GetYear(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int
GetYear(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int
[ "GetYear", "(", "self", "wxDateTime", "::", "TimeZone", "tz", "=", "LOCAL_TZ", ")", "-", ">", "int" ]
def GetYear(*args, **kwargs): """GetYear(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int""" return _misc_.DateTime_GetYear(*args, **kwargs)
[ "def", "GetYear", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetYear", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3977-L3979
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/distributions/transformed_distribution.py
python
_logical_equal
(x, y)
return constant_op.constant(np.array_equal(x_, y_))
Convenience function which attempts to statically compute `x == y`.
Convenience function which attempts to statically compute `x == y`.
[ "Convenience", "function", "which", "attempts", "to", "statically", "compute", "x", "==", "y", "." ]
def _logical_equal(x, y): """Convenience function which attempts to statically compute `x == y`.""" x_ = _static_value(x) y_ = _static_value(y) if x_ is None or y_ is None: return math_ops.equal(x, y) return constant_op.constant(np.array_equal(x_, y_))
[ "def", "_logical_equal", "(", "x", ",", "y", ")", ":", "x_", "=", "_static_value", "(", "x", ")", "y_", "=", "_static_value", "(", "y", ")", "if", "x_", "is", "None", "or", "y_", "is", "None", ":", "return", "math_ops", ".", "equal", "(", "x", ",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/transformed_distribution.py#L64-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
FileSystemHandler_GetMimeTypeFromExt
(*args, **kwargs)
return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
FileSystemHandler_GetMimeTypeFromExt(String location) -> String
FileSystemHandler_GetMimeTypeFromExt(String location) -> String
[ "FileSystemHandler_GetMimeTypeFromExt", "(", "String", "location", ")", "-", ">", "String" ]
def FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs): """FileSystemHandler_GetMimeTypeFromExt(String location) -> String""" return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
[ "def", "FileSystemHandler_GetMimeTypeFromExt", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "FileSystemHandler_GetMimeTypeFromExt", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2403-L2405
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py
python
_AddHasExtensionMethod
(cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddHasExtensionMethod(cls): """Helper for _AddMessageMethods().""" def HasExtension(self, extension_handle): _VerifyExtensionHandle(self, extension_handle) if extension_handle.label == _FieldDescriptor.LABEL_REPEATED: raise KeyError('"%s" is repeated.' % extension_handle.full_name) if extens...
[ "def", "_AddHasExtensionMethod", "(", "cls", ")", ":", "def", "HasExtension", "(", "self", ",", "extension_handle", ")", ":", "_VerifyExtensionHandle", "(", "self", ",", "extension_handle", ")", "if", "extension_handle", ".", "label", "==", "_FieldDescriptor", "."...
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py#L627-L639
ros/geometry
63c3c7b404b8f390061bdadc5bc675e7ae5808be
tf/src/tf/listener.py
python
TransformerROS.transformQuaternion
(self, target_frame, ps)
return r
:param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.QuaternionStamped message :return: new geometry_msgs.msg.QuaternionStamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise Transforms ...
:param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.QuaternionStamped message :return: new geometry_msgs.msg.QuaternionStamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise
[ ":", "param", "target_frame", ":", "the", "tf", "target", "frame", "a", "string", ":", "param", "ps", ":", "the", "geometry_msgs", ".", "msg", ".", "QuaternionStamped", "message", ":", "return", ":", "new", "geometry_msgs", ".", "msg", ".", "QuaternionStampe...
def transformQuaternion(self, target_frame, ps): """ :param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.QuaternionStamped message :return: new geometry_msgs.msg.QuaternionStamped message, in frame target_frame :raises: any of the exceptions that :...
[ "def", "transformQuaternion", "(", "self", ",", "target_frame", ",", "ps", ")", ":", "# mat44 is frame-to-frame transform as a 4x4", "mat44", "=", "self", ".", "asMatrix", "(", "target_frame", ",", "ps", ".", "header", ")", "# pose44 is the given quat as a 4x4", "pose...
https://github.com/ros/geometry/blob/63c3c7b404b8f390061bdadc5bc675e7ae5808be/tf/src/tf/listener.py#L253-L280
JaDogg/expressPython
960854d7f7ddfec959371cd32064c80095fb4448
ep_runner.py
python
exit
(*args, **kwargs)
Pseudo exit
Pseudo exit
[ "Pseudo", "exit" ]
def exit(*args, **kwargs): """ Pseudo exit """ pass
[ "def", "exit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/JaDogg/expressPython/blob/960854d7f7ddfec959371cd32064c80095fb4448/ep_runner.py#L54-L58
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/text/utils.py
python
Vocab.from_dict
(cls, word_dict)
return vocab
Build a vocab object from a dict. Args: word_dict (dict): Dict contains word and id pairs, where word should be str and id be int. id is recommended to start from 0 and be continuous. ValueError will be raised if id is negative. Returns: Vocab, vocab built from ...
Build a vocab object from a dict.
[ "Build", "a", "vocab", "object", "from", "a", "dict", "." ]
def from_dict(cls, word_dict): """ Build a vocab object from a dict. Args: word_dict (dict): Dict contains word and id pairs, where word should be str and id be int. id is recommended to start from 0 and be continuous. ValueError will be raised if id is negative. ...
[ "def", "from_dict", "(", "cls", ",", "word_dict", ")", ":", "vocab", "=", "Vocab", "(", ")", "vocab", ".", "c_vocab", "=", "cde", ".", "Vocab", ".", "from_dict", "(", "word_dict", ")", "return", "vocab" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/text/utils.py#L212-L228
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
PhasedLSTMCell._get_cycle_ratio
(self, time, phase, period)
return math_ops.cast(cycle_ratio, dtype=dtypes.float32)
Compute the cycle ratio in the dtype of the time.
Compute the cycle ratio in the dtype of the time.
[ "Compute", "the", "cycle", "ratio", "in", "the", "dtype", "of", "the", "time", "." ]
def _get_cycle_ratio(self, time, phase, period): """Compute the cycle ratio in the dtype of the time.""" phase_casted = math_ops.cast(phase, dtype=time.dtype) period_casted = math_ops.cast(period, dtype=time.dtype) shifted_time = time - phase_casted cycle_ratio = self._mod(shifted_time, period_caste...
[ "def", "_get_cycle_ratio", "(", "self", ",", "time", ",", "phase", ",", "period", ")", ":", "phase_casted", "=", "math_ops", ".", "cast", "(", "phase", ",", "dtype", "=", "time", ".", "dtype", ")", "period_casted", "=", "math_ops", ".", "cast", "(", "p...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L1978-L1984
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/text_format.py
python
_SkipFieldMessage
(tokenizer)
Skips over a field message. Args: tokenizer: A tokenizer to parse the field name and values.
Skips over a field message.
[ "Skips", "over", "a", "field", "message", "." ]
def _SkipFieldMessage(tokenizer): """Skips over a field message. Args: tokenizer: A tokenizer to parse the field name and values. """ if tokenizer.TryConsume('<'): delimiter = '>' else: tokenizer.Consume('{') delimiter = '}' while not tokenizer.LookingAt('>') and not tokenizer.LookingAt('...
[ "def", "_SkipFieldMessage", "(", "tokenizer", ")", ":", "if", "tokenizer", ".", "TryConsume", "(", "'<'", ")", ":", "delimiter", "=", "'>'", "else", ":", "tokenizer", ".", "Consume", "(", "'{'", ")", "delimiter", "=", "'}'", "while", "not", "tokenizer", ...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/text_format.py#L1176-L1192
may0324/DeepCompression-caffe
0aff6c1287bda4cfc7f378ed8a16524e1afabd8c
scripts/cpp_lint.py
python
FileInfo.FullName
(self)
return os.path.abspath(self._filename).replace('\\', '/')
Make Windows paths like Unix.
Make Windows paths like Unix.
[ "Make", "Windows", "paths", "like", "Unix", "." ]
def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/')
[ "def", "FullName", "(", "self", ")", ":", "return", "os", ".", "path", ".", "abspath", "(", "self", ".", "_filename", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")" ]
https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L881-L883
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py
python
matrix._collapse
(self, axis)
A convenience function for operations that want to collapse to a scalar like _align, but are using keepdims=True
A convenience function for operations that want to collapse to a scalar like _align, but are using keepdims=True
[ "A", "convenience", "function", "for", "operations", "that", "want", "to", "collapse", "to", "a", "scalar", "like", "_align", "but", "are", "using", "keepdims", "=", "True" ]
def _collapse(self, axis): """A convenience function for operations that want to collapse to a scalar like _align, but are using keepdims=True """ if axis is None: return self[0, 0] else: return self
[ "def", "_collapse", "(", "self", ",", "axis", ")", ":", "if", "axis", "is", "None", ":", "return", "self", "[", "0", ",", "0", "]", "else", ":", "return", "self" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py#L389-L396
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.CanScroll
(*args, **kwargs)
return _core_.Window_CanScroll(*args, **kwargs)
CanScroll(self, int orient) -> bool Can the window have the scrollbar in this orientation?
CanScroll(self, int orient) -> bool
[ "CanScroll", "(", "self", "int", "orient", ")", "-", ">", "bool" ]
def CanScroll(*args, **kwargs): """ CanScroll(self, int orient) -> bool Can the window have the scrollbar in this orientation? """ return _core_.Window_CanScroll(*args, **kwargs)
[ "def", "CanScroll", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_CanScroll", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L11207-L11213
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
_mboxMMDF.get_file
(self, key, from_=False)
return _PartialFile(self._file, self._file.tell(), stop)
Return a file-like representation or raise a KeyError.
Return a file-like representation or raise a KeyError.
[ "Return", "a", "file", "-", "like", "representation", "or", "raise", "a", "KeyError", "." ]
def get_file(self, key, from_=False): """Return a file-like representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) if not from_: self._file.readline() return _PartialFile(self._file, self._file.tell(), stop)
[ "def", "get_file", "(", "self", ",", "key", ",", "from_", "=", "False", ")", ":", "start", ",", "stop", "=", "self", ".", "_lookup", "(", "key", ")", "self", ".", "_file", ".", "seek", "(", "start", ")", "if", "not", "from_", ":", "self", ".", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L778-L784
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/image_ops_impl.py
python
ssim
(img1, img2, max_val, filter_size=11, filter_sigma=1.5, k1=0.01, k2=0.03)
Computes SSIM index between img1 and img2. This function is based on the standard SSIM implementation from: Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004). Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing. Note: The true SSIM ...
Computes SSIM index between img1 and img2.
[ "Computes", "SSIM", "index", "between", "img1", "and", "img2", "." ]
def ssim(img1, img2, max_val, filter_size=11, filter_sigma=1.5, k1=0.01, k2=0.03): """Computes SSIM index between img1 and img2. This function is based on the standard SSIM implementation from: Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004)...
[ "def", "ssim", "(", "img1", ",", "img2", ",", "max_val", ",", "filter_size", "=", "11", ",", "filter_sigma", "=", "1.5", ",", "k1", "=", "0.01", ",", "k2", "=", "0.03", ")", ":", "with", "ops", ".", "name_scope", "(", "None", ",", "'SSIM'", ",", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L4261-L4344
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py
python
CRL.from_cryptography
(cls, crypto_crl)
return crl
Construct based on a ``cryptography`` *crypto_crl*. :param crypto_crl: A ``cryptography`` certificate revocation list :type crypto_crl: ``cryptography.x509.CertificateRevocationList`` :rtype: CRL .. versionadded:: 17.1.0
Construct based on a ``cryptography`` *crypto_crl*.
[ "Construct", "based", "on", "a", "cryptography", "*", "crypto_crl", "*", "." ]
def from_cryptography(cls, crypto_crl): """ Construct based on a ``cryptography`` *crypto_crl*. :param crypto_crl: A ``cryptography`` certificate revocation list :type crypto_crl: ``cryptography.x509.CertificateRevocationList`` :rtype: CRL .. versionadded:: 17.1.0 ...
[ "def", "from_cryptography", "(", "cls", ",", "crypto_crl", ")", ":", "if", "not", "isinstance", "(", "crypto_crl", ",", "x509", ".", "CertificateRevocationList", ")", ":", "raise", "TypeError", "(", "\"Must be a certificate revocation list\"", ")", "crl", "=", "cl...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L2104-L2120
vgough/encfs
c444f9b9176beea1ad41a7b2e29ca26e709b57f7
vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py
python
CheckForHeaderGuard
(filename, lines, error)
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. lines: An array of strings, each representing a line of the file. error: The function to call...
Checks that the file contains a header guard.
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
def CheckForHeaderGuard(filename, lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. lines: An array of strings, each representi...
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "lines", ",", "error", ")", ":", "cppvar", "=", "GetHeaderGuardCPPVariable", "(", "filename", ")", "ifndef", "=", "None", "ifndef_linenum", "=", "0", "define", "=", "None", "endif", "=", "None", "endif_linenu...
https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L1386-L1458
assimp/assimp
97c7e084c2f7f8c9355ea42f73605890481bddc5
port/PyAssimp/scripts/transformations.py
python
quaternion_slerp
(quat0, quat1, fraction, spin=0, shortestpath=True)
return q0
Return spherical linear interpolation between two quaternions. >>> q0 = random_quaternion() >>> q1 = random_quaternion() >>> q = quaternion_slerp(q0, q1, 0.0) >>> numpy.allclose(q, q0) True >>> q = quaternion_slerp(q0, q1, 1.0, 1) >>> numpy.allclose(q, q1) True >>> q = quaternion_sl...
Return spherical linear interpolation between two quaternions.
[ "Return", "spherical", "linear", "interpolation", "between", "two", "quaternions", "." ]
def quaternion_slerp(quat0, quat1, fraction, spin=0, shortestpath=True): """Return spherical linear interpolation between two quaternions. >>> q0 = random_quaternion() >>> q1 = random_quaternion() >>> q = quaternion_slerp(q0, q1, 0.0) >>> numpy.allclose(q, q0) True >>> q = quaternion_slerp(...
[ "def", "quaternion_slerp", "(", "quat0", ",", "quat1", ",", "fraction", ",", "spin", "=", "0", ",", "shortestpath", "=", "True", ")", ":", "q0", "=", "unit_vector", "(", "quat0", "[", ":", "4", "]", ")", "q1", "=", "unit_vector", "(", "quat1", "[", ...
https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L1270-L1308
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/dashboard/services/rgw_client.py
python
RgwClient.get_buckets
(self, request=None)
return [bucket['Name'] for bucket in response[1]]
Get a list of names from all existing buckets of this user. :return: Returns a list of bucket names.
Get a list of names from all existing buckets of this user. :return: Returns a list of bucket names.
[ "Get", "a", "list", "of", "names", "from", "all", "existing", "buckets", "of", "this", "user", ".", ":", "return", ":", "Returns", "a", "list", "of", "bucket", "names", "." ]
def get_buckets(self, request=None): """ Get a list of names from all existing buckets of this user. :return: Returns a list of bucket names. """ response = request({'format': 'json'}) return [bucket['Name'] for bucket in response[1]]
[ "def", "get_buckets", "(", "self", ",", "request", "=", "None", ")", ":", "response", "=", "request", "(", "{", "'format'", ":", "'json'", "}", ")", "return", "[", "bucket", "[", "'Name'", "]", "for", "bucket", "in", "response", "[", "1", "]", "]" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/services/rgw_client.py#L515-L521
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
MHMessage.remove_sequence
(self, sequence)
Remove sequence from the list of sequences including the message.
Remove sequence from the list of sequences including the message.
[ "Remove", "sequence", "from", "the", "list", "of", "sequences", "including", "the", "message", "." ]
def remove_sequence(self, sequence): """Remove sequence from the list of sequences including the message.""" try: self._sequences.remove(sequence) except ValueError: pass
[ "def", "remove_sequence", "(", "self", ",", "sequence", ")", ":", "try", ":", "self", ".", "_sequences", ".", "remove", "(", "sequence", ")", "except", "ValueError", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L1775-L1780
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/lib/deepreload.py
python
deep_import_hook
(name, globals=None, locals=None, fromlist=None, level=-1)
return tail
Replacement for __import__()
Replacement for __import__()
[ "Replacement", "for", "__import__", "()" ]
def deep_import_hook(name, globals=None, locals=None, fromlist=None, level=-1): """Replacement for __import__()""" parent, buf = get_parent(globals, level) head, name, buf = load_next(parent, None if level < 0 else parent, name, buf) tail = head while name: tail, name, buf = load_next(tail...
[ "def", "deep_import_hook", "(", "name", ",", "globals", "=", "None", ",", "locals", "=", "None", ",", "fromlist", "=", "None", ",", "level", "=", "-", "1", ")", ":", "parent", ",", "buf", "=", "get_parent", "(", "globals", ",", "level", ")", "head", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/deepreload.py#L248-L268
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/toolchain/win/setup_toolchain.py
python
_FormatAsEnvironmentBlock
(envvar_dict)
return block
Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See CreateProcess documentation for more details.
Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See CreateProcess documentation for more details.
[ "Format", "as", "an", "environment", "block", "directly", "suitable", "for", "CreateProcess", ".", "Briefly", "this", "is", "a", "list", "of", "key", "=", "value", "\\", "0", "terminated", "by", "an", "additional", "\\", "0", ".", "See", "CreateProcess", "...
def _FormatAsEnvironmentBlock(envvar_dict): """Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See CreateProcess documentation for more details.""" block = '' nul = '\0' for key, value in envvar_dict.iteritems(): ...
[ "def", "_FormatAsEnvironmentBlock", "(", "envvar_dict", ")", ":", "block", "=", "''", "nul", "=", "'\\0'", "for", "key", ",", "value", "in", "envvar_dict", ".", "iteritems", "(", ")", ":", "block", "+=", "key", "+", "'='", "+", "value", "+", "nul", "bl...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/toolchain/win/setup_toolchain.py#L135-L144
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateTime.ResetTime
(*args, **kwargs)
return _misc_.DateTime_ResetTime(*args, **kwargs)
ResetTime(self) -> DateTime
ResetTime(self) -> DateTime
[ "ResetTime", "(", "self", ")", "-", ">", "DateTime" ]
def ResetTime(*args, **kwargs): """ResetTime(self) -> DateTime""" return _misc_.DateTime_ResetTime(*args, **kwargs)
[ "def", "ResetTime", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_ResetTime", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3809-L3811
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aquabutton.py
python
__ToggleMixin.OnKeyDown
(self, event)
Handles the ``wx.EVT_KEY_DOWN`` event for :class:`AquaButton` when used as toggle button. :param `event`: a :class:`KeyEvent` event to be processed.
Handles the ``wx.EVT_KEY_DOWN`` event for :class:`AquaButton` when used as toggle button.
[ "Handles", "the", "wx", ".", "EVT_KEY_DOWN", "event", "for", ":", "class", ":", "AquaButton", "when", "used", "as", "toggle", "button", "." ]
def OnKeyDown(self, event): """ Handles the ``wx.EVT_KEY_DOWN`` event for :class:`AquaButton` when used as toggle button. :param `event`: a :class:`KeyEvent` event to be processed. """ event.Skip()
[ "def", "OnKeyDown", "(", "self", ",", "event", ")", ":", "event", ".", "Skip", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aquabutton.py#L930-L937
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/dynamodb/transform.py
python
TransformationInjector.inject_attribute_value_input
(self, params, model, **kwargs)
Injects DynamoDB serialization into parameter input
Injects DynamoDB serialization into parameter input
[ "Injects", "DynamoDB", "serialization", "into", "parameter", "input" ]
def inject_attribute_value_input(self, params, model, **kwargs): """Injects DynamoDB serialization into parameter input""" self._transformer.transform( params, model.input_shape, self._serializer.serialize, 'AttributeValue')
[ "def", "inject_attribute_value_input", "(", "self", ",", "params", ",", "model", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_transformer", ".", "transform", "(", "params", ",", "model", ".", "input_shape", ",", "self", ".", "_serializer", ".", "seria...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/dynamodb/transform.py#L193-L197
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/integrate/_ivp/common.py
python
num_jac
(fun, t, y, f, threshold, factor, sparsity=None)
Finite differences Jacobian approximation tailored for ODE solvers. This function computes finite difference approximation to the Jacobian matrix of `fun` with respect to `y` using forward differences. The Jacobian matrix has shape (n, n) and its element (i, j) is equal to ``d f_i / d y_j``. A spe...
Finite differences Jacobian approximation tailored for ODE solvers.
[ "Finite", "differences", "Jacobian", "approximation", "tailored", "for", "ODE", "solvers", "." ]
def num_jac(fun, t, y, f, threshold, factor, sparsity=None): """Finite differences Jacobian approximation tailored for ODE solvers. This function computes finite difference approximation to the Jacobian matrix of `fun` with respect to `y` using forward differences. The Jacobian matrix has shape (n, n) ...
[ "def", "num_jac", "(", "fun", ",", "t", ",", "y", ",", "f", ",", "threshold", ",", "factor", ",", "sparsity", "=", "None", ")", ":", "y", "=", "np", ".", "asarray", "(", "y", ")", "n", "=", "y", ".", "shape", "[", "0", "]", "if", "n", "==",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_ivp/common.py#L248-L320
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py
python
Legacy_suite_Events.shut_down
(self, _no_object=None, _attributes={}, **_arguments)
shut down: Shut Down the computer Keyword argument _attributes: AppleEvent attribute dictionary
shut down: Shut Down the computer Keyword argument _attributes: AppleEvent attribute dictionary
[ "shut", "down", ":", "Shut", "Down", "the", "computer", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary" ]
def shut_down(self, _no_object=None, _attributes={}, **_arguments): """shut down: Shut Down the computer Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'fndr' _subcode = 'shut' if _arguments: raise TypeError, 'No optional args expected' ...
[ "def", "shut_down", "(", "self", ",", "_no_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'fndr'", "_subcode", "=", "'shut'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optiona...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py#L34-L51
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/networking/06-simple-avatar/ClientRepository.py
python
GameClientRepository.connectFailure
(self, statusCode, statusString)
Something went wrong
Something went wrong
[ "Something", "went", "wrong" ]
def connectFailure(self, statusCode, statusString): """ Something went wrong """ exit()
[ "def", "connectFailure", "(", "self", ",", "statusCode", ",", "statusString", ")", ":", "exit", "(", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/06-simple-avatar/ClientRepository.py#L45-L47