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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/contact.py | python | equilibriumTorques | (robot,holdList,fext=(0,0,-9.8),internalTorques=None,norm=0) | return (res[0],[f[i*3:i*3+3] for i in range(len(f)//3)]) | Solves for the torques / forces that keep the robot balanced against
gravity.
Args:
robot (RobotModel): the robot, posed in its current configuration
holdList (list of ``Hold``): a list of Holds.
fext (list of 3 floats, optional): the external force (e.g., gravity)
internalTor... | Solves for the torques / forces that keep the robot balanced against
gravity.
Args:
robot (RobotModel): the robot, posed in its current configuration
holdList (list of ``Hold``): a list of Holds.
fext (list of 3 floats, optional): the external force (e.g., gravity)
internalTor... | [
"Solves",
"for",
"the",
"torques",
"/",
"forces",
"that",
"keep",
"the",
"robot",
"balanced",
"against",
"gravity",
".",
"Args",
":",
"robot",
"(",
"RobotModel",
")",
":",
"the",
"robot",
"posed",
"in",
"its",
"current",
"configuration",
"holdList",
"(",
"... | def equilibriumTorques(robot,holdList,fext=(0,0,-9.8),internalTorques=None,norm=0):
""" Solves for the torques / forces that keep the robot balanced against
gravity.
Args:
robot (RobotModel): the robot, posed in its current configuration
holdList (list of ``Hold``): a list of Holds.
... | [
"def",
"equilibriumTorques",
"(",
"robot",
",",
"holdList",
",",
"fext",
"=",
"(",
"0",
",",
"0",
",",
"-",
"9.8",
")",
",",
"internalTorques",
"=",
"None",
",",
"norm",
"=",
"0",
")",
":",
"links",
"=",
"sum",
"(",
"[",
"[",
"h",
".",
"link",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/contact.py#L154-L181 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/rsa/rsa/transform.py | python | bytes2int | (raw_bytes) | return int(binascii.hexlify(raw_bytes), 16) | r'''Converts a list of bytes or an 8-bit string to an integer.
When using unicode strings, encode it to some encoding like UTF8 first.
>>> (((128 * 256) + 64) * 256) + 15
8405007
>>> bytes2int('\x80@\x0f')
8405007 | r'''Converts a list of bytes or an 8-bit string to an integer. | [
"r",
"Converts",
"a",
"list",
"of",
"bytes",
"or",
"an",
"8",
"-",
"bit",
"string",
"to",
"an",
"integer",
"."
] | def bytes2int(raw_bytes):
r'''Converts a list of bytes or an 8-bit string to an integer.
When using unicode strings, encode it to some encoding like UTF8 first.
>>> (((128 * 256) + 64) * 256) + 15
8405007
>>> bytes2int('\x80@\x0f')
8405007
'''
return int(binascii.hexlify(raw_bytes), ... | [
"def",
"bytes2int",
"(",
"raw_bytes",
")",
":",
"return",
"int",
"(",
"binascii",
".",
"hexlify",
"(",
"raw_bytes",
")",
",",
"16",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/transform.py#L39-L51 | |
facebook/folly | 744a0a698074d1b013813065fe60f545aa2c9b94 | build/fbcode_builder/getdeps/dyndeps.py | python | WinDeps.compute_dependency_paths_fast | (self, build_dir) | return sorted(dep_dirs) | Similar to compute_dependency_paths(), but rather than actually scanning
binaries, just add all library paths from the specified installation
directories. This is much faster than scanning the binaries, but may result in
more paths being returned than actually necessary. | Similar to compute_dependency_paths(), but rather than actually scanning
binaries, just add all library paths from the specified installation
directories. This is much faster than scanning the binaries, but may result in
more paths being returned than actually necessary. | [
"Similar",
"to",
"compute_dependency_paths",
"()",
"but",
"rather",
"than",
"actually",
"scanning",
"binaries",
"just",
"add",
"all",
"library",
"paths",
"from",
"the",
"specified",
"installation",
"directories",
".",
"This",
"is",
"much",
"faster",
"than",
"scann... | def compute_dependency_paths_fast(self, build_dir):
"""Similar to compute_dependency_paths(), but rather than actually scanning
binaries, just add all library paths from the specified installation
directories. This is much faster than scanning the binaries, but may result in
more paths ... | [
"def",
"compute_dependency_paths_fast",
"(",
"self",
",",
"build_dir",
")",
":",
"dep_dirs",
"=",
"set",
"(",
")",
"for",
"inst_dir",
"in",
"self",
".",
"install_dirs",
":",
"for",
"subdir",
"in",
"OBJECT_SUBDIRS",
":",
"path",
"=",
"os",
".",
"path",
".",... | https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps/dyndeps.py#L266-L280 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | tools/blade/src/blade/cc_targets.py | python | CcTarget._prepare_to_generate_rule | (self) | Should be overridden. | Should be overridden. | [
"Should",
"be",
"overridden",
"."
] | def _prepare_to_generate_rule(self):
"""Should be overridden. """
self._check_deprecated_deps()
self._clone_env() | [
"def",
"_prepare_to_generate_rule",
"(",
"self",
")",
":",
"self",
".",
"_check_deprecated_deps",
"(",
")",
"self",
".",
"_clone_env",
"(",
")"
] | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/cc_targets.py#L88-L91 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/stepper.py | python | NodeStepper._prepare_cont_call_dump_path_and_run_options | (self) | return dump_path, run_options | Prepare the dump path and RunOptions for next cont() call.
Returns:
dump_path: (str) Directory path to which the intermediate tensor will be
dumped.
run_options: (config_pb2.RunOptions) The RunOptions containing the tensor
watch options for this graph. | Prepare the dump path and RunOptions for next cont() call. | [
"Prepare",
"the",
"dump",
"path",
"and",
"RunOptions",
"for",
"next",
"cont",
"()",
"call",
"."
] | def _prepare_cont_call_dump_path_and_run_options(self):
"""Prepare the dump path and RunOptions for next cont() call.
Returns:
dump_path: (str) Directory path to which the intermediate tensor will be
dumped.
run_options: (config_pb2.RunOptions) The RunOptions containing the tensor
w... | [
"def",
"_prepare_cont_call_dump_path_and_run_options",
"(",
"self",
")",
":",
"run_options",
"=",
"config_pb2",
".",
"RunOptions",
"(",
")",
"dump_path",
"=",
"self",
".",
"_cont_call_dump_path",
"(",
")",
"for",
"element_name",
"in",
"self",
".",
"_closure_elements... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/stepper.py#L695-L714 | |
nasa/meshNetwork | ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c | python/mesh/generic/serialComm.py | python | SerialComm.bufferTxMsg | (self, msgBytes) | Add bytes to transmission buffer. | Add bytes to transmission buffer. | [
"Add",
"bytes",
"to",
"transmission",
"buffer",
"."
] | def bufferTxMsg(self, msgBytes):
"""Add bytes to transmission buffer."""
if msgBytes:
msgOut = self.msgParser.encodeMsg(msgBytes)
self.radio.bufferTxMsg(msgOut) | [
"def",
"bufferTxMsg",
"(",
"self",
",",
"msgBytes",
")",
":",
"if",
"msgBytes",
":",
"msgOut",
"=",
"self",
".",
"msgParser",
".",
"encodeMsg",
"(",
"msgBytes",
")",
"self",
".",
"radio",
".",
"bufferTxMsg",
"(",
"msgOut",
")"
] | https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/serialComm.py#L126-L130 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/pyproj/__init__.py | python | Proj.is_geocent | (self) | return _Proj.is_geocent(self) | returns True if projection in geocentric (x/y) coordinates | returns True if projection in geocentric (x/y) coordinates | [
"returns",
"True",
"if",
"projection",
"in",
"geocentric",
"(",
"x",
"/",
"y",
")",
"coordinates"
] | def is_geocent(self):
"""returns True if projection in geocentric (x/y) coordinates"""
return _Proj.is_geocent(self) | [
"def",
"is_geocent",
"(",
"self",
")",
":",
"return",
"_Proj",
".",
"is_geocent",
"(",
"self",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/pyproj/__init__.py#L219-L221 | |
sailing-pmls/pmls-caffe | 49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a | scripts/cpp_lint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L797-L807 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Rect.SetHeight | (*args, **kwargs) | return _core_.Rect_SetHeight(*args, **kwargs) | SetHeight(self, int h) | SetHeight(self, int h) | [
"SetHeight",
"(",
"self",
"int",
"h",
")"
] | def SetHeight(*args, **kwargs):
"""SetHeight(self, int h)"""
return _core_.Rect_SetHeight(*args, **kwargs) | [
"def",
"SetHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_SetHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1297-L1299 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training.py | python | _tpu_multi_host_concat | (v, strategy) | return concat(ordered_replicas) | Correctly order TPU PerReplica objects. | Correctly order TPU PerReplica objects. | [
"Correctly",
"order",
"TPU",
"PerReplica",
"objects",
"."
] | def _tpu_multi_host_concat(v, strategy):
"""Correctly order TPU PerReplica objects."""
replicas = strategy.unwrap(v)
# When distributed datasets are created from Tensors / NumPy,
# TPUStrategy.experimental_distribute_dataset shards data in
# (Replica, Host) order, and TPUStrategy.unwrap returns it in
# (Hos... | [
"def",
"_tpu_multi_host_concat",
"(",
"v",
",",
"strategy",
")",
":",
"replicas",
"=",
"strategy",
".",
"unwrap",
"(",
"v",
")",
"# When distributed datasets are created from Tensors / NumPy,",
"# TPUStrategy.experimental_distribute_dataset shards data in",
"# (Replica, Host) ord... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training.py#L2859-L2871 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py | python | get_num_gpus | () | return _get_num_nvidia_gpus() | Returns the number of GPUs visible on the current node.
Currently only implemented for NVIDIA GPUs. | Returns the number of GPUs visible on the current node. | [
"Returns",
"the",
"number",
"of",
"GPUs",
"visible",
"on",
"the",
"current",
"node",
"."
] | def get_num_gpus():
"""Returns the number of GPUs visible on the current node.
Currently only implemented for NVIDIA GPUs.
"""
return _get_num_nvidia_gpus() | [
"def",
"get_num_gpus",
"(",
")",
":",
"return",
"_get_num_nvidia_gpus",
"(",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py#L155-L160 | |
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | close-call-reporter/python/iot_close_call_reporter/storage.py | python | store_message | (payload, method="PUT") | Publish message to remote data store. | Publish message to remote data store. | [
"Publish",
"message",
"to",
"remote",
"data",
"store",
"."
] | def store_message(payload, method="PUT"):
"""
Publish message to remote data store.
"""
if not DATA_STORE_CONFIG:
return
server = DATA_STORE_CONFIG.server
auth_token = DATA_STORE_CONFIG.auth_token
headers = {
"X-Auth-Token": auth_token
}
def perform_request():
... | [
"def",
"store_message",
"(",
"payload",
",",
"method",
"=",
"\"PUT\"",
")",
":",
"if",
"not",
"DATA_STORE_CONFIG",
":",
"return",
"server",
"=",
"DATA_STORE_CONFIG",
".",
"server",
"auth_token",
"=",
"DATA_STORE_CONFIG",
".",
"auth_token",
"headers",
"=",
"{",
... | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/close-call-reporter/python/iot_close_call_reporter/storage.py#L27-L65 | ||
LLNL/RAJA | 8e8cc96cbccda2bfc33b14b57a8591b2cf9ca342 | scripts/spack_packages/chai/package.py | python | cmake_cache_option | (name, boolean_value, comment="") | return 'set(%s %s CACHE BOOL "%s")\n\n' % (name,value,comment) | Generate a string for a cmake configuration option | Generate a string for a cmake configuration option | [
"Generate",
"a",
"string",
"for",
"a",
"cmake",
"configuration",
"option"
] | def cmake_cache_option(name, boolean_value, comment=""):
"""Generate a string for a cmake configuration option"""
value = "ON" if boolean_value else "OFF"
return 'set(%s %s CACHE BOOL "%s")\n\n' % (name,value,comment) | [
"def",
"cmake_cache_option",
"(",
"name",
",",
"boolean_value",
",",
"comment",
"=",
"\"\"",
")",
":",
"value",
"=",
"\"ON\"",
"if",
"boolean_value",
"else",
"\"OFF\"",
"return",
"'set(%s %s CACHE BOOL \"%s\")\\n\\n'",
"%",
"(",
"name",
",",
"value",
",",
"comme... | https://github.com/LLNL/RAJA/blob/8e8cc96cbccda2bfc33b14b57a8591b2cf9ca342/scripts/spack_packages/chai/package.py#L27-L31 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/networking/02-time-synced-connection/server.py | python | GameServerRepository.__init__ | (self) | initialise the server class | initialise the server class | [
"initialise",
"the",
"server",
"class"
] | def __init__(self):
"""initialise the server class"""
# get the port number from the configuration file
# if it doesn't exist, we use 4400 as the default
tcpPort = ConfigVariableInt('server-port', 4400).getValue()
# list of all needed .dc files
dcFileNames = ['../direct... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# get the port number from the configuration file",
"# if it doesn't exist, we use 4400 as the default",
"tcpPort",
"=",
"ConfigVariableInt",
"(",
"'server-port'",
",",
"4400",
")",
".",
"getValue",
"(",
")",
"# list of all needed .d... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/02-time-synced-connection/server.py#L16-L28 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewListCtrl.GetItemData | (*args, **kwargs) | return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs) | GetItemData(self, DataViewItem item) -> UIntPtr | GetItemData(self, DataViewItem item) -> UIntPtr | [
"GetItemData",
"(",
"self",
"DataViewItem",
"item",
")",
"-",
">",
"UIntPtr"
] | def GetItemData(*args, **kwargs):
"""GetItemData(self, DataViewItem item) -> UIntPtr"""
return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs) | [
"def",
"GetItemData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_GetItemData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2205-L2207 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py | python | WhileContext._init_from_proto | (self, context_def, import_scope=None) | Creates a new `WhileContext` from protocol buffer.
Args:
context_def: `WhileContextDef` protocol buffer.
import_scope: Optional `string`. Name scope to add. | Creates a new `WhileContext` from protocol buffer. | [
"Creates",
"a",
"new",
"WhileContext",
"from",
"protocol",
"buffer",
"."
] | def _init_from_proto(self, context_def, import_scope=None):
"""Creates a new `WhileContext` from protocol buffer.
Args:
context_def: `WhileContextDef` protocol buffer.
import_scope: Optional `string`. Name scope to add.
"""
assert isinstance(context_def, control_flow_pb2.WhileContextDef)
... | [
"def",
"_init_from_proto",
"(",
"self",
",",
"context_def",
",",
"import_scope",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"context_def",
",",
"control_flow_pb2",
".",
"WhileContextDef",
")",
"# Create from context_def.",
"g",
"=",
"ops",
".",
"get_defau... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py#L1474-L1526 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridInterface.GetPropertyValue | (*args, **kwargs) | return _propgrid.PropertyGridInterface_GetPropertyValue(*args, **kwargs) | GetPropertyValue(self, PGPropArg id) -> wxVariant | GetPropertyValue(self, PGPropArg id) -> wxVariant | [
"GetPropertyValue",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"wxVariant"
] | def GetPropertyValue(*args, **kwargs):
"""GetPropertyValue(self, PGPropArg id) -> wxVariant"""
return _propgrid.PropertyGridInterface_GetPropertyValue(*args, **kwargs) | [
"def",
"GetPropertyValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetPropertyValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L1245-L1247 | |
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddPropertiesForField | (field, cls) | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're constructing. | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"and",
"(",
"in",
"the",
"case",
"of",
"non",
"-",
"repeated",
"scalar",
"fields",
")",
"directly",
"set",
"the"... | def _AddPropertiesForField(field, cls):
"""Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're ... | [
"def",
"_AddPropertiesForField",
"(",
"field",
",",
"cls",
")",
":",
"# Catch it if we add other types that we should",
"# handle specially here.",
"assert",
"_FieldDescriptor",
".",
"MAX_CPPTYPE",
"==",
"10",
"constant_name",
"=",
"field",
".",
"name",
".",
"upper",
"(... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L420-L442 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/CompressiblePotentialFlowApplication/python_scripts/level_set_remeshing_process.py | python | LevelSetRemeshingProcess._RefineMesh | (self) | This function remeshes the main_model_part according to the distance, using the MMG process from the MeshingApplication.
In order to perform the refinement, it is needed to calculate the distance gradient, the initial nodal_h and the level_set metric. | This function remeshes the main_model_part according to the distance, using the MMG process from the MeshingApplication.
In order to perform the refinement, it is needed to calculate the distance gradient, the initial nodal_h and the level_set metric. | [
"This",
"function",
"remeshes",
"the",
"main_model_part",
"according",
"to",
"the",
"distance",
"using",
"the",
"MMG",
"process",
"from",
"the",
"MeshingApplication",
".",
"In",
"order",
"to",
"perform",
"the",
"refinement",
"it",
"is",
"needed",
"to",
"calculat... | def _RefineMesh(self):
''' This function remeshes the main_model_part according to the distance, using the MMG process from the MeshingApplication.
In order to perform the refinement, it is needed to calculate the distance gradient, the initial nodal_h and the level_set metric.
'''
i... | [
"def",
"_RefineMesh",
"(",
"self",
")",
":",
"ini_time",
"=",
"time",
".",
"time",
"(",
")",
"local_gradient",
"=",
"KratosMultiphysics",
".",
"ComputeNodalGradientProcess2D",
"(",
"self",
".",
"main_model_part",
",",
"KratosMultiphysics",
".",
"DISTANCE",
",",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/CompressiblePotentialFlowApplication/python_scripts/level_set_remeshing_process.py#L150-L178 | ||
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/chart/widget.py | python | ChartCursor._mouse_moved | (self, evt: tuple) | Callback function when mouse is moved. | Callback function when mouse is moved. | [
"Callback",
"function",
"when",
"mouse",
"is",
"moved",
"."
] | def _mouse_moved(self, evt: tuple) -> None:
"""
Callback function when mouse is moved.
"""
if not self._manager.get_count():
return
# First get current mouse point
pos = evt
for plot_name, view in self._views.items():
rect = view.sceneBou... | [
"def",
"_mouse_moved",
"(",
"self",
",",
"evt",
":",
"tuple",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"_manager",
".",
"get_count",
"(",
")",
":",
"return",
"# First get current mouse point",
"pos",
"=",
"evt",
"for",
"plot_name",
",",
"view",
... | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/widget.py#L405-L428 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py | python | SSLProtocol.pause_writing | (self) | Called when the low-level transport's buffer goes over
the high-water mark. | Called when the low-level transport's buffer goes over
the high-water mark. | [
"Called",
"when",
"the",
"low",
"-",
"level",
"transport",
"s",
"buffer",
"goes",
"over",
"the",
"high",
"-",
"water",
"mark",
"."
] | def pause_writing(self):
"""Called when the low-level transport's buffer goes over
the high-water mark.
"""
self._app_protocol.pause_writing() | [
"def",
"pause_writing",
"(",
"self",
")",
":",
"self",
".",
"_app_protocol",
".",
"pause_writing",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py#L508-L512 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py | python | FakeFile.__init__ | (self, name, st_mode=stat.S_IFREG | PERM_DEF_FILE,
contents=None) | init.
Args:
name: name of the file/directory, without parent path information
st_mode: the stat.S_IF* constant representing the file type (i.e.
stat.S_IFREG, stat.SIFDIR)
contents: the contents of the filesystem object; should be a string for
regular files, and a list of other ... | init. | [
"init",
"."
] | def __init__(self, name, st_mode=stat.S_IFREG | PERM_DEF_FILE,
contents=None):
"""init.
Args:
name: name of the file/directory, without parent path information
st_mode: the stat.S_IF* constant representing the file type (i.e.
stat.S_IFREG, stat.SIFDIR)
contents: the ... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"st_mode",
"=",
"stat",
".",
"S_IFREG",
"|",
"PERM_DEF_FILE",
",",
"contents",
"=",
"None",
")",
":",
"self",
".",
"name",
"=",
"name",
"self",
".",
"st_mode",
"=",
"st_mode",
"self",
".",
"contents",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L182-L210 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/ctrlbox.py | python | SegmentBar.OnPaint | (self, evt) | Paint the control | Paint the control | [
"Paint",
"the",
"control"
] | def OnPaint(self, evt):
"""Paint the control"""
dc = wx.AutoBufferedPaintDCFactory(self)
gc = wx.GCDC(dc)
# Setup
dc.SetBrush(wx.TRANSPARENT_BRUSH)
gc.SetBrush(wx.TRANSPARENT_BRUSH)
gc.SetFont(self.GetFont())
gc.SetBackgroundMode(wx.TRANSPARENT)
g... | [
"def",
"OnPaint",
"(",
"self",
",",
"evt",
")",
":",
"dc",
"=",
"wx",
".",
"AutoBufferedPaintDCFactory",
"(",
"self",
")",
"gc",
"=",
"wx",
".",
"GCDC",
"(",
"dc",
")",
"# Setup",
"dc",
".",
"SetBrush",
"(",
"wx",
".",
"TRANSPARENT_BRUSH",
")",
"gc",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/ctrlbox.py#L1073-L1099 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | BrightCtrl.OnPaint | (self, event) | Handles the ``wx.EVT_PAINT`` for :class:`BrightCtrl`.
:param `event`: a :class:`PaintEvent` event to be processed. | Handles the ``wx.EVT_PAINT`` for :class:`BrightCtrl`. | [
"Handles",
"the",
"wx",
".",
"EVT_PAINT",
"for",
":",
"class",
":",
"BrightCtrl",
"."
] | def OnPaint(self, event):
"""
Handles the ``wx.EVT_PAINT`` for :class:`BrightCtrl`.
:param `event`: a :class:`PaintEvent` event to be processed.
"""
dc = wx.AutoBufferedPaintDC(self)
dc.SetBackground(wx.Brush(self.GetParent().GetBackgroundColour()))
dc.Clear()
... | [
"def",
"OnPaint",
"(",
"self",
",",
"event",
")",
":",
"dc",
"=",
"wx",
".",
"AutoBufferedPaintDC",
"(",
"self",
")",
"dc",
".",
"SetBackground",
"(",
"wx",
".",
"Brush",
"(",
"self",
".",
"GetParent",
"(",
")",
".",
"GetBackgroundColour",
"(",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L2284-L2318 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | MaskedArray.get_real | (self) | return result | Return the real part of the masked array.
The returned array is a view on the real part of the `MaskedArray`
whose `get_real` method is called.
Parameters
----------
None
Returns
-------
result : MaskedArray
The real part of the masked array... | Return the real part of the masked array. | [
"Return",
"the",
"real",
"part",
"of",
"the",
"masked",
"array",
"."
] | def get_real(self):
"""
Return the real part of the masked array.
The returned array is a view on the real part of the `MaskedArray`
whose `get_real` method is called.
Parameters
----------
None
Returns
-------
result : MaskedArray
... | [
"def",
"get_real",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_data",
".",
"real",
".",
"view",
"(",
"type",
"(",
"self",
")",
")",
"result",
".",
"__setmask__",
"(",
"self",
".",
"_mask",
")",
"return",
"result"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3895-L3926 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/postgis/connector.py | python | CursorAdapter.description | (self) | return self._description | Returns columns description, it should be already set by _execute | Returns columns description, it should be already set by _execute | [
"Returns",
"columns",
"description",
"it",
"should",
"be",
"already",
"set",
"by",
"_execute"
] | def description(self):
"""Returns columns description, it should be already set by _execute"""
if self._description is None:
self._description = []
if re.match('^SHOW', self.sql.strip().upper()):
try:
count = len(self.connection.executeSql(s... | [
"def",
"description",
"(",
"self",
")",
":",
"if",
"self",
".",
"_description",
"is",
"None",
":",
"self",
".",
"_description",
"=",
"[",
"]",
"if",
"re",
".",
"match",
"(",
"'^SHOW'",
",",
"self",
".",
"sql",
".",
"strip",
"(",
")",
".",
"upper",
... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/postgis/connector.py#L128-L178 | |
ethz-asl/rotors_simulator | cd813b7a8c375d677352aa20ad20047feb661126 | rotors_gazebo/scripts/substitution_args.py | python | resolve_args | (arg_str, context=None, resolve_anon=True) | return resolved | Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}).
@param arg_str: string to resolve zero or more substitution args
in. arg_str may be None, in which case resolve_args will
return None
@type arg_str: str
@param context dict: (optional) dictionary for storing resul... | Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}). | [
"Resolves",
"substitution",
"args",
"(",
"see",
"wiki",
"spec",
"U",
"{",
"http",
":",
"//",
"ros",
".",
"org",
"/",
"wiki",
"/",
"roslaunch",
"}",
")",
"."
] | def resolve_args(arg_str, context=None, resolve_anon=True):
"""
Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}).
@param arg_str: string to resolve zero or more substitution args
in. arg_str may be None, in which case resolve_args will
return None
@type arg_s... | [
"def",
"resolve_args",
"(",
"arg_str",
",",
"context",
"=",
"None",
",",
"resolve_anon",
"=",
"True",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"{",
"}",
"#parse found substitution args",
"if",
"not",
"arg_str",
":",
"return",
"arg_str",
... | https://github.com/ethz-asl/rotors_simulator/blob/cd813b7a8c375d677352aa20ad20047feb661126/rotors_gazebo/scripts/substitution_args.py#L104-L140 | |
JoseExposito/touchegg | 1f3fda214358d071c05da4bf17c070c33d67b5eb | cmake/cpplint.py | python | ProcessGlobalSuppresions | (lines) | Updates the list of global error suppressions.
Parses any lint directives in the file that have global effect.
Args:
lines: An array of strings, each representing a line of the file, with the
last element being empty if the file is terminated with a newline. | Updates the list of global error suppressions. | [
"Updates",
"the",
"list",
"of",
"global",
"error",
"suppressions",
"."
] | def ProcessGlobalSuppresions(lines):
"""Updates the list of global error suppressions.
Parses any lint directives in the file that have global effect.
Args:
lines: An array of strings, each representing a line of the file, with the
last element being empty if the file is terminated with a newline... | [
"def",
"ProcessGlobalSuppresions",
"(",
"lines",
")",
":",
"for",
"line",
"in",
"lines",
":",
"if",
"_SEARCH_C_FILE",
".",
"search",
"(",
"line",
")",
":",
"for",
"category",
"in",
"_DEFAULT_C_SUPPRESSED_CATEGORIES",
":",
"_global_error_suppressions",
"[",
"catego... | https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L615-L630 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/python_gflags/gflags.py | python | FlagValues.__RenderOurModuleFlags | (self, module, output_lines, prefix="") | Generates a help string for a given module. | Generates a help string for a given module. | [
"Generates",
"a",
"help",
"string",
"for",
"a",
"given",
"module",
"."
] | def __RenderOurModuleFlags(self, module, output_lines, prefix=""):
"""Generates a help string for a given module."""
flags = self._GetFlagsDefinedByModule(module)
if flags:
self.__RenderModuleFlags(module, flags, output_lines, prefix) | [
"def",
"__RenderOurModuleFlags",
"(",
"self",
",",
"module",
",",
"output_lines",
",",
"prefix",
"=",
"\"\"",
")",
":",
"flags",
"=",
"self",
".",
"_GetFlagsDefinedByModule",
"(",
"module",
")",
"if",
"flags",
":",
"self",
".",
"__RenderModuleFlags",
"(",
"m... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L1396-L1400 | ||
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/doxygenxml.py | python | LocationWithBody.get_reporter_location | (self) | return self._location.get_reporter_location() | Return reporter location for this location.
All issues are reported at the main location, which should match with
the declaration, where most of the documentation typically is. | Return reporter location for this location. | [
"Return",
"reporter",
"location",
"for",
"this",
"location",
"."
] | def get_reporter_location(self):
"""Return reporter location for this location.
All issues are reported at the main location, which should match with
the declaration, where most of the documentation typically is.
"""
return self._location.get_reporter_location() | [
"def",
"get_reporter_location",
"(",
"self",
")",
":",
"return",
"self",
".",
"_location",
".",
"get_reporter_location",
"(",
")"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/doxygenxml.py#L217-L223 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/experimental/unification/multipledispatch/dispatcher.py | python | Dispatcher.source | (self, *args, **kwargs) | Print source code for the function corresponding to inputs | Print source code for the function corresponding to inputs | [
"Print",
"source",
"code",
"for",
"the",
"function",
"corresponding",
"to",
"inputs"
] | def source(self, *args, **kwargs):
""" Print source code for the function corresponding to inputs """
print(self._source(*args)) | [
"def",
"source",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"print",
"(",
"self",
".",
"_source",
"(",
"*",
"args",
")",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/unification/multipledispatch/dispatcher.py#L372-L374 | ||
WenmuZhou/PSENet.pytorch | f760c2f4938726a2d00efaf5e5b28218323c44ca | dataset/augment.py | python | DataAugment.vertical_flip | (self, im: np.ndarray, text_polys: np.ndarray) | return flip_im, flip_text_polys | 对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框 | 对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框 | [
"对图片和文本框进行竖直翻转",
":",
"param",
"im",
":",
"图片",
":",
"param",
"text_polys",
":",
"文本框",
":",
"return",
":",
"竖直翻转之后的图片和文本框"
] | def vertical_flip(self, im: np.ndarray, text_polys: np.ndarray) -> tuple:
"""
对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框
"""
flip_text_polys = text_polys.copy()
flip_im = cv2.flip(im, 0)
h, w, _ = flip_im.shape
... | [
"def",
"vertical_flip",
"(",
"self",
",",
"im",
":",
"np",
".",
"ndarray",
",",
"text_polys",
":",
"np",
".",
"ndarray",
")",
"->",
"tuple",
":",
"flip_text_polys",
"=",
"text_polys",
".",
"copy",
"(",
")",
"flip_im",
"=",
"cv2",
".",
"flip",
"(",
"i... | https://github.com/WenmuZhou/PSENet.pytorch/blob/f760c2f4938726a2d00efaf5e5b28218323c44ca/dataset/augment.py#L314-L325 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saved_model/save_impl.py | python | _wrap_unconditional_loss | (loss_fn, index) | Wraps callable/unconditional loss, returning a serializable function. | Wraps callable/unconditional loss, returning a serializable function. | [
"Wraps",
"callable",
"/",
"unconditional",
"loss",
"returning",
"a",
"serializable",
"function",
"."
] | def _wrap_unconditional_loss(loss_fn, index):
"""Wraps callable/unconditional loss, returning a serializable function."""
# Extract original loss function from partial function
fn = loss_fn.args[0] if isinstance(loss_fn, functools.partial) else loss_fn
if isinstance(fn, def_function.Function):
return fn
e... | [
"def",
"_wrap_unconditional_loss",
"(",
"loss_fn",
",",
"index",
")",
":",
"# Extract original loss function from partial function",
"fn",
"=",
"loss_fn",
".",
"args",
"[",
"0",
"]",
"if",
"isinstance",
"(",
"loss_fn",
",",
"functools",
".",
"partial",
")",
"else"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/save_impl.py#L706-L714 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py | python | AoCUpgradeResourceSubprocessor.faith_recharge_rate_upgrade | (converter_group, value, operator, team=False) | return patches | Creates a patch for the faith_recharge_rate modify effect (ID: 35).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param value: Value used for patching the member.
:type value: MemberOperator
:par... | Creates a patch for the faith_recharge_rate modify effect (ID: 35). | [
"Creates",
"a",
"patch",
"for",
"the",
"faith_recharge_rate",
"modify",
"effect",
"(",
"ID",
":",
"35",
")",
"."
] | def faith_recharge_rate_upgrade(converter_group, value, operator, team=False):
"""
Creates a patch for the faith_recharge_rate modify effect (ID: 35).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
... | [
"def",
"faith_recharge_rate_upgrade",
"(",
"converter_group",
",",
"value",
",",
"operator",
",",
"team",
"=",
"False",
")",
":",
"monk_id",
"=",
"125",
"dataset",
"=",
"converter_group",
".",
"data",
"line",
"=",
"dataset",
".",
"unit_lines",
"[",
"monk_id",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py#L469-L550 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Control_RemoveMnemonics | (*args, **kwargs) | return _core_.Control_RemoveMnemonics(*args, **kwargs) | Control_RemoveMnemonics(String str) -> String
removes the mnemonics characters | Control_RemoveMnemonics(String str) -> String | [
"Control_RemoveMnemonics",
"(",
"String",
"str",
")",
"-",
">",
"String"
] | def Control_RemoveMnemonics(*args, **kwargs):
"""
Control_RemoveMnemonics(String str) -> String
removes the mnemonics characters
"""
return _core_.Control_RemoveMnemonics(*args, **kwargs) | [
"def",
"Control_RemoveMnemonics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Control_RemoveMnemonics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12785-L12791 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQM/SiStripMonitorClient/scripts/getRunInfo.py | python | Func_MakeShellWord | (str_python) | return str_python.replace('?','\\?').replace('=','\\=').replace(' ','\\ ').replace('&','\\&').replace(':','\\:') | Func_MakeShellWord(str_python)
Adds shell escape charakters to Python strings | Func_MakeShellWord(str_python)
Adds shell escape charakters to Python strings | [
"Func_MakeShellWord",
"(",
"str_python",
")",
"Adds",
"shell",
"escape",
"charakters",
"to",
"Python",
"strings"
] | def Func_MakeShellWord(str_python):
""" Func_MakeShellWord(str_python)
Adds shell escape charakters to Python strings
"""
return str_python.replace('?','\\?').replace('=','\\=').replace(' ','\\ ').replace('&','\\&').replace(':','\\:') | [
"def",
"Func_MakeShellWord",
"(",
"str_python",
")",
":",
"return",
"str_python",
".",
"replace",
"(",
"'?'",
",",
"'\\\\?'",
")",
".",
"replace",
"(",
"'='",
",",
"'\\\\='",
")",
".",
"replace",
"(",
"' '",
",",
"'\\\\ '",
")",
".",
"replace",
"(",
"'... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/SiStripMonitorClient/scripts/getRunInfo.py#L166-L170 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py | python | convert_layer_norm | (node, **kwargs) | return nodes | Map MXNet's LayerNorm operator attributes to onnx operators. | Map MXNet's LayerNorm operator attributes to onnx operators. | [
"Map",
"MXNet",
"s",
"LayerNorm",
"operator",
"attributes",
"to",
"onnx",
"operators",
"."
] | def convert_layer_norm(node, **kwargs):
"""Map MXNet's LayerNorm operator attributes to onnx operators.
"""
from onnx.helper import make_node
from onnx import TensorProto
name, input_nodes, attrs = get_inputs(node, kwargs)
input_dtypes = get_input_dtypes(node, kwargs)
dtype = input_dtypes[0... | [
"def",
"convert_layer_norm",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"from",
"onnx",
"import",
"TensorProto",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwar... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py#L349-L410 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/dateutil/zoneinfo/__init__.py | python | get_zonefile_instance | (new_instance=False) | return zif | This is a convenience function which provides a :class:`ZoneInfoFile`
instance using the data provided by the ``dateutil`` package. By default, it
caches a single instance of the ZoneInfoFile object and returns that.
:param new_instance:
If ``True``, a new instance of :class:`ZoneInfoFile` is insta... | This is a convenience function which provides a :class:`ZoneInfoFile`
instance using the data provided by the ``dateutil`` package. By default, it
caches a single instance of the ZoneInfoFile object and returns that. | [
"This",
"is",
"a",
"convenience",
"function",
"which",
"provides",
"a",
":",
"class",
":",
"ZoneInfoFile",
"instance",
"using",
"the",
"data",
"provided",
"by",
"the",
"dateutil",
"package",
".",
"By",
"default",
"it",
"caches",
"a",
"single",
"instance",
"o... | def get_zonefile_instance(new_instance=False):
"""
This is a convenience function which provides a :class:`ZoneInfoFile`
instance using the data provided by the ``dateutil`` package. By default, it
caches a single instance of the ZoneInfoFile object and returns that.
:param new_instance:
If... | [
"def",
"get_zonefile_instance",
"(",
"new_instance",
"=",
"False",
")",
":",
"if",
"new_instance",
":",
"zif",
"=",
"None",
"else",
":",
"zif",
"=",
"getattr",
"(",
"get_zonefile_instance",
",",
"'_cached_instance'",
",",
"None",
")",
"if",
"zif",
"is",
"Non... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/zoneinfo/__init__.py#L96-L122 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | MaskedArray.__getitem__ | (self, i) | Get item described by i. Not a copy as in previous versions. | Get item described by i. Not a copy as in previous versions. | [
"Get",
"item",
"described",
"by",
"i",
".",
"Not",
"a",
"copy",
"as",
"in",
"previous",
"versions",
"."
] | def __getitem__(self, i):
"Get item described by i. Not a copy as in previous versions."
self.unshare_mask()
m = self._mask
dout = self._data[i]
if m is nomask:
try:
if dout.size == 1:
return dout
else:
... | [
"def",
"__getitem__",
"(",
"self",
",",
"i",
")",
":",
"self",
".",
"unshare_mask",
"(",
")",
"m",
"=",
"self",
".",
"_mask",
"dout",
"=",
"self",
".",
"_data",
"[",
"i",
"]",
"if",
"m",
"is",
"nomask",
":",
"try",
":",
"if",
"dout",
".",
"size... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L799-L819 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | samples/python/efficientdet/image_batcher.py | python | ImageBatcher.get_batch | (self) | Retrieve the batches. This is a generator object, so you can use it within a loop as:
for batch, images in batcher.get_batch():
...
Or outside of a batch with the next() function.
:return: A generator yielding three items per iteration: a numpy array holding a batch of images, the lis... | Retrieve the batches. This is a generator object, so you can use it within a loop as:
for batch, images in batcher.get_batch():
...
Or outside of a batch with the next() function.
:return: A generator yielding three items per iteration: a numpy array holding a batch of images, the lis... | [
"Retrieve",
"the",
"batches",
".",
"This",
"is",
"a",
"generator",
"object",
"so",
"you",
"can",
"use",
"it",
"within",
"a",
"loop",
"as",
":",
"for",
"batch",
"images",
"in",
"batcher",
".",
"get_batch",
"()",
":",
"...",
"Or",
"outside",
"of",
"a",
... | def get_batch(self):
"""
Retrieve the batches. This is a generator object, so you can use it within a loop as:
for batch, images in batcher.get_batch():
...
Or outside of a batch with the next() function.
:return: A generator yielding three items per iteration: a numpy... | [
"def",
"get_batch",
"(",
"self",
")",
":",
"for",
"i",
",",
"batch_images",
"in",
"enumerate",
"(",
"self",
".",
"batches",
")",
":",
"batch_data",
"=",
"np",
".",
"zeros",
"(",
"self",
".",
"shape",
",",
"dtype",
"=",
"self",
".",
"dtype",
")",
"b... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/efficientdet/image_batcher.py#L148-L165 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | LayoutConstraints.SatisfyConstraints | (*args, **kwargs) | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) | SatisfyConstraints(Window win) -> (areSatisfied, noChanges) | SatisfyConstraints(Window win) -> (areSatisfied, noChanges) | [
"SatisfyConstraints",
"(",
"Window",
"win",
")",
"-",
">",
"(",
"areSatisfied",
"noChanges",
")"
] | def SatisfyConstraints(*args, **kwargs):
"""SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) | [
"def",
"SatisfyConstraints",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"LayoutConstraints_SatisfyConstraints",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L16358-L16360 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathToolLibraryEditor.py | python | EditorPanel.getMaterial | (self, material) | gets a combobox index number for a given material or vice versa | gets a combobox index number for a given material or vice versa | [
"gets",
"a",
"combobox",
"index",
"number",
"for",
"a",
"given",
"material",
"or",
"vice",
"versa"
] | def getMaterial(self, material):
"""gets a combobox index number for a given material or vice versa"""
matslist = Path.Tool.getToolMaterials(Path.Tool())
if isinstance(material, str):
if material in matslist:
return matslist.index(material)
else:
... | [
"def",
"getMaterial",
"(",
"self",
",",
"material",
")",
":",
"matslist",
"=",
"Path",
".",
"Tool",
".",
"getToolMaterials",
"(",
"Path",
".",
"Tool",
"(",
")",
")",
"if",
"isinstance",
"(",
"material",
",",
"str",
")",
":",
"if",
"material",
"in",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathToolLibraryEditor.py#L92-L101 | ||
h2oai/deepwater | 80e345c582e6ef912a31f42707a2f31c01b064da | tensorflow/src/main/resources/deepwater/models/inception.py | python | stem | (x) | return out | Stem fo the pure InceptionV4 and Inception-ResNet-V2 | Stem fo the pure InceptionV4 and Inception-ResNet-V2 | [
"Stem",
"fo",
"the",
"pure",
"InceptionV4",
"and",
"Inception",
"-",
"ResNet",
"-",
"V2"
] | def stem(x):
"""
Stem fo the pure InceptionV4 and Inception-ResNet-V2
"""
out = conv3x3(x, 32, stride=2, padding="VALID", batch_norm=use_batch_norm)
out = conv3x3(out, 32, stride=1, padding="VALID", batch_norm=use_batch_norm)
out = conv3x3(out, 64, stride=1, padding="SAME", batch_norm=use_batch_... | [
"def",
"stem",
"(",
"x",
")",
":",
"out",
"=",
"conv3x3",
"(",
"x",
",",
"32",
",",
"stride",
"=",
"2",
",",
"padding",
"=",
"\"VALID\"",
",",
"batch_norm",
"=",
"use_batch_norm",
")",
"out",
"=",
"conv3x3",
"(",
"out",
",",
"32",
",",
"stride",
... | https://github.com/h2oai/deepwater/blob/80e345c582e6ef912a31f42707a2f31c01b064da/tensorflow/src/main/resources/deepwater/models/inception.py#L191-L219 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py | python | StringSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a string field. | Returns a sizer for a string field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"string",
"field",
"."
] | def StringSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a string field."""
tag_size = _TagSize(field_number)
local_VarintSize = _VarintSize
local_len = len
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in ... | [
"def",
"StringSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"local_VarintSize",
"=",
"_VarintSize",
"local_len",
"=",
"len",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L221-L240 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/treeadapters/genshi.py | python | to_genshi | (walker) | Convert a tree to a genshi tree
:arg walker: the treewalker to use to walk the tree to convert it
:returns: generator of genshi nodes | Convert a tree to a genshi tree | [
"Convert",
"a",
"tree",
"to",
"a",
"genshi",
"tree"
] | def to_genshi(walker):
"""Convert a tree to a genshi tree
:arg walker: the treewalker to use to walk the tree to convert it
:returns: generator of genshi nodes
"""
text = []
for token in walker:
type = token["type"]
if type in ("Characters", "SpaceCharacters"):
tex... | [
"def",
"to_genshi",
"(",
"walker",
")",
":",
"text",
"=",
"[",
"]",
"for",
"token",
"in",
"walker",
":",
"type",
"=",
"token",
"[",
"\"type\"",
"]",
"if",
"type",
"in",
"(",
"\"Characters\"",
",",
"\"SpaceCharacters\"",
")",
":",
"text",
".",
"append",... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/treeadapters/genshi.py#L7-L54 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/asn1.py | python | DerObject._convertTag | (self, tag) | return tag | Check if *tag* is a real DER tag.
Convert it from a character to number if necessary. | Check if *tag* is a real DER tag.
Convert it from a character to number if necessary. | [
"Check",
"if",
"*",
"tag",
"*",
"is",
"a",
"real",
"DER",
"tag",
".",
"Convert",
"it",
"from",
"a",
"character",
"to",
"number",
"if",
"necessary",
"."
] | def _convertTag(self, tag):
"""Check if *tag* is a real DER tag.
Convert it from a character to number if necessary.
"""
if not _is_number(tag):
if len(tag) == 1:
tag = bord(tag[0])
# Ensure that ... | [
"def",
"_convertTag",
"(",
"self",
",",
"tag",
")",
":",
"if",
"not",
"_is_number",
"(",
"tag",
")",
":",
"if",
"len",
"(",
"tag",
")",
"==",
"1",
":",
"tag",
"=",
"bord",
"(",
"tag",
"[",
"0",
"]",
")",
"# Ensure that tag is a low tag",
"if",
"not... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/asn1.py#L143-L153 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/tokenutil.py | python | Compare | (token1, token2) | Compares two tokens and determines their relative order.
Args:
token1: The first token to compare.
token2: The second token to compare.
Returns:
A negative integer, zero, or a positive integer as the first token is
before, equal, or after the second in the token stream. | Compares two tokens and determines their relative order. | [
"Compares",
"two",
"tokens",
"and",
"determines",
"their",
"relative",
"order",
"."
] | def Compare(token1, token2):
"""Compares two tokens and determines their relative order.
Args:
token1: The first token to compare.
token2: The second token to compare.
Returns:
A negative integer, zero, or a positive integer as the first token is
before, equal, or after the second in the token s... | [
"def",
"Compare",
"(",
"token1",
",",
"token2",
")",
":",
"if",
"token2",
".",
"line_number",
"!=",
"token1",
".",
"line_number",
":",
"return",
"token1",
".",
"line_number",
"-",
"token2",
".",
"line_number",
"else",
":",
"return",
"token1",
".",
"start_i... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/tokenutil.py#L360-L374 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/sparse_ops.py | python | serialize_many_sparse_v2 | (sp_input, out_type=dtypes.string, name=None) | return gen_sparse_ops.serialize_many_sparse(
sp_input.indices,
sp_input.values,
sp_input.dense_shape,
name=name,
out_type=out_type) | Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`.
The `SparseTensor` must have rank `R` greater than 1, and the first dimension
is treated as the minibatch dimension. Elements of the `SparseTensor`
must be sorted in increasing order of this first dimension. The serialized
`SparseTensor` objec... | Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`. | [
"Serialize",
"N",
"-",
"minibatch",
"SparseTensor",
"into",
"an",
"[",
"N",
"3",
"]",
"Tensor",
"."
] | def serialize_many_sparse_v2(sp_input, out_type=dtypes.string, name=None):
"""Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`.
The `SparseTensor` must have rank `R` greater than 1, and the first dimension
is treated as the minibatch dimension. Elements of the `SparseTensor`
must be sorted in ... | [
"def",
"serialize_many_sparse_v2",
"(",
"sp_input",
",",
"out_type",
"=",
"dtypes",
".",
"string",
",",
"name",
"=",
"None",
")",
":",
"sp_input",
"=",
"_convert_to_sparse_tensor",
"(",
"sp_input",
")",
"return",
"gen_sparse_ops",
".",
"serialize_many_sparse",
"("... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/sparse_ops.py#L2238-L2269 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_vdvt_update.py | python | OperatorPDSqrtVDVTUpdate._check_shapes_dynamic | (self, operator, v, diag) | Return (v, diag) with Assert dependencies, which check shape. | Return (v, diag) with Assert dependencies, which check shape. | [
"Return",
"(",
"v",
"diag",
")",
"with",
"Assert",
"dependencies",
"which",
"check",
"shape",
"."
] | def _check_shapes_dynamic(self, operator, v, diag):
"""Return (v, diag) with Assert dependencies, which check shape."""
checks = []
with ops.op_scope([operator, v, diag], 'check_shapes'):
s_v = array_ops.shape(v)
r_op = operator.rank()
r_v = array_ops.rank(v)
if diag is not None:
... | [
"def",
"_check_shapes_dynamic",
"(",
"self",
",",
"operator",
",",
"v",
",",
"diag",
")",
":",
"checks",
"=",
"[",
"]",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"operator",
",",
"v",
",",
"diag",
"]",
",",
"'check_shapes'",
")",
":",
"s_v",
"=",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_vdvt_update.py#L214-L247 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | hasher-matcher-actioner/hmalib/common/models/bank.py | python | BanksTable.add_detached_bank_member_signal | (
self,
bank_id: str,
content_type: t.Type[ContentType],
signal_type: t.Type[SignalType],
signal_value: str,
) | return self.add_bank_member_signal(
bank_id=bank_id,
bank_member_id=bank_member.bank_member_id,
signal_type=signal_type,
signal_value=signal_value,
) | Adds a BankMemberSignal without a needing a related BankMember. Pretty
much the same as add_bank_member_signal otherwise.
Creates a BankMember with a is_media_unavailable=True. | Adds a BankMemberSignal without a needing a related BankMember. Pretty
much the same as add_bank_member_signal otherwise. | [
"Adds",
"a",
"BankMemberSignal",
"without",
"a",
"needing",
"a",
"related",
"BankMember",
".",
"Pretty",
"much",
"the",
"same",
"as",
"add_bank_member_signal",
"otherwise",
"."
] | def add_detached_bank_member_signal(
self,
bank_id: str,
content_type: t.Type[ContentType],
signal_type: t.Type[SignalType],
signal_value: str,
) -> BankMemberSignal:
"""
Adds a BankMemberSignal without a needing a related BankMember. Pretty
much the s... | [
"def",
"add_detached_bank_member_signal",
"(",
"self",
",",
"bank_id",
":",
"str",
",",
"content_type",
":",
"t",
".",
"Type",
"[",
"ContentType",
"]",
",",
"signal_type",
":",
"t",
".",
"Type",
"[",
"SignalType",
"]",
",",
"signal_value",
":",
"str",
",",... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/common/models/bank.py#L624-L652 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/Paste/paste/httpserver.py | python | ThreadPool.add_task | (self, task) | Add a task to the queue | Add a task to the queue | [
"Add",
"a",
"task",
"to",
"the",
"queue"
] | def add_task(self, task):
"""
Add a task to the queue
"""
self.logger.debug('Added task (%i tasks queued)', self.queue.qsize())
if self.hung_check_period:
self.requests_since_last_hung_check += 1
if self.requests_since_last_hung_check > self.hung_check_per... | [
"def",
"add_task",
"(",
"self",
",",
"task",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"'Added task (%i tasks queued)'",
",",
"self",
".",
"queue",
".",
"qsize",
"(",
")",
")",
"if",
"self",
".",
"hung_check_period",
":",
"self",
".",
"requests... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/httpserver.py#L640-L687 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | qatools/qatoolspython/qatoolspython.py | python | _parse_arguments | () | return args.subjects_dir, args.output_dir, args.subjects, args.shape, args.screenshots, args.fornix, args.outlier, args.outlier_table | an internal function to parse input arguments | an internal function to parse input arguments | [
"an",
"internal",
"function",
"to",
"parse",
"input",
"arguments"
] | def _parse_arguments():
"""
an internal function to parse input arguments
"""
# imports
import sys
import argparse
# parse
parser = argparse.ArgumentParser(description='''
This program takes existing Freesurfer 6.0 analysis results of one
or more subjects and computes ... | [
"def",
"_parse_arguments",
"(",
")",
":",
"# imports",
"import",
"sys",
"import",
"argparse",
"# parse",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'''\n This program takes existing Freesurfer 6.0 analysis results of one\n or more ... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/qatools/qatoolspython/qatoolspython.py#L248-L294 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py | python | SuperplotPresenter.set_bin_mode | (self, state) | Set the plot mode.
Args:
state (bool): if true, bin mode is set, if false, spectrum mode | Set the plot mode. | [
"Set",
"the",
"plot",
"mode",
"."
] | def set_bin_mode(self, state):
"""
Set the plot mode.
Args:
state (bool): if true, bin mode is set, if false, spectrum mode
"""
if state:
self._view.set_mode(self.BIN_MODE_TEXT)
else:
self._view.set_mode(self.SPECTRUM_MODE_TEXT)
... | [
"def",
"set_bin_mode",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
":",
"self",
".",
"_view",
".",
"set_mode",
"(",
"self",
".",
"BIN_MODE_TEXT",
")",
"else",
":",
"self",
".",
"_view",
".",
"set_mode",
"(",
"self",
".",
"SPECTRUM_MODE_TEXT",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py#L78-L90 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/ultisnips/plugin/UltiSnips/text_objects/_shell_code.py | python | _chomp | (string) | return string | Rather than rstrip(), remove only the last newline and preserve purposeful whitespace | Rather than rstrip(), remove only the last newline and preserve purposeful whitespace | [
"Rather",
"than",
"rstrip",
"()",
"remove",
"only",
"the",
"last",
"newline",
"and",
"preserve",
"purposeful",
"whitespace"
] | def _chomp(string):
"""Rather than rstrip(), remove only the last newline and preserve purposeful whitespace"""
if len(string) and string[-1] == '\n':
string = string[:-1]
if len(string) and string[-1] == '\r':
string = string[:-1]
return string | [
"def",
"_chomp",
"(",
"string",
")",
":",
"if",
"len",
"(",
"string",
")",
"and",
"string",
"[",
"-",
"1",
"]",
"==",
"'\\n'",
":",
"string",
"=",
"string",
"[",
":",
"-",
"1",
"]",
"if",
"len",
"(",
"string",
")",
"and",
"string",
"[",
"-",
... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/text_objects/_shell_code.py#L13-L19 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/run.py | python | MyHandler.decode_interrupthook | (self) | interrupt awakened thread | interrupt awakened thread | [
"interrupt",
"awakened",
"thread"
] | def decode_interrupthook(self):
"interrupt awakened thread"
global quitting
quitting = True
thread.interrupt_main() | [
"def",
"decode_interrupthook",
"(",
"self",
")",
":",
"global",
"quitting",
"quitting",
"=",
"True",
"thread",
".",
"interrupt_main",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/run.py#L285-L289 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py | python | Bucket.set_def_acl | (self, acl_or_str, headers=None) | Sets or changes a bucket's default ACL.
:type acl_or_str: string or :class:`boto.gs.acl.ACL`
:param acl_or_str: A canned ACL string (see
:data:`~.gs.acl.CannedACLStrings`) or an ACL object.
:type headers: dict
:param headers: Additional headers to set during the request. | Sets or changes a bucket's default ACL. | [
"Sets",
"or",
"changes",
"a",
"bucket",
"s",
"default",
"ACL",
"."
] | def set_def_acl(self, acl_or_str, headers=None):
"""Sets or changes a bucket's default ACL.
:type acl_or_str: string or :class:`boto.gs.acl.ACL`
:param acl_or_str: A canned ACL string (see
:data:`~.gs.acl.CannedACLStrings`) or an ACL object.
:type headers: dict
:par... | [
"def",
"set_def_acl",
"(",
"self",
",",
"acl_or_str",
",",
"headers",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"acl_or_str",
",",
"Policy",
")",
":",
"raise",
"InvalidAclError",
"(",
"'Attempt to set S3 Policy on GS ACL'",
")",
"elif",
"isinstance",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py#L310-L325 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_schema_compiler/js_externs_generator.py | python | _Generator._IsTypeConstructor | (self, js_type) | return any(prop.type_.property_type is PropertyType.FUNCTION
for prop in js_type.properties.values()) | Returns true if the given type should be a @constructor. If this returns
false, the type is a typedef. | Returns true if the given type should be a | [
"Returns",
"true",
"if",
"the",
"given",
"type",
"should",
"be",
"a"
] | def _IsTypeConstructor(self, js_type):
"""Returns true if the given type should be a @constructor. If this returns
false, the type is a typedef.
"""
return any(prop.type_.property_type is PropertyType.FUNCTION
for prop in js_type.properties.values()) | [
"def",
"_IsTypeConstructor",
"(",
"self",
",",
"js_type",
")",
":",
"return",
"any",
"(",
"prop",
".",
"type_",
".",
"property_type",
"is",
"PropertyType",
".",
"FUNCTION",
"for",
"prop",
"in",
"js_type",
".",
"properties",
".",
"values",
"(",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/js_externs_generator.py#L101-L106 | |
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/LZ2.py | python | dec_to_bin | ( n , digits ) | return ans | n is the number to convert to binary; digits is the number of bits you want
Always prints full number of digits
>>> print dec_to_bin( 17 , 9)
000010001
>>> print dec_to_bin( 17 , 5)
10001
Will behead the standard binary number if requested
>>> print dec_to_bin( 17 , 4)
0001 | n is the number to convert to binary; digits is the number of bits you want
Always prints full number of digits
>>> print dec_to_bin( 17 , 9)
000010001
>>> print dec_to_bin( 17 , 5)
10001 | [
"n",
"is",
"the",
"number",
"to",
"convert",
"to",
"binary",
";",
"digits",
"is",
"the",
"number",
"of",
"bits",
"you",
"want",
"Always",
"prints",
"full",
"number",
"of",
"digits",
">>>",
"print",
"dec_to_bin",
"(",
"17",
"9",
")",
"000010001",
">>>",
... | def dec_to_bin( n , digits ):
""" n is the number to convert to binary; digits is the number of bits you want
Always prints full number of digits
>>> print dec_to_bin( 17 , 9)
000010001
>>> print dec_to_bin( 17 , 5)
10001
Will behead the standard binary number if requested
>>> print de... | [
"def",
"dec_to_bin",
"(",
"n",
",",
"digits",
")",
":",
"if",
"(",
"n",
"<",
"0",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"warning, negative n not expected\\n\"",
")",
"i",
"=",
"digits",
"-",
"1",
"ans",
"=",
"\"\"",
"while",
"i",
">=",... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/LZ2.py#L19-L39 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Frontends/VBoxShell/vboxshell.py | python | natAlias | (ctx, mach, nicnum, nat, args=[]) | return (0, None) | This command shows/alters NAT's alias settings.
usage: nat <vm> <nicnum> alias [default|[log] [proxyonly] [sameports]]
default - set settings to default values
log - switch on alias logging
proxyonly - switch proxyonly mode on
sameports - enforces NAT using the same ports | This command shows/alters NAT's alias settings.
usage: nat <vm> <nicnum> alias [default|[log] [proxyonly] [sameports]]
default - set settings to default values
log - switch on alias logging
proxyonly - switch proxyonly mode on
sameports - enforces NAT using the same ports | [
"This",
"command",
"shows",
"/",
"alters",
"NAT",
"s",
"alias",
"settings",
".",
"usage",
":",
"nat",
"<vm",
">",
"<nicnum",
">",
"alias",
"[",
"default|",
"[",
"log",
"]",
"[",
"proxyonly",
"]",
"[",
"sameports",
"]]",
"default",
"-",
"set",
"settings... | def natAlias(ctx, mach, nicnum, nat, args=[]):
"""This command shows/alters NAT's alias settings.
usage: nat <vm> <nicnum> alias [default|[log] [proxyonly] [sameports]]
default - set settings to default values
log - switch on alias logging
proxyonly - switch proxyonly mode on
sameports - enforce... | [
"def",
"natAlias",
"(",
"ctx",
",",
"mach",
",",
"nicnum",
",",
"nat",
",",
"args",
"=",
"[",
"]",
")",
":",
"alias",
"=",
"{",
"'log'",
":",
"0x1",
",",
"'proxyonly'",
":",
"0x2",
",",
"'sameports'",
":",
"0x4",
"}",
"if",
"len",
"(",
"args",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Frontends/VBoxShell/vboxshell.py#L2669-L2704 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | libcxx/utils/gdb/libcxx/printers.py | python | RBTreeUtils.parent | (self, node) | return parent | Return the parent of node, if it exists. | Return the parent of node, if it exists. | [
"Return",
"the",
"parent",
"of",
"node",
"if",
"it",
"exists",
"."
] | def parent(self, node):
"""Return the parent of node, if it exists."""
# If this is the root, then from the algorithm's point of view, it has no
# parent.
if node == self.root:
return None
# We don't have enough information to tell if this is the end_node (which
... | [
"def",
"parent",
"(",
"self",
",",
"node",
")",
":",
"# If this is the root, then from the algorithm's point of view, it has no",
"# parent.",
"if",
"node",
"==",
"self",
".",
"root",
":",
"return",
"None",
"# We don't have enough information to tell if this is the end_node (wh... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/libcxx/utils/gdb/libcxx/printers.py#L604-L633 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextAttr.HasParagraphSpacingAfter | (*args, **kwargs) | return _controls_.TextAttr_HasParagraphSpacingAfter(*args, **kwargs) | HasParagraphSpacingAfter(self) -> bool | HasParagraphSpacingAfter(self) -> bool | [
"HasParagraphSpacingAfter",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasParagraphSpacingAfter(*args, **kwargs):
"""HasParagraphSpacingAfter(self) -> bool"""
return _controls_.TextAttr_HasParagraphSpacingAfter(*args, **kwargs) | [
"def",
"HasParagraphSpacingAfter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasParagraphSpacingAfter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1828-L1830 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vcs/git.py | python | Git.get_url_rev | (self) | return url, rev | Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes doesn't
work with a ssh:// scheme (e.g. Github). But we need a scheme for
parsing. Hence we remove it again afterwards and return it as a stub. | Prefixes stub URLs like 'user | [
"Prefixes",
"stub",
"URLs",
"like",
"user"
] | def get_url_rev(self):
"""
Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes doesn't
work with a ssh:// scheme (e.g. Github). But we need a scheme for
parsing. Hence we remove it again afterwards and ... | [
"def",
"get_url_rev",
"(",
"self",
")",
":",
"if",
"not",
"'://'",
"in",
"self",
".",
"url",
":",
"assert",
"not",
"'file:'",
"in",
"self",
".",
"url",
"self",
".",
"url",
"=",
"self",
".",
"url",
".",
"replace",
"(",
"'git+'",
",",
"'git+ssh://'",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vcs/git.py#L171-L186 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | unique_object_name | (name,
name_uid_map=None,
avoid_names=None,
namespace='',
zero_based=False,
avoid_observed_names=False) | return proposed_name | Makes a object name (or arbitrary string) unique within a TensorFlow graph.
Args:
name: String name to make unique.
name_uid_map: An optional defaultdict(int) to use when creating unique
names. If None (default), uses a per-Graph dictionary.
avoid_names: An optional set or dict with names which sho... | Makes a object name (or arbitrary string) unique within a TensorFlow graph. | [
"Makes",
"a",
"object",
"name",
"(",
"or",
"arbitrary",
"string",
")",
"unique",
"within",
"a",
"TensorFlow",
"graph",
"."
] | def unique_object_name(name,
name_uid_map=None,
avoid_names=None,
namespace='',
zero_based=False,
avoid_observed_names=False):
"""Makes a object name (or arbitrary string) unique within a TensorFlow grap... | [
"def",
"unique_object_name",
"(",
"name",
",",
"name_uid_map",
"=",
"None",
",",
"avoid_names",
"=",
"None",
",",
"namespace",
"=",
"''",
",",
"zero_based",
"=",
"False",
",",
"avoid_observed_names",
"=",
"False",
")",
":",
"if",
"name_uid_map",
"is",
"None"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L1121-L1174 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/analogclock/analogclock.py | python | AnalogClock.SetFaceBorderWidth | (self, width) | Sets border width of watch. | Sets border width of watch. | [
"Sets",
"border",
"width",
"of",
"watch",
"."
] | def SetFaceBorderWidth(self, width):
"""Sets border width of watch."""
self.Box.Face.SetBorderWidth(width)
self.Reset() | [
"def",
"SetFaceBorderWidth",
"(",
"self",
",",
"width",
")",
":",
"self",
".",
"Box",
".",
"Face",
".",
"SetBorderWidth",
"(",
"width",
")",
"self",
".",
"Reset",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/analogclock/analogclock.py#L433-L437 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/tf/ObjectDetectionAPI.py | python | get_specific_ops_with_const_inputs | (first_node: Node, allowed_ops: list, forward: bool = True) | return result | Returns the list with information about consecutive nodes of operation from "allowed_ops".
:param first_node: The first node (not included) to start looking for nodes from the "allowed_ops" list
:param allowed_ops: list of allowed operations
:param forward: flag specifying direction of search
:return: ... | Returns the list with information about consecutive nodes of operation from "allowed_ops". | [
"Returns",
"the",
"list",
"with",
"information",
"about",
"consecutive",
"nodes",
"of",
"operation",
"from",
"allowed_ops",
"."
] | def get_specific_ops_with_const_inputs(first_node: Node, allowed_ops: list, forward: bool = True):
"""
Returns the list with information about consecutive nodes of operation from "allowed_ops".
:param first_node: The first node (not included) to start looking for nodes from the "allowed_ops" list
:para... | [
"def",
"get_specific_ops_with_const_inputs",
"(",
"first_node",
":",
"Node",
",",
"allowed_ops",
":",
"list",
",",
"forward",
":",
"bool",
"=",
"True",
")",
":",
"node",
"=",
"first_node",
".",
"out_port",
"(",
"0",
")",
".",
"get_destination",
"(",
")",
"... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/tf/ObjectDetectionAPI.py#L604-L624 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/buildings-with-an-ocean-view.py | python | Solution2.findBuildings | (self, heights) | return result | :type heights: List[int]
:rtype: List[int] | :type heights: List[int]
:rtype: List[int] | [
":",
"type",
"heights",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def findBuildings(self, heights):
"""
:type heights: List[int]
:rtype: List[int]
"""
result = []
for i in reversed(xrange(len(heights))):
if not result or heights[result[-1]] < heights[i]:
result.append(i)
result.reverse()
retur... | [
"def",
"findBuildings",
"(",
"self",
",",
"heights",
")",
":",
"result",
"=",
"[",
"]",
"for",
"i",
"in",
"reversed",
"(",
"xrange",
"(",
"len",
"(",
"heights",
")",
")",
")",
":",
"if",
"not",
"result",
"or",
"heights",
"[",
"result",
"[",
"-",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/buildings-with-an-ocean-view.py#L21-L31 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime_Now | (*args) | return _misc_.DateTime_Now(*args) | DateTime_Now() -> DateTime | DateTime_Now() -> DateTime | [
"DateTime_Now",
"()",
"-",
">",
"DateTime"
] | def DateTime_Now(*args):
"""DateTime_Now() -> DateTime"""
return _misc_.DateTime_Now(*args) | [
"def",
"DateTime_Now",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"DateTime_Now",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4301-L4303 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/data/ops/dataset_ops.py | python | TensorSliceDataset.__init__ | (self, tensors) | See `Dataset.from_tensor_slices()` for details. | See `Dataset.from_tensor_slices()` for details. | [
"See",
"Dataset",
".",
"from_tensor_slices",
"()",
"for",
"details",
"."
] | def __init__(self, tensors):
"""See `Dataset.from_tensor_slices()` for details."""
super(TensorSliceDataset, self).__init__()
with ops.name_scope("tensors"):
flat_tensors = [
ops.convert_to_tensor(t, name="component_%d" % i)
for i, t in enumerate(nest.flatten(tensors))
]
... | [
"def",
"__init__",
"(",
"self",
",",
"tensors",
")",
":",
"super",
"(",
"TensorSliceDataset",
",",
"self",
")",
".",
"__init__",
"(",
")",
"with",
"ops",
".",
"name_scope",
"(",
"\"tensors\"",
")",
":",
"flat_tensors",
"=",
"[",
"ops",
".",
"convert_to_t... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/data/ops/dataset_ops.py#L870-L882 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyApp.GetUseBestVisual | (*args, **kwargs) | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) | GetUseBestVisual(self) -> bool
Get current UseBestVisual setting. | GetUseBestVisual(self) -> bool | [
"GetUseBestVisual",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetUseBestVisual(*args, **kwargs):
"""
GetUseBestVisual(self) -> bool
Get current UseBestVisual setting.
"""
return _core_.PyApp_GetUseBestVisual(*args, **kwargs) | [
"def",
"GetUseBestVisual",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetUseBestVisual",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L8099-L8105 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Configuration/Applications/python/ConfigBuilder.py | python | ConfigBuilder.prepare_HLT | (self, sequence = None) | Enrich the schedule with the HLT simulation step | Enrich the schedule with the HLT simulation step | [
"Enrich",
"the",
"schedule",
"with",
"the",
"HLT",
"simulation",
"step"
] | def prepare_HLT(self, sequence = None):
""" Enrich the schedule with the HLT simulation step"""
if not sequence:
print("no specification of the hlt menu has been given, should never happen")
raise Exception('no HLT sequence provided')
if '@' in sequence:
# c... | [
"def",
"prepare_HLT",
"(",
"self",
",",
"sequence",
"=",
"None",
")",
":",
"if",
"not",
"sequence",
":",
"print",
"(",
"\"no specification of the hlt menu has been given, should never happen\"",
")",
"raise",
"Exception",
"(",
"'no HLT sequence provided'",
")",
"if",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Configuration/Applications/python/ConfigBuilder.py#L1529-L1584 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/multiarray.py | python | kron | (a, b) | return _mx_nd_np.kron(a, b) | r"""Kronecker product of two arrays.
Computes the Kronecker product, a composite array made of blocks of the
second array scaled by the first.
Parameters
----------
a, b : ndarray
Returns
-------
out : ndarray
See Also
--------
outer : The outer product
.. note::
... | r"""Kronecker product of two arrays. | [
"r",
"Kronecker",
"product",
"of",
"two",
"arrays",
"."
] | def kron(a, b):
r"""Kronecker product of two arrays.
Computes the Kronecker product, a composite array made of blocks of the
second array scaled by the first.
Parameters
----------
a, b : ndarray
Returns
-------
out : ndarray
See Also
--------
outer : The outer produc... | [
"def",
"kron",
"(",
"a",
",",
"b",
")",
":",
"return",
"_mx_nd_np",
".",
"kron",
"(",
"a",
",",
"b",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L10131-L10177 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/android_commands.py | python | AndroidCommands.SetFileContents | (self, filename, contents) | Writes |contents| to the file specified by |filename|. | Writes |contents| to the file specified by |filename|. | [
"Writes",
"|contents|",
"to",
"the",
"file",
"specified",
"by",
"|filename|",
"."
] | def SetFileContents(self, filename, contents):
"""Writes |contents| to the file specified by |filename|."""
with tempfile.NamedTemporaryFile() as f:
f.write(contents)
f.flush()
self._adb.Push(f.name, filename) | [
"def",
"SetFileContents",
"(",
"self",
",",
"filename",
",",
"contents",
")",
":",
"with",
"tempfile",
".",
"NamedTemporaryFile",
"(",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"contents",
")",
"f",
".",
"flush",
"(",
")",
"self",
".",
"_adb",
"."... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/android_commands.py#L1047-L1052 | ||
bayandin/chromedriver | d40a2092b50f2fca817221eeb5ea093e0e642c10 | log_replay/client_replay.py | python | _Payload.__init__ | (self, payload_string) | Initialize the payload object.
Parses the payload, represented as a string, into a Python object.
Payloads appear in the log as a multi-line (usually) JSON string starting
on the header line, like the following, where the payload starts after the
word InitSession:
[1532467931.153][INFO]: [<session... | Initialize the payload object. | [
"Initialize",
"the",
"payload",
"object",
"."
] | def __init__(self, payload_string):
"""Initialize the payload object.
Parses the payload, represented as a string, into a Python object.
Payloads appear in the log as a multi-line (usually) JSON string starting
on the header line, like the following, where the payload starts after the
word InitSes... | [
"def",
"__init__",
"(",
"self",
",",
"payload_string",
")",
":",
"self",
".",
"is_empty",
"=",
"not",
"payload_string",
"self",
".",
"is_error",
"=",
"not",
"self",
".",
"is_empty",
"and",
"payload_string",
"[",
":",
"5",
"]",
"==",
"\"ERROR\"",
"if",
"s... | https://github.com/bayandin/chromedriver/blob/d40a2092b50f2fca817221eeb5ea093e0e642c10/log_replay/client_replay.py#L387-L416 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/client/timeline.py | python | Timeline._is_gputrace_device | (self, device_name) | return '/stream:' in device_name or '/memcpy' in device_name | Returns true if this device is part of the GPUTracer logging. | Returns true if this device is part of the GPUTracer logging. | [
"Returns",
"true",
"if",
"this",
"device",
"is",
"part",
"of",
"the",
"GPUTracer",
"logging",
"."
] | def _is_gputrace_device(self, device_name):
"""Returns true if this device is part of the GPUTracer logging."""
return '/stream:' in device_name or '/memcpy' in device_name | [
"def",
"_is_gputrace_device",
"(",
"self",
",",
"device_name",
")",
":",
"return",
"'/stream:'",
"in",
"device_name",
"or",
"'/memcpy'",
"in",
"device_name"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/timeline.py#L476-L478 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridCellEditor.GetCellAttr | (*args, **kwargs) | return _grid.GridCellEditor_GetCellAttr(*args, **kwargs) | GetCellAttr(self) -> GridCellAttr | GetCellAttr(self) -> GridCellAttr | [
"GetCellAttr",
"(",
"self",
")",
"-",
">",
"GridCellAttr"
] | def GetCellAttr(*args, **kwargs):
"""GetCellAttr(self) -> GridCellAttr"""
return _grid.GridCellEditor_GetCellAttr(*args, **kwargs) | [
"def",
"GetCellAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellEditor_GetCellAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L276-L278 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/string.py | python | lower | (s) | return s.lower() | lower(s) -> string
Return a copy of the string s converted to lowercase. | lower(s) -> string | [
"lower",
"(",
"s",
")",
"-",
">",
"string"
] | def lower(s):
"""lower(s) -> string
Return a copy of the string s converted to lowercase.
"""
return s.lower() | [
"def",
"lower",
"(",
"s",
")",
":",
"return",
"s",
".",
"lower",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/string.py#L220-L226 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py | python | accept_line | (event) | Accept the line regardless of where the cursor is. | Accept the line regardless of where the cursor is. | [
"Accept",
"the",
"line",
"regardless",
"of",
"where",
"the",
"cursor",
"is",
"."
] | def accept_line(event):
" Accept the line regardless of where the cursor is. "
b = event.current_buffer
b.accept_action.validate_and_handle(event.cli, b) | [
"def",
"accept_line",
"(",
"event",
")",
":",
"b",
"=",
"event",
".",
"current_buffer",
"b",
".",
"accept_action",
".",
"validate_and_handle",
"(",
"event",
".",
"cli",
",",
"b",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py#L129-L132 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_logic_parser.py | python | p_atom_symbol_lp_terms_rp | (p) | atom : SYMBOL LPAREN terms RPAREN | atom : SYMBOL LPAREN terms RPAREN | [
"atom",
":",
"SYMBOL",
"LPAREN",
"terms",
"RPAREN"
] | def p_atom_symbol_lp_terms_rp(p):
'atom : SYMBOL LPAREN terms RPAREN'
p[0] = Atom(p[1],p[3])
p[0].lineno = get_lineno(p,1) | [
"def",
"p_atom_symbol_lp_terms_rp",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"Atom",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"3",
"]",
")",
"p",
"[",
"0",
"]",
".",
"lineno",
"=",
"get_lineno",
"(",
"p",
",",
"1",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_parser.py#L282-L285 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py | python | summarize_address_range | (first, last) | Summarize a network range given the first and last IP addresses.
Example:
>>> list(summarize_address_range(IPv4Address('192.0.2.0'),
... IPv4Address('192.0.2.130')))
... #doctest: +NORMALIZE_WHITESPACE
[IPv4Network('192.0.2... | Summarize a network range given the first and last IP addresses. | [
"Summarize",
"a",
"network",
"range",
"given",
"the",
"first",
"and",
"last",
"IP",
"addresses",
"."
] | def summarize_address_range(first, last):
"""Summarize a network range given the first and last IP addresses.
Example:
>>> list(summarize_address_range(IPv4Address('192.0.2.0'),
... IPv4Address('192.0.2.130')))
... #doctest: +N... | [
"def",
"summarize_address_range",
"(",
"first",
",",
"last",
")",
":",
"if",
"(",
"not",
"(",
"isinstance",
"(",
"first",
",",
"_BaseAddress",
")",
"and",
"isinstance",
"(",
"last",
",",
"_BaseAddress",
")",
")",
")",
":",
"raise",
"TypeError",
"(",
"'fi... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py#L322-L374 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsGradientStops.Add | (*args) | return _gdi_.GraphicsGradientStops_Add(*args) | Add(self, GraphicsGradientStop stop)
Add(self, Colour col, float pos) | Add(self, GraphicsGradientStop stop)
Add(self, Colour col, float pos) | [
"Add",
"(",
"self",
"GraphicsGradientStop",
"stop",
")",
"Add",
"(",
"self",
"Colour",
"col",
"float",
"pos",
")"
] | def Add(*args):
"""
Add(self, GraphicsGradientStop stop)
Add(self, Colour col, float pos)
"""
return _gdi_.GraphicsGradientStops_Add(*args) | [
"def",
"Add",
"(",
"*",
"args",
")",
":",
"return",
"_gdi_",
".",
"GraphicsGradientStops_Add",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6083-L6088 | |
RcppCore/RcppParallel | ff49e84602a1771c06bc39fdea995447564f2b7f | src/tbb/python/tbb/pool.py | python | Pool.imap_unordered_async | (self, func, iterable, chunksize=None,
callback=None) | return apply_result | A variant of the imap_unordered() method which returns an
ApplyResult object that provides an iterator (next
method(timeout) available).
If callback is specified then it should be a callable which
accepts a single argument. When the resulting iterator becomes
ready, callback is ... | A variant of the imap_unordered() method which returns an
ApplyResult object that provides an iterator (next
method(timeout) available). | [
"A",
"variant",
"of",
"the",
"imap_unordered",
"()",
"method",
"which",
"returns",
"an",
"ApplyResult",
"object",
"that",
"provides",
"an",
"iterator",
"(",
"next",
"method",
"(",
"timeout",
")",
"available",
")",
"."
] | def imap_unordered_async(self, func, iterable, chunksize=None,
callback=None):
"""A variant of the imap_unordered() method which returns an
ApplyResult object that provides an iterator (next
method(timeout) available).
If callback is specified then it should... | [
"def",
"imap_unordered_async",
"(",
"self",
",",
"func",
",",
"iterable",
",",
"chunksize",
"=",
"None",
",",
"callback",
"=",
"None",
")",
":",
"apply_result",
"=",
"ApplyResult",
"(",
"callback",
"=",
"callback",
")",
"collector",
"=",
"UnorderedResultCollec... | https://github.com/RcppCore/RcppParallel/blob/ff49e84602a1771c06bc39fdea995447564f2b7f/src/tbb/python/tbb/pool.py#L189-L204 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Image.InitAlpha | (*args, **kwargs) | return _core_.Image_InitAlpha(*args, **kwargs) | InitAlpha(self)
Initializes the image alpha channel data. It is an error to call it if
the image already has alpha data. If it doesn't, alpha data will be by
default initialized to all pixels being fully opaque. But if the image
has a a mask colour, all mask pixels will be completely tr... | InitAlpha(self) | [
"InitAlpha",
"(",
"self",
")"
] | def InitAlpha(*args, **kwargs):
"""
InitAlpha(self)
Initializes the image alpha channel data. It is an error to call it if
the image already has alpha data. If it doesn't, alpha data will be by
default initialized to all pixels being fully opaque. But if the image
has a ... | [
"def",
"InitAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_InitAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L3076-L3085 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeOutputFileName | (self, spec, type=None) | Compute the filename of the final output for the current target. | Compute the filename of the final output for the current target. | [
"Compute",
"the",
"filename",
"of",
"the",
"final",
"output",
"for",
"the",
"current",
"target",
"."
] | def ComputeOutputFileName(self, spec, type=None):
"""Compute the filename of the final output for the current target."""
if not type:
type = spec['type']
default_variables = copy.copy(generator_default_variables)
CalculateVariables(default_variables, {'flavor': self.flavor})
# Compute filena... | [
"def",
"ComputeOutputFileName",
"(",
"self",
",",
"spec",
",",
"type",
"=",
"None",
")",
":",
"if",
"not",
"type",
":",
"type",
"=",
"spec",
"[",
"'type'",
"]",
"default_variables",
"=",
"copy",
".",
"copy",
"(",
"generator_default_variables",
")",
"Calcul... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L1068-L1116 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/pool.py | python | Pool._map_async | (self, func, iterable, mapper, chunksize=None, callback=None,
error_callback=None) | return result | Helper function to implement map, starmap and their async counterparts. | Helper function to implement map, starmap and their async counterparts. | [
"Helper",
"function",
"to",
"implement",
"map",
"starmap",
"and",
"their",
"async",
"counterparts",
"."
] | def _map_async(self, func, iterable, mapper, chunksize=None, callback=None,
error_callback=None):
'''
Helper function to implement map, starmap and their async counterparts.
'''
if self._state != RUN:
raise ValueError("Pool not running")
if not hasattr(ite... | [
"def",
"_map_async",
"(",
"self",
",",
"func",
",",
"iterable",
",",
"mapper",
",",
"chunksize",
"=",
"None",
",",
"callback",
"=",
"None",
",",
"error_callback",
"=",
"None",
")",
":",
"if",
"self",
".",
"_state",
"!=",
"RUN",
":",
"raise",
"ValueErro... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/pool.py#L375-L403 | |
amerkoleci/alimer | 4909b9563341bdc5777bf3c76db91bdb5d67830f | src/ThirdParty/glslang/update_glslang_sources.py | python | GetGoodCommits | (site) | Returns the latest list of GoodCommit objects. | Returns the latest list of GoodCommit objects. | [
"Returns",
"the",
"latest",
"list",
"of",
"GoodCommit",
"objects",
"."
] | def GetGoodCommits(site):
"""Returns the latest list of GoodCommit objects."""
known_good_file = SITE_TO_KNOWN_GOOD_FILE[site]
with open(known_good_file) as known_good:
return [GoodCommit(c) for c in json.loads(known_good.read())['commits']] | [
"def",
"GetGoodCommits",
"(",
"site",
")",
":",
"known_good_file",
"=",
"SITE_TO_KNOWN_GOOD_FILE",
"[",
"site",
"]",
"with",
"open",
"(",
"known_good_file",
")",
"as",
"known_good",
":",
"return",
"[",
"GoodCommit",
"(",
"c",
")",
"for",
"c",
"in",
"json",
... | https://github.com/amerkoleci/alimer/blob/4909b9563341bdc5777bf3c76db91bdb5d67830f/src/ThirdParty/glslang/update_glslang_sources.py#L124-L128 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/recfunctions.py | python | _izip_fields_flat | (iterable) | Returns an iterator of concatenated fields from a sequence of arrays,
collapsing any nested structure. | Returns an iterator of concatenated fields from a sequence of arrays,
collapsing any nested structure. | [
"Returns",
"an",
"iterator",
"of",
"concatenated",
"fields",
"from",
"a",
"sequence",
"of",
"arrays",
"collapsing",
"any",
"nested",
"structure",
"."
] | def _izip_fields_flat(iterable):
"""
Returns an iterator of concatenated fields from a sequence of arrays,
collapsing any nested structure.
"""
for element in iterable:
if isinstance(element, np.void):
for f in _izip_fields_flat(tuple(element)):
yield f
e... | [
"def",
"_izip_fields_flat",
"(",
"iterable",
")",
":",
"for",
"element",
"in",
"iterable",
":",
"if",
"isinstance",
"(",
"element",
",",
"np",
".",
"void",
")",
":",
"for",
"f",
"in",
"_izip_fields_flat",
"(",
"tuple",
"(",
"element",
")",
")",
":",
"y... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/recfunctions.py#L287-L298 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/generator/msvs.py | python | _VerifySourcesExist | (sources, root_dir) | return missing_sources | Verifies that all source files exist on disk.
Checks that all regular source files, i.e. not created at run time,
exist on disk. Missing files cause needless recompilation but no otherwise
visible errors.
Arguments:
sources: A recursive list of Filter/file names.
root_dir: The root directory for the ... | Verifies that all source files exist on disk. | [
"Verifies",
"that",
"all",
"source",
"files",
"exist",
"on",
"disk",
"."
] | def _VerifySourcesExist(sources, root_dir):
"""Verifies that all source files exist on disk.
Checks that all regular source files, i.e. not created at run time,
exist on disk. Missing files cause needless recompilation but no otherwise
visible errors.
Arguments:
sources: A recursive list of Filter/file... | [
"def",
"_VerifySourcesExist",
"(",
"sources",
",",
"root_dir",
")",
":",
"missing_sources",
"=",
"[",
"]",
"for",
"source",
"in",
"sources",
":",
"if",
"isinstance",
"(",
"source",
",",
"MSVS",
".",
"Filter",
")",
":",
"missing_sources",
".",
"extend",
"("... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/msvs.py#L2843-L2865 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/environment.py | python | Environment.compile_templates | (
self,
target: t.Union[str, os.PathLike],
extensions: t.Optional[t.Collection[str]] = None,
filter_func: t.Optional[t.Callable[[str], bool]] = None,
zip: t.Optional[str] = "deflated",
log_function: t.Optional[t.Callable[[str], None]] = None,
ignore_errors: bool =... | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | [
"Finds",
"all",
"the",
"templates",
"the",
"loader",
"can",
"find",
"compiles",
"them",
"and",
"stores",
"them",
"in",
"target",
".",
"If",
"zip",
"is",
"None",
"instead",
"of",
"in",
"a",
"zipfile",
"the",
"templates",
"will",
"be",
"stored",
"in",
"a",... | def compile_templates(
self,
target: t.Union[str, os.PathLike],
extensions: t.Optional[t.Collection[str]] = None,
filter_func: t.Optional[t.Callable[[str], bool]] = None,
zip: t.Optional[str] = "deflated",
log_function: t.Optional[t.Callable[[str], None]] = None,
... | [
"def",
"compile_templates",
"(",
"self",
",",
"target",
":",
"t",
".",
"Union",
"[",
"str",
",",
"os",
".",
"PathLike",
"]",
",",
"extensions",
":",
"t",
".",
"Optional",
"[",
"t",
".",
"Collection",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"filter_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/environment.py#L804-L880 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | python | MacTool._InstallEntitlements | (self, entitlements, substitutions, overrides) | return target_path | Generates and install the ${BundleName}.xcent entitlements file.
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated plist to "${BundlePath}.xcent".
Args:
entitlements: string, optional, p... | Generates and install the ${BundleName}.xcent entitlements file. | [
"Generates",
"and",
"install",
"the",
"$",
"{",
"BundleName",
"}",
".",
"xcent",
"entitlements",
"file",
"."
] | def _InstallEntitlements(self, entitlements, substitutions, overrides):
"""Generates and install the ${BundleName}.xcent entitlements file.
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated pli... | [
"def",
"_InstallEntitlements",
"(",
"self",
",",
"entitlements",
",",
"substitutions",
",",
"overrides",
")",
":",
"source_path",
"=",
"entitlements",
"target_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'BUILT_PRODUCTS_DIR'",
"... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L553-L585 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/rostime.py | python | TVal.set | (self, secs, nsecs) | Set time using separate secs and nsecs values
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds, ``int`` | Set time using separate secs and nsecs values
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds, ``int`` | [
"Set",
"time",
"using",
"separate",
"secs",
"and",
"nsecs",
"values",
":",
"param",
"secs",
":",
"seconds",
"since",
"epoch",
"int",
":",
"param",
"nsecs",
":",
"nanoseconds",
"since",
"seconds",
"int"
] | def set(self, secs, nsecs):
"""
Set time using separate secs and nsecs values
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds, ``int``
"""
self.secs = secs
self.nsecs = nsecs | [
"def",
"set",
"(",
"self",
",",
"secs",
",",
"nsecs",
")",
":",
"self",
".",
"secs",
"=",
"secs",
"self",
".",
"nsecs",
"=",
"nsecs"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/rostime.py#L86-L94 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/storage.py | python | TypedStorage.tolist | (self) | return list(self) | Returns a list containing the elements of this storage | Returns a list containing the elements of this storage | [
"Returns",
"a",
"list",
"containing",
"the",
"elements",
"of",
"this",
"storage"
] | def tolist(self):
"""Returns a list containing the elements of this storage"""
return list(self) | [
"def",
"tolist",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/storage.py#L459-L461 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/ftplib.py | python | FTP.retrbinary | (self, cmd, callback, blocksize=8192, rest=None) | return self.voidresp() | Retrieve data in binary mode. A new port is created for you.
Args:
cmd: A RETR command.
callback: A single parameter callable to be called on each
block of data read.
blocksize: The maximum number of bytes to read from the
socket at one ti... | Retrieve data in binary mode. A new port is created for you. | [
"Retrieve",
"data",
"in",
"binary",
"mode",
".",
"A",
"new",
"port",
"is",
"created",
"for",
"you",
"."
] | def retrbinary(self, cmd, callback, blocksize=8192, rest=None):
"""Retrieve data in binary mode. A new port is created for you.
Args:
cmd: A RETR command.
callback: A single parameter callable to be called on each
block of data read.
blocksize: The max... | [
"def",
"retrbinary",
"(",
"self",
",",
"cmd",
",",
"callback",
",",
"blocksize",
"=",
"8192",
",",
"rest",
"=",
"None",
")",
":",
"self",
".",
"voidcmd",
"(",
"'TYPE I'",
")",
"with",
"self",
".",
"transfercmd",
"(",
"cmd",
",",
"rest",
")",
"as",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ftplib.py#L421-L445 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/masked/maskededit.py | python | MaskedEditMixin._fixSelection | (self) | This gets called after the TAB traversal selection is made, if the
focus event was due to this, but before the EVT_LEFT_* events if
the focus shift was due to a mouse event.
The trouble is that, a priori, there's no explicit notification of
why the focus event we received. However, the... | This gets called after the TAB traversal selection is made, if the
focus event was due to this, but before the EVT_LEFT_* events if
the focus shift was due to a mouse event. | [
"This",
"gets",
"called",
"after",
"the",
"TAB",
"traversal",
"selection",
"is",
"made",
"if",
"the",
"focus",
"event",
"was",
"due",
"to",
"this",
"but",
"before",
"the",
"EVT_LEFT_",
"*",
"events",
"if",
"the",
"focus",
"shift",
"was",
"due",
"to",
"a"... | def _fixSelection(self):
"""
This gets called after the TAB traversal selection is made, if the
focus event was due to this, but before the EVT_LEFT_* events if
the focus shift was due to a mouse event.
The trouble is that, a priori, there's no explicit notification of
w... | [
"def",
"_fixSelection",
"(",
"self",
")",
":",
"## dbg('MaskedEditMixin::_fixSelection', indent=1)",
"# can get here if called with wx.CallAfter after underlying ",
"# control has been destroyed on close, but after focus",
"# events",
"if",
"not",
"self",
"or",
"not",
"self",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/maskededit.py#L5572-L5642 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.HasExplicitIdlRulesOrActions | (self, spec) | return (self._HasExplicitRuleForExtension(spec, 'idl') or
self._HasExplicitIdlActions(spec)) | Determine if there's an explicit rule or action for idl files. When
there isn't we need to generate implicit rules to build MIDL .idl files. | Determine if there's an explicit rule or action for idl files. When
there isn't we need to generate implicit rules to build MIDL .idl files. | [
"Determine",
"if",
"there",
"s",
"an",
"explicit",
"rule",
"or",
"action",
"for",
"idl",
"files",
".",
"When",
"there",
"isn",
"t",
"we",
"need",
"to",
"generate",
"implicit",
"rules",
"to",
"build",
"MIDL",
".",
"idl",
"files",
"."
] | def HasExplicitIdlRulesOrActions(self, spec):
"""Determine if there's an explicit rule or action for idl files. When
there isn't we need to generate implicit rules to build MIDL .idl files."""
return (self._HasExplicitRuleForExtension(spec, 'idl') or
self._HasExplicitIdlActions(spec)) | [
"def",
"HasExplicitIdlRulesOrActions",
"(",
"self",
",",
"spec",
")",
":",
"return",
"(",
"self",
".",
"_HasExplicitRuleForExtension",
"(",
"spec",
",",
"'idl'",
")",
"or",
"self",
".",
"_HasExplicitIdlActions",
"(",
"spec",
")",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L840-L844 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextObject.GetTextForRange | (*args, **kwargs) | return _richtext.RichTextObject_GetTextForRange(*args, **kwargs) | GetTextForRange(self, RichTextRange range) -> String | GetTextForRange(self, RichTextRange range) -> String | [
"GetTextForRange",
"(",
"self",
"RichTextRange",
"range",
")",
"-",
">",
"String"
] | def GetTextForRange(*args, **kwargs):
"""GetTextForRange(self, RichTextRange range) -> String"""
return _richtext.RichTextObject_GetTextForRange(*args, **kwargs) | [
"def",
"GetTextForRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_GetTextForRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1234-L1236 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | examples/pycaffe/tools.py | python | CaffeSolver.write | (self, filepath) | Export solver parameters to INPUT "filepath". Sorted alphabetically. | Export solver parameters to INPUT "filepath". Sorted alphabetically. | [
"Export",
"solver",
"parameters",
"to",
"INPUT",
"filepath",
".",
"Sorted",
"alphabetically",
"."
] | def write(self, filepath):
"""
Export solver parameters to INPUT "filepath". Sorted alphabetically.
"""
f = open(filepath, 'w')
for key, value in sorted(self.sp.items()):
if not(type(value) is str):
raise TypeError('All solver parameters must be string... | [
"def",
"write",
"(",
"self",
",",
"filepath",
")",
":",
"f",
"=",
"open",
"(",
"filepath",
",",
"'w'",
")",
"for",
"key",
",",
"value",
"in",
"sorted",
"(",
"self",
".",
"sp",
".",
"items",
"(",
")",
")",
":",
"if",
"not",
"(",
"type",
"(",
"... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/examples/pycaffe/tools.py#L113-L121 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGridInterface.GetIterator | (*args) | return _propgrid.PropertyGridInterface_GetIterator(*args) | GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGridIterator
GetIterator(self, int flag... | GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGridIterator
GetIterator(self, int flag... | [
"GetIterator",
"(",
"self",
"int",
"flags",
"=",
"PG_ITERATE_DEFAULT",
"PGProperty",
"firstProp",
"=",
"None",
")",
"-",
">",
"PropertyGridIterator",
"GetIterator",
"(",
"self",
"int",
"flags",
"=",
"PG_ITERATE_DEFAULT",
"PGProperty",
"firstProp",
"=",
"None",
")"... | def GetIterator(*args):
"""
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridIterator
GetIterator(self, int flags=PG_ITERATE_DEFAULT, PGProperty firstProp=None) -> PropertyGridConstIterator
GetIterator(self, int flags, int startPos) -> PropertyGri... | [
"def",
"GetIterator",
"(",
"*",
"args",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetIterator",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1167-L1174 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/execution_callbacks.py | python | InfOrNanError.__init__ | (self,
op_type,
op_name,
output_index,
num_outputs,
value) | Constructor of InfOrNanError.
Args:
op_type: Type name of the op that generated the tensor with
`inf`(s) or `nan`(s) (e.g., `Div`).
op_name: Name of the op that generated the tensor with `inf`(s) or
`nan`(s). This name is set by client and can be `None` if it is unset.
output_inde... | Constructor of InfOrNanError. | [
"Constructor",
"of",
"InfOrNanError",
"."
] | def __init__(self,
op_type,
op_name,
output_index,
num_outputs,
value):
"""Constructor of InfOrNanError.
Args:
op_type: Type name of the op that generated the tensor with
`inf`(s) or `nan`(s) (e.g., `Div`).
op_name: ... | [
"def",
"__init__",
"(",
"self",
",",
"op_type",
",",
"op_name",
",",
"output_index",
",",
"num_outputs",
",",
"value",
")",
":",
"self",
".",
"_op_type",
"=",
"op_type",
"self",
".",
"_op_name",
"=",
"op_name",
"self",
".",
"_output_index",
"=",
"output_in... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/execution_callbacks.py#L58-L86 | ||
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/scripts/cpp_lint.py | python | _NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L1940-L1946 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/experimental/accelerator_partitioner.py | python | Partitioner.aot_based_partition | (
self, node_to_partition_mapping, partition_to_logical_device_mapping
) | This function helps to rebuild the partitions given the nodes and its
corresponding partition id | This function helps to rebuild the partitions given the nodes and its
corresponding partition id | [
"This",
"function",
"helps",
"to",
"rebuild",
"the",
"partitions",
"given",
"the",
"nodes",
"and",
"its",
"corresponding",
"partition",
"id"
] | def aot_based_partition(
self, node_to_partition_mapping, partition_to_logical_device_mapping
):
"""This function helps to rebuild the partitions given the nodes and its
corresponding partition id
"""
partition_id_to_partition_mapping: Dict[int, Partition] = {}
self.n... | [
"def",
"aot_based_partition",
"(",
"self",
",",
"node_to_partition_mapping",
",",
"partition_to_logical_device_mapping",
")",
":",
"partition_id_to_partition_mapping",
":",
"Dict",
"[",
"int",
",",
"Partition",
"]",
"=",
"{",
"}",
"self",
".",
"node_to_partition",
"="... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/accelerator_partitioner.py#L1059-L1082 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.