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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/gem5/components/boards/mem_mode.py | python | mem_mode_to_string | (mem_mode: MemMode) | Returns the string form of the mem_mode, compatible with the gem5
simulator.
:returns: The string form of the mem_mode | Returns the string form of the mem_mode, compatible with the gem5
simulator. | [
"Returns",
"the",
"string",
"form",
"of",
"the",
"mem_mode",
"compatible",
"with",
"the",
"gem5",
"simulator",
"."
] | def mem_mode_to_string(mem_mode: MemMode) -> str:
"""
Returns the string form of the mem_mode, compatible with the gem5
simulator.
:returns: The string form of the mem_mode
"""
if mem_mode == MemMode.TIMING:
return "timing"
elif mem_mode == MemMode.ATOMIC:
return "atomic"
... | [
"def",
"mem_mode_to_string",
"(",
"mem_mode",
":",
"MemMode",
")",
"->",
"str",
":",
"if",
"mem_mode",
"==",
"MemMode",
".",
"TIMING",
":",
"return",
"\"timing\"",
"elif",
"mem_mode",
"==",
"MemMode",
".",
"ATOMIC",
":",
"return",
"\"atomic\"",
"elif",
"mem_... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/boards/mem_mode.py#L39-L53 | ||
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py | python | Replay | (*args) | Put mocks into Replay mode.
Args:
# args is any number of mocks to put into replay mode. | Put mocks into Replay mode. | [
"Put",
"mocks",
"into",
"Replay",
"mode",
"."
] | def Replay(*args):
"""Put mocks into Replay mode.
Args:
# args is any number of mocks to put into replay mode.
"""
for mock in args:
mock._Replay() | [
"def",
"Replay",
"(",
"*",
"args",
")",
":",
"for",
"mock",
"in",
"args",
":",
"mock",
".",
"_Replay",
"(",
")"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L235-L243 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py | python | install.finalize_other | (self) | Finalizes options for non-posix platforms | Finalizes options for non-posix platforms | [
"Finalizes",
"options",
"for",
"non",
"-",
"posix",
"platforms"
] | def finalize_other(self):
"""Finalizes options for non-posix platforms"""
if self.user:
if self.install_userbase is None:
raise DistutilsPlatformError(
"User base directory is not specified")
self.install_base = self.install_platbase = self.ins... | [
"def",
"finalize_other",
"(",
"self",
")",
":",
"if",
"self",
".",
"user",
":",
"if",
"self",
".",
"install_userbase",
"is",
"None",
":",
"raise",
"DistutilsPlatformError",
"(",
"\"User base directory is not specified\"",
")",
"self",
".",
"install_base",
"=",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py#L432-L452 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Utilities/Scripts/SlicerWizard/Utilities.py | python | haveGit | () | return _haveGit | Return True if git is available.
A side effect of `import git` is that it shows a popup window on
MacOSX, asking the user to install XCode (if git is not installed already),
therefore this method should only be called if git is actually needed. | Return True if git is available. | [
"Return",
"True",
"if",
"git",
"is",
"available",
"."
] | def haveGit():
"""Return True if git is available.
A side effect of `import git` is that it shows a popup window on
MacOSX, asking the user to install XCode (if git is not installed already),
therefore this method should only be called if git is actually needed.
"""
try:
import git
_haveGit = True... | [
"def",
"haveGit",
"(",
")",
":",
"try",
":",
"import",
"git",
"_haveGit",
"=",
"True",
"except",
"ImportError",
":",
"_haveGit",
"=",
"False",
"return",
"_haveGit"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Utilities/Scripts/SlicerWizard/Utilities.py#L10-L25 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/opt/python/training/elastic_average_optimizer.py | python | ElasticAverageCustomGetter.__init__ | (self, worker_device) | Create a new `ElasticAverageCustomGetter`.
Args:
worker_device: String. Name of the `worker` job. | Create a new `ElasticAverageCustomGetter`. | [
"Create",
"a",
"new",
"ElasticAverageCustomGetter",
"."
] | def __init__(self, worker_device):
"""Create a new `ElasticAverageCustomGetter`.
Args:
worker_device: String. Name of the `worker` job.
"""
self._worker_device = worker_device
self._local_map = {}
self._global_map = {} | [
"def",
"__init__",
"(",
"self",
",",
"worker_device",
")",
":",
"self",
".",
"_worker_device",
"=",
"worker_device",
"self",
".",
"_local_map",
"=",
"{",
"}",
"self",
".",
"_global_map",
"=",
"{",
"}"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/opt/python/training/elastic_average_optimizer.py#L87-L95 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/datasets/imagenet.py | python | imagenet.gt_roidb | (self) | return gt_roidb | Return the database of ground-truth regions of interest.
This function loads/saves from/to a cache file to speed up future calls. | Return the database of ground-truth regions of interest.
This function loads/saves from/to a cache file to speed up future calls. | [
"Return",
"the",
"database",
"of",
"ground",
"-",
"truth",
"regions",
"of",
"interest",
".",
"This",
"function",
"loads",
"/",
"saves",
"from",
"/",
"to",
"a",
"cache",
"file",
"to",
"speed",
"up",
"future",
"calls",
"."
] | def gt_roidb(self):
"""
Return the database of ground-truth regions of interest.
This function loads/saves from/to a cache file to speed up future calls.
"""
cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl')
if os.path.exists(cache_file):
... | [
"def",
"gt_roidb",
"(",
"self",
")",
":",
"cache_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"cache_path",
",",
"self",
".",
"name",
"+",
"'_gt_roidb.pkl'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"cache_file",
")",
":",
... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/datasets/imagenet.py#L144-L162 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/packaging/ipk.py | python | build_specfiles | (source, target, env) | return 0 | Filter the targets for the needed files and use the variables in env
to create the specfile. | Filter the targets for the needed files and use the variables in env
to create the specfile. | [
"Filter",
"the",
"targets",
"for",
"the",
"needed",
"files",
"and",
"use",
"the",
"variables",
"in",
"env",
"to",
"create",
"the",
"specfile",
"."
] | def build_specfiles(source, target, env):
""" Filter the targets for the needed files and use the variables in env
to create the specfile.
"""
#
# At first we care for the CONTROL/control file, which is the main file for ipk.
#
# For this we need to open multiple files in random order, so we... | [
"def",
"build_specfiles",
"(",
"source",
",",
"target",
",",
"env",
")",
":",
"#",
"# At first we care for the CONTROL/control file, which is the main file for ipk.",
"#",
"# For this we need to open multiple files in random order, so we store into",
"# a dict so they can be easily acces... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/packaging/ipk.py#L106-L179 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/cauchy.py | python | Cauchy._cross_entropy | (self, dist, loc_b, scale_b, loc_a=None, scale_a=None) | return self._entropy(loc_a, scale_a) + self._kl_loss(dist, loc_b, scale_b, loc_a, scale_a) | r"""
Evaluate cross entropy between Cauchy distributions.
Args:
dist (str): The type of the distributions. Should be "Cauchy" in this case.
loc_b (Tensor): The loc of distribution b.
scale_b (Tensor): The scale of distribution b.
loc (Tensor): The loc of ... | r"""
Evaluate cross entropy between Cauchy distributions. | [
"r",
"Evaluate",
"cross",
"entropy",
"between",
"Cauchy",
"distributions",
"."
] | def _cross_entropy(self, dist, loc_b, scale_b, loc_a=None, scale_a=None):
r"""
Evaluate cross entropy between Cauchy distributions.
Args:
dist (str): The type of the distributions. Should be "Cauchy" in this case.
loc_b (Tensor): The loc of distribution b.
sc... | [
"def",
"_cross_entropy",
"(",
"self",
",",
"dist",
",",
"loc_b",
",",
"scale_b",
",",
"loc_a",
"=",
"None",
",",
"scale_a",
"=",
"None",
")",
":",
"check_distribution_name",
"(",
"dist",
",",
"'Cauchy'",
")",
"return",
"self",
".",
"_entropy",
"(",
"loc_... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/cauchy.py#L355-L367 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/fpformat.py | python | sci | (x, digs) | return s + 'e' + e | Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point
and exactly one digit before.
If digs is <= 0, one digit is kept and the point is suppressed. | Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point
and exactly one digit before.
If digs is <= 0, one digit is kept and the point is suppressed. | [
"Format",
"x",
"as",
"[",
"-",
"]",
"d",
".",
"dddE",
"[",
"+",
"-",
"]",
"ddd",
"with",
"digs",
"digits",
"after",
"the",
"point",
"and",
"exactly",
"one",
"digit",
"before",
".",
"If",
"digs",
"is",
"<",
"=",
"0",
"one",
"digit",
"is",
"kept",
... | def sci(x, digs):
"""Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point
and exactly one digit before.
If digs is <= 0, one digit is kept and the point is suppressed."""
if type(x) != type(''): x = repr(x)
sign, intpart, fraction, expo = extract(x)
if not intpart:
while fract... | [
"def",
"sci",
"(",
"x",
",",
"digs",
")",
":",
"if",
"type",
"(",
"x",
")",
"!=",
"type",
"(",
"''",
")",
":",
"x",
"=",
"repr",
"(",
"x",
")",
"sign",
",",
"intpart",
",",
"fraction",
",",
"expo",
"=",
"extract",
"(",
"x",
")",
"if",
"not"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/fpformat.py#L107-L137 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/utils/conv_utils.py | python | conv_output_length | (input_length, filter_size, padding, stride, dilation=1) | return (output_length + stride - 1) // stride | Determines output length of a convolution given input length.
Arguments:
input_length: integer.
filter_size: integer.
padding: one of "same", "valid", "full".
stride: integer.
dilation: dilation rate, integer.
Returns:
The output length (integer). | Determines output length of a convolution given input length. | [
"Determines",
"output",
"length",
"of",
"a",
"convolution",
"given",
"input",
"length",
"."
] | def conv_output_length(input_length, filter_size, padding, stride, dilation=1):
"""Determines output length of a convolution given input length.
Arguments:
input_length: integer.
filter_size: integer.
padding: one of "same", "valid", "full".
stride: integer.
dilation: dilation rate, i... | [
"def",
"conv_output_length",
"(",
"input_length",
",",
"filter_size",
",",
"padding",
",",
"stride",
",",
"dilation",
"=",
"1",
")",
":",
"if",
"input_length",
"is",
"None",
":",
"return",
"None",
"assert",
"padding",
"in",
"{",
"'same'",
",",
"'valid'",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/utils/conv_utils.py#L109-L134 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/cat_helper.py | python | CatHelper.__init__ | (self, command_obj) | Initializes the helper object.
Args:
command_obj: gsutil command instance of calling command. | Initializes the helper object. | [
"Initializes",
"the",
"helper",
"object",
"."
] | def __init__(self, command_obj):
"""Initializes the helper object.
Args:
command_obj: gsutil command instance of calling command.
"""
self.command_obj = command_obj | [
"def",
"__init__",
"(",
"self",
",",
"command_obj",
")",
":",
"self",
".",
"command_obj",
"=",
"command_obj"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/cat_helper.py#L27-L33 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/ValidationKit/common/utils.py | python | timestampMilli | () | return long(time.time() * 1000) | Gets a millisecond timestamp. | Gets a millisecond timestamp. | [
"Gets",
"a",
"millisecond",
"timestamp",
"."
] | def timestampMilli():
"""
Gets a millisecond timestamp.
"""
if g_fWinUseWinPerfCounter is True:
return long(_winFloatTime() * 1000);
return long(time.time() * 1000); | [
"def",
"timestampMilli",
"(",
")",
":",
"if",
"g_fWinUseWinPerfCounter",
"is",
"True",
":",
"return",
"long",
"(",
"_winFloatTime",
"(",
")",
"*",
"1000",
")",
"return",
"long",
"(",
"time",
".",
"time",
"(",
")",
"*",
"1000",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L1279-L1285 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | MockMethod.__eq__ | (self, rhs) | return (isinstance(rhs, MockMethod) and
self._name == rhs._name and
self._params == rhs._params and
self._named_params == rhs._named_params) | Test whether this MockMethod is equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod | Test whether this MockMethod is equivalent to another MockMethod. | [
"Test",
"whether",
"this",
"MockMethod",
"is",
"equivalent",
"to",
"another",
"MockMethod",
"."
] | def __eq__(self, rhs):
"""Test whether this MockMethod is equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod
"""
return (isinstance(rhs, MockMethod) and
self._name == rhs._name and
self._params == rhs._params and
... | [
"def",
"__eq__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"(",
"isinstance",
"(",
"rhs",
",",
"MockMethod",
")",
"and",
"self",
".",
"_name",
"==",
"rhs",
".",
"_name",
"and",
"self",
".",
"_params",
"==",
"rhs",
".",
"_params",
"and",
"self",
... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L622-L633 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | ParserElement.transformString | ( self, instring ) | Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking C{transformString()} on a target string will then sca... | Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking C{transformString()} on a target string will then sca... | [
"Extension",
"to",
"C",
"{",
"L",
"{",
"scanString",
"}}",
"to",
"modify",
"matching",
"text",
"with",
"modified",
"tokens",
"that",
"may",
"be",
"returned",
"from",
"a",
"parse",
"action",
".",
"To",
"use",
"C",
"{",
"transformString",
"}",
"define",
"a... | def transformString( self, instring ):
"""
Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Inv... | [
"def",
"transformString",
"(",
"self",
",",
"instring",
")",
":",
"out",
"=",
"[",
"]",
"lastE",
"=",
"0",
"# force preservation of <TAB>s, to minimize unwanted transformation of string, and to",
"# keep string locs straight between transformString and scanString",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L1729-L1770 | ||
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/style/cpplint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L1639-L1652 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/operator.py | python | PythonOp.forward | (self, in_data, out_data) | Forward interface. Override to create new operators.
Parameters
----------
in_data, out_data: list
input and output for forward. See document for
corresponding arguments of Operator::Forward | Forward interface. Override to create new operators. | [
"Forward",
"interface",
".",
"Override",
"to",
"create",
"new",
"operators",
"."
] | def forward(self, in_data, out_data):
"""Forward interface. Override to create new operators.
Parameters
----------
in_data, out_data: list
input and output for forward. See document for
corresponding arguments of Operator::Forward
"""
out_data[0]... | [
"def",
"forward",
"(",
"self",
",",
"in_data",
",",
"out_data",
")",
":",
"out_data",
"[",
"0",
"]",
"[",
":",
"]",
"=",
"in_data",
"[",
"0",
"]"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/operator.py#L76-L85 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/tensor.py | python | add_column | (alpha, v, beta, M) | return M | Add v to each column of M.
Denote each column of M as m, m = alpha * v + beta * m
Args:
alpha (float): scalar factor
v (Tensor): a tensor
beta (float): scalar factor
M (Tensor): 2d tensor
Returns:
Resulted tensor M | Add v to each column of M. | [
"Add",
"v",
"to",
"each",
"column",
"of",
"M",
"."
] | def add_column(alpha, v, beta, M):
'''Add v to each column of M.
Denote each column of M as m, m = alpha * v + beta * m
Args:
alpha (float): scalar factor
v (Tensor): a tensor
beta (float): scalar factor
M (Tensor): 2d tensor
Returns:
Resulted tensor M
'''
... | [
"def",
"add_column",
"(",
"alpha",
",",
"v",
",",
"beta",
",",
"M",
")",
":",
"singa",
".",
"AddColumnWithScale",
"(",
"float",
"(",
"alpha",
")",
",",
"float",
"(",
"beta",
")",
",",
"v",
".",
"data",
",",
"M",
".",
"data",
")",
"return",
"M"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/tensor.py#L1687-L1702 | |
VowpalWabbit/vowpal_wabbit | 866b8fa88ff85a957c7eb72065ea44518b9ba416 | python/vowpalwabbit/sklearn.py | python | VW.fit | (self, X=None, y=None, sample_weight=None) | return self | Fit the model according to the given training data
TODO:
For first pass create and store example objects. For N-1 passes use example objects
directly (simulate cache file...but in memory for faster processing)
Args:
X : {array-like, sparse matrix}, shape (n_samples,... | Fit the model according to the given training data | [
"Fit",
"the",
"model",
"according",
"to",
"the",
"given",
"training",
"data"
] | def fit(self, X=None, y=None, sample_weight=None):
"""Fit the model according to the given training data
TODO:
For first pass create and store example objects. For N-1 passes use example objects
directly (simulate cache file...but in memory for faster processing)
Args:
... | [
"def",
"fit",
"(",
"self",
",",
"X",
"=",
"None",
",",
"y",
"=",
"None",
",",
"sample_weight",
"=",
"None",
")",
":",
"params",
"=",
"{",
"k",
":",
"v",
"for",
"k",
",",
"v",
"in",
"self",
".",
"get_params",
"(",
")",
".",
"items",
"(",
")",
... | https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/sklearn.py#L304-L364 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TreeCtrl.EditLabel | (*args, **kwargs) | return _controls_.TreeCtrl_EditLabel(*args, **kwargs) | EditLabel(self, TreeItemId item) | EditLabel(self, TreeItemId item) | [
"EditLabel",
"(",
"self",
"TreeItemId",
"item",
")"
] | def EditLabel(*args, **kwargs):
"""EditLabel(self, TreeItemId item)"""
return _controls_.TreeCtrl_EditLabel(*args, **kwargs) | [
"def",
"EditLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_EditLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5527-L5529 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/decl_printer.py | python | dump_declarations | (declarations, file_path) | Dump declarations tree rooted at each of the included nodes to the file
:param declarations: either a single :class:declaration_t object or a list
of :class:declaration_t objects
:param file_path: path to a file | Dump declarations tree rooted at each of the included nodes to the file | [
"Dump",
"declarations",
"tree",
"rooted",
"at",
"each",
"of",
"the",
"included",
"nodes",
"to",
"the",
"file"
] | def dump_declarations(declarations, file_path):
"""
Dump declarations tree rooted at each of the included nodes to the file
:param declarations: either a single :class:declaration_t object or a list
of :class:declaration_t objects
:param file_path: path to a file
"""
with open(file_pa... | [
"def",
"dump_declarations",
"(",
"declarations",
",",
"file_path",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"w+\"",
")",
"as",
"f",
":",
"print_declarations",
"(",
"declarations",
",",
"writer",
"=",
"f",
".",
"write",
")"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/decl_printer.py#L455-L466 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/Queue.py | python | Queue.get | (self, block=True, timeout=None) | Remove and return an item from the queue.
If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until an item is available. If 'timeout' is
a positive number, it blocks at most 'timeout' seconds and raises
the Empty exception if no item was available w... | Remove and return an item from the queue. | [
"Remove",
"and",
"return",
"an",
"item",
"from",
"the",
"queue",
"."
] | def get(self, block=True, timeout=None):
"""Remove and return an item from the queue.
If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until an item is available. If 'timeout' is
a positive number, it blocks at most 'timeout' seconds and raises
... | [
"def",
"get",
"(",
"self",
",",
"block",
"=",
"True",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"not_empty",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"not",
"block",
":",
"if",
"not",
"self",
".",
"_qsize",
"(",
")",
":",
"raise",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/Queue.py#L150-L182 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/nn.py | python | logical_not | (x, out=None, name=None) | return _logical_op(
op_name="logical_not", x=x, y=None, name=name, out=out, binary_op=False) | ``logical_not`` operator computes element-wise logical NOT on ``x``, and returns ``out``. ``out`` is N-dim boolean ``Variable``.
Each element of ``out`` is calculated by
.. math::
out = !x
Args:
x(Tensor): Operand of logical_not operator. Must be a Tensor of type bool, int8, int16, in32,... | [] | def logical_not(x, out=None, name=None):
"""
``logical_not`` operator computes element-wise logical NOT on ``x``, and returns ``out``. ``out`` is N-dim boolean ``Variable``.
Each element of ``out`` is calculated by
.. math::
out = !x
Args:
x(Tensor): Operand of logical_not opera... | [
"def",
"logical_not",
"(",
"x",
",",
"out",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_logical_op",
"(",
"op_name",
"=",
"\"logical_not\"",
",",
"x",
"=",
"x",
",",
"y",
"=",
"None",
",",
"name",
"=",
"name",
",",
"out",
"=",
"o... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L12505-L12534 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/ltisys.py | python | _KNV0 | (B, ker_pole, transfer_matrix, j, poles) | Algorithm "KNV0" Kautsky et Al. Robust pole
assignment in linear state feedback, Int journal of Control
1985, vol 41 p 1129->1155
https://la.epfl.ch/files/content/sites/la/files/
users/105941/public/KautskyNicholsDooren | Algorithm "KNV0" Kautsky et Al. Robust pole
assignment in linear state feedback, Int journal of Control
1985, vol 41 p 1129->1155
https://la.epfl.ch/files/content/sites/la/files/
users/105941/public/KautskyNicholsDooren | [
"Algorithm",
"KNV0",
"Kautsky",
"et",
"Al",
".",
"Robust",
"pole",
"assignment",
"in",
"linear",
"state",
"feedback",
"Int",
"journal",
"of",
"Control",
"1985",
"vol",
"41",
"p",
"1129",
"-",
">",
"1155",
"https",
":",
"//",
"la",
".",
"epfl",
".",
"ch... | def _KNV0(B, ker_pole, transfer_matrix, j, poles):
"""
Algorithm "KNV0" Kautsky et Al. Robust pole
assignment in linear state feedback, Int journal of Control
1985, vol 41 p 1129->1155
https://la.epfl.ch/files/content/sites/la/files/
users/105941/public/KautskyNicholsDooren
"""
# Re... | [
"def",
"_KNV0",
"(",
"B",
",",
"ker_pole",
",",
"transfer_matrix",
",",
"j",
",",
"poles",
")",
":",
"# Remove xj form the base",
"transfer_matrix_not_j",
"=",
"np",
".",
"delete",
"(",
"transfer_matrix",
",",
"j",
",",
"axis",
"=",
"1",
")",
"# If we QR thi... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L2568-L2601 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.SetPositionCacheSize | (*args, **kwargs) | return _stc.StyledTextCtrl_SetPositionCacheSize(*args, **kwargs) | SetPositionCacheSize(self, int size)
Set number of entries in position cache | SetPositionCacheSize(self, int size) | [
"SetPositionCacheSize",
"(",
"self",
"int",
"size",
")"
] | def SetPositionCacheSize(*args, **kwargs):
"""
SetPositionCacheSize(self, int size)
Set number of entries in position cache
"""
return _stc.StyledTextCtrl_SetPositionCacheSize(*args, **kwargs) | [
"def",
"SetPositionCacheSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetPositionCacheSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5727-L5733 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/keystone.py | python | dict_to_args | (specials, items) | return args | Transform
[(key1, val1), (special, val_special), (key3, val3) ]
into:
[ '--key1', 'val1', '--key3', 'val3', 'val_special' ] | Transform
[(key1, val1), (special, val_special), (key3, val3) ]
into:
[ '--key1', 'val1', '--key3', 'val3', 'val_special' ] | [
"Transform",
"[",
"(",
"key1",
"val1",
")",
"(",
"special",
"val_special",
")",
"(",
"key3",
"val3",
")",
"]",
"into",
":",
"[",
"--",
"key1",
"val1",
"--",
"key3",
"val3",
"val_special",
"]"
] | def dict_to_args(specials, items):
"""
Transform
[(key1, val1), (special, val_special), (key3, val3) ]
into:
[ '--key1', 'val1', '--key3', 'val3', 'val_special' ]
"""
args = []
special_vals = OrderedDict((k, '') for k in specials.split(','))
for (k, v) in items:
if k ... | [
"def",
"dict_to_args",
"(",
"specials",
",",
"items",
")",
":",
"args",
"=",
"[",
"]",
"special_vals",
"=",
"OrderedDict",
"(",
"(",
"k",
",",
"''",
")",
"for",
"k",
"in",
"specials",
".",
"split",
"(",
"','",
")",
")",
"for",
"(",
"k",
",",
"v",... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/keystone.py#L288-L304 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/csv.py | python | Sniffer._guess_delimiter | (self, data, delimiters) | return (delim, skipinitialspace) | The delimiter /should/ occur the same number of times on
each row. However, due to malformed data, it may not. We don't want
an all or nothing approach, so we allow for small variations in this
number.
1) build a table of the frequency of each character on every line.
2) buil... | The delimiter /should/ occur the same number of times on
each row. However, due to malformed data, it may not. We don't want
an all or nothing approach, so we allow for small variations in this
number.
1) build a table of the frequency of each character on every line.
2) buil... | [
"The",
"delimiter",
"/",
"should",
"/",
"occur",
"the",
"same",
"number",
"of",
"times",
"on",
"each",
"row",
".",
"However",
"due",
"to",
"malformed",
"data",
"it",
"may",
"not",
".",
"We",
"don",
"t",
"want",
"an",
"all",
"or",
"nothing",
"approach",... | def _guess_delimiter(self, data, delimiters):
"""
The delimiter /should/ occur the same number of times on
each row. However, due to malformed data, it may not. We don't want
an all or nothing approach, so we allow for small variations in this
number.
1) build a table o... | [
"def",
"_guess_delimiter",
"(",
"self",
",",
"data",
",",
"delimiters",
")",
":",
"data",
"=",
"filter",
"(",
"None",
",",
"data",
".",
"split",
"(",
"'\\n'",
")",
")",
"ascii",
"=",
"[",
"chr",
"(",
"c",
")",
"for",
"c",
"in",
"range",
"(",
"127... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/csv.py#L277-L379 | |
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | scripts/cpp_lint.py | python | _FunctionState.Check | (self, error, filename, linenum) | Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check. | Report if too many lines in function body. | [
"Report",
"if",
"too",
"many",
"lines",
"in",
"function",
"body",
"."
] | def Check(self, error, filename, linenum):
"""Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check.
"""
if Match(r'T(EST|est)', self.current_function):
... | [
"def",
"Check",
"(",
"self",
",",
"error",
",",
"filename",
",",
"linenum",
")",
":",
"if",
"Match",
"(",
"r'T(EST|est)'",
",",
"self",
".",
"current_function",
")",
":",
"base_trigger",
"=",
"self",
".",
"_TEST_TRIGGER",
"else",
":",
"base_trigger",
"=",
... | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L840-L863 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | _MaskedBinaryOperation.accumulate | (self, target, axis=0) | return masked_result | Accumulate `target` along `axis` after filling with y fill
value. | Accumulate `target` along `axis` after filling with y fill
value. | [
"Accumulate",
"target",
"along",
"axis",
"after",
"filling",
"with",
"y",
"fill",
"value",
"."
] | def accumulate(self, target, axis=0):
"""Accumulate `target` along `axis` after filling with y fill
value.
"""
tclass = get_masked_subclass(target)
t = filled(target, self.filly)
result = self.f.accumulate(t, axis)
masked_result = result.view(tclass)
retu... | [
"def",
"accumulate",
"(",
"self",
",",
"target",
",",
"axis",
"=",
"0",
")",
":",
"tclass",
"=",
"get_masked_subclass",
"(",
"target",
")",
"t",
"=",
"filled",
"(",
"target",
",",
"self",
".",
"filly",
")",
"result",
"=",
"self",
".",
"f",
".",
"ac... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L1118-L1127 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py | python | _path_isfile | (path) | return _path_is_mode_type(path, 0o100000) | Replacement for os.path.isfile. | Replacement for os.path.isfile. | [
"Replacement",
"for",
"os",
".",
"path",
".",
"isfile",
"."
] | def _path_isfile(path):
"""Replacement for os.path.isfile."""
return _path_is_mode_type(path, 0o100000) | [
"def",
"_path_isfile",
"(",
"path",
")",
":",
"return",
"_path_is_mode_type",
"(",
"path",
",",
"0o100000",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py#L93-L95 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/environment.py | python | Environment.call_test | (self, name, value, args=None, kwargs=None) | return func(value, *(args or ()), **(kwargs or {})) | Invokes a test on a value the same way the compiler does it.
.. versionadded:: 2.7 | Invokes a test on a value the same way the compiler does it. | [
"Invokes",
"a",
"test",
"on",
"a",
"value",
"the",
"same",
"way",
"the",
"compiler",
"does",
"it",
"."
] | def call_test(self, name, value, args=None, kwargs=None):
"""Invokes a test on a value the same way the compiler does it.
.. versionadded:: 2.7
"""
func = self.tests.get(name)
if func is None:
fail_for_missing_callable('no test named %r', name)
return func(va... | [
"def",
"call_test",
"(",
"self",
",",
"name",
",",
"value",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"func",
"=",
"self",
".",
"tests",
".",
"get",
"(",
"name",
")",
"if",
"func",
"is",
"None",
":",
"fail_for_missing_callable",... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/environment.py#L469-L477 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py | python | grok_environment_error | (exc, prefix="error: ") | return error | Generate a useful error message from an EnvironmentError (IOError or
OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and
does what it can to deal with exception objects that don't have a
filename (which happens when the error is due to a two-file operation,
such as 'rename()' or 'link... | Generate a useful error message from an EnvironmentError (IOError or
OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and
does what it can to deal with exception objects that don't have a
filename (which happens when the error is due to a two-file operation,
such as 'rename()' or 'link... | [
"Generate",
"a",
"useful",
"error",
"message",
"from",
"an",
"EnvironmentError",
"(",
"IOError",
"or",
"OSError",
")",
"exception",
"object",
".",
"Handles",
"Python",
"1",
".",
"5",
".",
"1",
"and",
"1",
".",
"5",
".",
"2",
"styles",
"and",
"does",
"w... | def grok_environment_error (exc, prefix="error: "):
"""Generate a useful error message from an EnvironmentError (IOError or
OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and
does what it can to deal with exception objects that don't have a
filename (which happens when the error is d... | [
"def",
"grok_environment_error",
"(",
"exc",
",",
"prefix",
"=",
"\"error: \"",
")",
":",
"# check for Python 1.5.2-style {IO,OS}Error exception objects",
"if",
"hasattr",
"(",
"exc",
",",
"'filename'",
")",
"and",
"hasattr",
"(",
"exc",
",",
"'strerror'",
")",
":",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py#L215-L234 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distribution/distribution.py | python | Distribution.event_shape | (self) | return self._event_shape | Returns event shape of distribution
Returns:
Sequence[int]: event shape | Returns event shape of distribution | [
"Returns",
"event",
"shape",
"of",
"distribution"
] | def event_shape(self):
"""Returns event shape of distribution
Returns:
Sequence[int]: event shape
"""
return self._event_shape | [
"def",
"event_shape",
"(",
"self",
")",
":",
"return",
"self",
".",
"_event_shape"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distribution/distribution.py#L73-L79 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/linalg/linear_operator_addition.py | python | _Adder.can_add | (self, op1, op2) | Returns `True` if this `Adder` can add `op1` and `op2`. Else `False`. | Returns `True` if this `Adder` can add `op1` and `op2`. Else `False`. | [
"Returns",
"True",
"if",
"this",
"Adder",
"can",
"add",
"op1",
"and",
"op2",
".",
"Else",
"False",
"."
] | def can_add(self, op1, op2):
"""Returns `True` if this `Adder` can add `op1` and `op2`. Else `False`."""
pass | [
"def",
"can_add",
"(",
"self",
",",
"op1",
",",
"op2",
")",
":",
"pass"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linear_operator_addition.py#L249-L251 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/profile_context.py | python | _profiled_run | (self,
fetches,
feed_dict=None,
options=None,
run_metadata=None) | return self._profiler_run_internal(
fetches, feed_dict, options, run_metadata) | Overwrites the session.run(). | Overwrites the session.run(). | [
"Overwrites",
"the",
"session",
".",
"run",
"()",
"."
] | def _profiled_run(self,
fetches,
feed_dict=None,
options=None,
run_metadata=None):
"""Overwrites the session.run()."""
# pylint: disable=protected-access
# Count the session steps.
with self.profile_context._new_step() as state:
step, l... | [
"def",
"_profiled_run",
"(",
"self",
",",
"fetches",
",",
"feed_dict",
"=",
"None",
",",
"options",
"=",
"None",
",",
"run_metadata",
"=",
"None",
")",
":",
"# pylint: disable=protected-access",
"# Count the session steps.",
"with",
"self",
".",
"profile_context",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/profile_context.py#L45-L109 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | Geometry3D.saveFile | (self, fn) | return _robotsim.Geometry3D_saveFile(self, fn) | saveFile(Geometry3D self, char const * fn) -> bool
Saves to file. Standard mesh types, PCD files, and .geom files are supported. | saveFile(Geometry3D self, char const * fn) -> bool | [
"saveFile",
"(",
"Geometry3D",
"self",
"char",
"const",
"*",
"fn",
")",
"-",
">",
"bool"
] | def saveFile(self, fn):
"""
saveFile(Geometry3D self, char const * fn) -> bool
Saves to file. Standard mesh types, PCD files, and .geom files are supported.
"""
return _robotsim.Geometry3D_saveFile(self, fn) | [
"def",
"saveFile",
"(",
"self",
",",
"fn",
")",
":",
"return",
"_robotsim",
".",
"Geometry3D_saveFile",
"(",
"self",
",",
"fn",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L2134-L2143 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/encodings/__init__.py | python | normalize_encoding | (encoding) | return '_'.join(encoding.translate(_norm_encoding_map).split()) | Normalize an encoding name.
Normalization works as follows: all non-alphanumeric
characters except the dot used for Python package names are
collapsed and replaced with a single underscore, e.g. ' -;#'
becomes '_'. Leading and trailing underscores are removed.
Note that encodi... | Normalize an encoding name. | [
"Normalize",
"an",
"encoding",
"name",
"."
] | def normalize_encoding(encoding):
""" Normalize an encoding name.
Normalization works as follows: all non-alphanumeric
characters except the dot used for Python package names are
collapsed and replaced with a single underscore, e.g. ' -;#'
becomes '_'. Leading and trailing undersc... | [
"def",
"normalize_encoding",
"(",
"encoding",
")",
":",
"# Make sure we have an 8-bit string, because .translate() works",
"# differently for Unicode strings.",
"if",
"hasattr",
"(",
"__builtin__",
",",
"\"unicode\"",
")",
"and",
"isinstance",
"(",
"encoding",
",",
"unicode",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/encodings/__init__.py#L49-L69 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TextAttr.Apply | (*args, **kwargs) | return _controls_.TextAttr_Apply(*args, **kwargs) | Apply(self, TextAttr style, TextAttr compareWith=None) -> bool | Apply(self, TextAttr style, TextAttr compareWith=None) -> bool | [
"Apply",
"(",
"self",
"TextAttr",
"style",
"TextAttr",
"compareWith",
"=",
"None",
")",
"-",
">",
"bool"
] | def Apply(*args, **kwargs):
"""Apply(self, TextAttr style, TextAttr compareWith=None) -> bool"""
return _controls_.TextAttr_Apply(*args, **kwargs) | [
"def",
"Apply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_Apply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1912-L1914 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/reinforcement-learning/a3c/launcher.py | python | exec_cmd | (cmd, role, taskid, pass_env) | Execute the command line command. | Execute the command line command. | [
"Execute",
"the",
"command",
"line",
"command",
"."
] | def exec_cmd(cmd, role, taskid, pass_env):
"""Execute the command line command."""
if cmd[0].find('/') == -1 and os.path.exists(cmd[0]) and os.name != 'nt':
cmd[0] = './' + cmd[0]
cmd = ' '.join(cmd)
env = os.environ.copy()
for k, v in pass_env.items():
env[k] = str(v)
env['DMLC... | [
"def",
"exec_cmd",
"(",
"cmd",
",",
"role",
",",
"taskid",
",",
"pass_env",
")",
":",
"if",
"cmd",
"[",
"0",
"]",
".",
"find",
"(",
"'/'",
")",
"==",
"-",
"1",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"cmd",
"[",
"0",
"]",
")",
"and",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/reinforcement-learning/a3c/launcher.py#L46-L77 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | third_party/gpus/find_cuda_config.py | python | _find_library | (base_paths, library_name, required_version) | return _find_file(base_paths, _library_paths(), filepattern) | Returns first valid path to the requested library. | Returns first valid path to the requested library. | [
"Returns",
"first",
"valid",
"path",
"to",
"the",
"requested",
"library",
"."
] | def _find_library(base_paths, library_name, required_version):
"""Returns first valid path to the requested library."""
if _is_windows():
filepattern = library_name + ".lib"
elif _is_macos():
filepattern = "%s*.dylib" % (".".join(["lib" + library_name] +
required_... | [
"def",
"_find_library",
"(",
"base_paths",
",",
"library_name",
",",
"required_version",
")",
":",
"if",
"_is_windows",
"(",
")",
":",
"filepattern",
"=",
"library_name",
"+",
"\".lib\"",
"elif",
"_is_macos",
"(",
")",
":",
"filepattern",
"=",
"\"%s*.dylib\"",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/third_party/gpus/find_cuda_config.py#L212-L222 | |
wheybags/freeablo | 921ac20be95828460ccc184a9de11eca5c7c0519 | extern/SDL_image/external/libwebp-0.3.0/swig/libwebp.py | python | WebPDecodeRGBA | (*args) | return _libwebp.WebPDecodeRGBA(*args) | WebPDecodeRGBA(uint8_t data) -> (rgb, width, height) | WebPDecodeRGBA(uint8_t data) -> (rgb, width, height) | [
"WebPDecodeRGBA",
"(",
"uint8_t",
"data",
")",
"-",
">",
"(",
"rgb",
"width",
"height",
")"
] | def WebPDecodeRGBA(*args):
"""WebPDecodeRGBA(uint8_t data) -> (rgb, width, height)"""
return _libwebp.WebPDecodeRGBA(*args) | [
"def",
"WebPDecodeRGBA",
"(",
"*",
"args",
")",
":",
"return",
"_libwebp",
".",
"WebPDecodeRGBA",
"(",
"*",
"args",
")"
] | https://github.com/wheybags/freeablo/blob/921ac20be95828460ccc184a9de11eca5c7c0519/extern/SDL_image/external/libwebp-0.3.0/swig/libwebp.py#L83-L85 | |
jsupancic/deep_hand_pose | 22cbeae1a8410ff5d37c060c7315719d0a5d608f | python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/jsupancic/deep_hand_pose/blob/22cbeae1a8410ff5d37c060c7315719d0a5d608f/python/caffe/io.py#L232-L256 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimum-operations-to-make-a-subsequence.py | python | Solution.minOperations | (self, target, arr) | return len(target)-len(lis) | :type target: List[int]
:type arr: List[int]
:rtype: int | :type target: List[int]
:type arr: List[int]
:rtype: int | [
":",
"type",
"target",
":",
"List",
"[",
"int",
"]",
":",
"type",
"arr",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"int"
] | def minOperations(self, target, arr):
"""
:type target: List[int]
:type arr: List[int]
:rtype: int
"""
lookup = {x:i for i, x in enumerate(target)}
lis = []
for x in arr:
if x not in lookup:
continue
i = bisect.bisec... | [
"def",
"minOperations",
"(",
"self",
",",
"target",
",",
"arr",
")",
":",
"lookup",
"=",
"{",
"x",
":",
"i",
"for",
"i",
",",
"x",
"in",
"enumerate",
"(",
"target",
")",
"}",
"lis",
"=",
"[",
"]",
"for",
"x",
"in",
"arr",
":",
"if",
"x",
"not... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-operations-to-make-a-subsequence.py#L8-L24 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/panel.py | python | panel_index | (time, panels, names=None) | return MultiIndex.from_arrays([time, panels], sortorder=None, names=names) | Returns a multi-index suitable for a panel-like DataFrame.
Parameters
----------
time : array-like
Time index, does not have to repeat
panels : array-like
Panel index, does not have to repeat
names : list, optional
List containing the names of the indices
Returns
--... | Returns a multi-index suitable for a panel-like DataFrame. | [
"Returns",
"a",
"multi",
"-",
"index",
"suitable",
"for",
"a",
"panel",
"-",
"like",
"DataFrame",
"."
] | def panel_index(time, panels, names=None):
"""
Returns a multi-index suitable for a panel-like DataFrame.
Parameters
----------
time : array-like
Time index, does not have to repeat
panels : array-like
Panel index, does not have to repeat
names : list, optional
List ... | [
"def",
"panel_index",
"(",
"time",
",",
"panels",
",",
"names",
"=",
"None",
")",
":",
"if",
"names",
"is",
"None",
":",
"names",
"=",
"[",
"'time'",
",",
"'panel'",
"]",
"time",
",",
"panels",
"=",
"_ensure_like_indices",
"(",
"time",
",",
"panels",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/panel.py#L64-L105 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/SANSUtility.py | python | convert_to_string_list | (to_convert) | return output_string | Convert a comma-separted string to a Python string list in a string form
"file1.xml, file2.xml" -> "['file1.xml','file2.xml']"
:param to_convert :: a comma-spearated string | Convert a comma-separted string to a Python string list in a string form
"file1.xml, file2.xml" -> "['file1.xml','file2.xml']"
:param to_convert :: a comma-spearated string | [
"Convert",
"a",
"comma",
"-",
"separted",
"string",
"to",
"a",
"Python",
"string",
"list",
"in",
"a",
"string",
"form",
"file1",
".",
"xml",
"file2",
".",
"xml",
"-",
">",
"[",
"file1",
".",
"xml",
"file2",
".",
"xml",
"]",
":",
"param",
"to_convert"... | def convert_to_string_list(to_convert):
"""
Convert a comma-separted string to a Python string list in a string form
"file1.xml, file2.xml" -> "['file1.xml','file2.xml']"
:param to_convert :: a comma-spearated string
"""
string_list = to_convert.replace(" ", "").split(",")
output_string = "[... | [
"def",
"convert_to_string_list",
"(",
"to_convert",
")",
":",
"string_list",
"=",
"to_convert",
".",
"replace",
"(",
"\" \"",
",",
"\"\"",
")",
".",
"split",
"(",
"\",\"",
")",
"output_string",
"=",
"\"[\"",
"+",
"','",
".",
"join",
"(",
"\"'\"",
"+",
"e... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L1578-L1586 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/utils.py | python | LRUCache.values | (self) | return [x[1] for x in self.items()] | Return a list of all values. | Return a list of all values. | [
"Return",
"a",
"list",
"of",
"all",
"values",
"."
] | def values(self):
"""Return a list of all values."""
return [x[1] for x in self.items()] | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"[",
"x",
"[",
"1",
"]",
"for",
"x",
"in",
"self",
".",
"items",
"(",
")",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/utils.py#L487-L489 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/utils_v1/export_utils.py | python | _maybe_add_default_serving_output | (export_outputs) | return export_outputs | Add a default serving output to the export_outputs if not present.
Args:
export_outputs: Describes the output signatures to be exported to
`SavedModel` and used during serving. Should be a dict.
Returns:
export_outputs dict with default serving signature added if necessary
Raises:
ValueError:... | Add a default serving output to the export_outputs if not present. | [
"Add",
"a",
"default",
"serving",
"output",
"to",
"the",
"export_outputs",
"if",
"not",
"present",
"."
] | def _maybe_add_default_serving_output(export_outputs):
"""Add a default serving output to the export_outputs if not present.
Args:
export_outputs: Describes the output signatures to be exported to
`SavedModel` and used during serving. Should be a dict.
Returns:
export_outputs dict with default ser... | [
"def",
"_maybe_add_default_serving_output",
"(",
"export_outputs",
")",
":",
"if",
"len",
"(",
"export_outputs",
")",
"==",
"1",
":",
"(",
"key",
",",
"value",
")",
",",
"=",
"export_outputs",
".",
"items",
"(",
")",
"if",
"key",
"!=",
"signature_constants",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/utils_v1/export_utils.py#L330-L357 | |
yushroom/FishEngine | a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9 | Script/reflect/clang/cindex.py | python | Cursor.get_field_offsetof | (self) | return conf.lib.clang_Cursor_getOffsetOfField(self) | Returns the offsetof the FIELD_DECL pointed by this Cursor. | Returns the offsetof the FIELD_DECL pointed by this Cursor. | [
"Returns",
"the",
"offsetof",
"the",
"FIELD_DECL",
"pointed",
"by",
"this",
"Cursor",
"."
] | def get_field_offsetof(self):
"""Returns the offsetof the FIELD_DECL pointed by this Cursor."""
return conf.lib.clang_Cursor_getOffsetOfField(self) | [
"def",
"get_field_offsetof",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Cursor_getOffsetOfField",
"(",
"self",
")"
] | https://github.com/yushroom/FishEngine/blob/a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9/Script/reflect/clang/cindex.py#L1710-L1712 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/ndimage/morphology.py | python | morphological_gradient | (input, size=None, footprint=None, structure=None,
output=None, mode="reflect", cval=0.0, origin=0) | Multi-dimensional morphological gradient.
The morphological gradient is calculated as the difference between a
dilation and an erosion of the input with a given structuring element.
Parameters
----------
input : array_like
Array over which to compute the morphlogical gradient.
size : t... | Multi-dimensional morphological gradient. | [
"Multi",
"-",
"dimensional",
"morphological",
"gradient",
"."
] | def morphological_gradient(input, size=None, footprint=None, structure=None,
output=None, mode="reflect", cval=0.0, origin=0):
"""
Multi-dimensional morphological gradient.
The morphological gradient is calculated as the difference between a
dilation and an erosion of the inp... | [
"def",
"morphological_gradient",
"(",
"input",
",",
"size",
"=",
"None",
",",
"footprint",
"=",
"None",
",",
"structure",
"=",
"None",
",",
"output",
"=",
"None",
",",
"mode",
"=",
"\"reflect\"",
",",
"cval",
"=",
"0.0",
",",
"origin",
"=",
"0",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/morphology.py#L1527-L1637 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xpathParserContext.xpathMultValues | (self) | Implement the multiply operation on XPath objects: The
numeric operators convert their operands to numbers as if
by calling the number function. | Implement the multiply operation on XPath objects: The
numeric operators convert their operands to numbers as if
by calling the number function. | [
"Implement",
"the",
"multiply",
"operation",
"on",
"XPath",
"objects",
":",
"The",
"numeric",
"operators",
"convert",
"their",
"operands",
"to",
"numbers",
"as",
"if",
"by",
"calling",
"the",
"number",
"function",
"."
] | def xpathMultValues(self):
"""Implement the multiply operation on XPath objects: The
numeric operators convert their operands to numbers as if
by calling the number function. """
libxml2mod.xmlXPathMultValues(self._o) | [
"def",
"xpathMultValues",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlXPathMultValues",
"(",
"self",
".",
"_o",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7581-L7585 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.postprocess | (self) | Clean up anything we don't need to hang onto after we've
been built. | Clean up anything we don't need to hang onto after we've
been built. | [
"Clean",
"up",
"anything",
"we",
"don",
"t",
"need",
"to",
"hang",
"onto",
"after",
"we",
"ve",
"been",
"built",
"."
] | def postprocess(self):
"""Clean up anything we don't need to hang onto after we've
been built."""
self.executor_cleanup()
self.waiting_parents = set() | [
"def",
"postprocess",
"(",
"self",
")",
":",
"self",
".",
"executor_cleanup",
"(",
")",
"self",
".",
"waiting_parents",
"=",
"set",
"(",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L814-L818 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/experiment.py | python | Experiment.train_and_evaluate | (self) | return eval_result, export_results | Interleaves training and evaluation.
The frequency of evaluation is controlled by the constructor arg
`min_eval_frequency`. When this parameter is 0, evaluation happens
only after training has completed. Note that evaluation cannot happen
more frequently than checkpoints are taken. If no new snapshots ... | Interleaves training and evaluation. | [
"Interleaves",
"training",
"and",
"evaluation",
"."
] | def train_and_evaluate(self):
"""Interleaves training and evaluation.
The frequency of evaluation is controlled by the constructor arg
`min_eval_frequency`. When this parameter is 0, evaluation happens
only after training has completed. Note that evaluation cannot happen
more frequently than checkp... | [
"def",
"train_and_evaluate",
"(",
"self",
")",
":",
"# The directory to which evaluation summaries are written are determined",
"# by adding a suffix to 'eval'; that suffix is the 'name' parameter to",
"# the various evaluate(...) methods. By setting it to None, we force",
"# the directory name to... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/experiment.py#L462-L510 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Band.GetVirtualMemArray | (self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0,
xsize=None, ysize=None, bufxsize=None, bufysize=None,
datatype=None,
cache_size = 10 * 1024 * 1024, page_size_hint = 0,
options=None) | return gdal_array.VirtualMemGetArray(virtualmem) | Return a NumPy array for the band, seen as a virtual memory mapping.
An element is accessed with array[y][x].
Any reference to the array must be dropped before the last reference to the
related dataset is also dropped. | Return a NumPy array for the band, seen as a virtual memory mapping.
An element is accessed with array[y][x].
Any reference to the array must be dropped before the last reference to the
related dataset is also dropped. | [
"Return",
"a",
"NumPy",
"array",
"for",
"the",
"band",
"seen",
"as",
"a",
"virtual",
"memory",
"mapping",
".",
"An",
"element",
"is",
"accessed",
"with",
"array",
"[",
"y",
"]",
"[",
"x",
"]",
".",
"Any",
"reference",
"to",
"the",
"array",
"must",
"b... | def GetVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0,
xsize=None, ysize=None, bufxsize=None, bufysize=None,
datatype=None,
cache_size = 10 * 1024 * 1024, page_size_hint = 0,
options=None):
... | [
"def",
"GetVirtualMemArray",
"(",
"self",
",",
"eAccess",
"=",
"gdalconst",
".",
"GF_Read",
",",
"xoff",
"=",
"0",
",",
"yoff",
"=",
"0",
",",
"xsize",
"=",
"None",
",",
"ysize",
"=",
"None",
",",
"bufxsize",
"=",
"None",
",",
"bufysize",
"=",
"None"... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3690-L3715 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/which/which.py | python | which | (command, path=None, verbose=0, exts=None) | return match | Return the full path to the first match of the given command on
the path.
"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
to use the PATH environment variable.
"verbose", if true, will cause a 2-tuple to be returne... | Return the full path to the first match of the given command on
the path.
"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
to use the PATH environment variable.
"verbose", if true, will cause a 2-tuple to be returne... | [
"Return",
"the",
"full",
"path",
"to",
"the",
"first",
"match",
"of",
"the",
"given",
"command",
"on",
"the",
"path",
".",
"command",
"is",
"a",
"the",
"name",
"of",
"the",
"executable",
"to",
"search",
"for",
".",
"path",
"is",
"an",
"optional",
"alte... | def which(command, path=None, verbose=0, exts=None):
"""Return the full path to the first match of the given command on
the path.
"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
to use the PATH environment variable... | [
"def",
"which",
"(",
"command",
",",
"path",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"exts",
"=",
"None",
")",
":",
"try",
":",
"match",
"=",
"whichgen",
"(",
"command",
",",
"path",
",",
"verbose",
",",
"exts",
")",
".",
"next",
"(",
")",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/which/which.py#L227-L249 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextHTMLHandler.SetFontSizeMapping | (*args, **kwargs) | return _richtext.RichTextHTMLHandler_SetFontSizeMapping(*args, **kwargs) | SetFontSizeMapping(self, wxArrayInt fontSizeMapping)
Set mapping from point size to HTML font size. There should be 7 elements, one
for each HTML font size, each element specifying the maximum point size for
that HTML font size. E.g. 8, 10, 13, 17, 22, 29, 100 | SetFontSizeMapping(self, wxArrayInt fontSizeMapping) | [
"SetFontSizeMapping",
"(",
"self",
"wxArrayInt",
"fontSizeMapping",
")"
] | def SetFontSizeMapping(*args, **kwargs):
"""
SetFontSizeMapping(self, wxArrayInt fontSizeMapping)
Set mapping from point size to HTML font size. There should be 7 elements, one
for each HTML font size, each element specifying the maximum point size for
that HTML font size. E.g. ... | [
"def",
"SetFontSizeMapping",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextHTMLHandler_SetFontSizeMapping",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4393-L4402 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py | python | NDFrame.keys | (self) | return self._info_axis | Get the 'info axis' (see Indexing for more).
This is index for Series, columns for DataFrame.
Returns
-------
Index
Info axis. | Get the 'info axis' (see Indexing for more). | [
"Get",
"the",
"info",
"axis",
"(",
"see",
"Indexing",
"for",
"more",
")",
"."
] | def keys(self):
"""
Get the 'info axis' (see Indexing for more).
This is index for Series, columns for DataFrame.
Returns
-------
Index
Info axis.
"""
return self._info_axis | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"self",
".",
"_info_axis"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L1815-L1826 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/filesystem.py | python | FSStatus.get_filesystems | (self) | Iterator for all filesystems. | Iterator for all filesystems. | [
"Iterator",
"for",
"all",
"filesystems",
"."
] | def get_filesystems(self):
"""
Iterator for all filesystems.
"""
for fs in self.map['filesystems']:
yield fs | [
"def",
"get_filesystems",
"(",
"self",
")",
":",
"for",
"fs",
"in",
"self",
".",
"map",
"[",
"'filesystems'",
"]",
":",
"yield",
"fs"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/filesystem.py#L90-L95 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/bisect_utils.py | python | RunGClientAndSync | (cwd=None) | return RunGClient(params, cwd=cwd) | Runs gclient and does a normal sync.
Args:
cwd: Working directory to run from.
Returns:
The return code of the call. | Runs gclient and does a normal sync. | [
"Runs",
"gclient",
"and",
"does",
"a",
"normal",
"sync",
"."
] | def RunGClientAndSync(cwd=None):
"""Runs gclient and does a normal sync.
Args:
cwd: Working directory to run from.
Returns:
The return code of the call.
"""
params = ['sync', '--verbose', '--nohooks', '--reset', '--force']
return RunGClient(params, cwd=cwd) | [
"def",
"RunGClientAndSync",
"(",
"cwd",
"=",
"None",
")",
":",
"params",
"=",
"[",
"'sync'",
",",
"'--verbose'",
",",
"'--nohooks'",
",",
"'--reset'",
",",
"'--force'",
"]",
"return",
"RunGClient",
"(",
"params",
",",
"cwd",
"=",
"cwd",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L320-L330 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/cross_device_utils.py | python | split_by_sparsity | (values) | return dense_values, dense_indices, sparse_values, sparse_indices | Split values into dense and sparse values.
Args:
values: a list of tensors or `PerReplica`s.
Returns:
Four lists:
a list of dense values, a list of their indices in `values` and
a list of sparse values, a list of their indices in `values`. | Split values into dense and sparse values. | [
"Split",
"values",
"into",
"dense",
"and",
"sparse",
"values",
"."
] | def split_by_sparsity(values):
"""Split values into dense and sparse values.
Args:
values: a list of tensors or `PerReplica`s.
Returns:
Four lists:
a list of dense values, a list of their indices in `values` and
a list of sparse values, a list of their indices in `values`.
"""
dense_valu... | [
"def",
"split_by_sparsity",
"(",
"values",
")",
":",
"dense_values",
"=",
"[",
"]",
"dense_indices",
"=",
"[",
"]",
"sparse_values",
"=",
"[",
"]",
"sparse_indices",
"=",
"[",
"]",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"values",
")",
":",
"if",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/cross_device_utils.py#L618-L640 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/BASIC/basiclex.py | python | t_NEWLINE | (t) | return t | r'\n | r'\n | [
"r",
"\\",
"n"
] | def t_NEWLINE(t):
r'\n'
t.lexer.lineno += 1
return t | [
"def",
"t_NEWLINE",
"(",
"t",
")",
":",
"t",
".",
"lexer",
".",
"lineno",
"+=",
"1",
"return",
"t"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basiclex.py#L48-L51 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/auth.py | python | SigV4Auth.string_to_sign | (self, request, canonical_request) | return '\n'.join(sts) | Return the canonical StringToSign as well as a dict
containing the original version of all headers that
were included in the StringToSign. | Return the canonical StringToSign as well as a dict
containing the original version of all headers that
were included in the StringToSign. | [
"Return",
"the",
"canonical",
"StringToSign",
"as",
"well",
"as",
"a",
"dict",
"containing",
"the",
"original",
"version",
"of",
"all",
"headers",
"that",
"were",
"included",
"in",
"the",
"StringToSign",
"."
] | def string_to_sign(self, request, canonical_request):
"""
Return the canonical StringToSign as well as a dict
containing the original version of all headers that
were included in the StringToSign.
"""
sts = ['AWS4-HMAC-SHA256']
sts.append(request.context['timestam... | [
"def",
"string_to_sign",
"(",
"self",
",",
"request",
",",
"canonical_request",
")",
":",
"sts",
"=",
"[",
"'AWS4-HMAC-SHA256'",
"]",
"sts",
".",
"append",
"(",
"request",
".",
"context",
"[",
"'timestamp'",
"]",
")",
"sts",
".",
"append",
"(",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/auth.py#L329-L339 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/tools/stats-viewer.py | python | UiCounter.__init__ | (self, var, format) | Creates a new ui counter.
Args:
var: the Tkinter string variable for updating the ui
format: the format string used to format this counter | Creates a new ui counter. | [
"Creates",
"a",
"new",
"ui",
"counter",
"."
] | def __init__(self, var, format):
"""Creates a new ui counter.
Args:
var: the Tkinter string variable for updating the ui
format: the format string used to format this counter
"""
self.var = var
self.format = format
self.last_value = None | [
"def",
"__init__",
"(",
"self",
",",
"var",
",",
"format",
")",
":",
"self",
".",
"var",
"=",
"var",
"self",
".",
"format",
"=",
"format",
"self",
".",
"last_value",
"=",
"None"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/stats-viewer.py#L271-L280 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | HDFStore.create_table_index | (
self,
key: str,
columns=None,
optlevel: Optional[int] = None,
kind: Optional[str] = None,
) | Create a pytables index on the table.
Parameters
----------
key : str
columns : None, bool, or listlike[str]
Indicate which columns to create an index on.
* False : Do not create any indexes.
* True : Create indexes on all columns.
* None... | Create a pytables index on the table. | [
"Create",
"a",
"pytables",
"index",
"on",
"the",
"table",
"."
] | def create_table_index(
self,
key: str,
columns=None,
optlevel: Optional[int] = None,
kind: Optional[str] = None,
):
"""
Create a pytables index on the table.
Parameters
----------
key : str
columns : None, bool, or listlike[st... | [
"def",
"create_table_index",
"(",
"self",
",",
"key",
":",
"str",
",",
"columns",
"=",
"None",
",",
"optlevel",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"kind",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
":",
"# version requi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L1276-L1315 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/wizard.py | python | WizardEvent.__init__ | (self, *args, **kwargs) | __init__(self, EventType type=wxEVT_NULL, int id=-1, bool direction=True,
WizardPage page=None) -> WizardEvent | __init__(self, EventType type=wxEVT_NULL, int id=-1, bool direction=True,
WizardPage page=None) -> WizardEvent | [
"__init__",
"(",
"self",
"EventType",
"type",
"=",
"wxEVT_NULL",
"int",
"id",
"=",
"-",
"1",
"bool",
"direction",
"=",
"True",
"WizardPage",
"page",
"=",
"None",
")",
"-",
">",
"WizardEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, EventType type=wxEVT_NULL, int id=-1, bool direction=True,
WizardPage page=None) -> WizardEvent
"""
_wizard.WizardEvent_swiginit(self,_wizard.new_WizardEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_wizard",
".",
"WizardEvent_swiginit",
"(",
"self",
",",
"_wizard",
".",
"new_WizardEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/wizard.py#L90-L95 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/OpenSCAD/importCSG.py | python | p_boolean | (p) | boolean : true
| false | boolean : true
| false | [
"boolean",
":",
"true",
"|",
"false"
] | def p_boolean(p):
'''
boolean : true
| false
'''
p[0] = p[1] | [
"def",
"p_boolean",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/OpenSCAD/importCSG.py#L242-L247 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/recursivemake.py | python | RecursiveMakeTraversal.default_filter | (current, subdirs) | return current, [], subdirs.dirs + subdirs.tests | Default filter for use with compute_dependencies and traverse. | Default filter for use with compute_dependencies and traverse. | [
"Default",
"filter",
"for",
"use",
"with",
"compute_dependencies",
"and",
"traverse",
"."
] | def default_filter(current, subdirs):
"""
Default filter for use with compute_dependencies and traverse.
"""
return current, [], subdirs.dirs + subdirs.tests | [
"def",
"default_filter",
"(",
"current",
",",
"subdirs",
")",
":",
"return",
"current",
",",
"[",
"]",
",",
"subdirs",
".",
"dirs",
"+",
"subdirs",
".",
"tests"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/recursivemake.py#L175-L179 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.SetColPos | (*args, **kwargs) | return _grid.Grid_SetColPos(*args, **kwargs) | SetColPos(self, int colID, int newPos) | SetColPos(self, int colID, int newPos) | [
"SetColPos",
"(",
"self",
"int",
"colID",
"int",
"newPos",
")"
] | def SetColPos(*args, **kwargs):
"""SetColPos(self, int colID, int newPos)"""
return _grid.Grid_SetColPos(*args, **kwargs) | [
"def",
"SetColPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SetColPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1870-L1872 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py | python | Globe.Polygon | (self) | Tries to get globe polygon from glb file.
Returns:
The polygon for the globe.
If no polygon is found in the globe,
it returns "No polygon." | Tries to get globe polygon from glb file. | [
"Tries",
"to",
"get",
"globe",
"polygon",
"from",
"glb",
"file",
"."
] | def Polygon(self):
"""Tries to get globe polygon from glb file.
Returns:
The polygon for the globe.
If no polygon is found in the globe,
it returns "No polygon."
"""
try:
return self.ReadFile("earth/polygon.kml")
# Don't fail if old globe with no polygon file.
except po... | [
"def",
"Polygon",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"ReadFile",
"(",
"\"earth/polygon.kml\"",
")",
"# Don't fail if old globe with no polygon file.",
"except",
"portable_exceptions",
".",
"UnableToFindException",
":",
"return",
"\"No polygon.\""
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py#L577-L590 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/webkit.py | python | WebKitCtrl.MakeEditable | (*args, **kwargs) | return _webkit.WebKitCtrl_MakeEditable(*args, **kwargs) | MakeEditable(self, bool enable=True) | MakeEditable(self, bool enable=True) | [
"MakeEditable",
"(",
"self",
"bool",
"enable",
"=",
"True",
")"
] | def MakeEditable(*args, **kwargs):
"""MakeEditable(self, bool enable=True)"""
return _webkit.WebKitCtrl_MakeEditable(*args, **kwargs) | [
"def",
"MakeEditable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_webkit",
".",
"WebKitCtrl_MakeEditable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/webkit.py#L156-L158 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.CharLeftExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_CharLeftExtend(*args, **kwargs) | CharLeftExtend(self)
Move caret left one character extending selection to new caret position. | CharLeftExtend(self) | [
"CharLeftExtend",
"(",
"self",
")"
] | def CharLeftExtend(*args, **kwargs):
"""
CharLeftExtend(self)
Move caret left one character extending selection to new caret position.
"""
return _stc.StyledTextCtrl_CharLeftExtend(*args, **kwargs) | [
"def",
"CharLeftExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_CharLeftExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4368-L4374 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlNode.prop | (self, name) | return ret | Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off.
NOTE: this function acts independently of namespaces
... | Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off.
NOTE: this function acts independently of namespaces
... | [
"Search",
"and",
"get",
"the",
"value",
"of",
"an",
"attribute",
"associated",
"to",
"a",
"node",
"This",
"does",
"the",
"entity",
"substitution",
".",
"This",
"function",
"looks",
"in",
"DTD",
"attribute",
"declaration",
"for",
"#FIXED",
"or",
"default",
"d... | def prop(self, name):
"""Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off.
NOTE: this function acts... | [
"def",
"prop",
"(",
"self",
",",
"name",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlGetProp",
"(",
"self",
".",
"_o",
",",
"name",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3465-L3474 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/core.py | python | MaskedArray.__rsub__ | (self, other) | return subtract(other, self) | Subtract self from other, and return a new masked array. | Subtract self from other, and return a new masked array. | [
"Subtract",
"self",
"from",
"other",
"and",
"return",
"a",
"new",
"masked",
"array",
"."
] | def __rsub__(self, other):
"""
Subtract self from other, and return a new masked array.
"""
return subtract(other, self) | [
"def",
"__rsub__",
"(",
"self",
",",
"other",
")",
":",
"return",
"subtract",
"(",
"other",
",",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L4159-L4164 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_randomGeneratorWrapper/generator.py | python | returnUniformAndTwoNormal | (*args) | return [int(np.random.uniform(args[0],args[1])),np.random.normal(args[2], args[3], 1),np.random.normal(args[4], args[5], 1)] | Return one integer uniformly distributed random variable and
two normal random variables | Return one integer uniformly distributed random variable and
two normal random variables | [
"Return",
"one",
"integer",
"uniformly",
"distributed",
"random",
"variable",
"and",
"two",
"normal",
"random",
"variables"
] | def returnUniformAndTwoNormal(*args):
"""
Return one integer uniformly distributed random variable and
two normal random variables
"""
return [int(np.random.uniform(args[0],args[1])),np.random.normal(args[2], args[3], 1),np.random.normal(args[4], args[5], 1)] | [
"def",
"returnUniformAndTwoNormal",
"(",
"*",
"args",
")",
":",
"return",
"[",
"int",
"(",
"np",
".",
"random",
".",
"uniform",
"(",
"args",
"[",
"0",
"]",
",",
"args",
"[",
"1",
"]",
")",
")",
",",
"np",
".",
"random",
".",
"normal",
"(",
"args"... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_randomGeneratorWrapper/generator.py#L81-L86 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/dispatch.py | python | should_series_dispatch | (left, right, op) | return False | Identify cases where a DataFrame operation should dispatch to its
Series counterpart.
Parameters
----------
left : DataFrame
right : DataFrame or Series
op : binary operator
Returns
-------
override : bool | Identify cases where a DataFrame operation should dispatch to its
Series counterpart. | [
"Identify",
"cases",
"where",
"a",
"DataFrame",
"operation",
"should",
"dispatch",
"to",
"its",
"Series",
"counterpart",
"."
] | def should_series_dispatch(left, right, op):
"""
Identify cases where a DataFrame operation should dispatch to its
Series counterpart.
Parameters
----------
left : DataFrame
right : DataFrame or Series
op : binary operator
Returns
-------
override : bool
"""
if left... | [
"def",
"should_series_dispatch",
"(",
"left",
",",
"right",
",",
"op",
")",
":",
"if",
"left",
".",
"_is_mixed_type",
"or",
"right",
".",
"_is_mixed_type",
":",
"return",
"True",
"if",
"op",
".",
"__name__",
".",
"strip",
"(",
"\"_\"",
")",
"in",
"[",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/dispatch.py#L48-L93 | |
strukturag/libheif | 0082fea96ee70a20c8906a0373bedec0c01777bc | scripts/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L1169-L1201 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | VarVScrollHelper.GetRowCount | (*args, **kwargs) | return _windows_.VarVScrollHelper_GetRowCount(*args, **kwargs) | GetRowCount(self) -> size_t | GetRowCount(self) -> size_t | [
"GetRowCount",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetRowCount(*args, **kwargs):
"""GetRowCount(self) -> size_t"""
return _windows_.VarVScrollHelper_GetRowCount(*args, **kwargs) | [
"def",
"GetRowCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarVScrollHelper_GetRowCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2297-L2299 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | python/lammps/core.py | python | lammps.is_running | (self) | return self.lib.lammps_is_running(self.lmp) == 1 | Report whether being called from a function during a run or a minimization
Various LAMMPS commands must not be called during an ongoing
run or minimization. This property allows to check for that.
This is a wrapper around the :cpp:func:`lammps_is_running`
function of the library interface.
.. ver... | Report whether being called from a function during a run or a minimization | [
"Report",
"whether",
"being",
"called",
"from",
"a",
"function",
"during",
"a",
"run",
"or",
"a",
"minimization"
] | def is_running(self):
""" Report whether being called from a function during a run or a minimization
Various LAMMPS commands must not be called during an ongoing
run or minimization. This property allows to check for that.
This is a wrapper around the :cpp:func:`lammps_is_running`
function of the ... | [
"def",
"is_running",
"(",
"self",
")",
":",
"return",
"self",
".",
"lib",
".",
"lammps_is_running",
"(",
"self",
".",
"lmp",
")",
"==",
"1"
] | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/python/lammps/core.py#L1479-L1492 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosgraph/src/rosgraph/network.py | python | is_local_address | (hostname) | return False | :param hostname: host name/address, ``str``
:returns True: if hostname maps to a local address, False otherwise. False conditions include invalid hostnames. | :param hostname: host name/address, ``str``
:returns True: if hostname maps to a local address, False otherwise. False conditions include invalid hostnames. | [
":",
"param",
"hostname",
":",
"host",
"name",
"/",
"address",
"str",
":",
"returns",
"True",
":",
"if",
"hostname",
"maps",
"to",
"a",
"local",
"address",
"False",
"otherwise",
".",
"False",
"conditions",
"include",
"invalid",
"hostnames",
"."
] | def is_local_address(hostname):
"""
:param hostname: host name/address, ``str``
:returns True: if hostname maps to a local address, False otherwise. False conditions include invalid hostnames.
"""
try:
if use_ipv6():
reverse_ips = [host[4][0] for host in socket.getaddrinfo(hostna... | [
"def",
"is_local_address",
"(",
"hostname",
")",
":",
"try",
":",
"if",
"use_ipv6",
"(",
")",
":",
"reverse_ips",
"=",
"[",
"host",
"[",
"4",
"]",
"[",
"0",
"]",
"for",
"host",
"in",
"socket",
".",
"getaddrinfo",
"(",
"hostname",
",",
"0",
",",
"0"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosgraph/src/rosgraph/network.py#L164-L180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiManager_DCP._destroyDummyPane | (self) | Destroys the Dummy Center Pane (**DCP**). | Destroys the Dummy Center Pane (**DCP**). | [
"Destroys",
"the",
"Dummy",
"Center",
"Pane",
"(",
"**",
"DCP",
"**",
")",
"."
] | def _destroyDummyPane(self):
""" Destroys the Dummy Center Pane (**DCP**). """
if not self.hasDummyPane:
return
self.hasDummyPane = False
self.ClosePane(self.GetPane('dummyCenterPane')) | [
"def",
"_destroyDummyPane",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"hasDummyPane",
":",
"return",
"self",
".",
"hasDummyPane",
"=",
"False",
"self",
".",
"ClosePane",
"(",
"self",
".",
"GetPane",
"(",
"'dummyCenterPane'",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L10657-L10664 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/io/loader.py | python | readVectorRaw | (text) | return [float(v) for v in items] | Reads a vector from a raw string 'v1 ... vn | Reads a vector from a raw string 'v1 ... vn | [
"Reads",
"a",
"vector",
"from",
"a",
"raw",
"string",
"v1",
"...",
"vn"
] | def readVectorRaw(text):
"""Reads a vector from a raw string 'v1 ... vn'"""
items = text.split()
return [float(v) for v in items] | [
"def",
"readVectorRaw",
"(",
"text",
")",
":",
"items",
"=",
"text",
".",
"split",
"(",
")",
"return",
"[",
"float",
"(",
"v",
")",
"for",
"v",
"in",
"items",
"]"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/loader.py#L113-L116 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.Add | (self, file_desc_proto) | Adds the FileDescriptorProto and its types to this pool.
Args:
file_desc_proto: The FileDescriptorProto to add. | Adds the FileDescriptorProto and its types to this pool. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"pool",
"."
] | def Add(self, file_desc_proto):
"""Adds the FileDescriptorProto and its types to this pool.
Args:
file_desc_proto: The FileDescriptorProto to add.
"""
self._internal_db.Add(file_desc_proto) | [
"def",
"Add",
"(",
"self",
",",
"file_desc_proto",
")",
":",
"self",
".",
"_internal_db",
".",
"Add",
"(",
"file_desc_proto",
")"
] | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py#L83-L90 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/control_flow_ops.py | python | exit | (data, name=None) | Exits the current frame to its parent frame.
Exit makes its input `data` available to the parent frame.
Args:
data: The tensor to be made available to the parent frame.
name: A name for this operation (optional).
Returns:
The same tensor as `data`. | Exits the current frame to its parent frame. | [
"Exits",
"the",
"current",
"frame",
"to",
"its",
"parent",
"frame",
"."
] | def exit(data, name=None):
"""Exits the current frame to its parent frame.
Exit makes its input `data` available to the parent frame.
Args:
data: The tensor to be made available to the parent frame.
name: A name for this operation (optional).
Returns:
The same tensor as `data`.
"""
data = ops... | [
"def",
"exit",
"(",
"data",
",",
"name",
"=",
"None",
")",
":",
"data",
"=",
"ops",
".",
"internal_convert_to_tensor_or_indexed_slices",
"(",
"data",
",",
"as_ref",
"=",
"True",
")",
"if",
"isinstance",
"(",
"data",
",",
"ops",
".",
"Tensor",
")",
":",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L251-L281 | ||
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/git.py | python | Git.version | (self) | return self.run(['describe', '--long']) | The git describe --long output. | The git describe --long output. | [
"The",
"git",
"describe",
"--",
"long",
"output",
"."
] | def version(self):
"""The git describe --long output."""
return self.run(['describe', '--long']) | [
"def",
"version",
"(",
"self",
")",
":",
"return",
"self",
".",
"run",
"(",
"[",
"'describe'",
",",
"'--long'",
"]",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/git.py#L122-L124 | |
eric1688/sphinx | 514317761b35c07eb9f36db55a1ff365c4a9f0bc | api/sphinxapi.py | python | SphinxClient.SetSortMode | ( self, mode, clause='' ) | Set sorting mode. | Set sorting mode. | [
"Set",
"sorting",
"mode",
"."
] | def SetSortMode ( self, mode, clause='' ):
"""
Set sorting mode.
"""
assert ( mode in [SPH_SORT_RELEVANCE, SPH_SORT_ATTR_DESC, SPH_SORT_ATTR_ASC, SPH_SORT_TIME_SEGMENTS, SPH_SORT_EXTENDED, SPH_SORT_EXPR] )
assert ( isinstance ( clause, str ) )
self._sort = mode
self._sortby = clause | [
"def",
"SetSortMode",
"(",
"self",
",",
"mode",
",",
"clause",
"=",
"''",
")",
":",
"assert",
"(",
"mode",
"in",
"[",
"SPH_SORT_RELEVANCE",
",",
"SPH_SORT_ATTR_DESC",
",",
"SPH_SORT_ATTR_ASC",
",",
"SPH_SORT_TIME_SEGMENTS",
",",
"SPH_SORT_EXTENDED",
",",
"SPH_SO... | https://github.com/eric1688/sphinx/blob/514317761b35c07eb9f36db55a1ff365c4a9f0bc/api/sphinxapi.py#L365-L372 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/back/OptimizeTransposeReshapeSequence.py | python | OptimizeTransposeReshapeSequence.forward_new_reshape_shape | (reshape_node: Node, initial_output_shape: np.array) | Propagates the changed output shape of the Reshape node forward. The output of the Reshape node should be
Transpose so it is necessary to update its 'order' attribute according to the updated shape and output data node.
:param reshape_node: the Reshape node to propagate the shape
:param initial_... | Propagates the changed output shape of the Reshape node forward. The output of the Reshape node should be
Transpose so it is necessary to update its 'order' attribute according to the updated shape and output data node.
:param reshape_node: the Reshape node to propagate the shape
:param initial_... | [
"Propagates",
"the",
"changed",
"output",
"shape",
"of",
"the",
"Reshape",
"node",
"forward",
".",
"The",
"output",
"of",
"the",
"Reshape",
"node",
"should",
"be",
"Transpose",
"so",
"it",
"is",
"necessary",
"to",
"update",
"its",
"order",
"attribute",
"acco... | def forward_new_reshape_shape(reshape_node: Node, initial_output_shape: np.array):
"""
Propagates the changed output shape of the Reshape node forward. The output of the Reshape node should be
Transpose so it is necessary to update its 'order' attribute according to the updated shape and output ... | [
"def",
"forward_new_reshape_shape",
"(",
"reshape_node",
":",
"Node",
",",
"initial_output_shape",
":",
"np",
".",
"array",
")",
":",
"output_shape",
"=",
"reshape_node",
".",
"out_port",
"(",
"0",
")",
".",
"data",
".",
"get_shape",
"(",
")",
"if",
"np",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/back/OptimizeTransposeReshapeSequence.py#L263-L292 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/scripter.py | python | BaseScriptElement.__str__ | (self) | return self.to_script() | Script representation of the object.
The output is meant to be executable as a Mantid python script | Script representation of the object.
The output is meant to be executable as a Mantid python script | [
"Script",
"representation",
"of",
"the",
"object",
".",
"The",
"output",
"is",
"meant",
"to",
"be",
"executable",
"as",
"a",
"Mantid",
"python",
"script"
] | def __str__(self):
"""
Script representation of the object.
The output is meant to be executable as a Mantid python script
"""
return self.to_script() | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"to_script",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/scripter.py#L47-L52 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/transformation.py | python | quaternion_multiply | (quaternion1, quaternion0) | return numpy.array([
-x1 * x0 - y1 * y0 - z1 * z0 + w1 * w0, x1 * w0 + y1 * z0 - z1 * y0 + w1 * x0,
-x1 * z0 + y1 * w0 + z1 * x0 + w1 * y0, x1 * y0 - y1 * x0 + z1 * w0 + w1 * z0
],
dtype=numpy.float64) | Return multiplication of two quaternions.
>>> q = quaternion_multiply([4, 1, -2, 3], [8, -5, 6, 7])
>>> numpy.allclose(q, [28, -44, -14, 48])
True | Return multiplication of two quaternions. | [
"Return",
"multiplication",
"of",
"two",
"quaternions",
"."
] | def quaternion_multiply(quaternion1, quaternion0):
"""Return multiplication of two quaternions.
>>> q = quaternion_multiply([4, 1, -2, 3], [8, -5, 6, 7])
>>> numpy.allclose(q, [28, -44, -14, 48])
True
"""
w0, x0, y0, z0 = quaternion0
w1, x1, y1, z1 = quaternion1
return numpy.array([
-x1 ... | [
"def",
"quaternion_multiply",
"(",
"quaternion1",
",",
"quaternion0",
")",
":",
"w0",
",",
"x0",
",",
"y0",
",",
"z0",
"=",
"quaternion0",
"w1",
",",
"x1",
",",
"y1",
",",
"z1",
"=",
"quaternion1",
"return",
"numpy",
".",
"array",
"(",
"[",
"-",
"x1"... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/transformation.py#L1153-L1167 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOMPatcher/DICOMPatcher.py | python | DICOMPatcherTest.setUp | (self) | Do whatever is needed to reset the state - typically a scene clear will be enough. | Do whatever is needed to reset the state - typically a scene clear will be enough. | [
"Do",
"whatever",
"is",
"needed",
"to",
"reset",
"the",
"state",
"-",
"typically",
"a",
"scene",
"clear",
"will",
"be",
"enough",
"."
] | def setUp(self):
""" Do whatever is needed to reset the state - typically a scene clear will be enough.
"""
slicer.mrmlScene.Clear(0) | [
"def",
"setUp",
"(",
"self",
")",
":",
"slicer",
".",
"mrmlScene",
".",
"Clear",
"(",
"0",
")"
] | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMPatcher/DICOMPatcher.py#L603-L606 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py | python | TPen.showturtle | (self) | Makes the turtle visible.
Aliases: showturtle | st
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.hideturtle()
>>> turtle.showturtle() | Makes the turtle visible. | [
"Makes",
"the",
"turtle",
"visible",
"."
] | def showturtle(self):
"""Makes the turtle visible.
Aliases: showturtle | st
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.hideturtle()
>>> turtle.showturtle()
"""
self.pen(shown=True) | [
"def",
"showturtle",
"(",
"self",
")",
":",
"self",
".",
"pen",
"(",
"shown",
"=",
"True",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2209-L2220 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py | python | is_summary_tag_unique | (tag) | return tag.encode() not in existing_tags | Checks if a summary tag is unique.
Args:
tag: The tag to use
Returns:
True if the summary tag is unique. | Checks if a summary tag is unique. | [
"Checks",
"if",
"a",
"summary",
"tag",
"is",
"unique",
"."
] | def is_summary_tag_unique(tag):
"""Checks if a summary tag is unique.
Args:
tag: The tag to use
Returns:
True if the summary tag is unique.
"""
existing_tags = [tensor_util.constant_value(summary.op.inputs[0])
for summary in ops.get_collection(ops.GraphKeys.SUMMARIES)]
existing_... | [
"def",
"is_summary_tag_unique",
"(",
"tag",
")",
":",
"existing_tags",
"=",
"[",
"tensor_util",
".",
"constant_value",
"(",
"summary",
".",
"op",
".",
"inputs",
"[",
"0",
"]",
")",
"for",
"summary",
"in",
"ops",
".",
"get_collection",
"(",
"ops",
".",
"G... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py#L81-L94 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/snode.py | python | SNode.name | (self) | return self.ptr.name() | Gets the name of `self`.
Returns:
str: The name of `self`. | Gets the name of `self`. | [
"Gets",
"the",
"name",
"of",
"self",
"."
] | def name(self):
"""Gets the name of `self`.
Returns:
str: The name of `self`.
"""
return self.ptr.name() | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"ptr",
".",
"name",
"(",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/snode.py#L242-L248 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/ElementalAnalysis/PeriodicTable/periodic_table.py | python | PeriodicList._selectionChanged | (self, treeItem, column) | Emit a :attr:`sigSelectionChanged` and send a list of
:class:`PeriodicTableItem` objects. | Emit a :attr:`sigSelectionChanged` and send a list of
:class:`PeriodicTableItem` objects. | [
"Emit",
"a",
":",
"attr",
":",
"sigSelectionChanged",
"and",
"send",
"a",
"list",
"of",
":",
"class",
":",
"PeriodicTableItem",
"objects",
"."
] | def _selectionChanged(self, treeItem, column):
"""Emit a :attr:`sigSelectionChanged` and send a list of
:class:`PeriodicTableItem` objects."""
self.sigSelectionChanged.emit(self.getSelection()) | [
"def",
"_selectionChanged",
"(",
"self",
",",
"treeItem",
",",
"column",
")",
":",
"self",
".",
"sigSelectionChanged",
".",
"emit",
"(",
"self",
".",
"getSelection",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/ElementalAnalysis/PeriodicTable/periodic_table.py#L760-L763 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/filters.py | python | do_tojson | (eval_ctx, value, indent=None) | return htmlsafe_json_dumps(value, dumper=dumper, **options) | Dumps a structure to JSON so that it's safe to use in ``<script>``
tags. It accepts the same arguments and returns a JSON string. Note that
this is available in templates through the ``|tojson`` filter which will
also mark the result as safe. Due to how this function escapes certain
characters this i... | Dumps a structure to JSON so that it's safe to use in ``<script>``
tags. It accepts the same arguments and returns a JSON string. Note that
this is available in templates through the ``|tojson`` filter which will
also mark the result as safe. Due to how this function escapes certain
characters this i... | [
"Dumps",
"a",
"structure",
"to",
"JSON",
"so",
"that",
"it",
"s",
"safe",
"to",
"use",
"in",
"<script",
">",
"tags",
".",
"It",
"accepts",
"the",
"same",
"arguments",
"and",
"returns",
"a",
"JSON",
"string",
".",
"Note",
"that",
"this",
"is",
"availabl... | def do_tojson(eval_ctx, value, indent=None):
"""Dumps a structure to JSON so that it's safe to use in ``<script>``
tags. It accepts the same arguments and returns a JSON string. Note that
this is available in templates through the ``|tojson`` filter which will
also mark the result as safe. Due to how... | [
"def",
"do_tojson",
"(",
"eval_ctx",
",",
"value",
",",
"indent",
"=",
"None",
")",
":",
"policies",
"=",
"eval_ctx",
".",
"environment",
".",
"policies",
"dumper",
"=",
"policies",
"[",
"'json.dumps_function'",
"]",
"options",
"=",
"policies",
"[",
"'json.d... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/filters.py#L1047-L1078 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBProcess.GetQueueAtIndex | (self, *args) | return _lldb.SBProcess_GetQueueAtIndex(self, *args) | GetQueueAtIndex(self, uint32_t index) -> SBQueue | GetQueueAtIndex(self, uint32_t index) -> SBQueue | [
"GetQueueAtIndex",
"(",
"self",
"uint32_t",
"index",
")",
"-",
">",
"SBQueue"
] | def GetQueueAtIndex(self, *args):
"""GetQueueAtIndex(self, uint32_t index) -> SBQueue"""
return _lldb.SBProcess_GetQueueAtIndex(self, *args) | [
"def",
"GetQueueAtIndex",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBProcess_GetQueueAtIndex",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7088-L7090 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/linalg.py | python | check_c_int | (context, builder, n) | Check whether *n* fits in a C `int`. | Check whether *n* fits in a C `int`. | [
"Check",
"whether",
"*",
"n",
"*",
"fits",
"in",
"a",
"C",
"int",
"."
] | def check_c_int(context, builder, n):
"""
Check whether *n* fits in a C `int`.
"""
_maxint = 2**31 - 1
def impl(n):
if n > _maxint:
raise OverflowError("array size too large to fit in C int")
context.compile_internal(builder, impl,
signature(typ... | [
"def",
"check_c_int",
"(",
"context",
",",
"builder",
",",
"n",
")",
":",
"_maxint",
"=",
"2",
"**",
"31",
"-",
"1",
"def",
"impl",
"(",
"n",
")",
":",
"if",
"n",
">",
"_maxint",
":",
"raise",
"OverflowError",
"(",
"\"array size too large to fit in C int... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/linalg.py#L306-L317 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py | python | NDFrame.swapaxes | (self: FrameOrSeries, axis1, axis2, copy=True) | return self._constructor(new_values, *new_axes).__finalize__(self) | Interchange axes and swap values axes appropriately.
Returns
-------
y : same as input | Interchange axes and swap values axes appropriately. | [
"Interchange",
"axes",
"and",
"swap",
"values",
"axes",
"appropriately",
"."
] | def swapaxes(self: FrameOrSeries, axis1, axis2, copy=True) -> FrameOrSeries:
"""
Interchange axes and swap values axes appropriately.
Returns
-------
y : same as input
"""
i = self._get_axis_number(axis1)
j = self._get_axis_number(axis2)
if i == ... | [
"def",
"swapaxes",
"(",
"self",
":",
"FrameOrSeries",
",",
"axis1",
",",
"axis2",
",",
"copy",
"=",
"True",
")",
"->",
"FrameOrSeries",
":",
"i",
"=",
"self",
".",
"_get_axis_number",
"(",
"axis1",
")",
"j",
"=",
"self",
".",
"_get_axis_number",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L664-L687 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py | python | cp | (src, dest) | Copy src to dest | Copy src to dest | [
"Copy",
"src",
"to",
"dest"
] | def cp(src, dest):
""" Copy src to dest """
_shutil.copy2(native(src), native(dest)) | [
"def",
"cp",
"(",
"src",
",",
"dest",
")",
":",
"_shutil",
".",
"copy2",
"(",
"native",
"(",
"src",
")",
",",
"native",
"(",
"dest",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py#L66-L68 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/slice_sans_event.py | python | slice_sans_event | (state_slice, input_ws, input_ws_monitor, data_type_str="Sample") | return to_return | Takes an event slice from an event workspace
:param state_slice: The state.slice object
:param input_ws: The input workspace. If it is an event workspace, then the slice is taken.
In case of a Workspace2D the original workspace is returned
:param input_ws_monitor: The monitor workspace ... | Takes an event slice from an event workspace
:param state_slice: The state.slice object
:param input_ws: The input workspace. If it is an event workspace, then the slice is taken.
In case of a Workspace2D the original workspace is returned
:param input_ws_monitor: The monitor workspace ... | [
"Takes",
"an",
"event",
"slice",
"from",
"an",
"event",
"workspace",
":",
"param",
"state_slice",
":",
"The",
"state",
".",
"slice",
"object",
":",
"param",
"input_ws",
":",
"The",
"input",
"workspace",
".",
"If",
"it",
"is",
"an",
"event",
"workspace",
... | def slice_sans_event(state_slice, input_ws, input_ws_monitor, data_type_str="Sample"):
"""
Takes an event slice from an event workspace
:param state_slice: The state.slice object
:param input_ws: The input workspace. If it is an event workspace, then the slice is taken.
In case of a... | [
"def",
"slice_sans_event",
"(",
"state_slice",
",",
"input_ws",
",",
"input_ws_monitor",
",",
"data_type_str",
"=",
"\"Sample\"",
")",
":",
"data_type",
"=",
"DataType",
"(",
"data_type_str",
")",
"# This should be removed in the future when cycle 19/1 data is unlikely to be ... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/slice_sans_event.py#L14-L52 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_diagram.py | python | Diagram.GetQuickEditMode | (self) | return self._quickEditMode | Return quick edit mode. | Return quick edit mode. | [
"Return",
"quick",
"edit",
"mode",
"."
] | def GetQuickEditMode(self):
"""Return quick edit mode."""
return self._quickEditMode | [
"def",
"GetQuickEditMode",
"(",
"self",
")",
":",
"return",
"self",
".",
"_quickEditMode"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_diagram.py#L146-L148 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/openpgp/sap/pkt/Packet.py | python | Packet.fill | (self, d) | Set the Packet instances's data, filling its attributes.
:Parameters:
- `d`: string of OpenPGP packet data
:Returns: Nothing
Tag data (d) must be a string of valid OpenPGP packet data
(tag, length, body, and possibly partial length/body
interlacing).
Examp... | Set the Packet instances's data, filling its attributes. | [
"Set",
"the",
"Packet",
"instances",
"s",
"data",
"filling",
"its",
"attributes",
"."
] | def fill(self, d):
"""Set the Packet instances's data, filling its attributes.
:Parameters:
- `d`: string of OpenPGP packet data
:Returns: Nothing
Tag data (d) must be a string of valid OpenPGP packet data
(tag, length, body, and possibly partial length/body
... | [
"def",
"fill",
"(",
"self",
",",
"d",
")",
":",
"# Partial Length Mechanics (..elif 1 == self.tag.version..): Body",
"# length is determined locally (with the help of str2int",
"# functions) to accomodate a flow between partial body fragments,",
"# concluding fragments, and complete packet bod... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/pkt/Packet.py#L294-L378 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/learn_io/dask_io.py | python | extract_dask_labels | (labels) | Extract data from dask.Series or dask.DataFrame for labels.
Given a distributed dask.DataFrame or dask.Series containing exactly one
column or name, this operation returns a single dask.DataFrame or dask.Series
that can be iterated over.
Args:
labels: A distributed dask.DataFrame or dask.Series with exact... | Extract data from dask.Series or dask.DataFrame for labels. | [
"Extract",
"data",
"from",
"dask",
".",
"Series",
"or",
"dask",
".",
"DataFrame",
"for",
"labels",
"."
] | def extract_dask_labels(labels):
"""Extract data from dask.Series or dask.DataFrame for labels.
Given a distributed dask.DataFrame or dask.Series containing exactly one
column or name, this operation returns a single dask.DataFrame or dask.Series
that can be iterated over.
Args:
labels: A distributed da... | [
"def",
"extract_dask_labels",
"(",
"labels",
")",
":",
"if",
"isinstance",
"(",
"labels",
",",
"dd",
".",
"DataFrame",
")",
":",
"ncol",
"=",
"labels",
".",
"columns",
"elif",
"isinstance",
"(",
"labels",
",",
"dd",
".",
"Series",
")",
":",
"ncol",
"="... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py#L84-L114 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.