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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pathlib.py
python
Path.is_fifo
(self)
Whether this path is a FIFO.
Whether this path is a FIFO.
[ "Whether", "this", "path", "is", "a", "FIFO", "." ]
def is_fifo(self): """ Whether this path is a FIFO. """ try: return S_ISFIFO(self.stat().st_mode) except OSError as e: if not _ignore_error(e): raise # Path doesn't exist or is a broken symlink # (see https://bitbuck...
[ "def", "is_fifo", "(", "self", ")", ":", "try", ":", "return", "S_ISFIFO", "(", "self", ".", "stat", "(", ")", ".", "st_mode", ")", "except", "OSError", "as", "e", ":", "if", "not", "_ignore_error", "(", "e", ")", ":", "raise", "# Path doesn't exist or...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pathlib.py#L1454-L1465
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/env.py
python
global_cvt_2_ener_float
(xx: tf.Tensor)
return tf.cast(xx, GLOBAL_ENER_FLOAT_PRECISION)
Cast tensor to globally set energy precision. Parameters ---------- xx : tf.Tensor input tensor Returns ------- tf.Tensor output tensor cast to `GLOBAL_ENER_FLOAT_PRECISION`
Cast tensor to globally set energy precision.
[ "Cast", "tensor", "to", "globally", "set", "energy", "precision", "." ]
def global_cvt_2_ener_float(xx: tf.Tensor) -> tf.Tensor: """Cast tensor to globally set energy precision. Parameters ---------- xx : tf.Tensor input tensor Returns ------- tf.Tensor output tensor cast to `GLOBAL_ENER_FLOAT_PRECISION` """ return tf.cast(xx, GLOBAL_EN...
[ "def", "global_cvt_2_ener_float", "(", "xx", ":", "tf", ".", "Tensor", ")", "->", "tf", ".", "Tensor", ":", "return", "tf", ".", "cast", "(", "xx", ",", "GLOBAL_ENER_FLOAT_PRECISION", ")" ]
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/env.py#L294-L307
cocos-creator/engine-native
984c4c9f5838253313b44ccd429bd8fac4ec8a6a
tools/bindings-generator/clang/cindex.py
python
Type.is_volatile_qualified
(self)
return conf.lib.clang_isVolatileQualifiedType(self)
Determine whether a Type has the "volatile" qualifier set. This does not look through typedefs that may have added "volatile" at a different level.
Determine whether a Type has the "volatile" qualifier set.
[ "Determine", "whether", "a", "Type", "has", "the", "volatile", "qualifier", "set", "." ]
def is_volatile_qualified(self): """Determine whether a Type has the "volatile" qualifier set. This does not look through typedefs that may have added "volatile" at a different level. """ return conf.lib.clang_isVolatileQualifiedType(self)
[ "def", "is_volatile_qualified", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isVolatileQualifiedType", "(", "self", ")" ]
https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L2304-L2310
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py
python
masked_not_equal
(x, value, copy=True)
return masked_where(not_equal(x, value), x, copy=copy)
Mask an array where `not` equal to a given value. This function is a shortcut to ``masked_where``, with `condition` = (x != value). See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy.ma as ma >>> a = np.arange(4) >>> a array(...
Mask an array where `not` equal to a given value.
[ "Mask", "an", "array", "where", "not", "equal", "to", "a", "given", "value", "." ]
def masked_not_equal(x, value, copy=True): """ Mask an array where `not` equal to a given value. This function is a shortcut to ``masked_where``, with `condition` = (x != value). See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy...
[ "def", "masked_not_equal", "(", "x", ",", "value", ",", "copy", "=", "True", ")", ":", "return", "masked_where", "(", "not_equal", "(", "x", ",", "value", ")", ",", "x", ",", "copy", "=", "copy", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L2058-L2081
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/specs/python/specs_ops.py
python
Var
(name, *args, **kw)
return specs_lib.Callable(var)
Implements an operator that generates a variable. This function is still experimental. Use it only for generating a single variable instance for each name. Args: name: Name of the variable. *args: Other arguments to get_variable. **kw: Other keywords for get_variable. Returns: A spe...
Implements an operator that generates a variable.
[ "Implements", "an", "operator", "that", "generates", "a", "variable", "." ]
def Var(name, *args, **kw): """Implements an operator that generates a variable. This function is still experimental. Use it only for generating a single variable instance for each name. Args: name: Name of the variable. *args: Other arguments to get_variable. **kw: Other keywords for get_...
[ "def", "Var", "(", "name", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "def", "var", "(", "_", ")", ":", "return", "variable_scope", ".", "get_variable", "(", "name", ",", "*", "args", ",", "*", "*", "kw", ")", "return", "specs_lib", ".", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/specs/python/specs_ops.py#L156-L175
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py
python
_ExtensionDict.__getitem__
(self, extension_handle)
return result
Returns the current value of the given extension handle.
Returns the current value of the given extension handle.
[ "Returns", "the", "current", "value", "of", "the", "given", "extension", "handle", "." ]
def __getitem__(self, extension_handle): """Returns the current value of the given extension handle.""" _VerifyExtensionHandle(self._extended_message, extension_handle) result = self._extended_message._fields.get(extension_handle) if result is not None: return result if extension_handle.lab...
[ "def", "__getitem__", "(", "self", ",", "extension_handle", ")", ":", "_VerifyExtensionHandle", "(", "self", ".", "_extended_message", ",", "extension_handle", ")", "result", "=", "self", ".", "_extended_message", ".", "_fields", ".", "get", "(", "extension_handle...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py#L1453-L1484
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStrHashF_Md5_GetSecHashCd
(*args)
return _snap.TStrHashF_Md5_GetSecHashCd(*args)
GetSecHashCd(char const * p) -> int Parameters: p: char const * TStrHashF_Md5_GetSecHashCd(TStr s) -> int Parameters: s: TStr const &
GetSecHashCd(char const * p) -> int
[ "GetSecHashCd", "(", "char", "const", "*", "p", ")", "-", ">", "int" ]
def TStrHashF_Md5_GetSecHashCd(*args): """ GetSecHashCd(char const * p) -> int Parameters: p: char const * TStrHashF_Md5_GetSecHashCd(TStr s) -> int Parameters: s: TStr const & """ return _snap.TStrHashF_Md5_GetSecHashCd(*args)
[ "def", "TStrHashF_Md5_GetSecHashCd", "(", "*", "args", ")", ":", "return", "_snap", ".", "TStrHashF_Md5_GetSecHashCd", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L6131-L6144
crosslife/OpenBird
9e0198a1a2295f03fa1e8676e216e22c9c7d380b
cocos2d/tools/bindings-generator/clang/cindex.py
python
Type.is_pod
(self)
return conf.lib.clang_isPODType(self)
Determine whether this Type represents plain old data (POD).
Determine whether this Type represents plain old data (POD).
[ "Determine", "whether", "this", "Type", "represents", "plain", "old", "data", "(", "POD", ")", "." ]
def is_pod(self): """Determine whether this Type represents plain old data (POD).""" return conf.lib.clang_isPODType(self)
[ "def", "is_pod", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isPODType", "(", "self", ")" ]
https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L1766-L1768
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/fftpack/realtransforms.py
python
_dst
(x, type, n=None, axis=-1, overwrite_x=False, normalize=None)
Return Discrete Sine Transform of arbitrary type sequence x. Parameters ---------- x : array_like input array. n : int, optional Length of the transform. axis : int, optional Axis along which the dst is computed. (default=-1) overwrite_x : bool, optional If True ...
Return Discrete Sine Transform of arbitrary type sequence x.
[ "Return", "Discrete", "Sine", "Transform", "of", "arbitrary", "type", "sequence", "x", "." ]
def _dst(x, type, n=None, axis=-1, overwrite_x=False, normalize=None): """ Return Discrete Sine Transform of arbitrary type sequence x. Parameters ---------- x : array_like input array. n : int, optional Length of the transform. axis : int, optional Axis along which ...
[ "def", "_dst", "(", "x", ",", "type", ",", "n", "=", "None", ",", "axis", "=", "-", "1", ",", "overwrite_x", "=", "False", ",", "normalize", "=", "None", ")", ":", "x0", ",", "n", ",", "copy_made", "=", "__fix_shape", "(", "x", ",", "n", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/fftpack/realtransforms.py#L710-L739
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/base.py
python
BaseContext.post_lowering
(self, mod, library)
Run target specific post-lowering transformation here.
Run target specific post-lowering transformation here.
[ "Run", "target", "specific", "post", "-", "lowering", "transformation", "here", "." ]
def post_lowering(self, mod, library): """Run target specific post-lowering transformation here. """
[ "def", "post_lowering", "(", "self", ",", "mod", ",", "library", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/base.py#L1099-L1101
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Canvas._create
(self, itemType, args, kw)
return getint(self.tk.call( self._w, 'create', itemType, *(args + self._options(cnf, kw))))
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={}) """Internal function.""" args = _flatten(args) cnf = args[-1] if type(cnf) in (DictionaryType, TupleType): args = args[:-1] else: cnf = {} return getint(self.tk.call( ...
[ "def", "_create", "(", "self", ",", "itemType", ",", "args", ",", "kw", ")", ":", "# Args: (val, val, ..., cnf={})", "args", "=", "_flatten", "(", "args", ")", "cnf", "=", "args", "[", "-", "1", "]", "if", "type", "(", "cnf", ")", "in", "(", "Diction...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2241-L2251
cdcseacave/openMVS
c658b72298019544a5b0522d303fc158f226857e
MvgMvsPipeline.py
python
whereis
(afile)
return directory in which afile is, None if not found. Look in PATH
return directory in which afile is, None if not found. Look in PATH
[ "return", "directory", "in", "which", "afile", "is", "None", "if", "not", "found", ".", "Look", "in", "PATH" ]
def whereis(afile): """ return directory in which afile is, None if not found. Look in PATH """ if sys.platform.startswith('win'): cmd = "where" else: cmd = "which" try: ret = subprocess.run([cmd, afile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True) ...
[ "def", "whereis", "(", "afile", ")", ":", "if", "sys", ".", "platform", ".", "startswith", "(", "'win'", ")", ":", "cmd", "=", "\"where\"", "else", ":", "cmd", "=", "\"which\"", "try", ":", "ret", "=", "subprocess", ".", "run", "(", "[", "cmd", ","...
https://github.com/cdcseacave/openMVS/blob/c658b72298019544a5b0522d303fc158f226857e/MvgMvsPipeline.py#L78-L90
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignment/python/svgfig.py
python
SVG.__getitem__
(self, ti)
Index is a list that descends tree, returning a sub-element if it ends with a number and an attribute if it ends with a string.
Index is a list that descends tree, returning a sub-element if it ends with a number and an attribute if it ends with a string.
[ "Index", "is", "a", "list", "that", "descends", "tree", "returning", "a", "sub", "-", "element", "if", "it", "ends", "with", "a", "number", "and", "an", "attribute", "if", "it", "ends", "with", "a", "string", "." ]
def __getitem__(self, ti): """Index is a list that descends tree, returning a sub-element if it ends with a number and an attribute if it ends with a string.""" obj = self if isinstance(ti, (list, tuple)): for i in ti[:-1]: obj = obj[i] ti = ti[-1] if isinstance(ti, (int, long, slice)):...
[ "def", "__getitem__", "(", "self", ",", "ti", ")", ":", "obj", "=", "self", "if", "isinstance", "(", "ti", ",", "(", "list", ",", "tuple", ")", ")", ":", "for", "i", "in", "ti", "[", ":", "-", "1", "]", ":", "obj", "=", "obj", "[", "i", "]"...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L136-L145
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/ISISCommandInterface.py
python
ConvertToPythonStringList
(to_convert)
return su.convert_to_string_list(to_convert)
Converts a python string list to a format more suitable for GUI representation @param to_convert:: The string list
Converts a python string list to a format more suitable for GUI representation
[ "Converts", "a", "python", "string", "list", "to", "a", "format", "more", "suitable", "for", "GUI", "representation" ]
def ConvertToPythonStringList(to_convert): ''' Converts a python string list to a format more suitable for GUI representation @param to_convert:: The string list ''' return su.convert_to_string_list(to_convert)
[ "def", "ConvertToPythonStringList", "(", "to_convert", ")", ":", "return", "su", ".", "convert_to_string_list", "(", "to_convert", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/ISISCommandInterface.py#L1321-L1326
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/dispatch.py
python
dispatch_to_extension_op
( op, left: Union[ABCExtensionArray, np.ndarray], right: Any, )
return res_values
Assume that left or right is a Series backed by an ExtensionArray, apply the operator defined by op. Parameters ---------- op : binary operator left : ExtensionArray or np.ndarray right : object Returns ------- ExtensionArray or np.ndarray 2-tuple of these if op is divmod o...
Assume that left or right is a Series backed by an ExtensionArray, apply the operator defined by op.
[ "Assume", "that", "left", "or", "right", "is", "a", "Series", "backed", "by", "an", "ExtensionArray", "apply", "the", "operator", "defined", "by", "op", "." ]
def dispatch_to_extension_op( op, left: Union[ABCExtensionArray, np.ndarray], right: Any, ): """ Assume that left or right is a Series backed by an ExtensionArray, apply the operator defined by op. Parameters ---------- op : binary operator left : ExtensionArray or np.ndarray right ...
[ "def", "dispatch_to_extension_op", "(", "op", ",", "left", ":", "Union", "[", "ABCExtensionArray", ",", "np", ".", "ndarray", "]", ",", "right", ":", "Any", ",", ")", ":", "# NB: left and right should already be unboxed, so neither should be", "# a Series or Index.", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/dispatch.py#L96-L126
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/netrc.py
python
netrc.authenticators
(self, host)
Return a (user, account, password) tuple for given host.
Return a (user, account, password) tuple for given host.
[ "Return", "a", "(", "user", "account", "password", ")", "tuple", "for", "given", "host", "." ]
def authenticators(self, host): """Return a (user, account, password) tuple for given host.""" if host in self.hosts: return self.hosts[host] elif 'default' in self.hosts: return self.hosts['default'] else: return None
[ "def", "authenticators", "(", "self", ",", "host", ")", ":", "if", "host", "in", "self", ".", "hosts", ":", "return", "self", ".", "hosts", "[", "host", "]", "elif", "'default'", "in", "self", ".", "hosts", ":", "return", "self", ".", "hosts", "[", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/netrc.py#L96-L103
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/math_grad.py
python
_MaxGrad
(op, grad)
return _MinOrMaxGrad(op, grad)
Gradient for Max.
Gradient for Max.
[ "Gradient", "for", "Max", "." ]
def _MaxGrad(op, grad): """Gradient for Max.""" return _MinOrMaxGrad(op, grad)
[ "def", "_MaxGrad", "(", "op", ",", "grad", ")", ":", "return", "_MinOrMaxGrad", "(", "op", ",", "grad", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_grad.py#L81-L83
KhronosGroup/SPIRV-LLVM
1eb85593f3fe2c39379b9a9b088d51eda4f42b8b
bindings/python/llvm/core.py
python
Module.target
(self, new_target)
new_target is a string.
new_target is a string.
[ "new_target", "is", "a", "string", "." ]
def target(self, new_target): """new_target is a string.""" lib.LLVMSetTarget(self, new_target)
[ "def", "target", "(", "self", ",", "new_target", ")", ":", "lib", ".", "LLVMSetTarget", "(", "self", ",", "new_target", ")" ]
https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/bindings/python/llvm/core.py#L219-L221
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_parser.py
python
IDLParser.p_interface_block
(self, p)
interface_block : modifiers INTERFACE SYMBOL '{' interface_list '}' ';
interface_block : modifiers INTERFACE SYMBOL '{' interface_list '}' ';
[ "interface_block", ":", "modifiers", "INTERFACE", "SYMBOL", "{", "interface_list", "}", ";" ]
def p_interface_block(self, p): """interface_block : modifiers INTERFACE SYMBOL '{' interface_list '}' ';'""" p[0] = self.BuildNamed('Interface', p, 3, ListFromConcat(p[1], p[5])) if self.parse_debug: DumpReduction('interface_block', p)
[ "def", "p_interface_block", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "self", ".", "BuildNamed", "(", "'Interface'", ",", "p", ",", "3", ",", "ListFromConcat", "(", "p", "[", "1", "]", ",", "p", "[", "5", "]", ")", ")", "if", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L765-L768
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/tyr/tyr/binarisation.py
python
shape2ed
(self, instance_config, filename, job_id, dataset_uid)
load a street network shape into ed
load a street network shape into ed
[ "load", "a", "street", "network", "shape", "into", "ed" ]
def shape2ed(self, instance_config, filename, job_id, dataset_uid): """load a street network shape into ed""" job = models.Job.query.get(job_id) dataset = _retrieve_dataset_and_set_state("shape", job.id) instance = job.instance logging.info("loading bounding shape for {} from = {}".format(instance.n...
[ "def", "shape2ed", "(", "self", ",", "instance_config", ",", "filename", ",", "job_id", ",", "dataset_uid", ")", ":", "job", "=", "models", ".", "Job", ".", "query", ".", "get", "(", "job_id", ")", "dataset", "=", "_retrieve_dataset_and_set_state", "(", "\...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/tyr/tyr/binarisation.py#L544-L559
rbgirshick/caffe-fast-rcnn
28a579eaf0668850705598b3075b8969f22226d9
python/caffe/pycaffe.py
python
_Net_forward_backward_all
(self, blobs=None, diffs=None, **kwargs)
return all_outs, all_diffs
Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backward) blob names and values are ndarrays. Refer to forward() and backwar...
Run net forward + backward in batches.
[ "Run", "net", "forward", "+", "backward", "in", "batches", "." ]
def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs): """ Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backw...
[ "def", "_Net_forward_backward_all", "(", "self", ",", "blobs", "=", "None", ",", "diffs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Batch blobs and diffs.", "all_outs", "=", "{", "out", ":", "[", "]", "for", "out", "in", "set", "(", "self", "....
https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/python/caffe/pycaffe.py#L182-L224
kevin-ssy/Optical-Flow-Guided-Feature
07d4501a29002ee7821c38c1820e4a64c1acf6e8
lib/caffe-action/tools/extra/extract_seconds.py
python
get_start_time
(line_iterable, year)
return start_datetime
Find start time from group of lines
Find start time from group of lines
[ "Find", "start", "time", "from", "group", "of", "lines" ]
def get_start_time(line_iterable, year): """Find start time from group of lines """ start_datetime = None for line in line_iterable: line = line.strip() if line.find('Solving') != -1: start_datetime = extract_datetime_from_line(line, year) break return start_...
[ "def", "get_start_time", "(", "line_iterable", ",", "year", ")", ":", "start_datetime", "=", "None", "for", "line", "in", "line_iterable", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", ".", "find", "(", "'Solving'", ")", "!=", "-", "1...
https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/tools/extra/extract_seconds.py#L31-L41
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
lldb/examples/python/gdbremote.py
python
RegisterInfo.__str__
(self)
return s
Dump the register info key/value pairs
Dump the register info key/value pairs
[ "Dump", "the", "register", "info", "key", "/", "value", "pairs" ]
def __str__(self): '''Dump the register info key/value pairs''' s = '' for key in self.info.keys(): if s: s += ', ' s += "%s=%s " % (key, self.info[key]) return s
[ "def", "__str__", "(", "self", ")", ":", "s", "=", "''", "for", "key", "in", "self", ".", "info", ".", "keys", "(", ")", ":", "if", "s", ":", "s", "+=", "', '", "s", "+=", "\"%s=%s \"", "%", "(", "key", ",", "self", ".", "info", "[", "key", ...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/examples/python/gdbremote.py#L393-L400
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
SpinCtrl.SetValueString
(*args, **kwargs)
return _controls_.SpinCtrl_SetValueString(*args, **kwargs)
SetValueString(self, String text)
SetValueString(self, String text)
[ "SetValueString", "(", "self", "String", "text", ")" ]
def SetValueString(*args, **kwargs): """SetValueString(self, String text)""" return _controls_.SpinCtrl_SetValueString(*args, **kwargs)
[ "def", "SetValueString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SpinCtrl_SetValueString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2364-L2366
pybox2d/pybox2d
09643321fd363f0850087d1bde8af3f4afd82163
library/Box2D/examples/pgu/gui/widget.py
python
Widget.update
(self,s)
return
Updates the surface and returns a rect list of updated areas This should be implemented by a subclass.
Updates the surface and returns a rect list of updated areas
[ "Updates", "the", "surface", "and", "returns", "a", "rect", "list", "of", "updated", "areas" ]
def update(self,s): """Updates the surface and returns a rect list of updated areas This should be implemented by a subclass. """ return
[ "def", "update", "(", "self", ",", "s", ")", ":", "return" ]
https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/pgu/gui/widget.py#L165-L171
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/panel.py
python
Panel.minor_xs
(self, key)
return self.xs(key, axis=self._AXIS_LEN - 1)
Return slice of panel along minor axis. Parameters ---------- key : object Minor axis label Returns ------- y : DataFrame index -> major axis, columns -> items Notes ----- minor_xs is only for getting, not setting values....
Return slice of panel along minor axis.
[ "Return", "slice", "of", "panel", "along", "minor", "axis", "." ]
def minor_xs(self, key): """ Return slice of panel along minor axis. Parameters ---------- key : object Minor axis label Returns ------- y : DataFrame index -> major axis, columns -> items Notes ----- mino...
[ "def", "minor_xs", "(", "self", ",", "key", ")", ":", "return", "self", ".", "xs", "(", "key", ",", "axis", "=", "self", ".", "_AXIS_LEN", "-", "1", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/panel.py#L817-L839
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/descriptor.py
python
Descriptor.__init__
(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=None, is_extendable=True, extension_ranges=None, file=None, serialized_start=None, serialized_end=None)
Arguments to __init__() are as described in the description of Descriptor fields above. Note that filename is an obsolete argument, that is not used anymore. Please use file.name to access this as an attribute.
Arguments to __init__() are as described in the description of Descriptor fields above.
[ "Arguments", "to", "__init__", "()", "are", "as", "described", "in", "the", "description", "of", "Descriptor", "fields", "above", "." ]
def __init__(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=None, is_extendable=True, extension_ranges=None, file=None, serialized_start=None, serialized_end=None): """Arguments to __init__() are as described in th...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "filename", ",", "containing_type", ",", "fields", ",", "nested_types", ",", "enum_types", ",", "extensions", ",", "options", "=", "None", ",", "is_extendable", "=", "True", ",", "extension_...
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/descriptor.py#L226-L270
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pyparsing/py2/pyparsing.py
python
ParserElement.copy
(self)
return cpy
Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParse...
Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element.
[ "Make", "a", "copy", "of", "this", ":", "class", ":", "ParserElement", ".", "Useful", "for", "defining", "different", "parse", "actions", "for", "the", "same", "parsing", "pattern", "using", "copies", "of", "the", "original", "parse", "element", "." ]
def copy(self): """ Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) ...
[ "def", "copy", "(", "self", ")", ":", "cpy", "=", "copy", ".", "copy", "(", "self", ")", "cpy", ".", "parseAction", "=", "self", ".", "parseAction", "[", ":", "]", "cpy", ".", "ignoreExprs", "=", "self", ".", "ignoreExprs", "[", ":", "]", "if", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py2/pyparsing.py#L1423-L1450
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pdb.py
python
Pdb.user_return
(self, frame, return_value)
This function is called when a return trap is set here.
This function is called when a return trap is set here.
[ "This", "function", "is", "called", "when", "a", "return", "trap", "is", "set", "here", "." ]
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" if self._wait_for_mainpyfile: return frame.f_locals['__return__'] = return_value print >>self.stdout, '--Return--' self.interaction(frame, None)
[ "def", "user_return", "(", "self", ",", "frame", ",", "return_value", ")", ":", "if", "self", ".", "_wait_for_mainpyfile", ":", "return", "frame", ".", "f_locals", "[", "'__return__'", "]", "=", "return_value", "print", ">>", "self", ".", "stdout", ",", "'...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pdb.py#L184-L190
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/ultratb.py
python
with_patch_inspect
(f)
return wrapped
Deprecated since IPython 6.0 decorator for monkeypatching inspect.findsource
Deprecated since IPython 6.0 decorator for monkeypatching inspect.findsource
[ "Deprecated", "since", "IPython", "6", ".", "0", "decorator", "for", "monkeypatching", "inspect", ".", "findsource" ]
def with_patch_inspect(f): """ Deprecated since IPython 6.0 decorator for monkeypatching inspect.findsource """ def wrapped(*args, **kwargs): save_findsource = inspect.findsource inspect.findsource = findsource try: return f(*args, **kwargs) finally: ...
[ "def", "with_patch_inspect", "(", "f", ")", ":", "def", "wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "save_findsource", "=", "inspect", ".", "findsource", "inspect", ".", "findsource", "=", "findsource", "try", ":", "return", "f", "(",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/ultratb.py#L238-L252
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/httplib.py
python
HTTPConnection.endheaders
(self)
Indicate that the last header line has been sent to the server.
Indicate that the last header line has been sent to the server.
[ "Indicate", "that", "the", "last", "header", "line", "has", "been", "sent", "to", "the", "server", "." ]
def endheaders(self): """Indicate that the last header line has been sent to the server.""" if self.__state == _CS_REQ_STARTED: self.__state = _CS_REQ_SENT else: raise CannotSendHeader() self._send_output()
[ "def", "endheaders", "(", "self", ")", ":", "if", "self", ".", "__state", "==", "_CS_REQ_STARTED", ":", "self", ".", "__state", "=", "_CS_REQ_SENT", "else", ":", "raise", "CannotSendHeader", "(", ")", "self", ".", "_send_output", "(", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/httplib.py#L896-L904
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_vendor/more_itertools/more.py
python
intersperse
(e, iterable, n=1)
Intersperse filler element *e* among the items in *iterable*, leaving *n* items between each filler element. >>> list(intersperse('!', [1, 2, 3, 4, 5])) [1, '!', 2, '!', 3, '!', 4, '!', 5] >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2)) [1, 2, None, 3, 4, None, 5]
Intersperse filler element *e* among the items in *iterable*, leaving *n* items between each filler element.
[ "Intersperse", "filler", "element", "*", "e", "*", "among", "the", "items", "in", "*", "iterable", "*", "leaving", "*", "n", "*", "items", "between", "each", "filler", "element", "." ]
def intersperse(e, iterable, n=1): """Intersperse filler element *e* among the items in *iterable*, leaving *n* items between each filler element. >>> list(intersperse('!', [1, 2, 3, 4, 5])) [1, '!', 2, '!', 3, '!', 4, '!', 5] >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2)) [...
[ "def", "intersperse", "(", "e", ",", "iterable", ",", "n", "=", "1", ")", ":", "if", "n", "==", "0", ":", "raise", "ValueError", "(", "'n must be > 0'", ")", "elif", "n", "==", "1", ":", "# interleave(repeat(e), iterable) -> e, x_0, e, e, x_1, e, x_2...", "# i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/more_itertools/more.py#L681-L704
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_osx_support.py
python
_check_for_unavailable_sdk
(_config_vars)
return _config_vars
Remove references to any SDKs not available
Remove references to any SDKs not available
[ "Remove", "references", "to", "any", "SDKs", "not", "available" ]
def _check_for_unavailable_sdk(_config_vars): """Remove references to any SDKs not available""" # If we're on OSX 10.5 or later and the user tries to # compile an extension using an SDK that is not present # on the current machine it is better to not use an SDK # than to fail. This is particularly ...
[ "def", "_check_for_unavailable_sdk", "(", "_config_vars", ")", ":", "# If we're on OSX 10.5 or later and the user tries to", "# compile an extension using an SDK that is not present", "# on the current machine it is better to not use an SDK", "# than to fail. This is particularly important with",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_osx_support.py#L277-L301
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextEvent.SetFlags
(*args, **kwargs)
return _richtext.RichTextEvent_SetFlags(*args, **kwargs)
SetFlags(self, int flags)
SetFlags(self, int flags)
[ "SetFlags", "(", "self", "int", "flags", ")" ]
def SetFlags(*args, **kwargs): """SetFlags(self, int flags)""" return _richtext.RichTextEvent_SetFlags(*args, **kwargs)
[ "def", "SetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextEvent_SetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4270-L4272
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py
python
HTMLDoc.docroutine
(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None)
Produce HTML documentation for a function or method object.
Produce HTML documentation for a function or method object.
[ "Produce", "HTML", "documentation", "for", "a", "function", "or", "method", "object", "." ]
def docroutine(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name n...
[ "def", "docroutine", "(", "self", ",", "object", ",", "name", "=", "None", ",", "mod", "=", "None", ",", "funcs", "=", "{", "}", ",", "classes", "=", "{", "}", ",", "methods", "=", "{", "}", ",", "cl", "=", "None", ")", ":", "realname", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py#L937-L994
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/linalg/linalg.py
python
_multi_dot
(arrays, order, i, j)
Actually do the multiplication with the given order.
Actually do the multiplication with the given order.
[ "Actually", "do", "the", "multiplication", "with", "the", "given", "order", "." ]
def _multi_dot(arrays, order, i, j): """Actually do the multiplication with the given order.""" if i == j: return arrays[i] else: return dot(_multi_dot(arrays, order, i, order[i, j]), _multi_dot(arrays, order, order[i, j] + 1, j))
[ "def", "_multi_dot", "(", "arrays", ",", "order", ",", "i", ",", "j", ")", ":", "if", "i", "==", "j", ":", "return", "arrays", "[", "i", "]", "else", ":", "return", "dot", "(", "_multi_dot", "(", "arrays", ",", "order", ",", "i", ",", "order", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/linalg/linalg.py#L2740-L2746
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/pipeline/sync/_balance/__init__.py
python
balance_by_size
( partitions: int, module: nn.Sequential, input: Union[List[Any], Tensor], *, chunks: int = 1, param_scale: float = 2.0, device: Device = torch.device("cuda"), )
return balance_cost(sizes, partitions)
Naive automatic balancing by CUDA memory usage per layer. During training, required memory for parameters depends on which optimizer is used. Optimizers may use buffers for each parameter to track optimization statistics internally, such as momentum buffer in SGD. To get more reliable size based balan...
Naive automatic balancing by CUDA memory usage per layer.
[ "Naive", "automatic", "balancing", "by", "CUDA", "memory", "usage", "per", "layer", "." ]
def balance_by_size( partitions: int, module: nn.Sequential, input: Union[List[Any], Tensor], *, chunks: int = 1, param_scale: float = 2.0, device: Device = torch.device("cuda"), ) -> List[int]: """Naive automatic balancing by CUDA memory usage per layer. During training, required m...
[ "def", "balance_by_size", "(", "partitions", ":", "int", ",", "module", ":", "nn", ".", "Sequential", ",", "input", ":", "Union", "[", "List", "[", "Any", "]", ",", "Tensor", "]", ",", "*", ",", "chunks", ":", "int", "=", "1", ",", "param_scale", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/_balance/__init__.py#L87-L164
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/soft_dec_lut_gen.py
python
soft_dec_table_generator
(soft_dec_gen, prec, Es=1)
return table
| Builds a LUT that is a list of tuples. The tuple represents the | soft decisions for the constellation/bit mapping at any given | point in the complex space, (x,y). | | The table is built to a precision specified by the 'prec' | argument. There are (2x2)^prec samples in the sample space, so we ...
| Builds a LUT that is a list of tuples. The tuple represents the | soft decisions for the constellation/bit mapping at any given | point in the complex space, (x,y). | | The table is built to a precision specified by the 'prec' | argument. There are (2x2)^prec samples in the sample space, so we ...
[ "|", "Builds", "a", "LUT", "that", "is", "a", "list", "of", "tuples", ".", "The", "tuple", "represents", "the", "|", "soft", "decisions", "for", "the", "constellation", "/", "bit", "mapping", "at", "any", "given", "|", "point", "in", "the", "complex", ...
def soft_dec_table_generator(soft_dec_gen, prec, Es=1): ''' | Builds a LUT that is a list of tuples. The tuple represents the | soft decisions for the constellation/bit mapping at any given | point in the complex space, (x,y). | | The table is built to a precision specified by the 'prec' | a...
[ "def", "soft_dec_table_generator", "(", "soft_dec_gen", ",", "prec", ",", "Es", "=", "1", ")", ":", "npts", "=", "int", "(", "2.0", "**", "prec", ")", "maxd", "=", "Es", "*", "numpy", ".", "sqrt", "(", "2.0", ")", "/", "2.0", "yrng", "=", "numpy", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/soft_dec_lut_gen.py#L15-L85
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/_funcs.py
python
svd
(A, dt=None)
return _svd(A, dt)
Perform singular value decomposition (A=USV^T) for arbitrary size matrix. Mathematical concept refers to https://en.wikipedia.org/wiki/Singular_value_decomposition. This is only a wrappers for :func:`taichi.svd`. Args: A (ti.Matrix(n, n)): input nxn matrix `A`. dt (DataType): date type of ...
Perform singular value decomposition (A=USV^T) for arbitrary size matrix.
[ "Perform", "singular", "value", "decomposition", "(", "A", "=", "USV^T", ")", "for", "arbitrary", "size", "matrix", "." ]
def svd(A, dt=None): """Perform singular value decomposition (A=USV^T) for arbitrary size matrix. Mathematical concept refers to https://en.wikipedia.org/wiki/Singular_value_decomposition. This is only a wrappers for :func:`taichi.svd`. Args: A (ti.Matrix(n, n)): input nxn matrix `A`. ...
[ "def", "svd", "(", "A", ",", "dt", "=", "None", ")", ":", "if", "dt", "is", "None", ":", "dt", "=", "impl", ".", "get_runtime", "(", ")", ".", "default_fp", "return", "_svd", "(", "A", ",", "dt", ")" ]
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/_funcs.py#L363-L378
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Image.SaveMimeStream
(*args, **kwargs)
return _core_.Image_SaveMimeStream(*args, **kwargs)
SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool Saves an image in the named file.
SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool
[ "SaveMimeStream", "(", "self", "wxOutputStream", "stream", "String", "mimetype", ")", "-", ">", "bool" ]
def SaveMimeStream(*args, **kwargs): """ SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool Saves an image in the named file. """ return _core_.Image_SaveMimeStream(*args, **kwargs)
[ "def", "SaveMimeStream", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Image_SaveMimeStream", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L3219-L3225
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.split_datetime
(self, column_name_prefix = "X", limit=None, tzone=False)
Splits an SArray of datetime type to multiple columns, return a new SFrame that contains expanded columns. A SArray of datetime will be split by default into an SFrame of 6 columns, one for each year/month/day/hour/minute/second element. **Column Naming** When splitting a SArra...
Splits an SArray of datetime type to multiple columns, return a new SFrame that contains expanded columns. A SArray of datetime will be split by default into an SFrame of 6 columns, one for each year/month/day/hour/minute/second element.
[ "Splits", "an", "SArray", "of", "datetime", "type", "to", "multiple", "columns", "return", "a", "new", "SFrame", "that", "contains", "expanded", "columns", ".", "A", "SArray", "of", "datetime", "will", "be", "split", "by", "default", "into", "an", "SFrame", ...
def split_datetime(self, column_name_prefix = "X", limit=None, tzone=False): """ Splits an SArray of datetime type to multiple columns, return a new SFrame that contains expanded columns. A SArray of datetime will be split by default into an SFrame of 6 columns, one for each year...
[ "def", "split_datetime", "(", "self", ",", "column_name_prefix", "=", "\"X\"", ",", "limit", "=", "None", ",", "tzone", "=", "False", ")", ":", "from", ".", "sframe", "import", "SFrame", "as", "_SFrame", "if", "self", ".", "dtype", "(", ")", "!=", "dat...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L2932-L3064
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/Composite/Composite.py
python
Composite.GetInputOrder
(self)
return self._mapOrder
returns the input order (used in remapping inputs)
returns the input order (used in remapping inputs)
[ "returns", "the", "input", "order", "(", "used", "in", "remapping", "inputs", ")" ]
def GetInputOrder(self): """ returns the input order (used in remapping inputs) """ return self._mapOrder
[ "def", "GetInputOrder", "(", "self", ")", ":", "return", "self", ".", "_mapOrder" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Composite/Composite.py#L360-L364
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Utilities/RelMon/python/web/app_utils.py
python
get_dataset_name
(name)
return '_'.join([ds, str(int(run))])
Returns extracted dataset name from the given ROOT filename.
Returns extracted dataset name from the given ROOT filename.
[ "Returns", "extracted", "dataset", "name", "from", "the", "given", "ROOT", "filename", "." ]
def get_dataset_name(name): '''Returns extracted dataset name from the given ROOT filename.''' if re.search('RelVal', name): run = str(int(re.findall('_R(\d{9})_', name)[0])) ds = re.findall('GR_R_\d*_V\d*C?_(?:RelVal)?_([\w\d]*-v\d+)_', name)[0] else: run, ds = re.findall('R(\d{9})_...
[ "def", "get_dataset_name", "(", "name", ")", ":", "if", "re", ".", "search", "(", "'RelVal'", ",", "name", ")", ":", "run", "=", "str", "(", "int", "(", "re", ".", "findall", "(", "'_R(\\d{9})_'", ",", "name", ")", "[", "0", "]", ")", ")", "ds", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Utilities/RelMon/python/web/app_utils.py#L68-L75
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2/eval/design.py
python
Design.grad
(self,func_name,method='CONTINUOUS_ADJOINT')
return self._eval(su2grad,func_name,method)
Evaluates SU2 Design Gradients by Name
Evaluates SU2 Design Gradients by Name
[ "Evaluates", "SU2", "Design", "Gradients", "by", "Name" ]
def grad(self,func_name,method='CONTINUOUS_ADJOINT'): """ Evaluates SU2 Design Gradients by Name """ return self._eval(su2grad,func_name,method)
[ "def", "grad", "(", "self", ",", "func_name", ",", "method", "=", "'CONTINUOUS_ADJOINT'", ")", ":", "return", "self", ".", "_eval", "(", "su2grad", ",", "func_name", ",", "method", ")" ]
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/eval/design.py#L188-L190
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/dist.py
python
Distribution.__init__
(self, attrs=None)
Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null va...
Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null va...
[ "Construct", "a", "new", "Distribution", "instance", ":", "initialize", "all", "the", "attributes", "of", "a", "Distribution", "and", "then", "use", "attrs", "(", "a", "dictionary", "mapping", "attribute", "names", "to", "values", ")", "to", "assign", "some", ...
def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in ...
[ "def", "__init__", "(", "self", ",", "attrs", "=", "None", ")", ":", "# Default values for our command-line options", "self", ".", "verbose", "=", "1", "self", ".", "dry_run", "=", "0", "self", ".", "help", "=", "0", "for", "attr", "in", "self", ".", "di...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/dist.py#L128-L287
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
benchmarks/functional_autograd_benchmark/torchvision_models.py
python
SetCriterion.loss_masks
(self, outputs, targets, indices, num_boxes)
return losses
Compute the losses related to the masks: the focal loss and the dice loss. targets dicts must contain the key "masks" containing a tensor of dim [nb_target_boxes, h, w]
Compute the losses related to the masks: the focal loss and the dice loss. targets dicts must contain the key "masks" containing a tensor of dim [nb_target_boxes, h, w]
[ "Compute", "the", "losses", "related", "to", "the", "masks", ":", "the", "focal", "loss", "and", "the", "dice", "loss", ".", "targets", "dicts", "must", "contain", "the", "key", "masks", "containing", "a", "tensor", "of", "dim", "[", "nb_target_boxes", "h"...
def loss_masks(self, outputs, targets, indices, num_boxes): """Compute the losses related to the masks: the focal loss and the dice loss. targets dicts must contain the key "masks" containing a tensor of dim [nb_target_boxes, h, w] """ assert "pred_masks" in outputs src_idx =...
[ "def", "loss_masks", "(", "self", ",", "outputs", ",", "targets", ",", "indices", ",", "num_boxes", ")", ":", "assert", "\"pred_masks\"", "in", "outputs", "src_idx", "=", "self", ".", "_get_src_permutation_idx", "(", "indices", ")", "tgt_idx", "=", "self", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/functional_autograd_benchmark/torchvision_models.py#L642-L669
libfive/libfive
ab5e354cf6fd992f80aaa9432c52683219515c8a
libfive/bind/python/libfive/stdlib/csg.py
python
loft
(a, b, zmin, zmax)
return Shape(stdlib.loft( args[0].ptr, args[1].ptr, args[2].ptr, args[3].ptr))
Produces a blended loft between a (at zmin) and b (at zmax) a and b should be 2D shapes (i.e. invariant along the z axis)
Produces a blended loft between a (at zmin) and b (at zmax) a and b should be 2D shapes (i.e. invariant along the z axis)
[ "Produces", "a", "blended", "loft", "between", "a", "(", "at", "zmin", ")", "and", "b", "(", "at", "zmax", ")", "a", "and", "b", "should", "be", "2D", "shapes", "(", "i", ".", "e", ".", "invariant", "along", "the", "z", "axis", ")" ]
def loft(a, b, zmin, zmax): """ Produces a blended loft between a (at zmin) and b (at zmax) a and b should be 2D shapes (i.e. invariant along the z axis) """ args = [Shape.wrap(a), Shape.wrap(b), Shape.wrap(zmin), Shape.wrap(zmax)] return Shape(stdlib.loft( args[0].ptr, args[1].p...
[ "def", "loft", "(", "a", ",", "b", ",", "zmin", ",", "zmax", ")", ":", "args", "=", "[", "Shape", ".", "wrap", "(", "a", ")", ",", "Shape", ".", "wrap", "(", "b", ")", ",", "Shape", ".", "wrap", "(", "zmin", ")", ",", "Shape", ".", "wrap", ...
https://github.com/libfive/libfive/blob/ab5e354cf6fd992f80aaa9432c52683219515c8a/libfive/bind/python/libfive/stdlib/csg.py#L151-L160
olliw42/storm32bgc
99d62a6130ae2950514022f50eb669c45a8cc1ba
old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py
python
dictkeyclean
(d)
return new_d
Convert all keys of the dict `d` to strings.
Convert all keys of the dict `d` to strings.
[ "Convert", "all", "keys", "of", "the", "dict", "d", "to", "strings", "." ]
def dictkeyclean(d): """Convert all keys of the dict `d` to strings. """ new_d = {} for k, v in d.items(): new_d[str(k)] = v return new_d
[ "def", "dictkeyclean", "(", "d", ")", ":", "new_d", "=", "{", "}", "for", "k", ",", "v", "in", "d", ".", "items", "(", ")", ":", "new_d", "[", "str", "(", "k", ")", "]", "=", "v", "return", "new_d" ]
https://github.com/olliw42/storm32bgc/blob/99d62a6130ae2950514022f50eb669c45a8cc1ba/old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py#L242-L248
thunil/tempoGAN
a9b92181e28a82c2029049791f875a6c1341d62b
tensorflow/tools/tilecreator_t.py
python
TileCreator.parseChannels
(self, channelString)
return c, c_types
arbitrary channel structure from string, expand if necessary. USE GLOBAL KEYS ^ 'd': default/ density; data that needs no special operations during augmentation 'v[label](x|y|z)': vector/velocity; is transformed according to the augmentation
arbitrary channel structure from string, expand if necessary. USE GLOBAL KEYS ^ 'd': default/ density; data that needs no special operations during augmentation 'v[label](x|y|z)': vector/velocity; is transformed according to the augmentation
[ "arbitrary", "channel", "structure", "from", "string", "expand", "if", "necessary", ".", "USE", "GLOBAL", "KEYS", "^", "d", ":", "default", "/", "density", ";", "data", "that", "needs", "no", "special", "operations", "during", "augmentation", "v", "[", "labe...
def parseChannels(self, channelString): ''' arbitrary channel structure from string, expand if necessary. USE GLOBAL KEYS ^ 'd': default/ density; data that needs no special operations during augmentation 'v[label](x|y|z)': vector/velocity; is transformed according to the augmentation ''' #need this for low...
[ "def", "parseChannels", "(", "self", ",", "channelString", ")", ":", "#need this for low and high, +high only labels", "c", "=", "channelString", ".", "lower", "(", ")", ".", "split", "(", "','", ")", "for", "i", "in", "range", "(", "len", "(", "c", ")", "...
https://github.com/thunil/tempoGAN/blob/a9b92181e28a82c2029049791f875a6c1341d62b/tensorflow/tools/tilecreator_t.py#L874-L905
sailing-pmls/bosen
06cb58902d011fbea5f9428f10ce30e621492204
style_script/cpplint.py
python
FileInfo.IsSource
(self)
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
File has a source file extension.
File has a source file extension.
[ "File", "has", "a", "source", "file", "extension", "." ]
def IsSource(self): """File has a source file extension.""" return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
[ "def", "IsSource", "(", "self", ")", ":", "return", "self", ".", "Extension", "(", ")", "[", "1", ":", "]", "in", "(", "'c'", ",", "'cc'", ",", "'cpp'", ",", "'cxx'", ")" ]
https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L1059-L1061
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py
python
obj_header.get_defined_structs
(self)
return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_ref_counted_t', 'cef_base_scoped_t']
Return a list of already defined structure names.
Return a list of already defined structure names.
[ "Return", "a", "list", "of", "already", "defined", "structure", "names", "." ]
def get_defined_structs(self): """ Return a list of already defined structure names. """ return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_ref_counted_t', 'cef_base_scoped_t']
[ "def", "get_defined_structs", "(", "self", ")", ":", "return", "[", "'cef_print_info_t'", ",", "'cef_window_info_t'", ",", "'cef_base_ref_counted_t'", ",", "'cef_base_scoped_t'", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L716-L718
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/reciprocal_grad.py
python
_reciprocal_grad_tbe
()
return
ReciprocalGrad TBE register
ReciprocalGrad TBE register
[ "ReciprocalGrad", "TBE", "register" ]
def _reciprocal_grad_tbe(): """ReciprocalGrad TBE register""" return
[ "def", "_reciprocal_grad_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/reciprocal_grad.py#L36-L38
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/util/log.py
python
_safe_unicode
(obj, encoding='utf-8')
Converts any given object to unicode string. >>> safeunicode('hello') u'hello' >>> safeunicode(2) u'2' >>> safeunicode('\xe1\x88\xb4') u'\u1234'
Converts any given object to unicode string.
[ "Converts", "any", "given", "object", "to", "unicode", "string", "." ]
def _safe_unicode(obj, encoding='utf-8'): """ Converts any given object to unicode string. >>> safeunicode('hello') u'hello' >>> safeunicode(2) u'2' >>> safeunicode('\xe1\x88\xb4') u'\u1234' """ t = type(obj) if t is unicode: return obj el...
[ "def", "_safe_unicode", "(", "obj", ",", "encoding", "=", "'utf-8'", ")", ":", "t", "=", "type", "(", "obj", ")", "if", "t", "is", "unicode", ":", "return", "obj", "elif", "t", "is", "str", ":", "return", "obj", ".", "decode", "(", "encoding", ",",...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/util/log.py#L51-L75
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Qrnn.py
python
Qrnn.free_term
(self)
return Blob.Blob(self._internal.get_free_term())
Gets the free term for all three gates in the same order. The blob size is 3 * hidden_size.
Gets the free term for all three gates in the same order. The blob size is 3 * hidden_size.
[ "Gets", "the", "free", "term", "for", "all", "three", "gates", "in", "the", "same", "order", ".", "The", "blob", "size", "is", "3", "*", "hidden_size", "." ]
def free_term(self): """Gets the free term for all three gates in the same order. The blob size is 3 * hidden_size. """ return Blob.Blob(self._internal.get_free_term())
[ "def", "free_term", "(", "self", ")", ":", "return", "Blob", ".", "Blob", "(", "self", ".", "_internal", ".", "get_free_term", "(", ")", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Qrnn.py#L276-L280
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBBreakpointLocation.SetScriptCallbackBody
(self, *args)
return _lldb.SBBreakpointLocation_SetScriptCallbackBody(self, *args)
SetScriptCallbackBody(self, str script_body_text) -> SBError Provide the body for the script function to be called when the breakpoint location is hit. The body will be wrapped in a function, which be passed two arguments: 'frame' - which holds the bottom-most SBFrame of the thread that hit the...
SetScriptCallbackBody(self, str script_body_text) -> SBError
[ "SetScriptCallbackBody", "(", "self", "str", "script_body_text", ")", "-", ">", "SBError" ]
def SetScriptCallbackBody(self, *args): """ SetScriptCallbackBody(self, str script_body_text) -> SBError Provide the body for the script function to be called when the breakpoint location is hit. The body will be wrapped in a function, which be passed two arguments: 'frame' - wh...
[ "def", "SetScriptCallbackBody", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBBreakpointLocation_SetScriptCallbackBody", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1837-L1850
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/utils/myio.py
python
dlmExtract
(inFile, outFields, outFile = None, convert = True, filterFile = None, filterField = None, inDelim = ',', outDelim = ',')
return data
Extract from a delimited file a list of fields to another delimited file Input: inFile - file name with the input data outFields - a list of fields to extract from inFile outFile - output file convert - whether to convert numeric inputs from strings inDelim - the delimiter in the input file ...
Extract from a delimited file a list of fields to another delimited file Input: inFile - file name with the input data outFields - a list of fields to extract from inFile outFile - output file convert - whether to convert numeric inputs from strings inDelim - the delimiter in the input file ...
[ "Extract", "from", "a", "delimited", "file", "a", "list", "of", "fields", "to", "another", "delimited", "file", "Input", ":", "inFile", "-", "file", "name", "with", "the", "input", "data", "outFields", "-", "a", "list", "of", "fields", "to", "extract", "...
def dlmExtract(inFile, outFields, outFile = None, convert = True, filterFile = None, filterField = None, inDelim = ',', outDelim = ',') : '''Extract from a delimited file a list of fields to another delimited file Input: inFile - file name with the input data outFields...
[ "def", "dlmExtract", "(", "inFile", ",", "outFields", ",", "outFile", "=", "None", ",", "convert", "=", "True", ",", "filterFile", "=", "None", ",", "filterField", "=", "None", ",", "inDelim", "=", "','", ",", "outDelim", "=", "','", ")", ":", "inFileH...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/utils/myio.py#L458-L515
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.Consume
(self, token)
Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed.
Consumes a piece of text.
[ "Consumes", "a", "piece", "of", "text", "." ]
def Consume(self, token): """Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed. """ if not self.TryConsume(token): raise self._ParseError('Expected "%s".' % token)
[ "def", "Consume", "(", "self", ",", "token", ")", ":", "if", "not", "self", ".", "TryConsume", "(", "token", ")", ":", "raise", "self", ".", "_ParseError", "(", "'Expected \"%s\".'", "%", "token", ")" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/text_format.py#L841-L851
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.GetBestSize
(*args, **kwargs)
return _core_.Window_GetBestSize(*args, **kwargs)
GetBestSize(self) -> Size This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (such as wx.Panel), the siz...
GetBestSize(self) -> Size
[ "GetBestSize", "(", "self", ")", "-", ">", "Size" ]
def GetBestSize(*args, **kwargs): """ GetBestSize(self) -> Size This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For win...
[ "def", "GetBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9593-L9604
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/environment.py
python
_resolve_path
(p)
return p
@param path: path string @type path: str Catch-all utility routine for fixing ROS environment variables that are a single path (e.g. ROS_ROOT). Currently this just expands tildes to home directories, but in the future it may encode other behaviors.
[]
def _resolve_path(p): """ @param path: path string @type path: str Catch-all utility routine for fixing ROS environment variables that are a single path (e.g. ROS_ROOT). Currently this just expands tildes to home directories, but in the future it may encode other behaviors. """ if ...
[ "def", "_resolve_path", "(", "p", ")", ":", "if", "p", "and", "p", "[", "0", "]", "==", "'~'", ":", "return", "os", ".", "path", ".", "expanduser", "(", "p", ")", "return", "p" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/environment.py#L55-L66
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/orthogonal.py
python
_pbcf
(n, theta)
return U, Ud
r"""Asymptotic series expansion of parabolic cylinder function The implementation is based on sections 3.2 and 3.3 from the original paper. Compared to the published version this code adds one more term to the asymptotic series. The detailed formulas can be found at [parabolic-asymptotics]_. The evalua...
r"""Asymptotic series expansion of parabolic cylinder function
[ "r", "Asymptotic", "series", "expansion", "of", "parabolic", "cylinder", "function" ]
def _pbcf(n, theta): r"""Asymptotic series expansion of parabolic cylinder function The implementation is based on sections 3.2 and 3.3 from the original paper. Compared to the published version this code adds one more term to the asymptotic series. The detailed formulas can be found at [parabolic-...
[ "def", "_pbcf", "(", "n", ",", "theta", ")", ":", "st", "=", "sin", "(", "theta", ")", "ct", "=", "cos", "(", "theta", ")", "# https://dlmf.nist.gov/12.10#vii", "mu", "=", "2.0", "*", "n", "+", "1.0", "# https://dlmf.nist.gov/12.10#E23", "eta", "=", "0.5...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/orthogonal.py#L876-L983
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.GetSizeTuple
(*args, **kwargs)
return _gdi_.DC_GetSizeTuple(*args, **kwargs)
GetSizeTuple() -> (width, height) This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if *maxX* and *maxY* represent the maximum horizontal and vertical 'pixel' values used in your application, the following co...
GetSizeTuple() -> (width, height)
[ "GetSizeTuple", "()", "-", ">", "(", "width", "height", ")" ]
def GetSizeTuple(*args, **kwargs): """ GetSizeTuple() -> (width, height) This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if *maxX* and *maxY* represent the maximum horizontal and vertical 'pixel' va...
[ "def", "GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4173-L4189
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
cyber/python/cyber_py3/parameter.py
python
ParameterServer.set_parameter
(self, param)
return _CYBER_PARAM.PyParameter_srv_set_parameter(self.param_srv, param.param)
set parameter, param is Parameter.
set parameter, param is Parameter.
[ "set", "parameter", "param", "is", "Parameter", "." ]
def set_parameter(self, param): """ set parameter, param is Parameter. """ return _CYBER_PARAM.PyParameter_srv_set_parameter(self.param_srv, param.param)
[ "def", "set_parameter", "(", "self", ",", "param", ")", ":", "return", "_CYBER_PARAM", ".", "PyParameter_srv_set_parameter", "(", "self", ".", "param_srv", ",", "param", ".", "param", ")" ]
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/cyber/python/cyber_py3/parameter.py#L160-L164
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/_ctypes/symbol.py
python
SymbolBase.__init__
(self, handle)
Initialize the function with handle Parameters ---------- handle : SymbolHandle the handle to the underlying C++ Symbol
Initialize the function with handle
[ "Initialize", "the", "function", "with", "handle" ]
def __init__(self, handle): """Initialize the function with handle Parameters ---------- handle : SymbolHandle the handle to the underlying C++ Symbol """ self.handle = handle
[ "def", "__init__", "(", "self", ",", "handle", ")", ":", "self", ".", "handle", "=", "handle" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/_ctypes/symbol.py#L35-L43
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
tools/idl_parser/idl_parser.py
python
IDLParser.p_SpecialOperation
(self, p)
SpecialOperation : Special Specials ReturnType OperationRest
SpecialOperation : Special Specials ReturnType OperationRest
[ "SpecialOperation", ":", "Special", "Specials", "ReturnType", "OperationRest" ]
def p_SpecialOperation(self, p): """SpecialOperation : Special Specials ReturnType OperationRest""" p[4].AddChildren(ListFromConcat(p[1], p[2], p[3])) p[0] = p[4]
[ "def", "p_SpecialOperation", "(", "self", ",", "p", ")", ":", "p", "[", "4", "]", ".", "AddChildren", "(", "ListFromConcat", "(", "p", "[", "1", "]", ",", "p", "[", "2", "]", ",", "p", "[", "3", "]", ")", ")", "p", "[", "0", "]", "=", "p", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L533-L536
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge2.py
python
ExodusModel.make_elements_quadratic
(self, element_block_ids='all')
Convert elements in one or more element blocks to a quadratic type. This will attempt to find the best element to convert to given the conversion schemes involved. If more than one element option exists for a given element type, this will choose the option that produces the fewest node...
Convert elements in one or more element blocks to a quadratic type.
[ "Convert", "elements", "in", "one", "or", "more", "element", "blocks", "to", "a", "quadratic", "type", "." ]
def make_elements_quadratic(self, element_block_ids='all'): """ Convert elements in one or more element blocks to a quadratic type. This will attempt to find the best element to convert to given the conversion schemes involved. If more than one element option exists for a given...
[ "def", "make_elements_quadratic", "(", "self", ",", "element_block_ids", "=", "'all'", ")", ":", "self", ".", "_change_element_order", "(", "element_block_ids", ",", "2", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L2830-L2840
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mailbox.py
python
Maildir.flush
(self)
return
Write any pending changes to disk.
Write any pending changes to disk.
[ "Write", "any", "pending", "changes", "to", "disk", "." ]
def flush(self): """Write any pending changes to disk.""" return
[ "def", "flush", "(", "self", ")", ":", "return" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L364-L366
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/file_util.py
python
_copy_file_contents
(src, dst, buffer_size=16*1024)
Copy the file 'src' to 'dst'. Both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files.
Copy the file 'src' to 'dst'.
[ "Copy", "the", "file", "src", "to", "dst", "." ]
def _copy_file_contents(src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'. Both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is ma...
[ "def", "_copy_file_contents", "(", "src", ",", "dst", ",", "buffer_size", "=", "16", "*", "1024", ")", ":", "# Stolen from shutil module in the standard library, but with", "# custom error-handling added.", "fsrc", "=", "None", "fdst", "=", "None", "try", ":", "try", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/file_util.py#L18-L69
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/cluster/hierarchy.py
python
cophenet
(Z, Y=None)
return (c, zz)
Calculate the cophenetic distances between each observation in the hierarchical clustering defined by the linkage ``Z``. Suppose ``p`` and ``q`` are original observations in disjoint clusters ``s`` and ``t``, respectively and ``s`` and ``t`` are joined by a direct parent cluster ``u``. The cophenet...
Calculate the cophenetic distances between each observation in the hierarchical clustering defined by the linkage ``Z``.
[ "Calculate", "the", "cophenetic", "distances", "between", "each", "observation", "in", "the", "hierarchical", "clustering", "defined", "by", "the", "linkage", "Z", "." ]
def cophenet(Z, Y=None): """ Calculate the cophenetic distances between each observation in the hierarchical clustering defined by the linkage ``Z``. Suppose ``p`` and ``q`` are original observations in disjoint clusters ``s`` and ``t``, respectively and ``s`` and ``t`` are joined by a direct p...
[ "def", "cophenet", "(", "Z", ",", "Y", "=", "None", ")", ":", "Z", "=", "np", ".", "asarray", "(", "Z", ",", "order", "=", "'c'", ")", "is_valid_linkage", "(", "Z", ",", "throw", "=", "True", ",", "name", "=", "'Z'", ")", "Zs", "=", "Z", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/cluster/hierarchy.py#L1618-L1748
CMU-Perceptual-Computing-Lab/caffe_rtpose
a4778bb1c3eb74d7250402016047216f77b4dba6
scripts/cpp_lint.py
python
_SetCountingStyle
(level)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level)
[ "def", "_SetCountingStyle", "(", "level", ")", ":", "_cpplint_state", ".", "SetCountingStyle", "(", "level", ")" ]
https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/blob/a4778bb1c3eb74d7250402016047216f77b4dba6/scripts/cpp_lint.py#L787-L789
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-number-of-arrows-to-burst-balloons.py
python
Solution.findMinArrowShots
(self, points)
return result
:type points: List[List[int]] :rtype: int
:type points: List[List[int]] :rtype: int
[ ":", "type", "points", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def findMinArrowShots(self, points): """ :type points: List[List[int]] :rtype: int """ if not points: return 0 points.sort() result = 0 i = 0 while i < len(points): j = i + 1 right_bound = points[i][1] ...
[ "def", "findMinArrowShots", "(", "self", ",", "points", ")", ":", "if", "not", "points", ":", "return", "0", "points", ".", "sort", "(", ")", "result", "=", "0", "i", "=", "0", "while", "i", "<", "len", "(", "points", ")", ":", "j", "=", "i", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-number-of-arrows-to-burst-balloons.py#L5-L25
wbaizx/VideoLive
9452554b58536c54a5dd1a2ebd5b76363bd39c06
library/src/main/cpp/libyuv/setup_links.py
python
Action.announce
(self, planning)
Log a description of this action. Args: planning - True iff we're in the planning stage, False if we're in the doit stage.
Log a description of this action.
[ "Log", "a", "description", "of", "this", "action", "." ]
def announce(self, planning): """Log a description of this action. Args: planning - True iff we're in the planning stage, False if we're in the doit stage. """ pass
[ "def", "announce", "(", "self", ",", "planning", ")", ":", "pass" ]
https://github.com/wbaizx/VideoLive/blob/9452554b58536c54a5dd1a2ebd5b76363bd39c06/library/src/main/cpp/libyuv/setup_links.py#L151-L158
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/parallel_for/pfor.py
python
PForConfig._set_iters
(self, iters)
Set number of pfor iterations.
Set number of pfor iterations.
[ "Set", "number", "of", "pfor", "iterations", "." ]
def _set_iters(self, iters): """Set number of pfor iterations.""" if isinstance(iters, ops.Tensor): iters = tensor_util.constant_value(iters) self._maybe_iters = iters
[ "def", "_set_iters", "(", "self", ",", "iters", ")", ":", "if", "isinstance", "(", "iters", ",", "ops", ".", "Tensor", ")", ":", "iters", "=", "tensor_util", ".", "constant_value", "(", "iters", ")", "self", ".", "_maybe_iters", "=", "iters" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/parallel_for/pfor.py#L1125-L1129
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/autograd.py
python
BinaryCrossEntropy.backward
(self, dy=1.0)
Args: dy (float or CTensor): scalar, accumulate gradient from outside of current network, usually equal to 1.0 Returns: dx (CTensor): data for the dL /dx, L is the loss, x is the output of current network. note that this is true f...
Args: dy (float or CTensor): scalar, accumulate gradient from outside of current network, usually equal to 1.0 Returns: dx (CTensor): data for the dL /dx, L is the loss, x is the output of current network. note that this is true f...
[ "Args", ":", "dy", "(", "float", "or", "CTensor", ")", ":", "scalar", "accumulate", "gradient", "from", "outside", "of", "current", "network", "usually", "equal", "to", "1", ".", "0", "Returns", ":", "dx", "(", "CTensor", ")", ":", "data", "for", "the"...
def backward(self, dy=1.0): """ Args: dy (float or CTensor): scalar, accumulate gradient from outside of current network, usually equal to 1.0 Returns: dx (CTensor): data for the dL /dx, L is the loss, x is the output ...
[ "def", "backward", "(", "self", ",", "dy", "=", "1.0", ")", ":", "dx", "=", "singa", ".", "__div__", "(", "self", ".", "t", ",", "self", ".", "x", ")", "negt", "=", "singa", ".", "AddFloat", "(", "self", ".", "t", ",", "-", "1.0", ")", "negx"...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L1184-L1205
Illumina/hap.py
84011695b2ff2406c16a335106db6831fb67fdfe
src/python/Tools/fastasize.py
python
fastaContigLengths
(fastafile)
return fastacontiglengths
Return contig lengths in a fasta file
Return contig lengths in a fasta file
[ "Return", "contig", "lengths", "in", "a", "fasta", "file" ]
def fastaContigLengths(fastafile): """ Return contig lengths in a fasta file """ if not os.path.exists(fastafile + ".fai"): raise Exception("Fasta file %s is not indexed" % fastafile) fastacontiglengths = {} with open(fastafile + ".fai") as fai: for l in fai: row = l.st...
[ "def", "fastaContigLengths", "(", "fastafile", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "fastafile", "+", "\".fai\"", ")", ":", "raise", "Exception", "(", "\"Fasta file %s is not indexed\"", "%", "fastafile", ")", "fastacontiglengths", "=", ...
https://github.com/Illumina/hap.py/blob/84011695b2ff2406c16a335106db6831fb67fdfe/src/python/Tools/fastasize.py#L34-L47
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/roslib/src/roslib/packages.py
python
find_resource
(pkg, resource_name, filter_fn=None, rospack=None)
return unique_matches
Warning: unstable API due to catkin. Locate the file named resource_name in package, optionally matching specified filter. find_resource() will return a list of matches, but only for a given scope. If the resource is found in the binary build directory, it will only return matches in that directo...
Warning: unstable API due to catkin.
[ "Warning", ":", "unstable", "API", "due", "to", "catkin", "." ]
def find_resource(pkg, resource_name, filter_fn=None, rospack=None): """ Warning: unstable API due to catkin. Locate the file named resource_name in package, optionally matching specified filter. find_resource() will return a list of matches, but only for a given scope. If the resource is found i...
[ "def", "find_resource", "(", "pkg", ",", "resource_name", ",", "filter_fn", "=", "None", ",", "rospack", "=", "None", ")", ":", "# New resource-location policy in Fuerte, induced by the new catkin ", "# build system:", "# (1) Use catkin_find to find libexec and share locations,...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/packages.py#L463-L520
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/win/split_link/split_link.py
python
AttemptLink
(flags, inputs_by_part, unresolved_by_part, deffiles, import_libs, intermediate_manifest)
return all_succeeded, dlls, combined_externals
Tries to run the linker for all parts using the current round of generated import libs and .def files. If the link fails, updates the unresolved externals list per part.
Tries to run the linker for all parts using the current round of generated import libs and .def files. If the link fails, updates the unresolved externals list per part.
[ "Tries", "to", "run", "the", "linker", "for", "all", "parts", "using", "the", "current", "round", "of", "generated", "import", "libs", "and", ".", "def", "files", ".", "If", "the", "link", "fails", "updates", "the", "unresolved", "externals", "list", "per"...
def AttemptLink(flags, inputs_by_part, unresolved_by_part, deffiles, import_libs, intermediate_manifest): """Tries to run the linker for all parts using the current round of generated import libs and .def files. If the link fails, updates the unresolved externals list per part.""" dlls = [] al...
[ "def", "AttemptLink", "(", "flags", ",", "inputs_by_part", ",", "unresolved_by_part", ",", "deffiles", ",", "import_libs", ",", "intermediate_manifest", ")", ":", "dlls", "=", "[", "]", "all_succeeded", "=", "True", "new_externals", "=", "[", "]", "Log", "(", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/win/split_link/split_link.py#L277-L303
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
PhotoImage.get
(self, x, y)
return self.tk.call(self.name, 'get', x, y)
Return the color (red, green, blue) of the pixel at X,Y.
Return the color (red, green, blue) of the pixel at X,Y.
[ "Return", "the", "color", "(", "red", "green", "blue", ")", "of", "the", "pixel", "at", "X", "Y", "." ]
def get(self, x, y): """Return the color (red, green, blue) of the pixel at X,Y.""" return self.tk.call(self.name, 'get', x, y)
[ "def", "get", "(", "self", ",", "x", ",", "y", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "name", ",", "'get'", ",", "x", ",", "y", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L3579-L3581
continental/ecal
204dab80a24fe01abca62541133b311bf0c09608
lang/python/core/ecal/core/subscriber.py
python
StringSubscriber.receive
(self, timeout=0)
return ret, msg, time
receive subscriber content with timeout :param timeout: receive timeout in ms
receive subscriber content with timeout
[ "receive", "subscriber", "content", "with", "timeout" ]
def receive(self, timeout=0): """ receive subscriber content with timeout :param timeout: receive timeout in ms """ ret, msg, time = self.c_subscriber.receive(timeout) if ret > 0: msg = msg.decode() else: msg = "" return ret, msg, time
[ "def", "receive", "(", "self", ",", "timeout", "=", "0", ")", ":", "ret", ",", "msg", ",", "time", "=", "self", ".", "c_subscriber", ".", "receive", "(", "timeout", ")", "if", "ret", ">", "0", ":", "msg", "=", "msg", ".", "decode", "(", ")", "e...
https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/subscriber.py#L143-L154
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_vehicle.py
python
VehicleDomain.getEffort
(self, vehID, time, edgeID)
return self._getUniversal(tc.VAR_EDGE_EFFORT, vehID, "tds", 2, time, edgeID)
getEffort(string, double, string) -> double Returns the information about the effort needed for edge "edgeID" valid for the given time from the vehicle's internal effort container (see setEffort). If there is no individual travel time set, INVALID_DOUBLE_VALUE is returned.
getEffort(string, double, string) -> double
[ "getEffort", "(", "string", "double", "string", ")", "-", ">", "double" ]
def getEffort(self, vehID, time, edgeID): """getEffort(string, double, string) -> double Returns the information about the effort needed for edge "edgeID" valid for the given time from the vehicle's internal effort container (see setEffort). If there is no individual travel time...
[ "def", "getEffort", "(", "self", ",", "vehID", ",", "time", ",", "edgeID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_EDGE_EFFORT", ",", "vehID", ",", "\"tds\"", ",", "2", ",", "time", ",", "edgeID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L452-L460
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/models/embedding/word2vec.py
python
Word2Vec.optimize
(self, loss)
Build the graph to optimize the loss function.
Build the graph to optimize the loss function.
[ "Build", "the", "graph", "to", "optimize", "the", "loss", "function", "." ]
def optimize(self, loss): """Build the graph to optimize the loss function.""" # Optimizer nodes. # Linear learning rate decay. opts = self._options words_to_train = float(opts.words_per_epoch * opts.epochs_to_train) lr = opts.learning_rate * tf.maximum( 0.0001, 1.0 - tf.cast(self._word...
[ "def", "optimize", "(", "self", ",", "loss", ")", ":", "# Optimizer nodes.", "# Linear learning rate decay.", "opts", "=", "self", ".", "_options", "words_to_train", "=", "float", "(", "opts", ".", "words_per_epoch", "*", "opts", ".", "epochs_to_train", ")", "lr...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/models/embedding/word2vec.py#L275-L289
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/tkwidgets/Floater.py
python
FloaterWidget.get
(self)
return self.value
self.get() Get current floater value
self.get() Get current floater value
[ "self", ".", "get", "()", "Get", "current", "floater", "value" ]
def get(self): """ self.get() Get current floater value """ return self.value
[ "def", "get", "(", "self", ")", ":", "return", "self", ".", "value" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/tkwidgets/Floater.py#L135-L140
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Spinbox.__init__
(self, master=None, cnf={}, **kw)
Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, in...
Construct a spinbox widget with the parent MASTER.
[ "Construct", "a", "spinbox", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthic...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'spinbox'", ",", "cnf", ",", "kw", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L3451-L3478
zachriggle/ida-splode
a4aee3be415b318a0e051a523ebd0a8d6d5e0026
py/idasplode/dynamic.py
python
CreateDynamicFunctionStub
(Name,StackDelta)
return Ea
Create a function stub for a dynamically resolved routine so that IDA can track X-refs
Create a function stub for a dynamically resolved routine so that IDA can track X-refs
[ "Create", "a", "function", "stub", "for", "a", "dynamically", "resolved", "routine", "so", "that", "IDA", "can", "track", "X", "-", "refs" ]
def CreateDynamicFunctionStub(Name,StackDelta): """Create a function stub for a dynamically resolved routine so that IDA can track X-refs""" Seg = GetDynamicSegment() print "Seg: %r" % Seg Ea = FindFirstNop(Seg) print "Ea: %r" % Ea Name = str(Name) print "Name: %r" % Name Bytes = [0xc...
[ "def", "CreateDynamicFunctionStub", "(", "Name", ",", "StackDelta", ")", ":", "Seg", "=", "GetDynamicSegment", "(", ")", "print", "\"Seg: %r\"", "%", "Seg", "Ea", "=", "FindFirstNop", "(", "Seg", ")", "print", "\"Ea: %r\"", "%", "Ea", "Name", "=", "str", "...
https://github.com/zachriggle/ida-splode/blob/a4aee3be415b318a0e051a523ebd0a8d6d5e0026/py/idasplode/dynamic.py#L56-L70
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/linalg/linalg.py
python
solve
(a, b)
Solve a linear matrix equation, or system of linear scalar equations. Computes the "exact" solution, `x`, of the well-determined, i.e., full rank, linear matrix equation `ax = b`. Parameters ---------- a : array_like, shape (M, M) Coefficient matrix. b : array_like, shape (M,) or (M, N...
Solve a linear matrix equation, or system of linear scalar equations.
[ "Solve", "a", "linear", "matrix", "equation", "or", "system", "of", "linear", "scalar", "equations", "." ]
def solve(a, b): """ Solve a linear matrix equation, or system of linear scalar equations. Computes the "exact" solution, `x`, of the well-determined, i.e., full rank, linear matrix equation `ax = b`. Parameters ---------- a : array_like, shape (M, M) Coefficient matrix. b : ar...
[ "def", "solve", "(", "a", ",", "b", ")", ":", "a", ",", "_", "=", "_makearray", "(", "a", ")", "b", ",", "wrap", "=", "_makearray", "(", "b", ")", "one_eq", "=", "len", "(", "b", ".", "shape", ")", "==", "1", "if", "one_eq", ":", "b", "=", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/linalg/linalg.py#L244-L332
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/DecTree/BuildQuantTree.py
python
QuantTreeBoot
(examples, attrs, nPossibleVals, nBoundsPerVar, initialVar=None, maxDepth=-1, **kwargs)
return tree
Bootstrapping code for the QuantTree If _initialVar_ is not set, the algorithm will automatically choose the first variable in the tree (the standard greedy approach). Otherwise, _initialVar_ will be used as the first split.
Bootstrapping code for the QuantTree
[ "Bootstrapping", "code", "for", "the", "QuantTree" ]
def QuantTreeBoot(examples, attrs, nPossibleVals, nBoundsPerVar, initialVar=None, maxDepth=-1, **kwargs): """ Bootstrapping code for the QuantTree If _initialVar_ is not set, the algorithm will automatically choose the first variable in the tree (the standard greedy approach)....
[ "def", "QuantTreeBoot", "(", "examples", ",", "attrs", ",", "nPossibleVals", ",", "nBoundsPerVar", ",", "initialVar", "=", "None", ",", "maxDepth", "=", "-", "1", ",", "*", "*", "kwargs", ")", ":", "attrs", "=", "list", "(", "attrs", ")", "for", "i", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/DecTree/BuildQuantTree.py#L211-L301
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/generator/msvs.py
python
GenerateOutput
(target_list, target_dicts, data, params)
Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing per .gyp data. params:
Generate .sln and .vcproj files.
[ "Generate", ".", "sln", "and", ".", "vcproj", "files", "." ]
def GenerateOutput(target_list, target_dicts, data, params): """Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing pe...
[ "def", "GenerateOutput", "(", "target_list", ",", "target_dicts", ",", "data", ",", "params", ")", ":", "global", "fixpath_prefix", "options", "=", "params", "[", "'options'", "]", "# Get the project file format version back out of where we stashed it in", "# GeneratorCalcu...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/msvs.py#L1694-L1765
tangjianpku/LINE
d5f840941e0f4026090d1b1feeaf15da38e2b24b
windows/evaluate/liblinear/python/liblinearutil.py
python
svm_read_problem
(data_file_name)
return (prob_y, prob_x)
svm_read_problem(data_file_name) -> [y, x] Read LIBSVM-format data from data_file_name and return labels y and data instances x.
svm_read_problem(data_file_name) -> [y, x]
[ "svm_read_problem", "(", "data_file_name", ")", "-", ">", "[", "y", "x", "]" ]
def svm_read_problem(data_file_name): """ svm_read_problem(data_file_name) -> [y, x] Read LIBSVM-format data from data_file_name and return labels y and data instances x. """ prob_y = [] prob_x = [] for line in open(data_file_name): line = line.split(None, 1) # In case an instance with all zero features ...
[ "def", "svm_read_problem", "(", "data_file_name", ")", ":", "prob_y", "=", "[", "]", "prob_x", "=", "[", "]", "for", "line", "in", "open", "(", "data_file_name", ")", ":", "line", "=", "line", ".", "split", "(", "None", ",", "1", ")", "# In case an ins...
https://github.com/tangjianpku/LINE/blob/d5f840941e0f4026090d1b1feeaf15da38e2b24b/windows/evaluate/liblinear/python/liblinearutil.py#L7-L27
stepcode/stepcode
2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39
src/exp2python/python/SCL/Part21.py
python
Lexer.t_REAL
(self, t)
return t
r'[+-]*[0-9][0-9]*\.[0-9]*(?:E[+-]*[0-9][0-9]*)?
r'[+-]*[0-9][0-9]*\.[0-9]*(?:E[+-]*[0-9][0-9]*)?
[ "r", "[", "+", "-", "]", "*", "[", "0", "-", "9", "]", "[", "0", "-", "9", "]", "*", "\\", ".", "[", "0", "-", "9", "]", "*", "(", "?", ":", "E", "[", "+", "-", "]", "*", "[", "0", "-", "9", "]", "[", "0", "-", "9", "]", "*", ...
def t_REAL(self, t): r'[+-]*[0-9][0-9]*\.[0-9]*(?:E[+-]*[0-9][0-9]*)?' t.value = float(t.value) return t
[ "def", "t_REAL", "(", "self", ",", "t", ")", ":", "t", ".", "value", "=", "float", "(", "t", ".", "value", ")", "return", "t" ]
https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L180-L183
CleverRaven/Cataclysm-DDA
03e7363df0835ec1b39da973ea29f26f27833b38
tools/gfx_tools/compose.py
python
Tilesheet.process_png
( self, filepath: Path, )
Verify image root name is unique, load it and register
Verify image root name is unique, load it and register
[ "Verify", "image", "root", "name", "is", "unique", "load", "it", "and", "register" ]
def process_png( self, filepath: Path, ) -> None: ''' Verify image root name is unique, load it and register ''' if filepath.stem in self.tileset.pngname_to_pngnum: if not self.is_filler: log.error( 'duplicate root name ...
[ "def", "process_png", "(", "self", ",", "filepath", ":", "Path", ",", ")", "->", "None", ":", "if", "filepath", ".", "stem", "in", "self", ".", "tileset", ".", "pngname_to_pngnum", ":", "if", "not", "self", ".", "is_filler", ":", "log", ".", "error", ...
https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/gfx_tools/compose.py#L554-L583
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/operator.py
python
register
(reg_name)
return do_register
Register a subclass of CustomOpProp to the registry with name reg_name.
Register a subclass of CustomOpProp to the registry with name reg_name.
[ "Register", "a", "subclass", "of", "CustomOpProp", "to", "the", "registry", "with", "name", "reg_name", "." ]
def register(reg_name): """Register a subclass of CustomOpProp to the registry with name reg_name.""" def do_register(prop_cls): """Register a subclass of CustomOpProp to the registry.""" fb_functype = CFUNCTYPE(c_int, c_int, POINTER(c_void_p), POINTER(c_int), POI...
[ "def", "register", "(", "reg_name", ")", ":", "def", "do_register", "(", "prop_cls", ")", ":", "\"\"\"Register a subclass of CustomOpProp to the registry.\"\"\"", "fb_functype", "=", "CFUNCTYPE", "(", "c_int", ",", "c_int", ",", "POINTER", "(", "c_void_p", ")", ",",...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/operator.py#L710-L1123
logcabin/logcabin
ee6c55ae9744b82b451becd9707d26c7c1b6bbfb
scripts/cpplint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/logcabin/logcabin/blob/ee6c55ae9744b82b451becd9707d26c7c1b6bbfb/scripts/cpplint.py#L545-L547
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.IsEqualUpTo
(*args, **kwargs)
return _misc_.DateTime_IsEqualUpTo(*args, **kwargs)
IsEqualUpTo(self, DateTime dt, TimeSpan ts) -> bool
IsEqualUpTo(self, DateTime dt, TimeSpan ts) -> bool
[ "IsEqualUpTo", "(", "self", "DateTime", "dt", "TimeSpan", "ts", ")", "-", ">", "bool" ]
def IsEqualUpTo(*args, **kwargs): """IsEqualUpTo(self, DateTime dt, TimeSpan ts) -> bool""" return _misc_.DateTime_IsEqualUpTo(*args, **kwargs)
[ "def", "IsEqualUpTo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_IsEqualUpTo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4053-L4055
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/utils/check_cfc/check_cfc.py
python
dash_g_no_change.perform_check
(self, arguments, my_env)
Check if different code is generated with/without the -g flag.
Check if different code is generated with/without the -g flag.
[ "Check", "if", "different", "code", "is", "generated", "with", "/", "without", "the", "-", "g", "flag", "." ]
def perform_check(self, arguments, my_env): """Check if different code is generated with/without the -g flag.""" output_file_b = get_temp_file_name('.o') alternate_command = list(arguments) alternate_command = flip_dash_g(alternate_command) alternate_command = set_output_file(al...
[ "def", "perform_check", "(", "self", ",", "arguments", ",", "my_env", ")", ":", "output_file_b", "=", "get_temp_file_name", "(", "'.o'", ")", "alternate_command", "=", "list", "(", "arguments", ")", "alternate_command", "=", "flip_dash_g", "(", "alternate_command"...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/utils/check_cfc/check_cfc.py#L260-L277
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/hypertreelist.py
python
TreeListMainWindow.ChildrenClosing
(self, item)
We are about to destroy the item's children. :param `item`: an instance of :class:`TreeListItem`.
We are about to destroy the item's children.
[ "We", "are", "about", "to", "destroy", "the", "item", "s", "children", "." ]
def ChildrenClosing(self, item): """ We are about to destroy the item's children. :param `item`: an instance of :class:`TreeListItem`. """ if self._editCtrl != None and item != self._editCtrl.item() and self.IsDescendantOf(item, self._editCtrl.item()): self._editCtr...
[ "def", "ChildrenClosing", "(", "self", ",", "item", ")", ":", "if", "self", ".", "_editCtrl", "!=", "None", "and", "item", "!=", "self", ".", "_editCtrl", ".", "item", "(", ")", "and", "self", ".", "IsDescendantOf", "(", "item", ",", "self", ".", "_e...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L2506-L2521
Komnomnomnom/swigibpy
cfd307fdbfaffabc69a2dc037538d7e34a8b8daf
swigibpy.py
python
TagValue.__init__
(self, *args)
__init__(TagValue self) -> TagValue __init__(TagValue self, IBString const & p_tag, IBString const & p_value) -> TagValue
__init__(TagValue self) -> TagValue __init__(TagValue self, IBString const & p_tag, IBString const & p_value) -> TagValue
[ "__init__", "(", "TagValue", "self", ")", "-", ">", "TagValue", "__init__", "(", "TagValue", "self", "IBString", "const", "&", "p_tag", "IBString", "const", "&", "p_value", ")", "-", ">", "TagValue" ]
def __init__(self, *args): """ __init__(TagValue self) -> TagValue __init__(TagValue self, IBString const & p_tag, IBString const & p_value) -> TagValue """ _swigibpy.TagValue_swiginit(self, _swigibpy.new_TagValue(*args))
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_swigibpy", ".", "TagValue_swiginit", "(", "self", ",", "_swigibpy", ".", "new_TagValue", "(", "*", "args", ")", ")" ]
https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L2006-L2011
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/CrystalField/function.py
python
PhysicalProperties.toString
(self)
return out
Create function initialisation string
Create function initialisation string
[ "Create", "function", "initialisation", "string" ]
def toString(self): """Create function initialisation string""" types = ['CrystalFieldHeatCapacity', 'CrystalFieldSusceptibility', 'CrystalFieldMagnetisation', 'CrystalFieldMoment'] out = 'name=%s' % (types[self._typeid - 1]) if self._typeid != self.HEATCAPACITY: ...
[ "def", "toString", "(", "self", ")", ":", "types", "=", "[", "'CrystalFieldHeatCapacity'", ",", "'CrystalFieldSusceptibility'", ",", "'CrystalFieldMagnetisation'", ",", "'CrystalFieldMoment'", "]", "out", "=", "'name=%s'", "%", "(", "types", "[", "self", ".", "_ty...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/CrystalField/function.py#L686-L706
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/plotting_units.py
python
AutoHistogramPlotter.bin_size
(self)
return (numpy.max(self.input) - numpy.min(self.input)) / self.nbins
:return: The size of each bin according to Freedman–Diaconis rule.
:return: The size of each bin according to Freedman–Diaconis rule.
[ ":", "return", ":", "The", "size", "of", "each", "bin", "according", "to", "Freedman–Diaconis", "rule", "." ]
def bin_size(self): """ :return: The size of each bin according to Freedman–Diaconis rule. """ return (numpy.max(self.input) - numpy.min(self.input)) / self.nbins
[ "def", "bin_size", "(", "self", ")", ":", "return", "(", "numpy", ".", "max", "(", "self", ".", "input", ")", "-", "numpy", ".", "min", "(", "self", ".", "input", ")", ")", "/", "self", ".", "nbins" ]
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/plotting_units.py#L641-L645
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/data_flow_ops.py
python
MapStagingArea.put
(self, key, vals, indices=None, name=None)
return op
Create an op that stores the (key, vals) pair in the staging area. Incomplete puts are possible, preferably using a dictionary for vals as the appropriate dtypes and shapes can be inferred from the value names dictionary key values. If vals is a list or tuple, indices must also be specified so that the...
Create an op that stores the (key, vals) pair in the staging area.
[ "Create", "an", "op", "that", "stores", "the", "(", "key", "vals", ")", "pair", "in", "the", "staging", "area", "." ]
def put(self, key, vals, indices=None, name=None): """ Create an op that stores the (key, vals) pair in the staging area. Incomplete puts are possible, preferably using a dictionary for vals as the appropriate dtypes and shapes can be inferred from the value names dictionary key values. If vals is ...
[ "def", "put", "(", "self", ",", "key", ",", "vals", ",", "indices", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"%s_put\"", "%", "self", ".", "_name", ",", "self", ".", "_scope_vals", "(", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/data_flow_ops.py#L1892-L1929
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/misc.py
python
splitext
(path)
return base, ext
Like os.path.splitext, but take off .tar too
Like os.path.splitext, but take off .tar too
[ "Like", "os", ".", "path", ".", "splitext", "but", "take", "off", ".", "tar", "too" ]
def splitext(path): # type: (str) -> Tuple[str, str] """Like os.path.splitext, but take off .tar too""" base, ext = posixpath.splitext(path) if base.lower().endswith('.tar'): ext = base[-4:] + ext base = base[:-4] return base, ext
[ "def", "splitext", "(", "path", ")", ":", "# type: (str) -> Tuple[str, str]", "base", ",", "ext", "=", "posixpath", ".", "splitext", "(", "path", ")", "if", "base", ".", "lower", "(", ")", ".", "endswith", "(", "'.tar'", ")", ":", "ext", "=", "base", "...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/misc.py#L285-L292
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecCodeSignBundle
(self, key, resource_rules, entitlements, provisioning)
Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. copy ResourceRules.plist from the user or the SDK into the bundle, 2. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.m...
Code sign a bundle.
[ "Code", "sign", "a", "bundle", "." ]
def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning): """Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. copy ResourceRules.plist from the user or the SDK into the bundle, 2. pick the provisioning profile tha...
[ "def", "ExecCodeSignBundle", "(", "self", ",", "key", ",", "resource_rules", ",", "entitlements", ",", "provisioning", ")", ":", "resource_rules_path", "=", "self", ".", "_InstallResourceRules", "(", "resource_rules", ")", "substitutions", ",", "overrides", "=", "...
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/mac_tool.py#L352-L373