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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/parser.py | python | _parse_struct | (ctxt, spec, name, node) | Parse a struct section in the IDL file. | Parse a struct section in the IDL file. | [
"Parse",
"a",
"struct",
"section",
"in",
"the",
"IDL",
"file",
"."
] | def _parse_struct(ctxt, spec, name, node):
# type: (errors.ParserContext, syntax.IDLSpec, unicode, Union[yaml.nodes.MappingNode, yaml.nodes.ScalarNode, yaml.nodes.SequenceNode]) -> None
"""Parse a struct section in the IDL file."""
if not ctxt.is_mapping_node(node, "struct"):
return
struct = sy... | [
"def",
"_parse_struct",
"(",
"ctxt",
",",
"spec",
",",
"name",
",",
"node",
")",
":",
"# type: (errors.ParserContext, syntax.IDLSpec, unicode, Union[yaml.nodes.MappingNode, yaml.nodes.ScalarNode, yaml.nodes.SequenceNode]) -> None",
"if",
"not",
"ctxt",
".",
"is_mapping_node",
"("... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/parser.py#L322-L345 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/threading.py | python | Thread.ident | (self) | return self.__ident | Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the thread.get_ident() function. Thread
identifiers may be recycled when a thread exits and another thread is
created. The identifier is available even after the thread has exited. | Thread identifier of this thread or None if it has not been started. | [
"Thread",
"identifier",
"of",
"this",
"thread",
"or",
"None",
"if",
"it",
"has",
"not",
"been",
"started",
"."
] | def ident(self):
"""Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the thread.get_ident() function. Thread
identifiers may be recycled when a thread exits and another thread is
created. The identifier is available even after the threa... | [
"def",
"ident",
"(",
"self",
")",
":",
"assert",
"self",
".",
"__initialized",
",",
"\"Thread.__init__() not called\"",
"return",
"self",
".",
"__ident"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/threading.py#L975-L984 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py | python | AutoScaleConnection.get_all_autoscaling_instances | (self, instance_ids=None,
max_records=None, next_token=None) | return self.get_list('DescribeAutoScalingInstances',
params, [('member', Instance)]) | Returns a description of each Auto Scaling instance in the instance_ids
list. If a list is not provided, the service returns the full details
of all instances up to a maximum of fifty.
This action supports pagination by returning a token if there are more
pages to retrieve. To get the n... | Returns a description of each Auto Scaling instance in the instance_ids
list. If a list is not provided, the service returns the full details
of all instances up to a maximum of fifty. | [
"Returns",
"a",
"description",
"of",
"each",
"Auto",
"Scaling",
"instance",
"in",
"the",
"instance_ids",
"list",
".",
"If",
"a",
"list",
"is",
"not",
"provided",
"the",
"service",
"returns",
"the",
"full",
"details",
"of",
"all",
"instances",
"up",
"to",
"... | def get_all_autoscaling_instances(self, instance_ids=None,
max_records=None, next_token=None):
"""
Returns a description of each Auto Scaling instance in the instance_ids
list. If a list is not provided, the service returns the full details
of all in... | [
"def",
"get_all_autoscaling_instances",
"(",
"self",
",",
"instance_ids",
"=",
"None",
",",
"max_records",
"=",
"None",
",",
"next_token",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"instance_ids",
":",
"self",
".",
"build_list_params",
"(",
"para... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py#L499-L529 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/project.py | python | ProjectRegistry.find_jamfile | (self, dir, parent_root=0, no_errors=0) | Find the Jamfile at the given location. This returns the
exact names of all the Jamfiles in the given directory. The optional
parent-root argument causes this to search not the given directory
but the ones above it up to the directory given in it. | Find the Jamfile at the given location. This returns the
exact names of all the Jamfiles in the given directory. The optional
parent-root argument causes this to search not the given directory
but the ones above it up to the directory given in it. | [
"Find",
"the",
"Jamfile",
"at",
"the",
"given",
"location",
".",
"This",
"returns",
"the",
"exact",
"names",
"of",
"all",
"the",
"Jamfiles",
"in",
"the",
"given",
"directory",
".",
"The",
"optional",
"parent",
"-",
"root",
"argument",
"causes",
"this",
"to... | def find_jamfile (self, dir, parent_root=0, no_errors=0):
"""Find the Jamfile at the given location. This returns the
exact names of all the Jamfiles in the given directory. The optional
parent-root argument causes this to search not the given directory
but the ones above it up to the di... | [
"def",
"find_jamfile",
"(",
"self",
",",
"dir",
",",
"parent_root",
"=",
"0",
",",
"no_errors",
"=",
"0",
")",
":",
"# Glob for all the possible Jamfiles according to the match pattern.",
"#",
"jamfile_glob",
"=",
"None",
"if",
"parent_root",
":",
"parent",
"=",
"... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/project.py#L242-L291 | ||
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/ctml_writer.py | python | Arrhenius.__init__ | (self,
A = 0.0,
b = 0.0,
E = 0.0,
coverage = []) | :param A:
The pre-exponential coefficient. Required input. If entered without
units, the units will be computed considering all factors that
affect the units. The resulting units string is written to the CTML
file individually for each reaction pre-exponential coefficient... | :param A:
The pre-exponential coefficient. Required input. If entered without
units, the units will be computed considering all factors that
affect the units. The resulting units string is written to the CTML
file individually for each reaction pre-exponential coefficient... | [
":",
"param",
"A",
":",
"The",
"pre",
"-",
"exponential",
"coefficient",
".",
"Required",
"input",
".",
"If",
"entered",
"without",
"units",
"the",
"units",
"will",
"be",
"computed",
"considering",
"all",
"factors",
"that",
"affect",
"the",
"units",
".",
"... | def __init__(self,
A = 0.0,
b = 0.0,
E = 0.0,
coverage = []):
"""
:param A:
The pre-exponential coefficient. Required input. If entered without
units, the units will be computed considering all factors that
... | [
"def",
"__init__",
"(",
"self",
",",
"A",
"=",
"0.0",
",",
"b",
"=",
"0.0",
",",
"E",
"=",
"0.0",
",",
"coverage",
"=",
"[",
"]",
")",
":",
"self",
".",
"_c",
"=",
"[",
"A",
",",
"b",
",",
"E",
"]",
"if",
"coverage",
":",
"if",
"isinstance"... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml_writer.py#L1021-L1054 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/util/lib/common/util.py | python | GetPlatformName | () | Return a string to be used in paths for the platform. | Return a string to be used in paths for the platform. | [
"Return",
"a",
"string",
"to",
"be",
"used",
"in",
"paths",
"for",
"the",
"platform",
"."
] | def GetPlatformName():
"""Return a string to be used in paths for the platform."""
if IsWindows():
return 'win'
if IsMac():
return 'mac'
if IsLinux():
return 'linux'
raise NotImplementedError('Unknown platform "%s".' % sys.platform) | [
"def",
"GetPlatformName",
"(",
")",
":",
"if",
"IsWindows",
"(",
")",
":",
"return",
"'win'",
"if",
"IsMac",
"(",
")",
":",
"return",
"'mac'",
"if",
"IsLinux",
"(",
")",
":",
"return",
"'linux'",
"raise",
"NotImplementedError",
"(",
"'Unknown platform \"%s\"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/util/lib/common/util.py#L18-L26 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/nodes.py | python | Node.iter_child_nodes | (self, exclude=None, only=None) | Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned. | Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned. | [
"Iterates",
"over",
"all",
"direct",
"child",
"nodes",
"of",
"the",
"node",
".",
"This",
"iterates",
"over",
"all",
"fields",
"and",
"yields",
"the",
"values",
"of",
"they",
"are",
"nodes",
".",
"If",
"the",
"value",
"of",
"a",
"field",
"is",
"a",
"lis... | def iter_child_nodes(self, exclude=None, only=None):
"""Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned.
"""
for field, item in sel... | [
"def",
"iter_child_nodes",
"(",
"self",
",",
"exclude",
"=",
"None",
",",
"only",
"=",
"None",
")",
":",
"for",
"field",
",",
"item",
"in",
"self",
".",
"iter_fields",
"(",
"exclude",
",",
"only",
")",
":",
"if",
"isinstance",
"(",
"item",
",",
"list... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/nodes.py#L164-L175 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/decimal.py | python | Context.is_snan | (self, a) | return a.is_snan() | Return True if the operand is a signaling NaN;
otherwise return False.
>>> ExtendedContext.is_snan(Decimal('2.50'))
False
>>> ExtendedContext.is_snan(Decimal('NaN'))
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
>>> ExtendedContext.is_snan(1)
... | Return True if the operand is a signaling NaN;
otherwise return False. | [
"Return",
"True",
"if",
"the",
"operand",
"is",
"a",
"signaling",
"NaN",
";",
"otherwise",
"return",
"False",
"."
] | def is_snan(self, a):
"""Return True if the operand is a signaling NaN;
otherwise return False.
>>> ExtendedContext.is_snan(Decimal('2.50'))
False
>>> ExtendedContext.is_snan(Decimal('NaN'))
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
... | [
"def",
"is_snan",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"is_snan",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L4431-L4445 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py | python | GroupBy.cumcount | (self, ascending: bool = True) | Number each item in each group from 0 to the length of that group - 1.
Essentially this is equivalent to
>>> self.apply(lambda x: pd.Series(np.arange(len(x)), x.index))
Parameters
----------
ascending : bool, default True
If False, number in reverse, from length of... | Number each item in each group from 0 to the length of that group - 1. | [
"Number",
"each",
"item",
"in",
"each",
"group",
"from",
"0",
"to",
"the",
"length",
"of",
"that",
"group",
"-",
"1",
"."
] | def cumcount(self, ascending: bool = True):
"""
Number each item in each group from 0 to the length of that group - 1.
Essentially this is equivalent to
>>> self.apply(lambda x: pd.Series(np.arange(len(x)), x.index))
Parameters
----------
ascending : bool, defa... | [
"def",
"cumcount",
"(",
"self",
",",
"ascending",
":",
"bool",
"=",
"True",
")",
":",
"with",
"_group_selection_context",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"_selected_obj",
".",
"index",
"cumcounts",
"=",
"self",
".",
"_cumcount_array",
"("... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py#L2024-L2080 | ||
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/cpp_wrappers/expected_improvement.py | python | ExpectedImprovement.compute_expected_improvement | (self, force_monte_carlo=False) | return C_GP.compute_expected_improvement(
self._gaussian_process._gaussian_process,
cpp_utils.cppify(self._points_to_sample),
cpp_utils.cppify(self._points_being_sampled),
self.num_to_sample,
self.num_being_sampled,
self._num_mc_iterations,
... | r"""Compute the expected improvement at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled.
.. Note:: These comments were copied from
:meth:`moe.optimal_learning.python.interfaces.expected_improvement_interface.ExpectedImprovementInterface.compute_expected_improvement... | r"""Compute the expected improvement at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled. | [
"r",
"Compute",
"the",
"expected",
"improvement",
"at",
"points_to_sample",
"with",
"points_being_sampled",
"concurrent",
"points",
"being",
"sampled",
"."
] | def compute_expected_improvement(self, force_monte_carlo=False):
r"""Compute the expected improvement at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled.
.. Note:: These comments were copied from
:meth:`moe.optimal_learning.python.interfaces.expected_improv... | [
"def",
"compute_expected_improvement",
"(",
"self",
",",
"force_monte_carlo",
"=",
"False",
")",
":",
"return",
"C_GP",
".",
"compute_expected_improvement",
"(",
"self",
".",
"_gaussian_process",
".",
"_gaussian_process",
",",
"cpp_utils",
".",
"cppify",
"(",
"self"... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/expected_improvement.py#L506-L553 | |
schwehr/libais | 1e19605942c8e155cd02fde6d1acde75ecd15d75 | third_party/gmock/scripts/upload.py | python | ErrorExit | (msg) | Print an error message to stderr and exit. | Print an error message to stderr and exit. | [
"Print",
"an",
"error",
"message",
"to",
"stderr",
"and",
"exit",
"."
] | def ErrorExit(msg):
"""Print an error message to stderr and exit."""
print >>sys.stderr, msg
sys.exit(1) | [
"def",
"ErrorExit",
"(",
"msg",
")",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"msg",
"sys",
".",
"exit",
"(",
"1",
")"
] | https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/third_party/gmock/scripts/upload.py#L109-L112 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/jobstats/jobstats.py | python | JobStats.end_timestr | (self) | return t.strftime("%Y-%m-%d %H:%M:%S") | Return a formatted timestamp of the job's end-time | Return a formatted timestamp of the job's end-time | [
"Return",
"a",
"formatted",
"timestamp",
"of",
"the",
"job",
"s",
"end",
"-",
"time"
] | def end_timestr(self):
"""Return a formatted timestamp of the job's end-time"""
t = datetime.datetime.fromtimestamp((self.start_usec +
self.dur_usec) / 1000000.0)
return t.strftime("%Y-%m-%d %H:%M:%S") | [
"def",
"end_timestr",
"(",
"self",
")",
":",
"t",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"(",
"self",
".",
"start_usec",
"+",
"self",
".",
"dur_usec",
")",
"/",
"1000000.0",
")",
"return",
"t",
".",
"strftime",
"(",
"\"%Y-%m-%d %H:%... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/jobstats/jobstats.py#L151-L155 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Text.tag_cget | (self, tagName, option) | return self.tk.call(self._w, 'tag', 'cget', tagName, option) | Return the value of OPTION for tag TAGNAME. | Return the value of OPTION for tag TAGNAME. | [
"Return",
"the",
"value",
"of",
"OPTION",
"for",
"tag",
"TAGNAME",
"."
] | def tag_cget(self, tagName, option):
"""Return the value of OPTION for tag TAGNAME."""
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'tag', 'cget', tagName, option) | [
"def",
"tag_cget",
"(",
"self",
",",
"tagName",
",",
"option",
")",
":",
"if",
"option",
"[",
":",
"1",
"]",
"!=",
"'-'",
":",
"option",
"=",
"'-'",
"+",
"option",
"if",
"option",
"[",
"-",
"1",
":",
"]",
"==",
"'_'",
":",
"option",
"=",
"optio... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3361-L3367 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | PlatformInformation.GetOperatingSystemFamilyName | (*args, **kwargs) | return _misc_.PlatformInformation_GetOperatingSystemFamilyName(*args, **kwargs) | GetOperatingSystemFamilyName(self) -> String | GetOperatingSystemFamilyName(self) -> String | [
"GetOperatingSystemFamilyName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetOperatingSystemFamilyName(*args, **kwargs):
"""GetOperatingSystemFamilyName(self) -> String"""
return _misc_.PlatformInformation_GetOperatingSystemFamilyName(*args, **kwargs) | [
"def",
"GetOperatingSystemFamilyName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"PlatformInformation_GetOperatingSystemFamilyName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1109-L1111 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/regression/boosted_trees_regression.py | python | BoostedTreesRegression.export_coreml | (self, filename) | Export the model in Core ML format.
Parameters
----------
filename: str
A valid filename where the model can be saved.
Examples
--------
>>> model.export_coreml("MyModel.mlmodel") | Export the model in Core ML format. | [
"Export",
"the",
"model",
"in",
"Core",
"ML",
"format",
"."
] | def export_coreml(self, filename):
"""
Export the model in Core ML format.
Parameters
----------
filename: str
A valid filename where the model can be saved.
Examples
--------
>>> model.export_coreml("MyModel.mlmodel")
"""
from ... | [
"def",
"export_coreml",
"(",
"self",
",",
"filename",
")",
":",
"from",
"turicreate",
".",
"toolkits",
"import",
"_coreml_utils",
"display_name",
"=",
"\"boosted trees regression\"",
"short_description",
"=",
"_coreml_utils",
".",
"_mlmodel_short_description",
"(",
"dis... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/regression/boosted_trees_regression.py#L219-L242 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | BitStream.__copy__ | (self) | return s_copy | Return a new copy of the BitStream. | Return a new copy of the BitStream. | [
"Return",
"a",
"new",
"copy",
"of",
"the",
"BitStream",
"."
] | def __copy__(self):
"""Return a new copy of the BitStream."""
s_copy = BitStream()
s_copy._pos = 0
if not isinstance(self._datastore, ByteStore):
# Let them both point to the same (invariant) array.
# If either gets modified then at that point they'll be read into... | [
"def",
"__copy__",
"(",
"self",
")",
":",
"s_copy",
"=",
"BitStream",
"(",
")",
"s_copy",
".",
"_pos",
"=",
"0",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_datastore",
",",
"ByteStore",
")",
":",
"# Let them both point to the same (invariant) array.",
"# I... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L4128-L4140 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | TextBoxAttr.GetRight | (*args) | return _richtext.TextBoxAttr_GetRight(*args) | GetRight(self) -> TextAttrDimension
GetRight(self) -> TextAttrDimension | GetRight(self) -> TextAttrDimension
GetRight(self) -> TextAttrDimension | [
"GetRight",
"(",
"self",
")",
"-",
">",
"TextAttrDimension",
"GetRight",
"(",
"self",
")",
"-",
">",
"TextAttrDimension"
] | def GetRight(*args):
"""
GetRight(self) -> TextAttrDimension
GetRight(self) -> TextAttrDimension
"""
return _richtext.TextBoxAttr_GetRight(*args) | [
"def",
"GetRight",
"(",
"*",
"args",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_GetRight",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L677-L682 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlHelpData.FindPageById | (*args, **kwargs) | return _html.HtmlHelpData_FindPageById(*args, **kwargs) | FindPageById(self, int id) -> String | FindPageById(self, int id) -> String | [
"FindPageById",
"(",
"self",
"int",
"id",
")",
"-",
">",
"String"
] | def FindPageById(*args, **kwargs):
"""FindPageById(self, int id) -> String"""
return _html.HtmlHelpData_FindPageById(*args, **kwargs) | [
"def",
"FindPageById",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlHelpData_FindPageById",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1515-L1517 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/barbican.py | python | task | (ctx, config) | Deploy and configure Keystone
Example of configuration:
tasks:
- local_cluster:
cluster_path: /home/adam/ceph-1/build
- local_rgw:
- tox: [ client.0 ]
- keystone:
client.0:
sha1: 17.0.0.0rc2
force-branch: master
projects:
... | Deploy and configure Keystone | [
"Deploy",
"and",
"configure",
"Keystone"
] | def task(ctx, config):
"""
Deploy and configure Keystone
Example of configuration:
tasks:
- local_cluster:
cluster_path: /home/adam/ceph-1/build
- local_rgw:
- tox: [ client.0 ]
- keystone:
client.0:
sha1: 17.0.0.0rc2
force-branch: ma... | [
"def",
"task",
"(",
"ctx",
",",
"config",
")",
":",
"assert",
"config",
"is",
"None",
"or",
"isinstance",
"(",
"config",
",",
"list",
")",
"or",
"isinstance",
"(",
"config",
",",
"dict",
")",
",",
"\"task keystone only supports a list or dictionary for configura... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/barbican.py#L410-L524 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/sax/xmlreader.py | python | XMLReader.setLocale | (self, locale) | Allow an application to set the locale for errors and warnings.
SAX parsers are not required to provide localization for errors
and warnings; if they cannot support the requested locale,
however, they must throw a SAX exception. Applications may
request a locale change in the middle of ... | Allow an application to set the locale for errors and warnings. | [
"Allow",
"an",
"application",
"to",
"set",
"the",
"locale",
"for",
"errors",
"and",
"warnings",
"."
] | def setLocale(self, locale):
"""Allow an application to set the locale for errors and warnings.
SAX parsers are not required to provide localization for errors
and warnings; if they cannot support the requested locale,
however, they must throw a SAX exception. Applications may
r... | [
"def",
"setLocale",
"(",
"self",
",",
"locale",
")",
":",
"raise",
"SAXNotSupportedException",
"(",
"\"Locale support not implemented\"",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/xmlreader.py#L66-L73 | ||
KhronosGroup/SPIRV-LLVM | 1eb85593f3fe2c39379b9a9b088d51eda4f42b8b | utils/lit/lit/LitConfig.py | python | LitConfig.load_config | (self, config, path) | return config | load_config(config, path) - Load a config object from an alternate
path. | load_config(config, path) - Load a config object from an alternate
path. | [
"load_config",
"(",
"config",
"path",
")",
"-",
"Load",
"a",
"config",
"object",
"from",
"an",
"alternate",
"path",
"."
] | def load_config(self, config, path):
"""load_config(config, path) - Load a config object from an alternate
path."""
if self.debug:
self.note('load_config from %r' % path)
config.load_from_path(path, self)
return config | [
"def",
"load_config",
"(",
"self",
",",
"config",
",",
"path",
")",
":",
"if",
"self",
".",
"debug",
":",
"self",
".",
"note",
"(",
"'load_config from %r'",
"%",
"path",
")",
"config",
".",
"load_from_path",
"(",
"path",
",",
"self",
")",
"return",
"co... | https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/utils/lit/lit/LitConfig.py#L61-L67 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/urllib/request.py | python | URLopener.addheader | (self, *args) | Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic') | Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic') | [
"Add",
"a",
"header",
"to",
"be",
"used",
"by",
"the",
"HTTP",
"interface",
"only",
"e",
".",
"g",
".",
"u",
".",
"addheader",
"(",
"Accept",
"sound",
"/",
"basic",
")"
] | def addheader(self, *args):
"""Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic')"""
self.addheaders.append(args) | [
"def",
"addheader",
"(",
"self",
",",
"*",
"args",
")",
":",
"self",
".",
"addheaders",
".",
"append",
"(",
"args",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/urllib/request.py#L1752-L1755 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/filter/CommonFilters.py | python | CommonFilters.setExposureAdjust | (self, stops) | return True | Sets a relative exposure adjustment to multiply with the result of
rendering the scene, in stops. A value of 0 means no adjustment, a
positive value will result in a brighter image. Useful in conjunction
with HDR, see setHighDynamicRange.
.. versionadded:: 1.10.7 | Sets a relative exposure adjustment to multiply with the result of
rendering the scene, in stops. A value of 0 means no adjustment, a
positive value will result in a brighter image. Useful in conjunction
with HDR, see setHighDynamicRange. | [
"Sets",
"a",
"relative",
"exposure",
"adjustment",
"to",
"multiply",
"with",
"the",
"result",
"of",
"rendering",
"the",
"scene",
"in",
"stops",
".",
"A",
"value",
"of",
"0",
"means",
"no",
"adjustment",
"a",
"positive",
"value",
"will",
"result",
"in",
"a"... | def setExposureAdjust(self, stops):
""" Sets a relative exposure adjustment to multiply with the result of
rendering the scene, in stops. A value of 0 means no adjustment, a
positive value will result in a brighter image. Useful in conjunction
with HDR, see setHighDynamicRange.
... | [
"def",
"setExposureAdjust",
"(",
"self",
",",
"stops",
")",
":",
"old_stops",
"=",
"self",
".",
"configuration",
".",
"get",
"(",
"\"ExposureAdjust\"",
")",
"if",
"old_stops",
"!=",
"stops",
":",
"self",
".",
"configuration",
"[",
"\"ExposureAdjust\"",
"]",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/filter/CommonFilters.py#L651-L663 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/grpc_dataset_ops.py | python | GRPCStreamIODataset.__init__ | (self, endpoint, shape, dtype) | Create a GRPC Reader.
Args:
endpoint: A `tf.string` tensor containing one or more endpoints. | Create a GRPC Reader. | [
"Create",
"a",
"GRPC",
"Reader",
"."
] | def __init__(self, endpoint, shape, dtype):
"""Create a GRPC Reader.
Args:
endpoint: A `tf.string` tensor containing one or more endpoints.
"""
with tf.name_scope("GRPCStreamIODataset"):
shape = tf.cast(shape, tf.int64)
resource = core_ops.io_grpc_re... | [
"def",
"__init__",
"(",
"self",
",",
"endpoint",
",",
"shape",
",",
"dtype",
")",
":",
"with",
"tf",
".",
"name_scope",
"(",
"\"GRPCStreamIODataset\"",
")",
":",
"shape",
"=",
"tf",
".",
"cast",
"(",
"shape",
",",
"tf",
".",
"int64",
")",
"resource",
... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/grpc_dataset_ops.py#L24-L61 | ||
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/field.py | python | Field.dtype | (self) | return self.snode.dtype | Gets data type of each individual value.
Returns:
DataType: Data type of each individual value. | Gets data type of each individual value. | [
"Gets",
"data",
"type",
"of",
"each",
"individual",
"value",
"."
] | def dtype(self):
"""Gets data type of each individual value.
Returns:
DataType: Data type of each individual value.
"""
return self.snode.dtype | [
"def",
"dtype",
"(",
"self",
")",
":",
"return",
"self",
".",
"snode",
".",
"dtype"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/field.py#L41-L47 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/tools/process_dumps_linux.py | python | VerifySymbolAndCopyToTempDir | (symbol_file, temp_dir, sym_module_name) | return False | Verify the symbol file looks correct and copy it to the right place
in temp_dir.
Args:
symbol_file: the path to the symbol file.
temp_dir: the base of the temp directory where the symbol file will reside.
Returns:
True on success. | Verify the symbol file looks correct and copy it to the right place
in temp_dir. | [
"Verify",
"the",
"symbol",
"file",
"looks",
"correct",
"and",
"copy",
"it",
"to",
"the",
"right",
"place",
"in",
"temp_dir",
"."
] | def VerifySymbolAndCopyToTempDir(symbol_file, temp_dir, sym_module_name):
"""Verify the symbol file looks correct and copy it to the right place
in temp_dir.
Args:
symbol_file: the path to the symbol file.
temp_dir: the base of the temp directory where the symbol file will reside.
Returns:
True on ... | [
"def",
"VerifySymbolAndCopyToTempDir",
"(",
"symbol_file",
",",
"temp_dir",
",",
"sym_module_name",
")",
":",
"symbol",
"=",
"open",
"(",
"symbol_file",
")",
"signature_line",
"=",
"symbol",
".",
"readline",
"(",
")",
".",
"strip",
"(",
")",
".",
"split",
"(... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/process_dumps_linux.py#L18-L41 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/utils.py | python | calculate_tree_hash | (body) | return binascii.hexlify(chunks[0]).decode('ascii') | Calculate a tree hash checksum.
For more information see:
http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html
:param body: Any file like object. This has the same constraints as
the ``body`` param in calculate_sha256
:rtype: str
:returns: The hex version of th... | Calculate a tree hash checksum. | [
"Calculate",
"a",
"tree",
"hash",
"checksum",
"."
] | def calculate_tree_hash(body):
"""Calculate a tree hash checksum.
For more information see:
http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html
:param body: Any file like object. This has the same constraints as
the ``body`` param in calculate_sha256
:rtype: s... | [
"def",
"calculate_tree_hash",
"(",
"body",
")",
":",
"chunks",
"=",
"[",
"]",
"required_chunk_size",
"=",
"1024",
"*",
"1024",
"sha256",
"=",
"hashlib",
".",
"sha256",
"for",
"chunk",
"in",
"iter",
"(",
"lambda",
":",
"body",
".",
"read",
"(",
"required_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/utils.py#L727-L757 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/StructuralMechanicsApplication/python_scripts/impose_rigid_movement_process.py | python | ImposeRigidMovementProcess.ExecuteInitializeSolutionStep | (self) | This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class. | This method is executed in order to initialize the current step | [
"This",
"method",
"is",
"executed",
"in",
"order",
"to",
"initialize",
"the",
"current",
"step"
] | def ExecuteInitializeSolutionStep(self):
""" This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class.
"""
current_time = self.model_part.ProcessInfo[KratosMultiphysics.TIME]
# We activate/deactivate... | [
"def",
"ExecuteInitializeSolutionStep",
"(",
"self",
")",
":",
"current_time",
"=",
"self",
".",
"model_part",
".",
"ProcessInfo",
"[",
"KratosMultiphysics",
".",
"TIME",
"]",
"# We activate/deactivate conditions dependeding of interval",
"if",
"self",
".",
"interval",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/StructuralMechanicsApplication/python_scripts/impose_rigid_movement_process.py#L99-L112 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/kubeadm.py | python | allocate_pod_subnet | (ctx, config) | Allocate a private subnet that will not collide with other test machines/clusters | Allocate a private subnet that will not collide with other test machines/clusters | [
"Allocate",
"a",
"private",
"subnet",
"that",
"will",
"not",
"collide",
"with",
"other",
"test",
"machines",
"/",
"clusters"
] | def allocate_pod_subnet(ctx, config):
"""
Allocate a private subnet that will not collide with other test machines/clusters
"""
cluster_name = config['cluster']
assert cluster_name == 'kubeadm', 'multiple subnets not yet implemented'
log.info('Identifying pod subnet')
remote = list(ctx.clus... | [
"def",
"allocate_pod_subnet",
"(",
"ctx",
",",
"config",
")",
":",
"cluster_name",
"=",
"config",
"[",
"'cluster'",
"]",
"assert",
"cluster_name",
"==",
"'kubeadm'",
",",
"'multiple subnets not yet implemented'",
"log",
".",
"info",
"(",
"'Identifying pod subnet'",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/kubeadm.py#L361-L376 | ||
dmtcp/dmtcp | 48a23686e1ce6784829b783ced9c62a14d620507 | util/cpplint.py | python | CheckLanguage | (filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error) | Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum:... | Checks rules from the 'C++ language rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"language",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckLanguage(filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
... | [
"def",
"CheckLanguage",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"include_state",
",",
"nesting_state",
",",
"error",
")",
":",
"# If the line is empty or consists of entirely a comment, no need to",
"# check it.",
"line",
"=",
"cle... | https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L4606-L4761 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/topology.py | python | Topology.residues | (self) | Iterate over all Residues in the Topology. | Iterate over all Residues in the Topology. | [
"Iterate",
"over",
"all",
"Residues",
"in",
"the",
"Topology",
"."
] | def residues(self):
"""Iterate over all Residues in the Topology."""
for chain in self._chains:
for residue in chain._residues:
yield residue | [
"def",
"residues",
"(",
"self",
")",
":",
"for",
"chain",
"in",
"self",
".",
"_chains",
":",
"for",
"residue",
"in",
"chain",
".",
"_residues",
":",
"yield",
"residue"
] | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/topology.py#L219-L223 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/adapters.py | python | HTTPAdapter.send | (self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None) | return self.build_response(request, resp) | Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up... | Sends PreparedRequest object. Returns Response object. | [
"Sends",
"PreparedRequest",
"object",
".",
"Returns",
"Response",
"object",
"."
] | def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
... | [
"def",
"send",
"(",
"self",
",",
"request",
",",
"stream",
"=",
"False",
",",
"timeout",
"=",
"None",
",",
"verify",
"=",
"True",
",",
"cert",
"=",
"None",
",",
"proxies",
"=",
"None",
")",
":",
"conn",
"=",
"self",
".",
"get_connection",
"(",
"req... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/adapters.py#L323-L437 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime.MakeTimezone | (*args, **kwargs) | return _misc_.DateTime_MakeTimezone(*args, **kwargs) | MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime | MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime | [
"MakeTimezone",
"(",
"self",
"wxDateTime",
"::",
"TimeZone",
"tz",
"bool",
"noDST",
"=",
"False",
")",
"-",
">",
"DateTime"
] | def MakeTimezone(*args, **kwargs):
"""MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime"""
return _misc_.DateTime_MakeTimezone(*args, **kwargs) | [
"def",
"MakeTimezone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_MakeTimezone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3926-L3928 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickle.py | python | Pickler.dump | (self, obj) | Write a pickled representation of obj to the open file. | Write a pickled representation of obj to the open file. | [
"Write",
"a",
"pickled",
"representation",
"of",
"obj",
"to",
"the",
"open",
"file",
"."
] | def dump(self, obj):
"""Write a pickled representation of obj to the open file."""
if self.proto >= 2:
self.write(PROTO + chr(self.proto))
self.save(obj)
self.write(STOP) | [
"def",
"dump",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"proto",
">=",
"2",
":",
"self",
".",
"write",
"(",
"PROTO",
"+",
"chr",
"(",
"self",
".",
"proto",
")",
")",
"self",
".",
"save",
"(",
"obj",
")",
"self",
".",
"write",
"("... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickle.py#L220-L225 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/jar.py | python | jarSources | (target, source, env, for_signature) | return result | Only include sources that are not a manifest file. | Only include sources that are not a manifest file. | [
"Only",
"include",
"sources",
"that",
"are",
"not",
"a",
"manifest",
"file",
"."
] | def jarSources(target, source, env, for_signature):
"""Only include sources that are not a manifest file."""
try:
env['JARCHDIR']
except KeyError:
jarchdir_set = False
else:
jarchdir_set = True
jarchdir = env.subst('$JARCHDIR', target=target, source=source)
if jar... | [
"def",
"jarSources",
"(",
"target",
",",
"source",
",",
"env",
",",
"for_signature",
")",
":",
"try",
":",
"env",
"[",
"'JARCHDIR'",
"]",
"except",
"KeyError",
":",
"jarchdir_set",
"=",
"False",
"else",
":",
"jarchdir_set",
"=",
"True",
"jarchdir",
"=",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/jar.py#L43-L72 | |
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppocr/postprocess/rec_postprocess.py | python | SEEDLabelDecode.__call__ | (self, preds, label=None, *args, **kwargs) | return text, label | text = self.decode(text)
if label is None:
return text
else:
label = self.decode(label, is_remove_duplicate=False)
return text, label | text = self.decode(text)
if label is None:
return text
else:
label = self.decode(label, is_remove_duplicate=False)
return text, label | [
"text",
"=",
"self",
".",
"decode",
"(",
"text",
")",
"if",
"label",
"is",
"None",
":",
"return",
"text",
"else",
":",
"label",
"=",
"self",
".",
"decode",
"(",
"label",
"is_remove_duplicate",
"=",
"False",
")",
"return",
"text",
"label"
] | def __call__(self, preds, label=None, *args, **kwargs):
"""
text = self.decode(text)
if label is None:
return text
else:
label = self.decode(label, is_remove_duplicate=False)
return text, label
"""
preds_idx = preds["rec_pred"]
... | [
"def",
"__call__",
"(",
"self",
",",
"preds",
",",
"label",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"preds_idx",
"=",
"preds",
"[",
"\"rec_pred\"",
"]",
"if",
"isinstance",
"(",
"preds_idx",
",",
"paddle",
".",
"Tensor",
")"... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/postprocess/rec_postprocess.py#L337-L359 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/quantization/tools/quantize_graph.py | python | quantize_weight_eightbit | (input_node, quantization_mode) | return [quint8_const_node, min_node, max_node, dequantize_node] | Returns replacement nodes for input_node using the Dequantize op. | Returns replacement nodes for input_node using the Dequantize op. | [
"Returns",
"replacement",
"nodes",
"for",
"input_node",
"using",
"the",
"Dequantize",
"op",
"."
] | def quantize_weight_eightbit(input_node, quantization_mode):
"""Returns replacement nodes for input_node using the Dequantize op."""
base_name = input_node.name + "_"
quint8_const_name = base_name + "quint8_const"
min_name = base_name + "min"
max_name = base_name + "max"
float_tensor = tensor_util.MakeNdarr... | [
"def",
"quantize_weight_eightbit",
"(",
"input_node",
",",
"quantization_mode",
")",
":",
"base_name",
"=",
"input_node",
".",
"name",
"+",
"\"_\"",
"quint8_const_name",
"=",
"base_name",
"+",
"\"quint8_const\"",
"min_name",
"=",
"base_name",
"+",
"\"min\"",
"max_na... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/quantization/tools/quantize_graph.py#L227-L272 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/example/pagerank.py | python | pagerank_algo | (edges) | return ranks | 接受表示网页链接关系的PCollection,求出每个网页的Rank指标
Args:
edges (PCollection): 输入PCollection,格式为(from_page_id, to_page_id)
Result:
PCollection: 表示结果的PCollection,格式为(page_id, rank) | 接受表示网页链接关系的PCollection,求出每个网页的Rank指标 | [
"接受表示网页链接关系的PCollection,求出每个网页的Rank指标"
] | def pagerank_algo(edges):
"""
接受表示网页链接关系的PCollection,求出每个网页的Rank指标
Args:
edges (PCollection): 输入PCollection,格式为(from_page_id, to_page_id)
Result:
PCollection: 表示结果的PCollection,格式为(page_id, rank)
"""
links = edges.apply(transforms.group_by_key)
ranks = links.apply(transforms.... | [
"def",
"pagerank_algo",
"(",
"edges",
")",
":",
"links",
"=",
"edges",
".",
"apply",
"(",
"transforms",
".",
"group_by_key",
")",
"ranks",
"=",
"links",
".",
"apply",
"(",
"transforms",
".",
"extract_keys",
")",
".",
"apply",
"(",
"transforms",
".",
"map... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/example/pagerank.py#L33-L58 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/processing/gui/AlgorithmDialog.py | python | AlgorithmDialog.flag_invalid_parameter_value | (self, message: str, widget) | Highlights a parameter with an invalid value | Highlights a parameter with an invalid value | [
"Highlights",
"a",
"parameter",
"with",
"an",
"invalid",
"value"
] | def flag_invalid_parameter_value(self, message: str, widget):
"""
Highlights a parameter with an invalid value
"""
try:
self.buttonBox().accepted.connect(lambda w=widget:
w.setPalette(QPalette()))
palette = widget.pale... | [
"def",
"flag_invalid_parameter_value",
"(",
"self",
",",
"message",
":",
"str",
",",
"widget",
")",
":",
"try",
":",
"self",
".",
"buttonBox",
"(",
")",
".",
"accepted",
".",
"connect",
"(",
"lambda",
"w",
"=",
"widget",
":",
"w",
".",
"setPalette",
"(... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/gui/AlgorithmDialog.py#L115-L130 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/app/mainwindow.py | python | _get_interface_dir | () | return os.path.dirname(mantidqtinterfaces.__file__) | Returns the path to the directory containing the mantidqt interfaces launch scripts
This is the path to the mantidqtinterfaces package | Returns the path to the directory containing the mantidqt interfaces launch scripts
This is the path to the mantidqtinterfaces package | [
"Returns",
"the",
"path",
"to",
"the",
"directory",
"containing",
"the",
"mantidqt",
"interfaces",
"launch",
"scripts",
"This",
"is",
"the",
"path",
"to",
"the",
"mantidqtinterfaces",
"package"
] | def _get_interface_dir():
"""
Returns the path to the directory containing the mantidqt interfaces launch scripts
This is the path to the mantidqtinterfaces package
"""
import mantidqtinterfaces
return os.path.dirname(mantidqtinterfaces.__file__) | [
"def",
"_get_interface_dir",
"(",
")",
":",
"import",
"mantidqtinterfaces",
"return",
"os",
".",
"path",
".",
"dirname",
"(",
"mantidqtinterfaces",
".",
"__file__",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/app/mainwindow.py#L69-L75 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | SpinCtrlDouble.GetMax | (*args, **kwargs) | return _controls_.SpinCtrlDouble_GetMax(*args, **kwargs) | GetMax(self) -> double | GetMax(self) -> double | [
"GetMax",
"(",
"self",
")",
"-",
">",
"double"
] | def GetMax(*args, **kwargs):
"""GetMax(self) -> double"""
return _controls_.SpinCtrlDouble_GetMax(*args, **kwargs) | [
"def",
"GetMax",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"SpinCtrlDouble_GetMax",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2508-L2510 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/filecmp.py | python | clear_cache | () | Clear the filecmp cache. | Clear the filecmp cache. | [
"Clear",
"the",
"filecmp",
"cache",
"."
] | def clear_cache():
"""Clear the filecmp cache."""
_cache.clear() | [
"def",
"clear_cache",
"(",
")",
":",
"_cache",
".",
"clear",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/filecmp.py#L25-L27 | ||
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | doc/userdoc/guides/spatially_structured_networks/scripts/connections.py | python | pn_fig | (fig, loc, spatial_nodes, cdict,
xlim=[0., .5], ylim=[0, 3.5], xticks=range(0, 51, 5),
yticks=np.arange(0., 1.1, 0.2), clr='blue',
label='') | ax.set_xticks(xticks)
ax.set_yticks(yticks) | ax.set_xticks(xticks)
ax.set_yticks(yticks) | [
"ax",
".",
"set_xticks",
"(",
"xticks",
")",
"ax",
".",
"set_yticks",
"(",
"yticks",
")"
] | def pn_fig(fig, loc, spatial_nodes, cdict,
xlim=[0., .5], ylim=[0, 3.5], xticks=range(0, 51, 5),
yticks=np.arange(0., 1.1, 0.2), clr='blue',
label=''):
nest.Connect(spatial_nodes, spatial_nodes, cdict)
ax = fig.add_subplot(loc)
conns = nest.GetConnections(spatial_nodes)
... | [
"def",
"pn_fig",
"(",
"fig",
",",
"loc",
",",
"spatial_nodes",
",",
"cdict",
",",
"xlim",
"=",
"[",
"0.",
",",
".5",
"]",
",",
"ylim",
"=",
"[",
"0",
",",
"3.5",
"]",
",",
"xticks",
"=",
"range",
"(",
"0",
",",
"51",
",",
"5",
")",
",",
"yt... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/doc/userdoc/guides/spatially_structured_networks/scripts/connections.py#L528-L552 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | _Transformer.transform | (self, feature_column) | return self._columns_to_tensors[feature_column] | Returns a Tensor which represents given feature_column.
Args:
feature_column: An instance of FeatureColumn.
Returns:
A Tensor which represents given feature_column. It may create a new Tensor
or re-use an existing one.
Raises:
ValueError: if FeatureColumn cannot be handled by this... | Returns a Tensor which represents given feature_column. | [
"Returns",
"a",
"Tensor",
"which",
"represents",
"given",
"feature_column",
"."
] | def transform(self, feature_column):
"""Returns a Tensor which represents given feature_column.
Args:
feature_column: An instance of FeatureColumn.
Returns:
A Tensor which represents given feature_column. It may create a new Tensor
or re-use an existing one.
Raises:
ValueError... | [
"def",
"transform",
"(",
"self",
",",
"feature_column",
")",
":",
"logging",
".",
"info",
"(",
"'Transforming feature_column %s'",
",",
"feature_column",
")",
"if",
"feature_column",
"in",
"self",
".",
"_columns_to_tensors",
":",
"# Feature_column is already transformed... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L366-L390 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py | python | tz_to_dtype | (tz) | Return a datetime64[ns] dtype appropriate for the given timezone.
Parameters
----------
tz : tzinfo or None
Returns
-------
np.dtype or Datetime64TZDType | Return a datetime64[ns] dtype appropriate for the given timezone. | [
"Return",
"a",
"datetime64",
"[",
"ns",
"]",
"dtype",
"appropriate",
"for",
"the",
"given",
"timezone",
"."
] | def tz_to_dtype(tz):
"""
Return a datetime64[ns] dtype appropriate for the given timezone.
Parameters
----------
tz : tzinfo or None
Returns
-------
np.dtype or Datetime64TZDType
"""
if tz is None:
return _NS_DTYPE
else:
return DatetimeTZDtype(tz=tz) | [
"def",
"tz_to_dtype",
"(",
"tz",
")",
":",
"if",
"tz",
"is",
"None",
":",
"return",
"_NS_DTYPE",
"else",
":",
"return",
"DatetimeTZDtype",
"(",
"tz",
"=",
"tz",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py#L55-L70 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm.assignments | (self) | return ret | Returns a list of Tensors with the matrix of assignments per shard. | Returns a list of Tensors with the matrix of assignments per shard. | [
"Returns",
"a",
"list",
"of",
"Tensors",
"with",
"the",
"matrix",
"of",
"assignments",
"per",
"shard",
"."
] | def assignments(self):
"""Returns a list of Tensors with the matrix of assignments per shard."""
ret = []
for w in self._w:
ret.append(tf.argmax(w, 1))
return ret | [
"def",
"assignments",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"w",
"in",
"self",
".",
"_w",
":",
"ret",
".",
"append",
"(",
"tf",
".",
"argmax",
"(",
"w",
",",
"1",
")",
")",
"return",
"ret"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L187-L192 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathOp.py | python | ObjectOp.__getstate__ | (self) | return None | __getstat__(self) ... called when receiver is saved.
Can safely be overwritten by subclasses. | __getstat__(self) ... called when receiver is saved.
Can safely be overwritten by subclasses. | [
"__getstat__",
"(",
"self",
")",
"...",
"called",
"when",
"receiver",
"is",
"saved",
".",
"Can",
"safely",
"be",
"overwritten",
"by",
"subclasses",
"."
] | def __getstate__(self):
"""__getstat__(self) ... called when receiver is saved.
Can safely be overwritten by subclasses."""
return None | [
"def",
"__getstate__",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathOp.py#L461-L464 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/dom/expatbuilder.py | python | ExpatBuilder.parseString | (self, string) | return doc | Parse a document from a string, returning the document node. | Parse a document from a string, returning the document node. | [
"Parse",
"a",
"document",
"from",
"a",
"string",
"returning",
"the",
"document",
"node",
"."
] | def parseString(self, string):
"""Parse a document from a string, returning the document node."""
parser = self.getParser()
try:
parser.Parse(string, True)
self._setup_subset(string)
except ParseEscape:
pass
doc = self.document
self.res... | [
"def",
"parseString",
"(",
"self",
",",
"string",
")",
":",
"parser",
"=",
"self",
".",
"getParser",
"(",
")",
"try",
":",
"parser",
".",
"Parse",
"(",
"string",
",",
"True",
")",
"self",
".",
"_setup_subset",
"(",
"string",
")",
"except",
"ParseEscape... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/dom/expatbuilder.py#L219-L230 | |
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/BasicPlace.py | python | BasicPlace.build_draw_placement | (self, params, placedb) | return draw_place.DrawPlace(placedb) | @brief plot placement
@param params parameters
@param placedb placement database | [] | def build_draw_placement(self, params, placedb):
"""
@brief plot placement
@param params parameters
@param placedb placement database
"""
return draw_place.DrawPlace(placedb) | [
"def",
"build_draw_placement",
"(",
"self",
",",
"params",
",",
"placedb",
")",
":",
"return",
"draw_place",
".",
"DrawPlace",
"(",
"placedb",
")"
] | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/BasicPlace.py#L995-L1001 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | ArtProvider.Push | (*args, **kwargs) | return _misc_.ArtProvider_Push(*args, **kwargs) | Push(ArtProvider provider)
Add new provider to the top of providers stack. | Push(ArtProvider provider) | [
"Push",
"(",
"ArtProvider",
"provider",
")"
] | def Push(*args, **kwargs):
"""
Push(ArtProvider provider)
Add new provider to the top of providers stack.
"""
return _misc_.ArtProvider_Push(*args, **kwargs) | [
"def",
"Push",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ArtProvider_Push",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2766-L2772 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/format/policy_templates/writers/admx_writer.py | python | ADMXWriter.BeginTemplate | (self) | Generates the skeleton of the ADMX template. An ADMX template contains
an ADMX "PolicyDefinitions" element with four child nodes: "policies"
"policyNamspaces", "resources", "supportedOn" and "categories" | Generates the skeleton of the ADMX template. An ADMX template contains
an ADMX "PolicyDefinitions" element with four child nodes: "policies"
"policyNamspaces", "resources", "supportedOn" and "categories" | [
"Generates",
"the",
"skeleton",
"of",
"the",
"ADMX",
"template",
".",
"An",
"ADMX",
"template",
"contains",
"an",
"ADMX",
"PolicyDefinitions",
"element",
"with",
"four",
"child",
"nodes",
":",
"policies",
"policyNamspaces",
"resources",
"supportedOn",
"and",
"cate... | def BeginTemplate(self):
'''Generates the skeleton of the ADMX template. An ADMX template contains
an ADMX "PolicyDefinitions" element with four child nodes: "policies"
"policyNamspaces", "resources", "supportedOn" and "categories"
'''
dom_impl = minidom.getDOMImplementation('')
self._doc = dom_... | [
"def",
"BeginTemplate",
"(",
"self",
")",
":",
"dom_impl",
"=",
"minidom",
".",
"getDOMImplementation",
"(",
"''",
")",
"self",
".",
"_doc",
"=",
"dom_impl",
".",
"createDocument",
"(",
"None",
",",
"'policyDefinitions'",
",",
"None",
")",
"if",
"self",
".... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/admx_writer.py#L348-L379 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/info.py | python | DataFrameInfoPrinter.max_rows | (self) | return get_option("display.max_info_rows", len(self.data) + 1) | Maximum info rows to be displayed. | Maximum info rows to be displayed. | [
"Maximum",
"info",
"rows",
"to",
"be",
"displayed",
"."
] | def max_rows(self) -> int:
"""Maximum info rows to be displayed."""
return get_option("display.max_info_rows", len(self.data) + 1) | [
"def",
"max_rows",
"(",
"self",
")",
"->",
"int",
":",
"return",
"get_option",
"(",
"\"display.max_info_rows\"",
",",
"len",
"(",
"self",
".",
"data",
")",
"+",
"1",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/info.py#L352-L354 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | lineno | (loc,strg) | return strg.count("\n",0,loc) + 1 | Returns current line number within a string, counting newlines as line separators.
The first line is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
o... | Returns current line number within a string, counting newlines as line separators.
The first line is number 1. | [
"Returns",
"current",
"line",
"number",
"within",
"a",
"string",
"counting",
"newlines",
"as",
"line",
"separators",
".",
"The",
"first",
"line",
"is",
"number",
"1",
"."
] | def lineno(loc,strg):
"""Returns current line number within a string, counting newlines as line separators.
The first line is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseStrin... | [
"def",
"lineno",
"(",
"loc",
",",
"strg",
")",
":",
"return",
"strg",
".",
"count",
"(",
"\"\\n\"",
",",
"0",
",",
"loc",
")",
"+",
"1"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L981-L991 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/integer.py | python | IntegerArray._maybe_mask_result | (self, result, mask, other, op_name) | return type(self)(result, mask, copy=False) | Parameters
----------
result : array-like
mask : array-like bool
other : scalar or array-like
op_name : str | Parameters
----------
result : array-like
mask : array-like bool
other : scalar or array-like
op_name : str | [
"Parameters",
"----------",
"result",
":",
"array",
"-",
"like",
"mask",
":",
"array",
"-",
"like",
"bool",
"other",
":",
"scalar",
"or",
"array",
"-",
"like",
"op_name",
":",
"str"
] | def _maybe_mask_result(self, result, mask, other, op_name):
"""
Parameters
----------
result : array-like
mask : array-like bool
other : scalar or array-like
op_name : str
"""
# may need to fill infs
# and mask wraparound
if is_flo... | [
"def",
"_maybe_mask_result",
"(",
"self",
",",
"result",
",",
"mask",
",",
"other",
",",
"op_name",
")",
":",
"# may need to fill infs",
"# and mask wraparound",
"if",
"is_float_dtype",
"(",
"result",
")",
":",
"mask",
"|=",
"(",
"result",
"==",
"np",
".",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/integer.py#L595-L618 | |
tiann/android-native-debug | 198903ed9346dc4a74327a63cb98d449b97d8047 | app/source/art/tools/cpplint.py | python | _ShouldPrintError | (category, confidence, linenum) | return True | If confidence >= verbose, category passes filter and is not suppressed. | If confidence >= verbose, category passes filter and is not suppressed. | [
"If",
"confidence",
">",
"=",
"verbose",
"category",
"passes",
"filter",
"and",
"is",
"not",
"suppressed",
"."
] | def _ShouldPrintError(category, confidence, linenum):
"""If confidence >= verbose, category passes filter and is not suppressed."""
# There are three ways we might decide not to print an error message:
# a "NOLINT(category)" comment appears in the source,
# the verbosity level isn't high enough, or the filters... | [
"def",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"# There are three ways we might decide not to print an error message:",
"# a \"NOLINT(category)\" comment appears in the source,",
"# the verbosity level isn't high enough, or the filters filter it out... | https://github.com/tiann/android-native-debug/blob/198903ed9346dc4a74327a63cb98d449b97d8047/app/source/art/tools/cpplint.py#L832-L856 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBDebugger.Terminate | () | return _lldb.SBDebugger_Terminate() | Terminate() | Terminate() | [
"Terminate",
"()"
] | def Terminate():
"""Terminate()"""
return _lldb.SBDebugger_Terminate() | [
"def",
"Terminate",
"(",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_Terminate",
"(",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3169-L3171 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/saver.py | python | export_meta_graph | (filename=None,
meta_info_def=None,
graph_def=None,
saver_def=None,
collection_list=None,
as_text=False,
graph=None,
export_scope=None,
clear_de... | return meta_graph_def | Returns `MetaGraphDef` proto.
Optionally writes it to filename.
This function exports the graph, saver, and collection objects into
`MetaGraphDef` protocol buffer with the intention of it being imported
at a later time or location to restart training, run inference, or be
a subgraph.
Args:
filename: ... | Returns `MetaGraphDef` proto. | [
"Returns",
"MetaGraphDef",
"proto",
"."
] | def export_meta_graph(filename=None,
meta_info_def=None,
graph_def=None,
saver_def=None,
collection_list=None,
as_text=False,
graph=None,
export_scope=None,
... | [
"def",
"export_meta_graph",
"(",
"filename",
"=",
"None",
",",
"meta_info_def",
"=",
"None",
",",
"graph_def",
"=",
"None",
",",
"saver_def",
"=",
"None",
",",
"collection_list",
"=",
"None",
",",
"as_text",
"=",
"False",
",",
"graph",
"=",
"None",
",",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/saver.py#L1640-L1721 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/impala_client.py | python | ImpalaHS2Client._do_hs2_rpc | (self, rpc, suppress_error_on_cancel=True, retry_on_error=False) | Executes the provided 'rpc' callable and tranlates any exceptions in the
appropriate exception for the shell. The input 'rpc' must be a python function
with the __name__ attribute and not a lambda function. Exceptions raised include:
* DisconnectedException if the client cannot communicate with the server.
... | Executes the provided 'rpc' callable and tranlates any exceptions in the
appropriate exception for the shell. The input 'rpc' must be a python function
with the __name__ attribute and not a lambda function. Exceptions raised include:
* DisconnectedException if the client cannot communicate with the server.
... | [
"Executes",
"the",
"provided",
"rpc",
"callable",
"and",
"tranlates",
"any",
"exceptions",
"in",
"the",
"appropriate",
"exception",
"for",
"the",
"shell",
".",
"The",
"input",
"rpc",
"must",
"be",
"a",
"python",
"function",
"with",
"the",
"__name__",
"attribut... | def _do_hs2_rpc(self, rpc, suppress_error_on_cancel=True, retry_on_error=False):
"""Executes the provided 'rpc' callable and tranlates any exceptions in the
appropriate exception for the shell. The input 'rpc' must be a python function
with the __name__ attribute and not a lambda function. Exceptions raised... | [
"def",
"_do_hs2_rpc",
"(",
"self",
",",
"rpc",
",",
"suppress_error_on_cancel",
"=",
"True",
",",
"retry_on_error",
"=",
"False",
")",
":",
"self",
".",
"_check_connected",
"(",
")",
"num_tries",
"=",
"1",
"max_tries",
"=",
"num_tries",
"if",
"retry_on_error",... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_client.py#L979-L1049 | ||
citra-emu/citra-canary | 286c6fbaa94492a300d8ca2bda032e0e136e3bc5 | dist/scripting/citra.py | python | Citra.write_memory | (self, write_address, write_contents) | return True | >>> c.write_memory(0x100000, b"\\xff\\xff\\xff\\xff")
True
>>> c.read_memory(0x100000, 4)
b'\\xff\\xff\\xff\\xff'
>>> c.write_memory(0x100000, b"\\x07\\x00\\x00\\xeb")
True
>>> c.read_memory(0x100000, 4)
b'\\x07\\x00\\x00\\xeb' | >>> c.write_memory(0x100000, b"\\xff\\xff\\xff\\xff")
True
>>> c.read_memory(0x100000, 4)
b'\\xff\\xff\\xff\\xff'
>>> c.write_memory(0x100000, b"\\x07\\x00\\x00\\xeb")
True
>>> c.read_memory(0x100000, 4)
b'\\x07\\x00\\x00\\xeb' | [
">>>",
"c",
".",
"write_memory",
"(",
"0x100000",
"b",
"\\\\",
"xff",
"\\\\",
"xff",
"\\\\",
"xff",
"\\\\",
"xff",
")",
"True",
">>>",
"c",
".",
"read_memory",
"(",
"0x100000",
"4",
")",
"b",
"\\\\",
"xff",
"\\\\",
"xff",
"\\\\",
"xff",
"\\\\",
"xff"... | def write_memory(self, write_address, write_contents):
"""
>>> c.write_memory(0x100000, b"\\xff\\xff\\xff\\xff")
True
>>> c.read_memory(0x100000, 4)
b'\\xff\\xff\\xff\\xff'
>>> c.write_memory(0x100000, b"\\x07\\x00\\x00\\xeb")
True
>>> c.read_memory(0x1000... | [
"def",
"write_memory",
"(",
"self",
",",
"write_address",
",",
"write_contents",
")",
":",
"write_size",
"=",
"len",
"(",
"write_contents",
")",
"while",
"write_size",
">",
"0",
":",
"temp_write_size",
"=",
"min",
"(",
"write_size",
",",
"MAX_REQUEST_DATA_SIZE",... | https://github.com/citra-emu/citra-canary/blob/286c6fbaa94492a300d8ca2bda032e0e136e3bc5/dist/scripting/citra.py#L62-L91 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | TranslationUnit.get_file | (self, filename) | return File.from_name(self, filename) | Obtain a File from this translation unit. | Obtain a File from this translation unit. | [
"Obtain",
"a",
"File",
"from",
"this",
"translation",
"unit",
"."
] | def get_file(self, filename):
"""Obtain a File from this translation unit."""
return File.from_name(self, filename) | [
"def",
"get_file",
"(",
"self",
",",
"filename",
")",
":",
"return",
"File",
".",
"from_name",
"(",
"self",
",",
"filename",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L2882-L2885 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/msearch.py | python | MSearch.terminateSearch | (self) | Prematurely terminate an running search prior
to the specified timeout. | Prematurely terminate an running search prior
to the specified timeout. | [
"Prematurely",
"terminate",
"an",
"running",
"search",
"prior",
"to",
"the",
"specified",
"timeout",
"."
] | def terminateSearch(self):
"""
Prematurely terminate an running search prior
to the specified timeout.
"""
self._runsearch = False | [
"def",
"terminateSearch",
"(",
"self",
")",
":",
"self",
".",
"_runsearch",
"=",
"False"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/msearch.py#L132-L137 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py | python | CCompiler_compile | (self, sources, output_dir=None, macros=None,
include_dirs=None, debug=0, extra_preargs=None,
extra_postargs=None, depends=None) | return objects | Compile one or more source files.
Please refer to the Python distutils API reference for more details.
Parameters
----------
sources : list of str
A list of filenames
output_dir : str, optional
Path to the output directory.
macros : list of tuples
A list of macro defini... | Compile one or more source files. | [
"Compile",
"one",
"or",
"more",
"source",
"files",
"."
] | def CCompiler_compile(self, sources, output_dir=None, macros=None,
include_dirs=None, debug=0, extra_preargs=None,
extra_postargs=None, depends=None):
"""
Compile one or more source files.
Please refer to the Python distutils API reference for more details.
... | [
"def",
"CCompiler_compile",
"(",
"self",
",",
"sources",
",",
"output_dir",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"debug",
"=",
"0",
",",
"extra_preargs",
"=",
"None",
",",
"extra_postargs",
"=",
"None",
",",
"de... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py#L123-L208 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/CreateCacheFilename.py | python | CreateCacheFilename.summary | (self) | return """Create cache filename""" | Return summary | Return summary | [
"Return",
"summary"
] | def summary(self):
""" Return summary
"""
return """Create cache filename""" | [
"def",
"summary",
"(",
"self",
")",
":",
"return",
"\"\"\"Create cache filename\"\"\""
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/CreateCacheFilename.py#L30-L33 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBInstruction.GetAddress | (self) | return _lldb.SBInstruction_GetAddress(self) | GetAddress(SBInstruction self) -> SBAddress | GetAddress(SBInstruction self) -> SBAddress | [
"GetAddress",
"(",
"SBInstruction",
"self",
")",
"-",
">",
"SBAddress"
] | def GetAddress(self):
"""GetAddress(SBInstruction self) -> SBAddress"""
return _lldb.SBInstruction_GetAddress(self) | [
"def",
"GetAddress",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBInstruction_GetAddress",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6173-L6175 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/gldraw.py | python | hermite_curve | (x1,v1,x2,v2,res=0.01,textured=False) | Draws a 3D Hermite curve with control points x1,v1,x2,v2 and resolution
res. If textured=True, generate texture coordinates for each point
(useful for applying patterns). | Draws a 3D Hermite curve with control points x1,v1,x2,v2 and resolution
res. If textured=True, generate texture coordinates for each point
(useful for applying patterns). | [
"Draws",
"a",
"3D",
"Hermite",
"curve",
"with",
"control",
"points",
"x1",
"v1",
"x2",
"v2",
"and",
"resolution",
"res",
".",
"If",
"textured",
"=",
"True",
"generate",
"texture",
"coordinates",
"for",
"each",
"point",
"(",
"useful",
"for",
"applying",
"pa... | def hermite_curve(x1,v1,x2,v2,res=0.01,textured=False):
"""Draws a 3D Hermite curve with control points x1,v1,x2,v2 and resolution
res. If textured=True, generate texture coordinates for each point
(useful for applying patterns)."""
bezier_curve(*spline.hermite_to_bezier(x1,v1,x2,v2),res=res,textured=t... | [
"def",
"hermite_curve",
"(",
"x1",
",",
"v1",
",",
"x2",
",",
"v2",
",",
"res",
"=",
"0.01",
",",
"textured",
"=",
"False",
")",
":",
"bezier_curve",
"(",
"*",
"spline",
".",
"hermite_to_bezier",
"(",
"x1",
",",
"v1",
",",
"x2",
",",
"v2",
")",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/gldraw.py#L170-L174 | ||
pytorch/xla | 93174035e8149d5d03cee446486de861f56493e1 | torch_xla/debug/metrics_compare_utils.py | python | parse_metrics_report | (report, dehumanize=True) | return data_points | Convert a string metrics report to a dict of parsed values.
Args:
report(string): Output from call to metrics_report().
Returns:
dict of metric name to metric value. Metric name will be appended
with the unit of measurement. Example output:
{
'CompileTime__Accumulator_sec': 50.0,
'Inb... | Convert a string metrics report to a dict of parsed values. | [
"Convert",
"a",
"string",
"metrics",
"report",
"to",
"a",
"dict",
"of",
"parsed",
"values",
"."
] | def parse_metrics_report(report, dehumanize=True):
"""Convert a string metrics report to a dict of parsed values.
Args:
report(string): Output from call to metrics_report().
Returns:
dict of metric name to metric value. Metric name will be appended
with the unit of measurement. Example output:
... | [
"def",
"parse_metrics_report",
"(",
"report",
",",
"dehumanize",
"=",
"True",
")",
":",
"data_points",
"=",
"{",
"}",
"# Parse metrics into data points.",
"metric_match_gd",
"=",
"[",
"m",
".",
"groupdict",
"(",
")",
"for",
"m",
"in",
"re",
".",
"finditer",
... | https://github.com/pytorch/xla/blob/93174035e8149d5d03cee446486de861f56493e1/torch_xla/debug/metrics_compare_utils.py#L70-L108 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItem.SetWindowEnabled | (self, enable=True) | Sets whether the associated window is enabled or not.
:param `enable`: ``True`` to enable the associated window, ``False`` to disable it. | Sets whether the associated window is enabled or not. | [
"Sets",
"whether",
"the",
"associated",
"window",
"is",
"enabled",
"or",
"not",
"."
] | def SetWindowEnabled(self, enable=True):
"""
Sets whether the associated window is enabled or not.
:param `enable`: ``True`` to enable the associated window, ``False`` to disable it.
"""
if not self._wnd:
raise Exception("\nERROR: This Item Has No Window Associated"... | [
"def",
"SetWindowEnabled",
"(",
"self",
",",
"enable",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"_wnd",
":",
"raise",
"Exception",
"(",
"\"\\nERROR: This Item Has No Window Associated\"",
")",
"self",
".",
"_windowenabled",
"=",
"enable",
"self",
".",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L2006-L2017 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/column/string.py | python | StringMethods.lower | (self) | return self._return_or_inplace(libstrings.to_lower(self._column)) | Converts all characters to lowercase.
Equivalent to `str.lower()
<https://docs.python.org/3/library/stdtypes.html#str.lower>`_.
Returns
-------
Series or Index of object
A copy of the object with all strings converted to lowercase.
See also
--------... | Converts all characters to lowercase. | [
"Converts",
"all",
"characters",
"to",
"lowercase",
"."
] | def lower(self) -> SeriesOrIndex:
"""
Converts all characters to lowercase.
Equivalent to `str.lower()
<https://docs.python.org/3/library/stdtypes.html#str.lower>`_.
Returns
-------
Series or Index of object
A copy of the object with all strings conv... | [
"def",
"lower",
"(",
"self",
")",
"->",
"SeriesOrIndex",
":",
"return",
"self",
".",
"_return_or_inplace",
"(",
"libstrings",
".",
"to_lower",
"(",
"self",
".",
"_column",
")",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/string.py#L1719-L1758 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup_common.py | python | pyod | (filename) | Python implementation of the od UNIX utility (od -b, more exactly).
Parameters
----------
filename : str
name of the file to get the dump from.
Returns
-------
out : seq
list of lines of od output
Note
----
We only implement enough to get the necessary information ... | Python implementation of the od UNIX utility (od -b, more exactly). | [
"Python",
"implementation",
"of",
"the",
"od",
"UNIX",
"utility",
"(",
"od",
"-",
"b",
"more",
"exactly",
")",
"."
] | def pyod(filename):
"""Python implementation of the od UNIX utility (od -b, more exactly).
Parameters
----------
filename : str
name of the file to get the dump from.
Returns
-------
out : seq
list of lines of od output
Note
----
We only implement enough to get... | [
"def",
"pyod",
"(",
"filename",
")",
":",
"def",
"_pyod2",
"(",
")",
":",
"out",
"=",
"[",
"]",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"fid",
":",
"yo",
"=",
"[",
"int",
"(",
"oct",
"(",
"int",
"(",
"binascii",
".",
"b2a_hex",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup_common.py#L298-L341 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlDoc.nodeListGetString | (self, list, inLine) | return ret | Build the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs | Build the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs | [
"Build",
"the",
"string",
"equivalent",
"to",
"the",
"text",
"contained",
"in",
"the",
"Node",
"list",
"made",
"of",
"TEXTs",
"and",
"ENTITY_REFs"
] | def nodeListGetString(self, list, inLine):
"""Build the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs """
if list is None: list__o = None
else: list__o = list._o
ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
re... | [
"def",
"nodeListGetString",
"(",
"self",
",",
"list",
",",
"inLine",
")",
":",
"if",
"list",
"is",
"None",
":",
"list__o",
"=",
"None",
"else",
":",
"list__o",
"=",
"list",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlNodeListGetString",
"(",
"self",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4451-L4457 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/HB2AReduce.py | python | HB2AReduce.get_detector_mask | (self, exp, indir) | return detector_mask | Returns an anode mask | Returns an anode mask | [
"Returns",
"an",
"anode",
"mask"
] | def get_detector_mask(self, exp, indir):
"""Returns an anode mask"""
detector_mask = np.ones(44, dtype=bool)
if len(self.getProperty("ExcludeDetectors").value) == 0:
exclude_filename = os.path.join(indir, 'HB2A_{}__exclude_detectors.txt'.format(exp))
if os.path.isfile(exc... | [
"def",
"get_detector_mask",
"(",
"self",
",",
"exp",
",",
"indir",
")",
":",
"detector_mask",
"=",
"np",
".",
"ones",
"(",
"44",
",",
"dtype",
"=",
"bool",
")",
"if",
"len",
"(",
"self",
".",
"getProperty",
"(",
"\"ExcludeDetectors\"",
")",
".",
"value... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/HB2AReduce.py#L304-L320 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py | python | MessageField.message_type | (self) | return self.type | Underlying message type used for serialization.
Will always be a sub-class of Message. This is different from type
which represents the python value that message_type is mapped to for
use by the user. | Underlying message type used for serialization. | [
"Underlying",
"message",
"type",
"used",
"for",
"serialization",
"."
] | def message_type(self):
"""Underlying message type used for serialization.
Will always be a sub-class of Message. This is different from type
which represents the python value that message_type is mapped to for
use by the user.
"""
return self.type | [
"def",
"message_type",
"(",
"self",
")",
":",
"return",
"self",
".",
"type"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L1610-L1617 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBar.GetToolRect | (*args, **kwargs) | return _aui.AuiToolBar_GetToolRect(*args, **kwargs) | GetToolRect(self, int toolId) -> Rect | GetToolRect(self, int toolId) -> Rect | [
"GetToolRect",
"(",
"self",
"int",
"toolId",
")",
"-",
">",
"Rect"
] | def GetToolRect(*args, **kwargs):
"""GetToolRect(self, int toolId) -> Rect"""
return _aui.AuiToolBar_GetToolRect(*args, **kwargs) | [
"def",
"GetToolRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetToolRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2102-L2104 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/calcdebug/calc.py | python | t_newline | (t) | r'\n+ | r'\n+ | [
"r",
"\\",
"n",
"+"
] | def t_newline(t):
r'\n+'
t.lexer.lineno += t.value.count("\n") | [
"def",
"t_newline",
"(",
"t",
")",
":",
"t",
".",
"lexer",
".",
"lineno",
"+=",
"t",
".",
"value",
".",
"count",
"(",
"\"\\n\"",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/calcdebug/calc.py#L31-L33 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/gdb/mongo_printers.py | python | StringDataPrinter.__init__ | (self, val) | Initialize StringDataPrinter. | Initialize StringDataPrinter. | [
"Initialize",
"StringDataPrinter",
"."
] | def __init__(self, val):
"""Initialize StringDataPrinter."""
self.val = val | [
"def",
"__init__",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"val",
"=",
"val"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo_printers.py#L83-L85 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/requests/cookies.py | python | get_cookie_header | (jar, request) | return r.get_new_headers().get('Cookie') | Produce an appropriate Cookie header string to be sent with `request`, or None. | Produce an appropriate Cookie header string to be sent with `request`, or None. | [
"Produce",
"an",
"appropriate",
"Cookie",
"header",
"string",
"to",
"be",
"sent",
"with",
"request",
"or",
"None",
"."
] | def get_cookie_header(jar, request):
"""Produce an appropriate Cookie header string to be sent with `request`, or None."""
r = MockRequest(request)
jar.add_cookie_header(r)
return r.get_new_headers().get('Cookie') | [
"def",
"get_cookie_header",
"(",
"jar",
",",
"request",
")",
":",
"r",
"=",
"MockRequest",
"(",
"request",
")",
"jar",
".",
"add_cookie_header",
"(",
"r",
")",
"return",
"r",
".",
"get_new_headers",
"(",
")",
".",
"get",
"(",
"'Cookie'",
")"
] | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/cookies.py#L120-L124 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.pack_slaves | (self) | return map(self._nametowidget,
self.tk.splitlist(
self.tk.call('pack', 'slaves', self._w))) | Return a list of all slaves of this widget
in its packing order. | Return a list of all slaves of this widget
in its packing order. | [
"Return",
"a",
"list",
"of",
"all",
"slaves",
"of",
"this",
"widget",
"in",
"its",
"packing",
"order",
"."
] | def pack_slaves(self):
"""Return a list of all slaves of this widget
in its packing order."""
return map(self._nametowidget,
self.tk.splitlist(
self.tk.call('pack', 'slaves', self._w))) | [
"def",
"pack_slaves",
"(",
"self",
")",
":",
"return",
"map",
"(",
"self",
".",
"_nametowidget",
",",
"self",
".",
"tk",
".",
"splitlist",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'pack'",
",",
"'slaves'",
",",
"self",
".",
"_w",
")",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1294-L1299 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateSpan_Day | (*args) | return _misc_.DateSpan_Day(*args) | DateSpan_Day() -> DateSpan | DateSpan_Day() -> DateSpan | [
"DateSpan_Day",
"()",
"-",
">",
"DateSpan"
] | def DateSpan_Day(*args):
"""DateSpan_Day() -> DateSpan"""
return _misc_.DateSpan_Day(*args) | [
"def",
"DateSpan_Day",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"DateSpan_Day",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4756-L4758 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/fileinput.py | python | filelineno | () | return _state.filelineno() | Return the line number in the current file. Before the first line
has been read, returns 0. After the last line of the last file has
been read, returns the line number of that line within the file. | Return the line number in the current file. Before the first line
has been read, returns 0. After the last line of the last file has
been read, returns the line number of that line within the file. | [
"Return",
"the",
"line",
"number",
"in",
"the",
"current",
"file",
".",
"Before",
"the",
"first",
"line",
"has",
"been",
"read",
"returns",
"0",
".",
"After",
"the",
"last",
"line",
"of",
"the",
"last",
"file",
"has",
"been",
"read",
"returns",
"the",
... | def filelineno():
"""
Return the line number in the current file. Before the first line
has been read, returns 0. After the last line of the last file has
been read, returns the line number of that line within the file.
"""
if not _state:
raise RuntimeError("no active input()")
retur... | [
"def",
"filelineno",
"(",
")",
":",
"if",
"not",
"_state",
":",
"raise",
"RuntimeError",
"(",
"\"no active input()\"",
")",
"return",
"_state",
".",
"filelineno",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/fileinput.py#L138-L146 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/feminout/importToolsFem.py | python | get_FemMeshObjectElementTypes | (
fem_mesh_obj,
remove_zero_element_entries=True
) | return elements_list | Spit out all elements in the mesh with their appropriate dimension. | Spit out all elements in the mesh with their appropriate dimension. | [
"Spit",
"out",
"all",
"elements",
"in",
"the",
"mesh",
"with",
"their",
"appropriate",
"dimension",
"."
] | def get_FemMeshObjectElementTypes(
fem_mesh_obj,
remove_zero_element_entries=True
):
"""
Spit out all elements in the mesh with their appropriate dimension.
"""
FreeCAD_element_names_dims = {
"Node": 0, "Edge": 1, "Hexa": 3, "Polygon": 2, "Polyhedron": 3,
"Prism": 3, "Pyramid... | [
"def",
"get_FemMeshObjectElementTypes",
"(",
"fem_mesh_obj",
",",
"remove_zero_element_entries",
"=",
"True",
")",
":",
"FreeCAD_element_names_dims",
"=",
"{",
"\"Node\"",
":",
"0",
",",
"\"Edge\"",
":",
"1",
",",
"\"Hexa\"",
":",
"3",
",",
"\"Polygon\"",
":",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/feminout/importToolsFem.py#L101-L122 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/axestabwidget/presenter.py | python | AxesTabWidgetPresenter.get_selected_ax_properties | (self) | return AxProperties.from_ax_object(self.get_selected_ax()) | Get axes properties from selected axes | Get axes properties from selected axes | [
"Get",
"axes",
"properties",
"from",
"selected",
"axes"
] | def get_selected_ax_properties(self):
"""Get axes properties from selected axes"""
return AxProperties.from_ax_object(self.get_selected_ax()) | [
"def",
"get_selected_ax_properties",
"(",
"self",
")",
":",
"return",
"AxProperties",
".",
"from_ax_object",
"(",
"self",
".",
"get_selected_ax",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/axestabwidget/presenter.py#L140-L142 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/buttonbar.py | python | RibbonButtonBar.OnSize | (self, event) | Handles the ``wx.EVT_SIZE`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`SizeEvent` event to be processed. | Handles the ``wx.EVT_SIZE`` event for :class:`RibbonButtonBar`. | [
"Handles",
"the",
"wx",
".",
"EVT_SIZE",
"event",
"for",
":",
"class",
":",
"RibbonButtonBar",
"."
] | def OnSize(self, event):
"""
Handles the ``wx.EVT_SIZE`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`SizeEvent` event to be processed.
"""
new_size = event.GetSize()
layout_count = len(self._layouts)
self._current_layout = layout_count - 1
... | [
"def",
"OnSize",
"(",
"self",
",",
"event",
")",
":",
"new_size",
"=",
"event",
".",
"GetSize",
"(",
")",
"layout_count",
"=",
"len",
"(",
"self",
".",
"_layouts",
")",
"self",
".",
"_current_layout",
"=",
"layout_count",
"-",
"1",
"for",
"layout_i",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/buttonbar.py#L850-L871 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/curriculum_reset_helpers.py | python | gap_task_curriculum_update | (env,
num_iter,
distance_to_gap_or_hurdle=1.5,
initial_gap_length=0.1,
max_iterations=500,
gap_delta=0.0008) | Linearly increase the gap width wrt the iteration number.
This is specific to BuildSingleGapWorld.
Args:
env: An instance of a LocomotionGymEnv.
num_iter: The training iteration we are on.
distance_to_gap_or_hurdle: The distance to the gap.
initial_gap_length: The starting gap length.
max_iter... | Linearly increase the gap width wrt the iteration number. | [
"Linearly",
"increase",
"the",
"gap",
"width",
"wrt",
"the",
"iteration",
"number",
"."
] | def gap_task_curriculum_update(env,
num_iter,
distance_to_gap_or_hurdle=1.5,
initial_gap_length=0.1,
max_iterations=500,
gap_delta=0.0008):
"""Linearly increase th... | [
"def",
"gap_task_curriculum_update",
"(",
"env",
",",
"num_iter",
",",
"distance_to_gap_or_hurdle",
"=",
"1.5",
",",
"initial_gap_length",
"=",
"0.1",
",",
"max_iterations",
"=",
"500",
",",
"gap_delta",
"=",
"0.0008",
")",
":",
"gap_length",
"=",
"initial_gap_len... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/curriculum_reset_helpers.py#L9-L34 | ||
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Job.py | python | Jobs.were_interrupted | (self) | return self.job.interrupted() | Returns whether the jobs were interrupted by a signal. | Returns whether the jobs were interrupted by a signal. | [
"Returns",
"whether",
"the",
"jobs",
"were",
"interrupted",
"by",
"a",
"signal",
"."
] | def were_interrupted(self):
"""Returns whether the jobs were interrupted by a signal."""
return self.job.interrupted() | [
"def",
"were_interrupted",
"(",
"self",
")",
":",
"return",
"self",
".",
"job",
".",
"interrupted",
"(",
")"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Job.py#L116-L118 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/multiprocessing/__init__.py | python | Queue | (maxsize=0) | return Queue(maxsize) | Returns a queue object | Returns a queue object | [
"Returns",
"a",
"queue",
"object"
] | def Queue(maxsize=0):
'''
Returns a queue object
'''
from multiprocessing.queues import Queue
return Queue(maxsize) | [
"def",
"Queue",
"(",
"maxsize",
"=",
"0",
")",
":",
"from",
"multiprocessing",
".",
"queues",
"import",
"Queue",
"return",
"Queue",
"(",
"maxsize",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/multiprocessing/__init__.py#L213-L218 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pep517/_in_process.py | python | build_wheel | (wheel_directory, config_settings, metadata_directory=None) | return _build_backend().build_wheel(wheel_directory, config_settings,
metadata_directory) | Invoke the mandatory build_wheel hook.
If a wheel was already built in the
prepare_metadata_for_build_wheel fallback, this
will copy it rather than rebuilding the wheel. | Invoke the mandatory build_wheel hook. | [
"Invoke",
"the",
"mandatory",
"build_wheel",
"hook",
"."
] | def build_wheel(wheel_directory, config_settings, metadata_directory=None):
"""Invoke the mandatory build_wheel hook.
If a wheel was already built in the
prepare_metadata_for_build_wheel fallback, this
will copy it rather than rebuilding the wheel.
"""
prebuilt_whl = _find_already_built_wheel(m... | [
"def",
"build_wheel",
"(",
"wheel_directory",
",",
"config_settings",
",",
"metadata_directory",
"=",
"None",
")",
":",
"prebuilt_whl",
"=",
"_find_already_built_wheel",
"(",
"metadata_directory",
")",
"if",
"prebuilt_whl",
":",
"shutil",
".",
"copy2",
"(",
"prebuil... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pep517/_in_process.py#L192-L205 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/win/importlibs/create_importlib_win.py | python | _ImportLibraryGenerator._CreateImportLib | (self, dll_name, imports, architecture, output_file) | Creates an import lib binding imports to dll_name for architecture.
On success, writes the import library to output file. | Creates an import lib binding imports to dll_name for architecture. | [
"Creates",
"an",
"import",
"lib",
"binding",
"imports",
"to",
"dll_name",
"for",
"architecture",
"."
] | def _CreateImportLib(self, dll_name, imports, architecture, output_file):
"""Creates an import lib binding imports to dll_name for architecture.
On success, writes the import library to output file.
"""
obj_file = None
# For x86 architecture we have to provide an object file for correct
# name... | [
"def",
"_CreateImportLib",
"(",
"self",
",",
"dll_name",
",",
"imports",
",",
"architecture",
",",
"output_file",
")",
":",
"obj_file",
"=",
"None",
"# For x86 architecture we have to provide an object file for correct",
"# name mangling between the import stubs and the exported ... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/win/importlibs/create_importlib_win.py#L122-L158 | ||
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | bindings/python/llvm/disassembler.py | python | Disassembler.__init__ | (self, triple) | Create a new disassembler instance.
The triple argument is the triple to create the disassembler for. This
is something like 'i386-apple-darwin9'. | Create a new disassembler instance. | [
"Create",
"a",
"new",
"disassembler",
"instance",
"."
] | def __init__(self, triple):
"""Create a new disassembler instance.
The triple argument is the triple to create the disassembler for. This
is something like 'i386-apple-darwin9'.
"""
_ensure_initialized()
ptr = lib.LLVMCreateDisasm(c_char_p(triple), c_void_p(None), c_in... | [
"def",
"__init__",
"(",
"self",
",",
"triple",
")",
":",
"_ensure_initialized",
"(",
")",
"ptr",
"=",
"lib",
".",
"LLVMCreateDisasm",
"(",
"c_char_p",
"(",
"triple",
")",
",",
"c_void_p",
"(",
"None",
")",
",",
"c_int",
"(",
"0",
")",
",",
"callbacks",... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/bindings/python/llvm/disassembler.py#L67-L82 | ||
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/modules/transformer.py | python | MultiheadAttention.forward | (self, queries, keys, values, mask=None) | return outputs_fc | Apply multi-head attention.
The input and output tensors are interpreted as sequences of
vectors, where the first tensor dimension is the sequence
dimension.
Args:
queries (lbann.Layer): Sequence of query vectors.
keys (lbann.Layer): Sequence of key vectors.
... | Apply multi-head attention. | [
"Apply",
"multi",
"-",
"head",
"attention",
"."
] | def forward(self, queries, keys, values, mask=None):
"""Apply multi-head attention.
The input and output tensors are interpreted as sequences of
vectors, where the first tensor dimension is the sequence
dimension.
Args:
queries (lbann.Layer): Sequence of query vecto... | [
"def",
"forward",
"(",
"self",
",",
"queries",
",",
"keys",
",",
"values",
",",
"mask",
"=",
"None",
")",
":",
"self",
".",
"instance",
"+=",
"1",
"name",
"=",
"f'{self.name}_instance{self.instance}'",
"# Apply fully-connected layers to input sequences",
"queries_fc... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/modules/transformer.py#L71-L178 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py | python | session | () | return Session() | Returns a :class:`Session` for context-management.
.. deprecated:: 1.0.0
This method has been deprecated since version 1.0.0 and is only kept for
backwards compatibility. New code should use :class:`~requests.sessions.Session`
to create a session. This may be removed at a future date... | [] | def session():
"""
Returns a :class:`Session` for context-management.
.. deprecated:: 1.0.0
This method has been deprecated since version 1.0.0 and is only kept for
backwards compatibility. New code should use :class:`~requests.sessions.Session`
to create a session. This ma... | [
"def",
"session",
"(",
")",
":",
"return",
"Session",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py#L1537-L1561 | ||
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/guidance/driver_lib.py | python | fix_logits | (kind, logits) | return logits | Fix logits to be scalar (True / False) rather than two class.
Args:
kind: Either 'sequence' or 'tree'.
logits: Logits tensor of shape (?, 2) or (?,).
Returns:
Logits tensor of shape (?,)
Raises:
ValueError: If logits has an invalid shape. | Fix logits to be scalar (True / False) rather than two class. | [
"Fix",
"logits",
"to",
"be",
"scalar",
"(",
"True",
"/",
"False",
")",
"rather",
"than",
"two",
"class",
"."
] | def fix_logits(kind, logits):
"""Fix logits to be scalar (True / False) rather than two class.
Args:
kind: Either 'sequence' or 'tree'.
logits: Logits tensor of shape (?, 2) or (?,).
Returns:
Logits tensor of shape (?,)
Raises:
ValueError: If logits has an invalid shape.
"""
logits_rank =... | [
"def",
"fix_logits",
"(",
"kind",
",",
"logits",
")",
":",
"logits_rank",
"=",
"logits",
".",
"get_shape",
"(",
")",
".",
"ndims",
"if",
"kind",
"==",
"'sequence'",
"and",
"logits_rank",
"==",
"2",
":",
"logits",
".",
"get_shape",
"(",
")",
".",
"merge... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/guidance/driver_lib.py#L71-L90 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/idtracking.py | python | FrameSymbolVisitor.visit_OverlayScope | (self, node, **kwargs) | Do not visit into overlay scopes. | Do not visit into overlay scopes. | [
"Do",
"not",
"visit",
"into",
"overlay",
"scopes",
"."
] | def visit_OverlayScope(self, node, **kwargs):
"""Do not visit into overlay scopes.""" | [
"def",
"visit_OverlayScope",
"(",
"self",
",",
"node",
",",
"*",
"*",
"kwargs",
")",
":"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/idtracking.py#L285-L286 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.srp_client_get_callback | (self) | return self.__parse_Enabled_or_Disabled(self.execute_command('srp client callback')) | Get SRP client callback mode. | Get SRP client callback mode. | [
"Get",
"SRP",
"client",
"callback",
"mode",
"."
] | def srp_client_get_callback(self) -> bool:
"""Get SRP client callback mode."""
return self.__parse_Enabled_or_Disabled(self.execute_command('srp client callback')) | [
"def",
"srp_client_get_callback",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"__parse_Enabled_or_Disabled",
"(",
"self",
".",
"execute_command",
"(",
"'srp client callback'",
")",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L1041-L1043 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/peeking-iterator.py | python | PeekingIterator.hasNext | (self) | return self.has_next_ | :rtype: bool | :rtype: bool | [
":",
"rtype",
":",
"bool"
] | def hasNext(self):
"""
:rtype: bool
"""
return self.has_next_ | [
"def",
"hasNext",
"(",
"self",
")",
":",
"return",
"self",
".",
"has_next_"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/peeking-iterator.py#L35-L39 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py | python | GenerateEnvironmentFiles | (toplevel_build_dir, generator_flags,
system_includes, open_out) | return cl_paths | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | [
"It",
"s",
"not",
"sufficient",
"to",
"have",
"the",
"absolute",
"path",
"to",
"the",
"compiler",
"linker",
"etc",
".",
"on",
"Windows",
"as",
"those",
"tools",
"rely",
"on",
".",
"dlls",
"being",
"in",
"the",
"PATH",
".",
"We",
"also",
"need",
"to",
... | def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags,
system_includes, open_out):
"""It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers w... | [
"def",
"GenerateEnvironmentFiles",
"(",
"toplevel_build_dir",
",",
"generator_flags",
",",
"system_includes",
",",
"open_out",
")",
":",
"archs",
"=",
"(",
"'x86'",
",",
"'x64'",
")",
"if",
"generator_flags",
".",
"get",
"(",
"'ninja_use_custom_environment_files'",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py#L1017-L1070 | |
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | python/caffe/net_spec.py | python | to_proto | (*tops) | return net | Generate a NetParameter that contains all layers needed to compute
all arguments. | Generate a NetParameter that contains all layers needed to compute
all arguments. | [
"Generate",
"a",
"NetParameter",
"that",
"contains",
"all",
"layers",
"needed",
"to",
"compute",
"all",
"arguments",
"."
] | def to_proto(*tops):
"""Generate a NetParameter that contains all layers needed to compute
all arguments."""
layers = OrderedDict()
autonames = Counter()
for top in tops:
top.fn._to_proto(layers, {}, autonames)
net = caffe_pb2.NetParameter()
net.layer.extend(layers.values())
ret... | [
"def",
"to_proto",
"(",
"*",
"tops",
")",
":",
"layers",
"=",
"OrderedDict",
"(",
")",
"autonames",
"=",
"Counter",
"(",
")",
"for",
"top",
"in",
"tops",
":",
"top",
".",
"fn",
".",
"_to_proto",
"(",
"layers",
",",
"{",
"}",
",",
"autonames",
")",
... | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/python/caffe/net_spec.py#L43-L53 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/random.py | python | set_rng_state | (new_state: torch.Tensor) | r"""Sets the random number generator state.
.. note: This function only works for CPU. For CUDA, please use
torch.manual_seed(seed), which works for both CPU and CUDA.
Args:
new_state (torch.ByteTensor): The desired state | r"""Sets the random number generator state. | [
"r",
"Sets",
"the",
"random",
"number",
"generator",
"state",
"."
] | def set_rng_state(new_state: torch.Tensor) -> None:
r"""Sets the random number generator state.
.. note: This function only works for CPU. For CUDA, please use
torch.manual_seed(seed), which works for both CPU and CUDA.
Args:
new_state (torch.ByteTensor): The desired state
"""
... | [
"def",
"set_rng_state",
"(",
"new_state",
":",
"torch",
".",
"Tensor",
")",
"->",
"None",
":",
"default_generator",
".",
"set_state",
"(",
"new_state",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/random.py#L9-L18 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/popen2.py | python | Popen3.wait | (self) | return self.sts | Wait for and return the exit status of the child process. | Wait for and return the exit status of the child process. | [
"Wait",
"for",
"and",
"return",
"the",
"exit",
"status",
"of",
"the",
"child",
"process",
"."
] | def wait(self):
"""Wait for and return the exit status of the child process."""
if self.sts < 0:
pid, sts = os.waitpid(self.pid, 0)
# This used to be a test, but it is believed to be
# always true, so I changed it to an assertion - mvl
assert pid == self.p... | [
"def",
"wait",
"(",
"self",
")",
":",
"if",
"self",
".",
"sts",
"<",
"0",
":",
"pid",
",",
"sts",
"=",
"os",
".",
"waitpid",
"(",
"self",
".",
"pid",
",",
"0",
")",
"# This used to be a test, but it is believed to be",
"# always true, so I changed it to an ass... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/popen2.py#L105-L113 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/dddoc/core.py | python | FileCache.flush | (self) | return True | Store the cache to its file. | Store the cache to its file. | [
"Store",
"the",
"cache",
"to",
"its",
"file",
"."
] | def flush(self):
"""Store the cache to its file."""
try:
with open(self.path, 'wb') as f:
pickle.dump(self.content, f)
except:
print >>sys.stderr, 'Could not store cache %s' % self.path
return False
print >>sys.stderr, 'Successfully sto... | [
"def",
"flush",
"(",
"self",
")",
":",
"try",
":",
"with",
"open",
"(",
"self",
".",
"path",
",",
"'wb'",
")",
"as",
"f",
":",
"pickle",
".",
"dump",
"(",
"self",
".",
"content",
",",
"f",
")",
"except",
":",
"print",
">>",
"sys",
".",
"stderr"... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dddoc/core.py#L186-L195 | |
lighttransport/nanort | 74063967336311f54ede5dffdfa242123825033b | deps/cpplint.py | python | FindCheckMacro | (line) | return (None, -1) | Find a replaceable CHECK-like macro.
Args:
line: line to search on.
Returns:
(macro name, start position), or (None, -1) if no replaceable
macro is found. | Find a replaceable CHECK-like macro. | [
"Find",
"a",
"replaceable",
"CHECK",
"-",
"like",
"macro",
"."
] | def FindCheckMacro(line):
"""Find a replaceable CHECK-like macro.
Args:
line: line to search on.
Returns:
(macro name, start position), or (None, -1) if no replaceable
macro is found.
"""
for macro in _CHECK_MACROS:
i = line.find(macro)
if i >= 0:
# Find opening parenthesis. Do a r... | [
"def",
"FindCheckMacro",
"(",
"line",
")",
":",
"for",
"macro",
"in",
"_CHECK_MACROS",
":",
"i",
"=",
"line",
".",
"find",
"(",
"macro",
")",
"if",
"i",
">=",
"0",
":",
"# Find opening parenthesis. Do a regular expression match here",
"# to make sure that we are ma... | https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L4178-L4198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.