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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | _AddFilters | (filters) | Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Adds more filter overrides. | [
"Adds",
"more",
"filter",
"overrides",
"."
] | def _AddFilters(filters):
"""Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint_sta... | [
"def",
"_AddFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"AddFilters",
"(",
"filters",
")"
] | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L1221-L1231 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/OfflineValidation/python/TkAlAllInOneTool/helperFunctions.py | python | replaceByMap | (target, the_map) | return result | This function replaces `.oO[key]Oo.` by `the_map[key]` in target.
Arguments:
- `target`: String which contains symbolic tags of the form `.oO[key]Oo.`
- `the_map`: Dictionary which has to contain the `key`s in `target` as keys | This function replaces `.oO[key]Oo.` by `the_map[key]` in target. | [
"This",
"function",
"replaces",
".",
"oO",
"[",
"key",
"]",
"Oo",
".",
"by",
"the_map",
"[",
"key",
"]",
"in",
"target",
"."
] | def replaceByMap(target, the_map):
"""This function replaces `.oO[key]Oo.` by `the_map[key]` in target.
Arguments:
- `target`: String which contains symbolic tags of the form `.oO[key]Oo.`
- `the_map`: Dictionary which has to contain the `key`s in `target` as keys
"""
result = target
for k... | [
"def",
"replaceByMap",
"(",
"target",
",",
"the_map",
")",
":",
"result",
"=",
"target",
"for",
"key",
"in",
"the_map",
":",
"lifeSaver",
"=",
"10e3",
"iteration",
"=",
"0",
"while",
"\".oO[\"",
"in",
"result",
"and",
"\"]Oo.\"",
"in",
"result",
":",
"fo... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/OfflineValidation/python/TkAlAllInOneTool/helperFunctions.py#L12-L48 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py | python | CodeDeployConnection.create_deployment_config | (self, deployment_config_name,
minimum_healthy_hosts=None) | return self.make_request(action='CreateDeploymentConfig',
body=json.dumps(params)) | Creates a new deployment configuration.
:type deployment_config_name: string
:param deployment_config_name: The name of the deployment configuration
to create.
:type minimum_healthy_hosts: dict
:param minimum_healthy_hosts: The minimum number of healthy instances
... | Creates a new deployment configuration. | [
"Creates",
"a",
"new",
"deployment",
"configuration",
"."
] | def create_deployment_config(self, deployment_config_name,
minimum_healthy_hosts=None):
"""
Creates a new deployment configuration.
:type deployment_config_name: string
:param deployment_config_name: The name of the deployment configuration
t... | [
"def",
"create_deployment_config",
"(",
"self",
",",
"deployment_config_name",
",",
"minimum_healthy_hosts",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'deploymentConfigName'",
":",
"deployment_config_name",
",",
"}",
"if",
"minimum_healthy_hosts",
"is",
"not",
"None... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py#L262-L297 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_trustregion_ncg.py | python | _minimize_trust_ncg | (fun, x0, args=(), jac=None, hess=None, hessp=None,
**trust_region_options) | return _minimize_trust_region(fun, x0, args=args, jac=jac, hess=hess,
hessp=hessp, subproblem=CGSteihaugSubproblem,
**trust_region_options) | Minimization of scalar function of one or more variables using
the Newton conjugate gradient trust-region algorithm.
Options
-------
initial_trust_radius : float
Initial trust-region radius.
max_trust_radius : float
Maximum value of the trust-region radius. No steps that are longer
... | Minimization of scalar function of one or more variables using
the Newton conjugate gradient trust-region algorithm. | [
"Minimization",
"of",
"scalar",
"function",
"of",
"one",
"or",
"more",
"variables",
"using",
"the",
"Newton",
"conjugate",
"gradient",
"trust",
"-",
"region",
"algorithm",
"."
] | def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hessp=None,
**trust_region_options):
"""
Minimization of scalar function of one or more variables using
the Newton conjugate gradient trust-region algorithm.
Options
-------
initial_trust_radius : float
... | [
"def",
"_minimize_trust_ncg",
"(",
"fun",
",",
"x0",
",",
"args",
"=",
"(",
")",
",",
"jac",
"=",
"None",
",",
"hess",
"=",
"None",
",",
"hessp",
"=",
"None",
",",
"*",
"*",
"trust_region_options",
")",
":",
"if",
"jac",
"is",
"None",
":",
"raise",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_trustregion_ncg.py#L13-L41 | |
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/caffe/caffe_layer_param_transmit.py | python | NotNeededInInference | (args) | Not need to parsing | Not need to parsing | [
"Not",
"need",
"to",
"parsing"
] | def NotNeededInInference(args):
"""
Not need to parsing
"""
# args is tuple object
node_io = args[0]
layer = args[1]
tensors = args[2]
logger(verbose.INFO).feed("Layer type(", layer.name, " : ", layer.type, ") with ", \
len(tensors), " tensors not needed in inference.") | [
"def",
"NotNeededInInference",
"(",
"args",
")",
":",
"# args is tuple object",
"node_io",
"=",
"args",
"[",
"0",
"]",
"layer",
"=",
"args",
"[",
"1",
"]",
"tensors",
"=",
"args",
"[",
"2",
"]",
"logger",
"(",
"verbose",
".",
"INFO",
")",
".",
"feed",
... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/caffe/caffe_layer_param_transmit.py#L63-L72 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/sandbox.py | python | AbstractSandbox.run | (self, func) | Run 'func' under os sandboxing | Run 'func' under os sandboxing | [
"Run",
"func",
"under",
"os",
"sandboxing"
] | def run(self, func):
"""Run 'func' under os sandboxing"""
with self:
return func() | [
"def",
"run",
"(",
"self",
",",
"func",
")",
":",
"with",
"self",
":",
"return",
"func",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/sandbox.py#L286-L289 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/msvs_emulation.py | python | _GenericRetrieve | (root, default, path) | return _GenericRetrieve(root.get(path[0]), default, path[1:]) | Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist. | Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist. | [
"Given",
"a",
"list",
"of",
"dictionary",
"keys",
"|path|",
"and",
"a",
"tree",
"of",
"dicts",
"|root|",
"find",
"value",
"at",
"path",
"or",
"return",
"|default|",
"if",
"any",
"of",
"the",
"path",
"doesn",
"t",
"exist",
"."
] | def _GenericRetrieve(root, default, path):
"""Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist."""
if not root:
return default
if not path:
return root
return _GenericRetrieve(root.get(path[0]), default, path[1:... | [
"def",
"_GenericRetrieve",
"(",
"root",
",",
"default",
",",
"path",
")",
":",
"if",
"not",
"root",
":",
"return",
"default",
"if",
"not",
"path",
":",
"return",
"root",
"return",
"_GenericRetrieve",
"(",
"root",
".",
"get",
"(",
"path",
"[",
"0",
"]",... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/msvs_emulation.py#L69-L76 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/upload.py | python | DoSSHCommand | (command, user, host, port=None, ssh_key=None) | return cmd.stdout.read().strip() | Execute command on user@host using ssh. Optionally use
port and ssh_key, if provided. | Execute command on user | [
"Execute",
"command",
"on",
"user"
] | def DoSSHCommand(command, user, host, port=None, ssh_key=None):
"""Execute command on user@host using ssh. Optionally use
port and ssh_key, if provided."""
cmdline = ["ssh"]
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
cmdline.extend(["%s@%s" % (user, host), command])
cmd = Popen(c... | [
"def",
"DoSSHCommand",
"(",
"command",
",",
"user",
",",
"host",
",",
"port",
"=",
"None",
",",
"ssh_key",
"=",
"None",
")",
":",
"cmdline",
"=",
"[",
"\"ssh\"",
"]",
"AppendOptionalArgsToSSHCommandline",
"(",
"cmdline",
",",
"port",
",",
"ssh_key",
")",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/upload.py#L79-L90 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/idtracking.py | python | FrameSymbolVisitor.visit_OverlayScope | (self, node, **kwargs) | Do not visit into overlay scopes. | Do not visit into overlay scopes. | [
"Do",
"not",
"visit",
"into",
"overlay",
"scopes",
"."
] | def visit_OverlayScope(self, node, **kwargs):
"""Do not visit into overlay scopes.""" | [
"def",
"visit_OverlayScope",
"(",
"self",
",",
"node",
",",
"*",
"*",
"kwargs",
")",
":"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/idtracking.py#L285-L286 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py | python | update_dist_caches | (dist_path, fix_zipimporter_caches) | Fix any globally cached `dist_path` related data
`dist_path` should be a path of a newly installed egg distribution (zipped
or unzipped).
sys.path_importer_cache contains finder objects that have been cached when
importing data from the original distribution. Any such finders need to be
cleared si... | Fix any globally cached `dist_path` related data | [
"Fix",
"any",
"globally",
"cached",
"dist_path",
"related",
"data"
] | def update_dist_caches(dist_path, fix_zipimporter_caches):
"""
Fix any globally cached `dist_path` related data
`dist_path` should be a path of a newly installed egg distribution (zipped
or unzipped).
sys.path_importer_cache contains finder objects that have been cached when
importing data fro... | [
"def",
"update_dist_caches",
"(",
"dist_path",
",",
"fix_zipimporter_caches",
")",
":",
"# There are several other known sources of stale zipimport.zipimporter",
"# instances that we do not clear here, but might if ever given a reason to",
"# do so:",
"# * Global setuptools pkg_resources.worki... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py#L1742-L1821 | ||
ianmaclarty/amulet | 3d1363e0a0dde5e4c346409cefab66c2dc91b237 | third_party/freetype-2.5.5/src/tools/docmaker/content.py | python | ContentProcessor.__init__ | ( self ) | Initialize a block content processor. | Initialize a block content processor. | [
"Initialize",
"a",
"block",
"content",
"processor",
"."
] | def __init__( self ):
"""Initialize a block content processor."""
self.reset()
self.sections = {} # dictionary of documentation sections
self.section = None # current documentation section
self.chapters = [] # list of chapters
self.headers = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"reset",
"(",
")",
"self",
".",
"sections",
"=",
"{",
"}",
"# dictionary of documentation sections",
"self",
".",
"section",
"=",
"None",
"# current documentation section",
"self",
".",
"chapters",
"=",
"[... | https://github.com/ianmaclarty/amulet/blob/3d1363e0a0dde5e4c346409cefab66c2dc91b237/third_party/freetype-2.5.5/src/tools/docmaker/content.py#L385-L394 | ||
Alexhuszagh/rust-lexical | 01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0 | scripts/timings.py | python | filename | (basename, args) | return name | Get a resilient name for the benchmark data. | Get a resilient name for the benchmark data. | [
"Get",
"a",
"resilient",
"name",
"for",
"the",
"benchmark",
"data",
"."
] | def filename(basename, args):
'''Get a resilient name for the benchmark data.'''
name = basename
if args.no_default_features:
name = f'{name}_nodefault'
if args.features:
name = f'{name}_features={args.features}'
return name | [
"def",
"filename",
"(",
"basename",
",",
"args",
")",
":",
"name",
"=",
"basename",
"if",
"args",
".",
"no_default_features",
":",
"name",
"=",
"f'{name}_nodefault'",
"if",
"args",
".",
"features",
":",
"name",
"=",
"f'{name}_features={args.features}'",
"return"... | https://github.com/Alexhuszagh/rust-lexical/blob/01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0/scripts/timings.py#L84-L92 | |
OpenNI/OpenNI | 1e9524ffd759841789dadb4ca19fb5d4ac5820e7 | Platform/Linux/CreateRedist/Redist_OpenNi.py | python | check_sample | (sample_dir) | return rc | Checks if a sample is a tool or should be skipped, returns: 0 - Regular, 1 - Skip, 2 - Tool | Checks if a sample is a tool or should be skipped, returns: 0 - Regular, 1 - Skip, 2 - Tool | [
"Checks",
"if",
"a",
"sample",
"is",
"a",
"tool",
"or",
"should",
"be",
"skipped",
"returns",
":",
"0",
"-",
"Regular",
"1",
"-",
"Skip",
"2",
"-",
"Tool"
] | def check_sample(sample_dir):
"Checks if a sample is a tool or should be skipped, returns: 0 - Regular, 1 - Skip, 2 - Tool"
rc = 0
if os.path.exists(sample_dir + "/.redist"):
redistFile = open(sample_dir + "/.redist")
else:
rc=0
return rc
redist_lines =redistFile.readlines()
... | [
"def",
"check_sample",
"(",
"sample_dir",
")",
":",
"rc",
"=",
"0",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"sample_dir",
"+",
"\"/.redist\"",
")",
":",
"redistFile",
"=",
"open",
"(",
"sample_dir",
"+",
"\"/.redist\"",
")",
"else",
":",
"rc",
"="... | https://github.com/OpenNI/OpenNI/blob/1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Platform/Linux/CreateRedist/Redist_OpenNi.py#L82-L103 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/inspect.py | python | BoundArguments.apply_defaults | (self) | Set default values for missing arguments.
For variable-positional arguments (*args) the default is an
empty tuple.
For variable-keyword arguments (**kwargs) the default is an
empty dict. | Set default values for missing arguments. | [
"Set",
"default",
"values",
"for",
"missing",
"arguments",
"."
] | def apply_defaults(self):
"""Set default values for missing arguments.
For variable-positional arguments (*args) the default is an
empty tuple.
For variable-keyword arguments (**kwargs) the default is an
empty dict.
"""
arguments = self.arguments
new_arg... | [
"def",
"apply_defaults",
"(",
"self",
")",
":",
"arguments",
"=",
"self",
".",
"arguments",
"new_arguments",
"=",
"[",
"]",
"for",
"name",
",",
"param",
"in",
"self",
".",
"_signature",
".",
"parameters",
".",
"items",
"(",
")",
":",
"try",
":",
"new_a... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/inspect.py#L2701-L2727 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/experimental/statistical_analysis/results_stats.py | python | IsScipyMannTestOneSided | () | return scipy_version[0] < 1 and scipy_version[1] < 17 | Checks if Scipy version is < 0.17.0.
This is the version where stats.mannwhitneyu(...) is changed from returning
a one-sided to returning a two-sided p-value. | Checks if Scipy version is < 0.17.0. | [
"Checks",
"if",
"Scipy",
"version",
"is",
"<",
"0",
".",
"17",
".",
"0",
"."
] | def IsScipyMannTestOneSided():
"""Checks if Scipy version is < 0.17.0.
This is the version where stats.mannwhitneyu(...) is changed from returning
a one-sided to returning a two-sided p-value.
"""
scipy_version = [int(num) for num in scipy.version.version.split('.')]
return scipy_version[0] < 1 and scipy_v... | [
"def",
"IsScipyMannTestOneSided",
"(",
")",
":",
"scipy_version",
"=",
"[",
"int",
"(",
"num",
")",
"for",
"num",
"in",
"scipy",
".",
"version",
".",
"version",
".",
"split",
"(",
"'.'",
")",
"]",
"return",
"scipy_version",
"[",
"0",
"]",
"<",
"1",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/experimental/statistical_analysis/results_stats.py#L46-L53 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | UpdateUIEvent.GetText | (*args, **kwargs) | return _core_.UpdateUIEvent_GetText(*args, **kwargs) | GetText(self) -> String
Returns the text that should be set for the UI element. | GetText(self) -> String | [
"GetText",
"(",
"self",
")",
"-",
">",
"String"
] | def GetText(*args, **kwargs):
"""
GetText(self) -> String
Returns the text that should be set for the UI element.
"""
return _core_.UpdateUIEvent_GetText(*args, **kwargs) | [
"def",
"GetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"UpdateUIEvent_GetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6773-L6779 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/resmokelib/parser.py | python | validate_options | (parser, options, args) | Do preliminary validation on the options and error on any invalid options. | Do preliminary validation on the options and error on any invalid options. | [
"Do",
"preliminary",
"validation",
"on",
"the",
"options",
"and",
"error",
"on",
"any",
"invalid",
"options",
"."
] | def validate_options(parser, options, args):
"""
Do preliminary validation on the options and error on any invalid options.
"""
if options.shell_port is not None and options.shell_conn_string is not None:
parser.error("Cannot specify both `shellPort` and `shellConnString`")
if options.exec... | [
"def",
"validate_options",
"(",
"parser",
",",
"options",
",",
"args",
")",
":",
"if",
"options",
".",
"shell_port",
"is",
"not",
"None",
"and",
"options",
".",
"shell_conn_string",
"is",
"not",
"None",
":",
"parser",
".",
"error",
"(",
"\"Cannot specify bot... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/resmokelib/parser.py#L292-L303 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/cnn_text_classification/data_helpers.py | python | load_data_and_labels | () | return [x_text, y] | Loads MR polarity data from files, splits the data into words and generates labels.
Returns split sentences and labels. | Loads MR polarity data from files, splits the data into words and generates labels.
Returns split sentences and labels. | [
"Loads",
"MR",
"polarity",
"data",
"from",
"files",
"splits",
"the",
"data",
"into",
"words",
"and",
"generates",
"labels",
".",
"Returns",
"split",
"sentences",
"and",
"labels",
"."
] | def load_data_and_labels():
"""
Loads MR polarity data from files, splits the data into words and generates labels.
Returns split sentences and labels.
"""
# Load data from files
pos_path = "./data/rt-polaritydata/rt-polarity.pos"
neg_path = "./data/rt-polaritydata/rt-polarity.neg"
if no... | [
"def",
"load_data_and_labels",
"(",
")",
":",
"# Load data from files",
"pos_path",
"=",
"\"./data/rt-polaritydata/rt-polarity.pos\"",
"neg_path",
"=",
"\"./data/rt-polaritydata/rt-polarity.neg\"",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"pos_path",
")",
":",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/cnn_text_classification/data_helpers.py#L46-L70 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/common_ops.py | python | TaichiOperations.atomic_sub | (self, other) | return ops.atomic_sub(self, other) | Return the new expression of computing atomic sub between self and a given operand.
Args:
other (Any): Given operand.
Returns:
:class:`~taichi.lang.expr.Expr`: The computing expression of atomic sub. | Return the new expression of computing atomic sub between self and a given operand. | [
"Return",
"the",
"new",
"expression",
"of",
"computing",
"atomic",
"sub",
"between",
"self",
"and",
"a",
"given",
"operand",
"."
] | def atomic_sub(self, other):
"""Return the new expression of computing atomic sub between self and a given operand.
Args:
other (Any): Given operand.
Returns:
:class:`~taichi.lang.expr.Expr`: The computing expression of atomic sub."""
return ops.atomic_sub(self,... | [
"def",
"atomic_sub",
"(",
"self",
",",
"other",
")",
":",
"return",
"ops",
".",
"atomic_sub",
"(",
"self",
",",
"other",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/common_ops.py#L138-L146 | |
garyexplains/examples | 2e2f7c1b990da00f07fc9f3e30086c93c81756a4 | Raspberry Pi Pico/MicroPython/primes.py | python | is_prime | (n: int) | return True | Primality test using 6k+-1 optimization. | Primality test using 6k+-1 optimization. | [
"Primality",
"test",
"using",
"6k",
"+",
"-",
"1",
"optimization",
"."
] | def is_prime(n: int) -> bool:
"""Primality test using 6k+-1 optimization."""
if n <= 3:
return n > 1
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i ** 2 <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True | [
"def",
"is_prime",
"(",
"n",
":",
"int",
")",
"->",
"bool",
":",
"if",
"n",
"<=",
"3",
":",
"return",
"n",
">",
"1",
"if",
"n",
"%",
"2",
"==",
"0",
"or",
"n",
"%",
"3",
"==",
"0",
":",
"return",
"False",
"i",
"=",
"5",
"while",
"i",
"**"... | https://github.com/garyexplains/examples/blob/2e2f7c1b990da00f07fc9f3e30086c93c81756a4/Raspberry Pi Pico/MicroPython/primes.py#L33-L44 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | TheoryAtom | (location: Location, term: AST, elements: Sequence[AST], guard: Optional[AST]) | return AST(p_ast[0]) | Construct an AST node of type `ASTType.TheoryAtom`. | Construct an AST node of type `ASTType.TheoryAtom`. | [
"Construct",
"an",
"AST",
"node",
"of",
"type",
"ASTType",
".",
"TheoryAtom",
"."
] | def TheoryAtom(location: Location, term: AST, elements: Sequence[AST], guard: Optional[AST]) -> AST:
'''
Construct an AST node of type `ASTType.TheoryAtom`.
'''
p_ast = _ffi.new('clingo_ast_t**')
c_location = _c_location(location)
_handle_error(_lib.clingo_ast_build(
_lib.clingo_ast_type... | [
"def",
"TheoryAtom",
"(",
"location",
":",
"Location",
",",
"term",
":",
"AST",
",",
"elements",
":",
"Sequence",
"[",
"AST",
"]",
",",
"guard",
":",
"Optional",
"[",
"AST",
"]",
")",
"->",
"AST",
":",
"p_ast",
"=",
"_ffi",
".",
"new",
"(",
"'cling... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1603-L1616 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | TextAreaBase.SetDefaultStyle | (*args, **kwargs) | return _core_.TextAreaBase_SetDefaultStyle(*args, **kwargs) | SetDefaultStyle(self, wxTextAttr style) -> bool | SetDefaultStyle(self, wxTextAttr style) -> bool | [
"SetDefaultStyle",
"(",
"self",
"wxTextAttr",
"style",
")",
"-",
">",
"bool"
] | def SetDefaultStyle(*args, **kwargs):
"""SetDefaultStyle(self, wxTextAttr style) -> bool"""
return _core_.TextAreaBase_SetDefaultStyle(*args, **kwargs) | [
"def",
"SetDefaultStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextAreaBase_SetDefaultStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L13428-L13430 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/youtube/__init__.py | python | YouTubeSubscriptionEntry.GetSubscriptionType | (self) | Retrieve the type of this subscription.
Returns:
A string that is either 'channel, 'query' or 'favorites' | Retrieve the type of this subscription. | [
"Retrieve",
"the",
"type",
"of",
"this",
"subscription",
"."
] | def GetSubscriptionType(self):
"""Retrieve the type of this subscription.
Returns:
A string that is either 'channel, 'query' or 'favorites'
"""
for category in self.category:
if category.scheme == YOUTUBE_SUBSCRIPTION_TYPE_SCHEME:
return category.term | [
"def",
"GetSubscriptionType",
"(",
"self",
")",
":",
"for",
"category",
"in",
"self",
".",
"category",
":",
"if",
"category",
".",
"scheme",
"==",
"YOUTUBE_SUBSCRIPTION_TYPE_SCHEME",
":",
"return",
"category",
".",
"term"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/youtube/__init__.py#L308-L316 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Build.py | python | BuildContext.compile | (self) | Run the build by creating an instance of :py:class:`waflib.Runner.Parallel`
The cache file is written when at least a task was executed.
:raises: :py:class:`waflib.Errors.BuildError` in case the build fails | Run the build by creating an instance of :py:class:`waflib.Runner.Parallel`
The cache file is written when at least a task was executed. | [
"Run",
"the",
"build",
"by",
"creating",
"an",
"instance",
"of",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Runner",
".",
"Parallel",
"The",
"cache",
"file",
"is",
"written",
"when",
"at",
"least",
"a",
"task",
"was",
"executed",
"."
] | def compile(self):
"""
Run the build by creating an instance of :py:class:`waflib.Runner.Parallel`
The cache file is written when at least a task was executed.
:raises: :py:class:`waflib.Errors.BuildError` in case the build fails
"""
Logs.debug('build: compile()')
# delegate the producer-consumer logic ... | [
"def",
"compile",
"(",
"self",
")",
":",
"Logs",
".",
"debug",
"(",
"'build: compile()'",
")",
"# delegate the producer-consumer logic to another object to reduce the complexity",
"self",
".",
"producer",
"=",
"Runner",
".",
"Parallel",
"(",
"self",
",",
"self",
".",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Build.py#L332-L355 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py | python | InverseGamma.allow_nan_stats | (self) | return self._allow_nan_stats | Boolean describing behavior when a stat is undefined for batch member. | Boolean describing behavior when a stat is undefined for batch member. | [
"Boolean",
"describing",
"behavior",
"when",
"a",
"stat",
"is",
"undefined",
"for",
"batch",
"member",
"."
] | def allow_nan_stats(self):
"""Boolean describing behavior when a stat is undefined for batch member."""
return self._allow_nan_stats | [
"def",
"allow_nan_stats",
"(",
"self",
")",
":",
"return",
"self",
".",
"_allow_nan_stats"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py#L108-L110 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/softsign_replacer.py | python | SoftSign.replace_op | (self, graph: Graph, node: Node) | return [div_node.id] | Replace Softsign according to formula feature/(abs(feature)+1) | Replace Softsign according to formula feature/(abs(feature)+1) | [
"Replace",
"Softsign",
"according",
"to",
"formula",
"feature",
"/",
"(",
"abs",
"(",
"feature",
")",
"+",
"1",
")"
] | def replace_op(self, graph: Graph, node: Node):
"""
Replace Softsign according to formula feature/(abs(feature)+1)
"""
abs_node = Abs(graph, {'name': "abs_" + node.id}).create_node()
abs_node.in_port(0).connect(node.in_port(0).get_source())
add_node = create_op_node_with... | [
"def",
"replace_op",
"(",
"self",
",",
"graph",
":",
"Graph",
",",
"node",
":",
"Node",
")",
":",
"abs_node",
"=",
"Abs",
"(",
"graph",
",",
"{",
"'name'",
":",
"\"abs_\"",
"+",
"node",
".",
"id",
"}",
")",
".",
"create_node",
"(",
")",
"abs_node",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/softsign_replacer.py#L17-L29 | |
cocos-creator/engine-native | 984c4c9f5838253313b44ccd429bd8fac4ec8a6a | download-deps.py | python | delete_folder_except | (folder_path, excepts) | Delete a folder excepts some files/subfolders, `excepts` doesn't recursively which means it can not include
`subfoler/file1`. `excepts` is an array. | Delete a folder excepts some files/subfolders, `excepts` doesn't recursively which means it can not include
`subfoler/file1`. `excepts` is an array. | [
"Delete",
"a",
"folder",
"excepts",
"some",
"files",
"/",
"subfolders",
"excepts",
"doesn",
"t",
"recursively",
"which",
"means",
"it",
"can",
"not",
"include",
"subfoler",
"/",
"file1",
".",
"excepts",
"is",
"an",
"array",
"."
] | def delete_folder_except(folder_path, excepts):
"""
Delete a folder excepts some files/subfolders, `excepts` doesn't recursively which means it can not include
`subfoler/file1`. `excepts` is an array.
"""
for file in os.listdir(folder_path):
if (file in excepts):
continue
... | [
"def",
"delete_folder_except",
"(",
"folder_path",
",",
"excepts",
")",
":",
"for",
"file",
"in",
"os",
".",
"listdir",
"(",
"folder_path",
")",
":",
"if",
"(",
"file",
"in",
"excepts",
")",
":",
"continue",
"full_path",
"=",
"os",
".",
"path",
".",
"j... | https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/download-deps.py#L55-L68 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/property.py | python | split_conditional | (property) | return None | If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string. | If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string. | [
"If",
"property",
"is",
"conditional",
"property",
"returns",
"condition",
"and",
"the",
"property",
"e",
".",
"g",
"<variant",
">",
"debug",
"<toolset",
">",
"gcc",
":",
"<inlining",
">",
"full",
"will",
"become",
"<variant",
">",
"debug",
"<toolset",
">",
... | def split_conditional (property):
""" If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string.
"""
m = __re_split_conditio... | [
"def",
"split_conditional",
"(",
"property",
")",
":",
"m",
"=",
"__re_split_conditional",
".",
"match",
"(",
"property",
")",
"if",
"m",
":",
"return",
"(",
"m",
".",
"group",
"(",
"1",
")",
",",
"'<'",
"+",
"m",
".",
"group",
"(",
"2",
")",
")",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/property.py#L262-L274 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | TextEntryBase.ChangeValue | (*args, **kwargs) | return _core_.TextEntryBase_ChangeValue(*args, **kwargs) | ChangeValue(self, String value)
Set the value in the text entry field. Does not generate a text change event. | ChangeValue(self, String value) | [
"ChangeValue",
"(",
"self",
"String",
"value",
")"
] | def ChangeValue(*args, **kwargs):
"""
ChangeValue(self, String value)
Set the value in the text entry field. Does not generate a text change event.
"""
return _core_.TextEntryBase_ChangeValue(*args, **kwargs) | [
"def",
"ChangeValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextEntryBase_ChangeValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L13081-L13087 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | scripts/recoverymetrics.py | python | FRAC | (total) | return realFrac | Returns a function that shows the average percentage of the values from
the total given. | Returns a function that shows the average percentage of the values from
the total given. | [
"Returns",
"a",
"function",
"that",
"shows",
"the",
"average",
"percentage",
"of",
"the",
"values",
"from",
"the",
"total",
"given",
"."
] | def FRAC(total):
"""Returns a function that shows the average percentage of the values from
the total given."""
def realFrac(values, unit):
r = toString(sum(values) / len(values) / total * 100)
r += '%'
if max(values) > min(values):
r += ' avg'
return [r]
retu... | [
"def",
"FRAC",
"(",
"total",
")",
":",
"def",
"realFrac",
"(",
"values",
",",
"unit",
")",
":",
"r",
"=",
"toString",
"(",
"sum",
"(",
"values",
")",
"/",
"len",
"(",
"values",
")",
"/",
"total",
"*",
"100",
")",
"r",
"+=",
"'%'",
"if",
"max",
... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/recoverymetrics.py#L208-L217 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlPrintout.SetHtmlText | (*args, **kwargs) | return _html.HtmlPrintout_SetHtmlText(*args, **kwargs) | SetHtmlText(self, String html, String basepath=EmptyString, bool isdir=True) | SetHtmlText(self, String html, String basepath=EmptyString, bool isdir=True) | [
"SetHtmlText",
"(",
"self",
"String",
"html",
"String",
"basepath",
"=",
"EmptyString",
"bool",
"isdir",
"=",
"True",
")"
] | def SetHtmlText(*args, **kwargs):
"""SetHtmlText(self, String html, String basepath=EmptyString, bool isdir=True)"""
return _html.HtmlPrintout_SetHtmlText(*args, **kwargs) | [
"def",
"SetHtmlText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlPrintout_SetHtmlText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1276-L1278 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_code/code.py | python | TracebackEntry.ishidden | (self) | return True if the current frame has a var __tracebackhide__
resolving to True
mostly for internal use | return True if the current frame has a var __tracebackhide__
resolving to True | [
"return",
"True",
"if",
"the",
"current",
"frame",
"has",
"a",
"var",
"__tracebackhide__",
"resolving",
"to",
"True"
] | def ishidden(self):
""" return True if the current frame has a var __tracebackhide__
resolving to True
mostly for internal use
"""
try:
return self.frame.f_locals['__tracebackhide__']
except KeyError:
try:
return self.frame... | [
"def",
"ishidden",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"frame",
".",
"f_locals",
"[",
"'__tracebackhide__'",
"]",
"except",
"KeyError",
":",
"try",
":",
"return",
"self",
".",
"frame",
".",
"f_globals",
"[",
"'__tracebackhide__'",
"]"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_code/code.py#L218-L230 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/tools/datetimes.py | python | DateOffset._from_freqstr | (cls: Type[_T], freqstr: str) | return cls(**{cls._CODES_TO_UNITS[freq_part]: int(numeric_part)}) | Parse a string and return a DateOffset object
expects strings of the form 3D, 25W, 10ms, 42ns, etc. | Parse a string and return a DateOffset object
expects strings of the form 3D, 25W, 10ms, 42ns, etc. | [
"Parse",
"a",
"string",
"and",
"return",
"a",
"DateOffset",
"object",
"expects",
"strings",
"of",
"the",
"form",
"3D",
"25W",
"10ms",
"42ns",
"etc",
"."
] | def _from_freqstr(cls: Type[_T], freqstr: str) -> _T:
"""
Parse a string and return a DateOffset object
expects strings of the form 3D, 25W, 10ms, 42ns, etc.
"""
match = cls._FREQSTR_REGEX.match(freqstr)
if match is None:
raise ValueError(f"Invalid frequency ... | [
"def",
"_from_freqstr",
"(",
"cls",
":",
"Type",
"[",
"_T",
"]",
",",
"freqstr",
":",
"str",
")",
"->",
"_T",
":",
"match",
"=",
"cls",
".",
"_FREQSTR_REGEX",
".",
"match",
"(",
"freqstr",
")",
"if",
"match",
"is",
"None",
":",
"raise",
"ValueError",... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/tools/datetimes.py#L644-L662 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dis.py | python | dis | (x=None) | Disassemble classes, methods, functions, or code.
With no argument, disassemble the last traceback. | Disassemble classes, methods, functions, or code. | [
"Disassemble",
"classes",
"methods",
"functions",
"or",
"code",
"."
] | def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argument, disassemble the last traceback.
"""
if x is None:
distb()
return
if isinstance(x, types.InstanceType):
x = x.__class__
if hasattr(x, 'im_func'):
x = x.im_func
if hasattr(... | [
"def",
"dis",
"(",
"x",
"=",
"None",
")",
":",
"if",
"x",
"is",
"None",
":",
"distb",
"(",
")",
"return",
"if",
"isinstance",
"(",
"x",
",",
"types",
".",
"InstanceType",
")",
":",
"x",
"=",
"x",
".",
"__class__",
"if",
"hasattr",
"(",
"x",
","... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dis.py#L16-L49 | ||
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | scripts/cpp_lint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L797-L807 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/distutils/ccompiler.py | python | _needs_build | (obj, cc_args, extra_postargs, pp_opts) | return False | Check if an objects needs to be rebuild based on its dependencies
Parameters
----------
obj : str
object file
Returns
-------
bool | Check if an objects needs to be rebuild based on its dependencies | [
"Check",
"if",
"an",
"objects",
"needs",
"to",
"be",
"rebuild",
"based",
"on",
"its",
"dependencies"
] | def _needs_build(obj, cc_args, extra_postargs, pp_opts):
"""
Check if an objects needs to be rebuild based on its dependencies
Parameters
----------
obj : str
object file
Returns
-------
bool
"""
# defined in unixcompiler.py
dep_file = obj + '.d'
if not os.path.... | [
"def",
"_needs_build",
"(",
"obj",
",",
"cc_args",
",",
"extra_postargs",
",",
"pp_opts",
")",
":",
"# defined in unixcompiler.py",
"dep_file",
"=",
"obj",
"+",
"'.d'",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"dep_file",
")",
":",
"return",
"Tr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/ccompiler.py#L37-L84 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/wishart.py | python | _WishartLinearOperator.scale_operator | (self) | return self._scale_operator | Wishart distribution scale matrix as an Linear Operator. | Wishart distribution scale matrix as an Linear Operator. | [
"Wishart",
"distribution",
"scale",
"matrix",
"as",
"an",
"Linear",
"Operator",
"."
] | def scale_operator(self):
"""Wishart distribution scale matrix as an Linear Operator."""
return self._scale_operator | [
"def",
"scale_operator",
"(",
"self",
")",
":",
"return",
"self",
".",
"_scale_operator"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/wishart.py#L194-L196 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.DocLineFromVisible | (*args, **kwargs) | return _stc.StyledTextCtrl_DocLineFromVisible(*args, **kwargs) | DocLineFromVisible(self, int lineDisplay) -> int
Find the document line of a display line taking hidden lines into account. | DocLineFromVisible(self, int lineDisplay) -> int | [
"DocLineFromVisible",
"(",
"self",
"int",
"lineDisplay",
")",
"-",
">",
"int"
] | def DocLineFromVisible(*args, **kwargs):
"""
DocLineFromVisible(self, int lineDisplay) -> int
Find the document line of a display line taking hidden lines into account.
"""
return _stc.StyledTextCtrl_DocLineFromVisible(*args, **kwargs) | [
"def",
"DocLineFromVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_DocLineFromVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3880-L3886 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/network/networkxtools.py | python | Primary.get_priority | (self, is_opp=False) | Returns priority of road.
To be overridden. | Returns priority of road. | [
"Returns",
"priority",
"of",
"road",
"."
] | def get_priority(self, is_opp=False):
"""
Returns priority of road.
To be overridden.
"""
if is_opp:
lanes = self._lanes_opp
else:
lanes = self._lanes
speed_max = self.get_speed_max()
n_lane = len(lanes)
# is_residential =... | [
"def",
"get_priority",
"(",
"self",
",",
"is_opp",
"=",
"False",
")",
":",
"if",
"is_opp",
":",
"lanes",
"=",
"self",
".",
"_lanes_opp",
"else",
":",
"lanes",
"=",
"self",
".",
"_lanes",
"speed_max",
"=",
"self",
".",
"get_speed_max",
"(",
")",
"n_lane... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/network/networkxtools.py#L1717-L1753 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py | python | _singlefileMailbox.add | (self, message) | return self._next_key - 1 | Add message and return assigned key. | Add message and return assigned key. | [
"Add",
"message",
"and",
"return",
"assigned",
"key",
"."
] | def add(self, message):
"""Add message and return assigned key."""
self._lookup()
self._toc[self._next_key] = self._append_message(message)
self._next_key += 1
# _append_message appends the message to the mailbox file. We
# don't need a full rewrite + rename, sync is enou... | [
"def",
"add",
"(",
"self",
",",
"message",
")",
":",
"self",
".",
"_lookup",
"(",
")",
"self",
".",
"_toc",
"[",
"self",
".",
"_next_key",
"]",
"=",
"self",
".",
"_append_message",
"(",
"message",
")",
"self",
".",
"_next_key",
"+=",
"1",
"# _append_... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L584-L592 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/function_base.py | python | geomspace | (start, stop, num=50, endpoint=True, dtype=None, axis=0) | return result.astype(dtype, copy=False) | Return numbers spaced evenly on a log scale (a geometric progression).
This is similar to `logspace`, but with endpoints specified directly.
Each output sample is a constant multiple of the previous.
.. versionchanged:: 1.16.0
Non-scalar `start` and `stop` are now supported.
Parameters
--... | Return numbers spaced evenly on a log scale (a geometric progression). | [
"Return",
"numbers",
"spaced",
"evenly",
"on",
"a",
"log",
"scale",
"(",
"a",
"geometric",
"progression",
")",
"."
] | def geomspace(start, stop, num=50, endpoint=True, dtype=None, axis=0):
"""
Return numbers spaced evenly on a log scale (a geometric progression).
This is similar to `logspace`, but with endpoints specified directly.
Each output sample is a constant multiple of the previous.
.. versionchanged:: 1.1... | [
"def",
"geomspace",
"(",
"start",
",",
"stop",
",",
"num",
"=",
"50",
",",
"endpoint",
"=",
"True",
",",
"dtype",
"=",
"None",
",",
"axis",
"=",
"0",
")",
":",
"start",
"=",
"asanyarray",
"(",
"start",
")",
"stop",
"=",
"asanyarray",
"(",
"stop",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/function_base.py#L289-L427 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py | python | Standard_Suite_Events.quit | (self, _object, _attributes={}, **_arguments) | quit: Quit an application.
Required argument: the object for the command
Keyword argument saving: Specifies whether changes should be saved before quitting.
Keyword argument _attributes: AppleEvent attribute dictionary | quit: Quit an application.
Required argument: the object for the command
Keyword argument saving: Specifies whether changes should be saved before quitting.
Keyword argument _attributes: AppleEvent attribute dictionary | [
"quit",
":",
"Quit",
"an",
"application",
".",
"Required",
"argument",
":",
"the",
"object",
"for",
"the",
"command",
"Keyword",
"argument",
"saving",
":",
"Specifies",
"whether",
"changes",
"should",
"be",
"saved",
"before",
"quitting",
".",
"Keyword",
"argum... | def quit(self, _object, _attributes={}, **_arguments):
"""quit: Quit an application.
Required argument: the object for the command
Keyword argument saving: Specifies whether changes should be saved before quitting.
Keyword argument _attributes: AppleEvent attribute dictionary
"""... | [
"def",
"quit",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'aevt'",
"_subcode",
"=",
"'quit'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_quit",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py#L258-L278 | ||
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/data2d.py | python | info | () | return d.info() | Print info on 2D objects in memory. | Print info on 2D objects in memory. | [
"Print",
"info",
"on",
"2D",
"objects",
"in",
"memory",
"."
] | def info():
"""Print info on 2D objects in memory."""
return d.info() | [
"def",
"info",
"(",
")",
":",
"return",
"d",
".",
"info",
"(",
")"
] | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/data2d.py#L136-L138 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/animate.py | python | Animation.GetTransparentColour | (*args, **kwargs) | return _animate.Animation_GetTransparentColour(*args, **kwargs) | GetTransparentColour(self, int frame) -> Colour | GetTransparentColour(self, int frame) -> Colour | [
"GetTransparentColour",
"(",
"self",
"int",
"frame",
")",
"-",
">",
"Colour"
] | def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, int frame) -> Colour"""
return _animate.Animation_GetTransparentColour(*args, **kwargs) | [
"def",
"GetTransparentColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_animate",
".",
"Animation_GetTransparentColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/animate.py#L134-L136 | |
AcademySoftwareFoundation/OpenColorIO | 73508eb5230374df8d96147a0627c015d359a641 | share/nuke/ocionuke/cdl.py | python | export_multiple_to_ccc | (filename = None) | Exported all selected OCIOCDLTransform nodes to a
ColorCorrectionCollection XML file (.ccc) | Exported all selected OCIOCDLTransform nodes to a
ColorCorrectionCollection XML file (.ccc) | [
"Exported",
"all",
"selected",
"OCIOCDLTransform",
"nodes",
"to",
"a",
"ColorCorrectionCollection",
"XML",
"file",
"(",
".",
"ccc",
")"
] | def export_multiple_to_ccc(filename = None):
"""Exported all selected OCIOCDLTransform nodes to a
ColorCorrectionCollection XML file (.ccc)
"""
if filename is None:
filename = nuke.getFilename("Color Correction XML file", pattern = "*.cc *.ccc")
if filename is None:
# User c... | [
"def",
"export_multiple_to_ccc",
"(",
"filename",
"=",
"None",
")",
":",
"if",
"filename",
"is",
"None",
":",
"filename",
"=",
"nuke",
".",
"getFilename",
"(",
"\"Color Correction XML file\"",
",",
"pattern",
"=",
"\"*.cc *.ccc\"",
")",
"if",
"filename",
"is",
... | https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/73508eb5230374df8d96147a0627c015d359a641/share/nuke/ocionuke/cdl.py#L218-L235 | ||
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/tools/extra/parse_log.py | python | write_csv | (output_filename, dict_list, delimiter, verbose=False) | Write a CSV file | Write a CSV file | [
"Write",
"a",
"CSV",
"file"
] | def write_csv(output_filename, dict_list, delimiter, verbose=False):
"""Write a CSV file
"""
if not dict_list:
if verbose:
print('Not writing %s; no lines to write' % output_filename)
return
dialect = csv.excel
dialect.delimiter = delimiter
with open(output_filenam... | [
"def",
"write_csv",
"(",
"output_filename",
",",
"dict_list",
",",
"delimiter",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"dict_list",
":",
"if",
"verbose",
":",
"print",
"(",
"'Not writing %s; no lines to write'",
"%",
"output_filename",
")",
"return... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/tools/extra/parse_log.py#L145-L163 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/variables.py | python | Variable.scatter_sub | (self, sparse_delta, use_locking=False) | return state_ops.scatter_sub(
self._variable,
sparse_delta.indices,
sparse_delta.values,
use_locking=use_locking) | Subtracts `IndexedSlices` from this variable.
This is essentially a shortcut for `scatter_sub(self, sparse_delta.indices,
sparse_delta.values)`.
Args:
sparse_delta: `IndexedSlices` to be subtracted from this variable.
use_locking: If `True`, use locking during the operation.
Returns:
... | Subtracts `IndexedSlices` from this variable. | [
"Subtracts",
"IndexedSlices",
"from",
"this",
"variable",
"."
] | def scatter_sub(self, sparse_delta, use_locking=False):
"""Subtracts `IndexedSlices` from this variable.
This is essentially a shortcut for `scatter_sub(self, sparse_delta.indices,
sparse_delta.values)`.
Args:
sparse_delta: `IndexedSlices` to be subtracted from this variable.
use_locking: ... | [
"def",
"scatter_sub",
"(",
"self",
",",
"sparse_delta",
",",
"use_locking",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"sparse_delta",
",",
"ops",
".",
"IndexedSlices",
")",
":",
"raise",
"ValueError",
"(",
"\"sparse_delta is not IndexedSlices: %s\"",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L559-L582 | |
openalpr/openalpr | 736ab0e608cf9b20d92f36a873bb1152240daa98 | src/bindings/python/openalpr/openalpr.py | python | Alpr.set_prewarp | (self, prewarp) | Updates the prewarp configuration used to skew images in OpenALPR before
processing.
:param prewarp: A unicode/ascii string (Python 2/3) or bytes array (Python 3)
:return: None | Updates the prewarp configuration used to skew images in OpenALPR before
processing. | [
"Updates",
"the",
"prewarp",
"configuration",
"used",
"to",
"skew",
"images",
"in",
"OpenALPR",
"before",
"processing",
"."
] | def set_prewarp(self, prewarp):
"""
Updates the prewarp configuration used to skew images in OpenALPR before
processing.
:param prewarp: A unicode/ascii string (Python 2/3) or bytes array (Python 3)
:return: None
"""
prewarp = _convert_to_charp(prewarp)
s... | [
"def",
"set_prewarp",
"(",
"self",
",",
"prewarp",
")",
":",
"prewarp",
"=",
"_convert_to_charp",
"(",
"prewarp",
")",
"self",
".",
"_set_prewarp_func",
"(",
"self",
".",
"alpr_pointer",
",",
"prewarp",
")"
] | https://github.com/openalpr/openalpr/blob/736ab0e608cf9b20d92f36a873bb1152240daa98/src/bindings/python/openalpr/openalpr.py#L225-L234 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py | python | CCompiler_spawn | (self, cmd, display=None) | Execute a command in a sub-process.
Parameters
----------
cmd : str
The command to execute.
display : str or sequence of str, optional
The text to add to the log file kept by `numpy.distutils`.
If not given, `display` is equal to `cmd`.
Returns
-------
None
Rai... | Execute a command in a sub-process. | [
"Execute",
"a",
"command",
"in",
"a",
"sub",
"-",
"process",
"."
] | def CCompiler_spawn(self, cmd, display=None):
"""
Execute a command in a sub-process.
Parameters
----------
cmd : str
The command to execute.
display : str or sequence of str, optional
The text to add to the log file kept by `numpy.distutils`.
If not given, `display` is ... | [
"def",
"CCompiler_spawn",
"(",
"self",
",",
"cmd",
",",
"display",
"=",
"None",
")",
":",
"if",
"display",
"is",
"None",
":",
"display",
"=",
"cmd",
"if",
"is_sequence",
"(",
"display",
")",
":",
"display",
"=",
"' '",
".",
"join",
"(",
"list",
"(",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py#L32-L72 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/server_lib.py | python | ClusterSpec.as_cluster_def | (self) | return self._cluster_def | Returns a `tf.train.ClusterDef` protocol buffer based on this cluster. | Returns a `tf.train.ClusterDef` protocol buffer based on this cluster. | [
"Returns",
"a",
"tf",
".",
"train",
".",
"ClusterDef",
"protocol",
"buffer",
"based",
"on",
"this",
"cluster",
"."
] | def as_cluster_def(self):
"""Returns a `tf.train.ClusterDef` protocol buffer based on this cluster."""
return self._cluster_def | [
"def",
"as_cluster_def",
"(",
"self",
")",
":",
"return",
"self",
".",
"_cluster_def"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/server_lib.py#L344-L346 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | tf/edgeml_tf/trainer/emirnnTrainer.py | python | EMI_Driver.assignToGraph | (self, initVarList) | This method should deal with restoring the entire graph
now | This method should deal with restoring the entire graph
now | [
"This",
"method",
"should",
"deal",
"with",
"restoring",
"the",
"entire",
"graph",
"now"
] | def assignToGraph(self, initVarList):
'''
This method should deal with restoring the entire graph
now'''
raise NotImplementedError() | [
"def",
"assignToGraph",
"(",
"self",
",",
"initVarList",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/trainer/emirnnTrainer.py#L341-L345 | ||
xapian/xapian | 2b803ea5e3904a6e0cd7d111b2ff38a704c21041 | xapian-maintainer-tools/buildbot/scripts/get_tarballs.py | python | get_archive_links | (url, archives) | return links | Get the links to the archive files. | Get the links to the archive files. | [
"Get",
"the",
"links",
"to",
"the",
"archive",
"files",
"."
] | def get_archive_links(url, archives):
"""Get the links to the archive files.
"""
print("Getting links from '%s'" % url)
fd = u.urlopen(url)
html = fd.read()
fd.close()
max_revision, links = parsehtml(html, archives)
return links | [
"def",
"get_archive_links",
"(",
"url",
",",
"archives",
")",
":",
"print",
"(",
"\"Getting links from '%s'\"",
"%",
"url",
")",
"fd",
"=",
"u",
".",
"urlopen",
"(",
"url",
")",
"html",
"=",
"fd",
".",
"read",
"(",
")",
"fd",
".",
"close",
"(",
")",
... | https://github.com/xapian/xapian/blob/2b803ea5e3904a6e0cd7d111b2ff38a704c21041/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py#L63-L72 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/platform.py | python | node | () | return uname().node | Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined. | Returns the computer's network name (which may not be fully
qualified) | [
"Returns",
"the",
"computer",
"s",
"network",
"name",
"(",
"which",
"may",
"not",
"be",
"fully",
"qualified",
")"
] | def node():
""" Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined.
"""
return uname().node | [
"def",
"node",
"(",
")",
":",
"return",
"uname",
"(",
")",
".",
"node"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/platform.py#L1070-L1078 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/policy_utils.py | python | policy_to_dict | (player_policy,
game,
all_states=None,
state_to_information_state=None) | return tabular_policy | Converts a Policy instance into a tabular policy represented as a dict.
This is compatible with the C++ TabularExploitability code (i.e.
pyspiel.exploitability, pyspiel.TabularBestResponse, etc.).
While you do not have to pass the all_states and state_to_information_state
arguments, creating them outside of t... | Converts a Policy instance into a tabular policy represented as a dict. | [
"Converts",
"a",
"Policy",
"instance",
"into",
"a",
"tabular",
"policy",
"represented",
"as",
"a",
"dict",
"."
] | def policy_to_dict(player_policy,
game,
all_states=None,
state_to_information_state=None):
"""Converts a Policy instance into a tabular policy represented as a dict.
This is compatible with the C++ TabularExploitability code (i.e.
pyspiel.exploitability, p... | [
"def",
"policy_to_dict",
"(",
"player_policy",
",",
"game",
",",
"all_states",
"=",
"None",
",",
"state_to_information_state",
"=",
"None",
")",
":",
"if",
"all_states",
"is",
"None",
":",
"all_states",
"=",
"get_all_states",
".",
"get_all_states",
"(",
"game",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/policy_utils.py#L20-L61 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tpu/python/tpu/tpu.py | python | outside_all_rewrites | () | Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.). | Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.). | [
"Experimental",
"API",
"to",
"break",
"out",
"of",
"a",
"tpu",
".",
"rewrite",
"()",
"(",
"or",
"shard",
"()",
"etc",
".",
")",
"."
] | def outside_all_rewrites():
"""Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.)."""
with ops.control_dependencies(None):
yield | [
"def",
"outside_all_rewrites",
"(",
")",
":",
"with",
"ops",
".",
"control_dependencies",
"(",
"None",
")",
":",
"yield"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tpu/python/tpu/tpu.py#L98-L101 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._get_displacement_field_prefix | (self) | return prefix | Return the prefix of the displacement field.
If no displacement field exists, this will return the default prefix. | Return the prefix of the displacement field. | [
"Return",
"the",
"prefix",
"of",
"the",
"displacement",
"field",
"."
] | def _get_displacement_field_prefix(self):
"""
Return the prefix of the displacement field.
If no displacement field exists, this will return the default prefix.
"""
prefix = 'disp'
for node_field_name in self.get_node_field_names():
# if it doesn't end in "_... | [
"def",
"_get_displacement_field_prefix",
"(",
"self",
")",
":",
"prefix",
"=",
"'disp'",
"for",
"node_field_name",
"in",
"self",
".",
"get_node_field_names",
"(",
")",
":",
"# if it doesn't end in \"_x\", it's not a prefix",
"if",
"len",
"(",
"node_field_name",
")",
"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L1275-L1291 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | FileSystemHandler.GetLeftLocation | (*args, **kwargs) | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | GetLeftLocation(String location) -> String | GetLeftLocation(String location) -> String | [
"GetLeftLocation",
"(",
"String",
"location",
")",
"-",
">",
"String"
] | def GetLeftLocation(*args, **kwargs):
"""GetLeftLocation(String location) -> String"""
return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | [
"def",
"GetLeftLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystemHandler_GetLeftLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2365-L2367 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | StandardPaths.GetExecutablePath | (*args, **kwargs) | return _misc_.StandardPaths_GetExecutablePath(*args, **kwargs) | GetExecutablePath(self) -> String
Return the path (directory+filename) of the running executable or an
empty string if it couldn't be determined. The path is returned as an
absolute path whenever possible. | GetExecutablePath(self) -> String | [
"GetExecutablePath",
"(",
"self",
")",
"-",
">",
"String"
] | def GetExecutablePath(*args, **kwargs):
"""
GetExecutablePath(self) -> String
Return the path (directory+filename) of the running executable or an
empty string if it couldn't be determined. The path is returned as an
absolute path whenever possible.
"""
return _... | [
"def",
"GetExecutablePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StandardPaths_GetExecutablePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6299-L6307 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | parserCtxt.parserHandleReference | (self) | TODO: Remove, now deprecated ... the test is done directly
in the content parsing routines. [67] Reference ::=
EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [
WFC: Entity Declared ] the Name given in the entity
reference must match that in an entity declaration, except
... | TODO: Remove, now deprecated ... the test is done directly
in the content parsing routines. [67] Reference ::=
EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [
WFC: Entity Declared ] the Name given in the entity
reference must match that in an entity declaration, except
... | [
"TODO",
":",
"Remove",
"now",
"deprecated",
"...",
"the",
"test",
"is",
"done",
"directly",
"in",
"the",
"content",
"parsing",
"routines",
".",
"[",
"67",
"]",
"Reference",
"::",
"=",
"EntityRef",
"|",
"CharRef",
"[",
"68",
"]",
"EntityRef",
"::",
"=",
... | def parserHandleReference(self):
"""TODO: Remove, now deprecated ... the test is done directly
in the content parsing routines. [67] Reference ::=
EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [
WFC: Entity Declared ] the Name given in the entity
reference must m... | [
"def",
"parserHandleReference",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlParserHandleReference",
"(",
"self",
".",
"_o",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L5507-L5520 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosmaster/src/rosmaster/master_api.py | python | ROSMasterHandler._notify | (self, registrations, task, key, value, node_apis) | Generic implementation of callback notification
@param registrations: Registrations
@type registrations: L{Registrations}
@param task: task to queue
@type task: fn
@param key: registration key
@type key: str
@param value: value to pass to task
@type va... | Generic implementation of callback notification | [
"Generic",
"implementation",
"of",
"callback",
"notification"
] | def _notify(self, registrations, task, key, value, node_apis):
"""
Generic implementation of callback notification
@param registrations: Registrations
@type registrations: L{Registrations}
@param task: task to queue
@type task: fn
@param key: registration key
... | [
"def",
"_notify",
"(",
"self",
",",
"registrations",
",",
"task",
",",
"key",
",",
"value",
",",
"node_apis",
")",
":",
"# cache thread_pool for thread safety",
"thread_pool",
"=",
"self",
".",
"thread_pool",
"if",
"not",
"thread_pool",
":",
"return",
"try",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmaster/src/rosmaster/master_api.py#L515-L537 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py | python | to_bfloat16 | (x, name="ToBFloat16") | return cast(x, dtypes.bfloat16, name=name) | Casts a tensor to type `bfloat16`.
Args:
x: A `Tensor` or `SparseTensor` or `IndexedSlices`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with
type `bfloat16`.
Raises:
TypeError: If `x` cannot be cast to the `bflo... | Casts a tensor to type `bfloat16`. | [
"Casts",
"a",
"tensor",
"to",
"type",
"bfloat16",
"."
] | def to_bfloat16(x, name="ToBFloat16"):
"""Casts a tensor to type `bfloat16`.
Args:
x: A `Tensor` or `SparseTensor` or `IndexedSlices`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with
type `bfloat16`.
Raises:
T... | [
"def",
"to_bfloat16",
"(",
"x",
",",
"name",
"=",
"\"ToBFloat16\"",
")",
":",
"return",
"cast",
"(",
"x",
",",
"dtypes",
".",
"bfloat16",
",",
"name",
"=",
"name",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L821-L835 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Blob.py | python | Blob.asarray | (self, copy=False) | return np.array(cpu_blob._internal, copy=False) | Returns the contents of the blob as a multi-dimensional array,
keeping only those dimensions that are more than 1 element long.
If all dimensions are 1, the blob will be a one-element array.
:param copy: if `True`, the data will be copied. If `False`, the array may share
the memory... | Returns the contents of the blob as a multi-dimensional array,
keeping only those dimensions that are more than 1 element long.
If all dimensions are 1, the blob will be a one-element array. | [
"Returns",
"the",
"contents",
"of",
"the",
"blob",
"as",
"a",
"multi",
"-",
"dimensional",
"array",
"keeping",
"only",
"those",
"dimensions",
"that",
"are",
"more",
"than",
"1",
"element",
"long",
".",
"If",
"all",
"dimensions",
"are",
"1",
"the",
"blob",
... | def asarray(self, copy=False):
"""Returns the contents of the blob as a multi-dimensional array,
keeping only those dimensions that are more than 1 element long.
If all dimensions are 1, the blob will be a one-element array.
:param copy: if `True`, the data will be copied. If `False`, ... | [
"def",
"asarray",
"(",
"self",
",",
"copy",
"=",
"False",
")",
":",
"if",
"type",
"(",
"self",
".",
"math_engine",
")",
"is",
"MathEngine",
".",
"CpuMathEngine",
":",
"return",
"np",
".",
"array",
"(",
"self",
".",
"_internal",
",",
"copy",
"=",
"cop... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Blob.py#L109-L123 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/base/Preferences.py | python | Preferences.addInt | (self, name, caption, default, min_val, max_val, tooltip) | Convenience function to add an integer preference. | Convenience function to add an integer preference. | [
"Convenience",
"function",
"to",
"add",
"an",
"integer",
"preference",
"."
] | def addInt(self, name, caption, default, min_val, max_val, tooltip):
"""
Convenience function to add an integer preference.
"""
self.addWidget(IntPreferenceWidget(name, caption, default, min_val, max_val, tooltip, self._key)) | [
"def",
"addInt",
"(",
"self",
",",
"name",
",",
"caption",
",",
"default",
",",
"min_val",
",",
"max_val",
",",
"tooltip",
")",
":",
"self",
".",
"addWidget",
"(",
"IntPreferenceWidget",
"(",
"name",
",",
"caption",
",",
"default",
",",
"min_val",
",",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/Preferences.py#L195-L199 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/hooks.py | python | Hooks.enqueue_done_task | (self, task, queue_name) | Enqueues a task that is triggered when the mapreduce completes.
This hook will be called within a transaction scope.
Hook should add task transactionally.
Args:
task: A taskqueue.Task that must be queued in order for the client to be
notified when the mapreduce is complete.
queue_name:... | Enqueues a task that is triggered when the mapreduce completes. | [
"Enqueues",
"a",
"task",
"that",
"is",
"triggered",
"when",
"the",
"mapreduce",
"completes",
"."
] | def enqueue_done_task(self, task, queue_name):
"""Enqueues a task that is triggered when the mapreduce completes.
This hook will be called within a transaction scope.
Hook should add task transactionally.
Args:
task: A taskqueue.Task that must be queued in order for the client to be
noti... | [
"def",
"enqueue_done_task",
"(",
"self",
",",
"task",
",",
"queue_name",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/hooks.py#L70-L85 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/series.py | python | _append_new_row_inplace | (col: ColumnLike, value: ScalarLike) | Append a scalar `value` to the end of `col` inplace.
Cast to common type if possible | Append a scalar `value` to the end of `col` inplace.
Cast to common type if possible | [
"Append",
"a",
"scalar",
"value",
"to",
"the",
"end",
"of",
"col",
"inplace",
".",
"Cast",
"to",
"common",
"type",
"if",
"possible"
] | def _append_new_row_inplace(col: ColumnLike, value: ScalarLike):
"""Append a scalar `value` to the end of `col` inplace.
Cast to common type if possible
"""
to_type = find_common_type([type(value), col.dtype])
val_col = as_column(value, dtype=to_type)
old_col = col.astype(to_type)
col._mimi... | [
"def",
"_append_new_row_inplace",
"(",
"col",
":",
"ColumnLike",
",",
"value",
":",
"ScalarLike",
")",
":",
"to_type",
"=",
"find_common_type",
"(",
"[",
"type",
"(",
"value",
")",
",",
"col",
".",
"dtype",
"]",
")",
"val_col",
"=",
"as_column",
"(",
"va... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/series.py#L86-L94 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/lib2to3/fixer_base.py | python | BaseFix.new_name | (self, template="xxx_todo_changeme") | return name | Return a string suitable for use as an identifier
The new name is guaranteed not to conflict with other identifiers. | Return a string suitable for use as an identifier | [
"Return",
"a",
"string",
"suitable",
"for",
"use",
"as",
"an",
"identifier"
] | def new_name(self, template="xxx_todo_changeme"):
"""Return a string suitable for use as an identifier
The new name is guaranteed not to conflict with other identifiers.
"""
name = template
while name in self.used_names:
name = template + str(next(self.numbers))
... | [
"def",
"new_name",
"(",
"self",
",",
"template",
"=",
"\"xxx_todo_changeme\"",
")",
":",
"name",
"=",
"template",
"while",
"name",
"in",
"self",
".",
"used_names",
":",
"name",
"=",
"template",
"+",
"str",
"(",
"next",
"(",
"self",
".",
"numbers",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/fixer_base.py#L105-L114 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListBox.HitTest | (*args, **kwargs) | return _controls_.ListBox_HitTest(*args, **kwargs) | HitTest(self, Point pt) -> int
Test where the given (in client coords) point lies | HitTest(self, Point pt) -> int | [
"HitTest",
"(",
"self",
"Point",
"pt",
")",
"-",
">",
"int"
] | def HitTest(*args, **kwargs):
"""
HitTest(self, Point pt) -> int
Test where the given (in client coords) point lies
"""
return _controls_.ListBox_HitTest(*args, **kwargs) | [
"def",
"HitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListBox_HitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1237-L1243 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlLinkInfo.GetEvent | (*args, **kwargs) | return _html.HtmlLinkInfo_GetEvent(*args, **kwargs) | GetEvent(self) -> MouseEvent | GetEvent(self) -> MouseEvent | [
"GetEvent",
"(",
"self",
")",
"-",
">",
"MouseEvent"
] | def GetEvent(*args, **kwargs):
"""GetEvent(self) -> MouseEvent"""
return _html.HtmlLinkInfo_GetEvent(*args, **kwargs) | [
"def",
"GetEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlLinkInfo_GetEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L110-L112 | |
ComputationalRadiationPhysics/picongpu | 59e9b53605f9a5c1bf271eeb055bc74370a99052 | lib/python/picongpu/plugins/data/phase_space.py | python | PhaseSpaceData.get_iterations | (self, ps, species, species_filter='all',
file_ext="h5") | return iterations | Return an array of iterations with available data.
Parameters
----------
ps : string
phase space selection in order: spatial, momentum component,
e.g. 'ypy' or 'ypx'
species : string
short name of the particle species, e.g. 'e' for electrons
... | Return an array of iterations with available data. | [
"Return",
"an",
"array",
"of",
"iterations",
"with",
"available",
"data",
"."
] | def get_iterations(self, ps, species, species_filter='all',
file_ext="h5"):
"""
Return an array of iterations with available data.
Parameters
----------
ps : string
phase space selection in order: spatial, momentum component,
e.g. '... | [
"def",
"get_iterations",
"(",
"self",
",",
"ps",
",",
"species",
",",
"species_filter",
"=",
"'all'",
",",
"file_ext",
"=",
"\"h5\"",
")",
":",
"# get the regular expression matching all available files",
"data_file_path",
"=",
"self",
".",
"get_data_path",
"(",
"ps... | https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/data/phase_space.py#L129-L160 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py | python | capture_warnings | (capture) | Replace warning.showwarning with idle_showwarning, or reverse. | Replace warning.showwarning with idle_showwarning, or reverse. | [
"Replace",
"warning",
".",
"showwarning",
"with",
"idle_showwarning",
"or",
"reverse",
"."
] | def capture_warnings(capture):
"Replace warning.showwarning with idle_showwarning, or reverse."
global _warnings_showwarning
if capture:
if _warnings_showwarning is None:
_warnings_showwarning = warnings.showwarning
warnings.showwarning = idle_showwarning
else:
i... | [
"def",
"capture_warnings",
"(",
"capture",
")",
":",
"global",
"_warnings_showwarning",
"if",
"capture",
":",
"if",
"_warnings_showwarning",
"is",
"None",
":",
"_warnings_showwarning",
"=",
"warnings",
".",
"showwarning",
"warnings",
".",
"showwarning",
"=",
"idle_s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py#L88-L99 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/io/matlab/miobase.py | python | read_dtype | (mat_stream, a_dtype) | return arr | Generic get of byte stream data of known type
Parameters
----------
mat_stream : file_like object
MATLAB (tm) mat file stream
a_dtype : dtype
dtype of array to read. `a_dtype` is assumed to be correct
endianness.
Returns
-------
arr : ndarray
Array of dtype... | Generic get of byte stream data of known type | [
"Generic",
"get",
"of",
"byte",
"stream",
"data",
"of",
"known",
"type"
] | def read_dtype(mat_stream, a_dtype):
"""
Generic get of byte stream data of known type
Parameters
----------
mat_stream : file_like object
MATLAB (tm) mat file stream
a_dtype : dtype
dtype of array to read. `a_dtype` is assumed to be correct
endianness.
Returns
... | [
"def",
"read_dtype",
"(",
"mat_stream",
",",
"a_dtype",
")",
":",
"num_bytes",
"=",
"a_dtype",
".",
"itemsize",
"arr",
"=",
"np",
".",
"ndarray",
"(",
"shape",
"=",
"(",
")",
",",
"dtype",
"=",
"a_dtype",
",",
"buffer",
"=",
"mat_stream",
".",
"read",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/matlab/miobase.py#L161-L184 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp2/ctptd.py | python | CtpTd.onRspTradingAccountPasswordUpdate | (self, TradingAccountPasswordUpdateField, RspInfoField, requestId, final) | 资金账户口令更新请求响应 | 资金账户口令更新请求响应 | [
"资金账户口令更新请求响应"
] | def onRspTradingAccountPasswordUpdate(self, TradingAccountPasswordUpdateField, RspInfoField, requestId, final):
"""资金账户口令更新请求响应"""
pass | [
"def",
"onRspTradingAccountPasswordUpdate",
"(",
"self",
",",
"TradingAccountPasswordUpdateField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp2/ctptd.py#L89-L91 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/adapters.py | python | HTTPAdapter.init_poolmanager | (self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs) | Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param connections: The number of urllib3 connection pools to cache.
:param maxsize: The ma... | Initializes a urllib3 PoolManager. | [
"Initializes",
"a",
"urllib3",
"PoolManager",
"."
] | def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs):
"""Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
... | [
"def",
"init_poolmanager",
"(",
"self",
",",
"connections",
",",
"maxsize",
",",
"block",
"=",
"DEFAULT_POOLBLOCK",
",",
"*",
"*",
"pool_kwargs",
")",
":",
"# save these values for pickling",
"self",
".",
"_pool_connections",
"=",
"connections",
"self",
".",
"_poo... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/adapters.py#L116-L134 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/models/image/alexnet/alexnet_benchmark.py | python | run_benchmark | () | Run the benchmark on AlexNet. | Run the benchmark on AlexNet. | [
"Run",
"the",
"benchmark",
"on",
"AlexNet",
"."
] | def run_benchmark():
"""Run the benchmark on AlexNet."""
with tf.Graph().as_default():
# Generate some dummy images.
image_size = 224
# Note that our padding definition is slightly different the cuda-convnet.
# In order to force the model to start with the same activations sizes,
# we add 3 to t... | [
"def",
"run_benchmark",
"(",
")",
":",
"with",
"tf",
".",
"Graph",
"(",
")",
".",
"as_default",
"(",
")",
":",
"# Generate some dummy images.",
"image_size",
"=",
"224",
"# Note that our padding definition is slightly different the cuda-convnet.",
"# In order to force the m... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/image/alexnet/alexnet_benchmark.py#L188-L223 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.Yield | (*args, **kwargs) | return _core_.PyApp_Yield(*args, **kwargs) | Yield(self, bool onlyIfNeeded=False) -> bool
Process all currently pending events right now, instead of waiting
until return to the event loop. It is an error to call ``Yield``
recursively unless the value of ``onlyIfNeeded`` is True.
:warning: This function is dangerous as it can lea... | Yield(self, bool onlyIfNeeded=False) -> bool | [
"Yield",
"(",
"self",
"bool",
"onlyIfNeeded",
"=",
"False",
")",
"-",
">",
"bool"
] | def Yield(*args, **kwargs):
"""
Yield(self, bool onlyIfNeeded=False) -> bool
Process all currently pending events right now, instead of waiting
until return to the event loop. It is an error to call ``Yield``
recursively unless the value of ``onlyIfNeeded`` is True.
:w... | [
"def",
"Yield",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_Yield",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7900-L7916 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/PyShell.py | python | ModifiedInterpreter.showsyntaxerror | (self, filename=None) | Extend base class method: Add Colorizing
Color the offending position instead of printing it and pointing at it
with a caret. | Extend base class method: Add Colorizing | [
"Extend",
"base",
"class",
"method",
":",
"Add",
"Colorizing"
] | def showsyntaxerror(self, filename=None):
"""Extend base class method: Add Colorizing
Color the offending position instead of printing it and pointing at it
with a caret.
"""
text = self.tkconsole.text
stuff = self.unpackerror()
if stuff:
msg, lineno... | [
"def",
"showsyntaxerror",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"text",
"=",
"self",
".",
"tkconsole",
".",
"text",
"stuff",
"=",
"self",
".",
"unpackerror",
"(",
")",
"if",
"stuff",
":",
"msg",
",",
"lineno",
",",
"offset",
",",
"line... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/PyShell.py#L709-L735 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/metric.py | python | EvalMetric.get_config | (self) | return config | Save configurations of metric. Can be recreated
from configs with metric.create(``**config``) | Save configurations of metric. Can be recreated
from configs with metric.create(``**config``) | [
"Save",
"configurations",
"of",
"metric",
".",
"Can",
"be",
"recreated",
"from",
"configs",
"with",
"metric",
".",
"create",
"(",
"**",
"config",
")"
] | def get_config(self):
"""Save configurations of metric. Can be recreated
from configs with metric.create(``**config``)
"""
config = self._kwargs.copy()
config.update({
'metric': self.__class__.__name__,
'name': self.name,
'output_names': self.o... | [
"def",
"get_config",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"_kwargs",
".",
"copy",
"(",
")",
"config",
".",
"update",
"(",
"{",
"'metric'",
":",
"self",
".",
"__class__",
".",
"__name__",
",",
"'name'",
":",
"self",
".",
"name",
",",
"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/metric.py#L99-L109 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGArrayStringEditorDialog.OnCustomNewAction | (*args, **kwargs) | return _propgrid.PGArrayStringEditorDialog_OnCustomNewAction(*args, **kwargs) | OnCustomNewAction(self, String resString) -> bool | OnCustomNewAction(self, String resString) -> bool | [
"OnCustomNewAction",
"(",
"self",
"String",
"resString",
")",
"-",
">",
"bool"
] | def OnCustomNewAction(*args, **kwargs):
"""OnCustomNewAction(self, String resString) -> bool"""
return _propgrid.PGArrayStringEditorDialog_OnCustomNewAction(*args, **kwargs) | [
"def",
"OnCustomNewAction",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGArrayStringEditorDialog_OnCustomNewAction",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L3253-L3255 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | scripts/cluster.py | python | Cluster.kill_server | (self, locator) | Kill a running server.
@param locator: service locator for the server that needs to be
killed. | Kill a running server. | [
"Kill",
"a",
"running",
"server",
"."
] | def kill_server(self, locator):
"""Kill a running server.
@param locator: service locator for the server that needs to be
killed.
"""
path = '%s/logs/shm' % os.getcwd()
files = sorted([f for f in os.listdir(path)
if os.path.isfile( os.path.join... | [
"def",
"kill_server",
"(",
"self",
",",
"locator",
")",
":",
"path",
"=",
"'%s/logs/shm'",
"%",
"os",
".",
"getcwd",
"(",
")",
"files",
"=",
"sorted",
"(",
"[",
"f",
"for",
"f",
"in",
"os",
".",
"listdir",
"(",
"path",
")",
"if",
"os",
".",
"path... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/cluster.py#L383-L409 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py | python | DataParallelExecutorManager.aux_arrays | (self) | return self.execgrp.aux_arrays | shared aux states | shared aux states | [
"shared",
"aux",
"states"
] | def aux_arrays(self):
"""shared aux states"""
# aux arrays are also shared by all executor groups
return self.execgrp.aux_arrays | [
"def",
"aux_arrays",
"(",
"self",
")",
":",
"# aux arrays are also shared by all executor groups",
"return",
"self",
".",
"execgrp",
".",
"aux_arrays"
] | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py#L359-L362 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/utils/llvm-build/llvmbuild/main.py | python | LLVMProjectInfo.get_required_libraries_for_component | (self, ci, traverse_groups = False) | get_required_libraries_for_component(component_info) -> iter
Given a Library component info descriptor, return an iterator over all
of the directly required libraries for linking with this component. If
traverse_groups is True, then library and target groups will be
traversed to include... | get_required_libraries_for_component(component_info) -> iter | [
"get_required_libraries_for_component",
"(",
"component_info",
")",
"-",
">",
"iter"
] | def get_required_libraries_for_component(self, ci, traverse_groups = False):
"""
get_required_libraries_for_component(component_info) -> iter
Given a Library component info descriptor, return an iterator over all
of the directly required libraries for linking with this component. If
... | [
"def",
"get_required_libraries_for_component",
"(",
"self",
",",
"ci",
",",
"traverse_groups",
"=",
"False",
")",
":",
"assert",
"ci",
".",
"type_name",
"in",
"(",
"'Library'",
",",
"'OptionalLibrary'",
",",
"'LibraryGroup'",
",",
"'TargetGroup'",
")",
"for",
"n... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/utils/llvm-build/llvmbuild/main.py#L424-L453 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | _DomainTan.__call__ | (self, x) | return umath.less(umath.absolute(umath.cos(x)), self.eps) | Executes the call behavior. | Executes the call behavior. | [
"Executes",
"the",
"call",
"behavior",
"."
] | def __call__ (self, x):
"Executes the call behavior."
return umath.less(umath.absolute(umath.cos(x)), self.eps) | [
"def",
"__call__",
"(",
"self",
",",
"x",
")",
":",
"return",
"umath",
".",
"less",
"(",
"umath",
".",
"absolute",
"(",
"umath",
".",
"cos",
"(",
"x",
")",
")",
",",
"self",
".",
"eps",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L755-L757 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Runner.py | python | Parallel.refill_task_list | (self) | Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`. | Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`. | [
"Put",
"the",
"next",
"group",
"of",
"tasks",
"to",
"execute",
"in",
":",
"py",
":",
"attr",
":",
"waflib",
".",
"Runner",
".",
"Parallel",
".",
"outstanding",
"."
] | def refill_task_list(self):
"""
Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`.
"""
while self.count > self.numjobs * GAP:
self.get_out()
while not self.outstanding:
if self.count:
self.get_out()
elif self.frozen:
try:
cond = self.deadlock == sel... | [
"def",
"refill_task_list",
"(",
"self",
")",
":",
"while",
"self",
".",
"count",
">",
"self",
".",
"numjobs",
"*",
"GAP",
":",
"self",
".",
"get_out",
"(",
")",
"while",
"not",
"self",
".",
"outstanding",
":",
"if",
"self",
".",
"count",
":",
"self",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Runner.py#L176-L209 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBProcessInfo.GroupIDIsValid | (self) | return _lldb.SBProcessInfo_GroupIDIsValid(self) | GroupIDIsValid(SBProcessInfo self) -> bool | GroupIDIsValid(SBProcessInfo self) -> bool | [
"GroupIDIsValid",
"(",
"SBProcessInfo",
"self",
")",
"-",
">",
"bool"
] | def GroupIDIsValid(self):
"""GroupIDIsValid(SBProcessInfo self) -> bool"""
return _lldb.SBProcessInfo_GroupIDIsValid(self) | [
"def",
"GroupIDIsValid",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBProcessInfo_GroupIDIsValid",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9000-L9002 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/python_message.py | python | _OneofListener.Modified | (self) | Also updates the state of the containing oneof in the parent message. | Also updates the state of the containing oneof in the parent message. | [
"Also",
"updates",
"the",
"state",
"of",
"the",
"containing",
"oneof",
"in",
"the",
"parent",
"message",
"."
] | def Modified(self):
"""Also updates the state of the containing oneof in the parent message."""
try:
self._parent_message_weakref._UpdateOneofState(self._field)
super(_OneofListener, self).Modified()
except ReferenceError:
pass | [
"def",
"Modified",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_parent_message_weakref",
".",
"_UpdateOneofState",
"(",
"self",
".",
"_field",
")",
"super",
"(",
"_OneofListener",
",",
"self",
")",
".",
"Modified",
"(",
")",
"except",
"ReferenceError",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/python_message.py#L1535-L1541 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py | python | Maildir._lookup | (self, key) | Use TOC to return subpath for given key, or raise a KeyError. | Use TOC to return subpath for given key, or raise a KeyError. | [
"Use",
"TOC",
"to",
"return",
"subpath",
"for",
"given",
"key",
"or",
"raise",
"a",
"KeyError",
"."
] | def _lookup(self, key):
"""Use TOC to return subpath for given key, or raise a KeyError."""
try:
if os.path.exists(os.path.join(self._path, self._toc[key])):
return self._toc[key]
except KeyError:
pass
self._refresh()
try:
retur... | [
"def",
"_lookup",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"self",
".",
"_toc",
"[",
"key",
"]",
")",
")",
":",
"return",
"self... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L547-L558 | ||
lhmRyan/deep-supervised-hashing-DSH | 631901f82e2ab031fbac33f914a5b08ef8e21d57 | python/caffe/pycaffe.py | python | _Net_forward_all | (self, blobs=None, **kwargs) | return all_outs | Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blob name: list of blobs} dict. | Run net forward in batches. | [
"Run",
"net",
"forward",
"in",
"batches",
"."
] | def _Net_forward_all(self, blobs=None, **kwargs):
"""
Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blo... | [
"def",
"_Net_forward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Collect outputs from batches",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".",
"outputs",
"+",
"(",
"blobs... | https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/python/caffe/pycaffe.py#L161-L189 | |
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/sanitizers/sancov_merger.py | python | merge_two | (args) | Merge two sancov files.
Called trough multiprocessing pool. The args are expected to unpack to:
swarming_output_dir: Folder where to find the new file.
coverage_dir: Folder where to find the existing file.
f: File name of the file to be merged. | Merge two sancov files. | [
"Merge",
"two",
"sancov",
"files",
"."
] | def merge_two(args):
"""Merge two sancov files.
Called trough multiprocessing pool. The args are expected to unpack to:
swarming_output_dir: Folder where to find the new file.
coverage_dir: Folder where to find the existing file.
f: File name of the file to be merged.
"""
swarming_output_dir, cover... | [
"def",
"merge_two",
"(",
"args",
")",
":",
"swarming_output_dir",
",",
"coverage_dir",
",",
"f",
"=",
"args",
"input_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"swarming_output_dir",
",",
"f",
")",
"output_file",
"=",
"os",
".",
"path",
".",
"join"... | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/sanitizers/sancov_merger.py#L160-L179 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py | python | Program.finalize | (self, isa, callconv=0, options=None) | return CodeObject(code_object) | The program object is safe to be deleted after ``finalize``. | The program object is safe to be deleted after ``finalize``. | [
"The",
"program",
"object",
"is",
"safe",
"to",
"be",
"deleted",
"after",
"finalize",
"."
] | def finalize(self, isa, callconv=0, options=None):
"""
The program object is safe to be deleted after ``finalize``.
"""
code_object = drvapi.hsa_code_object_t()
control_directives = drvapi.hsa_ext_control_directives_t()
ctypes.memset(ctypes.byref(control_directives), 0,
... | [
"def",
"finalize",
"(",
"self",
",",
"isa",
",",
"callconv",
"=",
"0",
",",
"options",
"=",
"None",
")",
":",
"code_object",
"=",
"drvapi",
".",
"hsa_code_object_t",
"(",
")",
"control_directives",
"=",
"drvapi",
".",
"hsa_ext_control_directives_t",
"(",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py#L994-L1009 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Statistics.__len__ | (self) | return int(Z3_stats_size(self.ctx.ref(), self.stats)) | Return the number of statistical counters.
>>> x = Int('x')
>>> s = Then('simplify', 'nlsat').solver()
>>> s.add(x > 0)
>>> s.check()
sat
>>> st = s.statistics()
>>> len(st)
6 | Return the number of statistical counters. | [
"Return",
"the",
"number",
"of",
"statistical",
"counters",
"."
] | def __len__(self):
"""Return the number of statistical counters.
>>> x = Int('x')
>>> s = Then('simplify', 'nlsat').solver()
>>> s.add(x > 0)
>>> s.check()
sat
>>> st = s.statistics()
>>> len(st)
6
"""
return int(Z3_stats_size(self... | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"int",
"(",
"Z3_stats_size",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
".",
"stats",
")",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L6675-L6687 | |
fabianschenk/RESLAM | 2e71a578b6d1a1ad1fb018641218e1f41dd9e330 | thirdparty/Sophus/py/sophus/se3.py | python | Se3.__mul__ | (self, right) | left-multiplication
either rotation concatenation or point-transform | left-multiplication
either rotation concatenation or point-transform | [
"left",
"-",
"multiplication",
"either",
"rotation",
"concatenation",
"or",
"point",
"-",
"transform"
] | def __mul__(self, right):
""" left-multiplication
either rotation concatenation or point-transform """
if isinstance(right, sympy.Matrix):
assert right.shape == (3, 1), right.shape
return self.so3 * right + self.t
elif isinstance(right, Se3):
r = s... | [
"def",
"__mul__",
"(",
"self",
",",
"right",
")",
":",
"if",
"isinstance",
"(",
"right",
",",
"sympy",
".",
"Matrix",
")",
":",
"assert",
"right",
".",
"shape",
"==",
"(",
"3",
",",
"1",
")",
",",
"right",
".",
"shape",
"return",
"self",
".",
"so... | https://github.com/fabianschenk/RESLAM/blob/2e71a578b6d1a1ad1fb018641218e1f41dd9e330/thirdparty/Sophus/py/sophus/se3.py#L65-L75 | ||
stepcode/stepcode | 2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39 | src/exp2python/python/SCL/Part21.py | python | Parser.p_data_section | (self, p) | data_section : data_start entity_instance_list ENDSEC | data_section : data_start entity_instance_list ENDSEC | [
"data_section",
":",
"data_start",
"entity_instance_list",
"ENDSEC"
] | def p_data_section(self, p):
"""data_section : data_start entity_instance_list ENDSEC"""
p[0] = Section(p[2]) | [
"def",
"p_data_section",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"Section",
"(",
"p",
"[",
"2",
"]",
")"
] | https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L395-L397 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/config.py | python | config_file_load | (dad) | Load the Preferences from Config File | Load the Preferences from Config File | [
"Load",
"the",
"Preferences",
"from",
"Config",
"File"
] | def config_file_load(dad):
"""Load the Preferences from Config File"""
dad.custom_kb_shortcuts = {}
dad.custom_codexec_type = {}
dad.custom_codexec_ext = {}
dad.custom_codexec_term = None
dad.latest_tag = ["", ""]
if os.path.isfile(cons.CONFIG_PATH):
cfg = ConfigParser.RawConfigParse... | [
"def",
"config_file_load",
"(",
"dad",
")",
":",
"dad",
".",
"custom_kb_shortcuts",
"=",
"{",
"}",
"dad",
".",
"custom_codexec_type",
"=",
"{",
"}",
"dad",
".",
"custom_codexec_ext",
"=",
"{",
"}",
"dad",
".",
"custom_codexec_term",
"=",
"None",
"dad",
"."... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/config.py#L189-L533 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py | python | ModelFittingModel.current_result_table_index | (self) | return self.fitting_context.current_result_table_index | Returns the index of the currently selected result table. | Returns the index of the currently selected result table. | [
"Returns",
"the",
"index",
"of",
"the",
"currently",
"selected",
"result",
"table",
"."
] | def current_result_table_index(self) -> int:
"""Returns the index of the currently selected result table."""
return self.fitting_context.current_result_table_index | [
"def",
"current_result_table_index",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"fitting_context",
".",
"current_result_table_index"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py#L30-L32 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGProperty.SetAttribute | (*args, **kwargs) | return _propgrid.PGProperty_SetAttribute(*args, **kwargs) | SetAttribute(self, String name, wxVariant value) | SetAttribute(self, String name, wxVariant value) | [
"SetAttribute",
"(",
"self",
"String",
"name",
"wxVariant",
"value",
")"
] | def SetAttribute(*args, **kwargs):
"""SetAttribute(self, String name, wxVariant value)"""
return _propgrid.PGProperty_SetAttribute(*args, **kwargs) | [
"def",
"SetAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L674-L676 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetBundleJavaFolderPath | (self) | return os.path.join(self.GetBundleResourceFolder(), 'Java') | Returns the qualified path to the bundle's Java resource folder.
E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles. | Returns the qualified path to the bundle's Java resource folder.
E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles. | [
"Returns",
"the",
"qualified",
"path",
"to",
"the",
"bundle",
"s",
"Java",
"resource",
"folder",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"Resources",
"/",
"Java",
".",
"Only",
"valid",
"for",
"bundles",
"."
] | def GetBundleJavaFolderPath(self):
"""Returns the qualified path to the bundle's Java resource folder.
E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles."""
assert self._IsBundle()
return os.path.join(self.GetBundleResourceFolder(), 'Java') | [
"def",
"GetBundleJavaFolderPath",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"GetBundleResourceFolder",
"(",
")",
",",
"'Java'",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/xcode_emulation.py#L328-L332 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/superplot/view.py | python | SuperplotView.set_hold_button_size | (self, width, height) | Set the hold button fixed size.
Args:
width (int): button width
height (int): button height | Set the hold button fixed size. | [
"Set",
"the",
"hold",
"button",
"fixed",
"size",
"."
] | def set_hold_button_size(self, width, height):
"""
Set the hold button fixed size.
Args:
width (int): button width
height (int): button height
"""
self._bottom_view.holdButton.setFixedSize(width, height) | [
"def",
"set_hold_button_size",
"(",
"self",
",",
"width",
",",
"height",
")",
":",
"self",
".",
"_bottom_view",
".",
"holdButton",
".",
"setFixedSize",
"(",
"width",
",",
"height",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/superplot/view.py#L423-L431 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _IsPresent | (item) | Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields(). | Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields(). | [
"Given",
"a",
"(",
"FieldDescriptor",
"value",
")",
"tuple",
"from",
"_fields",
"return",
"true",
"if",
"the",
"value",
"should",
"be",
"included",
"in",
"the",
"list",
"returned",
"by",
"ListFields",
"()",
"."
] | def _IsPresent(item):
"""Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields()."""
if item[0].label == _FieldDescriptor.LABEL_REPEATED:
return bool(item[1])
elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
return ... | [
"def",
"_IsPresent",
"(",
"item",
")",
":",
"if",
"item",
"[",
"0",
"]",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REPEATED",
":",
"return",
"bool",
"(",
"item",
"[",
"1",
"]",
")",
"elif",
"item",
"[",
"0",
"]",
".",
"cpp_type",
"==",
"_... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/python_message.py#L785-L794 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.SetWindowStyleFlag | (*args, **kwargs) | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) | SetWindowStyleFlag(self, long style)
Sets the style of the window. Please note that some styles cannot be
changed after the window creation and that Refresh() might need to be
called after changing the others for the change to take place
immediately. | SetWindowStyleFlag(self, long style) | [
"SetWindowStyleFlag",
"(",
"self",
"long",
"style",
")"
] | def SetWindowStyleFlag(*args, **kwargs):
"""
SetWindowStyleFlag(self, long style)
Sets the style of the window. Please note that some styles cannot be
changed after the window creation and that Refresh() might need to be
called after changing the others for the change to take pl... | [
"def",
"SetWindowStyleFlag",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetWindowStyleFlag",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10016-L10025 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | FlagCxx11Features | (filename, clean_lines, linenum, error) | Flag those c++11 features that we only allow in certain places.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Flag those c++11 features that we only allow in certain places. | [
"Flag",
"those",
"c",
"++",
"11",
"features",
"that",
"we",
"only",
"allow",
"in",
"certain",
"places",
"."
] | def FlagCxx11Features(filename, clean_lines, linenum, error):
"""Flag those c++11 features that we only allow in certain places.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to ... | [
"def",
"FlagCxx11Features",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"include",
"=",
"Match",
"(",
"r'\\s*#\\s*include\\s+[<\"]([^<\"]+)[\">]'",
",",
"line",
")",... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L6110-L6159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.