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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | protobuf/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeInt32 | (self) | return result | Consumes a signed 32bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 32bit integer couldn't be consumed. | Consumes a signed 32bit integer number. | [
"Consumes",
"a",
"signed",
"32bit",
"integer",
"number",
"."
] | def ConsumeInt32(self):
"""Consumes a signed 32bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 32bit integer couldn't be consumed.
"""
try:
result = ParseInteger(self.token, is_signed=True, is_long=False)
except ValueError, e:
raise self... | [
"def",
"ConsumeInt32",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"ParseInteger",
"(",
"self",
".",
"token",
",",
"is_signed",
"=",
"True",
",",
"is_long",
"=",
"False",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",
".",
"_ParseEr... | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/text_format.py#L599-L613 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | PyApp.WakeUpIdle | (*args, **kwargs) | return _core_.PyApp_WakeUpIdle(*args, **kwargs) | WakeUpIdle(self)
Make sure that idle events are sent again.
:see: `wx.WakeUpIdle` | WakeUpIdle(self) | [
"WakeUpIdle",
"(",
"self",
")"
] | def WakeUpIdle(*args, **kwargs):
"""
WakeUpIdle(self)
Make sure that idle events are sent again.
:see: `wx.WakeUpIdle`
"""
return _core_.PyApp_WakeUpIdle(*args, **kwargs) | [
"def",
"WakeUpIdle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_WakeUpIdle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7926-L7933 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py | python | BucketAccessControlsUpdate.RunWithArgs | (self, bucket, entity) | Updates an ACL entry on the specified bucket.
Args:
bucket: The name of the bucket.
entity: The entity holding the permission, in one of the following
forms: - user-userId - user-email - group-groupId - group-email -
domain-domain - project-team-projectId - allUsers -
al... | Updates an ACL entry on the specified bucket. | [
"Updates",
"an",
"ACL",
"entry",
"on",
"the",
"specified",
"bucket",
"."
] | def RunWithArgs(self, bucket, entity):
"""Updates an ACL entry on the specified bucket.
Args:
bucket: The name of the bucket.
entity: The entity holding the permission, in one of the following
forms: - user-userId - user-email - group-groupId - group-email -
domain-domain - pr... | [
"def",
"RunWithArgs",
"(",
"self",
",",
"bucket",
",",
"entity",
")",
":",
"client",
"=",
"GetClientFromFlags",
"(",
")",
"global_params",
"=",
"GetGlobalParamsFromFlags",
"(",
")",
"request",
"=",
"messages",
".",
"BucketAccessControl",
"(",
"bucket",
"=",
"b... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py#L538-L591 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/handlers.py | python | BufferedHandler.__init__ | (self, capacity, interval_secs) | Initialize the handler with the buffer size and timeout.
These values determine when the buffer is flushed regardless. | Initialize the handler with the buffer size and timeout. | [
"Initialize",
"the",
"handler",
"with",
"the",
"buffer",
"size",
"and",
"timeout",
"."
] | def __init__(self, capacity, interval_secs):
"""Initialize the handler with the buffer size and timeout.
These values determine when the buffer is flushed regardless.
"""
logging.Handler.__init__(self)
if not isinstance(capacity, int):
raise TypeError("capacity mus... | [
"def",
"__init__",
"(",
"self",
",",
"capacity",
",",
"interval_secs",
")",
":",
"logging",
".",
"Handler",
".",
"__init__",
"(",
"self",
")",
"if",
"not",
"isinstance",
"(",
"capacity",
",",
"int",
")",
":",
"raise",
"TypeError",
"(",
"\"capacity must be ... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/handlers.py#L35-L64 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/graph/lattice.py | python | Lattice.basis_vectors | (self) | return self._basis_vectors | Basis vectors of the lattice | Basis vectors of the lattice | [
"Basis",
"vectors",
"of",
"the",
"lattice"
] | def basis_vectors(self):
"""Basis vectors of the lattice"""
return self._basis_vectors | [
"def",
"basis_vectors",
"(",
"self",
")",
":",
"return",
"self",
".",
"_basis_vectors"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/lattice.py#L389-L391 | |
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/usb/control.py | python | get_descriptor | (dev, desc_size, desc_type, desc_index, wIndex = 0) | return desc | r"""Return the specified descriptor.
dev is the Device object to which the request will be
sent to.
desc_size is the descriptor size.
desc_type and desc_index are the descriptor type and index,
respectively. wIndex index is used for string descriptors
and represents the Language ID. For other... | r"""Return the specified descriptor. | [
"r",
"Return",
"the",
"specified",
"descriptor",
"."
] | def get_descriptor(dev, desc_size, desc_type, desc_index, wIndex = 0):
r"""Return the specified descriptor.
dev is the Device object to which the request will be
sent to.
desc_size is the descriptor size.
desc_type and desc_index are the descriptor type and index,
respectively. wIndex index i... | [
"def",
"get_descriptor",
"(",
"dev",
",",
"desc_size",
",",
"desc_type",
",",
"desc_index",
",",
"wIndex",
"=",
"0",
")",
":",
"wValue",
"=",
"desc_index",
"|",
"(",
"desc_type",
"<<",
"8",
")",
"bmRequestType",
"=",
"util",
".",
"build_request_type",
"(",... | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/control.py#L150-L180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/animate.py | python | AnimationBase.GetDelay | (*args, **kwargs) | return _animate.AnimationBase_GetDelay(*args, **kwargs) | GetDelay(self, int i) -> int | GetDelay(self, int i) -> int | [
"GetDelay",
"(",
"self",
"int",
"i",
")",
"-",
">",
"int"
] | def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs) | [
"def",
"GetDelay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_animate",
".",
"AnimationBase_GetDelay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/animate.py#L82-L84 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/AddonManager/AddonManager.py | python | CommandAddonManager.startup | (self) | Downloads the available packages listings and populates the table
This proceeds in four stages: first, the main GitHub repository is queried for a list of possible
addons. Each addon is specified as a git submodule with name and branch information. The actual specific
commit ID of the submodule... | Downloads the available packages listings and populates the table | [
"Downloads",
"the",
"available",
"packages",
"listings",
"and",
"populates",
"the",
"table"
] | def startup(self) -> None:
"""Downloads the available packages listings and populates the table
This proceeds in four stages: first, the main GitHub repository is queried for a list of possible
addons. Each addon is specified as a git submodule with name and branch information. The actual speci... | [
"def",
"startup",
"(",
"self",
")",
"->",
"None",
":",
"# Each function in this list is expected to launch a thread and connect its completion signal",
"# to self.do_next_startup_phase, or to shortcut to calling self.do_next_startup_phase if it",
"# is not launching a worker",
"self",
".",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/AddonManager/AddonManager.py#L508-L546 | ||
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | tools/extra/resize_and_crop_images.py | python | OpenCVResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256) | Takes an image name, resize it and crop the center square | Takes an image name, resize it and crop the center square | [
"Takes",
"an",
"image",
"name",
"resize",
"it",
"and",
"crop",
"the",
"center",
"square"
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256):
'''Takes an image name, resize it and crop the center square
'''
img = cv2.imread(input_file)
height, width, depth = img.shape
new_height = output_side_length
new_width = output_side_lengt... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
")",
":",
"img",
"=",
"cv2",
".",
"imread",
"(",
"input_file",
")",
"height",
",",
"width",
",",
"depth",
"=",
"img",
".",
"shape",
... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/tools/extra/resize_and_crop_images.py#L20-L36 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Sizer.ShowItems | (*args, **kwargs) | return _core_.Sizer_ShowItems(*args, **kwargs) | ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items. | ShowItems(self, bool show) | [
"ShowItems",
"(",
"self",
"bool",
"show",
")"
] | def ShowItems(*args, **kwargs):
"""
ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items.
"""
return _core_.Sizer_ShowItems(*args, **kwargs) | [
"def",
"ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14991-L14997 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/dir_util.py | python | remove_tree | (directory, verbose=1, dry_run=0) | Recursively remove an entire directory tree.
Any errors are ignored (apart from being reported to stdout if 'verbose'
is true). | Recursively remove an entire directory tree. | [
"Recursively",
"remove",
"an",
"entire",
"directory",
"tree",
"."
] | def remove_tree(directory, verbose=1, dry_run=0):
"""Recursively remove an entire directory tree.
Any errors are ignored (apart from being reported to stdout if 'verbose'
is true).
"""
global _path_created
if verbose >= 1:
log.info("removing '%s' (and everything under it)", directory)
... | [
"def",
"remove_tree",
"(",
"directory",
",",
"verbose",
"=",
"1",
",",
"dry_run",
"=",
"0",
")",
":",
"global",
"_path_created",
"if",
"verbose",
">=",
"1",
":",
"log",
".",
"info",
"(",
"\"removing '%s' (and everything under it)\"",
",",
"directory",
")",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/dir_util.py#L178-L200 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/RunDescriptor.py | python | RunDescriptor.get_workspace | (self) | Method returns workspace correspondent to current run number(s)
and loads this workspace if it has not been loaded
Returns Mantid pointer to the workspace, corresponding to this run number | Method returns workspace correspondent to current run number(s)
and loads this workspace if it has not been loaded | [
"Method",
"returns",
"workspace",
"correspondent",
"to",
"current",
"run",
"number",
"(",
"s",
")",
"and",
"loads",
"this",
"workspace",
"if",
"it",
"has",
"not",
"been",
"loaded"
] | def get_workspace(self):
"""Method returns workspace correspondent to current run number(s)
and loads this workspace if it has not been loaded
Returns Mantid pointer to the workspace, corresponding to this run number
"""
if not self._ws_name:
self._ws_name = se... | [
"def",
"get_workspace",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ws_name",
":",
"self",
".",
"_ws_name",
"=",
"self",
".",
"_build_ws_name",
"(",
")",
"if",
"self",
".",
"_ws_name",
"in",
"mtd",
":",
"ws",
"=",
"mtd",
"[",
"self",
".",
"_... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/RunDescriptor.py#L788-L819 | ||
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | scripts/cpp_lint.py | python | _FunctionState.Check | (self, error, filename, linenum) | Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check. | Report if too many lines in function body. | [
"Report",
"if",
"too",
"many",
"lines",
"in",
"function",
"body",
"."
] | def Check(self, error, filename, linenum):
"""Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check.
"""
if Match(r'T(EST|est)', self.current_function):
... | [
"def",
"Check",
"(",
"self",
",",
"error",
",",
"filename",
",",
"linenum",
")",
":",
"if",
"Match",
"(",
"r'T(EST|est)'",
",",
"self",
".",
"current_function",
")",
":",
"base_trigger",
"=",
"self",
".",
"_TEST_TRIGGER",
"else",
":",
"base_trigger",
"=",
... | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L836-L859 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/conv.py | python | conv.validate_arguments | (self) | Checks that both arguments are vectors, and the first is constant. | Checks that both arguments are vectors, and the first is constant. | [
"Checks",
"that",
"both",
"arguments",
"are",
"vectors",
"and",
"the",
"first",
"is",
"constant",
"."
] | def validate_arguments(self) -> None:
"""Checks that both arguments are vectors, and the first is constant.
"""
if not self.args[0].is_vector() or not self.args[1].is_vector():
raise ValueError("The arguments to conv must resolve to vectors.")
if not self.args[0].is_constant(... | [
"def",
"validate_arguments",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"args",
"[",
"0",
"]",
".",
"is_vector",
"(",
")",
"or",
"not",
"self",
".",
"args",
"[",
"1",
"]",
".",
"is_vector",
"(",
")",
":",
"raise",
"ValueError",
... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/conv.py#L61-L67 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/tools/scan-build-py/libscanbuild/clang.py | python | is_ctu_capable | (extdef_map_cmd) | return True | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | [
"Detects",
"if",
"the",
"current",
"(",
"or",
"given",
")",
"clang",
"and",
"external",
"definition",
"mapping",
"executables",
"are",
"CTU",
"compatible",
"."
] | def is_ctu_capable(extdef_map_cmd):
""" Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. """
try:
run_command([extdef_map_cmd, '-version'])
except (OSError, subprocess.CalledProcessError):
return False
return True | [
"def",
"is_ctu_capable",
"(",
"extdef_map_cmd",
")",
":",
"try",
":",
"run_command",
"(",
"[",
"extdef_map_cmd",
",",
"'-version'",
"]",
")",
"except",
"(",
"OSError",
",",
"subprocess",
".",
"CalledProcessError",
")",
":",
"return",
"False",
"return",
"True"
... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libscanbuild/clang.py#L164-L172 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/module/init.py | python | calculate_fan_in_and_fan_out | (tensor: Tensor) | return fan_in, fan_out | r"""Calculates fan_in / fan_out value for given weight tensor. This function assumes
input tensor is stored in ``NCHW`` format.
Note:
The group conv2d kernel shape in MegEngine is ``(G, O/G, I/G, K, K)``. This
function calculates ``fan_out = O/G * K * K`` as default, but PyTorch uses
``... | r"""Calculates fan_in / fan_out value for given weight tensor. This function assumes
input tensor is stored in ``NCHW`` format. | [
"r",
"Calculates",
"fan_in",
"/",
"fan_out",
"value",
"for",
"given",
"weight",
"tensor",
".",
"This",
"function",
"assumes",
"input",
"tensor",
"is",
"stored",
"in",
"NCHW",
"format",
"."
] | def calculate_fan_in_and_fan_out(tensor: Tensor) -> Tuple[float, float]:
r"""Calculates fan_in / fan_out value for given weight tensor. This function assumes
input tensor is stored in ``NCHW`` format.
Note:
The group conv2d kernel shape in MegEngine is ``(G, O/G, I/G, K, K)``. This
function... | [
"def",
"calculate_fan_in_and_fan_out",
"(",
"tensor",
":",
"Tensor",
")",
"->",
"Tuple",
"[",
"float",
",",
"float",
"]",
":",
"shape",
"=",
"tensor",
".",
"shape",
"ndim",
"=",
"len",
"(",
"shape",
")",
"if",
"ndim",
"<",
"2",
":",
"raise",
"ValueErro... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/module/init.py#L125-L160 | |
hyperledger-archives/iroha | ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9 | example/python/tx-example.py | python | create_domain_and_asset | () | Creates domain 'domain' and asset 'coin#domain' with precision 2 | Creates domain 'domain' and asset 'coin#domain' with precision 2 | [
"Creates",
"domain",
"domain",
"and",
"asset",
"coin#domain",
"with",
"precision",
"2"
] | def create_domain_and_asset():
"""
Creates domain 'domain' and asset 'coin#domain' with precision 2
"""
commands = [
iroha.command('CreateDomain', domain_id='domain', default_role='user'),
iroha.command('CreateAsset', asset_name='coin',
domain_id='domain', precision... | [
"def",
"create_domain_and_asset",
"(",
")",
":",
"commands",
"=",
"[",
"iroha",
".",
"command",
"(",
"'CreateDomain'",
",",
"domain_id",
"=",
"'domain'",
",",
"default_role",
"=",
"'user'",
")",
",",
"iroha",
".",
"command",
"(",
"'CreateAsset'",
",",
"asset... | https://github.com/hyperledger-archives/iroha/blob/ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9/example/python/tx-example.py#L49-L60 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/observer.py | python | Observable.has_changed | (self) | return self.changed | Return whether the object has changed. | Return whether the object has changed. | [
"Return",
"whether",
"the",
"object",
"has",
"changed",
"."
] | def has_changed(self):
"""
Return whether the object has changed.
"""
return self.changed | [
"def",
"has_changed",
"(",
"self",
")",
":",
"return",
"self",
".",
"changed"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/observer.py#L88-L92 | |
numenta/nupic.core | 949950cf2c6d8d894c7eabfa2860aae679bf91f7 | bindings/py/src/nupic/bindings/regions/PyRegion.py | python | PyRegion.serializeExtraData | (self, filePath) | This method is called during network serialization with an external
filename that can be used to bypass pickle for saving large binary states.
:param filePath: (string) full filepath and name | This method is called during network serialization with an external
filename that can be used to bypass pickle for saving large binary states. | [
"This",
"method",
"is",
"called",
"during",
"network",
"serialization",
"with",
"an",
"external",
"filename",
"that",
"can",
"be",
"used",
"to",
"bypass",
"pickle",
"for",
"saving",
"large",
"binary",
"states",
"."
] | def serializeExtraData(self, filePath):
"""This method is called during network serialization with an external
filename that can be used to bypass pickle for saving large binary states.
:param filePath: (string) full filepath and name
"""
pass | [
"def",
"serializeExtraData",
"(",
"self",
",",
"filePath",
")",
":",
"pass"
] | https://github.com/numenta/nupic.core/blob/949950cf2c6d8d894c7eabfa2860aae679bf91f7/bindings/py/src/nupic/bindings/regions/PyRegion.py#L309-L315 | ||
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Diagnostic.category_name | (self) | return conf.lib.clang_getDiagnosticCategoryName(self.category_number) | The string name of the category for this diagnostic. | The string name of the category for this diagnostic. | [
"The",
"string",
"name",
"of",
"the",
"category",
"for",
"this",
"diagnostic",
"."
] | def category_name(self):
"""The string name of the category for this diagnostic."""
return conf.lib.clang_getDiagnosticCategoryName(self.category_number) | [
"def",
"category_name",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticCategoryName",
"(",
"self",
".",
"category_number",
")"
] | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L345-L347 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_PolicyDuplicationSelect_REQUEST.initFromTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def initFromTpm(self, buf):
""" TpmMarshaller method """
self.objectName = buf.readSizedByteBuf()
self.newParentName = buf.readSizedByteBuf()
self.includeObject = buf.readByte() | [
"def",
"initFromTpm",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"objectName",
"=",
"buf",
".",
"readSizedByteBuf",
"(",
")",
"self",
".",
"newParentName",
"=",
"buf",
".",
"readSizedByteBuf",
"(",
")",
"self",
".",
"includeObject",
"=",
"buf",
".",... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L14876-L14880 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Rect2D.ContainsRect | (*args, **kwargs) | return _core_.Rect2D_ContainsRect(*args, **kwargs) | ContainsRect(self, Rect2D rect) -> bool | ContainsRect(self, Rect2D rect) -> bool | [
"ContainsRect",
"(",
"self",
"Rect2D",
"rect",
")",
"-",
">",
"bool"
] | def ContainsRect(*args, **kwargs):
"""ContainsRect(self, Rect2D rect) -> bool"""
return _core_.Rect2D_ContainsRect(*args, **kwargs) | [
"def",
"ContainsRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect2D_ContainsRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1971-L1973 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/artmanager.py | python | ArtManager.GetMenuTheme | (self) | return self._menuTheme | Returns the currently used menu theme.
:return: A string containining the currently used theme for the menu. | Returns the currently used menu theme. | [
"Returns",
"the",
"currently",
"used",
"menu",
"theme",
"."
] | def GetMenuTheme(self):
"""
Returns the currently used menu theme.
:return: A string containining the currently used theme for the menu.
"""
return self._menuTheme | [
"def",
"GetMenuTheme",
"(",
"self",
")",
":",
"return",
"self",
".",
"_menuTheme"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L1843-L1850 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator.py | python | LinearOperator.__init__ | (self,
dtype,
graph_parents=None,
is_non_singular=None,
is_self_adjoint=None,
is_positive_definite=None,
is_square=None,
name=None) | r"""Initialize the `LinearOperator`.
**This is a private method for subclass use.**
**Subclasses should copy-paste this `__init__` documentation.**
Args:
dtype: The type of the this `LinearOperator`. Arguments to `matmul` and
`solve` will have to be this type.
graph_parents: Python li... | r"""Initialize the `LinearOperator`. | [
"r",
"Initialize",
"the",
"LinearOperator",
"."
] | def __init__(self,
dtype,
graph_parents=None,
is_non_singular=None,
is_self_adjoint=None,
is_positive_definite=None,
is_square=None,
name=None):
r"""Initialize the `LinearOperator`.
**This is a private meth... | [
"def",
"__init__",
"(",
"self",
",",
"dtype",
",",
"graph_parents",
"=",
"None",
",",
"is_non_singular",
"=",
"None",
",",
"is_self_adjoint",
"=",
"None",
",",
"is_positive_definite",
"=",
"None",
",",
"is_square",
"=",
"None",
",",
"name",
"=",
"None",
")... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator.py#L142-L213 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/fslike/directory.py | python | Directory.resolve | (self, parts) | return os.path.join(self.path, *parts) | resolves parts to an actual path name. | resolves parts to an actual path name. | [
"resolves",
"parts",
"to",
"an",
"actual",
"path",
"name",
"."
] | def resolve(self, parts):
""" resolves parts to an actual path name. """
return os.path.join(self.path, *parts) | [
"def",
"resolve",
"(",
"self",
",",
"parts",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"path",
",",
"*",
"parts",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/fslike/directory.py#L44-L46 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | ImmediateFunction.WriteCmdSetHeader | (self, file) | Overridden from Function | Overridden from Function | [
"Overridden",
"from",
"Function"
] | def WriteCmdSetHeader(self, file):
"""Overridden from Function"""
self.type_handler.WriteImmediateCmdSetHeader(self, file) | [
"def",
"WriteCmdSetHeader",
"(",
"self",
",",
"file",
")",
":",
"self",
".",
"type_handler",
".",
"WriteImmediateCmdSetHeader",
"(",
"self",
",",
"file",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5450-L5452 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/package/package_exporter.py | python | PackageExporter.save_pickle | (
self,
package: str,
resource: str,
obj: Any,
dependencies: bool = True,
pickle_protocol: int = 3,
) | Save a python object to the archive using pickle. Equivalent to :func:`torch.save` but saving into
the archive rather than a stand-alone file. Stanard pickle does not save the code, only the objects.
If ``dependencies`` is true, this method will also scan the pickled objects for which modules are requir... | Save a python object to the archive using pickle. Equivalent to :func:`torch.save` but saving into
the archive rather than a stand-alone file. Stanard pickle does not save the code, only the objects.
If ``dependencies`` is true, this method will also scan the pickled objects for which modules are requir... | [
"Save",
"a",
"python",
"object",
"to",
"the",
"archive",
"using",
"pickle",
".",
"Equivalent",
"to",
":",
"func",
":",
"torch",
".",
"save",
"but",
"saving",
"into",
"the",
"archive",
"rather",
"than",
"a",
"stand",
"-",
"alone",
"file",
".",
"Stanard",
... | def save_pickle(
self,
package: str,
resource: str,
obj: Any,
dependencies: bool = True,
pickle_protocol: int = 3,
):
"""Save a python object to the archive using pickle. Equivalent to :func:`torch.save` but saving into
the archive rather than a stand-... | [
"def",
"save_pickle",
"(",
"self",
",",
"package",
":",
"str",
",",
"resource",
":",
"str",
",",
"obj",
":",
"Any",
",",
"dependencies",
":",
"bool",
"=",
"True",
",",
"pickle_protocol",
":",
"int",
"=",
"3",
",",
")",
":",
"assert",
"(",
"pickle_pro... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/package_exporter.py#L553-L659 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rfc822.py | python | Message.__getitem__ | (self, name) | return self.dict[name.lower()] | Get a specific header, as from a dictionary. | Get a specific header, as from a dictionary. | [
"Get",
"a",
"specific",
"header",
"as",
"from",
"a",
"dictionary",
"."
] | def __getitem__(self, name):
"""Get a specific header, as from a dictionary."""
return self.dict[name.lower()] | [
"def",
"__getitem__",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"dict",
"[",
"name",
".",
"lower",
"(",
")",
"]"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rfc822.py#L386-L388 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBListener.AddEvent | (self, *args) | return _lldb.SBListener_AddEvent(self, *args) | AddEvent(self, SBEvent event) | AddEvent(self, SBEvent event) | [
"AddEvent",
"(",
"self",
"SBEvent",
"event",
")"
] | def AddEvent(self, *args):
"""AddEvent(self, SBEvent event)"""
return _lldb.SBListener_AddEvent(self, *args) | [
"def",
"AddEvent",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBListener_AddEvent",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5728-L5730 | |
google/mozc | 7329757e1ad30e327c1ae823a8302c79482d6b9c | src/prediction/gen_zero_query_number_data.py | python | ParseOption | () | return parser.parse_args()[0] | Parses command line options. | Parses command line options. | [
"Parses",
"command",
"line",
"options",
"."
] | def ParseOption():
"""Parses command line options."""
parser = optparse.OptionParser()
parser.add_option('--input', dest='input', help='Input file path')
parser.add_option('--output_token_array', dest='output_token_array',
help='Output token array file path')
parser.add_option('--output_st... | [
"def",
"ParseOption",
"(",
")",
":",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
")",
"parser",
".",
"add_option",
"(",
"'--input'",
",",
"dest",
"=",
"'input'",
",",
"help",
"=",
"'Input file path'",
")",
"parser",
".",
"add_option",
"(",
"'--out... | https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/prediction/gen_zero_query_number_data.py#L62-L70 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/urllib.py | python | splitport | (host) | return host, None | splitport('host:port') --> 'host', 'port'. | splitport('host:port') --> 'host', 'port'. | [
"splitport",
"(",
"host",
":",
"port",
")",
"--",
">",
"host",
"port",
"."
] | def splitport(host):
"""splitport('host:port') --> 'host', 'port'."""
global _portprog
if _portprog is None:
import re
_portprog = re.compile('^(.*):([0-9]+)$')
match = _portprog.match(host)
if match: return match.group(1, 2)
return host, None | [
"def",
"splitport",
"(",
"host",
")",
":",
"global",
"_portprog",
"if",
"_portprog",
"is",
"None",
":",
"import",
"re",
"_portprog",
"=",
"re",
".",
"compile",
"(",
"'^(.*):([0-9]+)$'",
")",
"match",
"=",
"_portprog",
".",
"match",
"(",
"host",
")",
"if"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/urllib.py#L1090-L1099 | |
Tencent/mars | 54969ba56b402a622db123e780a4f760b38c5c36 | mars/lint/cpplint.py | python | CheckLanguage | (filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error) | Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum:... | Checks rules from the 'C++ language rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"language",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckLanguage(filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
... | [
"def",
"CheckLanguage",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"include_state",
",",
"nesting_state",
",",
"error",
")",
":",
"# If the line is empty or consists of entirely a comment, no need to",
"# check it.",
"line",
"=",
"cle... | https://github.com/Tencent/mars/blob/54969ba56b402a622db123e780a4f760b38c5c36/mars/lint/cpplint.py#L4766-L4921 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/encoding.py | python | _FetchRemapping | (type_name, mapping_type, python_name=None, json_name=None,
mappings=None) | return None | Common code for fetching a key or value from a remapping dict. | Common code for fetching a key or value from a remapping dict. | [
"Common",
"code",
"for",
"fetching",
"a",
"key",
"or",
"value",
"from",
"a",
"remapping",
"dict",
"."
] | def _FetchRemapping(type_name, mapping_type, python_name=None, json_name=None,
mappings=None):
"""Common code for fetching a key or value from a remapping dict."""
if python_name and json_name:
raise exceptions.InvalidDataError(
'Cannot specify both python_name and json_n... | [
"def",
"_FetchRemapping",
"(",
"type_name",
",",
"mapping_type",
",",
"python_name",
"=",
"None",
",",
"json_name",
"=",
"None",
",",
"mappings",
"=",
"None",
")",
":",
"if",
"python_name",
"and",
"json_name",
":",
"raise",
"exceptions",
".",
"InvalidDataError... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/encoding.py#L624-L643 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py | python | mingw32 | () | return False | Return true when using mingw32 environment. | Return true when using mingw32 environment. | [
"Return",
"true",
"when",
"using",
"mingw32",
"environment",
"."
] | def mingw32():
"""Return true when using mingw32 environment.
"""
if sys.platform=='win32':
if os.environ.get('OSTYPE', '')=='msys':
return True
if os.environ.get('MSYSTEM', '')=='MINGW32':
return True
return False | [
"def",
"mingw32",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'OSTYPE'",
",",
"''",
")",
"==",
"'msys'",
":",
"return",
"True",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'MS... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py#L391-L399 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/nn.py | python | deformable_conv | (input,
offset,
mask,
num_filters,
filter_size,
stride=1,
padding=0,
dilation=1,
groups=None,
deformable_groups=None,
im... | return output | r"""
:api_attr: Static Graph
**Deformable Convolution op**
Compute 2-D deformable convolution on 4-D input.
Given input image x, output feature map y, the deformable convolution operation can be expressed as follow:
Deformable Convolution v2:
.. math::
y(p) = \sum_{k=1}^{K}{w_k * x... | r"""
:api_attr: Static Graph | [
"r",
":",
"api_attr",
":",
"Static",
"Graph"
] | def deformable_conv(input,
offset,
mask,
num_filters,
filter_size,
stride=1,
padding=0,
dilation=1,
groups=None,
deformable_groups=None,
... | [
"def",
"deformable_conv",
"(",
"input",
",",
"offset",
",",
"mask",
",",
"num_filters",
",",
"filter_size",
",",
"stride",
"=",
"1",
",",
"padding",
"=",
"0",
",",
"dilation",
"=",
"1",
",",
"groups",
"=",
"None",
",",
"deformable_groups",
"=",
"None",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L14469-L14702 | |
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | _ClassifyInclude | (fileinfo, include, is_system) | return _OTHER_HEADER | Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _XXX_HEADER constants.
For example:
>>> _ClassifyIn... | Figures out what kind of header 'include' is. | [
"Figures",
"out",
"what",
"kind",
"of",
"header",
"include",
"is",
"."
] | def _ClassifyInclude(fileinfo, include, is_system):
"""Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _... | [
"def",
"_ClassifyInclude",
"(",
"fileinfo",
",",
"include",
",",
"is_system",
")",
":",
"# This is a list of all standard c++ header files, except",
"# those already checked for above.",
"is_cpp_h",
"=",
"include",
"in",
"_CPP_HEADERS",
"if",
"is_system",
":",
"if",
"is_cpp... | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L4545-L4601 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.EndFontSize | (*args, **kwargs) | return _richtext.RichTextCtrl_EndFontSize(*args, **kwargs) | EndFontSize(self) -> bool
End using point size | EndFontSize(self) -> bool | [
"EndFontSize",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndFontSize(*args, **kwargs):
"""
EndFontSize(self) -> bool
End using point size
"""
return _richtext.RichTextCtrl_EndFontSize(*args, **kwargs) | [
"def",
"EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3391-L3397 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/utils/tf_inspect.py | python | getmro | (cls) | return _inspect.getmro(cls) | TFDecorator-aware replacement for inspect.getmro. | TFDecorator-aware replacement for inspect.getmro. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"getmro",
"."
] | def getmro(cls):
"""TFDecorator-aware replacement for inspect.getmro."""
return _inspect.getmro(cls) | [
"def",
"getmro",
"(",
"cls",
")",
":",
"return",
"_inspect",
".",
"getmro",
"(",
"cls",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/tf_inspect.py#L335-L337 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/esptool.py | python | esp8266_crc32 | (data) | CRC32 algorithm used by 8266 SDK bootloader (and gen_appbin.py). | CRC32 algorithm used by 8266 SDK bootloader (and gen_appbin.py). | [
"CRC32",
"algorithm",
"used",
"by",
"8266",
"SDK",
"bootloader",
"(",
"and",
"gen_appbin",
".",
"py",
")",
"."
] | def esp8266_crc32(data):
"""
CRC32 algorithm used by 8266 SDK bootloader (and gen_appbin.py).
"""
crc = binascii.crc32(data, 0) & 0xFFFFFFFF
if crc & 0x80000000:
return crc ^ 0xFFFFFFFF
else:
return crc + 1 | [
"def",
"esp8266_crc32",
"(",
"data",
")",
":",
"crc",
"=",
"binascii",
".",
"crc32",
"(",
"data",
",",
"0",
")",
"&",
"0xFFFFFFFF",
"if",
"crc",
"&",
"0x80000000",
":",
"return",
"crc",
"^",
"0xFFFFFFFF",
"else",
":",
"return",
"crc",
"+",
"1"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/esptool.py#L1691-L1699 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/random.py | python | shuffle | (x) | Modify a sequence in-place by shuffling its contents.
This function only shuffles the array along the first axis of a
multi-dimensional array. The order of sub-arrays is changed but
their contents remain the same.
Parameters
----------
x: ndarray
The array or list to be shuffled.
... | Modify a sequence in-place by shuffling its contents. | [
"Modify",
"a",
"sequence",
"in",
"-",
"place",
"by",
"shuffling",
"its",
"contents",
"."
] | def shuffle(x):
"""
Modify a sequence in-place by shuffling its contents.
This function only shuffles the array along the first axis of a
multi-dimensional array. The order of sub-arrays is changed but
their contents remain the same.
Parameters
----------
x: ndarray
The array o... | [
"def",
"shuffle",
"(",
"x",
")",
":",
"_mx_nd_np",
".",
"random",
".",
"shuffle",
"(",
"x",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/random.py#L768-L797 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosunit/src/rosunit/junitxml.py | python | TestCaseResult.add_failure | (self, failure) | @param failure TestFailure | [] | def add_failure(self, failure):
"""
@param failure TestFailure
"""
self.failures.append(failure) | [
"def",
"add_failure",
"(",
"self",
",",
"failure",
")",
":",
"self",
".",
"failures",
".",
"append",
"(",
"failure",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosunit/src/rosunit/junitxml.py#L159-L163 | |||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/games/tic_tac_toe.py | python | TicTacToeState.is_terminal | (self) | return self._is_terminal | Returns True if the game is over. | Returns True if the game is over. | [
"Returns",
"True",
"if",
"the",
"game",
"is",
"over",
"."
] | def is_terminal(self):
"""Returns True if the game is over."""
return self._is_terminal | [
"def",
"is_terminal",
"(",
"self",
")",
":",
"return",
"self",
".",
"_is_terminal"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/games/tic_tac_toe.py#L121-L123 | |
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/IceBridge/icebridge_common.py | python | updateValidFilesListFromDisk | (filesList, filesSet) | return filesSet | Update the current set of valid files with any new info from disk. | Update the current set of valid files with any new info from disk. | [
"Update",
"the",
"current",
"set",
"of",
"valid",
"files",
"with",
"any",
"new",
"info",
"from",
"disk",
"."
] | def updateValidFilesListFromDisk(filesList, filesSet):
'''Update the current set of valid files with any new info from disk.'''
# Nothing to
if not os.path.exists(filesList):
return filesSet
print("Reading: " + filesList)
with open(filesList, 'r') as f:
for line in f:
... | [
"def",
"updateValidFilesListFromDisk",
"(",
"filesList",
",",
"filesSet",
")",
":",
"# Nothing to ",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filesList",
")",
":",
"return",
"filesSet",
"print",
"(",
"\"Reading: \"",
"+",
"filesList",
")",
"with",
... | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L306-L319 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Prog.py | python | _subst_libs | (env, libs) | return libs | Substitute environment variables and split into list. | Substitute environment variables and split into list. | [
"Substitute",
"environment",
"variables",
"and",
"split",
"into",
"list",
"."
] | def _subst_libs(env, libs):
"""
Substitute environment variables and split into list.
"""
if SCons.Util.is_String(libs):
libs = env.subst(libs)
if SCons.Util.is_String(libs):
libs = libs.split()
elif SCons.Util.is_Sequence(libs):
_libs = []
for l in libs:
... | [
"def",
"_subst_libs",
"(",
"env",
",",
"libs",
")",
":",
"if",
"SCons",
".",
"Util",
".",
"is_String",
"(",
"libs",
")",
":",
"libs",
"=",
"env",
".",
"subst",
"(",
"libs",
")",
"if",
"SCons",
".",
"Util",
".",
"is_String",
"(",
"libs",
")",
":",... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Prog.py#L41-L57 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryd.py | python | Armory_Json_Rpc_Server.jsonrpc_getledgersimple | (self, inB58ID, tx_count=10, from_tx=0) | return self.jsonrpc_getledger(inB58ID, tx_count, from_tx, True) | DESCRIPTION:
Get a simple version of a wallet or lockbox ledger.
PARAMETERS:
inB58ID - The Base58 ID of the wallet or lockbox from which to obtain the
ledger. The wallet or lockbox must already be loaded.
tx_count - (Default=10) The number of entries to get.
from_tx - (Defa... | DESCRIPTION:
Get a simple version of a wallet or lockbox ledger.
PARAMETERS:
inB58ID - The Base58 ID of the wallet or lockbox from which to obtain the
ledger. The wallet or lockbox must already be loaded.
tx_count - (Default=10) The number of entries to get.
from_tx - (Defa... | [
"DESCRIPTION",
":",
"Get",
"a",
"simple",
"version",
"of",
"a",
"wallet",
"or",
"lockbox",
"ledger",
".",
"PARAMETERS",
":",
"inB58ID",
"-",
"The",
"Base58",
"ID",
"of",
"the",
"wallet",
"or",
"lockbox",
"from",
"which",
"to",
"obtain",
"the",
"ledger",
... | def jsonrpc_getledgersimple(self, inB58ID, tx_count=10, from_tx=0):
"""
DESCRIPTION:
Get a simple version of a wallet or lockbox ledger.
PARAMETERS:
inB58ID - The Base58 ID of the wallet or lockbox from which to obtain the
ledger. The wallet or lockbox must already be loade... | [
"def",
"jsonrpc_getledgersimple",
"(",
"self",
",",
"inB58ID",
",",
"tx_count",
"=",
"10",
",",
"from_tx",
"=",
"0",
")",
":",
"return",
"self",
".",
"jsonrpc_getledger",
"(",
"inB58ID",
",",
"tx_count",
",",
"from_tx",
",",
"True",
")"
] | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L1209-L1222 | |
assimp/assimp | 97c7e084c2f7f8c9355ea42f73605890481bddc5 | port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py | python | GLRenderer.prepare_gl_buffers | (self, mesh) | Creates 3 buffer objets for each mesh,
to store the vertices, the normals, and the faces
indices. | Creates 3 buffer objets for each mesh,
to store the vertices, the normals, and the faces
indices. | [
"Creates",
"3",
"buffer",
"objets",
"for",
"each",
"mesh",
"to",
"store",
"the",
"vertices",
"the",
"normals",
"and",
"the",
"faces",
"indices",
"."
] | def prepare_gl_buffers(self, mesh):
""" Creates 3 buffer objets for each mesh,
to store the vertices, the normals, and the faces
indices.
"""
mesh.gl = {}
# Fill the buffer for vertex positions
mesh.gl["vertices"] = glGenBuffers(1)
glBindBuffer(GL_ARRAY... | [
"def",
"prepare_gl_buffers",
"(",
"self",
",",
"mesh",
")",
":",
"mesh",
".",
"gl",
"=",
"{",
"}",
"# Fill the buffer for vertex positions",
"mesh",
".",
"gl",
"[",
"\"vertices\"",
"]",
"=",
"glGenBuffers",
"(",
"1",
")",
"glBindBuffer",
"(",
"GL_ARRAY_BUFFER"... | https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py#L64-L96 | ||
YunzhuLi/InfoGAIL | 68058c17d9ca9d959435082f1c48cd7b637d6f40 | wgail_info_0/snakeoil_gym.py | python | Client.get_servers_input | (self) | Server's input is stored in a ServerState object | Server's input is stored in a ServerState object | [
"Server",
"s",
"input",
"is",
"stored",
"in",
"a",
"ServerState",
"object"
] | def get_servers_input(self):
'''Server's input is stored in a ServerState object'''
if not self.so: return
sockdata = str()
while True:
try:
# Receive server data
sockdata,addr= self.so.recvfrom(1024)
except socket.error, emsg:
... | [
"def",
"get_servers_input",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"so",
":",
"return",
"sockdata",
"=",
"str",
"(",
")",
"while",
"True",
":",
"try",
":",
"# Receive server data ",
"sockdata",
",",
"addr",
"=",
"self",
".",
"so",
".",
"recvf... | https://github.com/YunzhuLi/InfoGAIL/blob/68058c17d9ca9d959435082f1c48cd7b637d6f40/wgail_info_0/snakeoil_gym.py#L193-L221 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/concurrent/futures/process.py | python | _chain_from_iterable_of_lists | (iterable) | Specialized implementation of itertools.chain.from_iterable.
Each item in *iterable* should be a list. This function is
careful not to keep references to yielded objects. | Specialized implementation of itertools.chain.from_iterable.
Each item in *iterable* should be a list. This function is
careful not to keep references to yielded objects. | [
"Specialized",
"implementation",
"of",
"itertools",
".",
"chain",
".",
"from_iterable",
".",
"Each",
"item",
"in",
"*",
"iterable",
"*",
"should",
"be",
"a",
"list",
".",
"This",
"function",
"is",
"careful",
"not",
"to",
"keep",
"references",
"to",
"yielded"... | def _chain_from_iterable_of_lists(iterable):
"""
Specialized implementation of itertools.chain.from_iterable.
Each item in *iterable* should be a list. This function is
careful not to keep references to yielded objects.
"""
for element in iterable:
element.reverse()
while elemen... | [
"def",
"_chain_from_iterable_of_lists",
"(",
"iterable",
")",
":",
"for",
"element",
"in",
"iterable",
":",
"element",
".",
"reverse",
"(",
")",
"while",
"element",
":",
"yield",
"element",
".",
"pop",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/concurrent/futures/process.py#L553-L562 | ||
rampageX/firmware-mod-kit | c94cd6aeee50d92ec5280a6dba6d74828fd3606b | src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py | python | HashMatch.hash_files | (self, needle, haystack) | Compare one file against a list of other files.
Returns a list of tuple results. | Compare one file against a list of other files.
Returns a list of tuple results. | [
"Compare",
"one",
"file",
"against",
"a",
"list",
"of",
"other",
"files",
".",
"Returns",
"a",
"list",
"of",
"tuple",
"results",
"."
] | def hash_files(self, needle, haystack):
'''
Compare one file against a list of other files.
Returns a list of tuple results.
'''
self.total = 0
for f in haystack:
m = self._compare_files(needle, f)
if m is not None and self.is_match(m):
... | [
"def",
"hash_files",
"(",
"self",
",",
"needle",
",",
"haystack",
")",
":",
"self",
".",
"total",
"=",
"0",
"for",
"f",
"in",
"haystack",
":",
"m",
"=",
"self",
".",
"_compare_files",
"(",
"needle",
",",
"f",
")",
"if",
"m",
"is",
"not",
"None",
... | https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py#L233-L248 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _ValidateSourcesForMSVSProject | (spec, version) | Makes sure if duplicate basenames are not specified in the source list.
Arguments:
spec: The target dictionary containing the properties of the target.
version: The VisualStudioVersion object. | Makes sure if duplicate basenames are not specified in the source list. | [
"Makes",
"sure",
"if",
"duplicate",
"basenames",
"are",
"not",
"specified",
"in",
"the",
"source",
"list",
"."
] | def _ValidateSourcesForMSVSProject(spec, version):
"""Makes sure if duplicate basenames are not specified in the source list.
Arguments:
spec: The target dictionary containing the properties of the target.
version: The VisualStudioVersion object.
"""
# This validation should not be applied to MSVC2010 ... | [
"def",
"_ValidateSourcesForMSVSProject",
"(",
"spec",
",",
"version",
")",
":",
"# This validation should not be applied to MSVC2010 and later.",
"assert",
"not",
"version",
".",
"UsesVcxproj",
"(",
")",
"# TODO: Check if MSVC allows this for loadable_module targets.",
"if",
"spe... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L947-L979 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/receptive_field/python/util/receptive_field.py | python | _pool_kernel_size | (node) | return kernel_size_x, kernel_size_y | Computes kernel size given a TF pooling node.
Args:
node: Tensorflow node (NodeDef proto).
Returns:
kernel_size_x: Kernel size for horizontal direction (integer).
kernel_size_y: Kernel size for vertical direction (integer).
Raises:
ValueError: If pooling is invalid. | Computes kernel size given a TF pooling node. | [
"Computes",
"kernel",
"size",
"given",
"a",
"TF",
"pooling",
"node",
"."
] | def _pool_kernel_size(node):
"""Computes kernel size given a TF pooling node.
Args:
node: Tensorflow node (NodeDef proto).
Returns:
kernel_size_x: Kernel size for horizontal direction (integer).
kernel_size_y: Kernel size for vertical direction (integer).
Raises:
ValueError: If pooling is inv... | [
"def",
"_pool_kernel_size",
"(",
"node",
")",
":",
"ksize",
"=",
"node",
".",
"attr",
"[",
"\"ksize\"",
"]",
"kernel_size_y",
"=",
"ksize",
".",
"list",
".",
"i",
"[",
"1",
"]",
"kernel_size_x",
"=",
"ksize",
".",
"list",
".",
"i",
"[",
"2",
"]",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/receptive_field/python/util/receptive_field.py#L131-L151 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | net/tools/quic/benchmark/run_client.py | python | PageloadExperiment.__init__ | (self, use_wget, quic_binary_dir, quic_server_address,
quic_server_port) | Initialize PageloadExperiment.
Args:
use_wget: Whether to use wget.
quic_binary_dir: Directory for quic_binary.
quic_server_address: IP address of quic server.
quic_server_port: Port of the quic server. | Initialize PageloadExperiment. | [
"Initialize",
"PageloadExperiment",
"."
] | def __init__(self, use_wget, quic_binary_dir, quic_server_address,
quic_server_port):
"""Initialize PageloadExperiment.
Args:
use_wget: Whether to use wget.
quic_binary_dir: Directory for quic_binary.
quic_server_address: IP address of quic server.
quic_server_port: Port ... | [
"def",
"__init__",
"(",
"self",
",",
"use_wget",
",",
"quic_binary_dir",
",",
"quic_server_address",
",",
"quic_server_port",
")",
":",
"self",
".",
"use_wget",
"=",
"use_wget",
"self",
".",
"quic_binary_dir",
"=",
"quic_binary_dir",
"self",
".",
"quic_server_addr... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/net/tools/quic/benchmark/run_client.py#L44-L60 | ||
OPAE/opae-sdk | 221124343c8275243a249eb72d69e0ea2d568d1b | python/opae.admin/opae/admin/tools/fpgaotsu.py | python | otsu_manifest_loader.load_and_validate | (self) | return obj | Load and Verify contents
Verify that the required keys are present.
Verify that all "filename" keys correspond to files
that are present on the system.
Verify that all address fields are hex numbers. | Load and Verify contents | [
"Load",
"and",
"Verify",
"contents"
] | def load_and_validate(self):
"""Load and Verify contents
Verify that the required keys are present.
Verify that all "filename" keys correspond to files
that are present on the system.
Verify that all address fields are hex numbers.
"""
try:
... | [
"def",
"load_and_validate",
"(",
"self",
")",
":",
"try",
":",
"obj",
"=",
"json",
".",
"load",
"(",
"self",
".",
"_fp",
")",
"except",
"ValueError",
":",
"msg",
"=",
"'Invalid JSON format in {}'",
".",
"format",
"(",
"self",
".",
"_fp",
".",
"name",
"... | https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/python/opae.admin/opae/admin/tools/fpgaotsu.py#L220-L250 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_GeographicMap.py | python | GeographicMap.deserialize | (self, str) | unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str`` | unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str`` | [
"unpack",
"serialized",
"message",
"in",
"str",
"into",
"this",
"message",
"instance",
":",
"param",
"str",
":",
"byte",
"array",
"of",
"serialized",
"message",
"str"
] | def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
if self.header is None:
self.header = std_msgs.msg.Header()
if self.id is None:
self.id = uuid_msgs.msg.UniqueID()
... | [
"def",
"deserialize",
"(",
"self",
",",
"str",
")",
":",
"try",
":",
"if",
"self",
".",
"header",
"is",
"None",
":",
"self",
".",
"header",
"=",
"std_msgs",
".",
"msg",
".",
"Header",
"(",
")",
"if",
"self",
".",
"id",
"is",
"None",
":",
"self",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_GeographicMap.py#L289-L442 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/config.py | python | _get_option | (target_obj, key) | return getter() | Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly. | Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly. | [
"Given",
"a",
"target",
"object",
"and",
"option",
"key",
"get",
"that",
"option",
"from",
"the",
"target",
"object",
"either",
"through",
"a",
"get_",
"{",
"key",
"}",
"method",
"or",
"from",
"an",
"attribute",
"directly",
"."
] | def _get_option(target_obj, key):
"""
Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly.
"""
getter_name = 'get_{key}'.format(**locals())
by_attribute = functools.partial(getattr, target_obj, key)
... | [
"def",
"_get_option",
"(",
"target_obj",
",",
"key",
")",
":",
"getter_name",
"=",
"'get_{key}'",
".",
"format",
"(",
"*",
"*",
"locals",
"(",
")",
")",
"by_attribute",
"=",
"functools",
".",
"partial",
"(",
"getattr",
",",
"target_obj",
",",
"key",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/config.py#L109-L118 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/graph_kernel/expanders/square_sum_all.py | python | SquareSumAll._expand | (self, graph_builder) | return result0, result1 | do expand | do expand | [
"do",
"expand"
] | def _expand(self, graph_builder):
"""do expand"""
x0 = self.inputs[0]
x1 = self.inputs[1]
ori_shape = x0.shape
axis = []
for i, _ in enumerate(ori_shape):
axis.append(i)
square_res0 = graph_builder.emit('Mul', [x0, x0])
square_res1 = graph_bu... | [
"def",
"_expand",
"(",
"self",
",",
"graph_builder",
")",
":",
"x0",
"=",
"self",
".",
"inputs",
"[",
"0",
"]",
"x1",
"=",
"self",
".",
"inputs",
"[",
"1",
"]",
"ori_shape",
"=",
"x0",
".",
"shape",
"axis",
"=",
"[",
"]",
"for",
"i",
",",
"_",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/graph_kernel/expanders/square_sum_all.py#L28-L43 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py | python | fields_dict | (cls) | return ordered_dict(((a.name, a) for a in attrs)) | Return an ordered dictionary of ``attrs`` attributes for a class, whose
keys are the attribute names.
:param type cls: Class to introspect.
:raise TypeError: If *cls* is not a class.
:raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
class.
:rtype: an ordered dict w... | Return an ordered dictionary of ``attrs`` attributes for a class, whose
keys are the attribute names. | [
"Return",
"an",
"ordered",
"dictionary",
"of",
"attrs",
"attributes",
"for",
"a",
"class",
"whose",
"keys",
"are",
"the",
"attribute",
"names",
"."
] | def fields_dict(cls):
"""
Return an ordered dictionary of ``attrs`` attributes for a class, whose
keys are the attribute names.
:param type cls: Class to introspect.
:raise TypeError: If *cls* is not a class.
:raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
cla... | [
"def",
"fields_dict",
"(",
"cls",
")",
":",
"if",
"not",
"isclass",
"(",
"cls",
")",
":",
"raise",
"TypeError",
"(",
"\"Passed object must be a class.\"",
")",
"attrs",
"=",
"getattr",
"(",
"cls",
",",
"\"__attrs_attrs__\"",
",",
"None",
")",
"if",
"attrs",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py#L1405-L1430 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/integrate/_ivp/common.py | python | validate_tol | (rtol, atol, n) | return rtol, atol | Validate tolerance values. | Validate tolerance values. | [
"Validate",
"tolerance",
"values",
"."
] | def validate_tol(rtol, atol, n):
"""Validate tolerance values."""
if rtol < 100 * EPS:
warn("`rtol` is too low, setting to {}".format(100 * EPS))
rtol = 100 * EPS
atol = np.asarray(atol)
if atol.ndim > 0 and atol.shape != (n,):
raise ValueError("`atol` has wrong shape.")
if... | [
"def",
"validate_tol",
"(",
"rtol",
",",
"atol",
",",
"n",
")",
":",
"if",
"rtol",
"<",
"100",
"*",
"EPS",
":",
"warn",
"(",
"\"`rtol` is too low, setting to {}\"",
".",
"format",
"(",
"100",
"*",
"EPS",
")",
")",
"rtol",
"=",
"100",
"*",
"EPS",
"ato... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_ivp/common.py#L44-L57 | |
fluffos/fluffos | bf54d5d4acef4de49dbed7d184849a7b7b354156 | src/thirdparty/widecharwidth/generate.py | python | set_emoji_widths | (emoji_data_lines, cps) | Read from emoji-data.txt, set codepoint widths | Read from emoji-data.txt, set codepoint widths | [
"Read",
"from",
"emoji",
"-",
"data",
".",
"txt",
"set",
"codepoint",
"widths"
] | def set_emoji_widths(emoji_data_lines, cps):
""" Read from emoji-data.txt, set codepoint widths """
for line in emoji_data_lines:
for (cp, version) in parse_emoji_line(line):
# Don't consider <=1F000 values as emoji. These can only be made
# emoji through the variation selector w... | [
"def",
"set_emoji_widths",
"(",
"emoji_data_lines",
",",
"cps",
")",
":",
"for",
"line",
"in",
"emoji_data_lines",
":",
"for",
"(",
"cp",
",",
"version",
")",
"in",
"parse_emoji_line",
"(",
"line",
")",
":",
"# Don't consider <=1F000 values as emoji. These can only ... | https://github.com/fluffos/fluffos/blob/bf54d5d4acef4de49dbed7d184849a7b7b354156/src/thirdparty/widecharwidth/generate.py#L451-L473 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | MH.get_sequences | (self) | return results | Return a name-to-key-list dictionary to define each sequence. | Return a name-to-key-list dictionary to define each sequence. | [
"Return",
"a",
"name",
"-",
"to",
"-",
"key",
"-",
"list",
"dictionary",
"to",
"define",
"each",
"sequence",
"."
] | def get_sequences(self):
"""Return a name-to-key-list dictionary to define each sequence."""
results = {}
f = open(os.path.join(self._path, '.mh_sequences'), 'r')
try:
all_keys = set(self.keys())
for line in f:
try:
name, conten... | [
"def",
"get_sequences",
"(",
"self",
")",
":",
"results",
"=",
"{",
"}",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"'.mh_sequences'",
")",
",",
"'r'",
")",
"try",
":",
"all_keys",
"=",
"set",
"(",
"sel... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1122-L1147 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py | python | ispackage | (path) | return False | Guess whether a path refers to a package directory. | Guess whether a path refers to a package directory. | [
"Guess",
"whether",
"a",
"path",
"refers",
"to",
"a",
"package",
"directory",
"."
] | def ispackage(path):
"""Guess whether a path refers to a package directory."""
if os.path.isdir(path):
for ext in ('.py', '.pyc'):
if os.path.isfile(os.path.join(path, '__init__' + ext)):
return True
return False | [
"def",
"ispackage",
"(",
"path",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"for",
"ext",
"in",
"(",
"'.py'",
",",
"'.pyc'",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py#L230-L236 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/database.py | python | BaseInstalledDistribution.__init__ | (self, metadata, path, env=None) | Initialise an instance.
:param metadata: An instance of :class:`Metadata` which describes the
distribution. This will normally have been initialised
from a metadata file in the ``path``.
:param path: The path of the ``.dist-info`` or ``.egg-info``
... | Initialise an instance.
:param metadata: An instance of :class:`Metadata` which describes the
distribution. This will normally have been initialised
from a metadata file in the ``path``.
:param path: The path of the ``.dist-info`` or ``.egg-info``
... | [
"Initialise",
"an",
"instance",
".",
":",
"param",
"metadata",
":",
"An",
"instance",
"of",
":",
"class",
":",
"Metadata",
"which",
"describes",
"the",
"distribution",
".",
"This",
"will",
"normally",
"have",
"been",
"initialised",
"from",
"a",
"metadata",
"... | def __init__(self, metadata, path, env=None):
"""
Initialise an instance.
:param metadata: An instance of :class:`Metadata` which describes the
distribution. This will normally have been initialised
from a metadata file in the ``path``.
:... | [
"def",
"__init__",
"(",
"self",
",",
"metadata",
",",
"path",
",",
"env",
"=",
"None",
")",
":",
"super",
"(",
"BaseInstalledDistribution",
",",
"self",
")",
".",
"__init__",
"(",
"metadata",
")",
"self",
".",
"path",
"=",
"path",
"self",
".",
"dist_pa... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/database.py#L463-L476 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/javac.py | python | emit_java_classes | (target, source, env) | return full_tlist, slist | Create and return lists of source java files
and their corresponding target class files. | Create and return lists of source java files
and their corresponding target class files. | [
"Create",
"and",
"return",
"lists",
"of",
"source",
"java",
"files",
"and",
"their",
"corresponding",
"target",
"class",
"files",
"."
] | def emit_java_classes(target, source, env):
"""Create and return lists of source java files
and their corresponding target class files.
"""
java_suffix = env.get('JAVASUFFIX', '.java')
class_suffix = env.get('JAVACLASSSUFFIX', '.class')
target[0].must_be_same(SCons.Node.FS.Dir)
classdir = t... | [
"def",
"emit_java_classes",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"java_suffix",
"=",
"env",
".",
"get",
"(",
"'JAVASUFFIX'",
",",
"'.java'",
")",
"class_suffix",
"=",
"env",
".",
"get",
"(",
"'JAVACLASSSUFFIX'",
",",
"'.class'",
")",
"target... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/javac.py#L49-L130 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/ttk.py | python | _convert_stringval | (value) | return value | Converts a value to, hopefully, a more appropriate Python object. | Converts a value to, hopefully, a more appropriate Python object. | [
"Converts",
"a",
"value",
"to",
"hopefully",
"a",
"more",
"appropriate",
"Python",
"object",
"."
] | def _convert_stringval(value):
"""Converts a value to, hopefully, a more appropriate Python object."""
value = unicode(value)
try:
value = int(value)
except (ValueError, TypeError):
pass
return value | [
"def",
"_convert_stringval",
"(",
"value",
")",
":",
"value",
"=",
"unicode",
"(",
"value",
")",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"(",
"ValueError",
",",
"TypeError",
")",
":",
"pass",
"return",
"value"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L306-L314 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | catalog.convertSGMLCatalog | (self) | return ret | Convert all the SGML catalog entries as XML ones | Convert all the SGML catalog entries as XML ones | [
"Convert",
"all",
"the",
"SGML",
"catalog",
"entries",
"as",
"XML",
"ones"
] | def convertSGMLCatalog(self):
"""Convert all the SGML catalog entries as XML ones """
ret = libxml2mod.xmlConvertSGMLCatalog(self._o)
return ret | [
"def",
"convertSGMLCatalog",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlConvertSGMLCatalog",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L4886-L4889 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Solver.py | python | AdaptiveGradient.epsilon | (self) | return self._internal.get_epsilon() | Gets the small value used to avoid division by zero when
calculating second moment. | Gets the small value used to avoid division by zero when
calculating second moment. | [
"Gets",
"the",
"small",
"value",
"used",
"to",
"avoid",
"division",
"by",
"zero",
"when",
"calculating",
"second",
"moment",
"."
] | def epsilon(self):
"""Gets the small value used to avoid division by zero when
calculating second moment.
"""
return self._internal.get_epsilon() | [
"def",
"epsilon",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_epsilon",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Solver.py#L211-L215 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/swift_build_support/swift_build_support/shell.py | python | call_without_sleeping | (command, env=None, dry_run=False, echo=False) | Execute a command during which system sleep is disabled.
By default, this ignores the state of the `shell.dry_run` flag. | Execute a command during which system sleep is disabled. | [
"Execute",
"a",
"command",
"during",
"which",
"system",
"sleep",
"is",
"disabled",
"."
] | def call_without_sleeping(command, env=None, dry_run=False, echo=False):
"""
Execute a command during which system sleep is disabled.
By default, this ignores the state of the `shell.dry_run` flag.
"""
# Disable system sleep, if possible.
if platform.system() == 'Darwin':
# Don't mutat... | [
"def",
"call_without_sleeping",
"(",
"command",
",",
"env",
"=",
"None",
",",
"dry_run",
"=",
"False",
",",
"echo",
"=",
"False",
")",
":",
"# Disable system sleep, if possible.",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'Darwin'",
":",
"# Don't mutat... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/shell.py#L101-L113 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | Grid.HideRow | (*args, **kwargs) | return _grid.Grid_HideRow(*args, **kwargs) | HideRow(self, int row) | HideRow(self, int row) | [
"HideRow",
"(",
"self",
"int",
"row",
")"
] | def HideRow(*args, **kwargs):
"""HideRow(self, int row)"""
return _grid.Grid_HideRow(*args, **kwargs) | [
"def",
"HideRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_HideRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1822-L1824 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/SQLiteCpp/cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/SQLiteCpp/cpplint.py#L585-L598 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py | python | preprocess_target_platforms | (ctx, platforms, auto_populate_empty=False) | return processed_platforms | Preprocess a list of platforms from user input and list the concrete platform(s). The resulting list will contain
concrete platforms expanded from platform aliases if any
:param ctx: Context
:param platforms: The list of platforms to preprocess
:param auto_populate_empty: Optio... | Preprocess a list of platforms from user input and list the concrete platform(s). The resulting list will contain
concrete platforms expanded from platform aliases if any
:param ctx: Context
:param platforms: The list of platforms to preprocess
:param auto_populate_empty: Optio... | [
"Preprocess",
"a",
"list",
"of",
"platforms",
"from",
"user",
"input",
"and",
"list",
"the",
"concrete",
"platform",
"(",
"s",
")",
".",
"The",
"resulting",
"list",
"will",
"contain",
"concrete",
"platforms",
"expanded",
"from",
"platform",
"aliases",
"if",
... | def preprocess_target_platforms(ctx, platforms, auto_populate_empty=False):
"""
Preprocess a list of platforms from user input and list the concrete platform(s). The resulting list will contain
concrete platforms expanded from platform aliases if any
:param ctx: Context
:param platfo... | [
"def",
"preprocess_target_platforms",
"(",
"ctx",
",",
"platforms",
",",
"auto_populate_empty",
"=",
"False",
")",
":",
"processed_platforms",
"=",
"set",
"(",
")",
"if",
"(",
"auto_populate_empty",
"and",
"len",
"(",
"platforms",
")",
"==",
"0",
")",
"or",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py#L882-L903 | |
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | scripts/cpp_lint.py | python | CheckLanguage | (filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error) | Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum:... | Checks rules from the 'C++ language rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"language",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckLanguage(filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
... | [
"def",
"CheckLanguage",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"include_state",
",",
"nesting_state",
",",
"error",
")",
":",
"# If the line is empty or consists of entirely a comment, no need to",
"# check it.",
"line",
"=",
"cle... | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L3834-L4132 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TMOut.CutBf | (self, *args) | return _snap.TMOut_CutBf(self, *args) | CutBf(TMOut self, int const & CutBfL)
Parameters:
CutBfL: int const & | CutBf(TMOut self, int const & CutBfL) | [
"CutBf",
"(",
"TMOut",
"self",
"int",
"const",
"&",
"CutBfL",
")"
] | def CutBf(self, *args):
"""
CutBf(TMOut self, int const & CutBfL)
Parameters:
CutBfL: int const &
"""
return _snap.TMOut_CutBf(self, *args) | [
"def",
"CutBf",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TMOut_CutBf",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L3058-L3066 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Client.execute_query_step | (self, pending_query, subquery_id, start_time_str) | return self.recv_execute_query_step() | Parameters:
- pending_query
- subquery_id
- start_time_str | Parameters:
- pending_query
- subquery_id
- start_time_str | [
"Parameters",
":",
"-",
"pending_query",
"-",
"subquery_id",
"-",
"start_time_str"
] | def execute_query_step(self, pending_query, subquery_id, start_time_str):
"""
Parameters:
- pending_query
- subquery_id
- start_time_str
"""
self.send_execute_query_step(pending_query, subquery_id, start_time_str)
return self.recv_execute_query_step() | [
"def",
"execute_query_step",
"(",
"self",
",",
"pending_query",
",",
"subquery_id",
",",
"start_time_str",
")",
":",
"self",
".",
"send_execute_query_step",
"(",
"pending_query",
",",
"subquery_id",
",",
"start_time_str",
")",
"return",
"self",
".",
"recv_execute_qu... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L3813-L3822 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/dataframe/series.py | python | Series.build | (self, cache, **kwargs) | Returns a Tensor. | Returns a Tensor. | [
"Returns",
"a",
"Tensor",
"."
] | def build(self, cache, **kwargs):
"""Returns a Tensor."""
raise NotImplementedError() | [
"def",
"build",
"(",
"self",
",",
"cache",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/dataframe/series.py#L101-L103 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py | python | _verify_input_args | (x, y, input_fn, feed_fn, batch_size) | Verifies validity of co-existence of input arguments. | Verifies validity of co-existence of input arguments. | [
"Verifies",
"validity",
"of",
"co",
"-",
"existence",
"of",
"input",
"arguments",
"."
] | def _verify_input_args(x, y, input_fn, feed_fn, batch_size):
"""Verifies validity of co-existence of input arguments."""
if input_fn is None:
if x is None:
raise ValueError('Either x or input_fn must be provided.')
if tensor_util.is_tensor(x) or y is not None and tensor_util.is_tensor(y):
raise... | [
"def",
"_verify_input_args",
"(",
"x",
",",
"y",
",",
"input_fn",
",",
"feed_fn",
",",
"batch_size",
")",
":",
"if",
"input_fn",
"is",
"None",
":",
"if",
"x",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Either x or input_fn must be provided.'",
")",
"if... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L98-L113 | ||
nodejs/nan | 8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62 | cpplint.py | python | CheckTrailingSemicolon | (filename, clean_lines, linenum, error) | Looks for redundant trailing semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Looks for redundant trailing semicolon. | [
"Looks",
"for",
"redundant",
"trailing",
"semicolon",
"."
] | def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
"""Looks for redundant trailing semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any error... | [
"def",
"CheckTrailingSemicolon",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Block bodies should not be followed by a semicolon. Due to C++11",
"# brace initialization, ther... | https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L4091-L4235 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DropTarget.OnDrop | (*args, **kwargs) | return _misc_.DropTarget_OnDrop(*args, **kwargs) | OnDrop(self, int x, int y) -> bool | OnDrop(self, int x, int y) -> bool | [
"OnDrop",
"(",
"self",
"int",
"x",
"int",
"y",
")",
"-",
">",
"bool"
] | def OnDrop(*args, **kwargs):
"""OnDrop(self, int x, int y) -> bool"""
return _misc_.DropTarget_OnDrop(*args, **kwargs) | [
"def",
"OnDrop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DropTarget_OnDrop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5587-L5589 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.tk_setPalette | (self, *args, **kw) | Set a new color scheme for all widget elements.
A single color as argument will cause that all colors of Tk
widget elements are derived from this.
Alternatively several keyword parameters and its associated
colors can be given. The following keywords are valid:
activeBackground,... | Set a new color scheme for all widget elements. | [
"Set",
"a",
"new",
"color",
"scheme",
"for",
"all",
"widget",
"elements",
"."
] | def tk_setPalette(self, *args, **kw):
"""Set a new color scheme for all widget elements.
A single color as argument will cause that all colors of Tk
widget elements are derived from this.
Alternatively several keyword parameters and its associated
colors can be given. The follow... | [
"def",
"tk_setPalette",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"'tk_setPalette'",
",",
")",
"+",
"_flatten",
"(",
"args",
")",
"+",
"_flatten",
"(",
"kw",
".",
"items",
"(",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L472-L484 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | android_webview/tools/webview_licenses.py | python | _ReadFile | (path) | return open(os.path.join(REPOSITORY_ROOT, path), 'rb').read() | Reads a file from disk.
Args:
path: The path of the file to read, relative to the root of the repository.
Returns:
The contents of the file as a string. | Reads a file from disk.
Args:
path: The path of the file to read, relative to the root of the repository.
Returns:
The contents of the file as a string. | [
"Reads",
"a",
"file",
"from",
"disk",
".",
"Args",
":",
"path",
":",
"The",
"path",
"of",
"the",
"file",
"to",
"read",
"relative",
"to",
"the",
"root",
"of",
"the",
"repository",
".",
"Returns",
":",
"The",
"contents",
"of",
"the",
"file",
"as",
"a",... | def _ReadFile(path):
"""Reads a file from disk.
Args:
path: The path of the file to read, relative to the root of the repository.
Returns:
The contents of the file as a string.
"""
return open(os.path.join(REPOSITORY_ROOT, path), 'rb').read() | [
"def",
"_ReadFile",
"(",
"path",
")",
":",
"return",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"REPOSITORY_ROOT",
",",
"path",
")",
",",
"'rb'",
")",
".",
"read",
"(",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/android_webview/tools/webview_licenses.py#L190-L198 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | libcxx/utils/google-benchmark/tools/strip_asm.py | python | process_identifiers | (l) | return new_line | process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that. | process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that. | [
"process_identifiers",
"-",
"process",
"all",
"identifiers",
"and",
"modify",
"them",
"to",
"have",
"consistent",
"names",
"across",
"all",
"platforms",
";",
"specifically",
"across",
"ELF",
"and",
"MachO",
".",
"For",
"example",
"MachO",
"inserts",
"an",
"addit... | def process_identifiers(l):
"""
process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that.
"""
parts... | [
"def",
"process_identifiers",
"(",
"l",
")",
":",
"parts",
"=",
"re",
".",
"split",
"(",
"r'([a-zA-Z0-9_]+)'",
",",
"l",
")",
"new_line",
"=",
"''",
"for",
"tk",
"in",
"parts",
":",
"if",
"is_identifier",
"(",
"tk",
")",
":",
"if",
"tk",
".",
"starts... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/google-benchmark/tools/strip_asm.py#L64-L81 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/ultisnips/plugin/UltiSnips/text_objects/_lexer.py | python | _parse_number | (stream) | return int(rv) | Expects the stream to contain a number next, returns the number
without consuming any more bytes | Expects the stream to contain a number next, returns the number
without consuming any more bytes | [
"Expects",
"the",
"stream",
"to",
"contain",
"a",
"number",
"next",
"returns",
"the",
"number",
"without",
"consuming",
"any",
"more",
"bytes"
] | def _parse_number(stream):
"""
Expects the stream to contain a number next, returns the number
without consuming any more bytes
"""
rv = ""
while stream.peek() and stream.peek() in string.digits:
rv += stream.next()
return int(rv) | [
"def",
"_parse_number",
"(",
"stream",
")",
":",
"rv",
"=",
"\"\"",
"while",
"stream",
".",
"peek",
"(",
")",
"and",
"stream",
".",
"peek",
"(",
")",
"in",
"string",
".",
"digits",
":",
"rv",
"+=",
"stream",
".",
"next",
"(",
")",
"return",
"int",
... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/text_objects/_lexer.py#L72-L81 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/ConfigSet.py | python | ConfigSet.keys | (self) | return keys | Dict interface (unknown purpose) | Dict interface (unknown purpose) | [
"Dict",
"interface",
"(",
"unknown",
"purpose",
")"
] | def keys(self):
"""Dict interface (unknown purpose)"""
keys = set()
cur = self
while cur:
keys.update(cur.table.keys())
cur = getattr(cur, 'parent', None)
keys = list(keys)
keys.sort()
return keys | [
"def",
"keys",
"(",
"self",
")",
":",
"keys",
"=",
"set",
"(",
")",
"cur",
"=",
"self",
"while",
"cur",
":",
"keys",
".",
"update",
"(",
"cur",
".",
"table",
".",
"keys",
"(",
")",
")",
"cur",
"=",
"getattr",
"(",
"cur",
",",
"'parent'",
",",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/ConfigSet.py#L51-L60 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/function.py | python | _parse_kwargs_as_attrs | (func_name, **kwargs) | return attrs | Parses **kwargs into a node's attributes. | Parses **kwargs into a node's attributes. | [
"Parses",
"**",
"kwargs",
"into",
"a",
"node",
"s",
"attributes",
"."
] | def _parse_kwargs_as_attrs(func_name, **kwargs):
"""Parses **kwargs into a node's attributes."""
attrs = {}
noinline = kwargs.pop("noinline", None)
if noinline is not None:
attrs["_noinline"] = attr_value_pb2.AttrValue(b=bool(noinline))
compiled = kwargs.pop("compiled", None)
separate_compiled_gradien... | [
"def",
"_parse_kwargs_as_attrs",
"(",
"func_name",
",",
"*",
"*",
"kwargs",
")",
":",
"attrs",
"=",
"{",
"}",
"noinline",
"=",
"kwargs",
".",
"pop",
"(",
"\"noinline\"",
",",
"None",
")",
"if",
"noinline",
"is",
"not",
"None",
":",
"attrs",
"[",
"\"_no... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/function.py#L981-L1000 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/common/Canvas.py | python | Canvas.get_bone | (self, key) | return None | Given a guid, returns the corresponding bone from the canvas | Given a guid, returns the corresponding bone from the canvas | [
"Given",
"a",
"guid",
"returns",
"the",
"corresponding",
"bone",
"from",
"the",
"canvas"
] | def get_bone(self, key):
"""
Given a guid, returns the corresponding bone from the canvas
"""
if key in self.bones.keys():
return self.bones[key]
return None | [
"def",
"get_bone",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
".",
"bones",
".",
"keys",
"(",
")",
":",
"return",
"self",
".",
"bones",
"[",
"key",
"]",
"return",
"None"
] | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Canvas.py#L106-L112 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py | python | Binomial.event_shape | (self, name="event_shape") | Shape of a sample from a single distribution as a 1-D int32 `Tensor`.
Args:
name: name to give to the op
Returns:
`Tensor` `event_shape` | Shape of a sample from a single distribution as a 1-D int32 `Tensor`. | [
"Shape",
"of",
"a",
"sample",
"from",
"a",
"single",
"distribution",
"as",
"a",
"1",
"-",
"D",
"int32",
"Tensor",
"."
] | def event_shape(self, name="event_shape"):
"""Shape of a sample from a single distribution as a 1-D int32 `Tensor`.
Args:
name: name to give to the op
Returns:
`Tensor` `event_shape`
"""
with ops.name_scope(self.name):
with ops.op_scope([], name):
return constant_op.const... | [
"def",
"event_shape",
"(",
"self",
",",
"name",
"=",
"\"event_shape\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"]",
",",
"name",
")",
":",
"return",
"constant_op",
"."... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py#L196-L207 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py | python | describe | (thing) | return type(thing).__name__ | Produce a short description of the given thing. | Produce a short description of the given thing. | [
"Produce",
"a",
"short",
"description",
"of",
"the",
"given",
"thing",
"."
] | def describe(thing):
"""Produce a short description of the given thing."""
if inspect.ismodule(thing):
if thing.__name__ in sys.builtin_module_names:
return 'built-in module ' + thing.__name__
if hasattr(thing, '__path__'):
return 'package ' + thing.__name__
else:... | [
"def",
"describe",
"(",
"thing",
")",
":",
"if",
"inspect",
".",
"ismodule",
"(",
"thing",
")",
":",
"if",
"thing",
".",
"__name__",
"in",
"sys",
".",
"builtin_module_names",
":",
"return",
"'built-in module '",
"+",
"thing",
".",
"__name__",
"if",
"hasatt... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py#L1575-L1600 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ContactStructuralMechanicsApplication/python_scripts/explicit_penalty_contact_process.py | python | ExplicitPenaltyContactProcess.ExecuteBeforeSolutionLoop | (self) | This method is executed before starting the time loop
Keyword arguments:
self -- It signifies an instance of a class. | This method is executed before starting the time loop | [
"This",
"method",
"is",
"executed",
"before",
"starting",
"the",
"time",
"loop"
] | def ExecuteBeforeSolutionLoop(self):
""" This method is executed before starting the time loop
Keyword arguments:
self -- It signifies an instance of a class.
"""
# We call to the base process
super().ExecuteBeforeSolutionLoop() | [
"def",
"ExecuteBeforeSolutionLoop",
"(",
"self",
")",
":",
"# We call to the base process",
"super",
"(",
")",
".",
"ExecuteBeforeSolutionLoop",
"(",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/explicit_penalty_contact_process.py#L145-L152 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | api-reference-examples/python/pytx/pytx/request.py | python | Broker.get_new | (klass, attrs) | return n | Return a new instance of klass.
:param klass: The class to create a new instance of.
:type klass: :class:
:param attrs: The attributes to set for this new instance.
:type attrs: dict
:returns: new instance of klass | Return a new instance of klass. | [
"Return",
"a",
"new",
"instance",
"of",
"klass",
"."
] | def get_new(klass, attrs):
"""
Return a new instance of klass.
:param klass: The class to create a new instance of.
:type klass: :class:
:param attrs: The attributes to set for this new instance.
:type attrs: dict
:returns: new instance of klass
"""
... | [
"def",
"get_new",
"(",
"klass",
",",
"attrs",
")",
":",
"n",
"=",
"klass",
"(",
"*",
"*",
"attrs",
")",
"n",
".",
"_new",
"=",
"False",
"n",
".",
"_changed",
"=",
"[",
"]",
"return",
"n"
] | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/request.py#L35-L49 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | _is_datetime_dtype | (obj) | return dtype is not None and dtype.char in 'Mm' | Returns True if the obj.dtype is datetime64 or timedelta64 | Returns True if the obj.dtype is datetime64 or timedelta64 | [
"Returns",
"True",
"if",
"the",
"obj",
".",
"dtype",
"is",
"datetime64",
"or",
"timedelta64"
] | def _is_datetime_dtype(obj):
"""Returns True if the obj.dtype is datetime64 or timedelta64
"""
dtype = getattr(obj, 'dtype', None)
return dtype is not None and dtype.char in 'Mm' | [
"def",
"_is_datetime_dtype",
"(",
"obj",
")",
":",
"dtype",
"=",
"getattr",
"(",
"obj",
",",
"'dtype'",
",",
"None",
")",
"return",
"dtype",
"is",
"not",
"None",
"and",
"dtype",
".",
"char",
"in",
"'Mm'"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1787-L1791 | |
facebook/watchman | 0917460c71b000b96be9b9575d77f06f2f6053bb | build/fbcode_builder/getdeps/manifest.py | python | ManifestParser.get_section_as_args | (self, section, ctx=None) | return args | Intended for use with the make.[build_args/install_args] and
autoconf.args sections, this method collects the entries and returns an
array of strings.
If the manifest contains conditional sections, ctx is used to
evaluate the condition and merge in the values. | Intended for use with the make.[build_args/install_args] and
autoconf.args sections, this method collects the entries and returns an
array of strings.
If the manifest contains conditional sections, ctx is used to
evaluate the condition and merge in the values. | [
"Intended",
"for",
"use",
"with",
"the",
"make",
".",
"[",
"build_args",
"/",
"install_args",
"]",
"and",
"autoconf",
".",
"args",
"sections",
"this",
"method",
"collects",
"the",
"entries",
"and",
"returns",
"an",
"array",
"of",
"strings",
".",
"If",
"the... | def get_section_as_args(self, section, ctx=None) -> List[str]:
"""Intended for use with the make.[build_args/install_args] and
autoconf.args sections, this method collects the entries and returns an
array of strings.
If the manifest contains conditional sections, ctx is used to
e... | [
"def",
"get_section_as_args",
"(",
"self",
",",
"section",
",",
"ctx",
"=",
"None",
")",
"->",
"List",
"[",
"str",
"]",
":",
"args",
"=",
"[",
"]",
"ctx",
"=",
"ctx",
"or",
"{",
"}",
"for",
"s",
"in",
"self",
".",
"_config",
".",
"sections",
"(",... | https://github.com/facebook/watchman/blob/0917460c71b000b96be9b9575d77f06f2f6053bb/build/fbcode_builder/getdeps/manifest.py#L270-L293 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Text.tag_nextrange | (self, tagName, index1, index2=None) | return self.tk.splitlist(self.tk.call(
self._w, 'tag', 'nextrange', tagName, index1, index2)) | Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1. | Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1. | [
"Return",
"a",
"list",
"of",
"start",
"and",
"end",
"index",
"for",
"the",
"first",
"sequence",
"of",
"characters",
"between",
"INDEX1",
"and",
"INDEX2",
"which",
"all",
"have",
"tag",
"TAGNAME",
".",
"The",
"text",
"is",
"searched",
"forward",
"from",
"IN... | def tag_nextrange(self, tagName, index1, index2=None):
"""Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1."""
return self.tk.splitlist(self.tk.call(
self._... | [
"def",
"tag_nextrange",
"(",
"self",
",",
"tagName",
",",
"index1",
",",
"index2",
"=",
"None",
")",
":",
"return",
"self",
".",
"tk",
".",
"splitlist",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'tag'",
",",
"'nextrange'",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3383-L3388 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/chat.py | python | Chat.from_bot | (self) | return self._from_bot | Gets the from_bot of this Chat. # noqa: E501
:return: The from_bot of this Chat. # noqa: E501
:rtype: bool | Gets the from_bot of this Chat. # noqa: E501 | [
"Gets",
"the",
"from_bot",
"of",
"this",
"Chat",
".",
"#",
"noqa",
":",
"E501"
] | def from_bot(self):
"""Gets the from_bot of this Chat. # noqa: E501
:return: The from_bot of this Chat. # noqa: E501
:rtype: bool
"""
return self._from_bot | [
"def",
"from_bot",
"(",
"self",
")",
":",
"return",
"self",
".",
"_from_bot"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/chat.py#L190-L197 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | examples/acrobot/spong_sim.py | python | simulate | (*, initial_state, controller_params, t_final, tape_period) | return x_tape | Simulates an Acrobot + Spong controller from the given initial state and
parameters until the given final time. Returns the state sampled at the
given tape_period. | Simulates an Acrobot + Spong controller from the given initial state and
parameters until the given final time. Returns the state sampled at the
given tape_period. | [
"Simulates",
"an",
"Acrobot",
"+",
"Spong",
"controller",
"from",
"the",
"given",
"initial",
"state",
"and",
"parameters",
"until",
"the",
"given",
"final",
"time",
".",
"Returns",
"the",
"state",
"sampled",
"at",
"the",
"given",
"tape_period",
"."
] | def simulate(*, initial_state, controller_params, t_final, tape_period):
"""Simulates an Acrobot + Spong controller from the given initial state and
parameters until the given final time. Returns the state sampled at the
given tape_period.
"""
builder = DiagramBuilder()
plant = builder.AddSyste... | [
"def",
"simulate",
"(",
"*",
",",
"initial_state",
",",
"controller_params",
",",
"t_final",
",",
"tape_period",
")",
":",
"builder",
"=",
"DiagramBuilder",
"(",
")",
"plant",
"=",
"builder",
".",
"AddSystem",
"(",
"AcrobotPlant",
"(",
")",
")",
"controller"... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/examples/acrobot/spong_sim.py#L20-L48 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py | python | load_csv_with_header | (filename,
target_dtype,
features_dtype,
target_column=-1) | return Dataset(data=data, target=target) | Load dataset from CSV file with a header row. | Load dataset from CSV file with a header row. | [
"Load",
"dataset",
"from",
"CSV",
"file",
"with",
"a",
"header",
"row",
"."
] | def load_csv_with_header(filename,
target_dtype,
features_dtype,
target_column=-1):
"""Load dataset from CSV file with a header row."""
with gfile.Open(filename) as csv_file:
data_file = csv.reader(csv_file)
header = next(data_file)
... | [
"def",
"load_csv_with_header",
"(",
"filename",
",",
"target_dtype",
",",
"features_dtype",
",",
"target_column",
"=",
"-",
"1",
")",
":",
"with",
"gfile",
".",
"Open",
"(",
"filename",
")",
"as",
"csv_file",
":",
"data_file",
"=",
"csv",
".",
"reader",
"(... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py#L53-L69 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/config/ios/codesign.py | python | Entitlements.__init__ | (self, entitlements_path) | Initializes Entitlements object from entitlement file. | Initializes Entitlements object from entitlement file. | [
"Initializes",
"Entitlements",
"object",
"from",
"entitlement",
"file",
"."
] | def __init__(self, entitlements_path):
"""Initializes Entitlements object from entitlement file."""
self._path = entitlements_path
self._data = LoadPlistFile(self._path) | [
"def",
"__init__",
"(",
"self",
",",
"entitlements_path",
")",
":",
"self",
".",
"_path",
"=",
"entitlements_path",
"self",
".",
"_data",
"=",
"LoadPlistFile",
"(",
"self",
".",
"_path",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/config/ios/codesign.py#L234-L237 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/speedmeter.py | python | SpeedMeter.GetAngleRange | (self) | return self._anglerange | Returns the range of existence for :class:`SpeedMeter`.
The returned values are in radians. | Returns the range of existence for :class:`SpeedMeter`.
The returned values are in radians. | [
"Returns",
"the",
"range",
"of",
"existence",
"for",
":",
"class",
":",
"SpeedMeter",
".",
"The",
"returned",
"values",
"are",
"in",
"radians",
"."
] | def GetAngleRange(self):
"""
Returns the range of existence for :class:`SpeedMeter`.
The returned values are in radians.
"""
return self._anglerange | [
"def",
"GetAngleRange",
"(",
"self",
")",
":",
"return",
"self",
".",
"_anglerange"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/speedmeter.py#L1194-L1200 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | CpModel.AddMinEquality | (self, target, exprs) | return ct | Adds `target == Min(variables)`. | Adds `target == Min(variables)`. | [
"Adds",
"target",
"==",
"Min",
"(",
"variables",
")",
"."
] | def AddMinEquality(self, target, exprs):
"""Adds `target == Min(variables)`."""
ct = Constraint(self.__model.constraints)
model_ct = self.__model.constraints[ct.Index()]
model_ct.lin_max.exprs.extend(
[self.ParseLinearExpression(x, True) for x in exprs])
model_ct.lin_... | [
"def",
"AddMinEquality",
"(",
"self",
",",
"target",
",",
"exprs",
")",
":",
"ct",
"=",
"Constraint",
"(",
"self",
".",
"__model",
".",
"constraints",
")",
"model_ct",
"=",
"self",
".",
"__model",
".",
"constraints",
"[",
"ct",
".",
"Index",
"(",
")",
... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L1495-L1503 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/nodes.py | python | Node.set_environment | (self, environment) | return self | Set the environment for all nodes. | Set the environment for all nodes. | [
"Set",
"the",
"environment",
"for",
"all",
"nodes",
"."
] | def set_environment(self, environment):
"""Set the environment for all nodes."""
todo = deque([self])
while todo:
node = todo.popleft()
node.environment = environment
todo.extend(node.iter_child_nodes())
return self | [
"def",
"set_environment",
"(",
"self",
",",
"environment",
")",
":",
"todo",
"=",
"deque",
"(",
"[",
"self",
"]",
")",
"while",
"todo",
":",
"node",
"=",
"todo",
".",
"popleft",
"(",
")",
"node",
".",
"environment",
"=",
"environment",
"todo",
".",
"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/nodes.py#L219-L226 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/install_emulator_deps.py | python | CheckKVM | () | return os.path.exists('/dev/kvm') | Quickly check whether KVM is enabled.
Returns:
True iff /dev/kvm exists (Linux only). | Quickly check whether KVM is enabled. | [
"Quickly",
"check",
"whether",
"KVM",
"is",
"enabled",
"."
] | def CheckKVM():
"""Quickly check whether KVM is enabled.
Returns:
True iff /dev/kvm exists (Linux only).
"""
return os.path.exists('/dev/kvm') | [
"def",
"CheckKVM",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"exists",
"(",
"'/dev/kvm'",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/install_emulator_deps.py#L97-L103 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | loadCatalog | (filename) | return ret | Load the catalog and makes its definitions effective for
the default external entity loader. It will recurse in SGML
CATALOG entries. this function is not thread safe, catalog
initialization should preferably be done once at startup | Load the catalog and makes its definitions effective for
the default external entity loader. It will recurse in SGML
CATALOG entries. this function is not thread safe, catalog
initialization should preferably be done once at startup | [
"Load",
"the",
"catalog",
"and",
"makes",
"its",
"definitions",
"effective",
"for",
"the",
"default",
"external",
"entity",
"loader",
".",
"It",
"will",
"recurse",
"in",
"SGML",
"CATALOG",
"entries",
".",
"this",
"function",
"is",
"not",
"thread",
"safe",
"c... | def loadCatalog(filename):
"""Load the catalog and makes its definitions effective for
the default external entity loader. It will recurse in SGML
CATALOG entries. this function is not thread safe, catalog
initialization should preferably be done once at startup """
ret = libxml2mod.xmlLoadCa... | [
"def",
"loadCatalog",
"(",
"filename",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlLoadCatalog",
"(",
"filename",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L984-L990 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.