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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Cursor.referenced | (self) | return self._referenced | For a cursor that is a reference, returns a cursor
representing the entity that it references. | For a cursor that is a reference, returns a cursor
representing the entity that it references. | [
"For",
"a",
"cursor",
"that",
"is",
"a",
"reference",
"returns",
"a",
"cursor",
"representing",
"the",
"entity",
"that",
"it",
"references",
"."
] | def referenced(self):
"""
For a cursor that is a reference, returns a cursor
representing the entity that it references.
"""
if not hasattr(self, '_referenced'):
self._referenced = conf.lib.clang_getCursorReferenced(self)
return self._referenced | [
"def",
"referenced",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_referenced'",
")",
":",
"self",
".",
"_referenced",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorReferenced",
"(",
"self",
")",
"return",
"self",
".",
"_referenced"
] | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1452-L1460 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | CursorKind.is_attribute | (self) | return conf.lib.clang_isAttribute(self) | Test if this is an attribute kind. | Test if this is an attribute kind. | [
"Test",
"if",
"this",
"is",
"an",
"attribute",
"kind",
"."
] | def is_attribute(self):
"""Test if this is an attribute kind."""
return conf.lib.clang_isAttribute(self) | [
"def",
"is_attribute",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isAttribute",
"(",
"self",
")"
] | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L535-L537 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/main.py | python | main | (_) | Eager execution workflow with RevNet trained on CIFAR-10. | Eager execution workflow with RevNet trained on CIFAR-10. | [
"Eager",
"execution",
"workflow",
"with",
"RevNet",
"trained",
"on",
"CIFAR",
"-",
"10",
"."
] | def main(_):
"""Eager execution workflow with RevNet trained on CIFAR-10."""
tf.enable_eager_execution()
config = get_config(config_name=FLAGS.config, dataset=FLAGS.dataset)
ds_train, ds_train_one_shot, ds_validation, ds_test = get_datasets(
data_dir=FLAGS.data_dir, config=config)
model = revnet.RevNet... | [
"def",
"main",
"(",
"_",
")",
":",
"tf",
".",
"enable_eager_execution",
"(",
")",
"config",
"=",
"get_config",
"(",
"config_name",
"=",
"FLAGS",
".",
"config",
",",
"dataset",
"=",
"FLAGS",
".",
"dataset",
")",
"ds_train",
",",
"ds_train_one_shot",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/main.py#L37-L107 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlDocument.GetRoot | (*args, **kwargs) | return _xrc.XmlDocument_GetRoot(*args, **kwargs) | GetRoot(self) -> XmlNode | GetRoot(self) -> XmlNode | [
"GetRoot",
"(",
"self",
")",
"-",
">",
"XmlNode"
] | def GetRoot(*args, **kwargs):
"""GetRoot(self) -> XmlNode"""
return _xrc.XmlDocument_GetRoot(*args, **kwargs) | [
"def",
"GetRoot",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlDocument_GetRoot",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L535-L537 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | hasher-matcher-actioner/hmalib/matchers/filters.py | python | BankActiveFilter.get_bank_active | (self, bank_member_id: str) | return self.get_bank_active_internal(
member.bank_id, time.time() // BANK_CACHE_TIME_SECONDS
) | Is the bank active? Use the bank_member_id to get an answer. Note
bank_id -> active is cached, but bank_member_id -> bank_id is not. | Is the bank active? Use the bank_member_id to get an answer. Note
bank_id -> active is cached, but bank_member_id -> bank_id is not. | [
"Is",
"the",
"bank",
"active?",
"Use",
"the",
"bank_member_id",
"to",
"get",
"an",
"answer",
".",
"Note",
"bank_id",
"-",
">",
"active",
"is",
"cached",
"but",
"bank_member_id",
"-",
">",
"bank_id",
"is",
"not",
"."
] | def get_bank_active(self, bank_member_id: str) -> bool:
"""
Is the bank active? Use the bank_member_id to get an answer. Note
bank_id -> active is cached, but bank_member_id -> bank_id is not.
"""
member = self.get_bank_member_internal(
bank_member_id, time.time() // ... | [
"def",
"get_bank_active",
"(",
"self",
",",
"bank_member_id",
":",
"str",
")",
"->",
"bool",
":",
"member",
"=",
"self",
".",
"get_bank_member_internal",
"(",
"bank_member_id",
",",
"time",
".",
"time",
"(",
")",
"//",
"BANK_CACHE_TIME_SECONDS",
")",
"return",... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/matchers/filters.py#L288-L298 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/encoder.py | python | _ModifiedEncoder | (wire_type, encode_value, compute_value_size, modify_value) | return SpecificEncoder | Like SimpleEncoder but additionally invokes modify_value on every value
before passing it to encode_value. Usually modify_value is ZigZagEncode. | Like SimpleEncoder but additionally invokes modify_value on every value
before passing it to encode_value. Usually modify_value is ZigZagEncode. | [
"Like",
"SimpleEncoder",
"but",
"additionally",
"invokes",
"modify_value",
"on",
"every",
"value",
"before",
"passing",
"it",
"to",
"encode_value",
".",
"Usually",
"modify_value",
"is",
"ZigZagEncode",
"."
] | def _ModifiedEncoder(wire_type, encode_value, compute_value_size, modify_value):
"""Like SimpleEncoder but additionally invokes modify_value on every value
before passing it to encode_value. Usually modify_value is ZigZagEncode."""
def SpecificEncoder(field_number, is_repeated, is_packed):
if is_packed:
... | [
"def",
"_ModifiedEncoder",
"(",
"wire_type",
",",
"encode_value",
",",
"compute_value_size",
",",
"modify_value",
")",
":",
"def",
"SpecificEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"if",
"is_packed",
":",
"tag_bytes",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/encoder.py#L472-L503 | |
tkn-tub/ns3-gym | 19bfe0a583e641142609939a090a09dfc63a095f | src/visualizer/visualizer/svgitem.py | python | SvgItem._size_changed | (self) | !
Size Changed function
@param self this object
@return exception if unknown property | !
Size Changed function | [
"!",
"Size",
"Changed",
"function"
] | def _size_changed(self):
"""!
Size Changed function
@param self this object
@return exception if unknown property
"""
if self.custom_width is None and self.custom_height is None:
self.width = self.handle.props.width
self.height = self.handle.props.... | [
"def",
"_size_changed",
"(",
"self",
")",
":",
"if",
"self",
".",
"custom_width",
"is",
"None",
"and",
"self",
".",
"custom_height",
"is",
"None",
":",
"self",
".",
"width",
"=",
"self",
".",
"handle",
".",
"props",
".",
"width",
"self",
".",
"height",... | https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/src/visualizer/visualizer/svgitem.py#L125-L150 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | BuildInfoBase.__setstate__ | (self, state) | Restore the attributes from a pickled state. | Restore the attributes from a pickled state. | [
"Restore",
"the",
"attributes",
"from",
"a",
"pickled",
"state",
"."
] | def __setstate__(self, state):
"""
Restore the attributes from a pickled state.
"""
# TODO check or discard version
del state['_version_id']
for key, value in state.items():
if key not in ('__weakref__',):
setattr(self, key, value) | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"# TODO check or discard version",
"del",
"state",
"[",
"'_version_id'",
"]",
"for",
"key",
",",
"value",
"in",
"state",
".",
"items",
"(",
")",
":",
"if",
"key",
"not",
"in",
"(",
"'__weakref__'"... | 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/Node/__init__.py#L480-L488 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/lang/directives.py | python | set_loop_options | (
parallel_iterations=UNSPECIFIED,
swap_memory=UNSPECIFIED,
maximum_iterations=UNSPECIFIED,
shape_invariants=UNSPECIFIED) | Specifies additional arguments to be passed to the enclosing while_loop.
The parameters apply to and only to the immediately enclosing loop. It only
has effect if the loop is staged as a TF while_loop; otherwise the parameters
have no effect.
Usage:
>>> @tf.function(autograph=True)
... def f():
.... | Specifies additional arguments to be passed to the enclosing while_loop. | [
"Specifies",
"additional",
"arguments",
"to",
"be",
"passed",
"to",
"the",
"enclosing",
"while_loop",
"."
] | def set_loop_options(
parallel_iterations=UNSPECIFIED,
swap_memory=UNSPECIFIED,
maximum_iterations=UNSPECIFIED,
shape_invariants=UNSPECIFIED):
"""Specifies additional arguments to be passed to the enclosing while_loop.
The parameters apply to and only to the immediately enclosing loop. It only
ha... | [
"def",
"set_loop_options",
"(",
"parallel_iterations",
"=",
"UNSPECIFIED",
",",
"swap_memory",
"=",
"UNSPECIFIED",
",",
"maximum_iterations",
"=",
"UNSPECIFIED",
",",
"shape_invariants",
"=",
"UNSPECIFIED",
")",
":",
"del",
"parallel_iterations",
"del",
"swap_memory",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/lang/directives.py#L46-L94 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py | python | to_filename | (name) | return name.replace('-', '_') | Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'. | Convert a project or version name to its filename-escaped form | [
"Convert",
"a",
"project",
"or",
"version",
"name",
"to",
"its",
"filename",
"-",
"escaped",
"form"
] | def to_filename(name):
"""Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'.
"""
return name.replace('-', '_') | [
"def",
"to_filename",
"(",
"name",
")",
":",
"return",
"name",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L1344-L1349 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/pipeline.py | python | Pipeline.predict_proba | (self, X) | return self.steps[-1][-1].predict_proba(Xt) | Apply transforms, and predict_proba of the final estimator
Parameters
----------
X : iterable
Data to predict on. Must fulfill input requirements of first step
of the pipeline.
Returns
-------
y_proba : array-like, shape = [n_samples, n_classes] | Apply transforms, and predict_proba of the final estimator | [
"Apply",
"transforms",
"and",
"predict_proba",
"of",
"the",
"final",
"estimator"
] | def predict_proba(self, X):
"""Apply transforms, and predict_proba of the final estimator
Parameters
----------
X : iterable
Data to predict on. Must fulfill input requirements of first step
of the pipeline.
Returns
-------
y_proba : arra... | [
"def",
"predict_proba",
"(",
"self",
",",
"X",
")",
":",
"Xt",
"=",
"X",
"for",
"name",
",",
"transform",
"in",
"self",
".",
"steps",
"[",
":",
"-",
"1",
"]",
":",
"if",
"transform",
"is",
"not",
"None",
":",
"Xt",
"=",
"transform",
".",
"transfo... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/pipeline.py#L360-L377 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/__init__.py | python | Handler.acquire | (self) | Acquire the I/O thread lock. | Acquire the I/O thread lock. | [
"Acquire",
"the",
"I",
"/",
"O",
"thread",
"lock",
"."
] | def acquire(self):
"""
Acquire the I/O thread lock.
"""
if self.lock:
self.lock.acquire() | [
"def",
"acquire",
"(",
"self",
")",
":",
"if",
"self",
".",
"lock",
":",
"self",
".",
"lock",
".",
"acquire",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L896-L901 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | abs | (x, out=None, **kwargs) | return _pure_unary_func_helper(x, _api_internal.abs, _np.abs, out=out, **kwargs) | r"""
Calculate the absolute value element-wise.
Parameters
----------
x : ndarray or scalar
Input array.
out : ndarray or None, optional
A location into which the result is stored. If provided, it must have
a shape that the inputs broadcast to. If not provided or `None`,
... | r"""
Calculate the absolute value element-wise. | [
"r",
"Calculate",
"the",
"absolute",
"value",
"element",
"-",
"wise",
"."
] | def abs(x, out=None, **kwargs):
r"""
Calculate the absolute value element-wise.
Parameters
----------
x : ndarray or scalar
Input array.
out : ndarray or None, optional
A location into which the result is stored. If provided, it must have
a shape that the inputs broadcas... | [
"def",
"abs",
"(",
"x",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_pure_unary_func_helper",
"(",
"x",
",",
"_api_internal",
".",
"abs",
",",
"_np",
".",
"abs",
",",
"out",
"=",
"out",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L2831-L2856 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.gt | (self, other, axis="columns", level=None, fill_value=None) | return self._binaryop(
other=other, fn="gt", fill_value=fill_value, can_reindex=True
) | Greater than, element-wise (binary operator gt).
Parameters
----------
other : Series or scalar value
fill_value : None or value
Value to fill nulls with before computation. If data in both
corresponding Series locations is null the result will be null
R... | Greater than, element-wise (binary operator gt). | [
"Greater",
"than",
"element",
"-",
"wise",
"(",
"binary",
"operator",
"gt",
")",
"."
] | def gt(self, other, axis="columns", level=None, fill_value=None):
"""Greater than, element-wise (binary operator gt).
Parameters
----------
other : Series or scalar value
fill_value : None or value
Value to fill nulls with before computation. If data in both
... | [
"def",
"gt",
"(",
"self",
",",
"other",
",",
"axis",
"=",
"\"columns\"",
",",
"level",
"=",
"None",
",",
"fill_value",
"=",
"None",
")",
":",
"# noqa: E501",
"return",
"self",
".",
"_binaryop",
"(",
"other",
"=",
"other",
",",
"fn",
"=",
"\"gt\"",
",... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L6306-L6379 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Config.set_compatibility_check | (check_status) | Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading the bindings. This check
will throw an exception,... | Perform compatibility check when loading libclang | [
"Perform",
"compatibility",
"check",
"when",
"loading",
"libclang"
] | def set_compatibility_check(check_status):
""" Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading th... | [
"def",
"set_compatibility_check",
"(",
"check_status",
")",
":",
"if",
"Config",
".",
"loaded",
":",
"raise",
"Exception",
"(",
"\"compatibility_check must be set before before \"",
"\"using any other functionalities in libclang.\"",
")",
"Config",
".",
"compatibility_check",
... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L3334-L3355 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/filesystem.py | python | MDSCluster.set_inter_mds_block | (self, blocked, mds_rank_1, mds_rank_2) | Block (using iptables) communications from a provided MDS to other MDSs.
Block all ports that an MDS uses for communication.
:param blocked: True to block the MDS, False otherwise
:param mds_rank_1: MDS rank
:param mds_rank_2: MDS rank
:return: | Block (using iptables) communications from a provided MDS to other MDSs.
Block all ports that an MDS uses for communication. | [
"Block",
"(",
"using",
"iptables",
")",
"communications",
"from",
"a",
"provided",
"MDS",
"to",
"other",
"MDSs",
".",
"Block",
"all",
"ports",
"that",
"an",
"MDS",
"uses",
"for",
"communication",
"."
] | def set_inter_mds_block(self, blocked, mds_rank_1, mds_rank_2):
"""
Block (using iptables) communications from a provided MDS to other MDSs.
Block all ports that an MDS uses for communication.
:param blocked: True to block the MDS, False otherwise
:param mds_rank_1: MDS rank
... | [
"def",
"set_inter_mds_block",
"(",
"self",
",",
"blocked",
",",
"mds_rank_1",
",",
"mds_rank_2",
")",
":",
"da_flag",
"=",
"\"-A\"",
"if",
"blocked",
"else",
"\"-D\"",
"def",
"set_block",
"(",
"mds_ids",
")",
":",
"status",
"=",
"self",
".",
"status",
"(",... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/filesystem.py#L421-L458 | ||
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | build/fbcode_builder/getdeps/dyndeps.py | python | DepBase.strip_debug_info | (self, objfile) | override this to define how to remove debug information
from an object file | override this to define how to remove debug information
from an object file | [
"override",
"this",
"to",
"define",
"how",
"to",
"remove",
"debug",
"information",
"from",
"an",
"object",
"file"
] | def strip_debug_info(self, objfile):
"""override this to define how to remove debug information
from an object file"""
pass | [
"def",
"strip_debug_info",
"(",
"self",
",",
"objfile",
")",
":",
"pass"
] | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/build/fbcode_builder/getdeps/dyndeps.py#L148-L151 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/impl/statistics.py | python | ConnectionStatisticsLogger.sendStatistics | (self, subscriber_statistics_logger) | Send out statistics. Aggregate collected stats information.
Currently done blocking. Might be moved to own thread later. But at the moment
any computation done here should be rather quick. | Send out statistics. Aggregate collected stats information. | [
"Send",
"out",
"statistics",
".",
"Aggregate",
"collected",
"stats",
"information",
"."
] | def sendStatistics(self, subscriber_statistics_logger):
"""
Send out statistics. Aggregate collected stats information.
Currently done blocking. Might be moved to own thread later. But at the moment
any computation done here should be rather quick.
"""
curtime = rospy.Ti... | [
"def",
"sendStatistics",
"(",
"self",
",",
"subscriber_statistics_logger",
")",
":",
"curtime",
"=",
"rospy",
".",
"Time",
".",
"now",
"(",
")",
"msg",
"=",
"TopicStatistics",
"(",
")",
"msg",
".",
"topic",
"=",
"self",
".",
"topic",
"msg",
".",
"node_su... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/statistics.py#L162-L223 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Tools/MakeAppTools.py | python | replaceTemplate | (dirName, oldName, newName) | modify contents from dirName and below, replace oldName by newName | modify contents from dirName and below, replace oldName by newName | [
"modify",
"contents",
"from",
"dirName",
"and",
"below",
"replace",
"oldName",
"by",
"newName"
] | def replaceTemplate(dirName, oldName, newName):
"""
modify contents from dirName and below, replace oldName by newName
"""
for file in os.listdir(dirName):
pathName = os.path.join(dirName, file)
if not os.path.isdir(pathName):
try:
print(pathName)
... | [
"def",
"replaceTemplate",
"(",
"dirName",
",",
"oldName",
",",
"newName",
")",
":",
"for",
"file",
"in",
"os",
".",
"listdir",
"(",
"dirName",
")",
":",
"pathName",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dirName",
",",
"file",
")",
"if",
"not",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/MakeAppTools.py#L5-L31 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathAdaptive.py | python | PathAdaptive.opFeatures | (self, obj) | return (
PathOp.FeatureTool
| PathOp.FeatureBaseEdges
| PathOp.FeatureDepths
| PathOp.FeatureFinishDepth
| PathOp.FeatureStepDown
| PathOp.FeatureHeights
| PathOp.FeatureBaseGeometry
| PathOp.FeatureCoolant
| Pat... | opFeatures(obj) ... returns the OR'ed list of features used and supported by the operation.
The default implementation returns "FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint"
Should be overwritten by subclasses. | opFeatures(obj) ... returns the OR'ed list of features used and supported by the operation.
The default implementation returns "FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint"
Should be overwritten by subclasses. | [
"opFeatures",
"(",
"obj",
")",
"...",
"returns",
"the",
"OR",
"ed",
"list",
"of",
"features",
"used",
"and",
"supported",
"by",
"the",
"operation",
".",
"The",
"default",
"implementation",
"returns",
"FeatureTool",
"|",
"FeatureDepths",
"|",
"FeatureHeights",
... | def opFeatures(self, obj):
"""opFeatures(obj) ... returns the OR'ed list of features used and supported by the operation.
The default implementation returns "FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint"
Should be overwritten by subclasses."""
return (
Pat... | [
"def",
"opFeatures",
"(",
"self",
",",
"obj",
")",
":",
"return",
"(",
"PathOp",
".",
"FeatureTool",
"|",
"PathOp",
".",
"FeatureBaseEdges",
"|",
"PathOp",
".",
"FeatureDepths",
"|",
"PathOp",
".",
"FeatureFinishDepth",
"|",
"PathOp",
".",
"FeatureStepDown",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathAdaptive.py#L888-L902 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/Debugger.py | python | StackViewer.fill_menu | (self) | override base method | override base method | [
"override",
"base",
"method"
] | def fill_menu(self):
"override base method"
menu = self.menu
menu.add_command(label="Go to source line",
command=self.goto_source_line)
menu.add_command(label="Show stack frame",
command=self.show_stack_frame) | [
"def",
"fill_menu",
"(",
"self",
")",
":",
"menu",
"=",
"self",
".",
"menu",
"menu",
".",
"add_command",
"(",
"label",
"=",
"\"Go to source line\"",
",",
"command",
"=",
"self",
".",
"goto_source_line",
")",
"menu",
".",
"add_command",
"(",
"label",
"=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/Debugger.py#L369-L375 | ||
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | Rule.hash | (self) | return '' | Hash value. | Hash value. | [
"Hash",
"value",
"."
] | def hash(self):
"""Hash value."""
return '' | [
"def",
"hash",
"(",
"self",
")",
":",
"return",
"''"
] | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L3449-L3451 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mhlib.py | python | Folder.getlast | (self) | return self.last | Return the last message number. | Return the last message number. | [
"Return",
"the",
"last",
"message",
"number",
"."
] | def getlast(self):
"""Return the last message number."""
if not hasattr(self, 'last'):
self.listmessages() # Set self.last
return self.last | [
"def",
"getlast",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'last'",
")",
":",
"self",
".",
"listmessages",
"(",
")",
"# Set self.last",
"return",
"self",
".",
"last"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mhlib.py#L649-L653 | |
DanielSWolf/rhubarb-lip-sync | 5cface0af3b6e4e58c0b829c51561d784fb9f52f | rhubarb/lib/pocketsphinx-rev13216/doc/doxy2swig.py | python | Doxy2SWIG.get_specific_nodes | (self, node, names) | return dict(nodes) | Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name. | Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name. | [
"Given",
"a",
"node",
"and",
"a",
"sequence",
"of",
"strings",
"in",
"names",
"return",
"a",
"dictionary",
"containing",
"the",
"names",
"as",
"keys",
"and",
"child",
"ELEMENT_NODEs",
"that",
"have",
"a",
"tagName",
"equal",
"to",
"the",
"name",
"."
] | def get_specific_nodes(self, node, names):
"""Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name.
"""
nodes = [(x.tagName, x) for x in node.childNodes \
... | [
"def",
"get_specific_nodes",
"(",
"self",
",",
"node",
",",
"names",
")",
":",
"nodes",
"=",
"[",
"(",
"x",
".",
"tagName",
",",
"x",
")",
"for",
"x",
"in",
"node",
".",
"childNodes",
"if",
"x",
".",
"nodeType",
"==",
"x",
".",
"ELEMENT_NODE",
"and... | https://github.com/DanielSWolf/rhubarb-lip-sync/blob/5cface0af3b6e4e58c0b829c51561d784fb9f52f/rhubarb/lib/pocketsphinx-rev13216/doc/doxy2swig.py#L169-L178 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiToolBar.OnLeftDown | (self, event) | Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`AuiToolBar`.
:param `event`: a :class:`MouseEvent` event to be processed. | Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`AuiToolBar`. | [
"Handles",
"the",
"wx",
".",
"EVT_LEFT_DOWN",
"event",
"for",
":",
"class",
":",
"AuiToolBar",
"."
] | def OnLeftDown(self, event):
"""
Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`AuiToolBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
"""
cli_rect = wx.RectPS(wx.Point(0, 0), self.GetClientSize())
self.StopPreviewTimer()
... | [
"def",
"OnLeftDown",
"(",
"self",
",",
"event",
")",
":",
"cli_rect",
"=",
"wx",
".",
"RectPS",
"(",
"wx",
".",
"Point",
"(",
"0",
",",
"0",
")",
",",
"self",
".",
"GetClientSize",
"(",
")",
")",
"self",
".",
"StopPreviewTimer",
"(",
")",
"if",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L3518-L3633 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/bdb.py | python | set_trace | () | Start debugging with a Bdb instance from the caller's frame. | Start debugging with a Bdb instance from the caller's frame. | [
"Start",
"debugging",
"with",
"a",
"Bdb",
"instance",
"from",
"the",
"caller",
"s",
"frame",
"."
] | def set_trace():
"""Start debugging with a Bdb instance from the caller's frame."""
Bdb().set_trace() | [
"def",
"set_trace",
"(",
")",
":",
"Bdb",
"(",
")",
".",
"set_trace",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/bdb.py#L642-L644 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | plugin/opencv/opencv.py | python | fixed_crop | (src, x0, y0, w, h, size=None, interpolation=cv2.INTER_CUBIC) | return out | Crop src at fixed location, and (optionally) resize it to size | Crop src at fixed location, and (optionally) resize it to size | [
"Crop",
"src",
"at",
"fixed",
"location",
"and",
"(",
"optionally",
")",
"resize",
"it",
"to",
"size"
] | def fixed_crop(src, x0, y0, w, h, size=None, interpolation=cv2.INTER_CUBIC):
"""Crop src at fixed location, and (optionally) resize it to size"""
out = mx.nd.crop(src, begin=(y0, x0, 0), end=(y0+h, x0+w, int(src.shape[2])))
if size is not None and (w, h) != size:
out = resize(out, size, interpolatio... | [
"def",
"fixed_crop",
"(",
"src",
",",
"x0",
",",
"y0",
",",
"w",
",",
"h",
",",
"size",
"=",
"None",
",",
"interpolation",
"=",
"cv2",
".",
"INTER_CUBIC",
")",
":",
"out",
"=",
"mx",
".",
"nd",
".",
"crop",
"(",
"src",
",",
"begin",
"=",
"(",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/plugin/opencv/opencv.py#L107-L112 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/models.py | python | Response.json | (self, **kwargs) | return complexjson.loads(self.text, **kwargs) | r"""Returns the json-encoded content of a response, if any.
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
:raises ValueError: If the response body does not contain valid json. | r"""Returns the json-encoded content of a response, if any. | [
"r",
"Returns",
"the",
"json",
"-",
"encoded",
"content",
"of",
"a",
"response",
"if",
"any",
"."
] | def json(self, **kwargs):
r"""Returns the json-encoded content of a response, if any.
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
:raises ValueError: If the response body does not contain valid json.
"""
if not self.encoding and self.content and len(self.co... | [
"def",
"json",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"encoding",
"and",
"self",
".",
"content",
"and",
"len",
"(",
"self",
".",
"content",
")",
">",
"3",
":",
"# No encoding set. JSON RFC 4627 section 3 states we should ex... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/models.py#L876-L900 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mox3/mox3/mox.py | python | IgnoreArg.equals | (self, unused_rhs) | return True | Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True | Ignores arguments and returns True. | [
"Ignores",
"arguments",
"and",
"returns",
"True",
"."
] | def equals(self, unused_rhs):
"""Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True
"""
return True | [
"def",
"equals",
"(",
"self",
",",
"unused_rhs",
")",
":",
"return",
"True"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L1861-L1871 | |
asLody/whale | 6a661b27cc4cf83b7b5a3b02451597ee1ac7f264 | whale/cpplint.py | python | IsOutOfLineMethodDefinition | (clean_lines, linenum) | return False | Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition. | Check if current line contains an out-of-line method definition. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"out",
"-",
"of",
"-",
"line",
"method",
"definition",
"."
] | def IsOutOfLineMethodDefinition(clean_lines, linenum):
"""Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition... | [
"def",
"IsOutOfLineMethodDefinition",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
"... | https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L4955-L4968 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py | python | FS.Entry | (self, name, directory = None, create = 1) | return self._lookup(name, directory, Entry, create) | Look up or create a generic Entry node with the specified name.
If the name is a relative path (begins with ./, ../, or a file
name), then it is looked up relative to the supplied directory
node, or to the top level directory of the FS (supplied at
construction time) if no directory is s... | Look up or create a generic Entry node with the specified name.
If the name is a relative path (begins with ./, ../, or a file
name), then it is looked up relative to the supplied directory
node, or to the top level directory of the FS (supplied at
construction time) if no directory is s... | [
"Look",
"up",
"or",
"create",
"a",
"generic",
"Entry",
"node",
"with",
"the",
"specified",
"name",
".",
"If",
"the",
"name",
"is",
"a",
"relative",
"path",
"(",
"begins",
"with",
".",
"/",
"..",
"/",
"or",
"a",
"file",
"name",
")",
"then",
"it",
"i... | def Entry(self, name, directory = None, create = 1):
"""Look up or create a generic Entry node with the specified name.
If the name is a relative path (begins with ./, ../, or a file
name), then it is looked up relative to the supplied directory
node, or to the top level directory of the... | [
"def",
"Entry",
"(",
"self",
",",
"name",
",",
"directory",
"=",
"None",
",",
"create",
"=",
"1",
")",
":",
"return",
"self",
".",
"_lookup",
"(",
"name",
",",
"directory",
",",
"Entry",
",",
"create",
")"
] | 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/Node/FS.py#L1394-L1401 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/server2/availability_finder.py | python | AvailabilityFinder._GetApiSchemaFilename | (self, api_name, file_system, version) | return None | Gets the name of the file which may contain the schema for |api_name| in
|file_system|, or None if the API is not found. Note that this may be the
single _EXTENSION_API file which all APIs share in older versions of Chrome,
in which case it is unknown whether the API actually exists there. | Gets the name of the file which may contain the schema for |api_name| in
|file_system|, or None if the API is not found. Note that this may be the
single _EXTENSION_API file which all APIs share in older versions of Chrome,
in which case it is unknown whether the API actually exists there. | [
"Gets",
"the",
"name",
"of",
"the",
"file",
"which",
"may",
"contain",
"the",
"schema",
"for",
"|api_name|",
"in",
"|file_system|",
"or",
"None",
"if",
"the",
"API",
"is",
"not",
"found",
".",
"Note",
"that",
"this",
"may",
"be",
"the",
"single",
"_EXTEN... | def _GetApiSchemaFilename(self, api_name, file_system, version):
'''Gets the name of the file which may contain the schema for |api_name| in
|file_system|, or None if the API is not found. Note that this may be the
single _EXTENSION_API file which all APIs share in older versions of Chrome,
in which cas... | [
"def",
"_GetApiSchemaFilename",
"(",
"self",
",",
"api_name",
",",
"file_system",
",",
"version",
")",
":",
"def",
"under_api_path",
"(",
"path",
")",
":",
"return",
"API",
"+",
"path",
"if",
"version",
"==",
"'trunk'",
"or",
"version",
">",
"_ORIGINAL_FEATU... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/availability_finder.py#L92-L115 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/__init__.py | python | Client.sign | (self, uri, http_method='GET', body=None, headers=None, realm=None) | return uri, headers, body | Sign a request
Signs an HTTP request with the specified parts.
Returns a 3-tuple of the signed request's URI, headers, and body.
Note that http_method is not returned as it is unaffected by the OAuth
signing process. Also worth noting is that duplicate parameters
will be includ... | Sign a request | [
"Sign",
"a",
"request"
] | def sign(self, uri, http_method='GET', body=None, headers=None, realm=None):
"""Sign a request
Signs an HTTP request with the specified parts.
Returns a 3-tuple of the signed request's URI, headers, and body.
Note that http_method is not returned as it is unaffected by the OAuth
... | [
"def",
"sign",
"(",
"self",
",",
"uri",
",",
"http_method",
"=",
"'GET'",
",",
"body",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"realm",
"=",
"None",
")",
":",
"# normalize request data",
"request",
"=",
"Request",
"(",
"uri",
",",
"http_method",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/__init__.py#L226-L328 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py | python | FlagValues.AppendFlagsIntoFile | (self, filename) | Appends all flags assignments from this FlagInfo object to a file.
Output will be in the format of a flagfile.
NOTE: MUST mirror the behavior of the C++ AppendFlagsIntoFile
from http://code.google.com/p/google-gflags | Appends all flags assignments from this FlagInfo object to a file. | [
"Appends",
"all",
"flags",
"assignments",
"from",
"this",
"FlagInfo",
"object",
"to",
"a",
"file",
"."
] | def AppendFlagsIntoFile(self, filename):
"""Appends all flags assignments from this FlagInfo object to a file.
Output will be in the format of a flagfile.
NOTE: MUST mirror the behavior of the C++ AppendFlagsIntoFile
from http://code.google.com/p/google-gflags
"""
out_file = open(filename, 'a'... | [
"def",
"AppendFlagsIntoFile",
"(",
"self",
",",
"filename",
")",
":",
"out_file",
"=",
"open",
"(",
"filename",
",",
"'a'",
")",
"out_file",
".",
"write",
"(",
"self",
".",
"FlagsIntoString",
"(",
")",
")",
"out_file",
".",
"close",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L1690-L1700 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_logsoftmax | (node, **kwargs) | return nodes | Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node. | Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node. | [
"Map",
"MXNet",
"s",
"log_softmax",
"operator",
"attributes",
"to",
"onnx",
"s",
"LogSoftMax",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_logsoftmax(node, **kwargs):
"""Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node.
"""
from onnx.helper import make_node
name, input_nodes, attrs = get_inputs(node, kwargs)
# Converting to int
axis = int(attrs.get("axis", -1))
... | [
"def",
"convert_logsoftmax",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"# Converting to int",
"axis",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L2503-L2528 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | python/caffe/net_spec.py | python | param_name_dict | () | return dict(zip(param_type_names, param_names)) | Find out the correspondence between layer names and parameter names. | Find out the correspondence between layer names and parameter names. | [
"Find",
"out",
"the",
"correspondence",
"between",
"layer",
"names",
"and",
"parameter",
"names",
"."
] | def param_name_dict():
"""Find out the correspondence between layer names and parameter names."""
layer = caffe_pb2.LayerParameter()
# get all parameter names (typically underscore case) and corresponding
# type names (typically camel case), which contain the layer names
# (note that not all parame... | [
"def",
"param_name_dict",
"(",
")",
":",
"layer",
"=",
"caffe_pb2",
".",
"LayerParameter",
"(",
")",
"# get all parameter names (typically underscore case) and corresponding",
"# type names (typically camel case), which contain the layer names",
"# (note that not all parameters correspon... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/python/caffe/net_spec.py#L28-L40 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py | python | _POTargetFactory.__init__ | ( self, env, nodefault = True, alias = None, precious = True
, noclean = True ) | Object constructor.
**Arguments**
- *env* (`SCons.Environment.Environment`)
- *nodefault* (`boolean`) - if `True`, produced nodes will be ignored
from default target `'.'`
- *alias* (`string`) - if provided, produced nodes will be automatically
added to this alias, and ... | Object constructor. | [
"Object",
"constructor",
"."
] | def __init__( self, env, nodefault = True, alias = None, precious = True
, noclean = True ):
""" Object constructor.
**Arguments**
- *env* (`SCons.Environment.Environment`)
- *nodefault* (`boolean`) - if `True`, produced nodes will be ignored
from default target `'.'`
... | [
"def",
"__init__",
"(",
"self",
",",
"env",
",",
"nodefault",
"=",
"True",
",",
"alias",
"=",
"None",
",",
"precious",
"=",
"True",
",",
"noclean",
"=",
"True",
")",
":",
"self",
".",
"env",
"=",
"env",
"self",
".",
"alias",
"=",
"alias",
"self",
... | 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/GettextCommon.py#L60-L80 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | configure.py | python | symlink_force | (target, link_name) | Force symlink, equivalent of 'ln -sf'.
Args:
target: items to link to.
link_name: name of the link. | Force symlink, equivalent of 'ln -sf'. | [
"Force",
"symlink",
"equivalent",
"of",
"ln",
"-",
"sf",
"."
] | def symlink_force(target, link_name):
"""Force symlink, equivalent of 'ln -sf'.
Args:
target: items to link to.
link_name: name of the link.
"""
try:
os.symlink(target, link_name)
except OSError as e:
if e.errno == errno.EEXIST:
os.remove(link_name)
os.symlink(target, link_name)
... | [
"def",
"symlink_force",
"(",
"target",
",",
"link_name",
")",
":",
"try",
":",
"os",
".",
"symlink",
"(",
"target",
",",
"link_name",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"EEXIST",
":",
"os",
".",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/configure.py#L77-L91 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/evaluate/pep0484.py | python | infer_return_types | (function_context) | return _evaluate_for_annotation(module_context, annotation) | Infers the type of a function's return value,
according to type annotations. | Infers the type of a function's return value,
according to type annotations. | [
"Infers",
"the",
"type",
"of",
"a",
"function",
"s",
"return",
"value",
"according",
"to",
"type",
"annotations",
"."
] | def infer_return_types(function_context):
"""
Infers the type of a function's return value,
according to type annotations.
"""
annotation = py__annotations__(function_context.tree_node).get("return", None)
if annotation is None:
# If there is no Python 3-type annotation, look for a Pytho... | [
"def",
"infer_return_types",
"(",
"function_context",
")",
":",
"annotation",
"=",
"py__annotations__",
"(",
"function_context",
".",
"tree_node",
")",
".",
"get",
"(",
"\"return\"",
",",
"None",
")",
"if",
"annotation",
"is",
"None",
":",
"# If there is no Python... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/pep0484.py#L192-L215 | |
mickem/nscp | 79f89fdbb6da63f91bc9dedb7aea202fe938f237 | scripts/python/lib/google/protobuf/descriptor.py | python | Descriptor.CopyToProto | (self, proto) | Copies this to a descriptor_pb2.DescriptorProto.
Args:
proto: An empty descriptor_pb2.DescriptorProto. | Copies this to a descriptor_pb2.DescriptorProto. | [
"Copies",
"this",
"to",
"a",
"descriptor_pb2",
".",
"DescriptorProto",
"."
] | def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.DescriptorProto.
Args:
proto: An empty descriptor_pb2.DescriptorProto.
"""
# This function is overriden to give a better doc comment.
super(Descriptor, self).CopyToProto(proto) | [
"def",
"CopyToProto",
"(",
"self",
",",
"proto",
")",
":",
"# This function is overriden to give a better doc comment.",
"super",
"(",
"Descriptor",
",",
"self",
")",
".",
"CopyToProto",
"(",
"proto",
")"
] | https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/descriptor.py#L253-L260 | ||
vgough/encfs | c444f9b9176beea1ad41a7b2e29ca26e709b57f7 | vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py | python | CheckForIncludeWhatYouUse | (filename, clean_lines, include_state, error,
io=codecs) | Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
reason to include a header. For example, if you use both equal_to<> and
less<> in a .h file, only one (the latter in the ... | Reports for missing stl includes. | [
"Reports",
"for",
"missing",
"stl",
"includes",
"."
] | def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
io=codecs):
"""Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
r... | [
"def",
"CheckForIncludeWhatYouUse",
"(",
"filename",
",",
"clean_lines",
",",
"include_state",
",",
"error",
",",
"io",
"=",
"codecs",
")",
":",
"required",
"=",
"{",
"}",
"# A map of header name to linenumber and the template entity.",
"# Example of required: { '<functiona... | https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L4360-L4450 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/auto_bisect.py | python | _PrintStartedAndFailedBisectJobs | () | return {
'headline': 'Bisect Jobs',
'results': [
_JobsListResult('Failed jobs', failed_jobs),
_JobsListResult('Started jobs', started_jobs),
]
} | Prints started and failed bisect jobs in datastore. | Prints started and failed bisect jobs in datastore. | [
"Prints",
"started",
"and",
"failed",
"bisect",
"jobs",
"in",
"datastore",
"."
] | def _PrintStartedAndFailedBisectJobs():
"""Prints started and failed bisect jobs in datastore."""
failed_jobs = try_job.TryJob.query(
try_job.TryJob.status == 'failed').fetch()
started_jobs = try_job.TryJob.query(
try_job.TryJob.status == 'started').fetch()
failed_jobs.sort(key=lambda b: b.run_count... | [
"def",
"_PrintStartedAndFailedBisectJobs",
"(",
")",
":",
"failed_jobs",
"=",
"try_job",
".",
"TryJob",
".",
"query",
"(",
"try_job",
".",
"TryJob",
".",
"status",
"==",
"'failed'",
")",
".",
"fetch",
"(",
")",
"started_jobs",
"=",
"try_job",
".",
"TryJob",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/auto_bisect.py#L329-L344 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/labelbook.py | python | LabelBook.OnSize | (self, event) | Handles the ``wx.EVT_SIZE`` event for :class:`LabelBook`.
:param `event`: a :class:`SizeEvent` event to be processed. | Handles the ``wx.EVT_SIZE`` event for :class:`LabelBook`. | [
"Handles",
"the",
"wx",
".",
"EVT_SIZE",
"event",
"for",
":",
"class",
":",
"LabelBook",
"."
] | def OnSize(self, event):
"""
Handles the ``wx.EVT_SIZE`` event for :class:`LabelBook`.
:param `event`: a :class:`SizeEvent` event to be processed.
"""
self._pages.Refresh()
event.Skip() | [
"def",
"OnSize",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"_pages",
".",
"Refresh",
"(",
")",
"event",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/labelbook.py#L3021-L3029 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/framework/interfaces/face/utilities.py | python | stream_unary_event | (behavior) | return _MethodImplementation(cardinality.Cardinality.STREAM_UNARY,
style.Service.EVENT, None, None, None, None,
None, None, behavior, None) | Creates an face.MethodImplementation for the given behavior.
Args:
behavior: The implementation of a stream-unary RPC method as a callable
value that takes a response callback to which to pass the response value
of the RPC and an face.ServicerContext and returns a stream.Consumer to
which the r... | Creates an face.MethodImplementation for the given behavior. | [
"Creates",
"an",
"face",
".",
"MethodImplementation",
"for",
"the",
"given",
"behavior",
"."
] | def stream_unary_event(behavior):
"""Creates an face.MethodImplementation for the given behavior.
Args:
behavior: The implementation of a stream-unary RPC method as a callable
value that takes a response callback to which to pass the response value
of the RPC and an face.ServicerContext and retur... | [
"def",
"stream_unary_event",
"(",
"behavior",
")",
":",
"return",
"_MethodImplementation",
"(",
"cardinality",
".",
"Cardinality",
".",
"STREAM_UNARY",
",",
"style",
".",
"Service",
".",
"EVENT",
",",
"None",
",",
"None",
",",
"None",
",",
"None",
",",
"None... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/interfaces/face/utilities.py#L137-L151 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/ltisys.py | python | lti.output | (self, U, T, X0=None) | return lsim(self, U, T, X0=X0) | Return the response of a continuous-time system to input `U`.
See `lsim` for details. | Return the response of a continuous-time system to input `U`.
See `lsim` for details. | [
"Return",
"the",
"response",
"of",
"a",
"continuous",
"-",
"time",
"system",
"to",
"input",
"U",
".",
"See",
"lsim",
"for",
"details",
"."
] | def output(self, U, T, X0=None):
"""
Return the response of a continuous-time system to input `U`.
See `lsim` for details.
"""
return lsim(self, U, T, X0=X0) | [
"def",
"output",
"(",
"self",
",",
"U",
",",
"T",
",",
"X0",
"=",
"None",
")",
":",
"return",
"lsim",
"(",
"self",
",",
"U",
",",
"T",
",",
"X0",
"=",
"X0",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L245-L250 | |
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/gromacsgrofile.py | python | _isfloat | (word) | return match('^[-+]?[0-9]*\.?[0-9]*([eEdD][-+]?[0-9]+)?$',word) | Matches ANY number; it can be a decimal, scientific notation, what have you
CAUTION - this will also match an integer.
@param[in] word String (for instance, '123', '153.0', '2.', '-354')
@return answer Boolean which specifies whether the string is any number | Matches ANY number; it can be a decimal, scientific notation, what have you
CAUTION - this will also match an integer. | [
"Matches",
"ANY",
"number",
";",
"it",
"can",
"be",
"a",
"decimal",
"scientific",
"notation",
"what",
"have",
"you",
"CAUTION",
"-",
"this",
"will",
"also",
"match",
"an",
"integer",
"."
] | def _isfloat(word):
"""Matches ANY number; it can be a decimal, scientific notation, what have you
CAUTION - this will also match an integer.
@param[in] word String (for instance, '123', '153.0', '2.', '-354')
@return answer Boolean which specifies whether the string is any number
"""
return m... | [
"def",
"_isfloat",
"(",
"word",
")",
":",
"return",
"match",
"(",
"'^[-+]?[0-9]*\\.?[0-9]*([eEdD][-+]?[0-9]+)?$'",
",",
"word",
")"
] | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/gromacsgrofile.py#L54-L62 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/python/caffe/pycaffe.py | python | _Net_backward | (self, diffs=None, start=None, end=None, **kwargs) | return {out: self.blobs[out].diff for out in outputs} | Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If None, top diffs are taken from forward loss.
start : optional name of layer at w... | Backward pass: prepare diffs and run the net backward. | [
"Backward",
"pass",
":",
"prepare",
"diffs",
"and",
"run",
"the",
"net",
"backward",
"."
] | def _Net_backward(self, diffs=None, start=None, end=None, **kwargs):
"""
Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If Non... | [
"def",
"_Net_backward",
"(",
"self",
",",
"diffs",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"diffs",
"is",
"None",
":",
"diffs",
"=",
"[",
"]",
"if",
"start",
"is",
"not",
"None",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/python/caffe/pycaffe.py#L137-L182 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBarArt.GetElementSize | (*args, **kwargs) | return _aui.AuiToolBarArt_GetElementSize(*args, **kwargs) | GetElementSize(self, int elementId) -> int | GetElementSize(self, int elementId) -> int | [
"GetElementSize",
"(",
"self",
"int",
"elementId",
")",
"-",
">",
"int"
] | def GetElementSize(*args, **kwargs):
"""GetElementSize(self, int elementId) -> int"""
return _aui.AuiToolBarArt_GetElementSize(*args, **kwargs) | [
"def",
"GetElementSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarArt_GetElementSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1962-L1964 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/util/tf_inspect.py | python | currentframe | () | return _inspect.stack()[1][0] | TFDecorator-aware replacement for inspect.currentframe. | TFDecorator-aware replacement for inspect.currentframe. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"currentframe",
"."
] | def currentframe():
"""TFDecorator-aware replacement for inspect.currentframe."""
return _inspect.stack()[1][0] | [
"def",
"currentframe",
"(",
")",
":",
"return",
"_inspect",
".",
"stack",
"(",
")",
"[",
"1",
"]",
"[",
"0",
"]"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/util/tf_inspect.py#L27-L29 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBProcess.__get_is_alive__ | (self) | return False | Returns "True" if the process is currently alive, "False" otherwise | Returns "True" if the process is currently alive, "False" otherwise | [
"Returns",
"True",
"if",
"the",
"process",
"is",
"currently",
"alive",
"False",
"otherwise"
] | def __get_is_alive__(self):
'''Returns "True" if the process is currently alive, "False" otherwise'''
s = self.GetState()
if (s == eStateAttaching or
s == eStateLaunching or
s == eStateStopped or
s == eStateRunning or
s == eStateStepping or
... | [
"def",
"__get_is_alive__",
"(",
"self",
")",
":",
"s",
"=",
"self",
".",
"GetState",
"(",
")",
"if",
"(",
"s",
"==",
"eStateAttaching",
"or",
"s",
"==",
"eStateLaunching",
"or",
"s",
"==",
"eStateStopped",
"or",
"s",
"==",
"eStateRunning",
"or",
"s",
"... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7362-L7373 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/de2/nyan_subprocessor.py | python | DE2NyanSubprocessor.civ_group_to_civ | (civ_group) | Creates raw API objects for a civ group.
:param civ_group: Terrain group that gets converted to a tech.
:type civ_group: ..dataformat.converter_object.ConverterObjectGroup | Creates raw API objects for a civ group. | [
"Creates",
"raw",
"API",
"objects",
"for",
"a",
"civ",
"group",
"."
] | def civ_group_to_civ(civ_group):
"""
Creates raw API objects for a civ group.
:param civ_group: Terrain group that gets converted to a tech.
:type civ_group: ..dataformat.converter_object.ConverterObjectGroup
"""
civ_id = civ_group.get_id()
dataset = civ_group.d... | [
"def",
"civ_group_to_civ",
"(",
"civ_group",
")",
":",
"civ_id",
"=",
"civ_group",
".",
"get_id",
"(",
")",
"dataset",
"=",
"civ_group",
".",
"data",
"civ_lookup_dict",
"=",
"internal_name_lookups",
".",
"get_civ_lookups",
"(",
"dataset",
".",
"game_version",
")... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/de2/nyan_subprocessor.py#L801-L916 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosunit/src/rosunit/junitxml.py | python | read_all | (filter_=[]) | return root_result | Read in the test_results and aggregate into a single Result object
@param filter_: list of packages that should be processed
@type filter_: [str]
@return: aggregated result
@rtype: L{Result} | Read in the test_results and aggregate into a single Result object | [
"Read",
"in",
"the",
"test_results",
"and",
"aggregate",
"into",
"a",
"single",
"Result",
"object"
] | def read_all(filter_=[]):
"""
Read in the test_results and aggregate into a single Result object
@param filter_: list of packages that should be processed
@type filter_: [str]
@return: aggregated result
@rtype: L{Result}
"""
dir_ = rospkg.get_test_results_dir()
root_result = Result('... | [
"def",
"read_all",
"(",
"filter_",
"=",
"[",
"]",
")",
":",
"dir_",
"=",
"rospkg",
".",
"get_test_results_dir",
"(",
")",
"root_result",
"=",
"Result",
"(",
"'ros'",
",",
"0",
",",
"0",
",",
"0",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosunit/src/rosunit/junitxml.py#L393-L415 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py | python | DatetimeArray.tzinfo | (self) | return self.tz | Alias for tz attribute | Alias for tz attribute | [
"Alias",
"for",
"tz",
"attribute"
] | def tzinfo(self):
"""
Alias for tz attribute
"""
return self.tz | [
"def",
"tzinfo",
"(",
"self",
")",
":",
"return",
"self",
".",
"tz"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py#L522-L526 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/f2py/capi_maps.py | python | routsign2map | (rout) | return ret | name,NAME,begintitle,endtitle
rname,ctype,rformat
routdebugshowvalue | name,NAME,begintitle,endtitle
rname,ctype,rformat
routdebugshowvalue | [
"name",
"NAME",
"begintitle",
"endtitle",
"rname",
"ctype",
"rformat",
"routdebugshowvalue"
] | def routsign2map(rout):
"""
name,NAME,begintitle,endtitle
rname,ctype,rformat
routdebugshowvalue
"""
global lcb_map
name = rout['name']
fname = getfortranname(rout)
ret={'name': name,
'texname': name.replace('_', '\\_'),
'name_lower': name.lower(),
'NAME': ... | [
"def",
"routsign2map",
"(",
"rout",
")",
":",
"global",
"lcb_map",
"name",
"=",
"rout",
"[",
"'name'",
"]",
"fname",
"=",
"getfortranname",
"(",
"rout",
")",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'texname'",
":",
"name",
".",
"replace",
"(",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/f2py/capi_maps.py#L551-L624 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | tools/nightly.py | python | deps_install | (deps: List[str], existing_env: bool, env_opts: List[str]) | Install dependencies to deps environment | Install dependencies to deps environment | [
"Install",
"dependencies",
"to",
"deps",
"environment"
] | def deps_install(deps: List[str], existing_env: bool, env_opts: List[str]) -> None:
"""Install dependencies to deps environment"""
if not existing_env:
# first remove previous pytorch-deps env
cmd = ["conda", "env", "remove", "--yes"] + env_opts
p = subprocess.run(cmd, check=True)
# ... | [
"def",
"deps_install",
"(",
"deps",
":",
"List",
"[",
"str",
"]",
",",
"existing_env",
":",
"bool",
",",
"env_opts",
":",
"List",
"[",
"str",
"]",
")",
"->",
"None",
":",
"if",
"not",
"existing_env",
":",
"# first remove previous pytorch-deps env",
"cmd",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/nightly.py#L314-L323 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridPopulator.ToLongPCT | (*args, **kwargs) | return _propgrid.PropertyGridPopulator_ToLongPCT(*args, **kwargs) | ToLongPCT(String s, long pval, long max) -> bool | ToLongPCT(String s, long pval, long max) -> bool | [
"ToLongPCT",
"(",
"String",
"s",
"long",
"pval",
"long",
"max",
")",
"-",
">",
"bool"
] | def ToLongPCT(*args, **kwargs):
"""ToLongPCT(String s, long pval, long max) -> bool"""
return _propgrid.PropertyGridPopulator_ToLongPCT(*args, **kwargs) | [
"def",
"ToLongPCT",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridPopulator_ToLongPCT",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2615-L2617 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/dist.py | python | Distribution._suffix_for | (req) | return ':' + str(req.marker) if req.marker else '' | For a requirement, return the 'extras_require' suffix for
that requirement. | For a requirement, return the 'extras_require' suffix for
that requirement. | [
"For",
"a",
"requirement",
"return",
"the",
"extras_require",
"suffix",
"for",
"that",
"requirement",
"."
] | def _suffix_for(req):
"""
For a requirement, return the 'extras_require' suffix for
that requirement.
"""
return ':' + str(req.marker) if req.marker else '' | [
"def",
"_suffix_for",
"(",
"req",
")",
":",
"return",
"':'",
"+",
"str",
"(",
"req",
".",
"marker",
")",
"if",
"req",
".",
"marker",
"else",
"''"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/dist.py#L513-L518 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/metrics/python/ops/metric_ops.py | python | streaming_false_positive_rate_at_thresholds | (predictions,
labels,
thresholds,
weights=None,
metrics_collections=None,
update... | Computes various fpr values for different `thresholds` on `predictions`.
The `streaming_false_positive_rate_at_thresholds` function creates two
local variables, `false_positives`, `true_negatives`, for various values of
thresholds. `false_positive_rate[i]` is defined as the total weight
of values in `predictio... | Computes various fpr values for different `thresholds` on `predictions`. | [
"Computes",
"various",
"fpr",
"values",
"for",
"different",
"thresholds",
"on",
"predictions",
"."
] | def streaming_false_positive_rate_at_thresholds(predictions,
labels,
thresholds,
weights=None,
metrics_collections=None,
... | [
"def",
"streaming_false_positive_rate_at_thresholds",
"(",
"predictions",
",",
"labels",
",",
"thresholds",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/metrics/python/ops/metric_ops.py#L1626-L1694 | ||
milvus-io/milvus | 3b1030de2b6c39e3512833e97f6044d63eb24237 | internal/core/build-support/cpplint.py | python | CheckEmptyBlockBody | (filename, clean_lines, linenum, error) | Look for empty loop/conditional body with only a single semicolon.
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. | Look for empty loop/conditional body with only a single semicolon. | [
"Look",
"for",
"empty",
"loop",
"/",
"conditional",
"body",
"with",
"only",
"a",
"single",
"semicolon",
"."
] | def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
"""Look for empty loop/conditional body with only a single semicolon.
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 functio... | [
"def",
"CheckEmptyBlockBody",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Search for loop keywords at the beginning of the line. Because only",
"# whitespaces are allowed before the keywords, this will also ignore most",
"# do-while-loops, since those... | https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/cpplint.py#L4498-L4599 | ||
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | scripts/cpp_lint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L1508-L1523 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetExtension | (self) | return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec['type'], '') | Returns the extension for the target, with no leading dot.
Uses 'product_extension' if specified, otherwise uses MSVS defaults based on
the target type. | Returns the extension for the target, with no leading dot. | [
"Returns",
"the",
"extension",
"for",
"the",
"target",
"with",
"no",
"leading",
"dot",
"."
] | def GetExtension(self):
"""Returns the extension for the target, with no leading dot.
Uses 'product_extension' if specified, otherwise uses MSVS defaults based on
the target type.
"""
ext = self.spec.get('product_extension', None)
if ext:
return ext
return gyp.MSVSUtil.TARGET_TYPE_EXT... | [
"def",
"GetExtension",
"(",
"self",
")",
":",
"ext",
"=",
"self",
".",
"spec",
".",
"get",
"(",
"'product_extension'",
",",
"None",
")",
"if",
"ext",
":",
"return",
"ext",
"return",
"gyp",
".",
"MSVSUtil",
".",
"TARGET_TYPE_EXT",
".",
"get",
"(",
"self... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L226-L235 | |
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | storage/ndb/mcc/util.py | python | ConvertToPython.startElement | (self, name, attrs) | Creates a new attribute dict and pushes it on the element stack. | Creates a new attribute dict and pushes it on the element stack. | [
"Creates",
"a",
"new",
"attribute",
"dict",
"and",
"pushes",
"it",
"on",
"the",
"element",
"stack",
"."
] | def startElement(self, name, attrs):
"""Creates a new attribute dict and pushes it on the element stack."""
#print 'start( ', name, ')'
a = {}
for an in attrs.getNames():
a[an] = attrs.getValue(an)
try:
a[an] = float(a[an])
... | [
"def",
"startElement",
"(",
"self",
",",
"name",
",",
"attrs",
")",
":",
"#print 'start( ', name, ')'",
"a",
"=",
"{",
"}",
"for",
"an",
"in",
"attrs",
".",
"getNames",
"(",
")",
":",
"a",
"[",
"an",
"]",
"=",
"attrs",
".",
"getValue",
"(",
"an",
"... | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/storage/ndb/mcc/util.py#L168-L180 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.CopyAllowLine | (*args, **kwargs) | return _stc.StyledTextCtrl_CopyAllowLine(*args, **kwargs) | CopyAllowLine(self)
Copy the selection, if selection empty copy the line with the caret | CopyAllowLine(self) | [
"CopyAllowLine",
"(",
"self",
")"
] | def CopyAllowLine(*args, **kwargs):
"""
CopyAllowLine(self)
Copy the selection, if selection empty copy the line with the caret
"""
return _stc.StyledTextCtrl_CopyAllowLine(*args, **kwargs) | [
"def",
"CopyAllowLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_CopyAllowLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5743-L5749 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._merge_node_groups | (self, node_groups, suppress_warnings=False) | Merge nodes in the given node groups.
This updates node field and node set field values with the average of
the values at the merged nodes. If they differ, a warning is output in
addition.
Node sets and node set fields are updated accordingly.
Example:
>>> model._merg... | Merge nodes in the given node groups. | [
"Merge",
"nodes",
"in",
"the",
"given",
"node",
"groups",
"."
] | def _merge_node_groups(self, node_groups, suppress_warnings=False):
"""
Merge nodes in the given node groups.
This updates node field and node set field values with the average of
the values at the merged nodes. If they differ, a warning is output in
addition.
Node set... | [
"def",
"_merge_node_groups",
"(",
"self",
",",
"node_groups",
",",
"suppress_warnings",
"=",
"False",
")",
":",
"# ensure slave nodes are not duplicated",
"slave_nodes_set",
"=",
"set",
"(",
")",
"duplicated_slave_nodes",
"=",
"set",
"(",
")",
"for",
"master",
",",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L6842-L7030 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/aoc/genie_unit.py | python | GenieGameEntityGroup.is_garrison | (self, civ_id=-1) | return False | Checks whether the group can garrison other entities. This covers
all of these garrisons:
- Natural garrisons (castle, town center, tower)
- Production garrisons (barracks, archery range, stable, etc.)
- Unit garrisons (ram, siege tower)
- Transport ships
This does not ... | Checks whether the group can garrison other entities. This covers
all of these garrisons: | [
"Checks",
"whether",
"the",
"group",
"can",
"garrison",
"other",
"entities",
".",
"This",
"covers",
"all",
"of",
"these",
"garrisons",
":"
] | def is_garrison(self, civ_id=-1):
"""
Checks whether the group can garrison other entities. This covers
all of these garrisons:
- Natural garrisons (castle, town center, tower)
- Production garrisons (barracks, archery range, stable, etc.)
- Unit garrisons (ram, siege to... | [
"def",
"is_garrison",
"(",
"self",
",",
"civ_id",
"=",
"-",
"1",
")",
":",
"head_unit",
"=",
"self",
".",
"get_head_unit",
"(",
")",
"if",
"civ_id",
"!=",
"-",
"1",
":",
"head_unit",
"=",
"self",
".",
"data",
".",
"civ_groups",
"[",
"civ_id",
"]",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L296-L335 | |
pybox2d/pybox2d | 09643321fd363f0850087d1bde8af3f4afd82163 | library/Box2D/examples/backends/opencv_framework.py | python | OpencvDraw.DrawPoint | (self, p, size, color) | Draw a single point at point p given a pixel size and color. | Draw a single point at point p given a pixel size and color. | [
"Draw",
"a",
"single",
"point",
"at",
"point",
"p",
"given",
"a",
"pixel",
"size",
"and",
"color",
"."
] | def DrawPoint(self, p, size, color):
"""
Draw a single point at point p given a pixel size and color.
"""
self.DrawCircle(p, size / self.zoom, color, drawwidth=0) | [
"def",
"DrawPoint",
"(",
"self",
",",
"p",
",",
"size",
",",
"color",
")",
":",
"self",
".",
"DrawCircle",
"(",
"p",
",",
"size",
"/",
"self",
".",
"zoom",
",",
"color",
",",
"drawwidth",
"=",
"0",
")"
] | https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/backends/opencv_framework.py#L72-L76 | ||
arx/ArxLibertatis | 0313c51625f3f55016cdad43d2c7f7296d27949c | scripts/cpplint.py | python | FilesBelongToSameModule | (filename_cc, filename_h) | return files_belong_to_same_module, common_path | Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cpp, foo_test.cpp and foo_unittest.cpp belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and some/path/internal/xyzzy are also considered
to belong... | Check if these two filenames belong to the same module. | [
"Check",
"if",
"these",
"two",
"filenames",
"belong",
"to",
"the",
"same",
"module",
"."
] | def FilesBelongToSameModule(filename_cc, filename_h):
"""Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cpp, foo_test.cpp and foo_unittest.cpp belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy a... | [
"def",
"FilesBelongToSameModule",
"(",
"filename_cc",
",",
"filename_h",
")",
":",
"if",
"not",
"filename_cc",
".",
"endswith",
"(",
"'.cpp'",
")",
":",
"return",
"(",
"False",
",",
"''",
")",
"filename_cc",
"=",
"filename_cc",
"[",
":",
"-",
"len",
"(",
... | https://github.com/arx/ArxLibertatis/blob/0313c51625f3f55016cdad43d2c7f7296d27949c/scripts/cpplint.py#L3129-L3181 | |
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/busco/pipebricks/PipeLogger.py | python | PipeLogger.warn | (self, msg, *args, **kwargs) | This function overrides the _logger class warn
:param msg: the message to log
:type msg: str | This function overrides the _logger class warn
:param msg: the message to log
:type msg: str | [
"This",
"function",
"overrides",
"the",
"_logger",
"class",
"warn",
":",
"param",
"msg",
":",
"the",
"message",
"to",
"log",
":",
"type",
"msg",
":",
"str"
] | def warn(self, msg, *args, **kwargs):
"""
This function overrides the _logger class warn
:param msg: the message to log
:type msg: str
"""
self.warning(msg, *args, **kwargs) | [
"def",
"warn",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/busco/pipebricks/PipeLogger.py#L102-L108 | ||
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | build-support/iwyu/fix_includes.py | python | IWYUOutputParser.ParseOneRecord | (self, iwyu_output, flags) | return retval | Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
2) What line numbers hold includes/fwd-declares to ... | Given a file object with output from an iwyu run, return per file info. | [
"Given",
"a",
"file",
"object",
"with",
"output",
"from",
"an",
"iwyu",
"run",
"return",
"per",
"file",
"info",
"."
] | def ParseOneRecord(self, iwyu_output, flags):
"""Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
... | [
"def",
"ParseOneRecord",
"(",
"self",
",",
"iwyu_output",
",",
"flags",
")",
":",
"for",
"line",
"in",
"iwyu_output",
":",
"if",
"not",
"self",
".",
"_ProcessOneLine",
"(",
"line",
",",
"flags",
".",
"basedir",
")",
":",
"# returns False at end-of-record",
"... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/iwyu/fix_includes.py#L401-L483 | |
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/io.py | python | datum_to_array | (datum) | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | [
"Converts",
"a",
"datum",
"to",
"an",
"array",
".",
"Note",
"that",
"the",
"label",
"is",
"not",
"returned",
"as",
"one",
"can",
"easily",
"get",
"it",
"by",
"calling",
"datum",
".",
"label",
"."
] | def datum_to_array(datum):
"""Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label.
"""
if len(datum.data):
return np.fromstring(datum.data, dtype=np.uint8).reshape(
datum.channels, datum.height, datum.width)
else:
... | [
"def",
"datum_to_array",
"(",
"datum",
")",
":",
"if",
"len",
"(",
"datum",
".",
"data",
")",
":",
"return",
"np",
".",
"fromstring",
"(",
"datum",
".",
"data",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
".",
"reshape",
"(",
"datum",
".",
"channel... | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/io.py#L84-L93 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py | python | _TaskPanel.update | (self) | return | fills the widgets | fills the widgets | [
"fills",
"the",
"widgets"
] | def update(self):
"fills the widgets"
self.form.le_working_dir.setText(self.fea.working_dir)
if self.fea.solver.AnalysisType == "static":
self.form.rb_static_analysis.setChecked(True)
elif self.fea.solver.AnalysisType == "frequency":
self.form.rb_frequency_analysi... | [
"def",
"update",
"(",
"self",
")",
":",
"self",
".",
"form",
".",
"le_working_dir",
".",
"setText",
"(",
"self",
".",
"fea",
".",
"working_dir",
")",
"if",
"self",
".",
"fea",
".",
"solver",
".",
"AnalysisType",
"==",
"\"static\"",
":",
"self",
".",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py#L158-L171 | |
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/glfw.py | python | get_key | (window, key) | return _glfw.glfwGetKey(window, key) | Returns the last reported state of a keyboard key for the specified
window.
Wrapper for:
int glfwGetKey(GLFWwindow* window, int key); | Returns the last reported state of a keyboard key for the specified
window. | [
"Returns",
"the",
"last",
"reported",
"state",
"of",
"a",
"keyboard",
"key",
"for",
"the",
"specified",
"window",
"."
] | def get_key(window, key):
"""
Returns the last reported state of a keyboard key for the specified
window.
Wrapper for:
int glfwGetKey(GLFWwindow* window, int key);
"""
return _glfw.glfwGetKey(window, key) | [
"def",
"get_key",
"(",
"window",
",",
"key",
")",
":",
"return",
"_glfw",
".",
"glfwGetKey",
"(",
"window",
",",
"key",
")"
] | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L1466-L1474 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/embedding_generation_benchmark.py | python | generate_data | (T, batch_size, max_seq_length) | return queue | Fill a queue with input data | Fill a queue with input data | [
"Fill",
"a",
"queue",
"with",
"input",
"data"
] | def generate_data(T, batch_size, max_seq_length):
'''
Fill a queue with input data
'''
log.info("Generating T={} batches".format(T))
generate_input_init_net = core.Net('generate_input_init')
queue = generate_input_init_net.CreateBlobsQueue(
[], "inputqueue", num_blobs=1, capacity=T,
... | [
"def",
"generate_data",
"(",
"T",
",",
"batch_size",
",",
"max_seq_length",
")",
":",
"log",
".",
"info",
"(",
"\"Generating T={} batches\"",
".",
"format",
"(",
"T",
")",
")",
"generate_input_init_net",
"=",
"core",
".",
"Net",
"(",
"'generate_input_init'",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/embedding_generation_benchmark.py#L22-L46 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/sparse/base.py | python | spmatrix.todia | (self, copy=False) | return self.tocoo(copy=copy).todia(copy=False) | Convert this matrix to sparse DIAgonal format.
With copy=False, the data/indices may be shared between this matrix and
the resultant dia_matrix. | Convert this matrix to sparse DIAgonal format. | [
"Convert",
"this",
"matrix",
"to",
"sparse",
"DIAgonal",
"format",
"."
] | def todia(self, copy=False):
"""Convert this matrix to sparse DIAgonal format.
With copy=False, the data/indices may be shared between this matrix and
the resultant dia_matrix.
"""
return self.tocoo(copy=copy).todia(copy=False) | [
"def",
"todia",
"(",
"self",
",",
"copy",
"=",
"False",
")",
":",
"return",
"self",
".",
"tocoo",
"(",
"copy",
"=",
"copy",
")",
".",
"todia",
"(",
"copy",
"=",
"False",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/base.py#L760-L766 | |
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | var/assets/clients/gen-py/clause/Serving.py | python | Client.delIntent | (self, request) | return self.recv_delIntent() | Parameters:
- request | Parameters:
- request | [
"Parameters",
":",
"-",
"request"
] | def delIntent(self, request):
"""
Parameters:
- request
"""
self.send_delIntent(request)
return self.recv_delIntent() | [
"def",
"delIntent",
"(",
"self",
",",
"request",
")",
":",
"self",
".",
"send_delIntent",
"(",
"request",
")",
"return",
"self",
".",
"recv_delIntent",
"(",
")"
] | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L1056-L1063 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/common/Vector.py | python | Vector.isnan | (self) | return math.isnan(self.val1) or math.isnan(self.val2) | Returns true is any value of this vector is nan | Returns true is any value of this vector is nan | [
"Returns",
"true",
"is",
"any",
"value",
"of",
"this",
"vector",
"is",
"nan"
] | def isnan(self):
"""
Returns true is any value of this vector is nan
"""
return math.isnan(self.val1) or math.isnan(self.val2) | [
"def",
"isnan",
"(",
"self",
")",
":",
"return",
"math",
".",
"isnan",
"(",
"self",
".",
"val1",
")",
"or",
"math",
".",
"isnan",
"(",
"self",
".",
"val2",
")"
] | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Vector.py#L74-L78 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/jedi/jedi/cache.py | python | _ModulePickling.__init__ | (self) | Short name for distinguish Python implementations and versions.
It's like `sys.implementation.cache_tag` but for Python < 3.3
we generate something similar. See:
http://docs.python.org/3/library/sys.html#sys.implementation
.. todo:: Detect interpreter (e.g., PyPy). | Short name for distinguish Python implementations and versions. | [
"Short",
"name",
"for",
"distinguish",
"Python",
"implementations",
"and",
"versions",
"."
] | def __init__(self):
self.__index = None
self.py_tag = 'cpython-%s%s' % sys.version_info[:2]
"""
Short name for distinguish Python implementations and versions.
It's like `sys.implementation.cache_tag` but for Python < 3.3
we generate something similar. See:
http... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"__index",
"=",
"None",
"self",
".",
"py_tag",
"=",
"'cpython-%s%s'",
"%",
"sys",
".",
"version_info",
"[",
":",
"2",
"]"
] | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/cache.py#L236-L247 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/random.py | python | choice | (a, size=None, replace=True, p=None, device=None, out=None) | return _mx_nd_np.random.choice(a, size, replace, p, device, out) | r"""Generates a random sample from a given 1-D array
Parameters
-----------
a : 1-D array-like or int
If an ndarray, a random sample is generated from its elements.
If an int, the random sample is generated as if a were np.arange(a)
size : int or tuple of ints, optional
Output s... | r"""Generates a random sample from a given 1-D array | [
"r",
"Generates",
"a",
"random",
"sample",
"from",
"a",
"given",
"1",
"-",
"D",
"array"
] | def choice(a, size=None, replace=True, p=None, device=None, out=None):
r"""Generates a random sample from a given 1-D array
Parameters
-----------
a : 1-D array-like or int
If an ndarray, a random sample is generated from its elements.
If an int, the random sample is generated as if a w... | [
"def",
"choice",
"(",
"a",
",",
"size",
"=",
"None",
",",
"replace",
"=",
"True",
",",
"p",
"=",
"None",
",",
"device",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"_mx_nd_np",
".",
"random",
".",
"choice",
"(",
"a",
",",
"size",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/random.py#L514-L566 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/optparse.py | python | OptionParser.parse_args | (self, args=None, values=None) | return self.check_values(values, args) | parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string])
Parse the command-line options found in 'args' (default:
sys.argv[1:]). Any errors result in a call to 'error()', which
by default prints the usage message to std... | parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string]) | [
"parse_args",
"(",
"args",
":",
"[",
"string",
"]",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"values",
":",
"Values",
"=",
"None",
")",
"-",
">",
"(",
"values",
":",
"Values",
"args",
":",
"[",
"string",
"]",
")"
] | def parse_args(self, args=None, values=None):
"""
parse_args(args : [string] = sys.argv[1:],
values : Values = None)
-> (values : Values, args : [string])
Parse the command-line options found in 'args' (default:
sys.argv[1:]). Any errors result in a call to '... | [
"def",
"parse_args",
"(",
"self",
",",
"args",
"=",
"None",
",",
"values",
"=",
"None",
")",
":",
"rargs",
"=",
"self",
".",
"_get_args",
"(",
"args",
")",
"if",
"values",
"is",
"None",
":",
"values",
"=",
"self",
".",
"get_default_values",
"(",
")",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/optparse.py#L1367-L1404 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | RobotModelLink.getPositionJacobian | (self, plocal) | return _robotsim.RobotModelLink_getPositionJacobian(self, plocal) | getPositionJacobian(RobotModelLink self, double const [3] plocal)
Returns the position jacobian of a point on this link w.r.t. the robot's
configuration q.
Returns:
(list of 3 lists of floats): the 3xn Jacobian matrix of the
point given by local coordinates ploca... | getPositionJacobian(RobotModelLink self, double const [3] plocal) | [
"getPositionJacobian",
"(",
"RobotModelLink",
"self",
"double",
"const",
"[",
"3",
"]",
"plocal",
")"
] | def getPositionJacobian(self, plocal):
"""
getPositionJacobian(RobotModelLink self, double const [3] plocal)
Returns the position jacobian of a point on this link w.r.t. the robot's
configuration q.
Returns:
(list of 3 lists of floats): the 3xn Jacobian matri... | [
"def",
"getPositionJacobian",
"(",
"self",
",",
"plocal",
")",
":",
"return",
"_robotsim",
".",
"RobotModelLink_getPositionJacobian",
"(",
"self",
",",
"plocal",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4085-L4103 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/sessions.py | python | merge_setting | (request_setting, session_setting, dict_class=OrderedDict) | return merged_setting | Determines appropriate setting for a given request, taking into account the
explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class` | Determines appropriate setting for a given request, taking into account the
explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class` | [
"Determines",
"appropriate",
"setting",
"for",
"a",
"given",
"request",
"taking",
"into",
"account",
"the",
"explicit",
"setting",
"on",
"that",
"request",
"and",
"the",
"setting",
"in",
"the",
"session",
".",
"If",
"a",
"setting",
"is",
"a",
"dictionary",
"... | def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
"""
Determines appropriate setting for a given request, taking into account the
explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class`
... | [
"def",
"merge_setting",
"(",
"request_setting",
",",
"session_setting",
",",
"dict_class",
"=",
"OrderedDict",
")",
":",
"if",
"session_setting",
"is",
"None",
":",
"return",
"request_setting",
"if",
"request_setting",
"is",
"None",
":",
"return",
"session_setting",... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/sessions.py#L42-L72 | |
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/util/_analysis.py | python | analysis._cluster_local_extrema | (self, variance_ratio=0.95, k=0, single_cluster_tolerance=0.0001, kmax=0) | Clusters the results of a set of local searches and orders the clusters ascendently as
regards fitness value of its centroid (after transformation for constraint problems and
fitness decomposition for multi-objective problems). The clustering is conducted by means of
the k-Means algorithm in the... | Clusters the results of a set of local searches and orders the clusters ascendently as
regards fitness value of its centroid (after transformation for constraint problems and
fitness decomposition for multi-objective problems). The clustering is conducted by means of
the k-Means algorithm in the... | [
"Clusters",
"the",
"results",
"of",
"a",
"set",
"of",
"local",
"searches",
"and",
"orders",
"the",
"clusters",
"ascendently",
"as",
"regards",
"fitness",
"value",
"of",
"its",
"centroid",
"(",
"after",
"transformation",
"for",
"constraint",
"problems",
"and",
... | def _cluster_local_extrema(self, variance_ratio=0.95, k=0, single_cluster_tolerance=0.0001, kmax=0):
"""
Clusters the results of a set of local searches and orders the clusters ascendently as
regards fitness value of its centroid (after transformation for constraint problems and
fitness ... | [
"def",
"_cluster_local_extrema",
"(",
"self",
",",
"variance_ratio",
"=",
"0.95",
",",
"k",
"=",
"0",
",",
"single_cluster_tolerance",
"=",
"0.0001",
",",
"kmax",
"=",
"0",
")",
":",
"if",
"self",
".",
"npoints",
"==",
"0",
":",
"raise",
"ValueError",
"(... | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/_analysis.py#L2634-L2803 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridInterface.GetIterator | (*args) | return _propgrid.PropertyGridInterface_GetIterator(*args) | GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGridIterator
GetIterator(self, int flag... | GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGridIterator
GetIterator(self, int flag... | [
"GetIterator",
"(",
"self",
"int",
"flags",
"=",
"PG_ITERATE_DEFAULT",
"PGProperty",
"firstProp",
"=",
"None",
")",
"-",
">",
"PropertyGridIterator",
"GetIterator",
"(",
"self",
"int",
"flags",
"=",
"PG_ITERATE_DEFAULT",
"PGProperty",
"firstProp",
"=",
"None",
")"... | def GetIterator(*args):
"""
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGri... | [
"def",
"GetIterator",
"(",
"*",
"args",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetIterator",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L1167-L1174 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py | python | SimpleEdgeDrawings.update | (self, is_update=True) | Update color, assume that there have not been structural changes of the arrays | Update color, assume that there have not been structural changes of the arrays | [
"Update",
"color",
"assume",
"that",
"there",
"have",
"not",
"been",
"structural",
"changes",
"of",
"the",
"arrays"
] | def update(self, is_update=True):
"""
Update color, assume that there have not been structural changes of the arrays
"""
# assumes that edges have been set in set_edges
self.colors_fill.value[:] = np.ones((len(self), 1), np.float32)*self.color_default.value
self.colors_fi... | [
"def",
"update",
"(",
"self",
",",
"is_update",
"=",
"True",
")",
":",
"# assumes that edges have been set in set_edges",
"self",
".",
"colors_fill",
".",
"value",
"[",
":",
"]",
"=",
"np",
".",
"ones",
"(",
"(",
"len",
"(",
"self",
")",
",",
"1",
")",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py#L614-L624 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | NDArray._prepare_value_nd | (self, value, vshape) | return value_nd | Given value and vshape, create an `NDArray` from value with the same
context and dtype as the current one and broadcast it to vshape. | Given value and vshape, create an `NDArray` from value with the same
context and dtype as the current one and broadcast it to vshape. | [
"Given",
"value",
"and",
"vshape",
"create",
"an",
"NDArray",
"from",
"value",
"with",
"the",
"same",
"context",
"and",
"dtype",
"as",
"the",
"current",
"one",
"and",
"broadcast",
"it",
"to",
"vshape",
"."
] | def _prepare_value_nd(self, value, vshape):
"""Given value and vshape, create an `NDArray` from value with the same
context and dtype as the current one and broadcast it to vshape."""
if isinstance(value, numeric_types):
value_nd = full(shape=vshape, val=value, ctx=self.context, dtyp... | [
"def",
"_prepare_value_nd",
"(",
"self",
",",
"value",
",",
"vshape",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"numeric_types",
")",
":",
"value_nd",
"=",
"full",
"(",
"shape",
"=",
"vshape",
",",
"val",
"=",
"value",
",",
"ctx",
"=",
"self",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L665-L682 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/_multivariate.py | python | dirichlet_gen._logpdf | (self, x, alpha) | return - lnB + np.sum((np.log(x.T) * (alpha - 1)).T, 0) | Parameters
----------
x : ndarray
Points at which to evaluate the log of the probability
density function
%(_dirichlet_doc_default_callparams)s
Notes
-----
As this function does no argument checking, it should not be
called directly; use '... | Parameters
----------
x : ndarray
Points at which to evaluate the log of the probability
density function
%(_dirichlet_doc_default_callparams)s | [
"Parameters",
"----------",
"x",
":",
"ndarray",
"Points",
"at",
"which",
"to",
"evaluate",
"the",
"log",
"of",
"the",
"probability",
"density",
"function",
"%",
"(",
"_dirichlet_doc_default_callparams",
")",
"s"
] | def _logpdf(self, x, alpha):
"""
Parameters
----------
x : ndarray
Points at which to evaluate the log of the probability
density function
%(_dirichlet_doc_default_callparams)s
Notes
-----
As this function does no argument checking... | [
"def",
"_logpdf",
"(",
"self",
",",
"x",
",",
"alpha",
")",
":",
"lnB",
"=",
"_lnB",
"(",
"alpha",
")",
"return",
"-",
"lnB",
"+",
"np",
".",
"sum",
"(",
"(",
"np",
".",
"log",
"(",
"x",
".",
"T",
")",
"*",
"(",
"alpha",
"-",
"1",
")",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_multivariate.py#L1210-L1226 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/compile_utils.py | python | MetricsContainer.reset_state | (self) | Resets the state of all `Metric`s in this container. | Resets the state of all `Metric`s in this container. | [
"Resets",
"the",
"state",
"of",
"all",
"Metric",
"s",
"in",
"this",
"container",
"."
] | def reset_state(self):
"""Resets the state of all `Metric`s in this container."""
if self._built:
metrics = self._metrics_in_order
else:
# If the user supplied `Metric` objects directly, we should
# reset those. This could also contain `str`s or `function`s
# though.
metrics = ... | [
"def",
"reset_state",
"(",
"self",
")",
":",
"if",
"self",
".",
"_built",
":",
"metrics",
"=",
"self",
".",
"_metrics_in_order",
"else",
":",
"# If the user supplied `Metric` objects directly, we should",
"# reset those. This could also contain `str`s or `function`s",
"# thou... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/compile_utils.py#L467-L480 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Environment.py | python | OverrideEnvironment.has_key | (self, key) | Emulates the has_key() method of dictionaries. | Emulates the has_key() method of dictionaries. | [
"Emulates",
"the",
"has_key",
"()",
"method",
"of",
"dictionaries",
"."
] | def has_key(self, key):
"""Emulates the has_key() method of dictionaries."""
try:
self.__dict__['overrides'][key]
return 1
except KeyError:
return key in self.__dict__['__subject'] | [
"def",
"has_key",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"self",
".",
"__dict__",
"[",
"'overrides'",
"]",
"[",
"key",
"]",
"return",
"1",
"except",
"KeyError",
":",
"return",
"key",
"in",
"self",
".",
"__dict__",
"[",
"'__subject'",
"]"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Environment.py#L2421-L2427 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py | python | EmacsMode.add_key_logger | (self,logfun) | logfun should be function that takes disp_fun and line_buffer object | logfun should be function that takes disp_fun and line_buffer object | [
"logfun",
"should",
"be",
"function",
"that",
"takes",
"disp_fun",
"and",
"line_buffer",
"object"
] | def add_key_logger(self,logfun):
"""logfun should be function that takes disp_fun and line_buffer object """
self._keylog=logfun | [
"def",
"add_key_logger",
"(",
"self",
",",
"logfun",
")",
":",
"self",
".",
"_keylog",
"=",
"logfun"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L37-L39 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/storage_uri.py | python | BucketStorageUri.set_canned_acl | (self, acl_str, validate=False, headers=None,
version_id=None) | Sets or updates a bucket's acl to a predefined (canned) value. | Sets or updates a bucket's acl to a predefined (canned) value. | [
"Sets",
"or",
"updates",
"a",
"bucket",
"s",
"acl",
"to",
"a",
"predefined",
"(",
"canned",
")",
"value",
"."
] | def set_canned_acl(self, acl_str, validate=False, headers=None,
version_id=None):
"""Sets or updates a bucket's acl to a predefined (canned) value."""
self._check_object_uri('set_canned_acl')
self._warn_about_args('set_canned_acl', version_id=version_id)
key = self... | [
"def",
"set_canned_acl",
"(",
"self",
",",
"acl_str",
",",
"validate",
"=",
"False",
",",
"headers",
"=",
"None",
",",
"version_id",
"=",
"None",
")",
":",
"self",
".",
"_check_object_uri",
"(",
"'set_canned_acl'",
")",
"self",
".",
"_warn_about_args",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/storage_uri.py#L619-L626 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/dtypes/inference.py | python | is_re | (obj) | return isinstance(obj, re_type) | Check if the object is a regex pattern instance.
Parameters
----------
obj : The object to check
Returns
-------
is_regex : bool
Whether `obj` is a regex pattern.
Examples
--------
>>> is_re(re.compile(".*"))
True
>>> is_re("foo")
False | Check if the object is a regex pattern instance. | [
"Check",
"if",
"the",
"object",
"is",
"a",
"regex",
"pattern",
"instance",
"."
] | def is_re(obj):
"""
Check if the object is a regex pattern instance.
Parameters
----------
obj : The object to check
Returns
-------
is_regex : bool
Whether `obj` is a regex pattern.
Examples
--------
>>> is_re(re.compile(".*"))
True
>>> is_re("foo")
Fa... | [
"def",
"is_re",
"(",
"obj",
")",
":",
"return",
"isinstance",
"(",
"obj",
",",
"re_type",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/dtypes/inference.py#L200-L221 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/odr/odrpack.py | python | RealData._cov2wt | (self, cov) | Convert covariance matrix(-ices) to weights. | Convert covariance matrix(-ices) to weights. | [
"Convert",
"covariance",
"matrix",
"(",
"-",
"ices",
")",
"to",
"weights",
"."
] | def _cov2wt(self, cov):
""" Convert covariance matrix(-ices) to weights.
"""
from numpy.dual import inv
if len(cov.shape) == 2:
return inv(cov)
else:
weights = numpy.zeros(cov.shape, float)
for i in range(cov.shape[-1]): # n
... | [
"def",
"_cov2wt",
"(",
"self",
",",
"cov",
")",
":",
"from",
"numpy",
".",
"dual",
"import",
"inv",
"if",
"len",
"(",
"cov",
".",
"shape",
")",
"==",
"2",
":",
"return",
"inv",
"(",
"cov",
")",
"else",
":",
"weights",
"=",
"numpy",
".",
"zeros",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/odr/odrpack.py#L397-L411 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py | python | OperatorPDIdentity.dtype | (self) | return self._dtype | Data type of matrix elements of `A`. | Data type of matrix elements of `A`. | [
"Data",
"type",
"of",
"matrix",
"elements",
"of",
"A",
"."
] | def dtype(self):
"""Data type of matrix elements of `A`."""
return self._dtype | [
"def",
"dtype",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dtype"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py#L134-L136 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | parserCtxt.parseReference | (self) | parse and handle entity references in content, depending on
the SAX interface, this may end-up in a call to character()
if this is a CharRef, a predefined entity, if there is no
reference() callback. or if the parser was asked to switch
to that mode. [67] Reference ::= EntityRe... | parse and handle entity references in content, depending on
the SAX interface, this may end-up in a call to character()
if this is a CharRef, a predefined entity, if there is no
reference() callback. or if the parser was asked to switch
to that mode. [67] Reference ::= EntityRe... | [
"parse",
"and",
"handle",
"entity",
"references",
"in",
"content",
"depending",
"on",
"the",
"SAX",
"interface",
"this",
"may",
"end",
"-",
"up",
"in",
"a",
"call",
"to",
"character",
"()",
"if",
"this",
"is",
"a",
"CharRef",
"a",
"predefined",
"entity",
... | def parseReference(self):
"""parse and handle entity references in content, depending on
the SAX interface, this may end-up in a call to character()
if this is a CharRef, a predefined entity, if there is no
reference() callback. or if the parser was asked to switch
to th... | [
"def",
"parseReference",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlParseReference",
"(",
"self",
".",
"_o",
")"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L5360-L5366 | ||
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/device.py | python | Device.msg_file | (self) | return self._msg_file | str: Filename to write messages to.
By default, HOOMD prints all messages and errors to Python's
`sys.stdout` and `sys.stderr` (or the system's ``stdout`` and ``stderr``
when running in an MPI environment).
Set `msg_file` to a filename to redirect these messages to that file.
... | str: Filename to write messages to. | [
"str",
":",
"Filename",
"to",
"write",
"messages",
"to",
"."
] | def msg_file(self):
"""str: Filename to write messages to.
By default, HOOMD prints all messages and errors to Python's
`sys.stdout` and `sys.stderr` (or the system's ``stdout`` and ``stderr``
when running in an MPI environment).
Set `msg_file` to a filename to redirect these m... | [
"def",
"msg_file",
"(",
"self",
")",
":",
"return",
"self",
".",
"_msg_file"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/device.py#L68-L93 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridManager.IsPropertySelected | (*args, **kwargs) | return _propgrid.PropertyGridManager_IsPropertySelected(*args, **kwargs) | IsPropertySelected(self, PGPropArg id) -> bool | IsPropertySelected(self, PGPropArg id) -> bool | [
"IsPropertySelected",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"bool"
] | def IsPropertySelected(*args, **kwargs):
"""IsPropertySelected(self, PGPropArg id) -> bool"""
return _propgrid.PropertyGridManager_IsPropertySelected(*args, **kwargs) | [
"def",
"IsPropertySelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridManager_IsPropertySelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3547-L3549 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py | python | WorkingSet._build_master | (cls) | return ws | Prepare the master working set. | Prepare the master working set. | [
"Prepare",
"the",
"master",
"working",
"set",
"."
] | def _build_master(cls):
"""
Prepare the master working set.
"""
ws = cls()
try:
from __main__ import __requires__
except ImportError:
# The main program does not list any requirements
return ws
# ensure the requirements are met... | [
"def",
"_build_master",
"(",
"cls",
")",
":",
"ws",
"=",
"cls",
"(",
")",
"try",
":",
"from",
"__main__",
"import",
"__requires__",
"except",
"ImportError",
":",
"# The main program does not list any requirements",
"return",
"ws",
"# ensure the requirements are met",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py#L571-L588 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/base.py | python | IndexOpsMixin.__iter__ | (self) | Return an iterator of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
iterator | Return an iterator of the values. | [
"Return",
"an",
"iterator",
"of",
"the",
"values",
"."
] | def __iter__(self):
"""
Return an iterator of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
iterator
"""
# We are expl... | [
"def",
"__iter__",
"(",
"self",
")",
":",
"# We are explicitly making element iterators.",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_values",
",",
"np",
".",
"ndarray",
")",
":",
"# Check type instead of dtype to catch DTA/TDA",
"return",
"iter",
"(",
"self",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/base.py#L737-L754 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py3/traitlets/config/loader.py | python | load_pyconfig_files | (config_files, path) | return config | Load multiple Python config files, merging each of them in turn.
Parameters
----------
config_files : list of str
List of config files names to load and merge into the config.
path : unicode
The full path to the location of the config files. | Load multiple Python config files, merging each of them in turn. | [
"Load",
"multiple",
"Python",
"config",
"files",
"merging",
"each",
"of",
"them",
"in",
"turn",
"."
] | def load_pyconfig_files(config_files, path):
"""Load multiple Python config files, merging each of them in turn.
Parameters
----------
config_files : list of str
List of config files names to load and merge into the config.
path : unicode
The full path to the location of the config ... | [
"def",
"load_pyconfig_files",
"(",
"config_files",
",",
"path",
")",
":",
"config",
"=",
"Config",
"(",
")",
"for",
"cf",
"in",
"config_files",
":",
"loader",
"=",
"PyFileConfigLoader",
"(",
"cf",
",",
"path",
"=",
"path",
")",
"try",
":",
"next_config",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/config/loader.py#L1069-L1090 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py | python | TransformedDistribution.log_prob | (self, y, name="log_prob") | Log prob of observations in `y`.
`log ( p(g(y)) / det|J(g(y))| )`, where `g` is the inverse of `transform`.
Args:
y: tensor of dtype `dtype`.
name: The name to give this op.
Returns:
log_pdf: tensor of dtype `dtype`, the log-PDFs of `y`.
Raises:
ValueError: if `inverse` was n... | Log prob of observations in `y`. | [
"Log",
"prob",
"of",
"observations",
"in",
"y",
"."
] | def log_prob(self, y, name="log_prob"):
"""Log prob of observations in `y`.
`log ( p(g(y)) / det|J(g(y))| )`, where `g` is the inverse of `transform`.
Args:
y: tensor of dtype `dtype`.
name: The name to give this op.
Returns:
log_pdf: tensor of dtype `dtype`, the log-PDFs of `y`.
... | [
"def",
"log_prob",
"(",
"self",
",",
"y",
",",
"name",
"=",
"\"log_prob\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"y",
"]",
",",
"name",
")",
":",
"y",
"=",
"op... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py#L173-L205 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.