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/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/font.py | python | Font.actual | (self, option=None, displayof=None) | Return actual font attributes | Return actual font attributes | [
"Return",
"actual",
"font",
"attributes"
] | def actual(self, option=None, displayof=None):
"Return actual font attributes"
args = ()
if displayof:
args = ('-displayof', displayof)
if option:
args = args + ('-' + option, )
return self._call("font", "actual", self.name, *args)
else:
... | [
"def",
"actual",
"(",
"self",
",",
"option",
"=",
"None",
",",
"displayof",
"=",
"None",
")",
":",
"args",
"=",
"(",
")",
"if",
"displayof",
":",
"args",
"=",
"(",
"'-displayof'",
",",
"displayof",
")",
"if",
"option",
":",
"args",
"=",
"args",
"+"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/font.py#L122-L132 | ||
Adlik/Adlik | dba058c23ce76ff893d6c485e4ce7f097defaae3 | adlik_serving/clients/python/image_client.py | python | postprocess | (results, filenames, batch_size) | Post-process results to show classifications. | Post-process results to show classifications. | [
"Post",
"-",
"process",
"results",
"to",
"show",
"classifications",
"."
] | def postprocess(results, filenames, batch_size):
"""
Post-process results to show classifications.
"""
if len(results.tensor) != len(filenames):
raise Exception("expected {} results, got {}".format(batch_size, len(results)))
if len(filenames) != batch_size:
raise Exception("expected ... | [
"def",
"postprocess",
"(",
"results",
",",
"filenames",
",",
"batch_size",
")",
":",
"if",
"len",
"(",
"results",
".",
"tensor",
")",
"!=",
"len",
"(",
"filenames",
")",
":",
"raise",
"Exception",
"(",
"\"expected {} results, got {}\"",
".",
"format",
"(",
... | https://github.com/Adlik/Adlik/blob/dba058c23ce76ff893d6c485e4ce7f097defaae3/adlik_serving/clients/python/image_client.py#L139-L156 | ||
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Cursor.get_included_file | (self) | return conf.lib.clang_getIncludedFile(self) | Returns the File that is included by the current inclusion cursor. | Returns the File that is included by the current inclusion cursor. | [
"Returns",
"the",
"File",
"that",
"is",
"included",
"by",
"the",
"current",
"inclusion",
"cursor",
"."
] | def get_included_file(self):
"""Returns the File that is included by the current inclusion cursor."""
assert self.kind == CursorKind.INCLUSION_DIRECTIVE
return conf.lib.clang_getIncludedFile(self) | [
"def",
"get_included_file",
"(",
"self",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"INCLUSION_DIRECTIVE",
"return",
"conf",
".",
"lib",
".",
"clang_getIncludedFile",
"(",
"self",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L1514-L1518 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | python | Cursor.is_default_method | (self) | return conf.lib.clang_CXXMethod_isDefaulted(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"=",
"default",
"."
] | def is_default_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'.
"""
return conf.lib.clang_CXXMethod_isDefaulted(self) | [
"def",
"is_default_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isDefaulted",
"(",
"self",
")"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L1372-L1376 | |
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | CheckCStyleCast | (filename, clean_lines, linenum, cast_type, pattern, error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The string for the C++ cast to recommend. This is either
reinterpret_cast, static_... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
... | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L5196-L5246 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers.py | python | ConvertTo32Bit._convert_reward | (self, reward) | return np.array(reward, dtype=np.float32) | Convert the reward to 32 bits.
Args:
reward: Numpy reward.
Raises:
ValueError: Rewards contain infinite values.
Returns:
Numpy reward with 32-bit data type. | Convert the reward to 32 bits. | [
"Convert",
"the",
"reward",
"to",
"32",
"bits",
"."
] | def _convert_reward(self, reward):
"""Convert the reward to 32 bits.
Args:
reward: Numpy reward.
Raises:
ValueError: Rewards contain infinite values.
Returns:
Numpy reward with 32-bit data type.
"""
if not np.isfinite(reward).all():
raise ValueError('Infinite reward en... | [
"def",
"_convert_reward",
"(",
"self",
",",
"reward",
")",
":",
"if",
"not",
"np",
".",
"isfinite",
"(",
"reward",
")",
".",
"all",
"(",
")",
":",
"raise",
"ValueError",
"(",
"'Infinite reward encountered.'",
")",
"return",
"np",
".",
"array",
"(",
"rewa... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers.py#L535-L549 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py | python | DatagramHandler.makeSocket | (self) | return s | The factory method of SocketHandler is here overridden to create
a UDP socket (SOCK_DGRAM). | The factory method of SocketHandler is here overridden to create
a UDP socket (SOCK_DGRAM). | [
"The",
"factory",
"method",
"of",
"SocketHandler",
"is",
"here",
"overridden",
"to",
"create",
"a",
"UDP",
"socket",
"(",
"SOCK_DGRAM",
")",
"."
] | def makeSocket(self):
"""
The factory method of SocketHandler is here overridden to create
a UDP socket (SOCK_DGRAM).
"""
if self.port is None:
family = socket.AF_UNIX
else:
family = socket.AF_INET
s = socket.socket(family, socket.SOCK_DGRA... | [
"def",
"makeSocket",
"(",
"self",
")",
":",
"if",
"self",
".",
"port",
"is",
"None",
":",
"family",
"=",
"socket",
".",
"AF_UNIX",
"else",
":",
"family",
"=",
"socket",
".",
"AF_INET",
"s",
"=",
"socket",
".",
"socket",
"(",
"family",
",",
"socket",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py#L668-L678 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/graph/lattice.py | python | Lattice._clean_site_offsets | (site_offsets, atoms_coord, basis_vectors) | return site_offsets, fractional_coords | Check and convert `site_offsets` init argument. | Check and convert `site_offsets` init argument. | [
"Check",
"and",
"convert",
"site_offsets",
"init",
"argument",
"."
] | def _clean_site_offsets(site_offsets, atoms_coord, basis_vectors):
"""Check and convert `site_offsets` init argument."""
if atoms_coord is not None and site_offsets is not None:
raise ValueError(
"atoms_coord is deprecated and replaced by site_offsets, "
"so b... | [
"def",
"_clean_site_offsets",
"(",
"site_offsets",
",",
"atoms_coord",
",",
"basis_vectors",
")",
":",
"if",
"atoms_coord",
"is",
"not",
"None",
"and",
"site_offsets",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"atoms_coord is deprecated and replaced by s... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/lattice.py#L325-L367 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | Geometry3D.empty | (self) | return _robotsim.Geometry3D_empty(self) | empty(Geometry3D self) -> bool
Returns true if this has no contents (not the same as numElements()==0) | empty(Geometry3D self) -> bool | [
"empty",
"(",
"Geometry3D",
"self",
")",
"-",
">",
"bool"
] | def empty(self):
"""
empty(Geometry3D self) -> bool
Returns true if this has no contents (not the same as numElements()==0)
"""
return _robotsim.Geometry3D_empty(self) | [
"def",
"empty",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"Geometry3D_empty",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L1961-L1970 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | demo/live/ctpdemo.py | python | CtpTrading.onRspUserLogin | (self,RspUserLoginField) | :param RspUserLoginField:
:return: | :param RspUserLoginField:
:return: | [
":",
"param",
"RspUserLoginField",
":",
":",
"return",
":"
] | def onRspUserLogin(self,RspUserLoginField):
"""
:param RspUserLoginField:
:return:
"""
self.__sessionId = RspUserLoginField.sessionID
logger1.info(u'交易服务器登陆成功')
__requestId = self.__ctpTd.reqQryOrder() | [
"def",
"onRspUserLogin",
"(",
"self",
",",
"RspUserLoginField",
")",
":",
"self",
".",
"__sessionId",
"=",
"RspUserLoginField",
".",
"sessionID",
"logger1",
".",
"info",
"(",
"u'交易服务器登陆成功')",
"",
"__requestId",
"=",
"self",
".",
"__ctpTd",
".",
"reqQryOrder",
... | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/demo/live/ctpdemo.py#L68-L75 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/email/feedparser.py | python | FeedParser.feed | (self, data) | Push more data into the parser. | Push more data into the parser. | [
"Push",
"more",
"data",
"into",
"the",
"parser",
"."
] | def feed(self, data):
"""Push more data into the parser."""
self._input.push(data)
self._call_parse() | [
"def",
"feed",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_input",
".",
"push",
"(",
"data",
")",
"self",
".",
"_call_parse",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/feedparser.py#L150-L153 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/random.py | python | Random.gauss | (self, mu, sigma) | return mu + z*sigma | Gaussian distribution.
mu is the mean, and sigma is the standard deviation. This is
slightly faster than the normalvariate() function.
Not thread-safe without a lock around calls. | Gaussian distribution. | [
"Gaussian",
"distribution",
"."
] | def gauss(self, mu, sigma):
"""Gaussian distribution.
mu is the mean, and sigma is the standard deviation. This is
slightly faster than the normalvariate() function.
Not thread-safe without a lock around calls.
"""
# When x and y are two variables from [0, 1), unifor... | [
"def",
"gauss",
"(",
"self",
",",
"mu",
",",
"sigma",
")",
":",
"# When x and y are two variables from [0, 1), uniformly",
"# distributed, then",
"#",
"# cos(2*pi*x)*sqrt(-2*log(1-y))",
"# sin(2*pi*x)*sqrt(-2*log(1-y))",
"#",
"# are two *independent* variables with normal distr... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/random.py#L550-L587 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | docs/tutorials/Boosting-classifier-accuracy-by-grouping-categories/pets.py | python | take_action | (group) | Helper function to decide what action to take when we detect a group | Helper function to decide what action to take when we detect a group | [
"Helper",
"function",
"to",
"decide",
"what",
"action",
"to",
"take",
"when",
"we",
"detect",
"a",
"group"
] | def take_action(group):
"""Helper function to decide what action to take when we detect a group"""
if group == "Dog":
# A prediction in the dog category group was detected, print a `woof`
print("Woof!")
elif group == "Cat":
# A prediction in the cat category group was detected, print... | [
"def",
"take_action",
"(",
"group",
")",
":",
"if",
"group",
"==",
"\"Dog\"",
":",
"# A prediction in the dog category group was detected, print a `woof`",
"print",
"(",
"\"Woof!\"",
")",
"elif",
"group",
"==",
"\"Cat\"",
":",
"# A prediction in the cat category group was d... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/docs/tutorials/Boosting-classifier-accuracy-by-grouping-categories/pets.py#L40-L47 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/idtracking.py | python | FrameSymbolVisitor.visit_Assign | (self, node, **kwargs) | Visit assignments in the correct order. | Visit assignments in the correct order. | [
"Visit",
"assignments",
"in",
"the",
"correct",
"order",
"."
] | def visit_Assign(self, node, **kwargs):
"""Visit assignments in the correct order."""
self.visit(node.node, **kwargs)
self.visit(node.target, **kwargs) | [
"def",
"visit_Assign",
"(",
"self",
",",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"visit",
"(",
"node",
".",
"node",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"visit",
"(",
"node",
".",
"target",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/idtracking.py#L254-L257 | ||
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | wrap/gtwrap/pybind_wrapper.py | python | PybindWrapper.wrap_ctors | (self, my_class) | return res | Wrap the constructors. | Wrap the constructors. | [
"Wrap",
"the",
"constructors",
"."
] | def wrap_ctors(self, my_class):
"""Wrap the constructors."""
res = ""
for ctor in my_class.ctors:
res += (
self.method_indent + '.def(py::init<{args_cpp_types}>()'
'{py_args_names})'.format(
args_cpp_types=", ".join(ctor.args.to_cpp... | [
"def",
"wrap_ctors",
"(",
"self",
",",
"my_class",
")",
":",
"res",
"=",
"\"\"",
"for",
"ctor",
"in",
"my_class",
".",
"ctors",
":",
"res",
"+=",
"(",
"self",
".",
"method_indent",
"+",
"'.def(py::init<{args_cpp_types}>()'",
"'{py_args_names})'",
".",
"format"... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/pybind_wrapper.py#L83-L93 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | third-party/benchmark/tools/gbench/report.py | python | get_timedelta_field_as_seconds | (benchmark, field_name) | return dt / Timedelta(1, 's') | Get value of field_name field of benchmark, which is time with time unit
time_unit, as time in seconds. | Get value of field_name field of benchmark, which is time with time unit
time_unit, as time in seconds. | [
"Get",
"value",
"of",
"field_name",
"field",
"of",
"benchmark",
"which",
"is",
"time",
"with",
"time",
"unit",
"time_unit",
"as",
"time",
"in",
"seconds",
"."
] | def get_timedelta_field_as_seconds(benchmark, field_name):
"""
Get value of field_name field of benchmark, which is time with time unit
time_unit, as time in seconds.
"""
time_unit = benchmark['time_unit'] if 'time_unit' in benchmark else 's'
dt = Timedelta(benchmark[field_name], time_unit)
... | [
"def",
"get_timedelta_field_as_seconds",
"(",
"benchmark",
",",
"field_name",
")",
":",
"time_unit",
"=",
"benchmark",
"[",
"'time_unit'",
"]",
"if",
"'time_unit'",
"in",
"benchmark",
"else",
"'s'",
"dt",
"=",
"Timedelta",
"(",
"benchmark",
"[",
"field_name",
"]... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/third-party/benchmark/tools/gbench/report.py#L155-L162 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextPrinting.GetHeaderFooterData | (*args, **kwargs) | return _richtext.RichTextPrinting_GetHeaderFooterData(*args, **kwargs) | GetHeaderFooterData(self) -> wxRichTextHeaderFooterData | GetHeaderFooterData(self) -> wxRichTextHeaderFooterData | [
"GetHeaderFooterData",
"(",
"self",
")",
"-",
">",
"wxRichTextHeaderFooterData"
] | def GetHeaderFooterData(*args, **kwargs):
"""GetHeaderFooterData(self) -> wxRichTextHeaderFooterData"""
return _richtext.RichTextPrinting_GetHeaderFooterData(*args, **kwargs) | [
"def",
"GetHeaderFooterData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrinting_GetHeaderFooterData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4516-L4518 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | amax | (a, axis=None, keepdims=False, initial=None, where=True) | return a.max(axis, keepdims, initial, where) | Returns the maximum of an array or maximum along an axis.
Note:
Numpy argument `out` is not supported.
On GPU, the supported dtypes are np.float16, and np.float32.
Args:
a (Tensor): Input data.
axis (None or int or tuple of integers, optional): Defaults to None. Axis or
... | Returns the maximum of an array or maximum along an axis. | [
"Returns",
"the",
"maximum",
"of",
"an",
"array",
"or",
"maximum",
"along",
"an",
"axis",
"."
] | def amax(a, axis=None, keepdims=False, initial=None, where=True):
"""
Returns the maximum of an array or maximum along an axis.
Note:
Numpy argument `out` is not supported.
On GPU, the supported dtypes are np.float16, and np.float32.
Args:
a (Tensor): Input data.
axis (... | [
"def",
"amax",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"initial",
"=",
"None",
",",
"where",
"=",
"True",
")",
":",
"return",
"a",
".",
"max",
"(",
"axis",
",",
"keepdims",
",",
"initial",
",",
"where",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L1387-L1439 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/collide.py | python | bb_union | (*bbs) | return [min(*x) for x in zip(*[b[0] for b in bbs])],[max(*x) for x in zip(*[b[1] for b in bbs])] | Returns a bounding box containing the given bboxes | Returns a bounding box containing the given bboxes | [
"Returns",
"a",
"bounding",
"box",
"containing",
"the",
"given",
"bboxes"
] | def bb_union(*bbs):
"""Returns a bounding box containing the given bboxes"""
return [min(*x) for x in zip(*[b[0] for b in bbs])],[max(*x) for x in zip(*[b[1] for b in bbs])] | [
"def",
"bb_union",
"(",
"*",
"bbs",
")",
":",
"return",
"[",
"min",
"(",
"*",
"x",
")",
"for",
"x",
"in",
"zip",
"(",
"*",
"[",
"b",
"[",
"0",
"]",
"for",
"b",
"in",
"bbs",
"]",
")",
"]",
",",
"[",
"max",
"(",
"*",
"x",
")",
"for",
"x",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/collide.py#L25-L27 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/device_utils.py | python | DeviceUtils.GoHome | (self, timeout=None, retries=None) | Return to the home screen and obtain launcher focus.
This command launches the home screen and attempts to obtain
launcher focus until the timeout is reached.
Args:
timeout: timeout in seconds
retries: number of retries
Raises:
CommandTimeoutError on timeout.
DeviceUnreachable... | Return to the home screen and obtain launcher focus. | [
"Return",
"to",
"the",
"home",
"screen",
"and",
"obtain",
"launcher",
"focus",
"."
] | def GoHome(self, timeout=None, retries=None):
"""Return to the home screen and obtain launcher focus.
This command launches the home screen and attempts to obtain
launcher focus until the timeout is reached.
Args:
timeout: timeout in seconds
retries: number of retries
Raises:
Co... | [
"def",
"GoHome",
"(",
"self",
",",
"timeout",
"=",
"None",
",",
"retries",
"=",
"None",
")",
":",
"def",
"is_launcher_focused",
"(",
")",
":",
"output",
"=",
"self",
".",
"RunShellCommand",
"(",
"[",
"'dumpsys'",
",",
"'window'",
",",
"'windows'",
"]",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L1071-L1107 | ||
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/tools/extra/parse_log.py#L77-L116 | |
shader-slang/slang | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 | external/vulkan/registry/reg.py | python | Registry.breakOnName | (self, regexp) | Specify a feature name regexp to break on when generating features. | Specify a feature name regexp to break on when generating features. | [
"Specify",
"a",
"feature",
"name",
"regexp",
"to",
"break",
"on",
"when",
"generating",
"features",
"."
] | def breakOnName(self, regexp):
"""Specify a feature name regexp to break on when generating features."""
self.breakPat = re.compile(regexp) | [
"def",
"breakOnName",
"(",
"self",
",",
"regexp",
")",
":",
"self",
".",
"breakPat",
"=",
"re",
".",
"compile",
"(",
"regexp",
")"
] | https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/reg.py#L390-L392 | ||
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | wrappers/Python/CoolProp/Plots/psy.py | python | UI_Psychrometry.plot | (self) | Plot chart | Plot chart | [
"Plot",
"chart"
] | def plot(self):
"""Plot chart"""
Preferences = ConfigParser()
Preferences.read("psyrc")
self.diagrama2D.axes2D.clear()
self.diagrama2D.config()
filename = "%i.pkl" % P
if os.path.isfile(filename):
with open(filename, "r") as archivo:
d... | [
"def",
"plot",
"(",
"self",
")",
":",
"Preferences",
"=",
"ConfigParser",
"(",
")",
"Preferences",
".",
"read",
"(",
"\"psyrc\"",
")",
"self",
".",
"diagrama2D",
".",
"axes2D",
".",
"clear",
"(",
")",
"self",
".",
"diagrama2D",
".",
"config",
"(",
")",... | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/wrappers/Python/CoolProp/Plots/psy.py#L395-L485 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/validate.py | python | _test | (value, *args, **keywargs) | return (value, args, keywargs) | A function that exists for test purposes.
>>> checks = [
... '3, 6, min=1, max=3, test=list(a, b, c)',
... '3',
... '3, 6',
... '3,',
... 'min=1, test="a b c"',
... 'min=5, test="a, b, c"',
... 'min=1, max=3, test="a, b, c"',
... 'min=-100, test=-... | A function that exists for test purposes.
>>> checks = [
... '3, 6, min=1, max=3, test=list(a, b, c)',
... '3',
... '3, 6',
... '3,',
... 'min=1, test="a b c"',
... 'min=5, test="a, b, c"',
... 'min=1, max=3, test="a, b, c"',
... 'min=-100, test=-... | [
"A",
"function",
"that",
"exists",
"for",
"test",
"purposes",
".",
">>>",
"checks",
"=",
"[",
"...",
"3",
"6",
"min",
"=",
"1",
"max",
"=",
"3",
"test",
"=",
"list",
"(",
"a",
"b",
"c",
")",
"...",
"3",
"...",
"3",
"6",
"...",
"3",
"...",
"mi... | def _test(value, *args, **keywargs):
"""
A function that exists for test purposes.
>>> checks = [
... '3, 6, min=1, max=3, test=list(a, b, c)',
... '3',
... '3, 6',
... '3,',
... 'min=1, test="a b c"',
... 'min=5, test="a, b, c"',
... 'min=1, max=... | [
"def",
"_test",
"(",
"value",
",",
"*",
"args",
",",
"*",
"*",
"keywargs",
")",
":",
"return",
"(",
"value",
",",
"args",
",",
"keywargs",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/validate.py#L1319-L1400 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/tools/saved_model_cli.py | python | _show_tag_sets | (saved_model_dir) | Prints the tag-sets stored in SavedModel directory.
Prints all the tag-sets for MetaGraphs stored in SavedModel directory.
Args:
saved_model_dir: Directory containing the SavedModel to inspect. | Prints the tag-sets stored in SavedModel directory. | [
"Prints",
"the",
"tag",
"-",
"sets",
"stored",
"in",
"SavedModel",
"directory",
"."
] | def _show_tag_sets(saved_model_dir):
"""Prints the tag-sets stored in SavedModel directory.
Prints all the tag-sets for MetaGraphs stored in SavedModel directory.
Args:
saved_model_dir: Directory containing the SavedModel to inspect.
"""
tag_sets = reader.get_saved_model_tag_sets(saved_model_dir)
prin... | [
"def",
"_show_tag_sets",
"(",
"saved_model_dir",
")",
":",
"tag_sets",
"=",
"reader",
".",
"get_saved_model_tag_sets",
"(",
"saved_model_dir",
")",
"print",
"(",
"'The given SavedModel contains the following tag-sets:'",
")",
"for",
"tag_set",
"in",
"sorted",
"(",
"tag_... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/tools/saved_model_cli.py#L44-L55 | ||
s5z/zsim | fb4d6e0475a25cffd23f0687ede2d43d96b4a99f | misc/cpplint.py | python | CheckForFunctionLengths | (filename, clean_lines, linenum,
function_state, error) | Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming other style guidelines
(especially spacing) are followed.
Only checks unindented functions, so class members are ... | Reports for long function bodies. | [
"Reports",
"for",
"long",
"function",
"bodies",
"."
] | def CheckForFunctionLengths(filename, clean_lines, linenum,
function_state, error):
"""Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming ... | [
"def",
"CheckForFunctionLengths",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"function_state",
",",
"error",
")",
":",
"lines",
"=",
"clean_lines",
".",
"lines",
"line",
"=",
"lines",
"[",
"linenum",
"]",
"raw",
"=",
"clean_lines",
".",
"raw_l... | https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L1937-L2004 | ||
ideawu/ssdb | f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4 | deps/cpy/antlr3/tree.py | python | Tree.setParent | (self, t) | Tree tracks parent and child index now > 3.0 | Tree tracks parent and child index now > 3.0 | [
"Tree",
"tracks",
"parent",
"and",
"child",
"index",
"now",
">",
"3",
".",
"0"
] | def setParent(self, t):
"""Tree tracks parent and child index now > 3.0"""
raise NotImplementedError | [
"def",
"setParent",
"(",
"self",
",",
"t",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/tree.py#L125-L128 | ||
dolphin-emu/dolphin | b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb | Externals/fmt/support/docopt.py | python | transform | (pattern) | return Either(*[Required(*e) for e in result]) | Expand pattern into an (almost) equivalent one, but with single Either.
Example: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d)
Quirks: [-a] => (-a), (-a...) => (-a -a) | Expand pattern into an (almost) equivalent one, but with single Either. | [
"Expand",
"pattern",
"into",
"an",
"(",
"almost",
")",
"equivalent",
"one",
"but",
"with",
"single",
"Either",
"."
] | def transform(pattern):
"""Expand pattern into an (almost) equivalent one, but with single Either.
Example: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d)
Quirks: [-a] => (-a), (-a...) => (-a -a)
"""
result = []
groups = [[pattern]]
while groups:
children = groups.pop(0)
... | [
"def",
"transform",
"(",
"pattern",
")",
":",
"result",
"=",
"[",
"]",
"groups",
"=",
"[",
"[",
"pattern",
"]",
"]",
"while",
"groups",
":",
"children",
"=",
"groups",
".",
"pop",
"(",
"0",
")",
"parents",
"=",
"[",
"Required",
",",
"Optional",
","... | https://github.com/dolphin-emu/dolphin/blob/b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb/Externals/fmt/support/docopt.py#L72-L96 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.EndUnderline | (*args, **kwargs) | return _richtext.RichTextBuffer_EndUnderline(*args, **kwargs) | EndUnderline(self) -> bool | EndUnderline(self) -> bool | [
"EndUnderline",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndUnderline(*args, **kwargs):
"""EndUnderline(self) -> bool"""
return _richtext.RichTextBuffer_EndUnderline(*args, **kwargs) | [
"def",
"EndUnderline",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndUnderline",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2353-L2355 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/variables.py | python | initialize_variables | (var_list, name="init") | return control_flow_ops.no_op(name=name) | Returns an Op that initializes a list of variables.
After you launch the graph in a session, you can run the returned Op to
initialize all the variables in `var_list`. This Op runs all the
initializers of the variables in `var_list` in parallel.
Calling `initialize_variables()` is equivalent to passing the li... | Returns an Op that initializes a list of variables. | [
"Returns",
"an",
"Op",
"that",
"initializes",
"a",
"list",
"of",
"variables",
"."
] | def initialize_variables(var_list, name="init"):
"""Returns an Op that initializes a list of variables.
After you launch the graph in a session, you can run the returned Op to
initialize all the variables in `var_list`. This Op runs all the
initializers of the variables in `var_list` in parallel.
Calling `i... | [
"def",
"initialize_variables",
"(",
"var_list",
",",
"name",
"=",
"\"init\"",
")",
":",
"if",
"var_list",
":",
"return",
"control_flow_ops",
".",
"group",
"(",
"*",
"[",
"v",
".",
"initializer",
"for",
"v",
"in",
"var_list",
"]",
",",
"name",
"=",
"name"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variables.py#L907-L930 | |
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | FlagCxx14Features | (filename, clean_lines, linenum, error) | Flag those C++14 features that we restrict.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Flag those C++14 features that we restrict. | [
"Flag",
"those",
"C",
"++",
"14",
"features",
"that",
"we",
"restrict",
"."
] | def FlagCxx14Features(filename, clean_lines, linenum, error):
"""Flag those C++14 features that we restrict.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any erro... | [
"def",
"FlagCxx14Features",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"include",
"=",
"Match",
"(",
"r'\\s*#\\s*include\\s+[<\"]([^<\"]+)[\">]'",
",",
"line",
")",... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L6161-L6177 | ||
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/mox.py | python | MockMethod.__call__ | (self, *params, **named_params) | return expected_method._return_value | Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the top of the queue and
verify this call is equal ... | Log parameters and return the specified return value. | [
"Log",
"parameters",
"and",
"return",
"the",
"specified",
"return",
"value",
"."
] | def __call__(self, *params, **named_params):
"""Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"params",
",",
"*",
"*",
"named_params",
")",
":",
"self",
".",
"_params",
"=",
"params",
"self",
".",
"_named_params",
"=",
"named_params",
"if",
"not",
"self",
".",
"_replay_mode",
":",
"self",
".",
"_call_queu... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/mox.py#L545-L573 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py | python | _tf_style_initial_state | (initial_state_fn) | return actual_initial_state_fn | Method decorator for `tf_style_adaptive_encoding_stage`. | Method decorator for `tf_style_adaptive_encoding_stage`. | [
"Method",
"decorator",
"for",
"tf_style_adaptive_encoding_stage",
"."
] | def _tf_style_initial_state(initial_state_fn):
"""Method decorator for `tf_style_adaptive_encoding_stage`."""
def actual_initial_state_fn(self, name=None):
"""Modified `initial_state` method."""
with tf.compat.v1.name_scope(name, self.name + INITIAL_STATE_SCOPE_SUFFIX):
return initial_state_fn(self, ... | [
"def",
"_tf_style_initial_state",
"(",
"initial_state_fn",
")",
":",
"def",
"actual_initial_state_fn",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"\"\"\"Modified `initial_state` method.\"\"\"",
"with",
"tf",
".",
"compat",
".",
"v1",
".",
"name_scope",
"(",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py#L629-L637 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py | python | Distribution._print | (self, package, action) | Print package-related action text (e.g. 'Installing')
indicating progress | Print package-related action text (e.g. 'Installing')
indicating progress | [
"Print",
"package",
"-",
"related",
"action",
"text",
"(",
"e",
".",
"g",
".",
"Installing",
")",
"indicating",
"progress"
] | def _print(self, package, action):
"""Print package-related action text (e.g. 'Installing')
indicating progress"""
text = " ".join([action, package.name, package.version])
if self.verbose:
utils.print_box(text)
else:
if self.indent:
text =... | [
"def",
"_print",
"(",
"self",
",",
"package",
",",
"action",
")",
":",
"text",
"=",
"\" \"",
".",
"join",
"(",
"[",
"action",
",",
"package",
".",
"name",
",",
"package",
".",
"version",
"]",
")",
"if",
"self",
".",
"verbose",
":",
"utils",
".",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py#L369-L378 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/descriptor.py | python | describe_message | (message_definition) | return message_descriptor | Build descriptor for Message class.
Args:
message_definition: Message class to provide descriptor for.
Returns:
Initialized MessageDescriptor instance describing the Message class. | Build descriptor for Message class. | [
"Build",
"descriptor",
"for",
"Message",
"class",
"."
] | def describe_message(message_definition):
"""Build descriptor for Message class.
Args:
message_definition: Message class to provide descriptor for.
Returns:
Initialized MessageDescriptor instance describing the Message class.
"""
message_descriptor = MessageDescriptor()
message_descriptor.name = m... | [
"def",
"describe_message",
"(",
"message_definition",
")",
":",
"message_descriptor",
"=",
"MessageDescriptor",
"(",
")",
"message_descriptor",
".",
"name",
"=",
"message_definition",
".",
"definition_name",
"(",
")",
".",
"split",
"(",
"'.'",
")",
"[",
"-",
"1"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/descriptor.py#L376-L417 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeOutput | (self, spec, type=None) | Compute the path for the final output of the spec. | Compute the path for the final output of the spec. | [
"Compute",
"the",
"path",
"for",
"the",
"final",
"output",
"of",
"the",
"spec",
"."
] | def ComputeOutput(self, spec, type=None):
"""Compute the path for the final output of the spec."""
assert not self.is_mac_bundle or type
if not type:
type = spec['type']
if self.flavor == 'win':
override = self.msvs_settings.GetOutputName(self.config_name,
... | [
"def",
"ComputeOutput",
"(",
"self",
",",
"spec",
",",
"type",
"=",
"None",
")",
":",
"assert",
"not",
"self",
".",
"is_mac_bundle",
"or",
"type",
"if",
"not",
"type",
":",
"type",
"=",
"spec",
"[",
"'type'",
"]",
"if",
"self",
".",
"flavor",
"==",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L1118-L1157 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/markupsafe/_native.py | python | escape | (s) | return Markup(text_type(s)
.replace('&', '&')
.replace('>', '>')
.replace('<', '<')
.replace("'", ''')
.replace('"', '"')
) | Convert the characters &, <, >, ' and " in string s to HTML-safe
sequences. Use this if you need to display text that might contain
such characters in HTML. Marks return value as markup string. | Convert the characters &, <, >, ' and " in string s to HTML-safe
sequences. Use this if you need to display text that might contain
such characters in HTML. Marks return value as markup string. | [
"Convert",
"the",
"characters",
"&",
"<",
">",
"and",
"in",
"string",
"s",
"to",
"HTML",
"-",
"safe",
"sequences",
".",
"Use",
"this",
"if",
"you",
"need",
"to",
"display",
"text",
"that",
"might",
"contain",
"such",
"characters",
"in",
"HTML",
".",
"M... | def escape(s):
"""Convert the characters &, <, >, ' and " in string s to HTML-safe
sequences. Use this if you need to display text that might contain
such characters in HTML. Marks return value as markup string.
"""
if hasattr(s, '__html__'):
return s.__html__()
return Markup(text_type... | [
"def",
"escape",
"(",
"s",
")",
":",
"if",
"hasattr",
"(",
"s",
",",
"'__html__'",
")",
":",
"return",
"s",
".",
"__html__",
"(",
")",
"return",
"Markup",
"(",
"text_type",
"(",
"s",
")",
".",
"replace",
"(",
"'&'",
",",
"'&'",
")",
".",
"rep... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/markupsafe/_native.py#L15-L28 | |
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | source/common/utility.py | python | virtual | (func: Callable) | return func | mark a function as "virtual", which means that this function can be override.
any base class should use this or @abstractmethod to decorate all functions
that can be (re)implemented by subclasses. | mark a function as "virtual", which means that this function can be override.
any base class should use this or | [
"mark",
"a",
"function",
"as",
"virtual",
"which",
"means",
"that",
"this",
"function",
"can",
"be",
"override",
".",
"any",
"base",
"class",
"should",
"use",
"this",
"or"
] | def virtual(func: Callable):
"""
mark a function as "virtual", which means that this function can be override.
any base class should use this or @abstractmethod to decorate all functions
that can be (re)implemented by subclasses.
"""
return func | [
"def",
"virtual",
"(",
"func",
":",
"Callable",
")",
":",
"return",
"func"
] | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/common/utility.py#L164-L170 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pickletools.py | python | read_long4 | (f) | return decode_long(data) | r"""
>>> import io
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
255
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
32767
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
-256
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
-32768
>>> read_long1(... | r"""
>>> import io
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
255
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
32767
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
-256
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
-32768
>>> read_long1(... | [
"r",
">>>",
"import",
"io",
">>>",
"read_long4",
"(",
"io",
".",
"BytesIO",
"(",
"b",
"\\",
"x02",
"\\",
"x00",
"\\",
"x00",
"\\",
"x00",
"\\",
"xff",
"\\",
"x00",
"))",
"255",
">>>",
"read_long4",
"(",
"io",
".",
"BytesIO",
"(",
"b",
"\\",
"x02"... | def read_long4(f):
r"""
>>> import io
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
255
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
32767
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
-256
>>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
-32... | [
"def",
"read_long4",
"(",
"f",
")",
":",
"n",
"=",
"read_int4",
"(",
"f",
")",
"if",
"n",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"long4 byte count < 0: %d\"",
"%",
"n",
")",
"data",
"=",
"f",
".",
"read",
"(",
"n",
")",
"if",
"len",
"(",
"d... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pickletools.py#L905-L926 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/closure_compiler/error_filter.py | python | PromiseErrorFilter.filter | (self, error_list) | return [error for error in error_list if not self._should_ignore(error)] | Filters out errors matching any of the allowed patterns.
Args:
error_list: A list of errors from the closure compiler.
Return:
A list of errors, with spurious Promise type errors removed. | Filters out errors matching any of the allowed patterns. | [
"Filters",
"out",
"errors",
"matching",
"any",
"of",
"the",
"allowed",
"patterns",
"."
] | def filter(self, error_list):
"""Filters out errors matching any of the allowed patterns.
Args:
error_list: A list of errors from the closure compiler.
Return:
A list of errors, with spurious Promise type errors removed.
"""
return [error for error in error_list if not self._should... | [
"def",
"filter",
"(",
"self",
",",
"error_list",
")",
":",
"return",
"[",
"error",
"for",
"error",
"in",
"error_list",
"if",
"not",
"self",
".",
"_should_ignore",
"(",
"error",
")",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/closure_compiler/error_filter.py#L35-L44 | |
Atarity/Lightpack | 4dee73a443cba4c4073291febe450e6c1941f3af | Software/apiexamples/liOSC/OSC.py | python | OSCServer.close | (self) | Stops serving requests, closes server (socket), closes used client | Stops serving requests, closes server (socket), closes used client | [
"Stops",
"serving",
"requests",
"closes",
"server",
"(",
"socket",
")",
"closes",
"used",
"client"
] | def close(self):
"""Stops serving requests, closes server (socket), closes used client
"""
self.running = False
self.client.close()
self.server_close() | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"running",
"=",
"False",
"self",
".",
"client",
".",
"close",
"(",
")",
"self",
".",
"server_close",
"(",
")"
] | https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L1818-L1823 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.MoveLeft | (*args, **kwargs) | return _richtext.RichTextCtrl_MoveLeft(*args, **kwargs) | MoveLeft(self, int noPositions=1, int flags=0) -> bool
Move left | MoveLeft(self, int noPositions=1, int flags=0) -> bool | [
"MoveLeft",
"(",
"self",
"int",
"noPositions",
"=",
"1",
"int",
"flags",
"=",
"0",
")",
"-",
">",
"bool"
] | def MoveLeft(*args, **kwargs):
"""
MoveLeft(self, int noPositions=1, int flags=0) -> bool
Move left
"""
return _richtext.RichTextCtrl_MoveLeft(*args, **kwargs) | [
"def",
"MoveLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_MoveLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L3728-L3734 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/common_shapes.py | python | get_conv_output_size | (input_size, filter_size, strides, padding_type) | return tuple(output_size) | Returns the spatial size of a n-d convolution/pooling output. | Returns the spatial size of a n-d convolution/pooling output. | [
"Returns",
"the",
"spatial",
"size",
"of",
"a",
"n",
"-",
"d",
"convolution",
"/",
"pooling",
"output",
"."
] | def get_conv_output_size(input_size, filter_size, strides, padding_type):
"""Returns the spatial size of a n-d convolution/pooling output."""
input_size = tuple([tensor_shape.as_dimension(x).value for x in input_size])
filter_size = tuple([tensor_shape.as_dimension(x).value for x in filter_size])
strides = [int... | [
"def",
"get_conv_output_size",
"(",
"input_size",
",",
"filter_size",
",",
"strides",
",",
"padding_type",
")",
":",
"input_size",
"=",
"tuple",
"(",
"[",
"tensor_shape",
".",
"as_dimension",
"(",
"x",
")",
".",
"value",
"for",
"x",
"in",
"input_size",
"]",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/common_shapes.py#L106-L145 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUCh.__eq__ | (self, *args) | return _snap.TUCh___eq__(self, *args) | __eq__(TUCh self, TUCh UCh) -> bool
Parameters:
UCh: TUCh const & | __eq__(TUCh self, TUCh UCh) -> bool | [
"__eq__",
"(",
"TUCh",
"self",
"TUCh",
"UCh",
")",
"-",
">",
"bool"
] | def __eq__(self, *args):
"""
__eq__(TUCh self, TUCh UCh) -> bool
Parameters:
UCh: TUCh const &
"""
return _snap.TUCh___eq__(self, *args) | [
"def",
"__eq__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TUCh___eq__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L12779-L12787 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Simulator.getActualVelocity | (self, robot: int) | return _robotsim.Simulator_getActualVelocity(self, robot) | r"""
Returns the current actual velocity of the robot from the simulator.
Args:
robot (int) | r"""
Returns the current actual velocity of the robot from the simulator. | [
"r",
"Returns",
"the",
"current",
"actual",
"velocity",
"of",
"the",
"robot",
"from",
"the",
"simulator",
"."
] | def getActualVelocity(self, robot: int) ->None:
r"""
Returns the current actual velocity of the robot from the simulator.
Args:
robot (int)
"""
return _robotsim.Simulator_getActualVelocity(self, robot) | [
"def",
"getActualVelocity",
"(",
"self",
",",
"robot",
":",
"int",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"Simulator_getActualVelocity",
"(",
"self",
",",
"robot",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7889-L7896 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | ci/checks/gitutils.py | python | repo_version_major_minor | () | return out_version | Determines the version of the repo using `git describe` and returns only
the major and minor portion
Returns
-------
str
The partial version of the repo in the format '{major}.{minor}' | Determines the version of the repo using `git describe` and returns only
the major and minor portion | [
"Determines",
"the",
"version",
"of",
"the",
"repo",
"using",
"git",
"describe",
"and",
"returns",
"only",
"the",
"major",
"and",
"minor",
"portion"
] | def repo_version_major_minor():
"""
Determines the version of the repo using `git describe` and returns only
the major and minor portion
Returns
-------
str
The partial version of the repo in the format '{major}.{minor}'
"""
full_repo_version = repo_version()
match = re.ma... | [
"def",
"repo_version_major_minor",
"(",
")",
":",
"full_repo_version",
"=",
"repo_version",
"(",
")",
"match",
"=",
"re",
".",
"match",
"(",
"r\"^v?(?P<major>[0-9]+)(?:\\.(?P<minor>[0-9]+))?\"",
",",
"full_repo_version",
")",
"if",
"(",
"match",
"is",
"None",
")",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/ci/checks/gitutils.py#L56-L82 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py | python | Videos.makeURL | (self, URL) | Form a URL to search for videos
return a URL | Form a URL to search for videos
return a URL | [
"Form",
"a",
"URL",
"to",
"search",
"for",
"videos",
"return",
"a",
"URL"
] | def makeURL(self, URL):
'''Form a URL to search for videos
return a URL
'''
additions = dict(self.tree_customize[self.tree_key]['__default__']) # Set defaults
# Add customizations
if self.feed in list(self.tree_customize[self.tree_key].keys()):
for element in... | [
"def",
"makeURL",
"(",
"self",
",",
"URL",
")",
":",
"additions",
"=",
"dict",
"(",
"self",
".",
"tree_customize",
"[",
"self",
".",
"tree_key",
"]",
"[",
"'__default__'",
"]",
")",
"# Set defaults",
"# Add customizations",
"if",
"self",
".",
"feed",
"in",... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py#L655-L677 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/util/compat.py | python | as_bytes | (bytes_or_text) | Converts either bytes or unicode to `bytes`, using utf-8 encoding for text.
Args:
bytes_or_text: A `bytes`, `str`, or `unicode` object.
Returns:
A `bytes` object.
Raises:
TypeError: If `bytes_or_text` is not a binary or unicode string. | Converts either bytes or unicode to `bytes`, using utf-8 encoding for text. | [
"Converts",
"either",
"bytes",
"or",
"unicode",
"to",
"bytes",
"using",
"utf",
"-",
"8",
"encoding",
"for",
"text",
"."
] | def as_bytes(bytes_or_text):
"""Converts either bytes or unicode to `bytes`, using utf-8 encoding for text.
Args:
bytes_or_text: A `bytes`, `str`, or `unicode` object.
Returns:
A `bytes` object.
Raises:
TypeError: If `bytes_or_text` is not a binary or unicode string.
"""
if isinstance(bytes_o... | [
"def",
"as_bytes",
"(",
"bytes_or_text",
")",
":",
"if",
"isinstance",
"(",
"bytes_or_text",
",",
"six",
".",
"text_type",
")",
":",
"return",
"bytes_or_text",
".",
"encode",
"(",
"'utf-8'",
")",
"elif",
"isinstance",
"(",
"bytes_or_text",
",",
"bytes",
")",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/util/compat.py#L27-L45 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/numeric.py | python | Float64Index.get_value | (self, series, key) | return new_values | we always want to get an index value, never a value | we always want to get an index value, never a value | [
"we",
"always",
"want",
"to",
"get",
"an",
"index",
"value",
"never",
"a",
"value"
] | def get_value(self, series, key):
""" we always want to get an index value, never a value """
if not is_scalar(key):
raise InvalidIndexError
k = com.values_from_object(key)
loc = self.get_loc(k)
new_values = com.values_from_object(series)[loc]
return new_val... | [
"def",
"get_value",
"(",
"self",
",",
"series",
",",
"key",
")",
":",
"if",
"not",
"is_scalar",
"(",
"key",
")",
":",
"raise",
"InvalidIndexError",
"k",
"=",
"com",
".",
"values_from_object",
"(",
"key",
")",
"loc",
"=",
"self",
".",
"get_loc",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/numeric.py#L369-L378 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py | python | ConfigContext.bootstrap | (self, args) | Does minimal initialization using the root_directory, game_directory, aws_directory, and user_directory arguments. | Does minimal initialization using the root_directory, game_directory, aws_directory, and user_directory arguments. | [
"Does",
"minimal",
"initialization",
"using",
"the",
"root_directory",
"game_directory",
"aws_directory",
"and",
"user_directory",
"arguments",
"."
] | def bootstrap(self, args):
"""Does minimal initialization using the root_directory, game_directory, aws_directory, and user_directory arguments."""
self.__verbose = args.verbose
if args.root_directory:
self.root_directory_path = args.root_directory
else:
self.ro... | [
"def",
"bootstrap",
"(",
"self",
",",
"args",
")",
":",
"self",
".",
"__verbose",
"=",
"args",
".",
"verbose",
"if",
"args",
".",
"root_directory",
":",
"self",
".",
"root_directory_path",
"=",
"args",
".",
"root_directory",
"else",
":",
"self",
".",
"ro... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py#L69-L107 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/Codegen.py | python | CGNativeMember.getRetvalInfo | (self, type, isMember) | Returns a tuple:
The first element is the type declaration for the retval
The second element is a default value that can be used on error returns.
For cases whose behavior depends on isMember, the second element will be
None if isMember is true.
The third element is a template... | Returns a tuple: | [
"Returns",
"a",
"tuple",
":"
] | def getRetvalInfo(self, type, isMember):
"""
Returns a tuple:
The first element is the type declaration for the retval
The second element is a default value that can be used on error returns.
For cases whose behavior depends on isMember, the second element will be
None ... | [
"def",
"getRetvalInfo",
"(",
"self",
",",
"type",
",",
"isMember",
")",
":",
"if",
"type",
".",
"isVoid",
"(",
")",
":",
"return",
"\"void\"",
",",
"\"\"",
",",
"\"\"",
"if",
"type",
".",
"isPrimitive",
"(",
")",
"and",
"type",
".",
"tag",
"(",
")"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/Codegen.py#L12191-L12333 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/controlpanel.py | python | PackagesTable.add_packages | (self, fnames) | Add packages | Add packages | [
"Add",
"packages"
] | def add_packages(self, fnames):
"""Add packages"""
notsupported = []
notcompatible = []
dist = self.distribution
for fname in fnames:
bname = osp.basename(fname)
try:
package = wppm.Package(fname)
if package.is_compatible_wi... | [
"def",
"add_packages",
"(",
"self",
",",
"fnames",
")",
":",
"notsupported",
"=",
"[",
"]",
"notcompatible",
"=",
"[",
"]",
"dist",
"=",
"self",
".",
"distribution",
"for",
"fname",
"in",
"fnames",
":",
"bname",
"=",
"osp",
".",
"basename",
"(",
"fname... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/controlpanel.py#L171-L199 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/rectangle-area-ii.py | python | Solution.rectangleArea | (self, rectangles) | return result % (10**9+7) | :type rectangles: List[List[int]]
:rtype: int | :type rectangles: List[List[int]]
:rtype: int | [
":",
"type",
"rectangles",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def rectangleArea(self, rectangles):
"""
:type rectangles: List[List[int]]
:rtype: int
"""
OPEN, CLOSE = 1, -1
events = []
X = set()
for x1, y1, x2, y2 in rectangles:
events.append((y1, OPEN, x1, x2))
events.append((y2, CLOSE, x1, x... | [
"def",
"rectangleArea",
"(",
"self",
",",
"rectangles",
")",
":",
"OPEN",
",",
"CLOSE",
"=",
"1",
",",
"-",
"1",
"events",
"=",
"[",
"]",
"X",
"=",
"set",
"(",
")",
"for",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
"in",
"rectangles",
":",
"events"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/rectangle-area-ii.py#L37-L62 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/build/android/pylib/android_commands.py | python | AndroidCommands.Adb | (self) | return self._adb | Returns our AdbInterface to avoid us wrapping all its methods. | Returns our AdbInterface to avoid us wrapping all its methods. | [
"Returns",
"our",
"AdbInterface",
"to",
"avoid",
"us",
"wrapping",
"all",
"its",
"methods",
"."
] | def Adb(self):
"""Returns our AdbInterface to avoid us wrapping all its methods."""
return self._adb | [
"def",
"Adb",
"(",
"self",
")",
":",
"return",
"self",
".",
"_adb"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/android_commands.py#L206-L208 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | MHMessage.get_sequences | (self) | return self._sequences[:] | Return a list of sequences that include the message. | Return a list of sequences that include the message. | [
"Return",
"a",
"list",
"of",
"sequences",
"that",
"include",
"the",
"message",
"."
] | def get_sequences(self):
"""Return a list of sequences that include the message."""
return self._sequences[:] | [
"def",
"get_sequences",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sequences",
"[",
":",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1701-L1703 | |
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/scripts/cpp_lint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L3680-L3749 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | cleanupInputCallbacks | () | clears the entire input callback table. this includes the
compiled-in I/O. | clears the entire input callback table. this includes the
compiled-in I/O. | [
"clears",
"the",
"entire",
"input",
"callback",
"table",
".",
"this",
"includes",
"the",
"compiled",
"-",
"in",
"I",
"/",
"O",
"."
] | def cleanupInputCallbacks():
"""clears the entire input callback table. this includes the
compiled-in I/O. """
libxml2mod.xmlCleanupInputCallbacks() | [
"def",
"cleanupInputCallbacks",
"(",
")",
":",
"libxml2mod",
".",
"xmlCleanupInputCallbacks",
"(",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1873-L1876 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/transformed_distribution.py | python | TransformedDistribution._log_prob | (self, value, *args, **kwargs) | return self.select_base(isneginf,
self.select_base(
isnan, unadjust_prob + log_jacobian, unadjust_prob),
unadjust_prob + log_jacobian) | r"""
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) = \log(Px(g^{-1}(a))) + \log((g^{-1})'(a)) | r"""
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) = \log(Px(g^{-1}(a))) + \log((g^{-1})'(a)) | [
"r",
"..",
"math",
"::",
"Y",
"=",
"g",
"(",
"X",
")",
"Py",
"(",
"a",
")",
"=",
"Px",
"(",
"g^",
"{",
"-",
"1",
"}",
"(",
"a",
"))",
"*",
"(",
"g^",
"{",
"-",
"1",
"}",
")",
"(",
"a",
")",
"\\",
"log",
"(",
"Py",
"(",
"a",
"))",
... | def _log_prob(self, value, *args, **kwargs):
r"""
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) = \log(Px(g^{-1}(a))) + \log((g^{-1})'(a))
"""
inverse_value = self.bijector("inverse", value)
unadjust_prob = self.distributi... | [
"def",
"_log_prob",
"(",
"self",
",",
"value",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"inverse_value",
"=",
"self",
".",
"bijector",
"(",
"\"inverse\"",
",",
"value",
")",
"unadjust_prob",
"=",
"self",
".",
"distribution",
"(",
"\"log_prob\... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/transformed_distribution.py#L213-L229 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.DefaultConfiguration | (self) | return self.ConfigurationNamed(self._properties['defaultConfigurationName']) | Convenience accessor to obtain the default XCBuildConfiguration. | Convenience accessor to obtain the default XCBuildConfiguration. | [
"Convenience",
"accessor",
"to",
"obtain",
"the",
"default",
"XCBuildConfiguration",
"."
] | def DefaultConfiguration(self):
"""Convenience accessor to obtain the default XCBuildConfiguration."""
return self.ConfigurationNamed(self._properties['defaultConfigurationName']) | [
"def",
"DefaultConfiguration",
"(",
"self",
")",
":",
"return",
"self",
".",
"ConfigurationNamed",
"(",
"self",
".",
"_properties",
"[",
"'defaultConfigurationName'",
"]",
")"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py#L1612-L1614 | |
interpretml/interpret | 29466bffc04505fe4f836a83fcfebfd313ac8454 | python/interpret-core/interpret/perf/curve.py | python | PR.__init__ | (self, predict_fn, feature_names=None, feature_types=None, **kwargs) | Initializes class.
Args:
predict_fn: Function of blackbox that takes input, and returns prediction.
feature_names: List of feature names.
feature_types: List of feature types.
**kwargs: Currently unused. Due for deprecation. | Initializes class. | [
"Initializes",
"class",
"."
] | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
""" Initializes class.
Args:
predict_fn: Function of blackbox that takes input, and returns prediction.
feature_names: List of feature names.
feature_types: List of feature types.
... | [
"def",
"__init__",
"(",
"self",
",",
"predict_fn",
",",
"feature_names",
"=",
"None",
",",
"feature_types",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"predict_fn",
"=",
"predict_fn",
"self",
".",
"feature_names",
"=",
"feature_names",
"s... | https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/perf/curve.py#L18-L30 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/spatial/distance.py | python | minkowski | (u, v, p) | return dist | Computes the Minkowski distance between two 1-D arrays.
The Minkowski distance between 1-D arrays `u` and `v`,
is defined as
.. math::
{||u-v||}_p = (\\sum{|u_i - v_i|^p})^{1/p}.
Parameters
----------
u : (N,) array_like
Input array.
v : (N,) array_like
Input array... | Computes the Minkowski distance between two 1-D arrays. | [
"Computes",
"the",
"Minkowski",
"distance",
"between",
"two",
"1",
"-",
"D",
"arrays",
"."
] | def minkowski(u, v, p):
"""
Computes the Minkowski distance between two 1-D arrays.
The Minkowski distance between 1-D arrays `u` and `v`,
is defined as
.. math::
{||u-v||}_p = (\\sum{|u_i - v_i|^p})^{1/p}.
Parameters
----------
u : (N,) array_like
Input array.
v :... | [
"def",
"minkowski",
"(",
"u",
",",
"v",
",",
"p",
")",
":",
"u",
"=",
"_validate_vector",
"(",
"u",
")",
"v",
"=",
"_validate_vector",
"(",
"v",
")",
"if",
"p",
"<",
"1",
":",
"raise",
"ValueError",
"(",
"\"p must be at least 1\"",
")",
"dist",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/spatial/distance.py#L148-L179 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py | python | TimeSeriesReader.check_dataset_size | (self, minimum_dataset_size) | When possible, raises an error if the dataset is too small.
This method allows TimeSeriesReaders to raise informative error messages if
the user has selected a window size in their TimeSeriesInputFn which is
larger than the dataset size. However, many TimeSeriesReaders will not have
access to a dataset... | When possible, raises an error if the dataset is too small. | [
"When",
"possible",
"raises",
"an",
"error",
"if",
"the",
"dataset",
"is",
"too",
"small",
"."
] | def check_dataset_size(self, minimum_dataset_size):
"""When possible, raises an error if the dataset is too small.
This method allows TimeSeriesReaders to raise informative error messages if
the user has selected a window size in their TimeSeriesInputFn which is
larger than the dataset size. However, m... | [
"def",
"check_dataset_size",
"(",
"self",
",",
"minimum_dataset_size",
")",
":",
"pass"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py#L169-L183 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/intercept.py | python | setup_environment | (args, destination, bin_dir) | return environment | Sets up the environment for the build command.
It sets the required environment variables and execute the given command.
The exec calls will be logged by the 'libear' preloaded library or by the
'wrapper' programs. | Sets up the environment for the build command. | [
"Sets",
"up",
"the",
"environment",
"for",
"the",
"build",
"command",
"."
] | def setup_environment(args, destination, bin_dir):
""" Sets up the environment for the build command.
It sets the required environment variables and execute the given command.
The exec calls will be logged by the 'libear' preloaded library or by the
'wrapper' programs. """
c_compiler = args.cc if ... | [
"def",
"setup_environment",
"(",
"args",
",",
"destination",
",",
"bin_dir",
")",
":",
"c_compiler",
"=",
"args",
".",
"cc",
"if",
"'cc'",
"in",
"args",
"else",
"'cc'",
"cxx_compiler",
"=",
"args",
".",
"cxx",
"if",
"'cxx'",
"in",
"args",
"else",
"'c++'"... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/intercept.py#L115-L150 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/graphbuilder.py | python | Node.add_child | (self, child) | Add a child node. | Add a child node. | [
"Add",
"a",
"child",
"node",
"."
] | def add_child(self, child):
"""Add a child node."""
self._children.append(child) | [
"def",
"add_child",
"(",
"self",
",",
"child",
")",
":",
"self",
".",
"_children",
".",
"append",
"(",
"child",
")"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/graphbuilder.py#L188-L190 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/atom/__init__.py | python | Source.__init__ | (self, author=None, category=None, contributor=None,
generator=None, icon=None, atom_id=None, link=None, logo=None,
rights=None, subtitle=None, title=None, updated=None, text=None,
extension_elements=None, extension_attributes=None) | Constructor for Source
Args:
author: list (optional) A list of Author instances which belong to this
class.
category: list (optional) A list of Category instances
contributor: list (optional) A list on Contributor instances
generator: Generator (optional)
icon: Icon (optiona... | Constructor for Source | [
"Constructor",
"for",
"Source"
] | def __init__(self, author=None, category=None, contributor=None,
generator=None, icon=None, atom_id=None, link=None, logo=None,
rights=None, subtitle=None, title=None, updated=None, text=None,
extension_elements=None, extension_attributes=None):
"""Constructor for Source
Args:
author: l... | [
"def",
"__init__",
"(",
"self",
",",
"author",
"=",
"None",
",",
"category",
"=",
"None",
",",
"contributor",
"=",
"None",
",",
"generator",
"=",
"None",
",",
"icon",
"=",
"None",
",",
"atom_id",
"=",
"None",
",",
"link",
"=",
"None",
",",
"logo",
... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/atom/__init__.py#L1161-L1204 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Tools/c_config.py | python | get_define_comment | (self, key) | return coms.get(key, '') | Returns the comment associated to a define
:type key: string | Returns the comment associated to a define | [
"Returns",
"the",
"comment",
"associated",
"to",
"a",
"define"
] | def get_define_comment(self, key):
"""
Returns the comment associated to a define
:type key: string
"""
coms = self.env.DEFINE_COMMENTS or {}
return coms.get(key, '') | [
"def",
"get_define_comment",
"(",
"self",
",",
"key",
")",
":",
"coms",
"=",
"self",
".",
"env",
".",
"DEFINE_COMMENTS",
"or",
"{",
"}",
"return",
"coms",
".",
"get",
"(",
"key",
",",
"''",
")"
] | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Tools/c_config.py#L725-L732 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/D7YIGPositionCalibration.py | python | D7YIGPositionCalibration._fit_bragg_peaks | (self, ws, yig_peaks) | return conjoined_peak_fit_name, single_peak_fit_results_name | Fits peaks defined in the yig_peaks argument
returns a workspace with fitted peak positions
on the Y axis and the expected positions on the X axis | Fits peaks defined in the yig_peaks argument
returns a workspace with fitted peak positions
on the Y axis and the expected positions on the X axis | [
"Fits",
"peaks",
"defined",
"in",
"the",
"yig_peaks",
"argument",
"returns",
"a",
"workspace",
"with",
"fitted",
"peak",
"positions",
"on",
"the",
"Y",
"axis",
"and",
"the",
"expected",
"positions",
"on",
"the",
"X",
"axis"
] | def _fit_bragg_peaks(self, ws, yig_peaks):
""" Fits peaks defined in the yig_peaks argument
returns a workspace with fitted peak positions
on the Y axis and the expected positions on the X axis"""
fitting_method = self.getPropertyValue('FittingMethod')
max_n_peaks = len(max(yig_p... | [
"def",
"_fit_bragg_peaks",
"(",
"self",
",",
"ws",
",",
"yig_peaks",
")",
":",
"fitting_method",
"=",
"self",
".",
"getPropertyValue",
"(",
"'FittingMethod'",
")",
"max_n_peaks",
"=",
"len",
"(",
"max",
"(",
"yig_peaks",
",",
"key",
"=",
"len",
")",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/D7YIGPositionCalibration.py#L355-L442 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Canvas.find_above | (self, tagOrId) | return self.find('above', tagOrId) | Return items above TAGORID. | Return items above TAGORID. | [
"Return",
"items",
"above",
"TAGORID",
"."
] | def find_above(self, tagOrId):
"""Return items above TAGORID."""
return self.find('above', tagOrId) | [
"def",
"find_above",
"(",
"self",
",",
"tagOrId",
")",
":",
"return",
"self",
".",
"find",
"(",
"'above'",
",",
"tagOrId",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2294-L2296 | |
microsoft/LightGBM | 904b2d5158703c4900b68008617951dd2f9ff21b | python-package/lightgbm/plotting.py | python | plot_importance | (
booster: Union[Booster, LGBMModel],
ax=None,
height: float = 0.2,
xlim: Optional[Tuple[float, float]] = None,
ylim: Optional[Tuple[float, float]] = None,
title: Optional[str] = 'Feature importance',
xlabel: Optional[str] = 'Feature importance',
ylabel: Optional[str] = 'Features',
i... | return ax | Plot model's feature importances.
Parameters
----------
booster : Booster or LGBMModel
Booster or LGBMModel instance which feature importance should be plotted.
ax : matplotlib.axes.Axes or None, optional (default=None)
Target axes instance.
If None, new figure and axes will be ... | Plot model's feature importances. | [
"Plot",
"model",
"s",
"feature",
"importances",
"."
] | def plot_importance(
booster: Union[Booster, LGBMModel],
ax=None,
height: float = 0.2,
xlim: Optional[Tuple[float, float]] = None,
ylim: Optional[Tuple[float, float]] = None,
title: Optional[str] = 'Feature importance',
xlabel: Optional[str] = 'Feature importance',
ylabel: Optional[str] ... | [
"def",
"plot_importance",
"(",
"booster",
":",
"Union",
"[",
"Booster",
",",
"LGBMModel",
"]",
",",
"ax",
"=",
"None",
",",
"height",
":",
"float",
"=",
"0.2",
",",
"xlim",
":",
"Optional",
"[",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
"=",
"... | https://github.com/microsoft/LightGBM/blob/904b2d5158703c4900b68008617951dd2f9ff21b/python-package/lightgbm/plotting.py#L26-L159 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | BitVecNumRef.as_long | (self) | return int(self.as_string()) | Return a Z3 bit-vector numeral as a Python long (bignum) numeral.
>>> v = BitVecVal(0xbadc0de, 32)
>>> v
195936478
>>> print("0x%.8x" % v.as_long())
0x0badc0de | Return a Z3 bit-vector numeral as a Python long (bignum) numeral. | [
"Return",
"a",
"Z3",
"bit",
"-",
"vector",
"numeral",
"as",
"a",
"Python",
"long",
"(",
"bignum",
")",
"numeral",
"."
] | def as_long(self):
"""Return a Z3 bit-vector numeral as a Python long (bignum) numeral.
>>> v = BitVecVal(0xbadc0de, 32)
>>> v
195936478
>>> print("0x%.8x" % v.as_long())
0x0badc0de
"""
return int(self.as_string()) | [
"def",
"as_long",
"(",
"self",
")",
":",
"return",
"int",
"(",
"self",
".",
"as_string",
"(",
")",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L3868-L3877 | |
VowpalWabbit/vowpal_wabbit | 866b8fa88ff85a957c7eb72065ea44518b9ba416 | python/vowpalwabbit/dftovw.py | python | SimpleLabel.__init__ | (self, label: Hashable, weight: Optional[Hashable] = None) | Initialize a SimpleLabel instance.
Args:
label: The column name with the label.
weight: The column name with the weight. | Initialize a SimpleLabel instance. | [
"Initialize",
"a",
"SimpleLabel",
"instance",
"."
] | def __init__(self, label: Hashable, weight: Optional[Hashable] = None):
"""Initialize a SimpleLabel instance.
Args:
label: The column name with the label.
weight: The column name with the weight.
"""
self.label = label
self.weight = weight | [
"def",
"__init__",
"(",
"self",
",",
"label",
":",
"Hashable",
",",
"weight",
":",
"Optional",
"[",
"Hashable",
"]",
"=",
"None",
")",
":",
"self",
".",
"label",
"=",
"label",
"self",
".",
"weight",
"=",
"weight"
] | https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/dftovw.py#L221-L229 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/cell.py | python | InputCell.fetch | (self) | return Cell(h=h) | Creates a cell object.
Returns:
A cell object of the appropriate type and with the appropriate
properties given the attributes of the InputCell object. | Creates a cell object. | [
"Creates",
"a",
"cell",
"object",
"."
] | def fetch(self):
"""Creates a cell object.
Returns:
A cell object of the appropriate type and with the appropriate
properties given the attributes of the InputCell object.
"""
h = super(InputCell,self).fetch()
h.shape = (3,3)
return Cell(h=h) | [
"def",
"fetch",
"(",
"self",
")",
":",
"h",
"=",
"super",
"(",
"InputCell",
",",
"self",
")",
".",
"fetch",
"(",
")",
"h",
".",
"shape",
"=",
"(",
"3",
",",
"3",
")",
"return",
"Cell",
"(",
"h",
"=",
"h",
")"
] | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/cell.py#L66-L77 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/bccache.py | python | BytecodeCache.dump_bytecode | (self, bucket) | Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception. | Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception. | [
"Subclasses",
"have",
"to",
"override",
"this",
"method",
"to",
"write",
"the",
"bytecode",
"from",
"a",
"bucket",
"back",
"to",
"the",
"cache",
".",
"If",
"it",
"unable",
"to",
"do",
"so",
"it",
"must",
"not",
"fail",
"silently",
"but",
"raise",
"an",
... | def dump_bytecode(self, bucket):
"""Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception.
"""
raise NotImplementedError() | [
"def",
"dump_bytecode",
"(",
"self",
",",
"bucket",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/bccache.py#L153-L158 | ||
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/core.py | python | Node._update_appearance | (self) | !
Update the node aspect to reflect the selected/highlighted state
@param self: class object.
@return none | !
Update the node aspect to reflect the selected/highlighted state | [
"!",
"Update",
"the",
"node",
"aspect",
"to",
"reflect",
"the",
"selected",
"/",
"highlighted",
"state"
] | def _update_appearance(self):
"""!
Update the node aspect to reflect the selected/highlighted state
@param self: class object.
@return none
"""
size = transform_distance_simulation_to_canvas(self._size)
if self.svg_item is not None:
alpha = 0x80
... | [
"def",
"_update_appearance",
"(",
"self",
")",
":",
"size",
"=",
"transform_distance_simulation_to_canvas",
"(",
"self",
".",
"_size",
")",
"if",
"self",
".",
"svg_item",
"is",
"not",
"None",
":",
"alpha",
"=",
"0x80",
"else",
":",
"alpha",
"=",
"0xff",
"f... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/core.py#L362-L401 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | PolicySignedResponse.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(PolicySignedResponse) | Returns new PolicySignedResponse object constructed from its
marshaled representation in the given byte buffer | Returns new PolicySignedResponse object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"PolicySignedResponse",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new PolicySignedResponse object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(PolicySignedResponse) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"PolicySignedResponse",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L14238-L14242 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/Dice3DS/dom3ds.py | python | write_3ds_mem | (dom,check_magic=True) | return struct.pack("<HL",dom.tag,length) + s | Output a 3DS DOM as a string.
buf = write_3ds_mem(dom,check_magic=True)
dom: the 3DS dom
check_magic: If true, this function checks that the top level
chunk is the 3DS magic chunk (0x4D4D), and raises an exception
if it is not. | Output a 3DS DOM as a string. | [
"Output",
"a",
"3DS",
"DOM",
"as",
"a",
"string",
"."
] | def write_3ds_mem(dom,check_magic=True):
"""Output a 3DS DOM as a string.
buf = write_3ds_mem(dom,check_magic=True)
dom: the 3DS dom
check_magic: If true, this function checks that the top level
chunk is the 3DS magic chunk (0x4D4D), and raises an exception
if it is not.
"""
if ... | [
"def",
"write_3ds_mem",
"(",
"dom",
",",
"check_magic",
"=",
"True",
")",
":",
"if",
"check_magic",
"and",
"dom",
".",
"tag",
"!=",
"0x4D4D",
":",
"raise",
"File3dsFormatError",
"(",
"\"Not a 3D Studio file.\"",
")",
"s",
"=",
"dom",
".",
"write",
"(",
")"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/Dice3DS/dom3ds.py#L1790-L1807 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/python_gflags/gflags_validators.py | python | Validator.GetFlagsNames | (self) | Return the names of the flags checked by this validator.
Returns:
[string], names of the flags | Return the names of the flags checked by this validator. | [
"Return",
"the",
"names",
"of",
"the",
"flags",
"checked",
"by",
"this",
"validator",
"."
] | def GetFlagsNames(self):
"""Return the names of the flags checked by this validator.
Returns:
[string], names of the flags
"""
raise NotImplementedError('This method should be overloaded') | [
"def",
"GetFlagsNames",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"'This method should be overloaded'",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/python_gflags/gflags_validators.py#L83-L89 | ||
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | var/assets/clients/gen-py/clause/Serving.py | python | Iface.getSlots | (self, request) | Parameters:
- request | Parameters:
- request | [
"Parameters",
":",
"-",
"request"
] | def getSlots(self, request):
"""
Parameters:
- request
"""
pass | [
"def",
"getSlots",
"(",
"self",
",",
"request",
")",
":",
"pass"
] | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L262-L268 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/saver.py | python | Saver._MetaGraphFilename | (self, checkpoint_filename, meta_graph_suffix="meta") | return meta_graph_filename | Returns the meta graph filename.
Args:
checkpoint_filename: Name of the checkpoint file.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
Returns:
MetaGraph file name. | Returns the meta graph filename. | [
"Returns",
"the",
"meta",
"graph",
"filename",
"."
] | def _MetaGraphFilename(self, checkpoint_filename, meta_graph_suffix="meta"):
"""Returns the meta graph filename.
Args:
checkpoint_filename: Name of the checkpoint file.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
Returns:
MetaGraph file name.
"""
# If t... | [
"def",
"_MetaGraphFilename",
"(",
"self",
",",
"checkpoint_filename",
",",
"meta_graph_suffix",
"=",
"\"meta\"",
")",
":",
"# If the checkpoint_filename is sharded, the checkpoint_filename could",
"# be of format model.ckpt-step#-?????-of-shard#. For example,",
"# model.ckpt-123456-?????... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/saver.py#L890-L905 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python/xla_client.py | python | ComputationBuilder.Trans | (self, operand) | return ops.Transpose(operand, [1, 0]) | Specialized matrix transpose op. | Specialized matrix transpose op. | [
"Specialized",
"matrix",
"transpose",
"op",
"."
] | def Trans(self, operand):
"""Specialized matrix transpose op."""
return ops.Transpose(operand, [1, 0]) | [
"def",
"Trans",
"(",
"self",
",",
"operand",
")",
":",
"return",
"ops",
".",
"Transpose",
"(",
"operand",
",",
"[",
"1",
",",
"0",
"]",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python/xla_client.py#L994-L996 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/tensor.py | python | Tensor.deepcopy | (self) | return self.clone() | Same as clone().
Returns:
a new Tensor | Same as clone(). | [
"Same",
"as",
"clone",
"()",
"."
] | def deepcopy(self):
'''Same as clone().
Returns:
a new Tensor
'''
return self.clone() | [
"def",
"deepcopy",
"(",
"self",
")",
":",
"return",
"self",
".",
"clone",
"(",
")"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/tensor.py#L488-L494 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | AuiNotebook.FloatPage | (self, page_index) | Float the page in `page_index` by reparenting it to a floating frame.
:param integer `page_index`: the index of the page to be floated.
.. warning::
When the notebook is more or less full screen, tabs cannot be dragged far
enough outside of the notebook to become floating pages. | Float the page in `page_index` by reparenting it to a floating frame. | [
"Float",
"the",
"page",
"in",
"page_index",
"by",
"reparenting",
"it",
"to",
"a",
"floating",
"frame",
"."
] | def FloatPage(self, page_index):
"""
Float the page in `page_index` by reparenting it to a floating frame.
:param integer `page_index`: the index of the page to be floated.
.. warning::
When the notebook is more or less full screen, tabs cannot be dragged far
eno... | [
"def",
"FloatPage",
"(",
"self",
",",
"page_index",
")",
":",
"root_manager",
"=",
"framemanager",
".",
"GetManager",
"(",
"self",
")",
"page_title",
"=",
"self",
".",
"GetPageText",
"(",
"page_index",
")",
"page_contents",
"=",
"self",
".",
"GetPage",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L5114-L5187 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | Symbol.list_inputs | (self) | return [py_str(sarr[i]) for i in range(size.value)] | Lists all arguments and auxiliary states of this Symbol.
Returns
-------
inputs : list of str
List of all inputs.
Examples
--------
>>> bn = mx.sym.BatchNorm(name='bn')
>>> bn.list_arguments()
['bn_data', 'bn_gamma', 'bn_beta']
>>> bn... | Lists all arguments and auxiliary states of this Symbol. | [
"Lists",
"all",
"arguments",
"and",
"auxiliary",
"states",
"of",
"this",
"Symbol",
"."
] | def list_inputs(self):
"""Lists all arguments and auxiliary states of this Symbol.
Returns
-------
inputs : list of str
List of all inputs.
Examples
--------
>>> bn = mx.sym.BatchNorm(name='bn')
>>> bn.list_arguments()
['bn_data', 'bn... | [
"def",
"list_inputs",
"(",
"self",
")",
":",
"size",
"=",
"ctypes",
".",
"c_uint",
"(",
")",
"sarr",
"=",
"ctypes",
".",
"POINTER",
"(",
"ctypes",
".",
"c_char_p",
")",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"NNSymbolListInputNames",
"(",
"self",
".... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L818-L840 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.__reversed__ | (self) | od.__reversed__() <==> reversed(od) | od.__reversed__() <==> reversed(od) | [
"od",
".",
"__reversed__",
"()",
"<",
"==",
">",
"reversed",
"(",
"od",
")"
] | def __reversed__(self):
'od.__reversed__() <==> reversed(od)'
root = self.__root
curr = root[0]
while curr is not root:
yield curr[2]
curr = curr[0] | [
"def",
"__reversed__",
"(",
"self",
")",
":",
"root",
"=",
"self",
".",
"__root",
"curr",
"=",
"root",
"[",
"0",
"]",
"while",
"curr",
"is",
"not",
"root",
":",
"yield",
"curr",
"[",
"2",
"]",
"curr",
"=",
"curr",
"[",
"0",
"]"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py#L98-L104 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/debugger.py | python | Pdb._is_in_decorator_internal_and_should_skip | (self, frame) | return False | Utility to tell us whether we are in a decorator internal and should stop. | Utility to tell us whether we are in a decorator internal and should stop. | [
"Utility",
"to",
"tell",
"us",
"whether",
"we",
"are",
"in",
"a",
"decorator",
"internal",
"and",
"should",
"stop",
"."
] | def _is_in_decorator_internal_and_should_skip(self, frame):
"""
Utility to tell us whether we are in a decorator internal and should stop.
"""
# if we are disabled don't skip
if not self._predicates["debuggerskip"]:
return False
# if frame is tagged, skip... | [
"def",
"_is_in_decorator_internal_and_should_skip",
"(",
"self",
",",
"frame",
")",
":",
"# if we are disabled don't skip",
"if",
"not",
"self",
".",
"_predicates",
"[",
"\"debuggerskip\"",
"]",
":",
"return",
"False",
"# if frame is tagged, skip by default.",
"if",
"DEBU... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/debugger.py#L913-L937 | |
isc-projects/kea | c5836c791b63f42173bb604dd5f05d7110f3e716 | src/bin/shell/kea_connector3.py | python | send_to_control_agent | (params) | return result | Sends a request to Control Agent, receives a response and returns it. | Sends a request to Control Agent, receives a response and returns it. | [
"Sends",
"a",
"request",
"to",
"Control",
"Agent",
"receives",
"a",
"response",
"and",
"returns",
"it",
"."
] | def send_to_control_agent(params):
""" Sends a request to Control Agent, receives a response and returns it."""
# First, create the URL
url = params.scheme + "://" + params.http_host + ":"
url += str(params.http_port) + str(params.path)
# Now prepare the request (URL, headers and body)
req = u... | [
"def",
"send_to_control_agent",
"(",
"params",
")",
":",
"# First, create the URL",
"url",
"=",
"params",
".",
"scheme",
"+",
"\"://\"",
"+",
"params",
".",
"http_host",
"+",
"\":\"",
"url",
"+=",
"str",
"(",
"params",
".",
"http_port",
")",
"+",
"str",
"(... | https://github.com/isc-projects/kea/blob/c5836c791b63f42173bb604dd5f05d7110f3e716/src/bin/shell/kea_connector3.py#L17-L50 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py | python | proxy_bypass_environment | (host, proxies=None) | return False | Test if proxies should not be used for a particular host.
Checks the proxy dict for the value of no_proxy, which should
be a list of comma separated DNS suffixes, or '*' for all hosts. | Test if proxies should not be used for a particular host. | [
"Test",
"if",
"proxies",
"should",
"not",
"be",
"used",
"for",
"a",
"particular",
"host",
"."
] | def proxy_bypass_environment(host, proxies=None):
"""Test if proxies should not be used for a particular host.
Checks the proxy dict for the value of no_proxy, which should
be a list of comma separated DNS suffixes, or '*' for all hosts.
"""
if proxies is None:
proxies = getproxies_environ... | [
"def",
"proxy_bypass_environment",
"(",
"host",
",",
"proxies",
"=",
"None",
")",
":",
"if",
"proxies",
"is",
"None",
":",
"proxies",
"=",
"getproxies_environment",
"(",
")",
"# don't bypass, if no_proxy isn't specified",
"try",
":",
"no_proxy",
"=",
"proxies",
"[... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py#L2520-L2552 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py | python | DrillSample.setGroup | (self, group) | Set the group and index of the sample.
Args:
group (DrillSampleGroup): group. None if the sample is not in a
group. | Set the group and index of the sample. | [
"Set",
"the",
"group",
"and",
"index",
"of",
"the",
"sample",
"."
] | def setGroup(self, group):
"""
Set the group and index of the sample.
Args:
group (DrillSampleGroup): group. None if the sample is not in a
group.
"""
self._group = group
self.groupChanged.emit() | [
"def",
"setGroup",
"(",
"self",
",",
"group",
")",
":",
"self",
".",
"_group",
"=",
"group",
"self",
".",
"groupChanged",
".",
"emit",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py#L153-L162 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | locatedExpr | (expr) | return Group(locator("locn_start") + expr("value") + locator.copy().leaveWhitespace()("locn_end")) | Helper to decorate a returned token with its starting and ending locations in the input string.
This helper adds the following results names:
- locn_start = location where matched expression begins
- locn_end = location where matched expression ends
- value = the actual parsed results
Be c... | [] | def locatedExpr(expr):
"""
Helper to decorate a returned token with its starting and ending locations in the input string.
This helper adds the following results names:
- locn_start = location where matched expression begins
- locn_end = location where matched expression ends
- value = ... | [
"def",
"locatedExpr",
"(",
"expr",
")",
":",
"locator",
"=",
"Empty",
"(",
")",
".",
"setParseAction",
"(",
"lambda",
"s",
",",
"l",
",",
"t",
":",
"l",
")",
"return",
"Group",
"(",
"locator",
"(",
"\"locn_start\"",
")",
"+",
"expr",
"(",
"\"value\""... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L9449-L9491 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py | python | MouseHandlers.set_mouse_handler_for_range | (self, x_min, x_max, y_min, y_max, handler=None) | Set mouse handler for a region. | Set mouse handler for a region. | [
"Set",
"mouse",
"handler",
"for",
"a",
"region",
"."
] | def set_mouse_handler_for_range(self, x_min, x_max, y_min, y_max, handler=None):
"""
Set mouse handler for a region.
"""
for x, y in product(range(x_min, x_max), range(y_min, y_max)):
self.mouse_handlers[x,y] = handler | [
"def",
"set_mouse_handler_for_range",
"(",
"self",
",",
"x_min",
",",
"x_max",
",",
"y_min",
",",
"y_max",
",",
"handler",
"=",
"None",
")",
":",
"for",
"x",
",",
"y",
"in",
"product",
"(",
"range",
"(",
"x_min",
",",
"x_max",
")",
",",
"range",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py#L24-L29 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/bdist_rpm.py | python | bdist_rpm._make_spec_file | (self) | return spec_file | Generate the text of an RPM spec file and return it as a
list of strings (one per line). | Generate the text of an RPM spec file and return it as a
list of strings (one per line). | [
"Generate",
"the",
"text",
"of",
"an",
"RPM",
"spec",
"file",
"and",
"return",
"it",
"as",
"a",
"list",
"of",
"strings",
"(",
"one",
"per",
"line",
")",
"."
] | def _make_spec_file(self):
"""Generate the text of an RPM spec file and return it as a
list of strings (one per line).
"""
# definitions and headers
spec_file = [
'%define name ' + self.distribution.get_name(),
'%define version ' + self.distribution.get_ve... | [
"def",
"_make_spec_file",
"(",
"self",
")",
":",
"# definitions and headers",
"spec_file",
"=",
"[",
"'%define name '",
"+",
"self",
".",
"distribution",
".",
"get_name",
"(",
")",
",",
"'%define version '",
"+",
"self",
".",
"distribution",
".",
"get_version",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/bdist_rpm.py#L409-L560 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/serialjava.py | python | Serial.ri | (self) | Read terminal status line: Ring Indicator | Read terminal status line: Ring Indicator | [
"Read",
"terminal",
"status",
"line",
":",
"Ring",
"Indicator"
] | def ri(self):
"""Read terminal status line: Ring Indicator"""
if not self.sPort:
raise portNotOpenError
self.sPort.isRI() | [
"def",
"ri",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"sPort",
":",
"raise",
"portNotOpenError",
"self",
".",
"sPort",
".",
"isRI",
"(",
")"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/serialjava.py#L238-L242 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/flush.py | python | _FlushThread.signal_shutdown | (self) | Indicate to the flush thread that it should exit.
This will happen once its current queue of logging handlers are flushed and closed. | Indicate to the flush thread that it should exit. | [
"Indicate",
"to",
"the",
"flush",
"thread",
"that",
"it",
"should",
"exit",
"."
] | def signal_shutdown(self):
"""Indicate to the flush thread that it should exit.
This will happen once its current queue of logging handlers are flushed and closed.
"""
self.__should_stop.set()
# Signal the flush thread to wake up as though there is more work for it to do since... | [
"def",
"signal_shutdown",
"(",
"self",
")",
":",
"self",
".",
"__should_stop",
".",
"set",
"(",
")",
"# Signal the flush thread to wake up as though there is more work for it to do since we're",
"# trying to get it to exit.",
"self",
".",
"__schedule_updated",
".",
"set",
"("... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/flush.py#L129-L139 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/flatnotebook.py | python | FNBRendererVC71.__init__ | (self) | Default class constructor. | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self):
""" Default class constructor. """
FNBRenderer.__init__(self) | [
"def",
"__init__",
"(",
"self",
")",
":",
"FNBRenderer",
".",
"__init__",
"(",
"self",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L2236-L2239 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/XRCed/component.py | python | _ComponentManager.addExternal | (self, f) | Add an external resource file f to the list of preloaded
resources. | Add an external resource file f to the list of preloaded
resources. | [
"Add",
"an",
"external",
"resource",
"file",
"f",
"to",
"the",
"list",
"of",
"preloaded",
"resources",
"."
] | def addExternal(self, f):
'''Add an external resource file f to the list of preloaded
resources.'''
self.external.append(f)
Model.addExternal(f) | [
"def",
"addExternal",
"(",
"self",
",",
"f",
")",
":",
"self",
".",
"external",
".",
"append",
"(",
"f",
")",
"Model",
".",
"addExternal",
"(",
"f",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/component.py#L769-L773 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_checkparam.py | python | Validator.check_bool | (arg_value, arg_name=None, prim_name=None) | return arg_value | Check argument is instance of bool.
Usage:
- has_bias = check_bool(has_bias)
- has_bias = check_bool(has_bias, "has_bias") | Check argument is instance of bool. | [
"Check",
"argument",
"is",
"instance",
"of",
"bool",
"."
] | def check_bool(arg_value, arg_name=None, prim_name=None):
"""
Check argument is instance of bool.
Usage:
- has_bias = check_bool(has_bias)
- has_bias = check_bool(has_bias, "has_bias")
"""
if not isinstance(arg_value, bool):
prim_name = f"For '{prim_n... | [
"def",
"check_bool",
"(",
"arg_value",
",",
"arg_name",
"=",
"None",
",",
"prim_name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"arg_value",
",",
"bool",
")",
":",
"prim_name",
"=",
"f\"For '{prim_name}', the\"",
"if",
"prim_name",
"else",
"'Th... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_checkparam.py#L390-L402 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuItem.GetLabelText | (*args, **kwargs) | return _core_.MenuItem_GetLabelText(*args, **kwargs) | GetLabelText(String label) -> String | GetLabelText(String label) -> String | [
"GetLabelText",
"(",
"String",
"label",
")",
"-",
">",
"String"
] | def GetLabelText(*args, **kwargs):
"""GetLabelText(String label) -> String"""
return _core_.MenuItem_GetLabelText(*args, **kwargs) | [
"def",
"GetLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12475-L12477 | |
apache/incubator-weex | 5c25f0b59f7ac90703c363e7261f60bd06356dbe | weex_core/tools/cpplint.py | python | _CppLintState.SetVerboseLevel | (self, level) | return last_verbose_level | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def SetVerboseLevel(self, level):
"""Sets the module's verbosity, and returns the previous setting."""
last_verbose_level = self.verbose_level
self.verbose_level = level
return last_verbose_level | [
"def",
"SetVerboseLevel",
"(",
"self",
",",
"level",
")",
":",
"last_verbose_level",
"=",
"self",
".",
"verbose_level",
"self",
".",
"verbose_level",
"=",
"level",
"return",
"last_verbose_level"
] | https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L891-L895 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_schema_compiler/model.py | python | UnixName | (name) | return ''.join(unix_name) | Returns the unix_style name for a given lowerCamelCase string. | Returns the unix_style name for a given lowerCamelCase string. | [
"Returns",
"the",
"unix_style",
"name",
"for",
"a",
"given",
"lowerCamelCase",
"string",
"."
] | def UnixName(name):
'''Returns the unix_style name for a given lowerCamelCase string.
'''
unix_name = []
for i, c in enumerate(name):
if c.isupper() and i > 0 and name[i - 1] != '_':
# Replace lowerUpper with lower_Upper.
if name[i - 1].islower():
unix_name.append('_')
# Replace AC... | [
"def",
"UnixName",
"(",
"name",
")",
":",
"unix_name",
"=",
"[",
"]",
"for",
"i",
",",
"c",
"in",
"enumerate",
"(",
"name",
")",
":",
"if",
"c",
".",
"isupper",
"(",
")",
"and",
"i",
">",
"0",
"and",
"name",
"[",
"i",
"-",
"1",
"]",
"!=",
"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/model.py#L466-L484 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/_tokenize_py2.py | python | tokenize | (readline, tokeneater=printtoken) | The tokenize() function accepts two parameters: one representing the
input stream, and one providing an output mechanism for tokenize().
The first parameter, readline, must be a callable object which provides
the same interface as the readline() method of built-in file objects.
Each call to the functio... | The tokenize() function accepts two parameters: one representing the
input stream, and one providing an output mechanism for tokenize(). | [
"The",
"tokenize",
"()",
"function",
"accepts",
"two",
"parameters",
":",
"one",
"representing",
"the",
"input",
"stream",
"and",
"one",
"providing",
"an",
"output",
"mechanism",
"for",
"tokenize",
"()",
"."
] | def tokenize(readline, tokeneater=printtoken):
"""
The tokenize() function accepts two parameters: one representing the
input stream, and one providing an output mechanism for tokenize().
The first parameter, readline, must be a callable object which provides
the same interface as the readline() me... | [
"def",
"tokenize",
"(",
"readline",
",",
"tokeneater",
"=",
"printtoken",
")",
":",
"try",
":",
"tokenize_loop",
"(",
"readline",
",",
"tokeneater",
")",
"except",
"StopTokenizing",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/_tokenize_py2.py#L168-L184 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.