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
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/tokens.py
python
Token.getChannel
(self)
@brief Get the channel of the token Using setter/getter methods is deprecated. Use o.channel instead.
@brief Get the channel of the token
[ "@brief", "Get", "the", "channel", "of", "the", "token" ]
def getChannel(self): """@brief Get the channel of the token Using setter/getter methods is deprecated. Use o.channel instead.""" raise NotImplementedError
[ "def", "getChannel", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tokens.py#L108-L113
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/calendar.py
python
CalendarCtrl.Create
(*args, **kwargs)
return _calendar.CalendarCtrl_Create(*args, **kwargs)
Create(self, Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool Acutally create the GUI portion of the CalendarCtrl for 2-phase ...
Create(self, Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "DateTime", "date", "=", "DefaultDateTime", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS", "String", "name", "=", "Calen...
def Create(*args, **kwargs): """ Create(self, Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool Acutally create the GUI...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "CalendarCtrl_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L659-L669
TheImagingSource/tiscamera
baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6
tools/tcam-capture/tcam_capture/Settings.py
python
Settings._set_defaults
(self)
Set all settings to their default values
Set all settings to their default values
[ "Set", "all", "settings", "to", "their", "default", "values" ]
def _set_defaults(self): """ Set all settings to their default values """ self.settings_directory = "~/.config/" self.settings_file_name = "./tcam-capture.conf" self.save_location = "/tmp" self.image_type = "png" self.video_type = "avi" self.show_d...
[ "def", "_set_defaults", "(", "self", ")", ":", "self", ".", "settings_directory", "=", "\"~/.config/\"", "self", ".", "settings_file_name", "=", "\"./tcam-capture.conf\"", "self", ".", "save_location", "=", "\"/tmp\"", "self", ".", "image_type", "=", "\"png\"", "s...
https://github.com/TheImagingSource/tiscamera/blob/baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6/tools/tcam-capture/tcam_capture/Settings.py#L60-L82
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/message.py
python
Message.MergeFrom
(self, other_msg)
Merges the contents of the specified message into current message. This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Singular s...
Merges the contents of the specified message into current message.
[ "Merges", "the", "contents", "of", "the", "specified", "message", "into", "current", "message", "." ]
def MergeFrom(self, other_msg): """Merges the contents of the specified message into current message. This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repea...
[ "def", "MergeFrom", "(", "self", ",", "other_msg", ")", ":", "raise", "NotImplementedError" ]
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/message.py#L94-L105
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/build/feature.py
python
minimize
(properties)
return result
Given an expanded property set, eliminate all redundancy: properties which are elements of other (composite) properties in the set will be eliminated. Non-symmetric properties equal to default values will be eliminated, unless the override a value from some composite property. Implicit p...
Given an expanded property set, eliminate all redundancy: properties which are elements of other (composite) properties in the set will be eliminated. Non-symmetric properties equal to default values will be eliminated, unless the override a value from some composite property. Implicit p...
[ "Given", "an", "expanded", "property", "set", "eliminate", "all", "redundancy", ":", "properties", "which", "are", "elements", "of", "other", "(", "composite", ")", "properties", "in", "the", "set", "will", "be", "eliminated", ".", "Non", "-", "symmetric", "...
def minimize (properties): """ Given an expanded property set, eliminate all redundancy: properties which are elements of other (composite) properties in the set will be eliminated. Non-symmetric properties equal to default values will be eliminated, unless the override a value from some com...
[ "def", "minimize", "(", "properties", ")", ":", "if", "__debug__", ":", "from", ".", "property", "import", "Property", "assert", "is_iterable_typed", "(", "properties", ",", "Property", ")", "# remove properties implied by composite features", "components", "=", "[", ...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/feature.py#L724-L783
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
python
extract_pandas_labels
(labels)
Extract data from pandas.DataFrame for labels. Args: labels: `pandas.DataFrame` or `pandas.Series` containing one column of labels to be extracted. Returns: A numpy `ndarray` of labels from the DataFrame. Raises: ValueError: if more than one column is found or type is not int, float or ...
Extract data from pandas.DataFrame for labels.
[ "Extract", "data", "from", "pandas", ".", "DataFrame", "for", "labels", "." ]
def extract_pandas_labels(labels): """Extract data from pandas.DataFrame for labels. Args: labels: `pandas.DataFrame` or `pandas.Series` containing one column of labels to be extracted. Returns: A numpy `ndarray` of labels from the DataFrame. Raises: ValueError: if more than one column is f...
[ "def", "extract_pandas_labels", "(", "labels", ")", ":", "if", "isinstance", "(", "labels", ",", "pd", ".", "DataFrame", ")", ":", "# pandas.Series also belongs to DataFrame", "if", "len", "(", "labels", ".", "columns", ")", ">", "1", ":", "raise", "ValueError...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py#L84-L108
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ogl/_diagram.py
python
Diagram.RemoveAllShapes
(self)
Remove all shapes from the diagram but do not delete the shapes.
Remove all shapes from the diagram but do not delete the shapes.
[ "Remove", "all", "shapes", "from", "the", "diagram", "but", "do", "not", "delete", "the", "shapes", "." ]
def RemoveAllShapes(self): """Remove all shapes from the diagram but do not delete the shapes.""" self._shapeList = []
[ "def", "RemoveAllShapes", "(", "self", ")", ":", "self", ".", "_shapeList", "=", "[", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_diagram.py#L72-L74
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.__bool__
(self)
Raises a ValueError exception. The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
Raises a ValueError exception. The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
[ "Raises", "a", "ValueError", "exception", ".", "The", "truth", "value", "of", "an", "array", "with", "more", "than", "one", "element", "is", "ambiguous", ".", "Use", "a", ".", "any", "()", "or", "a", ".", "all", "()", "." ]
def __bool__(self): """ Raises a ValueError exception. The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). """ # message copied from Numpy raise ValueError("The truth value of an array with more than one element is ambiguous. Use a...
[ "def", "__bool__", "(", "self", ")", ":", "# message copied from Numpy", "raise", "ValueError", "(", "\"The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()\"", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L756-L762
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/psro_v2/strategy_selectors.py
python
exhaustive
(solver, number_policies_selected=1)
return policies, indexes
Returns every player's policies. Args: solver: A GenPSROSolver instance. number_policies_selected: Number of policies to return for each player. (Compatibility argument) Returns: used_policies : List of size 'num_players' of lists of size min('number_policies_selected', num_policies') cont...
Returns every player's policies.
[ "Returns", "every", "player", "s", "policies", "." ]
def exhaustive(solver, number_policies_selected=1): """Returns every player's policies. Args: solver: A GenPSROSolver instance. number_policies_selected: Number of policies to return for each player. (Compatibility argument) Returns: used_policies : List of size 'num_players' of lists of size ...
[ "def", "exhaustive", "(", "solver", ",", "number_policies_selected", "=", "1", ")", ":", "del", "number_policies_selected", "policies", "=", "solver", ".", "get_policies", "(", ")", "indexes", "=", "[", "list", "(", "range", "(", "len", "(", "pol", ")", ")...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/psro_v2/strategy_selectors.py#L26-L44
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/psk_constellations.py
python
sd_psk_2_0x1
(x, Es=1)
return -dist * x_re
1 | 0
1 | 0
[ "1", "|", "0" ]
def sd_psk_2_0x1(x, Es=1): ''' 1 | 0 ''' x_re = [x.real, ] dist = Es * numpy.sqrt(2) return -dist * x_re
[ "def", "sd_psk_2_0x1", "(", "x", ",", "Es", "=", "1", ")", ":", "x_re", "=", "[", "x", ".", "real", ",", "]", "dist", "=", "Es", "*", "numpy", ".", "sqrt", "(", "2", ")", "return", "-", "dist", "*", "x_re" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/psk_constellations.py#L98-L104
Bitcoin-ABC/bitcoin-abc
aff7e41f00bef9d52786c6cffb49faca5c84d32e
contrib/devtools/security-check.py
python
check_ELF_PIE
(executable)
return ok
Check for position independent executable (PIE), allowing for address space randomization.
Check for position independent executable (PIE), allowing for address space randomization.
[ "Check", "for", "position", "independent", "executable", "(", "PIE", ")", "allowing", "for", "address", "space", "randomization", "." ]
def check_ELF_PIE(executable): ''' Check for position independent executable (PIE), allowing for address space randomization. ''' p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines...
[ "def", "check_ELF_PIE", "(", "executable", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "READELF_CMD", ",", "'-h'", ",", "'-W'", ",", "executable", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", ...
https://github.com/Bitcoin-ABC/bitcoin-abc/blob/aff7e41f00bef9d52786c6cffb49faca5c84d32e/contrib/devtools/security-check.py#L21-L36
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/auto_parallel/reshard.py
python
_compute_complete_shape
(slice_shape, process_shape, dims_mapping)
return complete_shape
compute the complete shape of the slice tensor with its process mesh and dims mapping
compute the complete shape of the slice tensor with its process mesh and dims mapping
[ "compute", "the", "complete", "shape", "of", "the", "slice", "tensor", "with", "its", "process", "mesh", "and", "dims", "mapping" ]
def _compute_complete_shape(slice_shape, process_shape, dims_mapping): """compute the complete shape of the slice tensor with its process mesh and dims mapping""" complete_shape = [] for idx, item in enumerate(slice_shape): if dims_mapping[idx] == -1: complete_shape.append(item) ...
[ "def", "_compute_complete_shape", "(", "slice_shape", ",", "process_shape", ",", "dims_mapping", ")", ":", "complete_shape", "=", "[", "]", "for", "idx", ",", "item", "in", "enumerate", "(", "slice_shape", ")", ":", "if", "dims_mapping", "[", "idx", "]", "==...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/auto_parallel/reshard.py#L321-L329
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
python-bareos/bareos/util/bareosbase64.py
python
BareosBase64.int_to_base64
(self, value)
return result
Convert an integer to base 64. Args: value (int): integeer value. Returns: str: base 64 representation of value.
Convert an integer to base 64.
[ "Convert", "an", "integer", "to", "base", "64", "." ]
def int_to_base64(self, value): """Convert an integer to base 64. Args: value (int): integeer value. Returns: str: base 64 representation of value. """ result = "" if value < 0: result = "-" value = -value while val...
[ "def", "int_to_base64", "(", "self", ",", "value", ")", ":", "result", "=", "\"\"", "if", "value", "<", "0", ":", "result", "=", "\"-\"", "value", "=", "-", "value", "while", "value", ":", "charnumber", "=", "value", "%", "0x3F", "result", "+=", "sel...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/python-bareos/bareos/util/bareosbase64.py#L71-L89
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/email/_parseaddr.py
python
AddrlistClass.getphraselist
(self)
return plist
Parse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space.
Parse a sequence of RFC 2822 phrases.
[ "Parse", "a", "sequence", "of", "RFC", "2822", "phrases", "." ]
def getphraselist(self): """Parse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space. """ plist = [] ...
[ "def", "getphraselist", "(", "self", ")", ":", "plist", "=", "[", "]", "while", "self", ".", "pos", "<", "len", "(", "self", ".", "field", ")", ":", "if", "self", ".", "field", "[", "self", ".", "pos", "]", "in", "self", ".", "FWS", ":", "self"...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/_parseaddr.py#L412-L433
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/array_grad.py
python
_CheckNumericsGrad
(op, grad)
return array_ops.check_numerics( grad, "Not a number (NaN) or infinity (Inf) values detected in gradient. %s" % op.get_attr("message"))
Gradient for check_numerics op.
Gradient for check_numerics op.
[ "Gradient", "for", "check_numerics", "op", "." ]
def _CheckNumericsGrad(op, grad): """Gradient for check_numerics op.""" return array_ops.check_numerics( grad, "Not a number (NaN) or infinity (Inf) values detected in gradient. %s" % op.get_attr("message"))
[ "def", "_CheckNumericsGrad", "(", "op", ",", "grad", ")", ":", "return", "array_ops", ".", "check_numerics", "(", "grad", ",", "\"Not a number (NaN) or infinity (Inf) values detected in gradient. %s\"", "%", "op", ".", "get_attr", "(", "\"message\"", ")", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/array_grad.py#L641-L646
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
App.SetOutputWindowAttributes
(self, title=None, pos=None, size=None)
Set the title, position and/or size of the output window if the stdio has been redirected. This should be called before any output would cause the output window to be created.
Set the title, position and/or size of the output window if the stdio has been redirected. This should be called before any output would cause the output window to be created.
[ "Set", "the", "title", "position", "and", "/", "or", "size", "of", "the", "output", "window", "if", "the", "stdio", "has", "been", "redirected", ".", "This", "should", "be", "called", "before", "any", "output", "would", "cause", "the", "output", "window", ...
def SetOutputWindowAttributes(self, title=None, pos=None, size=None): """ Set the title, position and/or size of the output window if the stdio has been redirected. This should be called before any output would cause the output window to be created. """ if self.stdioWin:...
[ "def", "SetOutputWindowAttributes", "(", "self", ",", "title", "=", "None", ",", "pos", "=", "None", ",", "size", "=", "None", ")", ":", "if", "self", ".", "stdioWin", ":", "if", "title", "is", "not", "None", ":", "self", ".", "stdioWin", ".", "title...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8677-L8689
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py
python
EdgeresultDrawings.update
(self, is_update=True)
Update color, assume that there have not been structural changes of the arrays
Update color, assume that there have not been structural changes of the arrays
[ "Update", "color", "assume", "that", "there", "have", "not", "been", "structural", "changes", "of", "the", "arrays" ]
def update(self, is_update=True): """ Update color, assume that there have not been structural changes of the arrays """ # assumes that edges have been set in set_edges # print 'Edgedrawing.update' #edgeinds = self._edges.get_inds() self.colors_fill_highl.value[:...
[ "def", "update", "(", "self", ",", "is_update", "=", "True", ")", ":", "# assumes that edges have been set in set_edges", "# print 'Edgedrawing.update'", "#edgeinds = self._edges.get_inds()", "self", ".", "colors_fill_highl", ".", "value", "[", ":", "]", "=", "self", "....
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py#L764-L776
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pkg_resources.py
python
Environment.best_match
(self, req, working_set, installer=None)
return self.obtain(req, installer)
Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ``VersionConflict`` if an unsuitable version of the project is already active in the specified...
Find distribution best matching `req` and usable on `working_set`
[ "Find", "distribution", "best", "matching", "req", "and", "usable", "on", "working_set" ]
def best_match(self, req, working_set, installer=None): """Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ``VersionConflict`` if an unsuitabl...
[ "def", "best_match", "(", "self", ",", "req", ",", "working_set", ",", "installer", "=", "None", ")", ":", "dist", "=", "working_set", ".", "find", "(", "req", ")", "if", "dist", "is", "not", "None", ":", "return", "dist", "for", "dist", "in", "self"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pkg_resources.py#L704-L723
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msginit.py
python
exists
(env)
Check if the tool exists
Check if the tool exists
[ "Check", "if", "the", "tool", "exists" ]
def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msginit_exists try: return _msginit_exists(env) except: return False
[ "def", "exists", "(", "env", ")", ":", "from", "SCons", ".", "Tool", ".", "GettextCommon", "import", "_msginit_exists", "try", ":", "return", "_msginit_exists", "(", "env", ")", "except", ":", "return", "False" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msginit.py#L107-L113
yifita/3PU
9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0
code/utils/eulerangles.py
python
mat2euler
(M, cy_thresh=None)
return z, y, x
Discover Euler angle vector from 3x3 matrix Uses the conventions above. Parameters ---------- M : array-like, shape (3,3) cy_thresh : None or scalar, optional threshold below which to give up on straightforward arctan for estimating x rotation. If None (default), estimate from ...
Discover Euler angle vector from 3x3 matrix
[ "Discover", "Euler", "angle", "vector", "from", "3x3", "matrix" ]
def mat2euler(M, cy_thresh=None): ''' Discover Euler angle vector from 3x3 matrix Uses the conventions above. Parameters ---------- M : array-like, shape (3,3) cy_thresh : None or scalar, optional threshold below which to give up on straightforward arctan for estimating x rotatio...
[ "def", "mat2euler", "(", "M", ",", "cy_thresh", "=", "None", ")", ":", "M", "=", "np", ".", "asarray", "(", "M", ")", "if", "cy_thresh", "is", "None", ":", "try", ":", "cy_thresh", "=", "np", ".", "finfo", "(", "M", ".", "dtype", ")", ".", "eps...
https://github.com/yifita/3PU/blob/9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0/code/utils/eulerangles.py#L198-L268
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStrV.SearchForw
(self, *args)
return _snap.TStrV_SearchForw(self, *args)
SearchForw(TStrV self, TStr Val, int const & BValN=0) -> int Parameters: Val: TStr const & BValN: int const & SearchForw(TStrV self, TStr Val) -> int Parameters: Val: TStr const &
SearchForw(TStrV self, TStr Val, int const & BValN=0) -> int
[ "SearchForw", "(", "TStrV", "self", "TStr", "Val", "int", "const", "&", "BValN", "=", "0", ")", "-", ">", "int" ]
def SearchForw(self, *args): """ SearchForw(TStrV self, TStr Val, int const & BValN=0) -> int Parameters: Val: TStr const & BValN: int const & SearchForw(TStrV self, TStr Val) -> int Parameters: Val: TStr const & """ return ...
[ "def", "SearchForw", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TStrV_SearchForw", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19868-L19882
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/transformers/fusion_utils.py
python
FusionUtils.check_node_input_value
(self, node, input_index: int, expected_value)
Verify that a node has expected input value Args: node (NodeProto): a node to check input_index (int): index of its input to be verified expected_value (Any): expected value of the input Returns: bool: whether the check is passed or not
Verify that a node has expected input value
[ "Verify", "that", "a", "node", "has", "expected", "input", "value" ]
def check_node_input_value(self, node, input_index: int, expected_value): """Verify that a node has expected input value Args: node (NodeProto): a node to check input_index (int): index of its input to be verified expected_value (Any): expected value of the input ...
[ "def", "check_node_input_value", "(", "self", ",", "node", ",", "input_index", ":", "int", ",", "expected_value", ")", ":", "assert", "len", "(", "node", ".", "input", ")", ">", "input_index", "value", "=", "self", ".", "model", ".", "get_constant_value", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/transformers/fusion_utils.py#L84-L103
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Wrapping/Generators/Python/itk/support/extras.py
python
get_nthreads
()
return threader.GetGlobalDefaultNumberOfThreads()
Get the number of threads
Get the number of threads
[ "Get", "the", "number", "of", "threads" ]
def get_nthreads() -> int: """ Get the number of threads """ import itk threader = itk.MultiThreaderBase.New() return threader.GetGlobalDefaultNumberOfThreads()
[ "def", "get_nthreads", "(", ")", "->", "int", ":", "import", "itk", "threader", "=", "itk", ".", "MultiThreaderBase", ".", "New", "(", ")", "return", "threader", ".", "GetGlobalDefaultNumberOfThreads", "(", ")" ]
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/extras.py#L152-L159
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable.to_proto
(self)
return var_def
Converts a `Variable` to a `VariableDef` protocol buffer. Returns: A `VariableDef` protocol buffer.
Converts a `Variable` to a `VariableDef` protocol buffer.
[ "Converts", "a", "Variable", "to", "a", "VariableDef", "protocol", "buffer", "." ]
def to_proto(self): """Converts a `Variable` to a `VariableDef` protocol buffer. Returns: A `VariableDef` protocol buffer. """ var_def = variable_pb2.VariableDef() var_def.variable_name = self._variable.name var_def.initializer_name = self.initializer.name var_def.snapshot_name = self...
[ "def", "to_proto", "(", "self", ")", ":", "var_def", "=", "variable_pb2", ".", "VariableDef", "(", ")", "var_def", ".", "variable_name", "=", "self", ".", "_variable", ".", "name", "var_def", ".", "initializer_name", "=", "self", ".", "initializer", ".", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/variables.py#L682-L694
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsCJKCompatibility
(code)
return ret
Check whether the character is part of CJKCompatibility UCS Block
Check whether the character is part of CJKCompatibility UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "CJKCompatibility", "UCS", "Block" ]
def uCSIsCJKCompatibility(code): """Check whether the character is part of CJKCompatibility UCS Block """ ret = libxml2mod.xmlUCSIsCJKCompatibility(code) return ret
[ "def", "uCSIsCJKCompatibility", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCJKCompatibility", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2187-L2191
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_vehicle.py
python
VehicleDomain.getAccumulatedWaitingTime
(self, vehID)
return self._getUniversal(tc.VAR_ACCUMULATED_WAITING_TIME, vehID)
getAccumulatedWaitingTime() -> double The accumulated waiting time of a vehicle collects the vehicle's waiting time over a certain time interval (interval length is set per option '--waiting-time-memory')
getAccumulatedWaitingTime() -> double The accumulated waiting time of a vehicle collects the vehicle's waiting time over a certain time interval (interval length is set per option '--waiting-time-memory')
[ "getAccumulatedWaitingTime", "()", "-", ">", "double", "The", "accumulated", "waiting", "time", "of", "a", "vehicle", "collects", "the", "vehicle", "s", "waiting", "time", "over", "a", "certain", "time", "interval", "(", "interval", "length", "is", "set", "per...
def getAccumulatedWaitingTime(self, vehID): """getAccumulatedWaitingTime() -> double The accumulated waiting time of a vehicle collects the vehicle's waiting time over a certain time interval (interval length is set per option '--waiting-time-memory') """ return self._getUniversa...
[ "def", "getAccumulatedWaitingTime", "(", "self", ",", "vehID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_ACCUMULATED_WAITING_TIME", ",", "vehID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L564-L569
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
_BlockInfo.IsBlockInfo
(self)
return self.__class__ == _BlockInfo
Returns true if this block is a _BlockInfo. This is convenient for verifying that an object is an instance of a _BlockInfo, but not an instance of any of the derived classes. Returns: True for this class, False for derived classes.
Returns true if this block is a _BlockInfo.
[ "Returns", "true", "if", "this", "block", "is", "a", "_BlockInfo", "." ]
def IsBlockInfo(self): """Returns true if this block is a _BlockInfo. This is convenient for verifying that an object is an instance of a _BlockInfo, but not an instance of any of the derived classes. Returns: True for this class, False for derived classes. """ return self.__class__ == _...
[ "def", "IsBlockInfo", "(", "self", ")", ":", "return", "self", ".", "__class__", "==", "_BlockInfo" ]
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L2351-L2360
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.SetSavePoint
(*args, **kwargs)
return _stc.StyledTextCtrl_SetSavePoint(*args, **kwargs)
SetSavePoint(self) Remember the current position in the undo history as the position at which the document was saved.
SetSavePoint(self)
[ "SetSavePoint", "(", "self", ")" ]
def SetSavePoint(*args, **kwargs): """ SetSavePoint(self) Remember the current position in the undo history as the position at which the document was saved. """ return _stc.StyledTextCtrl_SetSavePoint(*args, **kwargs)
[ "def", "SetSavePoint", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetSavePoint", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L2128-L2135
udoprog/c10t
15d0bfe054fe5778c527c0f8bbf541d94bd2e106
gui/c10t-tk/mainwindow.py
python
ImageFrame.resize_image_to_zoom
(self, delta=None, zoom=None, center=None, forcereload=False)
Parameters: delta : How much to increase/decrease the current zoom? zoom : Set zoom to this absolute value. center : Uses these coordinates (x,y) as the zoom center, scrolling the canvas as needed. These are "window coordinates", rela...
Parameters: delta : How much to increase/decrease the current zoom? zoom : Set zoom to this absolute value. center : Uses these coordinates (x,y) as the zoom center, scrolling the canvas as needed. These are "window coordinates", rela...
[ "Parameters", ":", "delta", ":", "How", "much", "to", "increase", "/", "decrease", "the", "current", "zoom?", "zoom", ":", "Set", "zoom", "to", "this", "absolute", "value", ".", "center", ":", "Uses", "these", "coordinates", "(", "x", "y", ")", "as", "...
def resize_image_to_zoom(self, delta=None, zoom=None, center=None, forcereload=False): """Parameters: delta : How much to increase/decrease the current zoom? zoom : Set zoom to this absolute value. center : Uses these coordinates (x,y) as the zoom center, ...
[ "def", "resize_image_to_zoom", "(", "self", ",", "delta", "=", "None", ",", "zoom", "=", "None", ",", "center", "=", "None", ",", "forcereload", "=", "False", ")", ":", "# Sanity check", "if", "PIL_NOT_AVAILABLE", ":", "return", "if", "self", ".", "pil_ima...
https://github.com/udoprog/c10t/blob/15d0bfe054fe5778c527c0f8bbf541d94bd2e106/gui/c10t-tk/mainwindow.py#L539-L649
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/platform/gfile.py
python
Exists
(path)
return os.path.exists(path)
Returns True iff "path" exists (as a dir, file, non-broken symlink).
Returns True iff "path" exists (as a dir, file, non-broken symlink).
[ "Returns", "True", "iff", "path", "exists", "(", "as", "a", "dir", "file", "non", "-", "broken", "symlink", ")", "." ]
def Exists(path): # pylint: disable=invalid-name """Returns True iff "path" exists (as a dir, file, non-broken symlink).""" return os.path.exists(path)
[ "def", "Exists", "(", "path", ")", ":", "# pylint: disable=invalid-name", "return", "os", ".", "path", ".", "exists", "(", "path", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/platform/gfile.py#L250-L252
plasma-umass/Mesh
ad5947577a2dce68eb79e2d6ec8507ef992d2859
theory/meshers.py
python
color_counter
(graph)
return i + 1
interprets a coloring on a graph as a meshing.
interprets a coloring on a graph as a meshing.
[ "interprets", "a", "coloring", "on", "a", "graph", "as", "a", "meshing", "." ]
def color_counter(graph): """interprets a coloring on a graph as a meshing.""" color = nx.greedy_color(graph) i = 0 for key, value in color.iteritems(): i = max(i, value) return i + 1
[ "def", "color_counter", "(", "graph", ")", ":", "color", "=", "nx", ".", "greedy_color", "(", "graph", ")", "i", "=", "0", "for", "key", ",", "value", "in", "color", ".", "iteritems", "(", ")", ":", "i", "=", "max", "(", "i", ",", "value", ")", ...
https://github.com/plasma-umass/Mesh/blob/ad5947577a2dce68eb79e2d6ec8507ef992d2859/theory/meshers.py#L409-L415
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/cpu_options.py
python
InlineOptions.has_cost_model
(self)
return not (self.is_always_inline or self.is_never_inline)
True if a cost model is provided
True if a cost model is provided
[ "True", "if", "a", "cost", "model", "is", "provided" ]
def has_cost_model(self): """ True if a cost model is provided """ return not (self.is_always_inline or self.is_never_inline)
[ "def", "has_cost_model", "(", "self", ")", ":", "return", "not", "(", "self", ".", "is_always_inline", "or", "self", ".", "is_never_inline", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/cpu_options.py#L112-L116
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/DICOMLib/DICOMUtils.py
python
openTemporaryDatabase
(directory=None)
return originalDatabaseDir
Temporarily change the main DICOM database folder location, return current database directory. Useful for tests and demos. Call closeTemporaryDatabase to restore the original database folder.
Temporarily change the main DICOM database folder location, return current database directory. Useful for tests and demos. Call closeTemporaryDatabase to restore the original database folder.
[ "Temporarily", "change", "the", "main", "DICOM", "database", "folder", "location", "return", "current", "database", "directory", ".", "Useful", "for", "tests", "and", "demos", ".", "Call", "closeTemporaryDatabase", "to", "restore", "the", "original", "database", "...
def openTemporaryDatabase(directory=None): """ Temporarily change the main DICOM database folder location, return current database directory. Useful for tests and demos. Call closeTemporaryDatabase to restore the original database folder. """ # Specify temporary directory if not directory or directory == ''...
[ "def", "openTemporaryDatabase", "(", "directory", "=", "None", ")", ":", "# Specify temporary directory", "if", "not", "directory", "or", "directory", "==", "''", ":", "from", "time", "import", "gmtime", ",", "strftime", "directory", "=", "strftime", "(", "\"%Y%...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOMLib/DICOMUtils.py#L187-L214
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/wsgiref/headers.py
python
_formatparam
(param, value=None, quote=1)
Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true.
Convenience function to format and return a key=value pair.
[ "Convenience", "function", "to", "format", "and", "return", "a", "key", "=", "value", "pair", "." ]
def _formatparam(param, value=None, quote=1): """Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. """ if value is not None and len(value) > 0: if quote or tspecials.search(value): value = value.replace('\\', '\\\\')...
[ "def", "_formatparam", "(", "param", ",", "value", "=", "None", ",", "quote", "=", "1", ")", ":", "if", "value", "is", "not", "None", "and", "len", "(", "value", ")", ">", "0", ":", "if", "quote", "or", "tspecials", ".", "search", "(", "value", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/wsgiref/headers.py#L13-L25
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/cpp.py
python
CPP_to_Python
(s)
return s
Converts a C pre-processor expression into an equivalent Python expression that can be evaluated.
Converts a C pre-processor expression into an equivalent Python expression that can be evaluated.
[ "Converts", "a", "C", "pre", "-", "processor", "expression", "into", "an", "equivalent", "Python", "expression", "that", "can", "be", "evaluated", "." ]
def CPP_to_Python(s): """ Converts a C pre-processor expression into an equivalent Python expression that can be evaluated. """ s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s) for expr, repl in CPP_to_Python_Eval_List: s = re.sub(expr, repl, s) return s
[ "def", "CPP_to_Python", "(", "s", ")", ":", "s", "=", "CPP_to_Python_Ops_Expression", ".", "sub", "(", "CPP_to_Python_Ops_Sub", ",", "s", ")", "for", "expr", ",", "repl", "in", "CPP_to_Python_Eval_List", ":", "s", "=", "re", ".", "sub", "(", "expr", ",", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/cpp.py#L166-L174
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
dali/python/nvidia/dali/_multiproc/shared_mem.py
python
SharedMem.allocate
(cls, size)
return cls(None, size)
Creates new SharedMem instance representing freshly allocated shared memory of ``size`` bytes. Parameters ---------- `size` : int Number of bytes to allocate.
Creates new SharedMem instance representing freshly allocated shared memory of ``size`` bytes.
[ "Creates", "new", "SharedMem", "instance", "representing", "freshly", "allocated", "shared", "memory", "of", "size", "bytes", "." ]
def allocate(cls, size): """Creates new SharedMem instance representing freshly allocated shared memory of ``size`` bytes. Parameters ---------- `size` : int Number of bytes to allocate. """ return cls(None, size)
[ "def", "allocate", "(", "cls", ",", "size", ")", ":", "return", "cls", "(", "None", ",", "size", ")" ]
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/dali/python/nvidia/dali/_multiproc/shared_mem.py#L54-L63
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
add-ons/tools/legacy/cvmfs.py
python
Catalog._Decompress
(self, catalog_file)
Unzip a catalog file to a temporary referenced by self.catalog_file_
Unzip a catalog file to a temporary referenced by self.catalog_file_
[ "Unzip", "a", "catalog", "file", "to", "a", "temporary", "referenced", "by", "self", ".", "catalog_file_" ]
def _Decompress(self, catalog_file): """ Unzip a catalog file to a temporary referenced by self.catalog_file_ """ self.catalog_file_ = tempfile.NamedTemporaryFile('w+b') self.catalog_file_.write(zlib.decompress(catalog_file.read())) self.catalog_file_.flush()
[ "def", "_Decompress", "(", "self", ",", "catalog_file", ")", ":", "self", ".", "catalog_file_", "=", "tempfile", ".", "NamedTemporaryFile", "(", "'w+b'", ")", "self", ".", "catalog_file_", ".", "write", "(", "zlib", ".", "decompress", "(", "catalog_file", "....
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/add-ons/tools/legacy/cvmfs.py#L333-L337
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/fused_dbn_dw.py
python
_fused_dbn_dw_tbe
()
return
FusedDbnDw TBE register
FusedDbnDw TBE register
[ "FusedDbnDw", "TBE", "register" ]
def _fused_dbn_dw_tbe(): """FusedDbnDw TBE register""" return
[ "def", "_fused_dbn_dw_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/fused_dbn_dw.py#L50-L52
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/types.py
python
FisheyeCamera.pixel_bearings
(self, pixels)
return self.pixel_bearing_many(pixels)
Deprecated: use pixel_bearing_many.
Deprecated: use pixel_bearing_many.
[ "Deprecated", ":", "use", "pixel_bearing_many", "." ]
def pixel_bearings(self, pixels): """Deprecated: use pixel_bearing_many.""" return self.pixel_bearing_many(pixels)
[ "def", "pixel_bearings", "(", "self", ",", "pixels", ")", ":", "return", "self", ".", "pixel_bearing_many", "(", "pixels", ")" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/types.py#L498-L500
strukturag/libheif
0082fea96ee70a20c8906a0373bedec0c01777bc
scripts/cpplint.py
python
IsDerivedFunction
(clean_lines, linenum)
return False
Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier.
Check if current line contains an inherited function.
[ "Check", "if", "current", "line", "contains", "an", "inherited", "function", "." ]
def IsDerivedFunction(clean_lines, linenum): """Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier. """ ...
[ "def", "IsDerivedFunction", "(", "clean_lines", ",", "linenum", ")", ":", "# Scan back a few lines for start of current function", "for", "i", "in", "range", "(", "linenum", ",", "max", "(", "-", "1", ",", "linenum", "-", "10", ")", ",", "-", "1", ")", ":", ...
https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L4800-L4819
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/tensor_shape.py
python
TensorShape.assert_is_compatible_with
(self, other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both `self` and `other` represent. Args: other: Another TensorShape. Raises: ValueError: If `self` and `other` do not represent the same shape.
Raises exception if `self` and `other` do not represent the same shape.
[ "Raises", "exception", "if", "self", "and", "other", "do", "not", "represent", "the", "same", "shape", "." ]
def assert_is_compatible_with(self, other): """Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both `self` and `other` represent. Args: other: Another TensorShape. Raises: ValueError: If `self` an...
[ "def", "assert_is_compatible_with", "(", "self", ",", "other", ")", ":", "if", "not", "self", ".", "is_compatible_with", "(", "other", ")", ":", "raise", "ValueError", "(", "\"Shapes %s and %s are incompatible\"", "%", "(", "self", ",", "other", ")", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/tensor_shape.py#L740-L753
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
LabelFrame.__init__
(self, master=None, cnf={}, **kw)
Construct a labelframe widget with the parent MASTER. STANDARD OPTIONS borderwidth, cursor, font, foreground, highlightbackground, highlightcolor, highlightthickness, padx, pady, relief, takefocus, text WIDGET-SPECIFIC OPTIONS background, c...
Construct a labelframe widget with the parent MASTER.
[ "Construct", "a", "labelframe", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a labelframe widget with the parent MASTER. STANDARD OPTIONS borderwidth, cursor, font, foreground, highlightbackground, highlightcolor, highlightthickness, padx, pady, relief, takefocus, text ...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'labelframe'", ",", "cnf", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3531-L3547
ComputationalRadiationPhysics/picongpu
59e9b53605f9a5c1bf271eeb055bc74370a99052
lib/python/picongpu/plugins/data/sliceFieldReader.py
python
FieldSliceData
(File)
return data
Function to read one data file from PIConGPUs SliceFieldPrinter plug-in and returns the field data as array of size [N_y, N_x, 3], with N_y, N_x the size of the slice. Parameters: ----------- File: either a file of type file which points to the data file or a filename of type str with the...
Function to read one data file from PIConGPUs SliceFieldPrinter plug-in and returns the field data as array of size [N_y, N_x, 3], with N_y, N_x the size of the slice.
[ "Function", "to", "read", "one", "data", "file", "from", "PIConGPUs", "SliceFieldPrinter", "plug", "-", "in", "and", "returns", "the", "field", "data", "as", "array", "of", "size", "[", "N_y", "N_x", "3", "]", "with", "N_y", "N_x", "the", "size", "of", ...
def FieldSliceData(File): """ Function to read one data file from PIConGPUs SliceFieldPrinter plug-in and returns the field data as array of size [N_y, N_x, 3], with N_y, N_x the size of the slice. Parameters: ----------- File: either a file of type file which points to the data file or ...
[ "def", "FieldSliceData", "(", "File", ")", ":", "# case: file or filename", "if", "isinstance", "(", "File", ",", "IOBase", ")", ":", "theFile", "=", "File", "elif", "type", "(", "File", ")", "is", "str", ":", "theFile", "=", "open", "(", "File", ",", ...
https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/data/sliceFieldReader.py#L24-L81
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py
python
_cert_array_from_pem
(pem_bundle)
return cert_array
Given a bundle of certs in PEM format, turns them into a CFArray of certs that can be used to validate a cert chain.
Given a bundle of certs in PEM format, turns them into a CFArray of certs that can be used to validate a cert chain.
[ "Given", "a", "bundle", "of", "certs", "in", "PEM", "format", "turns", "them", "into", "a", "CFArray", "of", "certs", "that", "can", "be", "used", "to", "validate", "a", "cert", "chain", "." ]
def _cert_array_from_pem(pem_bundle): """ Given a bundle of certs in PEM format, turns them into a CFArray of certs that can be used to validate a cert chain. """ # Normalize the PEM bundle's line endings. pem_bundle = pem_bundle.replace(b"\r\n", b"\n") der_certs = [ base64.b64decod...
[ "def", "_cert_array_from_pem", "(", "pem_bundle", ")", ":", "# Normalize the PEM bundle's line endings.", "pem_bundle", "=", "pem_bundle", ".", "replace", "(", "b\"\\r\\n\"", ",", "b\"\\n\"", ")", "der_certs", "=", "[", "base64", ".", "b64decode", "(", "match", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py#L150-L192
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py
python
PthDistributions.save
(self)
Write changed .pth file back to disk
Write changed .pth file back to disk
[ "Write", "changed", ".", "pth", "file", "back", "to", "disk" ]
def save(self): """Write changed .pth file back to disk""" if not self.dirty: return rel_paths = list(map(self.make_relative, self.paths)) if rel_paths: log.debug("Saving %s", self.filename) lines = self._wrap_lines(rel_paths) data = '\n'....
[ "def", "save", "(", "self", ")", ":", "if", "not", "self", ".", "dirty", ":", "return", "rel_paths", "=", "list", "(", "map", "(", "self", ".", "make_relative", ",", "self", ".", "paths", ")", ")", "if", "rel_paths", ":", "log", ".", "debug", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py#L1633-L1653
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xpathParserContext.xpathStringLengthFunction
(self, nargs)
Implement the string-length() XPath function number string-length(string?) The string-length returns the number of characters in the string (see [3.6 Strings]). If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the ...
Implement the string-length() XPath function number string-length(string?) The string-length returns the number of characters in the string (see [3.6 Strings]). If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the ...
[ "Implement", "the", "string", "-", "length", "()", "XPath", "function", "number", "string", "-", "length", "(", "string?", ")", "The", "string", "-", "length", "returns", "the", "number", "of", "characters", "in", "the", "string", "(", "see", "[", "3", "...
def xpathStringLengthFunction(self, nargs): """Implement the string-length() XPath function number string-length(string?) The string-length returns the number of characters in the string (see [3.6 Strings]). If the argument is omitted, it defaults to the context node conv...
[ "def", "xpathStringLengthFunction", "(", "self", ",", "nargs", ")", ":", "libxml2mod", ".", "xmlXPathStringLengthFunction", "(", "self", ".", "_o", ",", "nargs", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L7086-L7093
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/eqsans_reduction.py
python
EQSANSReductionScripter.to_script
(self, file_name=None)
return script
Spits out the text of a reduction script with the current state. @param file_name: name of the file to write the script to
Spits out the text of a reduction script with the current state.
[ "Spits", "out", "the", "text", "of", "a", "reduction", "script", "with", "the", "current", "state", "." ]
def to_script(self, file_name=None): """ Spits out the text of a reduction script with the current state. @param file_name: name of the file to write the script to """ script = "# EQSANS reduction script\n" script += "# Script automatically generated on %s\n\n" % ...
[ "def", "to_script", "(", "self", ",", "file_name", "=", "None", ")", ":", "script", "=", "\"# EQSANS reduction script\\n\"", "script", "+=", "\"# Script automatically generated on %s\\n\\n\"", "%", "time", ".", "ctime", "(", "time", ".", "time", "(", ")", ")", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/eqsans_reduction.py#L35-L70
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/msvc.py
python
EnvironmentInfo.vc_ver
(self)
return self.si.vc_ver
Microsoft Visual C++ version.
Microsoft Visual C++ version.
[ "Microsoft", "Visual", "C", "++", "version", "." ]
def vc_ver(self): """ Microsoft Visual C++ version. """ return self.si.vc_ver
[ "def", "vc_ver", "(", "self", ")", ":", "return", "self", ".", "si", ".", "vc_ver" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/msvc.py#L850-L854
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py2/pygments/formatters/html.py
python
HtmlFormatter.wrap
(self, source, outfile)
Wrap the ``source``, which is a generator yielding individual lines, in custom generators. See docstring for `format`. Can be overridden.
Wrap the ``source``, which is a generator yielding individual lines, in custom generators. See docstring for `format`. Can be overridden.
[ "Wrap", "the", "source", "which", "is", "a", "generator", "yielding", "individual", "lines", "in", "custom", "generators", ".", "See", "docstring", "for", "format", ".", "Can", "be", "overridden", "." ]
def wrap(self, source, outfile): """ Wrap the ``source``, which is a generator yielding individual lines, in custom generators. See docstring for `format`. Can be overridden. """ if self.wrapcode: return self._wrap_div(self._wrap_pre(self._wrap_code(source))) ...
[ "def", "wrap", "(", "self", ",", "source", ",", "outfile", ")", ":", "if", "self", ".", "wrapcode", ":", "return", "self", ".", "_wrap_div", "(", "self", ".", "_wrap_pre", "(", "self", ".", "_wrap_code", "(", "source", ")", ")", ")", "else", ":", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py2/pygments/formatters/html.py#L838-L847
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L786-L788
mapsme/omim
1892903b63f2c85b16ed4966d21fe76aba06b9ba
tools/python/maps_generator/generator/env.py
python
PathProvider.log_path
(self)
return os.path.join(self.build_path, "logs")
mwm_path log files.
mwm_path log files.
[ "mwm_path", "log", "files", "." ]
def log_path(self) -> AnyStr: """mwm_path log files.""" return os.path.join(self.build_path, "logs")
[ "def", "log_path", "(", "self", ")", "->", "AnyStr", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "build_path", ",", "\"logs\"", ")" ]
https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/maps_generator/generator/env.py#L166-L168
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ogl/_composit.py
python
CompositeShape.GetConstraints
(self)
return self._constraints
Return the list of constraints.
Return the list of constraints.
[ "Return", "the", "list", "of", "constraints", "." ]
def GetConstraints(self): """Return the list of constraints.""" return self._constraints
[ "def", "GetConstraints", "(", "self", ")", ":", "return", "self", ".", "_constraints" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_composit.py#L741-L743
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
python
_code_to_timestamp_pyc
(code, mtime=0, source_size=0)
return data
Produce the data for a timestamp-based pyc.
Produce the data for a timestamp-based pyc.
[ "Produce", "the", "data", "for", "a", "timestamp", "-", "based", "pyc", "." ]
def _code_to_timestamp_pyc(code, mtime=0, source_size=0): "Produce the data for a timestamp-based pyc." data = bytearray(MAGIC_NUMBER) data.extend(_pack_uint32(0)) data.extend(_pack_uint32(mtime)) data.extend(_pack_uint32(source_size)) data.extend(marshal.dumps(code)) return data
[ "def", "_code_to_timestamp_pyc", "(", "code", ",", "mtime", "=", "0", ",", "source_size", "=", "0", ")", ":", "data", "=", "bytearray", "(", "MAGIC_NUMBER", ")", "data", ".", "extend", "(", "_pack_uint32", "(", "0", ")", ")", "data", ".", "extend", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L658-L665
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/backend/nn/passes/alert_return_type_cast.py
python
alert_return_type_cast
(prog)
prog: Program # NN always implicitly cast return types to fp32. Detect any return # types that are not builtin.fp32 and alert user of the implicit # casting. This pass must be at the end. Example: # # Given: # # main(%x: (2, 3, fp32)) { # block0() { # %shape_0: (2,i32...
prog: Program
[ "prog", ":", "Program" ]
def alert_return_type_cast(prog): """ prog: Program # NN always implicitly cast return types to fp32. Detect any return # types that are not builtin.fp32 and alert user of the implicit # casting. This pass must be at the end. Example: # # Given: # # main(%x: (2, 3, fp32)) { #...
[ "def", "alert_return_type_cast", "(", "prog", ")", ":", "for", "f_name", ",", "f", "in", "prog", ".", "functions", ".", "items", "(", ")", ":", "for", "v", "in", "f", ".", "outputs", ":", "if", "isinstance", "(", "v", ",", "Var", ")", "and", "v", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/backend/nn/passes/alert_return_type_cast.py#L18-L52
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/filters.py
python
ignore_case
(value)
return value.lower() if isinstance(value, string_types) else value
For use as a postprocessor for :func:`make_attrgetter`. Converts strings to lowercase and returns other types as-is.
For use as a postprocessor for :func:`make_attrgetter`. Converts strings to lowercase and returns other types as-is.
[ "For", "use", "as", "a", "postprocessor", "for", ":", "func", ":", "make_attrgetter", ".", "Converts", "strings", "to", "lowercase", "and", "returns", "other", "types", "as", "-", "is", "." ]
def ignore_case(value): """For use as a postprocessor for :func:`make_attrgetter`. Converts strings to lowercase and returns other types as-is.""" return value.lower() if isinstance(value, string_types) else value
[ "def", "ignore_case", "(", "value", ")", ":", "return", "value", ".", "lower", "(", ")", "if", "isinstance", "(", "value", ",", "string_types", ")", "else", "value" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/filters.py#L56-L59
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
python/caffe/draw.py
python
get_pydot_graph
(caffe_net, rankdir, label_edges=True, phase=None)
return pydot_graph
Create a data structure which represents the `caffe_net`. Parameters ---------- caffe_net : object rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. label_edges : boolean, optional Label the edges (default is True). phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TEST, Non...
Create a data structure which represents the `caffe_net`.
[ "Create", "a", "data", "structure", "which", "represents", "the", "caffe_net", "." ]
def get_pydot_graph(caffe_net, rankdir, label_edges=True, phase=None): """Create a data structure which represents the `caffe_net`. Parameters ---------- caffe_net : object rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. label_edges : boolean, optional Label the edges (d...
[ "def", "get_pydot_graph", "(", "caffe_net", ",", "rankdir", ",", "label_edges", "=", "True", ",", "phase", "=", "None", ")", ":", "pydot_graph", "=", "pydot", ".", "Dot", "(", "caffe_net", ".", "name", "if", "caffe_net", ".", "name", "else", "'Net'", ","...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/python/caffe/draw.py#L130-L202
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGProperty.SetAttributes
(*args, **kwargs)
return _propgrid.PGProperty_SetAttributes(*args, **kwargs)
SetAttributes(self, attributes)
SetAttributes(self, attributes)
[ "SetAttributes", "(", "self", "attributes", ")" ]
def SetAttributes(*args, **kwargs): """SetAttributes(self, attributes)""" return _propgrid.PGProperty_SetAttributes(*args, **kwargs)
[ "def", "SetAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L678-L680
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32com/client/gencache.py
python
GetGeneratedFileName
(clsid, lcid, major, minor)
return str(clsid).upper()[1:-1] + "x%sx%sx%s" % (lcid, major, minor)
Given the clsid, lcid, major and minor for a type lib, return the file name (no extension) providing this support.
Given the clsid, lcid, major and minor for a type lib, return the file name (no extension) providing this support.
[ "Given", "the", "clsid", "lcid", "major", "and", "minor", "for", "a", "type", "lib", "return", "the", "file", "name", "(", "no", "extension", ")", "providing", "this", "support", "." ]
def GetGeneratedFileName(clsid, lcid, major, minor): """Given the clsid, lcid, major and minor for a type lib, return the file name (no extension) providing this support. """ return str(clsid).upper()[1:-1] + "x%sx%sx%s" % (lcid, major, minor)
[ "def", "GetGeneratedFileName", "(", "clsid", ",", "lcid", ",", "major", ",", "minor", ")", ":", "return", "str", "(", "clsid", ")", ".", "upper", "(", ")", "[", "1", ":", "-", "1", "]", "+", "\"x%sx%sx%s\"", "%", "(", "lcid", ",", "major", ",", "...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/client/gencache.py#L127-L131
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/MarkupSafe/py3/markupsafe/__init__.py
python
Markup.unescape
(self)
return unescape(str(self))
Convert escaped markup back into a text string. This replaces HTML entities with the characters they represent. >>> Markup("Main &raquo; <em>About</em>").unescape() 'Main » <em>About</em>'
Convert escaped markup back into a text string. This replaces HTML entities with the characters they represent.
[ "Convert", "escaped", "markup", "back", "into", "a", "text", "string", ".", "This", "replaces", "HTML", "entities", "with", "the", "characters", "they", "represent", "." ]
def unescape(self) -> str: """Convert escaped markup back into a text string. This replaces HTML entities with the characters they represent. >>> Markup("Main &raquo; <em>About</em>").unescape() 'Main » <em>About</em>' """ from html import unescape return unesca...
[ "def", "unescape", "(", "self", ")", "->", "str", ":", "from", "html", "import", "unescape", "return", "unescape", "(", "str", "(", "self", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/MarkupSafe/py3/markupsafe/__init__.py#L138-L147
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
docs/examples/use_cases/pytorch/single_stage_detector/src/model.py
python
Loss._loc_vec
(self, loc)
return torch.cat((gxy, gwh), dim=1).contiguous()
Generate Location Vectors
Generate Location Vectors
[ "Generate", "Location", "Vectors" ]
def _loc_vec(self, loc): """ Generate Location Vectors """ gxy = self.scale_xy*(loc[:, :2, :] - self.dboxes[:, :2, :])/self.dboxes[:, 2:, ] gwh = self.scale_wh*(loc[:, 2:, :]/self.dboxes[:, 2:, :]).log() return torch.cat((gxy, gwh), dim=1).contiguous()
[ "def", "_loc_vec", "(", "self", ",", "loc", ")", ":", "gxy", "=", "self", ".", "scale_xy", "*", "(", "loc", "[", ":", ",", ":", "2", ",", ":", "]", "-", "self", ".", "dboxes", "[", ":", ",", ":", "2", ",", ":", "]", ")", "/", "self", ".",...
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/pytorch/single_stage_detector/src/model.py#L154-L160
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Maze/environment.py
python
MazeRewardStructure.hit_wall
(self, agent)
return -100
reward for hitting any other wall
reward for hitting any other wall
[ "reward", "for", "hitting", "any", "other", "wall" ]
def hit_wall(self, agent): """ reward for hitting any other wall """ return -100
[ "def", "hit_wall", "(", "self", ",", "agent", ")", ":", "return", "-", "100" ]
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Maze/environment.py#L22-L24
citizenfx/fivem
88276d40cc7baf8285d02754cc5ae42ec7a8563f
code/tools/idl/xpidl/xpidl.py
python
IDLParser.p_native
(self, p)
native : attributes NATIVE IDENTIFIER afternativeid '(' NATIVEID ')' ';
native : attributes NATIVE IDENTIFIER afternativeid '(' NATIVEID ')' ';
[ "native", ":", "attributes", "NATIVE", "IDENTIFIER", "afternativeid", "(", "NATIVEID", ")", ";" ]
def p_native(self, p): """native : attributes NATIVE IDENTIFIER afternativeid '(' NATIVEID ')' ';'""" p[0] = Native(name=p[3], nativename=p[6], attlist=p[1]['attlist'], location=self.getLocation(p, 2))
[ "def", "p_native", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Native", "(", "name", "=", "p", "[", "3", "]", ",", "nativename", "=", "p", "[", "6", "]", ",", "attlist", "=", "p", "[", "1", "]", "[", "'attlist'", "]", ",", ...
https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/code/tools/idl/xpidl/xpidl.py#L1169-L1174
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/util.py
python
Names.ClassName
(self, name, separator='_')
return self.CleanName(name)
Generate a valid class name from name.
Generate a valid class name from name.
[ "Generate", "a", "valid", "class", "name", "from", "name", "." ]
def ClassName(self, name, separator='_'): """Generate a valid class name from name.""" # TODO(craigcitro): Get rid of this case here and in MethodName. if name is None: return name # TODO(craigcitro): This is a hack to handle the case of specific # protorpc class name...
[ "def", "ClassName", "(", "self", ",", "name", ",", "separator", "=", "'_'", ")", ":", "# TODO(craigcitro): Get rid of this case here and in MethodName.", "if", "name", "is", "None", ":", "return", "name", "# TODO(craigcitro): This is a hack to handle the case of specific", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/gen/util.py#L103-L114
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/client/timeline.py
python
_TensorTracker.num_bytes
(self)
return self._num_bytes
Size of this tensor in bytes (long integer).
Size of this tensor in bytes (long integer).
[ "Size", "of", "this", "tensor", "in", "bytes", "(", "long", "integer", ")", "." ]
def num_bytes(self): """Size of this tensor in bytes (long integer).""" return self._num_bytes
[ "def", "num_bytes", "(", "self", ")", ":", "return", "self", ".", "_num_bytes" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/client/timeline.py#L315-L317
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/lib/configureUtil.py
python
checkFixTabixListOption
(tabixList,label)
check a list of files which are expected to be tabix indexed
check a list of files which are expected to be tabix indexed
[ "check", "a", "list", "of", "files", "which", "are", "expected", "to", "be", "tabix", "indexed" ]
def checkFixTabixListOption(tabixList,label) : """ check a list of files which are expected to be tabix indexed """ if tabixList is None : return for (index,tabixFile) in enumerate(tabixList) : checkTabixIndexedFile(tabixFile,label) tabixList[index] = os.path.abspath(tabixFile)
[ "def", "checkFixTabixListOption", "(", "tabixList", ",", "label", ")", ":", "if", "tabixList", "is", "None", ":", "return", "for", "(", "index", ",", "tabixFile", ")", "in", "enumerate", "(", "tabixList", ")", ":", "checkTabixIndexedFile", "(", "tabixFile", ...
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/configureUtil.py#L224-L231
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/autograd.py
python
set_recording
(is_recording)
return bool(prev.value)
Set status to recording/not recording. When recording, graph will be constructed for gradient computation. Parameters ---------- is_recording: bool Returns ------- previous state before this set.
Set status to recording/not recording. When recording, graph will be constructed for gradient computation.
[ "Set", "status", "to", "recording", "/", "not", "recording", ".", "When", "recording", "graph", "will", "be", "constructed", "for", "gradient", "computation", "." ]
def set_recording(is_recording): #pylint: disable=redefined-outer-name """Set status to recording/not recording. When recording, graph will be constructed for gradient computation. Parameters ---------- is_recording: bool Returns ------- previous state before this set. """ prev...
[ "def", "set_recording", "(", "is_recording", ")", ":", "#pylint: disable=redefined-outer-name", "prev", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXAutogradSetIsRecording", "(", "ctypes", ".", "c_int", "(", "is_recording", ")", ",", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/autograd.py#L35-L50
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/requests/requests/utils.py
python
get_encoding_from_headers
(headers)
Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from.
Returns encodings from given HTTP Header Dict.
[ "Returns", "encodings", "from", "given", "HTTP", "Header", "Dict", "." ]
def get_encoding_from_headers(headers): """Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. """ content_type = headers.get('content-type') if not content_type: return None content_type, params = cgi.parse_header(content_type) if...
[ "def", "get_encoding_from_headers", "(", "headers", ")", ":", "content_type", "=", "headers", ".", "get", "(", "'content-type'", ")", "if", "not", "content_type", ":", "return", "None", "content_type", ",", "params", "=", "cgi", ".", "parse_header", "(", "cont...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/utils.py#L277-L294
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.GetTargetRect
(*args, **kwargs)
return _richtext.RichTextCtrl_GetTargetRect(*args, **kwargs)
GetTargetRect(self) -> Rect
GetTargetRect(self) -> Rect
[ "GetTargetRect", "(", "self", ")", "-", ">", "Rect" ]
def GetTargetRect(*args, **kwargs): """GetTargetRect(self) -> Rect""" return _richtext.RichTextCtrl_GetTargetRect(*args, **kwargs)
[ "def", "GetTargetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_GetTargetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4202-L4204
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
RawTurtle._rotate
(self, angle)
Turns pen clockwise by angle.
Turns pen clockwise by angle.
[ "Turns", "pen", "clockwise", "by", "angle", "." ]
def _rotate(self, angle): """Turns pen clockwise by angle. """ if self.undobuffer: self.undobuffer.push(("rot", angle, self._degreesPerAU)) angle *= self._degreesPerAU neworient = self._orient.rotate(angle) tracing = self.screen._tracing if tracing == ...
[ "def", "_rotate", "(", "self", ",", "angle", ")", ":", "if", "self", ".", "undobuffer", ":", "self", ".", "undobuffer", ".", "push", "(", "(", "\"rot\"", ",", "angle", ",", "self", ".", "_degreesPerAU", ")", ")", "angle", "*=", "self", ".", "_degrees...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L3262-L3278
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/util/utility.py
python
on_windows
()
return False
Returns true if running on windows, whether in cygwin or not.
Returns true if running on windows, whether in cygwin or not.
[ "Returns", "true", "if", "running", "on", "windows", "whether", "in", "cygwin", "or", "not", "." ]
def on_windows (): """ Returns true if running on windows, whether in cygwin or not. """ if bjam.variable("NT"): return True elif bjam.variable("UNIX"): uname = bjam.variable("JAMUNAME") if uname and uname[0].startswith("CYGWIN"): return True return False
[ "def", "on_windows", "(", ")", ":", "if", "bjam", ".", "variable", "(", "\"NT\"", ")", ":", "return", "True", "elif", "bjam", ".", "variable", "(", "\"UNIX\"", ")", ":", "uname", "=", "bjam", ".", "variable", "(", "\"JAMUNAME\"", ")", "if", "uname", ...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/util/utility.py#L164-L176
yrnkrn/zapcc
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
bindings/python/llvm/core.py
python
Module.target
(self, new_target)
new_target is a string.
new_target is a string.
[ "new_target", "is", "a", "string", "." ]
def target(self, new_target): """new_target is a string.""" lib.LLVMSetTarget(self, new_target)
[ "def", "target", "(", "self", ",", "new_target", ")", ":", "lib", ".", "LLVMSetTarget", "(", "self", ",", "new_target", ")" ]
https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/bindings/python/llvm/core.py#L219-L221
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/motionplanning.py
python
PlannerInterface.addMilestone
(self, milestone: "PyObject *")
return _motionplanning.PlannerInterface_addMilestone(self, milestone)
r""" addMilestone(PlannerInterface self, PyObject * milestone) -> int
r""" addMilestone(PlannerInterface self, PyObject * milestone) -> int
[ "r", "addMilestone", "(", "PlannerInterface", "self", "PyObject", "*", "milestone", ")", "-", ">", "int" ]
def addMilestone(self, milestone: "PyObject *") -> "int": r""" addMilestone(PlannerInterface self, PyObject * milestone) -> int """ return _motionplanning.PlannerInterface_addMilestone(self, milestone)
[ "def", "addMilestone", "(", "self", ",", "milestone", ":", "\"PyObject *\"", ")", "->", "\"int\"", ":", "return", "_motionplanning", ".", "PlannerInterface_addMilestone", "(", "self", ",", "milestone", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/motionplanning.py#L923-L929
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/sonnx.py
python
SingaBackend._create_squeeze_unsqueeze
(cls, onnx_node, operator, opset_version=_opset_version)
return operator(axes)
get the Squeeze and Unsqueeze operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Returns: singa operator instance
get the Squeeze and Unsqueeze operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Returns: singa operator instance
[ "get", "the", "Squeeze", "and", "Unsqueeze", "operator", "from", "onnx", "node", "Args", ":", "onnx_node", "(", "OnnxNode", ")", ":", "a", "given", "onnx", "node", "operator", "(", "Operator", "Class", ")", ":", "a", "singa", "operator", "class", "opset_ve...
def _create_squeeze_unsqueeze(cls, onnx_node, operator, opset_version=_opset_version): """ get the Squeeze and Unsqueeze operator from onnx node Args: onnx_node (OnnxNode): a given o...
[ "def", "_create_squeeze_unsqueeze", "(", "cls", ",", "onnx_node", ",", "operator", ",", "opset_version", "=", "_opset_version", ")", ":", "axes", "=", "onnx_node", ".", "getattr", "(", "\"axes\"", ")", "return", "operator", "(", "axes", ")" ]
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L1285-L1299
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py
python
EnggCalibrateFull._apply_calibration_table
(self, ws, detPos)
Corrects the detector positions using the result of calibration (if one is specified). The parameters of the instrument definition of the workspace are updated in place using the geometry parameters given in the input table. @param ws :: workspace to calibrate which should be consistent with th...
Corrects the detector positions using the result of calibration (if one is specified). The parameters of the instrument definition of the workspace are updated in place using the geometry parameters given in the input table.
[ "Corrects", "the", "detector", "positions", "using", "the", "result", "of", "calibration", "(", "if", "one", "is", "specified", ")", ".", "The", "parameters", "of", "the", "instrument", "definition", "of", "the", "workspace", "are", "updated", "in", "place", ...
def _apply_calibration_table(self, ws, detPos): """ Corrects the detector positions using the result of calibration (if one is specified). The parameters of the instrument definition of the workspace are updated in place using the geometry parameters given in the input table. @p...
[ "def", "_apply_calibration_table", "(", "self", ",", "ws", ",", "detPos", ")", ":", "self", ".", "log", "(", ")", ".", "notice", "(", "\"Applying calibration on the input workspace\"", ")", "alg", "=", "self", ".", "createChildAlgorithm", "(", "'ApplyCalibration'"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py#L353-L369
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py
python
MWSConnection.get_my_price_for_asin
(self, request, response, **kw)
return self._post_request(request, kw, response)
Returns pricing information for your own offer listings, based on ASIN.
Returns pricing information for your own offer listings, based on ASIN.
[ "Returns", "pricing", "information", "for", "your", "own", "offer", "listings", "based", "on", "ASIN", "." ]
def get_my_price_for_asin(self, request, response, **kw): """Returns pricing information for your own offer listings, based on ASIN. """ return self._post_request(request, kw, response)
[ "def", "get_my_price_for_asin", "(", "self", ",", "request", ",", "response", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_post_request", "(", "request", ",", "kw", ",", "response", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py#L867-L870
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/framework/python/ops/arg_scope.py
python
add_arg_scope
(func)
return tf_decorator.make_decorator(func, func_with_args)
Decorates a function with args so it can be used within an arg_scope. Args: func: function to decorate. Returns: A tuple with the decorated function func_with_args().
Decorates a function with args so it can be used within an arg_scope.
[ "Decorates", "a", "function", "with", "args", "so", "it", "can", "be", "used", "within", "an", "arg_scope", "." ]
def add_arg_scope(func): """Decorates a function with args so it can be used within an arg_scope. Args: func: function to decorate. Returns: A tuple with the decorated function func_with_args(). """ def func_with_args(*args, **kwargs): current_scope = current_arg_scope() current_args = kwarg...
[ "def", "add_arg_scope", "(", "func", ")", ":", "def", "func_with_args", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "current_scope", "=", "current_arg_scope", "(", ")", "current_args", "=", "kwargs", "key_func", "=", "_key_op", "(", "func", ")", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/framework/python/ops/arg_scope.py#L166-L185
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/edit_config_handler.py
python
_ValidatePatterns
(test_path_patterns)
Raises an exception if any test path patterns are invalid.
Raises an exception if any test path patterns are invalid.
[ "Raises", "an", "exception", "if", "any", "test", "path", "patterns", "are", "invalid", "." ]
def _ValidatePatterns(test_path_patterns): """Raises an exception if any test path patterns are invalid.""" for pattern in test_path_patterns: if not _IsValidTestPathPattern(pattern): raise request_handler.InvalidInputError( 'Invalid test path pattern: "%s"' % pattern)
[ "def", "_ValidatePatterns", "(", "test_path_patterns", ")", ":", "for", "pattern", "in", "test_path_patterns", ":", "if", "not", "_IsValidTestPathPattern", "(", "pattern", ")", ":", "raise", "request_handler", ".", "InvalidInputError", "(", "'Invalid test path pattern: ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/edit_config_handler.py#L148-L153
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
masked_where
(condition, x, copy=1)
return array(filled(x), copy=copy, mask=m)
Return x as an array masked where condition is true. Also masked where x or condition masked.
Return x as an array masked where condition is true. Also masked where x or condition masked.
[ "Return", "x", "as", "an", "array", "masked", "where", "condition", "is", "true", ".", "Also", "masked", "where", "x", "or", "condition", "masked", "." ]
def masked_where(condition, x, copy=1): """Return x as an array masked where condition is true. Also masked where x or condition masked. """ cm = filled(condition, 1) m = mask_or(getmask(x), cm) return array(filled(x), copy=copy, mask=m)
[ "def", "masked_where", "(", "condition", ",", "x", ",", "copy", "=", "1", ")", ":", "cm", "=", "filled", "(", "condition", ",", "1", ")", "m", "=", "mask_or", "(", "getmask", "(", "x", ")", ",", "cm", ")", "return", "array", "(", "filled", "(", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1771-L1777
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/c/documentation/doxy_cleanup.py
python
HTMLFixer.FixTableHeadings
(self)
Fixes the doxygen table headings. This includes: - Using bare <h2> title row instead of row embedded in <tr><td> in table - Putting the "name" attribute into the "id" attribute of the <tr> tag. - Splitting up tables into multiple separate tables if a table heading appears in the middle of...
Fixes the doxygen table headings.
[ "Fixes", "the", "doxygen", "table", "headings", "." ]
def FixTableHeadings(self): '''Fixes the doxygen table headings. This includes: - Using bare <h2> title row instead of row embedded in <tr><td> in table - Putting the "name" attribute into the "id" attribute of the <tr> tag. - Splitting up tables into multiple separate tables if a table ...
[ "def", "FixTableHeadings", "(", "self", ")", ":", "table_headers", "=", "[", "]", "for", "tag", "in", "self", ".", "soup", ".", "findAll", "(", "'tr'", ")", ":", "if", "tag", ".", "td", "and", "tag", ".", "td", ".", "h2", "and", "tag", ".", "td",...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/c/documentation/doxy_cleanup.py#L34-L86
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/util/dispatch.py
python
make_type_checker
(annotation)
Builds a PyTypeChecker for the given type annotation.
Builds a PyTypeChecker for the given type annotation.
[ "Builds", "a", "PyTypeChecker", "for", "the", "given", "type", "annotation", "." ]
def make_type_checker(annotation): """Builds a PyTypeChecker for the given type annotation.""" if type_annotations.is_generic_union(annotation): type_args = type_annotations.get_generic_type_args(annotation) # If the union contains two or more simple types, then use a single # InstanceChecker to check ...
[ "def", "make_type_checker", "(", "annotation", ")", ":", "if", "type_annotations", ".", "is_generic_union", "(", "annotation", ")", ":", "type_args", "=", "type_annotations", ".", "get_generic_type_args", "(", "annotation", ")", "# If the union contains two or more simple...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/dispatch.py#L648-L688
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/scripts/cpp_lint.py
python
CheckEmptyBlockBody
(filename, clean_lines, linenum, error)
Look for empty loop/conditional body with only a single semicolon. 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.
Look for empty loop/conditional body with only a single semicolon.
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. 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 functio...
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L3247-L3279
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/vault.py
python
Vault.delete_archive
(self, archive_id)
return self.layer1.delete_archive(self.name, archive_id)
This operation deletes an archive from the vault. :type archive_id: str :param archive_id: The ID for the archive to be deleted.
This operation deletes an archive from the vault.
[ "This", "operation", "deletes", "an", "archive", "from", "the", "vault", "." ]
def delete_archive(self, archive_id): """ This operation deletes an archive from the vault. :type archive_id: str :param archive_id: The ID for the archive to be deleted. """ return self.layer1.delete_archive(self.name, archive_id)
[ "def", "delete_archive", "(", "self", ",", "archive_id", ")", ":", "return", "self", ".", "layer1", ".", "delete_archive", "(", "self", ".", "name", ",", "archive_id", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/vault.py#L387-L394
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py
python
Bucket.configure_versioning
(self, enabled, headers=None)
Configure versioning for this bucket. :param bool enabled: If set to True, enables versioning on this bucket. If set to False, disables versioning. :param dict headers: Additional headers to send with the request.
Configure versioning for this bucket.
[ "Configure", "versioning", "for", "this", "bucket", "." ]
def configure_versioning(self, enabled, headers=None): """Configure versioning for this bucket. :param bool enabled: If set to True, enables versioning on this bucket. If set to False, disables versioning. :param dict headers: Additional headers to send with the request. ""...
[ "def", "configure_versioning", "(", "self", ",", "enabled", ",", "headers", "=", "None", ")", ":", "if", "enabled", "==", "True", ":", "req_body", "=", "self", ".", "VersioningBody", "%", "(", "'Enabled'", ")", "else", ":", "req_body", "=", "self", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py#L937-L949
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/core/tensor/dtype.py
python
qint8
(scale)
return create_quantized_dtype(_builtin_quant_dtypes["qint8"], scale, None)
r"""Construct a quantized int8 data type with ``scale`` (float). The real value represented by a qint8 data type is float_val = scale * int8_val
r"""Construct a quantized int8 data type with ``scale`` (float). The real value represented by a qint8 data type is float_val = scale * int8_val
[ "r", "Construct", "a", "quantized", "int8", "data", "type", "with", "scale", "(", "float", ")", ".", "The", "real", "value", "represented", "by", "a", "qint8", "data", "type", "is", "float_val", "=", "scale", "*", "int8_val" ]
def qint8(scale): r"""Construct a quantized int8 data type with ``scale`` (float). The real value represented by a qint8 data type is float_val = scale * int8_val """ return create_quantized_dtype(_builtin_quant_dtypes["qint8"], scale, None)
[ "def", "qint8", "(", "scale", ")", ":", "return", "create_quantized_dtype", "(", "_builtin_quant_dtypes", "[", "\"qint8\"", "]", ",", "scale", ",", "None", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/core/tensor/dtype.py#L162-L166
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py
python
ParserElement.__rand__
(self, other )
return other & self
Implementation of & operator when left operand is not a C{L{ParserElement}}
Implementation of & operator when left operand is not a C{L{ParserElement}}
[ "Implementation", "of", "&", "operator", "when", "left", "operand", "is", "not", "a", "C", "{", "L", "{", "ParserElement", "}}" ]
def __rand__(self, other ): """ Implementation of & operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn(...
[ "def", "__rand__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "basestring", ")", ":", "other", "=", "ParserElement", ".", "_literalStringClass", "(", "other", ")", "if", "not", "isinstance", "(", "other", ",", "ParserElemen...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L2008-L2018
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/http/cookiejar.py
python
FileCookieJar.save
(self, filename=None, ignore_discard=False, ignore_expires=False)
Save cookies to a file.
Save cookies to a file.
[ "Save", "cookies", "to", "a", "file", "." ]
def save(self, filename=None, ignore_discard=False, ignore_expires=False): """Save cookies to a file.""" raise NotImplementedError()
[ "def", "save", "(", "self", ",", "filename", "=", "None", ",", "ignore_discard", "=", "False", ",", "ignore_expires", "=", "False", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/cookiejar.py#L1788-L1790
google/flatbuffers
b3006913369e0a7550795e477011ac5bebb93497
python/flatbuffers/reflection/EnumVal.py
python
EnumVal.GetRootAsEnumVal
(cls, buf, offset=0)
return cls.GetRootAs(buf, offset)
This method is deprecated. Please switch to GetRootAs.
This method is deprecated. Please switch to GetRootAs.
[ "This", "method", "is", "deprecated", ".", "Please", "switch", "to", "GetRootAs", "." ]
def GetRootAsEnumVal(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset)
[ "def", "GetRootAsEnumVal", "(", "cls", ",", "buf", ",", "offset", "=", "0", ")", ":", "return", "cls", ".", "GetRootAs", "(", "buf", ",", "offset", ")" ]
https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/reflection/EnumVal.py#L20-L22
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/html2.py
python
WebView.SetZoom
(*args, **kwargs)
return _html2.WebView_SetZoom(*args, **kwargs)
SetZoom(self, int zoom)
SetZoom(self, int zoom)
[ "SetZoom", "(", "self", "int", "zoom", ")" ]
def SetZoom(*args, **kwargs): """SetZoom(self, int zoom)""" return _html2.WebView_SetZoom(*args, **kwargs)
[ "def", "SetZoom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html2", ".", "WebView_SetZoom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html2.py#L318-L320
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/xgboost/subtree/rabit/wrapper/rabit.py
python
load_checkpoint
(with_local=False)
Load latest check point. Parameters ---------- with_local: bool, optional whether the checkpoint contains local model Returns ------- tuple : tuple if with_local: return (version, gobal_model, local_model) else return (version, gobal_model) if returned version =...
Load latest check point.
[ "Load", "latest", "check", "point", "." ]
def load_checkpoint(with_local=False): """Load latest check point. Parameters ---------- with_local: bool, optional whether the checkpoint contains local model Returns ------- tuple : tuple if with_local: return (version, gobal_model, local_model) else return (versi...
[ "def", "load_checkpoint", "(", "with_local", "=", "False", ")", ":", "gptr", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char", ")", "(", ")", "global_len", "=", "ctypes", ".", "c_ulong", "(", ")", "if", "with_local", ":", "lptr", "=", "ctype...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/subtree/rabit/wrapper/rabit.py#L242-L281
widelands/widelands
e9f047d46a23d81312237d52eabf7d74e8de52d6
utils/pywi/config.py
python
File.itersections
(self)
Iterate through (name, section) pairs.
Iterate through (name, section) pairs.
[ "Iterate", "through", "(", "name", "section", ")", "pairs", "." ]
def itersections(self): """Iterate through (name, section) pairs.""" for idx, line in enumerate(self.lines): if line.type == SECTION: if idx + 1 not in self._sections: self._sections[idx + 1] = Section(self, idx + 1) yield (line.value, self...
[ "def", "itersections", "(", "self", ")", ":", "for", "idx", ",", "line", "in", "enumerate", "(", "self", ".", "lines", ")", ":", "if", "line", ".", "type", "==", "SECTION", ":", "if", "idx", "+", "1", "not", "in", "self", ".", "_sections", ":", "...
https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/utils/pywi/config.py#L166-L172
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/model.py
python
SequentialTimeSeriesModel._imputation_step
(self, current_times, state)
Update model state across missing values. Called to prepare model state for _filtering_step and _prediction_step. Args: current_times: A [batch size] Tensor; state will be imputed up to, but not including, these timesteps. state: The pre-imputation model state, Tensors with shape [batch ...
Update model state across missing values.
[ "Update", "model", "state", "across", "missing", "values", "." ]
def _imputation_step(self, current_times, state): """Update model state across missing values. Called to prepare model state for _filtering_step and _prediction_step. Args: current_times: A [batch size] Tensor; state will be imputed up to, but not including, these timesteps. state: T...
[ "def", "_imputation_step", "(", "self", ",", "current_times", ",", "state", ")", ":", "pass" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/model.py#L387-L400
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
rlpytorch/methods/value_matcher.py
python
ValueMatcher._init
(self, _)
Initialize value loss to be ``nn.SmoothL1Loss``.
Initialize value loss to be ``nn.SmoothL1Loss``.
[ "Initialize", "value", "loss", "to", "be", "nn", ".", "SmoothL1Loss", "." ]
def _init(self, _): ''' Initialize value loss to be ``nn.SmoothL1Loss``. ''' self.value_loss = nn.SmoothL1Loss().cuda() self.value_node = self.args.value_node
[ "def", "_init", "(", "self", ",", "_", ")", ":", "self", ".", "value_loss", "=", "nn", ".", "SmoothL1Loss", "(", ")", ".", "cuda", "(", ")", "self", ".", "value_node", "=", "self", ".", "args", ".", "value_node" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/methods/value_matcher.py#L32-L35
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextBoxAttr.GetBottom
(*args)
return _richtext.TextBoxAttr_GetBottom(*args)
GetBottom(self) -> TextAttrDimension GetBottom(self) -> TextAttrDimension
GetBottom(self) -> TextAttrDimension GetBottom(self) -> TextAttrDimension
[ "GetBottom", "(", "self", ")", "-", ">", "TextAttrDimension", "GetBottom", "(", "self", ")", "-", ">", "TextAttrDimension" ]
def GetBottom(*args): """ GetBottom(self) -> TextAttrDimension GetBottom(self) -> TextAttrDimension """ return _richtext.TextBoxAttr_GetBottom(*args)
[ "def", "GetBottom", "(", "*", "args", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetBottom", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L691-L696
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/ciconfig/evergreen.py
python
Variant.test_flags
(self)
return self.expansion("test_flags")
Return the value of the test_flags expansion or None if not found.
Return the value of the test_flags expansion or None if not found.
[ "Return", "the", "value", "of", "the", "test_flags", "expansion", "or", "None", "if", "not", "found", "." ]
def test_flags(self): """Return the value of the test_flags expansion or None if not found.""" return self.expansion("test_flags")
[ "def", "test_flags", "(", "self", ")", ":", "return", "self", ".", "expansion", "(", "\"test_flags\"", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/ciconfig/evergreen.py#L167-L169
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
Node.clean
(self)
Clean this node's file if it is generated, and recursively its sources recursively.
Clean this node's file if it is generated, and recursively its sources recursively.
[ "Clean", "this", "node", "s", "file", "if", "it", "is", "generated", "and", "recursively", "its", "sources", "recursively", "." ]
def clean(self): """Clean this node's file if it is generated, and recursively its sources recursively.""" BaseNode.clean(self) if self.builder is not None and self.path().exists(): print('Deleting %s' % self) _OS.remove(str(self.path()))
[ "def", "clean", "(", "self", ")", ":", "BaseNode", ".", "clean", "(", "self", ")", "if", "self", ".", "builder", "is", "not", "None", "and", "self", ".", "path", "(", ")", ".", "exists", "(", ")", ":", "print", "(", "'Deleting %s'", "%", "self", ...
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1681-L1687
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ctypes/__init__.py
python
CFUNCTYPE
(restype, *argtypes, **kw)
CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a callable object: prototype(integer address) -...
CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype.
[ "CFUNCTYPE", "(", "restype", "*", "argtypes", "use_errno", "=", "False", "use_last_error", "=", "False", ")", "-", ">", "function", "prototype", "." ]
def CFUNCTYPE(restype, *argtypes, **kw): """CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a ca...
[ "def", "CFUNCTYPE", "(", "restype", ",", "*", "argtypes", ",", "*", "*", "kw", ")", ":", "flags", "=", "_FUNCFLAG_CDECL", "if", "kw", ".", "pop", "(", "\"use_errno\"", ",", "False", ")", ":", "flags", "|=", "_FUNCFLAG_USE_ERRNO", "if", "kw", ".", "pop"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ctypes/__init__.py#L73-L104
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/xrc.py
python
XmlProperty.__init__
(self, *args, **kwargs)
__init__(self, String name=EmptyString, String value=EmptyString, XmlProperty next=None) -> XmlProperty
__init__(self, String name=EmptyString, String value=EmptyString, XmlProperty next=None) -> XmlProperty
[ "__init__", "(", "self", "String", "name", "=", "EmptyString", "String", "value", "=", "EmptyString", "XmlProperty", "next", "=", "None", ")", "-", ">", "XmlProperty" ]
def __init__(self, *args, **kwargs): """ __init__(self, String name=EmptyString, String value=EmptyString, XmlProperty next=None) -> XmlProperty """ _xrc.XmlProperty_swiginit(self,_xrc.new_XmlProperty(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_xrc", ".", "XmlProperty_swiginit", "(", "self", ",", "_xrc", ".", "new_XmlProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L310-L315
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Gru.py
python
Gru.gate_free_term
(self, gate_free_term)
Sets the gate free terms as a blob of total 2 * hidden_size size.
Sets the gate free terms as a blob of total 2 * hidden_size size.
[ "Sets", "the", "gate", "free", "terms", "as", "a", "blob", "of", "total", "2", "*", "hidden_size", "size", "." ]
def gate_free_term(self, gate_free_term): """Sets the gate free terms as a blob of total 2 * hidden_size size. """ if not isinstance(gate_free_term, Blob.Blob): raise ValueError("The `blob` must be neoml.Blob.Blob'") self._internal.set_gate_free_term(gate_free_term._internal...
[ "def", "gate_free_term", "(", "self", ",", "gate_free_term", ")", ":", "if", "not", "isinstance", "(", "gate_free_term", ",", "Blob", ".", "Blob", ")", ":", "raise", "ValueError", "(", "\"The `blob` must be neoml.Blob.Blob'\"", ")", "self", ".", "_internal", "."...
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Gru.py#L137-L143
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.GetSortedXcodeEnv
(self, additional_settings=None)
return gyp.xcode_emulation.GetSortedXcodeEnv( self.xcode_settings, abs_build_dir, os.path.join(abs_build_dir, self.build_to_base), self.config_name, additional_settings)
Returns the variables Xcode would set for build steps.
Returns the variables Xcode would set for build steps.
[ "Returns", "the", "variables", "Xcode", "would", "set", "for", "build", "steps", "." ]
def GetSortedXcodeEnv(self, additional_settings=None): """Returns the variables Xcode would set for build steps.""" assert self.abs_build_dir abs_build_dir = self.abs_build_dir return gyp.xcode_emulation.GetSortedXcodeEnv( self.xcode_settings, abs_build_dir, os.path.join(abs_build_dir, s...
[ "def", "GetSortedXcodeEnv", "(", "self", ",", "additional_settings", "=", "None", ")", ":", "assert", "self", ".", "abs_build_dir", "abs_build_dir", "=", "self", ".", "abs_build_dir", "return", "gyp", ".", "xcode_emulation", ".", "GetSortedXcodeEnv", "(", "self", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L989-L996
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/function.py
python
_add_output_list
(op, start, limit, dtype_lst, func)
return ret_name
Adds a _ArrayToList node in the func for op.outputs[start:limit].
Adds a _ArrayToList node in the func for op.outputs[start:limit].
[ "Adds", "a", "_ArrayToList", "node", "in", "the", "func", "for", "op", ".", "outputs", "[", "start", ":", "limit", "]", "." ]
def _add_output_list(op, start, limit, dtype_lst, func): """Adds a _ArrayToList node in the func for op.outputs[start:limit].""" ret_name = op.name + "_Lst_" + str(start) + "_" + str(limit) num = limit - start assert len(dtype_lst) == num # Adds an identity node for each element in the array N*T so that # u...
[ "def", "_add_output_list", "(", "op", ",", "start", ",", "limit", ",", "dtype_lst", ",", "func", ")", ":", "ret_name", "=", "op", ".", "name", "+", "\"_Lst_\"", "+", "str", "(", "start", ")", "+", "\"_\"", "+", "str", "(", "limit", ")", "num", "=",...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/function.py#L99-L114