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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
amrayn/easyloggingpp | 8489989bb26c6371df103f6cbced3fbee1bc3c2f | tools/cpplint.py | python | CheckStyle | (filename, clean_lines, linenum, file_extension, nesting_state,
error) | Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,
tab usage, spaces inside code, etc.
Args:
filename: The name of the current file.
clean_line... | Checks rules from the 'C++ style rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"style",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,... | [
"def",
"CheckStyle",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want ... | https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/tools/cpplint.py#L3336-L3440 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/gyb_syntax_support/__init__.py | python | make_missing_swift_child | (child) | Generates a Swift call to make the raw syntax for a given Child object. | Generates a Swift call to make the raw syntax for a given Child object. | [
"Generates",
"a",
"Swift",
"call",
"to",
"make",
"the",
"raw",
"syntax",
"for",
"a",
"given",
"Child",
"object",
"."
] | def make_missing_swift_child(child):
"""
Generates a Swift call to make the raw syntax for a given Child object.
"""
if child.is_token():
token = child.main_token()
tok_kind = token.swift_kind() if token else "unknown"
if not token or not token.text:
tok_kind += '("")... | [
"def",
"make_missing_swift_child",
"(",
"child",
")",
":",
"if",
"child",
".",
"is_token",
"(",
")",
":",
"token",
"=",
"child",
".",
"main_token",
"(",
")",
"tok_kind",
"=",
"token",
".",
"swift_kind",
"(",
")",
"if",
"token",
"else",
"\"unknown\"",
"if... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/gyb_syntax_support/__init__.py#L113-L126 | ||
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/algorithm.py | python | info | () | return a.info() | Print info on matrix objects in memory. | Print info on matrix objects in memory. | [
"Print",
"info",
"on",
"matrix",
"objects",
"in",
"memory",
"."
] | def info():
"""Print info on matrix objects in memory."""
return a.info() | [
"def",
"info",
"(",
")",
":",
"return",
"a",
".",
"info",
"(",
")"
] | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/algorithm.py#L84-L86 | |
uber-research/jpeg2dct | ced1906d0cb8be5f5b1c096846258425887f3215 | jpeg2dct/tensorflow/__init__.py | python | get_ext_suffix | () | return '.so' | Determine library extension for various versions of Python. | Determine library extension for various versions of Python. | [
"Determine",
"library",
"extension",
"for",
"various",
"versions",
"of",
"Python",
"."
] | def get_ext_suffix():
"""Determine library extension for various versions of Python."""
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix:
return ext_suffix
ext_suffix = sysconfig.get_config_var('SO')
if ext_suffix:
return ext_suffix
return '.so' | [
"def",
"get_ext_suffix",
"(",
")",
":",
"ext_suffix",
"=",
"sysconfig",
".",
"get_config_var",
"(",
"'EXT_SUFFIX'",
")",
"if",
"ext_suffix",
":",
"return",
"ext_suffix",
"ext_suffix",
"=",
"sysconfig",
".",
"get_config_var",
"(",
"'SO'",
")",
"if",
"ext_suffix",... | https://github.com/uber-research/jpeg2dct/blob/ced1906d0cb8be5f5b1c096846258425887f3215/jpeg2dct/tensorflow/__init__.py#L25-L35 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/command.py | python | Command.__init__ | (self, command_runner, args, headers, debug, trace_token,
parallel_operations, bucket_storage_uri_class,
gsutil_api_class_map_factory, logging_filters=None,
command_alias_used=None) | Instantiates a Command.
Args:
command_runner: CommandRunner (for commands built atop other commands).
args: Command-line args (arg0 = actual arg, not command name ala bash).
headers: Dictionary containing optional HTTP headers to pass to boto.
debug: Debug level to pass in to boto connectio... | Instantiates a Command. | [
"Instantiates",
"a",
"Command",
"."
] | def __init__(self, command_runner, args, headers, debug, trace_token,
parallel_operations, bucket_storage_uri_class,
gsutil_api_class_map_factory, logging_filters=None,
command_alias_used=None):
"""Instantiates a Command.
Args:
command_runner: CommandRunner (f... | [
"def",
"__init__",
"(",
"self",
",",
"command_runner",
",",
"args",
",",
"headers",
",",
"debug",
",",
"trace_token",
",",
"parallel_operations",
",",
"bucket_storage_uri_class",
",",
"gsutil_api_class_map_factory",
",",
"logging_filters",
"=",
"None",
",",
"command... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/command.py#L388-L492 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py | python | NotEmacsMode.delete_char_or_list | (self, e) | Deletes the character under the cursor if not at the beginning or
end of the line (like delete-char). If at the end of the line,
behaves identically to possible-completions. This command is unbound
by default. | Deletes the character under the cursor if not at the beginning or
end of the line (like delete-char). If at the end of the line,
behaves identically to possible-completions. This command is unbound
by default. | [
"Deletes",
"the",
"character",
"under",
"the",
"cursor",
"if",
"not",
"at",
"the",
"beginning",
"or",
"end",
"of",
"the",
"line",
"(",
"like",
"delete",
"-",
"char",
")",
".",
"If",
"at",
"the",
"end",
"of",
"the",
"line",
"behaves",
"identically",
"to... | def delete_char_or_list(self, e): # ()
'''Deletes the character under the cursor if not at the beginning or
end of the line (like delete-char). If at the end of the line,
behaves identically to possible-completions. This command is unbound
by default.'''
pass | [
"def",
"delete_char_or_list",
"(",
"self",
",",
"e",
")",
":",
"# ()",
"pass"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py#L456-L461 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/parser/minddata_analyzer.py | python | MinddataProfilingAnalyzer._parse_pipeline_info | (self, pipeline_info) | return return_dict | Parse and process the pipeline profiling information.
Args:
pipeline_info (dict): The pipeline profiling information.
Returns:
Dictionary with analyzed summary output information
For the following key-value pairs, each value is a list ordered by increasing op id
... | Parse and process the pipeline profiling information. | [
"Parse",
"and",
"process",
"the",
"pipeline",
"profiling",
"information",
"."
] | def _parse_pipeline_info(self, pipeline_info):
"""
Parse and process the pipeline profiling information.
Args:
pipeline_info (dict): The pipeline profiling information.
Returns:
Dictionary with analyzed summary output information
For the following ke... | [
"def",
"_parse_pipeline_info",
"(",
"self",
",",
"pipeline_info",
")",
":",
"# Perform sanity checks for pipeline information",
"pipeline_op_info",
"=",
"pipeline_info",
".",
"get",
"(",
"'op_info'",
")",
"for",
"item",
"in",
"pipeline_op_info",
":",
"if",
"not",
"ite... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/minddata_analyzer.py#L300-L389 | |
lensfun/lensfun | 6c05440e6193ca170806c01aa2cd701e639d863a | tools/perspective_control/perspective_control.py | python | Modifier.enable_perspective_correction | (self, x, y, d) | return True | Depending on the number of control points given, there are three possible
modes:
4 control points: c0 and c1 define one vertical lines, c2 and c3 the other.
The focal length is used to get the proper aspect ratio.
6 control points: c0 to c3 like above. c4 and c5 define a horizontal li... | Depending on the number of control points given, there are three possible
modes: | [
"Depending",
"on",
"the",
"number",
"of",
"control",
"points",
"given",
"there",
"are",
"three",
"possible",
"modes",
":"
] | def enable_perspective_correction(self, x, y, d):
"""Depending on the number of control points given, there are three possible
modes:
4 control points: c0 and c1 define one vertical lines, c2 and c3 the other.
The focal length is used to get the proper aspect ratio.
6 control p... | [
"def",
"enable_perspective_correction",
"(",
"self",
",",
"x",
",",
"y",
",",
"d",
")",
":",
"if",
"len",
"(",
"x",
")",
"not",
"in",
"[",
"4",
",",
"5",
",",
"6",
",",
"7",
",",
"8",
"]",
"or",
"len",
"(",
"x",
")",
"!=",
"len",
"(",
"y",
... | https://github.com/lensfun/lensfun/blob/6c05440e6193ca170806c01aa2cd701e639d863a/tools/perspective_control/perspective_control.py#L402-L512 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_optionals | (self, optionals_in, optionals_out) | Add optional inputs and outputs to the model spec.
Parameters
----------
optionals_in: list of str
List of inputs that are optionals.
optionals_out: list of str
List of outputs that are optionals.
See Also
--------
set_input, set_output | Add optional inputs and outputs to the model spec. | [
"Add",
"optional",
"inputs",
"and",
"outputs",
"to",
"the",
"model",
"spec",
"."
] | def add_optionals(self, optionals_in, optionals_out):
"""
Add optional inputs and outputs to the model spec.
Parameters
----------
optionals_in: list of str
List of inputs that are optionals.
optionals_out: list of str
List of outputs that are op... | [
"def",
"add_optionals",
"(",
"self",
",",
"optionals_in",
",",
"optionals_out",
")",
":",
"spec",
"=",
"self",
".",
"spec",
"if",
"(",
"not",
"optionals_in",
")",
"and",
"(",
"not",
"optionals_out",
")",
":",
"return",
"input_types",
"=",
"[",
"datatypes",... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L668-L722 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | MaskedArray.reshape | (self, *s, **kwargs) | return result | Give a new shape to the array without changing its data.
Returns a masked array containing the same data, but with a new shape.
The result is a view on the original array; if this is not possible, a
ValueError is raised.
Parameters
----------
shape : int or tuple of int... | Give a new shape to the array without changing its data. | [
"Give",
"a",
"new",
"shape",
"to",
"the",
"array",
"without",
"changing",
"its",
"data",
"."
] | def reshape(self, *s, **kwargs):
"""
Give a new shape to the array without changing its data.
Returns a masked array containing the same data, but with a new shape.
The result is a view on the original array; if this is not possible, a
ValueError is raised.
Parameters
... | [
"def",
"reshape",
"(",
"self",
",",
"*",
"s",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"update",
"(",
"order",
"=",
"kwargs",
".",
"get",
"(",
"'order'",
",",
"'C'",
")",
")",
"result",
"=",
"self",
".",
"_data",
".",
"reshape",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L4542-L4596 | |
ONLYOFFICE/core | 1f976ae79a2593fc22ee78e9fdbb76090e83785c | DesktopEditor/freetype-2.10.4/src/tools/make_distribution_archives.py | python | is_git_dir_clean | (git_dir) | return len(out) == 0 | Return True iff |git_dir| is a git directory in clean state. | Return True iff |git_dir| is a git directory in clean state. | [
"Return",
"True",
"iff",
"|git_dir|",
"is",
"a",
"git",
"directory",
"in",
"clean",
"state",
"."
] | def is_git_dir_clean(git_dir):
"""Return True iff |git_dir| is a git directory in clean state."""
out = get_cmd_output(["git", "status", "--porcelain"], cwd=git_dir)
return len(out) == 0 | [
"def",
"is_git_dir_clean",
"(",
"git_dir",
")",
":",
"out",
"=",
"get_cmd_output",
"(",
"[",
"\"git\"",
",",
"\"status\"",
",",
"\"--porcelain\"",
"]",
",",
"cwd",
"=",
"git_dir",
")",
"return",
"len",
"(",
"out",
")",
"==",
"0"
] | https://github.com/ONLYOFFICE/core/blob/1f976ae79a2593fc22ee78e9fdbb76090e83785c/DesktopEditor/freetype-2.10.4/src/tools/make_distribution_archives.py#L27-L30 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/client/session.py | python | _FetchHandler.fetches | (self) | return self._final_fetches | Return the unique names of tensors to fetch.
Returns:
A list of strings. | Return the unique names of tensors to fetch. | [
"Return",
"the",
"unique",
"names",
"of",
"tensors",
"to",
"fetch",
"."
] | def fetches(self):
"""Return the unique names of tensors to fetch.
Returns:
A list of strings.
"""
return self._final_fetches | [
"def",
"fetches",
"(",
"self",
")",
":",
"return",
"self",
".",
"_final_fetches"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/client/session.py#L384-L390 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py | python | HTMLCalendar.formatyearpage | (self, theyear, width=3, css='calendar.css', encoding=None) | return ''.join(v).encode(encoding, "xmlcharrefreplace") | Return a formatted year as a complete HTML page. | Return a formatted year as a complete HTML page. | [
"Return",
"a",
"formatted",
"year",
"as",
"a",
"complete",
"HTML",
"page",
"."
] | def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
"""
Return a formatted year as a complete HTML page.
"""
if encoding is None:
encoding = sys.getdefaultencoding()
v = []
a = v.append
a('<?xml version="1.0" encoding="%s"?>\... | [
"def",
"formatyearpage",
"(",
"self",
",",
"theyear",
",",
"width",
"=",
"3",
",",
"css",
"=",
"'calendar.css'",
",",
"encoding",
"=",
"None",
")",
":",
"if",
"encoding",
"is",
"None",
":",
"encoding",
"=",
"sys",
".",
"getdefaultencoding",
"(",
")",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py#L464-L485 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/yapf_api.py | python | FormatFile | (filename,
style_config=None,
lines=None,
print_diff=False,
verify=False,
in_place=False,
logger=None) | return reformatted_source, encoding, changed | Format a single Python file and return the formatted code.
Arguments:
filename: (unicode) The file to reformat.
in_place: (bool) If True, write the reformatted code back to the file.
logger: (io streamer) A stream to output logging.
remaining arguments: see comment at the top of this module.
Retur... | Format a single Python file and return the formatted code. | [
"Format",
"a",
"single",
"Python",
"file",
"and",
"return",
"the",
"formatted",
"code",
"."
] | def FormatFile(filename,
style_config=None,
lines=None,
print_diff=False,
verify=False,
in_place=False,
logger=None):
"""Format a single Python file and return the formatted code.
Arguments:
filename: (unicode) The file t... | [
"def",
"FormatFile",
"(",
"filename",
",",
"style_config",
"=",
"None",
",",
"lines",
"=",
"None",
",",
"print_diff",
"=",
"False",
",",
"verify",
"=",
"False",
",",
"in_place",
"=",
"False",
",",
"logger",
"=",
"None",
")",
":",
"_CheckPythonVersion",
"... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/yapf_api.py#L54-L100 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_ops_v2.py | python | audio | (name, tensor, sample_rate, max_outputs, family=None, step=None) | return summary_writer_function(name, tensor, function, family=family) | Writes an audio summary if possible. | Writes an audio summary if possible. | [
"Writes",
"an",
"audio",
"summary",
"if",
"possible",
"."
] | def audio(name, tensor, sample_rate, max_outputs, family=None, step=None):
"""Writes an audio summary if possible."""
def function(tag, scope):
# Note the identity to move the tensor to the CPU.
return gen_summary_ops.write_audio_summary(
context.context().summary_writer._resource, # pylint: disab... | [
"def",
"audio",
"(",
"name",
",",
"tensor",
",",
"sample_rate",
",",
"max_outputs",
",",
"family",
"=",
"None",
",",
"step",
"=",
"None",
")",
":",
"def",
"function",
"(",
"tag",
",",
"scope",
")",
":",
"# Note the identity to move the tensor to the CPU.",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_ops_v2.py#L823-L837 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/nn_ops.py | python | MaxPoolWithArgmax.__init__ | (self, kernel_size=1, strides=1, pad_mode="valid", data_format="NCHW") | Initialize MaxPoolWithArgmax. | Initialize MaxPoolWithArgmax. | [
"Initialize",
"MaxPoolWithArgmax",
"."
] | def __init__(self, kernel_size=1, strides=1, pad_mode="valid", data_format="NCHW"):
"""Initialize MaxPoolWithArgmax."""
super(MaxPoolWithArgmax, self).__init__(kernel_size, strides, pad_mode, data_format) | [
"def",
"__init__",
"(",
"self",
",",
"kernel_size",
"=",
"1",
",",
"strides",
"=",
"1",
",",
"pad_mode",
"=",
"\"valid\"",
",",
"data_format",
"=",
"\"NCHW\"",
")",
":",
"super",
"(",
"MaxPoolWithArgmax",
",",
"self",
")",
".",
"__init__",
"(",
"kernel_s... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L1728-L1730 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | AboutDialogInfo.GetDevelopers | (*args, **kwargs) | return _misc_.AboutDialogInfo_GetDevelopers(*args, **kwargs) | GetDevelopers(self) --> list
Returns the list of developers. | GetDevelopers(self) --> list | [
"GetDevelopers",
"(",
"self",
")",
"--",
">",
"list"
] | def GetDevelopers(*args, **kwargs):
"""
GetDevelopers(self) --> list
Returns the list of developers.
"""
return _misc_.AboutDialogInfo_GetDevelopers(*args, **kwargs) | [
"def",
"GetDevelopers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_GetDevelopers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6823-L6829 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Context.minus | (self, a) | return a.__neg__(context=self) | Minus corresponds to unary prefix minus in Python.
The operation is evaluated using the same rules as subtract; the
operation minus(a) is calculated as subtract('0', a) where the '0'
has the same exponent as the operand.
>>> ExtendedContext.minus(Decimal('1.3'))
Decimal('-1.3')... | Minus corresponds to unary prefix minus in Python. | [
"Minus",
"corresponds",
"to",
"unary",
"prefix",
"minus",
"in",
"Python",
"."
] | def minus(self, a):
"""Minus corresponds to unary prefix minus in Python.
The operation is evaluated using the same rules as subtract; the
operation minus(a) is calculated as subtract('0', a) where the '0'
has the same exponent as the operand.
>>> ExtendedContext.minus(Decimal(... | [
"def",
"minus",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"__neg__",
"(",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L4926-L4941 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | MaildirMessage._explain_to | (self, message) | Copy Maildir-specific state to message insofar as possible. | Copy Maildir-specific state to message insofar as possible. | [
"Copy",
"Maildir",
"-",
"specific",
"state",
"to",
"message",
"insofar",
"as",
"possible",
"."
] | def _explain_to(self, message):
"""Copy Maildir-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
message.set_flags(self.get_flags())
message.set_subdir(self.get_subdir())
message.set_date(self.get_date())
elif isinstanc... | [
"def",
"_explain_to",
"(",
"self",
",",
"message",
")",
":",
"if",
"isinstance",
"(",
"message",
",",
"MaildirMessage",
")",
":",
"message",
".",
"set_flags",
"(",
"self",
".",
"get_flags",
"(",
")",
")",
"message",
".",
"set_subdir",
"(",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1588-L1629 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File.is_up_to_date | (self) | Check for whether the Node is current
In all cases self is the target we're checking to see if it's up to date | Check for whether the Node is current
In all cases self is the target we're checking to see if it's up to date | [
"Check",
"for",
"whether",
"the",
"Node",
"is",
"current",
"In",
"all",
"cases",
"self",
"is",
"the",
"target",
"we",
"re",
"checking",
"to",
"see",
"if",
"it",
"s",
"up",
"to",
"date"
] | def is_up_to_date(self):
"""Check for whether the Node is current
In all cases self is the target we're checking to see if it's up to date
"""
T = 0
if T: Trace('is_up_to_date(%s):' % self)
if not self.exists():
if T: Trace(' not self.exists():')
... | [
"def",
"is_up_to_date",
"(",
"self",
")",
":",
"T",
"=",
"0",
"if",
"T",
":",
"Trace",
"(",
"'is_up_to_date(%s):'",
"%",
"self",
")",
"if",
"not",
"self",
".",
"exists",
"(",
")",
":",
"if",
"T",
":",
"Trace",
"(",
"' not self.exists():'",
")",
"# Th... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L3499-L3531 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/simpla/_config.py | python | load | (filename) | load(string)
This loads configuration parameters from a file and overwrites default values. | load(string) | [
"load",
"(",
"string",
")"
] | def load(filename):
'''load(string)
This loads configuration parameters from a file and overwrites default values.
'''
global CONTROL_RATE, VEH_SELECTORS, MAX_PLATOON_GAP, CATCHUP_DIST, PLATOON_SPLIT_TIME
global VTYPE_FILE, PLATOON_VTYPES, LC_MODE, SPEEDFACTOR, SWITCH_IMPATIENCE_FACTOR
configD... | [
"def",
"load",
"(",
"filename",
")",
":",
"global",
"CONTROL_RATE",
",",
"VEH_SELECTORS",
",",
"MAX_PLATOON_GAP",
",",
"CATCHUP_DIST",
",",
"PLATOON_SPLIT_TIME",
"global",
"VTYPE_FILE",
",",
"PLATOON_VTYPES",
",",
"LC_MODE",
",",
"SPEEDFACTOR",
",",
"SWITCH_IMPATIEN... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/simpla/_config.py#L166-L305 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/pot/openvino/tools/pot/algorithms/quantization/fake_quantize_configuration.py | python | get_configurations_by_qscheme | (fq_to_hw_confs, qscheme) | return res | Choose fake quantize configuration by qscheme
:param fq_to_hw_confs: dictionary with fake quantize names as keys and
list of its configurations as values (read_all_fake_quantize_configurations(..) return value)
:param qscheme: The quantization scheme generated from the space
:return dictionary with fak... | Choose fake quantize configuration by qscheme
:param fq_to_hw_confs: dictionary with fake quantize names as keys and
list of its configurations as values (read_all_fake_quantize_configurations(..) return value)
:param qscheme: The quantization scheme generated from the space
:return dictionary with fak... | [
"Choose",
"fake",
"quantize",
"configuration",
"by",
"qscheme",
":",
"param",
"fq_to_hw_confs",
":",
"dictionary",
"with",
"fake",
"quantize",
"names",
"as",
"keys",
"and",
"list",
"of",
"its",
"configurations",
"as",
"values",
"(",
"read_all_fake_quantize_configura... | def get_configurations_by_qscheme(fq_to_hw_confs, qscheme):
""" Choose fake quantize configuration by qscheme
:param fq_to_hw_confs: dictionary with fake quantize names as keys and
list of its configurations as values (read_all_fake_quantize_configurations(..) return value)
:param qscheme: The quantiza... | [
"def",
"get_configurations_by_qscheme",
"(",
"fq_to_hw_confs",
",",
"qscheme",
")",
":",
"def",
"_set_config",
"(",
"conf_by_layer",
",",
"fq_type_",
")",
":",
"out",
"=",
"{",
"}",
"for",
"node_name",
",",
"_",
"in",
"conf_by_layer",
":",
"qscheme",
"[",
"n... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/algorithms/quantization/fake_quantize_configuration.py#L242-L264 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/ensemble/forest.py | python | RandomTreesEmbedding.transform | (self, X) | return self.one_hot_encoder_.transform(self.apply(X)) | Transform dataset.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Input data to be transformed. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also supported, use sparse
``csr_matrix`` for maximum ef... | Transform dataset. | [
"Transform",
"dataset",
"."
] | def transform(self, X):
"""Transform dataset.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Input data to be transformed. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also supported, use sparse
... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"return",
"self",
".",
"one_hot_encoder_",
".",
"transform",
"(",
"self",
".",
"apply",
"(",
"X",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/ensemble/forest.py#L1704-L1719 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/utils.py | python | zeros | (shape, ctx=None, dtype=None, stype=None, **kwargs) | Return a new array of given shape and type, filled with zeros.
Parameters
----------
shape : int or tuple of int
The shape of the empty array
ctx : Context, optional
An optional device context (default is the current default context)
dtype : str or numpy.dtype, optional
An o... | Return a new array of given shape and type, filled with zeros. | [
"Return",
"a",
"new",
"array",
"of",
"given",
"shape",
"and",
"type",
"filled",
"with",
"zeros",
"."
] | def zeros(shape, ctx=None, dtype=None, stype=None, **kwargs):
"""Return a new array of given shape and type, filled with zeros.
Parameters
----------
shape : int or tuple of int
The shape of the empty array
ctx : Context, optional
An optional device context (default is the current d... | [
"def",
"zeros",
"(",
"shape",
",",
"ctx",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"stype",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"stype",
"is",
"None",
"or",
"stype",
"==",
"'default'",
":",
"return",
"_zeros_ndarray",
"(",
"sh... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/utils.py#L40-L69 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | ComboPopup.GetControl | (*args, **kwargs) | return _combo.ComboPopup_GetControl(*args, **kwargs) | GetControl(self) -> Window
The derived class must implement this method and it should return a
reference to the widget created in the `Create` method. If the
derived class inherits from both the widget class and ComboPopup then
the return value is probably just ``self``. | GetControl(self) -> Window | [
"GetControl",
"(",
"self",
")",
"-",
">",
"Window"
] | def GetControl(*args, **kwargs):
"""
GetControl(self) -> Window
The derived class must implement this method and it should return a
reference to the widget created in the `Create` method. If the
derived class inherits from both the widget class and ComboPopup then
the r... | [
"def",
"GetControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboPopup_GetControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L637-L646 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | StaticLine.IsVertical | (*args, **kwargs) | return _controls_.StaticLine_IsVertical(*args, **kwargs) | IsVertical(self) -> bool | IsVertical(self) -> bool | [
"IsVertical",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsVertical(*args, **kwargs):
"""IsVertical(self) -> bool"""
return _controls_.StaticLine_IsVertical(*args, **kwargs) | [
"def",
"IsVertical",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"StaticLine_IsVertical",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L926-L928 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_equality_expression_1 | (t) | equality_expression : relational_expression | equality_expression : relational_expression | [
"equality_expression",
":",
"relational_expression"
] | def p_equality_expression_1(t):
'equality_expression : relational_expression'
pass | [
"def",
"p_equality_expression_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L667-L669 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/distutils/conv_template.py | python | parse_structure | (astr, level) | return spanlist | The returned line number is from the beginning of the string, starting
at zero. Returns an empty list if no loops found. | The returned line number is from the beginning of the string, starting
at zero. Returns an empty list if no loops found. | [
"The",
"returned",
"line",
"number",
"is",
"from",
"the",
"beginning",
"of",
"the",
"string",
"starting",
"at",
"zero",
".",
"Returns",
"an",
"empty",
"list",
"if",
"no",
"loops",
"found",
"."
] | def parse_structure(astr, level):
"""
The returned line number is from the beginning of the string, starting
at zero. Returns an empty list if no loops found.
"""
if level == 0 :
loopbeg = "/**begin repeat"
loopend = "/**end repeat**/"
else :
loopbeg = "/**begin repeat%d... | [
"def",
"parse_structure",
"(",
"astr",
",",
"level",
")",
":",
"if",
"level",
"==",
"0",
":",
"loopbeg",
"=",
"\"/**begin repeat\"",
"loopend",
"=",
"\"/**end repeat**/\"",
"else",
":",
"loopbeg",
"=",
"\"/**begin repeat%d\"",
"%",
"level",
"loopend",
"=",
"\"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/distutils/conv_template.py#L107-L136 | |
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/util/ranges.py | python | overlap_len | (range1, range2) | return max(0, (min(range1.end, range2.end) - max(range1.start, range2.start))) | Computes the number of overlapping bases of range1 and range2.
Args:
range1: nucleus.genomics.v1.Range.
range2: nucleus.genomics.v1.Range.
Returns:
int. The number of basepairs in common. 0 if the ranges are not on the same
contig. | Computes the number of overlapping bases of range1 and range2. | [
"Computes",
"the",
"number",
"of",
"overlapping",
"bases",
"of",
"range1",
"and",
"range2",
"."
] | def overlap_len(range1, range2):
"""Computes the number of overlapping bases of range1 and range2.
Args:
range1: nucleus.genomics.v1.Range.
range2: nucleus.genomics.v1.Range.
Returns:
int. The number of basepairs in common. 0 if the ranges are not on the same
contig.
"""
if range1.reference_... | [
"def",
"overlap_len",
"(",
"range1",
",",
"range2",
")",
":",
"if",
"range1",
".",
"reference_name",
"!=",
"range2",
".",
"reference_name",
":",
"return",
"0",
"return",
"max",
"(",
"0",
",",
"(",
"min",
"(",
"range1",
".",
"end",
",",
"range2",
".",
... | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/ranges.py#L627-L640 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread_WpanCtl.py | python | OpenThread_WpanCtl.__convertIp6PrefixStringToIp6Address | (self, strIp6Prefix) | return strIp6Prefix + '::' | convert IPv6 prefix string to IPv6 dotted-quad format
for example:
2001000000000000 -> 2001:0000:0000:0000::
Args:
strIp6Prefix: IPv6 address string
Returns:
IPv6 address dotted-quad format | convert IPv6 prefix string to IPv6 dotted-quad format
for example:
2001000000000000 -> 2001:0000:0000:0000:: | [
"convert",
"IPv6",
"prefix",
"string",
"to",
"IPv6",
"dotted",
"-",
"quad",
"format",
"for",
"example",
":",
"2001000000000000",
"-",
">",
"2001",
":",
"0000",
":",
"0000",
":",
"0000",
"::"
] | def __convertIp6PrefixStringToIp6Address(self, strIp6Prefix):
"""convert IPv6 prefix string to IPv6 dotted-quad format
for example:
2001000000000000 -> 2001:0000:0000:0000::
Args:
strIp6Prefix: IPv6 address string
Returns:
IPv6 address dotted-quad ... | [
"def",
"__convertIp6PrefixStringToIp6Address",
"(",
"self",
",",
"strIp6Prefix",
")",
":",
"prefix1",
"=",
"strIp6Prefix",
".",
"rstrip",
"(",
"'L'",
")",
"prefix2",
"=",
"self",
".",
"__lstrip0x",
"(",
"prefix1",
")",
"hexPrefix",
"=",
"str",
"(",
"prefix2",
... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread_WpanCtl.py#L563-L581 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py | python | Session.send | (self, request, **kwargs) | return r | Send a given PreparedRequest.
:rtype: requests.Response | Send a given PreparedRequest. | [
"Send",
"a",
"given",
"PreparedRequest",
"."
] | def send(self, request, **kwargs):
"""Send a given PreparedRequest.
:rtype: requests.Response
"""
# Set defaults that the hooks can utilize to ensure they always have
# the correct parameters to reproduce the previous request.
kwargs.setdefault('stream', self.stream)
... | [
"def",
"send",
"(",
"self",
",",
"request",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set defaults that the hooks can utilize to ensure they always have",
"# the correct parameters to reproduce the previous request.",
"kwargs",
".",
"setdefault",
"(",
"'stream'",
",",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py#L614-L685 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/cluster/hierarchy.py | python | fcluster | (Z, t, criterion='inconsistent', depth=2, R=None, monocrit=None) | return T | Form flat clusters from the hierarchical clustering defined by
the given linkage matrix.
Parameters
----------
Z : ndarray
The hierarchical clustering encoded with the matrix returned
by the `linkage` function.
t : scalar
For criteria 'inconsistent', 'distance' or 'monocrit'... | Form flat clusters from the hierarchical clustering defined by
the given linkage matrix. | [
"Form",
"flat",
"clusters",
"from",
"the",
"hierarchical",
"clustering",
"defined",
"by",
"the",
"given",
"linkage",
"matrix",
"."
] | def fcluster(Z, t, criterion='inconsistent', depth=2, R=None, monocrit=None):
"""
Form flat clusters from the hierarchical clustering defined by
the given linkage matrix.
Parameters
----------
Z : ndarray
The hierarchical clustering encoded with the matrix returned
by the `linka... | [
"def",
"fcluster",
"(",
"Z",
",",
"t",
",",
"criterion",
"=",
"'inconsistent'",
",",
"depth",
"=",
"2",
",",
"R",
"=",
"None",
",",
"monocrit",
"=",
"None",
")",
":",
"Z",
"=",
"np",
".",
"asarray",
"(",
"Z",
",",
"order",
"=",
"'c'",
")",
"is_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/cluster/hierarchy.py#L2464-L2649 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | analyzer_params | (args) | return prefix_with('-Xclang', result) | A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. | A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. | [
"A",
"group",
"of",
"command",
"line",
"arguments",
"can",
"mapped",
"to",
"command",
"line",
"arguments",
"of",
"the",
"analyzer",
".",
"This",
"method",
"generates",
"those",
"."
] | def analyzer_params(args):
""" A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. """
result = []
if args.store_model:
result.append('-analyzer-store={0}'.format(args.store_model))
if args.constraints_model:
result.a... | [
"def",
"analyzer_params",
"(",
"args",
")",
":",
"result",
"=",
"[",
"]",
"if",
"args",
".",
"store_model",
":",
"result",
".",
"append",
"(",
"'-analyzer-store={0}'",
".",
"format",
"(",
"args",
".",
"store_model",
")",
")",
"if",
"args",
".",
"constrai... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libscanbuild/analyze.py#L371-L405 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/MimeWriter.py | python | MimeWriter.startbody | (self, ctype, plist=[], prefix=1) | return self._fp | Returns a file-like object for writing the body of the message.
The content-type is set to the provided ctype, and the optional
parameter, plist, provides additional parameters for the
content-type declaration. The optional argument prefix determines
where the header is inserted; 0 mea... | Returns a file-like object for writing the body of the message. | [
"Returns",
"a",
"file",
"-",
"like",
"object",
"for",
"writing",
"the",
"body",
"of",
"the",
"message",
"."
] | def startbody(self, ctype, plist=[], prefix=1):
"""Returns a file-like object for writing the body of the message.
The content-type is set to the provided ctype, and the optional
parameter, plist, provides additional parameters for the
content-type declaration. The optional argument pr... | [
"def",
"startbody",
"(",
"self",
",",
"ctype",
",",
"plist",
"=",
"[",
"]",
",",
"prefix",
"=",
"1",
")",
":",
"for",
"name",
",",
"value",
"in",
"plist",
":",
"ctype",
"=",
"ctype",
"+",
"';\\n %s=\\\"%s\\\"'",
"%",
"(",
"name",
",",
"value",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/MimeWriter.py#L128-L143 | |
KhronosGroup/SPIRV-Headers | 6a55fade62dec6a406a5a721148f88a2211cbefa | tools/buildHeaders/bin/makeExtinstHeaders.py | python | mk_extinst | (name, grammar_file) | Generate one C header from a grammar | Generate one C header from a grammar | [
"Generate",
"one",
"C",
"header",
"from",
"a",
"grammar"
] | def mk_extinst(name, grammar_file):
"""Generate one C header from a grammar"""
script = '../../../tools/buildHeaders/bin/generate_language_headers.py'
subprocess.check_call(['python3',
script,
'--extinst-name=' + name,
'--extinst-grammar='... | [
"def",
"mk_extinst",
"(",
"name",
",",
"grammar_file",
")",
":",
"script",
"=",
"'../../../tools/buildHeaders/bin/generate_language_headers.py'",
"subprocess",
".",
"check_call",
"(",
"[",
"'python3'",
",",
"script",
",",
"'--extinst-name='",
"+",
"name",
",",
"'--ext... | https://github.com/KhronosGroup/SPIRV-Headers/blob/6a55fade62dec6a406a5a721148f88a2211cbefa/tools/buildHeaders/bin/makeExtinstHeaders.py#L10-L18 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiDefaultToolBarArt.GetLabelSize | (self, dc, wnd, item) | return wx.Size(item.GetMinSize().GetWidth(), label_size.GetHeight()) | Returns the label size for a toolbar item.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`. | Returns the label size for a toolbar item.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`. | [
"Returns",
"the",
"label",
"size",
"for",
"a",
"toolbar",
"item",
".",
":",
"param",
"dc",
":",
"a",
":",
"class",
":",
"DC",
"device",
"context",
";",
":",
"param",
"wnd",
":",
"a",
":",
"class",
":",
"Window",
"derived",
"window",
";",
":",
"para... | def GetLabelSize(self, dc, wnd, item):
"""
Returns the label size for a toolbar item.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`.
"""
dc.SetFont(self._f... | [
"def",
"GetLabelSize",
"(",
"self",
",",
"dc",
",",
"wnd",
",",
"item",
")",
":",
"dc",
".",
"SetFont",
"(",
"self",
".",
"_font",
")",
"label_size",
"=",
"GetLabelSize",
"(",
"dc",
",",
"item",
".",
"GetLabel",
"(",
")",
",",
"self",
".",
"_orient... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L1163-L1175 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | DragIcon | (*args, **kwargs) | return val | DragIcon(Icon image, Cursor cursor=wxNullCursor) -> DragImage | DragIcon(Icon image, Cursor cursor=wxNullCursor) -> DragImage | [
"DragIcon",
"(",
"Icon",
"image",
"Cursor",
"cursor",
"=",
"wxNullCursor",
")",
"-",
">",
"DragImage"
] | def DragIcon(*args, **kwargs):
"""DragIcon(Icon image, Cursor cursor=wxNullCursor) -> DragImage"""
val = _controls_.new_DragIcon(*args, **kwargs)
return val | [
"def",
"DragIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"new_DragIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L6399-L6402 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimize-max-distance-to-gas-station.py | python | Solution.minmaxGasDist | (self, stations, K) | return left | :type stations: List[int]
:type K: int
:rtype: float | :type stations: List[int]
:type K: int
:rtype: float | [
":",
"type",
"stations",
":",
"List",
"[",
"int",
"]",
":",
"type",
"K",
":",
"int",
":",
"rtype",
":",
"float"
] | def minmaxGasDist(self, stations, K):
"""
:type stations: List[int]
:type K: int
:rtype: float
"""
def possible(stations, K, guess):
return sum(int((stations[i+1]-stations[i]) / guess)
for i in xrange(len(stations)-1)) <= K
left... | [
"def",
"minmaxGasDist",
"(",
"self",
",",
"stations",
",",
"K",
")",
":",
"def",
"possible",
"(",
"stations",
",",
"K",
",",
"guess",
")",
":",
"return",
"sum",
"(",
"int",
"(",
"(",
"stations",
"[",
"i",
"+",
"1",
"]",
"-",
"stations",
"[",
"i",... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimize-max-distance-to-gas-station.py#L5-L22 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/mixins/treemixin.py | python | VirtualTree.OnGetItemImage | (self, index, which=wx.TreeItemIcon_Normal, column=0) | return -1 | This function may be overloaded in the derived class. It
should return the index of the image to be used. Don't forget
to associate an ImageList with the tree control. | This function may be overloaded in the derived class. It
should return the index of the image to be used. Don't forget
to associate an ImageList with the tree control. | [
"This",
"function",
"may",
"be",
"overloaded",
"in",
"the",
"derived",
"class",
".",
"It",
"should",
"return",
"the",
"index",
"of",
"the",
"image",
"to",
"be",
"used",
".",
"Don",
"t",
"forget",
"to",
"associate",
"an",
"ImageList",
"with",
"the",
"tree... | def OnGetItemImage(self, index, which=wx.TreeItemIcon_Normal, column=0):
""" This function may be overloaded in the derived class. It
should return the index of the image to be used. Don't forget
to associate an ImageList with the tree control. """
return -1 | [
"def",
"OnGetItemImage",
"(",
"self",
",",
"index",
",",
"which",
"=",
"wx",
".",
"TreeItemIcon_Normal",
",",
"column",
"=",
"0",
")",
":",
"return",
"-",
"1"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/mixins/treemixin.py#L324-L328 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/nodes.py | python | Expr.as_const | (self, eval_ctx=None) | Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environment.
.. versionchanged:: 2.4
... | Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible. | [
"Return",
"the",
"value",
"of",
"the",
"expression",
"as",
"constant",
"or",
"raise",
":",
"exc",
":",
"Impossible",
"if",
"this",
"was",
"not",
"possible",
"."
] | def as_const(self, eval_ctx=None):
"""Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environme... | [
"def",
"as_const",
"(",
"self",
",",
"eval_ctx",
"=",
"None",
")",
":",
"raise",
"Impossible",
"(",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/nodes.py#L350-L361 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.MoveCursorRight | (*args, **kwargs) | return _grid.Grid_MoveCursorRight(*args, **kwargs) | MoveCursorRight(self, bool expandSelection) -> bool | MoveCursorRight(self, bool expandSelection) -> bool | [
"MoveCursorRight",
"(",
"self",
"bool",
"expandSelection",
")",
"-",
">",
"bool"
] | def MoveCursorRight(*args, **kwargs):
"""MoveCursorRight(self, bool expandSelection) -> bool"""
return _grid.Grid_MoveCursorRight(*args, **kwargs) | [
"def",
"MoveCursorRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_MoveCursorRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1442-L1444 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/RANSApplication/python_scripts/formulations/rans_formulation.py | python | RansFormulation.GetWallFunctionSettings | (self) | Returns wall function settings
Returns:
Kratos.Parameters: Wall function settings used for formulations | Returns wall function settings | [
"Returns",
"wall",
"function",
"settings"
] | def GetWallFunctionSettings(self):
"""Returns wall function settings
Returns:
Kratos.Parameters: Wall function settings used for formulations
"""
if (hasattr(self, "_RansFormulation__wall_function_settings")):
return self.__wall_function_settings
else:
... | [
"def",
"GetWallFunctionSettings",
"(",
"self",
")",
":",
"if",
"(",
"hasattr",
"(",
"self",
",",
"\"_RansFormulation__wall_function_settings\"",
")",
")",
":",
"return",
"self",
".",
"__wall_function_settings",
"else",
":",
"raise",
"Exception",
"(",
"self",
".",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/RANSApplication/python_scripts/formulations/rans_formulation.py#L265-L274 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/lib/backgroundjobs.py | python | BackgroundJobBase.__init__ | (self) | Must be implemented in subclasses.
Subclasses must call :meth:`_init` for standard initialisation. | Must be implemented in subclasses. | [
"Must",
"be",
"implemented",
"in",
"subclasses",
"."
] | def __init__(self):
"""Must be implemented in subclasses.
Subclasses must call :meth:`_init` for standard initialisation.
"""
raise NotImplementedError("This class can not be instantiated directly.") | [
"def",
"__init__",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"This class can not be instantiated directly.\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/backgroundjobs.py#L381-L386 | ||
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/SQLiteCpp/cpplint.py | python | _DropCommonSuffixes | (filename) | return os.path.splitext(filename)[0] | Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')... | Drops common suffixes like _test.cc or -inl.h from filename. | [
"Drops",
"common",
"suffixes",
"like",
"_test",
".",
"cc",
"or",
"-",
"inl",
".",
"h",
"from",
"filename",
"."
] | def _DropCommonSuffixes(filename):
"""Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCom... | [
"def",
"_DropCommonSuffixes",
"(",
"filename",
")",
":",
"for",
"suffix",
"in",
"(",
"'test.cc'",
",",
"'regtest.cc'",
",",
"'unittest.cc'",
",",
"'inl.h'",
",",
"'impl.h'",
",",
"'internal.h'",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"suffix"... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/SQLiteCpp/cpplint.py#L3505-L3529 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/urllib.py | python | URLopener.retrieve | (self, url, filename=None, reporthook=None, data=None) | return result | retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object. | retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object. | [
"retrieve",
"(",
"url",
")",
"returns",
"(",
"filename",
"headers",
")",
"for",
"a",
"local",
"object",
"or",
"(",
"tempfilename",
"headers",
")",
"for",
"a",
"remote",
"object",
"."
] | def retrieve(self, url, filename=None, reporthook=None, data=None):
"""retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object."""
url = unwrap(toBytes(url))
if self.tempcache and url in self.tempcache:
return self.tempcache... | [
"def",
"retrieve",
"(",
"self",
",",
"url",
",",
"filename",
"=",
"None",
",",
"reporthook",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"url",
"=",
"unwrap",
"(",
"toBytes",
"(",
"url",
")",
")",
"if",
"self",
".",
"tempcache",
"and",
"url",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/urllib.py#L230-L291 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/roslib/src/roslib/packages.py | python | get_pkg_subdir | (package, subdir, required=True, env=None) | return _get_pkg_subdir_by_dir(pkg_dir, subdir, required, env) | @param required: if True, will attempt to create the subdirectory
if it does not exist. An exception will be raised if this fails.
@type required: bool
@param package: name of package
@type package: str
@param env: override os.environ dictionary
@type env: dict
@param required: if Tr... | [] | def get_pkg_subdir(package, subdir, required=True, env=None):
"""
@param required: if True, will attempt to create the subdirectory
if it does not exist. An exception will be raised if this fails.
@type required: bool
@param package: name of package
@type package: str
@param env: over... | [
"def",
"get_pkg_subdir",
"(",
"package",
",",
"subdir",
",",
"required",
"=",
"True",
",",
"env",
"=",
"None",
")",
":",
"if",
"env",
"is",
"None",
":",
"env",
"=",
"os",
".",
"environ",
"pkg_dir",
"=",
"get_pkg_dir",
"(",
"package",
",",
"required",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/packages.py#L235-L253 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/legacy_tf_layers/convolutional.py | python | conv3d_transpose | (inputs,
filters,
kernel_size,
strides=(1, 1, 1),
padding='valid',
data_format='channels_last',
activation=None,
use_bias=True,
kernel_initializer=None,... | return layer.apply(inputs) | Functional interface for transposed 3D convolution layer.
Args:
inputs: Input tensor.
filters: Integer, the dimensionality of the output space (i.e. the number
of filters in the convolution).
kernel_size: A tuple or list of 3 positive integers specifying the spatial
dimensions of the filters.... | Functional interface for transposed 3D convolution layer. | [
"Functional",
"interface",
"for",
"transposed",
"3D",
"convolution",
"layer",
"."
] | def conv3d_transpose(inputs,
filters,
kernel_size,
strides=(1, 1, 1),
padding='valid',
data_format='channels_last',
activation=None,
use_bias=True,
kern... | [
"def",
"conv3d_transpose",
"(",
"inputs",
",",
"filters",
",",
"kernel_size",
",",
"strides",
"=",
"(",
"1",
",",
"1",
",",
"1",
")",
",",
"padding",
"=",
"'valid'",
",",
"data_format",
"=",
"'channels_last'",
",",
"activation",
"=",
"None",
",",
"use_bi... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/legacy_tf_layers/convolutional.py#L1415-L1506 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py | python | Message.set_unrecognized_field | (self, key, value, variant) | Set an unrecognized field, used when decoding a message.
Args:
key: The name or number used to refer to this unknown value.
value: The value of the field.
variant: Type information needed to interpret the value or re-encode it.
Raises:
TypeError: If the variant is not an instance of me... | Set an unrecognized field, used when decoding a message. | [
"Set",
"an",
"unrecognized",
"field",
"used",
"when",
"decoding",
"a",
"message",
"."
] | def set_unrecognized_field(self, key, value, variant):
"""Set an unrecognized field, used when decoding a message.
Args:
key: The name or number used to refer to this unknown value.
value: The value of the field.
variant: Type information needed to interpret the value or re-encode it.
Ra... | [
"def",
"set_unrecognized_field",
"(",
"self",
",",
"key",
",",
"value",
",",
"variant",
")",
":",
"if",
"not",
"isinstance",
"(",
"variant",
",",
"Variant",
")",
":",
"raise",
"TypeError",
"(",
"'Variant type %s is not valid.'",
"%",
"variant",
")",
"self",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L929-L942 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/jit/_recursive.py | python | infer_methods_to_compile | (nn_module) | return overload_stubs + stubs | Implements the default rules for which methods should act as starting
points for compilation (TODO add a link when the rules are published). | Implements the default rules for which methods should act as starting
points for compilation (TODO add a link when the rules are published). | [
"Implements",
"the",
"default",
"rules",
"for",
"which",
"methods",
"should",
"act",
"as",
"starting",
"points",
"for",
"compilation",
"(",
"TODO",
"add",
"a",
"link",
"when",
"the",
"rules",
"are",
"published",
")",
"."
] | def infer_methods_to_compile(nn_module):
"""
Implements the default rules for which methods should act as starting
points for compilation (TODO add a link when the rules are published).
"""
check_module_initialized(nn_module)
user_annotated_ignored_attributes = getattr(nn_module, "__jit_ignored_... | [
"def",
"infer_methods_to_compile",
"(",
"nn_module",
")",
":",
"check_module_initialized",
"(",
"nn_module",
")",
"user_annotated_ignored_attributes",
"=",
"getattr",
"(",
"nn_module",
",",
"\"__jit_ignored_attributes__\"",
",",
"list",
"(",
")",
")",
"ignored_properties"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/jit/_recursive.py#L684-L736 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/base_events.py | python | BaseEventLoop.time | (self) | return time.monotonic() | Return the time according to the event loop's clock.
This is a float expressed in seconds since an epoch, but the
epoch, precision, accuracy and drift are unspecified and may
differ per event loop. | Return the time according to the event loop's clock. | [
"Return",
"the",
"time",
"according",
"to",
"the",
"event",
"loop",
"s",
"clock",
"."
] | def time(self):
"""Return the time according to the event loop's clock.
This is a float expressed in seconds since an epoch, but the
epoch, precision, accuracy and drift are unspecified and may
differ per event loop.
"""
return time.monotonic() | [
"def",
"time",
"(",
"self",
")",
":",
"return",
"time",
".",
"monotonic",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/base_events.py#L689-L696 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/transport.py | python | HttpTransport._start_rpc | (self, remote_info, request) | Start a remote procedure call.
Args:
remote_info: A RemoteInfo instance for this RPC.
request: The request message for this RPC.
Returns:
An Rpc instance initialized with a Request. | Start a remote procedure call. | [
"Start",
"a",
"remote",
"procedure",
"call",
"."
] | def _start_rpc(self, remote_info, request):
"""Start a remote procedure call.
Args:
remote_info: A RemoteInfo instance for this RPC.
request: The request message for this RPC.
Returns:
An Rpc instance initialized with a Request.
"""
method_url = '%s.%s' % (self.__service_url, rem... | [
"def",
"_start_rpc",
"(",
"self",
",",
"remote_info",
",",
"request",
")",
":",
"method_url",
"=",
"'%s.%s'",
"%",
"(",
"self",
".",
"__service_url",
",",
"remote_info",
".",
"method",
".",
"__name__",
")",
"encoded_request",
"=",
"self",
".",
"protocol",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/transport.py#L298-L337 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/contrib/pyopenssl.py | python | _dnsname_to_stdlib | (name) | return name | Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version.
Cryptography produces a dNSName as a unicode string that was idna-decoded
from ASCII bytes. We need to idna-encode that string to get it back, and
then on Python 3 we also need to conve... | Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version. | [
"Converts",
"a",
"dNSName",
"SubjectAlternativeName",
"field",
"to",
"the",
"form",
"used",
"by",
"the",
"standard",
"library",
"on",
"the",
"given",
"Python",
"version",
"."
] | def _dnsname_to_stdlib(name):
"""
Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version.
Cryptography produces a dNSName as a unicode string that was idna-decoded
from ASCII bytes. We need to idna-encode that string to get it back, and
... | [
"def",
"_dnsname_to_stdlib",
"(",
"name",
")",
":",
"def",
"idna_encode",
"(",
"name",
")",
":",
"\"\"\"\n Borrowed wholesale from the Python Cryptography Project. It turns out\n that we can't just safely call `idna.encode`: it can explode for\n wildcard names. This avoi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/contrib/pyopenssl.py#L151-L178 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/node.py | python | Node.__init__ | (
self,
op: str,
name: str = None,
attrs: Dict[str, object] = None,
inputs: List["Tensor"] = None,
outputs: List["Tensor"] = None,
) | A node represents an operation in a graph, and consumes zero or more Tensors, and produces zero or more Tensors.
Args:
op (str): The operation this node performs.
name (str): The name of this node.
attrs (Dict[str, object]): A dictionary that maps attribute names to their v... | A node represents an operation in a graph, and consumes zero or more Tensors, and produces zero or more Tensors. | [
"A",
"node",
"represents",
"an",
"operation",
"in",
"a",
"graph",
"and",
"consumes",
"zero",
"or",
"more",
"Tensors",
"and",
"produces",
"zero",
"or",
"more",
"Tensors",
"."
] | def __init__(
self,
op: str,
name: str = None,
attrs: Dict[str, object] = None,
inputs: List["Tensor"] = None,
outputs: List["Tensor"] = None,
):
"""
A node represents an operation in a graph, and consumes zero or more Tensors, and produces zero or mor... | [
"def",
"__init__",
"(",
"self",
",",
"op",
":",
"str",
",",
"name",
":",
"str",
"=",
"None",
",",
"attrs",
":",
"Dict",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"inputs",
":",
"List",
"[",
"\"Tensor\"",
"]",
"=",
"None",
",",
"outputs",
... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/node.py#L26-L49 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/kokkos-kernels/scripts/analysis/batched/pd.py | python | kkt_get_nthreads | (d) | return [i[0] for i in s], [i[1] for i in s] | Return sorted list of #threads used in the data. Return also the
corresponding exespace tuples. | Return sorted list of #threads used in the data. Return also the
corresponding exespace tuples. | [
"Return",
"sorted",
"list",
"of",
"#threads",
"used",
"in",
"the",
"data",
".",
"Return",
"also",
"the",
"corresponding",
"exespace",
"tuples",
"."
] | def kkt_get_nthreads(d):
"""Return sorted list of #threads used in the data. Return also the
corresponding exespace tuples."""
s = set()
for es in d.keys():
s.add((es[1]*es[2], es))
s = list(s)
s.sort()
return [i[0] for i in s], [i[1] for i in s] | [
"def",
"kkt_get_nthreads",
"(",
"d",
")",
":",
"s",
"=",
"set",
"(",
")",
"for",
"es",
"in",
"d",
".",
"keys",
"(",
")",
":",
"s",
".",
"add",
"(",
"(",
"es",
"[",
"1",
"]",
"*",
"es",
"[",
"2",
"]",
",",
"es",
")",
")",
"s",
"=",
"list... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/kokkos-kernels/scripts/analysis/batched/pd.py#L211-L219 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/util.py | python | split_filename | (filename, project_name=None) | return result | Extract name, version, python version from a filename (no extension)
Return name, version, pyver or None | Extract name, version, python version from a filename (no extension) | [
"Extract",
"name",
"version",
"python",
"version",
"from",
"a",
"filename",
"(",
"no",
"extension",
")"
] | def split_filename(filename, project_name=None):
"""
Extract name, version, python version from a filename (no extension)
Return name, version, pyver or None
"""
result = None
pyver = None
filename = unquote(filename).replace(' ', '-')
m = PYTHON_VERSION.search(filename)
if m:
... | [
"def",
"split_filename",
"(",
"filename",
",",
"project_name",
"=",
"None",
")",
":",
"result",
"=",
"None",
"pyver",
"=",
"None",
"filename",
"=",
"unquote",
"(",
"filename",
")",
".",
"replace",
"(",
"' '",
",",
"'-'",
")",
"m",
"=",
"PYTHON_VERSION",
... | 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/distlib/util.py#L839-L861 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/key.py | python | Key.get_torrent_file | (self, fp, headers=None, cb=None, num_cb=10) | return self.get_file(fp, headers, cb, num_cb, torrent=True) | Get a torrent file (see to get_file)
:type fp: file
:param fp: The file pointer of where to put the torrent
:type headers: dict
:param headers: Headers to be passed
:type cb: function
:param cb: a callback function that will be called to report
progress on ... | Get a torrent file (see to get_file) | [
"Get",
"a",
"torrent",
"file",
"(",
"see",
"to",
"get_file",
")"
] | def get_torrent_file(self, fp, headers=None, cb=None, num_cb=10):
"""
Get a torrent file (see to get_file)
:type fp: file
:param fp: The file pointer of where to put the torrent
:type headers: dict
:param headers: Headers to be passed
:type cb: function
... | [
"def",
"get_torrent_file",
"(",
"self",
",",
"fp",
",",
"headers",
"=",
"None",
",",
"cb",
"=",
"None",
",",
"num_cb",
"=",
"10",
")",
":",
"return",
"self",
".",
"get_file",
"(",
"fp",
",",
"headers",
",",
"cb",
",",
"num_cb",
",",
"torrent",
"=",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/key.py#L1561-L1586 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | BitTornado/ConfigDir.py | python | ConfigDir.__init__ | (self, dir_root) | Modified by ACR, for Armory-specific download | Modified by ACR, for Armory-specific download | [
"Modified",
"by",
"ACR",
"for",
"Armory",
"-",
"specific",
"download"
] | def __init__(self, dir_root):
"""
Modified by ACR, for Armory-specific download
"""
config_ext = '.armorydl'
self.dir_root = dir_root
if not os.path.isdir(self.dir_root):
os.mkdir(self.dir_root, 0700) # exception if failed
self.dir_icons = os.pat... | [
"def",
"__init__",
"(",
"self",
",",
"dir_root",
")",
":",
"config_ext",
"=",
"'.armorydl'",
"self",
".",
"dir_root",
"=",
"dir_root",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"dir_root",
")",
":",
"os",
".",
"mkdir",
"(",
"sel... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/BitTornado/ConfigDir.py#L73-L109 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/cognito/user_pool.py | python | get_client_apps | (user_pool_id) | return client_apps | Gets all client apps for a pool. | Gets all client apps for a pool. | [
"Gets",
"all",
"client",
"apps",
"for",
"a",
"pool",
"."
] | def get_client_apps(user_pool_id):
"""Gets all client apps for a pool."""
response = get_idp_client().list_user_pool_clients(UserPoolId=user_pool_id, MaxResults=60)
client_apps = response.get('UserPoolClients', [])
while 'NextToken' in response:
response = get_idp_client().list_user_pool_clients... | [
"def",
"get_client_apps",
"(",
"user_pool_id",
")",
":",
"response",
"=",
"get_idp_client",
"(",
")",
".",
"list_user_pool_clients",
"(",
"UserPoolId",
"=",
"user_pool_id",
",",
"MaxResults",
"=",
"60",
")",
"client_apps",
"=",
"response",
".",
"get",
"(",
"'U... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/cognito/user_pool.py#L40-L50 | |
apache/parquet-cpp | 642da055adf009652689b20e68a198cffb857651 | build-support/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L3812-L3864 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/state_ops.py | python | assign_sub | (ref, value, use_locking=None, name=None) | return ref.assign_sub(value) | Update `ref` by subtracting `value` from it.
This operation outputs `ref` after the update is done.
This makes it easier to chain operations that need to use the reset value.
Unlike `tf.math.subtract`, this op does not broadcast. `ref` and `value`
must have the same shape.
Args:
ref: A mutable `Tensor`.... | Update `ref` by subtracting `value` from it. | [
"Update",
"ref",
"by",
"subtracting",
"value",
"from",
"it",
"."
] | def assign_sub(ref, value, use_locking=None, name=None):
"""Update `ref` by subtracting `value` from it.
This operation outputs `ref` after the update is done.
This makes it easier to chain operations that need to use the reset value.
Unlike `tf.math.subtract`, this op does not broadcast. `ref` and `value`
m... | [
"def",
"assign_sub",
"(",
"ref",
",",
"value",
",",
"use_locking",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"ref",
".",
"dtype",
".",
"_is_ref_dtype",
":",
"return",
"gen_state_ops",
".",
"assign_sub",
"(",
"ref",
",",
"value",
",",
"use_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/state_ops.py#L133-L201 | |
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | python/caffe/classifier.py | python | Classifier.predict | (self, inputs, oversample=True) | return predictions | Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
when True (default). Center-only prediction when False.
Re... | Predict classification probabilities of inputs. | [
"Predict",
"classification",
"probabilities",
"of",
"inputs",
"."
] | def predict(self, inputs, oversample=True):
"""
Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
whe... | [
"def",
"predict",
"(",
"self",
",",
"inputs",
",",
"oversample",
"=",
"True",
")",
":",
"# Scale to standardize input dimensions.",
"input_",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"inputs",
")",
",",
"self",
".",
"image_dims",
"[",
"0",
"]",
","... | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/python/caffe/classifier.py#L47-L97 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py | python | DataFrame.set_index | (
self, keys, drop=True, append=False, inplace=False, verify_integrity=False
) | Set the DataFrame index using existing columns.
Set the DataFrame index (row labels) using one or more existing
columns or arrays (of the correct length). The index can replace the
existing index or expand on it.
Parameters
----------
keys : label or array-like or list ... | Set the DataFrame index using existing columns. | [
"Set",
"the",
"DataFrame",
"index",
"using",
"existing",
"columns",
"."
] | def set_index(
self, keys, drop=True, append=False, inplace=False, verify_integrity=False
):
"""
Set the DataFrame index using existing columns.
Set the DataFrame index (row labels) using one or more existing
columns or arrays (of the correct length). The index can replace t... | [
"def",
"set_index",
"(",
"self",
",",
"keys",
",",
"drop",
"=",
"True",
",",
"append",
"=",
"False",
",",
"inplace",
"=",
"False",
",",
"verify_integrity",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"\"inplace\"",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py#L4181-L4367 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.SetXOffset | (*args, **kwargs) | return _stc.StyledTextCtrl_SetXOffset(*args, **kwargs) | SetXOffset(self, int newOffset)
Get and Set the xOffset (ie, horizonal scroll position). | SetXOffset(self, int newOffset) | [
"SetXOffset",
"(",
"self",
"int",
"newOffset",
")"
] | def SetXOffset(*args, **kwargs):
"""
SetXOffset(self, int newOffset)
Get and Set the xOffset (ie, horizonal scroll position).
"""
return _stc.StyledTextCtrl_SetXOffset(*args, **kwargs) | [
"def",
"SetXOffset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetXOffset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5162-L5168 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/more-itertools/py3/more_itertools/more.py | python | map_reduce | (iterable, keyfunc, valuefunc=None, reducefunc=None) | return ret | Return a dictionary that maps the items in *iterable* to categories
defined by *keyfunc*, transforms them with *valuefunc*, and
then summarizes them by category with *reducefunc*.
*valuefunc* defaults to the identity function if it is unspecified.
If *reducefunc* is unspecified, no summarization takes ... | Return a dictionary that maps the items in *iterable* to categories
defined by *keyfunc*, transforms them with *valuefunc*, and
then summarizes them by category with *reducefunc*. | [
"Return",
"a",
"dictionary",
"that",
"maps",
"the",
"items",
"in",
"*",
"iterable",
"*",
"to",
"categories",
"defined",
"by",
"*",
"keyfunc",
"*",
"transforms",
"them",
"with",
"*",
"valuefunc",
"*",
"and",
"then",
"summarizes",
"them",
"by",
"category",
"... | def map_reduce(iterable, keyfunc, valuefunc=None, reducefunc=None):
"""Return a dictionary that maps the items in *iterable* to categories
defined by *keyfunc*, transforms them with *valuefunc*, and
then summarizes them by category with *reducefunc*.
*valuefunc* defaults to the identity function if it ... | [
"def",
"map_reduce",
"(",
"iterable",
",",
"keyfunc",
",",
"valuefunc",
"=",
"None",
",",
"reducefunc",
"=",
"None",
")",
":",
"valuefunc",
"=",
"(",
"lambda",
"x",
":",
"x",
")",
"if",
"(",
"valuefunc",
"is",
"None",
")",
"else",
"valuefunc",
"ret",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/more.py#L2997-L3061 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/BinWidthAtX.py | python | BinWidthAtX.name | (self) | return 'BinWidthAtX' | Return algorithm's name. | Return algorithm's name. | [
"Return",
"algorithm",
"s",
"name",
"."
] | def name(self):
'''
Return algorithm's name.
'''
return 'BinWidthAtX' | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"'BinWidthAtX'"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/BinWidthAtX.py#L26-L30 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | register_custom_device | (device_capsule, device_name, device_info_capsule) | Calls TFE_RegisterCustomDevice to register a custom device with Python.
Enables using C extensions specifying a custom device from Python. See the
experimental eager C API in tensorflow/c/eager/c_api_experimental.h for
details.
Note that custom devices are not currently supported inside `tf.function`s.
Arg... | Calls TFE_RegisterCustomDevice to register a custom device with Python. | [
"Calls",
"TFE_RegisterCustomDevice",
"to",
"register",
"a",
"custom",
"device",
"with",
"Python",
"."
] | def register_custom_device(device_capsule, device_name, device_info_capsule):
"""Calls TFE_RegisterCustomDevice to register a custom device with Python.
Enables using C extensions specifying a custom device from Python. See the
experimental eager C API in tensorflow/c/eager/c_api_experimental.h for
details.
... | [
"def",
"register_custom_device",
"(",
"device_capsule",
",",
"device_name",
",",
"device_info_capsule",
")",
":",
"context",
"(",
")",
".",
"register_custom_device",
"(",
"device_capsule",
",",
"device_name",
",",
"device_info_capsule",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L2685-L2708 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | examples/python/mach_o.py | python | TerminalColors.italics | (self, on=True) | return '' | Enable or disable italics depending on the "on" parameter. | Enable or disable italics depending on the "on" parameter. | [
"Enable",
"or",
"disable",
"italics",
"depending",
"on",
"the",
"on",
"parameter",
"."
] | def italics(self, on=True):
'''Enable or disable italics depending on the "on" parameter.'''
if self.enabled:
if on:
return "\x1b[3m"
else:
return "\x1b[23m"
return '' | [
"def",
"italics",
"(",
"self",
",",
"on",
"=",
"True",
")",
":",
"if",
"self",
".",
"enabled",
":",
"if",
"on",
":",
"return",
"\"\\x1b[3m\"",
"else",
":",
"return",
"\"\\x1b[23m\"",
"return",
"''"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/examples/python/mach_o.py#L235-L242 | |
HerculesWS/Hercules | 75bfe797ace4da8638b67a3b28e9f0de78dc40d8 | tools/utils/libconf.py | python | dumps | (cfg) | return str_file.getvalue() | Serialize ``cfg`` into a libconfig-formatted ``str``
``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
(numbers, strings, booleans, possibly nested dicts, lists, and tuples).
Returns the formatted string. | Serialize ``cfg`` into a libconfig-formatted ``str`` | [
"Serialize",
"cfg",
"into",
"a",
"libconfig",
"-",
"formatted",
"str"
] | def dumps(cfg):
'''Serialize ``cfg`` into a libconfig-formatted ``str``
``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
(numbers, strings, booleans, possibly nested dicts, lists, and tuples).
Returns the formatted string.
'''
str_file = io.StringIO()
dump(cfg, st... | [
"def",
"dumps",
"(",
"cfg",
")",
":",
"str_file",
"=",
"io",
".",
"StringIO",
"(",
")",
"dump",
"(",
"cfg",
",",
"str_file",
")",
"return",
"str_file",
".",
"getvalue",
"(",
")"
] | https://github.com/HerculesWS/Hercules/blob/75bfe797ace4da8638b67a3b28e9f0de78dc40d8/tools/utils/libconf.py#L672-L683 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/device_utils.py | python | DeviceUtils.Uninstall | (self, package_name, keep_data=False, timeout=None,
retries=None) | Remove the app |package_name| from the device.
This is a no-op if the app is not already installed.
Args:
package_name: The package to uninstall.
keep_data: (optional) Whether to keep the data and cache directories.
timeout: Timeout in seconds.
retries: Number of retries.
Raises:
... | Remove the app |package_name| from the device. | [
"Remove",
"the",
"app",
"|package_name|",
"from",
"the",
"device",
"."
] | def Uninstall(self, package_name, keep_data=False, timeout=None,
retries=None):
"""Remove the app |package_name| from the device.
This is a no-op if the app is not already installed.
Args:
package_name: The package to uninstall.
keep_data: (optional) Whether to keep the data an... | [
"def",
"Uninstall",
"(",
"self",
",",
"package_name",
",",
"keep_data",
"=",
"False",
",",
"timeout",
"=",
"None",
",",
"retries",
"=",
"None",
")",
":",
"installed",
"=",
"self",
".",
"_GetApplicationPathsInternal",
"(",
"package_name",
")",
"if",
"not",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L743-L771 | ||
arkenthera/electron-vibrancy | 383153ef9ccb23a6c7517150d6bb0794dff3115e | scripts/cpplint.py | python | _SetCountingStyle | (level) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def _SetCountingStyle(level):
"""Sets the module's counting options."""
_cpplint_state.SetCountingStyle(level) | [
"def",
"_SetCountingStyle",
"(",
"level",
")",
":",
"_cpplint_state",
".",
"SetCountingStyle",
"(",
"level",
")"
] | https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L761-L763 | ||
qboticslabs/mastering_ros | d83e78f30acc45b0f18522c1d5fae3a7f52974b9 | chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_ew.py | python | Pick_Place._create_place_goal | (self, group, target, places) | return goal | Create a MoveIt! PlaceGoal | Create a MoveIt! PlaceGoal | [
"Create",
"a",
"MoveIt!",
"PlaceGoal"
] | def _create_place_goal(self, group, target, places):
"""
Create a MoveIt! PlaceGoal
"""
# Create goal:
goal = PlaceGoal()
goal.group_name = group
goal.attached_object_name = target
goal.place_locations.extend(places)
# Configure goal ... | [
"def",
"_create_place_goal",
"(",
"self",
",",
"group",
",",
"target",
",",
"places",
")",
":",
"# Create goal:",
"goal",
"=",
"PlaceGoal",
"(",
")",
"goal",
".",
"group_name",
"=",
"group",
"goal",
".",
"attached_object_name",
"=",
"target",
"goal",
".",
... | https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_ew.py#L273-L295 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | find_distributions | (path_item, only=False) | return finder(importer, path_item, only) | Yield distributions accessible via `path_item` | Yield distributions accessible via `path_item` | [
"Yield",
"distributions",
"accessible",
"via",
"path_item"
] | def find_distributions(path_item, only=False):
"""Yield distributions accessible via `path_item`"""
importer = get_importer(path_item)
finder = _find_adapter(_distribution_finders, importer)
return finder(importer, path_item, only) | [
"def",
"find_distributions",
"(",
"path_item",
",",
"only",
"=",
"False",
")",
":",
"importer",
"=",
"get_importer",
"(",
"path_item",
")",
"finder",
"=",
"_find_adapter",
"(",
"_distribution_finders",
",",
"importer",
")",
"return",
"finder",
"(",
"importer",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L3933-L3941 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | SimBody.setTransform | (self, R, t) | return _robotsim.SimBody_setTransform(self, R, t) | setTransform(SimBody self, double const [9] R, double const [3] t)
Sets the body's transformation at the current simulation time step (in center-
of-mass centered coordinates). | setTransform(SimBody self, double const [9] R, double const [3] t) | [
"setTransform",
"(",
"SimBody",
"self",
"double",
"const",
"[",
"9",
"]",
"R",
"double",
"const",
"[",
"3",
"]",
"t",
")"
] | def setTransform(self, R, t):
"""
setTransform(SimBody self, double const [9] R, double const [3] t)
Sets the body's transformation at the current simulation time step (in center-
of-mass centered coordinates).
"""
return _robotsim.SimBody_setTransform(self, R, t) | [
"def",
"setTransform",
"(",
"self",
",",
"R",
",",
"t",
")",
":",
"return",
"_robotsim",
".",
"SimBody_setTransform",
"(",
"self",
",",
"R",
",",
"t",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7943-L7953 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/virtual_target.py | python | VirtualTarget.name | (self) | return self.name_ | Name of this target. | Name of this target. | [
"Name",
"of",
"this",
"target",
"."
] | def name (self):
""" Name of this target.
"""
return self.name_ | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"name_"
] | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/virtual_target.py#L289-L292 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/graph_kernel/model/model.py | python | Graph.add | (self, ops) | Add ops | Add ops | [
"Add",
"ops"
] | def add(self, ops):
"""Add ops"""
if isinstance(ops, Operator):
self.ops.append(ops)
else:
self.ops.extend(ops) | [
"def",
"add",
"(",
"self",
",",
"ops",
")",
":",
"if",
"isinstance",
"(",
"ops",
",",
"Operator",
")",
":",
"self",
".",
"ops",
".",
"append",
"(",
"ops",
")",
"else",
":",
"self",
".",
"ops",
".",
"extend",
"(",
"ops",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/graph_kernel/model/model.py#L402-L407 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | X509Extension.__init__ | (self, type_name, critical, value, subject=None, issuer=None) | Initializes an X509 extension.
:param type_name: The name of the type of extension_ to create.
:type type_name: :py:data:`bytes`
:param bool critical: A flag indicating whether this is a critical
extension.
:param value: The value of the extension.
:type value: :py... | Initializes an X509 extension. | [
"Initializes",
"an",
"X509",
"extension",
"."
] | def __init__(self, type_name, critical, value, subject=None, issuer=None):
"""
Initializes an X509 extension.
:param type_name: The name of the type of extension_ to create.
:type type_name: :py:data:`bytes`
:param bool critical: A flag indicating whether this is a critical
... | [
"def",
"__init__",
"(",
"self",
",",
"type_name",
",",
"critical",
",",
"value",
",",
"subject",
"=",
"None",
",",
"issuer",
"=",
"None",
")",
":",
"ctx",
"=",
"_ffi",
".",
"new",
"(",
"\"X509V3_CTX*\"",
")",
"# A context is necessary for any extension which u... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L706-L765 | ||
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/generators.py | python | Generator.convert_to_consumable_types | (self, project, name, prop_set, sources, only_one=False) | return consumed | Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert 'source' to only one of source types
if there's more that one possibility, re... | Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert 'source' to only one of source types
if there's more that one possibility, re... | [
"Attempts",
"to",
"convert",
"source",
"to",
"the",
"types",
"that",
"this",
"generator",
"can",
"handle",
".",
"The",
"intention",
"is",
"to",
"produce",
"the",
"set",
"of",
"targets",
"can",
"should",
"be",
"used",
"when",
"generator",
"is",
"run",
".",
... | def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
""" Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert... | [
"def",
"convert_to_consumable_types",
"(",
"self",
",",
"project",
",",
"name",
",",
"prop_set",
",",
"sources",
",",
"only_one",
"=",
"False",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/generators.py#L528-L585 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py | python | drop_fields | (base, drop_names, usemask=True, asrecarray=False) | return _fix_output(output, usemask=usemask, asrecarray=asrecarray) | Return a new array with fields in `drop_names` dropped.
Nested fields are supported.
..versionchanged: 1.18.0
`drop_fields` returns an array with 0 fields if all fields are dropped,
rather than returning ``None`` as it did previously.
Parameters
----------
base : array
Inp... | Return a new array with fields in `drop_names` dropped. | [
"Return",
"a",
"new",
"array",
"with",
"fields",
"in",
"drop_names",
"dropped",
"."
] | def drop_fields(base, drop_names, usemask=True, asrecarray=False):
"""
Return a new array with fields in `drop_names` dropped.
Nested fields are supported.
..versionchanged: 1.18.0
`drop_fields` returns an array with 0 fields if all fields are dropped,
rather than returning ``None`` as... | [
"def",
"drop_fields",
"(",
"base",
",",
"drop_names",
",",
"usemask",
"=",
"True",
",",
"asrecarray",
"=",
"False",
")",
":",
"if",
"_is_string_like",
"(",
"drop_names",
")",
":",
"drop_names",
"=",
"[",
"drop_names",
"]",
"else",
":",
"drop_names",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py#L524-L585 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py | python | BabylMessage.remove_label | (self, label) | Remove label from the list of labels on the message. | Remove label from the list of labels on the message. | [
"Remove",
"label",
"from",
"the",
"list",
"of",
"labels",
"on",
"the",
"message",
"."
] | def remove_label(self, label):
"""Remove label from the list of labels on the message."""
try:
self._labels.remove(label)
except ValueError:
pass | [
"def",
"remove_label",
"(",
"self",
",",
"label",
")",
":",
"try",
":",
"self",
".",
"_labels",
".",
"remove",
"(",
"label",
")",
"except",
"ValueError",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1788-L1793 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | NativeFontInfo.SetEncoding | (*args, **kwargs) | return _gdi_.NativeFontInfo_SetEncoding(*args, **kwargs) | SetEncoding(self, int encoding) | SetEncoding(self, int encoding) | [
"SetEncoding",
"(",
"self",
"int",
"encoding",
")"
] | def SetEncoding(*args, **kwargs):
"""SetEncoding(self, int encoding)"""
return _gdi_.NativeFontInfo_SetEncoding(*args, **kwargs) | [
"def",
"SetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_SetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1937-L1939 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBType.GetVirtualBaseClassAtIndex | (self, *args) | return _lldb.SBType_GetVirtualBaseClassAtIndex(self, *args) | GetVirtualBaseClassAtIndex(self, uint32_t idx) -> SBTypeMember | GetVirtualBaseClassAtIndex(self, uint32_t idx) -> SBTypeMember | [
"GetVirtualBaseClassAtIndex",
"(",
"self",
"uint32_t",
"idx",
")",
"-",
">",
"SBTypeMember"
] | def GetVirtualBaseClassAtIndex(self, *args):
"""GetVirtualBaseClassAtIndex(self, uint32_t idx) -> SBTypeMember"""
return _lldb.SBType_GetVirtualBaseClassAtIndex(self, *args) | [
"def",
"GetVirtualBaseClassAtIndex",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBType_GetVirtualBaseClassAtIndex",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10457-L10459 | |
facebookresearch/mvfst-rl | 778bc4259ae7277e67c2ead593a493845c93db83 | train/pantheon_env.py | python | get_jobs_to_perform | (job_ids, max_jobs) | return jobs | Obtain the list of jobs to perform given the current settings | Obtain the list of jobs to perform given the current settings | [
"Obtain",
"the",
"list",
"of",
"jobs",
"to",
"perform",
"given",
"the",
"current",
"settings"
] | def get_jobs_to_perform(job_ids, max_jobs):
"""Obtain the list of jobs to perform given the current settings"""
jobs = get_pantheon_emulated_jobs()
# Filter jobs.
if job_ids:
jobs = [jobs[job_id] for job_id in job_ids]
logging.info(
"Filtered {} jobs corresponding to ids {}.... | [
"def",
"get_jobs_to_perform",
"(",
"job_ids",
",",
"max_jobs",
")",
":",
"jobs",
"=",
"get_pantheon_emulated_jobs",
"(",
")",
"# Filter jobs.",
"if",
"job_ids",
":",
"jobs",
"=",
"[",
"jobs",
"[",
"job_id",
"]",
"for",
"job_id",
"in",
"job_ids",
"]",
"loggin... | https://github.com/facebookresearch/mvfst-rl/blob/778bc4259ae7277e67c2ead593a493845c93db83/train/pantheon_env.py#L222-L239 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/function.py | python | _DefinedFunction.grad_func_name | (self) | return self._grad_func.name if self._grad_func else None | Its gradient function's name. | Its gradient function's name. | [
"Its",
"gradient",
"function",
"s",
"name",
"."
] | def grad_func_name(self):
"""Its gradient function's name."""
return self._grad_func.name if self._grad_func else None | [
"def",
"grad_func_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_grad_func",
".",
"name",
"if",
"self",
".",
"_grad_func",
"else",
"None"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/function.py#L298-L300 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | _ProxyFile.tell | (self) | return self._pos | Return the position. | Return the position. | [
"Return",
"the",
"position",
"."
] | def tell(self):
"""Return the position."""
return self._pos | [
"def",
"tell",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pos"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1962-L1964 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/dump_apk_resource_strings.py | python | UnquoteString | (s) | return result | Unquote a given string from aapt dump.
Args:
s: An UTF-8 encoded string that contains backslashes for quotes, as found
in the output of 'aapt dump resources --values'.
Returns:
The unquoted version of the input string. | Unquote a given string from aapt dump. | [
"Unquote",
"a",
"given",
"string",
"from",
"aapt",
"dump",
"."
] | def UnquoteString(s):
"""Unquote a given string from aapt dump.
Args:
s: An UTF-8 encoded string that contains backslashes for quotes, as found
in the output of 'aapt dump resources --values'.
Returns:
The unquoted version of the input string.
"""
if not '\\' in s:
return s
result = ''
... | [
"def",
"UnquoteString",
"(",
"s",
")",
":",
"if",
"not",
"'\\\\'",
"in",
"s",
":",
"return",
"s",
"result",
"=",
"''",
"start",
"=",
"0",
"size",
"=",
"len",
"(",
"s",
")",
"while",
"start",
"<",
"size",
":",
"pos",
"=",
"s",
".",
"find",
"(",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/dump_apk_resource_strings.py#L100-L138 | |
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
".",
"Args",
":",
"filename",
":",
"The",
"name",
"of",
"the",
"current",
"file",
".",
"lines",
":",
"An",
"array",
"of",
"strings",
"each",... | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array l... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L1830-L1844 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/turtle.py | python | RawTurtle.onrelease | (self, fun, btn=1, add=None) | Bind fun to mouse-button-release event on this turtle on canvas.
Arguments:
fun -- a function with two arguments, to which will be assigned
the coordinates of the clicked point on the canvas.
btn -- number of the mouse-button defaults to 1 (left mouse button).
Example ... | Bind fun to mouse-button-release event on this turtle on canvas. | [
"Bind",
"fun",
"to",
"mouse",
"-",
"button",
"-",
"release",
"event",
"on",
"this",
"turtle",
"on",
"canvas",
"."
] | def onrelease(self, fun, btn=1, add=None):
"""Bind fun to mouse-button-release event on this turtle on canvas.
Arguments:
fun -- a function with two arguments, to which will be assigned
the coordinates of the clicked point on the canvas.
btn -- number of the mouse-butto... | [
"def",
"onrelease",
"(",
"self",
",",
"fun",
",",
"btn",
"=",
"1",
",",
"add",
"=",
"None",
")",
":",
"self",
".",
"screen",
".",
"_onrelease",
"(",
"self",
".",
"turtle",
".",
"_item",
",",
"fun",
",",
"btn",
",",
"add",
")",
"self",
".",
"_up... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/turtle.py#L3436-L3459 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | util/gem5art/artifact/gem5art/artifact/_artifactdb.py | python | ArtifactFileDB.insert_artifact | (
self,
the_uuid: UUID,
the_hash: str,
the_artifact: Dict[str, Union[str, UUID]],
) | return True | Put the artifact to the database.
Return True if the artifact uuid does not exist in the database prior
to calling this function; return False otherwise. | Put the artifact to the database. | [
"Put",
"the",
"artifact",
"to",
"the",
"database",
"."
] | def insert_artifact(
self,
the_uuid: UUID,
the_hash: str,
the_artifact: Dict[str, Union[str, UUID]],
) -> bool:
"""
Put the artifact to the database.
Return True if the artifact uuid does not exist in the database prior
to calling this function; retur... | [
"def",
"insert_artifact",
"(",
"self",
",",
"the_uuid",
":",
"UUID",
",",
"the_hash",
":",
"str",
",",
"the_artifact",
":",
"Dict",
"[",
"str",
",",
"Union",
"[",
"str",
",",
"UUID",
"]",
"]",
",",
")",
"->",
"bool",
":",
"uuid_str",
"=",
"str",
"(... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/gem5art/artifact/gem5art/artifact/_artifactdb.py#L355-L377 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | RadioBox.GetRowCount | (*args, **kwargs) | return _controls_.RadioBox_GetRowCount(*args, **kwargs) | GetRowCount(self) -> unsigned int | GetRowCount(self) -> unsigned int | [
"GetRowCount",
"(",
"self",
")",
"-",
">",
"unsigned",
"int"
] | def GetRowCount(*args, **kwargs):
"""GetRowCount(self) -> unsigned int"""
return _controls_.RadioBox_GetRowCount(*args, **kwargs) | [
"def",
"GetRowCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_GetRowCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2649-L2651 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/tpu_replicated_variable.py | python | TPUReplicatedVariable._update | (self, update_fn, value, **kwargs) | return control_flow_ops.group(
*tuple(
_on_device_update(update_fn, v, input_tensor, **kwargs)
for v in self.variables)) | Converts the value to tensor and updates the variable list. | Converts the value to tensor and updates the variable list. | [
"Converts",
"the",
"value",
"to",
"tensor",
"and",
"updates",
"the",
"variable",
"list",
"."
] | def _update(self, update_fn, value, **kwargs):
"""Converts the value to tensor and updates the variable list."""
input_tensor = ops.convert_to_tensor(
value, name='value_in_tensor', dtype=self.dtype)
return control_flow_ops.group(
*tuple(
_on_device_update(update_fn, v, input_te... | [
"def",
"_update",
"(",
"self",
",",
"update_fn",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"input_tensor",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"value",
",",
"name",
"=",
"'value_in_tensor'",
",",
"dtype",
"=",
"self",
".",
"dtype",
")",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/tpu_replicated_variable.py#L212-L220 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/config/mac/gen_plist.py | python | InterpolateList | (values, substitutions) | return result | Interpolates variable references into |value| using |substitutions|.
Inputs:
values: a list of values
substitutions: a mapping of variable names to values
Returns:
A new list of values with all variables references ${VARIABLE} replaced
by their value in |substitutions| or None if any of the variab... | Interpolates variable references into |value| using |substitutions|. | [
"Interpolates",
"variable",
"references",
"into",
"|value|",
"using",
"|substitutions|",
"."
] | def InterpolateList(values, substitutions):
"""Interpolates variable references into |value| using |substitutions|.
Inputs:
values: a list of values
substitutions: a mapping of variable names to values
Returns:
A new list of values with all variables references ${VARIABLE} replaced
by their valu... | [
"def",
"InterpolateList",
"(",
"values",
",",
"substitutions",
")",
":",
"result",
"=",
"[",
"]",
"for",
"value",
"in",
"values",
":",
"interpolated",
"=",
"InterpolateValue",
"(",
"value",
",",
"substitutions",
")",
"if",
"interpolated",
"is",
"None",
":",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/config/mac/gen_plist.py#L37-L55 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | tools/rdm/ExpectedResults.py | python | AckDiscoveryResult.__init__ | (self,
pid_id,
field_names=[],
field_values={},
action=None,
warning=None,
advisory=None) | Create an expected result object which is an ACK for a DISCOVERY request.
Args:
pid_id: The pid id we expect
field_names: Check that these fields are present in the response
field_values: Check that fields & values are present in the response
action: The action to run if this result matches... | Create an expected result object which is an ACK for a DISCOVERY request. | [
"Create",
"an",
"expected",
"result",
"object",
"which",
"is",
"an",
"ACK",
"for",
"a",
"DISCOVERY",
"request",
"."
] | def __init__(self,
pid_id,
field_names=[],
field_values={},
action=None,
warning=None,
advisory=None):
"""Create an expected result object which is an ACK for a DISCOVERY request.
Args:
pid_id: The pid id we expect
... | [
"def",
"__init__",
"(",
"self",
",",
"pid_id",
",",
"field_names",
"=",
"[",
"]",
",",
"field_values",
"=",
"{",
"}",
",",
"action",
"=",
"None",
",",
"warning",
"=",
"None",
",",
"advisory",
"=",
"None",
")",
":",
"super",
"(",
"AckDiscoveryResult",
... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/tools/rdm/ExpectedResults.py#L350-L373 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | _TopologicallySortedEnvVarKeys | (env) | Takes a dict |env| whose values are strings that can refer to other keys,
for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of
env such that key2 is after key1 in L if env[key2] refers to env[key1].
Throws an Exception in case of dependency cycles. | Takes a dict |env| whose values are strings that can refer to other keys,
for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of
env such that key2 is after key1 in L if env[key2] refers to env[key1]. | [
"Takes",
"a",
"dict",
"|env|",
"whose",
"values",
"are",
"strings",
"that",
"can",
"refer",
"to",
"other",
"keys",
"for",
"example",
"env",
"[",
"foo",
"]",
"=",
"$",
"(",
"bar",
")",
"and",
"$",
"(",
"baz",
")",
".",
"Returns",
"a",
"list",
"L",
... | def _TopologicallySortedEnvVarKeys(env):
"""Takes a dict |env| whose values are strings that can refer to other keys,
for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of
env such that key2 is after key1 in L if env[key2] refers to env[key1].
Throws an Exception in case of dependency c... | [
"def",
"_TopologicallySortedEnvVarKeys",
"(",
"env",
")",
":",
"# Since environment variables can refer to other variables, the evaluation",
"# order is important. Below is the logic to compute the dependency graph",
"# and sort it.",
"regex",
"=",
"re",
".",
"compile",
"(",
"r'\\$\\{(... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L1547-L1578 | ||
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/so3.py | python | So3.__init__ | (self, q) | internally represented by a unit quaternion q | internally represented by a unit quaternion q | [
"internally",
"represented",
"by",
"a",
"unit",
"quaternion",
"q"
] | def __init__(self, q):
""" internally represented by a unit quaternion q """
self.q = q | [
"def",
"__init__",
"(",
"self",
",",
"q",
")",
":",
"self",
".",
"q",
"=",
"q"
] | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/so3.py#L11-L13 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | _shape_simplifier | (x) | return None | if is_op(x):
if is_op(x,'zero'):
return x.args[0]
if is_op(x,'basis'):
return x.args[1]
if is_op(x,'eye'):
return flatten(x.args[0],x.args[0])
if is_op(x,'diag'):
return flatten(len_(x.args[0]),len_(x.args[0]))
if is_op(x,'dot'):
... | if is_op(x):
if is_op(x,'zero'):
return x.args[0]
if is_op(x,'basis'):
return x.args[1]
if is_op(x,'eye'):
return flatten(x.args[0],x.args[0])
if is_op(x,'diag'):
return flatten(len_(x.args[0]),len_(x.args[0]))
if is_op(x,'dot'):
... | [
"if",
"is_op",
"(",
"x",
")",
":",
"if",
"is_op",
"(",
"x",
"zero",
")",
":",
"return",
"x",
".",
"args",
"[",
"0",
"]",
"if",
"is_op",
"(",
"x",
"basis",
")",
":",
"return",
"x",
".",
"args",
"[",
"1",
"]",
"if",
"is_op",
"(",
"x",
"eye",
... | def _shape_simplifier(x):
if is_scalar(x): return ()
try:
res = x.returnType().shape()
if res is not None:
return res
except Exception as e:
pass
if isinstance(x,VariableExpression):
if x.var.type.size is not None:
return x.var.type.shape()
eli... | [
"def",
"_shape_simplifier",
"(",
"x",
")",
":",
"if",
"is_scalar",
"(",
"x",
")",
":",
"return",
"(",
")",
"try",
":",
"res",
"=",
"x",
".",
"returnType",
"(",
")",
".",
"shape",
"(",
")",
"if",
"res",
"is",
"not",
"None",
":",
"return",
"res",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L5585-L5623 | |
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | python/open3d/visualization/tensorboard_plugin/metadata.py | python | create_summary_metadata | (description, metadata) | return SummaryMetadata(
summary_description=description,
plugin_data=SummaryMetadata.PluginData(
plugin_name=PLUGIN_NAME, content=ln_proto.SerializeToString()),
) | Creates summary metadata. Reserved for future use. Required by
TensorBoard.
Args:
description: The description to show in TensorBoard.
Returns:
A `SummaryMetadata` protobuf object. | Creates summary metadata. Reserved for future use. Required by
TensorBoard. | [
"Creates",
"summary",
"metadata",
".",
"Reserved",
"for",
"future",
"use",
".",
"Required",
"by",
"TensorBoard",
"."
] | def create_summary_metadata(description, metadata):
"""Creates summary metadata. Reserved for future use. Required by
TensorBoard.
Args:
description: The description to show in TensorBoard.
Returns:
A `SummaryMetadata` protobuf object.
"""
ln_proto = LabelToNames()
if 'label_to... | [
"def",
"create_summary_metadata",
"(",
"description",
",",
"metadata",
")",
":",
"ln_proto",
"=",
"LabelToNames",
"(",
")",
"if",
"'label_to_names'",
"in",
"metadata",
":",
"ln_proto",
".",
"label_to_names",
".",
"update",
"(",
"metadata",
"[",
"'label_to_names'",... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/visualization/tensorboard_plugin/metadata.py#L100-L117 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py | python | TarInfo._create_header | (info, format, encoding, errors) | return buf | Return a header block. info is a dictionary with file
information, format must be one of the *_FORMAT constants. | Return a header block. info is a dictionary with file
information, format must be one of the *_FORMAT constants. | [
"Return",
"a",
"header",
"block",
".",
"info",
"is",
"a",
"dictionary",
"with",
"file",
"information",
"format",
"must",
"be",
"one",
"of",
"the",
"*",
"_FORMAT",
"constants",
"."
] | def _create_header(info, format, encoding, errors):
"""Return a header block. info is a dictionary with file
information, format must be one of the *_FORMAT constants.
"""
parts = [
stn(info.get("name", ""), 100, encoding, errors),
itn(info.get("mode", 0) & 0o7... | [
"def",
"_create_header",
"(",
"info",
",",
"format",
",",
"encoding",
",",
"errors",
")",
":",
"parts",
"=",
"[",
"stn",
"(",
"info",
".",
"get",
"(",
"\"name\"",
",",
"\"\"",
")",
",",
"100",
",",
"encoding",
",",
"errors",
")",
",",
"itn",
"(",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py#L1114-L1139 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/classifier/nearest_neighbor_classifier.py | python | NearestNeighborClassifier._load_version | (cls, state, version) | return cls(knn_model, state) | A function to load a previously saved NearestNeighborClassifier model.
Parameters
----------
unpickler : GLUnpickler
A GLUnpickler file handler.
version : int
Version number maintained by the class writer. | A function to load a previously saved NearestNeighborClassifier model. | [
"A",
"function",
"to",
"load",
"a",
"previously",
"saved",
"NearestNeighborClassifier",
"model",
"."
] | def _load_version(cls, state, version):
"""
A function to load a previously saved NearestNeighborClassifier model.
Parameters
----------
unpickler : GLUnpickler
A GLUnpickler file handler.
version : int
Version number maintained by the class writ... | [
"def",
"_load_version",
"(",
"cls",
",",
"state",
",",
"version",
")",
":",
"assert",
"version",
"==",
"cls",
".",
"_PYTHON_NN_CLASSIFIER_MODEL_VERSION",
"knn_model",
"=",
"_tc",
".",
"nearest_neighbors",
".",
"NearestNeighborsModel",
"(",
"state",
"[",
"\"knn_mod... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/classifier/nearest_neighbor_classifier.py#L346-L362 | |
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/deNovoQualityScore/denovo.py | python | precompute_indel_prior | (param, max_length) | return mut_rate | Precompute a lookup table for a length-dependent indel prior | Precompute a lookup table for a length-dependent indel prior | [
"Precompute",
"a",
"lookup",
"table",
"for",
"a",
"length",
"-",
"dependent",
"indel",
"prior"
] | def precompute_indel_prior(param, max_length):
"""Precompute a lookup table for a length-dependent indel prior"""
dx = np.arange(0, max_length+1)
mut_rate = np.exp(dx * param['slope'] + param['intercept'])
return mut_rate | [
"def",
"precompute_indel_prior",
"(",
"param",
",",
"max_length",
")",
":",
"dx",
"=",
"np",
".",
"arange",
"(",
"0",
",",
"max_length",
"+",
"1",
")",
"mut_rate",
"=",
"np",
".",
"exp",
"(",
"dx",
"*",
"param",
"[",
"'slope'",
"]",
"+",
"param",
"... | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/deNovoQualityScore/denovo.py#L447-L453 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Cluster/Clusters.py | python | Cluster.__init__ | (self, metric=0.0, children=None, position=None, index=-1, name=None, data=None) | Constructor
**Arguments**
see the class documentation for the meanings of these arguments
*my wrists are tired* | Constructor | [
"Constructor"
] | def __init__(self, metric=0.0, children=None, position=None, index=-1, name=None, data=None):
"""Constructor
**Arguments**
see the class documentation for the meanings of these arguments
*my wrists are tired*
"""
if children is None:
children = [... | [
"def",
"__init__",
"(",
"self",
",",
"metric",
"=",
"0.0",
",",
"children",
"=",
"None",
",",
"position",
"=",
"None",
",",
"index",
"=",
"-",
"1",
",",
"name",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"if",
"children",
"is",
"None",
":",... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Cluster/Clusters.py#L62-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.