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
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/errors.py
python
DataLossError.__init__
(self, node_def, op, message)
Creates a `DataLossError`.
Creates a `DataLossError`.
[ "Creates", "a", "DataLossError", "." ]
def __init__(self, node_def, op, message): """Creates a `DataLossError`.""" super(DataLossError, self).__init__(node_def, op, message, DATA_LOSS)
[ "def", "__init__", "(", "self", ",", "node_def", ",", "op", ",", "message", ")", ":", "super", "(", "DataLossError", ",", "self", ")", ".", "__init__", "(", "node_def", ",", "op", ",", "message", ",", "DATA_LOSS", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/errors.py#L409-L411
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/optim/lr_scheduler.py
python
LambdaLR.load_state_dict
(self, state_dict)
Loads the schedulers state. When saving or loading the scheduler, please make sure to also save or load the state of the optimizer. Args: state_dict (dict): scheduler state. Should be an object returned from a call to :meth:`state_dict`.
Loads the schedulers state.
[ "Loads", "the", "schedulers", "state", "." ]
def load_state_dict(self, state_dict): """Loads the schedulers state. When saving or loading the scheduler, please make sure to also save or load the state of the optimizer. Args: state_dict (dict): scheduler state. Should be an object returned from a call to :meth:...
[ "def", "load_state_dict", "(", "self", ",", "state_dict", ")", ":", "lr_lambdas", "=", "state_dict", ".", "pop", "(", "'lr_lambdas'", ")", "self", ".", "__dict__", ".", "update", "(", "state_dict", ")", "# Restore state_dict keys in order to prevent side effects", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/optim/lr_scheduler.py#L227-L245
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
docs-source/sphinx/autonumber.py
python
get_chapter
(node, depth, section_numbers)
return ".".join(str(i) for i in chapter)
Get the numerical position of the chapter in which node resides args: node: A docutils node whose chapter we want the number of depth: How many levels deep into the toctree is a "chapter" section_numbers: The output of chapter_numbers_by_section(env)
Get the numerical position of the chapter in which node resides
[ "Get", "the", "numerical", "position", "of", "the", "chapter", "in", "which", "node", "resides" ]
def get_chapter(node, depth, section_numbers): """Get the numerical position of the chapter in which node resides args: node: A docutils node whose chapter we want the number of depth: How many levels deep into the toctree is a "chapter" section_numbers: ...
[ "def", "get_chapter", "(", "node", ",", "depth", ",", "section_numbers", ")", ":", "parent", "=", "node", ".", "parent", "chapter", "=", "None", "while", "chapter", "is", "None", ":", "if", "isinstance", "(", "parent", ",", "section", ")", ":", "chapter"...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/docs-source/sphinx/autonumber.py#L45-L75
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/imghdr.py
python
test_rgb
(h, f)
SGI image library
SGI image library
[ "SGI", "image", "library" ]
def test_rgb(h, f): """SGI image library""" if h[:2] == '\001\332': return 'rgb'
[ "def", "test_rgb", "(", "h", ",", "f", ")", ":", "if", "h", "[", ":", "2", "]", "==", "'\\001\\332'", ":", "return", "'rgb'" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imghdr.py#L71-L74
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
WorkingSet.__init__
(self, entries=None)
Create working set from list of path entries (default=sys.path)
Create working set from list of path entries (default=sys.path)
[ "Create", "working", "set", "from", "list", "of", "path", "entries", "(", "default", "=", "sys", ".", "path", ")" ]
def __init__(self, entries=None): """Create working set from list of path entries (default=sys.path)""" self.entries = [] self.entry_keys = {} self.by_key = {} self.callbacks = [] if entries is None: entries = sys.path for entry in entries: ...
[ "def", "__init__", "(", "self", ",", "entries", "=", "None", ")", ":", "self", ".", "entries", "=", "[", "]", "self", ".", "entry_keys", "=", "{", "}", "self", ".", "by_key", "=", "{", "}", "self", ".", "callbacks", "=", "[", "]", "if", "entries"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L556-L567
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/distributions/python/ops/sample_stats.py
python
percentile
(x, q, axis=None, interpolation=None, keep_dims=False, validate_args=False, name=None)
Compute the `q`-th percentile of `x`. Given a vector `x`, the `q`-th percentile of `x` is the value `q / 100` of the way from the minimum to the maximum in a sorted copy of `x`. The values and distances of the two nearest neighbors as well as the `interpolation` parameter will determine the percentile if the ...
Compute the `q`-th percentile of `x`.
[ "Compute", "the", "q", "-", "th", "percentile", "of", "x", "." ]
def percentile(x, q, axis=None, interpolation=None, keep_dims=False, validate_args=False, name=None): """Compute the `q`-th percentile of `x`. Given a vector `x`, the `q`-th percentile of `x` is the value `q / 100` of the w...
[ "def", "percentile", "(", "x", ",", "q", ",", "axis", "=", "None", ",", "interpolation", "=", "None", ",", "keep_dims", "=", "False", ",", "validate_args", "=", "False", ",", "name", "=", "None", ")", ":", "name", "=", "name", "or", "\"percentile\"", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/sample_stats.py#L40-L183
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/io/__init__.py
python
UserMinibatchSource.is_infinite
(self)
return False
Should return true if the user has not specified any limit on the number of sweeps and samples.
Should return true if the user has not specified any limit on the number of sweeps and samples.
[ "Should", "return", "true", "if", "the", "user", "has", "not", "specified", "any", "limit", "on", "the", "number", "of", "sweeps", "and", "samples", "." ]
def is_infinite(self): ''' Should return true if the user has not specified any limit on the number of sweeps and samples. ''' return False
[ "def", "is_infinite", "(", "self", ")", ":", "return", "False" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/io/__init__.py#L520-L524
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/importIFCmulticore.py
python
createProduct
(ifcproduct,brep)
return obj
creates an Arch object from an IFC product
creates an Arch object from an IFC product
[ "creates", "an", "Arch", "object", "from", "an", "IFC", "product" ]
def createProduct(ifcproduct,brep): """creates an Arch object from an IFC product""" import Part shape = Part.Shape() shape.importBrepFromString(brep,False) shape.scale(1000.0) # IfcOpenShell outputs in meters if ifcproduct.is_a("IfcSpace"): obj = Arch.makeSpace() else: ob...
[ "def", "createProduct", "(", "ifcproduct", ",", "brep", ")", ":", "import", "Part", "shape", "=", "Part", ".", "Shape", "(", ")", "shape", ".", "importBrepFromString", "(", "brep", ",", "False", ")", "shape", ".", "scale", "(", "1000.0", ")", "# IfcOpenS...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFCmulticore.py#L157-L179
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/sparse/linalg/matfuncs.py
python
_onenormest_product
(operator_seq, t=2, itmax=5, compute_v=False, compute_w=False, structure=None)
return scipy.sparse.linalg.onenormest( ProductOperator(*operator_seq, structure=structure))
Efficiently estimate the 1-norm of the matrix product of the args. Parameters ---------- operator_seq : linear operator sequence Matrices whose 1-norm of product is to be computed. t : int, optional A positive parameter controlling the tradeoff between accuracy versus time and m...
Efficiently estimate the 1-norm of the matrix product of the args.
[ "Efficiently", "estimate", "the", "1", "-", "norm", "of", "the", "matrix", "product", "of", "the", "args", "." ]
def _onenormest_product(operator_seq, t=2, itmax=5, compute_v=False, compute_w=False, structure=None): """ Efficiently estimate the 1-norm of the matrix product of the args. Parameters ---------- operator_seq : linear operator sequence Matrices whose 1-norm of product is to be compu...
[ "def", "_onenormest_product", "(", "operator_seq", ",", "t", "=", "2", ",", "itmax", "=", "5", ",", "compute_v", "=", "False", ",", "compute_w", "=", "False", ",", "structure", "=", "None", ")", ":", "return", "scipy", ".", "sparse", ".", "linalg", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/linalg/matfuncs.py#L304-L343
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_ops.py
python
CondContext._init_from_proto
(self, context_def, import_scope=None)
Creates a new `CondContext` from protocol buffer. Args: context_def: `CondContextDef` protocol buffer. import_scope: Optional `string`. Name scope to add.
Creates a new `CondContext` from protocol buffer.
[ "Creates", "a", "new", "CondContext", "from", "protocol", "buffer", "." ]
def _init_from_proto(self, context_def, import_scope=None): """Creates a new `CondContext` from protocol buffer. Args: context_def: `CondContextDef` protocol buffer. import_scope: Optional `string`. Name scope to add. """ assert isinstance(context_def, control_flow_pb2.CondContextDef) #...
[ "def", "_init_from_proto", "(", "self", ",", "context_def", ",", "import_scope", "=", "None", ")", ":", "assert", "isinstance", "(", "context_def", ",", "control_flow_pb2", ".", "CondContextDef", ")", "# Create from context_def.", "g", "=", "ops", ".", "get_defaul...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L1544-L1562
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathSlot.py
python
ObjectSlot._getOppMidPoints
(self, same)
return (p1, p2)
_getOppMidPoints(same)... Find mid-points between ends of equal, oppossing edges passed in tuple (edge1, edge2).
_getOppMidPoints(same)... Find mid-points between ends of equal, oppossing edges passed in tuple (edge1, edge2).
[ "_getOppMidPoints", "(", "same", ")", "...", "Find", "mid", "-", "points", "between", "ends", "of", "equal", "oppossing", "edges", "passed", "in", "tuple", "(", "edge1", "edge2", ")", "." ]
def _getOppMidPoints(self, same): """_getOppMidPoints(same)... Find mid-points between ends of equal, oppossing edges passed in tuple (edge1, edge2).""" com1 = same[0].CenterOfMass com2 = same[1].CenterOfMass p1 = FreeCAD.Vector(com1.x, com1.y, 0.0) p2 = FreeCAD.Vector(co...
[ "def", "_getOppMidPoints", "(", "self", ",", "same", ")", ":", "com1", "=", "same", "[", "0", "]", ".", "CenterOfMass", "com2", "=", "same", "[", "1", "]", ".", "CenterOfMass", "p1", "=", "FreeCAD", ".", "Vector", "(", "com1", ".", "x", ",", "com1"...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSlot.py#L1326-L1333
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/range.py
python
RangeIndex.equals
(self, other: object)
return super().equals(other)
Determines if two Index objects contain the same elements.
Determines if two Index objects contain the same elements.
[ "Determines", "if", "two", "Index", "objects", "contain", "the", "same", "elements", "." ]
def equals(self, other: object) -> bool: """ Determines if two Index objects contain the same elements. """ if isinstance(other, RangeIndex): return self._range == other._range return super().equals(other)
[ "def", "equals", "(", "self", ",", "other", ":", "object", ")", "->", "bool", ":", "if", "isinstance", "(", "other", ",", "RangeIndex", ")", ":", "return", "self", ".", "_range", "==", "other", ".", "_range", "return", "super", "(", ")", ".", "equals...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/range.py#L543-L549
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py
python
WorkingSet.add
(self, dist, entry=None, insert=True)
Add `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn't already present). `dist` is only added to the working set if ...
Add `dist` to working set, associated with `entry`
[ "Add", "dist", "to", "working", "set", "associated", "with", "entry" ]
def add(self, dist, entry=None, insert=True): """Add `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn't already prese...
[ "def", "add", "(", "self", ",", "dist", ",", "entry", "=", "None", ",", "insert", "=", "True", ")", ":", "if", "insert", ":", "dist", ".", "insert_on", "(", "self", ".", "entries", ",", "entry", ")", "if", "entry", "is", "None", ":", "entry", "="...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py#L511-L537
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
DragImage.Show
(*args, **kwargs)
return _controls_.DragImage_Show(*args, **kwargs)
Show(self) -> bool
Show(self) -> bool
[ "Show", "(", "self", ")", "-", ">", "bool" ]
def Show(*args, **kwargs): """Show(self) -> bool""" return _controls_.DragImage_Show(*args, **kwargs)
[ "def", "Show", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "DragImage_Show", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L6372-L6374
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/build/project.py
python
ProjectRegistry.load_module
(self, name, extra_path=None)
Load a Python module that should be usable from Jamfiles. There are generally two types of modules Jamfiles might want to use: - Core Boost.Build. Those are imported using plain names, e.g. 'toolset', so this function checks if we have module named b2.package.module already. ...
Load a Python module that should be usable from Jamfiles.
[ "Load", "a", "Python", "module", "that", "should", "be", "usable", "from", "Jamfiles", "." ]
def load_module(self, name, extra_path=None): """Load a Python module that should be usable from Jamfiles. There are generally two types of modules Jamfiles might want to use: - Core Boost.Build. Those are imported using plain names, e.g. 'toolset', so this function checks if we...
[ "def", "load_module", "(", "self", ",", "name", ",", "extra_path", "=", "None", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "extra_path", ",", "basestring", ")", "or", "extra_path", "is", "None",...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/project.py#L726-L806
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/util.py
python
HaveFileUrls
(args_to_check)
return False
Checks whether args_to_check contain any file URLs. Args: args_to_check: Command-line argument subset to check. Returns: True if args_to_check contains any file URLs.
Checks whether args_to_check contain any file URLs.
[ "Checks", "whether", "args_to_check", "contain", "any", "file", "URLs", "." ]
def HaveFileUrls(args_to_check): """Checks whether args_to_check contain any file URLs. Args: args_to_check: Command-line argument subset to check. Returns: True if args_to_check contains any file URLs. """ for url_str in args_to_check: storage_url = StorageUrlFromString(url_str) if storage_...
[ "def", "HaveFileUrls", "(", "args_to_check", ")", ":", "for", "url_str", "in", "args_to_check", ":", "storage_url", "=", "StorageUrlFromString", "(", "url_str", ")", "if", "storage_url", ".", "IsFileUrl", "(", ")", ":", "return", "True", "return", "False" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/util.py#L926-L939
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
python
Timeout.get_connect_duration
(self)
return current_time() - self._start_connect
Gets the time elapsed since the call to :meth:`start_connect`. :return: Elapsed time. :rtype: float :raises urllib3.exceptions.TimeoutStateError: if you attempt to get duration for a timer that hasn't been started.
Gets the time elapsed since the call to :meth:`start_connect`.
[ "Gets", "the", "time", "elapsed", "since", "the", "call", "to", ":", "meth", ":", "start_connect", "." ]
def get_connect_duration(self): """ Gets the time elapsed since the call to :meth:`start_connect`. :return: Elapsed time. :rtype: float :raises urllib3.exceptions.TimeoutStateError: if you attempt to get duration for a timer that hasn't been started. """ if s...
[ "def", "get_connect_duration", "(", "self", ")", ":", "if", "self", ".", "_start_connect", "is", "None", ":", "raise", "TimeoutStateError", "(", "\"Can't get connect duration for timer \"", "\"that has not started.\"", ")", "return", "current_time", "(", ")", "-", "se...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py#L180-L191
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py
python
AbstractFileSystem.du
(self, path, total=True, maxdepth=None, **kwargs)
Space used by files within a path Parameters ---------- path: str total: bool whether to sum all the file sizes maxdepth: int or None maximum number of directory levels to descend, None for unlimited. kwargs: passed to ``ls`` Returns ...
Space used by files within a path
[ "Space", "used", "by", "files", "within", "a", "path" ]
def du(self, path, total=True, maxdepth=None, **kwargs): """Space used by files within a path Parameters ---------- path: str total: bool whether to sum all the file sizes maxdepth: int or None maximum number of directory levels to descend, None f...
[ "def", "du", "(", "self", ",", "path", ",", "total", "=", "True", ",", "maxdepth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "sizes", "=", "{", "}", "for", "f", "in", "self", ".", "find", "(", "path", ",", "maxdepth", "=", "maxdepth", ","...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py#L408-L432
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py
python
CookiePolicy.return_ok
(self, cookie, request)
Return true if (and only if) cookie should be returned to server.
Return true if (and only if) cookie should be returned to server.
[ "Return", "true", "if", "(", "and", "only", "if", ")", "cookie", "should", "be", "returned", "to", "server", "." ]
def return_ok(self, cookie, request): """Return true if (and only if) cookie should be returned to server.""" raise NotImplementedError()
[ "def", "return_ok", "(", "self", ",", "cookie", ",", "request", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py#L823-L825
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/signers.py
python
RequestSigner.get_auth_instance
(self, signing_name, region_name, signature_version=None, **kwargs)
return auth
Get an auth instance which can be used to sign a request using the given signature version. :type signing_name: string :param signing_name: Service signing name. This is usually the same as the service name, but can differ. E.g. ``emr`` ...
Get an auth instance which can be used to sign a request using the given signature version.
[ "Get", "an", "auth", "instance", "which", "can", "be", "used", "to", "sign", "a", "request", "using", "the", "given", "signature", "version", "." ]
def get_auth_instance(self, signing_name, region_name, signature_version=None, **kwargs): """ Get an auth instance which can be used to sign a request using the given signature version. :type signing_name: string :param signing_name: Service signing nam...
[ "def", "get_auth_instance", "(", "self", ",", "signing_name", ",", "region_name", ",", "signature_version", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "signature_version", "is", "None", ":", "signature_version", "=", "self", ".", "_signature_version",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/signers.py#L192-L233
crankyoldgit/IRremoteESP8266
6bc095af80e5aec47d66f8c6263f3a943ea3b4d5
tools/auto_analyse_raw_data.py
python
RawIRMessage.is_bit_mark
(self, usec)
return self._usec_compare(usec, self.bit_mark)
Is usec the bit mark?
Is usec the bit mark?
[ "Is", "usec", "the", "bit", "mark?" ]
def is_bit_mark(self, usec): """Is usec the bit mark?""" return self._usec_compare(usec, self.bit_mark)
[ "def", "is_bit_mark", "(", "self", ",", "usec", ")", ":", "return", "self", ".", "_usec_compare", "(", "usec", ",", "self", ".", "bit_mark", ")" ]
https://github.com/crankyoldgit/IRremoteESP8266/blob/6bc095af80e5aec47d66f8c6263f3a943ea3b4d5/tools/auto_analyse_raw_data.py#L263-L265
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet++/unet_collection/losses.py
python
iou_seg
(y_true, y_pred, dtype=tf.float32)
return 1-tf.math.divide_no_nan(area_intersect, area_union)
Inersection over Union (IoU) loss for segmentation maps. iou_seg(y_true, y_pred, dtype=tf.float32) ---------- Rahman, M.A. and Wang, Y., 2016, December. Optimizing intersection-over-union in deep neural networks for image segmentation. In International symposium on visual computing (pp. 234-...
Inersection over Union (IoU) loss for segmentation maps. iou_seg(y_true, y_pred, dtype=tf.float32) ---------- Rahman, M.A. and Wang, Y., 2016, December. Optimizing intersection-over-union in deep neural networks for image segmentation. In International symposium on visual computing (pp. 234-...
[ "Inersection", "over", "Union", "(", "IoU", ")", "loss", "for", "segmentation", "maps", ".", "iou_seg", "(", "y_true", "y_pred", "dtype", "=", "tf", ".", "float32", ")", "----------", "Rahman", "M", ".", "A", ".", "and", "Wang", "Y", ".", "2016", "Dece...
def iou_seg(y_true, y_pred, dtype=tf.float32): """ Inersection over Union (IoU) loss for segmentation maps. iou_seg(y_true, y_pred, dtype=tf.float32) ---------- Rahman, M.A. and Wang, Y., 2016, December. Optimizing intersection-over-union in deep neural networks for image segmentatio...
[ "def", "iou_seg", "(", "y_true", ",", "y_pred", ",", "dtype", "=", "tf", ".", "float32", ")", ":", "# tf tensor casting", "y_pred", "=", "tf", ".", "convert_to_tensor", "(", "y_pred", ")", "y_pred", "=", "tf", ".", "cast", "(", "y_pred", ",", "dtype", ...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet++/unet_collection/losses.py#L388-L425
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ListCtrl.InsertStringItem
(*args, **kwargs)
return _controls_.ListCtrl_InsertStringItem(*args, **kwargs)
InsertStringItem(self, long index, String label, int imageIndex=-1) -> long
InsertStringItem(self, long index, String label, int imageIndex=-1) -> long
[ "InsertStringItem", "(", "self", "long", "index", "String", "label", "int", "imageIndex", "=", "-", "1", ")", "-", ">", "long" ]
def InsertStringItem(*args, **kwargs): """InsertStringItem(self, long index, String label, int imageIndex=-1) -> long""" return _controls_.ListCtrl_InsertStringItem(*args, **kwargs)
[ "def", "InsertStringItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_InsertStringItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4711-L4713
tkn-tub/ns3-gym
19bfe0a583e641142609939a090a09dfc63a095f
utils.py
python
get_list_from_file
(file_path, list_name)
return list
Looks for a Python list called list_name in the file specified by file_path and returns it. If the file or list name aren't found, this function will return an empty list.
Looks for a Python list called list_name in the file specified by file_path and returns it.
[ "Looks", "for", "a", "Python", "list", "called", "list_name", "in", "the", "file", "specified", "by", "file_path", "and", "returns", "it", "." ]
def get_list_from_file(file_path, list_name): '''Looks for a Python list called list_name in the file specified by file_path and returns it. If the file or list name aren't found, this function will return an empty list. ''' list = [] # Read in the file if it exists. if os.path.exist...
[ "def", "get_list_from_file", "(", "file_path", ",", "list_name", ")", ":", "list", "=", "[", "]", "# Read in the file if it exists.", "if", "os", ".", "path", ".", "exists", "(", "file_path", ")", ":", "file_in", "=", "open", "(", "file_path", ",", "\"r\"", ...
https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/utils.py#L10-L50
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/retry.py
python
Retry.from_int
(cls, retries, redirect=True, default=None)
return new_retries
Backwards-compatibility for the old retries format.
Backwards-compatibility for the old retries format.
[ "Backwards", "-", "compatibility", "for", "the", "old", "retries", "format", "." ]
def from_int(cls, retries, redirect=True, default=None): """ Backwards-compatibility for the old retries format.""" if retries is None: retries = default if default is not None else cls.DEFAULT if isinstance(retries, Retry): return retries redirect = bool(redire...
[ "def", "from_int", "(", "cls", ",", "retries", ",", "redirect", "=", "True", ",", "default", "=", "None", ")", ":", "if", "retries", "is", "None", ":", "retries", "=", "default", "if", "default", "is", "not", "None", "else", "cls", ".", "DEFAULT", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/retry.py#L219-L230
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_percentage_less
(values, threshold, ignore_mask=None, weights=None, metrics_collections=None, updates_collections=None, name=None)
return streaming_mean(is_below_threshold, _mask_weights(ignore_mask, weights), metrics_collections, updates_collections, name or 'percentage_below_threshold')
Computes the percentage of values less than the given threshold. The `streaming_percentage_less` function creates two local variables, `total` and `count` that are used to compute the percentage of `values` that fall below `threshold`. This rate is weighted by `weights`, and it is ultimately returned as `perce...
Computes the percentage of values less than the given threshold.
[ "Computes", "the", "percentage", "of", "values", "less", "than", "the", "given", "threshold", "." ]
def streaming_percentage_less(values, threshold, ignore_mask=None, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the percentage of values less than the given threshold. The `streami...
[ "def", "streaming_percentage_less", "(", "values", ",", "threshold", ",", "ignore_mask", "=", "None", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "is_below_t...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/metrics/python/ops/metric_ops.py#L2584-L2631
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/ext-py/prettytable-0.7.2/prettytable.py
python
PrettyTable._get_sort_key
(self)
return self._sort_key
Sorting key function, applied to data points before sorting Arguments: sort_key - a function which takes one argument and returns something to be sorted
Sorting key function, applied to data points before sorting
[ "Sorting", "key", "function", "applied", "to", "data", "points", "before", "sorting" ]
def _get_sort_key(self): """Sorting key function, applied to data points before sorting Arguments: sort_key - a function which takes one argument and returns something to be sorted""" return self._sort_key
[ "def", "_get_sort_key", "(", "self", ")", ":", "return", "self", ".", "_sort_key" ]
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/ext-py/prettytable-0.7.2/prettytable.py#L521-L527
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/pydocview/FindService.py
python
FindService.GetLineNumber
(self, parent)
return line
Display Goto Line Number dialog box
Display Goto Line Number dialog box
[ "Display", "Goto", "Line", "Number", "dialog", "box" ]
def GetLineNumber(self, parent): """ Display Goto Line Number dialog box """ line = -1 dialog = wx.TextEntryDialog(parent, _("Enter line number to go to:"), _("Go to Line")) dialog.CenterOnParent() if dialog.ShowModal() == wx.ID_OK: try: line = int(dia...
[ "def", "GetLineNumber", "(", "self", ",", "parent", ")", ":", "line", "=", "-", "1", "dialog", "=", "wx", ".", "TextEntryDialog", "(", "parent", ",", "_", "(", "\"Enter line number to go to:\"", ")", ",", "_", "(", "\"Go to Line\"", ")", ")", "dialog", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pydocview/FindService.py#L153-L167
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/gcs_json_api.py
python
GcsJsonApi.UploadObject
(self, upload_stream, object_metadata, canned_acl=None, size=None, preconditions=None, progress_callback=None, provider=None, fields=None)
return self._UploadObject( upload_stream, object_metadata, canned_acl=canned_acl, size=size, preconditions=preconditions, progress_callback=progress_callback, fields=fields, apitools_strategy=apitools_transfer.SIMPLE_UPLOAD)
See CloudApi class for function doc strings.
See CloudApi class for function doc strings.
[ "See", "CloudApi", "class", "for", "function", "doc", "strings", "." ]
def UploadObject(self, upload_stream, object_metadata, canned_acl=None, size=None, preconditions=None, progress_callback=None, provider=None, fields=None): """See CloudApi class for function doc strings.""" return self._UploadObject( upload_stream, object_metadata, ...
[ "def", "UploadObject", "(", "self", ",", "upload_stream", ",", "object_metadata", ",", "canned_acl", "=", "None", ",", "size", "=", "None", ",", "preconditions", "=", "None", ",", "progress_callback", "=", "None", ",", "provider", "=", "None", ",", "fields",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/gcs_json_api.py#L1028-L1036
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/modules/prim_ops.py
python
deephi_ChannelScale.forward
(self, input:torch.Tensor, channel_scale:Union[torch.Tensor, Sequence[Any], float])
return output
if self.node.in_quant_part: channel_scale = quant_channel_scale_params(self.node, channel_scale)
if self.node.in_quant_part: channel_scale = quant_channel_scale_params(self.node, channel_scale)
[ "if", "self", ".", "node", ".", "in_quant_part", ":", "channel_scale", "=", "quant_channel_scale_params", "(", "self", ".", "node", "channel_scale", ")" ]
def forward(self, input:torch.Tensor, channel_scale:Union[torch.Tensor, Sequence[Any], float]): [input], _ = process_inputs_and_params( self.node, self.quantizer, inputs=[input], ) if isinstance(channel_scale, (list, tuple)): channel_scale = torch.Tensor(channel_scale).to(inpu...
[ "def", "forward", "(", "self", ",", "input", ":", "torch", ".", "Tensor", ",", "channel_scale", ":", "Union", "[", "torch", ".", "Tensor", ",", "Sequence", "[", "Any", "]", ",", "float", "]", ")", ":", "[", "input", "]", ",", "_", "=", "process_inp...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/modules/prim_ops.py#L262-L282
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py
python
swapaxes
(a, axis1, axis2)
return _wrapfunc(a, 'swapaxes', axis1, axis2)
Interchange two axes of an array. Parameters ---------- a : array_like Input array. axis1 : int First axis. axis2 : int Second axis. Returns ------- a_swapped : ndarray For NumPy >= 1.10.0, if `a` is an ndarray, then a view of `a` is returned; ot...
Interchange two axes of an array.
[ "Interchange", "two", "axes", "of", "an", "array", "." ]
def swapaxes(a, axis1, axis2): """ Interchange two axes of an array. Parameters ---------- a : array_like Input array. axis1 : int First axis. axis2 : int Second axis. Returns ------- a_swapped : ndarray For NumPy >= 1.10.0, if `a` is an ndarray,...
[ "def", "swapaxes", "(", "a", ",", "axis1", ",", "axis2", ")", ":", "return", "_wrapfunc", "(", "a", ",", "'swapaxes'", ",", "axis1", ",", "axis2", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L554-L597
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
DPGAnalysis/HcalTools/scripts/cmt/das_client.py
python
unique_filter
(rows)
Unique filter drop duplicate rows.
Unique filter drop duplicate rows.
[ "Unique", "filter", "drop", "duplicate", "rows", "." ]
def unique_filter(rows): """ Unique filter drop duplicate rows. """ old_row = {} row = None for row in rows: row_data = dict(row) try: del row_data['_id'] del row_data['das'] del row_data['das_id'] del row_data['cache_id'] e...
[ "def", "unique_filter", "(", "rows", ")", ":", "old_row", "=", "{", "}", "row", "=", "None", "for", "row", "in", "rows", ":", "row_data", "=", "dict", "(", "row", ")", "try", ":", "del", "row_data", "[", "'_id'", "]", "del", "row_data", "[", "'das'...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DPGAnalysis/HcalTools/scripts/cmt/das_client.py#L203-L231
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/sparse_ops.py
python
_take_many_sparse_from_tensors_map
( sparse_map_op, sparse_handles, rank=None, name=None)
return sparse_tensor.SparseTensor(output_indices, output_values, output_shape)
Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. The input `sparse_handles` must be a string matrix of shape `[N, 1]` where `N` is the minibatch size and the rows correspond to packed outputs of `add_sparse_to_tensors_map`. The ranks of the original `SparseTensor` objects must all match. ...
Read `SparseTensors` from a `SparseTensorsMap` and concatenate them.
[ "Read", "SparseTensors", "from", "a", "SparseTensorsMap", "and", "concatenate", "them", "." ]
def _take_many_sparse_from_tensors_map( sparse_map_op, sparse_handles, rank=None, name=None): """Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. The input `sparse_handles` must be a string matrix of shape `[N, 1]` where `N` is the minibatch size and the rows correspond to packed outputs ...
[ "def", "_take_many_sparse_from_tensors_map", "(", "sparse_map_op", ",", "sparse_handles", ",", "rank", "=", "None", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "sparse_map_op", ",", "ops", ".", "Operation", ")", ":", "raise", "TypeError...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/sparse_ops.py#L1955-L2034
etodd/lasercrabs
91484d9ac3a47ac38b8f40ec3ff35194714dad8e
assets/script/etodd_blender_fbx/export_fbx_bin.py
python
fbx_data_camera_elements
(root, cam_obj, scene_data)
Write the Camera data blocks.
Write the Camera data blocks.
[ "Write", "the", "Camera", "data", "blocks", "." ]
def fbx_data_camera_elements(root, cam_obj, scene_data): """ Write the Camera data blocks. """ gscale = scene_data.settings.global_scale cam = cam_obj.bdata cam_data = cam.data cam_key = scene_data.data_cameras[cam_obj] # Real data now, good old camera! # Object transform info. ...
[ "def", "fbx_data_camera_elements", "(", "root", ",", "cam_obj", ",", "scene_data", ")", ":", "gscale", "=", "scene_data", ".", "settings", ".", "global_scale", "cam", "=", "cam_obj", ".", "bdata", "cam_data", "=", "cam", ".", "data", "cam_key", "=", "scene_d...
https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/export_fbx_bin.py#L619-L705
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
tile
(A, reps)
return _unary_func_helper(A, _npi.tile, _np.tile, reps=reps)
r""" Construct an array by repeating A the number of times given by reps. If `reps` has length ``d``, the result will have dimension of ``max(d, A.ndim)``. If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication...
r""" Construct an array by repeating A the number of times given by reps.
[ "r", "Construct", "an", "array", "by", "repeating", "A", "the", "number", "of", "times", "given", "by", "reps", "." ]
def tile(A, reps): r""" Construct an array by repeating A the number of times given by reps. If `reps` has length ``d``, the result will have dimension of ``max(d, A.ndim)``. If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new axes. So a shape (3,) array is promoted to (1,...
[ "def", "tile", "(", "A", ",", "reps", ")", ":", "return", "_unary_func_helper", "(", "A", ",", "_npi", ".", "tile", ",", "_np", ".", "tile", ",", "reps", "=", "reps", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L3823-L3852
casadi/casadi
8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff
misc/cpplint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/casadi/casadi/blob/8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff/misc/cpplint.py#L705-L707
zerotier/libzt
41eb9aebc80a5f1c816fa26a06cefde9de906676
src/bindings/python/sockets.py
python
errno
()
return libzt.cvar.zts_errno
Return errno value of low-level socket layer
Return errno value of low-level socket layer
[ "Return", "errno", "value", "of", "low", "-", "level", "socket", "layer" ]
def errno(): """Return errno value of low-level socket layer""" return libzt.cvar.zts_errno
[ "def", "errno", "(", ")", ":", "return", "libzt", ".", "cvar", ".", "zts_errno" ]
https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L39-L41
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/email/iterators.py
python
walk
(self)
Walk over the message tree, yielding each subpart. The walk is performed in depth-first order. This method is a generator.
Walk over the message tree, yielding each subpart.
[ "Walk", "over", "the", "message", "tree", "yielding", "each", "subpart", "." ]
def walk(self): """Walk over the message tree, yielding each subpart. The walk is performed in depth-first order. This method is a generator. """ yield self if self.is_multipart(): for subpart in self.get_payload(): for subsubpart in subpart.walk(): yield su...
[ "def", "walk", "(", "self", ")", ":", "yield", "self", "if", "self", ".", "is_multipart", "(", ")", ":", "for", "subpart", "in", "self", ".", "get_payload", "(", ")", ":", "for", "subsubpart", "in", "subpart", ".", "walk", "(", ")", ":", "yield", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/iterators.py#L20-L30
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
TextCtrl.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=TextCtrlNameStr) -> TextCtrl
__init__(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=TextCtrlNameStr) -> TextCtrl
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "String", "value", "=", "EmptyString", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "Validator", "validator", "=", "DefaultVali...
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=TextCtrlNameStr) -> TextCtrl """ ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "TextCtrl_swiginit", "(", "self", ",", "_controls_", ".", "new_TextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setO...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2012-L2020
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_edge.py
python
EdgeDomain.getStreetName
(self, edgeID)
return self._getUniversal(tc.VAR_NAME, edgeID)
getStreetName(string) -> string Returns the street name of this edge
getStreetName(string) -> string
[ "getStreetName", "(", "string", ")", "-", ">", "string" ]
def getStreetName(self, edgeID): """getStreetName(string) -> string Returns the street name of this edge """ return self._getUniversal(tc.VAR_NAME, edgeID)
[ "def", "getStreetName", "(", "self", ",", "edgeID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_NAME", ",", "edgeID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_edge.py#L140-L145
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
MaildirMessage.get_date
(self)
return self._date
Return delivery date of message, in seconds since the epoch.
Return delivery date of message, in seconds since the epoch.
[ "Return", "delivery", "date", "of", "message", "in", "seconds", "since", "the", "epoch", "." ]
def get_date(self): """Return delivery date of message, in seconds since the epoch.""" return self._date
[ "def", "get_date", "(", "self", ")", ":", "return", "self", ".", "_date" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1566-L1568
whai362/PSENet
4d95395658662f2223805c36dcd573d9e190ce26
eval/ic15/script.py
python
evaluation_imports
()
return { 'Polygon':'plg', 'numpy':'np' }
evaluation_imports: Dictionary ( key = module name , value = alias ) with python modules used in the evaluation.
evaluation_imports: Dictionary ( key = module name , value = alias ) with python modules used in the evaluation.
[ "evaluation_imports", ":", "Dictionary", "(", "key", "=", "module", "name", "value", "=", "alias", ")", "with", "python", "modules", "used", "in", "the", "evaluation", "." ]
def evaluation_imports(): """ evaluation_imports: Dictionary ( key = module name , value = alias ) with python modules used in the evaluation. """ return { 'Polygon':'plg', 'numpy':'np' }
[ "def", "evaluation_imports", "(", ")", ":", "return", "{", "'Polygon'", ":", "'plg'", ",", "'numpy'", ":", "'np'", "}" ]
https://github.com/whai362/PSENet/blob/4d95395658662f2223805c36dcd573d9e190ce26/eval/ic15/script.py#L7-L14
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/db_manager/db_plugins/oracle/connector.py
python
OracleDBConnector.hasCreateSpatialViewSupport
(self)
return True
We can create Spatial Views.
We can create Spatial Views.
[ "We", "can", "create", "Spatial", "Views", "." ]
def hasCreateSpatialViewSupport(self): """We can create Spatial Views.""" return True
[ "def", "hasCreateSpatialViewSupport", "(", "self", ")", ":", "return", "True" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L209-L211
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_editv.py
python
EdEditorView.ModifySave
(self)
return result
Called when document has been modified prompting a message dialog asking if the user would like to save the document before closing. @return: Result value of whether the file was saved or not
Called when document has been modified prompting a message dialog asking if the user would like to save the document before closing. @return: Result value of whether the file was saved or not
[ "Called", "when", "document", "has", "been", "modified", "prompting", "a", "message", "dialog", "asking", "if", "the", "user", "would", "like", "to", "save", "the", "document", "before", "closing", ".", "@return", ":", "Result", "value", "of", "whether", "th...
def ModifySave(self): """Called when document has been modified prompting a message dialog asking if the user would like to save the document before closing. @return: Result value of whether the file was saved or not """ name = self.GetFileName() if name == u"": ...
[ "def", "ModifySave", "(", "self", ")", ":", "name", "=", "self", ".", "GetFileName", "(", ")", "if", "name", "==", "u\"\"", ":", "name", "=", "self", ".", "GetTabLabel", "(", ")", "dlg", "=", "wx", ".", "MessageDialog", "(", "self", ",", "_", "(", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_editv.py#L613-L641
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor.py
python
MakeDescriptor
(desc_proto, package='', build_file_if_cpp=True, syntax=None)
return Descriptor(desc_proto.name, desc_name, None, None, fields, list(nested_types.values()), list(enum_types.values()), [], options=_OptionsOrNone(desc_proto))
Make a protobuf Descriptor given a DescriptorProto protobuf. Handles nested descriptors. Note that this is limited to the scope of defining a message inside of another message. Composite fields can currently only be resolved if the message is defined in the same scope as the field. Args: desc_proto: The d...
Make a protobuf Descriptor given a DescriptorProto protobuf.
[ "Make", "a", "protobuf", "Descriptor", "given", "a", "DescriptorProto", "protobuf", "." ]
def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True, syntax=None): """Make a protobuf Descriptor given a DescriptorProto protobuf. Handles nested descriptors. Note that this is limited to the scope of defining a message inside of another message. Composite fields can currently on...
[ "def", "MakeDescriptor", "(", "desc_proto", ",", "package", "=", "''", ",", "build_file_if_cpp", "=", "True", ",", "syntax", "=", "None", ")", ":", "if", "api_implementation", ".", "Type", "(", ")", "==", "'cpp'", "and", "build_file_if_cpp", ":", "# The C++ ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor.py#L919-L1020
xbmc/xbmc
091211a754589fc40a2a1f239b0ce9f4ee138268
addons/service.xbmc.versioncheck/resources/lib/version_check/distro/distro.py
python
LinuxDistribution.lsb_release_info
(self)
return self._lsb_release_info
Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution. For details, see :func:`distro.lsb_release_info`.
Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution.
[ "Return", "a", "dictionary", "containing", "key", "-", "value", "pairs", "for", "the", "information", "items", "from", "the", "lsb_release", "command", "data", "source", "of", "the", "OS", "distribution", "." ]
def lsb_release_info(self): """ Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution. For details, see :func:`distro.lsb_release_info`. """ return self._lsb_release_info
[ "def", "lsb_release_info", "(", "self", ")", ":", "return", "self", ".", "_lsb_release_info" ]
https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/service.xbmc.versioncheck/resources/lib/version_check/distro/distro.py#L854-L862
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py
python
BareosVADPWrapper.remove_vm_snapshot
(self)
return True
Removes the snapshot taken before
Removes the snapshot taken before
[ "Removes", "the", "snapshot", "taken", "before" ]
def remove_vm_snapshot(self): """ Removes the snapshot taken before """ if not self.create_snap_result: bareosfd.JobMessage( bareosfd.M_WARNING, "No snapshot was taken, skipping snapshot removal\n", ) return False ...
[ "def", "remove_vm_snapshot", "(", "self", ")", ":", "if", "not", "self", ".", "create_snap_result", ":", "bareosfd", ".", "JobMessage", "(", "bareosfd", ".", "M_WARNING", ",", "\"No snapshot was taken, skipping snapshot removal\\n\"", ",", ")", "return", "False", "t...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py#L1133-L1157
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/glib2.py
python
add_enums
(self, source='', target='', file_head='', file_prod='', file_tail='', enum_prod='', value_head='', value_prod='', value_tail='', comments='')
Add a file to the list of enum files to process. Store them in the attribute *enums_list*. :param source: enum file to process :type source: string :param target: target file :type target: string :param file_head: unused :param file_prod: unused :param file_tail: unused :param enum_prod: unused :param value_h...
Add a file to the list of enum files to process. Store them in the attribute *enums_list*.
[ "Add", "a", "file", "to", "the", "list", "of", "enum", "files", "to", "process", ".", "Store", "them", "in", "the", "attribute", "*", "enums_list", "*", "." ]
def add_enums(self, source='', target='', file_head='', file_prod='', file_tail='', enum_prod='', value_head='', value_prod='', value_tail='', comments=''): """ Add a file to the list of enum files to process. Store them in the attribute *enums_list*. :param source: enum file to process ...
[ "def", "add_enums", "(", "self", ",", "source", "=", "''", ",", "target", "=", "''", ",", "file_head", "=", "''", ",", "file_prod", "=", "''", ",", "file_tail", "=", "''", ",", "enum_prod", "=", "''", ",", "value_head", "=", "''", ",", "value_prod", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/glib2.py#L119-L152
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Menu.invoke
(self, index)
return self.tk.call(self._w, 'invoke', index)
Invoke a menu item identified by INDEX and execute the associated command.
Invoke a menu item identified by INDEX and execute the associated command.
[ "Invoke", "a", "menu", "item", "identified", "by", "INDEX", "and", "execute", "the", "associated", "command", "." ]
def invoke(self, index): """Invoke a menu item identified by INDEX and execute the associated command.""" return self.tk.call(self._w, 'invoke', index)
[ "def", "invoke", "(", "self", ",", "index", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'invoke'", ",", "index", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L2802-L2805
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
NDArray._set_nd_basic_indexing
(self, key, value)
This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.
This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.
[ "This", "function", "is", "called", "by", "__setitem__", "when", "key", "is", "a", "basic", "index", "i", ".", "e", ".", "an", "integer", "or", "a", "slice", "or", "a", "tuple", "of", "integers", "and", "slices", ".", "No", "restrictions", "on", "the",...
def _set_nd_basic_indexing(self, key, value): """This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.""" shape = self.shape if isinstance(key, integer_type...
[ "def", "_set_nd_basic_indexing", "(", "self", ",", "key", ",", "value", ")", ":", "shape", "=", "self", ".", "shape", "if", "isinstance", "(", "key", ",", "integer_types", ")", ":", "if", "key", "<", "0", ":", "key", "+=", "shape", "[", "0", "]", "...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L684-L766
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py
python
unpack_zipfile
(filename, extract_dir, progress_filter=default_filter)
Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument.
Unpack zip `filename` to `extract_dir`
[ "Unpack", "zip", "filename", "to", "extract_dir" ]
def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): """Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. ...
[ "def", "unpack_zipfile", "(", "filename", ",", "extract_dir", ",", "progress_filter", "=", "default_filter", ")", ":", "if", "not", "zipfile", ".", "is_zipfile", "(", "filename", ")", ":", "raise", "UnrecognizedFormat", "(", "\"%s is not a zip file\"", "%", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py#L91-L125
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/gdal-utils/osgeo_utils/gdal2tiles.py
python
setup_output_srs
(input_srs: Optional[osr.SpatialReference], options: Options)
return output_srs
Setup the desired SRS (based on options)
Setup the desired SRS (based on options)
[ "Setup", "the", "desired", "SRS", "(", "based", "on", "options", ")" ]
def setup_output_srs(input_srs: Optional[osr.SpatialReference], options: Options) -> Optional[osr.SpatialReference]: """ Setup the desired SRS (based on options) """ output_srs = osr.SpatialReference() if options.profile == 'mercator': output_srs.ImportFromEPSG(3857) elif options.profil...
[ "def", "setup_output_srs", "(", "input_srs", ":", "Optional", "[", "osr", ".", "SpatialReference", "]", ",", "options", ":", "Options", ")", "->", "Optional", "[", "osr", ".", "SpatialReference", "]", ":", "output_srs", "=", "osr", ".", "SpatialReference", "...
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py#L879-L897
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/addins/calc.py
python
CalcAddin.generateFunctions
(self)
Generate source for function implementations.
Generate source for function implementations.
[ "Generate", "source", "for", "function", "implementations", "." ]
def generateFunctions(self): """Generate source for function implementations.""" for cat in self.categoryList_.categories(self.name_, self.coreCategories_, self.addinCategories_): buf = '' for func in cat.functions(self.name_): buf += self.generateFunction(func) ...
[ "def", "generateFunctions", "(", "self", ")", ":", "for", "cat", "in", "self", ".", "categoryList_", ".", "categories", "(", "self", ".", "name_", ",", "self", ".", "coreCategories_", ",", "self", ".", "addinCategories_", ")", ":", "buf", "=", "''", "for...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/calc.py#L189-L211
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/plan/motionplanning.py
python
CSpaceInterface.visibilityFailures
(self, a, b)
return _motionplanning.CSpaceInterface_visibilityFailures(self, a, b)
Returns a list of all failed visibility constraints. Args: a (:obj:`object`) b (:obj:`object`) Returns: (:obj:`object`):
Returns a list of all failed visibility constraints.
[ "Returns", "a", "list", "of", "all", "failed", "visibility", "constraints", "." ]
def visibilityFailures(self, a, b): """ Returns a list of all failed visibility constraints. Args: a (:obj:`object`) b (:obj:`object`) Returns: (:obj:`object`): """ return _motionplanning.CSpaceInterface_visibilityFailures(self, a, b...
[ "def", "visibilityFailures", "(", "self", ",", "a", ",", "b", ")", ":", "return", "_motionplanning", ".", "CSpaceInterface_visibilityFailures", "(", "self", ",", "a", ",", "b", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/motionplanning.py#L484-L494
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.SetBuildSetting
(self, key, value)
Sets the build setting for key to value in all child XCBuildConfiguration objects.
Sets the build setting for key to value in all child XCBuildConfiguration objects.
[ "Sets", "the", "build", "setting", "for", "key", "to", "value", "in", "all", "child", "XCBuildConfiguration", "objects", "." ]
def SetBuildSetting(self, key, value): """Sets the build setting for key to value in all child XCBuildConfiguration objects. """ for configuration in self._properties['buildConfigurations']: configuration.SetBuildSetting(key, value)
[ "def", "SetBuildSetting", "(", "self", ",", "key", ",", "value", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "configuration", ".", "SetBuildSetting", "(", "key", ",", "value", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py#L1656-L1662
google/sling
f408a148a06bc2d62e853a292a8ba7266c642839
python/task/workflow.py
python
stop_monitor
()
Stop task monitor.
Stop task monitor.
[ "Stop", "task", "monitor", "." ]
def stop_monitor(): """Stop task monitor.""" global active if active: log.info("sending final status to monitor") api.finalize_dashboard()
[ "def", "stop_monitor", "(", ")", ":", "global", "active", "if", "active", ":", "log", ".", "info", "(", "\"sending final status to monitor\"", ")", "api", ".", "finalize_dashboard", "(", ")" ]
https://github.com/google/sling/blob/f408a148a06bc2d62e853a292a8ba7266c642839/python/task/workflow.py#L733-L738
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/jtagice3protocol.py
python
Jtagice3Protocol.peel_response
(self, response, expected=None)
return return_list
Process the response, extracting error codes and data :param response: raw response bytes :param expected: expected response :return: status, data
Process the response, extracting error codes and data
[ "Process", "the", "response", "extracting", "error", "codes", "and", "data" ]
def peel_response(self, response, expected=None): """ Process the response, extracting error codes and data :param response: raw response bytes :param expected: expected response :return: status, data """ return_list = False, [0xFF] # Special handling ...
[ "def", "peel_response", "(", "self", ",", "response", ",", "expected", "=", "None", ")", ":", "return_list", "=", "False", ",", "[", "0xFF", "]", "# Special handling", "if", "expected", "is", "not", "None", "and", "response", "[", "0", "]", "==", "expect...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/jtagice3protocol.py#L197-L223
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/vesuvio/fitting.py
python
parse_fit_options
(mass_values, profile_strs, background_str="", constraints_str="")
return FittingOptions(mass_profiles, background, constraints)
Parse the function string into a more usable format
Parse the function string into a more usable format
[ "Parse", "the", "function", "string", "into", "a", "more", "usable", "format" ]
def parse_fit_options(mass_values, profile_strs, background_str="", constraints_str=""): """Parse the function string into a more usable format""" # Individual functions are separated by semi-colon separators mass_functions = profile_strs.rstrip(";").split(";") if len(mass_functions) != len(mass_values...
[ "def", "parse_fit_options", "(", "mass_values", ",", "profile_strs", ",", "background_str", "=", "\"\"", ",", "constraints_str", "=", "\"\"", ")", ":", "# Individual functions are separated by semi-colon separators", "mass_functions", "=", "profile_strs", ".", "rstrip", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/vesuvio/fitting.py#L22-L47
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
tree/library/tree.py
python
TreeNode.get_level
(self)
return level
get level of node by calculating how many ancestor it has
get level of node by calculating how many ancestor it has
[ "get", "level", "of", "node", "by", "calculating", "how", "many", "ancestor", "it", "has" ]
def get_level(self): """ get level of node by calculating how many ancestor it has """ level = 0 parent = self.parent while parent: level += 1 parent = parent.parent return level
[ "def", "get_level", "(", "self", ")", ":", "level", "=", "0", "parent", "=", "self", ".", "parent", "while", "parent", ":", "level", "+=", "1", "parent", "=", "parent", ".", "parent", "return", "level" ]
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/tree/library/tree.py#L16-L24
google/certificate-transparency
2588562fd306a447958471b6f06c1069619c1641
python/ct/serialization/tls_message.py
python
TLSReader._read_repeated
(self, message, field, opts)
Read a repeated field.
Read a repeated field.
[ "Read", "a", "repeated", "field", "." ]
def _read_repeated(self, message, field, opts): """Read a repeated field.""" if not opts.max_total_length: raise TypeError("Repeated field %s has no length limit" % field.name) # Recursive, naive. reader = TLSReader(self._read_var_bytes(opts.min_to...
[ "def", "_read_repeated", "(", "self", ",", "message", ",", "field", ",", "opts", ")", ":", "if", "not", "opts", ".", "max_total_length", ":", "raise", "TypeError", "(", "\"Repeated field %s has no length limit\"", "%", "field", ".", "name", ")", "# Recursive, na...
https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/serialization/tls_message.py#L101-L124
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ftplib.py
python
print_line
(line)
Default retrlines callback to print a line.
Default retrlines callback to print a line.
[ "Default", "retrlines", "callback", "to", "print", "a", "line", "." ]
def print_line(line): '''Default retrlines callback to print a line.''' print(line)
[ "def", "print_line", "(", "line", ")", ":", "print", "(", "line", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ftplib.py#L904-L906
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2B_CONTEXT_DATA.__init__
(self, buffer = None)
This structure is used in a TPMS_CONTEXT. Attributes: buffer (TPMS_CONTEXT_DATA): TBD
This structure is used in a TPMS_CONTEXT.
[ "This", "structure", "is", "used", "in", "a", "TPMS_CONTEXT", "." ]
def __init__(self, buffer = None): """ This structure is used in a TPMS_CONTEXT. Attributes: buffer (TPMS_CONTEXT_DATA): TBD """ self.buffer = buffer
[ "def", "__init__", "(", "self", ",", "buffer", "=", "None", ")", ":", "self", ".", "buffer", "=", "buffer" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L8795-L8801
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Image.SetDataBuffer
(*args, **kwargs)
return _core_.Image_SetDataBuffer(*args, **kwargs)
SetDataBuffer(self, buffer data) Sets the internal image data pointer to point at a Python buffer object. This can save making an extra copy of the data but you must ensure that the buffer object lives longer than the wx.Image does.
SetDataBuffer(self, buffer data)
[ "SetDataBuffer", "(", "self", "buffer", "data", ")" ]
def SetDataBuffer(*args, **kwargs): """ SetDataBuffer(self, buffer data) Sets the internal image data pointer to point at a Python buffer object. This can save making an extra copy of the data but you must ensure that the buffer object lives longer than the wx.Image does. ...
[ "def", "SetDataBuffer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Image_SetDataBuffer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L3385-L3393
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/packaging/_compat.py
python
with_metaclass
(meta, *bases)
return type.__new__(metaclass, 'temporary_class', (), {})
Create a base class with a metaclass.
Create a base class with a metaclass.
[ "Create", "a", "base", "class", "with", "a", "metaclass", "." ]
def with_metaclass(meta, *bases): """ Create a base class with a metaclass. """ # This requires a bit of explanation: the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass(meta): def __new_...
[ "def", "with_metaclass", "(", "meta", ",", "*", "bases", ")", ":", "# This requires a bit of explanation: the basic idea is to make a dummy", "# metaclass for one level of class instantiation that replaces itself with", "# the actual metaclass.", "class", "metaclass", "(", "meta", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/packaging/_compat.py#L20-L30
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
MDIParentFrame.Create
(*args, **kwargs)
return _windows_.MDIParentFrame_Create(*args, **kwargs)
Create(self, Window parent, int id=-1, String title=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL, String name=FrameNameStr) -> bool
Create(self, Window parent, int id=-1, String title=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL, String name=FrameNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "String", "title", "=", "EmptyString", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL", "String", ...
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, String title=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL, String name=FrameNameStr) -> bool """ return _w...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "MDIParentFrame_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4025-L4032
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/mixins.py
python
_binary_method
(ufunc, name)
return func
Implement a forward binary method with a ufunc, e.g., __add__.
Implement a forward binary method with a ufunc, e.g., __add__.
[ "Implement", "a", "forward", "binary", "method", "with", "a", "ufunc", "e", ".", "g", ".", "__add__", "." ]
def _binary_method(ufunc, name): """Implement a forward binary method with a ufunc, e.g., __add__.""" def func(self, other): if _disables_array_ufunc(other): return NotImplemented return ufunc(self, other) func.__name__ = '__{}__'.format(name) return func
[ "def", "_binary_method", "(", "ufunc", ",", "name", ")", ":", "def", "func", "(", "self", ",", "other", ")", ":", "if", "_disables_array_ufunc", "(", "other", ")", ":", "return", "NotImplemented", "return", "ufunc", "(", "self", ",", "other", ")", "func"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/mixins.py#L20-L27
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/html5lib/inputstream.py
python
codecName
(encoding)
Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.
Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.
[ "Return", "the", "python", "codec", "name", "corresponding", "to", "an", "encoding", "or", "None", "if", "the", "string", "doesn", "t", "correspond", "to", "a", "valid", "encoding", "." ]
def codecName(encoding): """Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.""" if isinstance(encoding, bytes): try: encoding = encoding.decode("ascii") except UnicodeDecodeError: return None i...
[ "def", "codecName", "(", "encoding", ")", ":", "if", "isinstance", "(", "encoding", ",", "bytes", ")", ":", "try", ":", "encoding", "=", "encoding", ".", "decode", "(", "\"ascii\"", ")", "except", "UnicodeDecodeError", ":", "return", "None", "if", "encodin...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/html5lib/inputstream.py#L869-L881
nsnam/ns-3-dev-git
efdb2e21f45c0a87a60b47c547b68fa140a7b686
src/visualizer/visualizer/plugins/olsr.py
python
ShowOlsrRoutingTable.__init__
(self, visualizer, node_index)
! Initializer @param self this object @param visualizer visualizer object @param node_index the node index
! Initializer
[ "!", "Initializer" ]
def __init__(self, visualizer, node_index): """! Initializer @param self this object @param visualizer visualizer object @param node_index the node index """ InformationWindow.__init__(self) self.win = Gtk.Dialog(parent=visualizer.window, ...
[ "def", "__init__", "(", "self", ",", "visualizer", ",", "node_index", ")", ":", "InformationWindow", ".", "__init__", "(", "self", ")", "self", ".", "win", "=", "Gtk", ".", "Dialog", "(", "parent", "=", "visualizer", ".", "window", ",", "flags", "=", "...
https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/plugins/olsr.py#L29-L78
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py
python
DataFrame.assign
(self, **kwargs)
return data
r""" Assign new columns to a DataFrame. Returns a new object with all original columns in addition to new ones. Existing columns that are re-assigned will be overwritten. Parameters ---------- **kwargs : dict of {str: callable or Series} The column names are...
r""" Assign new columns to a DataFrame.
[ "r", "Assign", "new", "columns", "to", "a", "DataFrame", "." ]
def assign(self, **kwargs) -> "DataFrame": r""" Assign new columns to a DataFrame. Returns a new object with all original columns in addition to new ones. Existing columns that are re-assigned will be overwritten. Parameters ---------- **kwargs : dict of {str: c...
[ "def", "assign", "(", "self", ",", "*", "*", "kwargs", ")", "->", "\"DataFrame\"", ":", "data", "=", "self", ".", "copy", "(", ")", "for", "k", ",", "v", "in", "kwargs", ".", "items", "(", ")", ":", "data", "[", "k", "]", "=", "com", ".", "ap...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py#L3498-L3568
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_edge.py
python
EdgeDomain.getPendingVehicles
(self, edgeID)
return self._getUniversal(tc.VAR_PENDING_VEHICLES, edgeID)
getPendingVehicles(string) -> list(string) Returns a list of all vehicle ids waiting for insertion on this edge (with depart delay)
getPendingVehicles(string) -> list(string) Returns a list of all vehicle ids waiting for insertion on this edge (with depart delay)
[ "getPendingVehicles", "(", "string", ")", "-", ">", "list", "(", "string", ")", "Returns", "a", "list", "of", "all", "vehicle", "ids", "waiting", "for", "insertion", "on", "this", "edge", "(", "with", "depart", "delay", ")" ]
def getPendingVehicles(self, edgeID): """getPendingVehicles(string) -> list(string) Returns a list of all vehicle ids waiting for insertion on this edge (with depart delay) """ return self._getUniversal(tc.VAR_PENDING_VEHICLES, edgeID)
[ "def", "getPendingVehicles", "(", "self", ",", "edgeID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_PENDING_VEHICLES", ",", "edgeID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_edge.py#L183-L187
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
modules/db.sqlite/db_sqlite_migration_grt.py
python
SQLiteMigration.migrateUpdateForChanges
(self, state, target_catalog)
return target_catalog
Create datatype cast expression for target column based on source datatype.
Create datatype cast expression for target column based on source datatype.
[ "Create", "datatype", "cast", "expression", "for", "target", "column", "based", "on", "source", "datatype", "." ]
def migrateUpdateForChanges(self, state, target_catalog): """ Create datatype cast expression for target column based on source datatype. """ return target_catalog
[ "def", "migrateUpdateForChanges", "(", "self", ",", "state", ",", "target_catalog", ")", ":", "return", "target_catalog" ]
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/modules/db.sqlite/db_sqlite_migration_grt.py#L206-L210
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/wire_format.py
python
UnpackTag
(tag)
return (tag >> TAG_TYPE_BITS), (tag & TAG_TYPE_MASK)
The inverse of PackTag(). Given an unsigned 32-bit number, returns a (field_number, wire_type) tuple.
The inverse of PackTag(). Given an unsigned 32-bit number, returns a (field_number, wire_type) tuple.
[ "The", "inverse", "of", "PackTag", "()", ".", "Given", "an", "unsigned", "32", "-", "bit", "number", "returns", "a", "(", "field_number", "wire_type", ")", "tuple", "." ]
def UnpackTag(tag): """The inverse of PackTag(). Given an unsigned 32-bit number, returns a (field_number, wire_type) tuple. """ return (tag >> TAG_TYPE_BITS), (tag & TAG_TYPE_MASK)
[ "def", "UnpackTag", "(", "tag", ")", ":", "return", "(", "tag", ">>", "TAG_TYPE_BITS", ")", ",", "(", "tag", "&", "TAG_TYPE_MASK", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/wire_format.py#L93-L97
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGProperty.AddPrivateChild
(*args, **kwargs)
return _propgrid.PGProperty_AddPrivateChild(*args, **kwargs)
AddPrivateChild(self, PGProperty prop)
AddPrivateChild(self, PGProperty prop)
[ "AddPrivateChild", "(", "self", "PGProperty", "prop", ")" ]
def AddPrivateChild(*args, **kwargs): """AddPrivateChild(self, PGProperty prop)""" return _propgrid.PGProperty_AddPrivateChild(*args, **kwargs)
[ "def", "AddPrivateChild", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_AddPrivateChild", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L799-L801
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
platforms/nuttx/NuttX/tools/kconfiglib.py
python
Kconfig.write_min_config
(self, filename, header="# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n")
Writes out a "minimal" configuration file, omitting symbols whose value matches their default value. The format matches the one produced by 'make savedefconfig'. The resulting configuration file is incomplete, but a complete configuration can be derived from it by loading it. Minimal ...
Writes out a "minimal" configuration file, omitting symbols whose value matches their default value. The format matches the one produced by 'make savedefconfig'.
[ "Writes", "out", "a", "minimal", "configuration", "file", "omitting", "symbols", "whose", "value", "matches", "their", "default", "value", ".", "The", "format", "matches", "the", "one", "produced", "by", "make", "savedefconfig", "." ]
def write_min_config(self, filename, header="# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n"): """ Writes out a "minimal" configuration file, omitting symbols whose value matches their default value. The format matches the one produced by '...
[ "def", "write_min_config", "(", "self", ",", "filename", ",", "header", "=", "\"# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\\n\"", ")", ":", "with", "self", ".", "_open", "(", "filename", ",", "\"w\"", ")", "as", "f", ":", "f", ".", "write"...
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/NuttX/tools/kconfiglib.py#L1396-L1443
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_AcosGrad
(op, grad)
Returns grad * -1/sqrt(1-x^2).
Returns grad * -1/sqrt(1-x^2).
[ "Returns", "grad", "*", "-", "1", "/", "sqrt", "(", "1", "-", "x^2", ")", "." ]
def _AcosGrad(op, grad): """Returns grad * -1/sqrt(1-x^2).""" x = op.inputs[0] with ops.control_dependencies([grad]): x = math_ops.conj(x) x2 = math_ops.square(x) one = constant_op.constant(1, dtype=grad.dtype) den = math_ops.sqrt(math_ops.subtract(one, x2)) inv = math_ops.reciprocal(den) ...
[ "def", "_AcosGrad", "(", "op", ",", "grad", ")", ":", "x", "=", "op", ".", "inputs", "[", "0", "]", "with", "ops", ".", "control_dependencies", "(", "[", "grad", "]", ")", ":", "x", "=", "math_ops", ".", "conj", "(", "x", ")", "x2", "=", "math_...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L1232-L1241
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
FileDropTarget.OnData
(*args, **kwargs)
return _misc_.FileDropTarget_OnData(*args, **kwargs)
OnData(self, int x, int y, int def) -> int
OnData(self, int x, int y, int def) -> int
[ "OnData", "(", "self", "int", "x", "int", "y", "int", "def", ")", "-", ">", "int" ]
def OnData(*args, **kwargs): """OnData(self, int x, int y, int def) -> int""" return _misc_.FileDropTarget_OnData(*args, **kwargs)
[ "def", "OnData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileDropTarget_OnData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5730-L5732
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/quantization/tools/quantize_graph.py
python
GraphRewriter.round_nodes_recursively
(self, current_node)
The entry point for simple rounding quantization.
The entry point for simple rounding quantization.
[ "The", "entry", "point", "for", "simple", "rounding", "quantization", "." ]
def round_nodes_recursively(self, current_node): """The entry point for simple rounding quantization.""" if self.already_visited[current_node.name]: return self.already_visited[current_node.name] = True for input_node_name in current_node.input: input_node_name = node_name_from_input(input_n...
[ "def", "round_nodes_recursively", "(", "self", ",", "current_node", ")", ":", "if", "self", ".", "already_visited", "[", "current_node", ".", "name", "]", ":", "return", "self", ".", "already_visited", "[", "current_node", ".", "name", "]", "=", "True", "for...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/quantization/tools/quantize_graph.py#L353-L382
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_wx/toolbox.py
python
ToolPalett.refresh
(self)
Reorganizes toolpallet after adding/removing tools. Attention is not automatically called.
Reorganizes toolpallet after adding/removing tools. Attention is not automatically called.
[ "Reorganizes", "toolpallet", "after", "adding", "/", "removing", "tools", ".", "Attention", "is", "not", "automatically", "called", "." ]
def refresh(self): """ Reorganizes toolpallet after adding/removing tools. Attention is not automatically called. """ self.sizer.Layout()
[ "def", "refresh", "(", "self", ")", ":", "self", ".", "sizer", ".", "Layout", "(", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py#L310-L315
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_toolbar.py
python
EdToolBar.__init__
(self, parent)
Initializes the toolbar @param parent: parent window of this toolbar
Initializes the toolbar @param parent: parent window of this toolbar
[ "Initializes", "the", "toolbar", "@param", "parent", ":", "parent", "window", "of", "this", "toolbar" ]
def __init__(self, parent): """Initializes the toolbar @param parent: parent window of this toolbar """ sstyle = wx.TB_HORIZONTAL | wx.NO_BORDER if wx.Platform == '__WXGTK__': sstyle = sstyle | wx.TB_DOCKABLE super(EdToolBar, self).__init__(parent, style=ssty...
[ "def", "__init__", "(", "self", ",", "parent", ")", ":", "sstyle", "=", "wx", ".", "TB_HORIZONTAL", "|", "wx", ".", "NO_BORDER", "if", "wx", ".", "Platform", "==", "'__WXGTK__'", ":", "sstyle", "=", "sstyle", "|", "wx", ".", "TB_DOCKABLE", "super", "("...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_toolbar.py#L42-L61
fabianschenk/RESLAM
2e71a578b6d1a1ad1fb018641218e1f41dd9e330
thirdparty/Sophus/py/sophus/complex.py
python
Complex.Da_a_mul_b
(a, b)
return sympy.Matrix([[b.real, -b.imag], [b.imag, b.real]])
derivatice of complex muliplication wrt left multiplier a
derivatice of complex muliplication wrt left multiplier a
[ "derivatice", "of", "complex", "muliplication", "wrt", "left", "multiplier", "a" ]
def Da_a_mul_b(a, b): """ derivatice of complex muliplication wrt left multiplier a """ return sympy.Matrix([[b.real, -b.imag], [b.imag, b.real]])
[ "def", "Da_a_mul_b", "(", "a", ",", "b", ")", ":", "return", "sympy", ".", "Matrix", "(", "[", "[", "b", ".", "real", ",", "-", "b", ".", "imag", "]", ",", "[", "b", ".", "imag", ",", "b", ".", "real", "]", "]", ")" ]
https://github.com/fabianschenk/RESLAM/blob/2e71a578b6d1a1ad1fb018641218e1f41dd9e330/thirdparty/Sophus/py/sophus/complex.py#L72-L75
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetypes.py
python
MimeTypes.guess_all_extensions
(self, type, strict=True)
return extensions
Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME t...
Guess the extensions for a file based on its MIME type.
[ "Guess", "the", "extensions", "for", "a", "file", "based", "on", "its", "MIME", "type", "." ]
def guess_all_extensions(self, type, strict=True): """Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any par...
[ "def", "guess_all_extensions", "(", "self", ",", "type", ",", "strict", "=", "True", ")", ":", "type", "=", "type", ".", "lower", "(", ")", "extensions", "=", "self", ".", "types_map_inv", "[", "True", "]", ".", "get", "(", "type", ",", "[", "]", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetypes.py#L157-L174
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.DrawEllipticArcPointSize
(*args, **kwargs)
return _gdi_.DC_DrawEllipticArcPointSize(*args, **kwargs)
DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end) Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current brush is used for drawing the pie. The *start* and *end* para...
DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end)
[ "DrawEllipticArcPointSize", "(", "self", "Point", "pt", "Size", "sz", "double", "start", "double", "end", ")" ]
def DrawEllipticArcPointSize(*args, **kwargs): """ DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end) Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current bru...
[ "def", "DrawEllipticArcPointSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DrawEllipticArcPointSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3514-L3528
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/ndimage/morphology.py
python
binary_dilation
(input, structure=None, iterations=1, mask=None, output=None, border_value=0, origin=0, brute_force=False)
return _binary_erosion(input, structure, iterations, mask, output, border_value, origin, 1, brute_force)
Multi-dimensional binary dilation with the given structuring element. Parameters ---------- input : array_like Binary array_like to be dilated. Non-zero (True) elements form the subset to be dilated. structure : array_like, optional Structuring element used for the dilation. Non...
Multi-dimensional binary dilation with the given structuring element.
[ "Multi", "-", "dimensional", "binary", "dilation", "with", "the", "given", "structuring", "element", "." ]
def binary_dilation(input, structure=None, iterations=1, mask=None, output=None, border_value=0, origin=0, brute_force=False): """ Multi-dimensional binary dilation with the given structuring element. Parameters ---------- input : array_like Binary ar...
[ "def", "binary_dilation", "(", "input", ",", "structure", "=", "None", ",", "iterations", "=", "1", ",", "mask", "=", "None", ",", "output", "=", "None", ",", "border_value", "=", "0", ",", "origin", "=", "0", ",", "brute_force", "=", "False", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/ndimage/morphology.py#L379-L507
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.xpathCastNodeToNumber
(self)
return ret
Converts a node to its number value
Converts a node to its number value
[ "Converts", "a", "node", "to", "its", "number", "value" ]
def xpathCastNodeToNumber(self): """Converts a node to its number value """ ret = libxml2mod.xmlXPathCastNodeToNumber(self._o) return ret
[ "def", "xpathCastNodeToNumber", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathCastNodeToNumber", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3704-L3707
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-thci/OpenThread.py
python
OpenThreadTHCI.getVersionNumber
(self)
return self.__executeCommand('version')[0]
get OpenThread stack firmware version number
get OpenThread stack firmware version number
[ "get", "OpenThread", "stack", "firmware", "version", "number" ]
def getVersionNumber(self): """get OpenThread stack firmware version number""" return self.__executeCommand('version')[0]
[ "def", "getVersionNumber", "(", "self", ")", ":", "return", "self", ".", "__executeCommand", "(", "'version'", ")", "[", "0", "]" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L368-L370
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/__main__.py
python
_HandleSigQuit
(signal_num, cur_stack_frame)
Called when user hits ^\\, so we can force breakpoint a running gsutil.
Called when user hits ^\\, so we can force breakpoint a running gsutil.
[ "Called", "when", "user", "hits", "^", "\\\\", "so", "we", "can", "force", "breakpoint", "a", "running", "gsutil", "." ]
def _HandleSigQuit(signal_num, cur_stack_frame): """Called when user hits ^\\, so we can force breakpoint a running gsutil.""" import pdb # pylint: disable=g-import-not-at-top pdb.set_trace()
[ "def", "_HandleSigQuit", "(", "signal_num", ",", "cur_stack_frame", ")", ":", "import", "pdb", "# pylint: disable=g-import-not-at-top", "pdb", ".", "set_trace", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/__main__.py#L440-L443
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py
python
Styler.highlight_max
(self, subset=None, color="yellow", axis=0)
return self._highlight_handler(subset=subset, color=color, axis=axis, max_=True)
Highlight the maximum by shading the background. Parameters ---------- subset : IndexSlice, default None A valid slice for ``data`` to limit the style application to. color : str, default 'yellow' axis : {0 or 'index', 1 or 'columns', None}, default 0 App...
Highlight the maximum by shading the background.
[ "Highlight", "the", "maximum", "by", "shading", "the", "background", "." ]
def highlight_max(self, subset=None, color="yellow", axis=0): """ Highlight the maximum by shading the background. Parameters ---------- subset : IndexSlice, default None A valid slice for ``data`` to limit the style application to. color : str, default 'yell...
[ "def", "highlight_max", "(", "self", ",", "subset", "=", "None", ",", "color", "=", "\"yellow\"", ",", "axis", "=", "0", ")", ":", "return", "self", ".", "_highlight_handler", "(", "subset", "=", "subset", ",", "color", "=", "color", ",", "axis", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py#L1296-L1314
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py
python
CodeLibrary.serialize_using_bitcode
(self)
return (self._name, 'bitcode', self._final_module.as_bitcode())
Serialize this library using its bitcode as the cached representation.
Serialize this library using its bitcode as the cached representation.
[ "Serialize", "this", "library", "using", "its", "bitcode", "as", "the", "cached", "representation", "." ]
def serialize_using_bitcode(self): """ Serialize this library using its bitcode as the cached representation. """ self._ensure_finalized() return (self._name, 'bitcode', self._final_module.as_bitcode())
[ "def", "serialize_using_bitcode", "(", "self", ")", ":", "self", ".", "_ensure_finalized", "(", ")", "return", "(", "self", ".", "_name", ",", "'bitcode'", ",", "self", ".", "_final_module", ".", "as_bitcode", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py#L407-L412
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
Grid.SetColFormatCustom
(*args, **kwargs)
return _grid.Grid_SetColFormatCustom(*args, **kwargs)
SetColFormatCustom(self, int col, String typeName)
SetColFormatCustom(self, int col, String typeName)
[ "SetColFormatCustom", "(", "self", "int", "col", "String", "typeName", ")" ]
def SetColFormatCustom(*args, **kwargs): """SetColFormatCustom(self, int col, String typeName)""" return _grid.Grid_SetColFormatCustom(*args, **kwargs)
[ "def", "SetColFormatCustom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetColFormatCustom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1742-L1744
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
ImageHandler.GetAltExtensions
(*args, **kwargs)
return _core_.ImageHandler_GetAltExtensions(*args, **kwargs)
GetAltExtensions(self) -> wxArrayString
GetAltExtensions(self) -> wxArrayString
[ "GetAltExtensions", "(", "self", ")", "-", ">", "wxArrayString" ]
def GetAltExtensions(*args, **kwargs): """GetAltExtensions(self) -> wxArrayString""" return _core_.ImageHandler_GetAltExtensions(*args, **kwargs)
[ "def", "GetAltExtensions", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ImageHandler_GetAltExtensions", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2628-L2630
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Environment.py
python
MethodWrapper.clone
(self, new_object)
return self.__class__(new_object, self.method, self.name)
Returns an object that re-binds the underlying "method" to the specified new object.
Returns an object that re-binds the underlying "method" to the specified new object.
[ "Returns", "an", "object", "that", "re", "-", "binds", "the", "underlying", "method", "to", "the", "specified", "new", "object", "." ]
def clone(self, new_object): """ Returns an object that re-binds the underlying "method" to the specified new object. """ return self.__class__(new_object, self.method, self.name)
[ "def", "clone", "(", "self", ",", "new_object", ")", ":", "return", "self", ".", "__class__", "(", "new_object", ",", "self", ".", "method", ",", "self", ".", "name", ")" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Environment.py#L226-L231
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
gtsam/3rdparty/GeographicLib/python/geographiclib/geodesic.py
python
Geodesic.__init__
(self, a, f)
Construct a Geodesic object :param a: the equatorial radius of the ellipsoid in meters :param f: the flattening of the ellipsoid An exception is thrown if *a* or the polar semi-axis *b* = *a* (1 - *f*) is not a finite positive quantity.
Construct a Geodesic object
[ "Construct", "a", "Geodesic", "object" ]
def __init__(self, a, f): """Construct a Geodesic object :param a: the equatorial radius of the ellipsoid in meters :param f: the flattening of the ellipsoid An exception is thrown if *a* or the polar semi-axis *b* = *a* (1 - *f*) is not a finite positive quantity. """ self.a = float(a) ...
[ "def", "__init__", "(", "self", ",", "a", ",", "f", ")", ":", "self", ".", "a", "=", "float", "(", "a", ")", "\"\"\"The equatorial radius in meters (readonly)\"\"\"", "self", ".", "f", "=", "float", "(", "f", ")", "\"\"\"The flattening (readonly)\"\"\"", "self...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/geodesic.py#L274-L320
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/npapi/npspy/analyze_streams.py
python
ReadFile
(filename, flags='rb')
return result
Returns the contents of a file.
Returns the contents of a file.
[ "Returns", "the", "contents", "of", "a", "file", "." ]
def ReadFile(filename, flags='rb'): """Returns the contents of a file.""" file = open(filename, flags) result = file.read() file.close() return result
[ "def", "ReadFile", "(", "filename", ",", "flags", "=", "'rb'", ")", ":", "file", "=", "open", "(", "filename", ",", "flags", ")", "result", "=", "file", ".", "read", "(", ")", "file", ".", "close", "(", ")", "return", "result" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/npapi/npspy/analyze_streams.py#L6-L11
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/req/constructors.py
python
_looks_like_path
(name)
return False
Checks whether the string "looks like" a path on the filesystem. This does not check whether the target actually exists, only judge from the appearance. Returns true if any of the following conditions is true: * a path separator is found (either os.path.sep or os.path.altsep); * a dot is fo...
Checks whether the string "looks like" a path on the filesystem.
[ "Checks", "whether", "the", "string", "looks", "like", "a", "path", "on", "the", "filesystem", "." ]
def _looks_like_path(name): # type: (str) -> bool """Checks whether the string "looks like" a path on the filesystem. This does not check whether the target actually exists, only judge from the appearance. Returns true if any of the following conditions is true: * a path separator is f...
[ "def", "_looks_like_path", "(", "name", ")", ":", "# type: (str) -> bool", "if", "os", ".", "path", ".", "sep", "in", "name", ":", "return", "True", "if", "os", ".", "path", ".", "altsep", "is", "not", "None", "and", "os", ".", "path", ".", "altsep", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/req/constructors.py#L459-L493
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/io_ops.py
python
TFRecordReader.__init__
(self, name=None, options=None)
Create a TFRecordReader. Args: name: A name for the operation (optional). options: A TFRecordOptions object (optional).
Create a TFRecordReader.
[ "Create", "a", "TFRecordReader", "." ]
def __init__(self, name=None, options=None): """Create a TFRecordReader. Args: name: A name for the operation (optional). options: A TFRecordOptions object (optional). """ compression_type_string = "" if (options and options.compression_type == python_io.TFRecordCompressionType....
[ "def", "__init__", "(", "self", ",", "name", "=", "None", ",", "options", "=", "None", ")", ":", "compression_type_string", "=", "\"\"", "if", "(", "options", "and", "options", ".", "compression_type", "==", "python_io", ".", "TFRecordCompressionType", ".", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/io_ops.py#L527-L541
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/drafttaskpanels/task_scale.py
python
ScaleTaskPanel.setClone
(self, state)
Set the clone and scale option.
Set the clone and scale option.
[ "Set", "the", "clone", "and", "scale", "option", "." ]
def setClone(self, state): """Set the clone and scale option.""" App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").SetBool("ScaleClone", state) if state and self.isCopy.isChecked(): self.isCopy.setChecked(False) if state and self.isSubelementMode.isChecked(): ...
[ "def", "setClone", "(", "self", ",", "state", ")", ":", "App", ".", "ParamGet", "(", "\"User parameter:BaseApp/Preferences/Mod/Draft\"", ")", ".", "SetBool", "(", "\"ScaleClone\"", ",", "state", ")", "if", "state", "and", "self", ".", "isCopy", ".", "isChecked...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_scale.py#L129-L135
microsoft/clang
86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5
tools/scan-build-py/libscanbuild/analyze.py
python
get_ctu_config_from_args
(args)
return ( CtuConfig(collect=args.ctu_phases.collect, analyze=args.ctu_phases.analyze, dir=args.ctu_dir, func_map_cmd=args.func_map_cmd) if hasattr(args, 'ctu_phases') and hasattr(args.ctu_phases, 'dir') else CtuConfig(collect=False, analyze=Fa...
CTU configuration is created from the chosen phases and dir.
CTU configuration is created from the chosen phases and dir.
[ "CTU", "configuration", "is", "created", "from", "the", "chosen", "phases", "and", "dir", "." ]
def get_ctu_config_from_args(args): """ CTU configuration is created from the chosen phases and dir. """ return ( CtuConfig(collect=args.ctu_phases.collect, analyze=args.ctu_phases.analyze, dir=args.ctu_dir, func_map_cmd=args.func_map_cmd) i...
[ "def", "get_ctu_config_from_args", "(", "args", ")", ":", "return", "(", "CtuConfig", "(", "collect", "=", "args", ".", "ctu_phases", ".", "collect", ",", "analyze", "=", "args", ".", "ctu_phases", ".", "analyze", ",", "dir", "=", "args", ".", "ctu_dir", ...
https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/tools/scan-build-py/libscanbuild/analyze.py#L113-L122
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
reduce_all
(input_tensor, reduction_indices=None, keep_dims=False, name=None)
return gen_math_ops._all(input_tensor, _ReductionDims(input_tensor, reduction_indices), keep_dims, name=name)
Computes the "logical and" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `reduction_indices`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_indices`. If `keep_dims` is true, the reduced dimensions are retained w...
Computes the "logical and" of elements across dimensions of a tensor.
[ "Computes", "the", "logical", "and", "of", "elements", "across", "dimensions", "of", "a", "tensor", "." ]
def reduce_all(input_tensor, reduction_indices=None, keep_dims=False, name=None): """Computes the "logical and" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `reduction_indices`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 fo...
[ "def", "reduce_all", "(", "input_tensor", ",", "reduction_indices", "=", "None", ",", "keep_dims", "=", "False", ",", "name", "=", "None", ")", ":", "return", "gen_math_ops", ".", "_all", "(", "input_tensor", ",", "_ReductionDims", "(", "input_tensor", ",", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1179-L1213
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/alara.py
python
_get_subvoxel_array
(mesh, cell_mats)
return subvoxel_array
This function returns an array of subvoxels. Parameters ---------- mesh : PyNE Mesh object The Mesh object for which the geometry is discretized. return : subvoxel_array: structured array A sorted, one dimensional array, each entry containing the following fields: :...
This function returns an array of subvoxels. Parameters ---------- mesh : PyNE Mesh object The Mesh object for which the geometry is discretized.
[ "This", "function", "returns", "an", "array", "of", "subvoxels", ".", "Parameters", "----------", "mesh", ":", "PyNE", "Mesh", "object", "The", "Mesh", "object", "for", "which", "the", "geometry", "is", "discretized", "." ]
def _get_subvoxel_array(mesh, cell_mats): """ This function returns an array of subvoxels. Parameters ---------- mesh : PyNE Mesh object The Mesh object for which the geometry is discretized. return : subvoxel_array: structured array A sorted, one dimensional array, each entry c...
[ "def", "_get_subvoxel_array", "(", "mesh", ",", "cell_mats", ")", ":", "cell_number_tag", "=", "mesh", ".", "cell_number", "subvoxel_array", "=", "np", ".", "zeros", "(", "0", ",", "dtype", "=", "[", "(", "'svid'", ",", "np", ".", "int64", ")", ",", "(...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/alara.py#L1003-L1039
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
python
SourceLoader.get_code
(self, fullname)
return code_object
Concrete implementation of InspectLoader.get_code. Reading of bytecode requires path_stats to be implemented. To write bytecode, set_data must also be implemented.
Concrete implementation of InspectLoader.get_code.
[ "Concrete", "implementation", "of", "InspectLoader", ".", "get_code", "." ]
def get_code(self, fullname): """Concrete implementation of InspectLoader.get_code. Reading of bytecode requires path_stats to be implemented. To write bytecode, set_data must also be implemented. """ source_path = self.get_filename(fullname) source_mtime = None ...
[ "def", "get_code", "(", "self", ",", "fullname", ")", ":", "source_path", "=", "self", ".", "get_filename", "(", "fullname", ")", "source_mtime", "=", "None", "source_bytes", "=", "None", "source_hash", "=", "None", "hash_based", "=", "False", "check_source", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L916-L998