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
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/em/fdem.py
python
FDEM.plotModelAndData
(self, model, xpos, response, modelL=None, modelU=None)
return
Plot both model and data in subfigures.
Plot both model and data in subfigures.
[ "Plot", "both", "model", "and", "data", "in", "subfigures", "." ]
def plotModelAndData(self, model, xpos, response, modelL=None, modelU=None): """Plot both model and data in subfigures.""" self.plotData(xpos, response, nv=3) show1dmodel(model, color='blue') if modelL is not None and modelU is not None: pass ...
[ "def", "plotModelAndData", "(", "self", ",", "model", ",", "xpos", ",", "response", ",", "modelL", "=", "None", ",", "modelU", "=", "None", ")", ":", "self", ".", "plotData", "(", "xpos", ",", "response", ",", "nv", "=", "3", ")", "show1dmodel", "(",...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/fdem.py#L659-L668
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py
python
read_unicodestring1
(f)
r""" >>> import io >>> s = 'abcd\uabcd' >>> enc = s.encode('utf-8') >>> enc b'abcd\xea\xaf\x8d' >>> n = bytes([len(enc)]) # little-endian 1-byte length >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk')) >>> s == t True >>> read_unicodestring1(io.BytesIO(n + enc[:-1])) ...
r""" >>> import io >>> s = 'abcd\uabcd' >>> enc = s.encode('utf-8') >>> enc b'abcd\xea\xaf\x8d' >>> n = bytes([len(enc)]) # little-endian 1-byte length >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk')) >>> s == t True
[ "r", ">>>", "import", "io", ">>>", "s", "=", "abcd", "\\", "uabcd", ">>>", "enc", "=", "s", ".", "encode", "(", "utf", "-", "8", ")", ">>>", "enc", "b", "abcd", "\\", "xea", "\\", "xaf", "\\", "x8d", ">>>", "n", "=", "bytes", "(", "[", "len",...
def read_unicodestring1(f): r""" >>> import io >>> s = 'abcd\uabcd' >>> enc = s.encode('utf-8') >>> enc b'abcd\xea\xaf\x8d' >>> n = bytes([len(enc)]) # little-endian 1-byte length >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk')) >>> s == t True >>> read_unicodestr...
[ "def", "read_unicodestring1", "(", "f", ")", ":", "n", "=", "read_uint1", "(", "f", ")", "assert", "n", ">=", "0", "data", "=", "f", ".", "read", "(", "n", ")", "if", "len", "(", "data", ")", "==", "n", ":", "return", "str", "(", "data", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py#L594-L618
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ast.py
python
NodeVisitor.visit
(self, node)
return visitor(node)
Visit a node.
Visit a node.
[ "Visit", "a", "node", "." ]
def visit(self, node): """Visit a node.""" method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) return visitor(node)
[ "def", "visit", "(", "self", ",", "node", ")", ":", "method", "=", "'visit_'", "+", "node", ".", "__class__", ".", "__name__", "visitor", "=", "getattr", "(", "self", ",", "method", ",", "self", ".", "generic_visit", ")", "return", "visitor", "(", "nod...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ast.py#L267-L271
eldar/pose-tensorflow
6a8f5ee90ea444e12c15eecebf8448797c52bbf5
lib/coco/PythonAPI/pycocotools/coco.py
python
COCO.info
(self)
Print information about the annotation file. :return:
Print information about the annotation file. :return:
[ "Print", "information", "about", "the", "annotation", "file", ".", ":", "return", ":" ]
def info(self): """ Print information about the annotation file. :return: """ for key, value in self.dataset['info'].items(): print('{}: {}'.format(key, value))
[ "def", "info", "(", "self", ")", ":", "for", "key", ",", "value", "in", "self", ".", "dataset", "[", "'info'", "]", ".", "items", "(", ")", ":", "print", "(", "'{}: {}'", ".", "format", "(", "key", ",", "value", ")", ")" ]
https://github.com/eldar/pose-tensorflow/blob/6a8f5ee90ea444e12c15eecebf8448797c52bbf5/lib/coco/PythonAPI/pycocotools/coco.py#L116-L122
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/frameworks/methodManager.py
python
MeshMethodManager.standardizedCoverage
(self, threshhold=0.01)
return 1.0*(abs(self.coverage()) > threshhold)
Return standardized coverage vector (0|1) using thresholding.
Return standardized coverage vector (0|1) using thresholding.
[ "Return", "standardized", "coverage", "vector", "(", "0|1", ")", "using", "thresholding", "." ]
def standardizedCoverage(self, threshhold=0.01): """Return standardized coverage vector (0|1) using thresholding. """ return 1.0*(abs(self.coverage()) > threshhold)
[ "def", "standardizedCoverage", "(", "self", ",", "threshhold", "=", "0.01", ")", ":", "return", "1.0", "*", "(", "abs", "(", "self", ".", "coverage", "(", ")", ")", ">", "threshhold", ")" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/methodManager.py#L812-L815
LisaAnne/lisa-caffe-public
49b8643ddef23a4f6120017968de30c45e693f59
scripts/cpp_lint.py
python
CheckForNewlineAtEOF
(filename, lines, error)
Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
Logs an error if there is no newline char at the end of the file.
[ "Logs", "an", "error", "if", "there", "is", "no", "newline", "char", "at", "the", "end", "of", "the", "file", "." ]
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
[ "def", "CheckForNewlineAtEOF", "(", "filename", ",", "lines", ",", "error", ")", ":", "# The array lines() was created by adding two newlines to the", "# original file (go figure), then splitting on \\n.", "# To verify that the file ends in \\n, we just have to make sure the", "# last-but-...
https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/scripts/cpp_lint.py#L1508-L1523
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
CreateGeometryFromGML
(*args)
return _ogr.CreateGeometryFromGML(*args)
r"""CreateGeometryFromGML(char const * input_string) -> Geometry
r"""CreateGeometryFromGML(char const * input_string) -> Geometry
[ "r", "CreateGeometryFromGML", "(", "char", "const", "*", "input_string", ")", "-", ">", "Geometry" ]
def CreateGeometryFromGML(*args): r"""CreateGeometryFromGML(char const * input_string) -> Geometry""" return _ogr.CreateGeometryFromGML(*args)
[ "def", "CreateGeometryFromGML", "(", "*", "args", ")", ":", "return", "_ogr", ".", "CreateGeometryFromGML", "(", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L5658-L5660
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
_mboxMMDF._install_message
(self, message)
return (start, stop)
Format a message and blindly write to self._file.
Format a message and blindly write to self._file.
[ "Format", "a", "message", "and", "blindly", "write", "to", "self", ".", "_file", "." ]
def _install_message(self, message): """Format a message and blindly write to self._file.""" from_line = None if isinstance(message, str) and message.startswith('From '): newline = message.find('\n') if newline != -1: from_line = message[:newline] ...
[ "def", "_install_message", "(", "self", ",", "message", ")", ":", "from_line", "=", "None", "if", "isinstance", "(", "message", ",", "str", ")", "and", "message", ".", "startswith", "(", "'From '", ")", ":", "newline", "=", "message", ".", "find", "(", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L786-L807
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/xcode_emulation.py
python
XcodeSettings.GetCflagsObjCC
(self, configname)
return cflags_objcc
Returns flags that need to be added to .mm compilations.
Returns flags that need to be added to .mm compilations.
[ "Returns", "flags", "that", "need", "to", "be", "added", "to", ".", "mm", "compilations", "." ]
def GetCflagsObjCC(self, configname): """Returns flags that need to be added to .mm compilations.""" self.configname = configname cflags_objcc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) self._AddObjectiveCARCFlags(cflags_objcc) self._AddObjectiveCMissingPropertySynthesisFlags(c...
[ "def", "GetCflagsObjCC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_objcc", "=", "[", "]", "self", ".", "_AddObjectiveCGarbageCollectionFlags", "(", "cflags_objcc", ")", "self", ".", "_AddObjectiveCARCFlags", "(...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L674-L684
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/plan/motionplanning.py
python
PlannerInterface.getData
(self, setting: str)
return _motionplanning.PlannerInterface_getData(self, setting)
r""" Args: setting (str)
r""" Args: setting (str)
[ "r", "Args", ":", "setting", "(", "str", ")" ]
def getData(self, setting: str) ->float: r""" Args: setting (str) """ return _motionplanning.PlannerInterface_getData(self, setting)
[ "def", "getData", "(", "self", ",", "setting", ":", "str", ")", "->", "float", ":", "return", "_motionplanning", ".", "PlannerInterface_getData", "(", "self", ",", "setting", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/motionplanning.py#L942-L947
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/cr/cr/plugin.py
python
Plugin.Select
(cls, context)
return plugin
Called to determine which plugin should be the active one.
Called to determine which plugin should be the active one.
[ "Called", "to", "determine", "which", "plugin", "should", "be", "the", "active", "one", "." ]
def Select(cls, context): """Called to determine which plugin should be the active one.""" plugin = cls.default selector = getattr(cls, 'SELECTOR', None) if selector: if plugin is not None: _selectors[selector] = plugin.name name = context.Find(selector) if name is not None: ...
[ "def", "Select", "(", "cls", ",", "context", ")", ":", "plugin", "=", "cls", ".", "default", "selector", "=", "getattr", "(", "cls", ",", "'SELECTOR'", ",", "None", ")", "if", "selector", ":", "if", "plugin", "is", "not", "None", ":", "_selectors", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/plugin.py#L291-L301
simsong/bulk_extractor
738911df22b7066ca9e1662f4131fb44090a4196
python/dfxml.py
python
fileobject.is_dir
(self)
return self.name_type()=='d'
Returns true if file is a directory
Returns true if file is a directory
[ "Returns", "true", "if", "file", "is", "a", "directory" ]
def is_dir(self): """Returns true if file is a directory""" return self.name_type()=='d'
[ "def", "is_dir", "(", "self", ")", ":", "return", "self", ".", "name_type", "(", ")", "==", "'d'" ]
https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L727-L729
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/core/fromnumeric.py
python
around
(a, decimals=0, out=None)
return round(decimals, out)
Evenly round to the given number of decimals. Parameters ---------- a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positions to the left of the decimal point. ...
Evenly round to the given number of decimals.
[ "Evenly", "round", "to", "the", "given", "number", "of", "decimals", "." ]
def around(a, decimals=0, out=None): """ Evenly round to the given number of decimals. Parameters ---------- a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positi...
[ "def", "around", "(", "a", ",", "decimals", "=", "0", ",", "out", "=", "None", ")", ":", "try", ":", "round", "=", "a", ".", "round", "except", "AttributeError", ":", "return", "_wrapit", "(", "a", ",", "'round'", ",", "decimals", ",", "out", ")", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/fromnumeric.py#L2208-L2278
KhronosGroup/SPIR
f33c27876d9f3d5810162b60fa89cc13d2b55725
bindings/python/clang/cindex.py
python
CompilationDatabase.fromDirectory
(buildDir)
return cdb
Builds a CompilationDatabase from the database found in buildDir
Builds a CompilationDatabase from the database found in buildDir
[ "Builds", "a", "CompilationDatabase", "from", "the", "database", "found", "in", "buildDir" ]
def fromDirectory(buildDir): """Builds a CompilationDatabase from the database found in buildDir""" errorCode = c_uint() try: cdb = conf.lib.clang_CompilationDatabase_fromDirectory(buildDir, byref(errorCode)) except CompilationDatabaseError as e: r...
[ "def", "fromDirectory", "(", "buildDir", ")", ":", "errorCode", "=", "c_uint", "(", ")", "try", ":", "cdb", "=", "conf", ".", "lib", ".", "clang_CompilationDatabase_fromDirectory", "(", "buildDir", ",", "byref", "(", "errorCode", ")", ")", "except", "Compila...
https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L2378-L2387
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
PlatformInformation.GetOSMajorVersion
(*args, **kwargs)
return _misc_.PlatformInformation_GetOSMajorVersion(*args, **kwargs)
GetOSMajorVersion(self) -> int
GetOSMajorVersion(self) -> int
[ "GetOSMajorVersion", "(", "self", ")", "-", ">", "int" ]
def GetOSMajorVersion(*args, **kwargs): """GetOSMajorVersion(self) -> int""" return _misc_.PlatformInformation_GetOSMajorVersion(*args, **kwargs)
[ "def", "GetOSMajorVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_GetOSMajorVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1061-L1063
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/back/ReduceTransposeDimensions.py
python
merge_permute_order_dimensions
(dims: list, permute_order: np.array)
return int64_array(new_permute_order)
Creates updated permutation for a given permutation order and the *input* dimension indices to be merged into one. :param dims: the input tensor dimensions indices to merge :param permute_order: the permutation order :return: the new permutation order after merging of the specified dimensions into one
Creates updated permutation for a given permutation order and the *input* dimension indices to be merged into one. :param dims: the input tensor dimensions indices to merge :param permute_order: the permutation order :return: the new permutation order after merging of the specified dimensions into one
[ "Creates", "updated", "permutation", "for", "a", "given", "permutation", "order", "and", "the", "*", "input", "*", "dimension", "indices", "to", "be", "merged", "into", "one", ".", ":", "param", "dims", ":", "the", "input", "tensor", "dimensions", "indices",...
def merge_permute_order_dimensions(dims: list, permute_order: np.array): """ Creates updated permutation for a given permutation order and the *input* dimension indices to be merged into one. :param dims: the input tensor dimensions indices to merge :param permute_order: the permutation order :retur...
[ "def", "merge_permute_order_dimensions", "(", "dims", ":", "list", ",", "permute_order", ":", "np", ".", "array", ")", ":", "assert", "len", "(", "dims", ")", ">=", "2", "new_permute_order", "=", "list", "(", ")", "for", "permute_index", "in", "permute_order...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/back/ReduceTransposeDimensions.py#L34-L50
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
SizerItem.SetUserData
(*args, **kwargs)
return _core_.SizerItem_SetUserData(*args, **kwargs)
SetUserData(self, PyObject userData) Associate a Python object with this sizer item.
SetUserData(self, PyObject userData)
[ "SetUserData", "(", "self", "PyObject", "userData", ")" ]
def SetUserData(*args, **kwargs): """ SetUserData(self, PyObject userData) Associate a Python object with this sizer item. """ return _core_.SizerItem_SetUserData(*args, **kwargs)
[ "def", "SetUserData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItem_SetUserData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14361-L14367
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/functions/enumerationmember.py
python
EnumerationMember.serialize
(self, serializer)
Load/unload class state to/from serializer object.
Load/unload class state to/from serializer object.
[ "Load", "/", "unload", "class", "state", "to", "/", "from", "serializer", "object", "." ]
def serialize(self, serializer): """Load/unload class state to/from serializer object.""" super(EnumerationMember, self).serialize(serializer)
[ "def", "serialize", "(", "self", ",", "serializer", ")", ":", "super", "(", "EnumerationMember", ",", "self", ")", ".", "serialize", "(", "serializer", ")" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/functions/enumerationmember.py#L42-L44
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryd.py
python
Armory_Json_Rpc_Server.jsonrpc_sendtransaction
(self, txHash)
return out
DESCRIPTION: Send the transaction . PARAMETERS: txHash - A hex string representing the transaction to obtain. RETURN: A dictionary listing information on the desired transaction, or empty if the transaction wasn't found.
DESCRIPTION: Send the transaction . PARAMETERS: txHash - A hex string representing the transaction to obtain. RETURN: A dictionary listing information on the desired transaction, or empty if the transaction wasn't found.
[ "DESCRIPTION", ":", "Send", "the", "transaction", ".", "PARAMETERS", ":", "txHash", "-", "A", "hex", "string", "representing", "the", "transaction", "to", "obtain", ".", "RETURN", ":", "A", "dictionary", "listing", "information", "on", "the", "desired", "trans...
def jsonrpc_sendtransaction(self, txHash): """ DESCRIPTION: Send the transaction . PARAMETERS: txHash - A hex string representing the transaction to obtain. RETURN: A dictionary listing information on the desired transaction, or empty if the transaction wasn't found. ...
[ "def", "jsonrpc_sendtransaction", "(", "self", ",", "txHash", ")", ":", "if", "TheBDM", ".", "getState", "(", ")", "in", "[", "BDM_UNINITIALIZED", ",", "BDM_OFFLINE", "]", ":", "return", "{", "'Error'", ":", "'armoryd is offline'", "}", "binhash", "=", "hex_...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L1824-L1914
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py
python
Window._copy_margin
( self, margin_content: UIContent, new_screen: Screen, write_position: WritePosition, move_x: int, width: int, )
Copy characters from the margin screen to the real screen.
Copy characters from the margin screen to the real screen.
[ "Copy", "characters", "from", "the", "margin", "screen", "to", "the", "real", "screen", "." ]
def _copy_margin( self, margin_content: UIContent, new_screen: Screen, write_position: WritePosition, move_x: int, width: int, ) -> None: """ Copy characters from the margin screen to the real screen. """ xpos = write_position.xpos + mo...
[ "def", "_copy_margin", "(", "self", ",", "margin_content", ":", "UIContent", ",", "new_screen", ":", "Screen", ",", "write_position", ":", "WritePosition", ",", "move_x", ":", "int", ",", "width", ":", "int", ",", ")", "->", "None", ":", "xpos", "=", "wr...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py#L2307-L2322
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.add
(self, **kwargs)
return new_element
Adds a new element at the end of the list and returns it. Keyword arguments may be used to initialize the element.
Adds a new element at the end of the list and returns it. Keyword arguments may be used to initialize the element.
[ "Adds", "a", "new", "element", "at", "the", "end", "of", "the", "list", "and", "returns", "it", ".", "Keyword", "arguments", "may", "be", "used", "to", "initialize", "the", "element", "." ]
def add(self, **kwargs): """Adds a new element at the end of the list and returns it. Keyword arguments may be used to initialize the element. """ new_element = self._message_descriptor._concrete_class(**kwargs) new_element._SetListener(self._message_listener) self._values.append(new_element) ...
[ "def", "add", "(", "self", ",", "*", "*", "kwargs", ")", ":", "new_element", "=", "self", ".", "_message_descriptor", ".", "_concrete_class", "(", "*", "*", "kwargs", ")", "new_element", ".", "_SetListener", "(", "self", ".", "_message_listener", ")", "sel...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/containers.py#L212-L221
DLR-SC/tigl
d1c5901e948e33d10b1f9659ff3e22c4717b455f
bindings/python_internal/tigl3/curve_factories.py
python
interpolate_points
(points, params=None, degree=3, close_continuous=False)
return curve
Creates a b-spline that passes through the given points using b-spline interpolation. :param points: Array of points (numpy array also works!). First dimension over number of points, second must be 3! :param params: Optional list of parameters (list of floats), at which the points should be interpolated. ...
Creates a b-spline that passes through the given points using b-spline interpolation.
[ "Creates", "a", "b", "-", "spline", "that", "passes", "through", "the", "given", "points", "using", "b", "-", "spline", "interpolation", "." ]
def interpolate_points(points, params=None, degree=3, close_continuous=False): """ Creates a b-spline that passes through the given points using b-spline interpolation. :param points: Array of points (numpy array also works!). First dimension over number of points, second must be 3! :param params: ...
[ "def", "interpolate_points", "(", "points", ",", "params", "=", "None", ",", "degree", "=", "3", ",", "close_continuous", "=", "False", ")", ":", "occ_points_array", "=", "point_array", "(", "points", ")", "if", "params", "is", "None", ":", "interp", "=", ...
https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/bindings/python_internal/tigl3/curve_factories.py#L5-L28
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macpath.py
python
islink
(s)
Return true if the pathname refers to a symbolic link.
Return true if the pathname refers to a symbolic link.
[ "Return", "true", "if", "the", "pathname", "refers", "to", "a", "symbolic", "link", "." ]
def islink(s): """Return true if the pathname refers to a symbolic link.""" try: import Carbon.File return Carbon.File.ResolveAliasFile(s, 0)[2] except: return False
[ "def", "islink", "(", "s", ")", ":", "try", ":", "import", "Carbon", ".", "File", "return", "Carbon", ".", "File", ".", "ResolveAliasFile", "(", "s", ",", "0", ")", "[", "2", "]", "except", ":", "return", "False" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macpath.py#L98-L105
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/ValidationKit/common/utils.py
python
ProcessInfo.getBaseImageNameNoExeSuff
(self)
return sRet
Same as getBaseImageName, except any '.exe' or similar suffix is stripped.
Same as getBaseImageName, except any '.exe' or similar suffix is stripped.
[ "Same", "as", "getBaseImageName", "except", "any", ".", "exe", "or", "similar", "suffix", "is", "stripped", "." ]
def getBaseImageNameNoExeSuff(self): """ Same as getBaseImageName, except any '.exe' or similar suffix is stripped. """ sRet = self.getBaseImageName(); if sRet is not None and len(sRet) > 4 and sRet[-4] == '.': if (sRet[-4:]).lower() in [ '.exe', '.com', '.msc', '.vbs...
[ "def", "getBaseImageNameNoExeSuff", "(", "self", ")", ":", "sRet", "=", "self", ".", "getBaseImageName", "(", ")", "if", "sRet", "is", "not", "None", "and", "len", "(", "sRet", ")", ">", "4", "and", "sRet", "[", "-", "4", "]", "==", "'.'", ":", "if...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L999-L1007
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
handheld/lib/nanopb/generator/nanopb_generator.py
python
process_file
(filename, fdesc, options, other_files = {})
return {'headername': headername, 'headerdata': headerdata, 'sourcename': sourcename, 'sourcedata': sourcedata}
Process a single file. filename: The full path to the .proto or .pb source file, as string. fdesc: The loaded FileDescriptorSet, or None to read from the input file. options: Command line options as they come from OptionsParser. Returns a dict: {'headername': Name of header file, 'head...
Process a single file. filename: The full path to the .proto or .pb source file, as string. fdesc: The loaded FileDescriptorSet, or None to read from the input file. options: Command line options as they come from OptionsParser.
[ "Process", "a", "single", "file", ".", "filename", ":", "The", "full", "path", "to", "the", ".", "proto", "or", ".", "pb", "source", "file", "as", "string", ".", "fdesc", ":", "The", "loaded", "FileDescriptorSet", "or", "None", "to", "read", "from", "t...
def process_file(filename, fdesc, options, other_files = {}): '''Process a single file. filename: The full path to the .proto or .pb source file, as string. fdesc: The loaded FileDescriptorSet, or None to read from the input file. options: Command line options as they come from OptionsParser. Retur...
[ "def", "process_file", "(", "filename", ",", "fdesc", ",", "options", ",", "other_files", "=", "{", "}", ")", ":", "f", "=", "parse_file", "(", "filename", ",", "fdesc", ",", "options", ")", "# Provide dependencies if available", "for", "dep", "in", "f", "...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/handheld/lib/nanopb/generator/nanopb_generator.py#L1468-L1511
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/CrystalField/fitting.py
python
CrystalField.getPeakList
(self, i=0)
return peaks
Get the peak list for spectrum i as a numpy array
Get the peak list for spectrum i as a numpy array
[ "Get", "the", "peak", "list", "for", "spectrum", "i", "as", "a", "numpy", "array" ]
def getPeakList(self, i=0): """Get the peak list for spectrum i as a numpy array""" self._calcPeaksList(i) peaks = np.array([self._peakList.column(0), self._peakList.column(1)]) return peaks
[ "def", "getPeakList", "(", "self", ",", "i", "=", "0", ")", ":", "self", ".", "_calcPeaksList", "(", "i", ")", "peaks", "=", "np", ".", "array", "(", "[", "self", ".", "_peakList", ".", "column", "(", "0", ")", ",", "self", ".", "_peakList", ".",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/CrystalField/fitting.py#L712-L716
adafruit/Adafruit_MQTT_Library
223d419ebdff8f594da6132755628b12ecbbf7d7
examples/mqtt_arbitrary_data/python_subscriber/subscriber.py
python
main
()
Wait for incoming message published by Adafruit MQTT client
Wait for incoming message published by Adafruit MQTT client
[ "Wait", "for", "incoming", "message", "published", "by", "Adafruit", "MQTT", "client" ]
def main(): """Wait for incoming message published by Adafruit MQTT client""" global args args = argBegin() client = mqtt.Client() client.on_connect = on_connect client.on_message = on_message client.username_pw_set(args.username, args.password) client.connect(args.host, args.port, args....
[ "def", "main", "(", ")", ":", "global", "args", "args", "=", "argBegin", "(", ")", "client", "=", "mqtt", ".", "Client", "(", ")", "client", ".", "on_connect", "=", "on_connect", "client", ".", "on_message", "=", "on_message", "client", ".", "username_pw...
https://github.com/adafruit/Adafruit_MQTT_Library/blob/223d419ebdff8f594da6132755628b12ecbbf7d7/examples/mqtt_arbitrary_data/python_subscriber/subscriber.py#L97-L111
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
build/pymake/pymake/builtins.py
python
rm
(args)
Emulate most of the behavior of rm(1). Only supports the -r (--recursive) and -f (--force) arguments.
Emulate most of the behavior of rm(1). Only supports the -r (--recursive) and -f (--force) arguments.
[ "Emulate", "most", "of", "the", "behavior", "of", "rm", "(", "1", ")", ".", "Only", "supports", "the", "-", "r", "(", "--", "recursive", ")", "and", "-", "f", "(", "--", "force", ")", "arguments", "." ]
def rm(args): """ Emulate most of the behavior of rm(1). Only supports the -r (--recursive) and -f (--force) arguments. """ try: opts, args = getopt(args, "rRf", ["force", "recursive"]) except GetoptError, e: raise PythonException, ("rm: %s" % e, 1) force = False recursive = False for o, a in ...
[ "def", "rm", "(", "args", ")", ":", "try", ":", "opts", ",", "args", "=", "getopt", "(", "args", ",", "\"rRf\"", ",", "[", "\"force\"", ",", "\"recursive\"", "]", ")", "except", "GetoptError", ",", "e", ":", "raise", "PythonException", ",", "(", "\"r...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/pymake/pymake/builtins.py#L34-L63
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator12.py
python
validate_spec_url
(url)
Simple utility function to perform recursive validation of a Resource Listing and all associated API Declarations. This is trivial wrapper function around :py:func:`swagger_spec_validator.validate_resource_listing` and :py:func:`swagger_spec_validator.validate_api_declaration`. You are encouraged ...
Simple utility function to perform recursive validation of a Resource Listing and all associated API Declarations.
[ "Simple", "utility", "function", "to", "perform", "recursive", "validation", "of", "a", "Resource", "Listing", "and", "all", "associated", "API", "Declarations", "." ]
def validate_spec_url(url): """Simple utility function to perform recursive validation of a Resource Listing and all associated API Declarations. This is trivial wrapper function around :py:func:`swagger_spec_validator.validate_resource_listing` and :py:func:`swagger_spec_validator.validate_api_dec...
[ "def", "validate_spec_url", "(", "url", ")", ":", "log", ".", "info", "(", "'Validating %s'", ",", "url", ")", "validate_spec", "(", "read_url", "(", "url", ")", ",", "url", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator12.py#L66-L83
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/formats/csvs.py
python
CSVFormatter._number_format
(self)
return { "na_rep": self.na_rep, "float_format": self.float_format, "date_format": self.date_format, "quoting": self.quoting, "decimal": self.decimal, }
Dictionary used for storing number formatting settings.
Dictionary used for storing number formatting settings.
[ "Dictionary", "used", "for", "storing", "number", "formatting", "settings", "." ]
def _number_format(self) -> dict[str, Any]: """Dictionary used for storing number formatting settings.""" return { "na_rep": self.na_rep, "float_format": self.float_format, "date_format": self.date_format, "quoting": self.quoting, "decimal": se...
[ "def", "_number_format", "(", "self", ")", "->", "dict", "[", "str", ",", "Any", "]", ":", "return", "{", "\"na_rep\"", ":", "self", ".", "na_rep", ",", "\"float_format\"", ":", "self", ".", "float_format", ",", "\"date_format\"", ":", "self", ".", "date...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/csvs.py#L167-L175
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py
python
Configuration.get_distribution
(self)
return get_distribution()
Return the distutils distribution object for self.
Return the distutils distribution object for self.
[ "Return", "the", "distutils", "distribution", "object", "for", "self", "." ]
def get_distribution(self): """Return the distutils distribution object for self.""" from numpy.distutils.core import get_distribution return get_distribution()
[ "def", "get_distribution", "(", "self", ")", ":", "from", "numpy", ".", "distutils", ".", "core", "import", "get_distribution", "return", "get_distribution", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L881-L884
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py
python
datetime._mktime
(self)
return (max, min)[self.fold](u1, u2)
Return integer POSIX timestamp.
Return integer POSIX timestamp.
[ "Return", "integer", "POSIX", "timestamp", "." ]
def _mktime(self): """Return integer POSIX timestamp.""" epoch = datetime(1970, 1, 1) max_fold_seconds = 24 * 3600 t = (self - epoch) // timedelta(0, 1) def local(u): y, m, d, hh, mm, ss = _time.localtime(u)[:6] return (datetime(y, m, d, hh, mm, ss) - epoc...
[ "def", "_mktime", "(", "self", ")", ":", "epoch", "=", "datetime", "(", "1970", ",", "1", ",", "1", ")", "max_fold_seconds", "=", "24", "*", "3600", "t", "=", "(", "self", "-", "epoch", ")", "//", "timedelta", "(", "0", ",", "1", ")", "def", "l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py#L1704-L1736
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextEvent.SetY
(*args, **kwargs)
return _stc.StyledTextEvent_SetY(*args, **kwargs)
SetY(self, int val)
SetY(self, int val)
[ "SetY", "(", "self", "int", "val", ")" ]
def SetY(*args, **kwargs): """SetY(self, int val)""" return _stc.StyledTextEvent_SetY(*args, **kwargs)
[ "def", "SetY", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_SetY", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L7090-L7092
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
python
_DoesTargetDependOnMatchingTargets
(target)
return False
Returns true if |target| or any of its dependencies is one of the targets containing the files supplied as input to analyzer. This updates |matches| of the Targets as it recurses. target: the Target to look for.
Returns true if |target| or any of its dependencies is one of the targets containing the files supplied as input to analyzer. This updates |matches| of the Targets as it recurses. target: the Target to look for.
[ "Returns", "true", "if", "|target|", "or", "any", "of", "its", "dependencies", "is", "one", "of", "the", "targets", "containing", "the", "files", "supplied", "as", "input", "to", "analyzer", ".", "This", "updates", "|matches|", "of", "the", "Targets", "as", ...
def _DoesTargetDependOnMatchingTargets(target): """Returns true if |target| or any of its dependencies is one of the targets containing the files supplied as input to analyzer. This updates |matches| of the Targets as it recurses. target: the Target to look for.""" if target.match_status == MATCH_STATUS_D...
[ "def", "_DoesTargetDependOnMatchingTargets", "(", "target", ")", ":", "if", "target", ".", "match_status", "==", "MATCH_STATUS_DOESNT_MATCH", ":", "return", "False", "if", "(", "target", ".", "match_status", "==", "MATCH_STATUS_MATCHES", "or", "target", ".", "match_...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py#L446-L464
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/math_ops.py
python
round
(x, name=None)
Rounds the values of a tensor to the nearest integer, element-wise. Rounds half to even. Also known as bankers rounding. If you want to round according to the current system rounding mode use tf::cint. For example: ```python x = tf.constant([0.9, 2.5, 2.3, 1.5, -4.5]) tf.round(x) # [ 1.0, 2.0, 2.0, 2.0,...
Rounds the values of a tensor to the nearest integer, element-wise.
[ "Rounds", "the", "values", "of", "a", "tensor", "to", "the", "nearest", "integer", "element", "-", "wise", "." ]
def round(x, name=None): """Rounds the values of a tensor to the nearest integer, element-wise. Rounds half to even. Also known as bankers rounding. If you want to round according to the current system rounding mode use tf::cint. For example: ```python x = tf.constant([0.9, 2.5, 2.3, 1.5, -4.5]) tf.rou...
[ "def", "round", "(", "x", ",", "name", "=", "None", ")", ":", "x", "=", "ops", ".", "convert_to_tensor", "(", "x", ",", "name", "=", "\"x\"", ")", "if", "x", ".", "dtype", ".", "is_integer", ":", "return", "x", "else", ":", "return", "gen_math_ops"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_ops.py#L688-L711
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/parquet_io_tensor_ops.py
python
BaseParquetGraphIOTensor.shape
(self)
return self._shape
Returns the `TensorShape` that represents the shape of the tensor.
Returns the `TensorShape` that represents the shape of the tensor.
[ "Returns", "the", "TensorShape", "that", "represents", "the", "shape", "of", "the", "tensor", "." ]
def shape(self): """Returns the `TensorShape` that represents the shape of the tensor.""" return self._shape
[ "def", "shape", "(", "self", ")", ":", "return", "self", ".", "_shape" ]
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/parquet_io_tensor_ops.py#L42-L44
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
python
DataFeeder.get_feed_params
(self)
return { 'epoch': self.epoch, 'offset': self.offset, 'batch_size': self._batch_size }
Function returns a dict with data feed params while training. Returns: A dict with data feed params while training.
Function returns a dict with data feed params while training.
[ "Function", "returns", "a", "dict", "with", "data", "feed", "params", "while", "training", "." ]
def get_feed_params(self): """Function returns a dict with data feed params while training. Returns: A dict with data feed params while training. """ return { 'epoch': self.epoch, 'offset': self.offset, 'batch_size': self._batch_size }
[ "def", "get_feed_params", "(", "self", ")", ":", "return", "{", "'epoch'", ":", "self", ".", "epoch", ",", "'offset'", ":", "self", ".", "offset", ",", "'batch_size'", ":", "self", ".", "_batch_size", "}" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py#L349-L359
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_grad.py
python
_LoopCondGrad
(_)
return None
Stop backprop for the predicate of a while loop.
Stop backprop for the predicate of a while loop.
[ "Stop", "backprop", "for", "the", "predicate", "of", "a", "while", "loop", "." ]
def _LoopCondGrad(_): """Stop backprop for the predicate of a while loop.""" return None
[ "def", "_LoopCondGrad", "(", "_", ")", ":", "return", "None" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_grad.py#L236-L238
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
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] = '// dummy'
[ "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/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L946-L951
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/peakprocesshelper.py
python
SinglePtScansIntegrationOperation.get_model_workspace
(self)
return self._model_ws_name
get the workspace name for calculated data (model) :return:
get the workspace name for calculated data (model) :return:
[ "get", "the", "workspace", "name", "for", "calculated", "data", "(", "model", ")", ":", "return", ":" ]
def get_model_workspace(self): """ get the workspace name for calculated data (model) :return: """ return self._model_ws_name
[ "def", "get_model_workspace", "(", "self", ")", ":", "return", "self", ".", "_model_ws_name" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/peakprocesshelper.py#L911-L916
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
SingleInstanceChecker.IsAnotherRunning
(*args, **kwargs)
return _misc_.SingleInstanceChecker_IsAnotherRunning(*args, **kwargs)
IsAnotherRunning(self) -> bool
IsAnotherRunning(self) -> bool
[ "IsAnotherRunning", "(", "self", ")", "-", ">", "bool" ]
def IsAnotherRunning(*args, **kwargs): """IsAnotherRunning(self) -> bool""" return _misc_.SingleInstanceChecker_IsAnotherRunning(*args, **kwargs)
[ "def", "IsAnotherRunning", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "SingleInstanceChecker_IsAnotherRunning", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L982-L984
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
xmlDoc.saveFileEnc
(self, filename, encoding)
return ret
Dump an XML document, converting it to the given encoding
Dump an XML document, converting it to the given encoding
[ "Dump", "an", "XML", "document", "converting", "it", "to", "the", "given", "encoding" ]
def saveFileEnc(self, filename, encoding): """Dump an XML document, converting it to the given encoding """ ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding) return ret
[ "def", "saveFileEnc", "(", "self", ",", "filename", ",", "encoding", ")", ":", "ret", "=", "libxml2mod", ".", "xmlSaveFileEnc", "(", "filename", ",", "self", ".", "_o", ",", "encoding", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3697-L3700
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
benchmarks/functional_autograd_benchmark/utils.py
python
extract_weights
(mod: nn.Module)
return params, names
This function removes all the Parameters from the model and return them as a tuple as well as their original attribute names. The weights must be re-loaded with `load_weights` before the model can be used again. Note that this function modifies the model in place and after this call, mod.parameters(...
This function removes all the Parameters from the model and return them as a tuple as well as their original attribute names. The weights must be re-loaded with `load_weights` before the model can be used again. Note that this function modifies the model in place and after this call, mod.parameters(...
[ "This", "function", "removes", "all", "the", "Parameters", "from", "the", "model", "and", "return", "them", "as", "a", "tuple", "as", "well", "as", "their", "original", "attribute", "names", ".", "The", "weights", "must", "be", "re", "-", "loaded", "with",...
def extract_weights(mod: nn.Module) -> Tuple[Tuple[Tensor, ...], List[str]]: """ This function removes all the Parameters from the model and return them as a tuple as well as their original attribute names. The weights must be re-loaded with `load_weights` before the model can be used again. Not...
[ "def", "extract_weights", "(", "mod", ":", "nn", ".", "Module", ")", "->", "Tuple", "[", "Tuple", "[", "Tensor", ",", "...", "]", ",", "List", "[", "str", "]", "]", ":", "orig_params", "=", "tuple", "(", "mod", ".", "parameters", "(", ")", ")", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/functional_autograd_benchmark/utils.py#L44-L62
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/session_manager.py
python
SessionManager.recover_session
(self, master, saver=None, checkpoint_dir=None, wait_for_checkpoint=False, max_wait_secs=7200, config=None)
return sess, is_loaded_from_checkpoint
Creates a `Session`, recovering if possible. Creates a new session on 'master'. If the session is not initialized and can be recovered from a checkpoint, recover it. Args: master: `String` representation of the TensorFlow master to use. saver: A `Saver` object used to restore a model. c...
Creates a `Session`, recovering if possible.
[ "Creates", "a", "Session", "recovering", "if", "possible", "." ]
def recover_session(self, master, saver=None, checkpoint_dir=None, wait_for_checkpoint=False, max_wait_secs=7200, config=None): """Creates a `Session`, recovering if possible. Cre...
[ "def", "recover_session", "(", "self", ",", "master", ",", "saver", "=", "None", ",", "checkpoint_dir", "=", "None", ",", "wait_for_checkpoint", "=", "False", ",", "max_wait_secs", "=", "7200", ",", "config", "=", "None", ")", ":", "sess", ",", "is_loaded_...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/session_manager.py#L254-L307
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TNGraphMtx.PMultiplyT
(self, *args)
return _snap.TNGraphMtx_PMultiplyT(self, *args)
PMultiplyT(TNGraphMtx self, TFltVV const & B, int ColId, TFltV & Result) Parameters: B: TFltVV const & ColId: int Result: TFltV & PMultiplyT(TNGraphMtx self, TFltV const & Vec, TFltV & Result) Parameters: Vec: TFltV const & Result: T...
PMultiplyT(TNGraphMtx self, TFltVV const & B, int ColId, TFltV & Result)
[ "PMultiplyT", "(", "TNGraphMtx", "self", "TFltVV", "const", "&", "B", "int", "ColId", "TFltV", "&", "Result", ")" ]
def PMultiplyT(self, *args): """ PMultiplyT(TNGraphMtx self, TFltVV const & B, int ColId, TFltV & Result) Parameters: B: TFltVV const & ColId: int Result: TFltV & PMultiplyT(TNGraphMtx self, TFltV const & Vec, TFltV & Result) Parameters: ...
[ "def", "PMultiplyT", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TNGraphMtx_PMultiplyT", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5444-L5460
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/gldraw.py
python
xform_widget
(T,length,width,lighting=True,fancy=False)
Draws an axis-aligned transform widget for the se3 transform T. Length / width govern the length / width of the axes. If fancy=True, draws the axes with real volume rather than lines
Draws an axis-aligned transform widget for the se3 transform T. Length / width govern the length / width of the axes. If fancy=True, draws the axes with real volume rather than lines
[ "Draws", "an", "axis", "-", "aligned", "transform", "widget", "for", "the", "se3", "transform", "T", ".", "Length", "/", "width", "govern", "the", "length", "/", "width", "of", "the", "axes", ".", "If", "fancy", "=", "True", "draws", "the", "axes", "wi...
def xform_widget(T,length,width,lighting=True,fancy=False): """Draws an axis-aligned transform widget for the se3 transform T. Length / width govern the length / width of the axes. If fancy=True, draws the axes with real volume rather than lines""" mat = zip(*se3.homogeneous(T)) mat = sum([list(col...
[ "def", "xform_widget", "(", "T", ",", "length", ",", "width", ",", "lighting", "=", "True", ",", "fancy", "=", "False", ")", ":", "mat", "=", "zip", "(", "*", "se3", ".", "homogeneous", "(", "T", ")", ")", "mat", "=", "sum", "(", "[", "list", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/gldraw.py#L125-L168
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
model_zoo/models/python/common.py
python
run_cmd
(model, data_reader, optimizer, test_setup = False)
return 'srun --nodes=' + str(nnodes) \ + ' --ntasks-per-node=' + str(ntasks_per_node) \ + ' ' + bindir() + '/lbann ' + lbann_options() \ + ' --model=' + model \ + ' --reader=' + data_reader \ + ' --optimizer=' + opt...
Returns a command line that will run the lbann executable using prototext files. The returned string is something like: srun --node=<int> --ntasks_per_node=<int> <path to>/lbann --todoTODO
Returns a command line that will run the lbann executable using prototext files. The returned string is something like: srun --node=<int> --ntasks_per_node=<int> <path to>/lbann --todoTODO
[ "Returns", "a", "command", "line", "that", "will", "run", "the", "lbann", "executable", "using", "prototext", "files", ".", "The", "returned", "string", "is", "something", "like", ":", "srun", "--", "node", "=", "<int", ">", "--", "ntasks_per_node", "=", "...
def run_cmd(model, data_reader, optimizer, test_setup = False) : '''Returns a command line that will run the lbann executable using prototext files. The returned string is something like: srun --node=<int> --ntasks_per_node=<int> <path to>/lbann --todoTODO ''' for n in sys.argv : if n == '--help'...
[ "def", "run_cmd", "(", "model", ",", "data_reader", ",", "optimizer", ",", "test_setup", "=", "False", ")", ":", "for", "n", "in", "sys", ".", "argv", ":", "if", "n", "==", "'--help'", "or", "n", "==", "'-h'", ":", "cmd", "=", "bindir", "(", ")", ...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/model_zoo/models/python/common.py#L122-L163
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/util/module_wrapper.py
python
TFModuleWrapper._getattr
(self, name)
return attr
Imports and caches pre-defined API. Warns if necessary. This method is a replacement for __getattr__(). It will be added into the extended python module as a callback to reduce API overhead. Instead of relying on implicit AttributeError handling, this added callback function will be called exp...
Imports and caches pre-defined API.
[ "Imports", "and", "caches", "pre", "-", "defined", "API", "." ]
def _getattr(self, name): # pylint: disable=g-doc-return-or-yield,g-doc-args """Imports and caches pre-defined API. Warns if necessary. This method is a replacement for __getattr__(). It will be added into the extended python module as a callback to reduce API overhead. Instead of relying on i...
[ "def", "_getattr", "(", "self", ",", "name", ")", ":", "# pylint: disable=g-doc-return-or-yield,g-doc-args", "try", ":", "attr", "=", "getattr", "(", "self", ".", "_tfmw_wrapped_module", ",", "name", ")", "except", "AttributeError", ":", "# Placeholder for Google-inte...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/module_wrapper.py#L218-L244
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py
python
Block.quantile
(self, qs, interpolation="linear", axis=0)
return make_block(result, placement=np.arange(len(result)), ndim=ndim)
compute the quantiles of the Parameters ---------- qs: a scalar or list of the quantiles to be computed interpolation: type of interpolation, default 'linear' axis: axis to compute, default 0 Returns ------- Block
compute the quantiles of the
[ "compute", "the", "quantiles", "of", "the" ]
def quantile(self, qs, interpolation="linear", axis=0): """ compute the quantiles of the Parameters ---------- qs: a scalar or list of the quantiles to be computed interpolation: type of interpolation, default 'linear' axis: axis to compute, default 0 Re...
[ "def", "quantile", "(", "self", ",", "qs", ",", "interpolation", "=", "\"linear\"", ",", "axis", "=", "0", ")", ":", "# We should always have ndim == 2 because Series dispatches to DataFrame", "assert", "self", ".", "ndim", "==", "2", "values", "=", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L1491-L1545
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pluggy/py3/pluggy/_hooks.py
python
_HookCaller.call_extra
(self, methods, kwargs)
Call the hook with some additional temporarily participating methods using the specified ``kwargs`` as call parameters.
Call the hook with some additional temporarily participating methods using the specified ``kwargs`` as call parameters.
[ "Call", "the", "hook", "with", "some", "additional", "temporarily", "participating", "methods", "using", "the", "specified", "kwargs", "as", "call", "parameters", "." ]
def call_extra(self, methods, kwargs): """Call the hook with some additional temporarily participating methods using the specified ``kwargs`` as call parameters.""" old = list(self._nonwrappers), list(self._wrappers) for method in methods: opts = dict(hookwrapper=False, tryla...
[ "def", "call_extra", "(", "self", ",", "methods", ",", "kwargs", ")", ":", "old", "=", "list", "(", "self", ".", "_nonwrappers", ")", ",", "list", "(", "self", ".", "_wrappers", ")", "for", "method", "in", "methods", ":", "opts", "=", "dict", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pluggy/py3/pluggy/_hooks.py#L283-L294
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/PropertyManager.py
python
PropertyManager._get_properties_with_files
(self)
return files_to_check
Method returns list of properties, which may have files as their values it does not include sample run, as this one will be treated separately.
Method returns list of properties, which may have files as their values
[ "Method", "returns", "list", "of", "properties", "which", "may", "have", "files", "as", "their", "values" ]
def _get_properties_with_files(self): """ Method returns list of properties, which may have files as their values it does not include sample run, as this one will be treated separately. """ run_files_prop=['wb_run','monovan_run','mask_run','wb_for_monovan_ru...
[ "def", "_get_properties_with_files", "(", "self", ")", ":", "run_files_prop", "=", "[", "'wb_run'", ",", "'monovan_run'", ",", "'mask_run'", ",", "'wb_for_monovan_run'", ",", "'second_white'", "]", "map_mask_prop", "=", "[", "'det_cal_file'", ",", "'map_file'", ",",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/PropertyManager.py#L568-L602
GrammaTech/gtirb
415dd72e1e3c475004d013723c16cdcb29c0826e
python/gtirb/section.py
python
Section.symbolic_expressions_at
( self, addrs: typing.Union[int, range] )
Finds all the symbolic expressions that begin at an address or range of addresses. :param addrs: Either a ``range`` object or a single address. :returns: Yields ``(interval, offset, symexpr)`` tuples for every symbolic expression in the range.
Finds all the symbolic expressions that begin at an address or range of addresses.
[ "Finds", "all", "the", "symbolic", "expressions", "that", "begin", "at", "an", "address", "or", "range", "of", "addresses", "." ]
def symbolic_expressions_at( self, addrs: typing.Union[int, range] ) -> typing.Iterable[SymbolicExpressionElement]: """Finds all the symbolic expressions that begin at an address or range of addresses. :param addrs: Either a ``range`` object or a single address. :returns: Yi...
[ "def", "symbolic_expressions_at", "(", "self", ",", "addrs", ":", "typing", ".", "Union", "[", "int", ",", "range", "]", ")", "->", "typing", ".", "Iterable", "[", "SymbolicExpressionElement", "]", ":", "for", "interval", "in", "self", ".", "byte_intervals_o...
https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/section.py#L365-L377
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
Pen.GetStyle
(*args, **kwargs)
return _gdi_.Pen_GetStyle(*args, **kwargs)
GetStyle(self) -> int
GetStyle(self) -> int
[ "GetStyle", "(", "self", ")", "-", ">", "int" ]
def GetStyle(*args, **kwargs): """GetStyle(self) -> int""" return _gdi_.Pen_GetStyle(*args, **kwargs)
[ "def", "GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Pen_GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L412-L414
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/handlers.py
python
DatagramHandler.makeSocket
(self)
return s
The factory method of SocketHandler is here overridden to create a UDP socket (SOCK_DGRAM).
The factory method of SocketHandler is here overridden to create a UDP socket (SOCK_DGRAM).
[ "The", "factory", "method", "of", "SocketHandler", "is", "here", "overridden", "to", "create", "a", "UDP", "socket", "(", "SOCK_DGRAM", ")", "." ]
def makeSocket(self): """ The factory method of SocketHandler is here overridden to create a UDP socket (SOCK_DGRAM). """ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return s
[ "def", "makeSocket", "(", "self", ")", ":", "s", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_DGRAM", ")", "return", "s" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/handlers.py#L616-L622
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
ctpx/ctp3/ctptd.py
python
CtpTd.onRspQryParkedOrder
(self, ParkedOrderField, RspInfoField, requestId, final)
请求查询预埋单响应
请求查询预埋单响应
[ "请求查询预埋单响应" ]
def onRspQryParkedOrder(self, ParkedOrderField, RspInfoField, requestId, final): """请求查询预埋单响应""" pass
[ "def", "onRspQryParkedOrder", "(", "self", ",", "ParkedOrderField", ",", "RspInfoField", ",", "requestId", ",", "final", ")", ":", "pass" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L435-L437
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/swift/utils/swift-bench.py
python
pstdev
(sample)
return math.sqrt(inner)
Given a list of numbers, return the population standard deviation. For a population x_1, x_2, ..., x_N with mean M, the standard deviation is defined as sqrt( 1/N * [ (x_1 - M)^2 + (x_2 - M)^2 + ... + (x_N - M)^2 ] )
Given a list of numbers, return the population standard deviation.
[ "Given", "a", "list", "of", "numbers", "return", "the", "population", "standard", "deviation", "." ]
def pstdev(sample): """Given a list of numbers, return the population standard deviation. For a population x_1, x_2, ..., x_N with mean M, the standard deviation is defined as sqrt( 1/N * [ (x_1 - M)^2 + (x_2 - M)^2 + ... + (x_N - M)^2 ] ) """ if len(sample) == 0: raise ValueError(...
[ "def", "pstdev", "(", "sample", ")", ":", "if", "len", "(", "sample", ")", "==", "0", ":", "raise", "ValueError", "(", "\"Cannot calculate the standard deviation of an \"", "\"empty list!\"", ")", "mean", "=", "sum", "(", "sample", ")", "/", "float", "(", "l...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/swift/utils/swift-bench.py#L65-L78
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
FileHistory.GetHistoryFile
(*args, **kwargs)
return _misc_.FileHistory_GetHistoryFile(*args, **kwargs)
GetHistoryFile(self, int i) -> String
GetHistoryFile(self, int i) -> String
[ "GetHistoryFile", "(", "self", "int", "i", ")", "-", ">", "String" ]
def GetHistoryFile(*args, **kwargs): """GetHistoryFile(self, int i) -> String""" return _misc_.FileHistory_GetHistoryFile(*args, **kwargs)
[ "def", "GetHistoryFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileHistory_GetHistoryFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L950-L952
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/package/_digraph.py
python
DiGraph.to_dot
(self)
return f"""\ digraph G {{ rankdir = LR; node [shape=box]; {edges} }} """
Returns the dot representation of the graph. Returns: A dot representation of the graph.
Returns the dot representation of the graph.
[ "Returns", "the", "dot", "representation", "of", "the", "graph", "." ]
def to_dot(self) -> str: """Returns the dot representation of the graph. Returns: A dot representation of the graph. """ edges = "\n".join(f'"{f}" -> "{t}";' for f, t in self.edges) return f"""\ digraph G {{ rankdir = LR; node [shape=box]; {edges} }} """
[ "def", "to_dot", "(", "self", ")", "->", "str", ":", "edges", "=", "\"\\n\"", ".", "join", "(", "f'\"{f}\" -> \"{t}\";'", "for", "f", ",", "t", "in", "self", ".", "edges", ")", "return", "f\"\"\"\\\ndigraph G {{\nrankdir = LR;\nnode [shape=box];\n{edges}\n}}\n\"\"\"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/_digraph.py#L141-L154
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/pytree.py
python
Base.remove
(self)
Remove the node from the tree. Returns the position of the node in its parent's children before it was removed.
Remove the node from the tree. Returns the position of the node in its parent's children before it was removed.
[ "Remove", "the", "node", "from", "the", "tree", ".", "Returns", "the", "position", "of", "the", "node", "in", "its", "parent", "s", "children", "before", "it", "was", "removed", "." ]
def remove(self): """ Remove the node from the tree. Returns the position of the node in its parent's children before it was removed. """ if self.parent: for i, node in enumerate(self.parent.children): if node is self: self.parent.c...
[ "def", "remove", "(", "self", ")", ":", "if", "self", ".", "parent", ":", "for", "i", ",", "node", "in", "enumerate", "(", "self", ".", "parent", ".", "children", ")", ":", "if", "node", "is", "self", ":", "self", ".", "parent", ".", "changed", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/pytree.py#L138-L149
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/contrib/dag/__init__.py
python
DAG.__init__
(self)
Construct a new DAG with no nodes or edges.
Construct a new DAG with no nodes or edges.
[ "Construct", "a", "new", "DAG", "with", "no", "nodes", "or", "edges", "." ]
def __init__(self): """ Construct a new DAG with no nodes or edges. """ self.__cached_graph = None self.reset_graph()
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "__cached_graph", "=", "None", "self", ".", "reset_graph", "(", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/contrib/dag/__init__.py#L24-L27
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
NodesGTEDegree
(*args)
return _snap.NodesGTEDegree(*args)
NodesGTEDegree(PNEANet Graph, int const Threshold=0) -> int Parameters: Graph: TPt< TNEANet > const & Threshold: int const NodesGTEDegree(PNEANet Graph) -> int Parameters: Graph: TPt< TNEANet > const &
NodesGTEDegree(PNEANet Graph, int const Threshold=0) -> int
[ "NodesGTEDegree", "(", "PNEANet", "Graph", "int", "const", "Threshold", "=", "0", ")", "-", ">", "int" ]
def NodesGTEDegree(*args): """ NodesGTEDegree(PNEANet Graph, int const Threshold=0) -> int Parameters: Graph: TPt< TNEANet > const & Threshold: int const NodesGTEDegree(PNEANet Graph) -> int Parameters: Graph: TPt< TNEANet > const & """ return _snap.NodesGTEDegree(*ar...
[ "def", "NodesGTEDegree", "(", "*", "args", ")", ":", "return", "_snap", ".", "NodesGTEDegree", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L22974-L22988
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/nets/inception_v1.py
python
inception_v1
(inputs, num_classes=1000, is_training=True, dropout_keep_prob=0.8, prediction_fn=layers_lib.softmax, spatial_squeeze=True, reuse=None, scope='InceptionV1')
return logits, end_points
Defines the Inception V1 architecture. This architecture is defined in: Going deeper with convolutions Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, Andrew Rabinovich. http://arxiv.org/pdf/1409.4842v1.pdf. The default i...
Defines the Inception V1 architecture.
[ "Defines", "the", "Inception", "V1", "architecture", "." ]
def inception_v1(inputs, num_classes=1000, is_training=True, dropout_keep_prob=0.8, prediction_fn=layers_lib.softmax, spatial_squeeze=True, reuse=None, scope='InceptionV1'): """Defines the Inception ...
[ "def", "inception_v1", "(", "inputs", ",", "num_classes", "=", "1000", ",", "is_training", "=", "True", ",", "dropout_keep_prob", "=", "0.8", ",", "prediction_fn", "=", "layers_lib", ".", "softmax", ",", "spatial_squeeze", "=", "True", ",", "reuse", "=", "No...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/nets/inception_v1.py#L304-L362
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
MenuItem.SetBitmaps
(*args, **kwargs)
return _core_.MenuItem_SetBitmaps(*args, **kwargs)
SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)
SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)
[ "SetBitmaps", "(", "self", "Bitmap", "bmpChecked", "Bitmap", "bmpUnchecked", "=", "wxNullBitmap", ")" ]
def SetBitmaps(*args, **kwargs): """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" return _core_.MenuItem_SetBitmaps(*args, **kwargs)
[ "def", "SetBitmaps", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuItem_SetBitmaps", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12581-L12583
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
clang/bindings/python/clang/cindex.py
python
TranslationUnit.get_location
(self, filename, position)
return SourceLocation.from_position(self, f, position[0], position[1])
Obtain a SourceLocation for a file in this translation unit. The position can be specified by passing: - Integer file offset. Initial file offset is 0. - 2-tuple of (line number, column number). Initial file position is (0, 0)
Obtain a SourceLocation for a file in this translation unit.
[ "Obtain", "a", "SourceLocation", "for", "a", "file", "in", "this", "translation", "unit", "." ]
def get_location(self, filename, position): """Obtain a SourceLocation for a file in this translation unit. The position can be specified by passing: - Integer file offset. Initial file offset is 0. - 2-tuple of (line number, column number). Initial file position is (0,...
[ "def", "get_location", "(", "self", ",", "filename", ",", "position", ")", ":", "f", "=", "self", ".", "get_file", "(", "filename", ")", "if", "isinstance", "(", "position", ",", "int", ")", ":", "return", "SourceLocation", ".", "from_offset", "(", "self...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L2906-L2920
ethz-asl/rotors_simulator
cd813b7a8c375d677352aa20ad20047feb661126
rotors_evaluation/src/rosbag_tools/analyze_bag.py
python
AnalyzeBag.extract_imu_topics
(self, topic, msg, bag_time)
Append the imu topic msg content to the acc attributes.
Append the imu topic msg content to the acc attributes.
[ "Append", "the", "imu", "topic", "msg", "content", "to", "the", "acc", "attributes", "." ]
def extract_imu_topics(self, topic, msg, bag_time): """Append the imu topic msg content to the acc attributes.""" msg_time = msg.header.stamp.to_sec() for index, imu_topic in enumerate(self.imu_topics): if topic == imu_topic: self.acc[index].x.append(msg.linear_accele...
[ "def", "extract_imu_topics", "(", "self", ",", "topic", ",", "msg", ",", "bag_time", ")", ":", "msg_time", "=", "msg", ".", "header", ".", "stamp", ".", "to_sec", "(", ")", "for", "index", ",", "imu_topic", "in", "enumerate", "(", "self", ".", "imu_top...
https://github.com/ethz-asl/rotors_simulator/blob/cd813b7a8c375d677352aa20ad20047feb661126/rotors_evaluation/src/rosbag_tools/analyze_bag.py#L323-L331
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.node_child_add
(self, *args)
Add a node having as parent the selected node
Add a node having as parent the selected node
[ "Add", "a", "node", "having", "as", "parent", "the", "selected", "node" ]
def node_child_add(self, *args): """Add a node having as parent the selected node""" if not self.is_there_selected_node_or_error(): return ret_name, ret_syntax, ret_tags, ret_ro, ret_c_icon_id, ret_is_bold, ret_fg = self.dialog_nodeprop(_("New Child Node Properties"), syntax_highl=self.syntax_hi...
[ "def", "node_child_add", "(", "self", ",", "*", "args", ")", ":", "if", "not", "self", ".", "is_there_selected_node_or_error", "(", ")", ":", "return", "ret_name", ",", "ret_syntax", ",", "ret_tags", ",", "ret_ro", ",", "ret_c_icon_id", ",", "ret_is_bold", "...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L2918-L2923
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsBitmap.__init__
(self, *args, **kwargs)
__init__(self) -> GraphicsBitmap
__init__(self) -> GraphicsBitmap
[ "__init__", "(", "self", ")", "-", ">", "GraphicsBitmap" ]
def __init__(self, *args, **kwargs): """__init__(self) -> GraphicsBitmap""" _gdi_.GraphicsBitmap_swiginit(self,_gdi_.new_GraphicsBitmap(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "GraphicsBitmap_swiginit", "(", "self", ",", "_gdi_", ".", "new_GraphicsBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5565-L5567
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
MaskedArray.compress
(self, condition, axis=None, out=None)
return _new
Return `a` where condition is ``True``. If condition is a `MaskedArray`, missing values are considered as ``False``. Parameters ---------- condition : var Boolean 1-d array selecting which entries to return. If len(condition) is less than the size of a a...
Return `a` where condition is ``True``.
[ "Return", "a", "where", "condition", "is", "True", "." ]
def compress(self, condition, axis=None, out=None): """ Return `a` where condition is ``True``. If condition is a `MaskedArray`, missing values are considered as ``False``. Parameters ---------- condition : var Boolean 1-d array selecting which entri...
[ "def", "compress", "(", "self", ",", "condition", ",", "axis", "=", "None", ",", "out", "=", "None", ")", ":", "# Get the basic components", "(", "_data", ",", "_mask", ")", "=", "(", "self", ".", "_data", ",", "self", ".", "_mask", ")", "# Force the c...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L3435-L3499
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
python
_ValidateSettings
(validators, settings, stderr)
Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name. The values are themselves dictionaries of setti...
Validates that the settings are valid for MSBuild or MSVS.
[ "Validates", "that", "the", "settings", "are", "valid", "for", "MSBuild", "or", "MSVS", "." ]
def _ValidateSettings(validators, settings, stderr): """Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name...
[ "def", "_ValidateSettings", "(", "validators", ",", "settings", ",", "stderr", ")", ":", "for", "tool_name", "in", "settings", ":", "if", "tool_name", "in", "validators", ":", "tool_validators", "=", "validators", "[", "tool_name", "]", "for", "setting", ",", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py#L515-L547
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py
python
CCompiler_get_version
(self, force=False, ok_status=[0])
return version
Return compiler version, or None if compiler is not available. Parameters ---------- force : bool, optional If True, force a new determination of the version, even if the compiler already has a version attribute. Default is False. ok_status : list of int, optional The list of st...
Return compiler version, or None if compiler is not available.
[ "Return", "compiler", "version", "or", "None", "if", "compiler", "is", "not", "available", "." ]
def CCompiler_get_version(self, force=False, ok_status=[0]): """ Return compiler version, or None if compiler is not available. Parameters ---------- force : bool, optional If True, force a new determination of the version, even if the compiler already has a version attribute. Defau...
[ "def", "CCompiler_get_version", "(", "self", ",", "force", "=", "False", ",", "ok_status", "=", "[", "0", "]", ")", ":", "if", "not", "force", "and", "hasattr", "(", "self", ",", "'version'", ")", ":", "return", "self", ".", "version", "self", ".", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py#L417-L468
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
llvm/bindings/python/llvm/object.py
python
Symbol.size
(self)
return lib.LLVMGetSymbolSize(self)
The size of the symbol, in long bytes.
The size of the symbol, in long bytes.
[ "The", "size", "of", "the", "symbol", "in", "long", "bytes", "." ]
def size(self): """The size of the symbol, in long bytes.""" if self.expired: raise Exception('Symbol instance has expired.') return lib.LLVMGetSymbolSize(self)
[ "def", "size", "(", "self", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Symbol instance has expired.'", ")", "return", "lib", ".", "LLVMGetSymbolSize", "(", "self", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/bindings/python/llvm/object.py#L321-L326
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
examples/python/metadata/helloworld_pb2_grpc.py
python
GreeterServicer.SayHello
(self, request, context)
Sends a greeting
Sends a greeting
[ "Sends", "a", "greeting" ]
def SayHello(self, request, context): """Sends a greeting """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
[ "def", "SayHello", "(", "self", ",", "request", ",", "context", ")", ":", "context", ".", "set_code", "(", "grpc", ".", "StatusCode", ".", "UNIMPLEMENTED", ")", "context", ".", "set_details", "(", "'Method not implemented!'", ")", "raise", "NotImplementedError",...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/examples/python/metadata/helloworld_pb2_grpc.py#L28-L33
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py
python
_PastaEditVisitor._maybe_add_arg_names
(self, node, full_name)
return False
Make args into keyword args if function called full_name requires it.
Make args into keyword args if function called full_name requires it.
[ "Make", "args", "into", "keyword", "args", "if", "function", "called", "full_name", "requires", "it", "." ]
def _maybe_add_arg_names(self, node, full_name): """Make args into keyword args if function called full_name requires it.""" function_reorders = self._api_change_spec.function_reorders if full_name in function_reorders: if uses_star_args_in_call(node): self.add_log(WARNING, node.lineno, node....
[ "def", "_maybe_add_arg_names", "(", "self", ",", "node", ",", "full_name", ")", ":", "function_reorders", "=", "self", ".", "_api_change_spec", ".", "function_reorders", "if", "full_name", "in", "function_reorders", ":", "if", "uses_star_args_in_call", "(", "node", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py#L449-L478
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/gem5/components/processors/gups_generator.py
python
GUPSGenerator.__init__
( self, start_addr: Addr, mem_size: str, update_limit: int = 0, clk_freq: Optional[str] = None, )
The GUPSGenerator class This class defines the interface for a single core GUPSGenerator, this generator could be used in place of a processor. For multicore versions of this generator look at GUPSGeneraorEP (EP stands for embarrassingly parallel) and GUPSGeneratorPAR (PAR stands for par...
The GUPSGenerator class This class defines the interface for a single core GUPSGenerator, this generator could be used in place of a processor. For multicore versions of this generator look at GUPSGeneraorEP (EP stands for embarrassingly parallel) and GUPSGeneratorPAR (PAR stands for par...
[ "The", "GUPSGenerator", "class", "This", "class", "defines", "the", "interface", "for", "a", "single", "core", "GUPSGenerator", "this", "generator", "could", "be", "used", "in", "place", "of", "a", "processor", ".", "For", "multicore", "versions", "of", "this"...
def __init__( self, start_addr: Addr, mem_size: str, update_limit: int = 0, clk_freq: Optional[str] = None, ): """The GUPSGenerator class This class defines the interface for a single core GUPSGenerator, this generator could be used in place of a proce...
[ "def", "__init__", "(", "self", ",", "start_addr", ":", "Addr", ",", "mem_size", ":", "str", ",", "update_limit", ":", "int", "=", "0", ",", "clk_freq", ":", "Optional", "[", "str", "]", "=", "None", ",", ")", ":", "super", "(", ")", ".", "__init__...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/processors/gups_generator.py#L39-L69
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiTabCtrl.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> AuiTabCtrl
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> AuiTabCtrl
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "ID_ANY", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", ")", "-", ">", "AuiTabCtrl" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> AuiTabCtrl """ _aui.AuiTabCtrl_swiginit(self,_aui.new_AuiTabCtrl(*args, **kwargs)) self._setOORInfo(self)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_aui", ".", "AuiTabCtrl_swiginit", "(", "self", ",", "_aui", ".", "new_AuiTabCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORInfo",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1268-L1274
xenia-project/xenia
9b1fdac98665ac091b9660a5d0fbb259ed79e578
third_party/google-styleguide/cpplint/cpplint.py
python
_IncludeState.CanonicalizeAlphabeticalOrder
(self, header_path)
return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicali...
Returns a path canonicalized for alphabetical comparison.
[ "Returns", "a", "path", "canonicalized", "for", "alphabetical", "comparison", "." ]
def CanonicalizeAlphabeticalOrder(self, header_path): """Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_p...
[ "def", "CanonicalizeAlphabeticalOrder", "(", "self", ",", "header_path", ")", ":", "return", "header_path", ".", "replace", "(", "'-inl.h'", ",", "'.h'", ")", ".", "replace", "(", "'-'", ",", "'_'", ")", ".", "lower", "(", ")" ]
https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L587-L600
fontmatrix/fontmatrix
ce9cee8868c3ba38787c26c132fa5d3394d68bf9
OSX-package/linktools/MachO.py
python
findExecutables
(bundleDir)
return result
Return a list of MachO.Executables found in bundleDir
Return a list of MachO.Executables found in bundleDir
[ "Return", "a", "list", "of", "MachO", ".", "Executables", "found", "in", "bundleDir" ]
def findExecutables(bundleDir): "Return a list of MachO.Executables found in bundleDir" result = [] pat = re.compile("Mach-O (.+)") for root, dirs, files in os.walk(bundleDir): for n in files: p = os.path.join(root, n) f = os.popen("file -b " + p, "r") m = pat.match(f.readline()) if m != None: res...
[ "def", "findExecutables", "(", "bundleDir", ")", ":", "result", "=", "[", "]", "pat", "=", "re", ".", "compile", "(", "\"Mach-O (.+)\"", ")", "for", "root", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "bundleDir", ")", ":", "for", "n", ...
https://github.com/fontmatrix/fontmatrix/blob/ce9cee8868c3ba38787c26c132fa5d3394d68bf9/OSX-package/linktools/MachO.py#L81-L94
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/node/misc.py
python
GritNode.GetOutputFiles
(self)
Returns the list of <output> nodes that are descendants of this node's <outputs> child and are not enclosed by unsatisfied <if> conditionals.
Returns the list of <output> nodes that are descendants of this node's <outputs> child and are not enclosed by unsatisfied <if> conditionals.
[ "Returns", "the", "list", "of", "<output", ">", "nodes", "that", "are", "descendants", "of", "this", "node", "s", "<outputs", ">", "child", "and", "are", "not", "enclosed", "by", "unsatisfied", "<if", ">", "conditionals", "." ]
def GetOutputFiles(self): """Returns the list of <output> nodes that are descendants of this node's <outputs> child and are not enclosed by unsatisfied <if> conditionals. """ for child in self.children: if child.name == 'outputs': return [node for node in child.ActiveDescendants() ...
[ "def", "GetOutputFiles", "(", "self", ")", ":", "for", "child", "in", "self", ".", "children", ":", "if", "child", ".", "name", "==", "'outputs'", ":", "return", "[", "node", "for", "node", "in", "child", ".", "ActiveDescendants", "(", ")", "if", "node...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/misc.py#L522-L530
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monoCriterion.py
python
MonoCriterion.tolerance
(self)
return self._tolerance
The tolerance used by the criterion
The tolerance used by the criterion
[ "The", "tolerance", "used", "by", "the", "criterion" ]
def tolerance(self) -> float: """The tolerance used by the criterion""" return self._tolerance
[ "def", "tolerance", "(", "self", ")", "->", "float", ":", "return", "self", ".", "_tolerance" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monoCriterion.py#L70-L72
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/index_composite.py
python
IndexComposite.logged
(self)
return self._logged
Gets the logged of this IndexComposite. # noqa: E501 :return: The logged of this IndexComposite. # noqa: E501 :rtype: datetime
Gets the logged of this IndexComposite. # noqa: E501
[ "Gets", "the", "logged", "of", "this", "IndexComposite", ".", "#", "noqa", ":", "E501" ]
def logged(self): """Gets the logged of this IndexComposite. # noqa: E501 :return: The logged of this IndexComposite. # noqa: E501 :rtype: datetime """ return self._logged
[ "def", "logged", "(", "self", ")", ":", "return", "self", ".", "_logged" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/index_composite.py#L208-L215
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/mirroring/module.py
python
Module.snapshot_mirror_distribution
(self, fs_name: str)
return self.fs_snapshot_mirror.show_distribution(fs_name)
Get current instance to directory map for a filesystem
Get current instance to directory map for a filesystem
[ "Get", "current", "instance", "to", "directory", "map", "for", "a", "filesystem" ]
def snapshot_mirror_distribution(self, fs_name: str): """Get current instance to directory map for a filesystem""" return self.fs_snapshot_mirror.show_distribution(fs_name)
[ "def", "snapshot_mirror_distribution", "(", "self", ",", "fs_name", ":", "str", ")", ":", "return", "self", ".", "fs_snapshot_mirror", ".", "show_distribution", "(", "fs_name", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/mirroring/module.py#L95-L98
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/ordered_dict.py
python
OrderedDict.viewkeys
(self)
return KeysView(self)
od.viewkeys() -> a set-like object providing a view on od's keys
od.viewkeys() -> a set-like object providing a view on od's keys
[ "od", ".", "viewkeys", "()", "-", ">", "a", "set", "-", "like", "object", "providing", "a", "view", "on", "od", "s", "keys" ]
def viewkeys(self): "od.viewkeys() -> a set-like object providing a view on od's keys" return KeysView(self)
[ "def", "viewkeys", "(", "self", ")", ":", "return", "KeysView", "(", "self", ")" ]
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/ordered_dict.py#L249-L251
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/inspect.py
python
getsourcefile
(object)
Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source.
Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source.
[ "Return", "the", "filename", "that", "can", "be", "used", "to", "locate", "an", "object", "s", "source", ".", "Return", "None", "if", "no", "way", "can", "be", "identified", "to", "get", "the", "source", "." ]
def getsourcefile(object): """Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source. """ filename = getfile(object) if string.lower(filename[-4:]) in ('.pyc', '.pyo'): filename = filename[:-4] + '.py' for suffix, mode...
[ "def", "getsourcefile", "(", "object", ")", ":", "filename", "=", "getfile", "(", "object", ")", "if", "string", ".", "lower", "(", "filename", "[", "-", "4", ":", "]", ")", "in", "(", "'.pyc'", ",", "'.pyo'", ")", ":", "filename", "=", "filename", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/inspect.py#L439-L457
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/convert_dex_profile.py
python
ProcessDex
(dex_dump)
return classes_by_name
Parses dexdump output returning a dict of class names to Class objects Parses output of the dexdump command on a dex file and extracts information about classes and their respective methods and which line numbers a method is mapped to. Methods that are not mapped to any line number are ignored and not listed ...
Parses dexdump output returning a dict of class names to Class objects
[ "Parses", "dexdump", "output", "returning", "a", "dict", "of", "class", "names", "to", "Class", "objects" ]
def ProcessDex(dex_dump): """Parses dexdump output returning a dict of class names to Class objects Parses output of the dexdump command on a dex file and extracts information about classes and their respective methods and which line numbers a method is mapped to. Methods that are not mapped to any line num...
[ "def", "ProcessDex", "(", "dex_dump", ")", ":", "# class_name: Class", "classes_by_name", "=", "{", "}", "current_class", "=", "None", "current_method", "=", "None", "reading_positions", "=", "False", "reading_methods", "=", "False", "method_line_numbers", "=", "[",...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/convert_dex_profile.py#L295-L351
Evolving-AI-Lab/fooling
66f097dd6bd2eb6794ade3e187a7adfdf1887688
caffe/scripts/cpp_lint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal...
https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L4617-L4682
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
tools/idl_parser/idl_parser.py
python
IDLParser.p_Special
(self, p)
Special : GETTER | SETTER | CREATOR | DELETER | LEGACYCALLER
Special : GETTER | SETTER | CREATOR | DELETER | LEGACYCALLER
[ "Special", ":", "GETTER", "|", "SETTER", "|", "CREATOR", "|", "DELETER", "|", "LEGACYCALLER" ]
def p_Special(self, p): """Special : GETTER | SETTER | CREATOR | DELETER | LEGACYCALLER""" p[0] = self.BuildTrue(p[1].upper())
[ "def", "p_Special", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "self", ".", "BuildTrue", "(", "p", "[", "1", "]", ".", "upper", "(", ")", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L546-L552
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/symbol/register.py
python
_make_symbol_function
(handle, name, func_name)
return symbol_function
Create a symbol function by handle and function name.
Create a symbol function by handle and function name.
[ "Create", "a", "symbol", "function", "by", "handle", "and", "function", "name", "." ]
def _make_symbol_function(handle, name, func_name): """Create a symbol function by handle and function name.""" code, doc_str = _generate_symbol_function_code(handle, name, func_name) local = {} exec(code, None, local) # pylint: disable=exec-used symbol_function = local[func_name] symbol_funct...
[ "def", "_make_symbol_function", "(", "handle", ",", "name", ",", "func_name", ")", ":", "code", ",", "doc_str", "=", "_generate_symbol_function_code", "(", "handle", ",", "name", ",", "func_name", ")", "local", "=", "{", "}", "exec", "(", "code", ",", "Non...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/register.py#L199-L209
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py
python
StataWriter._close
(self)
Close the file if it was created by the writer. If a buffer or file-like object was passed in, for example a GzipFile, then leave this file open for the caller to close. In either case, attempt to flush the file contents to ensure they are written to disk (if supported)
Close the file if it was created by the writer.
[ "Close", "the", "file", "if", "it", "was", "created", "by", "the", "writer", "." ]
def _close(self): """ Close the file if it was created by the writer. If a buffer or file-like object was passed in, for example a GzipFile, then leave this file open for the caller to close. In either case, attempt to flush the file contents to ensure they are written to disk ...
[ "def", "_close", "(", "self", ")", ":", "# Some file-like objects might not support flush", "try", ":", "self", ".", "_file", ".", "flush", "(", ")", "except", "AttributeError", ":", "pass", "if", "self", ".", "_own_file", ":", "self", ".", "_file", ".", "cl...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py#L2389-L2404
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
Config.set_library_file
(filename)
Set the exact location of libclang
Set the exact location of libclang
[ "Set", "the", "exact", "location", "of", "libclang" ]
def set_library_file(filename): """Set the exact location of libclang""" if Config.loaded: raise Exception("library file must be set before before using " \ "any other functionalities in libclang.") Config.library_file = filename
[ "def", "set_library_file", "(", "filename", ")", ":", "if", "Config", ".", "loaded", ":", "raise", "Exception", "(", "\"library file must be set before before using \"", "\"any other functionalities in libclang.\"", ")", "Config", ".", "library_file", "=", "filename" ]
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L3780-L3786
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/mozjar.py
python
JarReader.__contains__
(self, name)
return name in self.entries
Return whether the given file name appears in the Jar archive.
Return whether the given file name appears in the Jar archive.
[ "Return", "whether", "the", "given", "file", "name", "appears", "in", "the", "Jar", "archive", "." ]
def __contains__(self, name): ''' Return whether the given file name appears in the Jar archive. ''' return name in self.entries
[ "def", "__contains__", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "entries" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/mozjar.py#L446-L450
AcademySoftwareFoundation/OpenColorIO
73508eb5230374df8d96147a0627c015d359a641
src/apps/pyociodisplay/pyociodisplay.py
python
ImageView.exposure
(self)
return self.exposure_spinbox.value()
:return: Exposure value :rtype: float
:return: Exposure value :rtype: float
[ ":", "return", ":", "Exposure", "value", ":", "rtype", ":", "float" ]
def exposure(self): """ :return: Exposure value :rtype: float """ return self.exposure_spinbox.value()
[ "def", "exposure", "(", "self", ")", ":", "return", "self", ".", "exposure_spinbox", ".", "value", "(", ")" ]
https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/73508eb5230374df8d96147a0627c015d359a641/src/apps/pyociodisplay/pyociodisplay.py#L1175-L1180
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
CheckCStyleCast
(filename, clean_lines, linenum, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The string for the C++ cast to recommend. This is either reinterpret_cast, static_...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "match", "=", "Search", "(", "pattern", ",", "line", ...
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L5820-L5870
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/random_forest.py
python
LossMonitor.set_estimator
(self, est)
This function gets called in the same graph as _get_train_ops.
This function gets called in the same graph as _get_train_ops.
[ "This", "function", "gets", "called", "in", "the", "same", "graph", "as", "_get_train_ops", "." ]
def set_estimator(self, est): """This function gets called in the same graph as _get_train_ops.""" super(LossMonitor, self).set_estimator(est) self._loss_op_name = est.training_loss.name
[ "def", "set_estimator", "(", "self", ",", "est", ")", ":", "super", "(", "LossMonitor", ",", "self", ")", ".", "set_estimator", "(", "est", ")", "self", ".", "_loss_op_name", "=", "est", ".", "training_loss", ".", "name" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/random_forest.py#L68-L71
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pygments/token.py
python
is_token_subtype
(ttype, other)
return ttype in other
Return True if ``ttype`` is a subtype of ``other``. exists for backwards compatibility. use ``ttype in other`` now.
Return True if ``ttype`` is a subtype of ``other``.
[ "Return", "True", "if", "ttype", "is", "a", "subtype", "of", "other", "." ]
def is_token_subtype(ttype, other): """ Return True if ``ttype`` is a subtype of ``other``. exists for backwards compatibility. use ``ttype in other`` now. """ return ttype in other
[ "def", "is_token_subtype", "(", "ttype", ",", "other", ")", ":", "return", "ttype", "in", "other" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pygments/token.py#L76-L82
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/waiter.py
python
Waiter.__init__
(self, name, config, operation_method)
:type name: string :param name: The name of the waiter :type config: botocore.waiter.SingleWaiterConfig :param config: The configuration for the waiter. :type operation_method: callable :param operation_method: A callable that accepts **kwargs and returns a response...
[]
def __init__(self, name, config, operation_method): """ :type name: string :param name: The name of the waiter :type config: botocore.waiter.SingleWaiterConfig :param config: The configuration for the waiter. :type operation_method: callable :param operation_me...
[ "def", "__init__", "(", "self", ",", "name", ",", "config", ",", "operation_method", ")", ":", "self", ".", "_operation_method", "=", "operation_method", "# The two attributes are exposed to allow for introspection", "# and documentation.", "self", ".", "name", "=", "na...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/waiter.py#L266-L285
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet3Plus/unet_collection/swin.py
python
swin_unet_2d_base
(input_tensor, filter_num_begin, depth, stack_num_down, stack_num_up, patch_size, num_heads, window_size, num_mlp, shift_window=True, name='swin_unet')
return X
The base of SwinUNET.
The base of SwinUNET.
[ "The", "base", "of", "SwinUNET", "." ]
def swin_unet_2d_base(input_tensor, filter_num_begin, depth, stack_num_down, stack_num_up, patch_size, num_heads, window_size, num_mlp, shift_window=True, name='swin_unet'): ''' The base of SwinUNET. ''' # Compute n...
[ "def", "swin_unet_2d_base", "(", "input_tensor", ",", "filter_num_begin", ",", "depth", ",", "stack_num_down", ",", "stack_num_up", ",", "patch_size", ",", "num_heads", ",", "window_size", ",", "num_mlp", ",", "shift_window", "=", "True", ",", "name", "=", "'swi...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet3Plus/unet_collection/swin.py#L57-L156
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriOperationBlock.py
python
PhactoriOperationBlock.MakeListOfAllPoints1
(self)
return recursionItem.mParameters.mGlobalNodeIdList, \ recursionItem.mParameters.mPointXYZList
recursively going through multiblock setup, make a list of all the points in this operation output in this process. We get a list of global node ids and a list of xyz geometry points
recursively going through multiblock setup, make a list of all the points in this operation output in this process. We get a list of global node ids and a list of xyz geometry points
[ "recursively", "going", "through", "multiblock", "setup", "make", "a", "list", "of", "all", "the", "points", "in", "this", "operation", "output", "in", "this", "process", ".", "We", "get", "a", "list", "of", "global", "node", "ids", "and", "a", "list", "...
def MakeListOfAllPoints1(self): """recursively going through multiblock setup, make a list of all the points in this operation output in this process. We get a list of global node ids and a list of xyz geometry points""" recursionItem = BlockRecursionControlItem() recursionItem.mParameters = ...
[ "def", "MakeListOfAllPoints1", "(", "self", ")", ":", "recursionItem", "=", "BlockRecursionControlItem", "(", ")", "recursionItem", ".", "mParameters", "=", "PhactoriOperationBlock", ".", "MakeListOfAllPoints1Params", "(", ")", "recursionItem", ".", "mOperationToDoPerBloc...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriOperationBlock.py#L521-L532
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/android/battery_utils.py
python
BatteryUtils.__init__
(self, device, default_timeout=_DEFAULT_TIMEOUT, default_retries=_DEFAULT_RETRIES)
BatteryUtils constructor. Args: device: A DeviceUtils instance. default_timeout: An integer containing the default number of seconds to wait for an operation to complete if no explicit value is provided. default_retries: An integer contain...
BatteryUtils constructor.
[ "BatteryUtils", "constructor", "." ]
def __init__(self, device, default_timeout=_DEFAULT_TIMEOUT, default_retries=_DEFAULT_RETRIES): """BatteryUtils constructor. Args: device: A DeviceUtils instance. default_timeout: An integer containing the default number of seconds to wait for an operat...
[ "def", "__init__", "(", "self", ",", "device", ",", "default_timeout", "=", "_DEFAULT_TIMEOUT", ",", "default_retries", "=", "_DEFAULT_RETRIES", ")", ":", "if", "not", "isinstance", "(", "device", ",", "device_utils", ".", "DeviceUtils", ")", ":", "raise", "Ty...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/battery_utils.py#L137-L157
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
get_fill_value
(a)
return result
The fill value of a, if it has one; otherwise, the default fill value for that type.
The fill value of a, if it has one; otherwise, the default fill value for that type.
[ "The", "fill", "value", "of", "a", "if", "it", "has", "one", ";", "otherwise", "the", "default", "fill", "value", "for", "that", "type", "." ]
def get_fill_value (a): """ The fill value of a, if it has one; otherwise, the default fill value for that type. """ if isMaskedArray(a): result = a.fill_value() else: result = default_fill_value(a) return result
[ "def", "get_fill_value", "(", "a", ")", ":", "if", "isMaskedArray", "(", "a", ")", ":", "result", "=", "a", ".", "fill_value", "(", ")", "else", ":", "result", "=", "default_fill_value", "(", "a", ")", "return", "result" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L249-L258
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/special/orthogonal.py
python
_initial_nodes_b
(n, k)
return xksq
Gatteschi initial guesses Computes an initial approximation to the square of the `k`-th (positive) root :math:`x_k` of the Hermite polynomial :math:`H_n` of order :math:`n`. The formula is the one from lemma 3.2 in the original paper. The guesses are accurate in the region just below :math:`\sqrt{2...
Gatteschi initial guesses
[ "Gatteschi", "initial", "guesses" ]
def _initial_nodes_b(n, k): """Gatteschi initial guesses Computes an initial approximation to the square of the `k`-th (positive) root :math:`x_k` of the Hermite polynomial :math:`H_n` of order :math:`n`. The formula is the one from lemma 3.2 in the original paper. The guesses are accurate in the r...
[ "def", "_initial_nodes_b", "(", "n", ",", "k", ")", ":", "a", "=", "n", "%", "2", "-", "0.5", "nu", "=", "4.0", "*", "floor", "(", "n", "/", "2.0", ")", "+", "2.0", "*", "a", "+", "2.0", "# Airy roots by approximation", "ak", "=", "specfun", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/orthogonal.py#L787-L824