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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Qihoo360/mongosync | 55b647e81c072ebe91daaa3b9dc1a953c3c22e19 | dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py | python | CheckBraces | (filename, clean_lines, linenum, error) | Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Looks for misplaced braces (e.g. at the end of line). | [
"Looks",
"for",
"misplaced",
"braces",
"(",
"e",
".",
"g",
".",
"at",
"the",
"end",
"of",
"line",
")",
"."
] | def CheckBraces(filename, clean_lines, linenum, error):
"""Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any er... | [
"def",
"CheckBraces",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"if",
"Match",
"(",
"r'\\s*{\\s*$'",
",",
"line",
")",
":",
... | https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L1993-L2064 | ||
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ackermann_control/src/carla_ackermann_control/carla_ackermann_control_node.py | python | CarlaAckermannControl.reconfigure_pid_parameters | (self, ego_vehicle_control_parameter, _level) | return ego_vehicle_control_parameter | Callback for dynamic reconfigure call to set the PID parameters
:param ego_vehicle_control_parameter:
:type ego_vehicle_control_parameter: \
carla_ackermann_control.cfg.EgoVehicleControlParameterConfig | Callback for dynamic reconfigure call to set the PID parameters | [
"Callback",
"for",
"dynamic",
"reconfigure",
"call",
"to",
"set",
"the",
"PID",
"parameters"
] | def reconfigure_pid_parameters(self, ego_vehicle_control_parameter, _level):
"""
Callback for dynamic reconfigure call to set the PID parameters
:param ego_vehicle_control_parameter:
:type ego_vehicle_control_parameter: \
carla_ackermann_control.cfg.EgoVehicleControlParamete... | [
"def",
"reconfigure_pid_parameters",
"(",
"self",
",",
"ego_vehicle_control_parameter",
",",
"_level",
")",
":",
"rospy",
".",
"loginfo",
"(",
"\"Reconfigure Request: \"",
"\"speed ({speed_Kp}, {speed_Ki}, {speed_Kd}),\"",
"\"accel ({accel_Kp}, {accel_Ki}, {accel_Kd}),\"",
"\"\"",... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ackermann_control/src/carla_ackermann_control/carla_ackermann_control_node.py#L154-L177 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_and_expression_2 | (t) | and_expression : and_expression AND equality_expression | and_expression : and_expression AND equality_expression | [
"and_expression",
":",
"and_expression",
"AND",
"equality_expression"
] | def p_and_expression_2(t):
'and_expression : and_expression AND equality_expression'
pass | [
"def",
"p_and_expression_2",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L661-L663 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_root.py | python | _root_broyden1_doc | () | Options
-------
nit : int, optional
Number of iterations to make. If omitted (default), make as many
as required to meet tolerances.
disp : bool, optional
Print status to stdout on every iteration.
maxiter : int, optional
Maximum number of iterations to make. If more are ... | Options
-------
nit : int, optional
Number of iterations to make. If omitted (default), make as many
as required to meet tolerances.
disp : bool, optional
Print status to stdout on every iteration.
maxiter : int, optional
Maximum number of iterations to make. If more are ... | [
"Options",
"-------",
"nit",
":",
"int",
"optional",
"Number",
"of",
"iterations",
"to",
"make",
".",
"If",
"omitted",
"(",
"default",
")",
"make",
"as",
"many",
"as",
"required",
"to",
"meet",
"tolerances",
".",
"disp",
":",
"bool",
"optional",
"Print",
... | def _root_broyden1_doc():
"""
Options
-------
nit : int, optional
Number of iterations to make. If omitted (default), make as many
as required to meet tolerances.
disp : bool, optional
Print status to stdout on every iteration.
maxiter : int, optional
Maximum numb... | [
"def",
"_root_broyden1_doc",
"(",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_root.py#L307-L362 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/display.py | python | DisplayObject.__init__ | (self, data=None, url=None, filename=None) | Create a display object given raw data.
When this object is returned by an expression or passed to the
display function, it will result in the data being displayed
in the frontend. The MIME type of the data should match the
subclasses used, so the Png subclass should be used for 'image/... | Create a display object given raw data. | [
"Create",
"a",
"display",
"object",
"given",
"raw",
"data",
"."
] | def __init__(self, data=None, url=None, filename=None):
"""Create a display object given raw data.
When this object is returned by an expression or passed to the
display function, it will result in the data being displayed
in the frontend. The MIME type of the data should match the
... | [
"def",
"__init__",
"(",
"self",
",",
"data",
"=",
"None",
",",
"url",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"if",
"data",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"data",
",",
"string_types",
")",
":",
"if",
"data",
".",
"start... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/display.py#L585-L619 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | clang/bindings/python/clang/cindex.py | python | Cursor.is_abstract_record | (self) | return conf.lib.clang_CXXRecord_isAbstract(self) | Returns True if the cursor refers to a C++ record declaration
that has pure virtual member functions. | Returns True if the cursor refers to a C++ record declaration
that has pure virtual member functions. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"record",
"declaration",
"that",
"has",
"pure",
"virtual",
"member",
"functions",
"."
] | def is_abstract_record(self):
"""Returns True if the cursor refers to a C++ record declaration
that has pure virtual member functions.
"""
return conf.lib.clang_CXXRecord_isAbstract(self) | [
"def",
"is_abstract_record",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXRecord_isAbstract",
"(",
"self",
")"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L1500-L1504 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | openr/py/openr/cli/commands/kvstore.py | python | KvNodesCmd.get_connected_nodes | (
self, adj_keys: kvstore_types.Publication, node_id: str
) | return nx.node_connected_component(graph, node_id) | Build graph of adjacencies and return list of connected node from
current node-id | Build graph of adjacencies and return list of connected node from
current node-id | [
"Build",
"graph",
"of",
"adjacencies",
"and",
"return",
"list",
"of",
"connected",
"node",
"from",
"current",
"node",
"-",
"id"
] | def get_connected_nodes(
self, adj_keys: kvstore_types.Publication, node_id: str
) -> Set[str]:
"""
Build graph of adjacencies and return list of connected node from
current node-id
"""
import networkx as nx
edges = set()
graph = nx.Graph()
fo... | [
"def",
"get_connected_nodes",
"(",
"self",
",",
"adj_keys",
":",
"kvstore_types",
".",
"Publication",
",",
"node_id",
":",
"str",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"import",
"networkx",
"as",
"nx",
"edges",
"=",
"set",
"(",
")",
"graph",
"=",
"nx... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/commands/kvstore.py#L437-L460 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/gpu_info.py | python | GPUInfo.feature_status | (self) | return self._feature_status | Returns an optional dictionary of graphics features and their status. | Returns an optional dictionary of graphics features and their status. | [
"Returns",
"an",
"optional",
"dictionary",
"of",
"graphics",
"features",
"and",
"their",
"status",
"."
] | def feature_status(self):
"""Returns an optional dictionary of graphics features and their status."""
return self._feature_status | [
"def",
"feature_status",
"(",
"self",
")",
":",
"return",
"self",
".",
"_feature_status"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/gpu_info.py#L59-L61 | |
jiaxiang-wu/quantized-cnn | 4d020e17026df90e40111d219e3eb74e0afb1588 | 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. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | 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 ... | [
"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/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L1825-L1840 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/glcanvas.py | python | GLCanvas.SetCurrent | (*args) | return _glcanvas.GLCanvas_SetCurrent(*args) | SetCurrent(self, GLContext context) -> bool
SetCurrent(self) | SetCurrent(self, GLContext context) -> bool
SetCurrent(self) | [
"SetCurrent",
"(",
"self",
"GLContext",
"context",
")",
"-",
">",
"bool",
"SetCurrent",
"(",
"self",
")"
] | def SetCurrent(*args):
"""
SetCurrent(self, GLContext context) -> bool
SetCurrent(self)
"""
return _glcanvas.GLCanvas_SetCurrent(*args) | [
"def",
"SetCurrent",
"(",
"*",
"args",
")",
":",
"return",
"_glcanvas",
".",
"GLCanvas_SetCurrent",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/glcanvas.py#L135-L140 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/control_info/control_info.py | python | ControlInfo.longitudinal | (self) | Showing Longitudinal | Showing Longitudinal | [
"Showing",
"Longitudinal"
] | def longitudinal(self):
"""
Showing Longitudinal
"""
for loc, ax in numpy.ndenumerate(self.ax):
ax.clear()
self.ax[0, 0].plot(
self.canbustime, self.throttlefbk, label='Throttle Feedback')
self.ax[0, 0].plot(
self.controltime, self.thro... | [
"def",
"longitudinal",
"(",
"self",
")",
":",
"for",
"loc",
",",
"ax",
"in",
"numpy",
".",
"ndenumerate",
"(",
"self",
".",
"ax",
")",
":",
"ax",
".",
"clear",
"(",
")",
"self",
".",
"ax",
"[",
"0",
",",
"0",
"]",
".",
"plot",
"(",
"self",
".... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/control_info/control_info.py#L193-L256 | ||
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/python/caffe/draw.py | python | choose_color_by_layertype | (layertype) | return color | Define colors for nodes based on the layer type. | Define colors for nodes based on the layer type. | [
"Define",
"colors",
"for",
"nodes",
"based",
"on",
"the",
"layer",
"type",
"."
] | def choose_color_by_layertype(layertype):
"""Define colors for nodes based on the layer type.
"""
color = '#6495ED' # Default
if layertype == 'Convolution' or layertype == 'Deconvolution':
color = '#FF5050'
elif layertype == 'Pooling':
color = '#FF9900'
elif layertype == 'InnerP... | [
"def",
"choose_color_by_layertype",
"(",
"layertype",
")",
":",
"color",
"=",
"'#6495ED'",
"# Default",
"if",
"layertype",
"==",
"'Convolution'",
"or",
"layertype",
"==",
"'Deconvolution'",
":",
"color",
"=",
"'#FF5050'",
"elif",
"layertype",
"==",
"'Pooling'",
":... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/python/caffe/draw.py#L108-L118 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | _check_config_keys | (config, expected_keys) | Checks that a config has all expected_keys. | Checks that a config has all expected_keys. | [
"Checks",
"that",
"a",
"config",
"has",
"all",
"expected_keys",
"."
] | def _check_config_keys(config, expected_keys):
"""Checks that a config has all expected_keys."""
if set(config.keys()) != set(expected_keys):
raise ValueError('Invalid config: {}, expected keys: {}'.format(
config, expected_keys)) | [
"def",
"_check_config_keys",
"(",
"config",
",",
"expected_keys",
")",
":",
"if",
"set",
"(",
"config",
".",
"keys",
"(",
")",
")",
"!=",
"set",
"(",
"expected_keys",
")",
":",
"raise",
"ValueError",
"(",
"'Invalid config: {}, expected keys: {}'",
".",
"format... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L4597-L4601 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py | python | _DefinedFunction._create_definition_if_needed | (self) | Creates the function definition if it's not created yet. | Creates the function definition if it's not created yet. | [
"Creates",
"the",
"function",
"definition",
"if",
"it",
"s",
"not",
"created",
"yet",
"."
] | def _create_definition_if_needed(self):
"""Creates the function definition if it's not created yet."""
with context.graph_mode():
self._create_definition_if_needed_impl() | [
"def",
"_create_definition_if_needed",
"(",
"self",
")",
":",
"with",
"context",
".",
"graph_mode",
"(",
")",
":",
"self",
".",
"_create_definition_if_needed_impl",
"(",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py#L374-L377 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/type.py | python | all_bases | (type) | return result | Returns type and all of its bases, in the order of their distance from type. | Returns type and all of its bases, in the order of their distance from type. | [
"Returns",
"type",
"and",
"all",
"of",
"its",
"bases",
"in",
"the",
"order",
"of",
"their",
"distance",
"from",
"type",
"."
] | def all_bases (type):
""" Returns type and all of its bases, in the order of their distance from type.
"""
assert isinstance(type, basestring)
result = []
while type:
result.append (type)
type = __types [type]['base']
return result | [
"def",
"all_bases",
"(",
"type",
")",
":",
"assert",
"isinstance",
"(",
"type",
",",
"basestring",
")",
"result",
"=",
"[",
"]",
"while",
"type",
":",
"result",
".",
"append",
"(",
"type",
")",
"type",
"=",
"__types",
"[",
"type",
"]",
"[",
"'base'",... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/type.py#L181-L190 | |
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/style/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cppli... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justif... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L1443-L1479 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/vision/models/resnet.py | python | resnet152 | (pretrained=False, **kwargs) | return _resnet('resnet152', BottleneckBlock, 152, pretrained, **kwargs) | ResNet 152-layer model from
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
Examples:
.. code-block:: python
import paddle
from paddle.vision.models i... | ResNet 152-layer model from
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_ | [
"ResNet",
"152",
"-",
"layer",
"model",
"from",
"Deep",
"Residual",
"Learning",
"for",
"Image",
"Recognition",
"<https",
":",
"//",
"arxiv",
".",
"org",
"/",
"pdf",
"/",
"1512",
".",
"03385",
".",
"pdf",
">",
"_"
] | def resnet152(pretrained=False, **kwargs):
"""ResNet 152-layer model from
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
Examples:
.. code-block:: python
imp... | [
"def",
"resnet152",
"(",
"pretrained",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_resnet",
"(",
"'resnet152'",
",",
"BottleneckBlock",
",",
"152",
",",
"pretrained",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/models/resnet.py#L406-L430 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ConfigParser.py | python | ConfigParser.items | (self, section, raw=False, vars=None) | Return a list of tuples with (name, value) for each option
in the section.
All % interpolations are expanded in the return values, based on the
defaults passed into the constructor, unless the optional argument
`raw' is true. Additional substitutions may be provided using the
`... | Return a list of tuples with (name, value) for each option
in the section. | [
"Return",
"a",
"list",
"of",
"tuples",
"with",
"(",
"name",
"value",
")",
"for",
"each",
"option",
"in",
"the",
"section",
"."
] | def items(self, section, raw=False, vars=None):
"""Return a list of tuples with (name, value) for each option
in the section.
All % interpolations are expanded in the return values, based on the
defaults passed into the constructor, unless the optional argument
`raw' is true. A... | [
"def",
"items",
"(",
"self",
",",
"section",
",",
"raw",
"=",
"False",
",",
"vars",
"=",
"None",
")",
":",
"d",
"=",
"self",
".",
"_defaults",
".",
"copy",
"(",
")",
"try",
":",
"d",
".",
"update",
"(",
"self",
".",
"_sections",
"[",
"section",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ConfigParser.py#L625-L655 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/op_def_library.py | python | OpDefLibrary.add_op | (self, op_def) | Register an OpDef. May call apply_op with the name afterwards. | Register an OpDef. May call apply_op with the name afterwards. | [
"Register",
"an",
"OpDef",
".",
"May",
"call",
"apply_op",
"with",
"the",
"name",
"afterwards",
"."
] | def add_op(self, op_def):
"""Register an OpDef. May call apply_op with the name afterwards."""
if not isinstance(op_def, op_def_pb2.OpDef):
raise TypeError("%s is %s, not an op_def_pb2.OpDef" %
(op_def, type(op_def)))
if not op_def.name:
raise ValueError("%s missing name." ... | [
"def",
"add_op",
"(",
"self",
",",
"op_def",
")",
":",
"if",
"not",
"isinstance",
"(",
"op_def",
",",
"op_def_pb2",
".",
"OpDef",
")",
":",
"raise",
"TypeError",
"(",
"\"%s is %s, not an op_def_pb2.OpDef\"",
"%",
"(",
"op_def",
",",
"type",
"(",
"op_def",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/op_def_library.py#L269-L278 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/proc.py | python | select_adc2 | (name, **kwargs) | Function selecting the algorithm for ADC(2) excited state energy
call and directing to specified or best-performance default modules. | Function selecting the algorithm for ADC(2) excited state energy
call and directing to specified or best-performance default modules. | [
"Function",
"selecting",
"the",
"algorithm",
"for",
"ADC",
"(",
"2",
")",
"excited",
"state",
"energy",
"call",
"and",
"directing",
"to",
"specified",
"or",
"best",
"-",
"performance",
"default",
"modules",
"."
] | def select_adc2(name, **kwargs):
"""Function selecting the algorithm for ADC(2) excited state energy
call and directing to specified or best-performance default modules.
"""
reference = core.get_option('SCF', 'REFERENCE')
mtd_type = core.get_global_option('MP_TYPE')
module = core.get_global_opt... | [
"def",
"select_adc2",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"reference",
"=",
"core",
".",
"get_option",
"(",
"'SCF'",
",",
"'REFERENCE'",
")",
"mtd_type",
"=",
"core",
".",
"get_global_option",
"(",
"'MP_TYPE'",
")",
"module",
"=",
"core",
"."... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L1095-L1133 | ||
mavlink/mavros | a32232d57a5e91abf6737e454d4199cae29b369c | mavros/mavros/cmd/safety.py | python | safety | (client) | Tool to send safety commands to MAVLink device. | Tool to send safety commands to MAVLink device. | [
"Tool",
"to",
"send",
"safety",
"commands",
"to",
"MAVLink",
"device",
"."
] | def safety(client):
"""Tool to send safety commands to MAVLink device.""" | [
"def",
"safety",
"(",
"client",
")",
":"
] | https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/cmd/safety.py#L25-L26 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/caffe/caffe_net.py | python | get_lenet | () | return lenet | LeCun, Yann, Leon Bottou, Yoshua Bengio, and Patrick
Haffner. "Gradient-based learning applied to document recognition."
Proceedings of the IEEE (1998) | LeCun, Yann, Leon Bottou, Yoshua Bengio, and Patrick
Haffner. "Gradient-based learning applied to document recognition."
Proceedings of the IEEE (1998) | [
"LeCun",
"Yann",
"Leon",
"Bottou",
"Yoshua",
"Bengio",
"and",
"Patrick",
"Haffner",
".",
"Gradient",
"-",
"based",
"learning",
"applied",
"to",
"document",
"recognition",
".",
"Proceedings",
"of",
"the",
"IEEE",
"(",
"1998",
")"
] | def get_lenet():
"""
LeCun, Yann, Leon Bottou, Yoshua Bengio, and Patrick
Haffner. "Gradient-based learning applied to document recognition."
Proceedings of the IEEE (1998)
"""
data = mx.symbol.Variable('data')
# first conv
conv1 = mx.symbol.CaffeOp(data_0=data, num_weight=2, prototxt="... | [
"def",
"get_lenet",
"(",
")",
":",
"data",
"=",
"mx",
".",
"symbol",
".",
"Variable",
"(",
"'data'",
")",
"# first conv",
"conv1",
"=",
"mx",
".",
"symbol",
".",
"CaffeOp",
"(",
"data_0",
"=",
"data",
",",
"num_weight",
"=",
"2",
",",
"prototxt",
"="... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/caffe/caffe_net.py#L40-L68 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/backend.py | python | update_add | (x, increment) | return state_ops.assign_add(x, increment) | Update the value of `x` by adding `increment`.
Arguments:
x: A Variable.
increment: A tensor of same shape as `x`.
Returns:
The variable `x` updated. | Update the value of `x` by adding `increment`. | [
"Update",
"the",
"value",
"of",
"x",
"by",
"adding",
"increment",
"."
] | def update_add(x, increment):
"""Update the value of `x` by adding `increment`.
Arguments:
x: A Variable.
increment: A tensor of same shape as `x`.
Returns:
The variable `x` updated.
"""
return state_ops.assign_add(x, increment) | [
"def",
"update_add",
"(",
"x",
",",
"increment",
")",
":",
"return",
"state_ops",
".",
"assign_add",
"(",
"x",
",",
"increment",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L1099-L1109 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/graph_kernel/model/model.py | python | Tensor.get_size | (self) | return size | Get size | Get size | [
"Get",
"size"
] | def get_size(self):
"""Get size"""
size = PrimLib.dtype_bytes(self.dtype)
for i in self.shape:
size *= i
return size | [
"def",
"get_size",
"(",
"self",
")",
":",
"size",
"=",
"PrimLib",
".",
"dtype_bytes",
"(",
"self",
".",
"dtype",
")",
"for",
"i",
"in",
"self",
".",
"shape",
":",
"size",
"*=",
"i",
"return",
"size"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/graph_kernel/model/model.py#L326-L331 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/interactiveshell.py | python | InteractiveShell.getoutput | (self, cmd, split=True, depth=0) | return out | Get output (possibly including stderr) from a subprocess.
Parameters
----------
cmd : str
Command to execute (can not end in '&', as background processes are
not supported.
split : bool, optional
If True, split the output into an IPython SList. Otherwise, ... | Get output (possibly including stderr) from a subprocess. | [
"Get",
"output",
"(",
"possibly",
"including",
"stderr",
")",
"from",
"a",
"subprocess",
"."
] | def getoutput(self, cmd, split=True, depth=0):
"""Get output (possibly including stderr) from a subprocess.
Parameters
----------
cmd : str
Command to execute (can not end in '&', as background processes are
not supported.
split : bool, optional
If ... | [
"def",
"getoutput",
"(",
"self",
",",
"cmd",
",",
"split",
"=",
"True",
",",
"depth",
"=",
"0",
")",
":",
"if",
"cmd",
".",
"rstrip",
"(",
")",
".",
"endswith",
"(",
"'&'",
")",
":",
"# this is *far* from a rigorous test",
"raise",
"OSError",
"(",
"\"B... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L2267-L2294 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/wx/wxVTKRenderWindow.py | python | wxVTKRenderWindow.OnButtonUp | (self, event) | Overridable event. | Overridable event. | [
"Overridable",
"event",
"."
] | def OnButtonUp(self, event):
"""Overridable event.
"""
if event.LeftUp():
self.OnLeftUp(event)
elif event.RightUp():
self.OnRightUp(event)
elif event.MiddleUp():
self.OnMiddleUp(event)
# if not interacting, then do nothing more
... | [
"def",
"OnButtonUp",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"LeftUp",
"(",
")",
":",
"self",
".",
"OnLeftUp",
"(",
"event",
")",
"elif",
"event",
".",
"RightUp",
"(",
")",
":",
"self",
".",
"OnRightUp",
"(",
"event",
")",
"elif",
... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/wx/wxVTKRenderWindow.py#L415-L430 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/function.py | python | functionTracer.process | (self, data, t_range=[]) | test_performanc-19925 [003] .... 110337.353720: _fun_9351538_entry: (0xffff8553b0d8) | test_performanc-19925 [003] .... 110337.353720: _fun_9351538_entry: (0xffff8553b0d8) | [
"test_performanc",
"-",
"19925",
"[",
"003",
"]",
"....",
"110337",
".",
"353720",
":",
"_fun_9351538_entry",
":",
"(",
"0xffff8553b0d8",
")"
] | def process(self, data, t_range=[]):
""""test_performanc-19925 [003] .... 110337.353720: _fun_9351538_entry: (0xffff8553b0d8)"""
data = [l for l in data.get('ftrace', {}).get(
self.name) if not l.startswith('#')]
data_out = []
for l in data:
ftraceSym = l.strip().... | [
"def",
"process",
"(",
"self",
",",
"data",
",",
"t_range",
"=",
"[",
"]",
")",
":",
"data",
"=",
"[",
"l",
"for",
"l",
"in",
"data",
".",
"get",
"(",
"'ftrace'",
",",
"{",
"}",
")",
".",
"get",
"(",
"self",
".",
"name",
")",
"if",
"not",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/function.py#L389-L400 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pyio.py | python | FileIO.closefd | (self) | return self._closefd | True if the file descriptor will be closed by close(). | True if the file descriptor will be closed by close(). | [
"True",
"if",
"the",
"file",
"descriptor",
"will",
"be",
"closed",
"by",
"close",
"()",
"."
] | def closefd(self):
"""True if the file descriptor will be closed by close()."""
return self._closefd | [
"def",
"closefd",
"(",
"self",
")",
":",
"return",
"self",
".",
"_closefd"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pyio.py#L1744-L1746 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/utils/keyfactory.py | python | generateRSAKey | (bits, implementations=["openssl", "python"]) | Generate an RSA key with the specified bit length.
@type bits: int
@param bits: Desired bit length of the new key's modulus.
@rtype: L{tlslite.utils.RSAKey.RSAKey}
@return: A new RSA private key. | Generate an RSA key with the specified bit length. | [
"Generate",
"an",
"RSA",
"key",
"with",
"the",
"specified",
"bit",
"length",
"."
] | def generateRSAKey(bits, implementations=["openssl", "python"]):
"""Generate an RSA key with the specified bit length.
@type bits: int
@param bits: Desired bit length of the new key's modulus.
@rtype: L{tlslite.utils.RSAKey.RSAKey}
@return: A new RSA private key.
"""
for implementation in ... | [
"def",
"generateRSAKey",
"(",
"bits",
",",
"implementations",
"=",
"[",
"\"openssl\"",
",",
"\"python\"",
"]",
")",
":",
"for",
"implementation",
"in",
"implementations",
":",
"if",
"implementation",
"==",
"\"openssl\"",
"and",
"cryptomath",
".",
"m2cryptoLoaded",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/utils/keyfactory.py#L22-L36 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/layer1.py | python | CloudSearchConnection.define_index_field | (self, domain_name, index_field) | return self._make_request(
action='DefineIndexField',
verb='POST',
path='/', params=params) | Configures an `IndexField` for the search domain. Used to
create new fields and modify existing ones. You must specify
the name of the domain you are configuring and an index field
configuration. The index field configuration specifies a
unique name, the index field type, and the options... | Configures an `IndexField` for the search domain. Used to
create new fields and modify existing ones. You must specify
the name of the domain you are configuring and an index field
configuration. The index field configuration specifies a
unique name, the index field type, and the options... | [
"Configures",
"an",
"IndexField",
"for",
"the",
"search",
"domain",
".",
"Used",
"to",
"create",
"new",
"fields",
"and",
"modify",
"existing",
"ones",
".",
"You",
"must",
"specify",
"the",
"name",
"of",
"the",
"domain",
"you",
"are",
"configuring",
"and",
... | def define_index_field(self, domain_name, index_field):
"""
Configures an `IndexField` for the search domain. Used to
create new fields and modify existing ones. You must specify
the name of the domain you are configuring and an index field
configuration. The index field configur... | [
"def",
"define_index_field",
"(",
"self",
",",
"domain_name",
",",
"index_field",
")",
":",
"params",
"=",
"{",
"'DomainName'",
":",
"domain_name",
",",
"}",
"self",
".",
"build_complex_param",
"(",
"params",
",",
"'IndexField'",
",",
"index_field",
")",
"retu... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/layer1.py#L173-L204 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py | python | Bucket.validate_kwarg_names | (self, kwargs, names) | Checks that all named arguments are in the specified list of names.
:type kwargs: dict
:param kwargs: Dictionary of kwargs to validate.
:type names: list
:param names: List of possible named arguments. | Checks that all named arguments are in the specified list of names. | [
"Checks",
"that",
"all",
"named",
"arguments",
"are",
"in",
"the",
"specified",
"list",
"of",
"names",
"."
] | def validate_kwarg_names(self, kwargs, names):
"""
Checks that all named arguments are in the specified list of names.
:type kwargs: dict
:param kwargs: Dictionary of kwargs to validate.
:type names: list
:param names: List of possible named arguments.
"""
... | [
"def",
"validate_kwarg_names",
"(",
"self",
",",
"kwargs",
",",
"names",
")",
":",
"for",
"kwarg",
"in",
"kwargs",
":",
"if",
"kwarg",
"not",
"in",
"names",
":",
"raise",
"TypeError",
"(",
"'Invalid argument \"%s\"!'",
"%",
"kwarg",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py#L412-L424 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/compile_rules_linux_x64_linux_x64_clang.py | python | load_release_linux_x64_linux_x64_clang_settings | (conf) | Setup all compiler and linker settings shared over all linux_x64_linux_x64_clang configurations for
the 'release' configuration | Setup all compiler and linker settings shared over all linux_x64_linux_x64_clang configurations for
the 'release' configuration | [
"Setup",
"all",
"compiler",
"and",
"linker",
"settings",
"shared",
"over",
"all",
"linux_x64_linux_x64_clang",
"configurations",
"for",
"the",
"release",
"configuration"
] | def load_release_linux_x64_linux_x64_clang_settings(conf):
"""
Setup all compiler and linker settings shared over all linux_x64_linux_x64_clang configurations for
the 'release' configuration
"""
v = conf.env
conf.load_linux_x64_linux_x64_clang_common_settings()
# Load addional shared settings
conf.load_releas... | [
"def",
"load_release_linux_x64_linux_x64_clang_settings",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"conf",
".",
"load_linux_x64_linux_x64_clang_common_settings",
"(",
")",
"# Load addional shared settings",
"conf",
".",
"load_release_cryengine_settings",
"(",
")... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/compile_rules_linux_x64_linux_x64_clang.py#L75-L87 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/universe_generation/galaxy.py | python | DSet.bind_parent | (self, parent) | Bind to parent. | Bind to parent. | [
"Bind",
"to",
"parent",
"."
] | def bind_parent(self, parent):
"""Bind to parent."""
assert self is not parent
self.parent = parent | [
"def",
"bind_parent",
"(",
"self",
",",
"parent",
")",
":",
"assert",
"self",
"is",
"not",
"parent",
"self",
".",
"parent",
"=",
"parent"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L115-L118 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/swift_build_support/swift_build_support/products/swiftinspect.py | python | SwiftInspect.test | (self, host_target) | Just run a single instance of the command for both .debug and
.release. | Just run a single instance of the command for both .debug and
.release. | [
"Just",
"run",
"a",
"single",
"instance",
"of",
"the",
"command",
"for",
"both",
".",
"debug",
"and",
".",
"release",
"."
] | def test(self, host_target):
"""Just run a single instance of the command for both .debug and
.release.
"""
pass | [
"def",
"test",
"(",
"self",
",",
"host_target",
")",
":",
"pass"
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/products/swiftinspect.py#L54-L58 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/CGIHTTPServer.py | python | CGIHTTPRequestHandler.send_head | (self) | Version of send_head that support CGI scripts | Version of send_head that support CGI scripts | [
"Version",
"of",
"send_head",
"that",
"support",
"CGI",
"scripts"
] | def send_head(self):
"""Version of send_head that support CGI scripts"""
if self.is_cgi():
return self.run_cgi()
else:
return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) | [
"def",
"send_head",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_cgi",
"(",
")",
":",
"return",
"self",
".",
"run_cgi",
"(",
")",
"else",
":",
"return",
"SimpleHTTPServer",
".",
"SimpleHTTPRequestHandler",
".",
"send_head",
"(",
"self",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/CGIHTTPServer.py#L66-L71 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridCellAttr.GetTextColour | (*args, **kwargs) | return _grid.GridCellAttr_GetTextColour(*args, **kwargs) | GetTextColour(self) -> Colour | GetTextColour(self) -> Colour | [
"GetTextColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetTextColour(*args, **kwargs):
"""GetTextColour(self) -> Colour"""
return _grid.GridCellAttr_GetTextColour(*args, **kwargs) | [
"def",
"GetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellAttr_GetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L615-L617 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinemasci/paraview/tpl/cinemasci/cis/colormap.py | python | colormap.add_point | (self, point) | return | Add a point, a tuple of (x,o,r,g,b) to points. | Add a point, a tuple of (x,o,r,g,b) to points. | [
"Add",
"a",
"point",
"a",
"tuple",
"of",
"(",
"x",
"o",
"r",
"g",
"b",
")",
"to",
"points",
"."
] | def add_point(self, point):
""" Add a point, a tuple of (x,o,r,g,b) to points. """
self.edited = True
self.points.append(point)
self.points.sort()
#to do, if x value of point already exists, replace or return error?
return | [
"def",
"add_point",
"(",
"self",
",",
"point",
")",
":",
"self",
".",
"edited",
"=",
"True",
"self",
".",
"points",
".",
"append",
"(",
"point",
")",
"self",
".",
"points",
".",
"sort",
"(",
")",
"#to do, if x value of point already exists, replace or return e... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinemasci/paraview/tpl/cinemasci/cis/colormap.py#L66-L72 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distribution/dirichlet.py | python | Dirichlet.sample | (self, shape=()) | return _dirichlet(self.concentration.expand(self._extend_shape(shape))) | Sample from dirichlet distribution.
Args:
shape (Sequence[int], optional): Sample shape. Defaults to empty tuple. | Sample from dirichlet distribution. | [
"Sample",
"from",
"dirichlet",
"distribution",
"."
] | def sample(self, shape=()):
"""Sample from dirichlet distribution.
Args:
shape (Sequence[int], optional): Sample shape. Defaults to empty tuple.
"""
shape = shape if isinstance(shape, tuple) else tuple(shape)
return _dirichlet(self.concentration.expand(self._extend_s... | [
"def",
"sample",
"(",
"self",
",",
"shape",
"=",
"(",
")",
")",
":",
"shape",
"=",
"shape",
"if",
"isinstance",
"(",
"shape",
",",
"tuple",
")",
"else",
"tuple",
"(",
"shape",
")",
"return",
"_dirichlet",
"(",
"self",
".",
"concentration",
".",
"expa... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distribution/dirichlet.py#L103-L110 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | PseudoDC.DrawRectanglePointSize | (*args, **kwargs) | return _gdi_.PseudoDC_DrawRectanglePointSize(*args, **kwargs) | DrawRectanglePointSize(self, Point pt, Size sz)
Draws a rectangle with the given top left corner, and with the given
size. The current pen is used for the outline and the current brush
for filling the shape. | DrawRectanglePointSize(self, Point pt, Size sz) | [
"DrawRectanglePointSize",
"(",
"self",
"Point",
"pt",
"Size",
"sz",
")"
] | def DrawRectanglePointSize(*args, **kwargs):
"""
DrawRectanglePointSize(self, Point pt, Size sz)
Draws a rectangle with the given top left corner, and with the given
size. The current pen is used for the outline and the current brush
for filling the shape.
"""
re... | [
"def",
"DrawRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L7932-L7940 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/debug/debug_utils.py | python | add_debug_tensor_watch | (run_options,
node_name,
output_slot=0,
debug_ops="DebugIdentity",
debug_urls=None) | Add debug tensor watch option to RunOptions.
Args:
run_options: An instance of tensorflow.core.protobuf.config_pb2.RunOptions
node_name: Name of the node to watch.
output_slot: Output slot index of the tensor from the watched node.
debug_ops: Name(s) of the debug op(s). Default: "DebugIdentity".
... | Add debug tensor watch option to RunOptions. | [
"Add",
"debug",
"tensor",
"watch",
"option",
"to",
"RunOptions",
"."
] | def add_debug_tensor_watch(run_options,
node_name,
output_slot=0,
debug_ops="DebugIdentity",
debug_urls=None):
"""Add debug tensor watch option to RunOptions.
Args:
run_options: An instance of tensorflow... | [
"def",
"add_debug_tensor_watch",
"(",
"run_options",
",",
"node_name",
",",
"output_slot",
"=",
"0",
",",
"debug_ops",
"=",
"\"DebugIdentity\"",
",",
"debug_urls",
"=",
"None",
")",
":",
"watch_opts",
"=",
"run_options",
".",
"debug_tensor_watch_opts",
"watch",
"=... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/debug_utils.py#L25-L59 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/samples/vrp_initial_routes.py | python | main | () | Solve the CVRP problem. | Solve the CVRP problem. | [
"Solve",
"the",
"CVRP",
"problem",
"."
] | def main():
"""Solve the CVRP problem."""
# Instantiate the data problem.
# [START data]
data = create_data_model()
# [END data]
# Create the routing index manager.
# [START index_manager]
manager = pywrapcp.RoutingIndexManager(len(data['distance_matrix']),
... | [
"def",
"main",
"(",
")",
":",
"# Instantiate the data problem.",
"# [START data]",
"data",
"=",
"create_data_model",
"(",
")",
"# [END data]",
"# Create the routing index manager.",
"# [START index_manager]",
"manager",
"=",
"pywrapcp",
".",
"RoutingIndexManager",
"(",
"len... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/vrp_initial_routes.py#L134-L205 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/Blast/houdini/python2.7libs/blastExport/slice.py | python | Slice.translate | (self) | return self.__translate | :return: str | :return: str | [
":",
"return",
":",
"str"
] | def translate(self):
"""
:return: str
"""
return self.__translate | [
"def",
"translate",
"(",
"self",
")",
":",
"return",
"self",
".",
"__translate"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/houdini/python2.7libs/blastExport/slice.py#L293-L297 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/editor.py | python | EditorFrame.bufferSaveAs | (self) | return cancel | Save buffer to a new filename. | Save buffer to a new filename. | [
"Save",
"buffer",
"to",
"a",
"new",
"filename",
"."
] | def bufferSaveAs(self):
"""Save buffer to a new filename."""
if self.bufferHasChanged() and self.buffer.doc.filepath:
cancel = self.bufferSuggestSave()
if cancel:
return cancel
filedir = ''
if self.buffer and self.buffer.doc.filedir:
fi... | [
"def",
"bufferSaveAs",
"(",
"self",
")",
":",
"if",
"self",
".",
"bufferHasChanged",
"(",
")",
"and",
"self",
".",
"buffer",
".",
"doc",
".",
"filepath",
":",
"cancel",
"=",
"self",
".",
"bufferSuggestSave",
"(",
")",
"if",
"cancel",
":",
"return",
"ca... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/editor.py#L215-L230 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | bindings/pydrake/systems/planar_scenegraph_visualizer.py | python | PlanarSceneGraphVisualizer._build_body_patches | (self, use_random_colors,
substitute_collocated_mesh_files, inspector) | Generates body patches. self._patch_Blist stores a list of patches for
each body (starting at body id 1). A body patch is a list of all 3D
vertices of a piece of visual geometry. | Generates body patches. self._patch_Blist stores a list of patches for
each body (starting at body id 1). A body patch is a list of all 3D
vertices of a piece of visual geometry. | [
"Generates",
"body",
"patches",
".",
"self",
".",
"_patch_Blist",
"stores",
"a",
"list",
"of",
"patches",
"for",
"each",
"body",
"(",
"starting",
"at",
"body",
"id",
"1",
")",
".",
"A",
"body",
"patch",
"is",
"a",
"list",
"of",
"all",
"3D",
"vertices",... | def _build_body_patches(self, use_random_colors,
substitute_collocated_mesh_files, inspector):
"""
Generates body patches. self._patch_Blist stores a list of patches for
each body (starting at body id 1). A body patch is a list of all 3D
vertices of a piece of... | [
"def",
"_build_body_patches",
"(",
"self",
",",
"use_random_colors",
",",
"substitute_collocated_mesh_files",
",",
"inspector",
")",
":",
"self",
".",
"_patch_Blist",
"=",
"{",
"}",
"self",
".",
"_patch_Blist_colors",
"=",
"{",
"}",
"for",
"frame_id",
"in",
"ins... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/systems/planar_scenegraph_visualizer.py#L183-L331 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/signaltools.py | python | resample_poly | (x, up, down, axis=0, window=('kaiser', 5.0)) | return y[tuple(keep)] | Resample `x` along the given axis using polyphase filtering.
The signal `x` is upsampled by the factor `up`, a zero-phase low-pass
FIR filter is applied, and then it is downsampled by the factor `down`.
The resulting sample rate is ``up / down`` times the original sample
rate. Values beyond the boundar... | Resample `x` along the given axis using polyphase filtering. | [
"Resample",
"x",
"along",
"the",
"given",
"axis",
"using",
"polyphase",
"filtering",
"."
] | def resample_poly(x, up, down, axis=0, window=('kaiser', 5.0)):
"""
Resample `x` along the given axis using polyphase filtering.
The signal `x` is upsampled by the factor `up`, a zero-phase low-pass
FIR filter is applied, and then it is downsampled by the factor `down`.
The resulting sample rate is... | [
"def",
"resample_poly",
"(",
"x",
",",
"up",
",",
"down",
",",
"axis",
"=",
"0",
",",
"window",
"=",
"(",
"'kaiser'",
",",
"5.0",
")",
")",
":",
"x",
"=",
"asarray",
"(",
"x",
")",
"if",
"up",
"!=",
"int",
"(",
"up",
")",
":",
"raise",
"Value... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L2287-L2421 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | Maildir.remove | (self, key) | Remove the keyed message; raise KeyError if it doesn't exist. | Remove the keyed message; raise KeyError if it doesn't exist. | [
"Remove",
"the",
"keyed",
"message",
";",
"raise",
"KeyError",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
os.remove(os.path.join(self._path, self._lookup(key))) | [
"def",
"remove",
"(",
"self",
",",
"key",
")",
":",
"os",
".",
"remove",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"self",
".",
"_lookup",
"(",
"key",
")",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L331-L333 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py | python | RequestHooksMixin.deregister_hook | (self, event, hook) | Deregister a previously registered hook.
Returns True if the hook existed, False if not. | Deregister a previously registered hook.
Returns True if the hook existed, False if not. | [
"Deregister",
"a",
"previously",
"registered",
"hook",
".",
"Returns",
"True",
"if",
"the",
"hook",
"existed",
"False",
"if",
"not",
"."
] | def deregister_hook(self, event, hook):
"""Deregister a previously registered hook.
Returns True if the hook existed, False if not.
"""
try:
self.hooks[event].remove(hook)
return True
except ValueError:
return False | [
"def",
"deregister_hook",
"(",
"self",
",",
"event",
",",
"hook",
")",
":",
"try",
":",
"self",
".",
"hooks",
"[",
"event",
"]",
".",
"remove",
"(",
"hook",
")",
"return",
"True",
"except",
"ValueError",
":",
"return",
"False"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py#L186-L195 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/core/tensor.py | python | Tensor.__rdiv__ | (self, other) | return output | Calculate y / x.
Parameters
----------
other : Tensor
The y.
Returns
-------
Tensor
The output tensor. | Calculate y / x. | [
"Calculate",
"y",
"/",
"x",
"."
] | def __rdiv__(self, other):
"""Calculate y / x.
Parameters
----------
other : Tensor
The y.
Returns
-------
Tensor
The output tensor.
"""
if not isinstance(other, Tensor):
if not isinstance(other, np.ndarray):
... | [
"def",
"__rdiv__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"Tensor",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"np",
".",
"ndarray",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"l... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/core/tensor.py#L642-L666 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/skill/action_behavior.py | python | ActionBehavior.tick_once | (
self, robot: rc.Robot, world_state: rc.WorldState, ctx=None
) | return {self.robot.id: [self.action]} | Ticks its action using the robot given (if root) or the robot from its parent.
This will probably become tick() or spin() once action server is implemented
TODO: Should return a list of robot intents | Ticks its action using the robot given (if root) or the robot from its parent.
This will probably become tick() or spin() once action server is implemented
TODO: Should return a list of robot intents | [
"Ticks",
"its",
"action",
"using",
"the",
"robot",
"given",
"(",
"if",
"root",
")",
"or",
"the",
"robot",
"from",
"its",
"parent",
".",
"This",
"will",
"probably",
"become",
"tick",
"()",
"or",
"spin",
"()",
"once",
"action",
"server",
"is",
"implemented... | def tick_once(
self, robot: rc.Robot, world_state: rc.WorldState, ctx=None
) -> RobotActions:
"""
Ticks its action using the robot given (if root) or the robot from its parent.
This will probably become tick() or spin() once action server is implemented
TODO: Should return a ... | [
"def",
"tick_once",
"(",
"self",
",",
"robot",
":",
"rc",
".",
"Robot",
",",
"world_state",
":",
"rc",
".",
"WorldState",
",",
"ctx",
"=",
"None",
")",
"->",
"RobotActions",
":",
"if",
"robot",
"is",
"not",
"None",
":",
"self",
".",
"robot",
"=",
"... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/skill/action_behavior.py#L32-L53 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ctc_ops.py | python | ctc_loss_v2 | (labels,
logits,
label_length,
logit_length,
logits_time_major=True,
unique=None,
blank_index=None,
name=None) | return ctc_loss_dense(
labels=labels,
logits=logits,
label_length=label_length,
logit_length=logit_length,
logits_time_major=logits_time_major,
unique=unique,
blank_index=blank_index,
name=name) | Computes CTC (Connectionist Temporal Classification) loss.
This op implements the CTC loss as presented in (Graves et al., 2006).
Notes:
- Same as the "Classic CTC" in TensorFlow 1.x's tf.compat.v1.nn.ctc_loss
setting of preprocess_collapse_repeated=False, ctc_merge_repeated=True
- Labels may be supplied... | Computes CTC (Connectionist Temporal Classification) loss. | [
"Computes",
"CTC",
"(",
"Connectionist",
"Temporal",
"Classification",
")",
"loss",
"."
] | def ctc_loss_v2(labels,
logits,
label_length,
logit_length,
logits_time_major=True,
unique=None,
blank_index=None,
name=None):
"""Computes CTC (Connectionist Temporal Classification) loss.
This op implem... | [
"def",
"ctc_loss_v2",
"(",
"labels",
",",
"logits",
",",
"label_length",
",",
"logit_length",
",",
"logits_time_major",
"=",
"True",
",",
"unique",
"=",
"None",
",",
"blank_index",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ctc_ops.py#L781-L872 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | utils/cpplint.py | python | _CppLintState.ResetErrorCounts | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCounts(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errors_by_category = {} | [
"def",
"ResetErrorCounts",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errors_by_category",
"=",
"{",
"}"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L826-L829 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/pylib/results/report_results.py | python | LogFull | (results, test_type, test_package, annotation=None,
flakiness_server=None) | Log the tests results for the test suite.
The results will be logged three different ways:
1. Log to stdout.
2. Log to local files for aggregating multiple test steps
(on buildbots only).
3. Log to flakiness dashboard (on buildbots only).
Args:
results: An instance of TestRunResults object.... | Log the tests results for the test suite. | [
"Log",
"the",
"tests",
"results",
"for",
"the",
"test",
"suite",
"."
] | def LogFull(results, test_type, test_package, annotation=None,
flakiness_server=None):
"""Log the tests results for the test suite.
The results will be logged three different ways:
1. Log to stdout.
2. Log to local files for aggregating multiple test steps
(on buildbots only).
3. Log... | [
"def",
"LogFull",
"(",
"results",
",",
"test_type",
",",
"test_package",
",",
"annotation",
"=",
"None",
",",
"flakiness_server",
"=",
"None",
")",
":",
"if",
"not",
"results",
".",
"DidRunPass",
"(",
")",
":",
"logging",
".",
"critical",
"(",
"'*'",
"*"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/results/report_results.py#L72-L116 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_txt.py | python | FileReadJob.Cancel | (self) | Cancel the running task | Cancel the running task | [
"Cancel",
"the",
"running",
"task"
] | def Cancel(self):
"""Cancel the running task"""
self.cancel = True | [
"def",
"Cancel",
"(",
"self",
")",
":",
"self",
".",
"cancel",
"=",
"True"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_txt.py#L608-L610 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/third_party/Python/module/pexpect-2.4/pexpect.py | python | spawn.waitnoecho | (self, timeout=-1) | This waits until the terminal ECHO flag is set False. This returns
True if the echo mode is off. This returns False if the ECHO flag was
not set False before the timeout. This can be used to detect when the
child is waiting for a password. Usually a child application will turn
off echo m... | This waits until the terminal ECHO flag is set False. This returns
True if the echo mode is off. This returns False if the ECHO flag was
not set False before the timeout. This can be used to detect when the
child is waiting for a password. Usually a child application will turn
off echo m... | [
"This",
"waits",
"until",
"the",
"terminal",
"ECHO",
"flag",
"is",
"set",
"False",
".",
"This",
"returns",
"True",
"if",
"the",
"echo",
"mode",
"is",
"off",
".",
"This",
"returns",
"False",
"if",
"the",
"ECHO",
"flag",
"was",
"not",
"set",
"False",
"be... | def waitnoecho(self, timeout=-1):
"""This waits until the terminal ECHO flag is set False. This returns
True if the echo mode is off. This returns False if the ECHO flag was
not set False before the timeout. This can be used to detect when the
child is waiting for a password. Usually a c... | [
"def",
"waitnoecho",
"(",
"self",
",",
"timeout",
"=",
"-",
"1",
")",
":",
"if",
"timeout",
"==",
"-",
"1",
":",
"timeout",
"=",
"self",
".",
"timeout",
"if",
"timeout",
"is",
"not",
"None",
":",
"end_time",
"=",
"time",
".",
"time",
"(",
")",
"+... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/pexpect.py#L729-L758 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MenuBar.Attach | (*args, **kwargs) | return _core_.MenuBar_Attach(*args, **kwargs) | Attach(self, wxFrame frame) | Attach(self, wxFrame frame) | [
"Attach",
"(",
"self",
"wxFrame",
"frame",
")"
] | def Attach(*args, **kwargs):
"""Attach(self, wxFrame frame)"""
return _core_.MenuBar_Attach(*args, **kwargs) | [
"def",
"Attach",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuBar_Attach",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12371-L12373 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/imaplib.py | python | IMAP4.store | (self, message_set, command, flags) | return self._untagged_response(typ, dat, 'FETCH') | Alters flag dispositions for messages in mailbox.
(typ, [data]) = <instance>.store(message_set, command, flags) | Alters flag dispositions for messages in mailbox. | [
"Alters",
"flag",
"dispositions",
"for",
"messages",
"in",
"mailbox",
"."
] | def store(self, message_set, command, flags):
"""Alters flag dispositions for messages in mailbox.
(typ, [data]) = <instance>.store(message_set, command, flags)
"""
if (flags[0],flags[-1]) != ('(',')'):
flags = '(%s)' % flags # Avoid quoting the flags
typ, dat = sel... | [
"def",
"store",
"(",
"self",
",",
"message_set",
",",
"command",
",",
"flags",
")",
":",
"if",
"(",
"flags",
"[",
"0",
"]",
",",
"flags",
"[",
"-",
"1",
"]",
")",
"!=",
"(",
"'('",
",",
"')'",
")",
":",
"flags",
"=",
"'(%s)'",
"%",
"flags",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imaplib.py#L844-L852 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewListCtrl.AppendItem | (*args, **kwargs) | return _dataview.DataViewListCtrl_AppendItem(*args, **kwargs) | AppendItem(self, wxVariantVector values, UIntPtr data=None) | AppendItem(self, wxVariantVector values, UIntPtr data=None) | [
"AppendItem",
"(",
"self",
"wxVariantVector",
"values",
"UIntPtr",
"data",
"=",
"None",
")"
] | def AppendItem(*args, **kwargs):
"""AppendItem(self, wxVariantVector values, UIntPtr data=None)"""
return _dataview.DataViewListCtrl_AppendItem(*args, **kwargs) | [
"def",
"AppendItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_AppendItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2157-L2159 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/systrace/systrace/decorators.py | python | ShouldSkip | (test, device) | return False | Returns whether the test should be skipped and the reason for it. | Returns whether the test should be skipped and the reason for it. | [
"Returns",
"whether",
"the",
"test",
"should",
"be",
"skipped",
"and",
"the",
"reason",
"for",
"it",
"."
] | def ShouldSkip(test, device):
"""Returns whether the test should be skipped and the reason for it."""
if hasattr(test, '_disabled_strings'):
disabled_devices = getattr(test, '_disabled_strings')
return device in disabled_devices
return False | [
"def",
"ShouldSkip",
"(",
"test",
",",
"device",
")",
":",
"if",
"hasattr",
"(",
"test",
",",
"'_disabled_strings'",
")",
":",
"disabled_devices",
"=",
"getattr",
"(",
"test",
",",
"'_disabled_strings'",
")",
"return",
"device",
"in",
"disabled_devices",
"retu... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/systrace/systrace/decorators.py#L26-L31 | |
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.is_move_constructor | (self) | return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | Returns True if the cursor refers to a C++ move constructor. | Returns True if the cursor refers to a C++ move constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"move",
"constructor",
"."
] | def is_move_constructor(self):
"""Returns True if the cursor refers to a C++ move constructor.
"""
return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | [
"def",
"is_move_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isMoveConstructor",
"(",
"self",
")"
] | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1336-L1339 | |
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/scripts/cpp_lint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L504-L517 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/cppyy/cppyy-backend/cling/setup.py | python | get_prefix | () | return prefix | cppyy-cling installation. | cppyy-cling installation. | [
"cppyy",
"-",
"cling",
"installation",
"."
] | def get_prefix():
"""cppyy-cling installation."""
global prefix
if prefix is None:
prefix = os.path.join(get_builddir(), 'install', 'cppyy_backend')
return prefix | [
"def",
"get_prefix",
"(",
")",
":",
"global",
"prefix",
"if",
"prefix",
"is",
"None",
":",
"prefix",
"=",
"os",
".",
"path",
".",
"join",
"(",
"get_builddir",
"(",
")",
",",
"'install'",
",",
"'cppyy_backend'",
")",
"return",
"prefix"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/cppyy/cppyy-backend/cling/setup.py#L68-L73 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBarItem.SetActive | (*args, **kwargs) | return _aui.AuiToolBarItem_SetActive(*args, **kwargs) | SetActive(self, bool b) | SetActive(self, bool b) | [
"SetActive",
"(",
"self",
"bool",
"b",
")"
] | def SetActive(*args, **kwargs):
"""SetActive(self, bool b)"""
return _aui.AuiToolBarItem_SetActive(*args, **kwargs) | [
"def",
"SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarItem_SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1841-L1843 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TFIn.__init__ | (self, *args) | __init__(TFIn self, TStr FNm) -> TFIn
Parameters:
FNm: TStr const &
__init__(TFIn self, TStr FNm, bool & OpenedP) -> TFIn
Parameters:
FNm: TStr const &
OpenedP: bool & | __init__(TFIn self, TStr FNm) -> TFIn | [
"__init__",
"(",
"TFIn",
"self",
"TStr",
"FNm",
")",
"-",
">",
"TFIn"
] | def __init__(self, *args):
"""
__init__(TFIn self, TStr FNm) -> TFIn
Parameters:
FNm: TStr const &
__init__(TFIn self, TStr FNm, bool & OpenedP) -> TFIn
Parameters:
FNm: TStr const &
OpenedP: bool &
"""
_snap.TFIn_swiginit(... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_snap",
".",
"TFIn_swiginit",
"(",
"self",
",",
"_snap",
".",
"new_TFIn",
"(",
"*",
"args",
")",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L2716-L2730 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/vm/theano/compile/function.py | python | GraphDef_Device | (meta_graph) | Inject the device option into GraphDef.
Parameters
----------
meta_graph : dragon_pb2.GraphDef
The definition of meta graph.
Returns
-------
None
References
----------
`config.EnableCPU()`_ - How to use CPU device.
`config.EnableCUDA(*args, **kwargs)`_ - How to use CU... | Inject the device option into GraphDef. | [
"Inject",
"the",
"device",
"option",
"into",
"GraphDef",
"."
] | def GraphDef_Device(meta_graph):
"""Inject the device option into GraphDef.
Parameters
----------
meta_graph : dragon_pb2.GraphDef
The definition of meta graph.
Returns
-------
None
References
----------
`config.EnableCPU()`_ - How to use CPU device.
`config.Enabl... | [
"def",
"GraphDef_Device",
"(",
"meta_graph",
")",
":",
"from",
"dragon",
".",
"config",
"import",
"option",
"if",
"option",
"[",
"'device'",
"]",
"is",
"not",
"'None'",
":",
"supports",
"=",
"{",
"'CPU'",
":",
"0",
",",
"'CUDA'",
":",
"1",
"}",
"device... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/theano/compile/function.py#L159-L188 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/egt/alpharank_visualizer.py | python | NetworkPlot._draw_network | (self) | Draws the NetworkX object representing the underlying graph. | Draws the NetworkX object representing the underlying graph. | [
"Draws",
"the",
"NetworkX",
"object",
"representing",
"the",
"underlying",
"graph",
"."
] | def _draw_network(self):
"""Draws the NetworkX object representing the underlying graph."""
plt.clf()
if self.num_populations == 1:
node_sizes = 5000
node_border_width = 1.
else:
node_sizes = 15000
node_border_width = 3.
vmin, vmax = 0, np.max(self.pi) + 0.1
nx.draw_ne... | [
"def",
"_draw_network",
"(",
"self",
")",
":",
"plt",
".",
"clf",
"(",
")",
"if",
"self",
".",
"num_populations",
"==",
"1",
":",
"node_sizes",
"=",
"5000",
"node_border_width",
"=",
"1.",
"else",
":",
"node_sizes",
"=",
"15000",
"node_border_width",
"=",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/egt/alpharank_visualizer.py#L102-L182 | ||
Netflix/NfWebCrypto | 499faf4eb9f9ccf0b21dc728e974970f54bd6c52 | plugin/ppapi/ppapi/generators/idl_parser.py | python | IDLParser.p_expression_binop | (self, p) | expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
| expression '-' expression... | expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
| expression '-' expression... | [
"expression",
":",
"expression",
"LSHIFT",
"expression",
"|",
"expression",
"RSHIFT",
"expression",
"|",
"expression",
"|",
"expression",
"|",
"expression",
"&",
"expression",
"|",
"expression",
"^",
"expression",
"|",
"expression",
"+",
"expression",
"|",
"expres... | def p_expression_binop(self, p):
"""expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
... | [
"def",
"p_expression_binop",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"%s %s %s\"",
"%",
"(",
"str",
"(",
"p",
"[",
"1",
"]",
")",
",",
"str",
"(",
"p",
"[",
"2",
"]",
")",
",",
"str",
"(",
"p",
"[",
"3",
"]",
")",
")",... | https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_parser.py#L510-L521 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PrintPreview.SetCurrentPage | (*args, **kwargs) | return _windows_.PrintPreview_SetCurrentPage(*args, **kwargs) | SetCurrentPage(self, int pageNum) -> bool | SetCurrentPage(self, int pageNum) -> bool | [
"SetCurrentPage",
"(",
"self",
"int",
"pageNum",
")",
"-",
">",
"bool"
] | def SetCurrentPage(*args, **kwargs):
"""SetCurrentPage(self, int pageNum) -> bool"""
return _windows_.PrintPreview_SetCurrentPage(*args, **kwargs) | [
"def",
"SetCurrentPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintPreview_SetCurrentPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5565-L5567 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/functools.py | python | _c3_mro | (cls, abcs=None) | return _c3_merge(
[[cls]] +
explicit_c3_mros + abstract_c3_mros + other_c3_mros +
[explicit_bases] + [abstract_bases] + [other_bases]
) | Computes the method resolution order using extended C3 linearization.
If no *abcs* are given, the algorithm works exactly like the built-in C3
linearization used for method resolution.
If given, *abcs* is a list of abstract base classes that should be inserted
into the resulting MRO. Unrelated ABCs ar... | Computes the method resolution order using extended C3 linearization. | [
"Computes",
"the",
"method",
"resolution",
"order",
"using",
"extended",
"C3",
"linearization",
"."
] | def _c3_mro(cls, abcs=None):
"""Computes the method resolution order using extended C3 linearization.
If no *abcs* are given, the algorithm works exactly like the built-in C3
linearization used for method resolution.
If given, *abcs* is a list of abstract base classes that should be inserted
into ... | [
"def",
"_c3_mro",
"(",
"cls",
",",
"abcs",
"=",
"None",
")",
":",
"for",
"i",
",",
"base",
"in",
"enumerate",
"(",
"reversed",
"(",
"cls",
".",
"__bases__",
")",
")",
":",
"if",
"hasattr",
"(",
"base",
",",
"'__abstractmethods__'",
")",
":",
"boundar... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/functools.py#L651-L694 | |
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | vtr_flow/scripts/python_libs/vtr/log_parse.py | python | RangeAbsPassRequirement.min_value | (self) | return self._min_value | Return min value of ratio range | Return min value of ratio range | [
"Return",
"min",
"value",
"of",
"ratio",
"range"
] | def min_value(self):
"""Return min value of ratio range"""
return self._min_value | [
"def",
"min_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_min_value"
] | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/log_parse.py#L184-L186 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewTreeStoreContainerNode.IsExpanded | (*args, **kwargs) | return _dataview.DataViewTreeStoreContainerNode_IsExpanded(*args, **kwargs) | IsExpanded(self) -> bool | IsExpanded(self) -> bool | [
"IsExpanded",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsExpanded(*args, **kwargs):
"""IsExpanded(self) -> bool"""
return _dataview.DataViewTreeStoreContainerNode_IsExpanded(*args, **kwargs) | [
"def",
"IsExpanded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewTreeStoreContainerNode_IsExpanded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L2346-L2348 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/nndct_shared/utils/registry.py | python | Registry.lookup | (self, name) | Looks up "name".
Args:
name: a string specifying the registry key for the obj.
Returns:
Registered object if found
Raises:
LookupError: if "name" has not been registered. | Looks up "name". | [
"Looks",
"up",
"name",
"."
] | def lookup(self, name):
"""Looks up "name".
Args:
name: a string specifying the registry key for the obj.
Returns:
Registered object if found
Raises:
LookupError: if "name" has not been registered.
"""
if name in self._registry:
return self._registry[name]
else:
... | [
"def",
"lookup",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"in",
"self",
".",
"_registry",
":",
"return",
"self",
".",
"_registry",
"[",
"name",
"]",
"else",
":",
"raise",
"LookupError",
"(",
"\"%s registry has no entry for: %s\"",
"%",
"(",
"self"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/nndct_shared/utils/registry.py#L63-L76 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py | python | sdist.add_defaults | (self) | Add all the default files to self.filelist:
- README or README.txt
- setup.py
- test/test*.py
- all pure Python modules mentioned in setup script
- all files pointed by package_data (build_py)
- all files defined in data_files.
- all files defined as... | Add all the default files to self.filelist:
- README or README.txt
- setup.py
- test/test*.py
- all pure Python modules mentioned in setup script
- all files pointed by package_data (build_py)
- all files defined in data_files.
- all files defined as... | [
"Add",
"all",
"the",
"default",
"files",
"to",
"self",
".",
"filelist",
":",
"-",
"README",
"or",
"README",
".",
"txt",
"-",
"setup",
".",
"py",
"-",
"test",
"/",
"test",
"*",
".",
"py",
"-",
"all",
"pure",
"Python",
"modules",
"mentioned",
"in",
"... | def add_defaults(self):
"""Add all the default files to self.filelist:
- README or README.txt
- setup.py
- test/test*.py
- all pure Python modules mentioned in setup script
- all files pointed by package_data (build_py)
- all files defined in data_file... | [
"def",
"add_defaults",
"(",
"self",
")",
":",
"standards",
"=",
"[",
"(",
"'README'",
",",
"'README.txt'",
")",
",",
"self",
".",
"distribution",
".",
"script_name",
"]",
"for",
"fn",
"in",
"standards",
":",
"if",
"isinstance",
"(",
"fn",
",",
"tuple",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py#L218-L298 | ||
adventuregamestudio/ags | efa89736d868e9dfda4200149d33ba8637746399 | Common/libsrc/freetype-2.1.3/src/tools/docmaker/content.py | python | ContentProcessor.add_markup | ( self ) | add a new markup section | add a new markup section | [
"add",
"a",
"new",
"markup",
"section"
] | def add_markup( self ):
"""add a new markup section"""
if self.markup and self.markup_lines:
# get rid of last line of markup if it's empty
marks = self.markup_lines
if len(marks) > 0 and not string.strip(marks[-1]):
self.markup_lines = marks[:-1]
... | [
"def",
"add_markup",
"(",
"self",
")",
":",
"if",
"self",
".",
"markup",
"and",
"self",
".",
"markup_lines",
":",
"# get rid of last line of markup if it's empty",
"marks",
"=",
"self",
".",
"markup_lines",
"if",
"len",
"(",
"marks",
")",
">",
"0",
"and",
"n... | https://github.com/adventuregamestudio/ags/blob/efa89736d868e9dfda4200149d33ba8637746399/Common/libsrc/freetype-2.1.3/src/tools/docmaker/content.py#L329-L343 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_iteration_statement_2 | (t) | iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement | iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement | [
"iteration_statement",
":",
"FOR",
"LPAREN",
"expression_opt",
"SEMI",
"expression_opt",
"SEMI",
"expression_opt",
"RPAREN",
"statement"
] | def p_iteration_statement_2(t):
'iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement '
pass | [
"def",
"p_iteration_statement_2",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L531-L533 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | BaseWidget.__init__ | (self, master, widgetName, cnf={}, kw={}, extra=()) | Construct a widget with the parent widget MASTER, a name WIDGETNAME
and appropriate options. | Construct a widget with the parent widget MASTER, a name WIDGETNAME
and appropriate options. | [
"Construct",
"a",
"widget",
"with",
"the",
"parent",
"widget",
"MASTER",
"a",
"name",
"WIDGETNAME",
"and",
"appropriate",
"options",
"."
] | def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
"""Construct a widget with the parent widget MASTER, a name WIDGETNAME
and appropriate options."""
if kw:
cnf = _cnfmerge((cnf, kw))
self.widgetName = widgetName
BaseWidget._setup(self, master, cnf)
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
",",
"widgetName",
",",
"cnf",
"=",
"{",
"}",
",",
"kw",
"=",
"{",
"}",
",",
"extra",
"=",
"(",
")",
")",
":",
"if",
"kw",
":",
"cnf",
"=",
"_cnfmerge",
"(",
"(",
"cnf",
",",
"kw",
")",
")",
"s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2286-L2301 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/tool/build.py | python | RcBuilder.GenerateDepfile | (self, depfile, depdir, first_ids_file, depend_on_stamp) | Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|.
For example, supposing we have three files in a directory src/
src/
blah.grd ... | Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|. | [
"Generate",
"a",
"depfile",
"that",
"contains",
"the",
"imlicit",
"dependencies",
"of",
"the",
"input",
"grd",
".",
"The",
"depfile",
"will",
"be",
"in",
"the",
"same",
"format",
"as",
"a",
"makefile",
"and",
"will",
"contain",
"references",
"to",
"files",
... | def GenerateDepfile(self, depfile, depdir, first_ids_file, depend_on_stamp):
'''Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|.
For e... | [
"def",
"GenerateDepfile",
"(",
"self",
",",
"depfile",
",",
"depdir",
",",
"first_ids_file",
",",
"depend_on_stamp",
")",
":",
"depfile",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"depfile",
")",
"depdir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tool/build.py#L492-L549 | ||
sfzhang15/FaceBoxes | b52cc92f9362d3adc08d54666aeb9ebb62fdb7da | python/caffe/coord_map.py | python | coord_map | (fn) | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | [
"Define",
"the",
"coordinate",
"mapping",
"by",
"its",
"-",
"axis",
"-",
"scale",
":",
"output",
"coord",
"[",
"i",
"*",
"scale",
"]",
"<",
"-",
"input_coord",
"[",
"i",
"]",
"-",
"shift",
":",
"output",
"coord",
"[",
"i",
"]",
"<",
"-",
"output_co... | def coord_map(fn):
"""
Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis a... | [
"def",
"coord_map",
"(",
"fn",
")",
":",
"if",
"fn",
".",
"type_name",
"in",
"[",
"'Convolution'",
",",
"'Pooling'",
",",
"'Im2col'",
"]",
":",
"axis",
",",
"stride",
",",
"ks",
",",
"pad",
"=",
"conv_params",
"(",
"fn",
")",
"return",
"axis",
",",
... | https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/python/caffe/coord_map.py#L57-L79 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py | python | Decimal.log10 | (self, context=None) | return ans | Returns the base 10 logarithm of self. | Returns the base 10 logarithm of self. | [
"Returns",
"the",
"base",
"10",
"logarithm",
"of",
"self",
"."
] | def log10(self, context=None):
"""Returns the base 10 logarithm of self."""
if context is None:
context = getcontext()
# log10(NaN) = NaN
ans = self._check_nans(context=context)
if ans:
return ans
# log10(0.0) == -Infinity
if not self:
... | [
"def",
"log10",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"# log10(NaN) = NaN",
"ans",
"=",
"self",
".",
"_check_nans",
"(",
"context",
"=",
"context",
")",
"if",
"an... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L3272-L3321 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py | python | ParserElement.__rand__ | (self, other ) | return other & self | Implementation of & operator when left operand is not a :class:`ParserElement` | Implementation of & operator when left operand is not a :class:`ParserElement` | [
"Implementation",
"of",
"&",
"operator",
"when",
"left",
"operand",
"is",
"not",
"a",
":",
"class",
":",
"ParserElement"
] | def __rand__(self, other ):
"""
Implementation of & operator when left operand is not a :class:`ParserElement`
"""
if isinstance( other, basestring ):
other = ParserElement._literalStringClass( other )
if not isinstance( other, ParserElement ):
warnings.wa... | [
"def",
"__rand__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElemen... | 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/pyparsing.py#L2181-L2191 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextFileHandler.SetVisible | (*args, **kwargs) | return _richtext.RichTextFileHandler_SetVisible(*args, **kwargs) | SetVisible(self, bool visible) | SetVisible(self, bool visible) | [
"SetVisible",
"(",
"self",
"bool",
"visible",
")"
] | def SetVisible(*args, **kwargs):
"""SetVisible(self, bool visible)"""
return _richtext.RichTextFileHandler_SetVisible(*args, **kwargs) | [
"def",
"SetVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_SetVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2784-L2786 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf_kafka/versioneer.py | python | render_pep440_pre | (pieces) | return rendered | TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE | TAG[.post.devDISTANCE] -- No -dirty. | [
"TAG",
"[",
".",
"post",
".",
"devDISTANCE",
"]",
"--",
"No",
"-",
"dirty",
"."
] | def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exce... | [
"def",
"render_pep440_pre",
"(",
"pieces",
")",
":",
"if",
"pieces",
"[",
"\"closest-tag\"",
"]",
":",
"rendered",
"=",
"pieces",
"[",
"\"closest-tag\"",
"]",
"if",
"pieces",
"[",
"\"distance\"",
"]",
":",
"rendered",
"+=",
"\".post.dev%d\"",
"%",
"pieces",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf_kafka/versioneer.py#L1307-L1320 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/externals/loky/backend/popen_loky_win32.py | python | main | () | Run code specified by data received over pipe | Run code specified by data received over pipe | [
"Run",
"code",
"specified",
"by",
"data",
"received",
"over",
"pipe"
] | def main():
'''
Run code specified by data received over pipe
'''
assert is_forking(sys.argv)
handle = int(sys.argv[-1])
fd = msvcrt.open_osfhandle(handle, os.O_RDONLY)
from_parent = os.fdopen(fd, 'rb')
process.current_process()._inheriting = True
preparation_data = load(from_paren... | [
"def",
"main",
"(",
")",
":",
"assert",
"is_forking",
"(",
"sys",
".",
"argv",
")",
"handle",
"=",
"int",
"(",
"sys",
".",
"argv",
"[",
"-",
"1",
"]",
")",
"fd",
"=",
"msvcrt",
".",
"open_osfhandle",
"(",
"handle",
",",
"os",
".",
"O_RDONLY",
")"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/loky/backend/popen_loky_win32.py#L154-L173 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.__repr__ | (self, _repr_running={}) | od.__repr__() <==> repr(od) | od.__repr__() <==> repr(od) | [
"od",
".",
"__repr__",
"()",
"<",
"==",
">",
"repr",
"(",
"od",
")"
] | def __repr__(self, _repr_running={}):
'od.__repr__() <==> repr(od)'
call_key = id(self), _get_ident()
if call_key in _repr_running:
return '...'
_repr_running[call_key] = 1
try:
if not self:
return '%s()' % (self.__class__.__name__,)
... | [
"def",
"__repr__",
"(",
"self",
",",
"_repr_running",
"=",
"{",
"}",
")",
":",
"call_key",
"=",
"id",
"(",
"self",
")",
",",
"_get_ident",
"(",
")",
"if",
"call_key",
"in",
"_repr_running",
":",
"return",
"'...'",
"_repr_running",
"[",
"call_key",
"]",
... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/ordered_dict.py#L226-L237 | ||
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py | python | Datasource.set_probesource_cb | (self, cb) | Set callback for datasource probing
:param cb: Callback function, taking seqno, source definition, option map
:return: None | Set callback for datasource probing | [
"Set",
"callback",
"for",
"datasource",
"probing"
] | def set_probesource_cb(self, cb):
"""
Set callback for datasource probing
:param cb: Callback function, taking seqno, source definition, option map
:return: None
"""
self.probesource = cb | [
"def",
"set_probesource_cb",
"(",
"self",
",",
"cb",
")",
":",
"self",
".",
"probesource",
"=",
"cb"
] | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py#L786-L794 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pathlib2/pathlib2/__init__.py | python | _Flavour.join_parsed_parts | (self, drv, root, parts, drv2, root2, parts2) | return drv2, root2, parts2 | Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple. | Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple. | [
"Join",
"the",
"two",
"paths",
"represented",
"by",
"the",
"respective",
"(",
"drive",
"root",
"parts",
")",
"tuples",
".",
"Return",
"a",
"new",
"(",
"drive",
"root",
"parts",
")",
"tuple",
"."
] | def join_parsed_parts(self, drv, root, parts, drv2, root2, parts2):
"""
Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple.
"""
if root2:
if not drv2 and drv:
return drv, root2, [drv +... | [
"def",
"join_parsed_parts",
"(",
"self",
",",
"drv",
",",
"root",
",",
"parts",
",",
"drv2",
",",
"root2",
",",
"parts2",
")",
":",
"if",
"root2",
":",
"if",
"not",
"drv2",
"and",
"drv",
":",
"return",
"drv",
",",
"root2",
",",
"[",
"drv",
"+",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pathlib2/pathlib2/__init__.py#L275-L290 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/cookielib.py | python | CookiePolicy.set_ok | (self, cookie, request) | Return true if (and only if) cookie should be accepted from server.
Currently, pre-expired cookies never get this far -- the CookieJar
class deletes such cookies itself. | Return true if (and only if) cookie should be accepted from server. | [
"Return",
"true",
"if",
"(",
"and",
"only",
"if",
")",
"cookie",
"should",
"be",
"accepted",
"from",
"server",
"."
] | def set_ok(self, cookie, request):
"""Return true if (and only if) cookie should be accepted from server.
Currently, pre-expired cookies never get this far -- the CookieJar
class deletes such cookies itself.
"""
raise NotImplementedError() | [
"def",
"set_ok",
"(",
"self",
",",
"cookie",
",",
"request",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cookielib.py#L830-L837 | ||
apple/foundationdb | f7118ad406f44ab7a33970fc8370647ed0085e18 | bindings/python/fdb/directory_impl.py | python | DirectoryLayer.exists | (self, tr, path=()) | return True | Returns whether or not the specified directory exists. | Returns whether or not the specified directory exists. | [
"Returns",
"whether",
"or",
"not",
"the",
"specified",
"directory",
"exists",
"."
] | def exists(self, tr, path=()):
"""Returns whether or not the specified directory exists."""
self._check_version(tr, write_access=False)
path = _to_unicode_path(path)
node = self._find(tr, path).prefetch_metadata(tr)
if not node.exists():
return False
if nod... | [
"def",
"exists",
"(",
"self",
",",
"tr",
",",
"path",
"=",
"(",
")",
")",
":",
"self",
".",
"_check_version",
"(",
"tr",
",",
"write_access",
"=",
"False",
")",
"path",
"=",
"_to_unicode_path",
"(",
"path",
")",
"node",
"=",
"self",
".",
"_find",
"... | https://github.com/apple/foundationdb/blob/f7118ad406f44ab7a33970fc8370647ed0085e18/bindings/python/fdb/directory_impl.py#L427-L440 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc.bell | (self, displayof=0) | Ring a display's bell. | Ring a display's bell. | [
"Ring",
"a",
"display",
"s",
"bell",
"."
] | def bell(self, displayof=0):
"""Ring a display's bell."""
self.tk.call(('bell',) + self._displayof(displayof)) | [
"def",
"bell",
"(",
"self",
",",
"displayof",
"=",
"0",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"'bell'",
",",
")",
"+",
"self",
".",
"_displayof",
"(",
"displayof",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L781-L783 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/threading.py | python | Thread._set_tstate_lock | (self) | Set a lock object which will be released by the interpreter when
the underlying thread state (see pystate.h) gets deleted. | Set a lock object which will be released by the interpreter when
the underlying thread state (see pystate.h) gets deleted. | [
"Set",
"a",
"lock",
"object",
"which",
"will",
"be",
"released",
"by",
"the",
"interpreter",
"when",
"the",
"underlying",
"thread",
"state",
"(",
"see",
"pystate",
".",
"h",
")",
"gets",
"deleted",
"."
] | def _set_tstate_lock(self):
"""
Set a lock object which will be released by the interpreter when
the underlying thread state (see pystate.h) gets deleted.
"""
self._tstate_lock = _set_sentinel()
self._tstate_lock.acquire()
if not self.daemon:
with _sh... | [
"def",
"_set_tstate_lock",
"(",
"self",
")",
":",
"self",
".",
"_tstate_lock",
"=",
"_set_sentinel",
"(",
")",
"self",
".",
"_tstate_lock",
".",
"acquire",
"(",
")",
"if",
"not",
"self",
".",
"daemon",
":",
"with",
"_shutdown_locks_lock",
":",
"_shutdown_loc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/threading.py#L899-L909 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/ports/_virtual_connections.py | python | _sources_from_virtual_sink_port | (sink_port, _traversed=None) | return list(chain(*source_ports_per_virtual_connection)) | Resolve the source port that is connected to the given virtual sink port.
Use the get source from virtual source to recursively resolve subsequent ports. | Resolve the source port that is connected to the given virtual sink port.
Use the get source from virtual source to recursively resolve subsequent ports. | [
"Resolve",
"the",
"source",
"port",
"that",
"is",
"connected",
"to",
"the",
"given",
"virtual",
"sink",
"port",
".",
"Use",
"the",
"get",
"source",
"from",
"virtual",
"source",
"to",
"recursively",
"resolve",
"subsequent",
"ports",
"."
] | def _sources_from_virtual_sink_port(sink_port, _traversed=None):
"""
Resolve the source port that is connected to the given virtual sink port.
Use the get source from virtual source to recursively resolve subsequent ports.
"""
source_ports_per_virtual_connection = (
# there can be multiple p... | [
"def",
"_sources_from_virtual_sink_port",
"(",
"sink_port",
",",
"_traversed",
"=",
"None",
")",
":",
"source_ports_per_virtual_connection",
"=",
"(",
"# there can be multiple ports per virtual connection",
"_sources_from_virtual_source_port",
"(",
"c",
".",
"source_port",
",",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/ports/_virtual_connections.py#L24-L36 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | Cursor.is_converting_constructor | (self) | return conf.lib.clang_CXXConstructor_isConvertingConstructor(self) | Returns True if the cursor refers to a C++ converting constructor. | Returns True if the cursor refers to a C++ converting constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"converting",
"constructor",
"."
] | def is_converting_constructor(self):
"""Returns True if the cursor refers to a C++ converting constructor.
"""
return conf.lib.clang_CXXConstructor_isConvertingConstructor(self) | [
"def",
"is_converting_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isConvertingConstructor",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1352-L1355 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | AuiNotebook.GetAGWWindowStyleFlag | (self) | return self._agwFlags | Returns the AGW-specific style of the window.
:see: :meth:`SetAGWWindowStyleFlag` for a list of possible AGW-specific window styles. | Returns the AGW-specific style of the window. | [
"Returns",
"the",
"AGW",
"-",
"specific",
"style",
"of",
"the",
"window",
"."
] | def GetAGWWindowStyleFlag(self):
"""
Returns the AGW-specific style of the window.
:see: :meth:`SetAGWWindowStyleFlag` for a list of possible AGW-specific window styles.
"""
return self._agwFlags | [
"def",
"GetAGWWindowStyleFlag",
"(",
"self",
")",
":",
"return",
"self",
".",
"_agwFlags"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L3388-L3395 | |
tuttleofx/TuttleOFX | 36fc4cae15092a84ea8c29b9c6658c7cabfadb6e | applications/sam/common/samUtils.py | python | Sam._displayCommandLineHelp | (self, parser) | Display sam command line help. | Display sam command line help. | [
"Display",
"sam",
"command",
"line",
"help",
"."
] | def _displayCommandLineHelp(self, parser):
"""
Display sam command line help.
"""
if not self.command:
raise NotImplementedError
subparser = getSubParser(parser, self.command)
# if sam command is called from sam main command line
if subparser is not N... | [
"def",
"_displayCommandLineHelp",
"(",
"self",
",",
"parser",
")",
":",
"if",
"not",
"self",
".",
"command",
":",
"raise",
"NotImplementedError",
"subparser",
"=",
"getSubParser",
"(",
"parser",
",",
"self",
".",
"command",
")",
"# if sam command is called from sa... | https://github.com/tuttleofx/TuttleOFX/blob/36fc4cae15092a84ea8c29b9c6658c7cabfadb6e/applications/sam/common/samUtils.py#L99-L111 | ||
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/streams.py | python | CommonTokenStream.setTokenSource | (self, tokenSource) | Reset this token stream by setting its token source. | Reset this token stream by setting its token source. | [
"Reset",
"this",
"token",
"stream",
"by",
"setting",
"its",
"token",
"source",
"."
] | def setTokenSource(self, tokenSource):
"""Reset this token stream by setting its token source."""
self.tokenSource = tokenSource
self.tokens = []
self.p = -1
self.channel = DEFAULT_CHANNEL | [
"def",
"setTokenSource",
"(",
"self",
",",
"tokenSource",
")",
":",
"self",
".",
"tokenSource",
"=",
"tokenSource",
"self",
".",
"tokens",
"=",
"[",
"]",
"self",
".",
"p",
"=",
"-",
"1",
"self",
".",
"channel",
"=",
"DEFAULT_CHANNEL"
] | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/streams.py#L646-L652 | ||
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | python/open3d/visualization/tensorboard_plugin/colormap.py | python | Colormap.calc_color_array | (self, values, range_min, range_max) | return [tex[int(u * n)] for u in u_array] | Generate the color array based on the minimum and maximum range passed.
Args:
values: The index of values.
range_min: The minimum value in the range.
range_max: The maximum value in the range.
Returns:
An array of color index based on the range passed. | Generate the color array based on the minimum and maximum range passed. | [
"Generate",
"the",
"color",
"array",
"based",
"on",
"the",
"minimum",
"and",
"maximum",
"range",
"passed",
"."
] | def calc_color_array(self, values, range_min, range_max):
"""Generate the color array based on the minimum and maximum range passed.
Args:
values: The index of values.
range_min: The minimum value in the range.
range_max: The maximum value in the range.
Retu... | [
"def",
"calc_color_array",
"(",
"self",
",",
"values",
",",
"range_min",
",",
"range_max",
")",
":",
"u_array",
"=",
"self",
".",
"calc_u_array",
"(",
"values",
",",
"range_min",
",",
"range_max",
")",
"tex",
"=",
"[",
"[",
"1.0",
",",
"0.0",
",",
"1.0... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/visualization/tensorboard_plugin/colormap.py#L62-L101 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2.py | python | SimpleRoute.regex | (self) | return re.compile(self.template) | Lazy regex compiler. | Lazy regex compiler. | [
"Lazy",
"regex",
"compiler",
"."
] | def regex(self):
"""Lazy regex compiler."""
if not self.template.startswith('^'):
self.template = '^' + self.template
if not self.template.endswith('$'):
self.template += '$'
return re.compile(self.template) | [
"def",
"regex",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"template",
".",
"startswith",
"(",
"'^'",
")",
":",
"self",
".",
"template",
"=",
"'^'",
"+",
"self",
".",
"template",
"if",
"not",
"self",
".",
"template",
".",
"endswith",
"(",
"'$... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L835-L843 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | copysign | (x1, x2, dtype=None) | return res | Changes the sign of `x1` to that of `x2`, element-wise.
If `x2` is a scalar, its sign will be copied to all elements of `x1`.
Note:
Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
Complex inputs are not supported now.
Args:... | Changes the sign of `x1` to that of `x2`, element-wise. | [
"Changes",
"the",
"sign",
"of",
"x1",
"to",
"that",
"of",
"x2",
"element",
"-",
"wise",
"."
] | def copysign(x1, x2, dtype=None):
"""
Changes the sign of `x1` to that of `x2`, element-wise.
If `x2` is a scalar, its sign will be copied to all elements of `x1`.
Note:
Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
Co... | [
"def",
"copysign",
"(",
"x1",
",",
"x2",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"x1",
",",
"(",
"int",
",",
"float",
",",
"list",
",",
"tuple",
",",
"Tensor",
")",
")",
":",
"_raise_type_error",
"(",
"'integer, float, li... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L4492-L4549 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | CustomHandler.WriteImmediateCmdSet | (self, func, f) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
copy_args = func.MakeCmdArgString("_", False)
f.write(" void* Set(void* cmd%s) {\n" %
func.MakeTypedCmdArgString("_", True))
self.WriteImmediateCmdGetTotalSize(func, f)
f.write(" static_cast<ValueType*>(cm... | [
"def",
"WriteImmediateCmdSet",
"(",
"self",
",",
"func",
",",
"f",
")",
":",
"copy_args",
"=",
"func",
".",
"MakeCmdArgString",
"(",
"\"_\"",
",",
"False",
")",
"f",
".",
"write",
"(",
"\" void* Set(void* cmd%s) {\\n\"",
"%",
"func",
".",
"MakeTypedCmdArgStri... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L5722-L5732 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/binary-search-tree-iterator-ii.py | python | BSTIterator.next | (self) | return self.__vals[self.__pos] | :rtype: int | :rtype: int | [
":",
"rtype",
":",
"int"
] | def next(self):
"""
:rtype: int
"""
self.__pos += 1
if self.__pos == len(self.__vals):
node = self.__stk.pop()
self.__traversalLeft(node.right)
self.__vals.append(node.val)
return self.__vals[self.__pos] | [
"def",
"next",
"(",
"self",
")",
":",
"self",
".",
"__pos",
"+=",
"1",
"if",
"self",
".",
"__pos",
"==",
"len",
"(",
"self",
".",
"__vals",
")",
":",
"node",
"=",
"self",
".",
"__stk",
".",
"pop",
"(",
")",
"self",
".",
"__traversalLeft",
"(",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/binary-search-tree-iterator-ii.py#L29-L38 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/shape_base.py | python | hstack | (tup) | Stack arrays in sequence horizontally (column wise).
Take a sequence of arrays and stack them horizontally to make
a single array. Rebuild arrays divided by `hsplit`.
Parameters
----------
tup : sequence of ndarrays
All arrays must have the same shape along all but the second axis.
Re... | Stack arrays in sequence horizontally (column wise). | [
"Stack",
"arrays",
"in",
"sequence",
"horizontally",
"(",
"column",
"wise",
")",
"."
] | def hstack(tup):
"""
Stack arrays in sequence horizontally (column wise).
Take a sequence of arrays and stack them horizontally to make
a single array. Rebuild arrays divided by `hsplit`.
Parameters
----------
tup : sequence of ndarrays
All arrays must have the same shape along all... | [
"def",
"hstack",
"(",
"tup",
")",
":",
"arrs",
"=",
"[",
"atleast_1d",
"(",
"_m",
")",
"for",
"_m",
"in",
"tup",
"]",
"# As a special case, dimension 0 of 1-dimensional arrays is \"horizontal\"",
"if",
"arrs",
"[",
"0",
"]",
".",
"ndim",
"==",
"1",
":",
"ret... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/shape_base.py#L230-L277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.