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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/third_party/six/six.py | python | _SixMetaPathImporter.get_code | (self, fullname) | return None | Return None
Required, if is_package is implemented | Return None | [
"Return",
"None"
] | def get_code(self, fullname):
"""Return None
Required, if is_package is implemented"""
self.__get_module(fullname) # eventually raises ImportError
return None | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"self",
".",
"__get_module",
"(",
"fullname",
")",
"# eventually raises ImportError",
"return",
"None"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/third_party/six/six.py#L218-L223 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2B_DIGEST.__init__ | (self, buffer = None) | This structure is used for a sized buffer that cannot be larger than
the largest digest produced by any hash algorithm implemented on the TPM.
Attributes:
buffer (bytes): The buffer area that can be no larger than a digest | This structure is used for a sized buffer that cannot be larger than
the largest digest produced by any hash algorithm implemented on the TPM. | [
"This",
"structure",
"is",
"used",
"for",
"a",
"sized",
"buffer",
"that",
"cannot",
"be",
"larger",
"than",
"the",
"largest",
"digest",
"produced",
"by",
"any",
"hash",
"algorithm",
"implemented",
"on",
"the",
"TPM",
"."
] | def __init__(self, buffer = None):
""" This structure is used for a sized buffer that cannot be larger than
the largest digest produced by any hash algorithm implemented on the TPM.
Attributes:
buffer (bytes): The buffer area that can be no larger than a digest
"""
s... | [
"def",
"__init__",
"(",
"self",
",",
"buffer",
"=",
"None",
")",
":",
"self",
".",
"buffer",
"=",
"buffer"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L3669-L3676 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.VCHomeRectExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_VCHomeRectExtend(*args, **kwargs) | VCHomeRectExtend(self)
Move caret to before first visible character on line.
If already there move to first character on line.
In either case, extend rectangular selection to new caret position. | VCHomeRectExtend(self) | [
"VCHomeRectExtend",
"(",
"self",
")"
] | def VCHomeRectExtend(*args, **kwargs):
"""
VCHomeRectExtend(self)
Move caret to before first visible character on line.
If already there move to first character on line.
In either case, extend rectangular selection to new caret position.
"""
return _stc.StyledTex... | [
"def",
"VCHomeRectExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_VCHomeRectExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5407-L5415 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosbag/src/rosbag/bag.py | python | Bag._get_entry | (self, t, connections=None) | return first_entry | Return the first index entry on/before the given time on the given connections | Return the first index entry on/before the given time on the given connections | [
"Return",
"the",
"first",
"index",
"entry",
"on",
"/",
"before",
"the",
"given",
"time",
"on",
"the",
"given",
"connections"
] | def _get_entry(self, t, connections=None):
"""
Return the first index entry on/before the given time on the given connections
"""
indexes = self._get_indexes(connections)
entry = _IndexEntry(t)
first_entry = None
for index in indexes:
i = bisect.bis... | [
"def",
"_get_entry",
"(",
"self",
",",
"t",
",",
"connections",
"=",
"None",
")",
":",
"indexes",
"=",
"self",
".",
"_get_indexes",
"(",
"connections",
")",
"entry",
"=",
"_IndexEntry",
"(",
"t",
")",
"first_entry",
"=",
"None",
"for",
"index",
"in",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosbag/src/rosbag/bag.py#L1029-L1046 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/factorization/python/ops/gmm.py | python | GMM.covariances | (self) | return tf.contrib.framework.load_variable(
self.model_dir,
gmm_ops.GmmAlgorithm.CLUSTERS_COVS_VARIABLE) | Returns the covariances. | Returns the covariances. | [
"Returns",
"the",
"covariances",
"."
] | def covariances(self):
"""Returns the covariances."""
return tf.contrib.framework.load_variable(
self.model_dir,
gmm_ops.GmmAlgorithm.CLUSTERS_COVS_VARIABLE) | [
"def",
"covariances",
"(",
"self",
")",
":",
"return",
"tf",
".",
"contrib",
".",
"framework",
".",
"load_variable",
"(",
"self",
".",
"model_dir",
",",
"gmm_ops",
".",
"GmmAlgorithm",
".",
"CLUSTERS_COVS_VARIABLE",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/gmm.py#L164-L168 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/_pprint.py | python | _changed_params | (estimator) | return filtered_params | Return dict (param_name: value) of parameters that were given to
estimator with non-default values. | Return dict (param_name: value) of parameters that were given to
estimator with non-default values. | [
"Return",
"dict",
"(",
"param_name",
":",
"value",
")",
"of",
"parameters",
"that",
"were",
"given",
"to",
"estimator",
"with",
"non",
"-",
"default",
"values",
"."
] | def _changed_params(estimator):
"""Return dict (param_name: value) of parameters that were given to
estimator with non-default values."""
params = estimator.get_params(deep=False)
filtered_params = {}
init_func = getattr(estimator.__init__, 'deprecated_original',
estimator._... | [
"def",
"_changed_params",
"(",
"estimator",
")",
":",
"params",
"=",
"estimator",
".",
"get_params",
"(",
"deep",
"=",
"False",
")",
"filtered_params",
"=",
"{",
"}",
"init_func",
"=",
"getattr",
"(",
"estimator",
".",
"__init__",
",",
"'deprecated_original'",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/_pprint.py#L87-L101 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/position.py | python | Position.prev_close_price | (self, prev_close_price) | Sets the prev_close_price of this Position.
:param prev_close_price: The prev_close_price of this Position. # noqa: E501
:type: float | Sets the prev_close_price of this Position. | [
"Sets",
"the",
"prev_close_price",
"of",
"this",
"Position",
"."
] | def prev_close_price(self, prev_close_price):
"""Sets the prev_close_price of this Position.
:param prev_close_price: The prev_close_price of this Position. # noqa: E501
:type: float
"""
self._prev_close_price = prev_close_price | [
"def",
"prev_close_price",
"(",
"self",
",",
"prev_close_price",
")",
":",
"self",
".",
"_prev_close_price",
"=",
"prev_close_price"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L829-L837 | ||
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/dfxml.py | python | extentdb.add | (self,extent) | Adds an EXTENT (start,length) to the database.
Raises ValueError if there is an intersection. | Adds an EXTENT (start,length) to the database.
Raises ValueError if there is an intersection. | [
"Adds",
"an",
"EXTENT",
"(",
"start",
"length",
")",
"to",
"the",
"database",
".",
"Raises",
"ValueError",
"if",
"there",
"is",
"an",
"intersection",
"."
] | def add(self,extent):
"""Adds an EXTENT (start,length) to the database.
Raises ValueError if there is an intersection."""
v = self.intersects(extent)
if v:
raise ValueError("Cannot add "+str(extent)+": it intersects "+str(v))
self.db.append(extent) | [
"def",
"add",
"(",
"self",
",",
"extent",
")",
":",
"v",
"=",
"self",
".",
"intersects",
"(",
"extent",
")",
"if",
"v",
":",
"raise",
"ValueError",
"(",
"\"Cannot add \"",
"+",
"str",
"(",
"extent",
")",
"+",
"\": it intersects \"",
"+",
"str",
"(",
... | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L1449-L1455 | ||
udacity/CarND-MPC-Project | 5d5d9c55b1b11cfdcf73b0c74b97211fc3566531 | src/Eigen-3.3/debug/gdb/printers.py | python | EigenMatrixPrinter.__init__ | (self, variety, val) | Extract all the necessary information | Extract all the necessary information | [
"Extract",
"all",
"the",
"necessary",
"information"
] | def __init__(self, variety, val):
"Extract all the necessary information"
# Save the variety (presumably "Matrix" or "Array") for later usage
self.variety = variety
# The gdb extension does not support value template arguments - need to extract them by hand
type = val.type
if type.code == gdb.TYPE_COD... | [
"def",
"__init__",
"(",
"self",
",",
"variety",
",",
"val",
")",
":",
"# Save the variety (presumably \"Matrix\" or \"Array\") for later usage",
"self",
".",
"variety",
"=",
"variety",
"# The gdb extension does not support value template arguments - need to extract them by hand",
"... | https://github.com/udacity/CarND-MPC-Project/blob/5d5d9c55b1b11cfdcf73b0c74b97211fc3566531/src/Eigen-3.3/debug/gdb/printers.py#L37-L78 | ||
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | examples/motion_viewer.py | python | FairmotionSimInteractiveViewer.navmesh_config_and_recompute | (self) | Overwrite the NavMesh function to compute more restricted bounds for character. | Overwrite the NavMesh function to compute more restricted bounds for character. | [
"Overwrite",
"the",
"NavMesh",
"function",
"to",
"compute",
"more",
"restricted",
"bounds",
"for",
"character",
"."
] | def navmesh_config_and_recompute(self) -> None:
"""
Overwrite the NavMesh function to compute more restricted bounds for character.
"""
art_obj_mgr, art_cache = self.sim.get_articulated_object_manager(), {}
rgd_obj_mgr, rgd_cache = self.sim.get_rigid_object_manager(), {}
... | [
"def",
"navmesh_config_and_recompute",
"(",
"self",
")",
"->",
"None",
":",
"art_obj_mgr",
",",
"art_cache",
"=",
"self",
".",
"sim",
".",
"get_articulated_object_manager",
"(",
")",
",",
"{",
"}",
"rgd_obj_mgr",
",",
"rgd_cache",
"=",
"self",
".",
"sim",
".... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/examples/motion_viewer.py#L552-L603 | ||
Ewenwan/MVision | 97b394dfa48cb21c82cd003b1a952745e413a17f | deepLearning/03_cnn.py | python | ConvLayer.__init__ | (self, inpt, filter_shape, strides=(1, 1, 1, 1),
padding="SAME", activation=tf.nn.relu, bias_setting=True) | inpt: tf.Tensor, shape [n_examples, witdth, height, channels]
filter_shape: list or tuple, [witdth, height. channels, filter_nums]
strides: list or tuple, the step of filter
padding:
activation:
bias_setting: | inpt: tf.Tensor, shape [n_examples, witdth, height, channels]
filter_shape: list or tuple, [witdth, height. channels, filter_nums]
strides: list or tuple, the step of filter
padding:
activation:
bias_setting: | [
"inpt",
":",
"tf",
".",
"Tensor",
"shape",
"[",
"n_examples",
"witdth",
"height",
"channels",
"]",
"filter_shape",
":",
"list",
"or",
"tuple",
"[",
"witdth",
"height",
".",
"channels",
"filter_nums",
"]",
"strides",
":",
"list",
"or",
"tuple",
"the",
"step... | def __init__(self, inpt, filter_shape, strides=(1, 1, 1, 1),
padding="SAME", activation=tf.nn.relu, bias_setting=True):
"""
inpt: tf.Tensor, shape [n_examples, witdth, height, channels]
filter_shape: list or tuple, [witdth, height. channels, filter_nums]
strides: list or... | [
"def",
"__init__",
"(",
"self",
",",
"inpt",
",",
"filter_shape",
",",
"strides",
"=",
"(",
"1",
",",
"1",
",",
"1",
",",
"1",
")",
",",
"padding",
"=",
"\"SAME\"",
",",
"activation",
"=",
"tf",
".",
"nn",
".",
"relu",
",",
"bias_setting",
"=",
"... | https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/deepLearning/03_cnn.py#L17-L41 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/dataframe.py | python | DataFrame.assign | (self, **kwargs) | Adds columns to DataFrame.
Args:
**kwargs: assignments of the form key=value where key is a string
and value is an `inflow.Series`, a `pandas.Series` or a numpy array.
Raises:
TypeError: keys are not strings.
TypeError: values are not `inflow.Series`, `pandas.Series` or
`numpy.nd... | Adds columns to DataFrame. | [
"Adds",
"columns",
"to",
"DataFrame",
"."
] | def assign(self, **kwargs):
"""Adds columns to DataFrame.
Args:
**kwargs: assignments of the form key=value where key is a string
and value is an `inflow.Series`, a `pandas.Series` or a numpy array.
Raises:
TypeError: keys are not strings.
TypeError: values are not `inflow.Series`,... | [
"def",
"assign",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"k",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"\"The only supported type for k... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/dataframe.py#L42-L76 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/426.convert-binary-search-tree-to-sorted-doubly-linked-list.py | python | Solution.treeToDoublyList | (self, root) | return self.head.right | :type root: Node
:rtype: Node | :type root: Node
:rtype: Node | [
":",
"type",
"root",
":",
"Node",
":",
"rtype",
":",
"Node"
] | def treeToDoublyList(self, root):
"""
:type root: Node
:rtype: Node
"""
if root is None:
return root
self.helper(root)
self.head.right.left.right = self.head.right
return self.head.right | [
"def",
"treeToDoublyList",
"(",
"self",
",",
"root",
")",
":",
"if",
"root",
"is",
"None",
":",
"return",
"root",
"self",
".",
"helper",
"(",
"root",
")",
"self",
".",
"head",
".",
"right",
".",
"left",
".",
"right",
"=",
"self",
".",
"head",
".",
... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/426.convert-binary-search-tree-to-sorted-doubly-linked-list.py#L29-L41 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/SANSUtility.py | python | ConvertToSpecList | (maskstring, firstspec, dimension, orientation) | return speclist | Compile spectra ID list | Compile spectra ID list | [
"Compile",
"spectra",
"ID",
"list"
] | def ConvertToSpecList(maskstring, firstspec, dimension, orientation):
'''Compile spectra ID list'''
if maskstring == '':
return ''
masklist = maskstring.split(',')
speclist = ''
for x in masklist:
x = x.lower()
if '+' in x:
bigPieces = x.split('+')
if ... | [
"def",
"ConvertToSpecList",
"(",
"maskstring",
",",
"firstspec",
",",
"dimension",
",",
"orientation",
")",
":",
"if",
"maskstring",
"==",
"''",
":",
"return",
"''",
"masklist",
"=",
"maskstring",
".",
"split",
"(",
"','",
")",
"speclist",
"=",
"''",
"for"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L2214-L2268 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/syntax.py | python | SynExtensionDelegate.GetXmlObject | (self) | return self._xml | Get the xml object
@return: EditraXml instance | Get the xml object
@return: EditraXml instance | [
"Get",
"the",
"xml",
"object",
"@return",
":",
"EditraXml",
"instance"
] | def GetXmlObject(self):
"""Get the xml object
@return: EditraXml instance
"""
return self._xml | [
"def",
"GetXmlObject",
"(",
"self",
")",
":",
"return",
"self",
".",
"_xml"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/syntax.py#L291-L296 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBlock.GetSibling | (self) | return _lldb.SBBlock_GetSibling(self) | GetSibling(SBBlock self) -> SBBlock
Get the sibling block for this block. | GetSibling(SBBlock self) -> SBBlock | [
"GetSibling",
"(",
"SBBlock",
"self",
")",
"-",
">",
"SBBlock"
] | def GetSibling(self):
"""
GetSibling(SBBlock self) -> SBBlock
Get the sibling block for this block.
"""
return _lldb.SBBlock_GetSibling(self) | [
"def",
"GetSibling",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBBlock_GetSibling",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1315-L1321 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | FileSystem.ChangePathTo | (*args, **kwargs) | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | ChangePathTo(self, String location, bool is_dir=False) | ChangePathTo(self, String location, bool is_dir=False) | [
"ChangePathTo",
"(",
"self",
"String",
"location",
"bool",
"is_dir",
"=",
"False",
")"
] | def ChangePathTo(*args, **kwargs):
"""ChangePathTo(self, String location, bool is_dir=False)"""
return _core_.FileSystem_ChangePathTo(*args, **kwargs) | [
"def",
"ChangePathTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystem_ChangePathTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2416-L2418 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py | python | SelectionMixin._gotitem | (self, key, ndim, subset=None) | sub-classes to define
return a sliced object
Parameters
----------
key : string / list of selections
ndim : 1,2
requested ndim of result
subset : object, default None
subset to act on | sub-classes to define
return a sliced object | [
"sub",
"-",
"classes",
"to",
"define",
"return",
"a",
"sliced",
"object"
] | def _gotitem(self, key, ndim, subset=None):
"""
sub-classes to define
return a sliced object
Parameters
----------
key : string / list of selections
ndim : 1,2
requested ndim of result
subset : object, default None
subset to act on... | [
"def",
"_gotitem",
"(",
"self",
",",
"key",
",",
"ndim",
",",
"subset",
"=",
"None",
")",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py#L233-L247 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py | python | Message.find_rrset | (self, section, name, rdclass, rdtype,
covers=dns.rdatatype.NONE, deleting=None, create=False,
force_unique=False) | return rrset | Find the RRset with the given attributes in the specified section.
@param section: the section of the message to look in, e.g.
self.answer.
@type section: list of dns.rrset.RRset objects
@param name: the name of the RRset
@type name: dns.name.Name object
@param rdclass: ... | Find the RRset with the given attributes in the specified section. | [
"Find",
"the",
"RRset",
"with",
"the",
"given",
"attributes",
"in",
"the",
"specified",
"section",
"."
] | def find_rrset(self, section, name, rdclass, rdtype,
covers=dns.rdatatype.NONE, deleting=None, create=False,
force_unique=False):
"""Find the RRset with the given attributes in the specified section.
@param section: the section of the message to look in, e.g.
... | [
"def",
"find_rrset",
"(",
"self",
",",
"section",
",",
"name",
",",
"rdclass",
",",
"rdtype",
",",
"covers",
"=",
"dns",
".",
"rdatatype",
".",
"NONE",
",",
"deleting",
"=",
"None",
",",
"create",
"=",
"False",
",",
"force_unique",
"=",
"False",
")",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py#L295-L339 | |
LARG/HFO | b8b2a1d462823c6732f4d5581aa7fe2e371d55cb | hfo/hfo.py | python | HFOEnvironment.step | (self) | return hfo_lib.step(self.obj) | Advances the state of the environment | Advances the state of the environment | [
"Advances",
"the",
"state",
"of",
"the",
"environment"
] | def step(self):
""" Advances the state of the environment """
return hfo_lib.step(self.obj) | [
"def",
"step",
"(",
"self",
")",
":",
"return",
"hfo_lib",
".",
"step",
"(",
"self",
".",
"obj",
")"
] | https://github.com/LARG/HFO/blob/b8b2a1d462823c6732f4d5581aa7fe2e371d55cb/hfo/hfo.py#L177-L179 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | MaildirMessage.get_flags | (self) | Return as a string the flags that are set. | Return as a string the flags that are set. | [
"Return",
"as",
"a",
"string",
"the",
"flags",
"that",
"are",
"set",
"."
] | def get_flags(self):
"""Return as a string the flags that are set."""
if self._info.startswith('2,'):
return self._info[2:]
else:
return '' | [
"def",
"get_flags",
"(",
"self",
")",
":",
"if",
"self",
".",
"_info",
".",
"startswith",
"(",
"'2,'",
")",
":",
"return",
"self",
".",
"_info",
"[",
"2",
":",
"]",
"else",
":",
"return",
"''"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1492-L1497 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/view_audio.py | python | AudioDemo.on_play_button_click | (self) | called when user clicks the record button, same button is used to "stop" playback | called when user clicks the record button, same button is used to "stop" playback | [
"called",
"when",
"user",
"clicks",
"the",
"record",
"button",
"same",
"button",
"is",
"used",
"to",
"stop",
"playback"
] | def on_play_button_click(self):
""" called when user clicks the record button, same button is used to "stop" playback """
if self.play_button["text"] == "Play":
self.play_button["text"] = "Stop"
self.rec_button["text"] = "Rec"
self.on_play()
else:
... | [
"def",
"on_play_button_click",
"(",
"self",
")",
":",
"if",
"self",
".",
"play_button",
"[",
"\"text\"",
"]",
"==",
"\"Play\"",
":",
"self",
".",
"play_button",
"[",
"\"text\"",
"]",
"=",
"\"Stop\"",
"self",
".",
"rec_button",
"[",
"\"text\"",
"]",
"=",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/view_audio.py#L530-L538 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/passmanagers.py | python | PassManager.add_dead_code_elimination_pass | (self) | See http://llvm.org/docs/Passes.html#dce-dead-code-elimination. | See http://llvm.org/docs/Passes.html#dce-dead-code-elimination. | [
"See",
"http",
":",
"//",
"llvm",
".",
"org",
"/",
"docs",
"/",
"Passes",
".",
"html#dce",
"-",
"dead",
"-",
"code",
"-",
"elimination",
"."
] | def add_dead_code_elimination_pass(self):
"""See http://llvm.org/docs/Passes.html#dce-dead-code-elimination."""
ffi.lib.LLVMPY_AddDeadCodeEliminationPass(self) | [
"def",
"add_dead_code_elimination_pass",
"(",
"self",
")",
":",
"ffi",
".",
"lib",
".",
"LLVMPY_AddDeadCodeEliminationPass",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/passmanagers.py#L49-L51 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/utils/lui/lldbutil.py | python | ChildVisitingFormatter.__init__ | (self, indent_child=2) | Default indentation of 2 SPC's for the children. | Default indentation of 2 SPC's for the children. | [
"Default",
"indentation",
"of",
"2",
"SPC",
"s",
"for",
"the",
"children",
"."
] | def __init__(self, indent_child=2):
"""Default indentation of 2 SPC's for the children."""
self.cindent = indent_child | [
"def",
"__init__",
"(",
"self",
",",
"indent_child",
"=",
"2",
")",
":",
"self",
".",
"cindent",
"=",
"indent_child"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/utils/lui/lldbutil.py#L989-L991 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | python | MSVSSolution.__init__ | (self, path, version, entries=None, variants=None,
websiteProperties=True) | Initializes the solution.
Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May be None, if the folder is empty.
variants: List of build variant strings. If none, a default list will
... | Initializes the solution. | [
"Initializes",
"the",
"solution",
"."
] | def __init__(self, path, version, entries=None, variants=None,
websiteProperties=True):
"""Initializes the solution.
Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May ... | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"version",
",",
"entries",
"=",
"None",
",",
"variants",
"=",
"None",
",",
"websiteProperties",
"=",
"True",
")",
":",
"self",
".",
"path",
"=",
"path",
"self",
".",
"websiteProperties",
"=",
"websiteProp... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py#L178-L213 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | Int64Argument.WriteArgAccessor | (self, f) | Writes specialized accessor for compound members. | Writes specialized accessor for compound members. | [
"Writes",
"specialized",
"accessor",
"for",
"compound",
"members",
"."
] | def WriteArgAccessor(self, f):
"""Writes specialized accessor for compound members."""
f.write(" %s %s() const volatile {\n" % (self.type, self.name))
f.write(" return static_cast<%s>(\n" % self.type)
f.write(" GLES2Util::MapTwoUint32ToUint64(\n")
f.write(" %s_0,\n" % self.name... | [
"def",
"WriteArgAccessor",
"(",
"self",
",",
"f",
")",
":",
"f",
".",
"write",
"(",
"\" %s %s() const volatile {\\n\"",
"%",
"(",
"self",
".",
"type",
",",
"self",
".",
"name",
")",
")",
"f",
".",
"write",
"(",
"\" return static_cast<%s>(\\n\"",
"%",
"... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9177-L9185 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/learn_runner.py | python | _execute_schedule | (experiment, schedule) | return task() | Execute the method named `schedule` of `experiment`. | Execute the method named `schedule` of `experiment`. | [
"Execute",
"the",
"method",
"named",
"schedule",
"of",
"experiment",
"."
] | def _execute_schedule(experiment, schedule):
"""Execute the method named `schedule` of `experiment`."""
if not hasattr(experiment, schedule):
logging.error('Schedule references non-existent task %s', schedule)
valid_tasks = [x for x in dir(experiment)
if not x.startswith('_')
... | [
"def",
"_execute_schedule",
"(",
"experiment",
",",
"schedule",
")",
":",
"if",
"not",
"hasattr",
"(",
"experiment",
",",
"schedule",
")",
":",
"logging",
".",
"error",
"(",
"'Schedule references non-existent task %s'",
",",
"schedule",
")",
"valid_tasks",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/learn_runner.py#L28-L46 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTypeMember.IsBitfield | (self) | return _lldb.SBTypeMember_IsBitfield(self) | IsBitfield(self) -> bool | IsBitfield(self) -> bool | [
"IsBitfield",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsBitfield(self):
"""IsBitfield(self) -> bool"""
return _lldb.SBTypeMember_IsBitfield(self) | [
"def",
"IsBitfield",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBTypeMember_IsBitfield",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10156-L10158 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/package_index.py | python | PackageIndex.process_index | (self,url,page) | Process the contents of a PyPI page | Process the contents of a PyPI page | [
"Process",
"the",
"contents",
"of",
"a",
"PyPI",
"page"
] | def process_index(self,url,page):
"""Process the contents of a PyPI page"""
def scan(link):
# Process a URL to see if it's for a package page
if link.startswith(self.index_url):
parts = list(map(
unquote, link[len(self.index_url):].split('/')
... | [
"def",
"process_index",
"(",
"self",
",",
"url",
",",
"page",
")",
":",
"def",
"scan",
"(",
"link",
")",
":",
"# Process a URL to see if it's for a package page",
"if",
"link",
".",
"startswith",
"(",
"self",
".",
"index_url",
")",
":",
"parts",
"=",
"list",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/package_index.py#L368-L408 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.FindFileContainingSymbol | (self, symbol) | return self._ConvertFileProtoToFileDescriptor(file_proto) | Gets the FileDescriptor for the file containing the specified symbol.
Args:
symbol: The name of the symbol to search for.
Returns:
A FileDescriptor that contains the specified symbol.
Raises:
KeyError: if the file can not be found in the pool. | Gets the FileDescriptor for the file containing the specified symbol. | [
"Gets",
"the",
"FileDescriptor",
"for",
"the",
"file",
"containing",
"the",
"specified",
"symbol",
"."
] | def FindFileContainingSymbol(self, symbol):
"""Gets the FileDescriptor for the file containing the specified symbol.
Args:
symbol: The name of the symbol to search for.
Returns:
A FileDescriptor that contains the specified symbol.
Raises:
KeyError: if the file can not be found in th... | [
"def",
"FindFileContainingSymbol",
"(",
"self",
",",
"symbol",
")",
":",
"symbol",
"=",
"_NormalizeFullyQualifiedName",
"(",
"symbol",
")",
"try",
":",
"return",
"self",
".",
"_descriptors",
"[",
"symbol",
"]",
".",
"file",
"except",
"KeyError",
":",
"pass",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L208-L241 | |
deepmind/streetlearn | ccf1d60b9c45154894d45a897748aee85d7eb69b | streetlearn/python/environment/streetlearn.py | python | StreetLearn.reward | (self) | return self._reward | Returns the reward for the last time step. | Returns the reward for the last time step. | [
"Returns",
"the",
"reward",
"for",
"the",
"last",
"time",
"step",
"."
] | def reward(self):
"""Returns the reward for the last time step."""
return self._reward | [
"def",
"reward",
"(",
"self",
")",
":",
"return",
"self",
".",
"_reward"
] | https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/streetlearn.py#L383-L385 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/util.py | python | importModuleObjects | (from_module_name, dest_module_name, type_info) | Import object of type 'type_info' (str or type) from module identified
by 'from_module_name' into the module identified by 'dest_module_name'. | Import object of type 'type_info' (str or type) from module identified
by 'from_module_name' into the module identified by 'dest_module_name'. | [
"Import",
"object",
"of",
"type",
"type_info",
"(",
"str",
"or",
"type",
")",
"from",
"module",
"identified",
"by",
"from_module_name",
"into",
"the",
"module",
"identified",
"by",
"dest_module_name",
"."
] | def importModuleObjects(from_module_name, dest_module_name, type_info):
"""Import object of type 'type_info' (str or type) from module identified
by 'from_module_name' into the module identified by 'dest_module_name'."""
# Obtain a reference to the module identifed by 'dest_module_name'
import sys
dest_modul... | [
"def",
"importModuleObjects",
"(",
"from_module_name",
",",
"dest_module_name",
",",
"type_info",
")",
":",
"# Obtain a reference to the module identifed by 'dest_module_name'",
"import",
"sys",
"dest_module",
"=",
"sys",
".",
"modules",
"[",
"dest_module_name",
"]",
"# Ski... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/util.py#L135-L169 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu._DestroyById | (self, id) | Used internally. | Used internally. | [
"Used",
"internally",
"."
] | def _DestroyById(self, id):
""" Used internally. """
item = None
item = self.Remove(id)
if item:
del item | [
"def",
"_DestroyById",
"(",
"self",
",",
"id",
")",
":",
"item",
"=",
"None",
"item",
"=",
"self",
".",
"Remove",
"(",
"id",
")",
"if",
"item",
":",
"del",
"item"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L6640-L6647 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/initfini.py | python | initialize_native_asmparser | () | Initialize the native ASM parser. | Initialize the native ASM parser. | [
"Initialize",
"the",
"native",
"ASM",
"parser",
"."
] | def initialize_native_asmparser():
"""
Initialize the native ASM parser.
"""
ffi.lib.LLVMPY_InitializeNativeAsmParser() | [
"def",
"initialize_native_asmparser",
"(",
")",
":",
"ffi",
".",
"lib",
".",
"LLVMPY_InitializeNativeAsmParser",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/initfini.py#L46-L50 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/decorators.py | python | WithTimeoutAndRetriesFromInstance | (
default_timeout_name=DEFAULT_TIMEOUT_ATTR,
default_retries_name=DEFAULT_RETRIES_ATTR,
min_default_timeout=None) | return decorator | Returns a decorator that handles timeouts and retries.
The provided |default_timeout_name| and |default_retries_name| are used to
get the default timeout value and the default retries value from the object
instance if timeout and retries values are not provided.
Note that this should only be used to decorate ... | Returns a decorator that handles timeouts and retries. | [
"Returns",
"a",
"decorator",
"that",
"handles",
"timeouts",
"and",
"retries",
"."
] | def WithTimeoutAndRetriesFromInstance(
default_timeout_name=DEFAULT_TIMEOUT_ATTR,
default_retries_name=DEFAULT_RETRIES_ATTR,
min_default_timeout=None):
"""Returns a decorator that handles timeouts and retries.
The provided |default_timeout_name| and |default_retries_name| are used to
get the default ... | [
"def",
"WithTimeoutAndRetriesFromInstance",
"(",
"default_timeout_name",
"=",
"DEFAULT_TIMEOUT_ATTR",
",",
"default_retries_name",
"=",
"DEFAULT_RETRIES_ATTR",
",",
"min_default_timeout",
"=",
"None",
")",
":",
"def",
"decorator",
"(",
"f",
")",
":",
"def",
"get_timeout... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/decorators.py#L144-L175 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py | python | masked_all | (shape, dtype=float) | return a | Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the
data are masked.
Parameters
----------
shape : tuple
Shape of the required MaskedArray.
dtype : dtype, optional
Data type of the output.
Returns
------... | Empty masked array with all elements masked. | [
"Empty",
"masked",
"array",
"with",
"all",
"elements",
"masked",
"."
] | def masked_all(shape, dtype=float):
"""
Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the
data are masked.
Parameters
----------
shape : tuple
Shape of the required MaskedArray.
dtype : dtype, optional
... | [
"def",
"masked_all",
"(",
"shape",
",",
"dtype",
"=",
"float",
")",
":",
"a",
"=",
"masked_array",
"(",
"np",
".",
"empty",
"(",
"shape",
",",
"dtype",
")",
",",
"mask",
"=",
"np",
".",
"ones",
"(",
"shape",
",",
"make_mask_descr",
"(",
"dtype",
")... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py#L115-L164 | |
jiangxiluning/FOTS.PyTorch | b1851c170b4f1ad18406766352cb5171648ce603 | FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py | python | validate_lines_in_file | (fileName,file_contents,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0) | This function validates that all lines of the file calling the Line validation function for each line | This function validates that all lines of the file calling the Line validation function for each line | [
"This",
"function",
"validates",
"that",
"all",
"lines",
"of",
"the",
"file",
"calling",
"the",
"Line",
"validation",
"function",
"for",
"each",
"line"
] | def validate_lines_in_file(fileName,file_contents,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0):
"""
This function validates that all lines of the file calling the Line validation function for each line
"""
utf8File = decode_utf8(file_contents)
if (utf8File i... | [
"def",
"validate_lines_in_file",
"(",
"fileName",
",",
"file_contents",
",",
"CRLF",
"=",
"True",
",",
"LTRB",
"=",
"True",
",",
"withTranscription",
"=",
"False",
",",
"withConfidence",
"=",
"False",
",",
"imWidth",
"=",
"0",
",",
"imHeight",
"=",
"0",
")... | https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py#L92-L107 | ||
githubharald/CTCWordBeamSearch | 43567e5b06dd43bdcbec452f5099171c81f5e737 | extras/prototype/PrefixTree.py | python | PrefixTree.getNode | (self, text) | return node | get node representing given text | get node representing given text | [
"get",
"node",
"representing",
"given",
"text"
] | def getNode(self, text):
"get node representing given text"
node = self.root
for c in text:
if c in node.children:
node = node.children[c]
else:
return None
return node | [
"def",
"getNode",
"(",
"self",
",",
"text",
")",
":",
"node",
"=",
"self",
".",
"root",
"for",
"c",
"in",
"text",
":",
"if",
"c",
"in",
"node",
".",
"children",
":",
"node",
"=",
"node",
".",
"children",
"[",
"c",
"]",
"else",
":",
"return",
"N... | https://github.com/githubharald/CTCWordBeamSearch/blob/43567e5b06dd43bdcbec452f5099171c81f5e737/extras/prototype/PrefixTree.py#L37-L45 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/engine/topology.py | python | Container.set_weights | (self, weights) | Sets the weights of the model.
Arguments:
weights: A list of Numpy arrays with shapes and types matching
the output of `model.get_weights()`. | Sets the weights of the model. | [
"Sets",
"the",
"weights",
"of",
"the",
"model",
"."
] | def set_weights(self, weights):
"""Sets the weights of the model.
Arguments:
weights: A list of Numpy arrays with shapes and types matching
the output of `model.get_weights()`.
"""
tuples = []
for layer in self.layers:
num_param = len(layer.weights)
layer_weights = w... | [
"def",
"set_weights",
"(",
"self",
",",
"weights",
")",
":",
"tuples",
"=",
"[",
"]",
"for",
"layer",
"in",
"self",
".",
"layers",
":",
"num_param",
"=",
"len",
"(",
"layer",
".",
"weights",
")",
"layer_weights",
"=",
"weights",
"[",
":",
"num_param",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/engine/topology.py#L1675-L1689 | ||
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/export_fbx_bin.py | python | fbx_header_elements | (root, scene_data, time=None) | Write boiling code of FBX root.
time is expected to be a datetime.datetime object, or None (using now() in this case). | Write boiling code of FBX root.
time is expected to be a datetime.datetime object, or None (using now() in this case). | [
"Write",
"boiling",
"code",
"of",
"FBX",
"root",
".",
"time",
"is",
"expected",
"to",
"be",
"a",
"datetime",
".",
"datetime",
"object",
"or",
"None",
"(",
"using",
"now",
"()",
"in",
"this",
"case",
")",
"."
] | def fbx_header_elements(root, scene_data, time=None):
"""
Write boiling code of FBX root.
time is expected to be a datetime.datetime object, or None (using now() in this case).
"""
app_vendor = "Blender Foundation"
app_name = "Blender (stable FBX IO)"
app_ver = bpy.app.version_string
im... | [
"def",
"fbx_header_elements",
"(",
"root",
",",
"scene_data",
",",
"time",
"=",
"None",
")",
":",
"app_vendor",
"=",
"\"Blender Foundation\"",
"app_name",
"=",
"\"Blender (stable FBX IO)\"",
"app_ver",
"=",
"bpy",
".",
"app",
".",
"version_string",
"import",
"addo... | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/export_fbx_bin.py#L2661-L2786 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/__init__.py | python | tosequence | (x) | Cast iterable x to a Sequence, avoiding a copy if possible.
Parameters
----------
x : iterable | Cast iterable x to a Sequence, avoiding a copy if possible. | [
"Cast",
"iterable",
"x",
"to",
"a",
"Sequence",
"avoiding",
"a",
"copy",
"if",
"possible",
"."
] | def tosequence(x):
"""Cast iterable x to a Sequence, avoiding a copy if possible.
Parameters
----------
x : iterable
"""
if isinstance(x, np.ndarray):
return np.asarray(x)
elif isinstance(x, Sequence):
return x
else:
return list(x) | [
"def",
"tosequence",
"(",
"x",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"np",
".",
"ndarray",
")",
":",
"return",
"np",
".",
"asarray",
"(",
"x",
")",
"elif",
"isinstance",
"(",
"x",
",",
"Sequence",
")",
":",
"return",
"x",
"else",
":",
"ret... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/__init__.py#L831-L843 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/aio/_server.py | python | server | (migration_thread_pool: Optional[Executor] = None,
handlers: Optional[Sequence[grpc.GenericRpcHandler]] = None,
interceptors: Optional[Sequence[Any]] = None,
options: Optional[ChannelArgumentType] = None,
maximum_concurrent_rpcs: Optional[int] = None,
compression: ... | return Server(migration_thread_pool, () if handlers is None else handlers,
() if interceptors is None else interceptors,
() if options is None else options, maximum_concurrent_rpcs,
compression) | Creates a Server with which RPCs can be serviced.
Args:
migration_thread_pool: A futures.ThreadPoolExecutor to be used by the
Server to execute non-AsyncIO RPC handlers for migration purpose.
handlers: An optional list of GenericRpcHandlers used for executing RPCs.
More handlers may be ... | Creates a Server with which RPCs can be serviced. | [
"Creates",
"a",
"Server",
"with",
"which",
"RPCs",
"can",
"be",
"serviced",
"."
] | def server(migration_thread_pool: Optional[Executor] = None,
handlers: Optional[Sequence[grpc.GenericRpcHandler]] = None,
interceptors: Optional[Sequence[Any]] = None,
options: Optional[ChannelArgumentType] = None,
maximum_concurrent_rpcs: Optional[int] = None,
com... | [
"def",
"server",
"(",
"migration_thread_pool",
":",
"Optional",
"[",
"Executor",
"]",
"=",
"None",
",",
"handlers",
":",
"Optional",
"[",
"Sequence",
"[",
"grpc",
".",
"GenericRpcHandler",
"]",
"]",
"=",
"None",
",",
"interceptors",
":",
"Optional",
"[",
"... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_server.py#L176-L210 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/devices.py | python | _DeviceList.__getitem__ | (self, devnum) | return self.lst[devnum] | Returns the context manager for device *devnum*. | Returns the context manager for device *devnum*. | [
"Returns",
"the",
"context",
"manager",
"for",
"device",
"*",
"devnum",
"*",
"."
] | def __getitem__(self, devnum):
'''
Returns the context manager for device *devnum*.
'''
return self.lst[devnum] | [
"def",
"__getitem__",
"(",
"self",
",",
"devnum",
")",
":",
"return",
"self",
".",
"lst",
"[",
"devnum",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/devices.py#L37-L41 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/glibc.py | python | libc_ver | () | Try to determine the glibc version
Returns a tuple of strings (lib, version) which default to empty strings
in case the lookup fails. | Try to determine the glibc version | [
"Try",
"to",
"determine",
"the",
"glibc",
"version"
] | def libc_ver():
"""Try to determine the glibc version
Returns a tuple of strings (lib, version) which default to empty strings
in case the lookup fails.
"""
glibc_version = glibc_version_string()
if glibc_version is None:
return ("", "")
else:
return ("glibc", glibc_version) | [
"def",
"libc_ver",
"(",
")",
":",
"glibc_version",
"=",
"glibc_version_string",
"(",
")",
"if",
"glibc_version",
"is",
"None",
":",
"return",
"(",
"\"\"",
",",
"\"\"",
")",
"else",
":",
"return",
"(",
"\"glibc\"",
",",
"glibc_version",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/glibc.py#L76-L86 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/rsa/rsa/varblock.py | python | yield_varblocks | (infile) | Generator, yields each block in the input file.
@param infile: file to read, is expected to have the VARBLOCK format as
described in the module's docstring.
@yields the contents of each block. | Generator, yields each block in the input file. | [
"Generator",
"yields",
"each",
"block",
"in",
"the",
"input",
"file",
"."
] | def yield_varblocks(infile):
'''Generator, yields each block in the input file.
@param infile: file to read, is expected to have the VARBLOCK format as
described in the module's docstring.
@yields the contents of each block.
'''
# Check the version number
first_char = infile.read(1)
... | [
"def",
"yield_varblocks",
"(",
"infile",
")",
":",
"# Check the version number",
"first_char",
"=",
"infile",
".",
"read",
"(",
"1",
")",
"if",
"len",
"(",
"first_char",
")",
"==",
"0",
":",
"raise",
"EOFError",
"(",
"'Unable to read VARBLOCK version number'",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/varblock.py#L103-L134 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/pytree.py | python | Base.remove | (self) | Remove the node from the tree. Returns the position of the node in its
parent's children before it was removed. | Remove the node from the tree. Returns the position of the node in its
parent's children before it was removed. | [
"Remove",
"the",
"node",
"from",
"the",
"tree",
".",
"Returns",
"the",
"position",
"of",
"the",
"node",
"in",
"its",
"parent",
"s",
"children",
"before",
"it",
"was",
"removed",
"."
] | def remove(self):
"""
Remove the node from the tree. Returns the position of the node in its
parent's children before it was removed.
"""
if self.parent:
for i, node in enumerate(self.parent.children):
if node is self:
self.parent.c... | [
"def",
"remove",
"(",
"self",
")",
":",
"if",
"self",
".",
"parent",
":",
"for",
"i",
",",
"node",
"in",
"enumerate",
"(",
"self",
".",
"parent",
".",
"children",
")",
":",
"if",
"node",
"is",
"self",
":",
"self",
".",
"parent",
".",
"changed",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/pytree.py#L170-L181 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_reactor.py | python | Container.create_sender | (
self,
context: Union[str, Url, Connection],
target: Optional[str] = None,
source: Optional[str] = None,
name: Optional[str] = None,
handler: Optional[Handler] = None,
tags: Optional[Callable[[], bytes]] = None,
options: Op... | return snd | Initiates the establishment of a link over which messages can
be sent.
There are two patterns of use:
1. A connection can be passed as the first argument, in which
case the link is established on that connection. In this case
the target address can be specified as the ... | Initiates the establishment of a link over which messages can
be sent. | [
"Initiates",
"the",
"establishment",
"of",
"a",
"link",
"over",
"which",
"messages",
"can",
"be",
"sent",
"."
] | def create_sender(
self,
context: Union[str, Url, Connection],
target: Optional[str] = None,
source: Optional[str] = None,
name: Optional[str] = None,
handler: Optional[Handler] = None,
tags: Optional[Callable[[], bytes]] = None,
... | [
"def",
"create_sender",
"(",
"self",
",",
"context",
":",
"Union",
"[",
"str",
",",
"Url",
",",
"Connection",
"]",
",",
"target",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"source",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"nam... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_reactor.py#L1424-L1483 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/fuchsia/common.py | python | EnsurePathExists | (path) | return path | Checks that the file |path| exists on the filesystem and returns the path
if it does, raising an exception otherwise. | Checks that the file |path| exists on the filesystem and returns the path
if it does, raising an exception otherwise. | [
"Checks",
"that",
"the",
"file",
"|path|",
"exists",
"on",
"the",
"filesystem",
"and",
"returns",
"the",
"path",
"if",
"it",
"does",
"raising",
"an",
"exception",
"otherwise",
"."
] | def EnsurePathExists(path):
"""Checks that the file |path| exists on the filesystem and returns the path
if it does, raising an exception otherwise."""
if not os.path.exists(path):
raise IOError('Missing file: ' + path)
return path | [
"def",
"EnsurePathExists",
"(",
"path",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"raise",
"IOError",
"(",
"'Missing file: '",
"+",
"path",
")",
"return",
"path"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/common.py#L21-L28 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py | python | OrderedDict.keys | (self) | return _OrderedDictKeysView(self) | D.keys() -> a set-like object providing a view on D's keys | D.keys() -> a set-like object providing a view on D's keys | [
"D",
".",
"keys",
"()",
"-",
">",
"a",
"set",
"-",
"like",
"object",
"providing",
"a",
"view",
"on",
"D",
"s",
"keys"
] | def keys(self):
"D.keys() -> a set-like object providing a view on D's keys"
return _OrderedDictKeysView(self) | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"_OrderedDictKeysView",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py#L226-L228 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py | python | _BaseNetwork.is_private | (self) | return (self.network_address.is_private and
self.broadcast_address.is_private) | Test if this address is allocated for private networks.
Returns:
A boolean, True if the address is reserved per
iana-ipv4-special-registry or iana-ipv6-special-registry. | Test if this address is allocated for private networks. | [
"Test",
"if",
"this",
"address",
"is",
"allocated",
"for",
"private",
"networks",
"."
] | def is_private(self):
"""Test if this address is allocated for private networks.
Returns:
A boolean, True if the address is reserved per
iana-ipv4-special-registry or iana-ipv6-special-registry.
"""
return (self.network_address.is_private and
sel... | [
"def",
"is_private",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"network_address",
".",
"is_private",
"and",
"self",
".",
"broadcast_address",
".",
"is_private",
")"
] | 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/ipaddress.py#L1145-L1154 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/pyratemp.py | python | Template.__init__ | (self, string=None,filename=None,parsetree=None, encoding='utf-8', data=None, escape=HTML,
loader_class=LoaderFile,
parser_class=Parser,
renderer_class=Renderer,
eval_class=EvalPseudoSandbox,
escape_func=escape) | Load (+parse) a template.
:Parameters:
- `string,filename,parsetree`: a template-string,
filename of a template to load,
or a template-parsetree.
(only one of these 3 is ... | Load (+parse) a template. | [
"Load",
"(",
"+",
"parse",
")",
"a",
"template",
"."
] | def __init__(self, string=None,filename=None,parsetree=None, encoding='utf-8', data=None, escape=HTML,
loader_class=LoaderFile,
parser_class=Parser,
renderer_class=Renderer,
eval_class=EvalPseudoSandbox,
escape_func=escape):
"""Load (+parse) a template... | [
"def",
"__init__",
"(",
"self",
",",
"string",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"parsetree",
"=",
"None",
",",
"encoding",
"=",
"'utf-8'",
",",
"data",
"=",
"None",
",",
"escape",
"=",
"HTML",
",",
"loader_class",
"=",
"LoaderFile",
",",... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/pyratemp.py#L1129-L1177 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib2to3/pytree.py | python | Base.__ne__ | (self, other) | return not self._eq(other) | Compare two nodes for inequality.
This calls the method _eq(). | Compare two nodes for inequality. | [
"Compare",
"two",
"nodes",
"for",
"inequality",
"."
] | def __ne__(self, other):
"""
Compare two nodes for inequality.
This calls the method _eq().
"""
if self.__class__ is not other.__class__:
return NotImplemented
return not self._eq(other) | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"__class__",
"is",
"not",
"other",
".",
"__class__",
":",
"return",
"NotImplemented",
"return",
"not",
"self",
".",
"_eq",
"(",
"other",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/pytree.py#L67-L75 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py | python | Element.update_all_atts_coercion | (self, dict_, replace = True,
and_source = False) | Updates all attributes from node or dictionary `dict_`.
Appends the basic attributes ('ids', 'names', 'classes',
'dupnames', but not 'source') and then, for all other attributes in
dict_, updates the same attribute in self. When attributes with the
same identifier appear in both self a... | Updates all attributes from node or dictionary `dict_`. | [
"Updates",
"all",
"attributes",
"from",
"node",
"or",
"dictionary",
"dict_",
"."
] | def update_all_atts_coercion(self, dict_, replace = True,
and_source = False):
"""
Updates all attributes from node or dictionary `dict_`.
Appends the basic attributes ('ids', 'names', 'classes',
'dupnames', but not 'source') and then, for all other attr... | [
"def",
"update_all_atts_coercion",
"(",
"self",
",",
"dict_",
",",
"replace",
"=",
"True",
",",
"and_source",
"=",
"False",
")",
":",
"self",
".",
"update_all_atts",
"(",
"dict_",
",",
"Element",
".",
"copy_attr_coerce",
",",
"replace",
",",
"and_source",
")... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py#L877-L900 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | TurtleScreenBase._ondrag | (self, item, fun, num=1, add=None) | Bind fun to mouse-move-event (with pressed mouse button) on turtle.
fun must be a function with two arguments, the coordinates of the
actual mouse position on the canvas.
num, the number of the mouse-button defaults to 1
Every sequence of mouse-move-events on a turtle is preceded by a
... | Bind fun to mouse-move-event (with pressed mouse button) on turtle.
fun must be a function with two arguments, the coordinates of the
actual mouse position on the canvas.
num, the number of the mouse-button defaults to 1 | [
"Bind",
"fun",
"to",
"mouse",
"-",
"move",
"-",
"event",
"(",
"with",
"pressed",
"mouse",
"button",
")",
"on",
"turtle",
".",
"fun",
"must",
"be",
"a",
"function",
"with",
"two",
"arguments",
"the",
"coordinates",
"of",
"the",
"actual",
"mouse",
"positio... | def _ondrag(self, item, fun, num=1, add=None):
"""Bind fun to mouse-move-event (with pressed mouse button) on turtle.
fun must be a function with two arguments, the coordinates of the
actual mouse position on the canvas.
num, the number of the mouse-button defaults to 1
Every se... | [
"def",
"_ondrag",
"(",
"self",
",",
"item",
",",
"fun",
",",
"num",
"=",
"1",
",",
"add",
"=",
"None",
")",
":",
"if",
"fun",
"is",
"None",
":",
"self",
".",
"cv",
".",
"tag_unbind",
"(",
"item",
",",
"\"<Button%s-Motion>\"",
"%",
"num",
")",
"el... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L639-L658 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/cygwinccompiler.py | python | is_cygwingcc | () | return out_string.strip().endswith(b'cygwin') | Try to determine if the gcc that would be used is from cygwin. | Try to determine if the gcc that would be used is from cygwin. | [
"Try",
"to",
"determine",
"if",
"the",
"gcc",
"that",
"would",
"be",
"used",
"is",
"from",
"cygwin",
"."
] | def is_cygwingcc():
'''Try to determine if the gcc that would be used is from cygwin.'''
out_string = check_output(['gcc', '-dumpmachine'])
return out_string.strip().endswith(b'cygwin') | [
"def",
"is_cygwingcc",
"(",
")",
":",
"out_string",
"=",
"check_output",
"(",
"[",
"'gcc'",
",",
"'-dumpmachine'",
"]",
")",
"return",
"out_string",
".",
"strip",
"(",
")",
".",
"endswith",
"(",
"b'cygwin'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/cygwinccompiler.py#L400-L403 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathPocket.py | python | ObjectPocket.groupConnectedEdges | (self, holding) | return (low, high) | groupConnectedEdges(self, holding)
Take edges and determine which are connected.
Group connected chains/loops into: low and high | groupConnectedEdges(self, holding)
Take edges and determine which are connected.
Group connected chains/loops into: low and high | [
"groupConnectedEdges",
"(",
"self",
"holding",
")",
"Take",
"edges",
"and",
"determine",
"which",
"are",
"connected",
".",
"Group",
"connected",
"chains",
"/",
"loops",
"into",
":",
"low",
"and",
"high"
] | def groupConnectedEdges(self, holding):
"""groupConnectedEdges(self, holding)
Take edges and determine which are connected.
Group connected chains/loops into: low and high"""
holds = []
grps = []
searched = []
stop = False
attachments = []
loops = ... | [
"def",
"groupConnectedEdges",
"(",
"self",
",",
"holding",
")",
":",
"holds",
"=",
"[",
"]",
"grps",
"=",
"[",
"]",
"searched",
"=",
"[",
"]",
"stop",
"=",
"False",
"attachments",
"=",
"[",
"]",
"loops",
"=",
"1",
"def",
"updateAttachments",
"(",
"gr... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathPocket.py#L681-L819 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/implement-magic-dictionary.py | python | MagicDictionary.search | (self, word) | return find(word, self.trie, 0, True) | Returns if there is any word in the trie that equals to the given word after modifying exactly one character
:type word: str
:rtype: bool | Returns if there is any word in the trie that equals to the given word after modifying exactly one character
:type word: str
:rtype: bool | [
"Returns",
"if",
"there",
"is",
"any",
"word",
"in",
"the",
"trie",
"that",
"equals",
"to",
"the",
"given",
"word",
"after",
"modifying",
"exactly",
"one",
"character",
":",
"type",
"word",
":",
"str",
":",
"rtype",
":",
"bool"
] | def search(self, word):
"""
Returns if there is any word in the trie that equals to the given word after modifying exactly one character
:type word: str
:rtype: bool
"""
def find(word, curr, i, mistakeAllowed):
if i == len(word):
return "_end" ... | [
"def",
"search",
"(",
"self",
",",
"word",
")",
":",
"def",
"find",
"(",
"word",
",",
"curr",
",",
"i",
",",
"mistakeAllowed",
")",
":",
"if",
"i",
"==",
"len",
"(",
"word",
")",
":",
"return",
"\"_end\"",
"in",
"curr",
"and",
"not",
"mistakeAllowe... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/implement-magic-dictionary.py#L27-L47 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | thirdparty/parser/sm/js/src/build/win32/pgomerge.py | python | MergePGOFiles | (basename, pgddir, pgcdir) | Merge pgc files produced from an instrumented binary
into the pgd file for the second pass of profile-guided optimization
with MSVC. |basename| is the name of the DLL or EXE without the
extension. |pgddir| is the path that contains <basename>.pgd
(should be the objdir it was built in). |pgcdir| i... | Merge pgc files produced from an instrumented binary
into the pgd file for the second pass of profile-guided optimization
with MSVC. |basename| is the name of the DLL or EXE without the
extension. |pgddir| is the path that contains <basename>.pgd
(should be the objdir it was built in). |pgcdir| i... | [
"Merge",
"pgc",
"files",
"produced",
"from",
"an",
"instrumented",
"binary",
"into",
"the",
"pgd",
"file",
"for",
"the",
"second",
"pass",
"of",
"profile",
"-",
"guided",
"optimization",
"with",
"MSVC",
".",
"|basename|",
"is",
"the",
"name",
"of",
"the",
... | def MergePGOFiles(basename, pgddir, pgcdir):
"""Merge pgc files produced from an instrumented binary
into the pgd file for the second pass of profile-guided optimization
with MSVC. |basename| is the name of the DLL or EXE without the
extension. |pgddir| is the path that contains <basename>.pgd
(... | [
"def",
"MergePGOFiles",
"(",
"basename",
",",
"pgddir",
",",
"pgcdir",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"pgddir",
")",
"or",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"pgcdir",
")",
":",
"return",
"pgdfile",
"=",
"os"... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/thirdparty/parser/sm/js/src/build/win32/pgomerge.py#L11-L34 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/FlowGraph.py | python | FlowGraph.rewrite | (self) | Flag the namespace to be renewed. | Flag the namespace to be renewed. | [
"Flag",
"the",
"namespace",
"to",
"be",
"renewed",
"."
] | def rewrite(self):
"""
Flag the namespace to be renewed.
"""
self.renew_namespace()
Element.rewrite(self) | [
"def",
"rewrite",
"(",
"self",
")",
":",
"self",
".",
"renew_namespace",
"(",
")",
"Element",
".",
"rewrite",
"(",
"self",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/FlowGraph.py#L225-L230 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/thrift/transport/TZlibTransport.py | python | TZlibTransport.write | (self, buf) | Write some bytes, putting them into the internal write
buffer for eventual compression. | Write some bytes, putting them into the internal write
buffer for eventual compression. | [
"Write",
"some",
"bytes",
"putting",
"them",
"into",
"the",
"internal",
"write",
"buffer",
"for",
"eventual",
"compression",
"."
] | def write(self, buf):
'''
Write some bytes, putting them into the internal write
buffer for eventual compression.
'''
self.__wbuf.write(buf) | [
"def",
"write",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"__wbuf",
".",
"write",
"(",
"buf",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/thrift/transport/TZlibTransport.py#L222-L227 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py | python | _labels_inertia | (X, sample_weight, x_squared_norms, centers,
precompute_distances=True, distances=None) | return labels, inertia | E step of the K-means EM algorithm.
Compute the labels and the inertia of the given samples and centers.
This will compute the distances in-place.
Parameters
----------
X : float64 array-like or CSR sparse matrix, shape (n_samples, n_features)
The input samples to assign to the labels.
... | E step of the K-means EM algorithm. | [
"E",
"step",
"of",
"the",
"K",
"-",
"means",
"EM",
"algorithm",
"."
] | def _labels_inertia(X, sample_weight, x_squared_norms, centers,
precompute_distances=True, distances=None):
"""E step of the K-means EM algorithm.
Compute the labels and the inertia of the given samples and centers.
This will compute the distances in-place.
Parameters
---------... | [
"def",
"_labels_inertia",
"(",
"X",
",",
"sample_weight",
",",
"x_squared_norms",
",",
"centers",
",",
"precompute_distances",
"=",
"True",
",",
"distances",
"=",
"None",
")",
":",
"n_samples",
"=",
"X",
".",
"shape",
"[",
"0",
"]",
"sample_weight",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py#L509-L566 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py | python | splitquery | (url) | return url, None | splitquery('/path?query') --> '/path', 'query'. | splitquery('/path?query') --> '/path', 'query'. | [
"splitquery",
"(",
"/",
"path?query",
")",
"--",
">",
"/",
"path",
"query",
"."
] | def splitquery(url):
"""splitquery('/path?query') --> '/path', 'query'."""
global _queryprog
if _queryprog is None:
import re
_queryprog = re.compile('^(.*)\?([^?]*)$')
match = _queryprog.match(url)
if match: return match.group(1, 2)
return url, None | [
"def",
"splitquery",
"(",
"url",
")",
":",
"global",
"_queryprog",
"if",
"_queryprog",
"is",
"None",
":",
"import",
"re",
"_queryprog",
"=",
"re",
".",
"compile",
"(",
"'^(.*)\\?([^?]*)$'",
")",
"match",
"=",
"_queryprog",
".",
"match",
"(",
"url",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L1154-L1163 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlWindow.OnLinkClicked | (*args, **kwargs) | return _html.HtmlWindow_OnLinkClicked(*args, **kwargs) | OnLinkClicked(self, HtmlLinkInfo link) | OnLinkClicked(self, HtmlLinkInfo link) | [
"OnLinkClicked",
"(",
"self",
"HtmlLinkInfo",
"link",
")"
] | def OnLinkClicked(*args, **kwargs):
"""OnLinkClicked(self, HtmlLinkInfo link)"""
return _html.HtmlWindow_OnLinkClicked(*args, **kwargs) | [
"def",
"OnLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindow_OnLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1114-L1116 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Log.Suspend | (*args, **kwargs) | return _misc_.Log_Suspend(*args, **kwargs) | Suspend() | Suspend() | [
"Suspend",
"()"
] | def Suspend(*args, **kwargs):
"""Suspend()"""
return _misc_.Log_Suspend(*args, **kwargs) | [
"def",
"Suspend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Log_Suspend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1525-L1527 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/framework/framework.py | python | set_default_dtype | (d) | Set default dtype. The default dtype is initially float32
Args:
d(string|np.dtype): the dtype to make the default. It only
supports float16, float32 and float64.
Returns:
None.
Examples:
.. code-block:: python
import paddle
padd... | Set default dtype. The default dtype is initially float32 | [
"Set",
"default",
"dtype",
".",
"The",
"default",
"dtype",
"is",
"initially",
"float32"
] | def set_default_dtype(d):
"""
Set default dtype. The default dtype is initially float32
Args:
d(string|np.dtype): the dtype to make the default. It only
supports float16, float32 and float64.
Returns:
None.
Examples:
.. code-block:: python
... | [
"def",
"set_default_dtype",
"(",
"d",
")",
":",
"if",
"isinstance",
"(",
"d",
",",
"type",
")",
":",
"if",
"d",
"in",
"[",
"np",
".",
"float16",
",",
"np",
".",
"float32",
",",
"np",
".",
"float64",
"]",
":",
"d",
"=",
"d",
".",
"__name__",
"el... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/framework/framework.py#L25-L66 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBSection.GetLoadAddress | (self, target) | return _lldb.SBSection_GetLoadAddress(self, target) | GetLoadAddress(SBSection self, SBTarget target) -> lldb::addr_t | GetLoadAddress(SBSection self, SBTarget target) -> lldb::addr_t | [
"GetLoadAddress",
"(",
"SBSection",
"self",
"SBTarget",
"target",
")",
"-",
">",
"lldb",
"::",
"addr_t"
] | def GetLoadAddress(self, target):
"""GetLoadAddress(SBSection self, SBTarget target) -> lldb::addr_t"""
return _lldb.SBSection_GetLoadAddress(self, target) | [
"def",
"GetLoadAddress",
"(",
"self",
",",
"target",
")",
":",
"return",
"_lldb",
".",
"SBSection_GetLoadAddress",
"(",
"self",
",",
"target",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9292-L9294 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/bindings/python/llvm/core.py | python | MemoryBuffer.__init__ | (self, filename=None) | Create a new memory buffer.
Currently, we support creating from the contents of a file at the
specified filename. | Create a new memory buffer. | [
"Create",
"a",
"new",
"memory",
"buffer",
"."
] | def __init__(self, filename=None):
"""Create a new memory buffer.
Currently, we support creating from the contents of a file at the
specified filename.
"""
if filename is None:
raise Exception("filename argument must be defined")
memory = c_object_p()
... | [
"def",
"__init__",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"if",
"filename",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"filename argument must be defined\"",
")",
"memory",
"=",
"c_object_p",
"(",
")",
"out",
"=",
"c_char_p",
"(",
"None",
... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/bindings/python/llvm/core.py#L149-L167 | ||
Lavender105/DFF | 152397cec4a3dac2aa86e92a65cc27e6c8016ab9 | pytorch-encoding/encoding/models/model_store.py | python | purge | (root='./pretrain_models') | r"""Purge all pretrained model files in local file store.
Parameters
----------
root : str, default './pretrain_models'
Location for keeping the model parameters. | r"""Purge all pretrained model files in local file store. | [
"r",
"Purge",
"all",
"pretrained",
"model",
"files",
"in",
"local",
"file",
"store",
"."
] | def purge(root='./pretrain_models'):
r"""Purge all pretrained model files in local file store.
Parameters
----------
root : str, default './pretrain_models'
Location for keeping the model parameters.
"""
root = os.path.expanduser(root)
files = os.listdir(root)
for f in files:
... | [
"def",
"purge",
"(",
"root",
"=",
"'./pretrain_models'",
")",
":",
"root",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"root",
")",
"files",
"=",
"os",
".",
"listdir",
"(",
"root",
")",
"for",
"f",
"in",
"files",
":",
"if",
"f",
".",
"endswith"... | https://github.com/Lavender105/DFF/blob/152397cec4a3dac2aa86e92a65cc27e6c8016ab9/pytorch-encoding/encoding/models/model_store.py#L79-L91 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | LinearExpr.Sum | (cls, expressions) | return _SumArray(expressions) | Creates the expression sum(expressions). | Creates the expression sum(expressions). | [
"Creates",
"the",
"expression",
"sum",
"(",
"expressions",
")",
"."
] | def Sum(cls, expressions):
"""Creates the expression sum(expressions)."""
if len(expressions) == 1:
return expressions[0]
return _SumArray(expressions) | [
"def",
"Sum",
"(",
"cls",
",",
"expressions",
")",
":",
"if",
"len",
"(",
"expressions",
")",
"==",
"1",
":",
"return",
"expressions",
"[",
"0",
"]",
"return",
"_SumArray",
"(",
"expressions",
")"
] | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L180-L184 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridInterface.EditorValidate | (*args, **kwargs) | return _propgrid.PropertyGridInterface_EditorValidate(*args, **kwargs) | EditorValidate(self) -> bool | EditorValidate(self) -> bool | [
"EditorValidate",
"(",
"self",
")",
"-",
">",
"bool"
] | def EditorValidate(*args, **kwargs):
"""EditorValidate(self) -> bool"""
return _propgrid.PropertyGridInterface_EditorValidate(*args, **kwargs) | [
"def",
"EditorValidate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_EditorValidate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1142-L1144 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_polygon.py | python | PolygonDomain.setFilled | (self, polygonID, filled) | setFilled(string, bool) -> None
Sets the filled status of the polygon | setFilled(string, bool) -> None
Sets the filled status of the polygon | [
"setFilled",
"(",
"string",
"bool",
")",
"-",
">",
"None",
"Sets",
"the",
"filled",
"status",
"of",
"the",
"polygon"
] | def setFilled(self, polygonID, filled):
"""setFilled(string, bool) -> None
Sets the filled status of the polygon
"""
self._setCmd(tc.VAR_FILL, polygonID, "i", filled) | [
"def",
"setFilled",
"(",
"self",
",",
"polygonID",
",",
"filled",
")",
":",
"self",
".",
"_setCmd",
"(",
"tc",
".",
"VAR_FILL",
",",
"polygonID",
",",
"\"i\"",
",",
"filled",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_polygon.py#L88-L92 | ||
pskun/finance_news_analysis | 6ac13e32deede37a4cf57bba8b2897941ae3d80d | crawler/crawler/spiders/EastMoneyGubaListSpider.py | python | EastmoneyGubaListSpider.parse_index_page | (self, response) | 解析股吧列表第一页的信息 | 解析股吧列表第一页的信息 | [
"解析股吧列表第一页的信息"
] | def parse_index_page(self, response):
''' 解析股吧列表第一页的信息 '''
list_url = response.url
ticker_id = list_url.split(',')[1][0:6]
# 获得分页信息
pager_info = response.xpath(
'//span[@class="pagernums"]/@data-pager').extract()
pager_info = "".join(pager_info).split("|")
... | [
"def",
"parse_index_page",
"(",
"self",
",",
"response",
")",
":",
"list_url",
"=",
"response",
".",
"url",
"ticker_id",
"=",
"list_url",
".",
"split",
"(",
"','",
")",
"[",
"1",
"]",
"[",
"0",
":",
"6",
"]",
"# 获得分页信息",
"pager_info",
"=",
"response",
... | https://github.com/pskun/finance_news_analysis/blob/6ac13e32deede37a4cf57bba8b2897941ae3d80d/crawler/crawler/spiders/EastMoneyGubaListSpider.py#L50-L67 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.Create | (*args, **kwargs) | return _richtext.RichTextCtrl_Create(*args, **kwargs) | Create(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=RE_MULTILINE, Validator validator=DefaultValidator,
String name=RichTextCtrlNameStr) -> bool | Create(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=RE_MULTILINE, Validator validator=DefaultValidator,
String name=RichTextCtrlNameStr) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"String",
"value",
"=",
"EmptyString",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"RE_MULTILINE",
"Validator",
"validator",
"=",
"De... | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=RE_MULTILINE, Validator validator=DefaultValidator,
String name=RichTextCtrlNameStr) -> bool
"""
... | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2914-L2921 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | VListBox.SetItemCount | (*args, **kwargs) | return _windows_.VListBox_SetItemCount(*args, **kwargs) | SetItemCount(self, size_t count) | SetItemCount(self, size_t count) | [
"SetItemCount",
"(",
"self",
"size_t",
"count",
")"
] | def SetItemCount(*args, **kwargs):
"""SetItemCount(self, size_t count)"""
return _windows_.VListBox_SetItemCount(*args, **kwargs) | [
"def",
"SetItemCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VListBox_SetItemCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2648-L2650 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/windows.py | python | blackman | (M, sym=True) | return _truncate(w, needs_trunc) | r"""
Return a Blackman window.
The Blackman window is a taper formed by using the first three terms of
a summation of cosines. It was designed to have close to the minimal
leakage possible. It is close to optimal, only slightly worse than a
Kaiser window.
Parameters
----------
M : int... | r"""
Return a Blackman window. | [
"r",
"Return",
"a",
"Blackman",
"window",
"."
] | def blackman(M, sym=True):
r"""
Return a Blackman window.
The Blackman window is a taper formed by using the first three terms of
a summation of cosines. It was designed to have close to the minimal
leakage possible. It is close to optimal, only slightly worse than a
Kaiser window.
Parame... | [
"def",
"blackman",
"(",
"M",
",",
"sym",
"=",
"True",
")",
":",
"# Docstring adapted from NumPy's blackman function",
"if",
"_len_guards",
"(",
"M",
")",
":",
"return",
"np",
".",
"ones",
"(",
"M",
")",
"M",
",",
"needs_trunc",
"=",
"_extend",
"(",
"M",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/windows.py#L356-L443 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/WidgetRedirector.py | python | WidgetRedirector.close | (self) | Unregister operations and revert redirection created by .__init__. | Unregister operations and revert redirection created by .__init__. | [
"Unregister",
"operations",
"and",
"revert",
"redirection",
"created",
"by",
".",
"__init__",
"."
] | def close(self):
"Unregister operations and revert redirection created by .__init__."
for operation in list(self._operations):
self.unregister(operation)
widget = self.widget
tk = widget.tk
w = widget._w
# Restore the original widget Tcl command.
tk.de... | [
"def",
"close",
"(",
"self",
")",
":",
"for",
"operation",
"in",
"list",
"(",
"self",
".",
"_operations",
")",
":",
"self",
".",
"unregister",
"(",
"operation",
")",
"widget",
"=",
"self",
".",
"widget",
"tk",
"=",
"widget",
".",
"tk",
"w",
"=",
"w... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/WidgetRedirector.py#L54-L64 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _convert_to_lower_with_underscores | (text) | return text.lower() | Converts all text strings in camelCase or PascalCase to lowers with underscores. | Converts all text strings in camelCase or PascalCase to lowers with underscores. | [
"Converts",
"all",
"text",
"strings",
"in",
"camelCase",
"or",
"PascalCase",
"to",
"lowers",
"with",
"underscores",
"."
] | def _convert_to_lower_with_underscores(text):
"""Converts all text strings in camelCase or PascalCase to lowers with underscores."""
# First add underscores before any capital letter followed by a lower case letter
# as long as it is in a word.
# (This put an underscore before Password but not P and A ... | [
"def",
"_convert_to_lower_with_underscores",
"(",
"text",
")",
":",
"# First add underscores before any capital letter followed by a lower case letter",
"# as long as it is in a word.",
"# (This put an underscore before Password but not P and A in WPAPassword).",
"text",
"=",
"sub",
"(",
"... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L188-L205 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialposix.py | python | VTIMESerial._reconfigure_port | (self, force_update=True) | Set communication parameters on opened port. | Set communication parameters on opened port. | [
"Set",
"communication",
"parameters",
"on",
"opened",
"port",
"."
] | def _reconfigure_port(self, force_update=True):
"""Set communication parameters on opened port."""
super(VTIMESerial, self)._reconfigure_port()
fcntl.fcntl(self.fd, fcntl.F_SETFL, 0) # clear O_NONBLOCK
if self._inter_byte_timeout is not None:
vmin = 1
vtime = in... | [
"def",
"_reconfigure_port",
"(",
"self",
",",
"force_update",
"=",
"True",
")",
":",
"super",
"(",
"VTIMESerial",
",",
"self",
")",
".",
"_reconfigure_port",
"(",
")",
"fcntl",
".",
"fcntl",
"(",
"self",
".",
"fd",
",",
"fcntl",
".",
"F_SETFL",
",",
"0... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialposix.py#L764-L792 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/backend.py | python | one_hot | (indices, num_classes) | return array_ops.one_hot(indices, depth=num_classes, axis=-1) | Computes the one-hot representation of an integer tensor.
Arguments:
indices: nD integer tensor of shape
`(batch_size, dim1, dim2, ... dim(n-1))`
num_classes: Integer, number of classes to consider.
Returns:
(n + 1)D one hot representation of the input
with shape `(batch_size, di... | Computes the one-hot representation of an integer tensor. | [
"Computes",
"the",
"one",
"-",
"hot",
"representation",
"of",
"an",
"integer",
"tensor",
"."
] | def one_hot(indices, num_classes):
"""Computes the one-hot representation of an integer tensor.
Arguments:
indices: nD integer tensor of shape
`(batch_size, dim1, dim2, ... dim(n-1))`
num_classes: Integer, number of classes to consider.
Returns:
(n + 1)D one hot representation of the... | [
"def",
"one_hot",
"(",
"indices",
",",
"num_classes",
")",
":",
"return",
"array_ops",
".",
"one_hot",
"(",
"indices",
",",
"depth",
"=",
"num_classes",
",",
"axis",
"=",
"-",
"1",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L2298-L2313 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py | python | isupper | (a) | return _vec_string(a, bool_, 'isupper') | Returns true for each element if all cased characters in the
string are uppercase and there is at least one character, false
otherwise.
Call `str.isupper` element-wise.
For 8-bit strings, this method is locale-dependent.
Parameters
----------
a : array_like of str or unicode
Returns
... | Returns true for each element if all cased characters in the
string are uppercase and there is at least one character, false
otherwise. | [
"Returns",
"true",
"for",
"each",
"element",
"if",
"all",
"cased",
"characters",
"in",
"the",
"string",
"are",
"uppercase",
"and",
"there",
"is",
"at",
"least",
"one",
"character",
"false",
"otherwise",
"."
] | def isupper(a):
"""
Returns true for each element if all cased characters in the
string are uppercase and there is at least one character, false
otherwise.
Call `str.isupper` element-wise.
For 8-bit strings, this method is locale-dependent.
Parameters
----------
a : array_like of ... | [
"def",
"isupper",
"(",
"a",
")",
":",
"return",
"_vec_string",
"(",
"a",
",",
"bool_",
",",
"'isupper'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py#L913-L936 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32comext/authorization/demos/EditServiceSecurity.py | python | ServiceSecurity.GetObjectInformation | (self) | return flags, hinstance, servername, objectname, pagetitle, objecttype | Identifies object whose security will be modified, and determines options available
to the end user | Identifies object whose security will be modified, and determines options available
to the end user | [
"Identifies",
"object",
"whose",
"security",
"will",
"be",
"modified",
"and",
"determines",
"options",
"available",
"to",
"the",
"end",
"user"
] | def GetObjectInformation(self):
"""Identifies object whose security will be modified, and determines options available
to the end user"""
flags = SI_ADVANCED | SI_EDIT_ALL | SI_PAGE_TITLE | SI_RESET
hinstance = 0 ## handle to module containing string resources
servername = "" #... | [
"def",
"GetObjectInformation",
"(",
"self",
")",
":",
"flags",
"=",
"SI_ADVANCED",
"|",
"SI_EDIT_ALL",
"|",
"SI_PAGE_TITLE",
"|",
"SI_RESET",
"hinstance",
"=",
"0",
"## handle to module containing string resources",
"servername",
"=",
"\"\"",
"## name of authenticating se... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/authorization/demos/EditServiceSecurity.py#L78-L89 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/tensor.py | python | zeros | (shape, dtype, force_cpu=False, name=None) | return fill_constant(value=0.0, **locals()) | The OP creates a tensor of specified :attr:`shape` and :attr:`dtype`, and fills it with 0.
Its :attr:`stop_gradient` will be set to True to stop gradient computation.
Parameters:
shape(tuple|list|Tensor): Shape of output Tensor, the data type of ``shape`` is int32 or int64.
dtype (np.dtype|str)... | The OP creates a tensor of specified :attr:`shape` and :attr:`dtype`, and fills it with 0.
Its :attr:`stop_gradient` will be set to True to stop gradient computation. | [
"The",
"OP",
"creates",
"a",
"tensor",
"of",
"specified",
":",
"attr",
":",
"shape",
"and",
":",
"attr",
":",
"dtype",
"and",
"fills",
"it",
"with",
"0",
".",
"Its",
":",
"attr",
":",
"stop_gradient",
"will",
"be",
"set",
"to",
"True",
"to",
"stop",
... | def zeros(shape, dtype, force_cpu=False, name=None):
"""
The OP creates a tensor of specified :attr:`shape` and :attr:`dtype`, and fills it with 0.
Its :attr:`stop_gradient` will be set to True to stop gradient computation.
Parameters:
shape(tuple|list|Tensor): Shape of output Tensor, the data ... | [
"def",
"zeros",
"(",
"shape",
",",
"dtype",
",",
"force_cpu",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"return",
"fill_constant",
"(",
"value",
"=",
"0.0",
",",
"*",
"*",
"locals",
"(",
")",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/tensor.py#L1099-L1127 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextPrinting.SetShowOnFirstPage | (*args, **kwargs) | return _richtext.RichTextPrinting_SetShowOnFirstPage(*args, **kwargs) | SetShowOnFirstPage(self, bool show) | SetShowOnFirstPage(self, bool show) | [
"SetShowOnFirstPage",
"(",
"self",
"bool",
"show",
")"
] | def SetShowOnFirstPage(*args, **kwargs):
"""SetShowOnFirstPage(self, bool show)"""
return _richtext.RichTextPrinting_SetShowOnFirstPage(*args, **kwargs) | [
"def",
"SetShowOnFirstPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrinting_SetShowOnFirstPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4540-L4542 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_view.py | python | DeadTimeCorrectionsView.set_slot_for_dead_time_from_selector_changed | (self, slot) | Connect the slot for the Dead Time Selector Combobox. | Connect the slot for the Dead Time Selector Combobox. | [
"Connect",
"the",
"slot",
"for",
"the",
"Dead",
"Time",
"Selector",
"Combobox",
"."
] | def set_slot_for_dead_time_from_selector_changed(self, slot) -> None:
"""Connect the slot for the Dead Time Selector Combobox."""
self.dead_time_from_selector.currentIndexChanged.connect(slot) | [
"def",
"set_slot_for_dead_time_from_selector_changed",
"(",
"self",
",",
"slot",
")",
"->",
"None",
":",
"self",
".",
"dead_time_from_selector",
".",
"currentIndexChanged",
".",
"connect",
"(",
"slot",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_view.py#L32-L34 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/tools/scan-build-py/libscanbuild/intercept.py | python | setup_environment | (args, destination) | return environment | Sets up the environment for the build command.
It sets the required environment variables and execute the given command.
The exec calls will be logged by the 'libear' preloaded library or by the
'wrapper' programs. | Sets up the environment for the build command. | [
"Sets",
"up",
"the",
"environment",
"for",
"the",
"build",
"command",
"."
] | def setup_environment(args, destination):
""" Sets up the environment for the build command.
It sets the required environment variables and execute the given command.
The exec calls will be logged by the 'libear' preloaded library or by the
'wrapper' programs. """
c_compiler = args.cc if 'cc' in a... | [
"def",
"setup_environment",
"(",
"args",
",",
"destination",
")",
":",
"c_compiler",
"=",
"args",
".",
"cc",
"if",
"'cc'",
"in",
"args",
"else",
"'cc'",
"cxx_compiler",
"=",
"args",
".",
"cxx",
"if",
"'cxx'",
"in",
"args",
"else",
"'c++'",
"libear_path",
... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libscanbuild/intercept.py#L102-L135 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py | python | IConversion.CallFailureReasonToText | (self, Reason) | return self._ToText('cfr', Reason) | Returns failure reason as text.
@param Reason: Call failure reason.
@type Reason: L{Call failure reason<enums.cfrUnknown>}
@return: Text describing the call failure reason.
@rtype: unicode | Returns failure reason as text. | [
"Returns",
"failure",
"reason",
"as",
"text",
"."
] | def CallFailureReasonToText(self, Reason):
'''Returns failure reason as text.
@param Reason: Call failure reason.
@type Reason: L{Call failure reason<enums.cfrUnknown>}
@return: Text describing the call failure reason.
@rtype: unicode
'''
return self._ToText('cfr... | [
"def",
"CallFailureReasonToText",
"(",
"self",
",",
"Reason",
")",
":",
"return",
"self",
".",
"_ToText",
"(",
"'cfr'",
",",
"Reason",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py#L68-L76 | |
lhmRyan/deep-supervised-hashing-DSH | 631901f82e2ab031fbac33f914a5b08ef8e21d57 | scripts/cpp_lint.py | python | FileInfo.IsSource | (self) | return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
"in",
"(",
"'c'",
",",
"'cc'",
",",
"'cpp'",
",",
"'cxx'",
")"
] | https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/scripts/cpp_lint.py#L956-L958 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/struct_types.py | python | StructTypeInfoBase.get_to_bson_method | (self) | Get the to_bson method for a struct. | Get the to_bson method for a struct. | [
"Get",
"the",
"to_bson",
"method",
"for",
"a",
"struct",
"."
] | def get_to_bson_method(self):
# type: () -> MethodInfo
"""Get the to_bson method for a struct."""
pass | [
"def",
"get_to_bson_method",
"(",
"self",
")",
":",
"# type: () -> MethodInfo",
"pass"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/struct_types.py#L175-L178 | ||
dmlc/nnvm | dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38 | python/nnvm/frontend/darknet.py | python | _darknet_route | (inputs, attrs) | return _darknet_get_nnvm_op(op_name)(*inputs, **new_attrs), None | Process the route operation, which is equivalent to concat. | Process the route operation, which is equivalent to concat. | [
"Process",
"the",
"route",
"operation",
"which",
"is",
"equivalent",
"to",
"concat",
"."
] | def _darknet_route(inputs, attrs):
"""Process the route operation, which is equivalent to concat."""
op_name = 'concatenate'
new_attrs = {'axis': attrs.get('dim', 1)}
return _darknet_get_nnvm_op(op_name)(*inputs, **new_attrs), None | [
"def",
"_darknet_route",
"(",
"inputs",
",",
"attrs",
")",
":",
"op_name",
"=",
"'concatenate'",
"new_attrs",
"=",
"{",
"'axis'",
":",
"attrs",
".",
"get",
"(",
"'dim'",
",",
"1",
")",
"}",
"return",
"_darknet_get_nnvm_op",
"(",
"op_name",
")",
"(",
"*",... | https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/frontend/darknet.py#L266-L270 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/xtuner/tuner/benchmark/tpcc.py | python | run | (remote_server, local_host) | return float(tpmC) - 10 * nb_err | Because TPC-C would insert many tuples into database, we suggest that
backup the raw data directory and restore it when run TPC-C benchmark some times.
e.g.
```
remote_server.exec_command_sync('mv ~/backup ~/gsdata')
```
The passed two parameters are both Executor instance.
:param remot... | Because TPC-C would insert many tuples into database, we suggest that
backup the raw data directory and restore it when run TPC-C benchmark some times.
e.g.
```
remote_server.exec_command_sync('mv ~/backup ~/gsdata')
``` | [
"Because",
"TPC",
"-",
"C",
"would",
"insert",
"many",
"tuples",
"into",
"database",
"we",
"suggest",
"that",
"backup",
"the",
"raw",
"data",
"directory",
"and",
"restore",
"it",
"when",
"run",
"TPC",
"-",
"C",
"benchmark",
"some",
"times",
".",
"e",
"."... | def run(remote_server, local_host):
"""
Because TPC-C would insert many tuples into database, we suggest that
backup the raw data directory and restore it when run TPC-C benchmark some times.
e.g.
```
remote_server.exec_command_sync('mv ~/backup ~/gsdata')
```
The passed two paramet... | [
"def",
"run",
"(",
"remote_server",
",",
"local_host",
")",
":",
"# Benchmark can be deployed on a remote server or a local server.",
"# Here we set the terminal as a remote server.",
"terminal",
"=",
"remote_server",
"err_logfile",
"=",
"os",
".",
"path",
".",
"join",
"(",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/xtuner/tuner/benchmark/tpcc.py#L30-L80 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/linear_quadratic.py | python | MFGLinearQuadraticState.returns | (self) | return [self._returns()] | Returns for all players. | Returns for all players. | [
"Returns",
"for",
"all",
"players",
"."
] | def returns(self) -> List[float]:
"""Returns for all players."""
# For now, only single-population (single-player) mean field games
# are supported.
return [self._returns()] | [
"def",
"returns",
"(",
"self",
")",
"->",
"List",
"[",
"float",
"]",
":",
"# For now, only single-population (single-player) mean field games",
"# are supported.",
"return",
"[",
"self",
".",
"_returns",
"(",
")",
"]"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/linear_quadratic.py#L341-L345 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Size.IncBy | (*args, **kwargs) | return _core_.Size_IncBy(*args, **kwargs) | IncBy(self, int dx, int dy) | IncBy(self, int dx, int dy) | [
"IncBy",
"(",
"self",
"int",
"dx",
"int",
"dy",
")"
] | def IncBy(*args, **kwargs):
"""IncBy(self, int dx, int dy)"""
return _core_.Size_IncBy(*args, **kwargs) | [
"def",
"IncBy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Size_IncBy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L994-L996 | |
flexflow/FlexFlow | 581fad8ba8d10a16a3102ee2b406b0319586df24 | python/flexflow/core/flexflow_cffi.py | python | FFModel.subtract | (self, x, y, inplace_a=False, name=None) | return Tensor(handle, owner_op_type=OpType.SUBTRACT) | Layer that subtracts two input Tensors, :attr:`output = x * y`.
:param x: the first input Tensor.
:type x: Tensor
:param y: the second input Tensor.
:type y: Tensor
:param name: the name of the layer. Default is None.
:type name: string
:returns: Tensor -- ... | Layer that subtracts two input Tensors, :attr:`output = x * y`.
:param x: the first input Tensor.
:type x: Tensor
:param y: the second input Tensor.
:type y: Tensor
:param name: the name of the layer. Default is None.
:type name: string | [
"Layer",
"that",
"subtracts",
"two",
"input",
"Tensors",
":",
"attr",
":",
"output",
"=",
"x",
"*",
"y",
".",
":",
"param",
"x",
":",
"the",
"first",
"input",
"Tensor",
".",
":",
"type",
"x",
":",
"Tensor",
":",
"param",
"y",
":",
"the",
"second",
... | def subtract(self, x, y, inplace_a=False, name=None):
"""Layer that subtracts two input Tensors, :attr:`output = x * y`.
:param x: the first input Tensor.
:type x: Tensor
:param y: the second input Tensor.
:type y: Tensor
:param name: the name of the layer. Defau... | [
"def",
"subtract",
"(",
"self",
",",
"x",
",",
"y",
",",
"inplace_a",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"c_name",
"=",
"get_c_name",
"(",
"name",
")",
"handle",
"=",
"ffc",
".",
"flexflow_model_add_subtract",
"(",
"self",
".",
"handle",... | https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/core/flexflow_cffi.py#L832-L849 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlWinTagHandler.__init__ | (self, *args, **kwargs) | __init__(self) -> HtmlWinTagHandler | __init__(self) -> HtmlWinTagHandler | [
"__init__",
"(",
"self",
")",
"-",
">",
"HtmlWinTagHandler"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> HtmlWinTagHandler"""
_html.HtmlWinTagHandler_swiginit(self,_html.new_HtmlWinTagHandler(*args, **kwargs))
HtmlWinTagHandler._setCallbackInfo(self, self, HtmlWinTagHandler) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlWinTagHandler_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlWinTagHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"HtmlWinTagHand... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L424-L427 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_pydecimal.py | python | Context.copy_negate | (self, a) | return a.copy_negate() | Returns a copy of the operand with the sign inverted.
>>> ExtendedContext.copy_negate(Decimal('101.5'))
Decimal('-101.5')
>>> ExtendedContext.copy_negate(Decimal('-101.5'))
Decimal('101.5')
>>> ExtendedContext.copy_negate(1)
Decimal('-1') | Returns a copy of the operand with the sign inverted. | [
"Returns",
"a",
"copy",
"of",
"the",
"operand",
"with",
"the",
"sign",
"inverted",
"."
] | def copy_negate(self, a):
"""Returns a copy of the operand with the sign inverted.
>>> ExtendedContext.copy_negate(Decimal('101.5'))
Decimal('-101.5')
>>> ExtendedContext.copy_negate(Decimal('-101.5'))
Decimal('101.5')
>>> ExtendedContext.copy_negate(1)
Decimal('... | [
"def",
"copy_negate",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"copy_negate",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L4321-L4332 | |
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | scripts/cpp_lint.py | python | _NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L1948-L2002 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/parallel.py | python | _register_dask | () | Register Dask Backend if called with parallel_backend("dask") | Register Dask Backend if called with parallel_backend("dask") | [
"Register",
"Dask",
"Backend",
"if",
"called",
"with",
"parallel_backend",
"(",
"dask",
")"
] | def _register_dask():
""" Register Dask Backend if called with parallel_backend("dask") """
try:
from ._dask import DaskDistributedBackend
register_parallel_backend('dask', DaskDistributedBackend)
except ImportError as e:
msg = ("To use the dask.distributed backend you must install b... | [
"def",
"_register_dask",
"(",
")",
":",
"try",
":",
"from",
".",
"_dask",
"import",
"DaskDistributedBackend",
"register_parallel_backend",
"(",
"'dask'",
",",
"DaskDistributedBackend",
")",
"except",
"ImportError",
"as",
"e",
":",
"msg",
"=",
"(",
"\"To use the da... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/parallel.py#L58-L68 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/build_swift/build_swift/wrappers/xcrun.py | python | XcrunWrapper.sdk_version | (self, sdk=None, toolchain=None) | return Version(output.rstrip()) | Returns the SDK version. Returns None if the SDK cannot be found. | Returns the SDK version. Returns None if the SDK cannot be found. | [
"Returns",
"the",
"SDK",
"version",
".",
"Returns",
"None",
"if",
"the",
"SDK",
"cannot",
"be",
"found",
"."
] | def sdk_version(self, sdk=None, toolchain=None):
"""Returns the SDK version. Returns None if the SDK cannot be found.
"""
output = self.check_output(
'--show-sdk-version',
sdk=sdk,
toolchain=toolchain,
stderr=shell.DEVNULL)
return Version... | [
"def",
"sdk_version",
"(",
"self",
",",
"sdk",
"=",
"None",
",",
"toolchain",
"=",
"None",
")",
":",
"output",
"=",
"self",
".",
"check_output",
"(",
"'--show-sdk-version'",
",",
"sdk",
"=",
"sdk",
",",
"toolchain",
"=",
"toolchain",
",",
"stderr",
"=",
... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/build_swift/build_swift/wrappers/xcrun.py#L147-L157 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Reflectometry/isis_reflectometry/combineMulti.py | python | combineDataMulti | (wksp_list, output_wksp, beg_overlap, end_overlap, Qmin, Qmax, binning, scale_high=1,
scale_factor=-1.0, which_period=1, keep=0, scale_right=True) | return mtd[output_wksp] | Function stitches multiple workspaces together. Workspaces should have an X-axis in mod Q, and the Spectrum axis as I/I0
wksp_list: A list of workspaces to stitch together
ouput_wksp: output workspace name
beg_overlap: The beginning of the overlap region. List argument, each entry matches the entry in the ... | Function stitches multiple workspaces together. Workspaces should have an X-axis in mod Q, and the Spectrum axis as I/I0 | [
"Function",
"stitches",
"multiple",
"workspaces",
"together",
".",
"Workspaces",
"should",
"have",
"an",
"X",
"-",
"axis",
"in",
"mod",
"Q",
"and",
"the",
"Spectrum",
"axis",
"as",
"I",
"/",
"I0"
] | def combineDataMulti(wksp_list, output_wksp, beg_overlap, end_overlap, Qmin, Qmax, binning, scale_high=1,
scale_factor=-1.0, which_period=1, keep=0, scale_right=True):
"""
Function stitches multiple workspaces together. Workspaces should have an X-axis in mod Q, and the Spectrum axis as I/I... | [
"def",
"combineDataMulti",
"(",
"wksp_list",
",",
"output_wksp",
",",
"beg_overlap",
",",
"end_overlap",
",",
"Qmin",
",",
"Qmax",
",",
"binning",
",",
"scale_high",
"=",
"1",
",",
"scale_factor",
"=",
"-",
"1.0",
",",
"which_period",
"=",
"1",
",",
"keep"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Reflectometry/isis_reflectometry/combineMulti.py#L13-L67 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py | python | AddPeaksThread.__init__ | (self, main_window, exp_number, scan_number_list) | return | Initialization
:param main_window:
:param exp_number:
:param scan_number_list: | Initialization
:param main_window:
:param exp_number:
:param scan_number_list: | [
"Initialization",
":",
"param",
"main_window",
":",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number_list",
":"
] | def __init__(self, main_window, exp_number, scan_number_list):
"""
Initialization
:param main_window:
:param exp_number:
:param scan_number_list:
"""
# check
assert main_window is not None, 'Main window cannot be None'
assert isinstance(exp_number,... | [
"def",
"__init__",
"(",
"self",
",",
"main_window",
",",
"exp_number",
",",
"scan_number_list",
")",
":",
"# check",
"assert",
"main_window",
"is",
"not",
"None",
",",
"'Main window cannot be None'",
"assert",
"isinstance",
"(",
"exp_number",
",",
"int",
")",
",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py#L26-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.