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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | _as_indexed_slices_list | (inputs) | return casted_outputs | Convert all elements of 'inputs' to IndexedSlices.
Additionally, homogenize the types of all the indices to
either int32 or int64.
Args:
inputs: List containing either Tensor or IndexedSlices objects.
Returns:
A list of IndexedSlices objects.
Raises:
TypeError: If 'inputs' is not a list or a t... | Convert all elements of 'inputs' to IndexedSlices. | [
"Convert",
"all",
"elements",
"of",
"inputs",
"to",
"IndexedSlices",
"."
] | def _as_indexed_slices_list(inputs):
"""Convert all elements of 'inputs' to IndexedSlices.
Additionally, homogenize the types of all the indices to
either int32 or int64.
Args:
inputs: List containing either Tensor or IndexedSlices objects.
Returns:
A list of IndexedSlices objects.
Raises:
T... | [
"def",
"_as_indexed_slices_list",
"(",
"inputs",
")",
":",
"if",
"not",
"isinstance",
"(",
"inputs",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected a list or tuple, not a %s\"",
"%",
"type",
"(",
"inputs",
")",
")",
"ou... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1413-L1443 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py | python | pyparsing_common.convertToDatetime | (fmt="%Y-%m-%dT%H:%M:%S.%f") | return cvt_fn | Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
Params -
- fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"})
Example::
dt_expr = pyparsing_common.iso8601_datetime.copy()
dt_expr.setParse... | Helper to create a parse action for converting parsed datetime string to Python datetime.datetime | [
"Helper",
"to",
"create",
"a",
"parse",
"action",
"for",
"converting",
"parsed",
"datetime",
"string",
"to",
"Python",
"datetime",
".",
"datetime"
] | def convertToDatetime(fmt="%Y-%m-%dT%H:%M:%S.%f"):
"""
Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
Params -
- fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"})
Example::
dt_expr ... | [
"def",
"convertToDatetime",
"(",
"fmt",
"=",
"\"%Y-%m-%dT%H:%M:%S.%f\"",
")",
":",
"def",
"cvt_fn",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"try",
":",
"return",
"datetime",
".",
"strptime",
"(",
"t",
"[",
"0",
"]",
",",
"fmt",
")",
"except",
"ValueE... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py#L5615-L5634 | |
jolibrain/deepdetect | 9bc840f0b1055426670d64b5285701d6faceabb9 | clients/python/dd_client/__init__.py | python | DD.post_train | (
self,
sname,
data,
parameters_input,
parameters_mllib,
parameters_output,
jasync=True,
) | return self.post(self.__urls["train"], json=data) | Creates a training job
Parameters:
sname -- service name as a resource
jasync -- whether to run the job as non-blocking
data -- array of input data / dataset for training
parameters_input -- dict of input parameters
parameters_mllib -- dict ML library parameters
p... | Creates a training job
Parameters:
sname -- service name as a resource
jasync -- whether to run the job as non-blocking
data -- array of input data / dataset for training
parameters_input -- dict of input parameters
parameters_mllib -- dict ML library parameters
p... | [
"Creates",
"a",
"training",
"job",
"Parameters",
":",
"sname",
"--",
"service",
"name",
"as",
"a",
"resource",
"jasync",
"--",
"whether",
"to",
"run",
"the",
"job",
"as",
"non",
"-",
"blocking",
"data",
"--",
"array",
"of",
"input",
"data",
"/",
"dataset... | def post_train(
self,
sname,
data,
parameters_input,
parameters_mllib,
parameters_output,
jasync=True,
):
"""
Creates a training job
Parameters:
sname -- service name as a resource
jasync -- whether to run the job as non... | [
"def",
"post_train",
"(",
"self",
",",
"sname",
",",
"data",
",",
"parameters_input",
",",
"parameters_mllib",
",",
"parameters_output",
",",
"jasync",
"=",
"True",
",",
")",
":",
"data",
"=",
"{",
"\"service\"",
":",
"sname",
",",
"\"async\"",
":",
"jasyn... | https://github.com/jolibrain/deepdetect/blob/9bc840f0b1055426670d64b5285701d6faceabb9/clients/python/dd_client/__init__.py#L193-L222 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py | python | Experiment.local_run | (self) | return self.evaluate(delay_secs=0) | Run when called on local machine.
Returns:
The result of the `evaluate` call to the `Estimator`. | Run when called on local machine. | [
"Run",
"when",
"called",
"on",
"local",
"machine",
"."
] | def local_run(self):
"""Run when called on local machine.
Returns:
The result of the `evaluate` call to the `Estimator`.
"""
self._train_monitors = self._train_monitors or []
if self._local_eval_frequency:
self._train_monitors += [monitors.ValidationMonitor(
input_fn=self._eva... | [
"def",
"local_run",
"(",
"self",
")",
":",
"self",
".",
"_train_monitors",
"=",
"self",
".",
"_train_monitors",
"or",
"[",
"]",
"if",
"self",
".",
"_local_eval_frequency",
":",
"self",
".",
"_train_monitors",
"+=",
"[",
"monitors",
".",
"ValidationMonitor",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py#L146-L159 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py | python | get_spice_file_name | (instrument_name, exp_number, scan_number) | return file_name | Get standard HB3A SPICE file name from experiment number and scan number
:param instrument_name
:param exp_number:
:param scan_number:
:return: | Get standard HB3A SPICE file name from experiment number and scan number
:param instrument_name
:param exp_number:
:param scan_number:
:return: | [
"Get",
"standard",
"HB3A",
"SPICE",
"file",
"name",
"from",
"experiment",
"number",
"and",
"scan",
"number",
":",
"param",
"instrument_name",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number",
":",
":",
"return",
":"
] | def get_spice_file_name(instrument_name, exp_number, scan_number):
"""
Get standard HB3A SPICE file name from experiment number and scan number
:param instrument_name
:param exp_number:
:param scan_number:
:return:
"""
assert isinstance(instrument_name, str)
assert isinstance(exp_num... | [
"def",
"get_spice_file_name",
"(",
"instrument_name",
",",
"exp_number",
",",
"scan_number",
")",
":",
"assert",
"isinstance",
"(",
"instrument_name",
",",
"str",
")",
"assert",
"isinstance",
"(",
"exp_number",
",",
"int",
")",
"and",
"isinstance",
"(",
"scan_nu... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py#L411-L423 | |
OPAE/opae-sdk | 221124343c8275243a249eb72d69e0ea2d568d1b | python/opae.admin/opae/admin/sysfs.py | python | pci_node.device | (self) | return self._pci_address['device'] | device get the pci device of the node | device get the pci device of the node | [
"device",
"get",
"the",
"pci",
"device",
"of",
"the",
"node"
] | def device(self):
"""device get the pci device of the node"""
return self._pci_address['device'] | [
"def",
"device",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pci_address",
"[",
"'device'",
"]"
] | https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/python/opae.admin/opae/admin/sysfs.py#L366-L368 | |
rbgirshick/caffe-fast-rcnn | 28a579eaf0668850705598b3075b8969f22226d9 | python/caffe/draw.py | python | choose_color_by_layertype | (layertype) | return color | Define colors for nodes based on the layer type. | Define colors for nodes based on the layer type. | [
"Define",
"colors",
"for",
"nodes",
"based",
"on",
"the",
"layer",
"type",
"."
] | def choose_color_by_layertype(layertype):
"""Define colors for nodes based on the layer type.
"""
color = '#6495ED' # Default
if layertype == 'Convolution':
color = '#FF5050'
elif layertype == 'Pooling':
color = '#FF9900'
elif layertype == 'InnerProduct':
color = '#CC33F... | [
"def",
"choose_color_by_layertype",
"(",
"layertype",
")",
":",
"color",
"=",
"'#6495ED'",
"# Default",
"if",
"layertype",
"==",
"'Convolution'",
":",
"color",
"=",
"'#FF5050'",
"elif",
"layertype",
"==",
"'Pooling'",
":",
"color",
"=",
"'#FF9900'",
"elif",
"lay... | https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/python/caffe/draw.py#L108-L118 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/numbers.py | python | Integral.__and__ | (self, other) | self & other | self & other | [
"self",
"&",
"other"
] | def __and__(self, other):
"""self & other"""
raise NotImplementedError | [
"def",
"__and__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/numbers.py#L341-L343 | ||
akai-katto/dandere2x | bf1a46d5c9f9ffc8145a412c3571b283345b8512 | src/dandere2x/dandere2xlib/wrappers/ffmpeg/ffprobe.py | python | get_video_info | (ffprobe_dir, input_video) | return json.loads(json_str.decode('utf-8')) | Gets input video information
This method reads input video information
using ffprobe in dictionary.
Arguments:
input_video {string} -- input video file path
Returns:
dictionary -- JSON text of input video information | Gets input video information
This method reads input video information
using ffprobe in dictionary.
Arguments:
input_video {string} -- input video file path
Returns:
dictionary -- JSON text of input video information | [
"Gets",
"input",
"video",
"information",
"This",
"method",
"reads",
"input",
"video",
"information",
"using",
"ffprobe",
"in",
"dictionary",
".",
"Arguments",
":",
"input_video",
"{",
"string",
"}",
"--",
"input",
"video",
"file",
"path",
"Returns",
":",
"dict... | def get_video_info(ffprobe_dir, input_video):
""" Gets input video information
This method reads input video information
using ffprobe in dictionary.
Arguments:
input_video {string} -- input video file path
Returns:
dictionary -- JSON text of input video information
"""
asse... | [
"def",
"get_video_info",
"(",
"ffprobe_dir",
",",
"input_video",
")",
":",
"assert",
"get_operating_system",
"(",
")",
"!=",
"\"win32\"",
"or",
"os",
".",
"path",
".",
"exists",
"(",
"ffprobe_dir",
")",
",",
"\"%s does not exist!\"",
"%",
"ffprobe_dir",
"# this ... | https://github.com/akai-katto/dandere2x/blob/bf1a46d5c9f9ffc8145a412c3571b283345b8512/src/dandere2x/dandere2xlib/wrappers/ffmpeg/ffprobe.py#L13-L44 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | PointCloud.join | (self, pc) | return _robotsim.PointCloud_join(self, pc) | join(PointCloud self, PointCloud pc)
Adds the given point cloud to this one. They must share the same properties or
else an exception is raised. | join(PointCloud self, PointCloud pc) | [
"join",
"(",
"PointCloud",
"self",
"PointCloud",
"pc",
")"
] | def join(self, pc):
"""
join(PointCloud self, PointCloud pc)
Adds the given point cloud to this one. They must share the same properties or
else an exception is raised.
"""
return _robotsim.PointCloud_join(self, pc) | [
"def",
"join",
"(",
"self",
",",
"pc",
")",
":",
"return",
"_robotsim",
".",
"PointCloud_join",
"(",
"self",
",",
"pc",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L1196-L1206 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/targets.py | python | ProjectTarget.targets_to_build | (self) | return result | Computes and returns a list of AbstractTarget instances which
must be built when this project is built. | Computes and returns a list of AbstractTarget instances which
must be built when this project is built. | [
"Computes",
"and",
"returns",
"a",
"list",
"of",
"AbstractTarget",
"instances",
"which",
"must",
"be",
"built",
"when",
"this",
"project",
"is",
"built",
"."
] | def targets_to_build (self):
""" Computes and returns a list of AbstractTarget instances which
must be built when this project is built.
"""
result = []
if not self.built_main_targets_:
self.build_main_targets ()
# Collect all main targets here, except f... | [
"def",
"targets_to_build",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"if",
"not",
"self",
".",
"built_main_targets_",
":",
"self",
".",
"build_main_targets",
"(",
")",
"# Collect all main targets here, except for \"explicit\" ones.",
"for",
"n",
",",
"t",
"i... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/targets.py#L450-L469 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/descriptor.py | python | Descriptor.__init__ | (self, name, full_name, filename, containing_type, fields,
nested_types, enum_types, extensions, options=None,
serialized_options=None,
is_extendable=True, extension_ranges=None, oneofs=None,
file=None, serialized_start=None, serialized_end=None, # pylint: di... | Arguments to __init__() are as described in the description
of Descriptor fields above.
Note that filename is an obsolete argument, that is not used anymore.
Please use file.name to access this as an attribute. | Arguments to __init__() are as described in the description
of Descriptor fields above. | [
"Arguments",
"to",
"__init__",
"()",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"Descriptor",
"fields",
"above",
"."
] | def __init__(self, name, full_name, filename, containing_type, fields,
nested_types, enum_types, extensions, options=None,
serialized_options=None,
is_extendable=True, extension_ranges=None, oneofs=None,
file=None, serialized_start=None, serialized_end=None, ... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"filename",
",",
"containing_type",
",",
"fields",
",",
"nested_types",
",",
"enum_types",
",",
"extensions",
",",
"options",
"=",
"None",
",",
"serialized_options",
"=",
"None",
",",
"is_ex... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/descriptor.py#L316-L370 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Task.py | python | compile_fun_shell | (line) | return (funex(c), dvars) | Creates a compiled function to execute a process through a sub-shell | Creates a compiled function to execute a process through a sub-shell | [
"Creates",
"a",
"compiled",
"function",
"to",
"execute",
"a",
"process",
"through",
"a",
"sub",
"-",
"shell"
] | def compile_fun_shell(line):
"""
Creates a compiled function to execute a process through a sub-shell
"""
extr = []
def repl(match):
g = match.group
if g('dollar'):
return "$"
elif g('backslash'):
return '\\\\'
elif g('subst'):
extr.append((g('var'), g('code')))
return "%s"
return None
line ... | [
"def",
"compile_fun_shell",
"(",
"line",
")",
":",
"extr",
"=",
"[",
"]",
"def",
"repl",
"(",
"match",
")",
":",
"g",
"=",
"match",
".",
"group",
"if",
"g",
"(",
"'dollar'",
")",
":",
"return",
"\"$\"",
"elif",
"g",
"(",
"'backslash'",
")",
":",
... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Task.py#L1056-L1136 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/virtualpop.py | python | Virtualpopulation.select_plans_random | (self, fraction=0.1, **kwargs) | return True | A fraction of the population changes a plan.
The new plans are chosen randomly. | A fraction of the population changes a plan.
The new plans are chosen randomly. | [
"A",
"fraction",
"of",
"the",
"population",
"changes",
"a",
"plan",
".",
"The",
"new",
"plans",
"are",
"chosen",
"randomly",
"."
] | def select_plans_random(self, fraction=0.1, **kwargs):
"""
A fraction of the population changes a plan.
The new plans are chosen randomly.
"""
ids_pers_all = self.get_ids()
print 'select_plans_random', len(ids_pers_all), fraction
times_est = self.get_plans().t... | [
"def",
"select_plans_random",
"(",
"self",
",",
"fraction",
"=",
"0.1",
",",
"*",
"*",
"kwargs",
")",
":",
"ids_pers_all",
"=",
"self",
".",
"get_ids",
"(",
")",
"print",
"'select_plans_random'",
",",
"len",
"(",
"ids_pers_all",
")",
",",
"fraction",
"time... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/virtualpop.py#L6496-L6514 | |
llvm-mirror/libcxx | 78d6a7767ed57b50122a161b91f59f19c9bd0d19 | utils/google-benchmark/tools/gbench/util.py | python | run_benchmark | (exe_name, benchmark_flags) | return json_res | Run a benchmark specified by 'exe_name' with the specified
'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
real time console output.
RETURNS: A JSON object representing the benchmark output | Run a benchmark specified by 'exe_name' with the specified
'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
real time console output.
RETURNS: A JSON object representing the benchmark output | [
"Run",
"a",
"benchmark",
"specified",
"by",
"exe_name",
"with",
"the",
"specified",
"benchmark_flags",
".",
"The",
"benchmark",
"is",
"run",
"directly",
"as",
"a",
"subprocess",
"to",
"preserve",
"real",
"time",
"console",
"output",
".",
"RETURNS",
":",
"A",
... | def run_benchmark(exe_name, benchmark_flags):
"""
Run a benchmark specified by 'exe_name' with the specified
'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
real time console output.
RETURNS: A JSON object representing the benchmark output
"""
output_name = find_... | [
"def",
"run_benchmark",
"(",
"exe_name",
",",
"benchmark_flags",
")",
":",
"output_name",
"=",
"find_benchmark_flag",
"(",
"'--benchmark_out='",
",",
"benchmark_flags",
")",
"is_temp_output",
"=",
"False",
"if",
"output_name",
"is",
"None",
":",
"is_temp_output",
"=... | https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/utils/google-benchmark/tools/gbench/util.py#L122-L148 | |
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | scripts/cpp_lint.py | python | _IncludeState.IsInAlphabeticalOrder | (self, clean_lines, linenum, header_path) | return True | Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order. | Check if a header is in alphabetical order with the previous header. | [
"Check",
"if",
"a",
"header",
"is",
"in",
"alphabetical",
"order",
"with",
"the",
"previous",
"header",
"."
] | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checke... | [
"def",
"IsInAlphabeticalOrder",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"header_path",
")",
":",
"# If previous section is different from current section, _last_header will",
"# be reset to empty string, so it's always less than current header.",
"#",
"# If previous line ... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L612-L631 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/platform/android_platform_backend.py | python | AndroidPlatformBackend.PurgeUnpinnedMemory | (self) | Purges the unpinned ashmem memory for the whole system.
This can be used to make memory measurements more stable. Requires root. | Purges the unpinned ashmem memory for the whole system. | [
"Purges",
"the",
"unpinned",
"ashmem",
"memory",
"for",
"the",
"whole",
"system",
"."
] | def PurgeUnpinnedMemory(self):
"""Purges the unpinned ashmem memory for the whole system.
This can be used to make memory measurements more stable. Requires root.
"""
if not self._can_elevate_privilege:
logging.warning('Cannot run purge_ashmem. Requires a rooted device.')
return
if not... | [
"def",
"PurgeUnpinnedMemory",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_can_elevate_privilege",
":",
"logging",
".",
"warning",
"(",
"'Cannot run purge_ashmem. Requires a rooted device.'",
")",
"return",
"if",
"not",
"android_prebuilt_profiler_helper",
".",
"In... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/platform/android_platform_backend.py#L240-L255 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/connectionpool.py | python | HTTPSConnectionPool._new_conn | (self) | return self._prepare_conn(conn) | Return a fresh :class:`httplib.HTTPSConnection`. | Return a fresh :class:`httplib.HTTPSConnection`. | [
"Return",
"a",
"fresh",
":",
"class",
":",
"httplib",
".",
"HTTPSConnection",
"."
] | def _new_conn(self):
"""
Return a fresh :class:`httplib.HTTPSConnection`.
"""
self.num_connections += 1
log.debug(
"Starting new HTTPS connection (%d): %s:%s",
self.num_connections,
self.host,
self.port or "443",
)
... | [
"def",
"_new_conn",
"(",
"self",
")",
":",
"self",
".",
"num_connections",
"+=",
"1",
"log",
".",
"debug",
"(",
"\"Starting new HTTPS connection (%d): %s:%s\"",
",",
"self",
".",
"num_connections",
",",
"self",
".",
"host",
",",
"self",
".",
"port",
"or",
"\... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/connectionpool.py#L950-L984 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/Dice3DS/util.py | python | calculate_normals_by_angle_subtended | (pointarray,facearray,smarray) | return points, numpy.asarray(fnorms,numpy.float32) | Calculate normals by smoothing, weighting by angle subtended.
points,norms = calculate_normals_by_angle_subtended(
pointarray,facearray,smarray)
Takes an array of points, faces, and a smoothing group in exactly
the same form in which they appear in the 3DS DOM.
Returns a numpy.arr... | Calculate normals by smoothing, weighting by angle subtended. | [
"Calculate",
"normals",
"by",
"smoothing",
"weighting",
"by",
"angle",
"subtended",
"."
] | def calculate_normals_by_angle_subtended(pointarray,facearray,smarray):
"""Calculate normals by smoothing, weighting by angle subtended.
points,norms = calculate_normals_by_angle_subtended(
pointarray,facearray,smarray)
Takes an array of points, faces, and a smoothing group in exactly
... | [
"def",
"calculate_normals_by_angle_subtended",
"(",
"pointarray",
",",
"facearray",
",",
"smarray",
")",
":",
"# prepare to calculate normals. define some arrays",
"m",
"=",
"len",
"(",
"facearray",
")",
"rnorms",
"=",
"numpy",
".",
"zeros",
"(",
"(",
"m",
"*",
"3... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/Dice3DS/util.py#L175-L276 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchStructure.py | python | makeStructure | (baseobj=None,length=None,width=None,height=None,name="Structure") | return obj | makeStructure([obj],[length],[width],[height],[swap]): creates a
structure element based on the given profile object and the given
extrusion height. If no base object is given, you can also specify
length and width for a cubic object. | makeStructure([obj],[length],[width],[height],[swap]): creates a
structure element based on the given profile object and the given
extrusion height. If no base object is given, you can also specify
length and width for a cubic object. | [
"makeStructure",
"(",
"[",
"obj",
"]",
"[",
"length",
"]",
"[",
"width",
"]",
"[",
"height",
"]",
"[",
"swap",
"]",
")",
":",
"creates",
"a",
"structure",
"element",
"based",
"on",
"the",
"given",
"profile",
"object",
"and",
"the",
"given",
"extrusion"... | def makeStructure(baseobj=None,length=None,width=None,height=None,name="Structure"):
'''makeStructure([obj],[length],[width],[height],[swap]): creates a
structure element based on the given profile object and the given
extrusion height. If no base object is given, you can also specify
length and width ... | [
"def",
"makeStructure",
"(",
"baseobj",
"=",
"None",
",",
"length",
"=",
"None",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
",",
"name",
"=",
"\"Structure\"",
")",
":",
"if",
"not",
"FreeCAD",
".",
"ActiveDocument",
":",
"FreeCAD",
".",
"Co... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchStructure.py#L64-L128 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py | python | BaseMode.cut_selection_to_clipboard | (self, e) | Copy the text in the region to the windows clipboard. | Copy the text in the region to the windows clipboard. | [
"Copy",
"the",
"text",
"in",
"the",
"region",
"to",
"the",
"windows",
"clipboard",
"."
] | def cut_selection_to_clipboard(self, e): # ()
'''Copy the text in the region to the windows clipboard.'''
self.l_buffer.cut_selection_to_clipboard() | [
"def",
"cut_selection_to_clipboard",
"(",
"self",
",",
"e",
")",
":",
"# ()",
"self",
".",
"l_buffer",
".",
"cut_selection_to_clipboard",
"(",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py#L429-L431 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/packages/six.py | python | add_move | (move) | Add an item to six.moves. | Add an item to six.moves. | [
"Add",
"an",
"item",
"to",
"six",
".",
"moves",
"."
] | def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move) | [
"def",
"add_move",
"(",
"move",
")",
":",
"setattr",
"(",
"_MovedItems",
",",
"move",
".",
"name",
",",
"move",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/packages/six.py#L516-L518 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/applesingle.py | python | decode | (infile, outpath, resonly=False, verbose=False) | decode(infile, outpath [, resonly=False, verbose=False])
Creates a decoded file from an AppleSingle encoded file.
If resonly is True, then it will create a regular file at
outpath containing only the resource fork from infile.
Otherwise it will create an AppleDouble file at outpath
with the data an... | decode(infile, outpath [, resonly=False, verbose=False]) | [
"decode",
"(",
"infile",
"outpath",
"[",
"resonly",
"=",
"False",
"verbose",
"=",
"False",
"]",
")"
] | def decode(infile, outpath, resonly=False, verbose=False):
"""decode(infile, outpath [, resonly=False, verbose=False])
Creates a decoded file from an AppleSingle encoded file.
If resonly is True, then it will create a regular file at
outpath containing only the resource fork from infile.
Otherwise ... | [
"def",
"decode",
"(",
"infile",
",",
"outpath",
",",
"resonly",
"=",
"False",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"hasattr",
"(",
"infile",
",",
"'read'",
")",
":",
"if",
"isinstance",
"(",
"infile",
",",
"Carbon",
".",
"File",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/applesingle.py#L107-L132 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/matplotlib-inline/matplotlib_inline/config.py | python | pil_available | () | return out | Test if PIL/Pillow is available | Test if PIL/Pillow is available | [
"Test",
"if",
"PIL",
"/",
"Pillow",
"is",
"available"
] | def pil_available():
"""Test if PIL/Pillow is available"""
out = False
try:
from PIL import Image # noqa
out = True
except ImportError:
pass
return out | [
"def",
"pil_available",
"(",
")",
":",
"out",
"=",
"False",
"try",
":",
"from",
"PIL",
"import",
"Image",
"# noqa",
"out",
"=",
"True",
"except",
"ImportError",
":",
"pass",
"return",
"out"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/matplotlib-inline/matplotlib_inline/config.py#L16-L24 | |
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | python/kudu/util.py | python | from_unixtime_micros | (unixtime_micros) | Convert the input unixtime_micros value to a datetime in UTC.
Parameters
----------
unixtime_micros : int
Number of microseconds since the unix epoch.
Returns
-------
timestamp : datetime.datetime in UTC | Convert the input unixtime_micros value to a datetime in UTC. | [
"Convert",
"the",
"input",
"unixtime_micros",
"value",
"to",
"a",
"datetime",
"in",
"UTC",
"."
] | def from_unixtime_micros(unixtime_micros):
"""
Convert the input unixtime_micros value to a datetime in UTC.
Parameters
----------
unixtime_micros : int
Number of microseconds since the unix epoch.
Returns
-------
timestamp : datetime.datetime in UTC
"""
if isinstance(uni... | [
"def",
"from_unixtime_micros",
"(",
"unixtime_micros",
")",
":",
"if",
"isinstance",
"(",
"unixtime_micros",
",",
"int",
")",
":",
"return",
"_epoch",
"(",
")",
"+",
"datetime",
".",
"timedelta",
"(",
"microseconds",
"=",
"unixtime_micros",
")",
"else",
":",
... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/python/kudu/util.py#L87-L104 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugin.py | python | PluginConfigObject.GetBitmap | (self) | return wx.NullBitmap | Get the 32x32 bitmap to show in the config dialog
@return: wx.Bitmap
@note: Optional if not implemented default icon will be used | Get the 32x32 bitmap to show in the config dialog
@return: wx.Bitmap
@note: Optional if not implemented default icon will be used | [
"Get",
"the",
"32x32",
"bitmap",
"to",
"show",
"in",
"the",
"config",
"dialog",
"@return",
":",
"wx",
".",
"Bitmap",
"@note",
":",
"Optional",
"if",
"not",
"implemented",
"default",
"icon",
"will",
"be",
"used"
] | def GetBitmap(self):
"""Get the 32x32 bitmap to show in the config dialog
@return: wx.Bitmap
@note: Optional if not implemented default icon will be used
"""
return wx.NullBitmap | [
"def",
"GetBitmap",
"(",
"self",
")",
":",
"return",
"wx",
".",
"NullBitmap"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L254-L260 | |
wujixiu/helmet-detection | 8eff5c59ddfba5a29e0b76aeb48babcb49246178 | hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py | python | FindPreviousMatchingAngleBracket | (clean_lines, linenum, init_prefix) | return False | Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True if a matching bracket exists. | Find the corresponding < that started a template. | [
"Find",
"the",
"corresponding",
"<",
"that",
"started",
"a",
"template",
"."
] | def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
"""Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True i... | [
"def",
"FindPreviousMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_prefix",
")",
":",
"line",
"=",
"init_prefix",
"nesting_stack",
"=",
"[",
"'>'",
"]",
"while",
"True",
":",
"# Find the previous operator",
"match",
"=",
"Search",
"(",
"r'^(... | https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py#L2590-L2644 | |
xlgames-inc/XLE | cdd8682367d9e9fdbdda9f79d72bb5b1499cec46 | Foreign/FreeType/src/tools/docmaker/content.py | python | ContentProcessor.add_markup | ( self ) | Add a new markup section. | Add a new markup section. | [
"Add",
"a",
"new",
"markup",
"section",
"."
] | def add_markup( self ):
"""Add a new markup section."""
if self.markup and self.markup_lines:
# get rid of last line of markup if it's empty
marks = self.markup_lines
if len( marks ) > 0 and not string.strip( marks[-1] ):
self.markup_lines = marks[:-... | [
"def",
"add_markup",
"(",
"self",
")",
":",
"if",
"self",
".",
"markup",
"and",
"self",
".",
"markup_lines",
":",
"# get rid of last line of markup if it's empty",
"marks",
"=",
"self",
".",
"markup_lines",
"if",
"len",
"(",
"marks",
")",
">",
"0",
"and",
"n... | https://github.com/xlgames-inc/XLE/blob/cdd8682367d9e9fdbdda9f79d72bb5b1499cec46/Foreign/FreeType/src/tools/docmaker/content.py#L415-L429 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBThreadPlan.SetPlanComplete | (self, success) | return _lldb.SBThreadPlan_SetPlanComplete(self, success) | SetPlanComplete(SBThreadPlan self, bool success) | SetPlanComplete(SBThreadPlan self, bool success) | [
"SetPlanComplete",
"(",
"SBThreadPlan",
"self",
"bool",
"success",
")"
] | def SetPlanComplete(self, success):
"""SetPlanComplete(SBThreadPlan self, bool success)"""
return _lldb.SBThreadPlan_SetPlanComplete(self, success) | [
"def",
"SetPlanComplete",
"(",
"self",
",",
"success",
")",
":",
"return",
"_lldb",
".",
"SBThreadPlan_SetPlanComplete",
"(",
"self",
",",
"success",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L12162-L12164 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/simpleapi.py | python | _get_function_spec | (func) | return calltip | Get the python function signature for the given function object
:param func: A Python function object | Get the python function signature for the given function object | [
"Get",
"the",
"python",
"function",
"signature",
"for",
"the",
"given",
"function",
"object"
] | def _get_function_spec(func):
"""Get the python function signature for the given function object
:param func: A Python function object
"""
import inspect
try:
argspec = inspect.getfullargspec(func)
except TypeError:
return ''
# Algorithm functions have varargs set not args
... | [
"def",
"_get_function_spec",
"(",
"func",
")",
":",
"import",
"inspect",
"try",
":",
"argspec",
"=",
"inspect",
".",
"getfullargspec",
"(",
"func",
")",
"except",
"TypeError",
":",
"return",
"''",
"# Algorithm functions have varargs set not args",
"args",
"=",
"ar... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L570-L627 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/op_hint.py | python | _find_all_hints_in_nodes | (nodes) | return func_calls | Look at the all the input nodes and return a list of LiteFuncCall objs.
Args:
nodes: A TensorFlow graph_def to look for LiteFuncCalls.
Returns:
a list of `LifeFuncCall` objects in the form | Look at the all the input nodes and return a list of LiteFuncCall objs. | [
"Look",
"at",
"the",
"all",
"the",
"input",
"nodes",
"and",
"return",
"a",
"list",
"of",
"LiteFuncCall",
"objs",
"."
] | def _find_all_hints_in_nodes(nodes):
"""Look at the all the input nodes and return a list of LiteFuncCall objs.
Args:
nodes: A TensorFlow graph_def to look for LiteFuncCalls.
Returns:
a list of `LifeFuncCall` objects in the form
"""
func_calls = _collections.defaultdict(_LiteFuncCall)
for node i... | [
"def",
"_find_all_hints_in_nodes",
"(",
"nodes",
")",
":",
"func_calls",
"=",
"_collections",
".",
"defaultdict",
"(",
"_LiteFuncCall",
")",
"for",
"node",
"in",
"nodes",
":",
"attr",
"=",
"node",
".",
"attr",
"# This is an op hint if it has a FUNCTION_UUID_ATTR, othe... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/op_hint.py#L723-L783 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32com/server/register.py | python | _set_string | (path, value, base=win32con.HKEY_CLASSES_ROOT) | Set a string value in the registry. | Set a string value in the registry. | [
"Set",
"a",
"string",
"value",
"in",
"the",
"registry",
"."
] | def _set_string(path, value, base=win32con.HKEY_CLASSES_ROOT):
"Set a string value in the registry."
win32api.RegSetValue(base, path, win32con.REG_SZ, value) | [
"def",
"_set_string",
"(",
"path",
",",
"value",
",",
"base",
"=",
"win32con",
".",
"HKEY_CLASSES_ROOT",
")",
":",
"win32api",
".",
"RegSetValue",
"(",
"base",
",",
"path",
",",
"win32con",
".",
"REG_SZ",
",",
"value",
")"
] | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/server/register.py#L28-L31 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/grappler/item.py | python | Item.__init__ | (self,
metagraph,
ignore_colocation=True,
ignore_user_placement=False) | Creates an Item.
Args:
metagraph: a TensorFlow metagraph.
ignore_colocation: if set, the tool will ignore all the colocation
constraints generated by TensorFlow.
ignore_user_placement: if set, all the placement annotations annotated in
the metagraph will be ignored.
Raises:
... | Creates an Item. | [
"Creates",
"an",
"Item",
"."
] | def __init__(self,
metagraph,
ignore_colocation=True,
ignore_user_placement=False):
"""Creates an Item.
Args:
metagraph: a TensorFlow metagraph.
ignore_colocation: if set, the tool will ignore all the colocation
constraints generated by TensorFlo... | [
"def",
"__init__",
"(",
"self",
",",
"metagraph",
",",
"ignore_colocation",
"=",
"True",
",",
"ignore_user_placement",
"=",
"False",
")",
":",
"self",
".",
"_metagraph",
"=",
"metagraph",
"self",
".",
"_item_graph",
"=",
"meta_graph_pb2",
".",
"MetaGraphDef",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/grappler/item.py#L25-L46 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/distributions/beta.py | python | Beta.concentration1 | (self) | return self._concentration1 | Concentration parameter associated with a `1` outcome. | Concentration parameter associated with a `1` outcome. | [
"Concentration",
"parameter",
"associated",
"with",
"a",
"1",
"outcome",
"."
] | def concentration1(self):
"""Concentration parameter associated with a `1` outcome."""
return self._concentration1 | [
"def",
"concentration1",
"(",
"self",
")",
":",
"return",
"self",
".",
"_concentration1"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/beta.py#L180-L182 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py | python | idz_frm | (n, w, x) | return _id.idz_frm(n, w, x) | Transform complex vector via a composition of Rokhlin's random transform,
random subselection, and an FFT.
In contrast to :func:`idz_sfrm`, this routine works best when the length of
the transformed vector is the power-of-two integer output by
:func:`idz_frmi`, or when the length is not specified but i... | Transform complex vector via a composition of Rokhlin's random transform,
random subselection, and an FFT. | [
"Transform",
"complex",
"vector",
"via",
"a",
"composition",
"of",
"Rokhlin",
"s",
"random",
"transform",
"random",
"subselection",
"and",
"an",
"FFT",
"."
] | def idz_frm(n, w, x):
"""
Transform complex vector via a composition of Rokhlin's random transform,
random subselection, and an FFT.
In contrast to :func:`idz_sfrm`, this routine works best when the length of
the transformed vector is the power-of-two integer output by
:func:`idz_frmi`, or when... | [
"def",
"idz_frm",
"(",
"n",
",",
"w",
",",
"x",
")",
":",
"return",
"_id",
".",
"idz_frm",
"(",
"n",
",",
"w",
",",
"x",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L878-L904 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/interpolate.py | python | spleval | (xck, xnew, deriv=0) | return res | Evaluate a fixed spline represented by the given tuple at the new x-values
The `xj` values are the interior knot points. The approximation
region is `xj[0]` to `xj[-1]`. If N+1 is the length of `xj`, then `cvals`
should have length N+k where `k` is the order of the spline.
Parameters
----------
... | Evaluate a fixed spline represented by the given tuple at the new x-values | [
"Evaluate",
"a",
"fixed",
"spline",
"represented",
"by",
"the",
"given",
"tuple",
"at",
"the",
"new",
"x",
"-",
"values"
] | def spleval(xck, xnew, deriv=0):
"""
Evaluate a fixed spline represented by the given tuple at the new x-values
The `xj` values are the interior knot points. The approximation
region is `xj[0]` to `xj[-1]`. If N+1 is the length of `xj`, then `cvals`
should have length N+k where `k` is the order o... | [
"def",
"spleval",
"(",
"xck",
",",
"xnew",
",",
"deriv",
"=",
"0",
")",
":",
"(",
"xj",
",",
"cvals",
",",
"k",
")",
"=",
"xck",
"oldshape",
"=",
"np",
".",
"shape",
"(",
"xnew",
")",
"xx",
"=",
"np",
".",
"ravel",
"(",
"xnew",
")",
"sh",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/interpolate.py#L2937-L2986 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py | python | PublishManagerHelper.GetTargetDetails | (self, target_path) | return target_details | gets target details by target path.
Args:
target_path: target path.
Raises:
PublishServeException
Returns:
target details of a target. | gets target details by target path. | [
"gets",
"target",
"details",
"by",
"target",
"path",
"."
] | def GetTargetDetails(self, target_path):
"""gets target details by target path.
Args:
target_path: target path.
Raises:
PublishServeException
Returns:
target details of a target.
"""
target_details = {}
target_db_details = {}
publish_context = {}
target_db_details... | [
"def",
"GetTargetDetails",
"(",
"self",
",",
"target_path",
")",
":",
"target_details",
"=",
"{",
"}",
"target_db_details",
"=",
"{",
"}",
"publish_context",
"=",
"{",
"}",
"target_db_details",
"=",
"self",
".",
"_QueryTargetDbDetailsByPath",
"(",
"target_path",
... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py#L1591-L1625 | |
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | webvis/pydot.py | python | graph_from_adjacency_matrix | (matrix, node_prefix= u'', directed=False) | return graph | Creates a basic graph out of an adjacency matrix.
The matrix has to be a list of rows of values
representing an adjacency matrix.
The values can be anything: bool, int, float, as long
as they can evaluate to True or False. | Creates a basic graph out of an adjacency matrix.
The matrix has to be a list of rows of values
representing an adjacency matrix.
The values can be anything: bool, int, float, as long
as they can evaluate to True or False. | [
"Creates",
"a",
"basic",
"graph",
"out",
"of",
"an",
"adjacency",
"matrix",
".",
"The",
"matrix",
"has",
"to",
"be",
"a",
"list",
"of",
"rows",
"of",
"values",
"representing",
"an",
"adjacency",
"matrix",
".",
"The",
"values",
"can",
"be",
"anything",
":... | def graph_from_adjacency_matrix(matrix, node_prefix= u'', directed=False):
"""Creates a basic graph out of an adjacency matrix.
The matrix has to be a list of rows of values
representing an adjacency matrix.
The values can be anything: bool, int, float, as long
as they can evaluate to True or F... | [
"def",
"graph_from_adjacency_matrix",
"(",
"matrix",
",",
"node_prefix",
"=",
"u''",
",",
"directed",
"=",
"False",
")",
":",
"node_orig",
"=",
"1",
"if",
"directed",
":",
"graph",
"=",
"Dot",
"(",
"graph_type",
"=",
"'digraph'",
")",
"else",
":",
"graph",... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/webvis/pydot.py#L274-L307 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/ext.py | python | InternationalizationExtension._make_node | (self, singular, plural, variables, plural_expr,
vars_referenced, num_called_num) | return nodes.Output([node]) | Generates a useful node from the data provided. | Generates a useful node from the data provided. | [
"Generates",
"a",
"useful",
"node",
"from",
"the",
"data",
"provided",
"."
] | def _make_node(self, singular, plural, variables, plural_expr,
vars_referenced, num_called_num):
"""Generates a useful node from the data provided."""
# no variables referenced? no need to escape for old style
# gettext invocations only if there are vars.
if not vars_... | [
"def",
"_make_node",
"(",
"self",
",",
"singular",
",",
"plural",
",",
"variables",
",",
"plural_expr",
",",
"vars_referenced",
",",
"num_called_num",
")",
":",
"# no variables referenced? no need to escape for old style",
"# gettext invocations only if there are vars.",
"if... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/ext.py#L341-L387 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/dispatch.py | python | HsaUFuncDispatcher.__call__ | (self, *args, **kws) | return HsaUFuncMechanism.call(self.functions, args, kws) | *args: numpy arrays
**kws:
stream -- hsa stream; when defined, asynchronous mode is used.
out -- output array. Can be a numpy array or DeviceArrayBase
depending on the input arguments. Type must match
the input arguments. | *args: numpy arrays
**kws:
stream -- hsa stream; when defined, asynchronous mode is used.
out -- output array. Can be a numpy array or DeviceArrayBase
depending on the input arguments. Type must match
the input arguments. | [
"*",
"args",
":",
"numpy",
"arrays",
"**",
"kws",
":",
"stream",
"--",
"hsa",
"stream",
";",
"when",
"defined",
"asynchronous",
"mode",
"is",
"used",
".",
"out",
"--",
"output",
"array",
".",
"Can",
"be",
"a",
"numpy",
"array",
"or",
"DeviceArrayBase",
... | def __call__(self, *args, **kws):
"""
*args: numpy arrays
**kws:
stream -- hsa stream; when defined, asynchronous mode is used.
out -- output array. Can be a numpy array or DeviceArrayBase
depending on the input arguments. Type must match
... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kws",
")",
":",
"return",
"HsaUFuncMechanism",
".",
"call",
"(",
"self",
".",
"functions",
",",
"args",
",",
"kws",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/dispatch.py#L19-L28 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | cd/utils/artifact_repository.py | python | write_libmxnet_meta | (args: argparse.Namespace, destination: str) | Writes a file called libmxnet.meta in the 'destination' folder that contains
the libmxnet library information (commit id, type, etc.).
:param args: A Namespace object containing the library
:param destination: The folder in which to place the libmxnet.meta | Writes a file called libmxnet.meta in the 'destination' folder that contains
the libmxnet library information (commit id, type, etc.).
:param args: A Namespace object containing the library
:param destination: The folder in which to place the libmxnet.meta | [
"Writes",
"a",
"file",
"called",
"libmxnet",
".",
"meta",
"in",
"the",
"destination",
"folder",
"that",
"contains",
"the",
"libmxnet",
"library",
"information",
"(",
"commit",
"id",
"type",
"etc",
".",
")",
".",
":",
"param",
"args",
":",
"A",
"Namespace",... | def write_libmxnet_meta(args: argparse.Namespace, destination: str):
"""
Writes a file called libmxnet.meta in the 'destination' folder that contains
the libmxnet library information (commit id, type, etc.).
:param args: A Namespace object containing the library
:param destination: The folder in whi... | [
"def",
"write_libmxnet_meta",
"(",
"args",
":",
"argparse",
".",
"Namespace",
",",
"destination",
":",
"str",
")",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"destination",
",",
"'libmxnet.meta'",
")",
",",
"'w'",
")",
"as",
"fp",
"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/cd/utils/artifact_repository.py#L71-L84 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/docs/tools/dump_ast_matchers.py | python | unify_arguments | (args) | return args | Gets rid of anything the user doesn't care about in the argument list. | Gets rid of anything the user doesn't care about in the argument list. | [
"Gets",
"rid",
"of",
"anything",
"the",
"user",
"doesn",
"t",
"care",
"about",
"in",
"the",
"argument",
"list",
"."
] | def unify_arguments(args):
"""Gets rid of anything the user doesn't care about in the argument list."""
args = re.sub(r'internal::', r'', args)
args = re.sub(r'extern const\s+(.*)&', r'\1 ', args)
args = re.sub(r'&', r' ', args)
args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args)
return args | [
"def",
"unify_arguments",
"(",
"args",
")",
":",
"args",
"=",
"re",
".",
"sub",
"(",
"r'internal::'",
",",
"r''",
",",
"args",
")",
"args",
"=",
"re",
".",
"sub",
"(",
"r'extern const\\s+(.*)&'",
",",
"r'\\1 '",
",",
"args",
")",
"args",
"=",
"re",
"... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/docs/tools/dump_ast_matchers.py#L98-L104 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/format/policy_templates/writers/plist_writer.py | python | PListWriter._AddTargets | (self, parent, policy) | Adds the following XML snippet to an XML element:
<key>pfm_targets</key>
<array>
<string>user-managed</string>
</array>
Args:
parent: The parent XML element where the snippet will be added. | Adds the following XML snippet to an XML element:
<key>pfm_targets</key>
<array>
<string>user-managed</string>
</array> | [
"Adds",
"the",
"following",
"XML",
"snippet",
"to",
"an",
"XML",
"element",
":",
"<key",
">",
"pfm_targets<",
"/",
"key",
">",
"<array",
">",
"<string",
">",
"user",
"-",
"managed<",
"/",
"string",
">",
"<",
"/",
"array",
">"
] | def _AddTargets(self, parent, policy):
'''Adds the following XML snippet to an XML element:
<key>pfm_targets</key>
<array>
<string>user-managed</string>
</array>
Args:
parent: The parent XML element where the snippet will be added.
'''
array = self._AddKeyValuePair(p... | [
"def",
"_AddTargets",
"(",
"self",
",",
"parent",
",",
"policy",
")",
":",
"array",
"=",
"self",
".",
"_AddKeyValuePair",
"(",
"parent",
",",
"'pfm_targets'",
",",
"'array'",
")",
"if",
"self",
".",
"CanBeRecommended",
"(",
"policy",
")",
":",
"self",
".... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/plist_writer.py#L70-L84 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-time.py | python | SConsTimer.get_object_counts | (self, file, object_name, index=None) | return result | Returns the counts of the specified object_name. | Returns the counts of the specified object_name. | [
"Returns",
"the",
"counts",
"of",
"the",
"specified",
"object_name",
"."
] | def get_object_counts(self, file, object_name, index=None):
"""
Returns the counts of the specified object_name.
"""
object_string = ' ' + object_name + '\n'
with open(file) as f:
lines = f.readlines()
line = [l for l in lines if l.endswith(object_string)][0]
... | [
"def",
"get_object_counts",
"(",
"self",
",",
"file",
",",
"object_name",
",",
"index",
"=",
"None",
")",
":",
"object_string",
"=",
"' '",
"+",
"object_name",
"+",
"'\\n'",
"with",
"open",
"(",
"file",
")",
"as",
"f",
":",
"lines",
"=",
"f",
".",
"r... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-time.py#L686-L697 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/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/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py#L1727-L1806 | ||
flexflow/FlexFlow | 581fad8ba8d10a16a3102ee2b406b0319586df24 | python/flexflow/keras/utils/data_utils.py | python | OrderedEnqueuer._run | (self) | Submits request to the executor and queue the `Future` objects. | Submits request to the executor and queue the `Future` objects. | [
"Submits",
"request",
"to",
"the",
"executor",
"and",
"queue",
"the",
"Future",
"objects",
"."
] | def _run(self):
"""Submits request to the executor and queue the `Future` objects."""
while True:
sequence = list(range(len(self.sequence)))
self._send_sequence() # Share the initial sequence
if self.shuffle:
random.shuffle(sequence)
wit... | [
"def",
"_run",
"(",
"self",
")",
":",
"while",
"True",
":",
"sequence",
"=",
"list",
"(",
"range",
"(",
"len",
"(",
"self",
".",
"sequence",
")",
")",
")",
"self",
".",
"_send_sequence",
"(",
")",
"# Share the initial sequence",
"if",
"self",
".",
"shu... | https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/keras/utils/data_utils.py#L563-L590 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/selection.py | python | SelectIDs | (IDs=[], FieldType='POINT', ContainingCells=False, Source=None, Modifier=None) | Select attributes by attribute IDs.
- IDs - list of IDs of attribute types to select. Defined as (process number, attribute ID) pairs
interleaved in a single list. For multiblock datasets, this will select attributes on all
blocks of the provided (processor number, attribute ID) pairs
- FieldType -... | Select attributes by attribute IDs. | [
"Select",
"attributes",
"by",
"attribute",
"IDs",
"."
] | def SelectIDs(IDs=[], FieldType='POINT', ContainingCells=False, Source=None, Modifier=None):
"""Select attributes by attribute IDs.
- IDs - list of IDs of attribute types to select. Defined as (process number, attribute ID) pairs
interleaved in a single list. For multiblock datasets, this will select att... | [
"def",
"SelectIDs",
"(",
"IDs",
"=",
"[",
"]",
",",
"FieldType",
"=",
"'POINT'",
",",
"ContainingCells",
"=",
"False",
",",
"Source",
"=",
"None",
",",
"Modifier",
"=",
"None",
")",
":",
"_selectIDsHelper",
"(",
"'IDSelectionSource'",
",",
"*",
"*",
"loc... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/selection.py#L358-L371 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/backends/chrome/tab_list_backend.py | python | TabListBackend.CloseTab | (self, tab_id, timeout=300) | Closes the tab with the given debugger_url.
Raises:
devtools_http.DevToolsClientConnectionError
devtools_client_backend.TabNotFoundError
TabUnexpectedResponseException
exceptions.TimeoutException | Closes the tab with the given debugger_url. | [
"Closes",
"the",
"tab",
"with",
"the",
"given",
"debugger_url",
"."
] | def CloseTab(self, tab_id, timeout=300):
"""Closes the tab with the given debugger_url.
Raises:
devtools_http.DevToolsClientConnectionError
devtools_client_backend.TabNotFoundError
TabUnexpectedResponseException
exceptions.TimeoutException
"""
assert self._browser_backend.suppor... | [
"def",
"CloseTab",
"(",
"self",
",",
"tab_id",
",",
"timeout",
"=",
"300",
")",
":",
"assert",
"self",
".",
"_browser_backend",
".",
"supports_tab_control",
"# TODO(dtu): crbug.com/160946, allow closing the last tab on some platforms.",
"# For now, just create a new tab before ... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/backends/chrome/tab_list_backend.py#L44-L66 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/util/tf_inspect.py | python | isfunction | (object) | return _inspect.isfunction(tf_decorator.unwrap(object)[1]) | TFDecorator-aware replacement for inspect.isfunction. | TFDecorator-aware replacement for inspect.isfunction. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"isfunction",
"."
] | def isfunction(object): # pylint: disable=redefined-builtin
"""TFDecorator-aware replacement for inspect.isfunction."""
return _inspect.isfunction(tf_decorator.unwrap(object)[1]) | [
"def",
"isfunction",
"(",
"object",
")",
":",
"# pylint: disable=redefined-builtin",
"return",
"_inspect",
".",
"isfunction",
"(",
"tf_decorator",
".",
"unwrap",
"(",
"object",
")",
"[",
"1",
"]",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/tf_inspect.py#L379-L381 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py | python | QuantizedConv2d.from_float | (cls, mod, qconfig) | return conv | Create a qat module from a float module.
Args:
mod: A float module of type torch.nn.Conv2d.
qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig):
A qconfig object that saves the quantizers for the module. | Create a qat module from a float module. | [
"Create",
"a",
"qat",
"module",
"from",
"a",
"float",
"module",
"."
] | def from_float(cls, mod, qconfig):
"""Create a qat module from a float module.
Args:
mod: A float module of type torch.nn.Conv2d.
qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig):
A qconfig object that saves the quantizers for the module.
"""
assert qconfig, 'qco... | [
"def",
"from_float",
"(",
"cls",
",",
"mod",
",",
"qconfig",
")",
":",
"assert",
"qconfig",
",",
"'qconfig must be provided for quantized module'",
"assert",
"type",
"(",
"mod",
")",
"==",
"cls",
".",
"_FLOAT_MODULE",
",",
"' qat.'",
"+",
"cls",
".",
"__name__... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py#L84-L110 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py | python | put | (a, ind, v, mode='raise') | return put(ind, v, mode=mode) | Replaces specified elements of an array with given values.
The indexing works on the flattened target array. `put` is roughly
equivalent to:
::
a.flat[ind] = v
Parameters
----------
a : ndarray
Target array.
ind : array_like
Target indices, interpreted as integers... | Replaces specified elements of an array with given values. | [
"Replaces",
"specified",
"elements",
"of",
"an",
"array",
"with",
"given",
"values",
"."
] | def put(a, ind, v, mode='raise'):
"""
Replaces specified elements of an array with given values.
The indexing works on the flattened target array. `put` is roughly
equivalent to:
::
a.flat[ind] = v
Parameters
----------
a : ndarray
Target array.
ind : array_like
... | [
"def",
"put",
"(",
"a",
",",
"ind",
",",
"v",
",",
"mode",
"=",
"'raise'",
")",
":",
"try",
":",
"put",
"=",
"a",
".",
"put",
"except",
"AttributeError",
":",
"raise",
"TypeError",
"(",
"\"argument 1 must be numpy.ndarray, \"",
"\"not {name}\"",
".",
"form... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L490-L546 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armorycolors.py | python | tweakColor | (qcolor, op, tweaks) | return QColor(r,g,b) | We want to be able to take existing colors (from the palette)
and tweak them. This may involved "inverting" them, or
multiplying or adding scalars to the various channels. | We want to be able to take existing colors (from the palette)
and tweak them. This may involved "inverting" them, or
multiplying or adding scalars to the various channels. | [
"We",
"want",
"to",
"be",
"able",
"to",
"take",
"existing",
"colors",
"(",
"from",
"the",
"palette",
")",
"and",
"tweak",
"them",
".",
"This",
"may",
"involved",
"inverting",
"them",
"or",
"multiplying",
"or",
"adding",
"scalars",
"to",
"the",
"various",
... | def tweakColor(qcolor, op, tweaks):
"""
We want to be able to take existing colors (from the palette)
and tweak them. This may involved "inverting" them, or
multiplying or adding scalars to the various channels.
"""
if len(tweaks) != 3:
raise InvalidColor, 'Must supply list or tuple of RGB twe... | [
"def",
"tweakColor",
"(",
"qcolor",
",",
"op",
",",
"tweaks",
")",
":",
"if",
"len",
"(",
"tweaks",
")",
"!=",
"3",
":",
"raise",
"InvalidColor",
",",
"'Must supply list or tuple of RGB tweaks'",
"# Determine what the \"tweaks\" list/tuple means",
"tweakChannel",
"=",... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armorycolors.py#L42-L73 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/handler.py | python | ContentHandler.ignorableWhitespace | (self, whitespace) | Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk
of ignorable whitespace (see the W3C XML 1.0 recommendation,
section 2.10): non-validating parsers may also use this method
if they are capable of parsing and us... | Receive notification of ignorable whitespace in element content. | [
"Receive",
"notification",
"of",
"ignorable",
"whitespace",
"in",
"element",
"content",
"."
] | def ignorableWhitespace(self, whitespace):
"""Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk
of ignorable whitespace (see the W3C XML 1.0 recommendation,
section 2.10): non-validating parsers may also use thi... | [
"def",
"ignorableWhitespace",
"(",
"self",
",",
"whitespace",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/handler.py#L168-L180 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | exodus.get_side_set | (self, id) | return (side_set_elem_list, side_set_side_list) | ss_elems, ss_sides = exo.get_side_set(side_set_id)
-> get the lists of element and side indices in a side set; the
two lists correspond: together, ss_elems[i] and ss_sides[i]
define the face of an element
input value(s):
<int> side_set_id side set *ID* (not *I... | ss_elems, ss_sides = exo.get_side_set(side_set_id) | [
"ss_elems",
"ss_sides",
"=",
"exo",
".",
"get_side_set",
"(",
"side_set_id",
")"
] | def get_side_set(self, id):
"""
ss_elems, ss_sides = exo.get_side_set(side_set_id)
-> get the lists of element and side indices in a side set; the
two lists correspond: together, ss_elems[i] and ss_sides[i]
define the face of an element
input value(s):
... | [
"def",
"get_side_set",
"(",
"self",
",",
"id",
")",
":",
"(",
"side_set_elem_list",
",",
"side_set_side_list",
")",
"=",
"self",
".",
"__ex_get_side_set",
"(",
"id",
")",
"if",
"self",
".",
"use_numpy",
":",
"side_set_elem_list",
"=",
"ctype_to_numpy",
"(",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L2689-L2714 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L1254-L1297 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/common.py | python | get_graph_element_name | (elem) | return elem.name if hasattr(elem, "name") else str(elem) | Obtain the name or string representation of a graph element.
If the graph element has the attribute "name", return name. Otherwise, return
a __str__ representation of the graph element. Certain graph elements, such as
`SparseTensor`s, do not have the attribute "name".
Args:
elem: The graph element in ques... | Obtain the name or string representation of a graph element. | [
"Obtain",
"the",
"name",
"or",
"string",
"representation",
"of",
"a",
"graph",
"element",
"."
] | def get_graph_element_name(elem):
"""Obtain the name or string representation of a graph element.
If the graph element has the attribute "name", return name. Otherwise, return
a __str__ representation of the graph element. Certain graph elements, such as
`SparseTensor`s, do not have the attribute "name".
Ar... | [
"def",
"get_graph_element_name",
"(",
"elem",
")",
":",
"return",
"elem",
".",
"name",
"if",
"hasattr",
"(",
"elem",
",",
"\"name\"",
")",
"else",
"str",
"(",
"elem",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/common.py#L25-L40 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_Rewrap_REQUEST.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPM2_Rewrap_REQUEST) | Returns new TPM2_Rewrap_REQUEST object constructed from its
marshaled representation in the given byte buffer | Returns new TPM2_Rewrap_REQUEST object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"TPM2_Rewrap_REQUEST",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPM2_Rewrap_REQUEST object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPM2_Rewrap_REQUEST) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPM2_Rewrap_REQUEST",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L10429-L10433 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/toolkits/_internal_utils.py | python | _summarize_coefficients | (top_coefs, bottom_coefs) | return ([top_coefs_list, bottom_coefs_list], \
[ 'Highest Positive Coefficients', 'Lowest Negative Coefficients'] ) | Return a tuple of sections and section titles.
Sections are pretty print of model coefficients
Parameters
----------
top_coefs : SFrame of top k coefficients
bottom_coefs : SFrame of bottom k coefficients
Returns
-------
(sections, section_titles) : tuple
sections : list
... | Return a tuple of sections and section titles.
Sections are pretty print of model coefficients | [
"Return",
"a",
"tuple",
"of",
"sections",
"and",
"section",
"titles",
".",
"Sections",
"are",
"pretty",
"print",
"of",
"model",
"coefficients"
] | def _summarize_coefficients(top_coefs, bottom_coefs):
"""
Return a tuple of sections and section titles.
Sections are pretty print of model coefficients
Parameters
----------
top_coefs : SFrame of top k coefficients
bottom_coefs : SFrame of bottom k coefficients
Returns
-------
... | [
"def",
"_summarize_coefficients",
"(",
"top_coefs",
",",
"bottom_coefs",
")",
":",
"def",
"get_row_name",
"(",
"row",
")",
":",
"if",
"row",
"[",
"'index'",
"]",
"==",
"None",
":",
"return",
"row",
"[",
"'name'",
"]",
"else",
":",
"return",
"\"%s[%s]\"",
... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/toolkits/_internal_utils.py#L105-L146 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/mainframe.py | python | AgileMainframe.on_open | (self, event) | Open a document | Open a document | [
"Open",
"a",
"document"
] | def on_open(self, event):
"""Open a document"""
#wildcards = CreateWildCards() + "All files (*.*)|*.*"
print 'open it!!' | [
"def",
"on_open",
"(",
"self",
",",
"event",
")",
":",
"#wildcards = CreateWildCards() + \"All files (*.*)|*.*\"",
"print",
"'open it!!'"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/mainframe.py#L397-L400 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridInterface.SetPropertyAttribute | (*args, **kwargs) | return _propgrid.PropertyGridInterface_SetPropertyAttribute(*args, **kwargs) | SetPropertyAttribute(self, PGPropArg id, String attrName, wxVariant value, long argFlags=0) | SetPropertyAttribute(self, PGPropArg id, String attrName, wxVariant value, long argFlags=0) | [
"SetPropertyAttribute",
"(",
"self",
"PGPropArg",
"id",
"String",
"attrName",
"wxVariant",
"value",
"long",
"argFlags",
"=",
"0",
")"
] | def SetPropertyAttribute(*args, **kwargs):
"""SetPropertyAttribute(self, PGPropArg id, String attrName, wxVariant value, long argFlags=0)"""
return _propgrid.PropertyGridInterface_SetPropertyAttribute(*args, **kwargs) | [
"def",
"SetPropertyAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_SetPropertyAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1377-L1379 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | tools/scan-build-py/libscanbuild/analyze.py | python | analyze_compiler_wrapper | () | return compiler_wrapper(analyze_compiler_wrapper_impl) | Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. | Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. | [
"Entry",
"point",
"for",
"analyze",
"-",
"cc",
"and",
"analyze",
"-",
"c",
"++",
"compiler",
"wrappers",
"."
] | def analyze_compiler_wrapper():
""" Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. """
return compiler_wrapper(analyze_compiler_wrapper_impl) | [
"def",
"analyze_compiler_wrapper",
"(",
")",
":",
"return",
"compiler_wrapper",
"(",
"analyze_compiler_wrapper_impl",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/tools/scan-build-py/libscanbuild/analyze.py#L291-L294 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/kernel_mount.py | python | KernelMount.get_osd_epoch | (self) | return epoch, barrier | Return 2-tuple of osd_epoch, osd_epoch_barrier | Return 2-tuple of osd_epoch, osd_epoch_barrier | [
"Return",
"2",
"-",
"tuple",
"of",
"osd_epoch",
"osd_epoch_barrier"
] | def get_osd_epoch(self):
"""
Return 2-tuple of osd_epoch, osd_epoch_barrier
"""
osd_map = self.read_debug_file("osdmap")
assert osd_map
lines = osd_map.split("\n")
first_line_tokens = lines[0].split()
epoch, barrier = int(first_line_tokens[1]), int(first_... | [
"def",
"get_osd_epoch",
"(",
"self",
")",
":",
"osd_map",
"=",
"self",
".",
"read_debug_file",
"(",
"\"osdmap\"",
")",
"assert",
"osd_map",
"lines",
"=",
"osd_map",
".",
"split",
"(",
"\"\\n\"",
")",
"first_line_tokens",
"=",
"lines",
"[",
"0",
"]",
".",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/kernel_mount.py#L338-L349 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_CREATION_INFO.fromTpm | (buf) | return buf.createObj(TPMS_CREATION_INFO) | Returns new TPMS_CREATION_INFO object constructed from its marshaled
representation in the given TpmBuffer buffer | Returns new TPMS_CREATION_INFO object constructed from its marshaled
representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPMS_CREATION_INFO",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPMS_CREATION_INFO object constructed from its marshaled
representation in the given TpmBuffer buffer
"""
return buf.createObj(TPMS_CREATION_INFO) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPMS_CREATION_INFO",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5305-L5309 | |
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/pycaffe.py | python | _Net_forward_backward_all | (self, blobs=None, diffs=None, **kwargs) | return all_outs, all_diffs | Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backward) blob names
and values are ndarrays. Refer to forward() and backwar... | Run net forward + backward in batches. | [
"Run",
"net",
"forward",
"+",
"backward",
"in",
"batches",
"."
] | def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs):
"""
Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backw... | [
"def",
"_Net_forward_backward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"diffs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Batch blobs and diffs.",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".... | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/pycaffe.py#L206-L248 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Region.UnionRegion | (*args, **kwargs) | return _gdi_.Region_UnionRegion(*args, **kwargs) | UnionRegion(self, Region region) -> bool | UnionRegion(self, Region region) -> bool | [
"UnionRegion",
"(",
"self",
"Region",
"region",
")",
"-",
">",
"bool"
] | def UnionRegion(*args, **kwargs):
"""UnionRegion(self, Region region) -> bool"""
return _gdi_.Region_UnionRegion(*args, **kwargs) | [
"def",
"UnionRegion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Region_UnionRegion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1611-L1613 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/graph_matcher.py | python | GraphMatcher.__init__ | (self, pattern) | Initializes a GraphMatcher.
Args:
pattern: The `Pattern` against which `GraphMatcher` matches
subgraphs. | Initializes a GraphMatcher. | [
"Initializes",
"a",
"GraphMatcher",
"."
] | def __init__(self, pattern):
"""Initializes a GraphMatcher.
Args:
pattern: The `Pattern` against which `GraphMatcher` matches
subgraphs.
"""
self._pattern = pattern | [
"def",
"__init__",
"(",
"self",
",",
"pattern",
")",
":",
"self",
".",
"_pattern",
"=",
"pattern"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/graph_matcher.py#L204-L211 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime.__init__ | (self, *args, **kwargs) | __init__(self) -> DateTime | __init__(self) -> DateTime | [
"__init__",
"(",
"self",
")",
"-",
">",
"DateTime"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> DateTime"""
_misc_.DateTime_swiginit(self,_misc_.new_DateTime(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_misc_",
".",
"DateTime_swiginit",
"(",
"self",
",",
"_misc_",
".",
"new_DateTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3781-L3783 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Rect.SetTopLeft | (*args, **kwargs) | return _core_.Rect_SetTopLeft(*args, **kwargs) | SetTopLeft(self, Point p) | SetTopLeft(self, Point p) | [
"SetTopLeft",
"(",
"self",
"Point",
"p",
")"
] | def SetTopLeft(*args, **kwargs):
"""SetTopLeft(self, Point p)"""
return _core_.Rect_SetTopLeft(*args, **kwargs) | [
"def",
"SetTopLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_SetTopLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1325-L1327 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/site.py | python | enablerlcompleter | () | Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__.
If the readline module can be imported, the hook will set the Tab key
as completion key and register ~/.python_history as history file.
This can be overridden in the sitecustomize or usercustomize mo... | Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__. | [
"Enable",
"default",
"readline",
"configuration",
"on",
"interactive",
"prompts",
"by",
"registering",
"a",
"sys",
".",
"__interactivehook__",
"."
] | def enablerlcompleter():
"""Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__.
If the readline module can be imported, the hook will set the Tab key
as completion key and register ~/.python_history as history file.
This can be overridden in the s... | [
"def",
"enablerlcompleter",
"(",
")",
":",
"def",
"register_readline",
"(",
")",
":",
"import",
"atexit",
"try",
":",
"import",
"readline",
"import",
"rlcompleter",
"except",
"ImportError",
":",
"return",
"# Reading the initialization (config) file may not be enough to se... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/site.py#L406-L463 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/format/chrome_messages_json.py | python | Format | (root, lang='en', output_dir='.') | Format the messages as JSON. | Format the messages as JSON. | [
"Format",
"the",
"messages",
"as",
"JSON",
"."
] | def Format(root, lang='en', output_dir='.'):
"""Format the messages as JSON."""
yield '{'
encoder = JSONEncoder(ensure_ascii=False)
format = '"%s":{"message":%s%s}'
placeholder_format = '"%i":{"content":"$%i"}'
first = True
for child in root.ActiveDescendants():
if isinstance(child, message.MessageNo... | [
"def",
"Format",
"(",
"root",
",",
"lang",
"=",
"'en'",
",",
"output_dir",
"=",
"'.'",
")",
":",
"yield",
"'{'",
"encoder",
"=",
"JSONEncoder",
"(",
"ensure_ascii",
"=",
"False",
")",
"format",
"=",
"'\"%s\":{\"message\":%s%s}'",
"placeholder_format",
"=",
"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/format/chrome_messages_json.py#L15-L59 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roscpp/rosbuild/scripts/msg_gen.py | python | write_end | (s, spec) | Writes the end of the header file: the ending of the include guards
@param s: The stream to write to
@type s: stream
@param spec: The spec
@type spec: roslib.msgs.MsgSpec | Writes the end of the header file: the ending of the include guards | [
"Writes",
"the",
"end",
"of",
"the",
"header",
"file",
":",
"the",
"ending",
"of",
"the",
"include",
"guards"
] | def write_end(s, spec):
"""
Writes the end of the header file: the ending of the include guards
@param s: The stream to write to
@type s: stream
@param spec: The spec
@type spec: roslib.msgs.MsgSpec
"""
s.write('#endif // %s_MESSAGE_%s_H\n'%(spec.package.upper(), spec.short_name.upp... | [
"def",
"write_end",
"(",
"s",
",",
"spec",
")",
":",
"s",
".",
"write",
"(",
"'#endif // %s_MESSAGE_%s_H\\n'",
"%",
"(",
"spec",
".",
"package",
".",
"upper",
"(",
")",
",",
"spec",
".",
"short_name",
".",
"upper",
"(",
")",
")",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roscpp/rosbuild/scripts/msg_gen.py#L130-L139 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/optparse.py | python | HelpFormatter.format_option_strings | (self, option) | return ", ".join(opts) | Return a comma-separated list of option strings & metavariables. | Return a comma-separated list of option strings & metavariables. | [
"Return",
"a",
"comma",
"-",
"separated",
"list",
"of",
"option",
"strings",
"&",
"metavariables",
"."
] | def format_option_strings(self, option):
"""Return a comma-separated list of option strings & metavariables."""
if option.takes_value():
metavar = option.metavar or option.dest.upper()
short_opts = [self._short_opt_fmt % (sopt, metavar)
for sopt in optio... | [
"def",
"format_option_strings",
"(",
"self",
",",
"option",
")",
":",
"if",
"option",
".",
"takes_value",
"(",
")",
":",
"metavar",
"=",
"option",
".",
"metavar",
"or",
"option",
".",
"dest",
".",
"upper",
"(",
")",
"short_opts",
"=",
"[",
"self",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/optparse.py#L342-L359 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._GetAdditionalLibraryDirectories | (self, root, config, gyp_to_build_path) | return ['/LIBPATH:"' + p + '"' for p in libpaths] | Get and normalize the list of paths in AdditionalLibraryDirectories
setting. | Get and normalize the list of paths in AdditionalLibraryDirectories
setting. | [
"Get",
"and",
"normalize",
"the",
"list",
"of",
"paths",
"in",
"AdditionalLibraryDirectories",
"setting",
"."
] | def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path):
"""Get and normalize the list of paths in AdditionalLibraryDirectories
setting."""
config = self._TargetConfig(config)
libpaths = self._Setting(
(root, "AdditionalLibraryDirectories"), config, defaul... | [
"def",
"_GetAdditionalLibraryDirectories",
"(",
"self",
",",
"root",
",",
"config",
",",
"gyp_to_build_path",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"libpaths",
"=",
"self",
".",
"_Setting",
"(",
"(",
"root",
",",
"\"Addit... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py#L581-L592 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/coordinates.py | python | Frame.worldOrigin | (self) | return self._worldCoordinates[1] | Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates | Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates | [
"Returns",
"an",
"element",
"of",
"R^3",
"denoting",
"the",
"translation",
"of",
"the",
"origin",
"of",
"this",
"frame",
"in",
"world",
"coordinates"
] | def worldOrigin(self):
"""Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates"""
return self._worldCoordinates[1] | [
"def",
"worldOrigin",
"(",
"self",
")",
":",
"return",
"self",
".",
"_worldCoordinates",
"[",
"1",
"]"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/coordinates.py#L51-L54 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/tabart.py | python | VC8TabArt.Clone | (self) | return art | Clones the art object. | Clones the art object. | [
"Clones",
"the",
"art",
"object",
"."
] | def Clone(self):
""" Clones the art object. """
art = type(self)()
art.SetNormalFont(self.GetNormalFont())
art.SetSelectedFont(self.GetSelectedFont())
art.SetMeasuringFont(self.GetMeasuringFont())
art = CopyAttributes(art, self)
return art | [
"def",
"Clone",
"(",
"self",
")",
":",
"art",
"=",
"type",
"(",
"self",
")",
"(",
")",
"art",
".",
"SetNormalFont",
"(",
"self",
".",
"GetNormalFont",
"(",
")",
")",
"art",
".",
"SetSelectedFont",
"(",
"self",
".",
"GetSelectedFont",
"(",
")",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L2179-L2188 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._GetLdManifestFlags | (self, config, name, gyp_to_build_path,
allow_isolation, build_dir) | return flags, output_name, manifest_files | Returns a 3-tuple:
- the set of flags that need to be added to the link to generate
a default manifest
- the intermediate manifest that the linker will generate that should be
used to assert it doesn't add anything to the merged one.
- the list of all the manifest files to be merged by the manif... | Returns a 3-tuple:
- the set of flags that need to be added to the link to generate
a default manifest
- the intermediate manifest that the linker will generate that should be
used to assert it doesn't add anything to the merged one.
- the list of all the manifest files to be merged by the manif... | [
"Returns",
"a",
"3",
"-",
"tuple",
":",
"-",
"the",
"set",
"of",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"the",
"link",
"to",
"generate",
"a",
"default",
"manifest",
"-",
"the",
"intermediate",
"manifest",
"that",
"the",
"linker",
"will",
"... | def _GetLdManifestFlags(self, config, name, gyp_to_build_path,
allow_isolation, build_dir):
"""Returns a 3-tuple:
- the set of flags that need to be added to the link to generate
a default manifest
- the intermediate manifest that the linker will generate that should be
... | [
"def",
"_GetLdManifestFlags",
"(",
"self",
",",
"config",
",",
"name",
",",
"gyp_to_build_path",
",",
"allow_isolation",
",",
"build_dir",
")",
":",
"generate_manifest",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCLinkerTool'",
",",
"'GenerateManifest'",
")",
",... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py#L671-L756 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTypeSynthetic.CreateWithScriptCode | (*args) | return _lldb.SBTypeSynthetic_CreateWithScriptCode(*args) | CreateWithScriptCode(str data, uint32_t options = 0) -> SBTypeSynthetic
CreateWithScriptCode(str data) -> SBTypeSynthetic | CreateWithScriptCode(str data, uint32_t options = 0) -> SBTypeSynthetic
CreateWithScriptCode(str data) -> SBTypeSynthetic | [
"CreateWithScriptCode",
"(",
"str",
"data",
"uint32_t",
"options",
"=",
"0",
")",
"-",
">",
"SBTypeSynthetic",
"CreateWithScriptCode",
"(",
"str",
"data",
")",
"-",
">",
"SBTypeSynthetic"
] | def CreateWithScriptCode(*args):
"""
CreateWithScriptCode(str data, uint32_t options = 0) -> SBTypeSynthetic
CreateWithScriptCode(str data) -> SBTypeSynthetic
"""
return _lldb.SBTypeSynthetic_CreateWithScriptCode(*args) | [
"def",
"CreateWithScriptCode",
"(",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBTypeSynthetic_CreateWithScriptCode",
"(",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11562-L11567 | |
llvm-dcpu16/llvm-dcpu16 | ae6b01fecd03219677e391d4421df5d966d80dcf | utils/lit/lit/LitConfig.py | python | LitConfig.getBashPath | (self) | return self.bashPath | getBashPath - Get the path to 'bash | getBashPath - Get the path to 'bash | [
"getBashPath",
"-",
"Get",
"the",
"path",
"to",
"bash"
] | def getBashPath(self):
"""getBashPath - Get the path to 'bash'"""
import os, Util
if self.bashPath is not None:
return self.bashPath
self.bashPath = Util.which('bash', os.pathsep.join(self.path))
if self.bashPath is None:
# Check some known paths.
... | [
"def",
"getBashPath",
"(",
"self",
")",
":",
"import",
"os",
",",
"Util",
"if",
"self",
".",
"bashPath",
"is",
"not",
"None",
":",
"return",
"self",
".",
"bashPath",
"self",
".",
"bashPath",
"=",
"Util",
".",
"which",
"(",
"'bash'",
",",
"os",
".",
... | https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/utils/lit/lit/LitConfig.py#L70-L89 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/six.py | python | with_metaclass | (meta, *bases) | return type.__new__(metaclass, "temporary_class", (), {}) | Create a base class with a metaclass. | Create a base class with a metaclass. | [
"Create",
"a",
"base",
"class",
"with",
"a",
"metaclass",
"."
] | def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(type):
def __new__(cls, nam... | [
"def",
"with_metaclass",
"(",
"meta",
",",
"*",
"bases",
")",
":",
"# This requires a bit of explanation: the basic idea is to make a dummy",
"# metaclass for one level of class instantiation that replaces itself with",
"# the actual metaclass.",
"class",
"metaclass",
"(",
"type",
")... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/six.py#L884-L897 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/random_array.py | python | random_integers | (maximum, minimum=1, shape=[]) | return randint(minimum, maximum+1, shape) | random_integers(max, min=1, shape=[]) = random integers in range min-max inclusive | random_integers(max, min=1, shape=[]) = random integers in range min-max inclusive | [
"random_integers",
"(",
"max",
"min",
"=",
"1",
"shape",
"=",
"[]",
")",
"=",
"random",
"integers",
"in",
"range",
"min",
"-",
"max",
"inclusive"
] | def random_integers(maximum, minimum=1, shape=[]):
"""random_integers(max, min=1, shape=[]) = random integers in range min-max inclusive"""
return randint(minimum, maximum+1, shape) | [
"def",
"random_integers",
"(",
"maximum",
",",
"minimum",
"=",
"1",
",",
"shape",
"=",
"[",
"]",
")",
":",
"return",
"randint",
"(",
"minimum",
",",
"maximum",
"+",
"1",
",",
"shape",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/random_array.py#L59-L61 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathGeom.py | python | isHorizontal | (obj) | return None | isHorizontal(obj) ... answer True if obj points into X or Y | isHorizontal(obj) ... answer True if obj points into X or Y | [
"isHorizontal",
"(",
"obj",
")",
"...",
"answer",
"True",
"if",
"obj",
"points",
"into",
"X",
"or",
"Y"
] | def isHorizontal(obj):
"""isHorizontal(obj) ... answer True if obj points into X or Y"""
if type(obj) == FreeCAD.Vector:
return isRoughly(obj.z, 0)
if obj.ShapeType == "Face":
if type(obj.Surface) == Part.Plane:
return isVertical(obj.Surface.Axis)
if type(obj.Surface) ==... | [
"def",
"isHorizontal",
"(",
"obj",
")",
":",
"if",
"type",
"(",
"obj",
")",
"==",
"FreeCAD",
".",
"Vector",
":",
"return",
"isRoughly",
"(",
"obj",
".",
"z",
",",
"0",
")",
"if",
"obj",
".",
"ShapeType",
"==",
"\"Face\"",
":",
"if",
"type",
"(",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathGeom.py#L200-L228 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | WorldModel.enableGeometryLoading | (self, enabled) | return _robotsim.WorldModel_enableGeometryLoading(self, enabled) | enableGeometryLoading(WorldModel self, bool enabled)
If geometry loading is set to false, then only the kinematics are loaded from
disk, and no geometry / visualization / collision detection structures will be
loaded. Useful for quick scripts that just use kinematics / dynamics of a robot. | enableGeometryLoading(WorldModel self, bool enabled) | [
"enableGeometryLoading",
"(",
"WorldModel",
"self",
"bool",
"enabled",
")"
] | def enableGeometryLoading(self, enabled):
"""
enableGeometryLoading(WorldModel self, bool enabled)
If geometry loading is set to false, then only the kinematics are loaded from
disk, and no geometry / visualization / collision detection structures will be
loaded. Useful for qu... | [
"def",
"enableGeometryLoading",
"(",
"self",
",",
"enabled",
")",
":",
"return",
"_robotsim",
".",
"WorldModel_enableGeometryLoading",
"(",
"self",
",",
"enabled",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L6095-L6106 | |
spring/spring | 553a21526b144568b608a0507674b076ec80d9f9 | buildbot/stacktrace_translator/stacktrace_translator.py | python | translate_module_addresses | (module, debugarchive, addresses, debugfile) | return [fixup(addr, *line.split(':')) for addr, line in zip(addresses, stdout.splitlines())] | \
Translate addresses in a module to (module, address, filename, lineno) tuples
by invoking addr2line exactly once on the debugging symbols for that module.
>>> translate_module_addresses( 'spring.dbg', TESTFILE, ['0x0'], 'spring.dbg')
[('spring.dbg', '0x0', '??', 0)] | \
Translate addresses in a module to (module, address, filename, lineno) tuples
by invoking addr2line exactly once on the debugging symbols for that module.
>>> translate_module_addresses( 'spring.dbg', TESTFILE, ['0x0'], 'spring.dbg')
[('spring.dbg', '0x0', '??', 0)] | [
"\\",
"Translate",
"addresses",
"in",
"a",
"module",
"to",
"(",
"module",
"address",
"filename",
"lineno",
")",
"tuples",
"by",
"invoking",
"addr2line",
"exactly",
"once",
"on",
"the",
"debugging",
"symbols",
"for",
"that",
"module",
".",
">>>",
"translate_mod... | def translate_module_addresses(module, debugarchive, addresses, debugfile):
'''\
Translate addresses in a module to (module, address, filename, lineno) tuples
by invoking addr2line exactly once on the debugging symbols for that module.
>>> translate_module_addresses( 'spring.dbg', TESTFILE, ['0x0'], 'spring.dbg')
... | [
"def",
"translate_module_addresses",
"(",
"module",
",",
"debugarchive",
",",
"addresses",
",",
"debugfile",
")",
":",
"with",
"NamedTemporaryFile",
"(",
")",
"as",
"tempfile",
":",
"log",
".",
"info",
"(",
"'\\tExtracting debug symbols for module %s from archive %s...'... | https://github.com/spring/spring/blob/553a21526b144568b608a0507674b076ec80d9f9/buildbot/stacktrace_translator/stacktrace_translator.py#L276-L318 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tfile.py | python | pythonize_tfile | (klass) | TFile inherits from
- TDirectory the pythonized attr syntax (__getattr__) and WriteObject method.
- TDirectoryFile the pythonized Get method (pythonized only in Python) | TFile inherits from
- TDirectory the pythonized attr syntax (__getattr__) and WriteObject method.
- TDirectoryFile the pythonized Get method (pythonized only in Python) | [
"TFile",
"inherits",
"from",
"-",
"TDirectory",
"the",
"pythonized",
"attr",
"syntax",
"(",
"__getattr__",
")",
"and",
"WriteObject",
"method",
".",
"-",
"TDirectoryFile",
"the",
"pythonized",
"Get",
"method",
"(",
"pythonized",
"only",
"in",
"Python",
")"
] | def pythonize_tfile(klass):
"""
TFile inherits from
- TDirectory the pythonized attr syntax (__getattr__) and WriteObject method.
- TDirectoryFile the pythonized Get method (pythonized only in Python)
"""
# Pythonizations for TFile::Open
AddFileOpenPyz(klass)
klass._OriginalOpen = klass... | [
"def",
"pythonize_tfile",
"(",
"klass",
")",
":",
"# Pythonizations for TFile::Open",
"AddFileOpenPyz",
"(",
"klass",
")",
"klass",
".",
"_OriginalOpen",
"=",
"klass",
".",
"Open",
"klass",
".",
"Open",
"=",
"classmethod",
"(",
"_TFileOpen",
")",
"# Pythonization ... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tfile.py#L72-L86 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/widgets/about/presenter.py | python | AboutPresenter.should_show_on_startup | () | return current_version != lastVersion | Determines if the first time dialog should be shown
:return: True if the dialog should be shown | Determines if the first time dialog should be shown
:return: True if the dialog should be shown | [
"Determines",
"if",
"the",
"first",
"time",
"dialog",
"should",
"be",
"shown",
":",
"return",
":",
"True",
"if",
"the",
"dialog",
"should",
"be",
"shown"
] | def should_show_on_startup():
""" Determines if the first time dialog should be shown
:return: True if the dialog should be shown
"""
# first check the facility and instrument
facility = ConfigService.getString(AboutPresenter.FACILITY)
instrument = ConfigService.getString... | [
"def",
"should_show_on_startup",
"(",
")",
":",
"# first check the facility and instrument",
"facility",
"=",
"ConfigService",
".",
"getString",
"(",
"AboutPresenter",
".",
"FACILITY",
")",
"instrument",
"=",
"ConfigService",
".",
"getString",
"(",
"AboutPresenter",
"."... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/widgets/about/presenter.py#L60-L93 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | pow | (x, y) | return _F.pow(x, y) | pow(x, y)
Return the ``x ** y``, element-wise.
alias name: `power`.
Parameters
----------
x : var_like, input value.
y : var_like, input value.
Returns
-------
z : Var. The ``x ** y`` of `x` and `y`.
Example:
-------
>>> expr.pow([9., 0.5], [1.2, -3.0])
var([13.966... | pow(x, y)
Return the ``x ** y``, element-wise.
alias name: `power`. | [
"pow",
"(",
"x",
"y",
")",
"Return",
"the",
"x",
"**",
"y",
"element",
"-",
"wise",
".",
"alias",
"name",
":",
"power",
"."
] | def pow(x, y):
'''
pow(x, y)
Return the ``x ** y``, element-wise.
alias name: `power`.
Parameters
----------
x : var_like, input value.
y : var_like, input value.
Returns
-------
z : Var. The ``x ** y`` of `x` and `y`.
Example:
-------
>>> expr.pow([9., 0.5], [... | [
"def",
"pow",
"(",
"x",
",",
"y",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"y",
"=",
"_to_var",
"(",
"y",
")",
"x",
",",
"y",
"=",
"_match_dtype",
"(",
"x",
",",
"y",
")",
"return",
"_F",
".",
"pow",
"(",
"x",
",",
"y",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L869-L892 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | tf/edgeml_tf/trainer/fastTrainer.py | python | FastTrainer.classifier | (self, feats) | return tf.matmul(feats, self.FC) + self.FCbias | Can be raplaced by any classifier
TODO: Make this a separate class if needed | Can be raplaced by any classifier
TODO: Make this a separate class if needed | [
"Can",
"be",
"raplaced",
"by",
"any",
"classifier",
"TODO",
":",
"Make",
"this",
"a",
"separate",
"class",
"if",
"needed"
] | def classifier(self, feats):
'''
Can be raplaced by any classifier
TODO: Make this a separate class if needed
'''
self.FC = tf.Variable(tf.random_normal(
[self.FastObj.output_size, self.numClasses]), name='FC')
self.FCbias = tf.Variable(tf.random_normal(
... | [
"def",
"classifier",
"(",
"self",
",",
"feats",
")",
":",
"self",
".",
"FC",
"=",
"tf",
".",
"Variable",
"(",
"tf",
".",
"random_normal",
"(",
"[",
"self",
".",
"FastObj",
".",
"output_size",
",",
"self",
".",
"numClasses",
"]",
")",
",",
"name",
"... | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/trainer/fastTrainer.py#L87-L97 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsYiRadicals | (code) | return ret | Check whether the character is part of YiRadicals UCS Block | Check whether the character is part of YiRadicals UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"YiRadicals",
"UCS",
"Block"
] | def uCSIsYiRadicals(code):
"""Check whether the character is part of YiRadicals UCS Block """
ret = libxml2mod.xmlUCSIsYiRadicals(code)
return ret | [
"def",
"uCSIsYiRadicals",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsYiRadicals",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2193-L2196 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py | python | FancyURLopener.http_error_301 | (self, url, fp, errcode, errmsg, headers, data=None) | return self.http_error_302(url, fp, errcode, errmsg, headers, data) | Error 301 -- also relocated (permanently). | Error 301 -- also relocated (permanently). | [
"Error",
"301",
"--",
"also",
"relocated",
"(",
"permanently",
")",
"."
] | def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
"""Error 301 -- also relocated (permanently)."""
return self.http_error_302(url, fp, errcode, errmsg, headers, data) | [
"def",
"http_error_301",
"(",
"self",
",",
"url",
",",
"fp",
",",
"errcode",
",",
"errmsg",
",",
"headers",
",",
"data",
"=",
"None",
")",
":",
"return",
"self",
".",
"http_error_302",
"(",
"url",
",",
"fp",
",",
"errcode",
",",
"errmsg",
",",
"heade... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L663-L665 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/decoder/beam_search_decoder.py | python | StateCell.get_state | (self, state_name) | return self._cur_states[state_name] | The getter of state object. Find the state variable by its name.
Args:
state_name (str): A string of the state's name.
Returns:
The associated state object. | The getter of state object. Find the state variable by its name. | [
"The",
"getter",
"of",
"state",
"object",
".",
"Find",
"the",
"state",
"variable",
"by",
"its",
"name",
"."
] | def get_state(self, state_name):
"""
The getter of state object. Find the state variable by its name.
Args:
state_name (str): A string of the state's name.
Returns:
The associated state object.
"""
if self._in_decoder and not self._switched_decod... | [
"def",
"get_state",
"(",
"self",
",",
"state_name",
")",
":",
"if",
"self",
".",
"_in_decoder",
"and",
"not",
"self",
".",
"_switched_decoder",
":",
"self",
".",
"_switch_decoder",
"(",
")",
"if",
"state_name",
"not",
"in",
"self",
".",
"_cur_states",
":",... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/decoder/beam_search_decoder.py#L269-L287 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/wizard.py | python | Wizard.SetPageSize | (*args, **kwargs) | return _wizard.Wizard_SetPageSize(*args, **kwargs) | SetPageSize(self, Size size) | SetPageSize(self, Size size) | [
"SetPageSize",
"(",
"self",
"Size",
"size",
")"
] | def SetPageSize(*args, **kwargs):
"""SetPageSize(self, Size size)"""
return _wizard.Wizard_SetPageSize(*args, **kwargs) | [
"def",
"SetPageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"Wizard_SetPageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/wizard.py#L382-L384 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | logical_or | (x, y) | return _F.logical_or(x, y) | logical_or(x, y)
The dtype of x, y must be same.
Parameters
----------
x : var_like, input value, dtype just support int32.
y : var_like, input value, dtype just support int32.
Returns
-------
z : Var. The ``x or y`` of `x` and `y`, dtype is int32.
Example:
-------
>>> exp... | logical_or(x, y)
The dtype of x, y must be same. | [
"logical_or",
"(",
"x",
"y",
")",
"The",
"dtype",
"of",
"x",
"y",
"must",
"be",
"same",
"."
] | def logical_or(x, y):
'''
logical_or(x, y)
The dtype of x, y must be same.
Parameters
----------
x : var_like, input value, dtype just support int32.
y : var_like, input value, dtype just support int32.
Returns
-------
z : Var. The ``x or y`` of `x` and `y`, dtype is int32.
... | [
"def",
"logical_or",
"(",
"x",
",",
"y",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"y",
"=",
"_to_var",
"(",
"y",
")",
"x",
",",
"y",
"=",
"_match_dtype",
"(",
"x",
",",
"y",
")",
"if",
"x",
".",
"dtype",
"!=",
"_F",
".",
"int",
"or",
... | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L1124-L1148 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/image_ops_impl.py | python | rgb_to_yuv | (images) | return math_ops.tensordot(images, kernel, axes=[[ndims - 1], [0]]) | Converts one or more images from RGB to YUV.
Outputs a tensor of the same shape as the `images` tensor, containing the YUV
value of the pixels.
The output is only well defined if the value in images are in [0, 1].
There are two ways of representing an image: [0, 255] pixel values range or
[0, 1] (as float) p... | Converts one or more images from RGB to YUV. | [
"Converts",
"one",
"or",
"more",
"images",
"from",
"RGB",
"to",
"YUV",
"."
] | def rgb_to_yuv(images):
"""Converts one or more images from RGB to YUV.
Outputs a tensor of the same shape as the `images` tensor, containing the YUV
value of the pixels.
The output is only well defined if the value in images are in [0, 1].
There are two ways of representing an image: [0, 255] pixel values r... | [
"def",
"rgb_to_yuv",
"(",
"images",
")",
":",
"images",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"images",
",",
"name",
"=",
"'images'",
")",
"kernel",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"_rgb_to_yuv_kernel",
",",
"dtype",
"=",
"images",
".",
"dt... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L3925-L3946 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/generator.py | python | _CppFileWriterBase._predicate | (self, check_str, use_else_if=False, constexpr=False) | return writer.IndentedScopedBlock(self._writer, '%s (%s) {' % (conditional, check_str), '}') | Generate an if block if the condition is not-empty.
Generate 'else if' instead of use_else_if is True. | Generate an if block if the condition is not-empty. | [
"Generate",
"an",
"if",
"block",
"if",
"the",
"condition",
"is",
"not",
"-",
"empty",
"."
] | def _predicate(self, check_str, use_else_if=False, constexpr=False):
# type: (str, bool, bool) -> Union[writer.IndentedScopedBlock,writer.EmptyBlock]
"""
Generate an if block if the condition is not-empty.
Generate 'else if' instead of use_else_if is True.
"""
if not che... | [
"def",
"_predicate",
"(",
"self",
",",
"check_str",
",",
"use_else_if",
"=",
"False",
",",
"constexpr",
"=",
"False",
")",
":",
"# type: (str, bool, bool) -> Union[writer.IndentedScopedBlock,writer.EmptyBlock]",
"if",
"not",
"check_str",
":",
"return",
"writer",
".",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L390-L407 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | accumulate_n | (inputs, shape=None, tensor_dtype=None, name=None) | Returns the element-wise sum of a list of tensors.
Optionally, pass `shape` and `tensor_dtype` for shape and type checking,
otherwise, these are inferred.
For example:
```python
# tensor 'a' is [[1, 2], [3, 4]]
# tensor `b` is [[5, 0], [0, 6]]
tf.accumulate_n([a, b, a]) ==> [[7, 4], [6, 14]]
# Expli... | Returns the element-wise sum of a list of tensors. | [
"Returns",
"the",
"element",
"-",
"wise",
"sum",
"of",
"a",
"list",
"of",
"tensors",
"."
] | def accumulate_n(inputs, shape=None, tensor_dtype=None, name=None):
"""Returns the element-wise sum of a list of tensors.
Optionally, pass `shape` and `tensor_dtype` for shape and type checking,
otherwise, these are inferred.
For example:
```python
# tensor 'a' is [[1, 2], [3, 4]]
# tensor `b` is [[5, ... | [
"def",
"accumulate_n",
"(",
"inputs",
",",
"shape",
"=",
"None",
",",
"tensor_dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"tensor_dtype",
"is",
"None",
":",
"if",
"not",
"inputs",
"or",
"not",
"isinstance",
"(",
"inputs",
",",
"(",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1475-L1545 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py | python | EmacsMode.transpose_chars | (self, e) | Drag the character before the cursor forward over the character
at the cursor, moving the cursor forward as well. If the insertion
point is at the end of the line, then this transposes the last two
characters of the line. Negative arguments have no effect. | Drag the character before the cursor forward over the character
at the cursor, moving the cursor forward as well. If the insertion
point is at the end of the line, then this transposes the last two
characters of the line. Negative arguments have no effect. | [
"Drag",
"the",
"character",
"before",
"the",
"cursor",
"forward",
"over",
"the",
"character",
"at",
"the",
"cursor",
"moving",
"the",
"cursor",
"forward",
"as",
"well",
".",
"If",
"the",
"insertion",
"point",
"is",
"at",
"the",
"end",
"of",
"the",
"line",
... | def transpose_chars(self, e): # (C-t)
'''Drag the character before the cursor forward over the character
at the cursor, moving the cursor forward as well. If the insertion
point is at the end of the line, then this transposes the last two
characters of the line. Negative arguments have n... | [
"def",
"transpose_chars",
"(",
"self",
",",
"e",
")",
":",
"# (C-t)",
"self",
".",
"l_buffer",
".",
"transpose_chars",
"(",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L285-L290 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/servers/local_server.py | python | LocalServer.LocalJsonSearchHandler | (self, handler) | Handle GET request for json search results. | Handle GET request for json search results. | [
"Handle",
"GET",
"request",
"for",
"json",
"search",
"results",
"."
] | def LocalJsonSearchHandler(self, handler):
"""Handle GET request for json search results."""
if not handler.IsValidRequest():
raise tornado.web.HTTPError(404)
cb = handler.request.arguments["cb"][0]
service = handler.request.arguments["service"][0]
try:
self.search_services_[service].Js... | [
"def",
"LocalJsonSearchHandler",
"(",
"self",
",",
"handler",
")",
":",
"if",
"not",
"handler",
".",
"IsValidRequest",
"(",
")",
":",
"raise",
"tornado",
".",
"web",
".",
"HTTPError",
"(",
"404",
")",
"cb",
"=",
"handler",
".",
"request",
".",
"arguments... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/local_server.py#L373-L390 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListCtrl.GetLineSpacing | (*args, **kwargs) | return _gizmos.TreeListCtrl_GetLineSpacing(*args, **kwargs) | GetLineSpacing(self) -> unsigned int | GetLineSpacing(self) -> unsigned int | [
"GetLineSpacing",
"(",
"self",
")",
"-",
">",
"unsigned",
"int"
] | def GetLineSpacing(*args, **kwargs):
"""GetLineSpacing(self) -> unsigned int"""
return _gizmos.TreeListCtrl_GetLineSpacing(*args, **kwargs) | [
"def",
"GetLineSpacing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_GetLineSpacing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L511-L513 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | is_masked | (x) | return False | Determine whether input has masked values.
Accepts any object as input, but always returns False unless the
input is a MaskedArray containing masked values.
Parameters
----------
x : array_like
Array to check for masked values.
Returns
-------
result : bool
True if `x`... | Determine whether input has masked values. | [
"Determine",
"whether",
"input",
"has",
"masked",
"values",
"."
] | def is_masked(x):
"""
Determine whether input has masked values.
Accepts any object as input, but always returns False unless the
input is a MaskedArray containing masked values.
Parameters
----------
x : array_like
Array to check for masked values.
Returns
-------
res... | [
"def",
"is_masked",
"(",
"x",
")",
":",
"m",
"=",
"getmask",
"(",
"x",
")",
"if",
"m",
"is",
"nomask",
":",
"return",
"False",
"elif",
"m",
".",
"any",
"(",
")",
":",
"return",
"True",
"return",
"False"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L6381-L6431 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntHI.IsEmpty | (self) | return _snap.TIntHI_IsEmpty(self) | IsEmpty(TIntHI self) -> bool
Parameters:
self: THashKeyDatI< TInt,TInt > const * | IsEmpty(TIntHI self) -> bool | [
"IsEmpty",
"(",
"TIntHI",
"self",
")",
"-",
">",
"bool"
] | def IsEmpty(self):
"""
IsEmpty(TIntHI self) -> bool
Parameters:
self: THashKeyDatI< TInt,TInt > const *
"""
return _snap.TIntHI_IsEmpty(self) | [
"def",
"IsEmpty",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TIntHI_IsEmpty",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19037-L19045 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.