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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGProperty.OnMeasureImage
(*args, **kwargs)
return _propgrid.PGProperty_OnMeasureImage(*args, **kwargs)
OnMeasureImage(self, int item=-1) -> Size
OnMeasureImage(self, int item=-1) -> Size
[ "OnMeasureImage", "(", "self", "int", "item", "=", "-", "1", ")", "-", ">", "Size" ]
def OnMeasureImage(*args, **kwargs): """OnMeasureImage(self, int item=-1) -> Size""" return _propgrid.PGProperty_OnMeasureImage(*args, **kwargs)
[ "def", "OnMeasureImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_OnMeasureImage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L380-L382
facebook/hermes
b1b1a00ab468ec1b397b31b71587110044830970
tools/hbc-attribute/accumulate.py
python
Accumulation.insertLeaf
(self, dic, obj)
Registers an allocation unit as being used by a group.
Registers an allocation unit as being used by a group.
[ "Registers", "an", "allocation", "unit", "as", "being", "used", "by", "a", "group", "." ]
def insertLeaf(self, dic, obj): """Registers an allocation unit as being used by a group.""" for key in obj["type"].split(":"): assert LEAFNODE not in dic dic = getOrAssignEmpty(dic, key) dic[LEAFNODE] = True if obj["dedupKey"] in dic: # All units fr...
[ "def", "insertLeaf", "(", "self", ",", "dic", ",", "obj", ")", ":", "for", "key", "in", "obj", "[", "\"type\"", "]", ".", "split", "(", "\":\"", ")", ":", "assert", "LEAFNODE", "not", "in", "dic", "dic", "=", "getOrAssignEmpty", "(", "dic", ",", "k...
https://github.com/facebook/hermes/blob/b1b1a00ab468ec1b397b31b71587110044830970/tools/hbc-attribute/accumulate.py#L59-L71
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
configure.py
python
get_python_major_version
(python_bin_path)
return run_shell([python_bin_path, '-c', 'import sys; print(sys.version[0])'])
Get the python major version.
Get the python major version.
[ "Get", "the", "python", "major", "version", "." ]
def get_python_major_version(python_bin_path): """Get the python major version.""" return run_shell([python_bin_path, '-c', 'import sys; print(sys.version[0])'])
[ "def", "get_python_major_version", "(", "python_bin_path", ")", ":", "return", "run_shell", "(", "[", "python_bin_path", ",", "'-c'", ",", "'import sys; print(sys.version[0])'", "]", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/configure.py#L174-L176
Jittor/jittor
e9aca0444c2bdc8e2389d99122954cd0903eec46
python/jittor/transform/__init__.py
python
RandomResizedCrop.get_params
(img, scale, ratio)
return i, j, h, w
Get parameters for ``crop`` for a random sized crop. Args: img (PIL Image): Image to be cropped. scale (tuple): range of size of the origin size cropped ratio (tuple): range of aspect ratio of the origin aspect ratio cropped Returns: tuple: params (i, j,...
Get parameters for ``crop`` for a random sized crop.
[ "Get", "parameters", "for", "crop", "for", "a", "random", "sized", "crop", "." ]
def get_params(img, scale, ratio): """Get parameters for ``crop`` for a random sized crop. Args: img (PIL Image): Image to be cropped. scale (tuple): range of size of the origin size cropped ratio (tuple): range of aspect ratio of the origin aspect ratio cropped ...
[ "def", "get_params", "(", "img", ",", "scale", ",", "ratio", ")", ":", "width", ",", "height", "=", "_get_image_size", "(", "img", ")", "area", "=", "height", "*", "width", "for", "attempt", "in", "range", "(", "10", ")", ":", "target_area", "=", "ra...
https://github.com/Jittor/jittor/blob/e9aca0444c2bdc8e2389d99122954cd0903eec46/python/jittor/transform/__init__.py#L1102-L1143
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetIdlBuildData
(self, source, config)
return outdir, output, variables, flags
Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.
Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.
[ "Determine", "the", "implicit", "outputs", "for", "an", "idl", "file", ".", "Returns", "output", "directory", "outputs", "and", "variables", "and", "flags", "that", "are", "required", "." ]
def GetIdlBuildData(self, source, config): """Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.""" config = self._RealConfig(config) midl_get = self._GetWrapper(self, self.msvs_settings[config], 'VCMIDLTool') def midl(name, ...
[ "def", "GetIdlBuildData", "(", "self", ",", "source", ",", "config", ")", ":", "config", "=", "self", ".", "_RealConfig", "(", "config", ")", "midl_get", "=", "self", ".", "_GetWrapper", "(", "self", ",", "self", ".", "msvs_settings", "[", "config", "]",...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py#L521-L545
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/pexpect-4.6/pexpect/screen.py
python
screen.erase_down
(self)
Erases the screen from the current line down to the bottom of the screen.
Erases the screen from the current line down to the bottom of the screen.
[ "Erases", "the", "screen", "from", "the", "current", "line", "down", "to", "the", "bottom", "of", "the", "screen", "." ]
def erase_down (self): # <ESC>[0J -or- <ESC>[J '''Erases the screen from the current line down to the bottom of the screen.''' self.erase_end_of_line () self.fill_region (self.cur_r + 1, 1, self.rows, self.cols)
[ "def", "erase_down", "(", "self", ")", ":", "# <ESC>[0J -or- <ESC>[J", "self", ".", "erase_end_of_line", "(", ")", "self", ".", "fill_region", "(", "self", ".", "cur_r", "+", "1", ",", "1", ",", "self", ".", "rows", ",", "self", ".", "cols", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L393-L398
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.GetClientSize
(*args, **kwargs)
return _core_.Window_GetClientSize(*args, **kwargs)
GetClientSize(self) -> Size This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.
GetClientSize(self) -> Size
[ "GetClientSize", "(", "self", ")", "-", ">", "Size" ]
def GetClientSize(*args, **kwargs): """ GetClientSize(self) -> Size This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc. """ return _core_.Wi...
[ "def", "GetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9525-L9533
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.UnsetSortingColumn
(*args, **kwargs)
return _grid.Grid_UnsetSortingColumn(*args, **kwargs)
UnsetSortingColumn(self)
UnsetSortingColumn(self)
[ "UnsetSortingColumn", "(", "self", ")" ]
def UnsetSortingColumn(*args, **kwargs): """UnsetSortingColumn(self)""" return _grid.Grid_UnsetSortingColumn(*args, **kwargs)
[ "def", "UnsetSortingColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_UnsetSortingColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L2185-L2187
CMU-Perceptual-Computing-Lab/MonocularTotalCapture
f69a12ead1abc412bcb14bb066ec3a60292d6cf3
POF/utils/general.py
python
crop_image_from_xy
(image, crop_location, crop_size, scale=1.0)
Crops an image. When factor is not given does an central crop. Inputs: image: 4D tensor, [batch, height, width, channels] which will be cropped in height and width dimension crop_location: tensor, [batch, 2] which represent the height and width location of the crop crop_size: int, describes...
Crops an image. When factor is not given does an central crop.
[ "Crops", "an", "image", ".", "When", "factor", "is", "not", "given", "does", "an", "central", "crop", "." ]
def crop_image_from_xy(image, crop_location, crop_size, scale=1.0): """ Crops an image. When factor is not given does an central crop. Inputs: image: 4D tensor, [batch, height, width, channels] which will be cropped in height and width dimension crop_location: tensor, [batch, 2] which repre...
[ "def", "crop_image_from_xy", "(", "image", ",", "crop_location", ",", "crop_size", ",", "scale", "=", "1.0", ")", ":", "with", "tf", ".", "name_scope", "(", "'crop_image_from_xy'", ")", ":", "s", "=", "image", ".", "get_shape", "(", ")", ".", "as_list", ...
https://github.com/CMU-Perceptual-Computing-Lab/MonocularTotalCapture/blob/f69a12ead1abc412bcb14bb066ec3a60292d6cf3/POF/utils/general.py#L60-L93
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Simulator.getState
(self)
return _robotsim.Simulator_getState(self)
r""" Gets the current simulation state, including controller parameters, etc. Returns: A Base64 string representing the binary data for the state
r""" Gets the current simulation state, including controller parameters, etc.
[ "r", "Gets", "the", "current", "simulation", "state", "including", "controller", "parameters", "etc", "." ]
def getState(self) ->str: r""" Gets the current simulation state, including controller parameters, etc. Returns: A Base64 string representing the binary data for the state """ return _robotsim.Simulator_getState(self)
[ "def", "getState", "(", "self", ")", "->", "str", ":", "return", "_robotsim", ".", "Simulator_getState", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7822-L7832
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/libgithub.py
python
Addon.sync_from
(self, src, exclude)
return len(status) > 0
Synchronises add-on from another directory. src: Directory with new add-on version. exclude: List of files to ignore. Returns whether anything changed. Raises libgithub.Error if the checkout is not clean.
Synchronises add-on from another directory.
[ "Synchronises", "add", "-", "on", "from", "another", "directory", "." ]
def sync_from(self, src, exclude): """Synchronises add-on from another directory. src: Directory with new add-on version. exclude: List of files to ignore. Returns whether anything changed. Raises libgithub.Error if the checkout is not clean. """ logging.debug("S...
[ "def", "sync_from", "(", "self", ",", "src", ",", "exclude", ")", ":", "logging", ".", "debug", "(", "\"Syncing add-on {0} from add-on server ({1})\"", ".", "format", "(", "self", ".", "name", ",", "src", ")", ")", "status", "=", "self", ".", "_status", "(...
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/libgithub.py#L149-L169
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
SizerItemList_iterator.next
(*args, **kwargs)
return _core_.SizerItemList_iterator_next(*args, **kwargs)
next(self) -> SizerItem
next(self) -> SizerItem
[ "next", "(", "self", ")", "-", ">", "SizerItem" ]
def next(*args, **kwargs): """next(self) -> SizerItem""" return _core_.SizerItemList_iterator_next(*args, **kwargs)
[ "def", "next", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItemList_iterator_next", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13966-L13968
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/jax/_vmap_chunked.py
python
vmap_chunked
(f: Callable, in_axes=0, *, chunk_size: Optional[int])
return _chunk_vmapped_function(vmapped_fun, chunk_size, argnums)
Behaves like jax.vmap but uses scan to chunk the computations in smaller chunks.
Behaves like jax.vmap but uses scan to chunk the computations in smaller chunks.
[ "Behaves", "like", "jax", ".", "vmap", "but", "uses", "scan", "to", "chunk", "the", "computations", "in", "smaller", "chunks", "." ]
def vmap_chunked(f: Callable, in_axes=0, *, chunk_size: Optional[int]): """ Behaves like jax.vmap but uses scan to chunk the computations in smaller chunks. """ if isinstance(in_axes, int): in_axes = (in_axes,) if not set(in_axes).issubset((0, None)): raise NotImplementedError("Only...
[ "def", "vmap_chunked", "(", "f", ":", "Callable", ",", "in_axes", "=", "0", ",", "*", ",", "chunk_size", ":", "Optional", "[", "int", "]", ")", ":", "if", "isinstance", "(", "in_axes", ",", "int", ")", ":", "in_axes", "=", "(", "in_axes", ",", ")",...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/jax/_vmap_chunked.py#L60-L76
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_MakeCredential_REQUEST.__init__
(self, handle = TPM_HANDLE(), credential = None, objectName = None)
This command allows the TPM to perform the actions required of a Certificate Authority (CA) in creating a TPM2B_ID_OBJECT containing an activation credential. Attributes: handle (TPM_HANDLE): Loaded public area, used to encrypt the sensitive area containing the crede...
This command allows the TPM to perform the actions required of a Certificate Authority (CA) in creating a TPM2B_ID_OBJECT containing an activation credential.
[ "This", "command", "allows", "the", "TPM", "to", "perform", "the", "actions", "required", "of", "a", "Certificate", "Authority", "(", "CA", ")", "in", "creating", "a", "TPM2B_ID_OBJECT", "containing", "an", "activation", "credential", "." ]
def __init__(self, handle = TPM_HANDLE(), credential = None, objectName = None): """ This command allows the TPM to perform the actions required of a Certificate Authority (CA) in creating a TPM2B_ID_OBJECT containing an activation credential. Attributes: handle (TPM_HANDLE)...
[ "def", "__init__", "(", "self", ",", "handle", "=", "TPM_HANDLE", "(", ")", ",", "credential", "=", "None", ",", "objectName", "=", "None", ")", ":", "self", ".", "handle", "=", "handle", "self", ".", "credential", "=", "credential", "self", ".", "obje...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9920-L9934
vmtk/vmtk
927331ad752265199390eabbbf2e07cdc2b4bcc6
vmtkScripts/contrib/vmtknumpyreader.py
python
vmtkNumpyReader.ReadHDF5File
(self)
Load a dictionary from an HDF5 file.
Load a dictionary from an HDF5 file.
[ "Load", "a", "dictionary", "from", "an", "HDF5", "file", "." ]
def ReadHDF5File(self): """ Load a dictionary from an HDF5 file. """ try: import h5py except ImportError: self.PrintError('ImportError: Unable to Write to hdf5. h5py module not installed') raise ImportError('Unable to Write to hdf5. h5py modul...
[ "def", "ReadHDF5File", "(", "self", ")", ":", "try", ":", "import", "h5py", "except", "ImportError", ":", "self", ".", "PrintError", "(", "'ImportError: Unable to Write to hdf5. h5py module not installed'", ")", "raise", "ImportError", "(", "'Unable to Write to hdf5. h5py...
https://github.com/vmtk/vmtk/blob/927331ad752265199390eabbbf2e07cdc2b4bcc6/vmtkScripts/contrib/vmtknumpyreader.py#L61-L86
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/feature.py
python
get
(name)
return __all_features[name]
Return the Feature instance for the specified name. Throws if no feature by such name exists
Return the Feature instance for the specified name.
[ "Return", "the", "Feature", "instance", "for", "the", "specified", "name", "." ]
def get(name): """Return the Feature instance for the specified name. Throws if no feature by such name exists """ return __all_features[name]
[ "def", "get", "(", "name", ")", ":", "return", "__all_features", "[", "name", "]" ]
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/feature.py#L144-L149
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/rfc822.py
python
AddrlistClass.getquote
(self)
return self.getdelimited('"', '"\r', 0)
Get a quote-delimited fragment from self's field.
Get a quote-delimited fragment from self's field.
[ "Get", "a", "quote", "-", "delimited", "fragment", "from", "self", "s", "field", "." ]
def getquote(self): """Get a quote-delimited fragment from self's field.""" return self.getdelimited('"', '"\r', 0)
[ "def", "getquote", "(", "self", ")", ":", "return", "self", ".", "getdelimited", "(", "'\"'", ",", "'\"\\r'", ",", "0", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/rfc822.py#L716-L718
ycm-core/ycmd
fc0fb7e5e15176cc5a2a30c80956335988c6b59a
ycmd/completers/cs/cs_completer.py
python
CsharpSolutionCompleter.ServerIsReady
( self )
Check if our OmniSharp server is ready (loaded solution file).
Check if our OmniSharp server is ready (loaded solution file).
[ "Check", "if", "our", "OmniSharp", "server", "is", "ready", "(", "loaded", "solution", "file", ")", "." ]
def ServerIsReady( self ): """ Check if our OmniSharp server is ready (loaded solution file).""" if not self._ServerIsRunning(): return False try: return self._GetResponse( '/checkreadystatus', timeout = .2 ) except Exception: return False
[ "def", "ServerIsReady", "(", "self", ")", ":", "if", "not", "self", ".", "_ServerIsRunning", "(", ")", ":", "return", "False", "try", ":", "return", "self", ".", "_GetResponse", "(", "'/checkreadystatus'", ",", "timeout", "=", ".2", ")", "except", "Excepti...
https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/cs/cs_completer.py#L846-L854
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/perf/page_sets/pregenerated_profile_shared_state.py
python
PregeneratedProfileSharedState._MigratePregeneratedProfile
(self)
Migrates the pre-generated profile by launching Chrome with it. On success, updates self._migrated_profile and self._finder_options.browser_options.profile_dir with the directory of the migrated profile.
Migrates the pre-generated profile by launching Chrome with it.
[ "Migrates", "the", "pre", "-", "generated", "profile", "by", "launching", "Chrome", "with", "it", "." ]
def _MigratePregeneratedProfile(self): """Migrates the pre-generated profile by launching Chrome with it. On success, updates self._migrated_profile and self._finder_options.browser_options.profile_dir with the directory of the migrated profile. """ self._migrated_profile = tempfile.mkdtemp() ...
[ "def", "_MigratePregeneratedProfile", "(", "self", ")", ":", "self", ".", "_migrated_profile", "=", "tempfile", ".", "mkdtemp", "(", ")", "logging", ".", "info", "(", "\"Starting migration of pre-generated profile to %s\"", ",", "self", ".", "_migrated_profile", ")", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/page_sets/pregenerated_profile_shared_state.py#L140-L157
bigtreetech/BIGTREETECH-SKR-V1.3
b238aa402753e81d551b7d34a181a262a138ae9e
BTT SKR V1.4/Firmware/Marlin-bugfix-2.0.x-SKR-V1.4/buildroot/share/scripts/createTemperatureLookupMarlin.py
python
Thermistor.adc
(self, temp)
return (r / (self.rp + r)) * ARES
Convert temperature into a ADC reading
Convert temperature into a ADC reading
[ "Convert", "temperature", "into", "a", "ADC", "reading" ]
def adc(self, temp): "Convert temperature into a ADC reading" x = (self.c1 - (1.0 / (temp+ZERO))) / (2*self.c3) y = sqrt((self.c2 / (3*self.c3))**3 + x**2) r = exp((y-x)**(1.0/3) - (y+x)**(1.0/3)) return (r / (self.rp + r)) * ARES
[ "def", "adc", "(", "self", ",", "temp", ")", ":", "x", "=", "(", "self", ".", "c1", "-", "(", "1.0", "/", "(", "temp", "+", "ZERO", ")", ")", ")", "/", "(", "2", "*", "self", ".", "c3", ")", "y", "=", "sqrt", "(", "(", "self", ".", "c2"...
https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/b238aa402753e81d551b7d34a181a262a138ae9e/BTT SKR V1.4/Firmware/Marlin-bugfix-2.0.x-SKR-V1.4/buildroot/share/scripts/createTemperatureLookupMarlin.py#L82-L87
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/number-of-pairs-of-strings-with-concatenation-equal-to-target.py
python
Solution2.numOfPairs
(self, nums, target)
return result
:type nums: List[str] :type target: str :rtype: int
:type nums: List[str] :type target: str :rtype: int
[ ":", "type", "nums", ":", "List", "[", "str", "]", ":", "type", "target", ":", "str", ":", "rtype", ":", "int" ]
def numOfPairs(self, nums, target): """ :type nums: List[str] :type target: str :rtype: int """ prefix, suffix = collections.Counter(), collections.Counter() result = 0 for num in nums: if target.startswith(num): result += suffi...
[ "def", "numOfPairs", "(", "self", ",", "nums", ",", "target", ")", ":", "prefix", ",", "suffix", "=", "collections", ".", "Counter", "(", ")", ",", "collections", ".", "Counter", "(", ")", "result", "=", "0", "for", "num", "in", "nums", ":", "if", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/number-of-pairs-of-strings-with-concatenation-equal-to-target.py#L33-L50
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py
python
Coroutine.close
(self)
Raise GeneratorExit inside coroutine.
Raise GeneratorExit inside coroutine.
[ "Raise", "GeneratorExit", "inside", "coroutine", "." ]
def close(self): """Raise GeneratorExit inside coroutine. """ try: self.throw(GeneratorExit) except (GeneratorExit, StopIteration): pass else: raise RuntimeError("coroutine ignored GeneratorExit")
[ "def", "close", "(", "self", ")", ":", "try", ":", "self", ".", "throw", "(", "GeneratorExit", ")", "except", "(", "GeneratorExit", ",", "StopIteration", ")", ":", "pass", "else", ":", "raise", "RuntimeError", "(", "\"coroutine ignored GeneratorExit\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py#L138-L146
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/retry.py
python
Retry._is_method_retryable
(self, method)
return True
Checks if a given HTTP method should be retried upon, depending if it is included on the method whitelist.
Checks if a given HTTP method should be retried upon, depending if it is included on the method whitelist.
[ "Checks", "if", "a", "given", "HTTP", "method", "should", "be", "retried", "upon", "depending", "if", "it", "is", "included", "on", "the", "method", "whitelist", "." ]
def _is_method_retryable(self, method): """ Checks if a given HTTP method should be retried upon, depending if it is included on the method whitelist. """ if self.method_whitelist and method.upper() not in self.method_whitelist: return False return True
[ "def", "_is_method_retryable", "(", "self", ",", "method", ")", ":", "if", "self", ".", "method_whitelist", "and", "method", ".", "upper", "(", ")", "not", "in", "self", ".", "method_whitelist", ":", "return", "False", "return", "True" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/retry.py#L285-L292
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/dtypes.py
python
Registry.register
(self, dtype: Type[ExtensionDtype])
Parameters ---------- dtype : ExtensionDtype
Parameters ---------- dtype : ExtensionDtype
[ "Parameters", "----------", "dtype", ":", "ExtensionDtype" ]
def register(self, dtype: Type[ExtensionDtype]) -> None: """ Parameters ---------- dtype : ExtensionDtype """ if not issubclass(dtype, ExtensionDtype): raise ValueError("can only register pandas extension dtypes") self.dtypes.append(dtype)
[ "def", "register", "(", "self", ",", "dtype", ":", "Type", "[", "ExtensionDtype", "]", ")", "->", "None", ":", "if", "not", "issubclass", "(", "dtype", ",", "ExtensionDtype", ")", ":", "raise", "ValueError", "(", "\"can only register pandas extension dtypes\"", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/dtypes.py#L64-L73
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
clang/bindings/python/clang/cindex.py
python
CompilationDatabase.getAllCompileCommands
(self)
return conf.lib.clang_CompilationDatabase_getAllCompileCommands(self)
Get an iterable object providing all the CompileCommands available from the database.
Get an iterable object providing all the CompileCommands available from the database.
[ "Get", "an", "iterable", "object", "providing", "all", "the", "CompileCommands", "available", "from", "the", "database", "." ]
def getAllCompileCommands(self): """ Get an iterable object providing all the CompileCommands available from the database. """ return conf.lib.clang_CompilationDatabase_getAllCompileCommands(self)
[ "def", "getAllCompileCommands", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CompilationDatabase_getAllCompileCommands", "(", "self", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L3265-L3270
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
TextAttr.HasBackgroundColour
(*args, **kwargs)
return _controls_.TextAttr_HasBackgroundColour(*args, **kwargs)
HasBackgroundColour(self) -> bool
HasBackgroundColour(self) -> bool
[ "HasBackgroundColour", "(", "self", ")", "-", ">", "bool" ]
def HasBackgroundColour(*args, **kwargs): """HasBackgroundColour(self) -> bool""" return _controls_.TextAttr_HasBackgroundColour(*args, **kwargs)
[ "def", "HasBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_HasBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1772-L1774
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_filter.py
python
_depthwise_conv2d_backprop_filter_tbe
()
return
DepthwiseConv2DBackpropFilter TBE register
DepthwiseConv2DBackpropFilter TBE register
[ "DepthwiseConv2DBackpropFilter", "TBE", "register" ]
def _depthwise_conv2d_backprop_filter_tbe(): """DepthwiseConv2DBackpropFilter TBE register""" return
[ "def", "_depthwise_conv2d_backprop_filter_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_filter.py#L39-L41
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/_edje.py
python
SyntaxData.GetProperties
(self)
return [FOLD, FOLD_PRE]
Returns a list of Extra Properties to set
Returns a list of Extra Properties to set
[ "Returns", "a", "list", "of", "Extra", "Properties", "to", "set" ]
def GetProperties(self): """Returns a list of Extra Properties to set """ return [FOLD, FOLD_PRE]
[ "def", "GetProperties", "(", "self", ")", ":", "return", "[", "FOLD", ",", "FOLD_PRE", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_edje.py#L95-L97
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Panel.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, String name=PanelNameStr) -> Panel
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, String name=PanelNameStr) -> Panel
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "wxTAB_TRAVERSAL|wxNO_BORDER", "String", "name", "=", "PanelNameStr", ")", "-", ">", "P...
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, String name=PanelNameStr) -> Panel """ _windows_.Panel_swiginit(self,_windows_.new_Panel(...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_windows_", ".", "Panel_swiginit", "(", "self", ",", "_windows_", ".", "new_Panel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORInfo",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L62-L69
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/network/network.py
python
Edges.get_distances
(self, id_mode=0, is_check_lanes=False, is_precise=True, modeconst_excl=0.0, modeconst_mix=0.0)
return dists
Returns distances for all edges. The returned array represents the distance that corresponds to edge IDs. If is_check_lanes is True, then the lane speeds are considered where the respective mode is allowed. If not allowed on a particular edge, then the respective edge d...
Returns distances for all edges. The returned array represents the distance that corresponds to edge IDs.
[ "Returns", "distances", "for", "all", "edges", ".", "The", "returned", "array", "represents", "the", "distance", "that", "corresponds", "to", "edge", "IDs", "." ]
def get_distances(self, id_mode=0, is_check_lanes=False, is_precise=True, modeconst_excl=0.0, modeconst_mix=0.0): """ Returns distances for all edges. The returned array represents the distance that corresponds to edge IDs. If is_check_lanes is True, then the lane speeds are con...
[ "def", "get_distances", "(", "self", ",", "id_mode", "=", "0", ",", "is_check_lanes", "=", "False", ",", "is_precise", "=", "True", ",", "modeconst_excl", "=", "0.0", ",", "modeconst_mix", "=", "0.0", ")", ":", "print", "'get_distances id_mode,is_check_lanes,spe...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/network/network.py#L2008-L2068
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/bullet/minitaur.py
python
Minitaur.GetBasePosition
(self)
return position
Get the position of minitaur's base. Returns: The position of minitaur's base.
Get the position of minitaur's base.
[ "Get", "the", "position", "of", "minitaur", "s", "base", "." ]
def GetBasePosition(self): """Get the position of minitaur's base. Returns: The position of minitaur's base. """ position, _ = (self._pybullet_client.getBasePositionAndOrientation(self.quadruped)) return position
[ "def", "GetBasePosition", "(", "self", ")", ":", "position", ",", "_", "=", "(", "self", ".", "_pybullet_client", ".", "getBasePositionAndOrientation", "(", "self", ".", "quadruped", ")", ")", "return", "position" ]
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/bullet/minitaur.py#L253-L260
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/rsa/rsa/key.py
python
PublicKey.load_pkcs1_openssl_pem
(cls, keyfile)
return cls.load_pkcs1_openssl_der(der)
Loads a PKCS#1.5 PEM-encoded public key file from OpenSSL. These files can be recognised in that they start with BEGIN PUBLIC KEY rather than BEGIN RSA PUBLIC KEY. The contents of the file before the "-----BEGIN PUBLIC KEY-----" and after the "-----END PUBLIC KEY-----" ...
Loads a PKCS#1.5 PEM-encoded public key file from OpenSSL. These files can be recognised in that they start with BEGIN PUBLIC KEY rather than BEGIN RSA PUBLIC KEY. The contents of the file before the "-----BEGIN PUBLIC KEY-----" and after the "-----END PUBLIC KEY-----" ...
[ "Loads", "a", "PKCS#1", ".", "5", "PEM", "-", "encoded", "public", "key", "file", "from", "OpenSSL", ".", "These", "files", "can", "be", "recognised", "in", "that", "they", "start", "with", "BEGIN", "PUBLIC", "KEY", "rather", "than", "BEGIN", "RSA", "PUB...
def load_pkcs1_openssl_pem(cls, keyfile): '''Loads a PKCS#1.5 PEM-encoded public key file from OpenSSL. These files can be recognised in that they start with BEGIN PUBLIC KEY rather than BEGIN RSA PUBLIC KEY. The contents of the file before the "-----BEGIN PUBLIC KEY---...
[ "def", "load_pkcs1_openssl_pem", "(", "cls", ",", "keyfile", ")", ":", "der", "=", "rsa", ".", "pem", ".", "load_pem", "(", "keyfile", ",", "'PUBLIC KEY'", ")", "return", "cls", ".", "load_pkcs1_openssl_der", "(", "der", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/key.py#L204-L219
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/parser.py
python
Parser.parse_statements
(self, end_tokens, drop_needle=False)
return result
Parse multiple statements into a list until one of the end tokens is reached. This is used to parse the body of statements as it also parses template data if appropriate. The parser checks first if the current token is a colon and skips it if there is one. Then it checks for the block...
Parse multiple statements into a list until one of the end tokens is reached. This is used to parse the body of statements as it also parses template data if appropriate. The parser checks first if the current token is a colon and skips it if there is one. Then it checks for the block...
[ "Parse", "multiple", "statements", "into", "a", "list", "until", "one", "of", "the", "end", "tokens", "is", "reached", ".", "This", "is", "used", "to", "parse", "the", "body", "of", "statements", "as", "it", "also", "parses", "template", "data", "if", "a...
def parse_statements(self, end_tokens, drop_needle=False): """Parse multiple statements into a list until one of the end tokens is reached. This is used to parse the body of statements as it also parses template data if appropriate. The parser checks first if the current token is a col...
[ "def", "parse_statements", "(", "self", ",", "end_tokens", ",", "drop_needle", "=", "False", ")", ":", "# the first token may be a colon for python compatibility", "self", ".", "stream", ".", "skip_if", "(", "'colon'", ")", "# in the future it would be possible to add whole...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/parser.py#L149-L174
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/colorsetter.py
python
ColorSetter.__UpdateValues
(self)
Update the values based on the current state of the text control
Update the values based on the current state of the text control
[ "Update", "the", "values", "based", "on", "the", "current", "state", "of", "the", "text", "control" ]
def __UpdateValues(self): """Update the values based on the current state of the text control""" with Freezer(self._txt) as _tmp: cpos = self._txt.GetInsertionPoint() hexstr = self._txt.GetValue().replace('#', '').strip() valid = '' for char in hexstr: ...
[ "def", "__UpdateValues", "(", "self", ")", ":", "with", "Freezer", "(", "self", ".", "_txt", ")", "as", "_tmp", ":", "cpos", "=", "self", ".", "_txt", ".", "GetInsertionPoint", "(", ")", "hexstr", "=", "self", ".", "_txt", ".", "GetValue", "(", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/colorsetter.py#L110-L127
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/framework/python/framework/checkpoint_utils.py
python
init_from_checkpoint
(checkpoint_dir, assignment_map)
Using assignment map initializes current variables with loaded tensors. Note: This overrides default initialization ops of specified variables and redefines dtype. Assignment map supports following syntax: * `'checkpoint_scope_name/': 'scope_name/'` - will load all variables in current `scope_name` from ...
Using assignment map initializes current variables with loaded tensors.
[ "Using", "assignment", "map", "initializes", "current", "variables", "with", "loaded", "tensors", "." ]
def init_from_checkpoint(checkpoint_dir, assignment_map): """Using assignment map initializes current variables with loaded tensors. Note: This overrides default initialization ops of specified variables and redefines dtype. Assignment map supports following syntax: * `'checkpoint_scope_name/': 'scope_name...
[ "def", "init_from_checkpoint", "(", "checkpoint_dir", ",", "assignment_map", ")", ":", "filepattern", "=", "_get_checkpoint_filename", "(", "checkpoint_dir", ")", "reader", "=", "load_checkpoint", "(", "checkpoint_dir", ")", "variable_map", "=", "reader", ".", "get_va...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/framework/python/framework/checkpoint_utils.py#L152-L300
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextBoxAttr.GetOutline
(*args)
return _richtext.TextBoxAttr_GetOutline(*args)
GetOutline(self) -> TextAttrBorders GetOutline(self) -> TextAttrBorders
GetOutline(self) -> TextAttrBorders GetOutline(self) -> TextAttrBorders
[ "GetOutline", "(", "self", ")", "-", ">", "TextAttrBorders", "GetOutline", "(", "self", ")", "-", ">", "TextAttrBorders" ]
def GetOutline(*args): """ GetOutline(self) -> TextAttrBorders GetOutline(self) -> TextAttrBorders """ return _richtext.TextBoxAttr_GetOutline(*args)
[ "def", "GetOutline", "(", "*", "args", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetOutline", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L768-L773
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py
python
BasicFittingModel.plot_guess_start_x
(self, plot_guess_start_x: float)
Sets the start x to use in the guess plot.
Sets the start x to use in the guess plot.
[ "Sets", "the", "start", "x", "to", "use", "in", "the", "guess", "plot", "." ]
def plot_guess_start_x(self, plot_guess_start_x: float) -> None: """Sets the start x to use in the guess plot.""" self.fitting_context.plot_guess_start_x = plot_guess_start_x
[ "def", "plot_guess_start_x", "(", "self", ",", "plot_guess_start_x", ":", "float", ")", "->", "None", ":", "self", ".", "fitting_context", ".", "plot_guess_start_x", "=", "plot_guess_start_x" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L400-L402
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.RefreshAttr
(*args, **kwargs)
return _grid.Grid_RefreshAttr(*args, **kwargs)
RefreshAttr(self, int row, int col)
RefreshAttr(self, int row, int col)
[ "RefreshAttr", "(", "self", "int", "row", "int", "col", ")" ]
def RefreshAttr(*args, **kwargs): """RefreshAttr(self, int row, int col)""" return _grid.Grid_RefreshAttr(*args, **kwargs)
[ "def", "RefreshAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_RefreshAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1722-L1724
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py
python
IMetadataProvider.metadata_isdir
(name)
Is the named metadata a directory? (like ``os.path.isdir()``)
Is the named metadata a directory? (like ``os.path.isdir()``)
[ "Is", "the", "named", "metadata", "a", "directory?", "(", "like", "os", ".", "path", ".", "isdir", "()", ")" ]
def metadata_isdir(name): """Is the named metadata a directory? (like ``os.path.isdir()``)"""
[ "def", "metadata_isdir", "(", "name", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L516-L517
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
plugin/src/fv_converter/python_bridge/python/space_splitter.py
python
SpaceSplitter.split
(self, text)
return result
Splits the input text with space. The input text is typed as ``str``. This method should return list of boundaries (pair of beginning position and length), e.g., ``[ (0, 1), (3, 4) ]``.
Splits the input text with space.
[ "Splits", "the", "input", "text", "with", "space", "." ]
def split(self, text): """ Splits the input text with space. The input text is typed as ``str``. This method should return list of boundaries (pair of beginning position and length), e.g., ``[ (0, 1), (3, 4) ]``. """ result = [] begin = 0 length ...
[ "def", "split", "(", "self", ",", "text", ")", ":", "result", "=", "[", "]", "begin", "=", "0", "length", "=", "0", "for", "(", "pos", ",", "char", ")", "in", "enumerate", "(", "text", ")", ":", "if", "char", "==", "' '", ":", "if", "0", "<",...
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/plugin/src/fv_converter/python_bridge/python/space_splitter.py#L15-L38
KhronosGroup/SPIR
f33c27876d9f3d5810162b60fa89cc13d2b55725
bindings/python/clang/cindex.py
python
CursorKind.is_statement
(self)
return conf.lib.clang_isStatement(self)
Test if this is a statement kind.
Test if this is a statement kind.
[ "Test", "if", "this", "is", "a", "statement", "kind", "." ]
def is_statement(self): """Test if this is a statement kind.""" return conf.lib.clang_isStatement(self)
[ "def", "is_statement", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isStatement", "(", "self", ")" ]
https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L531-L533
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
SizerItem.SetFlag
(*args, **kwargs)
return _core_.SizerItem_SetFlag(*args, **kwargs)
SetFlag(self, int flag) Set the flag value for this item.
SetFlag(self, int flag)
[ "SetFlag", "(", "self", "int", "flag", ")" ]
def SetFlag(*args, **kwargs): """ SetFlag(self, int flag) Set the flag value for this item. """ return _core_.SizerItem_SetFlag(*args, **kwargs)
[ "def", "SetFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItem_SetFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14203-L14209
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/evaluation/metric.py
python
MetricCore.__init__
( self, name: Text, scope: MetricScope, single_ep_aggregator: Callable[[Sequence[Any]], Any], multi_ep_aggregator: Callable[[Sequence[Any]], Dict[Text, Any]], )
Initializes the class. Args: name: The name of the metric, for example "motor_torques", "distance_to_wall", etc. The full name of the metric will have scope name in the prefix, i.e. "scope/name". scope: The scope of this metric. Most metric should be for DEBUG purpose. The scope...
Initializes the class.
[ "Initializes", "the", "class", "." ]
def __init__( self, name: Text, scope: MetricScope, single_ep_aggregator: Callable[[Sequence[Any]], Any], multi_ep_aggregator: Callable[[Sequence[Any]], Dict[Text, Any]], ): """Initializes the class. Args: name: The name of the metric, for example "motor_torques", ...
[ "def", "__init__", "(", "self", ",", "name", ":", "Text", ",", "scope", ":", "MetricScope", ",", "single_ep_aggregator", ":", "Callable", "[", "[", "Sequence", "[", "Any", "]", "]", ",", "Any", "]", ",", "multi_ep_aggregator", ":", "Callable", "[", "[", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/evaluation/metric.py#L38-L67
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/util.py
python
GetFileType
(fname)
Get what the type of the file is as Editra sees it in a formatted string. @param fname: file path @return: string (formatted/translated filetype)
Get what the type of the file is as Editra sees it in a formatted string. @param fname: file path @return: string (formatted/translated filetype)
[ "Get", "what", "the", "type", "of", "the", "file", "is", "as", "Editra", "sees", "it", "in", "a", "formatted", "string", ".", "@param", "fname", ":", "file", "path", "@return", ":", "string", "(", "formatted", "/", "translated", "filetype", ")" ]
def GetFileType(fname): """Get what the type of the file is as Editra sees it in a formatted string. @param fname: file path @return: string (formatted/translated filetype) """ if os.path.isdir(fname): return _("Folder") eguess = syntax.GetTypeFromExt(fname.split('.')[-1]) if e...
[ "def", "GetFileType", "(", "fname", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "fname", ")", ":", "return", "_", "(", "\"Folder\"", ")", "eguess", "=", "syntax", ".", "GetTypeFromExt", "(", "fname", ".", "split", "(", "'.'", ")", "[", "-...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/util.py#L366-L386
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py
python
iddp_svd
(eps, A)
return U, V, S
Compute SVD of a real matrix to a specified relative precision. :param eps: Relative precision. :type eps: float :param A: Matrix. :type A: :class:`numpy.ndarray` :return: Left singular vectors. :rtype: :class:`numpy.ndarray` :return: Right singular vectors....
Compute SVD of a real matrix to a specified relative precision.
[ "Compute", "SVD", "of", "a", "real", "matrix", "to", "a", "specified", "relative", "precision", "." ]
def iddp_svd(eps, A): """ Compute SVD of a real matrix to a specified relative precision. :param eps: Relative precision. :type eps: float :param A: Matrix. :type A: :class:`numpy.ndarray` :return: Left singular vectors. :rtype: :class:`numpy.ndarray` :retur...
[ "def", "iddp_svd", "(", "eps", ",", "A", ")", ":", "A", "=", "np", ".", "asfortranarray", "(", "A", ")", "m", ",", "n", "=", "A", ".", "shape", "k", ",", "iU", ",", "iV", ",", "iS", ",", "w", ",", "ier", "=", "_id", ".", "iddp_svd", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L448-L477
infinidb/infinidb
6c9f5dfdabc41ad80e81ba9e1a4eb0d7271a5d23
writeengine/bulk/qa-bulkload.py
python
main
()
Bulk load the database.. Check that we can write OIDfiles, that all required tools exist, clean up old files, sort the index inserts and generally rock and roll
Bulk load the database.. Check that we can write OIDfiles, that all required tools exist, clean up old files, sort the index inserts and generally rock and roll
[ "Bulk", "load", "the", "database", "..", "Check", "that", "we", "can", "write", "OIDfiles", "that", "all", "required", "tools", "exist", "clean", "up", "old", "files", "sort", "the", "index", "inserts", "and", "generally", "rock", "and", "roll" ]
def main(): """ Bulk load the database.. Check that we can write OIDfiles, that all required tools exist, clean up old files, sort the index inserts and generally rock and roll """ start_dir = curdir=os.getcwd() # remember where we started if not os.access('.', os.W_OK): os.chdir('/tmp') logger...
[ "def", "main", "(", ")", ":", "start_dir", "=", "curdir", "=", "os", ".", "getcwd", "(", ")", "# remember where we started", "if", "not", "os", ".", "access", "(", "'.'", ",", "os", ".", "W_OK", ")", ":", "os", ".", "chdir", "(", "'/tmp'", ")", "lo...
https://github.com/infinidb/infinidb/blob/6c9f5dfdabc41ad80e81ba9e1a4eb0d7271a5d23/writeengine/bulk/qa-bulkload.py#L178-L300
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/core_set.py
python
_Spawn
(site_list_file, graph_sets, input_dir, output_dir, workers)
Spool site computation out to a multiprocessing pool.
Spool site computation out to a multiprocessing pool.
[ "Spool", "site", "computation", "out", "to", "a", "multiprocessing", "pool", "." ]
def _Spawn(site_list_file, graph_sets, input_dir, output_dir, workers): """Spool site computation out to a multiprocessing pool.""" with file(site_list_file) as site_file: sites = [l.strip() for l in site_file.readlines()] _Progress('Using sites:\n %s' % '\n '.join(sites)) pool = multiprocessing.Pool(worker...
[ "def", "_Spawn", "(", "site_list_file", ",", "graph_sets", ",", "input_dir", ",", "output_dir", ",", "workers", ")", ":", "with", "file", "(", "site_list_file", ")", "as", "site_file", ":", "sites", "=", "[", "l", ".", "strip", "(", ")", "for", "l", "i...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/core_set.py#L81-L88
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/lookup_ops.py
python
TableInitializerBase.value_dtype
(self)
return self._value_dtype
The expected table value dtype.
The expected table value dtype.
[ "The", "expected", "table", "value", "dtype", "." ]
def value_dtype(self): """The expected table value dtype.""" return self._value_dtype
[ "def", "value_dtype", "(", "self", ")", ":", "return", "self", ".", "_value_dtype" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/lookup_ops.py#L494-L496
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
set_shapes_for_outputs
(op)
Uses the registered shape functions to set the shapes for op's outputs.
Uses the registered shape functions to set the shapes for op's outputs.
[ "Uses", "the", "registered", "shape", "functions", "to", "set", "the", "shapes", "for", "op", "s", "outputs", "." ]
def set_shapes_for_outputs(op): """Uses the registered shape functions to set the shapes for op's outputs.""" try: shape_func = _shape_registry.lookup(op.type) except LookupError: try: shape_func = _default_shape_function_registry.lookup(op.type) except LookupError: shape_func = _call_cpp_...
[ "def", "set_shapes_for_outputs", "(", "op", ")", ":", "try", ":", "shape_func", "=", "_shape_registry", ".", "lookup", "(", "op", ".", "type", ")", "except", "LookupError", ":", "try", ":", "shape_func", "=", "_default_shape_function_registry", ".", "lookup", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L1901-L1930
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/proto.py
python
_PyName
(desc, pkg)
return desc.fqname[len(pkg)+1:]
Return the Python name of the entity in |desc| from proto package |pkg|.
Return the Python name of the entity in |desc| from proto package |pkg|.
[ "Return", "the", "Python", "name", "of", "the", "entity", "in", "|desc|", "from", "proto", "package", "|pkg|", "." ]
def _PyName(desc, pkg): """Return the Python name of the entity in |desc| from proto package |pkg|.""" if not pkg: return desc.fqname assert desc.fqname.startswith(pkg) return desc.fqname[len(pkg)+1:]
[ "def", "_PyName", "(", "desc", ",", "pkg", ")", ":", "if", "not", "pkg", ":", "return", "desc", ".", "fqname", "assert", "desc", ".", "fqname", ".", "startswith", "(", "pkg", ")", "return", "desc", ".", "fqname", "[", "len", "(", "pkg", ")", "+", ...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/proto.py#L65-L69
Dobiasd/frugally-deep
99d9378c6ef537a209bcb2a102e953899a6ab0e3
keras_export/convert_model.py
python
show_softmax_layer
(layer)
Serialize softmax layer to dict
Serialize softmax layer to dict
[ "Serialize", "softmax", "layer", "to", "dict" ]
def show_softmax_layer(layer): """Serialize softmax layer to dict""" assert layer.axis == -1
[ "def", "show_softmax_layer", "(", "layer", ")", ":", "assert", "layer", ".", "axis", "==", "-", "1" ]
https://github.com/Dobiasd/frugally-deep/blob/99d9378c6ef537a209bcb2a102e953899a6ab0e3/keras_export/convert_model.py#L487-L489
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/affiliate.py
python
Affiliate.prev_comm
(self)
return self._prev_comm
Gets the prev_comm of this Affiliate. # noqa: E501 :return: The prev_comm of this Affiliate. # noqa: E501 :rtype: float
Gets the prev_comm of this Affiliate. # noqa: E501
[ "Gets", "the", "prev_comm", "of", "this", "Affiliate", ".", "#", "noqa", ":", "E501" ]
def prev_comm(self): """Gets the prev_comm of this Affiliate. # noqa: E501 :return: The prev_comm of this Affiliate. # noqa: E501 :rtype: float """ return self._prev_comm
[ "def", "prev_comm", "(", "self", ")", ":", "return", "self", ".", "_prev_comm" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/affiliate.py#L217-L224
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/mstats_basic.py
python
trim
(a, limits=None, inclusive=(True,True), relative=False, axis=None)
Trims an array by masking the data outside some given limits. Returns a masked version of the input array. %s Examples -------- >>> from scipy.stats.mstats import trim >>> z = [ 1, 2, 3, 4, 5, 6, 7, 8, 9,10] >>> print(trim(z,(3,8))) [-- -- 3 4 5 6 7 8 -- --] >>> print(trim(z,(0.1,...
Trims an array by masking the data outside some given limits.
[ "Trims", "an", "array", "by", "masking", "the", "data", "outside", "some", "given", "limits", "." ]
def trim(a, limits=None, inclusive=(True,True), relative=False, axis=None): """ Trims an array by masking the data outside some given limits. Returns a masked version of the input array. %s Examples -------- >>> from scipy.stats.mstats import trim >>> z = [ 1, 2, 3, 4, 5, 6, 7, 8, 9,1...
[ "def", "trim", "(", "a", ",", "limits", "=", "None", ",", "inclusive", "=", "(", "True", ",", "True", ")", ",", "relative", "=", "False", ",", "axis", "=", "None", ")", ":", "if", "relative", ":", "return", "trimr", "(", "a", ",", "limits", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/mstats_basic.py#L1445-L1466
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/editor.py
python
EditorShellNotebookFrame.bufferDestroy
(self)
Destroy the current buffer.
Destroy the current buffer.
[ "Destroy", "the", "current", "buffer", "." ]
def bufferDestroy(self): """Destroy the current buffer.""" if self.buffer: self.editor = None del self.buffers[self.buffer.id] self.buffer = None # Do this before DeletePage(). if self._singlefile: self.notebook.Destroy() self.notebook...
[ "def", "bufferDestroy", "(", "self", ")", ":", "if", "self", ".", "buffer", ":", "self", ".", "editor", "=", "None", "del", "self", ".", "buffers", "[", "self", ".", "buffer", ".", "id", "]", "self", ".", "buffer", "=", "None", "# Do this before Delete...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/editor.py#L472-L484
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/walterPanel/walterOutliner.py
python
TreeModel.setData
(self, index, value, role=QtCore.Qt.EditRole)
return False
Set the role data for the item at index to value.
Set the role data for the item at index to value.
[ "Set", "the", "role", "data", "for", "the", "item", "at", "index", "to", "value", "." ]
def setData(self, index, value, role=QtCore.Qt.EditRole): """Set the role data for the item at index to value.""" if not index.isValid(): return False if role == QtCore.Qt.EditRole and value: item = index.internalPointer() originItem = item.getOriginItem() ...
[ "def", "setData", "(", "self", ",", "index", ",", "value", ",", "role", "=", "QtCore", ".", "Qt", ".", "EditRole", ")", ":", "if", "not", "index", ".", "isValid", "(", ")", ":", "return", "False", "if", "role", "==", "QtCore", ".", "Qt", ".", "Ed...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterOutliner.py#L947-L995
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
PyWindow.DoSetSize
(*args, **kwargs)
return _windows_.PyWindow_DoSetSize(*args, **kwargs)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
[ "DoSetSize", "(", "self", "int", "x", "int", "y", "int", "width", "int", "height", "int", "sizeFlags", "=", "SIZE_AUTO", ")" ]
def DoSetSize(*args, **kwargs): """DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)""" return _windows_.PyWindow_DoSetSize(*args, **kwargs)
[ "def", "DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyWindow_DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4158-L4160
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/powercycle/lib/__init__.py
python
PowercycleCommand.is_windows
()
return sys.platform == "win32" or sys.platform == "cygwin"
:return: True if running on Windows.
:return: True if running on Windows.
[ ":", "return", ":", "True", "if", "running", "on", "Windows", "." ]
def is_windows() -> bool: """:return: True if running on Windows.""" return sys.platform == "win32" or sys.platform == "cygwin"
[ "def", "is_windows", "(", ")", "->", "bool", ":", "return", "sys", ".", "platform", "==", "\"win32\"", "or", "sys", ".", "platform", "==", "\"cygwin\"" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/powercycle/lib/__init__.py#L40-L42
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/command/install_egg_info.py
python
to_filename
(name)
return name.replace('-','_')
Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'.
Convert a project or version name to its filename-escaped form
[ "Convert", "a", "project", "or", "version", "name", "to", "its", "filename", "-", "escaped", "form" ]
def to_filename(name): """Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. """ return name.replace('-','_')
[ "def", "to_filename", "(", "name", ")", ":", "return", "name", ".", "replace", "(", "'-'", ",", "'_'", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/command/install_egg_info.py#L72-L77
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_train.py
python
train
()
Train CIFAR-10 for a number of steps.
Train CIFAR-10 for a number of steps.
[ "Train", "CIFAR", "-", "10", "for", "a", "number", "of", "steps", "." ]
def train(): """Train CIFAR-10 for a number of steps.""" with tf.Graph().as_default(): global_step = tf.Variable(0, trainable=False) # Get images and labels for CIFAR-10. images, labels = cifar10.distorted_inputs() # Build a Graph that computes the logits predictions from the # inference model...
[ "def", "train", "(", ")", ":", "with", "tf", ".", "Graph", "(", ")", ".", "as_default", "(", ")", ":", "global_step", "=", "tf", ".", "Variable", "(", "0", ",", "trainable", "=", "False", ")", "# Get images and labels for CIFAR-10.", "images", ",", "labe...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_train.py#L60-L122
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/pipeline/pipeline_base.py
python
PipelineBase._register_extension
(self, extension)
Experimental interface to register an extension :param extension: :return:
Experimental interface to register an extension
[ "Experimental", "interface", "to", "register", "an", "extension" ]
def _register_extension(self, extension): """ Experimental interface to register an extension :param extension: :return: """ from bigflow.extension import BigFlowExtension if not isinstance(extension, BigFlowExtension): raise error.BigflowRuntimeException("Ex...
[ "def", "_register_extension", "(", "self", ",", "extension", ")", ":", "from", "bigflow", ".", "extension", "import", "BigFlowExtension", "if", "not", "isinstance", "(", "extension", ",", "BigFlowExtension", ")", ":", "raise", "error", ".", "BigflowRuntimeExceptio...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/pipeline/pipeline_base.py#L248-L260
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow.update_merge_message
(self, exp_number, scan_number, mode, message)
Update the merge-scan table for message such as error or etc. Note: the string passed from PyQt message is of type unicode but not string! :param exp_number: :param scan_number: :param mode: :param message: :return:
Update the merge-scan table for message such as error or etc. Note: the string passed from PyQt message is of type unicode but not string! :param exp_number: :param scan_number: :param mode: :param message: :return:
[ "Update", "the", "merge", "-", "scan", "table", "for", "message", "such", "as", "error", "or", "etc", ".", "Note", ":", "the", "string", "passed", "from", "PyQt", "message", "is", "of", "type", "unicode", "but", "not", "string!", ":", "param", "exp_numbe...
def update_merge_message(self, exp_number, scan_number, mode, message): """ Update the merge-scan table for message such as error or etc. Note: the string passed from PyQt message is of type unicode but not string! :param exp_number: :param scan_number: :param mode: ...
[ "def", "update_merge_message", "(", "self", ",", "exp_number", ",", "scan_number", ",", "mode", ",", "message", ")", ":", "# check", "assert", "isinstance", "(", "exp_number", ",", "int", ")", ",", "'Experiment number must be integer.'", "assert", "isinstance", "(...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L4117-L4162
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/barostats.py
python
Barostat.get_press
(self)
return np.trace(self.stress)/3.0
Calculates the internal pressure.
Calculates the internal pressure.
[ "Calculates", "the", "internal", "pressure", "." ]
def get_press(self): """Calculates the internal pressure.""" return np.trace(self.stress)/3.0
[ "def", "get_press", "(", "self", ")", ":", "return", "np", ".", "trace", "(", "self", ".", "stress", ")", "/", "3.0" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/barostats.py#L203-L206
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
python/musicexp.py
python
Score.set_tempo
(self, tempo)
Set the tempo attribute of the Score. This attribute can be used in L{print_ly} for the midi output (see L{musicxml.Sound}). @param tempo: The value of the tempo, in beats per minute. @type tempo: String
Set the tempo attribute of the Score. This attribute can be used in L{print_ly} for the midi output (see L{musicxml.Sound}).
[ "Set", "the", "tempo", "attribute", "of", "the", "Score", ".", "This", "attribute", "can", "be", "used", "in", "L", "{", "print_ly", "}", "for", "the", "midi", "output", "(", "see", "L", "{", "musicxml", ".", "Sound", "}", ")", "." ]
def set_tempo(self, tempo): """ Set the tempo attribute of the Score. This attribute can be used in L{print_ly} for the midi output (see L{musicxml.Sound}). @param tempo: The value of the tempo, in beats per minute. @type tempo: String """ self.tempo = tempo
[ "def", "set_tempo", "(", "self", ",", "tempo", ")", ":", "self", ".", "tempo", "=", "tempo" ]
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/python/musicexp.py#L2603-L2611
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/cpplint.py
python
FileInfo.BaseName
(self)
return self.Split()[1]
File base name - text after the final slash, before the final period.
File base name - text after the final slash, before the final period.
[ "File", "base", "name", "-", "text", "after", "the", "final", "slash", "before", "the", "final", "period", "." ]
def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1]
[ "def", "BaseName", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "1", "]" ]
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L1638-L1640
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py
python
BaseMode.forward_word
(self, e)
Move forward to the end of the next word. Words are composed of letters and digits.
Move forward to the end of the next word. Words are composed of letters and digits.
[ "Move", "forward", "to", "the", "end", "of", "the", "next", "word", ".", "Words", "are", "composed", "of", "letters", "and", "digits", "." ]
def forward_word(self, e): # (M-f) '''Move forward to the end of the next word. Words are composed of letters and digits.''' self.l_buffer.forward_word(self.argument_reset)
[ "def", "forward_word", "(", "self", ",", "e", ")", ":", "# (M-f)", "self", ".", "l_buffer", ".", "forward_word", "(", "self", ".", "argument_reset", ")" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py#L253-L256
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py
python
Entry.rfile
(self)
return File.rfile(self)
We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.
We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.
[ "We", "re", "a", "generic", "Entry", "but", "the", "caller", "is", "actually", "looking", "for", "a", "File", "at", "this", "point", "so", "morph", "into", "one", "." ]
def rfile(self): """We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.""" self.__class__ = File self._morph() self.clear() return File.rfile(self)
[ "def", "rfile", "(", "self", ")", ":", "self", ".", "__class__", "=", "File", "self", ".", "_morph", "(", ")", "self", ".", "clear", "(", ")", "return", "File", ".", "rfile", "(", "self", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py#L999-L1005
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
PseudoDC.SetPalette
(*args, **kwargs)
return _gdi_.PseudoDC_SetPalette(*args, **kwargs)
SetPalette(self, Palette palette) If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC. If the argument is ``wx.NullPalette``, the current palette is selected out of the device context, and the original palette restored.
SetPalette(self, Palette palette)
[ "SetPalette", "(", "self", "Palette", "palette", ")" ]
def SetPalette(*args, **kwargs): """ SetPalette(self, Palette palette) If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC. If the argument is ``wx.NullPalette``, the current palette is selected out of the device ...
[ "def", "SetPalette", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PseudoDC_SetPalette", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L8429-L8438
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/cr/cr/actions/action.py
python
Action.Skipping
(self, context)
return self.name == 'skip'
A method that is used to detect void or skip implementations. Most actions have a skip version that you can select to indicate that you want to not perform the action at all. It is important that commands can detect this so they can modify the action sequence if there are other changes that depend on i...
A method that is used to detect void or skip implementations.
[ "A", "method", "that", "is", "used", "to", "detect", "void", "or", "skip", "implementations", "." ]
def Skipping(self, context): """A method that is used to detect void or skip implementations. Most actions have a skip version that you can select to indicate that you want to not perform the action at all. It is important that commands can detect this so they can modify the action sequence if ther...
[ "def", "Skipping", "(", "self", ",", "context", ")", ":", "return", "self", ".", "name", "==", "'skip'" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/actions/action.py#L32-L47
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/tablez.py
python
TablesHandler.table_copy
(self, *args)
Copy Table
Copy Table
[ "Copy", "Table" ]
def table_copy(self, *args): """Copy Table""" self.dad.object_set_selection(self.curr_table_anchor) self.dad.sourceview.emit("copy-clipboard")
[ "def", "table_copy", "(", "self", ",", "*", "args", ")", ":", "self", ".", "dad", ".", "object_set_selection", "(", "self", ".", "curr_table_anchor", ")", "self", ".", "dad", ".", "sourceview", ".", "emit", "(", "\"copy-clipboard\"", ")" ]
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/tablez.py#L40-L43
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetools.py
python
encode
(input, output, encoding)
Encode common content-transfer-encodings (base64, quopri, uuencode).
Encode common content-transfer-encodings (base64, quopri, uuencode).
[ "Encode", "common", "content", "-", "transfer", "-", "encodings", "(", "base64", "quopri", "uuencode", ")", "." ]
def encode(input, output, encoding): """Encode common content-transfer-encodings (base64, quopri, uuencode).""" if encoding == 'base64': import base64 return base64.encode(input, output) if encoding == 'quoted-printable': import quopri return quopri.encode(input, output, 0) ...
[ "def", "encode", "(", "input", ",", "output", ",", "encoding", ")", ":", "if", "encoding", "==", "'base64'", ":", "import", "base64", "return", "base64", ".", "encode", "(", "input", ",", "output", ")", "if", "encoding", "==", "'quoted-printable'", ":", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetools.py#L176-L193
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/tlslite/tlslite/utils/RSAKey.py
python
RSAKey.writeXMLPublicKey
(self, indent='')
return Python_RSAKey(self.n, self.e).write(indent)
Return a string containing the key. @rtype: str @return: A string describing the public key, in XML format.
Return a string containing the key.
[ "Return", "a", "string", "containing", "the", "key", "." ]
def writeXMLPublicKey(self, indent=''): """Return a string containing the key. @rtype: str @return: A string describing the public key, in XML format. """ return Python_RSAKey(self.n, self.e).write(indent)
[ "def", "writeXMLPublicKey", "(", "self", ",", "indent", "=", "''", ")", ":", "return", "Python_RSAKey", "(", "self", ".", "n", ",", "self", ".", "e", ")", ".", "write", "(", "indent", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/utils/RSAKey.py#L218-L224
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/indentation.py
python
IndentationRules.__init__
(self)
Initializes the IndentationRules checker.
Initializes the IndentationRules checker.
[ "Initializes", "the", "IndentationRules", "checker", "." ]
def __init__(self): """Initializes the IndentationRules checker.""" self._stack = [] # Map from line number to number of characters it is off in indentation. self._start_index_offset = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "_stack", "=", "[", "]", "# Map from line number to number of characters it is off in indentation.", "self", ".", "_start_index_offset", "=", "{", "}" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/indentation.py#L113-L118
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectDiffScan.py
python
IndirectDiffScan._get_temperature
(self, ws_name)
return None
Gets the sample temperature for a given workspace. @param ws_name Name of workspace @returns Temperature in Kelvin or None if not found
Gets the sample temperature for a given workspace.
[ "Gets", "the", "sample", "temperature", "for", "a", "given", "workspace", "." ]
def _get_temperature(self, ws_name): """ Gets the sample temperature for a given workspace. @param ws_name Name of workspace @returns Temperature in Kelvin or None if not found """ instr, run_number = self._get_InstrRun(ws_name) pad_num = config.getInstrument(in...
[ "def", "_get_temperature", "(", "self", ",", "ws_name", ")", ":", "instr", ",", "run_number", "=", "self", ".", "_get_InstrRun", "(", "ws_name", ")", "pad_num", "=", "config", ".", "getInstrument", "(", "instr", ")", ".", "zeroPadding", "(", "int", "(", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectDiffScan.py#L173-L221
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/Demos/cmdserver.py
python
ThreadWriter.write
(self, str)
Write to the current thread's writer, default sys.stdout
Write to the current thread's writer, default sys.stdout
[ "Write", "to", "the", "current", "thread", "s", "writer", "default", "sys", ".", "stdout" ]
def write(self, str): "Write to the current thread's writer, default sys.stdout" self.getwriter().write(str)
[ "def", "write", "(", "self", ",", "str", ")", ":", "self", ".", "getwriter", "(", ")", ".", "write", "(", "str", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/Demos/cmdserver.py#L43-L45
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/gem5art/artifact/gem5art/artifact/_artifactdb.py
python
ArtifactDB.searchByType
(self, typ: str, limit: int)
Returns an iterable of all artifacts in the database that match some type. Note: Not all DB implementations will implement this function
Returns an iterable of all artifacts in the database that match some type. Note: Not all DB implementations will implement this function
[ "Returns", "an", "iterable", "of", "all", "artifacts", "in", "the", "database", "that", "match", "some", "type", ".", "Note", ":", "Not", "all", "DB", "implementations", "will", "implement", "this", "function" ]
def searchByType(self, typ: str, limit: int) -> Iterable[Dict[str, Any]]: """Returns an iterable of all artifacts in the database that match some type. Note: Not all DB implementations will implement this function""" raise NotImplementedError()
[ "def", "searchByType", "(", "self", ",", "typ", ":", "str", ",", "limit", ":", "int", ")", "->", "Iterable", "[", "Dict", "[", "str", ",", "Any", "]", "]", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/gem5art/artifact/gem5art/artifact/_artifactdb.py#L102-L106
NetSys/bess
ae52fc5804290fc3116daf2aef52226fafcedf5d
pybess/protobuf_to_dict.py
python
dict_to_protobuf
(pb_klass_or_instance, values, type_callable_map=REVERSE_TYPE_CALLABLE_MAP, strict=True)
return _dict_to_protobuf(instance, values, type_callable_map, strict)
Populates a protobuf model from a dictionary. :param pb_klass_or_instance: a protobuf message class, or an protobuf instance :type pb_klass_or_instance: a type or instance of a subclass of google.protobuf.message.Message :param dict values: a dictionary of values. Repeated and nested values are full...
Populates a protobuf model from a dictionary.
[ "Populates", "a", "protobuf", "model", "from", "a", "dictionary", "." ]
def dict_to_protobuf(pb_klass_or_instance, values, type_callable_map=REVERSE_TYPE_CALLABLE_MAP, strict=True): """Populates a protobuf model from a dictionary. :param pb_klass_or_instance: a protobuf message class, or an protobuf instance :type pb_klass_or_instance: a type or instance of a subclass of googl...
[ "def", "dict_to_protobuf", "(", "pb_klass_or_instance", ",", "values", ",", "type_callable_map", "=", "REVERSE_TYPE_CALLABLE_MAP", ",", "strict", "=", "True", ")", ":", "if", "isinstance", "(", "pb_klass_or_instance", ",", "Message", ")", ":", "instance", "=", "pb...
https://github.com/NetSys/bess/blob/ae52fc5804290fc3116daf2aef52226fafcedf5d/pybess/protobuf_to_dict.py#L136-L151
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
newTextReaderFilename
(URI)
return xmlTextReader(_obj=ret)
Create an xmlTextReader structure fed with the resource at @URI
Create an xmlTextReader structure fed with the resource at
[ "Create", "an", "xmlTextReader", "structure", "fed", "with", "the", "resource", "at" ]
def newTextReaderFilename(URI): """Create an xmlTextReader structure fed with the resource at @URI """ ret = libxml2mod.xmlNewTextReaderFilename(URI) if ret is None:raise treeError('xmlNewTextReaderFilename() failed') return xmlTextReader(_obj=ret)
[ "def", "newTextReaderFilename", "(", "URI", ")", ":", "ret", "=", "libxml2mod", ".", "xmlNewTextReaderFilename", "(", "URI", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlNewTextReaderFilename() failed'", ")", "return", "xmlTextReader", "(",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L1941-L1946
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/platforms/osx.py
python
brew_detect
(resolved, exec_fn=None)
return list(filter(is_installed, resolved))
Given a list of resolutions, return the list of installed resolutions. :param resolved: List of HomebrewResolution objects :returns: Filtered list of HomebrewResolution objects
Given a list of resolutions, return the list of installed resolutions.
[ "Given", "a", "list", "of", "resolutions", "return", "the", "list", "of", "installed", "resolutions", "." ]
def brew_detect(resolved, exec_fn=None): """Given a list of resolutions, return the list of installed resolutions. :param resolved: List of HomebrewResolution objects :returns: Filtered list of HomebrewResolution objects """ if exec_fn is None: exec_fn = read_stdout std_out = exec_fn(['...
[ "def", "brew_detect", "(", "resolved", ",", "exec_fn", "=", "None", ")", ":", "if", "exec_fn", "is", "None", ":", "exec_fn", "=", "read_stdout", "std_out", "=", "exec_fn", "(", "[", "'brew'", ",", "'list'", "]", ")", "installed_formulae", "=", "std_out", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/platforms/osx.py#L160-L208
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/io_tensor.py
python
IOTensor.from_tiff
(cls, filename, **kwargs)
Creates an `IOTensor` from a tiff file. Note tiff file may consists of multiple images with different shapes. Args: filename: A string, the filename of a tiff file. name: A name prefix for the IOTensor (optional). Returns: A `IOTensor`.
Creates an `IOTensor` from a tiff file.
[ "Creates", "an", "IOTensor", "from", "a", "tiff", "file", "." ]
def from_tiff(cls, filename, **kwargs): """Creates an `IOTensor` from a tiff file. Note tiff file may consists of multiple images with different shapes. Args: filename: A string, the filename of a tiff file. name: A name prefix for the IOTensor (optional). Returns:...
[ "def", "from_tiff", "(", "cls", ",", "filename", ",", "*", "*", "kwargs", ")", ":", "with", "tf", ".", "name_scope", "(", "kwargs", ".", "get", "(", "\"name\"", ",", "\"IOFromTIFF\"", ")", ")", ":", "return", "tiff_io_tensor_ops", ".", "TIFFIOTensor", "(...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/io_tensor.py#L444-L458
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/util/ranges.py
python
parse_literal
(region_literal, contig_map=None)
Parses a Range from a string representation like chr:start-end. The region literal must conform to the following pattern: chromosome:start-end chromosome:position chromosome [if contig_map is provided] chromosome can be any non-empty string without whitespace. start and end must both be positive i...
Parses a Range from a string representation like chr:start-end.
[ "Parses", "a", "Range", "from", "a", "string", "representation", "like", "chr", ":", "start", "-", "end", "." ]
def parse_literal(region_literal, contig_map=None): """Parses a Range from a string representation like chr:start-end. The region literal must conform to the following pattern: chromosome:start-end chromosome:position chromosome [if contig_map is provided] chromosome can be any non-empty string wi...
[ "def", "parse_literal", "(", "region_literal", ",", "contig_map", "=", "None", ")", ":", "def", "parse_position", "(", "pos_str", ")", ":", "return", "int", "(", "pos_str", ".", "replace", "(", "','", ",", "''", ")", ")", "matched", "=", "_REGION_LITERAL_R...
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/ranges.py#L519-L573
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
Gauge.GetBezelFace
(*args, **kwargs)
return _controls_.Gauge_GetBezelFace(*args, **kwargs)
GetBezelFace(self) -> int
GetBezelFace(self) -> int
[ "GetBezelFace", "(", "self", ")", "-", ">", "int" ]
def GetBezelFace(*args, **kwargs): """GetBezelFace(self) -> int""" return _controls_.Gauge_GetBezelFace(*args, **kwargs)
[ "def", "GetBezelFace", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Gauge_GetBezelFace", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L783-L785
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/ability_subprocessor.py
python
AoCAbilitySubprocessor.research_ability
(line)
return ability_forward_ref
Adds the Research ability to a line. :param line: Unit/Building line that gets the ability. :type line: ...dataformat.converter_object.ConverterObjectGroup :returns: The forward reference for the ability. :rtype: ...dataformat.forward_ref.ForwardRef
Adds the Research ability to a line.
[ "Adds", "the", "Research", "ability", "to", "a", "line", "." ]
def research_ability(line): """ Adds the Research ability to a line. :param line: Unit/Building line that gets the ability. :type line: ...dataformat.converter_object.ConverterObjectGroup :returns: The forward reference for the ability. :rtype: ...dataformat.forward_ref....
[ "def", "research_ability", "(", "line", ")", ":", "current_unit_id", "=", "line", ".", "get_head_unit_id", "(", ")", "dataset", "=", "line", ".", "data", "api_objects", "=", "dataset", ".", "nyan_api_objects", "name_lookup_dict", "=", "internal_name_lookups", ".",...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/ability_subprocessor.py#L5328-L5401
ArduPilot/apm_planner
bc6721a6b875ede1116a2a4cb6f9d3d74cd9a6ef
sik_uploader/sik_uploader.py
python
uploader.debug
(self, s, level=1)
write some debug text
write some debug text
[ "write", "some", "debug", "text" ]
def debug(self, s, level=1): '''write some debug text''' if self._debug >= level: print(s)
[ "def", "debug", "(", "self", ",", "s", ",", "level", "=", "1", ")", ":", "if", "self", ".", "_debug", ">=", "level", ":", "print", "(", "s", ")" ]
https://github.com/ArduPilot/apm_planner/blob/bc6721a6b875ede1116a2a4cb6f9d3d74cd9a6ef/sik_uploader/sik_uploader.py#L113-L116
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/hex_codec.py
python
hex_decode
(input,errors='strict')
return (output, len(input))
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error hand...
Decodes the object input and returns a tuple (output object, length consumed).
[ "Decodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def hex_decode(input,errors='strict'): """ Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing t...
[ "def", "hex_decode", "(", "input", ",", "errors", "=", "'strict'", ")", ":", "assert", "errors", "==", "'strict'", "output", "=", "binascii", ".", "a2b_hex", "(", "input", ")", "return", "(", "output", ",", "len", "(", "input", ")", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/hex_codec.py#L27-L43
milvus-io/milvus
3b1030de2b6c39e3512833e97f6044d63eb24237
internal/core/build-support/cpplint.py
python
CheckBracesSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about the current stack o...
Checks for horizontal spacing near commas.
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "." ]
def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingStat...
[ "def", "CheckBracesSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Except after an opening paren, or after another opening brace (in case of", ...
https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/cpplint.py#L4048-L4134
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/retdec-utils.py
python
CmdRunner._start
(self, cmd, buffer_output=False, discard_stdout=False, discard_stderr=False)
Starts the given command and returns a handler to it. :param list cmd: Command to be run as a list of arguments (strings). :param bool buffer_output: See above. :returns: A handler to the started command (``subprocess.Popen``). If the output is irrelevant for you, you should set `buff...
Starts the given command and returns a handler to it.
[ "Starts", "the", "given", "command", "and", "returns", "a", "handler", "to", "it", "." ]
def _start(self, cmd, buffer_output=False, discard_stdout=False, discard_stderr=False): """Starts the given command and returns a handler to it. :param list cmd: Command to be run as a list of arguments (strings). :param bool buffer_output: See above. :returns: A handler to the started...
[ "def", "_start", "(", "self", ",", "cmd", ",", "buffer_output", "=", "False", ",", "discard_stdout", "=", "False", ",", "discard_stderr", "=", "False", ")", ":", "# The implementation is platform-specific because we want to be able to", "# kill the children alongside with t...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/retdec-utils.py#L124-L165
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/core.py
python
Node._update_position
(self)
! Update position function. @param self: class object. @return none
! Update position function.
[ "!", "Update", "position", "function", "." ]
def _update_position(self): """! Update position function. @param self: class object. @return none """ x, y = self.get_position() self.set_position(x, y)
[ "def", "_update_position", "(", "self", ")", ":", "x", ",", "y", "=", "self", ".", "get_position", "(", ")", "self", ".", "set_position", "(", "x", ",", "y", ")" ]
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L451-L459
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/number-of-matching-subsequences.py
python
Solution.numMatchingSubseq
(self, S, words)
return len(waiting[None])
:type S: str :type words: List[str] :rtype: int
:type S: str :type words: List[str] :rtype: int
[ ":", "type", "S", ":", "str", ":", "type", "words", ":", "List", "[", "str", "]", ":", "rtype", ":", "int" ]
def numMatchingSubseq(self, S, words): """ :type S: str :type words: List[str] :rtype: int """ waiting = collections.defaultdict(list) for word in words: it = iter(word) waiting[next(it, None)].append(it) for c in S: for...
[ "def", "numMatchingSubseq", "(", "self", ",", "S", ",", "words", ")", ":", "waiting", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "word", "in", "words", ":", "it", "=", "iter", "(", "word", ")", "waiting", "[", "next", "(", "it",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/number-of-matching-subsequences.py#L8-L21
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py
python
Context.logical_invert
(self, a)
return a.logical_invert(context=self)
Invert all the digits in the operand. The operand must be a logical number. >>> ExtendedContext.logical_invert(Decimal('0')) Decimal('111111111') >>> ExtendedContext.logical_invert(Decimal('1')) Decimal('111111110') >>> ExtendedContext.logical_invert(Decimal('111111111'...
Invert all the digits in the operand.
[ "Invert", "all", "the", "digits", "in", "the", "operand", "." ]
def logical_invert(self, a): """Invert all the digits in the operand. The operand must be a logical number. >>> ExtendedContext.logical_invert(Decimal('0')) Decimal('111111111') >>> ExtendedContext.logical_invert(Decimal('1')) Decimal('111111110') >>> ExtendedCo...
[ "def", "logical_invert", "(", "self", ",", "a", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "logical_invert", "(", "context", "=", "self", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L4589-L4606
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
TimeSpan.IsNegative
(*args, **kwargs)
return _misc_.TimeSpan_IsNegative(*args, **kwargs)
IsNegative(self) -> bool
IsNegative(self) -> bool
[ "IsNegative", "(", "self", ")", "-", ">", "bool" ]
def IsNegative(*args, **kwargs): """IsNegative(self) -> bool""" return _misc_.TimeSpan_IsNegative(*args, **kwargs)
[ "def", "IsNegative", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TimeSpan_IsNegative", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4498-L4500
CaoWGG/TensorRT-CenterNet
f949252e37b51e60f873808f46d3683f15735e79
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
Token.spelling
(self)
return conf.lib.clang_getTokenSpelling(self._tu, self)
The spelling of this token. This is the textual representation of the token in source.
The spelling of this token.
[ "The", "spelling", "of", "this", "token", "." ]
def spelling(self): """The spelling of this token. This is the textual representation of the token in source. """ return conf.lib.clang_getTokenSpelling(self._tu, self)
[ "def", "spelling", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTokenSpelling", "(", "self", ".", "_tu", ",", "self", ")" ]
https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L2992-L2997
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/spades_func.py
python
get_max_spades_kmer
(spades_path)
SPAdes usually has a maximum k-mer size of 127, but this can be changed when compiling SPAdes, so this function checks the help text to see what it is. https://github.com/ablab/spades/issues/40
SPAdes usually has a maximum k-mer size of 127, but this can be changed when compiling SPAdes, so this function checks the help text to see what it is. https://github.com/ablab/spades/issues/40
[ "SPAdes", "usually", "has", "a", "maximum", "k", "-", "mer", "size", "of", "127", "but", "this", "can", "be", "changed", "when", "compiling", "SPAdes", "so", "this", "function", "checks", "the", "help", "text", "to", "see", "what", "it", "is", ".", "ht...
def get_max_spades_kmer(spades_path): """ SPAdes usually has a maximum k-mer size of 127, but this can be changed when compiling SPAdes, so this function checks the help text to see what it is. https://github.com/ablab/spades/issues/40 """ try: process = subprocess.Popen([spades_path, '-...
[ "def", "get_max_spades_kmer", "(", "spades_path", ")", ":", "try", ":", "process", "=", "subprocess", ".", "Popen", "(", "[", "spades_path", ",", "'--help'", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE",...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/spades_func.py#L304-L320
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/saver.py
python
Saver.export_meta_graph
(self, filename=None, collection_list=None, as_text=False)
return export_meta_graph(filename=filename, graph_def=ops.get_default_graph().as_graph_def( add_shapes=True), saver_def=self.saver_def, collection_list=collection_list, as...
Writes `MetaGraphDef` to save_path/filename. Args: filename: Optional meta_graph filename including the path. collection_list: List of string keys to collect. as_text: If `True`, writes the meta_graph as an ASCII proto. Returns: A `MetaGraphDef` proto.
Writes `MetaGraphDef` to save_path/filename.
[ "Writes", "MetaGraphDef", "to", "save_path", "/", "filename", "." ]
def export_meta_graph(self, filename=None, collection_list=None, as_text=False): """Writes `MetaGraphDef` to save_path/filename. Args: filename: Optional meta_graph filename including the path. collection_list: List of string keys to collect. as_text: If `True`, writes...
[ "def", "export_meta_graph", "(", "self", ",", "filename", "=", "None", ",", "collection_list", "=", "None", ",", "as_text", "=", "False", ")", ":", "return", "export_meta_graph", "(", "filename", "=", "filename", ",", "graph_def", "=", "ops", ".", "get_defau...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/saver.py#L1089-L1106
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/rules_generator.py
python
SconsFileHeaderGenerator.generate_imports_functions
(self, blade_path)
Generates imports and functions.
Generates imports and functions.
[ "Generates", "imports", "and", "functions", "." ]
def generate_imports_functions(self, blade_path): """Generates imports and functions. """ self._add_rule( r""" import sys sys.path.insert(0, '%s') """ % blade_path) self._add_rule( r""" import os import subprocess import signal import time import socket import glob impor...
[ "def", "generate_imports_functions", "(", "self", ",", "blade_path", ")", ":", "self", ".", "_add_rule", "(", "r\"\"\"\nimport sys\nsys.path.insert(0, '%s')\n\"\"\"", "%", "blade_path", ")", "self", ".", "_add_rule", "(", "r\"\"\"\nimport os\nimport subprocess\nimport signal\...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/rules_generator.py#L159-L195
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/interpolate/fitpack.py
python
_intc_overflow
(x, msg=None)
return intc(x)
Cast the value to an intc and raise an OverflowError if the value cannot fit.
Cast the value to an intc and raise an OverflowError if the value cannot fit.
[ "Cast", "the", "value", "to", "an", "intc", "and", "raise", "an", "OverflowError", "if", "the", "value", "cannot", "fit", "." ]
def _intc_overflow(x, msg=None): """Cast the value to an intc and raise an OverflowError if the value cannot fit. """ if x > iinfo(intc).max: if msg is None: msg = '%r cannot fit into an intc' % x raise OverflowError(msg) return intc(x)
[ "def", "_intc_overflow", "(", "x", ",", "msg", "=", "None", ")", ":", "if", "x", ">", "iinfo", "(", "intc", ")", ".", "max", ":", "if", "msg", "is", "None", ":", "msg", "=", "'%r cannot fit into an intc'", "%", "x", "raise", "OverflowError", "(", "ms...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/fitpack.py#L41-L49
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/contrib/crosstalkcaffe/unimodel/cntkinstance.py
python
ApiSetup.splice
(cntk_layer, inputs)
return ops.splice(*inputs, axis=0, name=cntk_layer.op_name)
Setup splice op with given parameters Args: cntk_layer (:class:`~cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition`): the layer definition of splice op inputs (list): a list contains all :class:`~cntk.ops.functions.Function` or :class:`~...
Setup splice op with given parameters
[ "Setup", "splice", "op", "with", "given", "parameters" ]
def splice(cntk_layer, inputs): ''' Setup splice op with given parameters Args: cntk_layer (:class:`~cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition`): the layer definition of splice op inputs (list): a list contains all :class:`~cntk...
[ "def", "splice", "(", "cntk_layer", ",", "inputs", ")", ":", "return", "ops", ".", "splice", "(", "*", "inputs", ",", "axis", "=", "0", ",", "name", "=", "cntk_layer", ".", "op_name", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalkcaffe/unimodel/cntkinstance.py#L361-L374
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py
python
_Listener.__init__
(self, parent_message)
Args: parent_message: The message whose _Modified() method we should call when we receive Modified() messages.
Args: parent_message: The message whose _Modified() method we should call when we receive Modified() messages.
[ "Args", ":", "parent_message", ":", "The", "message", "whose", "_Modified", "()", "method", "we", "should", "call", "when", "we", "receive", "Modified", "()", "messages", "." ]
def __init__(self, parent_message): """Args: parent_message: The message whose _Modified() method we should call when we receive Modified() messages. """ # This listener establishes a back reference from a child (contained) object # to its parent (containing) object. We make this a weak r...
[ "def", "__init__", "(", "self", ",", "parent_message", ")", ":", "# This listener establishes a back reference from a child (contained) object", "# to its parent (containing) object. We make this a weak reference to avoid", "# creating cyclic garbage when the client finishes with the 'parent' o...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py#L961-L978
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py
python
_AddEqualsMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddEqualsMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __eq__(self, other): if (not isinstance(other, message_mod.Message) or other.DESCRIPTOR != self.DESCRIPTOR): return False if self is other: return True return self.ListFields() == other.ListFi...
[ "def", "_AddEqualsMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "(", "not", "isinstance", "(", "other", ",", "message_mod", ".", "Message", ")", "or", "other", ".", "DESCRIPTOR", "!=...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L641-L653
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ribbon/toolbar.py
python
RibbonToolBar.OnMouseLeave
(self, event)
Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`RibbonToolBar`. :param `event`: a :class:`MouseEvent` event to be processed.
Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`RibbonToolBar`.
[ "Handles", "the", "wx", ".", "EVT_LEAVE_WINDOW", "event", "for", ":", "class", ":", "RibbonToolBar", "." ]
def OnMouseLeave(self, event): """ Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`RibbonToolBar`. :param `event`: a :class:`MouseEvent` event to be processed. """ if self._hover_tool: self._hover_tool.state &= ~RIBBON_TOOLBAR_TOOL_HOVER_MASK ...
[ "def", "OnMouseLeave", "(", "self", ",", "event", ")", ":", "if", "self", ".", "_hover_tool", ":", "self", ".", "_hover_tool", ".", "state", "&=", "~", "RIBBON_TOOLBAR_TOOL_HOVER_MASK", "self", ".", "_hover_tool", "=", "None", "self", ".", "Refresh", "(", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/toolbar.py#L1343-L1353
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.AddOrGetFileInRootGroup
(self, path)
return group.AddOrGetFileByPath(path, hierarchical)
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned.
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics.
[ "Returns", "a", "PBXFileReference", "corresponding", "to", "path", "in", "the", "correct", "group", "according", "to", "RootGroupForPath", "s", "heuristics", "." ]
def AddOrGetFileInRootGroup(self, path): """Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned. """ (group, hierarchi...
[ "def", "AddOrGetFileInRootGroup", "(", "self", ",", "path", ")", ":", "(", "group", ",", "hierarchical", ")", "=", "self", ".", "RootGroupForPath", "(", "path", ")", "return", "group", ".", "AddOrGetFileByPath", "(", "path", ",", "hierarchical", ")" ]
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcodeproj_file.py#L2621-L2630