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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/_config/config.py | python | _build_option_description | (k) | return s | Builds a formatted description of a registered option and prints it | Builds a formatted description of a registered option and prints it | [
"Builds",
"a",
"formatted",
"description",
"of",
"a",
"registered",
"option",
"and",
"prints",
"it"
] | def _build_option_description(k):
""" Builds a formatted description of a registered option and prints it """
o = _get_registered_option(k)
d = _get_deprecated_option(k)
s = f"{k} "
if o.doc:
s += "\n".join(o.doc.strip().split("\n"))
else:
s += "No description available."
... | [
"def",
"_build_option_description",
"(",
"k",
")",
":",
"o",
"=",
"_get_registered_option",
"(",
"k",
")",
"d",
"=",
"_get_deprecated_option",
"(",
"k",
")",
"s",
"=",
"f\"{k} \"",
"if",
"o",
".",
"doc",
":",
"s",
"+=",
"\"\\n\"",
".",
"join",
"(",
"o"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/_config/config.py#L635-L657 | |
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/lib/checkChromSet.py | python | getTabixChromSet | (tabixBin, tabixFile) | return chromSet | Return the set of chromosomes from any tabix-indexed file | Return the set of chromosomes from any tabix-indexed file | [
"Return",
"the",
"set",
"of",
"chromosomes",
"from",
"any",
"tabix",
"-",
"indexed",
"file"
] | def getTabixChromSet(tabixBin, tabixFile) :
"""
Return the set of chromosomes from any tabix-indexed file
"""
import subprocess
chromSet = set()
tabixCmd = [tabixBin, "-l", tabixFile]
proc=subprocess.Popen(tabixCmd, stdout=subprocess.PIPE)
for line in proc.stdout :
chrom = line.... | [
"def",
"getTabixChromSet",
"(",
"tabixBin",
",",
"tabixFile",
")",
":",
"import",
"subprocess",
"chromSet",
"=",
"set",
"(",
")",
"tabixCmd",
"=",
"[",
"tabixBin",
",",
"\"-l\"",
",",
"tabixFile",
"]",
"proc",
"=",
"subprocess",
".",
"Popen",
"(",
"tabixCm... | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/checkChromSet.py#L103-L119 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py | python | _assert_pid_not_reused | (fun) | return wrapper | Decorator which raises NoSuchProcess in case a process is no
longer running or its PID has been reused. | Decorator which raises NoSuchProcess in case a process is no
longer running or its PID has been reused. | [
"Decorator",
"which",
"raises",
"NoSuchProcess",
"in",
"case",
"a",
"process",
"is",
"no",
"longer",
"running",
"or",
"its",
"PID",
"has",
"been",
"reused",
"."
] | def _assert_pid_not_reused(fun):
"""Decorator which raises NoSuchProcess in case a process is no
longer running or its PID has been reused.
"""
@_wraps(fun)
def wrapper(self, *args, **kwargs):
if not self.is_running():
raise NoSuchProcess(self.pid, self._name)
return fun(... | [
"def",
"_assert_pid_not_reused",
"(",
"fun",
")",
":",
"@",
"_wraps",
"(",
"fun",
")",
"def",
"wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"is_running",
"(",
")",
":",
"raise",
"NoSuchProcess"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L250-L259 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | Benchmarks/synthetic_benchmark/create_table.py | python | Column.createColumnDetailsString | (self) | return result | Returns the ColumnDetails as expected by pymapd's API | Returns the ColumnDetails as expected by pymapd's API | [
"Returns",
"the",
"ColumnDetails",
"as",
"expected",
"by",
"pymapd",
"s",
"API"
] | def createColumnDetailsString(self):
"""
Returns the ColumnDetails as expected by pymapd's API
"""
result = "ColumnDetails(name='"
result += self.column_name
result += "', type='"
result += self.sql_type.upper()
result += "', nullable=True, precision=0, sc... | [
"def",
"createColumnDetailsString",
"(",
"self",
")",
":",
"result",
"=",
"\"ColumnDetails(name='\"",
"result",
"+=",
"self",
".",
"column_name",
"result",
"+=",
"\"', type='\"",
"result",
"+=",
"self",
".",
"sql_type",
".",
"upper",
"(",
")",
"result",
"+=",
... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/Benchmarks/synthetic_benchmark/create_table.py#L35-L44 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | TimelineEvent.get_bounds | (self) | ! Get Bounds
@param self this object
@return the bounds | ! Get Bounds | [
"!",
"Get",
"Bounds"
] | def get_bounds(self):
"""! Get Bounds
@param self this object
@return the bounds
"""
if len(self.events) > 0:
lo = self.events[0].at
hi = self.events[-1].at
return(lo, hi)
else:
return(0, 0) | [
"def",
"get_bounds",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"events",
")",
">",
"0",
":",
"lo",
"=",
"self",
".",
"events",
"[",
"0",
"]",
".",
"at",
"hi",
"=",
"self",
".",
"events",
"[",
"-",
"1",
"]",
".",
"at",
"return",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L252-L262 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py | python | load_cdll | (name, macos10_16_path) | Loads a CDLL by name, falling back to known path on 10.16+ | Loads a CDLL by name, falling back to known path on 10.16+ | [
"Loads",
"a",
"CDLL",
"by",
"name",
"falling",
"back",
"to",
"known",
"path",
"on",
"10",
".",
"16",
"+"
] | def load_cdll(name, macos10_16_path):
"""Loads a CDLL by name, falling back to known path on 10.16+"""
try:
# Big Sur is technically 11 but we use 10.16 due to the Big Sur
# beta being labeled as 10.16.
if version_info >= (10, 16):
path = macos10_16_path
else:
... | [
"def",
"load_cdll",
"(",
"name",
",",
"macos10_16_path",
")",
":",
"try",
":",
"# Big Sur is technically 11 but we use 10.16 due to the Big Sur",
"# beta being labeled as 10.16.",
"if",
"version_info",
">=",
"(",
"10",
",",
"16",
")",
":",
"path",
"=",
"macos10_16_path"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py#L65-L78 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | SashWindow.SashHitTest | (*args, **kwargs) | return _windows_.SashWindow_SashHitTest(*args, **kwargs) | SashHitTest(self, int x, int y, int tolerance=2) -> int | SashHitTest(self, int x, int y, int tolerance=2) -> int | [
"SashHitTest",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"tolerance",
"=",
"2",
")",
"-",
">",
"int"
] | def SashHitTest(*args, **kwargs):
"""SashHitTest(self, int x, int y, int tolerance=2) -> int"""
return _windows_.SashWindow_SashHitTest(*args, **kwargs) | [
"def",
"SashHitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SashWindow_SashHitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1870-L1872 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/math_ops.py | python | reduce_min | (input_tensor, axis=None, keepdims=False, name=None) | return _may_reduce_to_scalar(
keepdims, axis,
gen_math_ops._min(
input_tensor, _ReductionDims(input_tensor, axis), keepdims,
name=name)) | Computes the `tf.math.minimum` of elements across dimensions of a tensor.
This is the reduction operation for the elementwise `tf.math.minimum` op.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each
of the entries in `axis`, ... | Computes the `tf.math.minimum` of elements across dimensions of a tensor. | [
"Computes",
"the",
"tf",
".",
"math",
".",
"minimum",
"of",
"elements",
"across",
"dimensions",
"of",
"a",
"tensor",
"."
] | def reduce_min(input_tensor, axis=None, keepdims=False, name=None):
"""Computes the `tf.math.minimum` of elements across dimensions of a tensor.
This is the reduction operation for the elementwise `tf.math.minimum` op.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the... | [
"def",
"reduce_min",
"(",
"input_tensor",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"keepdims",
"=",
"False",
"if",
"keepdims",
"is",
"None",
"else",
"bool",
"(",
"keepdims",
")",
"return",
"_may_reduce_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L2932-L2991 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | ipow | (a, b) | return a | Same as a **= b. | Same as a **= b. | [
"Same",
"as",
"a",
"**",
"=",
"b",
"."
] | def ipow(a, b):
"Same as a **= b."
a **=b
return a | [
"def",
"ipow",
"(",
"a",
",",
"b",
")",
":",
"a",
"**=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L385-L388 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py | python | ModelFittingModel.y_parameters | (self) | return list(self.fitting_context.y_parameters.keys()) | Returns the Y parameters that are stored by the fitting context. | Returns the Y parameters that are stored by the fitting context. | [
"Returns",
"the",
"Y",
"parameters",
"that",
"are",
"stored",
"by",
"the",
"fitting",
"context",
"."
] | def y_parameters(self) -> list:
"""Returns the Y parameters that are stored by the fitting context."""
return list(self.fitting_context.y_parameters.keys()) | [
"def",
"y_parameters",
"(",
"self",
")",
"->",
"list",
":",
"return",
"list",
"(",
"self",
".",
"fitting_context",
".",
"y_parameters",
".",
"keys",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py#L63-L65 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | PyPickerBase.SetTextCtrl | (*args, **kwargs) | return _controls_.PyPickerBase_SetTextCtrl(*args, **kwargs) | SetTextCtrl(self, TextCtrl text) | SetTextCtrl(self, TextCtrl text) | [
"SetTextCtrl",
"(",
"self",
"TextCtrl",
"text",
")"
] | def SetTextCtrl(*args, **kwargs):
"""SetTextCtrl(self, TextCtrl text)"""
return _controls_.PyPickerBase_SetTextCtrl(*args, **kwargs) | [
"def",
"SetTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"PyPickerBase_SetTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6880-L6882 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/dask_cudf/dask_cudf/io/parquet.py | python | read_parquet | (
path,
columns=None,
split_row_groups=None,
row_groups_per_part=None,
**kwargs,
) | return dd.read_parquet(
path,
columns=columns,
split_row_groups=split_row_groups,
engine=CudfEngine,
**kwargs,
) | Read parquet files into a Dask DataFrame
Calls ``dask.dataframe.read_parquet`` to cordinate the execution of
``cudf.read_parquet``, and ultimately read multiple partitions into
a single Dask dataframe. The Dask version must supply an
``ArrowDatasetEngine`` class to support full functionality.
See `... | Read parquet files into a Dask DataFrame | [
"Read",
"parquet",
"files",
"into",
"a",
"Dask",
"DataFrame"
] | def read_parquet(
path,
columns=None,
split_row_groups=None,
row_groups_per_part=None,
**kwargs,
):
"""Read parquet files into a Dask DataFrame
Calls ``dask.dataframe.read_parquet`` to cordinate the execution of
``cudf.read_parquet``, and ultimately read multiple partitions into
a s... | [
"def",
"read_parquet",
"(",
"path",
",",
"columns",
"=",
"None",
",",
"split_row_groups",
"=",
"None",
",",
"row_groups_per_part",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"if",
"isinstance",
"(",
"columns",
",",
"str",
")",
":",
"columns",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/io/parquet.py#L351-L393 | |
dfm/celerite | 62c8ce6f5816c655ad2a2d1b3eaaaf9fc7ca7908 | celerite/modeling.py | python | Model.log_prior | (self) | return 0.0 | Compute the log prior probability of the current parameters | Compute the log prior probability of the current parameters | [
"Compute",
"the",
"log",
"prior",
"probability",
"of",
"the",
"current",
"parameters"
] | def log_prior(self):
"""Compute the log prior probability of the current parameters"""
for p, b in zip(self.parameter_vector, self.parameter_bounds):
if b[0] is not None and p < b[0]:
return -np.inf
if b[1] is not None and p > b[1]:
return -np.inf
... | [
"def",
"log_prior",
"(",
"self",
")",
":",
"for",
"p",
",",
"b",
"in",
"zip",
"(",
"self",
".",
"parameter_vector",
",",
"self",
".",
"parameter_bounds",
")",
":",
"if",
"b",
"[",
"0",
"]",
"is",
"not",
"None",
"and",
"p",
"<",
"b",
"[",
"0",
"... | https://github.com/dfm/celerite/blob/62c8ce6f5816c655ad2a2d1b3eaaaf9fc7ca7908/celerite/modeling.py#L299-L306 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/view_audio.py | python | AudioDemo.init_ui | (self) | setup the GUI for the app | setup the GUI for the app | [
"setup",
"the",
"GUI",
"for",
"the",
"app"
] | def init_ui(self):
""" setup the GUI for the app """
self.master.title("Test")
self.pack(fill=BOTH, expand=True)
# Input section
input_frame = LabelFrame(self, text="Input")
input_frame.bind("-", self.on_minus_key)
input_frame.bind("+", self.on_plus_key)
... | [
"def",
"init_ui",
"(",
"self",
")",
":",
"self",
".",
"master",
".",
"title",
"(",
"\"Test\"",
")",
"self",
".",
"pack",
"(",
"fill",
"=",
"BOTH",
",",
"expand",
"=",
"True",
")",
"# Input section",
"input_frame",
"=",
"LabelFrame",
"(",
"self",
",",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/view_audio.py#L602-L661 | ||
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/utils/check_entity_existence_by_list.py | python | check_entities | (filename) | Check entities in filename
:param filename:
:return: | Check entities in filename
:param filename:
:return: | [
"Check",
"entities",
"in",
"filename",
":",
"param",
"filename",
":",
":",
"return",
":"
] | def check_entities(filename):
"""
Check entities in filename
:param filename:
:return:
"""
with open(filename, 'r') as file:
for line in file:
id = line.strip()
check_entity(id) | [
"def",
"check_entities",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"file",
":",
"for",
"line",
"in",
"file",
":",
"id",
"=",
"line",
".",
"strip",
"(",
")",
"check_entity",
"(",
"id",
")"
] | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/utils/check_entity_existence_by_list.py#L77-L87 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py | python | Context.divide_int | (self, a, b) | Divides two numbers and returns the integer part of the result.
>>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
Decimal('0')
>>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
Decimal('3')
>>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
D... | Divides two numbers and returns the integer part of the result. | [
"Divides",
"two",
"numbers",
"and",
"returns",
"the",
"integer",
"part",
"of",
"the",
"result",
"."
] | def divide_int(self, a, b):
"""Divides two numbers and returns the integer part of the result.
>>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
Decimal('0')
>>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
Decimal('3')
>>> ExtendedContext.divide_int(... | [
"def",
"divide_int",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"r",
"=",
"a",
".",
"__floordiv__",
"(",
"b",
",",
"context",
"=",
"self",
")",
"if",
"r",
"is",
"NotImplement... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L4395-L4416 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | RegionIterator.__nonzero__ | (*args, **kwargs) | return _gdi_.RegionIterator___nonzero__(*args, **kwargs) | __nonzero__(self) -> bool | __nonzero__(self) -> bool | [
"__nonzero__",
"(",
"self",
")",
"-",
">",
"bool"
] | def __nonzero__(*args, **kwargs):
"""__nonzero__(self) -> bool"""
return _gdi_.RegionIterator___nonzero__(*args, **kwargs) | [
"def",
"__nonzero__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"RegionIterator___nonzero__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1710-L1712 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/utils/check_cfc/check_cfc.py | python | path_without_wrapper | () | return remove_dir_from_path(path, scriptdir) | Returns the PATH variable modified to remove the path to this program. | Returns the PATH variable modified to remove the path to this program. | [
"Returns",
"the",
"PATH",
"variable",
"modified",
"to",
"remove",
"the",
"path",
"to",
"this",
"program",
"."
] | def path_without_wrapper():
"""Returns the PATH variable modified to remove the path to this program."""
scriptdir = get_main_dir()
path = os.environ['PATH']
return remove_dir_from_path(path, scriptdir) | [
"def",
"path_without_wrapper",
"(",
")",
":",
"scriptdir",
"=",
"get_main_dir",
"(",
")",
"path",
"=",
"os",
".",
"environ",
"[",
"'PATH'",
"]",
"return",
"remove_dir_from_path",
"(",
"path",
",",
"scriptdir",
")"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/utils/check_cfc/check_cfc.py#L105-L109 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | Co-Simulation/PTV-Vissim/run_synchronization.py | python | SimulationSynchronization.close | (self) | Cleans synchronization. | Cleans synchronization. | [
"Cleans",
"synchronization",
"."
] | def close(self):
"""
Cleans synchronization.
"""
# Configuring carla simulation in async mode.
settings = self.carla.world.get_settings()
settings.synchronous_mode = False
settings.fixed_delta_seconds = None
self.carla.world.apply_settings(settings)
... | [
"def",
"close",
"(",
"self",
")",
":",
"# Configuring carla simulation in async mode.",
"settings",
"=",
"self",
".",
"carla",
".",
"world",
".",
"get_settings",
"(",
")",
"settings",
".",
"synchronous_mode",
"=",
"False",
"settings",
".",
"fixed_delta_seconds",
"... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/Co-Simulation/PTV-Vissim/run_synchronization.py#L152-L167 | ||
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | _AddFilters | (filters) | Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Adds more filter overrides. | [
"Adds",
"more",
"filter",
"overrides",
"."
] | def _AddFilters(filters):
"""Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint_sta... | [
"def",
"_AddFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"AddFilters",
"(",
"filters",
")"
] | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L893-L903 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTarget.FindGlobalVariables | (self, *args) | return _lldb.SBTarget_FindGlobalVariables(self, *args) | FindGlobalVariables(self, str name, uint32_t max_matches) -> SBValueList
FindGlobalVariables(self, str name, uint32_t max_matches, MatchType matchtype) -> SBValueList
Find global and static variables by name.
@param[in] name
The name of the global or static variable we are ... | FindGlobalVariables(self, str name, uint32_t max_matches) -> SBValueList
FindGlobalVariables(self, str name, uint32_t max_matches, MatchType matchtype) -> SBValueList | [
"FindGlobalVariables",
"(",
"self",
"str",
"name",
"uint32_t",
"max_matches",
")",
"-",
">",
"SBValueList",
"FindGlobalVariables",
"(",
"self",
"str",
"name",
"uint32_t",
"max_matches",
"MatchType",
"matchtype",
")",
"-",
">",
"SBValueList"
] | def FindGlobalVariables(self, *args):
"""
FindGlobalVariables(self, str name, uint32_t max_matches) -> SBValueList
FindGlobalVariables(self, str name, uint32_t max_matches, MatchType matchtype) -> SBValueList
Find global and static variables by name.
@param[in] name
... | [
"def",
"FindGlobalVariables",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBTarget_FindGlobalVariables",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L8984-L9001 | |
SOUI2/soui | 774e5566b2d3254a94f4b3efd55b982e7c665434 | third-part/jsoncpp/doxybuild.py | python | cd | (newdir) | http://stackoverflow.com/questions/431684/how-do-i-cd-in-python | http://stackoverflow.com/questions/431684/how-do-i-cd-in-python | [
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"431684",
"/",
"how",
"-",
"do",
"-",
"i",
"-",
"cd",
"-",
"in",
"-",
"python"
] | def cd(newdir):
"""
http://stackoverflow.com/questions/431684/how-do-i-cd-in-python
"""
prevdir = os.getcwd()
os.chdir(newdir)
try:
yield
finally:
os.chdir(prevdir) | [
"def",
"cd",
"(",
"newdir",
")",
":",
"prevdir",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"newdir",
")",
"try",
":",
"yield",
"finally",
":",
"os",
".",
"chdir",
"(",
"prevdir",
")"
] | https://github.com/SOUI2/soui/blob/774e5566b2d3254a94f4b3efd55b982e7c665434/third-part/jsoncpp/doxybuild.py#L15-L24 | ||
musescore/MuseScore | a817fea23e3c2be30847b7fde5b01746222c252e | thirdparty/freetype/src/tools/docmaker/sources.py | python | SourceProcessor.process_normal_line | ( self, line ) | Process a normal line and check whether it is the start of a new
block. | Process a normal line and check whether it is the start of a new
block. | [
"Process",
"a",
"normal",
"line",
"and",
"check",
"whether",
"it",
"is",
"the",
"start",
"of",
"a",
"new",
"block",
"."
] | def process_normal_line( self, line ):
"""Process a normal line and check whether it is the start of a new
block."""
for f in re_source_block_formats:
if f.start.match( line ):
self.add_block_lines()
self.format = f
self.lineno = fi... | [
"def",
"process_normal_line",
"(",
"self",
",",
"line",
")",
":",
"for",
"f",
"in",
"re_source_block_formats",
":",
"if",
"f",
".",
"start",
".",
"match",
"(",
"line",
")",
":",
"self",
".",
"add_block_lines",
"(",
")",
"self",
".",
"format",
"=",
"f",... | https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/thirdparty/freetype/src/tools/docmaker/sources.py#L369-L378 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py | python | XmlTopologyParser.get_instances | (self) | return self.__instances | Returns a topology object. | Returns a topology object. | [
"Returns",
"a",
"topology",
"object",
"."
] | def get_instances(self):
"""
Returns a topology object.
"""
return self.__instances | [
"def",
"get_instances",
"(",
"self",
")",
":",
"return",
"self",
".",
"__instances"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py#L340-L344 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/code_coverage/croc.py | python | Coverage.UpdateTreeStats | (self) | Recalculates the tree stats from the currently covered files.
Also calculates coverage summary for files. | Recalculates the tree stats from the currently covered files. | [
"Recalculates",
"the",
"tree",
"stats",
"from",
"the",
"currently",
"covered",
"files",
"."
] | def UpdateTreeStats(self):
"""Recalculates the tree stats from the currently covered files.
Also calculates coverage summary for files.
"""
self.tree = CoveredDir('')
for cov_file in self.files.itervalues():
# Add the file to the tree
fdirs = cov_file.filename.split('/')
parent = ... | [
"def",
"UpdateTreeStats",
"(",
"self",
")",
":",
"self",
".",
"tree",
"=",
"CoveredDir",
"(",
"''",
")",
"for",
"cov_file",
"in",
"self",
".",
"files",
".",
"itervalues",
"(",
")",
":",
"# Add the file to the tree",
"fdirs",
"=",
"cov_file",
".",
"filename... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/code_coverage/croc.py#L570-L602 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/yaml/__init__.py | python | compose | (stream, Loader=Loader) | Parse the first YAML document in a stream
and produce the corresponding representation tree. | Parse the first YAML document in a stream
and produce the corresponding representation tree. | [
"Parse",
"the",
"first",
"YAML",
"document",
"in",
"a",
"stream",
"and",
"produce",
"the",
"corresponding",
"representation",
"tree",
"."
] | def compose(stream, Loader=Loader):
"""
Parse the first YAML document in a stream
and produce the corresponding representation tree.
"""
loader = Loader(stream)
try:
return loader.get_single_node()
finally:
loader.dispose() | [
"def",
"compose",
"(",
"stream",
",",
"Loader",
"=",
"Loader",
")",
":",
"loader",
"=",
"Loader",
"(",
"stream",
")",
"try",
":",
"return",
"loader",
".",
"get_single_node",
"(",
")",
"finally",
":",
"loader",
".",
"dispose",
"(",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/yaml/__init__.py#L41-L50 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/expression.py | python | Expression.is_pwl | (self) | return self.is_constant() | Is the expression piecewise linear? | Is the expression piecewise linear? | [
"Is",
"the",
"expression",
"piecewise",
"linear?"
] | def is_pwl(self) -> bool:
"""Is the expression piecewise linear?
"""
# Defaults to constant.
return self.is_constant() | [
"def",
"is_pwl",
"(",
"self",
")",
"->",
"bool",
":",
"# Defaults to constant.",
"return",
"self",
".",
"is_constant",
"(",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L320-L324 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/filters.py | python | do_first | (environment, seq) | Return the first item of a sequence. | Return the first item of a sequence. | [
"Return",
"the",
"first",
"item",
"of",
"a",
"sequence",
"."
] | def do_first(environment, seq):
"""Return the first item of a sequence."""
try:
return next(iter(seq))
except StopIteration:
return environment.undefined('No first item, sequence was empty.') | [
"def",
"do_first",
"(",
"environment",
",",
"seq",
")",
":",
"try",
":",
"return",
"next",
"(",
"iter",
"(",
"seq",
")",
")",
"except",
"StopIteration",
":",
"return",
"environment",
".",
"undefined",
"(",
"'No first item, sequence was empty.'",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/filters.py#L433-L438 | ||
llvm-mirror/libcxx | 78d6a7767ed57b50122a161b91f59f19c9bd0d19 | utils/gdb/libcxx/printers.py | python | AbstractRBTreePrinter._get_key_value | (self, node) | Subclasses should override to return a list of values to yield. | Subclasses should override to return a list of values to yield. | [
"Subclasses",
"should",
"override",
"to",
"return",
"a",
"list",
"of",
"values",
"to",
"yield",
"."
] | def _get_key_value(self, node):
"""Subclasses should override to return a list of values to yield."""
raise NotImplementedError | [
"def",
"_get_key_value",
"(",
"self",
",",
"node",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/utils/gdb/libcxx/printers.py#L628-L630 | ||
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/core.py | python | SimulationThread.set_nodes_of_interest | (self, nodes) | !
Set nodes of interest function.
@param self: class object.
@param nodes: class object.
@return | !
Set nodes of interest function. | [
"!",
"Set",
"nodes",
"of",
"interest",
"function",
"."
] | def set_nodes_of_interest(self, nodes):
"""!
Set nodes of interest function.
@param self: class object.
@param nodes: class object.
@return
"""
self.lock.acquire()
try:
self.sim_helper.SetNodesOfInterest(nodes)
finally:
sel... | [
"def",
"set_nodes_of_interest",
"(",
"self",
",",
"nodes",
")",
":",
"self",
".",
"lock",
".",
"acquire",
"(",
")",
"try",
":",
"self",
".",
"sim_helper",
".",
"SetNodesOfInterest",
"(",
"nodes",
")",
"finally",
":",
"self",
".",
"lock",
".",
"release",
... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/core.py#L635-L647 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeMacBundleBinaryOutput | (self) | return os.path.join(path, self.xcode_settings.GetExecutablePath()) | Return the 'output' (full output path) to the binary in a bundle. | Return the 'output' (full output path) to the binary in a bundle. | [
"Return",
"the",
"output",
"(",
"full",
"output",
"path",
")",
"to",
"the",
"binary",
"in",
"a",
"bundle",
"."
] | def ComputeMacBundleBinaryOutput(self):
"""Return the 'output' (full output path) to the binary in a bundle."""
assert self.is_mac_bundle
path = self.ExpandSpecial(generator_default_variables['PRODUCT_DIR'])
return os.path.join(path, self.xcode_settings.GetExecutablePath()) | [
"def",
"ComputeMacBundleBinaryOutput",
"(",
"self",
")",
":",
"assert",
"self",
".",
"is_mac_bundle",
"path",
"=",
"self",
".",
"ExpandSpecial",
"(",
"generator_default_variables",
"[",
"'PRODUCT_DIR'",
"]",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L1062-L1066 | |
google/swiftshader | 8ccc63f045d5975fb67f9dfd3d2b8235b0526990 | third_party/llvm-10.0/scripts/update.py | python | copy_common_generated_files | (dst_base) | Copy platform-independent generated files. | Copy platform-independent generated files. | [
"Copy",
"platform",
"-",
"independent",
"generated",
"files",
"."
] | def copy_common_generated_files(dst_base):
"""Copy platform-independent generated files."""
log("Copying platform-independent generated files", 1)
suffixes = {'.inc', '.h', '.def'}
subdirs = [
path.join('include', 'llvm', 'IR'),
path.join('include', 'llvm', 'Support'),
path.join(... | [
"def",
"copy_common_generated_files",
"(",
"dst_base",
")",
":",
"log",
"(",
"\"Copying platform-independent generated files\"",
",",
"1",
")",
"suffixes",
"=",
"{",
"'.inc'",
",",
"'.h'",
",",
"'.def'",
"}",
"subdirs",
"=",
"[",
"path",
".",
"join",
"(",
"'in... | https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/llvm-10.0/scripts/update.py#L238-L252 | ||
wuye9036/SalviaRenderer | a3931dec1b1e5375ef497a9d4d064f0521ba6f37 | blibs/cpuinfo.py | python | get_cpu_info | () | return output | Returns the CPU info by using the best sources of information for your OS.
Returns the result in a dict | Returns the CPU info by using the best sources of information for your OS.
Returns the result in a dict | [
"Returns",
"the",
"CPU",
"info",
"by",
"using",
"the",
"best",
"sources",
"of",
"information",
"for",
"your",
"OS",
".",
"Returns",
"the",
"result",
"in",
"a",
"dict"
] | def get_cpu_info():
'''
Returns the CPU info by using the best sources of information for your OS.
Returns the result in a dict
'''
import json
output = get_cpu_info_json()
# Convert JSON to Python with non unicode strings
output = json.loads(output, object_hook = _utf_to_str)
return output | [
"def",
"get_cpu_info",
"(",
")",
":",
"import",
"json",
"output",
"=",
"get_cpu_info_json",
"(",
")",
"# Convert JSON to Python with non unicode strings",
"output",
"=",
"json",
".",
"loads",
"(",
"output",
",",
"object_hook",
"=",
"_utf_to_str",
")",
"return",
"o... | https://github.com/wuye9036/SalviaRenderer/blob/a3931dec1b1e5375ef497a9d4d064f0521ba6f37/blibs/cpuinfo.py#L2185-L2198 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_publisher.py | python | HeaderlessTopicDiagnostic.tick | (self) | Signals that a publication has occurred. | Signals that a publication has occurred. | [
"Signals",
"that",
"a",
"publication",
"has",
"occurred",
"."
] | def tick(self):
"""Signals that a publication has occurred."""
self.freq.tick() | [
"def",
"tick",
"(",
"self",
")",
":",
"self",
".",
"freq",
".",
"tick",
"(",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_publisher.py#L72-L74 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/external/qt_loaders.py | python | can_import | (api) | Safely query whether an API is importable, without importing it | Safely query whether an API is importable, without importing it | [
"Safely",
"query",
"whether",
"an",
"API",
"is",
"importable",
"without",
"importing",
"it"
] | def can_import(api):
"""Safely query whether an API is importable, without importing it"""
if not has_binding(api):
return False
current = loaded_api()
if api == QT_API_PYQT_DEFAULT:
return current in [QT_API_PYQT6, None]
else:
return current in [api, None] | [
"def",
"can_import",
"(",
"api",
")",
":",
"if",
"not",
"has_binding",
"(",
"api",
")",
":",
"return",
"False",
"current",
"=",
"loaded_api",
"(",
")",
"if",
"api",
"==",
"QT_API_PYQT_DEFAULT",
":",
"return",
"current",
"in",
"[",
"QT_API_PYQT6",
",",
"N... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/external/qt_loaders.py#L179-L188 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/utils/lui/lldbutil.py | python | continue_to_breakpoint | (process, bkpt) | Continues the process, if it stops, returns the threads stopped at bkpt; otherwise, returns None | Continues the process, if it stops, returns the threads stopped at bkpt; otherwise, returns None | [
"Continues",
"the",
"process",
"if",
"it",
"stops",
"returns",
"the",
"threads",
"stopped",
"at",
"bkpt",
";",
"otherwise",
"returns",
"None"
] | def continue_to_breakpoint(process, bkpt):
""" Continues the process, if it stops, returns the threads stopped at bkpt; otherwise, returns None"""
process.Continue()
if process.GetState() != lldb.eStateStopped:
return None
else:
return get_threads_stopped_at_breakpoint(process, bkpt) | [
"def",
"continue_to_breakpoint",
"(",
"process",
",",
"bkpt",
")",
":",
"process",
".",
"Continue",
"(",
")",
"if",
"process",
".",
"GetState",
"(",
")",
"!=",
"lldb",
".",
"eStateStopped",
":",
"return",
"None",
"else",
":",
"return",
"get_threads_stopped_a... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/utils/lui/lldbutil.py#L681-L687 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.flush | (self) | This does nothing. It is here to support the interface for a
File-like object. | This does nothing. It is here to support the interface for a
File-like object. | [
"This",
"does",
"nothing",
".",
"It",
"is",
"here",
"to",
"support",
"the",
"interface",
"for",
"a",
"File",
"-",
"like",
"object",
"."
] | def flush(self):
'''This does nothing. It is here to support the interface for a
File-like object. '''
pass | [
"def",
"flush",
"(",
"self",
")",
":",
"pass"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L405-L409 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/nfs/module.py | python | Module._cmd_nfs_export_apply | (self, cluster_id: str, inbuf: str) | return self.export_mgr.apply_export(cluster_id, export_config=inbuf) | Create or update an export by `-i <json_or_ganesha_export_file>` | Create or update an export by `-i <json_or_ganesha_export_file>` | [
"Create",
"or",
"update",
"an",
"export",
"by",
"-",
"i",
"<json_or_ganesha_export_file",
">"
] | def _cmd_nfs_export_apply(self, cluster_id: str, inbuf: str) -> Tuple[int, str, str]:
"""Create or update an export by `-i <json_or_ganesha_export_file>`"""
return self.export_mgr.apply_export(cluster_id, export_config=inbuf) | [
"def",
"_cmd_nfs_export_apply",
"(",
"self",
",",
"cluster_id",
":",
"str",
",",
"inbuf",
":",
"str",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"return",
"self",
".",
"export_mgr",
".",
"apply_export",
"(",
"cluster_id",
",",
"e... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/nfs/module.py#L89-L91 | |
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/profiling/plot.py | python | PlotJob.save | (self, id, fig, extention) | return (id, result) | generate plot output | generate plot output | [
"generate",
"plot",
"output"
] | def save(self, id, fig, extention):
""" generate plot output """
if not have_mpl:
raise MissingDependencyError("matplotlib")
result = ""
fig.tight_layout()
if self.__plottype == "SVG":
imgdata = io.StringIO()
fig.savefig(imgdata, format='svg')
plaintext = imgdata.getvalue()
plaintext = " ".j... | [
"def",
"save",
"(",
"self",
",",
"id",
",",
"fig",
",",
"extention",
")",
":",
"if",
"not",
"have_mpl",
":",
"raise",
"MissingDependencyError",
"(",
"\"matplotlib\"",
")",
"result",
"=",
"\"\"",
"fig",
".",
"tight_layout",
"(",
")",
"if",
"self",
".",
... | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/profiling/plot.py#L182-L208 | |
envoyproxy/envoy | 65541accdafe255e72310b4298d646e091da2d80 | tools/api_proto_breaking_change_detector/detector.py | python | ProtoBreakingChangeDetector.is_breaking | (self) | Return True if breaking changes were detected in the given protos | Return True if breaking changes were detected in the given protos | [
"Return",
"True",
"if",
"breaking",
"changes",
"were",
"detected",
"in",
"the",
"given",
"protos"
] | def is_breaking(self) -> bool:
"""Return True if breaking changes were detected in the given protos"""
pass | [
"def",
"is_breaking",
"(",
"self",
")",
"->",
"bool",
":",
"pass"
] | https://github.com/envoyproxy/envoy/blob/65541accdafe255e72310b4298d646e091da2d80/tools/api_proto_breaking_change_detector/detector.py#L35-L37 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | _get_available_gpus | () | return [x.name for x in _LOCAL_DEVICES if x.device_type == 'GPU'] | Get a list of available gpu devices (formatted as strings).
Returns:
A list of available GPU devices. | Get a list of available gpu devices (formatted as strings). | [
"Get",
"a",
"list",
"of",
"available",
"gpu",
"devices",
"(",
"formatted",
"as",
"strings",
")",
"."
] | def _get_available_gpus():
"""Get a list of available gpu devices (formatted as strings).
Returns:
A list of available GPU devices.
"""
if ops.executing_eagerly_outside_functions():
# Returns names of devices directly.
return [name for name in context.list_devices() if 'GPU' in name]
global _L... | [
"def",
"_get_available_gpus",
"(",
")",
":",
"if",
"ops",
".",
"executing_eagerly_outside_functions",
"(",
")",
":",
"# Returns names of devices directly.",
"return",
"[",
"name",
"for",
"name",
"in",
"context",
".",
"list_devices",
"(",
")",
"if",
"'GPU'",
"in",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L619-L632 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py | python | DefaultCookiePolicy.set_blocked_domains | (self, blocked_domains) | Set the sequence of blocked domains. | Set the sequence of blocked domains. | [
"Set",
"the",
"sequence",
"of",
"blocked",
"domains",
"."
] | def set_blocked_domains(self, blocked_domains):
"""Set the sequence of blocked domains."""
self._blocked_domains = tuple(blocked_domains) | [
"def",
"set_blocked_domains",
"(",
"self",
",",
"blocked_domains",
")",
":",
"self",
".",
"_blocked_domains",
"=",
"tuple",
"(",
"blocked_domains",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cookielib.py#L884-L886 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/summary_ops_v2.py | python | create_file_writer | (logdir,
max_queue=None,
flush_millis=None,
filename_suffix=None,
name=None) | Creates a summary file writer in the current context under the given name.
Args:
logdir: a string, or None. If a string, creates a summary file writer
which writes to the directory named by the string. If None, returns
a mock object which acts like a summary writer but does nothing,
useful to use ... | Creates a summary file writer in the current context under the given name. | [
"Creates",
"a",
"summary",
"file",
"writer",
"in",
"the",
"current",
"context",
"under",
"the",
"given",
"name",
"."
] | def create_file_writer(logdir,
max_queue=None,
flush_millis=None,
filename_suffix=None,
name=None):
"""Creates a summary file writer in the current context under the given name.
Args:
logdir: a string, or None. If a str... | [
"def",
"create_file_writer",
"(",
"logdir",
",",
"max_queue",
"=",
"None",
",",
"flush_millis",
"=",
"None",
",",
"filename_suffix",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"logdir",
"is",
"None",
":",
"return",
"_NoopSummaryWriter",
"(",
")... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/summary_ops_v2.py#L563-L608 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | BookCtrlBase.ChangeSelection | (*args, **kwargs) | return _core_.BookCtrlBase_ChangeSelection(*args, **kwargs) | ChangeSelection(self, size_t n) -> int | ChangeSelection(self, size_t n) -> int | [
"ChangeSelection",
"(",
"self",
"size_t",
"n",
")",
"-",
">",
"int"
] | def ChangeSelection(*args, **kwargs):
"""ChangeSelection(self, size_t n) -> int"""
return _core_.BookCtrlBase_ChangeSelection(*args, **kwargs) | [
"def",
"ChangeSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_ChangeSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13637-L13639 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | prj/app/prj.py | python | System.generate | (self, *, copy_all_files) | Generate the source for the system.
Raise an appropriate exception if there is an error.
No return value from this method. | Generate the source for the system. | [
"Generate",
"the",
"source",
"for",
"the",
"system",
"."
] | def generate(self, *, copy_all_files):
"""Generate the source for the system.
Raise an appropriate exception if there is an error.
No return value from this method.
"""
os.makedirs(self.output, exist_ok=True)
for i in self._instances:
i.prepare(copy_all_fil... | [
"def",
"generate",
"(",
"self",
",",
"*",
",",
"copy_all_files",
")",
":",
"os",
".",
"makedirs",
"(",
"self",
".",
"output",
",",
"exist_ok",
"=",
"True",
")",
"for",
"i",
"in",
"self",
".",
"_instances",
":",
"i",
".",
"prepare",
"(",
"copy_all_fil... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/prj/app/prj.py#L791-L804 | ||
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | wrap/gtwrap/template_instantiator/namespace.py | python | instantiate_namespace | (namespace) | return namespace | Instantiate the classes and other elements in the `namespace` content and
assign it back to the namespace content attribute.
@param[in/out] namespace The namespace whose content will be replaced with
the instantiated content. | Instantiate the classes and other elements in the `namespace` content and
assign it back to the namespace content attribute. | [
"Instantiate",
"the",
"classes",
"and",
"other",
"elements",
"in",
"the",
"namespace",
"content",
"and",
"assign",
"it",
"back",
"to",
"the",
"namespace",
"content",
"attribute",
"."
] | def instantiate_namespace(namespace):
"""
Instantiate the classes and other elements in the `namespace` content and
assign it back to the namespace content attribute.
@param[in/out] namespace The namespace whose content will be replaced with
the instantiated content.
"""
instantiated_co... | [
"def",
"instantiate_namespace",
"(",
"namespace",
")",
":",
"instantiated_content",
"=",
"[",
"]",
"typedef_content",
"=",
"[",
"]",
"for",
"element",
"in",
"namespace",
".",
"content",
":",
"if",
"isinstance",
"(",
"element",
",",
"parser",
".",
"Class",
")... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/template_instantiator/namespace.py#L11-L88 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/serialcli.py | python | IronSerial.inWaiting | (self) | return self._port_handle.BytesToRead | Return the number of characters currently in the input buffer. | Return the number of characters currently in the input buffer. | [
"Return",
"the",
"number",
"of",
"characters",
"currently",
"in",
"the",
"input",
"buffer",
"."
] | def inWaiting(self):
"""Return the number of characters currently in the input buffer."""
if not self._port_handle: raise portNotOpenError
return self._port_handle.BytesToRead | [
"def",
"inWaiting",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_port_handle",
":",
"raise",
"portNotOpenError",
"return",
"self",
".",
"_port_handle",
".",
"BytesToRead"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialcli.py#L147-L150 | |
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/io/genomics_reader.py | python | GenomicsReader.__exit__ | (self, unused_type, unused_value, unused_traceback) | Exit a `with` block. Typically, this will close the file. | Exit a `with` block. Typically, this will close the file. | [
"Exit",
"a",
"with",
"block",
".",
"Typically",
"this",
"will",
"close",
"the",
"file",
"."
] | def __exit__(self, unused_type, unused_value, unused_traceback):
"""Exit a `with` block. Typically, this will close the file.""" | [
"def",
"__exit__",
"(",
"self",
",",
"unused_type",
",",
"unused_value",
",",
"unused_traceback",
")",
":"
] | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/genomics_reader.py#L99-L100 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/rootfind.py | python | setXTolerance | (tolx: float) | return _rootfind.setXTolerance(tolx) | r"""
Sets the termination threshold for the change in x.
Args:
tolx (float) | r"""
Sets the termination threshold for the change in x. | [
"r",
"Sets",
"the",
"termination",
"threshold",
"for",
"the",
"change",
"in",
"x",
"."
] | def setXTolerance(tolx: float) ->None:
r"""
Sets the termination threshold for the change in x.
Args:
tolx (float)
"""
return _rootfind.setXTolerance(tolx) | [
"def",
"setXTolerance",
"(",
"tolx",
":",
"float",
")",
"->",
"None",
":",
"return",
"_rootfind",
".",
"setXTolerance",
"(",
"tolx",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/rootfind.py#L80-L87 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/masked/numctrl.py | python | NumCtrl.SetLimited | (self, limited) | If called with a value of True, this function will cause the control
to limit the value to fall within the bounds currently specified.
If the control's value currently exceeds the bounds, it will then
be limited accordingly.
If called with a value of False, this function will disable va... | If called with a value of True, this function will cause the control
to limit the value to fall within the bounds currently specified.
If the control's value currently exceeds the bounds, it will then
be limited accordingly. | [
"If",
"called",
"with",
"a",
"value",
"of",
"True",
"this",
"function",
"will",
"cause",
"the",
"control",
"to",
"limit",
"the",
"value",
"to",
"fall",
"within",
"the",
"bounds",
"currently",
"specified",
".",
"If",
"the",
"control",
"s",
"value",
"current... | def SetLimited(self, limited):
"""
If called with a value of True, this function will cause the control
to limit the value to fall within the bounds currently specified.
If the control's value currently exceeds the bounds, it will then
be limited accordingly.
If called w... | [
"def",
"SetLimited",
"(",
"self",
",",
"limited",
")",
":",
"self",
".",
"SetParameters",
"(",
"limited",
"=",
"limited",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/numctrl.py#L1409-L1420 | ||
eclipse/omr | 056e7c9ce9d503649190bc5bd9931fac30b4e4bc | jitbuilder/apigen/cppgen.py | python | CppGenerator.grab_impl | (self, v, t) | return self.to_impl_cast(t.as_class(), "{v} != NULL ? {v}->_impl : NULL".format(v=v)) if t.is_class() else v | Constructs an expression that grabs the implementation object
from a client API object `v` and with type name `t`. | Constructs an expression that grabs the implementation object
from a client API object `v` and with type name `t`. | [
"Constructs",
"an",
"expression",
"that",
"grabs",
"the",
"implementation",
"object",
"from",
"a",
"client",
"API",
"object",
"v",
"and",
"with",
"type",
"name",
"t",
"."
] | def grab_impl(self, v, t):
"""
Constructs an expression that grabs the implementation object
from a client API object `v` and with type name `t`.
"""
return self.to_impl_cast(t.as_class(), "{v} != NULL ? {v}->_impl : NULL".format(v=v)) if t.is_class() else v | [
"def",
"grab_impl",
"(",
"self",
",",
"v",
",",
"t",
")",
":",
"return",
"self",
".",
"to_impl_cast",
"(",
"t",
".",
"as_class",
"(",
")",
",",
"\"{v} != NULL ? {v}->_impl : NULL\"",
".",
"format",
"(",
"v",
"=",
"v",
")",
")",
"if",
"t",
".",
"is_cl... | https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/cppgen.py#L190-L195 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBLanguageRuntime_GetNameForLanguageType | (*args) | return _lldb.SBLanguageRuntime_GetNameForLanguageType(*args) | SBLanguageRuntime_GetNameForLanguageType(LanguageType language) -> str | SBLanguageRuntime_GetNameForLanguageType(LanguageType language) -> str | [
"SBLanguageRuntime_GetNameForLanguageType",
"(",
"LanguageType",
"language",
")",
"-",
">",
"str"
] | def SBLanguageRuntime_GetNameForLanguageType(*args):
"""SBLanguageRuntime_GetNameForLanguageType(LanguageType language) -> str"""
return _lldb.SBLanguageRuntime_GetNameForLanguageType(*args) | [
"def",
"SBLanguageRuntime_GetNameForLanguageType",
"(",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBLanguageRuntime_GetNameForLanguageType",
"(",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5405-L5407 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Pen.SetDashes | (*args, **kwargs) | return _gdi_.Pen_SetDashes(*args, **kwargs) | SetDashes(self, int dashes) | SetDashes(self, int dashes) | [
"SetDashes",
"(",
"self",
"int",
"dashes",
")"
] | def SetDashes(*args, **kwargs):
"""SetDashes(self, int dashes)"""
return _gdi_.Pen_SetDashes(*args, **kwargs) | [
"def",
"SetDashes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_SetDashes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L445-L447 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Context.logical_or | (self, a, b) | return a.logical_or(b, context=self) | Applies the logical operation 'or' between each operand's digits.
The operands must be both logical numbers.
>>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
Decimal('1')
>>> ExtendedConte... | Applies the logical operation 'or' between each operand's digits. | [
"Applies",
"the",
"logical",
"operation",
"or",
"between",
"each",
"operand",
"s",
"digits",
"."
] | def logical_or(self, a, b):
"""Applies the logical operation 'or' between each operand's digits.
The operands must be both logical numbers.
>>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
... | [
"def",
"logical_or",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"logical_or",
"(",
"b",
",",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L4784-L4809 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCompileUnit.__str__ | (self) | return _lldb.SBCompileUnit___str__(self) | __str__(SBCompileUnit self) -> PyObject * | __str__(SBCompileUnit self) -> PyObject * | [
"__str__",
"(",
"SBCompileUnit",
"self",
")",
"-",
">",
"PyObject",
"*"
] | def __str__(self):
"""__str__(SBCompileUnit self) -> PyObject *"""
return _lldb.SBCompileUnit___str__(self) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBCompileUnit___str__",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3259-L3261 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/benchmark.py | python | benchmark_file | (
filename, compiler, include_dirs, (progress_from, progress_to),
iter_count, extra_flags = '') | return {
"time": time_sum / iter_count,
"memory": mem_sum / (iter_count * 1024)
} | Benchmark one file | Benchmark one file | [
"Benchmark",
"one",
"file"
] | def benchmark_file(
filename, compiler, include_dirs, (progress_from, progress_to),
iter_count, extra_flags = ''):
"""Benchmark one file"""
time_sum = 0
mem_sum = 0
for nth_run in xrange(0, iter_count):
(time_spent, mem_used) = benchmark_command(
'{0} -std=c++11 {1} -... | [
"def",
"benchmark_file",
"(",
"filename",
",",
"compiler",
",",
"include_dirs",
",",
"(",
"progress_from",
",",
"progress_to",
")",
",",
"iter_count",
",",
"extra_flags",
"=",
"''",
")",
":",
"time_sum",
"=",
"0",
"mem_sum",
"=",
"0",
"for",
"nth_run",
"in... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/benchmark.py#L48-L73 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libevent-2.0.18-stable/event_rpcgen.py | python | EntryInt.CodeArrayAdd | (self, varname, value) | return [ '%(varname)s = %(value)s;' % { 'varname' : varname,
'value' : value } ] | Returns a new entry of this type. | Returns a new entry of this type. | [
"Returns",
"a",
"new",
"entry",
"of",
"this",
"type",
"."
] | def CodeArrayAdd(self, varname, value):
"""Returns a new entry of this type."""
return [ '%(varname)s = %(value)s;' % { 'varname' : varname,
'value' : value } ] | [
"def",
"CodeArrayAdd",
"(",
"self",
",",
"varname",
",",
"value",
")",
":",
"return",
"[",
"'%(varname)s = %(value)s;'",
"%",
"{",
"'varname'",
":",
"varname",
",",
"'value'",
":",
"value",
"}",
"]"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libevent-2.0.18-stable/event_rpcgen.py#L621-L624 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridSizeEvent.CmdDown | (*args, **kwargs) | return _grid.GridSizeEvent_CmdDown(*args, **kwargs) | CmdDown(self) -> bool | CmdDown(self) -> bool | [
"CmdDown",
"(",
"self",
")",
"-",
">",
"bool"
] | def CmdDown(*args, **kwargs):
"""CmdDown(self) -> bool"""
return _grid.GridSizeEvent_CmdDown(*args, **kwargs) | [
"def",
"CmdDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridSizeEvent_CmdDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L2381-L2383 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py | python | print_formatted_text | (
output: Output,
formatted_text: AnyFormattedText,
style: BaseStyle,
style_transformation: Optional[StyleTransformation] = None,
color_depth: Optional[ColorDepth] = None,
) | Print a list of (style_str, text) tuples in the given style to the output. | Print a list of (style_str, text) tuples in the given style to the output. | [
"Print",
"a",
"list",
"of",
"(",
"style_str",
"text",
")",
"tuples",
"in",
"the",
"given",
"style",
"to",
"the",
"output",
"."
] | def print_formatted_text(
output: Output,
formatted_text: AnyFormattedText,
style: BaseStyle,
style_transformation: Optional[StyleTransformation] = None,
color_depth: Optional[ColorDepth] = None,
) -> None:
"""
Print a list of (style_str, text) tuples in the given style to the output.
""... | [
"def",
"print_formatted_text",
"(",
"output",
":",
"Output",
",",
"formatted_text",
":",
"AnyFormattedText",
",",
"style",
":",
"BaseStyle",
",",
"style_transformation",
":",
"Optional",
"[",
"StyleTransformation",
"]",
"=",
"None",
",",
"color_depth",
":",
"Optio... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py#L766-L810 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/grokdump.py | python | InspectionShell.do_dp | (self, address) | return self.do_display_page(address) | see display_page | see display_page | [
"see",
"display_page"
] | def do_dp(self, address):
""" see display_page """
return self.do_display_page(address) | [
"def",
"do_dp",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"do_display_page",
"(",
"address",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/grokdump.py#L3460-L3462 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/signature_def_utils_impl.py | python | regression_signature_def | (examples, predictions) | return signature_def | Creates regression signature from given examples and predictions.
This function produces signatures intended for use with the TensorFlow Serving
Regress API (tensorflow_serving/apis/prediction_service.proto), and so
constrains the input and output types to those allowed by TensorFlow Serving.
Args:
exampl... | Creates regression signature from given examples and predictions. | [
"Creates",
"regression",
"signature",
"from",
"given",
"examples",
"and",
"predictions",
"."
] | def regression_signature_def(examples, predictions):
"""Creates regression signature from given examples and predictions.
This function produces signatures intended for use with the TensorFlow Serving
Regress API (tensorflow_serving/apis/prediction_service.proto), and so
constrains the input and output types t... | [
"def",
"regression_signature_def",
"(",
"examples",
",",
"predictions",
")",
":",
"if",
"examples",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Regression `examples` cannot be None.'",
")",
"if",
"not",
"isinstance",
"(",
"examples",
",",
"ops",
".",
"Tensor"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/signature_def_utils_impl.py#L67-L108 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/fcompiler/__init__.py | python | show_fcompilers | (dist=None) | Print list of available compilers (used by the "--help-fcompiler"
option to "config_fc"). | Print list of available compilers (used by the "--help-fcompiler"
option to "config_fc"). | [
"Print",
"list",
"of",
"available",
"compilers",
"(",
"used",
"by",
"the",
"--",
"help",
"-",
"fcompiler",
"option",
"to",
"config_fc",
")",
"."
] | def show_fcompilers(dist=None):
"""Print list of available compilers (used by the "--help-fcompiler"
option to "config_fc").
"""
if dist is None:
from distutils.dist import Distribution
from numpy.distutils.command.config_compiler import config_fc
dist = Distribution()
di... | [
"def",
"show_fcompilers",
"(",
"dist",
"=",
"None",
")",
":",
"if",
"dist",
"is",
"None",
":",
"from",
"distutils",
".",
"dist",
"import",
"Distribution",
"from",
"numpy",
".",
"distutils",
".",
"command",
".",
"config_compiler",
"import",
"config_fc",
"dist... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/fcompiler/__init__.py#L904-L962 | ||
continental/ecal | 204dab80a24fe01abca62541133b311bf0c09608 | lang/python/core/ecal/core/core.py | python | client_rem_method_callback | (client_handle) | return _ecal.client_rem_response_callback(client_handle) | remove response callback from client
:param client_handle: the client handle | remove response callback from client | [
"remove",
"response",
"callback",
"from",
"client"
] | def client_rem_method_callback(client_handle):
""" remove response callback from client
:param client_handle: the client handle
"""
return _ecal.client_rem_response_callback(client_handle) | [
"def",
"client_rem_method_callback",
"(",
"client_handle",
")",
":",
"return",
"_ecal",
".",
"client_rem_response_callback",
"(",
"client_handle",
")"
] | https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/core.py#L456-L462 | |
INK-USC/USC-DS-RelationExtraction | eebcfa7fd2eda5bba92f3ef8158797cdf91e6981 | code/Classifier/HierarchySVM.py | python | HierarchySVM.fit_em | (self, train_x, train_y) | row = [0]*len(x)
data = [1]*len(x)
train_x = list of list
train_y = list of list
:param x:
:param y:
:return: | row = [0]*len(x)
data = [1]*len(x)
train_x = list of list
train_y = list of list
:param x:
:param y:
:return: | [
"row",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"x",
")",
"data",
"=",
"[",
"1",
"]",
"*",
"len",
"(",
"x",
")",
"train_x",
"=",
"list",
"of",
"list",
"train_y",
"=",
"list",
"of",
"list",
":",
"param",
"x",
":",
":",
"param",
"y",
":",
":",
... | def fit_em(self, train_x, train_y):
"""
row = [0]*len(x)
data = [1]*len(x)
train_x = list of list
train_y = list of list
:param x:
:param y:
:return:
"""
new_train_x = []
new_train_y = []
for i in xrange(len(train_y)):
... | [
"def",
"fit_em",
"(",
"self",
",",
"train_x",
",",
"train_y",
")",
":",
"new_train_x",
"=",
"[",
"]",
"new_train_y",
"=",
"[",
"]",
"for",
"i",
"in",
"xrange",
"(",
"len",
"(",
"train_y",
")",
")",
":",
"x",
"=",
"train_x",
"[",
"i",
"]",
"y",
... | https://github.com/INK-USC/USC-DS-RelationExtraction/blob/eebcfa7fd2eda5bba92f3ef8158797cdf91e6981/code/Classifier/HierarchySVM.py#L32-L70 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/TreeWidget.py | python | TreeItem.SetText | (self, text) | Change the item's text (if it is editable). | Change the item's text (if it is editable). | [
"Change",
"the",
"item",
"s",
"text",
"(",
"if",
"it",
"is",
"editable",
")",
"."
] | def SetText(self, text):
"""Change the item's text (if it is editable).""" | [
"def",
"SetText",
"(",
"self",
",",
"text",
")",
":"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/TreeWidget.py#L346-L347 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/gencpp/src/gencpp/__init__.py | python | default_value | (type) | return "" | Returns the value to initialize a message member with. 0 for integer types, 0.0 for floating point, false for bool,
empty string for everything else
@param type: The type
@type type: str | Returns the value to initialize a message member with. 0 for integer types, 0.0 for floating point, false for bool,
empty string for everything else | [
"Returns",
"the",
"value",
"to",
"initialize",
"a",
"message",
"member",
"with",
".",
"0",
"for",
"integer",
"types",
"0",
".",
"0",
"for",
"floating",
"point",
"false",
"for",
"bool",
"empty",
"string",
"for",
"everything",
"else"
] | def default_value(type):
"""
Returns the value to initialize a message member with. 0 for integer types, 0.0 for floating point, false for bool,
empty string for everything else
@param type: The type
@type type: str
"""
if type in ['byte', 'int8', 'int16', 'int32', 'int64',
... | [
"def",
"default_value",
"(",
"type",
")",
":",
"if",
"type",
"in",
"[",
"'byte'",
",",
"'int8'",
",",
"'int16'",
",",
"'int32'",
",",
"'int64'",
",",
"'char'",
",",
"'uint8'",
",",
"'uint16'",
",",
"'uint32'",
",",
"'uint64'",
"]",
":",
"return",
"'0'"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/gencpp/src/gencpp/__init__.py#L159-L175 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PyWindow.DoSetVirtualSize | (*args, **kwargs) | return _windows_.PyWindow_DoSetVirtualSize(*args, **kwargs) | DoSetVirtualSize(self, int x, int y) | DoSetVirtualSize(self, int x, int y) | [
"DoSetVirtualSize",
"(",
"self",
"int",
"x",
"int",
"y",
")"
] | def DoSetVirtualSize(*args, **kwargs):
"""DoSetVirtualSize(self, int x, int y)"""
return _windows_.PyWindow_DoSetVirtualSize(*args, **kwargs) | [
"def",
"DoSetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyWindow_DoSetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4158-L4160 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py | python | ZipFile.close | (self) | Close the file, and for mode "w" and "a" write the ending
records. | Close the file, and for mode "w" and "a" write the ending
records. | [
"Close",
"the",
"file",
"and",
"for",
"mode",
"w",
"and",
"a",
"write",
"the",
"ending",
"records",
"."
] | def close(self):
"""Close the file, and for mode "w" and "a" write the ending
records."""
if self.fp is None:
return
try:
if self.mode in ("w", "a") and self._didModify: # write ending records
count = 0
pos1 = self.fp.tell()
... | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"fp",
"is",
"None",
":",
"return",
"try",
":",
"if",
"self",
".",
"mode",
"in",
"(",
"\"w\"",
",",
"\"a\"",
")",
"and",
"self",
".",
"_didModify",
":",
"# write ending records",
"count",
"=",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py#L1247-L1350 | ||
OGRECave/ogre-next | 287307980e6de8910f04f3cc0994451b075071fd | Tools/Wings3DExporter/mesh.py | python | Mesh.dump | (self) | show data | show data | [
"show",
"data"
] | def dump(self):
"show data"
print "Mesh '%s':" % self.name
print "%d vertices:" % len(self.glverts)
for vert in self.glverts: print " ", vert
ntris = sum(map(lambda submesh: len(submesh.gltris), self.subs))
print "%d submeshes, %d tris total:" % (len(self.subs), ntris)
for sub in self.subs:
print ... | [
"def",
"dump",
"(",
"self",
")",
":",
"print",
"\"Mesh '%s':\"",
"%",
"self",
".",
"name",
"print",
"\"%d vertices:\"",
"%",
"len",
"(",
"self",
".",
"glverts",
")",
"for",
"vert",
"in",
"self",
".",
"glverts",
":",
"print",
"\" \"",
",",
"vert",
"nt... | https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/Wings3DExporter/mesh.py#L394-L408 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py | python | is_same | (type1, type2) | return nake_type1 == nake_type2 | returns True, if type1 and type2 are same types | returns True, if type1 and type2 are same types | [
"returns",
"True",
"if",
"type1",
"and",
"type2",
"are",
"same",
"types"
] | def is_same(type1, type2):
"""returns True, if type1 and type2 are same types"""
nake_type1 = remove_declarated(type1)
nake_type2 = remove_declarated(type2)
return nake_type1 == nake_type2 | [
"def",
"is_same",
"(",
"type1",
",",
"type2",
")",
":",
"nake_type1",
"=",
"remove_declarated",
"(",
"type1",
")",
"nake_type2",
"=",
"remove_declarated",
"(",
"type2",
")",
"return",
"nake_type1",
"==",
"nake_type2"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py#L383-L387 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | GridCellWorker._setOORInfo | (*args, **kwargs) | return _grid.GridCellWorker__setOORInfo(*args, **kwargs) | _setOORInfo(self, PyObject _self) | _setOORInfo(self, PyObject _self) | [
"_setOORInfo",
"(",
"self",
"PyObject",
"_self",
")"
] | def _setOORInfo(*args, **kwargs):
"""_setOORInfo(self, PyObject _self)"""
return _grid.GridCellWorker__setOORInfo(*args, **kwargs) | [
"def",
"_setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellWorker__setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L89-L91 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/ParameterSet/python/Config.py | python | Process.services_ | (self) | return DictTypes.FixedKeysDict(self.__services) | returns a dict of the services that have been added to the Process | returns a dict of the services that have been added to the Process | [
"returns",
"a",
"dict",
"of",
"the",
"services",
"that",
"have",
"been",
"added",
"to",
"the",
"Process"
] | def services_(self):
"""returns a dict of the services that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__services) | [
"def",
"services_",
"(",
"self",
")",
":",
"return",
"DictTypes",
".",
"FixedKeysDict",
"(",
"self",
".",
"__services",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Config.py#L324-L326 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/command/bdist_msi.py | python | PyDialog.xbutton | (self, name, title, next, xpos) | return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next) | Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons.
Return the button, so that events can be associated | Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons. | [
"Add",
"a",
"button",
"with",
"a",
"given",
"title",
"the",
"tab",
"-",
"next",
"button",
"its",
"name",
"in",
"the",
"Control",
"table",
"giving",
"its",
"x",
"position",
";",
"the",
"y",
"-",
"position",
"is",
"aligned",
"with",
"the",
"other",
"butt... | def xbutton(self, name, title, next, xpos):
"""Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons.
Return the button, so that events can be associated"""
return self.pushbut... | [
"def",
"xbutton",
"(",
"self",
",",
"name",
",",
"title",
",",
"next",
",",
"xpos",
")",
":",
"return",
"self",
".",
"pushbutton",
"(",
"name",
",",
"int",
"(",
"self",
".",
"w",
"*",
"xpos",
"-",
"28",
")",
",",
"self",
".",
"h",
"-",
"27",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/bdist_msi.py#L77-L83 | |
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/scripts/cpp_lint.py | python | FindEndOfExpressionInLine | (line, startpos, depth, startchar, endchar) | return (-1, depth) | Find the position just after the matching endchar.
Args:
line: a CleansedLines line.
startpos: start searching at this position.
depth: nesting level at startpos.
startchar: expression opening character.
endchar: expression closing character.
Returns:
On finding matching endchar: (index ju... | Find the position just after the matching endchar. | [
"Find",
"the",
"position",
"just",
"after",
"the",
"matching",
"endchar",
"."
] | def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
"""Find the position just after the matching endchar.
Args:
line: a CleansedLines line.
startpos: start searching at this position.
depth: nesting level at startpos.
startchar: expression opening character.
endchar: expre... | [
"def",
"FindEndOfExpressionInLine",
"(",
"line",
",",
"startpos",
",",
"depth",
",",
"startchar",
",",
"endchar",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"startpos",
",",
"len",
"(",
"line",
")",
")",
":",
"if",
"line",
"[",
"i",
"]",
"==",
"start... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L1230-L1251 | |
cryfs/cryfs | 5f908c641cd5854b8a347f842b996bfe76a64577 | src/gitversion/_version.py | python | run_command | (commands, args, cwd=None, verbose=False, hide_stderr=False) | return stdout | Call the given command(s). | Call the given command(s). | [
"Call",
"the",
"given",
"command",
"(",
"s",
")",
"."
] | def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
"""Call the given command(s)."""
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
... | [
"def",
"run_command",
"(",
"commands",
",",
"args",
",",
"cwd",
"=",
"None",
",",
"verbose",
"=",
"False",
",",
"hide_stderr",
"=",
"False",
")",
":",
"assert",
"isinstance",
"(",
"commands",
",",
"list",
")",
"p",
"=",
"None",
"for",
"c",
"in",
"com... | https://github.com/cryfs/cryfs/blob/5f908c641cd5854b8a347f842b996bfe76a64577/src/gitversion/_version.py#L71-L102 | |
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/stylesheet/drules_merge.py | python | zooms_string | (z1, z2) | Prints 'zoom N' or 'zooms N-M'. | Prints 'zoom N' or 'zooms N-M'. | [
"Prints",
"zoom",
"N",
"or",
"zooms",
"N",
"-",
"M",
"."
] | def zooms_string(z1, z2):
"""Prints 'zoom N' or 'zooms N-M'."""
if z2 != z1:
return "zooms {}-{}".format(min(z1, z2), max(z1, z2))
else:
return "zoom {}".format(z1) | [
"def",
"zooms_string",
"(",
"z1",
",",
"z2",
")",
":",
"if",
"z2",
"!=",
"z1",
":",
"return",
"\"zooms {}-{}\"",
".",
"format",
"(",
"min",
"(",
"z1",
",",
"z2",
")",
",",
"max",
"(",
"z1",
",",
"z2",
")",
")",
"else",
":",
"return",
"\"zoom {}\"... | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/stylesheet/drules_merge.py#L32-L37 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | MaskedArray.tofile | (self, fid, sep="", format="%s") | Save a masked array to a file in binary format.
.. warning::
This function is not implemented yet.
Raises
------
NotImplementedError
When `tofile` is called. | Save a masked array to a file in binary format. | [
"Save",
"a",
"masked",
"array",
"to",
"a",
"file",
"in",
"binary",
"format",
"."
] | def tofile(self, fid, sep="", format="%s"):
"""
Save a masked array to a file in binary format.
.. warning::
This function is not implemented yet.
Raises
------
NotImplementedError
When `tofile` is called.
"""
raise NotImplementedE... | [
"def",
"tofile",
"(",
"self",
",",
"fid",
",",
"sep",
"=",
"\"\"",
",",
"format",
"=",
"\"%s\"",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"MaskedArray.tofile() not implemented yet.\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L6021-L6034 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/inputparser.py | python | process_cfour_command | (matchobj) | return "%score.set_global_option(\"%s\", \"\"\"%s\n\"\"\")\n" % \
(spaces, 'LITERAL_CFOUR', 'literals_psi4_yo-' + literalkey) | Function to process match of ``cfour name? { ... }``. | Function to process match of ``cfour name? { ... }``. | [
"Function",
"to",
"process",
"match",
"of",
"cfour",
"name?",
"{",
"...",
"}",
"."
] | def process_cfour_command(matchobj):
"""Function to process match of ``cfour name? { ... }``."""
spaces = matchobj.group(1)
name = matchobj.group(2)
cfourblock = matchobj.group(3)
literalkey = str(uuid.uuid4())[:8]
literals[literalkey] = cfourblock
return "%score.set_global_option(\"%s\", \... | [
"def",
"process_cfour_command",
"(",
"matchobj",
")",
":",
"spaces",
"=",
"matchobj",
".",
"group",
"(",
"1",
")",
"name",
"=",
"matchobj",
".",
"group",
"(",
"2",
")",
"cfourblock",
"=",
"matchobj",
".",
"group",
"(",
"3",
")",
"literalkey",
"=",
"str... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/inputparser.py#L217-L226 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py | python | ConfigObj._handle_error | (self, text, ErrorClass, infile, cur_index) | Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index`` | Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index`` | [
"Handle",
"an",
"error",
"according",
"to",
"the",
"error",
"settings",
".",
"Either",
"raise",
"the",
"error",
"or",
"store",
"it",
".",
"The",
"error",
"will",
"have",
"occured",
"at",
"cur_index"
] | def _handle_error(self, text, ErrorClass, infile, cur_index):
"""
Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index``
"""
line = infile[cur_index]
cur_index += 1
message... | [
"def",
"_handle_error",
"(",
"self",
",",
"text",
",",
"ErrorClass",
",",
"infile",
",",
"cur_index",
")",
":",
"line",
"=",
"infile",
"[",
"cur_index",
"]",
"cur_index",
"+=",
"1",
"message",
"=",
"text",
"%",
"cur_index",
"error",
"=",
"ErrorClass",
"(... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py#L1720-L1736 | ||
apache/thrift | 0b29261a4f3c6882ef3b09aae47914f0012b0472 | lib/py/src/server/TNonblockingServer.py | python | socket_exception | (func) | return read | Decorator close object on socket.error. | Decorator close object on socket.error. | [
"Decorator",
"close",
"object",
"on",
"socket",
".",
"error",
"."
] | def socket_exception(func):
"""Decorator close object on socket.error."""
def read(self, *args, **kwargs):
try:
return func(self, *args, **kwargs)
except socket.error:
logger.debug('ignoring socket exception', exc_info=True)
self.close()
return read | [
"def",
"socket_exception",
"(",
"func",
")",
":",
"def",
"read",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"func",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"socket",
".",... | https://github.com/apache/thrift/blob/0b29261a4f3c6882ef3b09aae47914f0012b0472/lib/py/src/server/TNonblockingServer.py#L84-L92 | |
Yijunmaverick/GenerativeFaceCompletion | f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2 | scripts/cpp_lint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L1062-L1120 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/format.py | python | _filter_header | (s) | return tokenize.untokenize(tokens)[:-1] | Clean up 'L' in npz header ints.
Cleans up the 'L' in strings representing integers. Needed to allow npz
headers produced in Python2 to be read in Python3.
Parameters
----------
s : byte string
Npy file header.
Returns
-------
header : str
Cleaned up header. | Clean up 'L' in npz header ints. | [
"Clean",
"up",
"L",
"in",
"npz",
"header",
"ints",
"."
] | def _filter_header(s):
"""Clean up 'L' in npz header ints.
Cleans up the 'L' in strings representing integers. Needed to allow npz
headers produced in Python2 to be read in Python3.
Parameters
----------
s : byte string
Npy file header.
Returns
-------
header : str
... | [
"def",
"_filter_header",
"(",
"s",
")",
":",
"import",
"tokenize",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
">=",
"3",
":",
"from",
"io",
"import",
"StringIO",
"else",
":",
"from",
"StringIO",
"import",
"StringIO",
"tokens",
"=",
"[",
"]",
"las... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/format.py#L479-L517 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/tempfile.py | python | mktemp | (suffix="", prefix=template, dir=None) | User-callable function to return a unique temporary file name. The
file is not created.
Arguments are as for mkstemp, except that the 'text' argument is
not accepted.
This function is unsafe and should not be used. The file name
refers to a file that did not exist at some point, but by the time
... | User-callable function to return a unique temporary file name. The
file is not created. | [
"User",
"-",
"callable",
"function",
"to",
"return",
"a",
"unique",
"temporary",
"file",
"name",
".",
"The",
"file",
"is",
"not",
"created",
"."
] | def mktemp(suffix="", prefix=template, dir=None):
"""User-callable function to return a unique temporary file name. The
file is not created.
Arguments are as for mkstemp, except that the 'text' argument is
not accepted.
This function is unsafe and should not be used. The file name
refers to ... | [
"def",
"mktemp",
"(",
"suffix",
"=",
"\"\"",
",",
"prefix",
"=",
"template",
",",
"dir",
"=",
"None",
")",
":",
"## from warnings import warn as _warn",
"## _warn(\"mktemp is a potential security risk to your program\",",
"## RuntimeWarning, stacklevel=2)",
"if",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/tempfile.py#L338-L365 | ||
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/mox.py | python | UnknownMethodCallError.__init__ | (self, unknown_method_name) | Init exception.
Args:
# unknown_method_name: Method call that is not part of the mocked class's
# public interface.
unknown_method_name: str | Init exception. | [
"Init",
"exception",
"."
] | def __init__(self, unknown_method_name):
"""Init exception.
Args:
# unknown_method_name: Method call that is not part of the mocked class's
# public interface.
unknown_method_name: str
"""
Error.__init__(self)
self._unknown_method_name = unknown_method_name | [
"def",
"__init__",
"(",
"self",
",",
"unknown_method_name",
")",
":",
"Error",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"_unknown_method_name",
"=",
"unknown_method_name"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/mox.py#L133-L143 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/while_v2_indexed_slices_rewriter.py | python | rewrite_grad_indexed_slices | (grads, body_grad_graph, loop_vars,
forward_inputs) | return loop_vars | Handles special case of IndexedSlices returned from while gradient.
Some gradient functions return IndexedSlices instead of a Tensor (e.g. the
gradient of Gather ops). When this happens in the gradient of a while body,
the resulting gradient body function will have mismatched inputs and outputs,
since the inpu... | Handles special case of IndexedSlices returned from while gradient. | [
"Handles",
"special",
"case",
"of",
"IndexedSlices",
"returned",
"from",
"while",
"gradient",
"."
] | def rewrite_grad_indexed_slices(grads, body_grad_graph, loop_vars,
forward_inputs):
"""Handles special case of IndexedSlices returned from while gradient.
Some gradient functions return IndexedSlices instead of a Tensor (e.g. the
gradient of Gather ops). When this happens in the g... | [
"def",
"rewrite_grad_indexed_slices",
"(",
"grads",
",",
"body_grad_graph",
",",
"loop_vars",
",",
"forward_inputs",
")",
":",
"# Match up body_grad_graph.structured_outputs with the corresponding",
"# forward_inputs.",
"#",
"# Note that we don't expect a gradient computation to have s... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py#L28-L80 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Sizer._setOORInfo | (*args, **kwargs) | return _core_.Sizer__setOORInfo(*args, **kwargs) | _setOORInfo(self, PyObject _self) | _setOORInfo(self, PyObject _self) | [
"_setOORInfo",
"(",
"self",
"PyObject",
"_self",
")"
] | def _setOORInfo(*args, **kwargs):
"""_setOORInfo(self, PyObject _self)"""
return _core_.Sizer__setOORInfo(*args, **kwargs) | [
"def",
"_setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer__setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14446-L14448 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dependency_manager/dependency_manager/base_config.py | python | BaseConfig.GetVersion | (self, dependency, platform) | return self._GetPlatformData(
dependency, platform, data_type='version_in_cs') | Return the Version information for the given dependency. | Return the Version information for the given dependency. | [
"Return",
"the",
"Version",
"information",
"for",
"the",
"given",
"dependency",
"."
] | def GetVersion(self, dependency, platform):
"""Return the Version information for the given dependency."""
return self._GetPlatformData(
dependency, platform, data_type='version_in_cs') | [
"def",
"GetVersion",
"(",
"self",
",",
"dependency",
",",
"platform",
")",
":",
"return",
"self",
".",
"_GetPlatformData",
"(",
"dependency",
",",
"platform",
",",
"data_type",
"=",
"'version_in_cs'",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dependency_manager/dependency_manager/base_config.py#L286-L289 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/filter_design.py | python | _align_nums | (nums) | Aligns the shapes of multiple numerators.
Given an array of numerator coefficient arrays [[a_1, a_2,...,
a_n],..., [b_1, b_2,..., b_m]], this function pads shorter numerator
arrays with zero's so that all numerators have the same length. Such
alignment is necessary for functions like 'tf2ss', which nee... | Aligns the shapes of multiple numerators. | [
"Aligns",
"the",
"shapes",
"of",
"multiple",
"numerators",
"."
] | def _align_nums(nums):
"""Aligns the shapes of multiple numerators.
Given an array of numerator coefficient arrays [[a_1, a_2,...,
a_n],..., [b_1, b_2,..., b_m]], this function pads shorter numerator
arrays with zero's so that all numerators have the same length. Such
alignment is necessary for fun... | [
"def",
"_align_nums",
"(",
"nums",
")",
":",
"try",
":",
"# The statement can throw a ValueError if one",
"# of the numerators is a single digit and another",
"# is array-like e.g. if nums = [5, [1, 2, 3]]",
"nums",
"=",
"asarray",
"(",
"nums",
")",
"if",
"not",
"np",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/filter_design.py#L1165-L1208 | ||
bigtreetech/BIGTREETECH-SKR-mini-E3 | 221247c12502ff92d071c701ea63cf3aa9bb3b29 | firmware/V2.0/Marlin-2.0.8.2.x-SKR-mini-E3-V2.0/buildroot/share/scripts/createTemperatureLookupMarlin.py | python | main | (argv) | Default values | Default values | [
"Default",
"values"
] | def main(argv):
"Default values"
t1 = 25 # low temperature in Kelvin (25 degC)
r1 = 100000 # resistance at low temperature (10 kOhm)
t2 = 150 # middle temperature in Kelvin (150 degC)
r2 = 1641.9 ... | [
"def",
"main",
"(",
"argv",
")",
":",
"t1",
"=",
"25",
"# low temperature in Kelvin (25 degC)",
"r1",
"=",
"100000",
"# resistance at low temperature (10 kOhm)",
"t2",
"=",
"150",
"# middle temperature in Kelvin (150 degC)",
"r2",
"=",
"1641.9",
"# resistance at middle temp... | https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/blob/221247c12502ff92d071c701ea63cf3aa9bb3b29/firmware/V2.0/Marlin-2.0.8.2.x-SKR-mini-E3-V2.0/buildroot/share/scripts/createTemperatureLookupMarlin.py#L88-L151 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/descriptor.py | python | _OptionsOrNone | (descriptor_proto) | Returns the value of the field `options`, or None if it is not set. | Returns the value of the field `options`, or None if it is not set. | [
"Returns",
"the",
"value",
"of",
"the",
"field",
"options",
"or",
"None",
"if",
"it",
"is",
"not",
"set",
"."
] | def _OptionsOrNone(descriptor_proto):
"""Returns the value of the field `options`, or None if it is not set."""
if descriptor_proto.HasField('options'):
return descriptor_proto.options
else:
return None | [
"def",
"_OptionsOrNone",
"(",
"descriptor_proto",
")",
":",
"if",
"descriptor_proto",
".",
"HasField",
"(",
"'options'",
")",
":",
"return",
"descriptor_proto",
".",
"options",
"else",
":",
"return",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/descriptor.py#L1054-L1059 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/valgrind/suppressions.py | python | ReadDrMemorySuppressions | (lines, supp_descriptor) | return suppressions | Given a list of lines, returns a list of DrMemory suppressions.
Args:
lines: a list of lines containing suppressions.
supp_descriptor: should typically be a filename.
Used only when parsing errors happen. | Given a list of lines, returns a list of DrMemory suppressions. | [
"Given",
"a",
"list",
"of",
"lines",
"returns",
"a",
"list",
"of",
"DrMemory",
"suppressions",
"."
] | def ReadDrMemorySuppressions(lines, supp_descriptor):
"""Given a list of lines, returns a list of DrMemory suppressions.
Args:
lines: a list of lines containing suppressions.
supp_descriptor: should typically be a filename.
Used only when parsing errors happen.
"""
lines = StripAndSkipCommentsIte... | [
"def",
"ReadDrMemorySuppressions",
"(",
"lines",
",",
"supp_descriptor",
")",
":",
"lines",
"=",
"StripAndSkipCommentsIterator",
"(",
"lines",
")",
"suppressions",
"=",
"[",
"]",
"for",
"(",
"line_no",
",",
"line",
")",
"in",
"lines",
":",
"if",
"not",
"line... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/valgrind/suppressions.py#L446-L506 | |
mangosArchives/serverZero_Rel19 | 395039dd19cca769ec42186e76f0477089cc2490 | dep/ACE_wrappers/bin/make_release.py | python | get_and_update_versions | () | Gets current version information for each component,
updates the version files, creates changelog entries,
and commit the changes into the repository. | Gets current version information for each component,
updates the version files, creates changelog entries,
and commit the changes into the repository. | [
"Gets",
"current",
"version",
"information",
"for",
"each",
"component",
"updates",
"the",
"version",
"files",
"creates",
"changelog",
"entries",
"and",
"commit",
"the",
"changes",
"into",
"the",
"repository",
"."
] | def get_and_update_versions ():
""" Gets current version information for each component,
updates the version files, creates changelog entries,
and commit the changes into the repository."""
try:
get_comp_versions ("ACE")
get_comp_versions ("TAO")
get_comp_versions ("CIAO")
... | [
"def",
"get_and_update_versions",
"(",
")",
":",
"try",
":",
"get_comp_versions",
"(",
"\"ACE\"",
")",
"get_comp_versions",
"(",
"\"TAO\"",
")",
"get_comp_versions",
"(",
"\"CIAO\"",
")",
"get_comp_versions",
"(",
"\"DAnCE\"",
")",
"files",
"=",
"list",
"(",
")"... | https://github.com/mangosArchives/serverZero_Rel19/blob/395039dd19cca769ec42186e76f0477089cc2490/dep/ACE_wrappers/bin/make_release.py#L420-L447 | ||
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/types/datatype.py | python | DataType.value | (self) | return self.value_ | Return the data type. | Return the data type. | [
"Return",
"the",
"data",
"type",
"."
] | def value(self):
"""Return the data type."""
return self.value_ | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
".",
"value_"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/types/datatype.py#L39-L41 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEANet.AttrValueNI | (self, *args) | return _snap.TNEANet_AttrValueNI(self, *args) | AttrValueNI(TNEANet self, TInt NId, TStrV Values)
Parameters:
NId: TInt const &
Values: TStrV &
AttrValueNI(TNEANet self, TInt NId, TStrIntPrH::TIter NodeHI, TStrV Values)
Parameters:
NId: TInt const &
NodeHI: TStrIntPrH::TIter
Value... | AttrValueNI(TNEANet self, TInt NId, TStrV Values) | [
"AttrValueNI",
"(",
"TNEANet",
"self",
"TInt",
"NId",
"TStrV",
"Values",
")"
] | def AttrValueNI(self, *args):
"""
AttrValueNI(TNEANet self, TInt NId, TStrV Values)
Parameters:
NId: TInt const &
Values: TStrV &
AttrValueNI(TNEANet self, TInt NId, TStrIntPrH::TIter NodeHI, TStrV Values)
Parameters:
NId: TInt const &
... | [
"def",
"AttrValueNI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TNEANet_AttrValueNI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L21455-L21471 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm.is_initialized | (self) | return self._cluster_centers_initialized | Returns a boolean operation for initialized variables. | Returns a boolean operation for initialized variables. | [
"Returns",
"a",
"boolean",
"operation",
"for",
"initialized",
"variables",
"."
] | def is_initialized(self):
"""Returns a boolean operation for initialized variables."""
return self._cluster_centers_initialized | [
"def",
"is_initialized",
"(",
"self",
")",
":",
"return",
"self",
".",
"_cluster_centers_initialized"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L233-L235 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py | python | Panedwindow.__init__ | (self, master=None, **kw) | Construct a Ttk Panedwindow with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
orient, width, height
PANE OPTIONS
weight | Construct a Ttk Panedwindow with parent master. | [
"Construct",
"a",
"Ttk",
"Panedwindow",
"with",
"parent",
"master",
"."
] | def __init__(self, master=None, **kw):
"""Construct a Ttk Panedwindow with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
orient, width, height
PANE OPTIONS
weight
"""
Widget.__init__(self,... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"\"ttk::panedwindow\"",
",",
"kw",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L941-L956 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageFile.py | python | PyDecoder.init | (self, args) | Override to perform decoder specific initialization
:param args: Array of args items from the tile entry
:returns: None | Override to perform decoder specific initialization | [
"Override",
"to",
"perform",
"decoder",
"specific",
"initialization"
] | def init(self, args):
"""
Override to perform decoder specific initialization
:param args: Array of args items from the tile entry
:returns: None
"""
self.args = args | [
"def",
"init",
"(",
"self",
",",
"args",
")",
":",
"self",
".",
"args",
"=",
"args"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageFile.py#L588-L595 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListView.Select | (*args, **kwargs) | return _controls_.ListView_Select(*args, **kwargs) | Select(self, long n, bool on=True) | Select(self, long n, bool on=True) | [
"Select",
"(",
"self",
"long",
"n",
"bool",
"on",
"=",
"True",
")"
] | def Select(*args, **kwargs):
"""Select(self, long n, bool on=True)"""
return _controls_.ListView_Select(*args, **kwargs) | [
"def",
"Select",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListView_Select",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4915-L4917 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.isotope | (self) | return self.dispatcher._checkResult(Indigo._lib.indigoIsotope(self.id)) | Atom method returns the isotope number
Returns:
int: isotope number | Atom method returns the isotope number | [
"Atom",
"method",
"returns",
"the",
"isotope",
"number"
] | def isotope(self):
"""Atom method returns the isotope number
Returns:
int: isotope number
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(Indigo._lib.indigoIsotope(self.id)) | [
"def",
"isotope",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoIsotope",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1163-L1170 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macurl2path.py | python | url2pathname | (pathname) | return urllib.unquote(rv) | OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use. | OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use. | [
"OS",
"-",
"specific",
"conversion",
"from",
"a",
"relative",
"URL",
"of",
"the",
"file",
"scheme",
"to",
"a",
"file",
"system",
"path",
";",
"not",
"recommended",
"for",
"general",
"use",
"."
] | def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
#
# XXXX The .. handling should be fixed...
#
tp = urllib.splittype(pathname)[0]
if tp and tp != 'file':
raise RuntimeError, 'Cann... | [
"def",
"url2pathname",
"(",
"pathname",
")",
":",
"#",
"# XXXX The .. handling should be fixed...",
"#",
"tp",
"=",
"urllib",
".",
"splittype",
"(",
"pathname",
")",
"[",
"0",
"]",
"if",
"tp",
"and",
"tp",
"!=",
"'file'",
":",
"raise",
"RuntimeError",
",",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macurl2path.py#L10-L50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.