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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/lib/io/file_io.py | python | get_matching_files | (filename) | return get_matching_files_v2(filename) | Returns a list of files that match the given pattern(s).
Args:
filename: string or iterable of strings. The glob pattern(s).
Returns:
A list of strings containing filenames that match the given pattern(s).
Raises:
* errors.OpError: If there are filesystem / directory listing errors.
* errors.NotF... | Returns a list of files that match the given pattern(s). | [
"Returns",
"a",
"list",
"of",
"files",
"that",
"match",
"the",
"given",
"pattern",
"(",
"s",
")",
"."
] | def get_matching_files(filename):
"""Returns a list of files that match the given pattern(s).
Args:
filename: string or iterable of strings. The glob pattern(s).
Returns:
A list of strings containing filenames that match the given pattern(s).
Raises:
* errors.OpError: If there are filesystem / dir... | [
"def",
"get_matching_files",
"(",
"filename",
")",
":",
"return",
"get_matching_files_v2",
"(",
"filename",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/lib/io/file_io.py#L367-L380 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert-gpu/tensorrt-inference-server/src/clients/python/grpc_image_client.py | python | parse_model | (status, model_name, batch_size, verbose=False) | return (input.name, output.name, c, h, w, input.format, model_dtype_to_np(input.data_type)) | Check the configuration of a model to make sure it meets the
requirements for an image classification network (as expected by
this client) | Check the configuration of a model to make sure it meets the
requirements for an image classification network (as expected by
this client) | [
"Check",
"the",
"configuration",
"of",
"a",
"model",
"to",
"make",
"sure",
"it",
"meets",
"the",
"requirements",
"for",
"an",
"image",
"classification",
"network",
"(",
"as",
"expected",
"by",
"this",
"client",
")"
] | def parse_model(status, model_name, batch_size, verbose=False):
"""
Check the configuration of a model to make sure it meets the
requirements for an image classification network (as expected by
this client)
"""
server_status = status.server_status
if model_name not in server_status.model_sta... | [
"def",
"parse_model",
"(",
"status",
",",
"model_name",
",",
"batch_size",
",",
"verbose",
"=",
"False",
")",
":",
"server_status",
"=",
"status",
".",
"server_status",
"if",
"model_name",
"not",
"in",
"server_status",
".",
"model_status",
".",
"keys",
"(",
... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/tensorrt-inference-server/src/clients/python/grpc_image_client.py#L69-L141 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | putmask | (a, mask, values) | return | Changes elements of an array based on conditional and input values.
This is the masked array version of `numpy.putmask`, for details see
`numpy.putmask`.
See Also
--------
numpy.putmask
Notes
-----
Using a masked array as `values` will **not** transform a `ndarray` into
a `MaskedA... | Changes elements of an array based on conditional and input values. | [
"Changes",
"elements",
"of",
"an",
"array",
"based",
"on",
"conditional",
"and",
"input",
"values",
"."
] | def putmask(a, mask, values): # , mode='raise'):
"""
Changes elements of an array based on conditional and input values.
This is the masked array version of `numpy.putmask`, for details see
`numpy.putmask`.
See Also
--------
numpy.putmask
Notes
-----
Using a masked array as `... | [
"def",
"putmask",
"(",
"a",
",",
"mask",
",",
"values",
")",
":",
"# , mode='raise'):",
"# We can't use 'frommethod', the order of arguments is different",
"if",
"not",
"isinstance",
"(",
"a",
",",
"MaskedArray",
")",
":",
"a",
"=",
"a",
".",
"view",
"(",
"Maske... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L6873-L6909 | |
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | restapi/bareos_restapi/__init__.py | python | read_all_storages | (
*,
response: Response,
current_user: User = Depends(get_current_user),
verbose: Optional[bareosBool] = Query("yes", title="Verbose output"),
) | return show_configuration_items(
response=response,
current_user=current_user,
itemType="storages",
verbose=verbose,
) | Read all jobdef resources. Built on console command _show storages_.
Needs at least Bareos Version >= 20.0.0 | Read all jobdef resources. Built on console command _show storages_. | [
"Read",
"all",
"jobdef",
"resources",
".",
"Built",
"on",
"console",
"command",
"_show",
"storages_",
"."
] | def read_all_storages(
*,
response: Response,
current_user: User = Depends(get_current_user),
verbose: Optional[bareosBool] = Query("yes", title="Verbose output"),
):
"""
Read all jobdef resources. Built on console command _show storages_.
Needs at least Bareos Version >= 20.0.0
"""
... | [
"def",
"read_all_storages",
"(",
"*",
",",
"response",
":",
"Response",
",",
"current_user",
":",
"User",
"=",
"Depends",
"(",
"get_current_user",
")",
",",
"verbose",
":",
"Optional",
"[",
"bareosBool",
"]",
"=",
"Query",
"(",
"\"yes\"",
",",
"title",
"="... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/restapi/bareos_restapi/__init__.py#L1695-L1711 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.__init__ | (self, descriptor_db=None) | Initializes a Pool of proto buffs.
The descriptor_db argument to the constructor is provided to allow
specialized file descriptor proto lookup code to be triggered on demand. An
example would be an implementation which will read and compile a file
specified in a call to FindFileByName() and not require... | Initializes a Pool of proto buffs. | [
"Initializes",
"a",
"Pool",
"of",
"proto",
"buffs",
"."
] | def __init__(self, descriptor_db=None):
"""Initializes a Pool of proto buffs.
The descriptor_db argument to the constructor is provided to allow
specialized file descriptor proto lookup code to be triggered on demand. An
example would be an implementation which will read and compile a file
specifie... | [
"def",
"__init__",
"(",
"self",
",",
"descriptor_db",
"=",
"None",
")",
":",
"self",
".",
"_internal_db",
"=",
"descriptor_database",
".",
"DescriptorDatabase",
"(",
")",
"self",
".",
"_descriptor_db",
"=",
"descriptor_db",
"self",
".",
"_descriptors",
"=",
"{... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/descriptor_pool.py#L64-L81 | ||
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/mox.py | python | Mox.ResetAll | (self) | Call reset on all mock objects. This does not unset stubs. | Call reset on all mock objects. This does not unset stubs. | [
"Call",
"reset",
"on",
"all",
"mock",
"objects",
".",
"This",
"does",
"not",
"unset",
"stubs",
"."
] | def ResetAll(self):
"""Call reset on all mock objects. This does not unset stubs."""
for mock_obj in self._mock_objects:
mock_obj._Reset() | [
"def",
"ResetAll",
"(",
"self",
")",
":",
"for",
"mock_obj",
"in",
"self",
".",
"_mock_objects",
":",
"mock_obj",
".",
"_Reset",
"(",
")"
] | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L202-L206 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/util/retry.py | python | Retry.sleep | (self) | Sleep between retry attempts using an exponential backoff.
By default, the backoff factor is 0 and this method will return
immediately. | Sleep between retry attempts using an exponential backoff. | [
"Sleep",
"between",
"retry",
"attempts",
"using",
"an",
"exponential",
"backoff",
"."
] | def sleep(self):
""" Sleep between retry attempts using an exponential backoff.
By default, the backoff factor is 0 and this method will return
immediately.
"""
backoff = self.get_backoff_time()
if backoff <= 0:
return
time.sleep(backoff) | [
"def",
"sleep",
"(",
"self",
")",
":",
"backoff",
"=",
"self",
".",
"get_backoff_time",
"(",
")",
"if",
"backoff",
"<=",
"0",
":",
"return",
"time",
".",
"sleep",
"(",
"backoff",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/util/retry.py#L169-L178 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/git.py | python | Git.get_revision_sha | (self, dest, rev) | return (sha, False) | Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None.
Args:
dest: the repository directory.
rev: the revision name. | Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None. | [
"Return",
"(",
"sha_or_none",
"is_branch",
")",
"where",
"sha_or_none",
"is",
"a",
"commit",
"hash",
"if",
"the",
"revision",
"names",
"a",
"remote",
"branch",
"or",
"tag",
"otherwise",
"None",
"."
] | def get_revision_sha(self, dest, rev):
"""
Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None.
Args:
dest: the repository directory.
rev: the revision name.
"""
# Pass rev t... | [
"def",
"get_revision_sha",
"(",
"self",
",",
"dest",
",",
"rev",
")",
":",
"# Pass rev to pre-filter the list.",
"output",
"=",
"self",
".",
"run_command",
"(",
"[",
"'show-ref'",
",",
"rev",
"]",
",",
"cwd",
"=",
"dest",
",",
"show_stdout",
"=",
"False",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/git.py#L114-L146 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiPaneInfo.MaxSize | (*args, **kwargs) | return _aui.AuiPaneInfo_MaxSize(*args, **kwargs) | MaxSize(self, Size size) -> AuiPaneInfo | MaxSize(self, Size size) -> AuiPaneInfo | [
"MaxSize",
"(",
"self",
"Size",
"size",
")",
"-",
">",
"AuiPaneInfo"
] | def MaxSize(*args, **kwargs):
"""MaxSize(self, Size size) -> AuiPaneInfo"""
return _aui.AuiPaneInfo_MaxSize(*args, **kwargs) | [
"def",
"MaxSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_MaxSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L397-L399 | |
microsoft/AirSim | 8057725712c0cd46979135396381784075ffc0f3 | PythonClient/airsim/client.py | python | VehicleClient.simRunConsoleCommand | (self, command) | return self.client.call('simRunConsoleCommand', command) | Allows the client to execute a command in Unreal's native console, via an API.
Affords access to the countless built-in commands such as "stat unit", "stat fps", "open [map]", adjust any config settings, etc. etc.
Allows the user to create bespoke APIs very easily, by adding a custom event to the level ... | Allows the client to execute a command in Unreal's native console, via an API.
Affords access to the countless built-in commands such as "stat unit", "stat fps", "open [map]", adjust any config settings, etc. etc.
Allows the user to create bespoke APIs very easily, by adding a custom event to the level ... | [
"Allows",
"the",
"client",
"to",
"execute",
"a",
"command",
"in",
"Unreal",
"s",
"native",
"console",
"via",
"an",
"API",
".",
"Affords",
"access",
"to",
"the",
"countless",
"built",
"-",
"in",
"commands",
"such",
"as",
"stat",
"unit",
"stat",
"fps",
"op... | def simRunConsoleCommand(self, command):
"""
Allows the client to execute a command in Unreal's native console, via an API.
Affords access to the countless built-in commands such as "stat unit", "stat fps", "open [map]", adjust any config settings, etc. etc.
Allows the user to create bes... | [
"def",
"simRunConsoleCommand",
"(",
"self",
",",
"command",
")",
":",
"return",
"self",
".",
"client",
".",
"call",
"(",
"'simRunConsoleCommand'",
",",
"command",
")"
] | https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/client.py#L410-L422 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/summary/summary_iterator.py | python | summary_iterator | (path) | return _SummaryIterator(path) | Returns a iterator for reading `Event` protocol buffers from an event file.
You can use this function to read events written to an event file. It returns
a Python iterator that yields `Event` protocol buffers.
Example: Print the contents of an events file.
```python
for e in tf.compat.v1.train.summary_iter... | Returns a iterator for reading `Event` protocol buffers from an event file. | [
"Returns",
"a",
"iterator",
"for",
"reading",
"Event",
"protocol",
"buffers",
"from",
"an",
"event",
"file",
"."
] | def summary_iterator(path):
# pylint: disable=line-too-long
"""Returns a iterator for reading `Event` protocol buffers from an event file.
You can use this function to read events written to an event file. It returns
a Python iterator that yields `Event` protocol buffers.
Example: Print the contents of an e... | [
"def",
"summary_iterator",
"(",
"path",
")",
":",
"# pylint: disable=line-too-long",
"return",
"_SummaryIterator",
"(",
"path",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/summary/summary_iterator.py#L40-L91 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/interval.py | python | _is_valid_endpoint | (endpoint) | return any(
[
is_number(endpoint),
isinstance(endpoint, Timestamp),
isinstance(endpoint, Timedelta),
endpoint is None,
]
) | Helper for interval_range to check if start/end are valid types. | Helper for interval_range to check if start/end are valid types. | [
"Helper",
"for",
"interval_range",
"to",
"check",
"if",
"start",
"/",
"end",
"are",
"valid",
"types",
"."
] | def _is_valid_endpoint(endpoint) -> bool:
"""
Helper for interval_range to check if start/end are valid types.
"""
return any(
[
is_number(endpoint),
isinstance(endpoint, Timestamp),
isinstance(endpoint, Timedelta),
endpoint is None,
]
... | [
"def",
"_is_valid_endpoint",
"(",
"endpoint",
")",
"->",
"bool",
":",
"return",
"any",
"(",
"[",
"is_number",
"(",
"endpoint",
")",
",",
"isinstance",
"(",
"endpoint",
",",
"Timestamp",
")",
",",
"isinstance",
"(",
"endpoint",
",",
"Timedelta",
")",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/interval.py#L896-L907 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/s3transfer/download.py | python | DownloadChunkIterator.__init__ | (self, body, chunksize) | Iterator to chunk out a downloaded S3 stream
:param body: A readable file-like object
:param chunksize: The amount to read each time | Iterator to chunk out a downloaded S3 stream | [
"Iterator",
"to",
"chunk",
"out",
"a",
"downloaded",
"S3",
"stream"
] | def __init__(self, body, chunksize):
"""Iterator to chunk out a downloaded S3 stream
:param body: A readable file-like object
:param chunksize: The amount to read each time
"""
self._body = body
self._chunksize = chunksize
self._num_reads = 0 | [
"def",
"__init__",
"(",
"self",
",",
"body",
",",
"chunksize",
")",
":",
"self",
".",
"_body",
"=",
"body",
"self",
".",
"_chunksize",
"=",
"chunksize",
"self",
".",
"_num_reads",
"=",
"0"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/s3transfer/download.py#L646-L654 | ||
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/run_classifier.py | python | MrpcProcessor.get_labels | (self) | return ["0", "1"] | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_labels(self):
"""See base class."""
return ["0", "1"] | [
"def",
"get_labels",
"(",
"self",
")",
":",
"return",
"[",
"\"0\"",
",",
"\"1\"",
"]"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L314-L316 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | TypeHandler.WriteGLES2TraceImplementation | (self, func, file) | Writes the GLES2 Trace Implemention. | Writes the GLES2 Trace Implemention. | [
"Writes",
"the",
"GLES2",
"Trace",
"Implemention",
"."
] | def WriteGLES2TraceImplementation(self, func, file):
"""Writes the GLES2 Trace Implemention."""
file.Write("%s GLES2TraceImplementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
result_string = "return "
if func.return_type... | [
"def",
"WriteGLES2TraceImplementation",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"file",
".",
"Write",
"(",
"\"%s GLES2TraceImplementation::%s(%s) {\\n\"",
"%",
"(",
"func",
".",
"return_type",
",",
"func",
".",
"original_name",
",",
"func",
".",
"MakeTy... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3064-L3077 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py | python | ParserElement.setResultsName | ( self, name, listAllMatches=False ) | return newself | Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original C{ParserElement} object;
this is so that the client can define a basic element, such as an
integer, and reference it in multiple places with differ... | Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original C{ParserElement} object;
this is so that the client can define a basic element, such as an
integer, and reference it in multiple places with differ... | [
"Define",
"name",
"for",
"referencing",
"matching",
"tokens",
"as",
"a",
"nested",
"attribute",
"of",
"the",
"returned",
"parse",
"results",
".",
"NOTE",
":",
"this",
"returns",
"a",
"*",
"copy",
"*",
"of",
"the",
"original",
"C",
"{",
"ParserElement",
"}"... | def setResultsName( self, name, listAllMatches=False ):
"""
Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original C{ParserElement} object;
this is so that the client can define a basic element,... | [
"def",
"setResultsName",
"(",
"self",
",",
"name",
",",
"listAllMatches",
"=",
"False",
")",
":",
"newself",
"=",
"self",
".",
"copy",
"(",
")",
"if",
"name",
".",
"endswith",
"(",
"\"*\"",
")",
":",
"name",
"=",
"name",
"[",
":",
"-",
"1",
"]",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L1204-L1230 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | remoting/tools/hostdir.py | python | list_cmd | (args) | return 0 | list command | list command | [
"list",
"command"
] | def list_cmd(args):
"""list command"""
if len(args) != 0:
return usage()
(username, token) = load_auth_token()
client = HostDirectory(username, token)
print '%36s %30s %s' % ("HOST ID", "HOST NAME", "JABBER ID")
for host in client.get_hosts():
print '%36s %30s %s' % (host.host_id, host.host_na... | [
"def",
"list_cmd",
"(",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"!=",
"0",
":",
"return",
"usage",
"(",
")",
"(",
"username",
",",
"token",
")",
"=",
"load_auth_token",
"(",
")",
"client",
"=",
"HostDirectory",
"(",
"username",
",",
"token",... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/remoting/tools/hostdir.py#L157-L166 | |
materialx/MaterialX | 77ff72f352470b5c76dddde765951a8e3bcf79fc | python/MaterialX/main.py | python | _setParameterValue | (self, name, value, typeString = '') | (Deprecated) Set the typed value of a parameter by its name. | (Deprecated) Set the typed value of a parameter by its name. | [
"(",
"Deprecated",
")",
"Set",
"the",
"typed",
"value",
"of",
"a",
"parameter",
"by",
"its",
"name",
"."
] | def _setParameterValue(self, name, value, typeString = ''):
"""(Deprecated) Set the typed value of a parameter by its name."""
warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) | [
"def",
"_setParameterValue",
"(",
"self",
",",
"name",
",",
"value",
",",
"typeString",
"=",
"''",
")",
":",
"warnings",
".",
"warn",
"(",
"\"This function is deprecated; parameters have been replaced with uniform inputs in 1.38.\"",
",",
"DeprecationWarning",
",",
"stack... | https://github.com/materialx/MaterialX/blob/77ff72f352470b5c76dddde765951a8e3bcf79fc/python/MaterialX/main.py#L119-L121 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/profiler.py | python | Domain.new_counter | (self, name, value=None) | return Counter(self, name, value) | Create new Counter object owned by this domain
Parameters
----------
name : string
Name of the counter | Create new Counter object owned by this domain | [
"Create",
"new",
"Counter",
"object",
"owned",
"by",
"this",
"domain"
] | def new_counter(self, name, value=None):
"""Create new Counter object owned by this domain
Parameters
----------
name : string
Name of the counter
"""
return Counter(self, name, value) | [
"def",
"new_counter",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"return",
"Counter",
"(",
"self",
",",
"name",
",",
"value",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/profiler.py#L267-L275 | |
dmlc/treelite | df56babb6a4a2d7c29d719c28ce53acfa7dbab3c | python/treelite/contrib/__init__.py | python | expand_windows_path | (dirpath) | return dirpath | Expand a short path to full path (only applicable for Windows)
Parameters
----------
dirpath : :py:class:`str <python:str>`
Path to expand
Returns
-------
fullpath : :py:class:`str <python:str>`
Expanded path | Expand a short path to full path (only applicable for Windows) | [
"Expand",
"a",
"short",
"path",
"to",
"full",
"path",
"(",
"only",
"applicable",
"for",
"Windows",
")"
] | def expand_windows_path(dirpath):
"""
Expand a short path to full path (only applicable for Windows)
Parameters
----------
dirpath : :py:class:`str <python:str>`
Path to expand
Returns
-------
fullpath : :py:class:`str <python:str>`
Expanded path
"""
if sys.plat... | [
"def",
"expand_windows_path",
"(",
"dirpath",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"buffer_size",
"=",
"500",
"buffer",
"=",
"ctypes",
".",
"create_unicode_buffer",
"(",
"buffer_size",
")",
"get_long_path_name",
"=",
"ctypes",
".",
"wi... | https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/python/treelite/contrib/__init__.py#L16-L37 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/misc.py | python | get_right_arrow | () | This function returns either a Unicode right arrow or '->', depending on the system encoding. | This function returns either a Unicode right arrow or '->', depending on the system encoding. | [
"This",
"function",
"returns",
"either",
"a",
"Unicode",
"right",
"arrow",
"or",
"-",
">",
"depending",
"on",
"the",
"system",
"encoding",
"."
] | def get_right_arrow():
"""
This function returns either a Unicode right arrow or '->', depending on the system encoding.
"""
try:
'\u2192'.encode(sys.stdout.encoding)
except (AttributeError, UnicodeEncodeError):
return '->'
else:
return '\u2192' | [
"def",
"get_right_arrow",
"(",
")",
":",
"try",
":",
"'\\u2192'",
".",
"encode",
"(",
"sys",
".",
"stdout",
".",
"encoding",
")",
"except",
"(",
"AttributeError",
",",
"UnicodeEncodeError",
")",
":",
"return",
"'->'",
"else",
":",
"return",
"'\\u2192'"
] | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/misc.py#L783-L792 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/filelist.py | python | FileList.debug_print | (self, msg) | Print 'msg' to stdout if the global DEBUG (taken from the
DISTUTILS_DEBUG environment variable) flag is true. | Print 'msg' to stdout if the global DEBUG (taken from the
DISTUTILS_DEBUG environment variable) flag is true. | [
"Print",
"msg",
"to",
"stdout",
"if",
"the",
"global",
"DEBUG",
"(",
"taken",
"from",
"the",
"DISTUTILS_DEBUG",
"environment",
"variable",
")",
"flag",
"is",
"true",
"."
] | def debug_print(self, msg):
"""Print 'msg' to stdout if the global DEBUG (taken from the
DISTUTILS_DEBUG environment variable) flag is true.
"""
from distutils.debug import DEBUG
if DEBUG:
print(msg) | [
"def",
"debug_print",
"(",
"self",
",",
"msg",
")",
":",
"from",
"distutils",
".",
"debug",
"import",
"DEBUG",
"if",
"DEBUG",
":",
"print",
"(",
"msg",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/filelist.py#L41-L47 | ||
NVIDIA/MDL-SDK | aa9642b2546ad7b6236b5627385d882c2ed83c5d | src/mdl/jit/llvm/dist/utils/lit/lit/llvm/config.py | python | LLVMConfig.use_llvm_tool | (self, name, search_env=None, required=False, quiet=False) | return tool | Find the executable program 'name', optionally using the specified
environment variable as an override before searching the
configuration's PATH. | Find the executable program 'name', optionally using the specified
environment variable as an override before searching the
configuration's PATH. | [
"Find",
"the",
"executable",
"program",
"name",
"optionally",
"using",
"the",
"specified",
"environment",
"variable",
"as",
"an",
"override",
"before",
"searching",
"the",
"configuration",
"s",
"PATH",
"."
] | def use_llvm_tool(self, name, search_env=None, required=False, quiet=False):
"""Find the executable program 'name', optionally using the specified
environment variable as an override before searching the
configuration's PATH."""
# If the override is specified in the environment, use it w... | [
"def",
"use_llvm_tool",
"(",
"self",
",",
"name",
",",
"search_env",
"=",
"None",
",",
"required",
"=",
"False",
",",
"quiet",
"=",
"False",
")",
":",
"# If the override is specified in the environment, use it without",
"# validation.",
"if",
"search_env",
":",
"too... | https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/llvm/dist/utils/lit/lit/llvm/config.py#L307-L332 | |
vicaya/hypertable | e7386f799c238c109ae47973417c2a2c7f750825 | src/py/ThriftClient/gen-py/hyperthrift/gen/ClientService.py | python | Client.get_row_as_arrays | (self, name, row) | return self.recv_get_row_as_arrays() | Alternative interface using array as cell
Parameters:
- name
- row | Alternative interface using array as cell
Parameters:
- name
- row | [
"Alternative",
"interface",
"using",
"array",
"as",
"cell",
"Parameters",
":",
"-",
"name",
"-",
"row"
] | def get_row_as_arrays(self, name, row):
"""
Alternative interface using array as cell
Parameters:
- name
- row
"""
self.send_get_row_as_arrays(name, row)
return self.recv_get_row_as_arrays() | [
"def",
"get_row_as_arrays",
"(",
"self",
",",
"name",
",",
"row",
")",
":",
"self",
".",
"send_get_row_as_arrays",
"(",
"name",
",",
"row",
")",
"return",
"self",
".",
"recv_get_row_as_arrays",
"(",
")"
] | https://github.com/vicaya/hypertable/blob/e7386f799c238c109ae47973417c2a2c7f750825/src/py/ThriftClient/gen-py/hyperthrift/gen/ClientService.py#L622-L631 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py | python | formatstring | (cols, colwidth=_colwidth, spacing=_spacing) | return spacing.join(c.center(colwidth) for c in cols) | Returns a string formatted from n strings, centered within n columns. | Returns a string formatted from n strings, centered within n columns. | [
"Returns",
"a",
"string",
"formatted",
"from",
"n",
"strings",
"centered",
"within",
"n",
"columns",
"."
] | def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
"""Returns a string formatted from n strings, centered within n columns."""
spacing *= ' '
return spacing.join(c.center(colwidth) for c in cols) | [
"def",
"formatstring",
"(",
"cols",
",",
"colwidth",
"=",
"_colwidth",
",",
"spacing",
"=",
"_spacing",
")",
":",
"spacing",
"*=",
"' '",
"return",
"spacing",
".",
"join",
"(",
"c",
".",
"center",
"(",
"colwidth",
")",
"for",
"c",
"in",
"cols",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py#L645-L648 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/variables.py | python | Variable._set_save_slice_info | (self, save_slice_info) | Sets the slice info for this `Variable`.
Args:
save_slice_info: A `Variable.SaveSliceInfo` object. | Sets the slice info for this `Variable`. | [
"Sets",
"the",
"slice",
"info",
"for",
"this",
"Variable",
"."
] | def _set_save_slice_info(self, save_slice_info):
"""Sets the slice info for this `Variable`.
Args:
save_slice_info: A `Variable.SaveSliceInfo` object.
"""
self._save_slice_info = save_slice_info | [
"def",
"_set_save_slice_info",
"(",
"self",
",",
"save_slice_info",
")",
":",
"self",
".",
"_save_slice_info",
"=",
"save_slice_info"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L965-L971 | ||
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/service_reflection.py | python | _ServiceBuilder._GetResponseClass | (self, method_descriptor) | return method_descriptor.output_type._concrete_class | Returns the class of the response protocol message.
Args:
method_descriptor: Descriptor of the method for which to return the
response protocol message class.
Returns:
A class that represents the output protocol message of the specified
method. | Returns the class of the response protocol message. | [
"Returns",
"the",
"class",
"of",
"the",
"response",
"protocol",
"message",
"."
] | def _GetResponseClass(self, method_descriptor):
"""Returns the class of the response protocol message.
Args:
method_descriptor: Descriptor of the method for which to return the
response protocol message class.
Returns:
A class that represents the output protocol message of the specifie... | [
"def",
"_GetResponseClass",
"(",
"self",
",",
"method_descriptor",
")",
":",
"if",
"method_descriptor",
".",
"containing_service",
"!=",
"self",
".",
"descriptor",
":",
"raise",
"RuntimeError",
"(",
"'GetResponseClass() given method descriptor for wrong service type.'",
")"... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/service_reflection.py#L189-L203 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/utils/spirv/gen_spirv_dialect.py | python | get_capability_mapping | (operand_kinds) | return capability_mapping | Returns the capability mapping from duplicated cases to canonicalized ones.
Arguments:
- operand_kinds: all operand kinds' grammar spec
Returns:
- A map mapping from duplicated capability symbols to the canonicalized
symbol chosen for SPIRVBase.td. | Returns the capability mapping from duplicated cases to canonicalized ones. | [
"Returns",
"the",
"capability",
"mapping",
"from",
"duplicated",
"cases",
"to",
"canonicalized",
"ones",
"."
] | def get_capability_mapping(operand_kinds):
"""Returns the capability mapping from duplicated cases to canonicalized ones.
Arguments:
- operand_kinds: all operand kinds' grammar spec
Returns:
- A map mapping from duplicated capability symbols to the canonicalized
symbol chosen for SPIRVBase.td.
"... | [
"def",
"get_capability_mapping",
"(",
"operand_kinds",
")",
":",
"# Find the operand kind for capability",
"cap_kind",
"=",
"{",
"}",
"for",
"kind",
"in",
"operand_kinds",
":",
"if",
"kind",
"[",
"'kind'",
"]",
"==",
"'Capability'",
":",
"cap_kind",
"=",
"kind",
... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/utils/spirv/gen_spirv_dialect.py#L225-L246 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | CpModel.NewOptionalIntervalVar | (self, start, size, end, is_present, name) | return IntervalVar(self.__model, start_expr, size_expr, end_expr,
is_present_index, name) | Creates an optional interval var from start, size, end, and is_present.
An optional interval variable is a constraint, that is itself used in other
constraints like NoOverlap. This constraint is protected by an is_present
literal that indicates if it is active or not.
Internally, it ensures that `is_p... | Creates an optional interval var from start, size, end, and is_present. | [
"Creates",
"an",
"optional",
"interval",
"var",
"from",
"start",
"size",
"end",
"and",
"is_present",
"."
] | def NewOptionalIntervalVar(self, start, size, end, is_present, name):
"""Creates an optional interval var from start, size, end, and is_present.
An optional interval variable is a constraint, that is itself used in other
constraints like NoOverlap. This constraint is protected by an is_present
lite... | [
"def",
"NewOptionalIntervalVar",
"(",
"self",
",",
"start",
",",
"size",
",",
"end",
",",
"is_present",
",",
"name",
")",
":",
"# Add the linear constraint.",
"self",
".",
"Add",
"(",
"start",
"+",
"size",
"==",
"end",
")",
".",
"OnlyEnforceIf",
"(",
"is_p... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L1614-L1656 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py | python | reduce_ | (a, reduce_fn, cmp_fn=None, axis=None, keepdims=False, initial=None, where=True, dtype=None) | return reduce_fn(a, axes).astype(dtype) | Applies comparison based on cmp_fn and reduction based on reduce_fn.
If cmp_fn is None, only reduction is performed. | Applies comparison based on cmp_fn and reduction based on reduce_fn.
If cmp_fn is None, only reduction is performed. | [
"Applies",
"comparison",
"based",
"on",
"cmp_fn",
"and",
"reduction",
"based",
"on",
"reduce_fn",
".",
"If",
"cmp_fn",
"is",
"None",
"only",
"reduction",
"is",
"performed",
"."
] | def reduce_(a, reduce_fn, cmp_fn=None, axis=None, keepdims=False, initial=None, where=True, dtype=None):
"""
Applies comparison based on cmp_fn and reduction based on reduce_fn.
If cmp_fn is None, only reduction is performed.
"""
shape = F.shape(a)
ndim = F.rank(a)
if dtype is None:
... | [
"def",
"reduce_",
"(",
"a",
",",
"reduce_fn",
",",
"cmp_fn",
"=",
"None",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"initial",
"=",
"None",
",",
"where",
"=",
"True",
",",
"dtype",
"=",
"None",
")",
":",
"shape",
"=",
"F",
"."... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py#L1097-L1138 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py | python | Subversion.get_netloc_and_auth | (cls, netloc, scheme) | return split_auth_from_netloc(netloc) | This override allows the auth information to be passed to svn via the
--username and --password options instead of via the URL. | [] | def get_netloc_and_auth(cls, netloc, scheme):
"""
This override allows the auth information to be passed to svn via the
--username and --password options instead of via the URL.
"""
if scheme == 'ssh':
# The --username and --password options can't be used for
... | [
"def",
"get_netloc_and_auth",
"(",
"cls",
",",
"netloc",
",",
"scheme",
")",
":",
"if",
"scheme",
"==",
"'ssh'",
":",
"# The --username and --password options can't be used for",
"# svn+ssh URLs, so keep the auth information in the URL.",
"return",
"super",
"(",
")",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py#L163-L183 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/BaseHTTPServer.py | python | BaseHTTPRequestHandler.send_response | (self, code, message=None) | Send the response header and log the response code.
Also send two standard headers with the server software
version and the current date. | Send the response header and log the response code. | [
"Send",
"the",
"response",
"header",
"and",
"log",
"the",
"response",
"code",
"."
] | def send_response(self, code, message=None):
"""Send the response header and log the response code.
Also send two standard headers with the server software
version and the current date.
"""
self.log_request(code)
if message is None:
if code in self.responses... | [
"def",
"send_response",
"(",
"self",
",",
"code",
",",
"message",
"=",
"None",
")",
":",
"self",
".",
"log_request",
"(",
"code",
")",
"if",
"message",
"is",
"None",
":",
"if",
"code",
"in",
"self",
".",
"responses",
":",
"message",
"=",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/BaseHTTPServer.py#L389-L407 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py | python | TextDoc.formatvalue | (self, object) | return '=' + self.repr(object) | Format an argument default value as text. | Format an argument default value as text. | [
"Format",
"an",
"argument",
"default",
"value",
"as",
"text",
"."
] | def formatvalue(self, object):
"""Format an argument default value as text."""
return '=' + self.repr(object) | [
"def",
"formatvalue",
"(",
"self",
",",
"object",
")",
":",
"return",
"'='",
"+",
"self",
".",
"repr",
"(",
"object",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py#L1251-L1253 | |
facebookresearch/SparseConvNet | fe38ab5845c1c0aaf46d943f52b15243011dbe93 | sparseconvnet/sparseConvNetTensor.py | python | SparseConvNetTensor.get_spatial_locations | (self, spatial_size=None) | return t | Coordinates and batch index for the active spatial locations | Coordinates and batch index for the active spatial locations | [
"Coordinates",
"and",
"batch",
"index",
"for",
"the",
"active",
"spatial",
"locations"
] | def get_spatial_locations(self, spatial_size=None):
"Coordinates and batch index for the active spatial locations"
if spatial_size is None:
spatial_size = self.spatial_size
t = self.metadata.getSpatialLocations(spatial_size)
return t | [
"def",
"get_spatial_locations",
"(",
"self",
",",
"spatial_size",
"=",
"None",
")",
":",
"if",
"spatial_size",
"is",
"None",
":",
"spatial_size",
"=",
"self",
".",
"spatial_size",
"t",
"=",
"self",
".",
"metadata",
".",
"getSpatialLocations",
"(",
"spatial_siz... | https://github.com/facebookresearch/SparseConvNet/blob/fe38ab5845c1c0aaf46d943f52b15243011dbe93/sparseconvnet/sparseConvNetTensor.py#L18-L23 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py#L236-L260 | ||
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | scripts/cpp_lint.py | python | CheckCaffeRandom | (filename, clean_lines, linenum, error) | Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which should produce deterministic results for a
fixed Caffe seed set u... | Checks for calls to C random functions (rand, rand_r, random, ...). | [
"Checks",
"for",
"calls",
"to",
"C",
"random",
"functions",
"(",
"rand",
"rand_r",
"random",
"...",
")",
"."
] | def CheckCaffeRandom(filename, clean_lines, linenum, error):
"""Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which s... | [
"def",
"CheckCaffeRandom",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
"in",
"c_random_function_list",
":",
"ix",
"=",
"line",
".",
"find",
... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L1640-L1663 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/base.py | python | c_handle_array | (objs) | return arr | Create ctypes const void ** from a list of MXNet objects with handles.
Parameters
----------
objs : list of NDArray/Symbol.
MXNet objects.
Returns
-------
(ctypes.c_void_p * len(objs))
A void ** pointer that can be passed to C API. | Create ctypes const void ** from a list of MXNet objects with handles. | [
"Create",
"ctypes",
"const",
"void",
"**",
"from",
"a",
"list",
"of",
"MXNet",
"objects",
"with",
"handles",
"."
] | def c_handle_array(objs):
"""Create ctypes const void ** from a list of MXNet objects with handles.
Parameters
----------
objs : list of NDArray/Symbol.
MXNet objects.
Returns
-------
(ctypes.c_void_p * len(objs))
A void ** pointer that can be passed to C API.
"""
a... | [
"def",
"c_handle_array",
"(",
"objs",
")",
":",
"arr",
"=",
"(",
"ctypes",
".",
"c_void_p",
"*",
"len",
"(",
"objs",
")",
")",
"(",
")",
"arr",
"[",
":",
"]",
"=",
"[",
"o",
".",
"handle",
"for",
"o",
"in",
"objs",
"]",
"return",
"arr"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/base.py#L447-L462 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetLdflags | (self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir) | return ldflags, intermediate_manifest, manifest_files | Returns the flags that need to be added to link commands, and the
manifest files. | Returns the flags that need to be added to link commands, and the
manifest files. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"link",
"commands",
"and",
"the",
"manifest",
"files",
"."
] | def GetLdflags(self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir):
"""Returns the flags that need to be added to link commands, and the
manifest files."""
config = self._TargetConfig(config)
ldflags = []
ld = self._GetWrapper(... | [
"def",
"GetLdflags",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
",",
"expand_special",
",",
"manifest_base_name",
",",
"output_name",
",",
"is_executable",
",",
"build_dir",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L556-L657 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Log.FlushActive | (*args, **kwargs) | return _misc_.Log_FlushActive(*args, **kwargs) | FlushActive() | FlushActive() | [
"FlushActive",
"()"
] | def FlushActive(*args, **kwargs):
"""FlushActive()"""
return _misc_.Log_FlushActive(*args, **kwargs) | [
"def",
"FlushActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Log_FlushActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1510-L1512 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py | python | convert_activation | (
builder, layer, input_names, output_names, keras_layer, respect_train
) | Convert an activation layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
respect_train: boolean,
Ignored. | Convert an activation layer from keras to coreml. | [
"Convert",
"an",
"activation",
"layer",
"from",
"keras",
"to",
"coreml",
"."
] | def convert_activation(
builder, layer, input_names, output_names, keras_layer, respect_train
):
"""
Convert an activation layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder objec... | [
"def",
"convert_activation",
"(",
"builder",
",",
"layer",
",",
"input_names",
",",
"output_names",
",",
"keras_layer",
",",
"respect_train",
")",
":",
"# Get input and output names",
"input_name",
",",
"output_name",
"=",
"(",
"input_names",
"[",
"0",
"]",
",",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py#L245-L334 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlNode.setSpacePreserve | (self, val) | Set (or reset) the space preserving behaviour of a node,
i.e. the value of the xml:space attribute. | Set (or reset) the space preserving behaviour of a node,
i.e. the value of the xml:space attribute. | [
"Set",
"(",
"or",
"reset",
")",
"the",
"space",
"preserving",
"behaviour",
"of",
"a",
"node",
"i",
".",
"e",
".",
"the",
"value",
"of",
"the",
"xml",
":",
"space",
"attribute",
"."
] | def setSpacePreserve(self, val):
"""Set (or reset) the space preserving behaviour of a node,
i.e. the value of the xml:space attribute. """
libxml2mod.xmlNodeSetSpacePreserve(self._o, val) | [
"def",
"setSpacePreserve",
"(",
"self",
",",
"val",
")",
":",
"libxml2mod",
".",
"xmlNodeSetSpacePreserve",
"(",
"self",
".",
"_o",
",",
"val",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2804-L2807 | ||
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/bg1/CharGenCommon.py | python | CharGen.displayOverview | (self) | Sets up the primary character generation window.
show all comments of previous stages | Sets up the primary character generation window.
show all comments of previous stages | [
"Sets",
"up",
"the",
"primary",
"character",
"generation",
"window",
".",
"show",
"all",
"comments",
"of",
"previous",
"stages"
] | def displayOverview(self):
"""
Sets up the primary character generation window.
show all comments of previous stages
"""
if(self.window):
CharGenWindow = self.window
else:
CharGenWindow = GemRB.LoadWindow (0, "GUICG")
step = self.step
#set portrait
PortraitButton = CharGenWindow.GetCont... | [
"def",
"displayOverview",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"window",
")",
":",
"CharGenWindow",
"=",
"self",
".",
"window",
"else",
":",
"CharGenWindow",
"=",
"GemRB",
".",
"LoadWindow",
"(",
"0",
",",
"\"GUICG\"",
")",
"step",
"=",
"self... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/bg1/CharGenCommon.py#L52-L136 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2_extras/config.py | python | Config.__getitem__ | (self, module) | Returns the configuration for a module. If it is not already
set, loads a ``default_config`` variable from the given module and
updates the configuration with those default values
Every module that allows some kind of configuration sets a
``default_config`` global variable that is loade... | Returns the configuration for a module. If it is not already
set, loads a ``default_config`` variable from the given module and
updates the configuration with those default values | [
"Returns",
"the",
"configuration",
"for",
"a",
"module",
".",
"If",
"it",
"is",
"not",
"already",
"set",
"loads",
"a",
"default_config",
"variable",
"from",
"the",
"given",
"module",
"and",
"updates",
"the",
"configuration",
"with",
"those",
"default",
"values... | def __getitem__(self, module):
"""Returns the configuration for a module. If it is not already
set, loads a ``default_config`` variable from the given module and
updates the configuration with those default values
Every module that allows some kind of configuration sets a
``defa... | [
"def",
"__getitem__",
"(",
"self",
",",
"module",
")",
":",
"if",
"module",
"not",
"in",
"self",
".",
"loaded",
":",
"# Load default configuration and update config.",
"values",
"=",
"webapp2",
".",
"import_string",
"(",
"module",
"+",
"'.default_config'",
",",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/config.py#L86-L113 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Dir.walk | (self, func, arg) | Walk this directory tree by calling the specified function
for each directory in the tree.
This behaves like the os.path.walk() function, but for in-memory
Node.FS.Dir objects. The function takes the same arguments as
the functions passed to os.path.walk():
func(arg, d... | Walk this directory tree by calling the specified function
for each directory in the tree. | [
"Walk",
"this",
"directory",
"tree",
"by",
"calling",
"the",
"specified",
"function",
"for",
"each",
"directory",
"in",
"the",
"tree",
"."
] | def walk(self, func, arg):
"""
Walk this directory tree by calling the specified function
for each directory in the tree.
This behaves like the os.path.walk() function, but for in-memory
Node.FS.Dir objects. The function takes the same arguments as
the functions passed ... | [
"def",
"walk",
"(",
"self",
",",
"func",
",",
"arg",
")",
":",
"entries",
"=",
"self",
".",
"entries",
"names",
"=",
"list",
"(",
"entries",
".",
"keys",
"(",
")",
")",
"names",
".",
"remove",
"(",
"'.'",
")",
"names",
".",
"remove",
"(",
"'..'",... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L2104-L2128 | ||
ros-planning/moveit | ee48dc5cedc981d0869352aa3db0b41469c2735c | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.get_current_state_bounded | (self) | return s | Get the current state of the robot bounded. | Get the current state of the robot bounded. | [
"Get",
"the",
"current",
"state",
"of",
"the",
"robot",
"bounded",
"."
] | def get_current_state_bounded(self):
""" Get the current state of the robot bounded."""
s = RobotState()
c_str = self._g.get_current_state_bounded()
conversions.msg_from_string(s, c_str)
return s | [
"def",
"get_current_state_bounded",
"(",
"self",
")",
":",
"s",
"=",
"RobotState",
"(",
")",
"c_str",
"=",
"self",
".",
"_g",
".",
"get_current_state_bounded",
"(",
")",
"conversions",
".",
"msg_from_string",
"(",
"s",
",",
"c_str",
")",
"return",
"s"
] | https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/move_group.py#L182-L187 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ContactStructuralMechanicsApplication/python_scripts/search_base_process.py | python | SearchBaseProcess.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.
"""
pass | [
"def",
"ExecuteBeforeSolutionLoop",
"(",
"self",
")",
":",
"pass"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/search_base_process.py#L203-L209 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | common_fill_value | (a, b) | return None | Return the common filling value of two masked arrays, if any.
If ``a.fill_value == b.fill_value``, return the fill value,
otherwise return None.
Parameters
----------
a, b : MaskedArray
The masked arrays for which to compare fill values.
Returns
-------
fill_value : scalar or ... | Return the common filling value of two masked arrays, if any. | [
"Return",
"the",
"common",
"filling",
"value",
"of",
"two",
"masked",
"arrays",
"if",
"any",
"."
] | def common_fill_value(a, b):
"""
Return the common filling value of two masked arrays, if any.
If ``a.fill_value == b.fill_value``, return the fill value,
otherwise return None.
Parameters
----------
a, b : MaskedArray
The masked arrays for which to compare fill values.
Return... | [
"def",
"common_fill_value",
"(",
"a",
",",
"b",
")",
":",
"t1",
"=",
"get_fill_value",
"(",
"a",
")",
"t2",
"=",
"get_fill_value",
"(",
"b",
")",
"if",
"t1",
"==",
"t2",
":",
"return",
"t1",
"return",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L562-L591 | |
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/PlaceDB.py | python | PlaceDB.height | (self) | return self.yh-self.yl | @return height of layout | [] | def height(self):
"""
@return height of layout
"""
return self.yh-self.yl | [
"def",
"height",
"(",
"self",
")",
":",
"return",
"self",
".",
"yh",
"-",
"self",
".",
"yl"
] | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/PlaceDB.py#L233-L237 | ||
alexozer/jankdrone | c4b403eb254b41b832ab2bdfade12ba59c99e5dc | handheld/lib/nanopb/generator/nanopb_generator.py | python | main_plugin | () | Main function when invoked as a protoc plugin. | Main function when invoked as a protoc plugin. | [
"Main",
"function",
"when",
"invoked",
"as",
"a",
"protoc",
"plugin",
"."
] | def main_plugin():
'''Main function when invoked as a protoc plugin.'''
import io, sys
if sys.platform == "win32":
import os, msvcrt
# Set stdin and stdout to binary mode
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
da... | [
"def",
"main_plugin",
"(",
")",
":",
"import",
"io",
",",
"sys",
"if",
"sys",
".",
"platform",
"==",
"\"win32\"",
":",
"import",
"os",
",",
"msvcrt",
"# Set stdin and stdout to binary mode",
"msvcrt",
".",
"setmode",
"(",
"sys",
".",
"stdin",
".",
"fileno",
... | https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/handheld/lib/nanopb/generator/nanopb_generator.py#L1549-L1603 | ||
diwu/Tiny-Wings-Remake-on-Android | a9fd714432a350b69615bf8dbb40448231a54524 | twxes10/libs/cocos2dx/platform/third_party/marmalade/freetype/src/tools/docmaker/utils.py | python | make_file_list | ( args = None ) | return file_list | builds a list of input files from command-line arguments | builds a list of input files from command-line arguments | [
"builds",
"a",
"list",
"of",
"input",
"files",
"from",
"command",
"-",
"line",
"arguments"
] | def make_file_list( args = None ):
"""builds a list of input files from command-line arguments"""
file_list = []
# sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
if not args:
args = sys.argv[1 :]
for pathname in args:
if string.find( pathname, '*' ) >= 0:
newpath = g... | [
"def",
"make_file_list",
"(",
"args",
"=",
"None",
")",
":",
"file_list",
"=",
"[",
"]",
"# sys.stderr.write( repr( sys.argv[1 :] ) + '\\n' )",
"if",
"not",
"args",
":",
"args",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"for",
"pathname",
"in",
"args",
... | https://github.com/diwu/Tiny-Wings-Remake-on-Android/blob/a9fd714432a350b69615bf8dbb40448231a54524/twxes10/libs/cocos2dx/platform/third_party/marmalade/freetype/src/tools/docmaker/utils.py#L106-L130 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/primitive.py | python | Primitive.recompute | (self, mode=True) | return self | Set the primitive recomputed. If a primitive set recomputed feeds into some backward nodes
for computing gradient, rather than storing the intermediate activation computed in forward
pass, we will recompute it in backward pass.
Note:
- If the computation involves something like ran... | Set the primitive recomputed. If a primitive set recomputed feeds into some backward nodes
for computing gradient, rather than storing the intermediate activation computed in forward
pass, we will recompute it in backward pass. | [
"Set",
"the",
"primitive",
"recomputed",
".",
"If",
"a",
"primitive",
"set",
"recomputed",
"feeds",
"into",
"some",
"backward",
"nodes",
"for",
"computing",
"gradient",
"rather",
"than",
"storing",
"the",
"intermediate",
"activation",
"computed",
"in",
"forward",
... | def recompute(self, mode=True):
"""
Set the primitive recomputed. If a primitive set recomputed feeds into some backward nodes
for computing gradient, rather than storing the intermediate activation computed in forward
pass, we will recompute it in backward pass.
Note:
... | [
"def",
"recompute",
"(",
"self",
",",
"mode",
"=",
"True",
")",
":",
"if",
"context",
".",
"get_context",
"(",
"\"mode\"",
")",
"==",
"context",
".",
"PYNATIVE_MODE",
":",
"raise",
"TypeError",
"(",
"\"Recompute is not supported in pynative mode currently.\"",
")"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/primitive.py#L324-L371 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/format_token.py | python | FormatToken.node_split_penalty | (self) | return pytree_utils.GetNodeAnnotation(
self.node, pytree_utils.Annotation.SPLIT_PENALTY, default=0) | Split penalty attached to the pytree node of this token. | Split penalty attached to the pytree node of this token. | [
"Split",
"penalty",
"attached",
"to",
"the",
"pytree",
"node",
"of",
"this",
"token",
"."
] | def node_split_penalty(self):
"""Split penalty attached to the pytree node of this token."""
return pytree_utils.GetNodeAnnotation(
self.node, pytree_utils.Annotation.SPLIT_PENALTY, default=0) | [
"def",
"node_split_penalty",
"(",
"self",
")",
":",
"return",
"pytree_utils",
".",
"GetNodeAnnotation",
"(",
"self",
".",
"node",
",",
"pytree_utils",
".",
"Annotation",
".",
"SPLIT_PENALTY",
",",
"default",
"=",
"0",
")"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/format_token.py#L190-L193 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | domain_check_interval.__init__ | (self, y1, y2) | domain_check_interval(a,b)(x) = true where x < a or y > b | domain_check_interval(a,b)(x) = true where x < a or y > b | [
"domain_check_interval",
"(",
"a",
"b",
")",
"(",
"x",
")",
"=",
"true",
"where",
"x",
"<",
"a",
"or",
"y",
">",
"b"
] | def __init__(self, y1, y2):
"domain_check_interval(a,b)(x) = true where x < a or y > b"
self.y1 = y1
self.y2 = y2 | [
"def",
"__init__",
"(",
"self",
",",
"y1",
",",
"y2",
")",
":",
"self",
".",
"y1",
"=",
"y1",
"self",
".",
"y2",
"=",
"y2"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L258-L261 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/examples/python/file_extract.py | python | FileExtract.get_n_uint64 | (self, n, fail_value=0) | Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers | Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers | [
"Extract",
"n",
"uint64_t",
"integers",
"from",
"the",
"binary",
"file",
"at",
"the",
"current",
"file",
"position",
"returns",
"a",
"list",
"of",
"integers"
] | def get_n_uint64(self, n, fail_value=0):
'''Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers'''
s = self.read_size(8 * n)
if s:
return struct.unpack(self.byte_order + ("%u" % n) + 'Q', s)
else:
return (fai... | [
"def",
"get_n_uint64",
"(",
"self",
",",
"n",
",",
"fail_value",
"=",
"0",
")",
":",
"s",
"=",
"self",
".",
"read_size",
"(",
"8",
"*",
"n",
")",
"if",
"s",
":",
"return",
"struct",
".",
"unpack",
"(",
"self",
".",
"byte_order",
"+",
"(",
"\"%u\"... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/examples/python/file_extract.py#L220-L226 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | llvm/utils/rsp_bisect.py | python | modify_rsp | (rsp_entries, other_rel_path, modify_after_num) | return ret | Create a modified rsp file for use in bisection.
Returns a new list from rsp.
For each file in rsp after the first modify_after_num files, prepend
other_rel_path. | Create a modified rsp file for use in bisection. | [
"Create",
"a",
"modified",
"rsp",
"file",
"for",
"use",
"in",
"bisection",
"."
] | def modify_rsp(rsp_entries, other_rel_path, modify_after_num):
"""Create a modified rsp file for use in bisection.
Returns a new list from rsp.
For each file in rsp after the first modify_after_num files, prepend
other_rel_path.
"""
ret = []
for r in rsp_entries:
if is_path(r):
if modify_after_... | [
"def",
"modify_rsp",
"(",
"rsp_entries",
",",
"other_rel_path",
",",
"modify_after_num",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"r",
"in",
"rsp_entries",
":",
"if",
"is_path",
"(",
"r",
")",
":",
"if",
"modify_after_num",
"==",
"0",
":",
"r",
"=",
"os"... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/utils/rsp_bisect.py#L89-L105 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/ensemble/_gb_losses.py | python | LossFunction.negative_gradient | (self, y, raw_predictions, **kargs) | Compute the negative gradient.
Parameters
----------
y : 1d array, shape (n_samples,)
The target labels.
raw_predictions : 2d array, shape (n_samples, K)
The raw predictions (i.e. values from the tree leaves) of the
tree ensemble at iteration ``i - 1... | Compute the negative gradient. | [
"Compute",
"the",
"negative",
"gradient",
"."
] | def negative_gradient(self, y, raw_predictions, **kargs):
"""Compute the negative gradient.
Parameters
----------
y : 1d array, shape (n_samples,)
The target labels.
raw_predictions : 2d array, shape (n_samples, K)
The raw predictions (i.e. values from t... | [
"def",
"negative_gradient",
"(",
"self",
",",
"y",
",",
"raw_predictions",
",",
"*",
"*",
"kargs",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_gb_losses.py#L60-L71 | ||
fabianschenk/RESLAM | 2e71a578b6d1a1ad1fb018641218e1f41dd9e330 | thirdparty/Sophus/py/sophus/se3.py | python | Se3.exp | (v) | return Se3(so3, V * upsilon) | exponential map | exponential map | [
"exponential",
"map"
] | def exp(v):
""" exponential map """
upsilon = v[0:3, :]
omega = sophus.Vector3(v[3], v[4], v[5])
so3 = sophus.So3.exp(omega)
Omega = sophus.So3.hat(omega)
Omega_sq = Omega * Omega
theta = sympy.sqrt(sophus.squared_norm(omega))
V = (sympy.Matrix.eye(3) +
... | [
"def",
"exp",
"(",
"v",
")",
":",
"upsilon",
"=",
"v",
"[",
"0",
":",
"3",
",",
":",
"]",
"omega",
"=",
"sophus",
".",
"Vector3",
"(",
"v",
"[",
"3",
"]",
",",
"v",
"[",
"4",
"]",
",",
"v",
"[",
"5",
"]",
")",
"so3",
"=",
"sophus",
".",... | https://github.com/fabianschenk/RESLAM/blob/2e71a578b6d1a1ad1fb018641218e1f41dd9e330/thirdparty/Sophus/py/sophus/se3.py#L22-L33 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsCatSc | (code) | return ret | Check whether the character is part of Sc UCS Category | Check whether the character is part of Sc UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Sc",
"UCS",
"Category"
] | def uCSIsCatSc(code):
"""Check whether the character is part of Sc UCS Category """
ret = libxml2mod.xmlUCSIsCatSc(code)
return ret | [
"def",
"uCSIsCatSc",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatSc",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2386-L2389 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/calendar.py | python | weekday | (year, month, day) | return datetime.date(year, month, day).weekday() | Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31). | Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31). | [
"Return",
"weekday",
"(",
"0",
"-",
"6",
"~",
"Mon",
"-",
"Sun",
")",
"for",
"year",
"month",
"(",
"1",
"-",
"12",
")",
"day",
"(",
"1",
"-",
"31",
")",
"."
] | def weekday(year, month, day):
"""Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
year = 2000 + year % 400
return datetime.date(year, month, day).weekday() | [
"def",
"weekday",
"(",
"year",
",",
"month",
",",
"day",
")",
":",
"if",
"not",
"datetime",
".",
"MINYEAR",
"<=",
"year",
"<=",
"datetime",
".",
"MAXYEAR",
":",
"year",
"=",
"2000",
"+",
"year",
"%",
"400",
"return",
"datetime",
".",
"date",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/calendar.py#L113-L117 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py | python | Globe.ServeLocalTiles | (self, globe_path) | Sets which tile db file is being served. | Sets which tile db file is being served. | [
"Sets",
"which",
"tile",
"db",
"file",
"is",
"being",
"served",
"."
] | def ServeLocalTiles(self, globe_path):
"""Sets which tile db file is being served."""
self.SetGlobePath(globe_path)
self.db_ = None
try:
print "sqlite connection to ", globe_path
self.db_ = sqlite3.connect(globe_path)
except Exception:
print "Failed to connect to %s." % globe_path | [
"def",
"ServeLocalTiles",
"(",
"self",
",",
"globe_path",
")",
":",
"self",
".",
"SetGlobePath",
"(",
"globe_path",
")",
"self",
".",
"db_",
"=",
"None",
"try",
":",
"print",
"\"sqlite connection to \"",
",",
"globe_path",
"self",
".",
"db_",
"=",
"sqlite3",... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py#L388-L396 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsSupplementaryPrivateUseAreaB | (code) | return ret | Check whether the character is part of
SupplementaryPrivateUseArea-B UCS Block | Check whether the character is part of
SupplementaryPrivateUseArea-B UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"SupplementaryPrivateUseArea",
"-",
"B",
"UCS",
"Block"
] | def uCSIsSupplementaryPrivateUseAreaB(code):
"""Check whether the character is part of
SupplementaryPrivateUseArea-B UCS Block """
ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaB(code)
return ret | [
"def",
"uCSIsSupplementaryPrivateUseAreaB",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsSupplementaryPrivateUseAreaB",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2108-L2112 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py | python | UdInsnDef.lookupPrefix | (self, pfx) | return True if pfx in self.prefixes else None | Lookup prefix (if any, None otherwise), by name | Lookup prefix (if any, None otherwise), by name | [
"Lookup",
"prefix",
"(",
"if",
"any",
"None",
"otherwise",
")",
"by",
"name"
] | def lookupPrefix(self, pfx):
"""Lookup prefix (if any, None otherwise), by name"""
return True if pfx in self.prefixes else None | [
"def",
"lookupPrefix",
"(",
"self",
",",
"pfx",
")",
":",
"return",
"True",
"if",
"pfx",
"in",
"self",
".",
"prefixes",
"else",
"None"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py#L51-L53 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiPaneInfo.HasMaximizeButton | (*args, **kwargs) | return _aui.AuiPaneInfo_HasMaximizeButton(*args, **kwargs) | HasMaximizeButton(self) -> bool | HasMaximizeButton(self) -> bool | [
"HasMaximizeButton",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasMaximizeButton(*args, **kwargs):
"""HasMaximizeButton(self) -> bool"""
return _aui.AuiPaneInfo_HasMaximizeButton(*args, **kwargs) | [
"def",
"HasMaximizeButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_HasMaximizeButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L317-L319 | |
google/google-api-cpp-client | 3df15df632bef43eb320645ac3329d872aabf5ad | prepare_dependencies.py | python | MongoosePackageInstaller.MaybeTweakAfterUnpackage | (self) | Creates a CMakeLists.txt file for building the package. | Creates a CMakeLists.txt file for building the package. | [
"Creates",
"a",
"CMakeLists",
".",
"txt",
"file",
"for",
"building",
"the",
"package",
"."
] | def MaybeTweakAfterUnpackage(self):
"""Creates a CMakeLists.txt file for building the package."""
config = self._config
cmakelists_path = os.path.join(self._package_path, 'CMakeLists.txt')
if config.force and os.path.exists(cmakelists_path):
os.unlink(cmakelists_path)
if os.path.exists(cmakeli... | [
"def",
"MaybeTweakAfterUnpackage",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"_config",
"cmakelists_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_package_path",
",",
"'CMakeLists.txt'",
")",
"if",
"config",
".",
"force",
"and",
"... | https://github.com/google/google-api-cpp-client/blob/3df15df632bef43eb320645ac3329d872aabf5ad/prepare_dependencies.py#L677-L693 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | Logger.handle | (self, record) | Call the handlers for the specified record.
This method is used for unpickled records received from a socket, as
well as those created locally. Logger-level filtering is applied. | Call the handlers for the specified record. | [
"Call",
"the",
"handlers",
"for",
"the",
"specified",
"record",
"."
] | def handle(self, record):
"""
Call the handlers for the specified record.
This method is used for unpickled records received from a socket, as
well as those created locally. Logger-level filtering is applied.
"""
if (not self.disabled) and self.filter(record):
... | [
"def",
"handle",
"(",
"self",
",",
"record",
")",
":",
"if",
"(",
"not",
"self",
".",
"disabled",
")",
"and",
"self",
".",
"filter",
"(",
"record",
")",
":",
"self",
".",
"callHandlers",
"(",
"record",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1270-L1278 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | TextEntryBase.CanRedo | (*args, **kwargs) | return _core_.TextEntryBase_CanRedo(*args, **kwargs) | CanRedo(self) -> bool
Returns True if the text field is editable and the last undo can be
redone. | CanRedo(self) -> bool | [
"CanRedo",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanRedo(*args, **kwargs):
"""
CanRedo(self) -> bool
Returns True if the text field is editable and the last undo can be
redone.
"""
return _core_.TextEntryBase_CanRedo(*args, **kwargs) | [
"def",
"CanRedo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextEntryBase_CanRedo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13232-L13239 | |
ptrkrysik/gr-gsm | 2de47e28ce1fb9a518337bfc0add36c8e3cff5eb | python/qa_tch_h_decoder.py | python | qa_tch_h_decoder.test_amr7_40_and_4_75 | (self) | TCH/H MultiRate AMR 7.40 and 4.75
Two 7.40 followed by two 4.75 frames | TCH/H MultiRate AMR 7.40 and 4.75
Two 7.40 followed by two 4.75 frames | [
"TCH",
"/",
"H",
"MultiRate",
"AMR",
"7",
".",
"40",
"and",
"4",
".",
"75",
"Two",
"7",
".",
"40",
"followed",
"by",
"two",
"4",
".",
"75",
"frames"
] | def test_amr7_40_and_4_75 (self):
"""
TCH/H MultiRate AMR 7.40 and 4.75
Two 7.40 followed by two 4.75 frames
"""
b = self.b
self.assertListEqual(self.tchh_multirate(
multirate= "28111a40",
subchan = 0,
frames = [259657, 25965... | [
"def",
"test_amr7_40_and_4_75",
"(",
"self",
")",
":",
"b",
"=",
"self",
".",
"b",
"self",
".",
"assertListEqual",
"(",
"self",
".",
"tchh_multirate",
"(",
"multirate",
"=",
"\"28111a40\"",
",",
"subchan",
"=",
"0",
",",
"frames",
"=",
"[",
"259657",
","... | https://github.com/ptrkrysik/gr-gsm/blob/2de47e28ce1fb9a518337bfc0add36c8e3cff5eb/python/qa_tch_h_decoder.py#L117-L147 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/_differentialevolution.py | python | DifferentialEvolutionSolver._unscale_parameters | (self, parameters) | return (parameters - self.__scale_arg1) / self.__scale_arg2 + 0.5 | scale from parameters to a number between 0 and 1. | scale from parameters to a number between 0 and 1. | [
"scale",
"from",
"parameters",
"to",
"a",
"number",
"between",
"0",
"and",
"1",
"."
] | def _unscale_parameters(self, parameters):
"""
scale from parameters to a number between 0 and 1.
"""
return (parameters - self.__scale_arg1) / self.__scale_arg2 + 0.5 | [
"def",
"_unscale_parameters",
"(",
"self",
",",
"parameters",
")",
":",
"return",
"(",
"parameters",
"-",
"self",
".",
"__scale_arg1",
")",
"/",
"self",
".",
"__scale_arg2",
"+",
"0.5"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_differentialevolution.py#L676-L680 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py | python | InstalledDistribution._get_records | (self) | return results | Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
size might be ``None`` for some entries. The path is exactly
as stored in the file (which is as in PEP 376). | [] | def _get_records(self):
"""
Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
size might be ``None`` for some entries. The path is exactly
as stored in the file (which is as in PEP 376)... | [
"def",
"_get_records",
"(",
"self",
")",
":",
"results",
"=",
"[",
"]",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"'RECORD'",
")",
"with",
"contextlib",
".",
"closing",
"(",
"r",
".",
"as_stream",
"(",
")",
")",
"as",
"stream",
":",
"with",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L1159-L1201 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/dataset.py | python | _DatasetWriter.write | (self, writer_net, fields) | Add operations to `net` that append the blobs in `fields` to the end
of the dataset. An additional operator will also be added that checks
the consistency of the data in `fields` against the dataset schema.
Args:
writer_net: The net that will contain the Append operators.
... | Add operations to `net` that append the blobs in `fields` to the end
of the dataset. An additional operator will also be added that checks
the consistency of the data in `fields` against the dataset schema. | [
"Add",
"operations",
"to",
"net",
"that",
"append",
"the",
"blobs",
"in",
"fields",
"to",
"the",
"end",
"of",
"the",
"dataset",
".",
"An",
"additional",
"operator",
"will",
"also",
"be",
"added",
"that",
"checks",
"the",
"consistency",
"of",
"the",
"data",... | def write(self, writer_net, fields):
"""
Add operations to `net` that append the blobs in `fields` to the end
of the dataset. An additional operator will also be added that checks
the consistency of the data in `fields` against the dataset schema.
Args:
writer_net: T... | [
"def",
"write",
"(",
"self",
",",
"writer_net",
",",
"fields",
")",
":",
"assert",
"self",
".",
"mutex",
"is",
"not",
"None",
",",
"'setup not called.'",
"field_blobs",
"=",
"self",
".",
"_content",
".",
"field_blobs",
"(",
")",
"assert",
"len",
"(",
"fi... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/dataset.py#L134-L152 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | X509Req.to_cryptography | (self) | return _CertificateSigningRequest(backend, self._req) | Export as a ``cryptography`` certificate signing request.
:rtype: ``cryptography.x509.CertificateSigningRequest``
.. versionadded:: 17.1.0 | Export as a ``cryptography`` certificate signing request. | [
"Export",
"as",
"a",
"cryptography",
"certificate",
"signing",
"request",
"."
] | def to_cryptography(self):
"""
Export as a ``cryptography`` certificate signing request.
:rtype: ``cryptography.x509.CertificateSigningRequest``
.. versionadded:: 17.1.0
"""
from cryptography.hazmat.backends.openssl.x509 import (
_CertificateSigningRequest
... | [
"def",
"to_cryptography",
"(",
"self",
")",
":",
"from",
"cryptography",
".",
"hazmat",
".",
"backends",
".",
"openssl",
".",
"x509",
"import",
"(",
"_CertificateSigningRequest",
")",
"backend",
"=",
"_get_backend",
"(",
")",
"return",
"_CertificateSigningRequest"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L863-L875 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py | python | _linux_distribution | (distname, version, id, supported_dists,
full_distribution_name) | return distname, version, id | Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.
supported_dists may be given to define the set of Linux
distributions to l... | Tries to determine the name of the Linux OS distribution name. | [
"Tries",
"to",
"determine",
"the",
"name",
"of",
"the",
"Linux",
"OS",
"distribution",
"name",
"."
] | def _linux_distribution(distname, version, id, supported_dists,
full_distribution_name):
""" Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
... | [
"def",
"_linux_distribution",
"(",
"distname",
",",
"version",
",",
"id",
",",
"supported_dists",
",",
"full_distribution_name",
")",
":",
"try",
":",
"etc",
"=",
"os",
".",
"listdir",
"(",
"_UNIXCONFDIR",
")",
"except",
"OSError",
":",
"# Probably not a Unix sy... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py#L341-L391 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/gradientbutton.py | python | GradientButton.GetPressedBottomColour | (self) | return self._pressedBottomColour | Returns the pressed bottom start colour for the gradient shading. | Returns the pressed bottom start colour for the gradient shading. | [
"Returns",
"the",
"pressed",
"bottom",
"start",
"colour",
"for",
"the",
"gradient",
"shading",
"."
] | def GetPressedBottomColour(self):
""" Returns the pressed bottom start colour for the gradient shading. """
return self._pressedBottomColour | [
"def",
"GetPressedBottomColour",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pressedBottomColour"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/gradientbutton.py#L646-L649 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/common.py | python | _is_dtype | (arr_or_dtype, condition) | return condition(dtype) | Return a boolean if the condition is satisfied for the arr_or_dtype.
Parameters
----------
arr_or_dtype : array-like, str, np.dtype, or ExtensionArrayType
The array-like or dtype object whose dtype we want to extract.
condition : callable[Union[np.dtype, ExtensionDtype]]
Returns
------... | Return a boolean if the condition is satisfied for the arr_or_dtype. | [
"Return",
"a",
"boolean",
"if",
"the",
"condition",
"is",
"satisfied",
"for",
"the",
"arr_or_dtype",
"."
] | def _is_dtype(arr_or_dtype, condition) -> bool:
"""
Return a boolean if the condition is satisfied for the arr_or_dtype.
Parameters
----------
arr_or_dtype : array-like, str, np.dtype, or ExtensionArrayType
The array-like or dtype object whose dtype we want to extract.
condition : calla... | [
"def",
"_is_dtype",
"(",
"arr_or_dtype",
",",
"condition",
")",
"->",
"bool",
":",
"if",
"arr_or_dtype",
"is",
"None",
":",
"return",
"False",
"try",
":",
"dtype",
"=",
"get_dtype",
"(",
"arr_or_dtype",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/common.py#L1519-L1540 | |
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | rtc_tools/py_event_log_analyzer/pb_parse.py | python | ParseProtobuf | (file_path) | return [
DataPoint(event.rtp_packet.header, event.rtp_packet.packet_length,
event.timestamp_us, event.rtp_packet.incoming)
for event in event_stream.stream if event.HasField("rtp_packet")
] | Parses RTC event log from protobuf file.
Args:
file_path: path to protobuf file of RTC event stream
Returns:
all RTP packet events from the event stream as a list of DataPoints | Parses RTC event log from protobuf file. | [
"Parses",
"RTC",
"event",
"log",
"from",
"protobuf",
"file",
"."
] | def ParseProtobuf(file_path):
"""Parses RTC event log from protobuf file.
Args:
file_path: path to protobuf file of RTC event stream
Returns:
all RTP packet events from the event stream as a list of DataPoints
"""
event_stream = rtc_pb.EventStream()
with open(file_path, "rb") as f:
... | [
"def",
"ParseProtobuf",
"(",
"file_path",
")",
":",
"event_stream",
"=",
"rtc_pb",
".",
"EventStream",
"(",
")",
"with",
"open",
"(",
"file_path",
",",
"\"rb\"",
")",
"as",
"f",
":",
"event_stream",
".",
"ParseFromString",
"(",
"f",
".",
"read",
"(",
")"... | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/rtc_tools/py_event_log_analyzer/pb_parse.py#L34-L51 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/vm/caffe/net.py | python | Net.backward | (self, **kwargs) | Backward pass. [**PyCaffe Style**]
Parameters
----------
diffs : dict or None
The diffs to feed before.
Returns
=------
None
References
----------
The implementation of `Net_backward(pycaffe.py, L137)`_. | Backward pass. [**PyCaffe Style**] | [
"Backward",
"pass",
".",
"[",
"**",
"PyCaffe",
"Style",
"**",
"]"
] | def backward(self, **kwargs):
"""Backward pass. [**PyCaffe Style**]
Parameters
----------
diffs : dict or None
The diffs to feed before.
Returns
=------
None
References
----------
The implementation of `Net_backward(pycaffe.p... | [
"def",
"backward",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"kwargs",
":",
"for",
"name",
",",
"blob",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"ws",
".",
"FeedTensor",
"(",
"self",
".",
"_blobs",
"[",
"name",
"]",
"[",
"'diff'",... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/caffe/net.py#L381-L402 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/query.py | python | HelpSource.__init__ | (self, parent, title, *, menuitem='', filepath='',
used_names={}, _htest=False, _utest=False) | Get menu entry and url/local file for Additional Help.
User enters a name for the Help resource and a web url or file
name. The user can browse for the file. | Get menu entry and url/local file for Additional Help. | [
"Get",
"menu",
"entry",
"and",
"url",
"/",
"local",
"file",
"for",
"Additional",
"Help",
"."
] | def __init__(self, parent, title, *, menuitem='', filepath='',
used_names={}, _htest=False, _utest=False):
"""Get menu entry and url/local file for Additional Help.
User enters a name for the Help resource and a web url or file
name. The user can browse for the file.
""... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"title",
",",
"*",
",",
"menuitem",
"=",
"''",
",",
"filepath",
"=",
"''",
",",
"used_names",
"=",
"{",
"}",
",",
"_htest",
"=",
"False",
",",
"_utest",
"=",
"False",
")",
":",
"self",
".",
"fil... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/query.py#L246-L257 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Source/JavaScriptCore/disassembler/udis86/ud_itab.py | python | UdItabGenerator.genOpcodeTable | (self, table, isGlobal=False) | Emit Opcode Table in C. | Emit Opcode Table in C. | [
"Emit",
"Opcode",
"Table",
"in",
"C",
"."
] | def genOpcodeTable(self, table, isGlobal=False):
"""Emit Opcode Table in C.
"""
self.ItabC.write( "\n" );
if not isGlobal:
self.ItabC.write('static ')
self.ItabC.write( "const uint16_t %s[] = {\n" % self.getTableName(table))
for i in range(table.size()):
... | [
"def",
"genOpcodeTable",
"(",
"self",
",",
"table",
",",
"isGlobal",
"=",
"False",
")",
":",
"self",
".",
"ItabC",
".",
"write",
"(",
"\"\\n\"",
")",
"if",
"not",
"isGlobal",
":",
"self",
".",
"ItabC",
".",
"write",
"(",
"'static '",
")",
"self",
"."... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Source/JavaScriptCore/disassembler/udis86/ud_itab.py#L221-L241 | ||
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/service_reflection.py | python | GeneratedServiceType.__init__ | (cls, name, bases, dictionary) | Creates a message service class.
Args:
name: Name of the class (ignored, but required by the metaclass
protocol).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must contain a Service... | Creates a message service class. | [
"Creates",
"a",
"message",
"service",
"class",
"."
] | def __init__(cls, name, bases, dictionary):
"""Creates a message service class.
Args:
name: Name of the class (ignored, but required by the metaclass
protocol).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
... | [
"def",
"__init__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"# Don't do anything if this class doesn't have a descriptor. This happens",
"# when a service class is subclassed.",
"if",
"GeneratedServiceType",
".",
"_DESCRIPTOR_KEY",
"not",
"in",
"dic... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/service_reflection.py#L64-L83 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/mixture/_base.py | python | BaseMixture.predict_proba | (self, X) | return np.exp(log_resp) | Predict posterior probability of each component given the data.
Parameters
----------
X : array-like, shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
Returns
-------
resp : ar... | Predict posterior probability of each component given the data. | [
"Predict",
"posterior",
"probability",
"of",
"each",
"component",
"given",
"the",
"data",
"."
] | def predict_proba(self, X):
"""Predict posterior probability of each component given the data.
Parameters
----------
X : array-like, shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
Re... | [
"def",
"predict_proba",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
")",
"X",
"=",
"_check_X",
"(",
"X",
",",
"None",
",",
"self",
".",
"means_",
".",
"shape",
"[",
"1",
"]",
")",
"_",
",",
"log_resp",
"=",
"self",
".",
"_est... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_base.py#L374-L392 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py | python | Barrier.__init__ | (self, parties, action=None, timeout=None) | Create a barrier, initialised to 'parties' threads.
'action' is a callable which, when supplied, will be called by one of
the threads after they have all entered the barrier and just prior to
releasing them all. If a 'timeout' is provided, it is used as the
default for all subsequent 'w... | Create a barrier, initialised to 'parties' threads. | [
"Create",
"a",
"barrier",
"initialised",
"to",
"parties",
"threads",
"."
] | def __init__(self, parties, action=None, timeout=None):
"""Create a barrier, initialised to 'parties' threads.
'action' is a callable which, when supplied, will be called by one of
the threads after they have all entered the barrier and just prior to
releasing them all. If a 'timeout' i... | [
"def",
"__init__",
"(",
"self",
",",
"parties",
",",
"action",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_cond",
"=",
"Condition",
"(",
"Lock",
"(",
")",
")",
"self",
".",
"_action",
"=",
"action",
"self",
".",
"_timeout",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py#L576-L590 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | Context._internal_operation_seed | (self) | return self._rng.randint(0, _MAXINT32) | Returns a fake operation seed.
In eager mode, user shouldn't set or depend on operation seed.
Here, we generate a random seed based on global seed to make
operation's randomness different and depend on the global seed.
Returns:
A fake operation seed based on global seed. | Returns a fake operation seed. | [
"Returns",
"a",
"fake",
"operation",
"seed",
"."
] | def _internal_operation_seed(self):
"""Returns a fake operation seed.
In eager mode, user shouldn't set or depend on operation seed.
Here, we generate a random seed based on global seed to make
operation's randomness different and depend on the global seed.
Returns:
A fake operation se... | [
"def",
"_internal_operation_seed",
"(",
"self",
")",
":",
"return",
"self",
".",
"_rng",
".",
"randint",
"(",
"0",
",",
"_MAXINT32",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L524-L534 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiTabContainer.SetNormalFont | (self, font) | Sets the normal font for drawing tab labels.
:param Font `font`: the new font to use to draw tab labels in their normal, un-selected state. | Sets the normal font for drawing tab labels. | [
"Sets",
"the",
"normal",
"font",
"for",
"drawing",
"tab",
"labels",
"."
] | def SetNormalFont(self, font):
"""
Sets the normal font for drawing tab labels.
:param Font `font`: the new font to use to draw tab labels in their normal, un-selected state.
"""
self._art.SetNormalFont(font) | [
"def",
"SetNormalFont",
"(",
"self",
",",
"font",
")",
":",
"self",
".",
"_art",
".",
"SetNormalFont",
"(",
"font",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L951-L958 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | onnxruntime/python/onnxruntime_inference_collection.py | python | SparseTensor.as_csrc_view | (self) | return self._tensor.get_csrc_data() | The method will return CSR(C) representation of the sparse tensor which will enable
querying CRS(C) indices. If the instance dit not contain CSR(C) format, it would throw.
You can query indices as:
::
inner_ndices = sparse_tensor.as_csrc_view().inner()
outer_ndices = sp... | The method will return CSR(C) representation of the sparse tensor which will enable
querying CRS(C) indices. If the instance dit not contain CSR(C) format, it would throw.
You can query indices as: | [
"The",
"method",
"will",
"return",
"CSR",
"(",
"C",
")",
"representation",
"of",
"the",
"sparse",
"tensor",
"which",
"will",
"enable",
"querying",
"CRS",
"(",
"C",
")",
"indices",
".",
"If",
"the",
"instance",
"dit",
"not",
"contain",
"CSR",
"(",
"C",
... | def as_csrc_view(self):
'''
The method will return CSR(C) representation of the sparse tensor which will enable
querying CRS(C) indices. If the instance dit not contain CSR(C) format, it would throw.
You can query indices as:
::
inner_ndices = sparse_tensor.as_csrc_... | [
"def",
"as_csrc_view",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tensor",
".",
"get_csrc_data",
"(",
")"
] | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/onnxruntime_inference_collection.py#L766-L779 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py2/data.py | python | Data.flatten | (self, installer) | return tmap.items() | Flatten the file list to (target, file) tuples | Flatten the file list to (target, file) tuples | [
"Flatten",
"the",
"file",
"list",
"to",
"(",
"target",
"file",
")",
"tuples"
] | def flatten(self, installer):
""" Flatten the file list to (target, file) tuples """
# pylint: disable = W0613
if self._prefix:
_, prefix = splitpath(self._prefix)
telems = prefix
else:
telems = []
tmap = {}
for fname in self._files:
... | [
"def",
"flatten",
"(",
"self",
",",
"installer",
")",
":",
"# pylint: disable = W0613",
"if",
"self",
".",
"_prefix",
":",
"_",
",",
"prefix",
"=",
"splitpath",
"(",
"self",
".",
"_prefix",
")",
"telems",
"=",
"prefix",
"else",
":",
"telems",
"=",
"[",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py2/data.py#L106-L124 | |
lilypond/lilypond | 2a14759372979f5b796ee802b0ee3bc15d28b06b | python/convertrules.py | python | rule | (version, message) | return dec | version: a LilyPond version tuple like (2, 11, 50)
message: the message that describes the conversion.
This decorator adds its function together with the version and the
message to the global conversions list. (It doesn't need to return
the function as it isn't used directly anyway.)
A conversion... | version: a LilyPond version tuple like (2, 11, 50)
message: the message that describes the conversion. | [
"version",
":",
"a",
"LilyPond",
"version",
"tuple",
"like",
"(",
"2",
"11",
"50",
")",
"message",
":",
"the",
"message",
"that",
"describes",
"the",
"conversion",
"."
] | def rule(version, message):
"""
version: a LilyPond version tuple like (2, 11, 50)
message: the message that describes the conversion.
This decorator adds its function together with the version and the
message to the global conversions list. (It doesn't need to return
the function as it isn't ... | [
"def",
"rule",
"(",
"version",
",",
"message",
")",
":",
"def",
"dec",
"(",
"f",
")",
":",
"conversions",
".",
"append",
"(",
"(",
"version",
",",
"f",
",",
"message",
")",
")",
"return",
"dec"
] | https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/python/convertrules.py#L50-L69 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | DepFile.__init__ | (self, builder, name) | Construct a dependency file for builder with given name. | Construct a dependency file for builder with given name. | [
"Construct",
"a",
"dependency",
"file",
"for",
"builder",
"with",
"given",
"name",
"."
] | def __init__(self, builder, name):
"""Construct a dependency file for builder with given name."""
self.__builder = builder
self.name = name
self.__files = []
self.__invalid = False
self.__hashes = None
self.__dirty = False | [
"def",
"__init__",
"(",
"self",
",",
"builder",
",",
"name",
")",
":",
"self",
".",
"__builder",
"=",
"builder",
"self",
".",
"name",
"=",
"name",
"self",
".",
"__files",
"=",
"[",
"]",
"self",
".",
"__invalid",
"=",
"False",
"self",
".",
"__hashes",... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1161-L1168 | ||
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub3-upgrade.py | python | Pub1Parser.p_bindkey | (self, p) | bindkey : null
| string
| bind_var
| integer | bindkey : null
| string
| bind_var
| integer | [
"bindkey",
":",
"null",
"|",
"string",
"|",
"bind_var",
"|",
"integer"
] | def p_bindkey (self, p):
'''bindkey : null
| string
| bind_var
| integer'''
p[0] = p[1] | [
"def",
"p_bindkey",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub3-upgrade.py#L1016-L1021 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py | python | FTP.retrlines | (self, cmd, callback = None) | return self.voidresp() | Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, or NLST command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.
[default: print_line()]
Return... | Retrieve data in line mode. A new port is created for you. | [
"Retrieve",
"data",
"in",
"line",
"mode",
".",
"A",
"new",
"port",
"is",
"created",
"for",
"you",
"."
] | def retrlines(self, cmd, callback = None):
"""Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, or NLST command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.
... | [
"def",
"retrlines",
"(",
"self",
",",
"cmd",
",",
"callback",
"=",
"None",
")",
":",
"if",
"callback",
"is",
"None",
":",
"callback",
"=",
"print_line",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'TYPE A'",
")",
"with",
"self",
".",
"transfercmd",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L453-L486 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | TextAttrDimensionConverter.ConvertTenthsMMToPixels | (*args, **kwargs) | return _richtext.TextAttrDimensionConverter_ConvertTenthsMMToPixels(*args, **kwargs) | ConvertTenthsMMToPixels(self, int units) -> int | ConvertTenthsMMToPixels(self, int units) -> int | [
"ConvertTenthsMMToPixels",
"(",
"self",
"int",
"units",
")",
"-",
">",
"int"
] | def ConvertTenthsMMToPixels(*args, **kwargs):
"""ConvertTenthsMMToPixels(self, int units) -> int"""
return _richtext.TextAttrDimensionConverter_ConvertTenthsMMToPixels(*args, **kwargs) | [
"def",
"ConvertTenthsMMToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextAttrDimensionConverter_ConvertTenthsMMToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L278-L280 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/util/regex.py | python | replace | (s, pattern, replacement) | return re.sub(pattern, _replacement, s) | Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression.
Args:
s (str): the string to modify
pattern (str): the search expression
replacement (str): the string to replace each match with | Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression. | [
"Replaces",
"occurrences",
"of",
"a",
"match",
"string",
"in",
"a",
"given",
"string",
"and",
"returns",
"the",
"new",
"string",
".",
"The",
"match",
"string",
"can",
"be",
"a",
"regex",
"expression",
"."
] | def replace(s, pattern, replacement):
"""Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression.
Args:
s (str): the string to modify
pattern (str): the search expression
replacement (str): the... | [
"def",
"replace",
"(",
"s",
",",
"pattern",
",",
"replacement",
")",
":",
"# the replacement string may contain invalid backreferences (like \\1 or \\g)",
"# which will cause python's regex to blow up. Since this should emulate",
"# the jam version exactly and the jam version didn't support"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/util/regex.py#L31-L50 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py | python | Binomial.dtype | (self) | return self._p.dtype | dtype of samples from this distribution. | dtype of samples from this distribution. | [
"dtype",
"of",
"samples",
"from",
"this",
"distribution",
"."
] | def dtype(self):
"""dtype of samples from this distribution."""
return self._p.dtype | [
"def",
"dtype",
"(",
"self",
")",
":",
"return",
"self",
".",
"_p",
".",
"dtype"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py#L158-L160 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/linear_quadratic.py | python | MFGLinearQuadraticGame.new_initial_state | (self) | return MFGLinearQuadraticState(self) | Returns a state corresponding to the start of a game. | Returns a state corresponding to the start of a game. | [
"Returns",
"a",
"state",
"corresponding",
"to",
"the",
"start",
"of",
"a",
"game",
"."
] | def new_initial_state(self):
"""Returns a state corresponding to the start of a game."""
return MFGLinearQuadraticState(self) | [
"def",
"new_initial_state",
"(",
"self",
")",
":",
"return",
"MFGLinearQuadraticState",
"(",
"self",
")"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/linear_quadratic.py#L111-L113 | |
jiangxiluning/FOTS.PyTorch | b1851c170b4f1ad18406766352cb5171648ce603 | FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py | python | validate_tl_line | (line,LTRB=True,withTranscription=True,withConfidence=True,imWidth=0,imHeight=0) | Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription]
LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,... | Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription]
LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,... | [
"Validate",
"the",
"format",
"of",
"the",
"line",
".",
"If",
"the",
"line",
"is",
"not",
"valid",
"an",
"exception",
"will",
"be",
"raised",
".",
"If",
"maxWidth",
"and",
"maxHeight",
"are",
"specified",
"all",
"points",
"must",
"be",
"inside",
"the",
"i... | def validate_tl_line(line,LTRB=True,withTranscription=True,withConfidence=True,imWidth=0,imHeight=0):
"""
Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
L... | [
"def",
"validate_tl_line",
"(",
"line",
",",
"LTRB",
"=",
"True",
",",
"withTranscription",
"=",
"True",
",",
"withConfidence",
"=",
"True",
",",
"imWidth",
"=",
"0",
",",
"imHeight",
"=",
"0",
")",
":",
"get_tl_line_values",
"(",
"line",
",",
"LTRB",
",... | https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py#L111-L119 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/glprogram.py | python | GLProgram.mousefunc | (self,button,state,x,y) | return False | Called when the mouse is clicked. May be overridden. | Called when the mouse is clicked. May be overridden. | [
"Called",
"when",
"the",
"mouse",
"is",
"clicked",
".",
"May",
"be",
"overridden",
"."
] | def mousefunc(self,button,state,x,y):
"""Called when the mouse is clicked. May be overridden."""
return False | [
"def",
"mousefunc",
"(",
"self",
",",
"button",
",",
"state",
",",
"x",
",",
"y",
")",
":",
"return",
"False"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/glprogram.py#L129-L131 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/texture_3d.py | python | Texture3D.write | (self, data, viewport=None, *, alignment=1) | Update the content of the texture from byte data
or a moderngl :py:class:`~moderngl.Buffer`::
# Write data from a moderngl Buffer
data = ctx.buffer(reserve=8)
texture = ctx.texture3d((2, 2, 2), 1)
texture.write(data)
# Write d... | Update the content of the texture from byte data
or a moderngl :py:class:`~moderngl.Buffer`:: | [
"Update",
"the",
"content",
"of",
"the",
"texture",
"from",
"byte",
"data",
"or",
"a",
"moderngl",
":",
"py",
":",
"class",
":",
"~moderngl",
".",
"Buffer",
"::"
] | def write(self, data, viewport=None, *, alignment=1) -> None:
'''
Update the content of the texture from byte data
or a moderngl :py:class:`~moderngl.Buffer`::
# Write data from a moderngl Buffer
data = ctx.buffer(reserve=8)
texture = ctx.... | [
"def",
"write",
"(",
"self",
",",
"data",
",",
"viewport",
"=",
"None",
",",
"*",
",",
"alignment",
"=",
"1",
")",
"->",
"None",
":",
"if",
"type",
"(",
"data",
")",
"is",
"Buffer",
":",
"data",
"=",
"data",
".",
"mglo",
"self",
".",
"mglo",
".... | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/texture_3d.py#L258-L284 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/modeling/gradient_clipping.py | python | GradientClipping.__init__ | (self, grad_clip_method, clip_norm_type='l2_norm',
clip_threshold=0.1, use_parameter_norm=False,
compute_norm_ratio=False, clip_max=1, clip_min=-1,
blobs_to_include=None, blobs_to_exclude=None) | Clips gradient to avoid gradient magnitude explosion or vanishing gradient.
Args:
grad_clip_method: ways to clip the gradients
clip_norm_type: type of norm used in the necessary computation
clip_threshold: threshold used to determine whether to clip
use_parameter_norm: a boolean... | Clips gradient to avoid gradient magnitude explosion or vanishing gradient. | [
"Clips",
"gradient",
"to",
"avoid",
"gradient",
"magnitude",
"explosion",
"or",
"vanishing",
"gradient",
"."
] | def __init__(self, grad_clip_method, clip_norm_type='l2_norm',
clip_threshold=0.1, use_parameter_norm=False,
compute_norm_ratio=False, clip_max=1, clip_min=-1,
blobs_to_include=None, blobs_to_exclude=None):
"""
Clips gradient to avoid gradient magnitude ex... | [
"def",
"__init__",
"(",
"self",
",",
"grad_clip_method",
",",
"clip_norm_type",
"=",
"'l2_norm'",
",",
"clip_threshold",
"=",
"0.1",
",",
"use_parameter_norm",
"=",
"False",
",",
"compute_norm_ratio",
"=",
"False",
",",
"clip_max",
"=",
"1",
",",
"clip_min",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/modeling/gradient_clipping.py#L27-L67 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/packages/ssl_match_hostname/_implementation.py | python | match_hostname | (cert, hostname) | Verify that *cert* (in decoded format as returned by
SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125
rules are followed, but IP addresses are not accepted for *hostname*.
CertificateError is raised on failure. On success, the function
returns nothing. | Verify that *cert* (in decoded format as returned by
SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125
rules are followed, but IP addresses are not accepted for *hostname*. | [
"Verify",
"that",
"*",
"cert",
"*",
"(",
"in",
"decoded",
"format",
"as",
"returned",
"by",
"SSLSocket",
".",
"getpeercert",
"()",
")",
"matches",
"the",
"*",
"hostname",
"*",
".",
"RFC",
"2818",
"and",
"RFC",
"6125",
"rules",
"are",
"followed",
"but",
... | def match_hostname(cert, hostname):
"""Verify that *cert* (in decoded format as returned by
SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125
rules are followed, but IP addresses are not accepted for *hostname*.
CertificateError is raised on failure. On success, the function
r... | [
"def",
"match_hostname",
"(",
"cert",
",",
"hostname",
")",
":",
"if",
"not",
"cert",
":",
"raise",
"ValueError",
"(",
"\"empty or no certificate, match_hostname needs a \"",
"\"SSL socket or SSL context with either \"",
"\"CERT_OPTIONAL or CERT_REQUIRED\"",
")",
"try",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/packages/ssl_match_hostname/_implementation.py#L97-L160 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/substitution_args.py | python | _find_resource | (resolved, a, args, _context, source_path_to_packages=None) | return before + paths[0] + after | process $(find-resource PKG PATH)
Resolves the relative PATH from the share folder of the PKG either from install space, devel space or from the source folder.
:returns: updated resolved argument, ``str``
:raises: :exc:SubstitutionException: if PKG and PATH invalidly specified or relative PATH is not found ... | process $(find-resource PKG PATH)
Resolves the relative PATH from the share folder of the PKG either from install space, devel space or from the source folder.
:returns: updated resolved argument, ``str``
:raises: :exc:SubstitutionException: if PKG and PATH invalidly specified or relative PATH is not found ... | [
"process",
"$",
"(",
"find",
"-",
"resource",
"PKG",
"PATH",
")",
"Resolves",
"the",
"relative",
"PATH",
"from",
"the",
"share",
"folder",
"of",
"the",
"PKG",
"either",
"from",
"install",
"space",
"devel",
"space",
"or",
"from",
"the",
"source",
"folder",
... | def _find_resource(resolved, a, args, _context, source_path_to_packages=None):
"""
process $(find-resource PKG PATH)
Resolves the relative PATH from the share folder of the PKG either from install space, devel space or from the source folder.
:returns: updated resolved argument, ``str``
:raises: :ex... | [
"def",
"_find_resource",
"(",
"resolved",
",",
"a",
",",
"args",
",",
"_context",
",",
"source_path_to_packages",
"=",
"None",
")",
":",
"if",
"len",
"(",
"args",
")",
"!=",
"2",
":",
"raise",
"SubstitutionException",
"(",
"\"$(find-resource pkg path) command on... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/substitution_args.py#L194-L213 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/io/resource.py | python | thumbnail | (value,size,type='auto',world=None,frame=None) | return plugin.image | Retrieves an image of the given item, resized to the given size.
Args:
value: a resource type.
size (pair of ints): the (width,height) of the thumbnail, in pixels.
type (str, optional): the type of value
world (WorldModel, optional): if given, the resource will be drawn with
... | Retrieves an image of the given item, resized to the given size. | [
"Retrieves",
"an",
"image",
"of",
"the",
"given",
"item",
"resized",
"to",
"the",
"given",
"size",
"."
] | def thumbnail(value,size,type='auto',world=None,frame=None):
"""Retrieves an image of the given item, resized to the given size.
Args:
value: a resource type.
size (pair of ints): the (width,height) of the thumbnail, in pixels.
type (str, optional): the type of value
world (Worl... | [
"def",
"thumbnail",
"(",
"value",
",",
"size",
",",
"type",
"=",
"'auto'",
",",
"world",
"=",
"None",
",",
"frame",
"=",
"None",
")",
":",
"global",
"_thumbnail_window",
"world",
"=",
"_get_world",
"(",
"world",
")",
"if",
"isinstance",
"(",
"value",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/resource.py#L415-L497 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.