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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | SpinCtrl.GetMax | (*args, **kwargs) | return _controls_.SpinCtrl_GetMax(*args, **kwargs) | GetMax(self) -> int | GetMax(self) -> int | [
"GetMax",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMax(*args, **kwargs):
"""GetMax(self) -> int"""
return _controls_.SpinCtrl_GetMax(*args, **kwargs) | [
"def",
"GetMax",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"SpinCtrl_GetMax",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2384-L2386 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | third_party/mbedtls/repo/scripts/config.py | python | Config.set | (self, name, value=None) | Set name to the given value and make it active.
If value is None and name is already known, don't change its value.
If value is None and name is not known, set its value to the empty
string. | Set name to the given value and make it active. | [
"Set",
"name",
"to",
"the",
"given",
"value",
"and",
"make",
"it",
"active",
"."
] | def set(self, name, value=None):
"""Set name to the given value and make it active.
If value is None and name is already known, don't change its value.
If value is None and name is not known, set its value to the empty
string.
"""
if name in self.settings:
if... | [
"def",
"set",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"if",
"name",
"in",
"self",
".",
"settings",
":",
"if",
"value",
"is",
"not",
"None",
":",
"self",
".",
"settings",
"[",
"name",
"]",
".",
"value",
"=",
"value",
"self",... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/third_party/mbedtls/repo/scripts/config.py#L113-L125 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py | python | DirectedGraph.add | (self, key) | Add a new vertex to the graph. | Add a new vertex to the graph. | [
"Add",
"a",
"new",
"vertex",
"to",
"the",
"graph",
"."
] | def add(self, key):
"""Add a new vertex to the graph."""
if key in self._vertices:
raise ValueError("vertex exists")
self._vertices.add(key)
self._forwards[key] = set()
self._backwards[key] = set() | [
"def",
"add",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
".",
"_vertices",
":",
"raise",
"ValueError",
"(",
"\"vertex exists\"",
")",
"self",
".",
"_vertices",
".",
"add",
"(",
"key",
")",
"self",
".",
"_forwards",
"[",
"key",
"]",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py#L57-L69 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSVersion.py | python | _CreateVersion | (name, path, sdk_based=False) | return versions[str(name)] | Sets up MSVS project generation.
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a error. | Sets up MSVS project generation. | [
"Sets",
"up",
"MSVS",
"project",
"generation",
"."
] | def _CreateVersion(name, path, sdk_based=False):
"""Sets up MSVS project generation.
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a err... | [
"def",
"_CreateVersion",
"(",
"name",
",",
"path",
",",
"sdk_based",
"=",
"False",
")",
":",
"if",
"path",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"versions",
"=",
"{",
"'2015'",
":",
"VisualStudioVersion",
"(",
"'2015'"... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSVersion.py#L219-L323 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/simpledialog.py | python | Dialog.buttonbox | (self) | add standard button box.
override if you do not want the standard buttons | add standard button box. | [
"add",
"standard",
"button",
"box",
"."
] | def buttonbox(self):
'''add standard button box.
override if you do not want the standard buttons
'''
box = Frame(self)
w = Button(box, text="OK", width=10, command=self.ok, default=ACTIVE)
w.pack(side=LEFT, padx=5, pady=5)
w = Button(box, text="Cancel", width=... | [
"def",
"buttonbox",
"(",
"self",
")",
":",
"box",
"=",
"Frame",
"(",
"self",
")",
"w",
"=",
"Button",
"(",
"box",
",",
"text",
"=",
"\"OK\"",
",",
"width",
"=",
"10",
",",
"command",
"=",
"self",
".",
"ok",
",",
"default",
"=",
"ACTIVE",
")",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/simpledialog.py#L188-L204 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/tools/calculate_wms_mercator_tile_errors.py | python | ErrorInPixels | (y, num_tiles, pos_flat_tile_0_to_1) | return (y_flat - true_y_merc) * 256 | Calculate error in pixels at given position within tile.
Position ranges from 0.0 to 1.0 (y_pixel = 0 to y_pixel = 255).
Maximum error should be near the middle since it is 0 at the
two borders.
Args:
y: (integer) Position of tile in qt grid moving from south to north.
num_tiles: (integer) Number of t... | Calculate error in pixels at given position within tile. | [
"Calculate",
"error",
"in",
"pixels",
"at",
"given",
"position",
"within",
"tile",
"."
] | def ErrorInPixels(y, num_tiles, pos_flat_tile_0_to_1):
"""Calculate error in pixels at given position within tile.
Position ranges from 0.0 to 1.0 (y_pixel = 0 to y_pixel = 255).
Maximum error should be near the middle since it is 0 at the
two borders.
Args:
y: (integer) Position of tile in qt grid movi... | [
"def",
"ErrorInPixels",
"(",
"y",
",",
"num_tiles",
",",
"pos_flat_tile_0_to_1",
")",
":",
"# Top and bottom bounds in degrees (same for flat and Mercator)",
"# since we are passing these to wms as the bounds.",
"bottom_merc_tile_deg",
"=",
"ToMercDegrees",
"(",
"y",
"+",
"0.0",
... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/tools/calculate_wms_mercator_tile_errors.py#L118-L146 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | WorkingSet.__init__ | (self, entries=None) | Create working set from list of path entries (default=sys.path) | Create working set from list of path entries (default=sys.path) | [
"Create",
"working",
"set",
"from",
"list",
"of",
"path",
"entries",
"(",
"default",
"=",
"sys",
".",
"path",
")"
] | def __init__(self, entries=None):
"""Create working set from list of path entries (default=sys.path)"""
self.entries = []
self.entry_keys = {}
self.by_key = {}
self.callbacks = []
if entries is None:
entries = sys.path
for entry in entries:
... | [
"def",
"__init__",
"(",
"self",
",",
"entries",
"=",
"None",
")",
":",
"self",
".",
"entries",
"=",
"[",
"]",
"self",
".",
"entry_keys",
"=",
"{",
"}",
"self",
".",
"by_key",
"=",
"{",
"}",
"self",
".",
"callbacks",
"=",
"[",
"]",
"if",
"entries"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L557-L568 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/openvino/runtime/opset4/ops.py | python | lstm_cell | (
X: NodeInput,
initial_hidden_state: NodeInput,
initial_cell_state: NodeInput,
W: NodeInput,
R: NodeInput,
B: NodeInput,
hidden_size: int,
activations: List[str] = None,
activations_alpha: List[float] = None,
activations_beta: List[float] = None,
clip: float = 0.0,
name:... | return _get_node_factory_opset4().create("LSTMCell", node_inputs, attributes) | Return a node which performs LSTMCell operation.
@param X: The input tensor with shape: [batch_size, input_size].
@param initial_hidden_state: The hidden state tensor with shape: [batch_size, hidden_size].
@param initial_cell_state: The cell state tensor with shape: [batch_size, hidden_size].
@param W:... | Return a node which performs LSTMCell operation. | [
"Return",
"a",
"node",
"which",
"performs",
"LSTMCell",
"operation",
"."
] | def lstm_cell(
X: NodeInput,
initial_hidden_state: NodeInput,
initial_cell_state: NodeInput,
W: NodeInput,
R: NodeInput,
B: NodeInput,
hidden_size: int,
activations: List[str] = None,
activations_alpha: List[float] = None,
activations_beta: List[float] = None,
clip: float = 0... | [
"def",
"lstm_cell",
"(",
"X",
":",
"NodeInput",
",",
"initial_hidden_state",
":",
"NodeInput",
",",
"initial_cell_state",
":",
"NodeInput",
",",
"W",
":",
"NodeInput",
",",
"R",
":",
"NodeInput",
",",
"B",
":",
"NodeInput",
",",
"hidden_size",
":",
"int",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/opset4/ops.py#L354-L401 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py | python | _singlefileMailbox.__len__ | (self) | return len(self._toc) | Return a count of messages in the mailbox. | Return a count of messages in the mailbox. | [
"Return",
"a",
"count",
"of",
"messages",
"in",
"the",
"mailbox",
"."
] | def __len__(self):
"""Return a count of messages in the mailbox."""
self._lookup()
return len(self._toc) | [
"def",
"__len__",
"(",
"self",
")",
":",
"self",
".",
"_lookup",
"(",
")",
"return",
"len",
"(",
"self",
".",
"_toc",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L617-L620 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/math_ops.py | python | _calc_mat_mul_flops | (graph, node) | return ops.OpStats("flops", (k * output_count * 2)) | Calculates the compute resources needed for MatMul. | Calculates the compute resources needed for MatMul. | [
"Calculates",
"the",
"compute",
"resources",
"needed",
"for",
"MatMul",
"."
] | def _calc_mat_mul_flops(graph, node):
"""Calculates the compute resources needed for MatMul."""
transpose_a = node.attr["transpose_a"].b
a_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0])
a_shape.assert_is_fully_defined()
if transpose_a:
k = int(a_shape[0])
else:
k = int(a_sh... | [
"def",
"_calc_mat_mul_flops",
"(",
"graph",
",",
"node",
")",
":",
"transpose_a",
"=",
"node",
".",
"attr",
"[",
"\"transpose_a\"",
"]",
".",
"b",
"a_shape",
"=",
"graph_util",
".",
"tensor_shape_from_node_def_name",
"(",
"graph",
",",
"node",
".",
"input",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_ops.py#L1853-L1865 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | thirdparty/gflags/gflags.py | python | FlagValues.__IsFlagFileDirective | (self, flag_string) | return 0 | Checks whether flag_string contain a --flagfile=<foo> directive. | Checks whether flag_string contain a --flagfile=<foo> directive. | [
"Checks",
"whether",
"flag_string",
"contain",
"a",
"--",
"flagfile",
"=",
"<foo",
">",
"directive",
"."
] | def __IsFlagFileDirective(self, flag_string):
"""Checks whether flag_string contain a --flagfile=<foo> directive."""
if isinstance(flag_string, type("")):
if flag_string.startswith('--flagfile='):
return 1
elif flag_string == '--flagfile':
return 1
elif flag_string.startswith('... | [
"def",
"__IsFlagFileDirective",
"(",
"self",
",",
"flag_string",
")",
":",
"if",
"isinstance",
"(",
"flag_string",
",",
"type",
"(",
"\"\"",
")",
")",
":",
"if",
"flag_string",
".",
"startswith",
"(",
"'--flagfile='",
")",
":",
"return",
"1",
"elif",
"flag... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L1456-L1469 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/cmd.py | python | Command.finalize_options | (self) | Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: if
'foo' depends on 'bar', then... | Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: if
'foo' depends on 'bar', then... | [
"Set",
"final",
"values",
"for",
"all",
"the",
"options",
"that",
"this",
"command",
"supports",
".",
"This",
"is",
"always",
"called",
"as",
"late",
"as",
"possible",
"ie",
".",
"after",
"any",
"option",
"assignments",
"from",
"the",
"command",
"-",
"line... | def finalize_options(self):
"""Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: ... | [
"def",
"finalize_options",
"(",
"self",
")",
":",
"raise",
"RuntimeError",
",",
"\"abstract method -- subclass %s must override\"",
"%",
"self",
".",
"__class__"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/cmd.py#L138-L150 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/_psosx.py | python | boot_time | () | return cext.boot_time() | The system boot time expressed in seconds since the epoch. | The system boot time expressed in seconds since the epoch. | [
"The",
"system",
"boot",
"time",
"expressed",
"in",
"seconds",
"since",
"the",
"epoch",
"."
] | def boot_time():
"""The system boot time expressed in seconds since the epoch."""
return cext.boot_time() | [
"def",
"boot_time",
"(",
")",
":",
"return",
"cext",
".",
"boot_time",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/_psosx.py#L117-L119 | |
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/actor.py | python | Actor.get_ros_transform | (self, transform=None) | return tf_msg | Function to provide the current ROS transform
:return: the ROS transfrom
:rtype: geometry_msgs.msg.TransformStamped | Function to provide the current ROS transform | [
"Function",
"to",
"provide",
"the",
"current",
"ROS",
"transform"
] | def get_ros_transform(self, transform=None):
"""
Function to provide the current ROS transform
:return: the ROS transfrom
:rtype: geometry_msgs.msg.TransformStamped
"""
tf_msg = TransformStamped()
tf_msg.header = self.get_msg_header("map")
tf_msg.child_fr... | [
"def",
"get_ros_transform",
"(",
"self",
",",
"transform",
"=",
"None",
")",
":",
"tf_msg",
"=",
"TransformStamped",
"(",
")",
"tf_msg",
".",
"header",
"=",
"self",
".",
"get_msg_header",
"(",
"\"map\"",
")",
"tf_msg",
".",
"child_frame_id",
"=",
"self",
"... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/actor.py#L99-L114 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/android_eclipse.py | python | AndroidEclipseBackend._Element_for_extra_jar | (self, name) | return e | Turn a referenced JAR name into an XML Element, like:
<classpathentry exported="true" kind="lib" path="/Users/nalexander/Mozilla/gecko-dev/build/mobile/robocop/robotium-solo-4.3.1.jar"/> | Turn a referenced JAR name into an XML Element, like:
<classpathentry exported="true" kind="lib" path="/Users/nalexander/Mozilla/gecko-dev/build/mobile/robocop/robotium-solo-4.3.1.jar"/> | [
"Turn",
"a",
"referenced",
"JAR",
"name",
"into",
"an",
"XML",
"Element",
"like",
":",
"<classpathentry",
"exported",
"=",
"true",
"kind",
"=",
"lib",
"path",
"=",
"/",
"Users",
"/",
"nalexander",
"/",
"Mozilla",
"/",
"gecko",
"-",
"dev",
"/",
"build",
... | def _Element_for_extra_jar(self, name):
"""Turn a referenced JAR name into an XML Element, like:
<classpathentry exported="true" kind="lib" path="/Users/nalexander/Mozilla/gecko-dev/build/mobile/robocop/robotium-solo-4.3.1.jar"/>
"""
e = ET.Element('classpathentry')
e.set('kind',... | [
"def",
"_Element_for_extra_jar",
"(",
"self",
",",
"name",
")",
":",
"e",
"=",
"ET",
".",
"Element",
"(",
"'classpathentry'",
")",
"e",
".",
"set",
"(",
"'kind'",
",",
"'lib'",
")",
"e",
".",
"set",
"(",
"'exported'",
",",
"'true'",
")",
"e",
".",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/backend/android_eclipse.py#L117-L125 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unicode.py | python | _lower_ucs4 | (code_point, data, length, idx, mapped) | return _PyUnicode_ToLowerFull(code_point, mapped) | This is a translation of the function that lowers a character. | This is a translation of the function that lowers a character. | [
"This",
"is",
"a",
"translation",
"of",
"the",
"function",
"that",
"lowers",
"a",
"character",
"."
] | def _lower_ucs4(code_point, data, length, idx, mapped):
"""This is a translation of the function that lowers a character."""
if code_point == 0x3A3:
mapped[0] = _handle_capital_sigma(data, length, idx)
return 1
return _PyUnicode_ToLowerFull(code_point, mapped) | [
"def",
"_lower_ucs4",
"(",
"code_point",
",",
"data",
",",
"length",
",",
"idx",
",",
"mapped",
")",
":",
"if",
"code_point",
"==",
"0x3A3",
":",
"mapped",
"[",
"0",
"]",
"=",
"_handle_capital_sigma",
"(",
"data",
",",
"length",
",",
"idx",
")",
"retur... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unicode.py#L2042-L2047 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | RobotModelLink.setPrismatic | (self, prismatic: bool) | return _robotsim.RobotModelLink_setPrismatic(self, prismatic) | r"""
Changes a link from revolute to prismatic or vice versa.
Args:
prismatic (bool) | r"""
Changes a link from revolute to prismatic or vice versa. | [
"r",
"Changes",
"a",
"link",
"from",
"revolute",
"to",
"prismatic",
"or",
"vice",
"versa",
"."
] | def setPrismatic(self, prismatic: bool) ->None:
r"""
Changes a link from revolute to prismatic or vice versa.
Args:
prismatic (bool)
"""
return _robotsim.RobotModelLink_setPrismatic(self, prismatic) | [
"def",
"setPrismatic",
"(",
"self",
",",
"prismatic",
":",
"bool",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"RobotModelLink_setPrismatic",
"(",
"self",
",",
"prismatic",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4071-L4078 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.ToolPath | (self, tool) | return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) | Returns the path to a given compiler tool. | Returns the path to a given compiler tool. | [
"Returns",
"the",
"path",
"to",
"a",
"given",
"compiler",
"tool",
"."
] | def ToolPath(self, tool):
"""Returns the path to a given compiler tool. """
return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) | [
"def",
"ToolPath",
"(",
"self",
",",
"tool",
")",
":",
"return",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"path",
",",
"\"VC/bin\"",
",",
"tool",
")",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py#L61-L63 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/meta/decompiler/simple_instructions.py | python | SimpleInstructions.STORE_LOCALS | (self, instr) | remove Locals from class def | remove Locals from class def | [
"remove",
"Locals",
"from",
"class",
"def"
] | def STORE_LOCALS(self, instr):
'remove Locals from class def'
self.ast_stack.pop() | [
"def",
"STORE_LOCALS",
"(",
"self",
",",
"instr",
")",
":",
"self",
".",
"ast_stack",
".",
"pop",
"(",
")"
] | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/meta/decompiler/simple_instructions.py#L249-L251 | ||
happynear/caffe-windows | 967eedf25009e334b7f6f933bb5e17aaaff5bef6 | python/caffe/io.py | python | datum_to_array | (datum) | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | [
"Converts",
"a",
"datum",
"to",
"an",
"array",
".",
"Note",
"that",
"the",
"label",
"is",
"not",
"returned",
"as",
"one",
"can",
"easily",
"get",
"it",
"by",
"calling",
"datum",
".",
"label",
"."
] | def datum_to_array(datum):
"""Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label.
"""
if len(datum.data):
return np.fromstring(datum.data, dtype=np.uint8).reshape(
datum.channels, datum.height, datum.width)
else:
... | [
"def",
"datum_to_array",
"(",
"datum",
")",
":",
"if",
"len",
"(",
"datum",
".",
"data",
")",
":",
"return",
"np",
".",
"fromstring",
"(",
"datum",
".",
"data",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
".",
"reshape",
"(",
"datum",
".",
"channel... | https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/python/caffe/io.py#L84-L93 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Dir._glob1 | (self, pattern, ondisk=True, source=False, strings=False) | return [self.entries[_my_normcase(n)] for n in names] | Globs for and returns a list of entry names matching a single
pattern in this directory.
This searches any repositories and source directories for
corresponding entries and returns a Node (or string) relative
to the current directory if an entry is found anywhere.
TODO: handle ... | Globs for and returns a list of entry names matching a single
pattern in this directory. | [
"Globs",
"for",
"and",
"returns",
"a",
"list",
"of",
"entry",
"names",
"matching",
"a",
"single",
"pattern",
"in",
"this",
"directory",
"."
] | def _glob1(self, pattern, ondisk=True, source=False, strings=False):
"""
Globs for and returns a list of entry names matching a single
pattern in this directory.
This searches any repositories and source directories for
corresponding entries and returns a Node (or string) relati... | [
"def",
"_glob1",
"(",
"self",
",",
"pattern",
",",
"ondisk",
"=",
"True",
",",
"source",
"=",
"False",
",",
"strings",
"=",
"False",
")",
":",
"search_dir_list",
"=",
"self",
".",
"get_all_rdirs",
"(",
")",
"for",
"srcdir",
"in",
"self",
".",
"srcdir_l... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L2190-L2255 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/SerialCppVisitor.py | python | SerialCppVisitor.protectedVisit | (self, obj) | Defined to generate protected stuff within a class.
@param args: the instance of the concrete element to operation on. | Defined to generate protected stuff within a class. | [
"Defined",
"to",
"generate",
"protected",
"stuff",
"within",
"a",
"class",
"."
] | def protectedVisit(self, obj):
"""
Defined to generate protected stuff within a class.
@param args: the instance of the concrete element to operation on.
""" | [
"def",
"protectedVisit",
"(",
"self",
",",
"obj",
")",
":"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/SerialCppVisitor.py#L329-L333 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/experimental/loss_scale.py | python | get | (identifier) | Get a loss scale object. | Get a loss scale object. | [
"Get",
"a",
"loss",
"scale",
"object",
"."
] | def get(identifier):
"""Get a loss scale object."""
if isinstance(identifier, six.integer_types + (float,)):
return FixedLossScale(identifier)
if identifier == 'dynamic':
return DynamicLossScale()
if isinstance(identifier, LossScale):
return identifier
elif identifier is None:
return None
el... | [
"def",
"get",
"(",
"identifier",
")",
":",
"if",
"isinstance",
"(",
"identifier",
",",
"six",
".",
"integer_types",
"+",
"(",
"float",
",",
")",
")",
":",
"return",
"FixedLossScale",
"(",
"identifier",
")",
"if",
"identifier",
"==",
"'dynamic'",
":",
"re... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/experimental/loss_scale.py#L463-L475 | ||
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | src/visualizer/visualizer/core.py | python | Node._update_appearance | (self) | !
Update the node aspect to reflect the selected/highlighted state
@param self: class object.
@return none | !
Update the node aspect to reflect the selected/highlighted state | [
"!",
"Update",
"the",
"node",
"aspect",
"to",
"reflect",
"the",
"selected",
"/",
"highlighted",
"state"
] | def _update_appearance(self):
"""!
Update the node aspect to reflect the selected/highlighted state
@param self: class object.
@return none
"""
size = transform_distance_simulation_to_canvas(self._size)
if self.svg_item is not None:
alpha = 0x80
... | [
"def",
"_update_appearance",
"(",
"self",
")",
":",
"size",
"=",
"transform_distance_simulation_to_canvas",
"(",
"self",
".",
"_size",
")",
"if",
"self",
".",
"svg_item",
"is",
"not",
"None",
":",
"alpha",
"=",
"0x80",
"else",
":",
"alpha",
"=",
"0xff",
"f... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L361-L400 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/bccache.py | python | BytecodeCache.get_bucket | (self, environment, name, filename, source) | return bucket | Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`. | Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`. | [
"Return",
"a",
"cache",
"bucket",
"for",
"the",
"given",
"template",
".",
"All",
"arguments",
"are",
"mandatory",
"but",
"filename",
"may",
"be",
"None",
"."
] | def get_bucket(self, environment, name, filename, source):
"""Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`.
"""
key = self.get_cache_key(name, filename)
checksum = self.get_source_checksum(source)
bucket = Bucket(en... | [
"def",
"get_bucket",
"(",
"self",
",",
"environment",
",",
"name",
",",
"filename",
",",
"source",
")",
":",
"key",
"=",
"self",
".",
"get_cache_key",
"(",
"name",
",",
"filename",
")",
"checksum",
"=",
"self",
".",
"get_source_checksum",
"(",
"source",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/bccache.py#L180-L188 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | BookCtrlBase.GetClassDefaultAttributes | (*args, **kwargs) | return _core_.BookCtrlBase_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13654-L13669 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionDIFF.py | python | IndirectILLReductionDIFF._normalize_by_monitor | (self) | Normalizes the workspace by monitor value (ID is 0 for IN16B) | Normalizes the workspace by monitor value (ID is 0 for IN16B) | [
"Normalizes",
"the",
"workspace",
"by",
"monitor",
"value",
"(",
"ID",
"is",
"0",
"for",
"IN16B",
")"
] | def _normalize_by_monitor(self):
"""
Normalizes the workspace by monitor value (ID is 0 for IN16B)
"""
monitor_ws = self.output + '_mon'
ExtractMonitors(InputWorkspace=self.output, DetectorWorkspace=self.output, MonitorWorkspace=monitor_ws)
Divide(LHSWorkspace=self.ou... | [
"def",
"_normalize_by_monitor",
"(",
"self",
")",
":",
"monitor_ws",
"=",
"self",
".",
"output",
"+",
"'_mon'",
"ExtractMonitors",
"(",
"InputWorkspace",
"=",
"self",
".",
"output",
",",
"DetectorWorkspace",
"=",
"self",
".",
"output",
",",
"MonitorWorkspace",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionDIFF.py#L58-L65 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-time.py | python | SConsTimer.args_to_files | (self, args, tail=None) | return files | Takes a list of arguments, expands any glob patterns, and
returns the last "tail" files from the list. | Takes a list of arguments, expands any glob patterns, and
returns the last "tail" files from the list. | [
"Takes",
"a",
"list",
"of",
"arguments",
"expands",
"any",
"glob",
"patterns",
"and",
"returns",
"the",
"last",
"tail",
"files",
"from",
"the",
"list",
"."
] | def args_to_files(self, args, tail=None):
"""
Takes a list of arguments, expands any glob patterns, and
returns the last "tail" files from the list.
"""
files = []
for a in args:
files.extend(sorted(glob.glob(a)))
if tail:
files = files[-t... | [
"def",
"args_to_files",
"(",
"self",
",",
"args",
",",
"tail",
"=",
"None",
")",
":",
"files",
"=",
"[",
"]",
"for",
"a",
"in",
"args",
":",
"files",
".",
"extend",
"(",
"sorted",
"(",
"glob",
".",
"glob",
"(",
"a",
")",
")",
")",
"if",
"tail",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-time.py#L479-L491 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | pdq/python/pdqhashing/types/hash256.py | python | Hash256.fuzz | (self, numErrorBits) | return rv | Flips some number of bits randomly, with replacement. (I.e. not all
flipped bits are guaranteed to be in different positions; if you pass
argument of 10 then maybe 2 bits will be flipped and flipped back, and
only 6 flipped once.) | Flips some number of bits randomly, with replacement. (I.e. not all
flipped bits are guaranteed to be in different positions; if you pass
argument of 10 then maybe 2 bits will be flipped and flipped back, and
only 6 flipped once.) | [
"Flips",
"some",
"number",
"of",
"bits",
"randomly",
"with",
"replacement",
".",
"(",
"I",
".",
"e",
".",
"not",
"all",
"flipped",
"bits",
"are",
"guaranteed",
"to",
"be",
"in",
"different",
"positions",
";",
"if",
"you",
"pass",
"argument",
"of",
"10",
... | def fuzz(self, numErrorBits):
""" Flips some number of bits randomly, with replacement. (I.e. not all
flipped bits are guaranteed to be in different positions; if you pass
argument of 10 then maybe 2 bits will be flipped and flipped back, and
only 6 flipped once.) """
rv = self.... | [
"def",
"fuzz",
"(",
"self",
",",
"numErrorBits",
")",
":",
"rv",
"=",
"self",
".",
"clone",
"(",
")",
"i",
"=",
"0",
"while",
"i",
"<",
"numErrorBits",
":",
"rv",
".",
"flipBit",
"(",
"randint",
"(",
"0",
",",
"255",
")",
")",
"i",
"+=",
"1",
... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/pdq/python/pdqhashing/types/hash256.py#L186-L196 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/symbol_database.py | python | Default | () | return _DEFAULT | Returns the default SymbolDatabase. | Returns the default SymbolDatabase. | [
"Returns",
"the",
"default",
"SymbolDatabase",
"."
] | def Default():
"""Returns the default SymbolDatabase."""
return _DEFAULT | [
"def",
"Default",
"(",
")",
":",
"return",
"_DEFAULT"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/symbol_database.py#L183-L185 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/trajectory.py | python | SE3Trajectory.__init__ | (self,times=None,milestones=None) | Constructor can take either a list of SE3 elements or
12-element vectors. | Constructor can take either a list of SE3 elements or
12-element vectors. | [
"Constructor",
"can",
"take",
"either",
"a",
"list",
"of",
"SE3",
"elements",
"or",
"12",
"-",
"element",
"vectors",
"."
] | def __init__(self,times=None,milestones=None):
"""Constructor can take either a list of SE3 elements or
12-element vectors."""
if milestones is not None and len(milestones) > 0 and len(milestones[0])==2:
GeodesicTrajectory.__init__(self,SE3Space(),times,[m[0]+m[1] for m in milestones... | [
"def",
"__init__",
"(",
"self",
",",
"times",
"=",
"None",
",",
"milestones",
"=",
"None",
")",
":",
"if",
"milestones",
"is",
"not",
"None",
"and",
"len",
"(",
"milestones",
")",
">",
"0",
"and",
"len",
"(",
"milestones",
"[",
"0",
"]",
")",
"==",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/trajectory.py#L675-L681 | ||
facebookincubator/katran | 192eb988c398afc673620254097defb7035d669e | build/fbcode_builder/getdeps/builder.py | python | CargoBuilder._extract_crates | (cargo_toml_file, dep_to_git) | return deps_to_crates | This functions reads content of provided cargo toml file and extracts
crate names per each dependency. The extraction is done by a heuristic
so it might be incorrect. | This functions reads content of provided cargo toml file and extracts
crate names per each dependency. The extraction is done by a heuristic
so it might be incorrect. | [
"This",
"functions",
"reads",
"content",
"of",
"provided",
"cargo",
"toml",
"file",
"and",
"extracts",
"crate",
"names",
"per",
"each",
"dependency",
".",
"The",
"extraction",
"is",
"done",
"by",
"a",
"heuristic",
"so",
"it",
"might",
"be",
"incorrect",
"."
... | def _extract_crates(cargo_toml_file, dep_to_git):
"""
This functions reads content of provided cargo toml file and extracts
crate names per each dependency. The extraction is done by a heuristic
so it might be incorrect.
"""
deps_to_crates = {}
with open(cargo_tom... | [
"def",
"_extract_crates",
"(",
"cargo_toml_file",
",",
"dep_to_git",
")",
":",
"deps_to_crates",
"=",
"{",
"}",
"with",
"open",
"(",
"cargo_toml_file",
",",
"\"r\"",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
".",
"readlines",
"(",
")",
":",
"if",
... | https://github.com/facebookincubator/katran/blob/192eb988c398afc673620254097defb7035d669e/build/fbcode_builder/getdeps/builder.py#L1453-L1474 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/libdeps/libdeps/analyzer.py | python | Counter.report | (self, report) | Report the results for the current type. | Report the results for the current type. | [
"Report",
"the",
"results",
"for",
"the",
"current",
"type",
"."
] | def report(self, report):
"""Report the results for the current type."""
report[self._count_type] = self.run() | [
"def",
"report",
"(",
"self",
",",
"report",
")",
":",
"report",
"[",
"self",
".",
"_count_type",
"]",
"=",
"self",
".",
"run",
"(",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/libdeps/libdeps/analyzer.py#L179-L182 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/dbwrap.py | python | Database.table_merge_abbr | (self, plotpath, subjoin) | return rowplan, columnplan, landscape, footnotes, title, theme | Specialization of table_generic into table with minimal statistics
(three S22 and three overall) plus embedded slat diagram as suitable
for main paper. A single table is formed in sections by *bas* with
lines *mtd* within each section. | Specialization of table_generic into table with minimal statistics
(three S22 and three overall) plus embedded slat diagram as suitable
for main paper. A single table is formed in sections by *bas* with
lines *mtd* within each section. | [
"Specialization",
"of",
"table_generic",
"into",
"table",
"with",
"minimal",
"statistics",
"(",
"three",
"S22",
"and",
"three",
"overall",
")",
"plus",
"embedded",
"slat",
"diagram",
"as",
"suitable",
"for",
"main",
"paper",
".",
"A",
"single",
"table",
"is",
... | def table_merge_abbr(self, plotpath, subjoin):
"""Specialization of table_generic into table with minimal statistics
(three S22 and three overall) plus embedded slat diagram as suitable
for main paper. A single table is formed in sections by *bas* with
lines *mtd* within each section.
... | [
"def",
"table_merge_abbr",
"(",
"self",
",",
"plotpath",
",",
"subjoin",
")",
":",
"rowplan",
"=",
"[",
"'bas'",
",",
"'mtd'",
"]",
"columnplan",
"=",
"[",
"[",
"'l'",
",",
"r\"\"\"Method \\& Basis Set\"\"\"",
",",
"''",
",",
"textables",
".",
"label",
","... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L2910-L2937 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/_multivariate.py | python | multinomial_gen.entropy | (self, n, p) | return self._checkresult(term1 + term2, npcond, np.nan) | r"""
Compute the entropy of the multinomial distribution.
The entropy is computed using this expression:
.. math::
f(x) = - \log n! - n\sum_{i=1}^k p_i \log p_i +
\sum_{i=1}^k \sum_{x=0}^n \binom n x p_i^x(1-p_i)^{n-x} \log x!
Parameters
----------
... | r"""
Compute the entropy of the multinomial distribution. | [
"r",
"Compute",
"the",
"entropy",
"of",
"the",
"multinomial",
"distribution",
"."
] | def entropy(self, n, p):
r"""
Compute the entropy of the multinomial distribution.
The entropy is computed using this expression:
.. math::
f(x) = - \log n! - n\sum_{i=1}^k p_i \log p_i +
\sum_{i=1}^k \sum_{x=0}^n \binom n x p_i^x(1-p_i)^{n-x} \log x!
... | [
"def",
"entropy",
"(",
"self",
",",
"n",
",",
"p",
")",
":",
"n",
",",
"p",
",",
"npcond",
"=",
"self",
".",
"_process_parameters",
"(",
"n",
",",
"p",
")",
"x",
"=",
"np",
".",
"r_",
"[",
"1",
":",
"np",
".",
"max",
"(",
"n",
")",
"+",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_multivariate.py#L3158-L3196 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/supervisor.py | python | SVSummaryThread.__init__ | (self, sv, sess) | Create a SVSummaryThread.
Args:
sv: A `Supervisor`.
sess: A `Session`. | Create a SVSummaryThread. | [
"Create",
"a",
"SVSummaryThread",
"."
] | def __init__(self, sv, sess):
"""Create a SVSummaryThread.
Args:
sv: A `Supervisor`.
sess: A `Session`.
"""
super(SVSummaryThread, self).__init__(sv.coord, sv.save_summaries_secs)
self._sv = sv
self._sess = sess | [
"def",
"__init__",
"(",
"self",
",",
"sv",
",",
"sess",
")",
":",
"super",
"(",
"SVSummaryThread",
",",
"self",
")",
".",
"__init__",
"(",
"sv",
".",
"coord",
",",
"sv",
".",
"save_summaries_secs",
")",
"self",
".",
"_sv",
"=",
"sv",
"self",
".",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/supervisor.py#L980-L989 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/gluon/model_zoo/vision/resnet.py | python | resnet50_v2 | (**kwargs) | return get_resnet(2, 50, **kwargs) | r"""ResNet-50 V2 model from `"Identity Mappings in Deep Residual Networks"
<https://arxiv.org/abs/1603.05027>`_ paper.
Parameters
----------
pretrained : bool, default False
Whether to load the pretrained weights for model.
ctx : Context, default CPU
The context in which to load the... | r"""ResNet-50 V2 model from `"Identity Mappings in Deep Residual Networks"
<https://arxiv.org/abs/1603.05027>`_ paper. | [
"r",
"ResNet",
"-",
"50",
"V2",
"model",
"from",
"Identity",
"Mappings",
"in",
"Deep",
"Residual",
"Networks",
"<https",
":",
"//",
"arxiv",
".",
"org",
"/",
"abs",
"/",
"1603",
".",
"05027",
">",
"_",
"paper",
"."
] | def resnet50_v2(**kwargs):
r"""ResNet-50 V2 model from `"Identity Mappings in Deep Residual Networks"
<https://arxiv.org/abs/1603.05027>`_ paper.
Parameters
----------
pretrained : bool, default False
Whether to load the pretrained weights for model.
ctx : Context, default CPU
T... | [
"def",
"resnet50_v2",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"get_resnet",
"(",
"2",
",",
"50",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/gluon/model_zoo/vision/resnet.py#L492-L505 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py | python | pooling_nhwc_max_unsigned | (
I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW,
S.C),
K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]),
O=TensorDef(U, S.N, S.OH, S.OW, S.C, output=True),
strides=IndexAttrDef(S.SH, S.SW),
dilations=IndexAttrDef(S.DH, S.DW)) | Performs unsigned max pooling.
Numeric casting is performed on the input operand, promoting it to the same
data type as the accumulator/output. | Performs unsigned max pooling. | [
"Performs",
"unsigned",
"max",
"pooling",
"."
] | def pooling_nhwc_max_unsigned(
I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW,
S.C),
K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]),
O=TensorDef(U, S.N, S.OH, S.OW, S.C, output=True),
strides=IndexAttrDef(S.SH, S.SW),
dilations=IndexAttrDef(S.DH, S.DW... | [
"def",
"pooling_nhwc_max_unsigned",
"(",
"I",
"=",
"TensorDef",
"(",
"T1",
",",
"S",
".",
"N",
",",
"S",
".",
"OH",
"*",
"S",
".",
"SH",
"+",
"S",
".",
"KH",
"*",
"S",
".",
"DH",
",",
"S",
".",
"OW",
"*",
"S",
".",
"SW",
"+",
"S",
".",
"K... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L488-L504 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | PseudoDC.GetIdBounds | (*args, **kwargs) | return _gdi_.PseudoDC_GetIdBounds(*args, **kwargs) | GetIdBounds(self, int id) -> Rect
Returns the bounding rectangle previouly set with SetIdBounds. If
no bounds have been set, it returns wx.Rect(0,0,0,0). | GetIdBounds(self, int id) -> Rect | [
"GetIdBounds",
"(",
"self",
"int",
"id",
")",
"-",
">",
"Rect"
] | def GetIdBounds(*args, **kwargs):
"""
GetIdBounds(self, int id) -> Rect
Returns the bounding rectangle previouly set with SetIdBounds. If
no bounds have been set, it returns wx.Rect(0,0,0,0).
"""
return _gdi_.PseudoDC_GetIdBounds(*args, **kwargs) | [
"def",
"GetIdBounds",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_GetIdBounds",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L7680-L7687 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/math_ops.py | python | _sparse_dense_truediv | (sp_indices, sp_values, sp_shape, y, name=None) | Internal helper function for 'sp_t / dense_t'. | Internal helper function for 'sp_t / dense_t'. | [
"Internal",
"helper",
"function",
"for",
"sp_t",
"/",
"dense_t",
"."
] | def _sparse_dense_truediv(sp_indices, sp_values, sp_shape, y, name=None):
"""Internal helper function for 'sp_t / dense_t'."""
with ops.name_scope(name, "truediv",
[sp_indices, sp_values, sp_shape, y]) as name:
sp_values = ops.convert_to_tensor(sp_values, name="sp_values")
y = ops.conv... | [
"def",
"_sparse_dense_truediv",
"(",
"sp_indices",
",",
"sp_values",
",",
"sp_shape",
",",
"y",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"truediv\"",
",",
"[",
"sp_indices",
",",
"sp_values",
",",
"sp_shape"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/math_ops.py#L804-L823 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/__init__.py | python | Channel.__enter__ | (self) | Enters the runtime context related to the channel object. | Enters the runtime context related to the channel object. | [
"Enters",
"the",
"runtime",
"context",
"related",
"to",
"the",
"channel",
"object",
"."
] | def __enter__(self):
"""Enters the runtime context related to the channel object."""
raise NotImplementedError() | [
"def",
"__enter__",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L1071-L1073 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | HDFStore.keys | (self, include: str = "pandas") | Return a list of keys corresponding to objects stored in HDFStore.
Parameters
----------
include : str, default 'pandas'
When kind equals 'pandas' return pandas objects.
When kind equals 'native' return native HDF5 Table objects.
.. versionadded... | Return a list of keys corresponding to objects stored in HDFStore. | [
"Return",
"a",
"list",
"of",
"keys",
"corresponding",
"to",
"objects",
"stored",
"in",
"HDFStore",
"."
] | def keys(self, include: str = "pandas") -> list[str]:
"""
Return a list of keys corresponding to objects stored in HDFStore.
Parameters
----------
include : str, default 'pandas'
When kind equals 'pandas' return pandas objects.
When kind equals '... | [
"def",
"keys",
"(",
"self",
",",
"include",
":",
"str",
"=",
"\"pandas\"",
")",
"->",
"list",
"[",
"str",
"]",
":",
"if",
"include",
"==",
"\"pandas\"",
":",
"return",
"[",
"n",
".",
"_v_pathname",
"for",
"n",
"in",
"self",
".",
"groups",
"(",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L651-L683 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/session.py | python | Session.available_profiles | (self) | return self._session.available_profiles | The profiles available to the session credentials | The profiles available to the session credentials | [
"The",
"profiles",
"available",
"to",
"the",
"session",
"credentials"
] | def available_profiles(self):
"""
The profiles available to the session credentials
"""
return self._session.available_profiles | [
"def",
"available_profiles",
"(",
"self",
")",
":",
"return",
"self",
".",
"_session",
".",
"available_profiles"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/session.py#L110-L114 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Radiobutton.__init__ | (self, master=None, cnf={}, **kw) | Construct a radiobutton widget with the parent MASTER.
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, i... | Construct a radiobutton widget with the parent MASTER. | [
"Construct",
"a",
"radiobutton",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct a radiobutton widget with the parent MASTER.
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'radiobutton'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2766-L2776 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsVariationSelectorsSupplement | (code) | return ret | Check whether the character is part of
VariationSelectorsSupplement UCS Block | Check whether the character is part of
VariationSelectorsSupplement UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"VariationSelectorsSupplement",
"UCS",
"Block"
] | def uCSIsVariationSelectorsSupplement(code):
"""Check whether the character is part of
VariationSelectorsSupplement UCS Block """
ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code)
return ret | [
"def",
"uCSIsVariationSelectorsSupplement",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsVariationSelectorsSupplement",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2187-L2191 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/fused_abs_max1_impl.py | python | shape8 | (tik_instance, input_x_shape, input_x, res) | return tik_instance, res | shape8 | shape8 | [
"shape8"
] | def shape8(tik_instance, input_x_shape, input_x, res):
"""shape8"""
total_elements8 = 1
for val in input_x_shape:
total_elements8 *= val
blocks = 32
each_block_element = total_elements8 // blocks
with tik_instance.for_range(0, blocks, block_num=blocks) as block_index:
input_x_ub ... | [
"def",
"shape8",
"(",
"tik_instance",
",",
"input_x_shape",
",",
"input_x",
",",
"res",
")",
":",
"total_elements8",
"=",
"1",
"for",
"val",
"in",
"input_x_shape",
":",
"total_elements8",
"*=",
"val",
"blocks",
"=",
"32",
"each_block_element",
"=",
"total_elem... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/fused_abs_max1_impl.py#L392-L421 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/mongod_fuzzer_configs.py | python | fuzz_set_parameters | (seed, user_provided_params) | return utils.dump_yaml(ret), generate_eviction_configs(rng), generate_table_configs(rng), \
generate_table_configs(rng) | Randomly generate mongod configurations and wiredTigerConnectionString. | Randomly generate mongod configurations and wiredTigerConnectionString. | [
"Randomly",
"generate",
"mongod",
"configurations",
"and",
"wiredTigerConnectionString",
"."
] | def fuzz_set_parameters(seed, user_provided_params):
"""Randomly generate mongod configurations and wiredTigerConnectionString."""
rng = random.Random(seed)
ret = {}
params = [generate_flow_control_parameters(rng), generate_independent_parameters(rng)]
for dct in params:
for key, value in d... | [
"def",
"fuzz_set_parameters",
"(",
"seed",
",",
"user_provided_params",
")",
":",
"rng",
"=",
"random",
".",
"Random",
"(",
"seed",
")",
"ret",
"=",
"{",
"}",
"params",
"=",
"[",
"generate_flow_control_parameters",
"(",
"rng",
")",
",",
"generate_independent_p... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/mongod_fuzzer_configs.py#L96-L110 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/threading.py | python | Condition.notify | (self, n=1) | Wake up one or more threads waiting on this condition, if any.
If the calling thread has not acquired the lock when this method is
called, a RuntimeError is raised.
This method wakes up at most n of the threads waiting for the condition
variable; it is a no-op if no threads are waiting... | Wake up one or more threads waiting on this condition, if any. | [
"Wake",
"up",
"one",
"or",
"more",
"threads",
"waiting",
"on",
"this",
"condition",
"if",
"any",
"."
] | def notify(self, n=1):
"""Wake up one or more threads waiting on this condition, if any.
If the calling thread has not acquired the lock when this method is
called, a RuntimeError is raised.
This method wakes up at most n of the threads waiting for the condition
variable; it is... | [
"def",
"notify",
"(",
"self",
",",
"n",
"=",
"1",
")",
":",
"if",
"not",
"self",
".",
"_is_owned",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"\"cannot notify on un-acquired lock\"",
")",
"all_waiters",
"=",
"self",
".",
"_waiters",
"waiters_to_notify",
"=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/threading.py#L335-L356 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/util/set.py | python | contains | (small, large) | return True | Returns true iff all elements of 'small' exist in 'large'. | Returns true iff all elements of 'small' exist in 'large'. | [
"Returns",
"true",
"iff",
"all",
"elements",
"of",
"small",
"exist",
"in",
"large",
"."
] | def contains (small, large):
""" Returns true iff all elements of 'small' exist in 'large'.
"""
small = to_seq (small)
large = to_seq (large)
for s in small:
if not s in large:
return False
return True | [
"def",
"contains",
"(",
"small",
",",
"large",
")",
":",
"small",
"=",
"to_seq",
"(",
"small",
")",
"large",
"=",
"to_seq",
"(",
"large",
")",
"for",
"s",
"in",
"small",
":",
"if",
"not",
"s",
"in",
"large",
":",
"return",
"False",
"return",
"True"... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/util/set.py#L27-L36 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/optimizer_v2/optimizer_v2.py | python | _is_dynamic | (value) | return False | Returns true if __init__ arg `value` should be re-evaluated each step. | Returns true if __init__ arg `value` should be re-evaluated each step. | [
"Returns",
"true",
"if",
"__init__",
"arg",
"value",
"should",
"be",
"re",
"-",
"evaluated",
"each",
"step",
"."
] | def _is_dynamic(value):
"""Returns true if __init__ arg `value` should be re-evaluated each step."""
if callable(value):
return True
# Don't need to do anything special in graph mode, since dynamic values
# will propagate correctly automatically.
# TODO(josh11b): Add per-replica caching across steps using... | [
"def",
"_is_dynamic",
"(",
"value",
")",
":",
"if",
"callable",
"(",
"value",
")",
":",
"return",
"True",
"# Don't need to do anything special in graph mode, since dynamic values",
"# will propagate correctly automatically.",
"# TODO(josh11b): Add per-replica caching across steps usi... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/optimizer_v2/optimizer_v2.py#L185-L196 | |
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/clusterfuzz/js_fuzzer/tools/run_one.py | python | run | (fuzz_file, flag_file) | Executes the differential-fuzzing harness foozzie with one fuzz test. | Executes the differential-fuzzing harness foozzie with one fuzz test. | [
"Executes",
"the",
"differential",
"-",
"fuzzing",
"harness",
"foozzie",
"with",
"one",
"fuzz",
"test",
"."
] | def run(fuzz_file, flag_file):
"""Executes the differential-fuzzing harness foozzie with one fuzz test."""
with open(flag_file) as f:
flags = f.read().split(' ')
args = [FOOZZIE, '--random-seed=%d' % random_seed()] + flags + [fuzz_file]
cmd = ' '.join(args)
try:
output = subprocess.check_output(cmd, s... | [
"def",
"run",
"(",
"fuzz_file",
",",
"flag_file",
")",
":",
"with",
"open",
"(",
"flag_file",
")",
"as",
"f",
":",
"flags",
"=",
"f",
".",
"read",
"(",
")",
".",
"split",
"(",
"' '",
")",
"args",
"=",
"[",
"FOOZZIE",
",",
"'--random-seed=%d'",
"%",... | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/clusterfuzz/js_fuzzer/tools/run_one.py#L51-L61 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/device_utils.py | python | DeviceUtils.TakeScreenshot | (self, host_path=None, timeout=None, retries=None) | return host_path | Takes a screenshot of the device.
Args:
host_path: A string containing the path on the host to save the
screenshot to. If None, a file name in the current
directory will be generated.
timeout: timeout in seconds
retries: number of retries
Returns:
The ... | Takes a screenshot of the device. | [
"Takes",
"a",
"screenshot",
"of",
"the",
"device",
"."
] | def TakeScreenshot(self, host_path=None, timeout=None, retries=None):
"""Takes a screenshot of the device.
Args:
host_path: A string containing the path on the host to save the
screenshot to. If None, a file name in the current
directory will be generated.
timeout:... | [
"def",
"TakeScreenshot",
"(",
"self",
",",
"host_path",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"retries",
"=",
"None",
")",
":",
"if",
"not",
"host_path",
":",
"host_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"'screenshot-%s-%s.png'",
"%... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L2082-L2107 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py | python | Telnet._expect_with_select | (self, list, timeout=None) | return (-1, None, text) | Read until one from a list of a regular expressions matches.
The timeout is implemented using select.select(). | Read until one from a list of a regular expressions matches. | [
"Read",
"until",
"one",
"from",
"a",
"list",
"of",
"a",
"regular",
"expressions",
"matches",
"."
] | def _expect_with_select(self, list, timeout=None):
"""Read until one from a list of a regular expressions matches.
The timeout is implemented using select.select().
"""
re = None
list = list[:]
indices = range(len(list))
for i in indices:
if not hasat... | [
"def",
"_expect_with_select",
"(",
"self",
",",
"list",
",",
"timeout",
"=",
"None",
")",
":",
"re",
"=",
"None",
"list",
"=",
"list",
"[",
":",
"]",
"indices",
"=",
"range",
"(",
"len",
"(",
"list",
")",
")",
"for",
"i",
"in",
"indices",
":",
"i... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L717-L755 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/notebook/callback.py | python | PandasLogger.callback_args | (self) | return {
'batch_end_callback': self.train_cb,
'eval_end_callback': self.eval_cb,
'epoch_end_callback': self.epoch_cb,
} | returns **kwargs parameters for model.fit()
to enable all callbacks. e.g.
model.fit(X=train, eval_data=test, **pdlogger.callback_args()) | returns **kwargs parameters for model.fit()
to enable all callbacks. e.g.
model.fit(X=train, eval_data=test, **pdlogger.callback_args()) | [
"returns",
"**",
"kwargs",
"parameters",
"for",
"model",
".",
"fit",
"()",
"to",
"enable",
"all",
"callbacks",
".",
"e",
".",
"g",
".",
"model",
".",
"fit",
"(",
"X",
"=",
"train",
"eval_data",
"=",
"test",
"**",
"pdlogger",
".",
"callback_args",
"()",... | def callback_args(self):
"""returns **kwargs parameters for model.fit()
to enable all callbacks. e.g.
model.fit(X=train, eval_data=test, **pdlogger.callback_args())
"""
return {
'batch_end_callback': self.train_cb,
'eval_end_callback': self.eval_cb,
... | [
"def",
"callback_args",
"(",
"self",
")",
":",
"return",
"{",
"'batch_end_callback'",
":",
"self",
".",
"train_cb",
",",
"'eval_end_callback'",
":",
"self",
".",
"eval_cb",
",",
"'epoch_end_callback'",
":",
"self",
".",
"epoch_cb",
",",
"}"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/notebook/callback.py#L188-L197 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Geometry.PointOnSurface | (self, *args) | return _ogr.Geometry_PointOnSurface(self, *args) | r"""
PointOnSurface(Geometry self) -> Geometry
OGRGeometryH
OGR_G_PointOnSurface(OGRGeometryH hGeom)
Returns a point guaranteed to lie on the surface.
This method relates to the SFCOM ISurface::get_PointOnSurface() method
however the current implementation based on GEOS... | r"""
PointOnSurface(Geometry self) -> Geometry
OGRGeometryH
OGR_G_PointOnSurface(OGRGeometryH hGeom) | [
"r",
"PointOnSurface",
"(",
"Geometry",
"self",
")",
"-",
">",
"Geometry",
"OGRGeometryH",
"OGR_G_PointOnSurface",
"(",
"OGRGeometryH",
"hGeom",
")"
] | def PointOnSurface(self, *args):
r"""
PointOnSurface(Geometry self) -> Geometry
OGRGeometryH
OGR_G_PointOnSurface(OGRGeometryH hGeom)
Returns a point guaranteed to lie on the surface.
This method relates to the SFCOM ISurface::get_PointOnSurface() method
however... | [
"def",
"PointOnSurface",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Geometry_PointOnSurface",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L7181-L7207 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | GenericDirCtrl.SelectPaths | (*args, **kwargs) | return _controls_.GenericDirCtrl_SelectPaths(*args, **kwargs) | SelectPaths(self, wxArrayString paths) | SelectPaths(self, wxArrayString paths) | [
"SelectPaths",
"(",
"self",
"wxArrayString",
"paths",
")"
] | def SelectPaths(*args, **kwargs):
"""SelectPaths(self, wxArrayString paths)"""
return _controls_.GenericDirCtrl_SelectPaths(*args, **kwargs) | [
"def",
"SelectPaths",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"GenericDirCtrl_SelectPaths",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5705-L5707 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.add_prefix | (self, prefix: str, flags='paosr', prf='med') | Add a valid prefix to the Network Data. | Add a valid prefix to the Network Data. | [
"Add",
"a",
"valid",
"prefix",
"to",
"the",
"Network",
"Data",
"."
] | def add_prefix(self, prefix: str, flags='paosr', prf='med'):
"""Add a valid prefix to the Network Data."""
self.execute_command(f'prefix add {prefix} {flags} {prf}') | [
"def",
"add_prefix",
"(",
"self",
",",
"prefix",
":",
"str",
",",
"flags",
"=",
"'paosr'",
",",
"prf",
"=",
"'med'",
")",
":",
"self",
".",
"execute_command",
"(",
"f'prefix add {prefix} {flags} {prf}'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L1531-L1533 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | plugins/migration/backend/migration.py | python | MigrationSource.reverseEngineer | (self) | Perform reverse engineering of selected schemas into the migration.sourceCatalog node | Perform reverse engineering of selected schemas into the migration.sourceCatalog node | [
"Perform",
"reverse",
"engineering",
"of",
"selected",
"schemas",
"into",
"the",
"migration",
".",
"sourceCatalog",
"node"
] | def reverseEngineer(self):
"""Perform reverse engineering of selected schemas into the migration.sourceCatalog node"""
self.connect()
grt.send_info("Reverse engineering %s from %s" % (", ".join(self.selectedSchemataNames), self.selectedCatalogName))
self.state.sourceCatalog = se... | [
"def",
"reverseEngineer",
"(",
"self",
")",
":",
"self",
".",
"connect",
"(",
")",
"grt",
".",
"send_info",
"(",
"\"Reverse engineering %s from %s\"",
"%",
"(",
"\", \"",
".",
"join",
"(",
"self",
".",
"selectedSchemataNames",
")",
",",
"self",
".",
"selecte... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/migration/backend/migration.py#L359-L364 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | PyDataViewModelNotifier.__init__ | (self, *args, **kwargs) | __init__(self) -> PyDataViewModelNotifier
This class is a version of `DataViewModelNotifier` that has been
engineered to know how to reflect the C++ virtual method calls to
Python methods in the derived class. Use this class as your base
class instead of `DataViewModelNotifier`. | __init__(self) -> PyDataViewModelNotifier | [
"__init__",
"(",
"self",
")",
"-",
">",
"PyDataViewModelNotifier"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> PyDataViewModelNotifier
This class is a version of `DataViewModelNotifier` that has been
engineered to know how to reflect the C++ virtual method calls to
Python methods in the derived class. Use this class as your bas... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_dataview",
".",
"PyDataViewModelNotifier_swiginit",
"(",
"self",
",",
"_dataview",
".",
"new_PyDataViewModelNotifier",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L304-L314 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/tools/stats-viewer.py | python | ChromeCounter.Value | (self) | return self.data.IntAt(self.value_offset) | Return the integer value of this counter. | Return the integer value of this counter. | [
"Return",
"the",
"integer",
"value",
"of",
"this",
"counter",
"."
] | def Value(self):
"""Return the integer value of this counter."""
return self.data.IntAt(self.value_offset) | [
"def",
"Value",
"(",
"self",
")",
":",
"return",
"self",
".",
"data",
".",
"IntAt",
"(",
"self",
".",
"value_offset",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/stats-viewer.py#L398-L400 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py | python | WorkingSet.add | (self, dist, entry=None, insert=True, replace=False) | Add `dist` to working set, associated with `entry`
If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
On exit from this routine, `entry` is added to the end of the working
set's ``.entries`` (if it wasn't already present).
`dist` is only added to the working set if ... | Add `dist` to working set, associated with `entry` | [
"Add",
"dist",
"to",
"working",
"set",
"associated",
"with",
"entry"
] | def add(self, dist, entry=None, insert=True, replace=False):
"""Add `dist` to working set, associated with `entry`
If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
On exit from this routine, `entry` is added to the end of the working
set's ``.entries`` (if it wasn'... | [
"def",
"add",
"(",
"self",
",",
"dist",
",",
"entry",
"=",
"None",
",",
"insert",
"=",
"True",
",",
"replace",
"=",
"False",
")",
":",
"if",
"insert",
":",
"dist",
".",
"insert_on",
"(",
"self",
".",
"entries",
",",
"entry",
",",
"replace",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py#L686-L714 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py | python | Context.is_snan | (self, a) | return a.is_snan() | Return True if the operand is a signaling NaN;
otherwise return False.
>>> ExtendedContext.is_snan(Decimal('2.50'))
False
>>> ExtendedContext.is_snan(Decimal('NaN'))
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
>>> ExtendedContext.is_snan(1)
... | Return True if the operand is a signaling NaN;
otherwise return False. | [
"Return",
"True",
"if",
"the",
"operand",
"is",
"a",
"signaling",
"NaN",
";",
"otherwise",
"return",
"False",
"."
] | def is_snan(self, a):
"""Return True if the operand is a signaling NaN;
otherwise return False.
>>> ExtendedContext.is_snan(Decimal('2.50'))
False
>>> ExtendedContext.is_snan(Decimal('NaN'))
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
... | [
"def",
"is_snan",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"is_snan",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L4607-L4621 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py | python | TFRecordToMR._get_data_from_tfrecord_sample | (self, iterator) | return ms_dict | convert tfrecord sample to mindrecord sample | convert tfrecord sample to mindrecord sample | [
"convert",
"tfrecord",
"sample",
"to",
"mindrecord",
"sample"
] | def _get_data_from_tfrecord_sample(self, iterator):
"""convert tfrecord sample to mindrecord sample"""
ms_dict = {}
sample = iterator.get_next()
for key, val in sample.items():
cast_key = _cast_name(key)
if cast_key in self.scalar_set:
self._get_da... | [
"def",
"_get_data_from_tfrecord_sample",
"(",
"self",
",",
"iterator",
")",
":",
"ms_dict",
"=",
"{",
"}",
"sample",
"=",
"iterator",
".",
"get_next",
"(",
")",
"for",
"key",
",",
"val",
"in",
"sample",
".",
"items",
"(",
")",
":",
"cast_key",
"=",
"_c... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py#L244-L259 | |
SmileiPIC/Smilei | 07dcb51200029e10f626e1546558c1ae7599c8b1 | happi/_Utils.py | python | multiPlot | (*Diags, **kwargs) | multiplot(Diag1, Diag2, ...,
shape=None,
movie="", fps=15, dpi=200, saveAs=None,
skipAnimation=False
)
Plots simultaneously several diagnostics.
Parameters:
-----------
Diag1, Diag2, ... : Several objects of classes 'Scalar', 'Field', 'Probe' or 'Particl... | multiplot(Diag1, Diag2, ...,
shape=None,
movie="", fps=15, dpi=200, saveAs=None,
skipAnimation=False
) | [
"multiplot",
"(",
"Diag1",
"Diag2",
"...",
"shape",
"=",
"None",
"movie",
"=",
"fps",
"=",
"15",
"dpi",
"=",
"200",
"saveAs",
"=",
"None",
"skipAnimation",
"=",
"False",
")"
] | def multiPlot(*Diags, **kwargs):
""" multiplot(Diag1, Diag2, ...,
shape=None,
movie="", fps=15, dpi=200, saveAs=None,
skipAnimation=False
)
Plots simultaneously several diagnostics.
Parameters:
-----------
Diag1, Diag2, ... : Several objects of classes ... | [
"def",
"multiPlot",
"(",
"*",
"Diags",
",",
"*",
"*",
"kwargs",
")",
":",
"mp",
"=",
"_multiPlotUtil",
"(",
"*",
"Diags",
",",
"*",
"*",
"kwargs",
")",
"if",
"mp",
".",
"sameAxes",
"and",
"Diags",
"[",
"0",
"]",
".",
"dim",
"==",
"0",
":",
"mp"... | https://github.com/SmileiPIC/Smilei/blob/07dcb51200029e10f626e1546558c1ae7599c8b1/happi/_Utils.py#L627-L653 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/path.py/path.py | python | Path.in_place | (self, mode='r', buffering=-1, encoding=None, errors=None,
newline=None, backup_extension=None) | A context in which a file may be re-written in-place with new content.
Yields a tuple of :samp:`({readable}, {writable})` file objects, where `writable`
replaces `readable`.
If an exception occurs, the old file is restored, removing the
written data.
Mode *must not* use ``'w'`... | A context in which a file may be re-written in-place with new content. | [
"A",
"context",
"in",
"which",
"a",
"file",
"may",
"be",
"re",
"-",
"written",
"in",
"-",
"place",
"with",
"new",
"content",
"."
] | def in_place(self, mode='r', buffering=-1, encoding=None, errors=None,
newline=None, backup_extension=None):
"""
A context in which a file may be re-written in-place with new content.
Yields a tuple of :samp:`({readable}, {writable})` file objects, where `writable`
replaces ... | [
"def",
"in_place",
"(",
"self",
",",
"mode",
"=",
"'r'",
",",
"buffering",
"=",
"-",
"1",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"newline",
"=",
"None",
",",
"backup_extension",
"=",
"None",
")",
":",
"import",
"io",
"if",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/path.py/path.py#L1418-L1496 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py | python | PublishManagerHelper.GetVhBaseUrl | (self, vh_url, vh_ssl) | Builds a Virtual Host base URL.
If the vh_url is scheme://host:port/path, then it extracts
scheme://host:port to build a base URL, otherwise (vh_url is a path,
e.g. /public) it builds a base URL based on information in Apache config
and FQDN.
Args:
vh_url: virtual host URL - /path or scheme:... | Builds a Virtual Host base URL. | [
"Builds",
"a",
"Virtual",
"Host",
"base",
"URL",
"."
] | def GetVhBaseUrl(self, vh_url, vh_ssl):
"""Builds a Virtual Host base URL.
If the vh_url is scheme://host:port/path, then it extracts
scheme://host:port to build a base URL, otherwise (vh_url is a path,
e.g. /public) it builds a base URL based on information in Apache config
and FQDN.
Args:
... | [
"def",
"GetVhBaseUrl",
"(",
"self",
",",
"vh_url",
",",
"vh_ssl",
")",
":",
"url_parse_res",
"=",
"urlparse",
".",
"urlparse",
"(",
"vh_url",
")",
"if",
"url_parse_res",
".",
"scheme",
"and",
"url_parse_res",
".",
"netloc",
":",
"return",
"\"{0}://{1}\"",
".... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py#L1516-L1560 | ||
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/ResponseProvider.py | python | Payload.response_code | (self) | return self.__response_code | Response code to send to the client. | Response code to send to the client. | [
"Response",
"code",
"to",
"send",
"to",
"the",
"client",
"."
] | def response_code(self):
"""
Response code to send to the client.
"""
return self.__response_code | [
"def",
"response_code",
"(",
"self",
")",
":",
"return",
"self",
".",
"__response_code"
] | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/ResponseProvider.py#L18-L22 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/usdviewApi.py | python | UsdviewApi.property | (self) | return self.__appController._dataModel.selection.getFocusProp() | The focus property from the property selection. | The focus property from the property selection. | [
"The",
"focus",
"property",
"from",
"the",
"property",
"selection",
"."
] | def property(self):
"""The focus property from the property selection."""
return self.__appController._dataModel.selection.getFocusProp() | [
"def",
"property",
"(",
"self",
")",
":",
"return",
"self",
".",
"__appController",
".",
"_dataModel",
".",
"selection",
".",
"getFocusProp",
"(",
")"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/usdviewApi.py#L149-L152 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/base64.py | python | a85decode | (b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v') | return result | Decode the Ascii85 encoded bytes-like object or ASCII string b.
foldspaces is a flag that specifies whether the 'y' short sequence should be
accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
not supported by the "standard" Adobe encoding.
adobe controls whether the input seq... | Decode the Ascii85 encoded bytes-like object or ASCII string b. | [
"Decode",
"the",
"Ascii85",
"encoded",
"bytes",
"-",
"like",
"object",
"or",
"ASCII",
"string",
"b",
"."
] | def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
"""Decode the Ascii85 encoded bytes-like object or ASCII string b.
foldspaces is a flag that specifies whether the 'y' short sequence should be
accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
not ... | [
"def",
"a85decode",
"(",
"b",
",",
"*",
",",
"foldspaces",
"=",
"False",
",",
"adobe",
"=",
"False",
",",
"ignorechars",
"=",
"b' \\t\\n\\r\\v'",
")",
":",
"b",
"=",
"_bytes_from_decode_data",
"(",
"b",
")",
"if",
"adobe",
":",
"if",
"not",
"b",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/base64.py#L344-L412 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/representation/painter.py | python | MplPainter.cross | (self, x, y, half_width, **kwargs) | return self.axes.add_patch(PathPatch(Path(verts, codes), **kwargs)) | Draw a cross at the given location
:param x: X coordinate of the center
:param y: Y coordinate of the center
:param half_width: Half-width of cross
:param kwargs: Additional matplotlib properties to pass to the call | Draw a cross at the given location
:param x: X coordinate of the center
:param y: Y coordinate of the center
:param half_width: Half-width of cross
:param kwargs: Additional matplotlib properties to pass to the call | [
"Draw",
"a",
"cross",
"at",
"the",
"given",
"location",
":",
"param",
"x",
":",
"X",
"coordinate",
"of",
"the",
"center",
":",
"param",
"y",
":",
"Y",
"coordinate",
"of",
"the",
"center",
":",
"param",
"half_width",
":",
"Half",
"-",
"width",
"of",
"... | def cross(self, x, y, half_width, **kwargs):
"""Draw a cross at the given location
:param x: X coordinate of the center
:param y: Y coordinate of the center
:param half_width: Half-width of cross
:param kwargs: Additional matplotlib properties to pass to the call
"""
... | [
"def",
"cross",
"(",
"self",
",",
"x",
",",
"y",
",",
"half_width",
",",
"*",
"*",
"kwargs",
")",
":",
"verts",
"=",
"(",
"(",
"x",
"-",
"half_width",
",",
"y",
"+",
"half_width",
")",
",",
"(",
"x",
"+",
"half_width",
",",
"y",
"-",
"half_widt... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/representation/painter.py#L123-L133 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py | python | PredefinedSplit._iter_test_masks | (self) | Generates boolean masks corresponding to test sets. | Generates boolean masks corresponding to test sets. | [
"Generates",
"boolean",
"masks",
"corresponding",
"to",
"test",
"sets",
"."
] | def _iter_test_masks(self):
"""Generates boolean masks corresponding to test sets."""
for f in self.unique_folds:
test_index = np.where(self.test_fold == f)[0]
test_mask = np.zeros(len(self.test_fold), dtype=np.bool)
test_mask[test_index] = True
yield test... | [
"def",
"_iter_test_masks",
"(",
"self",
")",
":",
"for",
"f",
"in",
"self",
".",
"unique_folds",
":",
"test_index",
"=",
"np",
".",
"where",
"(",
"self",
".",
"test_fold",
"==",
"f",
")",
"[",
"0",
"]",
"test_mask",
"=",
"np",
".",
"zeros",
"(",
"l... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py#L1464-L1470 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_handlers.py | python | OutgoingMessageHandler.on_released | (self, event: Event) | Called when the remote peer releases an outgoing message. Note
that this may be in response to either the ``RELEASE`` or ``MODIFIED``
state as defined by the AMQP specification.
:param event: The underlying event object. Use this to obtain further
information on the event. | Called when the remote peer releases an outgoing message. Note
that this may be in response to either the ``RELEASE`` or ``MODIFIED``
state as defined by the AMQP specification. | [
"Called",
"when",
"the",
"remote",
"peer",
"releases",
"an",
"outgoing",
"message",
".",
"Note",
"that",
"this",
"may",
"be",
"in",
"response",
"to",
"either",
"the",
"RELEASE",
"or",
"MODIFIED",
"state",
"as",
"defined",
"by",
"the",
"AMQP",
"specification"... | def on_released(self, event: Event):
"""
Called when the remote peer releases an outgoing message. Note
that this may be in response to either the ``RELEASE`` or ``MODIFIED``
state as defined by the AMQP specification.
:param event: The underlying event object. Use this to obtai... | [
"def",
"on_released",
"(",
"self",
",",
"event",
":",
"Event",
")",
":",
"if",
"self",
".",
"delegate",
"is",
"not",
"None",
":",
"_dispatch",
"(",
"self",
".",
"delegate",
",",
"'on_released'",
",",
"event",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_handlers.py#L112-L122 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextEvent.SetY | (*args, **kwargs) | return _stc.StyledTextEvent_SetY(*args, **kwargs) | SetY(self, int val) | SetY(self, int val) | [
"SetY",
"(",
"self",
"int",
"val",
")"
] | def SetY(*args, **kwargs):
"""SetY(self, int val)"""
return _stc.StyledTextEvent_SetY(*args, **kwargs) | [
"def",
"SetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_SetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L7090-L7092 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Menu.entryconfigure | (self, index, cnf=None, **kw) | return self._configure(('entryconfigure', index), cnf, kw) | Configure a menu item at INDEX. | Configure a menu item at INDEX. | [
"Configure",
"a",
"menu",
"item",
"at",
"INDEX",
"."
] | def entryconfigure(self, index, cnf=None, **kw):
"""Configure a menu item at INDEX."""
return self._configure(('entryconfigure', index), cnf, kw) | [
"def",
"entryconfigure",
"(",
"self",
",",
"index",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_configure",
"(",
"(",
"'entryconfigure'",
",",
"index",
")",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2727-L2729 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/sentence-similarity-ii.py | python | Solution.areSentencesSimilarTwo | (self, words1, words2, pairs) | return all(w1 == w2 or
w1 in lookup and w2 in lookup and
union_find.find_set(lookup[w1]) == union_find.find_set(lookup[w2])
for w1, w2 in itertools.izip(words1, words2)) | :type words1: List[str]
:type words2: List[str]
:type pairs: List[List[str]]
:rtype: bool | :type words1: List[str]
:type words2: List[str]
:type pairs: List[List[str]]
:rtype: bool | [
":",
"type",
"words1",
":",
"List",
"[",
"str",
"]",
":",
"type",
"words2",
":",
"List",
"[",
"str",
"]",
":",
"type",
"pairs",
":",
"List",
"[",
"List",
"[",
"str",
"]]",
":",
"rtype",
":",
"bool"
] | def areSentencesSimilarTwo(self, words1, words2, pairs):
"""
:type words1: List[str]
:type words2: List[str]
:type pairs: List[List[str]]
:rtype: bool
"""
if len(words1) != len(words2): return False
lookup = {}
union_find = UnionFind(2 * len(pairs... | [
"def",
"areSentencesSimilarTwo",
"(",
"self",
",",
"words1",
",",
"words2",
",",
"pairs",
")",
":",
"if",
"len",
"(",
"words1",
")",
"!=",
"len",
"(",
"words2",
")",
":",
"return",
"False",
"lookup",
"=",
"{",
"}",
"union_find",
"=",
"UnionFind",
"(",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/sentence-similarity-ii.py#L25-L45 | |
google/shaka-player-embedded | dabbeb5b47cc257b37b9a254661546352aaf0afe | shaka/tools/idl/exposed_type_generator.py | python | _GeneratePublicSource | (results, f, public_header, internal_header) | Generates the source for the public C++ type. | Generates the source for the public C++ type. | [
"Generates",
"the",
"source",
"for",
"the",
"public",
"C",
"++",
"type",
"."
] | def _GeneratePublicSource(results, f, public_header, internal_header):
"""Generates the source for the public C++ type."""
other_types = [t.name for t in results.types]
writer = embed_utils.CodeWriter(f)
writer.Write('#include "%s"', public_header)
writer.Write()
writer.Write('#include "%s"', internal_heade... | [
"def",
"_GeneratePublicSource",
"(",
"results",
",",
"f",
",",
"public_header",
",",
"internal_header",
")",
":",
"other_types",
"=",
"[",
"t",
".",
"name",
"for",
"t",
"in",
"results",
".",
"types",
"]",
"writer",
"=",
"embed_utils",
".",
"CodeWriter",
"(... | https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/idl/exposed_type_generator.py#L243-L322 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Tools/demo/life.py | python | LifeBoard.set | (self, y, x) | Set a cell to the live state | Set a cell to the live state | [
"Set",
"a",
"cell",
"to",
"the",
"live",
"state"
] | def set(self, y, x):
"""Set a cell to the live state"""
if x < 0 or self.X <= x or y < 0 or self.Y <= y:
raise ValueError("Coordinates out of range %i,%i" % (y, x))
self.state[x, y] = 1 | [
"def",
"set",
"(",
"self",
",",
"y",
",",
"x",
")",
":",
"if",
"x",
"<",
"0",
"or",
"self",
".",
"X",
"<=",
"x",
"or",
"y",
"<",
"0",
"or",
"self",
".",
"Y",
"<=",
"y",
":",
"raise",
"ValueError",
"(",
"\"Coordinates out of range %i,%i\"",
"%",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Tools/demo/life.py#L62-L66 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/quote_fill_ratio.py | python | QuoteFillRatio.dealt_mavg7 | (self) | return self._dealt_mavg7 | Gets the dealt_mavg7 of this QuoteFillRatio. # noqa: E501
:return: The dealt_mavg7 of this QuoteFillRatio. # noqa: E501
:rtype: float | Gets the dealt_mavg7 of this QuoteFillRatio. # noqa: E501 | [
"Gets",
"the",
"dealt_mavg7",
"of",
"this",
"QuoteFillRatio",
".",
"#",
"noqa",
":",
"E501"
] | def dealt_mavg7(self):
"""Gets the dealt_mavg7 of this QuoteFillRatio. # noqa: E501
:return: The dealt_mavg7 of this QuoteFillRatio. # noqa: E501
:rtype: float
"""
return self._dealt_mavg7 | [
"def",
"dealt_mavg7",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dealt_mavg7"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/quote_fill_ratio.py#L187-L194 | |
hzl123456/LibyuvDemo | d02b6500d0cf111bdd8778c56983154e6d14bdb4 | libyuv/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py | python | CalculateChangedDeps | (libyuv_deps, new_cr_deps) | return sorted(result) | Calculate changed deps entries based on entries defined in the libyuv DEPS
file:
- If a shared dependency with the Chromium DEPS file: roll it to the same
revision as Chromium (i.e. entry in the new_cr_deps dict)
- If it's a Chromium sub-directory, roll it to the HEAD revision (notice
this mea... | Calculate changed deps entries based on entries defined in the libyuv DEPS
file:
- If a shared dependency with the Chromium DEPS file: roll it to the same
revision as Chromium (i.e. entry in the new_cr_deps dict)
- If it's a Chromium sub-directory, roll it to the HEAD revision (notice
this mea... | [
"Calculate",
"changed",
"deps",
"entries",
"based",
"on",
"entries",
"defined",
"in",
"the",
"libyuv",
"DEPS",
"file",
":",
"-",
"If",
"a",
"shared",
"dependency",
"with",
"the",
"Chromium",
"DEPS",
"file",
":",
"roll",
"it",
"to",
"the",
"same",
"revision... | def CalculateChangedDeps(libyuv_deps, new_cr_deps):
"""
Calculate changed deps entries based on entries defined in the libyuv DEPS
file:
- If a shared dependency with the Chromium DEPS file: roll it to the same
revision as Chromium (i.e. entry in the new_cr_deps dict)
- If it's a Chromium sub-dir... | [
"def",
"CalculateChangedDeps",
"(",
"libyuv_deps",
",",
"new_cr_deps",
")",
":",
"result",
"=",
"[",
"]",
"libyuv_entries",
"=",
"BuildDepsentryDict",
"(",
"libyuv_deps",
")",
"new_cr_entries",
"=",
"BuildDepsentryDict",
"(",
"new_cr_deps",
")",
"for",
"path",
","... | https://github.com/hzl123456/LibyuvDemo/blob/d02b6500d0cf111bdd8778c56983154e6d14bdb4/libyuv/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py#L219-L258 | |
google/perfetto | fe68c7a7f7657aa71ced68efb126dcac4107c745 | python/perfetto/batch_trace_processor/api.py | python | BatchTraceProcessor.execute_and_flatten | (self, fn: Callable[[TraceProcessor], pd.DataFrame]
) | return df.reset_index(drop=True) | Executes the provided function and flattens the result.
The execution happens in parallel across all the trace processor
instances owned by this object and the returned Pandas dataframes are
flattened into a single dataframe.
Args:
fn: The function to execute which returns a Pandas dataframe.
... | Executes the provided function and flattens the result. | [
"Executes",
"the",
"provided",
"function",
"and",
"flattens",
"the",
"result",
"."
] | def execute_and_flatten(self, fn: Callable[[TraceProcessor], pd.DataFrame]
) -> pd.DataFrame:
"""Executes the provided function and flattens the result.
The execution happens in parallel across all the trace processor
instances owned by this object and the returned Pandas dataframe... | [
"def",
"execute_and_flatten",
"(",
"self",
",",
"fn",
":",
"Callable",
"[",
"[",
"TraceProcessor",
"]",
",",
"pd",
".",
"DataFrame",
"]",
")",
"->",
"pd",
".",
"DataFrame",
":",
"def",
"wrapped",
"(",
"pair",
":",
"Tuple",
"[",
"TraceProcessor",
",",
"... | https://github.com/google/perfetto/blob/fe68c7a7f7657aa71ced68efb126dcac4107c745/python/perfetto/batch_trace_processor/api.py#L237-L263 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyEventsHTMLVisitor.py | python | InstanceTopologyEventsHTMLVisitor.namespaceVisit | (self, obj) | Defined to generate namespace code within a file.
Also any pre-condition code is generated.
@param args: the instance of the concrete element to operation on. | Defined to generate namespace code within a file.
Also any pre-condition code is generated. | [
"Defined",
"to",
"generate",
"namespace",
"code",
"within",
"a",
"file",
".",
"Also",
"any",
"pre",
"-",
"condition",
"code",
"is",
"generated",
"."
] | def namespaceVisit(self, obj):
"""
Defined to generate namespace code within a file.
Also any pre-condition code is generated.
@param args: the instance of the concrete element to operation on.
""" | [
"def",
"namespaceVisit",
"(",
"self",
",",
"obj",
")",
":"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyEventsHTMLVisitor.py#L146-L151 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_run_setup.py | python | RunSetupWidget.__init__ | (self, parent=None, state=None, settings=None, data_type=None) | return | Initialization | Initialization | [
"Initialization"
] | def __init__(self, parent=None, state=None, settings=None, data_type=None):
""" Initialization
"""
super(RunSetupWidget, self).__init__(parent, state, settings, data_type=data_type)
class RunSetFrame(QFrame):
""" Define class linked to UI Frame
"""
d... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
"=",
"None",
",",
"state",
"=",
"None",
",",
"settings",
"=",
"None",
",",
"data_type",
"=",
"None",
")",
":",
"super",
"(",
"RunSetupWidget",
",",
"self",
")",
".",
"__init__",
"(",
"parent",
",",
"stat... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_run_setup.py#L43-L75 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/spreadsheets/client.py | python | ListQuery.__init__ | (self, order_by=None, reverse=None, sq=None, **kwargs) | Adds List-feed specific query parameters to a request.
Args:
order_by: str Specifies what column to use in ordering the entries in
the feed. By position (the default): 'position' returns
rows in the order in which they appear in the GUI. Row 1, then
row 2, then... | Adds List-feed specific query parameters to a request. | [
"Adds",
"List",
"-",
"feed",
"specific",
"query",
"parameters",
"to",
"a",
"request",
"."
] | def __init__(self, order_by=None, reverse=None, sq=None, **kwargs):
"""Adds List-feed specific query parameters to a request.
Args:
order_by: str Specifies what column to use in ordering the entries in
the feed. By position (the default): 'position' returns
rows in the ord... | [
"def",
"__init__",
"(",
"self",
",",
"order_by",
"=",
"None",
",",
"reverse",
"=",
"None",
",",
"sq",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"gdata",
".",
"client",
".",
"Query",
".",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")"... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/spreadsheets/client.py#L336-L362 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/utilities/load_utils.py | python | flatten_run_list | (run_list) | return new_list | run list might be [1,2,[3,4]] where the [3,4] are co-added | run list might be [1,2,[3,4]] where the [3,4] are co-added | [
"run",
"list",
"might",
"be",
"[",
"1",
"2",
"[",
"3",
"4",
"]]",
"where",
"the",
"[",
"3",
"4",
"]",
"are",
"co",
"-",
"added"
] | def flatten_run_list(run_list):
"""
run list might be [1,2,[3,4]] where the [3,4] are co-added
"""
new_list = []
for run_item in run_list:
if isinstance(run_item, int):
new_list += [run_item]
elif isinstance(run_item, list):
for run in run_item:
... | [
"def",
"flatten_run_list",
"(",
"run_list",
")",
":",
"new_list",
"=",
"[",
"]",
"for",
"run_item",
"in",
"run_list",
":",
"if",
"isinstance",
"(",
"run_item",
",",
"int",
")",
":",
"new_list",
"+=",
"[",
"run_item",
"]",
"elif",
"isinstance",
"(",
"run_... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/utilities/load_utils.py#L305-L316 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_COMMAND_AUDIT_INFO.GetUnionSelector | (self) | return TPM_ST.ATTEST_COMMAND_AUDIT | TpmUnion method | TpmUnion method | [
"TpmUnion",
"method"
] | def GetUnionSelector(self): # TPM_ST
""" TpmUnion method """
return TPM_ST.ATTEST_COMMAND_AUDIT | [
"def",
"GetUnionSelector",
"(",
"self",
")",
":",
"# TPM_ST",
"return",
"TPM_ST",
".",
"ATTEST_COMMAND_AUDIT"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5203-L5205 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/attrs/attr/_make.py | python | Attribute.evolve | (self, **changes) | return new | Copy *self* and apply *changes*.
This works similarly to `attr.evolve` but that function does not work
with ``Attribute``.
It is mainly meant to be used for `transform-fields`.
.. versionadded:: 20.3.0 | Copy *self* and apply *changes*. | [
"Copy",
"*",
"self",
"*",
"and",
"apply",
"*",
"changes",
"*",
"."
] | def evolve(self, **changes):
"""
Copy *self* and apply *changes*.
This works similarly to `attr.evolve` but that function does not work
with ``Attribute``.
It is mainly meant to be used for `transform-fields`.
.. versionadded:: 20.3.0
"""
new = copy.cop... | [
"def",
"evolve",
"(",
"self",
",",
"*",
"*",
"changes",
")",
":",
"new",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"new",
".",
"_setattrs",
"(",
"changes",
".",
"items",
"(",
")",
")",
"return",
"new"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/_make.py#L2616-L2631 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/byteflow.py | python | TraceRunner.op_BUILD_SLICE | (self, state, inst) | slice(TOS1, TOS) or slice(TOS2, TOS1, TOS) | slice(TOS1, TOS) or slice(TOS2, TOS1, TOS) | [
"slice",
"(",
"TOS1",
"TOS",
")",
"or",
"slice",
"(",
"TOS2",
"TOS1",
"TOS",
")"
] | def op_BUILD_SLICE(self, state, inst):
"""
slice(TOS1, TOS) or slice(TOS2, TOS1, TOS)
"""
argc = inst.arg
if argc == 2:
tos = state.pop()
tos1 = state.pop()
start = tos1
stop = tos
step = None
elif argc == 3:
... | [
"def",
"op_BUILD_SLICE",
"(",
"self",
",",
"state",
",",
"inst",
")",
":",
"argc",
"=",
"inst",
".",
"arg",
"if",
"argc",
"==",
"2",
":",
"tos",
"=",
"state",
".",
"pop",
"(",
")",
"tos1",
"=",
"state",
".",
"pop",
"(",
")",
"start",
"=",
"tos1... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/byteflow.py#L528-L553 | ||
tinyobjloader/tinyobjloader | 8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93 | deps/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/tinyobjloader/tinyobjloader/blob/8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93/deps/cpplint.py#L3812-L3864 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py | python | Differ._qformat | (self, aline, bline, atags, btags) | r"""
Format "?" output and deal with leading tabs.
Example:
>>> d = Differ()
>>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
... ' ^ ^ ^ ', ' ^ ^ ^ ')
>>> for line in results: print repr(line)
...
'- \t... | r"""
Format "?" output and deal with leading tabs. | [
"r",
"Format",
"?",
"output",
"and",
"deal",
"with",
"leading",
"tabs",
"."
] | def _qformat(self, aline, bline, atags, btags):
r"""
Format "?" output and deal with leading tabs.
Example:
>>> d = Differ()
>>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
... ' ^ ^ ^ ', ' ^ ^ ^ ')
>>> for lin... | [
"def",
"_qformat",
"(",
"self",
",",
"aline",
",",
"bline",
",",
"atags",
",",
"btags",
")",
":",
"# Can hurt, but will probably help most of the time.",
"common",
"=",
"min",
"(",
"_count_leading",
"(",
"aline",
",",
"\"\\t\"",
")",
",",
"_count_leading",
"(",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py#L1056-L1087 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/DICOMLib/DICOMPlugin.py | python | DICOMPlugin.cacheLoadables | (self,files,loadables) | Helper method to store the results of examining a list
of files for later quick access | Helper method to store the results of examining a list
of files for later quick access | [
"Helper",
"method",
"to",
"store",
"the",
"results",
"of",
"examining",
"a",
"list",
"of",
"files",
"for",
"later",
"quick",
"access"
] | def cacheLoadables(self,files,loadables):
""" Helper method to store the results of examining a list
of files for later quick access"""
key = self.hashFiles(files)
self.loadableCache[key] = loadables | [
"def",
"cacheLoadables",
"(",
"self",
",",
"files",
",",
"loadables",
")",
":",
"key",
"=",
"self",
".",
"hashFiles",
"(",
"files",
")",
"self",
".",
"loadableCache",
"[",
"key",
"]",
"=",
"loadables"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOMLib/DICOMPlugin.py#L108-L112 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlBookRecord.__init__ | (self, *args, **kwargs) | __init__(self, String bookfile, String basepath, String title, String start) -> HtmlBookRecord | __init__(self, String bookfile, String basepath, String title, String start) -> HtmlBookRecord | [
"__init__",
"(",
"self",
"String",
"bookfile",
"String",
"basepath",
"String",
"title",
"String",
"start",
")",
"-",
">",
"HtmlBookRecord"
] | def __init__(self, *args, **kwargs):
"""__init__(self, String bookfile, String basepath, String title, String start) -> HtmlBookRecord"""
_html.HtmlBookRecord_swiginit(self,_html.new_HtmlBookRecord(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlBookRecord_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlBookRecord",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1408-L1410 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/freeview.py | python | fvoverlay | (surface, overlay, background=True, opts='', verbose=False, **kwargs) | Freeview wrapper to quickly load an overlay onto a surface.
Args:
surface: An existing surface filename.
overlay: An existing volume filename, a numpy array, or a nibabel image to apply as an overlay.
background: Run freeview as a background process. Defaults to True.
verbose: Print... | Freeview wrapper to quickly load an overlay onto a surface. | [
"Freeview",
"wrapper",
"to",
"quickly",
"load",
"an",
"overlay",
"onto",
"a",
"surface",
"."
] | def fvoverlay(surface, overlay, background=True, opts='', verbose=False, **kwargs):
'''Freeview wrapper to quickly load an overlay onto a surface.
Args:
surface: An existing surface filename.
overlay: An existing volume filename, a numpy array, or a nibabel image to apply as an overlay.
... | [
"def",
"fvoverlay",
"(",
"surface",
",",
"overlay",
",",
"background",
"=",
"True",
",",
"opts",
"=",
"''",
",",
"verbose",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"fv",
"=",
"Freeview",
"(",
")",
"fv",
".",
"surf",
"(",
"surface",
",",
... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/freeview.py#L450-L462 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | docs/sphinxext/mantiddoc/directives/categories.py | python | to_unix_style_path | (path) | return path.replace("\\", "/").replace("//", "/") | Replaces any backslashes in the given string with forward slashes
and replace consecutive forward slashes with a single forward slash.
Arguments:
path: A string possibly containing backslashes | Replaces any backslashes in the given string with forward slashes
and replace consecutive forward slashes with a single forward slash. | [
"Replaces",
"any",
"backslashes",
"in",
"the",
"given",
"string",
"with",
"forward",
"slashes",
"and",
"replace",
"consecutive",
"forward",
"slashes",
"with",
"a",
"single",
"forward",
"slash",
"."
] | def to_unix_style_path(path):
"""
Replaces any backslashes in the given string with forward slashes
and replace consecutive forward slashes with a single forward slash.
Arguments:
path: A string possibly containing backslashes
"""
return path.replace("\\", "/").replace("//", "/") | [
"def",
"to_unix_style_path",
"(",
"path",
")",
":",
"return",
"path",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"/\"",
")",
".",
"replace",
"(",
"\"//\"",
",",
"\"/\"",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/docs/sphinxext/mantiddoc/directives/categories.py#L307-L315 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiPaneInfo.Top | (self) | return self | Sets the pane dock position to the top of the frame.
:note: This is the same thing as calling :meth:`~AuiPaneInfo.Direction` with ``AUI_DOCK_TOP`` as
parameter. | Sets the pane dock position to the top of the frame. | [
"Sets",
"the",
"pane",
"dock",
"position",
"to",
"the",
"top",
"of",
"the",
"frame",
"."
] | def Top(self):
"""
Sets the pane dock position to the top of the frame.
:note: This is the same thing as calling :meth:`~AuiPaneInfo.Direction` with ``AUI_DOCK_TOP`` as
parameter.
"""
self.dock_direction = AUI_DOCK_TOP
return self | [
"def",
"Top",
"(",
"self",
")",
":",
"self",
".",
"dock_direction",
"=",
"AUI_DOCK_TOP",
"return",
"self"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L932-L941 | |
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | scripts/cpp_lint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L792-L794 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py | python | DatetimeLikeArrayMixin.asi8 | (self) | return self._ndarray.view("i8") | Integer representation of the values.
Returns
-------
ndarray
An ndarray with int64 dtype. | Integer representation of the values. | [
"Integer",
"representation",
"of",
"the",
"values",
"."
] | def asi8(self) -> np.ndarray:
"""
Integer representation of the values.
Returns
-------
ndarray
An ndarray with int64 dtype.
"""
# do not cache or you'll create a memory leak
return self._ndarray.view("i8") | [
"def",
"asi8",
"(",
"self",
")",
"->",
"np",
".",
"ndarray",
":",
"# do not cache or you'll create a memory leak",
"return",
"self",
".",
"_ndarray",
".",
"view",
"(",
"\"i8\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py#L277-L287 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | FontMapper.Set | (*args, **kwargs) | return _gdi_.FontMapper_Set(*args, **kwargs) | Set(FontMapper mapper) -> FontMapper | Set(FontMapper mapper) -> FontMapper | [
"Set",
"(",
"FontMapper",
"mapper",
")",
"-",
">",
"FontMapper"
] | def Set(*args, **kwargs):
"""Set(FontMapper mapper) -> FontMapper"""
return _gdi_.FontMapper_Set(*args, **kwargs) | [
"def",
"Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"FontMapper_Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2015-L2017 | |
ros-planning/moveit2 | dd240ef6fd8b9932a7a53964140f2952786187a9 | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.get_goal_joint_tolerance | (self) | return self._g.get_goal_joint_tolerance() | Get the tolerance for achieving a joint goal (distance for each joint variable) | Get the tolerance for achieving a joint goal (distance for each joint variable) | [
"Get",
"the",
"tolerance",
"for",
"achieving",
"a",
"joint",
"goal",
"(",
"distance",
"for",
"each",
"joint",
"variable",
")"
] | def get_goal_joint_tolerance(self):
""" Get the tolerance for achieving a joint goal (distance for each joint variable) """
return self._g.get_goal_joint_tolerance() | [
"def",
"get_goal_joint_tolerance",
"(",
"self",
")",
":",
"return",
"self",
".",
"_g",
".",
"get_goal_joint_tolerance",
"(",
")"
] | https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L436-L438 | |
mixxxdj/mixxx | b519aba1d967a39c63b5f5c56cf5c3a95addec28 | tools/make_xone.py | python | get_group_name | (channel, key) | return "[Channel%d]" % channel | Optionally munge group name if an EQ | Optionally munge group name if an EQ | [
"Optionally",
"munge",
"group",
"name",
"if",
"an",
"EQ"
] | def get_group_name(channel, key):
"""Optionally munge group name if an EQ"""
if "filter" in key:
return "[EqualizerRack1_[Channel%d]_Effect1]" % channel
return "[Channel%d]" % channel | [
"def",
"get_group_name",
"(",
"channel",
",",
"key",
")",
":",
"if",
"\"filter\"",
"in",
"key",
":",
"return",
"\"[EqualizerRack1_[Channel%d]_Effect1]\"",
"%",
"channel",
"return",
"\"[Channel%d]\"",
"%",
"channel"
] | https://github.com/mixxxdj/mixxx/blob/b519aba1d967a39c63b5f5c56cf5c3a95addec28/tools/make_xone.py#L422-L426 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/stepper.py | python | NodeStepper.closure_elements | (self) | return self._closure_elements | Get a name list of the graph elements of the stepper.
Returns:
(list of str): names of the graph elements (i.e., nodes and tensors) in
the transitive closure of the stepper, in a random order. | Get a name list of the graph elements of the stepper. | [
"Get",
"a",
"name",
"list",
"of",
"the",
"graph",
"elements",
"of",
"the",
"stepper",
"."
] | def closure_elements(self):
"""Get a name list of the graph elements of the stepper.
Returns:
(list of str): names of the graph elements (i.e., nodes and tensors) in
the transitive closure of the stepper, in a random order.
"""
return self._closure_elements | [
"def",
"closure_elements",
"(",
"self",
")",
":",
"return",
"self",
".",
"_closure_elements"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/stepper.py#L345-L353 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.