nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py
python
IRBuilder.convert_to_fp16
(self, a)
Convert the given FP number to an i16
Convert the given FP number to an i16
[ "Convert", "the", "given", "FP", "number", "to", "an", "i16" ]
def convert_to_fp16(self, a): """ Convert the given FP number to an i16 """
[ "def", "convert_to_fp16", "(", "self", ",", "a", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py#L1054-L1057
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/workspacedisplay/table/presenter_standard.py
python
TableWorkspaceDataPresenterStandard.create_item
(data, editable)
return create_table_item(data, editable)
Create a QStandardItemModel for the data :param data: The typed data to store :param editable: True if it should be editable in the view
Create a QStandardItemModel for the data :param data: The typed data to store :param editable: True if it should be editable in the view
[ "Create", "a", "QStandardItemModel", "for", "the", "data", ":", "param", "data", ":", "The", "typed", "data", "to", "store", ":", "param", "editable", ":", "True", "if", "it", "should", "be", "editable", "in", "the", "view" ]
def create_item(data, editable): """Create a QStandardItemModel for the data :param data: The typed data to store :param editable: True if it should be editable in the view """ return create_table_item(data, editable)
[ "def", "create_item", "(", "data", ",", "editable", ")", ":", "return", "create_table_item", "(", "data", ",", "editable", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/workspacedisplay/table/presenter_standard.py#L46-L51
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/autograph/operators/slices.py
python
_tf_tensorarray_set_item
(target, i, x)
return target.write(i, x)
Overload of set_item that stages a TensorArray write.
Overload of set_item that stages a TensorArray write.
[ "Overload", "of", "set_item", "that", "stages", "a", "TensorArray", "write", "." ]
def _tf_tensorarray_set_item(target, i, x): """Overload of set_item that stages a TensorArray write.""" return target.write(i, x)
[ "def", "_tf_tensorarray_set_item", "(", "target", ",", "i", ",", "x", ")", ":", "return", "target", ".", "write", "(", "i", ",", "x", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/operators/slices.py#L124-L126
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/dataframe.py
python
DataFrame.from_pandas
(cls, dataframe, nan_as_null=None)
return result
Convert from a Pandas DataFrame. Parameters ---------- dataframe : Pandas DataFrame object A Pandads DataFrame object which has to be converted to cuDF DataFrame. nan_as_null : bool, Default True If ``True``, converts ``np.nan`` values to ``null`` val...
Convert from a Pandas DataFrame.
[ "Convert", "from", "a", "Pandas", "DataFrame", "." ]
def from_pandas(cls, dataframe, nan_as_null=None): """ Convert from a Pandas DataFrame. Parameters ---------- dataframe : Pandas DataFrame object A Pandads DataFrame object which has to be converted to cuDF DataFrame. nan_as_null : bool, Default T...
[ "def", "from_pandas", "(", "cls", ",", "dataframe", ",", "nan_as_null", "=", "None", ")", ":", "if", "not", "isinstance", "(", "dataframe", ",", "pd", ".", "DataFrame", ")", ":", "raise", "TypeError", "(", "\"not a pandas.DataFrame\"", ")", "if", "not", "d...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/dataframe.py#L4461-L4527
chatopera/clause
dee31153d5ffdef33deedb6bff03e7806c296968
src/lac/python/reader.py
python
test_reader
(file_dir, word2id_dict, label2id_dict, word_replace_dict, filename_feature="")
return reader
define the reader to read test files in file_dir
define the reader to read test files in file_dir
[ "define", "the", "reader", "to", "read", "test", "files", "in", "file_dir" ]
def test_reader(file_dir, word2id_dict, label2id_dict, word_replace_dict, filename_feature=""): """ define the reader to read test files in file_dir """ word_dict_len = max(map(int, word2id_dict.values())) + 1 label_dict_len = max(map(i...
[ "def", "test_reader", "(", "file_dir", ",", "word2id_dict", ",", "label2id_dict", ",", "word_replace_dict", ",", "filename_feature", "=", "\"\"", ")", ":", "word_dict_len", "=", "max", "(", "map", "(", "int", ",", "word2id_dict", ".", "values", "(", ")", ")"...
https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/src/lac/python/reader.py#L59-L101
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Protocol/SecretSharing.py
python
_Element.inverse
(self)
return _Element(s0)
Return the inverse of this element in GF(2^128).
Return the inverse of this element in GF(2^128).
[ "Return", "the", "inverse", "of", "this", "element", "in", "GF", "(", "2^128", ")", "." ]
def inverse(self): """Return the inverse of this element in GF(2^128).""" # We use the Extended GCD algorithm # http://en.wikipedia.org/wiki/Polynomial_greatest_common_divisor r0, r1 = self._value, self.irr_poly s0, s1 = 1, 0 while r1 > 0: q = _div_gf2(r0, r...
[ "def", "inverse", "(", "self", ")", ":", "# We use the Extended GCD algorithm", "# http://en.wikipedia.org/wiki/Polynomial_greatest_common_divisor", "r0", ",", "r1", "=", "self", ".", "_value", ",", "self", ".", "irr_poly", "s0", ",", "s1", "=", "1", ",", "0", "wh...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Protocol/SecretSharing.py#L132-L144
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/httplib.py
python
HTTPMessage.addheader
(self, key, value)
Add header for field key handling repeats.
Add header for field key handling repeats.
[ "Add", "header", "for", "field", "key", "handling", "repeats", "." ]
def addheader(self, key, value): """Add header for field key handling repeats.""" prev = self.dict.get(key) if prev is None: self.dict[key] = value else: combined = ", ".join((prev, value)) self.dict[key] = combined
[ "def", "addheader", "(", "self", ",", "key", ",", "value", ")", ":", "prev", "=", "self", ".", "dict", ".", "get", "(", "key", ")", "if", "prev", "is", "None", ":", "self", ".", "dict", "[", "key", "]", "=", "value", "else", ":", "combined", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/httplib.py#L257-L264
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_simulation.py
python
SimulationDomain.getStopEndingVehiclesNumber
(self)
return self._getUniversal(tc.VAR_STOP_ENDING_VEHICLES_NUMBER)
getStopEndingVehiclesNumber() -> integer .
getStopEndingVehiclesNumber() -> integer
[ "getStopEndingVehiclesNumber", "()", "-", ">", "integer" ]
def getStopEndingVehiclesNumber(self): """getStopEndingVehiclesNumber() -> integer . """ return self._getUniversal(tc.VAR_STOP_ENDING_VEHICLES_NUMBER)
[ "def", "getStopEndingVehiclesNumber", "(", "self", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_STOP_ENDING_VEHICLES_NUMBER", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_simulation.py#L401-L406
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/poplib.py
python
POP3.capa
(self)
return caps
Return server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa() {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'], 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [], 'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [], ...
Return server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa() {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'], 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [], 'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [], ...
[ "Return", "server", "capabilities", "(", "RFC", "2449", ")", "as", "a", "dictionary", ">>>", "c", "=", "poplib", ".", "POP3", "(", "localhost", ")", ">>>", "c", ".", "capa", "()", "{", "IMPLEMENTATION", ":", "[", "Cyrus", "POP3", "server", "v2", ".", ...
def capa(self): """Return server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa() {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'], 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [], 'EXPIRE': ['NEVER'], 'USER': [], 'STLS'...
[ "def", "capa", "(", "self", ")", ":", "def", "_parsecap", "(", "line", ")", ":", "lst", "=", "line", ".", "decode", "(", "'ascii'", ")", ".", "split", "(", ")", "return", "lst", "[", "0", "]", ",", "lst", "[", "1", ":", "]", "caps", "=", "{",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/poplib.py#L361-L387
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
gtsam/3rdparty/GeographicLib/python/geographiclib/accumulator.py
python
Accumulator.Negate
(self)
Negate sum
Negate sum
[ "Negate", "sum" ]
def Negate(self): """Negate sum""" self._s *= -1 self._t *= -1
[ "def", "Negate", "(", "self", ")", ":", "self", ".", "_s", "*=", "-", "1", "self", ".", "_t", "*=", "-", "1" ]
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/accumulator.py#L79-L82
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/eventloop/posix.py
python
PosixEventLoop.call_from_executor
(self, callback, _max_postpone_until=None)
Call this function in the main event loop. Similar to Twisted's ``callFromThread``. :param _max_postpone_until: `None` or `time.time` value. For interal use. If the eventloop is saturated, consider this task to be low priority and postpone maximum until this timestamp. (For inst...
Call this function in the main event loop. Similar to Twisted's ``callFromThread``.
[ "Call", "this", "function", "in", "the", "main", "event", "loop", ".", "Similar", "to", "Twisted", "s", "callFromThread", "." ]
def call_from_executor(self, callback, _max_postpone_until=None): """ Call this function in the main event loop. Similar to Twisted's ``callFromThread``. :param _max_postpone_until: `None` or `time.time` value. For interal use. If the eventloop is saturated, consider this ta...
[ "def", "call_from_executor", "(", "self", ",", "callback", ",", "_max_postpone_until", "=", "None", ")", ":", "assert", "_max_postpone_until", "is", "None", "or", "isinstance", "(", "_max_postpone_until", ",", "float", ")", "self", ".", "_calls_from_executor", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/eventloop/posix.py#L228-L249
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/python_gflags/gflags.py
python
FlagValues.KeyFlagsByModuleDict
(self)
return self.__dict__['__key_flags_by_module']
Returns the dictionary of module_name -> list of key flags. Returns: A dictionary. Its keys are module names (strings). Its values are lists of Flag objects.
Returns the dictionary of module_name -> list of key flags.
[ "Returns", "the", "dictionary", "of", "module_name", "-", ">", "list", "of", "key", "flags", "." ]
def KeyFlagsByModuleDict(self): """Returns the dictionary of module_name -> list of key flags. Returns: A dictionary. Its keys are module names (strings). Its values are lists of Flag objects. """ return self.__dict__['__key_flags_by_module']
[ "def", "KeyFlagsByModuleDict", "(", "self", ")", ":", "return", "self", ".", "__dict__", "[", "'__key_flags_by_module'", "]" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L867-L874
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_grad.py
python
_FractionalMaxPoolGrad
(op, grad_0, unused_grad_1, unused_grad_2)
return gen_nn_ops.fractional_max_pool_grad( op.inputs[0], op.outputs[0], grad_0, op.outputs[1], op.outputs[2], op.get_attr("overlapping"))
Returns gradient for FractionalMaxPool. Since FractionalMaxPool has three outputs, there are three gradients passed in for each of the outputs. Only the first one is useful, the other two gradients are empty. Args: op: The FractionalMaxPoolOp. grad_0: Gradient with respect to op.outputs[0] unused_...
Returns gradient for FractionalMaxPool.
[ "Returns", "gradient", "for", "FractionalMaxPool", "." ]
def _FractionalMaxPoolGrad(op, grad_0, unused_grad_1, unused_grad_2): """Returns gradient for FractionalMaxPool. Since FractionalMaxPool has three outputs, there are three gradients passed in for each of the outputs. Only the first one is useful, the other two gradients are empty. Args: op: The Fraction...
[ "def", "_FractionalMaxPoolGrad", "(", "op", ",", "grad_0", ",", "unused_grad_1", ",", "unused_grad_2", ")", ":", "return", "gen_nn_ops", ".", "fractional_max_pool_grad", "(", "op", ".", "inputs", "[", "0", "]", ",", "op", ".", "outputs", "[", "0", "]", ","...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_grad.py#L770-L788
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
api/ctpx/ctptd.py
python
CtpTd.onErrRtnQuoteInsert
(self, InputQuoteField, RspInfoField)
报价录入错误回报
报价录入错误回报
[ "报价录入错误回报" ]
def onErrRtnQuoteInsert(self, InputQuoteField, RspInfoField): """报价录入错误回报""" pass
[ "def", "onErrRtnQuoteInsert", "(", "self", ",", "InputQuoteField", ",", "RspInfoField", ")", ":", "pass" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/api/ctpx/ctptd.py#L403-L405
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py
python
RedshiftConnection.revoke_cluster_security_group_ingress
(self, cluster_security_group_name, cidrip=None, ec2_security_group_name=None, ec2_security_group_owner_id=None)
return self._make_request( action='RevokeClusterSecurityGroupIngress', verb='POST', path='/', params=params)
Revokes an ingress rule in an Amazon Redshift security group for a previously authorized IP range or Amazon EC2 security group. To add an ingress rule, see AuthorizeClusterSecurityGroupIngress. For information about managing security groups, go to `Amazon Redshift Cluster Securit...
Revokes an ingress rule in an Amazon Redshift security group for a previously authorized IP range or Amazon EC2 security group. To add an ingress rule, see AuthorizeClusterSecurityGroupIngress. For information about managing security groups, go to `Amazon Redshift Cluster Securit...
[ "Revokes", "an", "ingress", "rule", "in", "an", "Amazon", "Redshift", "security", "group", "for", "a", "previously", "authorized", "IP", "range", "or", "Amazon", "EC2", "security", "group", ".", "To", "add", "an", "ingress", "rule", "see", "AuthorizeClusterSec...
def revoke_cluster_security_group_ingress(self, cluster_security_group_name, cidrip=None, ec2_security_group_name=None, ec2_security_gro...
[ "def", "revoke_cluster_security_group_ingress", "(", "self", ",", "cluster_security_group_name", ",", "cidrip", "=", "None", ",", "ec2_security_group_name", "=", "None", ",", "ec2_security_group_owner_id", "=", "None", ")", ":", "params", "=", "{", "'ClusterSecurityGrou...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py#L2977-L3027
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/contact.py
python
contact_map
(contacts,fixed=None)
return paircontacts
Given an unordered list of ContactPoints, computes a canonical dict from (obj1,obj2) pairs to a list of contacts on those objects. The resulting dict is also regularized so that objects are sorted in increasing getID(), so that (obj1,obj2) is not duplicated as (obj2,obj1). If fixed is provided, all...
Given an unordered list of ContactPoints, computes a canonical dict from (obj1,obj2) pairs to a list of contacts on those objects. The resulting dict is also regularized so that objects are sorted in increasing getID(), so that (obj1,obj2) is not duplicated as (obj2,obj1). If fixed is provided, all...
[ "Given", "an", "unordered", "list", "of", "ContactPoints", "computes", "a", "canonical", "dict", "from", "(", "obj1", "obj2", ")", "pairs", "to", "a", "list", "of", "contacts", "on", "those", "objects", ".", "The", "resulting", "dict", "is", "also", "regul...
def contact_map(contacts,fixed=None): """Given an unordered list of ContactPoints, computes a canonical dict from (obj1,obj2) pairs to a list of contacts on those objects. The resulting dict is also regularized so that objects are sorted in increasing getID(), so that (obj1,obj2) is not duplicated as (o...
[ "def", "contact_map", "(", "contacts", ",", "fixed", "=", "None", ")", ":", "worlds", "=", "set", "(", ")", "robots", "=", "set", "(", ")", "objects", "=", "set", "(", ")", "#check which worlds, robots, and objects are used", "for", "c", "in", "contacts", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/contact.py#L222-L279
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py
python
NTableWidget.__init__
(self, parent)
return
:param parent: :return:
[]
def __init__(self, parent): """ :param parent: :return: """ QTableWidget.__init__(self, parent) self._myParent = parent self._myColumnNameList = None self._myColumnTypeList = None self._editableList = list() self._statusColName = 'Statu...
[ "def", "__init__", "(", "self", ",", "parent", ")", ":", "QTableWidget", ".", "__init__", "(", "self", ",", "parent", ")", "self", ".", "_myParent", "=", "parent", "self", ".", "_myColumnNameList", "=", "None", "self", ".", "_myColumnTypeList", "=", "None"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py#L28-L45
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_mean_iou
(predictions, labels, num_classes, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None)
Calculate per-step mean Intersection-Over-Union (mIOU). Mean Intersection-Over-Union is a common evaluation metric for semantic image segmentation, which first computes the IOU for each semantic class and then computes the average over classes. IOU is defined as follows: IOU = true_positive / (true_positiv...
Calculate per-step mean Intersection-Over-Union (mIOU).
[ "Calculate", "per", "-", "step", "mean", "Intersection", "-", "Over", "-", "Union", "(", "mIOU", ")", "." ]
def streaming_mean_iou(predictions, labels, num_classes, ignore_mask=None, metrics_collections=None, updates_collections=None, name=None): """Calculate per-step mean Intersection-O...
[ "def", "streaming_mean_iou", "(", "predictions", ",", "labels", ",", "num_classes", ",", "ignore_mask", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py#L1750-L1860
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py
python
DocbookXslt
(env, target, source=None, *args, **kw)
return result
A pseudo-Builder, applying a simple XSL transformation to the input file.
A pseudo-Builder, applying a simple XSL transformation to the input file.
[ "A", "pseudo", "-", "Builder", "applying", "a", "simple", "XSL", "transformation", "to", "the", "input", "file", "." ]
def DocbookXslt(env, target, source=None, *args, **kw): """ A pseudo-Builder, applying a simple XSL transformation to the input file. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'tra...
[ "def", "DocbookXslt", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Init list of targets/sources", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "# ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py#L794-L814
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py
python
grid_to_graph
(n_x, n_y, n_z=1, mask=None, return_as=sparse.coo_matrix, dtype=np.int)
return _to_graph(n_x, n_y, n_z, mask=mask, return_as=return_as, dtype=dtype)
Graph of the pixel-to-pixel connections Edges exist if 2 voxels are connected. Parameters ---------- n_x : int Dimension in x axis n_y : int Dimension in y axis n_z : int, optional, default 1 Dimension in z axis mask : ndarray of booleans, optional An option...
Graph of the pixel-to-pixel connections
[ "Graph", "of", "the", "pixel", "-", "to", "-", "pixel", "connections" ]
def grid_to_graph(n_x, n_y, n_z=1, mask=None, return_as=sparse.coo_matrix, dtype=np.int): """Graph of the pixel-to-pixel connections Edges exist if 2 voxels are connected. Parameters ---------- n_x : int Dimension in x axis n_y : int Dimension in y axis n_...
[ "def", "grid_to_graph", "(", "n_x", ",", "n_y", ",", "n_z", "=", "1", ",", "mask", "=", "None", ",", "return_as", "=", "sparse", ".", "coo_matrix", ",", "dtype", "=", "np", ".", "int", ")", ":", "return", "_to_graph", "(", "n_x", ",", "n_y", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py#L166-L198
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
libs/EXTERNAL/libcatch2/.conan/build.py
python
BuilderSettings._branch
(self)
return ci_manager.get_branch()
Get branch name from CI manager
Get branch name from CI manager
[ "Get", "branch", "name", "from", "CI", "manager" ]
def _branch(self): """ Get branch name from CI manager """ printer = Printer(None) ci_manager = CIManager(printer) return ci_manager.get_branch()
[ "def", "_branch", "(", "self", ")", ":", "printer", "=", "Printer", "(", "None", ")", "ci_manager", "=", "CIManager", "(", "printer", ")", "return", "ci_manager", ".", "get_branch", "(", ")" ]
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/libs/EXTERNAL/libcatch2/.conan/build.py#L74-L79
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/npyimpl.py
python
_ufunc_db_function
(ufunc)
return _KernelImpl
Use the ufunc loop type information to select the code generation function from the table provided by the dict_of_kernels. The dict of kernels maps the loop identifier to a function with the following signature: (context, builder, signature, args). The loop type information has the form 'AB->C'. The le...
Use the ufunc loop type information to select the code generation function from the table provided by the dict_of_kernels. The dict of kernels maps the loop identifier to a function with the following signature: (context, builder, signature, args).
[ "Use", "the", "ufunc", "loop", "type", "information", "to", "select", "the", "code", "generation", "function", "from", "the", "table", "provided", "by", "the", "dict_of_kernels", ".", "The", "dict", "of", "kernels", "maps", "the", "loop", "identifier", "to", ...
def _ufunc_db_function(ufunc): """Use the ufunc loop type information to select the code generation function from the table provided by the dict_of_kernels. The dict of kernels maps the loop identifier to a function with the following signature: (context, builder, signature, args). The loop type in...
[ "def", "_ufunc_db_function", "(", "ufunc", ")", ":", "class", "_KernelImpl", "(", "_Kernel", ")", ":", "def", "__init__", "(", "self", ",", "context", ",", "builder", ",", "outer_sig", ")", ":", "super", "(", "_KernelImpl", ",", "self", ")", ".", "__init...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/npyimpl.py#L389-L437
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/egg_info.py
python
FileList.recursive_exclude
(self, dir, pattern)
return self._remove_files(match.match)
Exclude any file anywhere in 'dir/' that match the pattern.
Exclude any file anywhere in 'dir/' that match the pattern.
[ "Exclude", "any", "file", "anywhere", "in", "dir", "/", "that", "match", "the", "pattern", "." ]
def recursive_exclude(self, dir, pattern): """ Exclude any file anywhere in 'dir/' that match the pattern. """ match = translate_pattern(os.path.join(dir, '**', pattern)) return self._remove_files(match.match)
[ "def", "recursive_exclude", "(", "self", ",", "dir", ",", "pattern", ")", ":", "match", "=", "translate_pattern", "(", "os", ".", "path", ".", "join", "(", "dir", ",", "'**'", ",", "pattern", ")", ")", "return", "self", ".", "_remove_files", "(", "matc...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/egg_info.py#L433-L438
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/os.py
python
execlp
(file, *args)
execlp(file, *args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process.
execlp(file, *args)
[ "execlp", "(", "file", "*", "args", ")" ]
def execlp(file, *args): """execlp(file, *args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process. """ execvp(file, args)
[ "def", "execlp", "(", "file", ",", "*", "args", ")", ":", "execvp", "(", "file", ",", "args", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/os.py#L552-L557
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/ocaml/menhir.py
python
Menhir.source
(self)
return self.__source
The menhir source file.
The menhir source file.
[ "The", "menhir", "source", "file", "." ]
def source(self): '''The menhir source file.''' return self.__source
[ "def", "source", "(", "self", ")", ":", "return", "self", ".", "__source" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/ocaml/menhir.py#L48-L50
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/MSVSNew.py
python
MSVSSolution.__init__
(self, path, version, entries=None, variants=None, websiteProperties=True)
Initializes the solution. Args: path: Path to solution file. version: Format version to emit. entries: List of entries in solution. May contain Folder or Project objects. May be None, if the folder is empty. variants: List of build variant strings. If none, a default list will ...
Initializes the solution.
[ "Initializes", "the", "solution", "." ]
def __init__(self, path, version, entries=None, variants=None, websiteProperties=True): """Initializes the solution. Args: path: Path to solution file. version: Format version to emit. entries: List of entries in solution. May contain Folder or Project objects. May ...
[ "def", "__init__", "(", "self", ",", "path", ",", "version", ",", "entries", "=", "None", ",", "variants", "=", "None", ",", "websiteProperties", "=", "True", ")", ":", "self", ".", "path", "=", "path", "self", ".", "websiteProperties", "=", "websiteProp...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/MSVSNew.py#L172-L207
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/Pharm2D/LazyGenerator.py
python
Generator.__init__
(self, sigFactory, mol, dMat=None, bitCache=True)
constructor **Arguments** - sigFactory: a signature factory, see class docs - mol: a molecule, see class docs - dMat: (optional) a distance matrix for the molecule. If this is not provided, one will be calculated - bitCache: (optional) if nonzero, a local cache of which ...
constructor
[ "constructor" ]
def __init__(self, sigFactory, mol, dMat=None, bitCache=True): """ constructor **Arguments** - sigFactory: a signature factory, see class docs - mol: a molecule, see class docs - dMat: (optional) a distance matrix for the molecule. If this is not provided, one will be calcul...
[ "def", "__init__", "(", "self", ",", "sigFactory", ",", "mol", ",", "dMat", "=", "None", ",", "bitCache", "=", "True", ")", ":", "if", "not", "isinstance", "(", "sigFactory", ",", "SigFactory", ".", "SigFactory", ")", ":", "raise", "ValueError", "(", "...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Pharm2D/LazyGenerator.py#L36-L83
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py
python
MH.__init__
(self, path = None, profile = None)
Constructor.
Constructor.
[ "Constructor", "." ]
def __init__(self, path = None, profile = None): """Constructor.""" if profile is None: profile = MH_PROFILE self.profile = os.path.expanduser(profile) if path is None: path = self.getprofile('Path') if not path: path = PATH if not os.path.isabs(path) and path[0] != '~': ...
[ "def", "__init__", "(", "self", ",", "path", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "profile", "is", "None", ":", "profile", "=", "MH_PROFILE", "self", ".", "profile", "=", "os", ".", "path", ".", "expanduser", "(", "profile", ")",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py#L102-L112
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/message.py
python
Message.ParseFromString
(self, serialized)
return self.MergeFromString(serialized)
Parse serialized protocol buffer data into this message. Like :func:`MergeFromString()`, except we clear the object first.
Parse serialized protocol buffer data into this message.
[ "Parse", "serialized", "protocol", "buffer", "data", "into", "this", "message", "." ]
def ParseFromString(self, serialized): """Parse serialized protocol buffer data into this message. Like :func:`MergeFromString()`, except we clear the object first. """ self.Clear() return self.MergeFromString(serialized)
[ "def", "ParseFromString", "(", "self", ",", "serialized", ")", ":", "self", ".", "Clear", "(", ")", "return", "self", ".", "MergeFromString", "(", "serialized", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/message.py#L193-L199
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/arg_max.py
python
_arg_max_tbe
()
return
Argmax TBE register
Argmax TBE register
[ "Argmax", "TBE", "register" ]
def _arg_max_tbe(): """Argmax TBE register""" return
[ "def", "_arg_max_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/arg_max.py#L36-L38
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/lib/clipboard.py
python
tkinter_clipboard_get
()
return text
Get the clipboard's text using Tkinter. This is the default on systems that are not Windows or OS X. It may interfere with other UI toolkits and should be replaced with an implementation that uses that toolkit.
Get the clipboard's text using Tkinter.
[ "Get", "the", "clipboard", "s", "text", "using", "Tkinter", "." ]
def tkinter_clipboard_get(): """ Get the clipboard's text using Tkinter. This is the default on systems that are not Windows or OS X. It may interfere with other UI toolkits and should be replaced with an implementation that uses that toolkit. """ try: from tkinter import Tk, TclError ...
[ "def", "tkinter_clipboard_get", "(", ")", ":", "try", ":", "from", "tkinter", "import", "Tk", ",", "TclError", "# Py 3", "except", "ImportError", ":", "try", ":", "from", "Tkinter", "import", "Tk", ",", "TclError", "# Py 2", "except", "ImportError", ":", "ra...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/clipboard.py#L46-L70
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/f2py/f2py2e.py
python
run_main
(comline_list)
return ret
Equivalent to running:: f2py <args> where ``<args>=string.join(<list>,' ')``, but in Python. Unless ``-h`` is used, this function returns a dictionary containing information on generated modules and their dependencies on source files. For example, the command ``f2py -m scalar scalar.f`` can ...
Equivalent to running::
[ "Equivalent", "to", "running", "::" ]
def run_main(comline_list): """ Equivalent to running:: f2py <args> where ``<args>=string.join(<list>,' ')``, but in Python. Unless ``-h`` is used, this function returns a dictionary containing information on generated modules and their dependencies on source files. For example, the ...
[ "def", "run_main", "(", "comline_list", ")", ":", "crackfortran", ".", "reset_global_f2py_vars", "(", ")", "f2pydir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "cfuncs", ".", "__file__", ")", ")", "fobjhsrc", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/f2py/f2py2e.py#L398-L461
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/beta.py
python
Beta.name
(self)
return self._name
Name to prepend to all ops.
Name to prepend to all ops.
[ "Name", "to", "prepend", "to", "all", "ops", "." ]
def name(self): """Name to prepend to all ops.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/beta.py#L164-L166
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pretty_annotate.py
python
reform_code
(annotation)
return s
Extract the code from the Numba annotation datastructure. Pygments can only highlight full multi-line strings, the Numba annotation is list of single lines, with indentation removed.
Extract the code from the Numba annotation datastructure.
[ "Extract", "the", "code", "from", "the", "Numba", "annotation", "datastructure", "." ]
def reform_code(annotation): """ Extract the code from the Numba annotation datastructure. Pygments can only highlight full multi-line strings, the Numba annotation is list of single lines, with indentation removed. """ ident_dict = annotation['python_indent'] s= '' for n,l in annotati...
[ "def", "reform_code", "(", "annotation", ")", ":", "ident_dict", "=", "annotation", "[", "'python_indent'", "]", "s", "=", "''", "for", "n", ",", "l", "in", "annotation", "[", "'python_lines'", "]", ":", "s", "=", "s", "+", "' '", "*", "ident_dict", "[...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pretty_annotate.py#L210-L221
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.PositionFromPointClose
(*args, **kwargs)
return _stc.StyledTextCtrl_PositionFromPointClose(*args, **kwargs)
PositionFromPointClose(self, int x, int y) -> int Find the position from a point within the window but return INVALID_POSITION if not close to text.
PositionFromPointClose(self, int x, int y) -> int
[ "PositionFromPointClose", "(", "self", "int", "x", "int", "y", ")", "-", ">", "int" ]
def PositionFromPointClose(*args, **kwargs): """ PositionFromPointClose(self, int x, int y) -> int Find the position from a point within the window but return INVALID_POSITION if not close to text. """ return _stc.StyledTextCtrl_PositionFromPointClose(*args, **kwargs)
[ "def", "PositionFromPointClose", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_PositionFromPointClose", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L2194-L2201
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/lti_conversion.py
python
tf2ss
(num, den)
return A, B, C, D
r"""Transfer function to state-space representation. Parameters ---------- num, den : array_like Sequences representing the coefficients of the numerator and denominator polynomials, in order of descending degree. The denominator needs to be at least as long as the numerator. R...
r"""Transfer function to state-space representation.
[ "r", "Transfer", "function", "to", "state", "-", "space", "representation", "." ]
def tf2ss(num, den): r"""Transfer function to state-space representation. Parameters ---------- num, den : array_like Sequences representing the coefficients of the numerator and denominator polynomials, in order of descending degree. The denominator needs to be at least as long...
[ "def", "tf2ss", "(", "num", ",", "den", ")", ":", "# Controller canonical state-space representation.", "# if M+1 = len(num) and K+1 = len(den) then we must have M <= K", "# states are found by asserting that X(s) = U(s) / D(s)", "# then Y(s) = N(s) * X(s)", "#", "# A, B, C, and D fol...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/lti_conversion.py#L20-L114
OpenGenus/quark
225ad96efdfcc66cb6584a756c17eb3871e6eb62
code/code/graph_algorithms/src/maximum_bipartite_matching/max_bipartite_matching.py
python
Graph.maxBPM
(self)
return result
An array to keep track of the applicants assigned to jobs. The value of matchR[i] is the applicant number assigned to job i, the value -1 indicates nobody is assigned.
An array to keep track of the applicants assigned to jobs. The value of matchR[i] is the applicant number assigned to job i, the value -1 indicates nobody is assigned.
[ "An", "array", "to", "keep", "track", "of", "the", "applicants", "assigned", "to", "jobs", ".", "The", "value", "of", "matchR", "[", "i", "]", "is", "the", "applicant", "number", "assigned", "to", "job", "i", "the", "value", "-", "1", "indicates", "nob...
def maxBPM(self): '''An array to keep track of the applicants assigned to jobs. The value of matchR[i] is the applicant number assigned to job i, the value -1 indicates nobody is assigned.''' matchR = [-1] * self.jobs result = 0 # Count of jobs assigned to applicants ...
[ "def", "maxBPM", "(", "self", ")", ":", "matchR", "=", "[", "-", "1", "]", "*", "self", ".", "jobs", "result", "=", "0", "# Count of jobs assigned to applicants", "for", "i", "in", "range", "(", "self", ".", "ppl", ")", ":", "# Mark all jobs as not seen fo...
https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/graph_algorithms/src/maximum_bipartite_matching/max_bipartite_matching.py#L38-L51
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
libcxx/utils/libcxx/util.py
python
executeCommandOrDie
(cmd, *args, **kwargs)
return out, err, exitCode
Execute a command and print its output on failure.
Execute a command and print its output on failure.
[ "Execute", "a", "command", "and", "print", "its", "output", "on", "failure", "." ]
def executeCommandOrDie(cmd, *args, **kwargs): """ Execute a command and print its output on failure. """ out, err, exitCode = executeCommand(cmd, *args, **kwargs) if exitCode != 0: report = makeReport(cmd, out, err, exitCode) report += "\n\nFailed!" sys.stderr.write('%s\n' %...
[ "def", "executeCommandOrDie", "(", "cmd", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "out", ",", "err", ",", "exitCode", "=", "executeCommand", "(", "cmd", ",", "*", "args", ",", "*", "*", "kwargs", ")", "if", "exitCode", "!=", "0", ":", ...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/libcxx/utils/libcxx/util.py#L288-L298
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_header_value_parser.py
python
_find_mime_parameters
(tokenlist, value)
Do our best to find the parameters in an invalid MIME header
Do our best to find the parameters in an invalid MIME header
[ "Do", "our", "best", "to", "find", "the", "parameters", "in", "an", "invalid", "MIME", "header" ]
def _find_mime_parameters(tokenlist, value): """Do our best to find the parameters in an invalid MIME header """ while value and value[0] != ';': if value[0] in PHRASE_ENDS: tokenlist.append(ValueTerminal(value[0], 'misplaced-special')) value = value[1:] else: ...
[ "def", "_find_mime_parameters", "(", "tokenlist", ",", "value", ")", ":", "while", "value", "and", "value", "[", "0", "]", "!=", "';'", ":", "if", "value", "[", "0", "]", "in", "PHRASE_ENDS", ":", "tokenlist", ".", "append", "(", "ValueTerminal", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_header_value_parser.py#L2486-L2500
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/util/cloudpickle.py
python
CloudPickler.extract_code_globals
(co)
return out_names
Find all globals names read or written to by codeblock co
Find all globals names read or written to by codeblock co
[ "Find", "all", "globals", "names", "read", "or", "written", "to", "by", "codeblock", "co" ]
def extract_code_globals(co): """ Find all globals names read or written to by codeblock co """ code = co.co_code if not PY3: code = [ord(c) for c in code] names = co.co_names out_names = set() n = len(code) i = 0 extended_arg ...
[ "def", "extract_code_globals", "(", "co", ")", ":", "code", "=", "co", ".", "co_code", "if", "not", "PY3", ":", "code", "=", "[", "ord", "(", "c", ")", "for", "c", "in", "code", "]", "names", "=", "co", ".", "co_names", "out_names", "=", "set", "...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/cloudpickle.py#L249-L281
msracver/Deep-Image-Analogy
632b9287b42552e32dad64922967c8c9ec7fc4d3
python/caffe/detector.py
python
Detector.detect_selective_search
(self, image_fnames)
return self.detect_windows(zip(image_fnames, windows_list))
Do windowed detection over Selective Search proposals by extracting the crop and warping to the input dimensions of the net. Parameters ---------- image_fnames: list Returns ------- detections: list of {filename: image filename, window: crop coordinates, ...
Do windowed detection over Selective Search proposals by extracting the crop and warping to the input dimensions of the net.
[ "Do", "windowed", "detection", "over", "Selective", "Search", "proposals", "by", "extracting", "the", "crop", "and", "warping", "to", "the", "input", "dimensions", "of", "the", "net", "." ]
def detect_selective_search(self, image_fnames): """ Do windowed detection over Selective Search proposals by extracting the crop and warping to the input dimensions of the net. Parameters ---------- image_fnames: list Returns ------- detections:...
[ "def", "detect_selective_search", "(", "self", ",", "image_fnames", ")", ":", "import", "selective_search_ijcv_with_python", "as", "selective_search", "# Make absolute paths so MATLAB can find the files.", "image_fnames", "=", "[", "os", ".", "path", ".", "abspath", "(", ...
https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/python/caffe/detector.py#L101-L123
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/text_file.py
python
TextFile.readlines
(self)
Read and return the list of all logical lines remaining in the current file.
Read and return the list of all logical lines remaining in the current file.
[ "Read", "and", "return", "the", "list", "of", "all", "logical", "lines", "remaining", "in", "the", "current", "file", "." ]
def readlines(self): """Read and return the list of all logical lines remaining in the current file.""" lines = [] while True: line = self.readline() if line is None: return lines lines.append(line)
[ "def", "readlines", "(", "self", ")", ":", "lines", "=", "[", "]", "while", "True", ":", "line", "=", "self", ".", "readline", "(", ")", "if", "line", "is", "None", ":", "return", "lines", "lines", ".", "append", "(", "line", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/text_file.py#L272-L280
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGProperty.RefreshEditor
(*args, **kwargs)
return _propgrid.PGProperty_RefreshEditor(*args, **kwargs)
RefreshEditor(self)
RefreshEditor(self)
[ "RefreshEditor", "(", "self", ")" ]
def RefreshEditor(*args, **kwargs): """RefreshEditor(self)""" return _propgrid.PGProperty_RefreshEditor(*args, **kwargs)
[ "def", "RefreshEditor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_RefreshEditor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L671-L673
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/yply/yparse.py
python
p_empty
(p)
empty :
empty :
[ "empty", ":" ]
def p_empty(p): '''empty : '''
[ "def", "p_empty", "(", "p", ")", ":" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/yply/yparse.py#L204-L205
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/minorview/model.py
python
find_colour_decoder
(stripSpace, decoderName, dataName, picPairs)
Make a colour decoder from some picture file blob attributes
Make a colour decoder from some picture file blob attributes
[ "Make", "a", "colour", "decoder", "from", "some", "picture", "file", "blob", "attributes" ]
def find_colour_decoder(stripSpace, decoderName, dataName, picPairs): """Make a colour decoder from some picture file blob attributes""" if decoderName == 'frame': return FrameColours.decoder(Counts, stripSpace, dataName) elif decoderName in decoder_element_classes: return TwoDColours.decode...
[ "def", "find_colour_decoder", "(", "stripSpace", ",", "decoderName", ",", "dataName", ",", "picPairs", ")", ":", "if", "decoderName", "==", "'frame'", ":", "return", "FrameColours", ".", "decoder", "(", "Counts", ",", "stripSpace", ",", "dataName", ")", "elif"...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/minorview/model.py#L407-L418
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py
python
_NNTPBase._putcmd
(self, line)
Internal: send one command to the server (through _putline()). The `line` must be a unicode string.
Internal: send one command to the server (through _putline()). The `line` must be a unicode string.
[ "Internal", ":", "send", "one", "command", "to", "the", "server", "(", "through", "_putline", "()", ")", ".", "The", "line", "must", "be", "a", "unicode", "string", "." ]
def _putcmd(self, line): """Internal: send one command to the server (through _putline()). The `line` must be a unicode string.""" if self.debugging: print('*cmd*', repr(line)) line = line.encode(self.encoding, self.errors) self._putline(line)
[ "def", "_putcmd", "(", "self", ",", "line", ")", ":", "if", "self", ".", "debugging", ":", "print", "(", "'*cmd*'", ",", "repr", "(", "line", ")", ")", "line", "=", "line", ".", "encode", "(", "self", ".", "encoding", ",", "self", ".", "errors", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py#L421-L426
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
python/caffe/io.py
python
array_to_datum
(arr, label=None)
return datum
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
[ "Converts", "a", "3", "-", "dimensional", "array", "to", "datum", ".", "If", "the", "array", "has", "dtype", "uint8", "the", "output", "data", "will", "be", "encoded", "as", "a", "string", ".", "Otherwise", "the", "output", "data", "will", "be", "stored"...
def array_to_datum(arr, label=None): """Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format. """ if arr.ndim != 3: raise ValueError('Incorrect array shape.') datum = ...
[ "def", "array_to_datum", "(", "arr", ",", "label", "=", "None", ")", ":", "if", "arr", ".", "ndim", "!=", "3", ":", "raise", "ValueError", "(", "'Incorrect array shape.'", ")", "datum", "=", "caffe_pb2", ".", "Datum", "(", ")", "datum", ".", "channels", ...
https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/python/caffe/io.py#L66-L81
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/morestats.py
python
shapiro
(x, a=None, reta=False)
Perform the Shapiro-Wilk test for normality. The Shapiro-Wilk test tests the null hypothesis that the data was drawn from a normal distribution. Parameters ---------- x : array_like Array of sample data. a : array_like, optional Array of internal parameters used in the calculat...
Perform the Shapiro-Wilk test for normality.
[ "Perform", "the", "Shapiro", "-", "Wilk", "test", "for", "normality", "." ]
def shapiro(x, a=None, reta=False): """ Perform the Shapiro-Wilk test for normality. The Shapiro-Wilk test tests the null hypothesis that the data was drawn from a normal distribution. Parameters ---------- x : array_like Array of sample data. a : array_like, optional A...
[ "def", "shapiro", "(", "x", ",", "a", "=", "None", ",", "reta", "=", "False", ")", ":", "if", "a", "is", "not", "None", "or", "reta", ":", "warnings", ".", "warn", "(", "\"input parameters 'a' and 'reta' are scheduled to be \"", "\"removed in version 0.18.0\"", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/morestats.py#L1247-L1334
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/difflib.py
python
HtmlDiff.make_table
(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5)
return table.replace('\0+','<span class="diff_add">'). \ replace('\0-','<span class="diff_sub">'). \ replace('\0^','<span class="diff_chg">'). \ replace('\1','</span>'). \ replace('\t','&nbsp;')
Returns HTML table of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file column header string todesc -- "to" file column header string context -- set to True for contextual dif...
Returns HTML table of side by side comparison with change highlights
[ "Returns", "HTML", "table", "of", "side", "by", "side", "comparison", "with", "change", "highlights" ]
def make_table(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5): """Returns HTML table of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file c...
[ "def", "make_table", "(", "self", ",", "fromlines", ",", "tolines", ",", "fromdesc", "=", "''", ",", "todesc", "=", "''", ",", "context", "=", "False", ",", "numlines", "=", "5", ")", ":", "# make unique anchor prefixes so that multiple tables may exist", "# on ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/difflib.py#L1981-L2056
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
TextAttr.HasFontItalic
(*args, **kwargs)
return _controls_.TextAttr_HasFontItalic(*args, **kwargs)
HasFontItalic(self) -> bool
HasFontItalic(self) -> bool
[ "HasFontItalic", "(", "self", ")", "-", ">", "bool" ]
def HasFontItalic(*args, **kwargs): """HasFontItalic(self) -> bool""" return _controls_.TextAttr_HasFontItalic(*args, **kwargs)
[ "def", "HasFontItalic", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_HasFontItalic", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1800-L1802
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Image.GetWidth
(*args, **kwargs)
return _core_.Image_GetWidth(*args, **kwargs)
GetWidth(self) -> int Gets the width of the image in pixels.
GetWidth(self) -> int
[ "GetWidth", "(", "self", ")", "-", ">", "int" ]
def GetWidth(*args, **kwargs): """ GetWidth(self) -> int Gets the width of the image in pixels. """ return _core_.Image_GetWidth(*args, **kwargs)
[ "def", "GetWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Image_GetWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L3266-L3272
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
htmlReadDoc
(cur, URL, encoding, options)
return xmlDoc(_obj=ret)
parse an XML in-memory document and build a tree.
parse an XML in-memory document and build a tree.
[ "parse", "an", "XML", "in", "-", "memory", "document", "and", "build", "a", "tree", "." ]
def htmlReadDoc(cur, URL, encoding, options): """parse an XML in-memory document and build a tree. """ ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options) if ret is None:raise treeError('htmlReadDoc() failed') return xmlDoc(_obj=ret)
[ "def", "htmlReadDoc", "(", "cur", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "htmlReadDoc", "(", "cur", ",", "URL", ",", "encoding", ",", "options", ")", "if", "ret", "is", "None", ":", "raise", "treeError", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L828-L832
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py
python
Context.min
(self, a, b)
return a.min(b, context=self)
min compares two values numerically and returns the minimum. If either operand is a NaN then the general rules apply. Otherwise, the operands are compared as though by the compare operation. If they are numerically equal then the left-hand operand is chosen as the result. Otherwise th...
min compares two values numerically and returns the minimum.
[ "min", "compares", "two", "values", "numerically", "and", "returns", "the", "minimum", "." ]
def min(self, a, b): """min compares two values numerically and returns the minimum. If either operand is a NaN then the general rules apply. Otherwise, the operands are compared as though by the compare operation. If they are numerically equal then the left-hand operand is cho...
[ "def", "min", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "min", "(", "b", ",", "context", "=", "self", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L4706-L4731
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
Layer.SetSpatialFilterRect
(self, *args)
return _ogr.Layer_SetSpatialFilterRect(self, *args)
r""" SetSpatialFilterRect(Layer self, double minx, double miny, double maxx, double maxy) SetSpatialFilterRect(Layer self, int iGeomField, double minx, double miny, double maxx, double maxy) void OGR_L_SetSpatialFilterRect(OGRLayerH hLayer, double dfMinX, double dfMinY, double df...
r""" SetSpatialFilterRect(Layer self, double minx, double miny, double maxx, double maxy) SetSpatialFilterRect(Layer self, int iGeomField, double minx, double miny, double maxx, double maxy) void OGR_L_SetSpatialFilterRect(OGRLayerH hLayer, double dfMinX, double dfMinY, double df...
[ "r", "SetSpatialFilterRect", "(", "Layer", "self", "double", "minx", "double", "miny", "double", "maxx", "double", "maxy", ")", "SetSpatialFilterRect", "(", "Layer", "self", "int", "iGeomField", "double", "minx", "double", "miny", "double", "maxx", "double", "ma...
def SetSpatialFilterRect(self, *args): r""" SetSpatialFilterRect(Layer self, double minx, double miny, double maxx, double maxy) SetSpatialFilterRect(Layer self, int iGeomField, double minx, double miny, double maxx, double maxy) void OGR_L_SetSpatialFilterRect(OGRLayerH hLayer, ...
[ "def", "SetSpatialFilterRect", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "Layer_SetSpatialFilterRect", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L1079-L1118
MtnViewJohn/context-free
757d7bde9742f201cec61bd195dda98093edd1e8
src-scintilla/scripts/FileGenerator.py
python
Regenerate
(filename, commentPrefix, *lists)
Regenerate the given file.
Regenerate the given file.
[ "Regenerate", "the", "given", "file", "." ]
def Regenerate(filename, commentPrefix, *lists): """Regenerate the given file. """ Generate(filename, filename, commentPrefix, *lists)
[ "def", "Regenerate", "(", "filename", ",", "commentPrefix", ",", "*", "lists", ")", ":", "Generate", "(", "filename", ",", "filename", ",", "commentPrefix", ",", "*", "lists", ")" ]
https://github.com/MtnViewJohn/context-free/blob/757d7bde9742f201cec61bd195dda98093edd1e8/src-scintilla/scripts/FileGenerator.py#L135-L138
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
PyPreviewFrame._setCallbackInfo
(*args, **kwargs)
return _windows_.PyPreviewFrame__setCallbackInfo(*args, **kwargs)
_setCallbackInfo(self, PyObject self, PyObject _class)
_setCallbackInfo(self, PyObject self, PyObject _class)
[ "_setCallbackInfo", "(", "self", "PyObject", "self", "PyObject", "_class", ")" ]
def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(self, PyObject self, PyObject _class)""" return _windows_.PyPreviewFrame__setCallbackInfo(*args, **kwargs)
[ "def", "_setCallbackInfo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyPreviewFrame__setCallbackInfo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L5744-L5746
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Scrollbar.get
(self)
return self._getdoubles(self.tk.call(self._w, 'get'))
Return the current fractional values (upper and lower end) of the slider position.
Return the current fractional values (upper and lower end) of the slider position.
[ "Return", "the", "current", "fractional", "values", "(", "upper", "and", "lower", "end", ")", "of", "the", "slider", "position", "." ]
def get(self): """Return the current fractional values (upper and lower end) of the slider position.""" return self._getdoubles(self.tk.call(self._w, 'get'))
[ "def", "get", "(", "self", ")", ":", "return", "self", ".", "_getdoubles", "(", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'get'", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2853-L2856
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
.ci/openvino-onnx/watchdog/src/git_wrapper.py
python
GitWrapper._get_pull_requests
(self)
return self.git.get_organization(self.repository).get_repo(self.project).get_pulls()
Private method retrieving pull requests from GitHub. :return: Paginated list of Pull Requests in GitHub repo :rtype: github.PaginatedList.PaginatedList of github.PullRequest.PullRequest
Private method retrieving pull requests from GitHub.
[ "Private", "method", "retrieving", "pull", "requests", "from", "GitHub", "." ]
def _get_pull_requests(self): """Private method retrieving pull requests from GitHub. :return: Paginated list of Pull Requests in GitHub repo :rtype: github.PaginatedList.PaginatedList of github.PullRequest.PullRequest """ return self.git.g...
[ "def", "_get_pull_requests", "(", "self", ")", ":", "return", "self", ".", "git", ".", "get_organization", "(", "self", ".", "repository", ")", ".", "get_repo", "(", "self", ".", "project", ")", ".", "get_pulls", "(", ")" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/.ci/openvino-onnx/watchdog/src/git_wrapper.py#L91-L97
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/meta/generator/parse.py
python
FastParser.p_float
(self, p)
float : FLOATLITERAL
float : FLOATLITERAL
[ "float", ":", "FLOATLITERAL" ]
def p_float(self, p): "float : FLOATLITERAL" p[0] = {"FloatLiteral": p[1][:-1]}
[ "def", "p_float", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "{", "\"FloatLiteral\"", ":", "p", "[", "1", "]", "[", ":", "-", "1", "]", "}" ]
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/parse.py#L276-L278
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/tensor_array_ops.py
python
TensorArray.flow
(self)
return self._flow
The flow `Tensor` forcing ops leading to this TensorArray state.
The flow `Tensor` forcing ops leading to this TensorArray state.
[ "The", "flow", "Tensor", "forcing", "ops", "leading", "to", "this", "TensorArray", "state", "." ]
def flow(self): """The flow `Tensor` forcing ops leading to this TensorArray state.""" return self._flow
[ "def", "flow", "(", "self", ")", ":", "return", "self", ".", "_flow" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/tensor_array_ops.py#L150-L152
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/variables.py
python
local_variables
(scope=None)
return ops.get_collection(ops.GraphKeys.LOCAL_VARIABLES, scope)
Returns local variables. Local variables - per process variables, usually not saved/restored to checkpoint and used for temporary or intermediate values. For example, they can be used as counters for metrics computation or number of epochs this machine has read data. The `tf.contrib.framework.local_variable(...
Returns local variables.
[ "Returns", "local", "variables", "." ]
def local_variables(scope=None): """Returns local variables. Local variables - per process variables, usually not saved/restored to checkpoint and used for temporary or intermediate values. For example, they can be used as counters for metrics computation or number of epochs this machine has read data. The...
[ "def", "local_variables", "(", "scope", "=", "None", ")", ":", "return", "ops", ".", "get_collection", "(", "ops", ".", "GraphKeys", ".", "LOCAL_VARIABLES", ",", "scope", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/variables.py#L3164-L3188
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/kernels/transpose.py
python
transpose
(a, b=None)
return b
Compute the transpose of 'a' and store it into 'b', if given, and return it. If 'b' is not given, allocate a new array and return that. This implements the algorithm documented in http://devblogs.nvidia.com/parallelforall/efficient-matrix-transpose-cuda-cc/ :param a: an `np.ndarray` or a `DeviceND...
Compute the transpose of 'a' and store it into 'b', if given, and return it. If 'b' is not given, allocate a new array and return that.
[ "Compute", "the", "transpose", "of", "a", "and", "store", "it", "into", "b", "if", "given", "and", "return", "it", ".", "If", "b", "is", "not", "given", "allocate", "a", "new", "array", "and", "return", "that", "." ]
def transpose(a, b=None): """Compute the transpose of 'a' and store it into 'b', if given, and return it. If 'b' is not given, allocate a new array and return that. This implements the algorithm documented in http://devblogs.nvidia.com/parallelforall/efficient-matrix-transpose-cuda-cc/ :param ...
[ "def", "transpose", "(", "a", ",", "b", "=", "None", ")", ":", "# prefer `a`'s stream if", "stream", "=", "getattr", "(", "a", ",", "'stream'", ",", "0", ")", "if", "not", "b", ":", "cols", ",", "rows", "=", "a", ".", "shape", "strides", "=", "a", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/kernels/transpose.py#L6-L65
tinyobjloader/tinyobjloader
8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93
deps/cpplint.py
python
CheckParenthesisSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing around parentheses.
[ "Checks", "for", "horizontal", "spacing", "around", "parentheses", "." ]
def CheckParenthesisSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call wit...
[ "def", "CheckParenthesisSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# No spaces after an if, while, switch, or for", "match", "=", "Search", "(", "r' (if\\(|f...
https://github.com/tinyobjloader/tinyobjloader/blob/8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93/deps/cpplint.py#L3242-L3277
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py
python
basename
(p)
return split(p)[1]
Returns the final component of a pathname
Returns the final component of a pathname
[ "Returns", "the", "final", "component", "of", "a", "pathname" ]
def basename(p): """Returns the final component of a pathname""" return split(p)[1]
[ "def", "basename", "(", "p", ")", ":", "return", "split", "(", "p", ")", "[", "1", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py#L212-L214
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
doorbell/python/iot_doorbell/hardware/grove.py
python
GroveBoard.detect_touch
(self)
return self.touch.isPressed()
Detect touch state.
Detect touch state.
[ "Detect", "touch", "state", "." ]
def detect_touch(self): """ Detect touch state. """ return self.touch.isPressed()
[ "def", "detect_touch", "(", "self", ")", ":", "return", "self", ".", "touch", ".", "isPressed", "(", ")" ]
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/doorbell/python/iot_doorbell/hardware/grove.py#L78-L84
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py
python
SinglePtIntegrationTable.set_peak_height
(self, scan_number, pt_number, peak_height, roi_name)
return
set the intensity of single measurement from the counts on the detector. In the view as 3D peak, it is the cut on the center plane as the peak shape can be modeled by 3D Gaussian. Thus the integrated value is used as the Gaussian's height. :param scan_number: :param pt_number: :p...
set the intensity of single measurement from the counts on the detector. In the view as 3D peak, it is the cut on the center plane as the peak shape can be modeled by 3D Gaussian. Thus the integrated value is used as the Gaussian's height. :param scan_number: :param pt_number: :p...
[ "set", "the", "intensity", "of", "single", "measurement", "from", "the", "counts", "on", "the", "detector", ".", "In", "the", "view", "as", "3D", "peak", "it", "is", "the", "cut", "on", "the", "center", "plane", "as", "the", "peak", "shape", "can", "be...
def set_peak_height(self, scan_number, pt_number, peak_height, roi_name): """ set the intensity of single measurement from the counts on the detector. In the view as 3D peak, it is the cut on the center plane as the peak shape can be modeled by 3D Gaussian. Thus the integrated value is used as t...
[ "def", "set_peak_height", "(", "self", ",", "scan_number", ",", "pt_number", ",", "peak_height", ",", "roi_name", ")", ":", "row_number", "=", "self", ".", "_pt_row_dict", "[", "scan_number", ",", "pt_number", "]", "self", ".", "update_cell_value", "(", "row_n...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L1650-L1665
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
MacPrefixHeader.GetInclude
(self, lang, arch=None)
Gets the cflags to include the prefix header for language |lang|.
Gets the cflags to include the prefix header for language |lang|.
[ "Gets", "the", "cflags", "to", "include", "the", "prefix", "header", "for", "language", "|lang|", "." ]
def GetInclude(self, lang, arch=None): """Gets the cflags to include the prefix header for language |lang|.""" if self.compile_headers and lang in self.compiled_headers: return "-include %s" % self._CompiledHeader(lang, arch) elif self.header: return "-include %s" % self....
[ "def", "GetInclude", "(", "self", ",", "lang", ",", "arch", "=", "None", ")", ":", "if", "self", ".", "compile_headers", "and", "lang", "in", "self", ".", "compiled_headers", ":", "return", "\"-include %s\"", "%", "self", ".", "_CompiledHeader", "(", "lang...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L1435-L1442
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/ops.py
python
_assert_same_graph
(original_item, item)
Fail if the 2 items are from different graphs. Args: original_item: Original item to check against. item: Item to check. Raises: ValueError: if graphs do not match.
Fail if the 2 items are from different graphs.
[ "Fail", "if", "the", "2", "items", "are", "from", "different", "graphs", "." ]
def _assert_same_graph(original_item, item): """Fail if the 2 items are from different graphs. Args: original_item: Original item to check against. item: Item to check. Raises: ValueError: if graphs do not match. """ if original_item.graph is not item.graph: raise ValueError( "%s mus...
[ "def", "_assert_same_graph", "(", "original_item", ",", "item", ")", ":", "if", "original_item", ".", "graph", "is", "not", "item", ".", "graph", ":", "raise", "ValueError", "(", "\"%s must be from the same graph as %s.\"", "%", "(", "item", ",", "original_item", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L3754-L3766
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.update_node_aux_icon
(self, tree_iter)
Set Aux Icon to node
Set Aux Icon to node
[ "Set", "Aux", "Icon", "to", "node" ]
def update_node_aux_icon(self, tree_iter): """Set Aux Icon to node""" node_id = self.get_node_id_from_tree_iter(tree_iter) is_bookmarked = str(node_id) in self.bookmarks is_ro = self.get_node_read_only(tree_iter) if is_bookmarked and is_ro: stock_id = "lockpin" ...
[ "def", "update_node_aux_icon", "(", "self", ",", "tree_iter", ")", ":", "node_id", "=", "self", ".", "get_node_id_from_tree_iter", "(", "tree_iter", ")", "is_bookmarked", "=", "str", "(", "node_id", ")", "in", "self", ".", "bookmarks", "is_ro", "=", "self", ...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L5199-L5212
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
python/pyarrow/types.py
python
is_duration
(t)
return t.id == lib.Type_DURATION
Return True if value is an instance of a duration type. Parameters ---------- t : DataType
Return True if value is an instance of a duration type.
[ "Return", "True", "if", "value", "is", "an", "instance", "of", "a", "duration", "type", "." ]
def is_duration(t): """ Return True if value is an instance of a duration type. Parameters ---------- t : DataType """ return t.id == lib.Type_DURATION
[ "def", "is_duration", "(", "t", ")", ":", "return", "t", ".", "id", "==", "lib", ".", "Type_DURATION" ]
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/python/pyarrow/types.py#L321-L329
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env_example.py
python
ResetPoseExample
(log_path=None)
An example that the minitaur stands still using the reset pose.
An example that the minitaur stands still using the reset pose.
[ "An", "example", "that", "the", "minitaur", "stands", "still", "using", "the", "reset", "pose", "." ]
def ResetPoseExample(log_path=None): """An example that the minitaur stands still using the reset pose.""" steps = 10000 environment = minitaur_gym_env.MinitaurGymEnv( urdf_version=minitaur_gym_env.DERPY_V0_URDF_VERSION, render=True, leg_model_enabled=False, motor_velocity_limit=np.inf, ...
[ "def", "ResetPoseExample", "(", "log_path", "=", "None", ")", ":", "steps", "=", "10000", "environment", "=", "minitaur_gym_env", ".", "MinitaurGymEnv", "(", "urdf_version", "=", "minitaur_gym_env", ".", "DERPY_V0_URDF_VERSION", ",", "render", "=", "True", ",", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env_example.py#L46-L64
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py
python
SConsInteractiveCmd.do_shell
(self, argv)
\ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms.
\ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms.
[ "\\", "shell", "[", "COMMANDLINE", "]", "Execute", "COMMANDLINE", "in", "a", "subshell", ".", "sh", "and", "!", "are", "synonyms", "." ]
def do_shell(self, argv): """\ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms. """ import subprocess argv = argv[1:] if not argv: argv = os.environ[self.shell_variable] try: ...
[ "def", "do_shell", "(", "self", ",", "argv", ")", ":", "import", "subprocess", "argv", "=", "argv", "[", "1", ":", "]", "if", "not", "argv", ":", "argv", "=", "os", ".", "environ", "[", "self", ".", "shell_variable", "]", "try", ":", "# Per \"[Python...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py#L339-L357
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/text_format.py
python
Tokenizer.ConsumeIdentifierOrNumber
(self)
return result
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Consumes protocol message field identifier.
[ "Consumes", "protocol", "message", "field", "identifier", "." ]
def ConsumeIdentifierOrNumber(self): """Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed. """ result = self.token if not self._IDENTIFIER_OR_NUMBER.match(result): raise self.ParseError('Expected ...
[ "def", "ConsumeIdentifierOrNumber", "(", "self", ")", ":", "result", "=", "self", ".", "token", "if", "not", "self", ".", "_IDENTIFIER_OR_NUMBER", ".", "match", "(", "result", ")", ":", "raise", "self", ".", "ParseError", "(", "'Expected identifier or number, go...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/text_format.py#L1368-L1381
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
addon-sdk/source/python-lib/mozrunner/__init__.py
python
Profile.clean_addons
(self)
Cleans up addons in the profile.
Cleans up addons in the profile.
[ "Cleans", "up", "addons", "in", "the", "profile", "." ]
def clean_addons(self): """Cleans up addons in the profile.""" for addon in self.addons_installed: if os.path.isdir(addon): rmtree(addon)
[ "def", "clean_addons", "(", "self", ")", ":", "for", "addon", "in", "self", ".", "addons_installed", ":", "if", "os", ".", "path", ".", "isdir", "(", "addon", ")", ":", "rmtree", "(", "addon", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/addon-sdk/source/python-lib/mozrunner/__init__.py#L298-L302
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewIndexListModel.Reset
(*args, **kwargs)
return _dataview.DataViewIndexListModel_Reset(*args, **kwargs)
Reset(self, unsigned int new_size) Call this if the data has to be read again from the model. This is useful after major changes when calling methods like `RowChanged` or `RowDeleted` (possibly thousands of times) doesn't make sense.
Reset(self, unsigned int new_size)
[ "Reset", "(", "self", "unsigned", "int", "new_size", ")" ]
def Reset(*args, **kwargs): """ Reset(self, unsigned int new_size) Call this if the data has to be read again from the model. This is useful after major changes when calling methods like `RowChanged` or `RowDeleted` (possibly thousands of times) doesn't make sense. """ ...
[ "def", "Reset", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewIndexListModel_Reset", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L900-L908
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/examples/imagenet_trainer.py
python
AddNullInput
(model, reader, batch_size, img_size, dtype)
The null input function uses a gaussian fill operator to emulate real image input. A label blob is hardcoded to a single value. This is useful if you want to test compute throughput or don't have a dataset available.
The null input function uses a gaussian fill operator to emulate real image input. A label blob is hardcoded to a single value. This is useful if you want to test compute throughput or don't have a dataset available.
[ "The", "null", "input", "function", "uses", "a", "gaussian", "fill", "operator", "to", "emulate", "real", "image", "input", ".", "A", "label", "blob", "is", "hardcoded", "to", "a", "single", "value", ".", "This", "is", "useful", "if", "you", "want", "to"...
def AddNullInput(model, reader, batch_size, img_size, dtype): ''' The null input function uses a gaussian fill operator to emulate real image input. A label blob is hardcoded to a single value. This is useful if you want to test compute throughput or don't have a dataset available. ''' suffix = ...
[ "def", "AddNullInput", "(", "model", ",", "reader", ",", "batch_size", ",", "img_size", ",", "dtype", ")", ":", "suffix", "=", "\"_fp16\"", "if", "dtype", "==", "\"float16\"", "else", "\"\"", "model", ".", "param_init_net", ".", "GaussianFill", "(", "[", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/examples/imagenet_trainer.py#L82-L103
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/command_parser.py
python
parse_indices
(indices_string)
return [int(element) for element in indices_string.split(",")]
Parse a string representing indices. For example, if the input is "[1, 2, 3]", the return value will be a list of indices: [1, 2, 3] Args: indices_string: (str) a string representing indices. Can optionally be surrounded by a pair of brackets. Returns: (list of int): Parsed indices.
Parse a string representing indices.
[ "Parse", "a", "string", "representing", "indices", "." ]
def parse_indices(indices_string): """Parse a string representing indices. For example, if the input is "[1, 2, 3]", the return value will be a list of indices: [1, 2, 3] Args: indices_string: (str) a string representing indices. Can optionally be surrounded by a pair of brackets. Returns: (l...
[ "def", "parse_indices", "(", "indices_string", ")", ":", "# Strip whitespace.", "indices_string", "=", "re", ".", "sub", "(", "r\"\\s+\"", ",", "\"\"", ",", "indices_string", ")", "# Strip any brackets at the two ends.", "if", "indices_string", ".", "startswith", "(",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/command_parser.py#L219-L240
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteMacBundleResources
(self, resources, bundle_depends)
Writes ninja edges for 'mac_bundle_resources'.
Writes ninja edges for 'mac_bundle_resources'.
[ "Writes", "ninja", "edges", "for", "mac_bundle_resources", "." ]
def WriteMacBundleResources(self, resources, bundle_depends): """Writes ninja edges for 'mac_bundle_resources'.""" for output, res in gyp.xcode_emulation.GetMacBundleResources( self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), self.xcode_settings, map(self.GypPathToNinja, resources...
[ "def", "WriteMacBundleResources", "(", "self", ",", "resources", ",", "bundle_depends", ")", ":", "for", "output", ",", "res", "in", "gyp", ".", "xcode_emulation", ".", "GetMacBundleResources", "(", "self", ".", "ExpandSpecial", "(", "generator_default_variables", ...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py#L677-L684
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/tags.py
python
sys_tags
(*, warn: bool = False)
Returns the sequence of tag triples for the running interpreter. The order of the sequence corresponds to priority order for the interpreter, from most to least important.
Returns the sequence of tag triples for the running interpreter.
[ "Returns", "the", "sequence", "of", "tag", "triples", "for", "the", "running", "interpreter", "." ]
def sys_tags(*, warn: bool = False) -> Iterator[Tag]: """ Returns the sequence of tag triples for the running interpreter. The order of the sequence corresponds to priority order for the interpreter, from most to least important. """ interp_name = interpreter_name() if interp_name == "cp":...
[ "def", "sys_tags", "(", "*", ",", "warn", ":", "bool", "=", "False", ")", "->", "Iterator", "[", "Tag", "]", ":", "interp_name", "=", "interpreter_name", "(", ")", "if", "interp_name", "==", "\"cp\"", ":", "yield", "from", "cpython_tags", "(", "warn", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/tags.py#L470-L484
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
HashedCategoricalColumn.name
(self)
return self.key
See `FeatureColumn` base class.
See `FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def name(self): """See `FeatureColumn` base class.""" return self.key
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "key" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L3467-L3469
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py
python
TypeRef.name
(self)
return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self))
Get type name
Get type name
[ "Get", "type", "name" ]
def name(self): """ Get type name """ return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self))
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "ret_string", "(", "ffi", ".", "lib", ".", "LLVMPY_GetTypeName", "(", "self", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py#L50-L54
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/calldef.py
python
calldef_t.overloads
(self)
return self.parent.calldefs( name=self.name, function=lambda decl: decl is not self, allow_empty=True, recursive=False)
A list of overloaded "callables" (i.e. other callables with the same name within the same scope. @type: list of :class:`calldef_t`
A list of overloaded "callables" (i.e. other callables with the same name within the same scope.
[ "A", "list", "of", "overloaded", "callables", "(", "i", ".", "e", ".", "other", "callables", "with", "the", "same", "name", "within", "the", "same", "scope", "." ]
def overloads(self): """A list of overloaded "callables" (i.e. other callables with the same name within the same scope. @type: list of :class:`calldef_t` """ if not self.parent: return [] # finding all functions with the same name return self.parent....
[ "def", "overloads", "(", "self", ")", ":", "if", "not", "self", ".", "parent", ":", "return", "[", "]", "# finding all functions with the same name", "return", "self", ".", "parent", ".", "calldefs", "(", "name", "=", "self", ".", "name", ",", "function", ...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/calldef.py#L278-L291
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py
python
_is_cert
(item)
return CoreFoundation.CFGetTypeID(item) == expected
Returns True if a given CFTypeRef is a certificate.
Returns True if a given CFTypeRef is a certificate.
[ "Returns", "True", "if", "a", "given", "CFTypeRef", "is", "a", "certificate", "." ]
def _is_cert(item): """ Returns True if a given CFTypeRef is a certificate. """ expected = Security.SecCertificateGetTypeID() return CoreFoundation.CFGetTypeID(item) == expected
[ "def", "_is_cert", "(", "item", ")", ":", "expected", "=", "Security", ".", "SecCertificateGetTypeID", "(", ")", "return", "CoreFoundation", ".", "CFGetTypeID", "(", "item", ")", "==", "expected" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py#L195-L200
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/trajectory.py
python
SE3Trajectory.to_se3
(self,state)
return (state[:9],state[9:])
Converts a state parameter vector to a klampt.se3 element
Converts a state parameter vector to a klampt.se3 element
[ "Converts", "a", "state", "parameter", "vector", "to", "a", "klampt", ".", "se3", "element" ]
def to_se3(self,state): """Converts a state parameter vector to a klampt.se3 element""" return (state[:9],state[9:])
[ "def", "to_se3", "(", "self", ",", "state", ")", ":", "return", "(", "state", "[", ":", "9", "]", ",", "state", "[", "9", ":", "]", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/trajectory.py#L682-L684
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
python
DependencyGraphNode._LinkDependenciesInternal
(self, targets, include_shared_libraries, dependencies=None, initial=True)
return dependencies
Returns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of |initial|. Outside callers should always leave |initial| at its default setting. When adding a target to the list of dependencies, this function will ...
Returns an OrderedSet of dependency targets that are linked into this target.
[ "Returns", "an", "OrderedSet", "of", "dependency", "targets", "that", "are", "linked", "into", "this", "target", "." ]
def _LinkDependenciesInternal(self, targets, include_shared_libraries, dependencies=None, initial=True): """Returns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of |initial|. Outsid...
[ "def", "_LinkDependenciesInternal", "(", "self", ",", "targets", ",", "include_shared_libraries", ",", "dependencies", "=", "None", ",", "initial", "=", "True", ")", ":", "if", "dependencies", "is", "None", ":", "# Using a list to get ordered output and a set to do fast...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py#L1687-L1771
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/shortcuteditor.py
python
ShortcutEditor.ToMenuBar
(self, topWindow)
Dumps the entire shortcut hierarchy (for shortcuts associated with a :class:`MenuItem`), into a :class:`MenuBar`, changing only the :class:`Menu` / :class:`MenuItem` labels (it does **not** rebuild the :class:`MenuBar`). :param `topWindow`: an instance of :class:`TopLevelWindow`, containing the...
Dumps the entire shortcut hierarchy (for shortcuts associated with a :class:`MenuItem`), into a :class:`MenuBar`, changing only the :class:`Menu` / :class:`MenuItem` labels (it does **not** rebuild the :class:`MenuBar`).
[ "Dumps", "the", "entire", "shortcut", "hierarchy", "(", "for", "shortcuts", "associated", "with", "a", ":", "class", ":", "MenuItem", ")", "into", "a", ":", "class", ":", "MenuBar", "changing", "only", "the", ":", "class", ":", "Menu", "/", ":", "class",...
def ToMenuBar(self, topWindow): """ Dumps the entire shortcut hierarchy (for shortcuts associated with a :class:`MenuItem`), into a :class:`MenuBar`, changing only the :class:`Menu` / :class:`MenuItem` labels (it does **not** rebuild the :class:`MenuBar`). :param `topWindow`: an...
[ "def", "ToMenuBar", "(", "self", ",", "topWindow", ")", ":", "def", "MenuItemSet", "(", "shortcut", ",", "menuBar", ")", ":", "child", ",", "cookie", "=", "shortcut", ".", "GetFirstChild", "(", "shortcut", ")", "while", "child", ":", "child", ".", "ToMen...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shortcuteditor.py#L2370-L2392
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
SimRobotController.setPIDCommand
(self, *args)
return _robotsim.SimRobotController_setPIDCommand(self, *args)
setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes) setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes, doubleVector tfeedforward) Sets a PID command controller. If tfeedforward is provided, it is the feedforward torque vector.
setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes) setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes, doubleVector tfeedforward)
[ "setPIDCommand", "(", "SimRobotController", "self", "doubleVector", "qdes", "doubleVector", "dqdes", ")", "setPIDCommand", "(", "SimRobotController", "self", "doubleVector", "qdes", "doubleVector", "dqdes", "doubleVector", "tfeedforward", ")" ]
def setPIDCommand(self, *args): """ setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes) setPIDCommand(SimRobotController self, doubleVector qdes, doubleVector dqdes, doubleVector tfeedforward) Sets a PID command controller. If tfeedforward is provided, it is ...
[ "def", "setPIDCommand", "(", "self", ",", "*", "args", ")", ":", "return", "_robotsim", ".", "SimRobotController_setPIDCommand", "(", "self", ",", "*", "args", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7729-L7740
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py
python
BackgroundCorrectionsView.set_slot_for_show_fit_output_clicked
(self, slot)
Sets the slot for when the 'Show Output' is clicked.
Sets the slot for when the 'Show Output' is clicked.
[ "Sets", "the", "slot", "for", "when", "the", "Show", "Output", "is", "clicked", "." ]
def set_slot_for_show_fit_output_clicked(self, slot) -> None: """Sets the slot for when the 'Show Output' is clicked.""" self.handle_show_fit_output_clicked = slot
[ "def", "set_slot_for_show_fit_output_clicked", "(", "self", ",", "slot", ")", "->", "None", ":", "self", ".", "handle_show_fit_output_clicked", "=", "slot" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py#L109-L111
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/config.py
python
DictConfigurator.configure_handler
(self, config)
return result
Configure a handler from a dictionary.
Configure a handler from a dictionary.
[ "Configure", "a", "handler", "from", "a", "dictionary", "." ]
def configure_handler(self, config): """Configure a handler from a dictionary.""" formatter = config.pop('formatter', None) if formatter: try: formatter = self.config['formatters'][formatter] except StandardError, e: raise ValueError('Unabl...
[ "def", "configure_handler", "(", "self", ",", "config", ")", ":", "formatter", "=", "config", ".", "pop", "(", "'formatter'", ",", "None", ")", "if", "formatter", ":", "try", ":", "formatter", "=", "self", ".", "config", "[", "'formatters'", "]", "[", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/config.py#L702-L758
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
TimeSpan.Format
(*args, **kwargs)
return _misc_.TimeSpan_Format(*args, **kwargs)
Format(self, String format=DefaultTimeSpanFormat) -> String
Format(self, String format=DefaultTimeSpanFormat) -> String
[ "Format", "(", "self", "String", "format", "=", "DefaultTimeSpanFormat", ")", "-", ">", "String" ]
def Format(*args, **kwargs): """Format(self, String format=DefaultTimeSpanFormat) -> String""" return _misc_.TimeSpan_Format(*args, **kwargs)
[ "def", "Format", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TimeSpan_Format", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4538-L4540
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/base_layer_v1.py
python
Layer.call
(self, inputs, **kwargs)
return inputs
This is where the layer's logic lives. Args: inputs: Input tensor, or list/tuple of input tensors. **kwargs: Additional keyword arguments. Returns: A tensor or list/tuple of tensors.
This is where the layer's logic lives.
[ "This", "is", "where", "the", "layer", "s", "logic", "lives", "." ]
def call(self, inputs, **kwargs): # pylint: disable=unused-argument """This is where the layer's logic lives. Args: inputs: Input tensor, or list/tuple of input tensors. **kwargs: Additional keyword arguments. Returns: A tensor or list/tuple of tensors. """ return inputs
[ "def", "call", "(", "self", ",", "inputs", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "return", "inputs" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/base_layer_v1.py#L281-L291
baidu/AnyQ
d94d450d2aaa5f7ed73424b10aa4539835b97527
tools/simnet/preprocess/operation_unit.py
python
OpWriteData._get_pairwise_lines
(self, dataset, setname)
pairwise data generator
pairwise data generator
[ "pairwise", "data", "generator" ]
def _get_pairwise_lines(self, dataset, setname): """ pairwise data generator """ for (qid, oo_list) in dataset: if setname == 'train': pos_titles = [] neg_titles = [] for oo in oo_list: infos = oo.get_infos...
[ "def", "_get_pairwise_lines", "(", "self", ",", "dataset", ",", "setname", ")", ":", "for", "(", "qid", ",", "oo_list", ")", "in", "dataset", ":", "if", "setname", "==", "'train'", ":", "pos_titles", "=", "[", "]", "neg_titles", "=", "[", "]", "for", ...
https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/preprocess/operation_unit.py#L255-L284
vusec/vuzzer64
2b1b0ed757a3dca114db0192fa4ab1add92348bc
fuzzer-code/runfuzzer.py
python
form_bitvector
(bbdict)
This function forms bit vector for each trace and append them to config.TEMPTRACE list.
This function forms bit vector for each trace and append them to config.TEMPTRACE list.
[ "This", "function", "forms", "bit", "vector", "for", "each", "trace", "and", "append", "them", "to", "config", ".", "TEMPTRACE", "list", "." ]
def form_bitvector(bbdict): ''' This function forms bit vector for each trace and append them to config.TEMPTRACE list. ''' newbb=0 temp=set() for bbadr in bbdict: temp.add(bbadr) if bbadr not in config.BBSEENVECTOR: #added for bit vector formation newbb ...
[ "def", "form_bitvector", "(", "bbdict", ")", ":", "newbb", "=", "0", "temp", "=", "set", "(", ")", "for", "bbadr", "in", "bbdict", ":", "temp", ".", "add", "(", "bbadr", ")", "if", "bbadr", "not", "in", "config", ".", "BBSEENVECTOR", ":", "#added for...
https://github.com/vusec/vuzzer64/blob/2b1b0ed757a3dca114db0192fa4ab1add92348bc/fuzzer-code/runfuzzer.py#L94-L116
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/clustering/dbscan.py
python
DBSCANModel.__repr__
(self)
return out + "\n" + out2
Print a string description of the model when the model name is entered in the terminal.
Print a string description of the model when the model name is entered in the terminal.
[ "Print", "a", "string", "description", "of", "the", "model", "when", "the", "model", "name", "is", "entered", "in", "the", "terminal", "." ]
def __repr__(self): """ Print a string description of the model when the model name is entered in the terminal. """ width = 40 sections, section_titles = self._get_summary_struct() accessible_fields = { "cluster_id": "Cluster label for each row in the...
[ "def", "__repr__", "(", "self", ")", ":", "width", "=", "40", "sections", ",", "section_titles", "=", "self", ".", "_get_summary_struct", "(", ")", "accessible_fields", "=", "{", "\"cluster_id\"", ":", "\"Cluster label for each row in the input dataset.\"", "}", "ou...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/clustering/dbscan.py#L390-L404
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/tyr/tyr/tasks.py
python
import_in_mimir
(_file, instance, asynchronous=True)
Import pt data stops to autocomplete
Import pt data stops to autocomplete
[ "Import", "pt", "data", "stops", "to", "autocomplete" ]
def import_in_mimir(_file, instance, asynchronous=True): """ Import pt data stops to autocomplete """ datatype, _ = utils.type_of_data(_file) family_type = utils.family_of_data(datatype) current_app.logger.debug("Import {} data to mimir".format(family_type)) actions = [] for version in...
[ "def", "import_in_mimir", "(", "_file", ",", "instance", ",", "asynchronous", "=", "True", ")", ":", "datatype", ",", "_", "=", "utils", ".", "type_of_data", "(", "_file", ")", "family_type", "=", "utils", ".", "family_of_data", "(", "datatype", ")", "curr...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/tyr/tyr/tasks.py#L397-L426
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
media/tools/constrained_network_server/cns.py
python
ParseArgs
()
return options
Define and parse the command-line arguments.
Define and parse the command-line arguments.
[ "Define", "and", "parse", "the", "command", "-", "line", "arguments", "." ]
def ParseArgs(): """Define and parse the command-line arguments.""" parser = optparse.OptionParser() parser.add_option('--expiry-time', type='int', default=_DEFAULT_PORT_EXPIRY_TIME_SECS, help=('Number of seconds before constrained ports expire ' ...
[ "def", "ParseArgs", "(", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "'--expiry-time'", ",", "type", "=", "'int'", ",", "default", "=", "_DEFAULT_PORT_EXPIRY_TIME_SECS", ",", "help", "=", "(", "'Numbe...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/media/tools/constrained_network_server/cns.py#L354-L409
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/graphics.py
python
GraphicsContext.SetTransform
(self, matrix)
Set the context's current transformation matrix to matrix.
Set the context's current transformation matrix to matrix.
[ "Set", "the", "context", "s", "current", "transformation", "matrix", "to", "matrix", "." ]
def SetTransform(self, matrix): """ Set the context's current transformation matrix to matrix. """ self._context.set_matrix(matrix.GetNativeMatrix())
[ "def", "SetTransform", "(", "self", ",", "matrix", ")", ":", "self", ".", "_context", ".", "set_matrix", "(", "matrix", ".", "GetNativeMatrix", "(", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/graphics.py#L1226-L1230
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/commands/undistort.py
python
undistort_image
(shot, undistorted_shots, original, interpolation, max_size)
Undistort an image into a set of undistorted ones. Args: shot: the distorted shot undistorted_shots: the set of undistorted shots covering the distorted shot field of view. That is 1 for most camera types and 6 for equirectangular cameras. original: the original dist...
Undistort an image into a set of undistorted ones.
[ "Undistort", "an", "image", "into", "a", "set", "of", "undistorted", "ones", "." ]
def undistort_image(shot, undistorted_shots, original, interpolation, max_size): """Undistort an image into a set of undistorted ones. Args: shot: the distorted shot undistorted_shots: the set of undistorted shots covering the distorted shot field of view. That i...
[ "def", "undistort_image", "(", "shot", ",", "undistorted_shots", ",", "original", ",", "interpolation", ",", "max_size", ")", ":", "if", "original", "is", "None", ":", "return", "projection_type", "=", "shot", ".", "camera", ".", "projection_type", "if", "proj...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/commands/undistort.py#L111-L153
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py2/more_itertools/more.py
python
with_iter
(context_manager)
Wrap an iterable in a ``with`` statement, so it closes once exhausted. For example, this will close the file when the iterator is exhausted:: upper_lines = (line.upper() for line in with_iter(open('foo'))) Any context manager which returns an iterable is a candidate for ``with_iter``.
Wrap an iterable in a ``with`` statement, so it closes once exhausted.
[ "Wrap", "an", "iterable", "in", "a", "with", "statement", "so", "it", "closes", "once", "exhausted", "." ]
def with_iter(context_manager): """Wrap an iterable in a ``with`` statement, so it closes once exhausted. For example, this will close the file when the iterator is exhausted:: upper_lines = (line.upper() for line in with_iter(open('foo'))) Any context manager which returns an iterable is a candi...
[ "def", "with_iter", "(", "context_manager", ")", ":", "with", "context_manager", "as", "iterable", ":", "for", "item", "in", "iterable", ":", "yield", "item" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py2/more_itertools/more.py#L466-L479
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/filters.py
python
do_indent
(s, width=4, indentfirst=False)
return rv
Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter: .. sourcecode:: jinja {{ mytext|indent(2, true) }} indent by...
Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter:
[ "Return", "a", "copy", "of", "the", "passed", "string", "each", "line", "indented", "by", "4", "spaces", ".", "The", "first", "line", "is", "not", "indented", ".", "If", "you", "want", "to", "change", "the", "number", "of", "spaces", "or", "indent", "t...
def do_indent(s, width=4, indentfirst=False): """Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter: .. sourcecode:: jinja ...
[ "def", "do_indent", "(", "s", ",", "width", "=", "4", ",", "indentfirst", "=", "False", ")", ":", "indention", "=", "u' '", "*", "width", "rv", "=", "(", "u'\\n'", "+", "indention", ")", ".", "join", "(", "s", ".", "splitlines", "(", ")", ")", "i...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/filters.py#L430-L445