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
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/compile_settings_gcc.py
python
load_gcc_common_settings
(conf)
Setup all compiler/linker flags with are shared over all targets using the gcc compiler !!! But not the actual compiler, since the compiler depends on the target !!!
Setup all compiler/linker flags with are shared over all targets using the gcc compiler !!! But not the actual compiler, since the compiler depends on the target !!!
[ "Setup", "all", "compiler", "/", "linker", "flags", "with", "are", "shared", "over", "all", "targets", "using", "the", "gcc", "compiler", "!!!", "But", "not", "the", "actual", "compiler", "since", "the", "compiler", "depends", "on", "the", "target", "!!!" ]
def load_gcc_common_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the gcc compiler !!! But not the actual compiler, since the compiler depends on the target !!! """ v = conf.env # Figure out GCC compiler version try: conf.get_cc_version( [ v['CC'] ], gcc=True) ...
[ "def", "load_gcc_common_settings", "(", "conf", ")", ":", "v", "=", "conf", ".", "env", "# Figure out GCC compiler version", "try", ":", "conf", ".", "get_cc_version", "(", "[", "v", "[", "'CC'", "]", "]", ",", "gcc", "=", "True", ")", "except", ":", "# ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/compile_settings_gcc.py#L6-L171
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/containers.py#L308-L310
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py
python
ParseFlags
(resp)
return tuple(mo.group('flags').split())
Convert IMAP4 flags response to python tuple.
Convert IMAP4 flags response to python tuple.
[ "Convert", "IMAP4", "flags", "response", "to", "python", "tuple", "." ]
def ParseFlags(resp): """Convert IMAP4 flags response to python tuple.""" mo = Flags.match(resp) if not mo: return () return tuple(mo.group('flags').split())
[ "def", "ParseFlags", "(", "resp", ")", ":", "mo", "=", "Flags", ".", "match", "(", "resp", ")", "if", "not", "mo", ":", "return", "(", ")", "return", "tuple", "(", "mo", ".", "group", "(", "'flags'", ")", ".", "split", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py#L1458-L1466
wujixiu/helmet-detection
8eff5c59ddfba5a29e0b76aeb48babcb49246178
hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py#L3607-L3621
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/task.py
python
Task.__init__
( self, step=None, outputs=None, workspace_type=None, group=None, node=None, name=None, num_instances=None)
Instantiate a Task and add it to the current TaskGroup and Node. Args: step: If provided, this task will run this ExecutionStep. outputs: If provided, the task will return the provided outputs to the client at completion time. node: If provided, force ...
Instantiate a Task and add it to the current TaskGroup and Node.
[ "Instantiate", "a", "Task", "and", "add", "it", "to", "the", "current", "TaskGroup", "and", "Node", "." ]
def __init__( self, step=None, outputs=None, workspace_type=None, group=None, node=None, name=None, num_instances=None): """ Instantiate a Task and add it to the current TaskGroup and Node. Args: step: If provided, this task will run this Execut...
[ "def", "__init__", "(", "self", ",", "step", "=", "None", ",", "outputs", "=", "None", ",", "workspace_type", "=", "None", ",", "group", "=", "None", ",", "node", "=", "None", ",", "name", "=", "None", ",", "num_instances", "=", "None", ")", ":", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/task.py#L492-L536
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/fractions.py
python
Fraction.__trunc__
(a)
trunc(a)
trunc(a)
[ "trunc", "(", "a", ")" ]
def __trunc__(a): """trunc(a)""" if a._numerator < 0: return -(-a._numerator // a._denominator) else: return a._numerator // a._denominator
[ "def", "__trunc__", "(", "a", ")", ":", "if", "a", ".", "_numerator", "<", "0", ":", "return", "-", "(", "-", "a", ".", "_numerator", "//", "a", ".", "_denominator", ")", "else", ":", "return", "a", ".", "_numerator", "//", "a", ".", "_denominator"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/fractions.py#L504-L509
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/urlhandler/protocol_alt.py
python
serial_class_for_url
(url)
return (''.join([parts.netloc, parts.path]), cls)
extract host and port from an URL string
extract host and port from an URL string
[ "extract", "host", "and", "port", "from", "an", "URL", "string" ]
def serial_class_for_url(url): """extract host and port from an URL string""" parts = urlparse.urlsplit(url) if parts.scheme != 'alt': raise serial.SerialException( 'expected a string in the form "alt://port[?option[=value][&option[=value]]]": ' 'not starting with alt:// ({!r...
[ "def", "serial_class_for_url", "(", "url", ")", ":", "parts", "=", "urlparse", ".", "urlsplit", "(", "url", ")", "if", "parts", ".", "scheme", "!=", "'alt'", ":", "raise", "serial", ".", "SerialException", "(", "'expected a string in the form \"alt://port[?option[...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/urlhandler/protocol_alt.py#L27-L50
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/control-examples/baxterserialrelay.py
python
mainRosControllerToKlamptRobot
(klampt_robot_model_fn,klampt_serial_port)
Relays ROS Baxter controller messages to and from Klamp't simulated robot
Relays ROS Baxter controller messages to and from Klamp't simulated robot
[ "Relays", "ROS", "Baxter", "controller", "messages", "to", "and", "from", "Klamp", "t", "simulated", "robot" ]
def mainRosControllerToKlamptRobot(klampt_robot_model_fn,klampt_serial_port): """Relays ROS Baxter controller messages to and from Klamp't simulated robot""" rospy.init_node('klampt_sim') #load robot file world = WorldModel() world.enableGeometryLoading(False) res = world.readFile(klampt_robot_...
[ "def", "mainRosControllerToKlamptRobot", "(", "klampt_robot_model_fn", ",", "klampt_serial_port", ")", ":", "rospy", ".", "init_node", "(", "'klampt_sim'", ")", "#load robot file", "world", "=", "WorldModel", "(", ")", "world", ".", "enableGeometryLoading", "(", "Fals...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/baxterserialrelay.py#L33-L74
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-utils/modtool/tools/grc_yaml_generator.py
python
dict_constructor
(loader, node)
return OrderedDict(loader.construct_pairs(node))
Construct an OrderedDict for dumping
Construct an OrderedDict for dumping
[ "Construct", "an", "OrderedDict", "for", "dumping" ]
def dict_constructor(loader, node): """ Construct an OrderedDict for dumping """ return OrderedDict(loader.construct_pairs(node))
[ "def", "dict_constructor", "(", "loader", ",", "node", ")", ":", "return", "OrderedDict", "(", "loader", ".", "construct_pairs", "(", "node", ")", ")" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/tools/grc_yaml_generator.py#L32-L34
Ewenwan/MVision
97b394dfa48cb21c82cd003b1a952745e413a17f
vSLAM/矩阵变换python函数.py
python
superimposition_matrix
(v0, v1, scaling=False, usesvd=True)
return M
Return matrix to transform given vector set into second vector set. v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 vectors. If usesvd is True, the weighted sum of squared deviations (RMSD) is minimized according to the algorithm by W. Kabsch [8]. Otherwise the quaternion based algorithm by ...
Return matrix to transform given vector set into second vector set. v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 vectors. If usesvd is True, the weighted sum of squared deviations (RMSD) is minimized according to the algorithm by W. Kabsch [8]. Otherwise the quaternion based algorithm by ...
[ "Return", "matrix", "to", "transform", "given", "vector", "set", "into", "second", "vector", "set", ".", "v0", "and", "v1", "are", "shape", "(", "3", "\\", "*", ")", "or", "(", "4", "\\", "*", ")", "arrays", "of", "at", "least", "3", "vectors", "."...
def superimposition_matrix(v0, v1, scaling=False, usesvd=True): """Return matrix to transform given vector set into second vector set. v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 vectors. If usesvd is True, the weighted sum of squared deviations (RMSD) is minimized according to the algor...
[ "def", "superimposition_matrix", "(", "v0", ",", "v1", ",", "scaling", "=", "False", ",", "usesvd", "=", "True", ")", ":", "v0", "=", "numpy", ".", "array", "(", "v0", ",", "dtype", "=", "numpy", ".", "float64", ",", "copy", "=", "False", ")", "[",...
https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/vSLAM/矩阵变换python函数.py#L794-L888
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/images/layer_rasters.py
python
LayerRasters.addToBaseQuery
(self, query)
add queries that together define the layer
add queries that together define the layer
[ "add", "queries", "that", "together", "define", "the", "layer" ]
def addToBaseQuery(self, query): """ add queries that together define the layer """ self.dict.update(query)
[ "def", "addToBaseQuery", "(", "self", ",", "query", ")", ":", "self", ".", "dict", ".", "update", "(", "query", ")" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/images/layer_rasters.py#L19-L21
cluebotng/cluebotng
2ed38a518c1019f6b7b03e33b487f96f8df617b0
fabfile.py
python
_update_utils
()
Clone or pull the utils git repo into the apps path
Clone or pull the utils git repo into the apps path
[ "Clone", "or", "pull", "the", "utils", "git", "repo", "into", "the", "apps", "path" ]
def _update_utils(): ''' Clone or pull the utils git repo into the apps path ''' print('Resetting local changes') sudo('cd "%(dir)s" && git reset --hard && git clean -fd' % {'dir': os.path.join(TOOL_DIR, 'apps', 'utils')}) print('Updating code') sudo('cd "%(dir)s" && git pull origi...
[ "def", "_update_utils", "(", ")", ":", "print", "(", "'Resetting local changes'", ")", "sudo", "(", "'cd \"%(dir)s\" && git reset --hard && git clean -fd'", "%", "{", "'dir'", ":", "os", ".", "path", ".", "join", "(", "TOOL_DIR", ",", "'apps'", ",", "'utils'", "...
https://github.com/cluebotng/cluebotng/blob/2ed38a518c1019f6b7b03e33b487f96f8df617b0/fabfile.py#L126-L135
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
CheckForNonConstReference
(filename, clean_lines, linenum, nesting_state, error)
Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A...
Check for non-const references.
[ "Check", "for", "non", "-", "const", "references", "." ]
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean...
[ "def", "CheckForNonConstReference", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Do nothing if there is no '&' on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "'&'", "n...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L5013-L5149
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__reversed__
(self)
od.__reversed__() <==> reversed(od)
od.__reversed__() <==> reversed(od)
[ "od", ".", "__reversed__", "()", "<", "==", ">", "reversed", "(", "od", ")" ]
def __reversed__(self): 'od.__reversed__() <==> reversed(od)' root = self.__root curr = root[0] while curr is not root: yield curr[2] curr = curr[0]
[ "def", "__reversed__", "(", "self", ")", ":", "root", "=", "self", ".", "__root", "curr", "=", "root", "[", "0", "]", "while", "curr", "is", "not", "root", ":", "yield", "curr", "[", "2", "]", "curr", "=", "curr", "[", "0", "]" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/ordered_dict.py#L98-L104
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/ert/ves.py
python
VESModelling.drawData
(self, ax, data, error=None, label=None, **kwargs)
r"""Draw modeled apparent resistivity data. Parameters ---------- ax: axes Matplotlib axes object to draw into. data: iterable Apparent resistivity values to draw. error: iterable [None] Adds an error bar if you have error values. l...
r"""Draw modeled apparent resistivity data.
[ "r", "Draw", "modeled", "apparent", "resistivity", "data", "." ]
def drawData(self, ax, data, error=None, label=None, **kwargs): r"""Draw modeled apparent resistivity data. Parameters ---------- ax: axes Matplotlib axes object to draw into. data: iterable Apparent resistivity values to draw. error: iterable [...
[ "def", "drawData", "(", "self", ",", "ax", ",", "data", ",", "error", "=", "None", ",", "label", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ab2", "=", "kwargs", ".", "pop", "(", "'ab2'", ",", "self", ".", "ab2", ")", "# mn2 = kwargs.pop('mn2'...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/ert/ves.py#L142-L200
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlDoc.isRef
(self, elem, attr)
return ret
Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase).
Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase).
[ "Determine", "whether", "an", "attribute", "is", "of", "type", "Ref", ".", "In", "case", "we", "have", "DTD", "(", "s", ")", "then", "this", "is", "simple", "otherwise", "we", "use", "an", "heuristic", ":", "name", "Ref", "(", "upper", "or", "lowercase...
def isRef(self, elem, attr): """Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase). """ if elem is None: elem__o = None else: elem__o = elem._o if attr is None: attr_...
[ "def", "isRef", "(", "self", ",", "elem", ",", "attr", ")", ":", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "if", "attr", "is", "None", ":", "attr__o", "=", "None", "else", ":", "attr_...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4622-L4631
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/treewizard.py
python
TreeWizard._index
(self, t, m)
Do the work for index
Do the work for index
[ "Do", "the", "work", "for", "index" ]
def _index(self, t, m): """Do the work for index""" if t is None: return ttype = self.adaptor.getType(t) elements = m.get(ttype) if elements is None: m[ttype] = elements = [] elements.append(t) for i in range(self.adaptor.getChildCount(t...
[ "def", "_index", "(", "self", ",", "t", ",", "m", ")", ":", "if", "t", "is", "None", ":", "return", "ttype", "=", "self", ".", "adaptor", ".", "getType", "(", "t", ")", "elements", "=", "m", ".", "get", "(", "ttype", ")", "if", "elements", "is"...
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/treewizard.py#L377-L391
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/util.py
python
convert_path
(pathname)
return os.path.join(*paths)
Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can ...
Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can ...
[ "Return", "pathname", "as", "a", "name", "that", "will", "work", "on", "the", "native", "filesystem", "i", ".", "e", ".", "split", "it", "on", "/", "and", "put", "it", "back", "together", "again", "using", "the", "current", "directory", "separator", ".",...
def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the...
[ "def", "convert_path", "(", "pathname", ")", ":", "if", "os", ".", "sep", "==", "'/'", ":", "return", "pathname", "if", "not", "pathname", ":", "return", "pathname", "if", "pathname", "[", "0", "]", "==", "'/'", ":", "raise", "ValueError", "(", "\"path...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/util.py#L109-L132
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
Tools/mavlink_px4.py
python
MAVLink.param_value_encode
(self, param_id, param_value, param_type, param_count, param_index)
return msg
Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. param_id ...
Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout.
[ "Emit", "the", "value", "of", "a", "onboard", "parameter", ".", "The", "inclusion", "of", "param_count", "and", "param_index", "in", "the", "message", "allows", "the", "recipient", "to", "keep", "track", "of", "received", "parameters", "and", "allows", "him", ...
def param_value_encode(self, param_id, param_value, param_type, param_count, param_index): ''' Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and ...
[ "def", "param_value_encode", "(", "self", ",", "param_id", ",", "param_value", ",", "param_type", ",", "param_count", ",", "param_index", ")", ":", "msg", "=", "MAVLink_param_value_message", "(", "param_id", ",", "param_value", ",", "param_type", ",", "param_count...
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L2731-L2747
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_xmcAlgorithm/checkInitialisation.py
python
checkInitialisationMLMC
(XMCAlgorithm)
Method checking all attributes of different classes are correctly set to run Multilevel Monte Carlo algorithm (both standard and asynchronous).
Method checking all attributes of different classes are correctly set to run Multilevel Monte Carlo algorithm (both standard and asynchronous).
[ "Method", "checking", "all", "attributes", "of", "different", "classes", "are", "correctly", "set", "to", "run", "Multilevel", "Monte", "Carlo", "algorithm", "(", "both", "standard", "and", "asynchronous", ")", "." ]
def checkInitialisationMLMC(XMCAlgorithm): """ Method checking all attributes of different classes are correctly set to run Multilevel Monte Carlo algorithm (both standard and asynchronous). """ solverWrapperDictionary = XMCAlgorithm.monteCarloSampler.indexConstructorDictionary[ "samplerInp...
[ "def", "checkInitialisationMLMC", "(", "XMCAlgorithm", ")", ":", "solverWrapperDictionary", "=", "XMCAlgorithm", ".", "monteCarloSampler", ".", "indexConstructorDictionary", "[", "\"samplerInputDictionary\"", "]", "[", "\"solverWrapperInputDictionary\"", "]", "positionMaxNumber...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_xmcAlgorithm/checkInitialisation.py#L24-L37
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/QT/Grid.py
python
Grid.__init__
(self, wParent, oColumnas, dicVideo=None, altoFila=20, siSelecFilas=False, siSeleccionMultiple=False, siLineas=True, siEditable=False, siCabeceraMovible=True, xid=None, background="", siCabeceraVisible=True, altoCabecera=None)
@param wParent: ventana propietaria @param oColumnas: configuracion de las columnas. @param altoFila: altura de todas las filas.
[]
def __init__(self, wParent, oColumnas, dicVideo=None, altoFila=20, siSelecFilas=False, siSeleccionMultiple=False, siLineas=True, siEditable=False, siCabeceraMovible=True, xid=None, background="", siCabeceraVisible=True, altoCabecera=None): """ @param wParent: ventana pr...
[ "def", "__init__", "(", "self", ",", "wParent", ",", "oColumnas", ",", "dicVideo", "=", "None", ",", "altoFila", "=", "20", ",", "siSelecFilas", "=", "False", ",", "siSeleccionMultiple", "=", "False", ",", "siLineas", "=", "True", ",", "siEditable", "=", ...
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/Grid.py#L217-L273
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
StatusBar.GetFields
(self)
return [self.GetStatusText(i) for i in range(self.GetFieldsCount())]
Return a list of field values in the status bar.
Return a list of field values in the status bar.
[ "Return", "a", "list", "of", "field", "values", "in", "the", "status", "bar", "." ]
def GetFields(self): """Return a list of field values in the status bar. """ return [self.GetStatusText(i) for i in range(self.GetFieldsCount())]
[ "def", "GetFields", "(", "self", ")", ":", "return", "[", "self", ".", "GetStatusText", "(", "i", ")", "for", "i", "in", "range", "(", "self", ".", "GetFieldsCount", "(", ")", ")", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1321-L1323
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListItemData.GetY
(self)
return self._rect.y
Returns the item `y` position.
Returns the item `y` position.
[ "Returns", "the", "item", "y", "position", "." ]
def GetY(self): """ Returns the item `y` position. """ return self._rect.y
[ "def", "GetY", "(", "self", ")", ":", "return", "self", ".", "_rect", ".", "y" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L3100-L3103
rampageX/firmware-mod-kit
c94cd6aeee50d92ec5280a6dba6d74828fd3606b
src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py
python
HashMatch.run
(self)
return True
Main module method.
Main module method.
[ "Main", "module", "method", "." ]
def run(self): ''' Main module method. ''' # Access the raw self.config.files list directly here, since we accept both # files and directories and self.next_file only works for files. needle = self.config.files[0] haystack = self.config.files[1:] self.hea...
[ "def", "run", "(", "self", ")", ":", "# Access the raw self.config.files list directly here, since we accept both", "# files and directories and self.next_file only works for files.", "needle", "=", "self", ".", "config", ".", "files", "[", "0", "]", "haystack", "=", "self", ...
https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py#L307-L328
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py
python
ServiceDescriptor.CopyToProto
(self, proto)
Copies this to a descriptor_pb2.ServiceDescriptorProto. Args: proto: An empty descriptor_pb2.ServiceDescriptorProto.
Copies this to a descriptor_pb2.ServiceDescriptorProto.
[ "Copies", "this", "to", "a", "descriptor_pb2", ".", "ServiceDescriptorProto", "." ]
def CopyToProto(self, proto): """Copies this to a descriptor_pb2.ServiceDescriptorProto. Args: proto: An empty descriptor_pb2.ServiceDescriptorProto. """ # This function is overridden to give a better doc comment. super(ServiceDescriptor, self).CopyToProto(proto)
[ "def", "CopyToProto", "(", "self", ",", "proto", ")", ":", "# This function is overridden to give a better doc comment.", "super", "(", "ServiceDescriptor", ",", "self", ")", ".", "CopyToProto", "(", "proto", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py#L744-L751
facebookarchive/LogDevice
ce7726050edc49a1e15d9160e81c890736b779e2
logdevice/ops/ldshell/logdevice_context.py
python
LDShellContext.on_connected
(self, *args, **kwargs)
Gets called after a connect() command is executed
Gets called after a connect() command is executed
[ "Gets", "called", "after", "a", "connect", "()", "command", "is", "executed" ]
def on_connected(self, *args, **kwargs): """ Gets called after a connect() command is executed """ with self._lock: self._reset_cache() if not self._should_we_be_connected(): cprint(self._get_disconnected_warning(), "yellow", file=sys.stderr) ...
[ "def", "on_connected", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "with", "self", ".", "_lock", ":", "self", ".", "_reset_cache", "(", ")", "if", "not", "self", ".", "_should_we_be_connected", "(", ")", ":", "cprint", "(", "sel...
https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/logdevice/ops/ldshell/logdevice_context.py#L160-L177
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py
python
Locator.get_errors
(self)
return result
Return any errors which have occurred.
Return any errors which have occurred.
[ "Return", "any", "errors", "which", "have", "occurred", "." ]
def get_errors(self): """ Return any errors which have occurred. """ result = [] while not self.errors.empty(): # pragma: no cover try: e = self.errors.get(False) result.append(e) except self.errors.Empty: c...
[ "def", "get_errors", "(", "self", ")", ":", "result", "=", "[", "]", "while", "not", "self", ".", "errors", ".", "empty", "(", ")", ":", "# pragma: no cover", "try", ":", "e", "=", "self", ".", "errors", ".", "get", "(", "False", ")", "result", "."...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py#L121-L133
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/mesh.py
python
Mesh.structured_iterate_hex_volumes
(self, order="zyx", **kw)
Get an iterator over the volumes of the mesh hexahedra See structured_iterate_hex() for an explanation of the order argument and the available keyword arguments.
Get an iterator over the volumes of the mesh hexahedra
[ "Get", "an", "iterator", "over", "the", "volumes", "of", "the", "mesh", "hexahedra" ]
def structured_iterate_hex_volumes(self, order="zyx", **kw): """Get an iterator over the volumes of the mesh hexahedra See structured_iterate_hex() for an explanation of the order argument and the available keyword arguments. """ self._structured_check() indices, _ = _s...
[ "def", "structured_iterate_hex_volumes", "(", "self", ",", "order", "=", "\"zyx\"", ",", "*", "*", "kw", ")", ":", "self", ".", "_structured_check", "(", ")", "indices", ",", "_", "=", "_structured_iter_setup", "(", "self", ".", "dims", ",", "order", ",", ...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mesh.py#L1404-L1422
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
concatenate
(arrays, axis=0)
return data
Concatenate a sequence of arrays along the given axis. Parameters ---------- arrays : sequence of array_like The arrays must have the same shape, except in the dimension corresponding to `axis` (the first, by default). axis : int, optional The axis along which the arrays will be...
Concatenate a sequence of arrays along the given axis.
[ "Concatenate", "a", "sequence", "of", "arrays", "along", "the", "given", "axis", "." ]
def concatenate(arrays, axis=0): """ Concatenate a sequence of arrays along the given axis. Parameters ---------- arrays : sequence of array_like The arrays must have the same shape, except in the dimension corresponding to `axis` (the first, by default). axis : int, optional ...
[ "def", "concatenate", "(", "arrays", ",", "axis", "=", "0", ")", ":", "d", "=", "np", ".", "concatenate", "(", "[", "getdata", "(", "a", ")", "for", "a", "in", "arrays", "]", ",", "axis", ")", "rcls", "=", "get_masked_subclass", "(", "*", "arrays",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L6827-L6884
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/version.py
python
suggest_normalized_version
(s)
return rs
Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given...
Suggest a normalized version close to the given version string.
[ "Suggest", "a", "normalized", "version", "close", "to", "the", "given", "version", "string", "." ]
def suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a nu...
[ "def", "suggest_normalized_version", "(", "s", ")", ":", "try", ":", "normalized_key", "(", "s", ")", "return", "s", "# already rational", "except", "UnsupportedVersionError", ":", "pass", "rs", "=", "s", ".", "lower", "(", ")", "# part of this could use maketrans...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/version.py#L420-L528
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
Grid.GetSelectionBackground
(*args, **kwargs)
return _grid.Grid_GetSelectionBackground(*args, **kwargs)
GetSelectionBackground(self) -> Colour
GetSelectionBackground(self) -> Colour
[ "GetSelectionBackground", "(", "self", ")", "-", ">", "Colour" ]
def GetSelectionBackground(*args, **kwargs): """GetSelectionBackground(self) -> Colour""" return _grid.Grid_GetSelectionBackground(*args, **kwargs)
[ "def", "GetSelectionBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetSelectionBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L2093-L2095
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/utils/prune.py
python
global_unstructured
(parameters, pruning_method, importance_scores=None, **kwargs)
r""" Globally prunes tensors corresponding to all parameters in ``parameters`` by applying the specified ``pruning_method``. Modifies modules in place by: 1) adding a named buffer called ``name+'_mask'`` corresponding to the binary mask applied to the parameter ``name`` by the pruning method. ...
r""" Globally prunes tensors corresponding to all parameters in ``parameters`` by applying the specified ``pruning_method``. Modifies modules in place by:
[ "r", "Globally", "prunes", "tensors", "corresponding", "to", "all", "parameters", "in", "parameters", "by", "applying", "the", "specified", "pruning_method", ".", "Modifies", "modules", "in", "place", "by", ":" ]
def global_unstructured(parameters, pruning_method, importance_scores=None, **kwargs): r""" Globally prunes tensors corresponding to all parameters in ``parameters`` by applying the specified ``pruning_method``. Modifies modules in place by: 1) adding a named buffer called ``name+'_mask'`` correspo...
[ "def", "global_unstructured", "(", "parameters", ",", "pruning_method", ",", "importance_scores", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# ensure parameters is a list or generator of tuples", "if", "not", "isinstance", "(", "parameters", ",", "Iterable", ")"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/utils/prune.py#L1011-L1128
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/iostream.py
python
BaseIOStream.read_until_close
(self)
return future
Asynchronously reads all data from the socket until it is closed. This will buffer all available data until ``max_buffer_size`` is reached. If flow control or cancellation are desired, use a loop with `read_bytes(partial=True) <.read_bytes>` instead. .. versionchanged:: 4.0 ...
Asynchronously reads all data from the socket until it is closed.
[ "Asynchronously", "reads", "all", "data", "from", "the", "socket", "until", "it", "is", "closed", "." ]
def read_until_close(self) -> Awaitable[bytes]: """Asynchronously reads all data from the socket until it is closed. This will buffer all available data until ``max_buffer_size`` is reached. If flow control or cancellation are desired, use a loop with `read_bytes(partial=True) <.read_by...
[ "def", "read_until_close", "(", "self", ")", "->", "Awaitable", "[", "bytes", "]", ":", "future", "=", "self", ".", "_start_read", "(", ")", "if", "self", ".", "closed", "(", ")", ":", "self", ".", "_finish_read", "(", "self", ".", "_read_buffer_size", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/iostream.py#L481-L509
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/net_configs.py
python
GetNetConfig
(key)
return _NET_CONFIGS[key]
Returns the NetConfig object corresponding to the given |key|.
Returns the NetConfig object corresponding to the given |key|.
[ "Returns", "the", "NetConfig", "object", "corresponding", "to", "the", "given", "|key|", "." ]
def GetNetConfig(key): """Returns the NetConfig object corresponding to the given |key|.""" if key not in _NET_CONFIGS: raise KeyError('No net config with key: %s' % key) return _NET_CONFIGS[key]
[ "def", "GetNetConfig", "(", "key", ")", ":", "if", "key", "not", "in", "_NET_CONFIGS", ":", "raise", "KeyError", "(", "'No net config with key: %s'", "%", "key", ")", "return", "_NET_CONFIGS", "[", "key", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/net_configs.py#L44-L48
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py
python
Output.encoding
(self)
Return the encoding for this output, e.g. 'utf-8'. (This is used mainly to know which characters are supported by the output the data, so that the UI can provide alternatives, when required.)
Return the encoding for this output, e.g. 'utf-8'. (This is used mainly to know which characters are supported by the output the data, so that the UI can provide alternatives, when required.)
[ "Return", "the", "encoding", "for", "this", "output", "e", ".", "g", ".", "utf", "-", "8", ".", "(", "This", "is", "used", "mainly", "to", "know", "which", "characters", "are", "supported", "by", "the", "output", "the", "data", "so", "that", "the", "...
def encoding(self): """ Return the encoding for this output, e.g. 'utf-8'. (This is used mainly to know which characters are supported by the output the data, so that the UI can provide alternatives, when required.) """
[ "def", "encoding", "(", "self", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py#L28-L34
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_concept_space.py
python
p_terms_terms_term
(p)
terms : terms COMMA term
terms : terms COMMA term
[ "terms", ":", "terms", "COMMA", "term" ]
def p_terms_terms_term(p): 'terms : terms COMMA term' p[0] = p[1] p[0].append(p[3])
[ "def", "p_terms_terms_term", "(", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "p", "[", "0", "]", ".", "append", "(", "p", "[", "3", "]", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_concept_space.py#L146-L149
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/_parseaddr.py
python
AddrlistClass.getaddrlist
(self)
return result
Parse all addresses. Returns a list containing all of the addresses.
Parse all addresses.
[ "Parse", "all", "addresses", "." ]
def getaddrlist(self): """Parse all addresses. Returns a list containing all of the addresses. """ result = [] while self.pos < len(self.field): ad = self.getaddress() if ad: result += ad else: result.append((''...
[ "def", "getaddrlist", "(", "self", ")", ":", "result", "=", "[", "]", "while", "self", ".", "pos", "<", "len", "(", "self", ".", "field", ")", ":", "ad", "=", "self", ".", "getaddress", "(", ")", "if", "ad", ":", "result", "+=", "ad", "else", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/_parseaddr.py#L211-L223
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/vision/py_transforms_util.py
python
horizontal_flip
(img)
return img.transpose(Image.FLIP_LEFT_RIGHT)
Flip the input image horizontally. Args: img (PIL image): Image to be flipped horizontally. Returns: img (PIL image), Horizontally flipped image.
Flip the input image horizontally.
[ "Flip", "the", "input", "image", "horizontally", "." ]
def horizontal_flip(img): """ Flip the input image horizontally. Args: img (PIL image): Image to be flipped horizontally. Returns: img (PIL image), Horizontally flipped image. """ if not is_pil(img): raise TypeError(augment_error_message.format(type(img))) return i...
[ "def", "horizontal_flip", "(", "img", ")", ":", "if", "not", "is_pil", "(", "img", ")", ":", "raise", "TypeError", "(", "augment_error_message", ".", "format", "(", "type", "(", "img", ")", ")", ")", "return", "img", ".", "transpose", "(", "Image", "."...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms_util.py#L175-L188
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py
python
extract_audio
( video_source_filename, audio_id=128, verbose_flag=0, dry_run_flag=0)
This extracts the given audio_id track as raw uncompressed PCM from the given source video. Note that mplayer always saves this to audiodump.wav. At this time there is no way to set the output audio name.
This extracts the given audio_id track as raw uncompressed PCM from the given source video. Note that mplayer always saves this to audiodump.wav. At this time there is no way to set the output audio name.
[ "This", "extracts", "the", "given", "audio_id", "track", "as", "raw", "uncompressed", "PCM", "from", "the", "given", "source", "video", ".", "Note", "that", "mplayer", "always", "saves", "this", "to", "audiodump", ".", "wav", ".", "At", "this", "time", "th...
def extract_audio( video_source_filename, audio_id=128, verbose_flag=0, dry_run_flag=0): """This extracts the given audio_id track as raw uncompressed PCM from the given source video. Note that mplayer always saves this to audiodump.wav. At this time there is no way t...
[ "def", "extract_audio", "(", "video_source_filename", ",", "audio_id", "=", "128", ",", "verbose_flag", "=", "0", ",", "dry_run_flag", "=", "0", ")", ":", "#cmd = \"mplayer %(video_source_filename)s -vc null -vo null -aid %(audio_id)s -ao pcm:fast -noframedrop\" % locals()", "c...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py#L494-L509
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/PSDraw.py
python
PSDraw.setfont
(self, font, size)
Selects which font to use. :param font: A Postscript font name :param size: Size in points.
Selects which font to use.
[ "Selects", "which", "font", "to", "use", "." ]
def setfont(self, font, size): """ Selects which font to use. :param font: A Postscript font name :param size: Size in points. """ if font not in self.isofont: # reencode font self._fp_write("/PSDraw-{} ISOLatin1Encoding /{} E\n".format(font, font...
[ "def", "setfont", "(", "self", ",", "font", ",", "size", ")", ":", "if", "font", "not", "in", "self", ".", "isofont", ":", "# reencode font", "self", ".", "_fp_write", "(", "\"/PSDraw-{} ISOLatin1Encoding /{} E\\n\"", ".", "format", "(", "font", ",", "font",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/PSDraw.py#L65-L77
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py
python
build_specfile
(target, source, env)
Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes.
Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes.
[ "Builds", "a", "RPM", "specfile", "from", "a", "dictionary", "with", "string", "metadata", "and", "by", "analyzing", "a", "tree", "of", "nodes", "." ]
def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ file = open(target[0].get_abspath(), 'w') try: file.write( build_specfile_header(env) ) file.write( build_specfile_sections(env) ) ...
[ "def", "build_specfile", "(", "target", ",", "source", ",", "env", ")", ":", "file", "=", "open", "(", "target", "[", "0", "]", ".", "get_abspath", "(", ")", ",", "'w'", ")", "try", ":", "file", ".", "write", "(", "build_specfile_header", "(", "env",...
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/packaging/rpm.py#L123-L140
projectchrono/chrono
92015a8a6f84ef63ac8206a74e54a676251dcc89
src/demos/python/chrono-tensorflow/PPO/utils.py
python
Scaler.__init__
(self, obs_dim, env_name)
Args: obs_dim: dimension of axis=1
Args: obs_dim: dimension of axis=1
[ "Args", ":", "obs_dim", ":", "dimension", "of", "axis", "=", "1" ]
def __init__(self, obs_dim, env_name): """ Args: obs_dim: dimension of axis=1 """ self.env_name = env_name self.vars = np.zeros(obs_dim) self.means = np.zeros(obs_dim) self.m = 0 self.n = 0 self.first_pass = True
[ "def", "__init__", "(", "self", ",", "obs_dim", ",", "env_name", ")", ":", "self", ".", "env_name", "=", "env_name", "self", ".", "vars", "=", "np", ".", "zeros", "(", "obs_dim", ")", "self", ".", "means", "=", "np", ".", "zeros", "(", "obs_dim", "...
https://github.com/projectchrono/chrono/blob/92015a8a6f84ef63ac8206a74e54a676251dcc89/src/demos/python/chrono-tensorflow/PPO/utils.py#L19-L29
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
RemoveMultiLineCommentsFromRange
(lines, begin, end)
Clears a range of lines for multi-line comments.
Clears a range of lines for multi-line comments.
[ "Clears", "a", "range", "of", "lines", "for", "multi", "-", "line", "comments", "." ]
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '/**/'
[ "def", "RemoveMultiLineCommentsFromRange", "(", "lines", ",", "begin", ",", "end", ")", ":", "# Having // dummy comments makes the lines non-empty, so we will not get", "# unnecessary blank line warnings later in the code.", "for", "i", "in", "range", "(", "begin", ",", "end", ...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1384-L1389
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
llvm/bindings/python/llvm/object.py
python
Section.address
(self)
return lib.LLVMGetSectionAddress(self)
The address of this section, in long bytes.
The address of this section, in long bytes.
[ "The", "address", "of", "this", "section", "in", "long", "bytes", "." ]
def address(self): """The address of this section, in long bytes.""" if self.expired: raise Exception('Section instance has expired.') return lib.LLVMGetSectionAddress(self)
[ "def", "address", "(", "self", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Section instance has expired.'", ")", "return", "lib", ".", "LLVMGetSectionAddress", "(", "self", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/bindings/python/llvm/object.py#L224-L229
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_vim.py
python
EditraCommander.JoinLines
(self, repeat)
Join lines into a single line. @param repeat: number of lines below the current line to join with
Join lines into a single line. @param repeat: number of lines below the current line to join with
[ "Join", "lines", "into", "a", "single", "line", ".", "@param", "repeat", ":", "number", "of", "lines", "below", "the", "current", "line", "to", "join", "with" ]
def JoinLines(self, repeat): """Join lines into a single line. @param repeat: number of lines below the current line to join with """ self.SelectLines(repeat) self.stc.LinesJoinSelected()
[ "def", "JoinLines", "(", "self", ",", "repeat", ")", ":", "self", ".", "SelectLines", "(", "repeat", ")", "self", ".", "stc", ".", "LinesJoinSelected", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L687-L693
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py
python
Regex.__init__
( self, pattern, flags=0)
The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.
The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.
[ "The", "parameters", "C", "{", "pattern", "}", "and", "C", "{", "flags", "}", "are", "passed", "to", "the", "C", "{", "re", ".", "compile", "()", "}", "function", "as", "-", "is", ".", "See", "the", "Python", "C", "{", "re", "}", "module", "for",...
def __init__( self, pattern, flags=0): """The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.""" super(Regex,self).__init__() if isinstance(pattern, basestring): ...
[ "def", "__init__", "(", "self", ",", "pattern", ",", "flags", "=", "0", ")", ":", "super", "(", "Regex", ",", "self", ")", ".", "__init__", "(", ")", "if", "isinstance", "(", "pattern", ",", "basestring", ")", ":", "if", "not", "pattern", ":", "war...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L2779-L2811
abyzovlab/CNVnator
c73786d6160f17b020feae928148533ca036fad2
pytools/io.py
python
IO.signal_name
(self, chr, bin_size, signal, flags=FLAG_USEMASK | FLAG_GC_CORR)
return self.signals[signal] % {"chr": chr, "bin_size": bin_size, "rd_flag": self.sufix_rd_flag(flags), "snp_flag": self.sufix_snp_flag(flags), "flag": self.sufix_flag(flags)}
Returns TH1 or TH2 name for signal
Returns TH1 or TH2 name for signal
[ "Returns", "TH1", "or", "TH2", "name", "for", "signal" ]
def signal_name(self, chr, bin_size, signal, flags=FLAG_USEMASK | FLAG_GC_CORR): """Returns TH1 or TH2 name for signal""" return self.signals[signal] % {"chr": chr, "bin_size": bin_size, "rd_flag": self.sufix_rd_flag(flags), "snp_flag": self.sufix_snp_flag(flags), ...
[ "def", "signal_name", "(", "self", ",", "chr", ",", "bin_size", ",", "signal", ",", "flags", "=", "FLAG_USEMASK", "|", "FLAG_GC_CORR", ")", ":", "return", "self", ".", "signals", "[", "signal", "]", "%", "{", "\"chr\"", ":", "chr", ",", "\"bin_size\"", ...
https://github.com/abyzovlab/CNVnator/blob/c73786d6160f17b020feae928148533ca036fad2/pytools/io.py#L98-L101
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/ciconfig/evergreen.py
python
Task.generated_task_name
(self)
return self.name[:-4]
Get basename of the tasks generated by this _gen task. :return: Basename of the generated tasks.
Get basename of the tasks generated by this _gen task.
[ "Get", "basename", "of", "the", "tasks", "generated", "by", "this", "_gen", "task", "." ]
def generated_task_name(self): """ Get basename of the tasks generated by this _gen task. :return: Basename of the generated tasks. """ if not self.is_generate_resmoke_task: raise TypeError("Only _gen tasks can have generated task names") return self.name[:-...
[ "def", "generated_task_name", "(", "self", ")", ":", "if", "not", "self", ".", "is_generate_resmoke_task", ":", "raise", "TypeError", "(", "\"Only _gen tasks can have generated task names\"", ")", "return", "self", ".", "name", "[", ":", "-", "4", "]" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/ciconfig/evergreen.py#L153-L162
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/gen.py
python
FunctionCall
(pyname, wrapper, doc, catch, call, postcall_init, typepostconversion, func_ast, lineno, prepend_self=None)
Generate PyCFunction wrapper from AST.FuncDecl func_ast. Args: pyname: str - Python function name (may be special: ends with @) wrapper: str - generated function name doc: str - C++ signature catch: bool - catch C++ exceptions call: str | [str] - C++ command(s) to call the wrapped function ...
Generate PyCFunction wrapper from AST.FuncDecl func_ast.
[ "Generate", "PyCFunction", "wrapper", "from", "AST", ".", "FuncDecl", "func_ast", "." ]
def FunctionCall(pyname, wrapper, doc, catch, call, postcall_init, typepostconversion, func_ast, lineno, prepend_self=None): """Generate PyCFunction wrapper from AST.FuncDecl func_ast. Args: pyname: str - Python function name (may be special: ends with @) wrapper: str - generated function ...
[ "def", "FunctionCall", "(", "pyname", ",", "wrapper", ",", "doc", ",", "catch", ",", "call", ",", "postcall_init", ",", "typepostconversion", ",", "func_ast", ",", "lineno", ",", "prepend_self", "=", "None", ")", ":", "ctxmgr", "=", "pyname", ".", "endswit...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/gen.py#L605-L890
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/function_deserialization.py
python
recreate_function
(saved_function, concrete_functions)
return tf_decorator.make_decorator( restored_function_body, restored_function, decorator_argspec=function_spec.fullargspec)
Creates a `Function` from a `SavedFunction`. Args: saved_function: `SavedFunction` proto. concrete_functions: map from function name to `ConcreteFunction`. Returns: A `Function`.
Creates a `Function` from a `SavedFunction`.
[ "Creates", "a", "Function", "from", "a", "SavedFunction", "." ]
def recreate_function(saved_function, concrete_functions): """Creates a `Function` from a `SavedFunction`. Args: saved_function: `SavedFunction` proto. concrete_functions: map from function name to `ConcreteFunction`. Returns: A `Function`. """ # TODO(andresp): Construct a `Function` with the ca...
[ "def", "recreate_function", "(", "saved_function", ",", "concrete_functions", ")", ":", "# TODO(andresp): Construct a `Function` with the cache populated", "# instead of creating a new `Function` backed by a Python layer to", "# glue things together. Current approach is nesting functions deeper ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/function_deserialization.py#L198-L277
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Sizer.RecalcSizes
(*args, **kwargs)
return _core_.Sizer_RecalcSizes(*args, **kwargs)
RecalcSizes(self) Using the sizes calculated by `CalcMin` reposition and resize all the items managed by this sizer. You should not need to call this directly as it is called by `Layout`.
RecalcSizes(self)
[ "RecalcSizes", "(", "self", ")" ]
def RecalcSizes(*args, **kwargs): """ RecalcSizes(self) Using the sizes calculated by `CalcMin` reposition and resize all the items managed by this sizer. You should not need to call this directly as it is called by `Layout`. """ return _core_.Sizer_RecalcSizes(...
[ "def", "RecalcSizes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Sizer_RecalcSizes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L14815-L14823
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xpathContext.xpathRegisteredNsCleanup
(self)
Cleanup the XPath context data associated to registered variables
Cleanup the XPath context data associated to registered variables
[ "Cleanup", "the", "XPath", "context", "data", "associated", "to", "registered", "variables" ]
def xpathRegisteredNsCleanup(self): """Cleanup the XPath context data associated to registered variables """ libxml2mod.xmlXPathRegisteredNsCleanup(self._o)
[ "def", "xpathRegisteredNsCleanup", "(", "self", ")", ":", "libxml2mod", ".", "xmlXPathRegisteredNsCleanup", "(", "self", ".", "_o", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6595-L6598
synfig/synfig
a5ec91db5b751dc12e4400ccfb5c063fd6d2d928
synfig-studio/plugins/lottie-exporter/common/Layer.py
python
Layer.get_param
(self, *keys)
return Param(None, None)
Given a key, this will return the address of the child corresponding to it If multiple keys are given, it will return the key found first
Given a key, this will return the address of the child corresponding to it If multiple keys are given, it will return the key found first
[ "Given", "a", "key", "this", "will", "return", "the", "address", "of", "the", "child", "corresponding", "to", "it", "If", "multiple", "keys", "are", "given", "it", "will", "return", "the", "key", "found", "first" ]
def get_param(self, *keys): """ Given a key, this will return the address of the child corresponding to it If multiple keys are given, it will return the key found first """ for key in keys: if key in self.params.keys(): return self.params[key]...
[ "def", "get_param", "(", "self", ",", "*", "keys", ")", ":", "for", "key", "in", "keys", ":", "if", "key", "in", "self", ".", "params", ".", "keys", "(", ")", ":", "return", "self", ".", "params", "[", "key", "]", "return", "Param", "(", "None", ...
https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Layer.py#L83-L92
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/reductions/complex2real/atom_canonicalizers/matrix_canon.py
python
lambda_sum_largest_canon
(expr, real_args, imag_args, real2imag)
return real, imag
Canonicalize nuclear norm with Hermitian matrix input.
Canonicalize nuclear norm with Hermitian matrix input.
[ "Canonicalize", "nuclear", "norm", "with", "Hermitian", "matrix", "input", "." ]
def lambda_sum_largest_canon(expr, real_args, imag_args, real2imag): """Canonicalize nuclear norm with Hermitian matrix input. """ # Divide by two because each eigenvalue is repeated twice. real, imag = hermitian_canon(expr, real_args, imag_args, real2imag) real.k *= 2 if imag_args[0] is not Non...
[ "def", "lambda_sum_largest_canon", "(", "expr", ",", "real_args", ",", "imag_args", ",", "real2imag", ")", ":", "# Divide by two because each eigenvalue is repeated twice.", "real", ",", "imag", "=", "hermitian_canon", "(", "expr", ",", "real_args", ",", "imag_args", ...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/reductions/complex2real/atom_canonicalizers/matrix_canon.py#L52-L60
wang-bin/QtAV
3b937991afce248648836ae811324d4051b31def
python/configure.py
python
_TargetConfiguration.get_qt_configuration
(self, opts)
Get the Qt configuration that can be extracted from qmake. opts are the command line options.
Get the Qt configuration that can be extracted from qmake. opts are the command line options.
[ "Get", "the", "Qt", "configuration", "that", "can", "be", "extracted", "from", "qmake", ".", "opts", "are", "the", "command", "line", "options", "." ]
def get_qt_configuration(self, opts): """ Get the Qt configuration that can be extracted from qmake. opts are the command line options. """ # Query qmake. qt_config = _TargetQtConfiguration(self.qmake) self.qt_version_str = getattr(qt_config, 'QT_VERSION', '') ...
[ "def", "get_qt_configuration", "(", "self", ",", "opts", ")", ":", "# Query qmake.", "qt_config", "=", "_TargetQtConfiguration", "(", "self", ".", "qmake", ")", "self", ".", "qt_version_str", "=", "getattr", "(", "qt_config", ",", "'QT_VERSION'", ",", "''", ")...
https://github.com/wang-bin/QtAV/blob/3b937991afce248648836ae811324d4051b31def/python/configure.py#L958-L1008
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/psutil/psutil/_psbsd.py
python
Process.get_process_uids
(self)
return nt_uids(real, effective, saved)
Return real, effective and saved user ids.
Return real, effective and saved user ids.
[ "Return", "real", "effective", "and", "saved", "user", "ids", "." ]
def get_process_uids(self): """Return real, effective and saved user ids.""" real, effective, saved = _psutil_bsd.get_process_uids(self.pid) return nt_uids(real, effective, saved)
[ "def", "get_process_uids", "(", "self", ")", ":", "real", ",", "effective", ",", "saved", "=", "_psutil_bsd", ".", "get_process_uids", "(", "self", ".", "pid", ")", "return", "nt_uids", "(", "real", ",", "effective", ",", "saved", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/_psbsd.py#L235-L238
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/plan/rigidobjectcspace.py
python
RigidObjectCSpace.__init__
(self,rigidObject,collider=None,translationDomain=None,rotationDomain=None)
Args: rigidObject (RigidObjectModel): the object that should move. collider (:class:`WorldCollider`, optional): a collider instance containing the world in which the object lives. Any ignored collisions will be respected in the feasibility test. trans...
Args: rigidObject (RigidObjectModel): the object that should move. collider (:class:`WorldCollider`, optional): a collider instance containing the world in which the object lives. Any ignored collisions will be respected in the feasibility test. trans...
[ "Args", ":", "rigidObject", "(", "RigidObjectModel", ")", ":", "the", "object", "that", "should", "move", ".", "collider", "(", ":", "class", ":", "WorldCollider", "optional", ")", ":", "a", "collider", "instance", "containing", "the", "world", "in", "which"...
def __init__(self,rigidObject,collider=None,translationDomain=None,rotationDomain=None): """ Args: rigidObject (RigidObjectModel): the object that should move. collider (:class:`WorldCollider`, optional): a collider instance containing the world in which the objec...
[ "def", "__init__", "(", "self", ",", "rigidObject", ",", "collider", "=", "None", ",", "translationDomain", "=", "None", ",", "rotationDomain", "=", "None", ")", ":", "CSpace", ".", "__init__", "(", "self", ")", "self", ".", "rigidObject", "=", "rigidObjec...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/rigidobjectcspace.py#L21-L71
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/utils/lui/lldbutil.py
python
run_break_set_by_regexp
( test, regexp, extra_options=None, num_expected_locations=-1)
return get_bpno_from_match(break_results)
Set a breakpoint by regular expression match on symbol name. Common options are the same as run_break_set_by_file_and_line.
Set a breakpoint by regular expression match on symbol name. Common options are the same as run_break_set_by_file_and_line.
[ "Set", "a", "breakpoint", "by", "regular", "expression", "match", "on", "symbol", "name", ".", "Common", "options", "are", "the", "same", "as", "run_break_set_by_file_and_line", "." ]
def run_break_set_by_regexp( test, regexp, extra_options=None, num_expected_locations=-1): """Set a breakpoint by regular expression match on symbol name. Common options are the same as run_break_set_by_file_and_line.""" command = 'breakpoint set -r "%s"' % (regexp) if extr...
[ "def", "run_break_set_by_regexp", "(", "test", ",", "regexp", ",", "extra_options", "=", "None", ",", "num_expected_locations", "=", "-", "1", ")", ":", "command", "=", "'breakpoint set -r \"%s\"'", "%", "(", "regexp", ")", "if", "extra_options", ":", "command",...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/utils/lui/lldbutil.py#L438-L456
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/signal/python/ops/mel_ops.py
python
_validate_arguments
(num_mel_bins, num_spectrogram_bins, sample_rate, lower_edge_hertz, upper_edge_hertz, dtype)
Checks the inputs to linear_to_mel_weight_matrix.
Checks the inputs to linear_to_mel_weight_matrix.
[ "Checks", "the", "inputs", "to", "linear_to_mel_weight_matrix", "." ]
def _validate_arguments(num_mel_bins, num_spectrogram_bins, sample_rate, lower_edge_hertz, upper_edge_hertz, dtype): """Checks the inputs to linear_to_mel_weight_matrix.""" if num_mel_bins <= 0: raise ValueError('num_mel_bins must be positive. Got: %s' % num_mel_bins) if num_spectrogra...
[ "def", "_validate_arguments", "(", "num_mel_bins", ",", "num_spectrogram_bins", ",", "sample_rate", ",", "lower_edge_hertz", ",", "upper_edge_hertz", ",", "dtype", ")", ":", "if", "num_mel_bins", "<=", "0", ":", "raise", "ValueError", "(", "'num_mel_bins must be posit...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/signal/python/ops/mel_ops.py#L67-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/six.py
python
add_move
(move)
Add an item to six.moves.
Add an item to six.moves.
[ "Add", "an", "item", "to", "six", ".", "moves", "." ]
def add_move(move): """Add an item to six.moves.""" setattr(_MovedItems, move.name, move)
[ "def", "add_move", "(", "move", ")", ":", "setattr", "(", "_MovedItems", ",", "move", ".", "name", ",", "move", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/six.py#L470-L472
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/tclib.py
python
BaseMessage.GetContent
(self)
return self.parts
Returns the parts of the message. You may modify parts if you wish. Note that you must not call GetId() on this object until you have finished modifying the contents.
Returns the parts of the message. You may modify parts if you wish. Note that you must not call GetId() on this object until you have finished modifying the contents.
[ "Returns", "the", "parts", "of", "the", "message", ".", "You", "may", "modify", "parts", "if", "you", "wish", ".", "Note", "that", "you", "must", "not", "call", "GetId", "()", "on", "this", "object", "until", "you", "have", "finished", "modifying", "the"...
def GetContent(self): '''Returns the parts of the message. You may modify parts if you wish. Note that you must not call GetId() on this object until you have finished modifying the contents. ''' self.dirty = True # user might modify content return self.parts
[ "def", "GetContent", "(", "self", ")", ":", "self", ".", "dirty", "=", "True", "# user might modify content", "return", "self", ".", "parts" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tclib.py#L125-L131
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
integrations/tensorflow/python_projects/iree_tf/iree/tf/support/trace_utils.py
python
ModuleCall.get_tolerances
(self)
return self.rtol, self.atol
Gets the floating point tolerances associated with this call.
Gets the floating point tolerances associated with this call.
[ "Gets", "the", "floating", "point", "tolerances", "associated", "with", "this", "call", "." ]
def get_tolerances(self) -> Tuple[float, float]: """Gets the floating point tolerances associated with this call.""" return self.rtol, self.atol
[ "def", "get_tolerances", "(", "self", ")", "->", "Tuple", "[", "float", ",", "float", "]", ":", "return", "self", ".", "rtol", ",", "self", ".", "atol" ]
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/python_projects/iree_tf/iree/tf/support/trace_utils.py#L72-L74
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py
python
RegistryInfo.windows_kits_roots
(self)
return r'Windows Kits\Installed Roots'
Microsoft Windows Kits Roots registry key.
Microsoft Windows Kits Roots registry key.
[ "Microsoft", "Windows", "Kits", "Roots", "registry", "key", "." ]
def windows_kits_roots(self): """ Microsoft Windows Kits Roots registry key. """ return r'Windows Kits\Installed Roots'
[ "def", "windows_kits_roots", "(", "self", ")", ":", "return", "r'Windows Kits\\Installed Roots'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py#L406-L410
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/ffmpeg/ffmpeg_ops.py
python
_decode_audio_shape
(op)
return [tensor_shape.TensorShape([None, channels])]
Computes the shape of a DecodeAudio operation. Args: op: A DecodeAudio operation. Returns: A list of output shapes. There's exactly one output, the sampled audio. This is a rank 2 tensor with an unknown number of samples and a known number of channels.
Computes the shape of a DecodeAudio operation.
[ "Computes", "the", "shape", "of", "a", "DecodeAudio", "operation", "." ]
def _decode_audio_shape(op): """Computes the shape of a DecodeAudio operation. Args: op: A DecodeAudio operation. Returns: A list of output shapes. There's exactly one output, the sampled audio. This is a rank 2 tensor with an unknown number of samples and a known number of channels. """ try...
[ "def", "_decode_audio_shape", "(", "op", ")", ":", "try", ":", "channels", "=", "op", ".", "get_attr", "(", "'channel_count'", ")", "except", "ValueError", ":", "channels", "=", "None", "return", "[", "tensor_shape", ".", "TensorShape", "(", "[", "None", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/ffmpeg/ffmpeg_ops.py#L32-L47
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/leg_controller.py
python
LegController.get_action
(self)
Gets the control signal e.g. torques/positions for the leg.
Gets the control signal e.g. torques/positions for the leg.
[ "Gets", "the", "control", "signal", "e", ".", "g", ".", "torques", "/", "positions", "for", "the", "leg", "." ]
def get_action(self) -> Any: """Gets the control signal e.g. torques/positions for the leg.""" pass
[ "def", "get_action", "(", "self", ")", "->", "Any", ":", "pass" ]
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/leg_controller.py#L27-L29
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
llvm/utils/lint/common_lint.py
python
VerifyTrailingWhitespace
(filename, lines)
return lint
Checks to make sure the file has no lines with trailing whitespace. Args: filename: the file under consideration as string lines: contents of the file as string array Returns: A list of tuples with format [(filename, line number, msg), ...] with any violations found.
Checks to make sure the file has no lines with trailing whitespace.
[ "Checks", "to", "make", "sure", "the", "file", "has", "no", "lines", "with", "trailing", "whitespace", "." ]
def VerifyTrailingWhitespace(filename, lines): """Checks to make sure the file has no lines with trailing whitespace. Args: filename: the file under consideration as string lines: contents of the file as string array Returns: A list of tuples with format [(filename, line number, msg), ...] with any ...
[ "def", "VerifyTrailingWhitespace", "(", "filename", ",", "lines", ")", ":", "lint", "=", "[", "]", "trailing_whitespace_re", "=", "re", ".", "compile", "(", "r'\\s+$'", ")", "line_num", "=", "1", "for", "line", "in", "lines", ":", "if", "trailing_whitespace_...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/llvm/utils/lint/common_lint.py#L52-L70
commaai/openpilot
4416c21b1e738ab7d04147c5ae52b5135e0cdb40
pyextra/acados_template/acados_ocp.py
python
AcadosOcpOptions.hessian_approx
(self)
return self.__hessian_approx
Hessian approximation. String in ('GAUSS_NEWTON', 'EXACT'). Default: 'GAUSS_NEWTON'.
Hessian approximation. String in ('GAUSS_NEWTON', 'EXACT'). Default: 'GAUSS_NEWTON'.
[ "Hessian", "approximation", ".", "String", "in", "(", "GAUSS_NEWTON", "EXACT", ")", ".", "Default", ":", "GAUSS_NEWTON", "." ]
def hessian_approx(self): """Hessian approximation. String in ('GAUSS_NEWTON', 'EXACT'). Default: 'GAUSS_NEWTON'. """ return self.__hessian_approx
[ "def", "hessian_approx", "(", "self", ")", ":", "return", "self", ".", "__hessian_approx" ]
https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L2165-L2170
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L153-L155
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
PanedWindow.remove
(self, child)
Remove the pane containing child from the panedwindow All geometry management options for child will be forgotten.
Remove the pane containing child from the panedwindow
[ "Remove", "the", "pane", "containing", "child", "from", "the", "panedwindow" ]
def remove(self, child): """Remove the pane containing child from the panedwindow All geometry management options for child will be forgotten. """ self.tk.call(self._w, 'forget', child)
[ "def", "remove", "(", "self", ",", "child", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'forget'", ",", "child", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3825-L3830
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/data_flow_ops.py
python
Barrier.barrier_ref
(self)
return self._barrier_ref
Get the underlying barrier reference.
Get the underlying barrier reference.
[ "Get", "the", "underlying", "barrier", "reference", "." ]
def barrier_ref(self): """Get the underlying barrier reference.""" return self._barrier_ref
[ "def", "barrier_ref", "(", "self", ")", ":", "return", "self", ".", "_barrier_ref" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/data_flow_ops.py#L922-L924
ukoethe/vigra
093d57d15c8c237adf1704d96daa6393158ce299
vigranumpy/lib/arraytypes.py
python
ImagePyramid.__getitem__
(self, level)
return list.__getitem__(self, level - self.lowestLevel)
Get the image at 'level'. Raises IndexError when the level does not exist.
Get the image at 'level'. Raises IndexError when the level does not exist.
[ "Get", "the", "image", "at", "level", ".", "Raises", "IndexError", "when", "the", "level", "does", "not", "exist", "." ]
def __getitem__(self, level): '''Get the image at 'level'. Raises IndexError when the level does not exist. ''' if level < self.lowestLevel or level > self.highestLevel: raise IndexError("ImagePyramid[level]: level out of range.") return list.__getitem__(self, leve...
[ "def", "__getitem__", "(", "self", ",", "level", ")", ":", "if", "level", "<", "self", ".", "lowestLevel", "or", "level", ">", "self", ".", "highestLevel", ":", "raise", "IndexError", "(", "\"ImagePyramid[level]: level out of range.\"", ")", "return", "list", ...
https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L2003-L2009
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
categorical_column_with_vocabulary_file
(key, vocabulary_file, vocabulary_size=None, num_oov_buckets=0, default_value=None, dtype=dtypes.str...
return categorical_column_with_vocabulary_file_v2( key, vocabulary_file, vocabulary_size, dtype, default_value, num_oov_buckets)
A `CategoricalColumn` with a vocabulary file. Use this when your inputs are in string or integer format, and you have a vocabulary file that maps each value to an integer ID. By default, out-of-vocabulary values are ignored. Use either (but not both) of `num_oov_buckets` and `default_value` to specify how to i...
A `CategoricalColumn` with a vocabulary file.
[ "A", "CategoricalColumn", "with", "a", "vocabulary", "file", "." ]
def categorical_column_with_vocabulary_file(key, vocabulary_file, vocabulary_size=None, num_oov_buckets=0, default_value=None, ...
[ "def", "categorical_column_with_vocabulary_file", "(", "key", ",", "vocabulary_file", ",", "vocabulary_size", "=", "None", ",", "num_oov_buckets", "=", "0", ",", "default_value", "=", "None", ",", "dtype", "=", "dtypes", ".", "string", ")", ":", "return", "categ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L1475-L1562
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/vendored/six.py
python
with_metaclass
(meta, *bases)
return type.__new__(metaclass, 'temporary_class', (), {})
Create a base class with a metaclass.
Create a base class with a metaclass.
[ "Create", "a", "base", "class", "with", "a", "metaclass", "." ]
def with_metaclass(meta, *bases): """Create a base class with a metaclass.""" # This requires a bit of explanation: the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass(meta): def __new__(cls, na...
[ "def", "with_metaclass", "(", "meta", ",", "*", "bases", ")", ":", "# This requires a bit of explanation: the basic idea is to make a dummy", "# metaclass for one level of class instantiation that replaces itself with", "# the actual metaclass.", "class", "metaclass", "(", "meta", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/vendored/six.py#L800-L809
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/io/stata.py
python
StataReader.value_labels
(self)
return self.value_label_dict
Returns a dict, associating each variable name a dict, associating each value its corresponding label
Returns a dict, associating each variable name a dict, associating each value its corresponding label
[ "Returns", "a", "dict", "associating", "each", "variable", "name", "a", "dict", "associating", "each", "value", "its", "corresponding", "label" ]
def value_labels(self): """Returns a dict, associating each variable name a dict, associating each value its corresponding label """ if not self._value_labels_read: self._read_value_labels() return self.value_label_dict
[ "def", "value_labels", "(", "self", ")", ":", "if", "not", "self", ".", "_value_labels_read", ":", "self", ".", "_read_value_labels", "(", ")", "return", "self", ".", "value_label_dict" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/stata.py#L1738-L1745
apache/madlib
be297fe6beada0640f93317e8948834032718e32
src/madpack/madpack.py
python
_get_relative_maddir
(maddir, port)
Return a relative path version of maddir GPDB installations have a symlink outside of GPHOME that links to the current GPHOME. After a DB upgrade, this symlink is updated to the new GPHOME. 'maddir_lib', which uses the absolute path of GPHOME, is hardcoded into each madlib function definition. Rep...
Return a relative path version of maddir
[ "Return", "a", "relative", "path", "version", "of", "maddir" ]
def _get_relative_maddir(maddir, port): """ Return a relative path version of maddir GPDB installations have a symlink outside of GPHOME that links to the current GPHOME. After a DB upgrade, this symlink is updated to the new GPHOME. 'maddir_lib', which uses the absolute path of GPHOME, is hardcod...
[ "def", "_get_relative_maddir", "(", "maddir", ",", "port", ")", ":", "if", "port", "==", "'postgres'", ":", "# do nothing for postgres", "return", "maddir", "# e.g. maddir_lib = $GPHOME/madlib/Versions/1.9/lib/libmadlib.so", "# 'madlib' is supposed to be in this path, which is the ...
https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/madpack.py#L102-L134
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py
python
convert_slice_axis
(node, **kwargs)
return nodes
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node.
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node.
[ "Map", "MXNet", "s", "slice_axis", "operator", "attributes", "to", "onnx", "s", "Slice", "operator", "and", "return", "the", "created", "node", "." ]
def convert_slice_axis(node, **kwargs): """Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node. """ from onnx.helper import make_node name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) begin = int(attrs.get("begin"))...
[ "def", "convert_slice_axis", "(", "node", ",", "*", "*", "kwargs", ")", ":", "from", "onnx", ".", "helper", "import", "make_node", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "a...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L1995-L2037
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py
python
BufferingHandler.close
(self)
Close the handler. This version just flushes and chains to the parent class' close().
Close the handler.
[ "Close", "the", "handler", "." ]
def close(self): """ Close the handler. This version just flushes and chains to the parent class' close(). """ try: self.flush() finally: logging.Handler.close(self)
[ "def", "close", "(", "self", ")", ":", "try", ":", "self", ".", "flush", "(", ")", "finally", ":", "logging", ".", "Handler", ".", "close", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L1249-L1258
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
VolumeGrid.set
(self, *args)
return _robotsim.VolumeGrid_set(self, *args)
set(VolumeGrid self, double value) set(VolumeGrid self, int i, int j, int k, double value)
set(VolumeGrid self, double value) set(VolumeGrid self, int i, int j, int k, double value)
[ "set", "(", "VolumeGrid", "self", "double", "value", ")", "set", "(", "VolumeGrid", "self", "int", "i", "int", "j", "int", "k", "double", "value", ")" ]
def set(self, *args): """ set(VolumeGrid self, double value) set(VolumeGrid self, int i, int j, int k, double value) """ return _robotsim.VolumeGrid_set(self, *args)
[ "def", "set", "(", "self", ",", "*", "args", ")", ":", "return", "_robotsim", ".", "VolumeGrid_set", "(", "self", ",", "*", "args", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L1492-L1500
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py
python
MaxAbsScaler.transform
(self, X)
return X
Scale the data Parameters ---------- X : {array-like, sparse matrix} The data that should be scaled.
Scale the data
[ "Scale", "the", "data" ]
def transform(self, X): """Scale the data Parameters ---------- X : {array-like, sparse matrix} The data that should be scaled. """ check_is_fitted(self) X = check_array(X, accept_sparse=('csr', 'csc'), copy=self.copy, estimato...
[ "def", "transform", "(", "self", ",", "X", ")", ":", "check_is_fitted", "(", "self", ")", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "(", "'csr'", ",", "'csc'", ")", ",", "copy", "=", "self", ".", "copy", ",", "estimator", "=", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py#L990-L1007
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/CMAC.py
python
CMAC._update
(self, data_block)
Update a block aligned to the block boundary
Update a block aligned to the block boundary
[ "Update", "a", "block", "aligned", "to", "the", "block", "boundary" ]
def _update(self, data_block): """Update a block aligned to the block boundary""" bs = self._block_size assert len(data_block) % bs == 0 if len(data_block) == 0: return ct = self._cbc.encrypt(data_block) if len(data_block) == bs: second_...
[ "def", "_update", "(", "self", ",", "data_block", ")", ":", "bs", "=", "self", ".", "_block_size", "assert", "len", "(", "data_block", ")", "%", "bs", "==", "0", "if", "len", "(", "data_block", ")", "==", "0", ":", "return", "ct", "=", "self", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/CMAC.py#L148-L163
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Import/App/config_control_design.py
python
gbsf_check_curve
(cv,)
return FALSE
:param cv :type cv:curve
:param cv :type cv:curve
[ ":", "param", "cv", ":", "type", "cv", ":", "curve" ]
def gbsf_check_curve(cv,): ''' :param cv :type cv:curve ''' if (SIZEOF(['CONFIG_CONTROL_DESIGN.BOUNDED_CURVE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.CURVE_REPLICA','CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D'] * TYPEOF(cv)) > 1): return FALSE else: if (SIZEOF(['CONFIG...
[ "def", "gbsf_check_curve", "(", "cv", ",", ")", ":", "if", "(", "SIZEOF", "(", "[", "'CONFIG_CONTROL_DESIGN.BOUNDED_CURVE'", ",", "'CONFIG_CONTROL_DESIGN.CONIC'", ",", "'CONFIG_CONTROL_DESIGN.CURVE_REPLICA'", ",", "'CONFIG_CONTROL_DESIGN.LINE'", ",", "'CONFIG_CONTROL_DESIGN.O...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Import/App/config_control_design.py#L11988-L12035
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/backend.py
python
batch_normalization
(x, mean, var, beta, gamma, epsilon=1e-3)
return nn.batch_normalization(x, mean, var, beta, gamma, epsilon)
Applies batch normalization on x given mean, var, beta and gamma. I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` Arguments: x: Input tensor or variable. mean: Mean of batch. var: Variance of batch. beta: Tensor with which to center the input. gamma: Tens...
Applies batch normalization on x given mean, var, beta and gamma.
[ "Applies", "batch", "normalization", "on", "x", "given", "mean", "var", "beta", "and", "gamma", "." ]
def batch_normalization(x, mean, var, beta, gamma, epsilon=1e-3): """Applies batch normalization on x given mean, var, beta and gamma. I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` Arguments: x: Input tensor or variable. mean: Mean of batch. var: Variance of batc...
[ "def", "batch_normalization", "(", "x", ",", "mean", ",", "var", ",", "beta", ",", "gamma", ",", "epsilon", "=", "1e-3", ")", ":", "return", "nn", ".", "batch_normalization", "(", "x", ",", "mean", ",", "var", ",", "beta", ",", "gamma", ",", "epsilon...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L1879-L1896
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextObject_GetTotalMargin
(*args, **kwargs)
return _richtext.RichTextObject_GetTotalMargin(*args, **kwargs)
RichTextObject_GetTotalMargin(DC dc, RichTextBuffer buffer, RichTextAttr attr, int leftMargin, int rightMargin, int topMargin, int bottomMargin) -> bool
RichTextObject_GetTotalMargin(DC dc, RichTextBuffer buffer, RichTextAttr attr, int leftMargin, int rightMargin, int topMargin, int bottomMargin) -> bool
[ "RichTextObject_GetTotalMargin", "(", "DC", "dc", "RichTextBuffer", "buffer", "RichTextAttr", "attr", "int", "leftMargin", "int", "rightMargin", "int", "topMargin", "int", "bottomMargin", ")", "-", ">", "bool" ]
def RichTextObject_GetTotalMargin(*args, **kwargs): """ RichTextObject_GetTotalMargin(DC dc, RichTextBuffer buffer, RichTextAttr attr, int leftMargin, int rightMargin, int topMargin, int bottomMargin) -> bool """ return _richtext.RichTextObject_GetTotalMargin(*args, **kwargs)
[ "def", "RichTextObject_GetTotalMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_GetTotalMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1486-L1492
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
_get_sharded_variable
(name, shape, dtype, num_shards)
return shards
Get a list of sharded variables with the given dtype.
Get a list of sharded variables with the given dtype.
[ "Get", "a", "list", "of", "sharded", "variables", "with", "the", "given", "dtype", "." ]
def _get_sharded_variable(name, shape, dtype, num_shards): """Get a list of sharded variables with the given dtype.""" if num_shards > shape[0]: raise ValueError("Too many shards: shape=%s, num_shards=%d" % (shape, num_shards)) unit_shard_size = int(math.floor(shape[0] / num_shards)) re...
[ "def", "_get_sharded_variable", "(", "name", ",", "shape", ",", "dtype", ",", "num_shards", ")", ":", "if", "num_shards", ">", "shape", "[", "0", "]", ":", "raise", "ValueError", "(", "\"Too many shards: shape=%s, num_shards=%d\"", "%", "(", "shape", ",", "num...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L51-L66
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintscoordentry.py
python
VariableValue.type
(self)
return 'VariableType'
Gets specialization type of CoordValue
Gets specialization type of CoordValue
[ "Gets", "specialization", "type", "of", "CoordValue" ]
def type(self): """Gets specialization type of CoordValue""" return 'VariableType'
[ "def", "type", "(", "self", ")", ":", "return", "'VariableType'" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintscoordentry.py#L142-L144
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
AboutDialogInfo.HasLicence
(*args, **kwargs)
return _misc_.AboutDialogInfo_HasLicence(*args, **kwargs)
HasLicence(self) -> bool Returns ``True`` if the licence property has been set.
HasLicence(self) -> bool
[ "HasLicence", "(", "self", ")", "-", ">", "bool" ]
def HasLicence(*args, **kwargs): """ HasLicence(self) -> bool Returns ``True`` if the licence property has been set. """ return _misc_.AboutDialogInfo_HasLicence(*args, **kwargs)
[ "def", "HasLicence", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "AboutDialogInfo_HasLicence", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6716-L6722
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/layers/python/layers/feature_column_ops.py
python
_check_forbidden_sequence_columns
(feature_columns)
Recursively cecks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`.
Recursively cecks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`.
[ "Recursively", "cecks", "feature_columns", "for", "_FORBIDDEN_SEQUENCE_COLUMNS", "." ]
def _check_forbidden_sequence_columns(feature_columns): """Recursively cecks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`.""" all_feature_columns = _gather_feature_columns(feature_columns) for feature_column in all_feature_columns: if isinstance(feature_column, _FORBIDDEN_SEQUENCE_COLUMNS): raise...
[ "def", "_check_forbidden_sequence_columns", "(", "feature_columns", ")", ":", "all_feature_columns", "=", "_gather_feature_columns", "(", "feature_columns", ")", "for", "feature_column", "in", "all_feature_columns", ":", "if", "isinstance", "(", "feature_column", ",", "_F...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L821-L829
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py
python
_IsPresent
(item)
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
[ "Given", "a", "(", "FieldDescriptor", "value", ")", "tuple", "from", "_fields", "return", "true", "if", "the", "value", "should", "be", "included", "in", "the", "list", "returned", "by", "ListFields", "()", "." ]
def _IsPresent(item): """Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().""" if item[0].label == _FieldDescriptor.LABEL_REPEATED: return bool(item[1]) elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE: return ...
[ "def", "_IsPresent", "(", "item", ")", ":", "if", "item", "[", "0", "]", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "return", "bool", "(", "item", "[", "1", "]", ")", "elif", "item", "[", "0", "]", ".", "cpp_type", "==", "_...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py#L588-L597
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/codecs.py
python
IncrementalEncoder.getstate
(self)
return 0
Return the current state of the encoder.
Return the current state of the encoder.
[ "Return", "the", "current", "state", "of", "the", "encoder", "." ]
def getstate(self): """ Return the current state of the encoder. """ return 0
[ "def", "getstate", "(", "self", ")", ":", "return", "0" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/codecs.py#L208-L212
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/crash/module.py
python
Module.timestamp_filter
(self, f: Callable[[datetime.datetime], bool])
return filter(inner, self.crashes.items())
Filter crash reports by timestamp. :param f: f(time) return true to keep crash report :returns: crash reports for which f(time) returns true
Filter crash reports by timestamp.
[ "Filter", "crash", "reports", "by", "timestamp", "." ]
def timestamp_filter(self, f: Callable[[datetime.datetime], bool]) -> Iterable[Tuple[str, CrashT]]: """ Filter crash reports by timestamp. :param f: f(time) return true to keep crash report :returns: crash reports for which f(time) returns true """ def inner(pair: Tuple[...
[ "def", "timestamp_filter", "(", "self", ",", "f", ":", "Callable", "[", "[", "datetime", ".", "datetime", "]", ",", "bool", "]", ")", "->", "Iterable", "[", "Tuple", "[", "str", ",", "CrashT", "]", "]", ":", "def", "inner", "(", "pair", ":", "Tuple...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/crash/module.py#L171-L183
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/handlers.py
python
SocketHandler.emit
(self, record)
Emit a record. Pickles the record and writes it to the socket in binary format. If there is an error with the socket, silently drop the packet. If there was a problem with the socket, re-establishes the socket.
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. Pickles the record and writes it to the socket in binary format. If there is an error with the socket, silently drop the packet. If there was a problem with the socket, re-establishes the socket. """ try: ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "try", ":", "s", "=", "self", ".", "makePickle", "(", "record", ")", "self", ".", "send", "(", "s", ")", "except", "(", "KeyboardInterrupt", ",", "SystemExit", ")", ":", "raise", "except", ":", "...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/handlers.py#L531-L546
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/logging/graph.py
python
plot
(root, filename=None)
return model
Walks through every node of the graph starting at ``root``, creates a network graph, and returns a network description. If ``filename`` is specified, it outputs a DOT, PNG, PDF, or SVG file depending on the file name's suffix. Requirements: * for DOT output: `pydot_ng <https://pypi.python.org/pypi/py...
Walks through every node of the graph starting at ``root``, creates a network graph, and returns a network description. If ``filename`` is specified, it outputs a DOT, PNG, PDF, or SVG file depending on the file name's suffix.
[ "Walks", "through", "every", "node", "of", "the", "graph", "starting", "at", "root", "creates", "a", "network", "graph", "and", "returns", "a", "network", "description", ".", "If", "filename", "is", "specified", "it", "outputs", "a", "DOT", "PNG", "PDF", "...
def plot(root, filename=None): ''' Walks through every node of the graph starting at ``root``, creates a network graph, and returns a network description. If ``filename`` is specified, it outputs a DOT, PNG, PDF, or SVG file depending on the file name's suffix. Requirements: * for DOT output:...
[ "def", "plot", "(", "root", ",", "filename", "=", "None", ")", ":", "if", "filename", ":", "suffix", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "[", "1", "]", ".", "lower", "(", ")", "if", "suffix", "not", "in", "(", "'.svg'",...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/logging/graph.py#L179-L387
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/zipfile.py
python
ZipFile.__init__
(self, file, mode="r", compression=ZIP_STORED, allowZip64=False)
Open the ZIP file with mode read "r", write "w" or append "a".
Open the ZIP file with mode read "r", write "w" or append "a".
[ "Open", "the", "ZIP", "file", "with", "mode", "read", "r", "write", "w", "or", "append", "a", "." ]
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False): """Open the ZIP file with mode read "r", write "w" or append "a".""" if mode not in ("r", "w", "a"): raise RuntimeError('ZipFile() requires mode "r", "w", or "a"') if compression == ZIP_STORED: ...
[ "def", "__init__", "(", "self", ",", "file", ",", "mode", "=", "\"r\"", ",", "compression", "=", "ZIP_STORED", ",", "allowZip64", "=", "False", ")", ":", "if", "mode", "not", "in", "(", "\"r\"", ",", "\"w\"", ",", "\"a\"", ")", ":", "raise", "Runtime...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/zipfile.py#L653-L710
CNugteren/CLBlast
4500a03440e2cc54998c0edab366babf5e504d67
scripts/generator/generator/routine.py
python
Routine.arguments_def_c
(self, flavour)
return (self.options_def_c() + self.sizes_def() + list(chain(*[self.buffer_def(b) for b in self.scalar_buffers_first()])) + self.scalar_def("alpha", flavour) + list(chain(*[self.buffer_def(b) for b in self.buffers_first()])) + self.scalar_def("beta", flavo...
As above, but for the C API
As above, but for the C API
[ "As", "above", "but", "for", "the", "C", "API" ]
def arguments_def_c(self, flavour): """As above, but for the C API""" return (self.options_def_c() + self.sizes_def() + list(chain(*[self.buffer_def(b) for b in self.scalar_buffers_first()])) + self.scalar_def("alpha", flavour) + list(chain(*[self.buffer_d...
[ "def", "arguments_def_c", "(", "self", ",", "flavour", ")", ":", "return", "(", "self", ".", "options_def_c", "(", ")", "+", "self", ".", "sizes_def", "(", ")", "+", "list", "(", "chain", "(", "*", "[", "self", ".", "buffer_def", "(", "b", ")", "fo...
https://github.com/CNugteren/CLBlast/blob/4500a03440e2cc54998c0edab366babf5e504d67/scripts/generator/generator/routine.py#L755-L765
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/arduino.py
python
Arduino._WriteSpeedControllerParams
(self, speedControllerParams)
Writes the speed controller parameters (drive gains (PID), and command timeout) to the Arduino controller.
Writes the speed controller parameters (drive gains (PID), and command timeout) to the Arduino controller.
[ "Writes", "the", "speed", "controller", "parameters", "(", "drive", "gains", "(", "PID", ")", "and", "command", "timeout", ")", "to", "the", "Arduino", "controller", "." ]
def _WriteSpeedControllerParams(self, speedControllerParams): """ Writes the speed controller parameters (drive gains (PID), and command timeout) to the Arduino controller. """ rospy.logdebug("Handling '_WriteSpeedControllerParams'; received parameters " + str(speedControllerParams)) message = 'SpeedCo %d %d %...
[ "def", "_WriteSpeedControllerParams", "(", "self", ",", "speedControllerParams", ")", ":", "rospy", ".", "logdebug", "(", "\"Handling '_WriteSpeedControllerParams'; received parameters \"", "+", "str", "(", "speedControllerParams", ")", ")", "message", "=", "'SpeedCo %d %d ...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/arduino.py#L380-L387
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/json/encoder.py
python
JSONEncoder.default
(self, o)
Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): ...
Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``).
[ "Implement", "this", "method", "in", "a", "subclass", "such", "that", "it", "returns", "a", "serializable", "object", "for", "o", "or", "calls", "the", "base", "implementation", "(", "to", "raise", "a", "TypeError", ")", "." ]
def default(self, o): """Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def d...
[ "def", "default", "(", "self", ",", "o", ")", ":", "raise", "TypeError", "(", "f'Object of type {o.__class__.__name__} '", "f'is not JSON serializable'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/json/encoder.py#L160-L180
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/lib/sessions.py
python
RamSession.release_lock
(self)
Release the lock on the currently-loaded session data.
Release the lock on the currently-loaded session data.
[ "Release", "the", "lock", "on", "the", "currently", "-", "loaded", "session", "data", "." ]
def release_lock(self): """Release the lock on the currently-loaded session data.""" self.locks[self.id].release() self.locked = False
[ "def", "release_lock", "(", "self", ")", ":", "self", ".", "locks", "[", "self", ".", "id", "]", ".", "release", "(", ")", "self", ".", "locked", "=", "False" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L372-L375
Pay20Y/FOTS_TF
c42ea59a20c28d506fee35cfb4c553b0cb20eee8
nets/resnet_utils.py
python
stack_blocks_dense
(net, blocks, output_stride=None, outputs_collections=None)
return net
Stacks ResNet `Blocks` and controls output feature density. First, this function creates scopes for the ResNet in the form of 'block_name/unit_1', 'block_name/unit_2', etc. Second, this function allows the user to explicitly control the ResNet output_stride, which is the ratio of the input to output s...
Stacks ResNet `Blocks` and controls output feature density.
[ "Stacks", "ResNet", "Blocks", "and", "controls", "output", "feature", "density", "." ]
def stack_blocks_dense(net, blocks, output_stride=None, outputs_collections=None): """Stacks ResNet `Blocks` and controls output feature density. First, this function creates scopes for the ResNet in the form of 'block_name/unit_1', 'block_name/unit_2', etc. Second, this functio...
[ "def", "stack_blocks_dense", "(", "net", ",", "blocks", ",", "output_stride", "=", "None", ",", "outputs_collections", "=", "None", ")", ":", "# The current_stride variable keeps track of the effective stride of the", "# activations. This allows us to invoke atrous convolution when...
https://github.com/Pay20Y/FOTS_TF/blob/c42ea59a20c28d506fee35cfb4c553b0cb20eee8/nets/resnet_utils.py#L126-L206
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
red_black_tree/red_black_tree.py
python
RedBlackTree.sibling
(node)
return node.parent.left
returns sibling of given node
returns sibling of given node
[ "returns", "sibling", "of", "given", "node" ]
def sibling(node): """ returns sibling of given node """ if node is None or node.parent is None: return None if node is node.parent.left: return node.parent.right return node.parent.left
[ "def", "sibling", "(", "node", ")", ":", "if", "node", "is", "None", "or", "node", ".", "parent", "is", "None", ":", "return", "None", "if", "node", "is", "node", ".", "parent", ".", "left", ":", "return", "node", ".", "parent", ".", "right", "retu...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/red_black_tree/red_black_tree.py#L195-L202
baoboa/pyqt5
11d5f43bc6f213d9d60272f3954a0048569cfc7c
examples/ipc/sharedmemory/sharedmemory.py
python
Dialog.loadFromFile
(self)
This slot function is called when the "Load Image From File..." button is pressed on the firs Dialog process. First, it tests whether the process is already connected to a shared memory segment and, if so, detaches from that segment. This ensures that we always start the example from t...
This slot function is called when the "Load Image From File..." button is pressed on the firs Dialog process. First, it tests whether the process is already connected to a shared memory segment and, if so, detaches from that segment. This ensures that we always start the example from t...
[ "This", "slot", "function", "is", "called", "when", "the", "Load", "Image", "From", "File", "...", "button", "is", "pressed", "on", "the", "firs", "Dialog", "process", ".", "First", "it", "tests", "whether", "the", "process", "is", "already", "connected", ...
def loadFromFile(self): """ This slot function is called when the "Load Image From File..." button is pressed on the firs Dialog process. First, it tests whether the process is already connected to a shared memory segment and, if so, detaches from that segment. This ensures that we alw...
[ "def", "loadFromFile", "(", "self", ")", ":", "if", "self", ".", "sharedMemory", ".", "isAttached", "(", ")", ":", "self", ".", "detach", "(", ")", "self", ".", "ui", ".", "label", ".", "setText", "(", "\"Select an image file\"", ")", "fileName", ",", ...
https://github.com/baoboa/pyqt5/blob/11d5f43bc6f213d9d60272f3954a0048569cfc7c/examples/ipc/sharedmemory/sharedmemory.py#L84-L133