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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert-gpu/modeling.py | python | get_activation | (activation_string) | Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`.
Args:
activation_string: String name of the activation function.
Returns:
A Python function corresponding to the activation function. If
`activation_string` is None, empty, or "linear", this will return None.
If `activation_string` ... | Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`. | [
"Maps",
"a",
"string",
"to",
"a",
"Python",
"function",
"e",
".",
"g",
".",
"relu",
"=",
">",
"tf",
".",
"nn",
".",
"relu",
"."
] | def get_activation(activation_string):
"""Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`.
Args:
activation_string: String name of the activation function.
Returns:
A Python function corresponding to the activation function. If
`activation_string` is None, empty, or "linear", this w... | [
"def",
"get_activation",
"(",
"activation_string",
")",
":",
"# We assume that anything that\"s not a string is already an activation",
"# function, so we just return it.",
"if",
"not",
"isinstance",
"(",
"activation_string",
",",
"six",
".",
"string_types",
")",
":",
"return",... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/modeling.py#L288-L322 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/run.py | python | main | () | return action.execute(known_args) | Parses network folders and responsible for passing --help flags to subcommands if --network is provided.
Returns:
None | Parses network folders and responsible for passing --help flags to subcommands if --network is provided. | [
"Parses",
"network",
"folders",
"and",
"responsible",
"for",
"passing",
"--",
"help",
"flags",
"to",
"subcommands",
"if",
"--",
"network",
"is",
"provided",
"."
] | def main() -> None:
"""
Parses network folders and responsible for passing --help flags to subcommands if --network is provided.
Returns:
None
"""
# Get all available network scripts
networks = register_network_folders(os.getcwd())
# Add network folder for entry point
descripti... | [
"def",
"main",
"(",
")",
"->",
"None",
":",
"# Get all available network scripts",
"networks",
"=",
"register_network_folders",
"(",
"os",
".",
"getcwd",
"(",
")",
")",
"# Add network folder for entry point",
"description",
"=",
"\"Runs TensorRT networks that are based-off ... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/run.py#L231-L251 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MouseEvent.Aux1Down | (*args, **kwargs) | return _core_.MouseEvent_Aux1Down(*args, **kwargs) | Aux1Down(self) -> bool
Returns true if the AUX1 mouse button state changed to down. | Aux1Down(self) -> bool | [
"Aux1Down",
"(",
"self",
")",
"-",
">",
"bool"
] | def Aux1Down(*args, **kwargs):
"""
Aux1Down(self) -> bool
Returns true if the AUX1 mouse button state changed to down.
"""
return _core_.MouseEvent_Aux1Down(*args, **kwargs) | [
"def",
"Aux1Down",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseEvent_Aux1Down",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L5649-L5655 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/utils.py | python | iter_token_lines | (tokenlist) | Iterator that yields tokenlists for each line. | Iterator that yields tokenlists for each line. | [
"Iterator",
"that",
"yields",
"tokenlists",
"for",
"each",
"line",
"."
] | def iter_token_lines(tokenlist):
"""
Iterator that yields tokenlists for each line.
"""
line = []
for token, c in explode_tokens(tokenlist):
line.append((token, c))
if c == '\n':
yield line
line = []
yield line | [
"def",
"iter_token_lines",
"(",
"tokenlist",
")",
":",
"line",
"=",
"[",
"]",
"for",
"token",
",",
"c",
"in",
"explode_tokens",
"(",
"tokenlist",
")",
":",
"line",
".",
"append",
"(",
"(",
"token",
",",
"c",
")",
")",
"if",
"c",
"==",
"'\\n'",
":",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/utils.py#L47-L59 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/rrule.py | python | rrulebase.xafter | (self, dt, count=None, inc=False) | Generator which yields up to `count` recurrences after the given
datetime instance, equivalent to `after`.
:param dt:
The datetime at which to start generating recurrences.
:param count:
The maximum number of recurrences to generate. If `None` (default),
dat... | Generator which yields up to `count` recurrences after the given
datetime instance, equivalent to `after`. | [
"Generator",
"which",
"yields",
"up",
"to",
"count",
"recurrences",
"after",
"the",
"given",
"datetime",
"instance",
"equivalent",
"to",
"after",
"."
] | def xafter(self, dt, count=None, inc=False):
"""
Generator which yields up to `count` recurrences after the given
datetime instance, equivalent to `after`.
:param dt:
The datetime at which to start generating recurrences.
:param count:
The maximum number... | [
"def",
"xafter",
"(",
"self",
",",
"dt",
",",
"count",
"=",
"None",
",",
"inc",
"=",
"False",
")",
":",
"if",
"self",
".",
"_cache_complete",
":",
"gen",
"=",
"self",
".",
"_cache",
"else",
":",
"gen",
"=",
"self",
"# Select the comparison function",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/rrule.py#L228-L267 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/queue_runner_impl.py | python | QueueRunner.exceptions_raised | (self) | return self._exceptions_raised | Exceptions raised but not handled by the `QueueRunner` threads.
Exceptions raised in queue runner threads are handled in one of two ways
depending on whether or not a `Coordinator` was passed to
`create_threads()`:
* With a `Coordinator`, exceptions are reported to the coordinator and
forgotten ... | Exceptions raised but not handled by the `QueueRunner` threads. | [
"Exceptions",
"raised",
"but",
"not",
"handled",
"by",
"the",
"QueueRunner",
"threads",
"."
] | def exceptions_raised(self):
"""Exceptions raised but not handled by the `QueueRunner` threads.
Exceptions raised in queue runner threads are handled in one of two ways
depending on whether or not a `Coordinator` was passed to
`create_threads()`:
* With a `Coordinator`, exceptions are reported to ... | [
"def",
"exceptions_raised",
"(",
"self",
")",
":",
"return",
"self",
".",
"_exceptions_raised"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/queue_runner_impl.py#L196-L212 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/labeled_tensor/python/ops/core.py | python | _find_consistent_ordering | (a, b) | return ordering | Find the left-most consistent ordering between two lists of unique items.
A consistent ordering combines all elements in both a and b while keeping all
elements in their original order in both inputs. The left-most consistent
ordering orders elements from `a` not found in `b` before elements in `b` not
found i... | Find the left-most consistent ordering between two lists of unique items. | [
"Find",
"the",
"left",
"-",
"most",
"consistent",
"ordering",
"between",
"two",
"lists",
"of",
"unique",
"items",
"."
] | def _find_consistent_ordering(a, b):
"""Find the left-most consistent ordering between two lists of unique items.
A consistent ordering combines all elements in both a and b while keeping all
elements in their original order in both inputs. The left-most consistent
ordering orders elements from `a` not found i... | [
"def",
"_find_consistent_ordering",
"(",
"a",
",",
"b",
")",
":",
"a_set",
"=",
"set",
"(",
"a",
")",
"b_set",
"=",
"set",
"(",
"b",
")",
"i",
"=",
"0",
"j",
"=",
"0",
"ordering",
"=",
"[",
"]",
"while",
"i",
"<",
"len",
"(",
"a",
")",
"and",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/labeled_tensor/python/ops/core.py#L916-L960 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/connection.py | python | Listener.accept | (self) | return c | Accept a connection on the bound socket or named pipe of `self`.
Returns a `Connection` object. | Accept a connection on the bound socket or named pipe of `self`. | [
"Accept",
"a",
"connection",
"on",
"the",
"bound",
"socket",
"or",
"named",
"pipe",
"of",
"self",
"."
] | def accept(self):
'''
Accept a connection on the bound socket or named pipe of `self`.
Returns a `Connection` object.
'''
c = self._listener.accept()
if self._authkey:
deliver_challenge(c, self._authkey)
answer_challenge(c, self._authkey)
... | [
"def",
"accept",
"(",
"self",
")",
":",
"c",
"=",
"self",
".",
"_listener",
".",
"accept",
"(",
")",
"if",
"self",
".",
"_authkey",
":",
"deliver_challenge",
"(",
"c",
",",
"self",
".",
"_authkey",
")",
"answer_challenge",
"(",
"c",
",",
"self",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/connection.py#L139-L149 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/imaplib.py | python | IMAP4.login | (self, user, password) | return typ, dat | Identify client using plaintext password.
(typ, [data]) = <instance>.login(user, password)
NB: 'password' will be quoted. | Identify client using plaintext password. | [
"Identify",
"client",
"using",
"plaintext",
"password",
"."
] | def login(self, user, password):
"""Identify client using plaintext password.
(typ, [data]) = <instance>.login(user, password)
NB: 'password' will be quoted.
"""
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
if typ != 'OK':
raise self... | [
"def",
"login",
"(",
"self",
",",
"user",
",",
"password",
")",
":",
"typ",
",",
"dat",
"=",
"self",
".",
"_simple_command",
"(",
"'LOGIN'",
",",
"user",
",",
"self",
".",
"_quote",
"(",
"password",
")",
")",
"if",
"typ",
"!=",
"'OK'",
":",
"raise"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imaplib.py#L603-L614 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | filled | (a, fill_value=None) | Return input as an array with masked data replaced by a fill value.
If `a` is not a `MaskedArray`, `a` itself is returned.
If `a` is a `MaskedArray` and `fill_value` is None, `fill_value` is set to
``a.fill_value``.
Parameters
----------
a : MaskedArray or array_like
An input object.
... | Return input as an array with masked data replaced by a fill value. | [
"Return",
"input",
"as",
"an",
"array",
"with",
"masked",
"data",
"replaced",
"by",
"a",
"fill",
"value",
"."
] | def filled(a, fill_value=None):
"""
Return input as an array with masked data replaced by a fill value.
If `a` is not a `MaskedArray`, `a` itself is returned.
If `a` is a `MaskedArray` and `fill_value` is None, `fill_value` is set to
``a.fill_value``.
Parameters
----------
a : MaskedAr... | [
"def",
"filled",
"(",
"a",
",",
"fill_value",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"a",
",",
"'filled'",
")",
":",
"return",
"a",
".",
"filled",
"(",
"fill_value",
")",
"elif",
"isinstance",
"(",
"a",
",",
"ndarray",
")",
":",
"# Should we ch... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L532-L575 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/protocols.py | python | DatagramProtocol.error_received | (self, exc) | Called when a send or receive operation raises an OSError.
(Other than BlockingIOError or InterruptedError.) | Called when a send or receive operation raises an OSError. | [
"Called",
"when",
"a",
"send",
"or",
"receive",
"operation",
"raises",
"an",
"OSError",
"."
] | def error_received(self, exc):
"""Called when a send or receive operation raises an OSError.
(Other than BlockingIOError or InterruptedError.)
""" | [
"def",
"error_received",
"(",
"self",
",",
"exc",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/protocols.py#L166-L170 | ||
garbear/kodi-steamlink | 3f8e5970b01607cdb3c2688fbaa78e08f2d9c561 | tools/EventClients/lib/python/xbmcclient.py | python | XBMCClient.send_action | (self, actionmessage="", actiontype=ACTION_EXECBUILTIN) | Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to. | Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to. | [
"Keyword",
"arguments",
":",
"actionmessage",
"--",
"the",
"ActionString",
"actiontype",
"--",
"The",
"ActionType",
"the",
"ActionString",
"should",
"be",
"sent",
"to",
"."
] | def send_action(self, actionmessage="", actiontype=ACTION_EXECBUILTIN):
"""
Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to.
"""
packet = PacketACTION(actionmessage, actiontype)
packet.send(self.... | [
"def",
"send_action",
"(",
"self",
",",
"actionmessage",
"=",
"\"\"",
",",
"actiontype",
"=",
"ACTION_EXECBUILTIN",
")",
":",
"packet",
"=",
"PacketACTION",
"(",
"actionmessage",
",",
"actiontype",
")",
"packet",
".",
"send",
"(",
"self",
".",
"sock",
",",
... | https://github.com/garbear/kodi-steamlink/blob/3f8e5970b01607cdb3c2688fbaa78e08f2d9c561/tools/EventClients/lib/python/xbmcclient.py#L624-L631 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/solvers/python/ops/util.py | python | identity_operator | (matrix) | return linear_operator(
shape=shape,
dtype=matrix.dtype,
apply=lambda v: v,
apply_adjoint=lambda v: v) | Creates a linear operator from a rank-2 identity tensor. | Creates a linear operator from a rank-2 identity tensor. | [
"Creates",
"a",
"linear",
"operator",
"from",
"a",
"rank",
"-",
"2",
"identity",
"tensor",
"."
] | def identity_operator(matrix):
"""Creates a linear operator from a rank-2 identity tensor."""
linear_operator = collections.namedtuple(
"LinearOperator", ["shape", "dtype", "apply", "apply_adjoint"])
shape = matrix.get_shape()
if shape.is_fully_defined():
shape = shape.as_list()
else:
shape = a... | [
"def",
"identity_operator",
"(",
"matrix",
")",
":",
"linear_operator",
"=",
"collections",
".",
"namedtuple",
"(",
"\"LinearOperator\"",
",",
"[",
"\"shape\"",
",",
"\"dtype\"",
",",
"\"apply\"",
",",
"\"apply_adjoint\"",
"]",
")",
"shape",
"=",
"matrix",
".",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/solvers/python/ops/util.py#L48-L62 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/device_worker.py | python | DeviceWorker._gen_worker_desc | (self, trainer_desc) | Generator worker desc.
Args:
trainer_desc(TrainerDesc): a TrainerDesc object | Generator worker desc. | [
"Generator",
"worker",
"desc",
"."
] | def _gen_worker_desc(self, trainer_desc):
"""
Generator worker desc.
Args:
trainer_desc(TrainerDesc): a TrainerDesc object
"""
raise NotImplementedError(
"DeviceWorker does not implement gen_worker_desc, "
"please use Hogwild or DownpourSGD, e... | [
"def",
"_gen_worker_desc",
"(",
"self",
",",
"trainer_desc",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"DeviceWorker does not implement gen_worker_desc, \"",
"\"please use Hogwild or DownpourSGD, etc.\"",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/device_worker.py#L63-L72 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/metadata/Music/discid/disc.py | python | Disc._get_first_track_num | (self) | return _LIB.discid_get_first_track_num(self._handle) | Gets the first track number | Gets the first track number | [
"Gets",
"the",
"first",
"track",
"number"
] | def _get_first_track_num(self):
"""Gets the first track number
"""
assert self._success
return _LIB.discid_get_first_track_num(self._handle) | [
"def",
"_get_first_track_num",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_success",
"return",
"_LIB",
".",
"discid_get_first_track_num",
"(",
"self",
".",
"_handle",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Music/discid/disc.py#L227-L231 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/nvvm.py | python | _replace_llvm_memset_usage | (m) | return '({})'.format(out) | Replace `llvm.memset` usage for llvm7+.
Used as functor for `re.sub. | Replace `llvm.memset` usage for llvm7+. | [
"Replace",
"llvm",
".",
"memset",
"usage",
"for",
"llvm7",
"+",
"."
] | def _replace_llvm_memset_usage(m):
"""Replace `llvm.memset` usage for llvm7+.
Used as functor for `re.sub.
"""
params = list(m.group(1).split(','))
align = re.search(r'align (\d+)', params[0]).group(1)
params.insert(-1, 'i32 {}'.format(align))
out = ', '.join(params)
return '({})'.forma... | [
"def",
"_replace_llvm_memset_usage",
"(",
"m",
")",
":",
"params",
"=",
"list",
"(",
"m",
".",
"group",
"(",
"1",
")",
".",
"split",
"(",
"','",
")",
")",
"align",
"=",
"re",
".",
"search",
"(",
"r'align (\\d+)'",
",",
"params",
"[",
"0",
"]",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/nvvm.py#L652-L661 | |
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/GUIOPTControls.py | python | OptCheckbox | (winhelp, ctlhelp, help_ta, window, button_id, label_id, label_strref, variable, handler=None, value=1) | return button | Standard checkbox for option windows | Standard checkbox for option windows | [
"Standard",
"checkbox",
"for",
"option",
"windows"
] | def OptCheckbox (winhelp, ctlhelp, help_ta, window, button_id, label_id, label_strref, variable, handler=None, value=1):
"""Standard checkbox for option windows"""
button = window.GetControl (button_id)
button.SetFlags (IE_GUI_BUTTON_CHECKBOX, OP_OR)
if variable:
button.SetVarAssoc (variable, value)
if GameChe... | [
"def",
"OptCheckbox",
"(",
"winhelp",
",",
"ctlhelp",
",",
"help_ta",
",",
"window",
",",
"button_id",
",",
"label_id",
",",
"label_strref",
",",
"variable",
",",
"handler",
"=",
"None",
",",
"value",
"=",
"1",
")",
":",
"button",
"=",
"window",
".",
"... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/GUIOPTControls.py#L76-L99 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/util/tty/color.py | python | cescape | (string) | return str(string).replace('@', '@@') | Replace all @ with @@ in the string provided. | Replace all | [
"Replace",
"all"
] | def cescape(string):
"""Replace all @ with @@ in the string provided."""
return str(string).replace('@', '@@') | [
"def",
"cescape",
"(",
"string",
")",
":",
"return",
"str",
"(",
"string",
")",
".",
"replace",
"(",
"'@'",
",",
"'@@'",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/util/tty/color.py#L189-L191 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/widgets/widget.py | python | Widget.getNamedChildren | (self, include_unnamed = False) | return children | Create a dictionary of child widgets with the keys being
their name. This will contain only Widgets which have
a name different from "__unnamed__" (which is the default).
@param include_unnamed: Defaults to false. If this is true unnamed widgets are added, too.
The values are lists of widgets, so not only... | Create a dictionary of child widgets with the keys being
their name. This will contain only Widgets which have
a name different from "__unnamed__" (which is the default).
@param include_unnamed: Defaults to false. If this is true unnamed widgets are added, too.
The values are lists of widgets, so not only... | [
"Create",
"a",
"dictionary",
"of",
"child",
"widgets",
"with",
"the",
"keys",
"being",
"their",
"name",
".",
"This",
"will",
"contain",
"only",
"Widgets",
"which",
"have",
"a",
"name",
"different",
"from",
"__unnamed__",
"(",
"which",
"is",
"the",
"default",... | def getNamedChildren(self, include_unnamed = False):
"""
Create a dictionary of child widgets with the keys being
their name. This will contain only Widgets which have
a name different from "__unnamed__" (which is the default).
@param include_unnamed: Defaults to false. If this is true unnamed widgets are ... | [
"def",
"getNamedChildren",
"(",
"self",
",",
"include_unnamed",
"=",
"False",
")",
":",
"children",
"=",
"{",
"}",
"if",
"include_unnamed",
":",
"def",
"_childCollector",
"(",
"widget",
")",
":",
"children",
".",
"setdefault",
"(",
"widget",
".",
"_name",
... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/widgets/widget.py#L562-L587 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/Input/BlockTree.py | python | BlockTree._includeParents | (self, block) | Recursively set all parent blocks to be included
Input:
block[BlockInfo]: Include the parent of this block | Recursively set all parent blocks to be included
Input:
block[BlockInfo]: Include the parent of this block | [
"Recursively",
"set",
"all",
"parent",
"blocks",
"to",
"be",
"included",
"Input",
":",
"block",
"[",
"BlockInfo",
"]",
":",
"Include",
"the",
"parent",
"of",
"this",
"block"
] | def _includeParents(self, block):
"""
Recursively set all parent blocks to be included
Input:
block[BlockInfo]: Include the parent of this block
"""
item = self._path_item_map.get(block.path)
if item:
parent = item.parent()
if parent:
... | [
"def",
"_includeParents",
"(",
"self",
",",
"block",
")",
":",
"item",
"=",
"self",
".",
"_path_item_map",
".",
"get",
"(",
"block",
".",
"path",
")",
"if",
"item",
":",
"parent",
"=",
"item",
".",
"parent",
"(",
")",
"if",
"parent",
":",
"parent_blo... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/BlockTree.py#L306-L321 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | benchmark/opperf/nd_operations/nn_optimizer_operators.py | python | run_optimizer_operators_benchmarks | (ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100) | return merge_map_list(multi_sgd_mom_res + multi_sgd_mom_res + multi_sgd_res + multi_mp_sgd_res + preloaded_multi_mp_sgd_res +\
preloaded_multi_sgd_mom_res + preloaded_multi_mp_sgd_res + preloaded_multi_mp_sgd_mom_res +\
multi_mp_sgd_mom_res + preloaded_multi_sgd_res +... | Runs benchmarks with the given context, precision (dtype), and input data size (int64_tensor) for all the neural network
optimizer update operators in MXNet.
Parameters
----------
ctx: mx.ctx
Context to run benchmarks
dtype: str, default 'float32'
Precision to use for benchmarks
... | Runs benchmarks with the given context, precision (dtype), and input data size (int64_tensor) for all the neural network
optimizer update operators in MXNet. | [
"Runs",
"benchmarks",
"with",
"the",
"given",
"context",
"precision",
"(",
"dtype",
")",
"and",
"input",
"data",
"size",
"(",
"int64_tensor",
")",
"for",
"all",
"the",
"neural",
"network",
"optimizer",
"update",
"operators",
"in",
"MXNet",
"."
] | def run_optimizer_operators_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100):
"""Runs benchmarks with the given context, precision (dtype), and input data size (int64_tensor) for all the neural network
optimizer update operators in MXNet.
Parameters
... | [
"def",
"run_optimizer_operators_benchmarks",
"(",
"ctx",
"=",
"mx",
".",
"cpu",
"(",
")",
",",
"dtype",
"=",
"'float32'",
",",
"profiler",
"=",
"'native'",
",",
"int64_tensor",
"=",
"'off'",
",",
"warmup",
"=",
"25",
",",
"runs",
"=",
"100",
")",
":",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/benchmark/opperf/nd_operations/nn_optimizer_operators.py#L57-L145 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/string.py | python | count | (s, *args) | return s.count(*args) | count(s, sub[, start[,end]]) -> int
Return the number of occurrences of substring sub in string
s[start:end]. Optional arguments start and end are
interpreted as in slice notation. | count(s, sub[, start[,end]]) -> int | [
"count",
"(",
"s",
"sub",
"[",
"start",
"[",
"end",
"]]",
")",
"-",
">",
"int"
] | def count(s, *args):
"""count(s, sub[, start[,end]]) -> int
Return the number of occurrences of substring sub in string
s[start:end]. Optional arguments start and end are
interpreted as in slice notation.
"""
return s.count(*args) | [
"def",
"count",
"(",
"s",
",",
"*",
"args",
")",
":",
"return",
"s",
".",
"count",
"(",
"*",
"args",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/string.py#L342-L350 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/random/_pickle.py | python | __generator_ctor | (bit_generator_name='MT19937') | return Generator(bit_generator()) | Pickling helper function that returns a Generator object
Parameters
----------
bit_generator_name: str
String containing the core BitGenerator
Returns
-------
rg: Generator
Generator using the named core BitGenerator | Pickling helper function that returns a Generator object | [
"Pickling",
"helper",
"function",
"that",
"returns",
"a",
"Generator",
"object"
] | def __generator_ctor(bit_generator_name='MT19937'):
"""
Pickling helper function that returns a Generator object
Parameters
----------
bit_generator_name: str
String containing the core BitGenerator
Returns
-------
rg: Generator
Generator using the named core BitGenerat... | [
"def",
"__generator_ctor",
"(",
"bit_generator_name",
"=",
"'MT19937'",
")",
":",
"if",
"bit_generator_name",
"in",
"BitGenerators",
":",
"bit_generator",
"=",
"BitGenerators",
"[",
"bit_generator_name",
"]",
"else",
":",
"raise",
"ValueError",
"(",
"str",
"(",
"b... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/random/_pickle.py#L16-L36 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/fileinput.py | python | fileno | () | return _state.fileno() | Return the file number of the current file. When no file is currently
opened, returns -1. | Return the file number of the current file. When no file is currently
opened, returns -1. | [
"Return",
"the",
"file",
"number",
"of",
"the",
"current",
"file",
".",
"When",
"no",
"file",
"is",
"currently",
"opened",
"returns",
"-",
"1",
"."
] | def fileno():
"""
Return the file number of the current file. When no file is currently
opened, returns -1.
"""
if not _state:
raise RuntimeError, "no active input()"
return _state.fileno() | [
"def",
"fileno",
"(",
")",
":",
"if",
"not",
"_state",
":",
"raise",
"RuntimeError",
",",
"\"no active input()\"",
"return",
"_state",
".",
"fileno",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/fileinput.py#L157-L164 | |
cyberbotics/webots | af7fa7d68dcf7b4550f1f2e132092b41e83698fc | projects/humans/c3d/controllers/c3d_viewer/c3d.py | python | Param.float_array | (self) | return self._as_array('f') | Get the param as an array of 32-bit floats. | Get the param as an array of 32-bit floats. | [
"Get",
"the",
"param",
"as",
"an",
"array",
"of",
"32",
"-",
"bit",
"floats",
"."
] | def float_array(self):
'''Get the param as an array of 32-bit floats.'''
return self._as_array('f') | [
"def",
"float_array",
"(",
"self",
")",
":",
"return",
"self",
".",
"_as_array",
"(",
"'f'",
")"
] | https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/projects/humans/c3d/controllers/c3d_viewer/c3d.py#L363-L365 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py | python | Window._copy_body | (
self,
ui_content: UIContent,
new_screen: Screen,
write_position: WritePosition,
move_x: int,
width: int,
vertical_scroll: int = 0,
horizontal_scroll: int = 0,
wrap_lines: bool = False,
highlight_lines: bool = False,
vertical_scrol... | return visible_line_to_row_col, rowcol_to_yx | Copy the UIContent into the output screen.
Return (visible_line_to_row_col, rowcol_to_yx) tuple.
:param get_line_prefix: None or a callable that takes a line number
(int) and a wrap_count (int) and returns formatted text. | Copy the UIContent into the output screen.
Return (visible_line_to_row_col, rowcol_to_yx) tuple. | [
"Copy",
"the",
"UIContent",
"into",
"the",
"output",
"screen",
".",
"Return",
"(",
"visible_line_to_row_col",
"rowcol_to_yx",
")",
"tuple",
"."
] | def _copy_body(
self,
ui_content: UIContent,
new_screen: Screen,
write_position: WritePosition,
move_x: int,
width: int,
vertical_scroll: int = 0,
horizontal_scroll: int = 0,
wrap_lines: bool = False,
highlight_lines: bool = False,
... | [
"def",
"_copy_body",
"(",
"self",
",",
"ui_content",
":",
"UIContent",
",",
"new_screen",
":",
"Screen",
",",
"write_position",
":",
"WritePosition",
",",
"move_x",
":",
"int",
",",
"width",
":",
"int",
",",
"vertical_scroll",
":",
"int",
"=",
"0",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/containers.py#L1941-L2181 | |
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/make.py | python | stmt_list | (stmt) | return [stmt] | Make list of stmt from blocks.
Parameters
----------
stmt : A block statement
Returns
-------
stmt_list : list of Stmt
The unpacked list of statements | Make list of stmt from blocks. | [
"Make",
"list",
"of",
"stmt",
"from",
"blocks",
"."
] | def stmt_list(stmt):
"""Make list of stmt from blocks.
Parameters
----------
stmt : A block statement
Returns
-------
stmt_list : list of Stmt
The unpacked list of statements
"""
if isinstance(stmt, _stmt.Block):
return stmt_list(stmt.first) + stmt_list(stmt.rest)
... | [
"def",
"stmt_list",
"(",
"stmt",
")",
":",
"if",
"isinstance",
"(",
"stmt",
",",
"_stmt",
".",
"Block",
")",
":",
"return",
"stmt_list",
"(",
"stmt",
".",
"first",
")",
"+",
"stmt_list",
"(",
"stmt",
".",
"rest",
")",
"elif",
"isinstance",
"(",
"stmt... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/make.py#L111-L127 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/recipe_modules/build/api.py | python | BuildApi.copy_build_products | (self, out_dir, dst) | Copy selected build products to dst. | Copy selected build products to dst. | [
"Copy",
"selected",
"build",
"products",
"to",
"dst",
"."
] | def copy_build_products(self, out_dir, dst):
"""Copy selected build products to dst."""
self.copy_fn(self.m, out_dir, dst) | [
"def",
"copy_build_products",
"(",
"self",
",",
"out_dir",
",",
"dst",
")",
":",
"self",
".",
"copy_fn",
"(",
"self",
".",
"m",
",",
"out_dir",
",",
"dst",
")"
] | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipe_modules/build/api.py#L55-L57 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/parserdata.py | python | ConditionBlock.condition_source | (statement, index) | Convert a condition to its source representation.
The index argument defines the index of this condition inside a
ConditionBlock. If it is greater than 0, an "else" will be prepended
to the result, if necessary. | Convert a condition to its source representation. | [
"Convert",
"a",
"condition",
"to",
"its",
"source",
"representation",
"."
] | def condition_source(statement, index):
"""Convert a condition to its source representation.
The index argument defines the index of this condition inside a
ConditionBlock. If it is greater than 0, an "else" will be prepended
to the result, if necessary.
"""
prefix = ''
... | [
"def",
"condition_source",
"(",
"statement",
",",
"index",
")",
":",
"prefix",
"=",
"''",
"if",
"isinstance",
"(",
"statement",
",",
"(",
"EqCondition",
",",
"IfdefCondition",
")",
")",
"and",
"index",
">",
"0",
":",
"prefix",
"=",
"'else '",
"if",
"isin... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/parserdata.py#L697-L761 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags2man.py | python | ProgramInfo.ParseCFlags | (self, start_line=0) | Parse C style flags. | Parse C style flags. | [
"Parse",
"C",
"style",
"flags",
"."
] | def ParseCFlags(self, start_line=0):
"""Parse C style flags."""
modname = None # name of current module
modlist = []
flag = None
for line_num in range(start_line, len(self.output)): # collect flags
line = self.output[line_num].rstrip()
if not line: ... | [
"def",
"ParseCFlags",
"(",
"self",
",",
"start_line",
"=",
"0",
")",
":",
"modname",
"=",
"None",
"# name of current module",
"modlist",
"=",
"[",
"]",
"flag",
"=",
"None",
"for",
"line_num",
"in",
"range",
"(",
"start_line",
",",
"len",
"(",
"self",
"."... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags2man.py#L323-L362 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/directnotify/Notifier.py | python | Notifier.debug | (self, debugString) | return 1 | Issue the debug message if debug flag is on | Issue the debug message if debug flag is on | [
"Issue",
"the",
"debug",
"message",
"if",
"debug",
"flag",
"is",
"on"
] | def debug(self, debugString):
"""
Issue the debug message if debug flag is on
"""
if self.__debug:
message = str(debugString)
if Notifier.showTime.getValue():
string = (self.getTime() + self.__name + '(debug): ' + message)
else:
... | [
"def",
"debug",
"(",
"self",
",",
"debugString",
")",
":",
"if",
"self",
".",
"__debug",
":",
"message",
"=",
"str",
"(",
"debugString",
")",
"if",
"Notifier",
".",
"showTime",
".",
"getValue",
"(",
")",
":",
"string",
"=",
"(",
"self",
".",
"getTime... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/Notifier.py#L160-L172 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | AlphaPixelData.__nonzero__ | (*args, **kwargs) | return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs) | __nonzero__(self) -> bool | __nonzero__(self) -> bool | [
"__nonzero__",
"(",
"self",
")",
"-",
">",
"bool"
] | def __nonzero__(*args, **kwargs):
"""__nonzero__(self) -> bool"""
return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs) | [
"def",
"__nonzero__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"AlphaPixelData___nonzero__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1150-L1152 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/summary/text_summary.py | python | text_summary | (name, tensor, collections=None) | return t_summary | Summarizes textual data.
Text data summarized via this plugin will be visible in the Text Dashboard
in TensorBoard. The standard TensorBoard Text Dashboard will render markdown
in the strings, and will automatically organize 1d and 2d tensors into tables.
If a tensor with more than 2 dimensions is provided, a ... | Summarizes textual data. | [
"Summarizes",
"textual",
"data",
"."
] | def text_summary(name, tensor, collections=None):
"""Summarizes textual data.
Text data summarized via this plugin will be visible in the Text Dashboard
in TensorBoard. The standard TensorBoard Text Dashboard will render markdown
in the strings, and will automatically organize 1d and 2d tensors into tables.
... | [
"def",
"text_summary",
"(",
"name",
",",
"tensor",
",",
"collections",
"=",
"None",
")",
":",
"if",
"tensor",
".",
"dtype",
"!=",
"dtypes",
".",
"string",
":",
"raise",
"ValueError",
"(",
"\"Expected tensor %s to have dtype string, got %s\"",
"%",
"(",
"tensor",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/summary/text_summary.py#L36-L74 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py | python | XMLParser.close | (self) | Finish feeding data to parser and return element structure. | Finish feeding data to parser and return element structure. | [
"Finish",
"feeding",
"data",
"to",
"parser",
"and",
"return",
"element",
"structure",
"."
] | def close(self):
"""Finish feeding data to parser and return element structure."""
try:
self.parser.Parse("", 1) # end of data
except self._error as v:
self._raiseerror(v)
try:
close_handler = self.target.close
except AttributeError:
... | [
"def",
"close",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"parser",
".",
"Parse",
"(",
"\"\"",
",",
"1",
")",
"# end of data",
"except",
"self",
".",
"_error",
"as",
"v",
":",
"self",
".",
"_raiseerror",
"(",
"v",
")",
"try",
":",
"close_hand... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py#L1634-L1649 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/site_compare/commands/maskmaker.py | python | ValidateMaskmaker | (command) | Validate the arguments to maskmaker. Raises ParseError if failed. | Validate the arguments to maskmaker. Raises ParseError if failed. | [
"Validate",
"the",
"arguments",
"to",
"maskmaker",
".",
"Raises",
"ParseError",
"if",
"failed",
"."
] | def ValidateMaskmaker(command):
"""Validate the arguments to maskmaker. Raises ParseError if failed."""
executables = [".exe", ".com", ".bat"]
if command["--browserpath"]:
if os.path.splitext(command["--browserpath"])[1].lower() not in executables:
raise command_line.ParseError("Browser filename must be... | [
"def",
"ValidateMaskmaker",
"(",
"command",
")",
":",
"executables",
"=",
"[",
"\".exe\"",
",",
"\".com\"",
",",
"\".bat\"",
"]",
"if",
"command",
"[",
"\"--browserpath\"",
"]",
":",
"if",
"os",
".",
"path",
".",
"splitext",
"(",
"command",
"[",
"\"--brows... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/site_compare/commands/maskmaker.py#L88-L93 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/dir_util.py | python | copy_tree | (src, dst, preserve_mode=1, preserve_times=1,
preserve_symlinks=0, update=0, verbose=1, dry_run=0) | return outputs | Copy an entire directory tree 'src' to a new location 'dst'.
Both 'src' and 'dst' must be directory names. If 'src' is not a
directory, raise DistutilsFileError. If 'dst' does not exist, it is
created with 'mkpath()'. The end result of the copy is that every
file in 'src' is copied to 'dst', and dir... | Copy an entire directory tree 'src' to a new location 'dst'. | [
"Copy",
"an",
"entire",
"directory",
"tree",
"src",
"to",
"a",
"new",
"location",
"dst",
"."
] | def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
preserve_symlinks=0, update=0, verbose=1, dry_run=0):
"""Copy an entire directory tree 'src' to a new location 'dst'.
Both 'src' and 'dst' must be directory names. If 'src' is not a
directory, raise DistutilsFileError. If 'dst' does... | [
"def",
"copy_tree",
"(",
"src",
",",
"dst",
",",
"preserve_mode",
"=",
"1",
",",
"preserve_times",
"=",
"1",
",",
"preserve_symlinks",
"=",
"0",
",",
"update",
"=",
"0",
",",
"verbose",
"=",
"1",
",",
"dry_run",
"=",
"0",
")",
":",
"from",
"distutils... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/dir_util.py#L99-L166 | |
google/swiftshader | 8ccc63f045d5975fb67f9dfd3d2b8235b0526990 | third_party/SPIRV-Tools/utils/check_copyright.py | python | insert_copyright | (author, glob, comment_prefix) | Finds all glob-matching files under the current directory and inserts the
copyright message, and license notice. An MIT license or Khronos free
use license (modified MIT) is replaced with an Apache 2 license.
The copyright message goes into the first non-whitespace, non-shebang line
in a file. The li... | Finds all glob-matching files under the current directory and inserts the
copyright message, and license notice. An MIT license or Khronos free
use license (modified MIT) is replaced with an Apache 2 license. | [
"Finds",
"all",
"glob",
"-",
"matching",
"files",
"under",
"the",
"current",
"directory",
"and",
"inserts",
"the",
"copyright",
"message",
"and",
"license",
"notice",
".",
"An",
"MIT",
"license",
"or",
"Khronos",
"free",
"use",
"license",
"(",
"modified",
"M... | def insert_copyright(author, glob, comment_prefix):
"""Finds all glob-matching files under the current directory and inserts the
copyright message, and license notice. An MIT license or Khronos free
use license (modified MIT) is replaced with an Apache 2 license.
The copyright message goes into the fi... | [
"def",
"insert_copyright",
"(",
"author",
",",
"glob",
",",
"comment_prefix",
")",
":",
"copyright",
"=",
"comment",
"(",
"'Copyright (c) {} {}'",
".",
"format",
"(",
"CURRENT_YEAR",
",",
"author",
")",
",",
"comment_prefix",
")",
"+",
"'\\n\\n'",
"licensed",
... | https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/check_copyright.py#L112-L161 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/eager/core.py | python | active_trace | () | return _active_trace | Returns the current global active trace of execution and memory usage. | Returns the current global active trace of execution and memory usage. | [
"Returns",
"the",
"current",
"global",
"active",
"trace",
"of",
"execution",
"and",
"memory",
"usage",
"."
] | def active_trace():
"""Returns the current global active trace of execution and memory usage."""
return _active_trace | [
"def",
"active_trace",
"(",
")",
":",
"return",
"_active_trace"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/core.py#L73-L75 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/util/lib/common/util.py | python | Kill | (pid) | Terminate the given pid. | Terminate the given pid. | [
"Terminate",
"the",
"given",
"pid",
"."
] | def Kill(pid):
"""Terminate the given pid."""
if IsWindows():
subprocess.call(['taskkill.exe', '/T', '/F', '/PID', str(pid)])
else:
os.kill(pid, signal.SIGTERM) | [
"def",
"Kill",
"(",
"pid",
")",
":",
"if",
"IsWindows",
"(",
")",
":",
"subprocess",
".",
"call",
"(",
"[",
"'taskkill.exe'",
",",
"'/T'",
",",
"'/F'",
",",
"'/PID'",
",",
"str",
"(",
"pid",
")",
"]",
")",
"else",
":",
"os",
".",
"kill",
"(",
"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/util/lib/common/util.py#L106-L111 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlDoc.schemaNewDocParserCtxt | (self) | return __tmp | Create an XML Schemas parse context for that document. NB.
The document may be modified during the parsing process. | Create an XML Schemas parse context for that document. NB.
The document may be modified during the parsing process. | [
"Create",
"an",
"XML",
"Schemas",
"parse",
"context",
"for",
"that",
"document",
".",
"NB",
".",
"The",
"document",
"may",
"be",
"modified",
"during",
"the",
"parsing",
"process",
"."
] | def schemaNewDocParserCtxt(self):
"""Create an XML Schemas parse context for that document. NB.
The document may be modified during the parsing process. """
ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed')
... | [
"def",
"schemaNewDocParserCtxt",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlSchemaNewDocParserCtxt",
"(",
"self",
".",
"_o",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"parserError",
"(",
"'xmlSchemaNewDocParserCtxt() failed'",
")",
"__tmp",
"=... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4854-L4860 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MenuItem.GetBackgroundColour | (*args, **kwargs) | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | GetBackgroundColour(self) -> Colour | GetBackgroundColour(self) -> Colour | [
"GetBackgroundColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self) -> Colour"""
return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | [
"def",
"GetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12577-L12579 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/document.py | python | Document.leading_whitespace_in_current_line | (self) | return current_line[:length] | The leading whitespace in the left margin of the current line. | The leading whitespace in the left margin of the current line. | [
"The",
"leading",
"whitespace",
"in",
"the",
"left",
"margin",
"of",
"the",
"current",
"line",
"."
] | def leading_whitespace_in_current_line(self):
""" The leading whitespace in the left margin of the current line. """
current_line = self.current_line
length = len(current_line) - len(current_line.lstrip())
return current_line[:length] | [
"def",
"leading_whitespace_in_current_line",
"(",
"self",
")",
":",
"current_line",
"=",
"self",
".",
"current_line",
"length",
"=",
"len",
"(",
"current_line",
")",
"-",
"len",
"(",
"current_line",
".",
"lstrip",
"(",
")",
")",
"return",
"current_line",
"[",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/document.py#L225-L229 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_data.py | python | Data.get_py_described | (self) | A convenience method for decoding an AMQP described value.
:returns: The decoded AMQP descriptor. | A convenience method for decoding an AMQP described value. | [
"A",
"convenience",
"method",
"for",
"decoding",
"an",
"AMQP",
"described",
"value",
"."
] | def get_py_described(self) -> Described:
"""
A convenience method for decoding an AMQP described value.
:returns: The decoded AMQP descriptor.
"""
if self.enter():
try:
self.next()
descriptor = self.get_object()
self.ne... | [
"def",
"get_py_described",
"(",
"self",
")",
"->",
"Described",
":",
"if",
"self",
".",
"enter",
"(",
")",
":",
"try",
":",
"self",
".",
"next",
"(",
")",
"descriptor",
"=",
"self",
".",
"get_object",
"(",
")",
"self",
".",
"next",
"(",
")",
"value... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_data.py#L1480-L1494 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/cloud/common/google_instance_helper.py | python | GoogleInstanceHelper.CreateTemplate | (self, tag, bucket, task_dir) | return self._ExecuteApiRequest(request)[0] | Creates an instance template for instances identified by tag.
Args:
tag: (string) Tag associated to a task.
bucket: (string) Root bucket where the deployment is located.
task_dir: (string) Subdirectory of |bucket| where task data is read and
written.
Returns:
b... | Creates an instance template for instances identified by tag. | [
"Creates",
"an",
"instance",
"template",
"for",
"instances",
"identified",
"by",
"tag",
"."
] | def CreateTemplate(self, tag, bucket, task_dir):
"""Creates an instance template for instances identified by tag.
Args:
tag: (string) Tag associated to a task.
bucket: (string) Root bucket where the deployment is located.
task_dir: (string) Subdirectory of |bucket| where task data is read and... | [
"def",
"CreateTemplate",
"(",
"self",
",",
"tag",
",",
"bucket",
",",
"task_dir",
")",
":",
"image_url",
"=",
"self",
".",
"_COMPUTE_API_ROOT",
"+",
"'ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20160406'",
"request_body",
"=",
"{",
"'name'",
":",
"self",
".",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/common/google_instance_helper.py#L62-L112 | |
berndpfrommer/tagslam | 406562abfb27ec0f409d7bd27dd6c45dabd9965d | src/rpp.py | python | project_points | (wph_cam) | return (wph_cam/wph_cam[:,2])[:,0:3] | project homogeneous world points in camera coord to image points | project homogeneous world points in camera coord to image points | [
"project",
"homogeneous",
"world",
"points",
"in",
"camera",
"coord",
"to",
"image",
"points"
] | def project_points(wph_cam):
""" project homogeneous world points in camera coord to image points """
return (wph_cam/wph_cam[:,2])[:,0:3] | [
"def",
"project_points",
"(",
"wph_cam",
")",
":",
"return",
"(",
"wph_cam",
"/",
"wph_cam",
"[",
":",
",",
"2",
"]",
")",
"[",
":",
",",
"0",
":",
"3",
"]"
] | https://github.com/berndpfrommer/tagslam/blob/406562abfb27ec0f409d7bd27dd6c45dabd9965d/src/rpp.py#L58-L60 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/tools/grokdump.py | python | InspectionShell.do_dp | (self, address) | return self.do_display_page(address) | see display_page | see display_page | [
"see",
"display_page"
] | def do_dp(self, address):
""" see display_page """
return self.do_display_page(address) | [
"def",
"do_dp",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"do_display_page",
"(",
"address",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/grokdump.py#L3610-L3612 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/sgf_properties.py | python | serialise_point | (point, context) | return serialise_go_point(point, context.size) | Serialise a Point or Stone value.
point -- pair (row, col)
See serialise_go_point() above for details. | Serialise a Point or Stone value. | [
"Serialise",
"a",
"Point",
"or",
"Stone",
"value",
"."
] | def serialise_point(point, context):
"""Serialise a Point or Stone value.
point -- pair (row, col)
See serialise_go_point() above for details.
"""
if point is None:
raise ValueError
return serialise_go_point(point, context.size) | [
"def",
"serialise_point",
"(",
"point",
",",
"context",
")",
":",
"if",
"point",
"is",
"None",
":",
"raise",
"ValueError",
"return",
"serialise_go_point",
"(",
"point",
",",
"context",
".",
"size",
")"
] | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf_properties.py#L274-L284 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/vecutil.py | python | dot | (v, u) | return sum(u[i] * v[i] for i in range(len(v))) | Compute dot product of vectors *v* and *u*. | Compute dot product of vectors *v* and *u*. | [
"Compute",
"dot",
"product",
"of",
"vectors",
"*",
"v",
"*",
"and",
"*",
"u",
"*",
"."
] | def dot(v, u):
"""Compute dot product of vectors *v* and *u*."""
return sum(u[i] * v[i] for i in range(len(v))) | [
"def",
"dot",
"(",
"v",
",",
"u",
")",
":",
"return",
"sum",
"(",
"u",
"[",
"i",
"]",
"*",
"v",
"[",
"i",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"v",
")",
")",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/vecutil.py#L59-L61 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/dataset.py | python | DataSet._load_mask_list | (self) | Load mask list from mask_list.txt or list masks/ folder. | Load mask list from mask_list.txt or list masks/ folder. | [
"Load",
"mask",
"list",
"from",
"mask_list",
".",
"txt",
"or",
"list",
"masks",
"/",
"folder",
"."
] | def _load_mask_list(self):
"""Load mask list from mask_list.txt or list masks/ folder."""
mask_list_file = os.path.join(self.data_path, 'mask_list.txt')
if os.path.isfile(mask_list_file):
with io.open_rt(mask_list_file) as fin:
lines = fin.read().splitlines()
... | [
"def",
"_load_mask_list",
"(",
"self",
")",
":",
"mask_list_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"data_path",
",",
"'mask_list.txt'",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"mask_list_file",
")",
":",
"with",
"io",
"... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/dataset.py#L96-L104 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/PDF/pidPDF.py | python | PDFCanvas.drawString | (self, s, x, y, font=None, color=None, angle=0, **kwargs) | As it says, but many options to process. It translates
user space rather than text space, in case underlining is
needed on rotated text. It cheats and does literals
for efficiency, avoiding changing the python graphics state. | As it says, but many options to process. It translates
user space rather than text space, in case underlining is
needed on rotated text. It cheats and does literals
for efficiency, avoiding changing the python graphics state. | [
"As",
"it",
"says",
"but",
"many",
"options",
"to",
"process",
".",
"It",
"translates",
"user",
"space",
"rather",
"than",
"text",
"space",
"in",
"case",
"underlining",
"is",
"needed",
"on",
"rotated",
"text",
".",
"It",
"cheats",
"and",
"does",
"literals"... | def drawString(self, s, x, y, font=None, color=None, angle=0, **kwargs):
"""As it says, but many options to process. It translates
user space rather than text space, in case underlining is
needed on rotated text. It cheats and does literals
for efficiency, avoiding changing... | [
"def",
"drawString",
"(",
"self",
",",
"s",
",",
"x",
",",
"y",
",",
"font",
"=",
"None",
",",
"color",
"=",
"None",
",",
"angle",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"pdf",
".",
"addLiteral",
"(",
"'%begin drawString'",
")"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pidPDF.py#L329-L383 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FlatNotebook.SetRightClickMenu | (self, menu) | Sets the popup menu associated to a right click on a tab.
:param `menu`: an instance of :class:`Menu`. | Sets the popup menu associated to a right click on a tab. | [
"Sets",
"the",
"popup",
"menu",
"associated",
"to",
"a",
"right",
"click",
"on",
"a",
"tab",
"."
] | def SetRightClickMenu(self, menu):
"""
Sets the popup menu associated to a right click on a tab.
:param `menu`: an instance of :class:`Menu`.
"""
self._pages._pRightClickMenu = menu | [
"def",
"SetRightClickMenu",
"(",
"self",
",",
"menu",
")",
":",
"self",
".",
"_pages",
".",
"_pRightClickMenu",
"=",
"menu"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4850-L4857 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ptyprocess/ptyprocess/ptyprocess.py | python | PtyProcess.close | (self, force=True) | This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the child ignores SIGHUP
and SIGINT). | This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the child ignores SIGHUP
and SIGINT). | [
"This",
"closes",
"the",
"connection",
"with",
"the",
"child",
"application",
".",
"Note",
"that",
"calling",
"close",
"()",
"more",
"than",
"once",
"is",
"valid",
".",
"This",
"emulates",
"standard",
"Python",
"behavior",
"with",
"files",
".",
"Set",
"force... | def close(self, force=True):
'''This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the chi... | [
"def",
"close",
"(",
"self",
",",
"force",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"closed",
":",
"self",
".",
"flush",
"(",
")",
"self",
".",
"fileobj",
".",
"close",
"(",
")",
"# Closes the file descriptor",
"# Give kernel time to update process s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ptyprocess/ptyprocess/ptyprocess.py#L393-L408 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/misc.py | python | file_be_gone | (path) | Remove a file, and don't get annoyed if it doesn't exist. | Remove a file, and don't get annoyed if it doesn't exist. | [
"Remove",
"a",
"file",
"and",
"don",
"t",
"get",
"annoyed",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def file_be_gone(path):
"""Remove a file, and don't get annoyed if it doesn't exist."""
try:
os.remove(path)
except OSError as e:
if e.errno != errno.ENOENT:
raise | [
"def",
"file_be_gone",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"remove",
"(",
"path",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"!=",
"errno",
".",
"ENOENT",
":",
"raise"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/misc.py#L145-L151 | ||
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/views/exceptions.py | python | failed_colander_validation | (exception, request) | return response | Catch ``colander.Invalid`` and give an informative 500 response.
:param exception: exception to be handled
:type exception: colander.Invalid
:param request: the pyramid request that lead to the exception being raised.
:type request: pyramid.request.Request
:return: the pyramid response to be render... | Catch ``colander.Invalid`` and give an informative 500 response. | [
"Catch",
"colander",
".",
"Invalid",
"and",
"give",
"an",
"informative",
"500",
"response",
"."
] | def failed_colander_validation(exception, request):
"""Catch ``colander.Invalid`` and give an informative 500 response.
:param exception: exception to be handled
:type exception: colander.Invalid
:param request: the pyramid request that lead to the exception being raised.
:type request: pyramid.req... | [
"def",
"failed_colander_validation",
"(",
"exception",
",",
"request",
")",
":",
"status_int",
"=",
"500",
"body",
"=",
"'{0:d}: {1:s}\\nFailed validation:\\n{2:s}'",
".",
"format",
"(",
"status_int",
",",
"request",
".",
"referrer",
",",
"pprint",
".",
"pformat",
... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/views/exceptions.py#L60-L74 | |
cksystemsgroup/scalloc | 049857919b5fa1d539c9e4206e353daca2e87394 | tools/cpplint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
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... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L1666-L1677 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/storage.py | python | TypedStorage._new_shared | (cls, size) | return cls(wrap_storage=untyped_storage) | Creates a new storage in shared memory with the same data type | Creates a new storage in shared memory with the same data type | [
"Creates",
"a",
"new",
"storage",
"in",
"shared",
"memory",
"with",
"the",
"same",
"data",
"type"
] | def _new_shared(cls, size):
"""Creates a new storage in shared memory with the same data type"""
module = eval(cls.__module__)
untyped_storage = module.UntypedStorage._new_shared(size * cls().element_size())
return cls(wrap_storage=untyped_storage) | [
"def",
"_new_shared",
"(",
"cls",
",",
"size",
")",
":",
"module",
"=",
"eval",
"(",
"cls",
".",
"__module__",
")",
"untyped_storage",
"=",
"module",
".",
"UntypedStorage",
".",
"_new_shared",
"(",
"size",
"*",
"cls",
"(",
")",
".",
"element_size",
"(",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/storage.py#L484-L488 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py | python | TurtleScreenBase._blankimage | () | return img | return a blank image object | return a blank image object | [
"return",
"a",
"blank",
"image",
"object"
] | def _blankimage():
"""return a blank image object
"""
img = TK.PhotoImage(width=1, height=1)
img.blank()
return img | [
"def",
"_blankimage",
"(",
")",
":",
"img",
"=",
"TK",
".",
"PhotoImage",
"(",
"width",
"=",
"1",
",",
"height",
"=",
"1",
")",
"img",
".",
"blank",
"(",
")",
"return",
"img"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L491-L496 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py | python | Message.getheader | (self, name, default=None) | return self.dict.get(name.lower(), default) | Get the header value for a name.
This is the normal interface: it returns a stripped version of the
header value for a given header name, or None if it doesn't exist.
This uses the dictionary version which finds the *last* such header. | Get the header value for a name. | [
"Get",
"the",
"header",
"value",
"for",
"a",
"name",
"."
] | def getheader(self, name, default=None):
"""Get the header value for a name.
This is the normal interface: it returns a stripped version of the
header value for a given header name, or None if it doesn't exist.
This uses the dictionary version which finds the *last* such header.
... | [
"def",
"getheader",
"(",
"self",
",",
"name",
",",
"default",
"=",
"None",
")",
":",
"return",
"self",
".",
"dict",
".",
"get",
"(",
"name",
".",
"lower",
"(",
")",
",",
"default",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py#L285-L292 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/Crypto/PublicKey/qNEW.py | python | qNEWobj.publickey | (self) | return construct((self.p, self.q, self.g, self.y)) | Return a new key object containing only the public information. | Return a new key object containing only the public information. | [
"Return",
"a",
"new",
"key",
"object",
"containing",
"only",
"the",
"public",
"information",
"."
] | def publickey(self):
"""Return a new key object containing only the public information."""
return construct((self.p, self.q, self.g, self.y)) | [
"def",
"publickey",
"(",
"self",
")",
":",
"return",
"construct",
"(",
"(",
"self",
".",
"p",
",",
"self",
".",
"q",
",",
"self",
".",
"g",
",",
"self",
".",
"y",
")",
")"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/Crypto/PublicKey/qNEW.py#L165-L167 | |
citra-emu/citra | cdbd72e79c9f91fd8261fd3bc2fa25b883a17fbe | dist/scripting/citra.py | python | Citra.read_memory | (self, read_address, read_size) | return result | >>> c.read_memory(0x100000, 4)
b'\\x07\\x00\\x00\\xeb' | >>> c.read_memory(0x100000, 4)
b'\\x07\\x00\\x00\\xeb' | [
">>>",
"c",
".",
"read_memory",
"(",
"0x100000",
"4",
")",
"b",
"\\\\",
"x07",
"\\\\",
"x00",
"\\\\",
"x00",
"\\\\",
"xeb"
] | def read_memory(self, read_address, read_size):
"""
>>> c.read_memory(0x100000, 4)
b'\\x07\\x00\\x00\\xeb'
"""
result = bytes()
while read_size > 0:
temp_read_size = min(read_size, MAX_REQUEST_DATA_SIZE)
request_data = struct.pack("II", read_addres... | [
"def",
"read_memory",
"(",
"self",
",",
"read_address",
",",
"read_size",
")",
":",
"result",
"=",
"bytes",
"(",
")",
"while",
"read_size",
">",
"0",
":",
"temp_read_size",
"=",
"min",
"(",
"read_size",
",",
"MAX_REQUEST_DATA_SIZE",
")",
"request_data",
"=",... | https://github.com/citra-emu/citra/blob/cdbd72e79c9f91fd8261fd3bc2fa25b883a17fbe/dist/scripting/citra.py#L37-L60 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/align.py | python | B787 | (cgeom,
rgeom,
cuniq,
runiq,
do_plot=False,
verbose=1,
atoms_map=False,
run_resorting=False,
mols_align=False,
run_to_completion=False,
uno_cutoff=1.e-3,
run_mirror=False) | return qcel.molutil.B787(cgeom,
rgeom,
cuniq,
runiq,
do_plot=do_plot,
verbose=verbose,
atoms_map=atoms_map,
run_resor... | Use Kabsch algorithm to find best alignment of geometry `cgeom` onto
`rgeom` while sampling atom mappings restricted by `runiq` and `cuniq`.
Parameters
----------
rgeom : ndarray of float
(nat, 3) array of reference/target/unchanged geometry. Assumed [a0]
for RMSD purposes.
cgeom : ... | Use Kabsch algorithm to find best alignment of geometry `cgeom` onto
`rgeom` while sampling atom mappings restricted by `runiq` and `cuniq`. | [
"Use",
"Kabsch",
"algorithm",
"to",
"find",
"best",
"alignment",
"of",
"geometry",
"cgeom",
"onto",
"rgeom",
"while",
"sampling",
"atom",
"mappings",
"restricted",
"by",
"runiq",
"and",
"cuniq",
"."
] | def B787(cgeom,
rgeom,
cuniq,
runiq,
do_plot=False,
verbose=1,
atoms_map=False,
run_resorting=False,
mols_align=False,
run_to_completion=False,
uno_cutoff=1.e-3,
run_mirror=False):
"""Use Kabsch algorithm to find best... | [
"def",
"B787",
"(",
"cgeom",
",",
"rgeom",
",",
"cuniq",
",",
"runiq",
",",
"do_plot",
"=",
"False",
",",
"verbose",
"=",
"1",
",",
"atoms_map",
"=",
"False",
",",
"run_resorting",
"=",
"False",
",",
"mols_align",
"=",
"False",
",",
"run_to_completion",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/align.py#L34-L117 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/visitor.py | python | NodeVisitor.get_visitor | (self, node) | return getattr(self, method, None) | Return the visitor function for this node or `None` if no visitor
exists for this node. In that case the generic visit function is
used instead. | Return the visitor function for this node or `None` if no visitor
exists for this node. In that case the generic visit function is
used instead. | [
"Return",
"the",
"visitor",
"function",
"for",
"this",
"node",
"or",
"None",
"if",
"no",
"visitor",
"exists",
"for",
"this",
"node",
".",
"In",
"that",
"case",
"the",
"generic",
"visit",
"function",
"is",
"used",
"instead",
"."
] | def get_visitor(self, node):
"""Return the visitor function for this node or `None` if no visitor
exists for this node. In that case the generic visit function is
used instead.
"""
method = 'visit_' + node.__class__.__name__
return getattr(self, method, None) | [
"def",
"get_visitor",
"(",
"self",
",",
"node",
")",
":",
"method",
"=",
"'visit_'",
"+",
"node",
".",
"__class__",
".",
"__name__",
"return",
"getattr",
"(",
"self",
",",
"method",
",",
"None",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/visitor.py#L26-L32 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/set.py | python | Set.difference | (self, other) | return obj | Return a new set which I{self} - I{other}, i.e. the items
in I{self} which are not also in I{other}.
@param other: the other set
@type other: Set object
@rtype: the same type as I{self} | Return a new set which I{self} - I{other}, i.e. the items
in I{self} which are not also in I{other}. | [
"Return",
"a",
"new",
"set",
"which",
"I",
"{",
"self",
"}",
"-",
"I",
"{",
"other",
"}",
"i",
".",
"e",
".",
"the",
"items",
"in",
"I",
"{",
"self",
"}",
"which",
"are",
"not",
"also",
"in",
"I",
"{",
"other",
"}",
"."
] | def difference(self, other):
"""Return a new set which I{self} - I{other}, i.e. the items
in I{self} which are not also in I{other}.
@param other: the other set
@type other: Set object
@rtype: the same type as I{self}
"""
obj = self._clone()
obj.differen... | [
"def",
"difference",
"(",
"self",
",",
"other",
")",
":",
"obj",
"=",
"self",
".",
"_clone",
"(",
")",
"obj",
".",
"difference_update",
"(",
"other",
")",
"return",
"obj"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/set.py#L154-L165 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/_lib/decorator.py | python | FunctionMaker.create | (cls, obj, body, evaldict, defaults=None,
doc=None, module=None, addsource=True, **attrs) | return self.make('def %(name)s(%(signature)s):\n' + ibody,
evaldict, addsource, **attrs) | Create a function from the strings name, signature and body.
evaldict is the evaluation dictionary. If addsource is true an
attribute __source__ is added to the result. The attributes attrs
are added, if any. | Create a function from the strings name, signature and body.
evaldict is the evaluation dictionary. If addsource is true an
attribute __source__ is added to the result. The attributes attrs
are added, if any. | [
"Create",
"a",
"function",
"from",
"the",
"strings",
"name",
"signature",
"and",
"body",
".",
"evaldict",
"is",
"the",
"evaluation",
"dictionary",
".",
"If",
"addsource",
"is",
"true",
"an",
"attribute",
"__source__",
"is",
"added",
"to",
"the",
"result",
".... | def create(cls, obj, body, evaldict, defaults=None,
doc=None, module=None, addsource=True, **attrs):
"""
Create a function from the strings name, signature and body.
evaldict is the evaluation dictionary. If addsource is true an
attribute __source__ is added to the result.... | [
"def",
"create",
"(",
"cls",
",",
"obj",
",",
"body",
",",
"evaldict",
",",
"defaults",
"=",
"None",
",",
"doc",
"=",
"None",
",",
"module",
"=",
"None",
",",
"addsource",
"=",
"True",
",",
"*",
"*",
"attrs",
")",
":",
"if",
"isinstance",
"(",
"o... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/_lib/decorator.py#L203-L222 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py | python | AddrlistClass.getdelimited | (self, beginchar, endchars, allowcomments=True) | return EMPTYSTRING.join(slist) | Parse a header fragment delimited by special characters.
`beginchar' is the start character for the fragment.
If self is not looking at an instance of `beginchar' then
getdelimited returns the empty string.
`endchars' is a sequence of allowable end-delimiting characters.
Parsin... | Parse a header fragment delimited by special characters. | [
"Parse",
"a",
"header",
"fragment",
"delimited",
"by",
"special",
"characters",
"."
] | def getdelimited(self, beginchar, endchars, allowcomments=True):
"""Parse a header fragment delimited by special characters.
`beginchar' is the start character for the fragment.
If self is not looking at an instance of `beginchar' then
getdelimited returns the empty string.
`en... | [
"def",
"getdelimited",
"(",
"self",
",",
"beginchar",
",",
"endchars",
",",
"allowcomments",
"=",
"True",
")",
":",
"if",
"self",
".",
"field",
"[",
"self",
".",
"pos",
"]",
"!=",
"beginchar",
":",
"return",
"''",
"slist",
"=",
"[",
"''",
"]",
"quote... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py#L412-L447 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/websocket-client/websocket.py | python | WebSocketApp.send | (self, data, opcode=ABNF.OPCODE_TEXT) | send message.
data: message to send. If you set opcode to OPCODE_TEXT, data must be utf-8 string or unicode.
opcode: operation code of data. default is OPCODE_TEXT. | send message.
data: message to send. If you set opcode to OPCODE_TEXT, data must be utf-8 string or unicode.
opcode: operation code of data. default is OPCODE_TEXT. | [
"send",
"message",
".",
"data",
":",
"message",
"to",
"send",
".",
"If",
"you",
"set",
"opcode",
"to",
"OPCODE_TEXT",
"data",
"must",
"be",
"utf",
"-",
"8",
"string",
"or",
"unicode",
".",
"opcode",
":",
"operation",
"code",
"of",
"data",
".",
"default... | def send(self, data, opcode=ABNF.OPCODE_TEXT):
"""
send message.
data: message to send. If you set opcode to OPCODE_TEXT, data must be utf-8 string or unicode.
opcode: operation code of data. default is OPCODE_TEXT.
"""
if self.sock.send(data, opcode) == 0:
ra... | [
"def",
"send",
"(",
"self",
",",
"data",
",",
"opcode",
"=",
"ABNF",
".",
"OPCODE_TEXT",
")",
":",
"if",
"self",
".",
"sock",
".",
"send",
"(",
"data",
",",
"opcode",
")",
"==",
"0",
":",
"raise",
"WebSocketConnectionClosedException",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/websocket-client/websocket.py#L806-L813 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.GetScriptingLanguage | (self, script_language_name) | return _lldb.SBDebugger_GetScriptingLanguage(self, script_language_name) | GetScriptingLanguage(SBDebugger self, char const * script_language_name) -> lldb::ScriptLanguage | GetScriptingLanguage(SBDebugger self, char const * script_language_name) -> lldb::ScriptLanguage | [
"GetScriptingLanguage",
"(",
"SBDebugger",
"self",
"char",
"const",
"*",
"script_language_name",
")",
"-",
">",
"lldb",
"::",
"ScriptLanguage"
] | def GetScriptingLanguage(self, script_language_name):
"""GetScriptingLanguage(SBDebugger self, char const * script_language_name) -> lldb::ScriptLanguage"""
return _lldb.SBDebugger_GetScriptingLanguage(self, script_language_name) | [
"def",
"GetScriptingLanguage",
"(",
"self",
",",
"script_language_name",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_GetScriptingLanguage",
"(",
"self",
",",
"script_language_name",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4096-L4098 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py | python | GraphRewriter.eightbitize_concat_node | (self, original_node) | Replaces a Concat node with the eight bit equivalent sub-graph.
Converts a node like this:
Shape(f) Input0(f) Input1(f)
| | |
+--------v v v----------+
Concat
|
v
(f)
Into a quantize... | Replaces a Concat node with the eight bit equivalent sub-graph. | [
"Replaces",
"a",
"Concat",
"node",
"with",
"the",
"eight",
"bit",
"equivalent",
"sub",
"-",
"graph",
"."
] | def eightbitize_concat_node(self, original_node):
"""Replaces a Concat node with the eight bit equivalent sub-graph.
Converts a node like this:
Shape(f) Input0(f) Input1(f)
| | |
+--------v v v----------+
Concat
|
... | [
"def",
"eightbitize_concat_node",
"(",
"self",
",",
"original_node",
")",
":",
"namespace_prefix",
"=",
"original_node",
".",
"name",
"+",
"\"_eightbit\"",
"quantized_concat_name",
"=",
"namespace_prefix",
"+",
"\"_quantized_concat\"",
"reshape_dims_name",
",",
"reduction... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L683-L753 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tarfile.py | python | TarInfo._posix_split_name | (self, name, encoding, errors) | return prefix, name | Split a name longer than 100 chars into a prefix
and a name part. | Split a name longer than 100 chars into a prefix
and a name part. | [
"Split",
"a",
"name",
"longer",
"than",
"100",
"chars",
"into",
"a",
"prefix",
"and",
"a",
"name",
"part",
"."
] | def _posix_split_name(self, name, encoding, errors):
"""Split a name longer than 100 chars into a prefix
and a name part.
"""
components = name.split("/")
for i in range(1, len(components)):
prefix = "/".join(components[:i])
name = "/".join(components[i... | [
"def",
"_posix_split_name",
"(",
"self",
",",
"name",
",",
"encoding",
",",
"errors",
")",
":",
"components",
"=",
"name",
".",
"split",
"(",
"\"/\"",
")",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"components",
")",
")",
":",
"prefix",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L904-L918 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/uuid.py | python | _ip_getnode | () | return None | Get the hardware address on Unix by running ip. | Get the hardware address on Unix by running ip. | [
"Get",
"the",
"hardware",
"address",
"on",
"Unix",
"by",
"running",
"ip",
"."
] | def _ip_getnode():
"""Get the hardware address on Unix by running ip."""
# This works on Linux with iproute2.
mac = _find_mac_near_keyword('ip', 'link', [b'link/ether'], lambda i: i+1)
if mac:
return mac
return None | [
"def",
"_ip_getnode",
"(",
")",
":",
"# This works on Linux with iproute2.",
"mac",
"=",
"_find_mac_near_keyword",
"(",
"'ip'",
",",
"'link'",
",",
"[",
"b'link/ether'",
"]",
",",
"lambda",
"i",
":",
"i",
"+",
"1",
")",
"if",
"mac",
":",
"return",
"mac",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/uuid.py#L515-L521 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pathlib.py | python | Path.symlink_to | (self, target, target_is_directory=False) | Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's. | Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's. | [
"Make",
"this",
"path",
"a",
"symlink",
"pointing",
"to",
"the",
"given",
"path",
".",
"Note",
"the",
"order",
"of",
"arguments",
"(",
"self",
"target",
")",
"is",
"the",
"reverse",
"of",
"os",
".",
"symlink",
"s",
"."
] | def symlink_to(self, target, target_is_directory=False):
"""
Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's.
"""
if self._closed:
self._raise_closed()
self._accessor.symlink(target... | [
"def",
"symlink_to",
"(",
"self",
",",
"target",
",",
"target_is_directory",
"=",
"False",
")",
":",
"if",
"self",
".",
"_closed",
":",
"self",
".",
"_raise_closed",
"(",
")",
"self",
".",
"_accessor",
".",
"symlink",
"(",
"target",
",",
"self",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pathlib.py#L1345-L1352 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PageSetupDialogData.GetMinMarginTopLeft | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetMinMarginTopLeft(*args, **kwargs) | GetMinMarginTopLeft(self) -> Point | GetMinMarginTopLeft(self) -> Point | [
"GetMinMarginTopLeft",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetMinMarginTopLeft(*args, **kwargs):
"""GetMinMarginTopLeft(self) -> Point"""
return _windows_.PageSetupDialogData_GetMinMarginTopLeft(*args, **kwargs) | [
"def",
"GetMinMarginTopLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetMinMarginTopLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4930-L4932 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py | python | SystemInfo.NetFxSdkDir | (self) | return sdkdir or '' | Microsoft .NET Framework SDK directory. | Microsoft .NET Framework SDK directory. | [
"Microsoft",
".",
"NET",
"Framework",
"SDK",
"directory",
"."
] | def NetFxSdkDir(self):
"""
Microsoft .NET Framework SDK directory.
"""
for ver in self.NetFxSdkVersion:
loc = os.path.join(self.ri.netfx_sdk, ver)
sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder')
if sdkdir:
break
return sd... | [
"def",
"NetFxSdkDir",
"(",
"self",
")",
":",
"for",
"ver",
"in",
"self",
".",
"NetFxSdkVersion",
":",
"loc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ri",
".",
"netfx_sdk",
",",
"ver",
")",
"sdkdir",
"=",
"self",
".",
"ri",
".",
"l... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py#L724-L733 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/LargeScaleStructures/data_stitching.py | python | Stitcher.size | (self) | return len(self._data_sets) | Return the number of data sets | Return the number of data sets | [
"Return",
"the",
"number",
"of",
"data",
"sets"
] | def size(self):
"""
Return the number of data sets
"""
return len(self._data_sets) | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_data_sets",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/LargeScaleStructures/data_stitching.py#L470-L474 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html2.py | python | WebView.GetSelectedText | (*args, **kwargs) | return _html2.WebView_GetSelectedText(*args, **kwargs) | GetSelectedText(self) -> String | GetSelectedText(self) -> String | [
"GetSelectedText",
"(",
"self",
")",
"-",
">",
"String"
] | def GetSelectedText(*args, **kwargs):
"""GetSelectedText(self) -> String"""
return _html2.WebView_GetSelectedText(*args, **kwargs) | [
"def",
"GetSelectedText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_GetSelectedText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html2.py#L278-L280 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/linear_quadratic.py | python | MFGLinearQuadraticState._legal_actions | (self, player) | Returns a list of legal actions for player and MFG nodes. | Returns a list of legal actions for player and MFG nodes. | [
"Returns",
"a",
"list",
"of",
"legal",
"actions",
"for",
"player",
"and",
"MFG",
"nodes",
"."
] | def _legal_actions(self, player):
"""Returns a list of legal actions for player and MFG nodes."""
if player == pyspiel.PlayerId.MEAN_FIELD:
return []
if (player == pyspiel.PlayerId.DEFAULT_PLAYER_ID and
player == self.current_player()):
return list(range(self.n_actions))
raise ValueE... | [
"def",
"_legal_actions",
"(",
"self",
",",
"player",
")",
":",
"if",
"player",
"==",
"pyspiel",
".",
"PlayerId",
".",
"MEAN_FIELD",
":",
"return",
"[",
"]",
"if",
"(",
"player",
"==",
"pyspiel",
".",
"PlayerId",
".",
"DEFAULT_PLAYER_ID",
"and",
"player",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/linear_quadratic.py#L180-L188 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/ValidationKit/common/utils.py | python | ProcessInfo.loadAll | (self) | Load all the info. | Load all the info. | [
"Load",
"all",
"the",
"info",
"."
] | def loadAll(self):
"""Load all the info."""
sOs = getHostOs();
if sOs == 'linux':
sProc = '/proc/%s/' % (self.iPid,);
if self.sImage is None: self.sImage = noxcptReadLink(sProc + 'exe', None);
if self.sCwd is None: self.sCwd = noxcptReadLink(sProc + 'c... | [
"def",
"loadAll",
"(",
"self",
")",
":",
"sOs",
"=",
"getHostOs",
"(",
")",
"if",
"sOs",
"==",
"'linux'",
":",
"sProc",
"=",
"'/proc/%s/'",
"%",
"(",
"self",
".",
"iPid",
",",
")",
"if",
"self",
".",
"sImage",
"is",
"None",
":",
"self",
".",
"sIm... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L950-L965 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/contrib/dag/__init__.py | python | DAG.reverse_edges | (self, graph=None) | Reversed dependencies in current graph. | Reversed dependencies in current graph. | [
"Reversed",
"dependencies",
"in",
"current",
"graph",
"."
] | def reverse_edges(self, graph=None):
""" Reversed dependencies in current graph. """
new_graph = self.reverse_clone()
self.graph = new_graph.graph | [
"def",
"reverse_edges",
"(",
"self",
",",
"graph",
"=",
"None",
")",
":",
"new_graph",
"=",
"self",
".",
"reverse_clone",
"(",
")",
"self",
".",
"graph",
"=",
"new_graph",
".",
"graph"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/contrib/dag/__init__.py#L304-L308 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/math_ops.py | python | _OverrideBinaryOperatorHelper | (func, op_name, clazz_object=ops.Tensor) | Register operators with different tensor and scalar versions.
If `clazz_object` is `SparseTensor`, assumes `func` takes `(sp_indices,
sp_values, sp_shape, dense)` and outputs `(new_sp_values)`.
Args:
func: the operator
op_name: name of the operator being overridden
clazz_object: class to override fo... | Register operators with different tensor and scalar versions. | [
"Register",
"operators",
"with",
"different",
"tensor",
"and",
"scalar",
"versions",
"."
] | def _OverrideBinaryOperatorHelper(func, op_name, clazz_object=ops.Tensor):
"""Register operators with different tensor and scalar versions.
If `clazz_object` is `SparseTensor`, assumes `func` takes `(sp_indices,
sp_values, sp_shape, dense)` and outputs `(new_sp_values)`.
Args:
func: the operator
op_na... | [
"def",
"_OverrideBinaryOperatorHelper",
"(",
"func",
",",
"op_name",
",",
"clazz_object",
"=",
"ops",
".",
"Tensor",
")",
":",
"def",
"binary_op_wrapper",
"(",
"x",
",",
"y",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"op_name",
",",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_ops.py#L840-L900 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/threading.py | python | Thread.is_alive | (self) | return not self._is_stopped | Return whether the thread is alive.
This method returns True just before the run() method starts until just
after the run() method terminates. See also the module function
enumerate(). | Return whether the thread is alive. | [
"Return",
"whether",
"the",
"thread",
"is",
"alive",
"."
] | def is_alive(self):
"""Return whether the thread is alive.
This method returns True just before the run() method starts until just
after the run() method terminates. See also the module function
enumerate().
"""
assert self._initialized, "Thread.__init__() not called"
... | [
"def",
"is_alive",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_initialized",
",",
"\"Thread.__init__() not called\"",
"if",
"self",
".",
"_is_stopped",
"or",
"not",
"self",
".",
"_started",
".",
"is_set",
"(",
")",
":",
"return",
"False",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/threading.py#L1126-L1138 | |
NetSys/bess | ae52fc5804290fc3116daf2aef52226fafcedf5d | bessctl/measurement_utils.py | python | PortStats.jitter | (self, percentile=None) | return self.jitter[percentile] | Returns the dictionary of all jitter value if `percentile` is none.
Otherwise returns the `percentile`th percentile jitter. | Returns the dictionary of all jitter value if `percentile` is none.
Otherwise returns the `percentile`th percentile jitter. | [
"Returns",
"the",
"dictionary",
"of",
"all",
"jitter",
"value",
"if",
"percentile",
"is",
"none",
".",
"Otherwise",
"returns",
"the",
"percentile",
"th",
"percentile",
"jitter",
"."
] | def jitter(self, percentile=None):
"""
Returns the dictionary of all jitter value if `percentile` is none.
Otherwise returns the `percentile`th percentile jitter.
"""
if self.jitter is None or percentile is None:
return self.jitter
return self.jitter[percentil... | [
"def",
"jitter",
"(",
"self",
",",
"percentile",
"=",
"None",
")",
":",
"if",
"self",
".",
"jitter",
"is",
"None",
"or",
"percentile",
"is",
"None",
":",
"return",
"self",
".",
"jitter",
"return",
"self",
".",
"jitter",
"[",
"percentile",
"]"
] | https://github.com/NetSys/bess/blob/ae52fc5804290fc3116daf2aef52226fafcedf5d/bessctl/measurement_utils.py#L95-L102 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PageSetupDialogData.GetDefaultMinMargins | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetDefaultMinMargins(*args, **kwargs) | GetDefaultMinMargins(self) -> bool | GetDefaultMinMargins(self) -> bool | [
"GetDefaultMinMargins",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetDefaultMinMargins(*args, **kwargs):
"""GetDefaultMinMargins(self) -> bool"""
return _windows_.PageSetupDialogData_GetDefaultMinMargins(*args, **kwargs) | [
"def",
"GetDefaultMinMargins",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetDefaultMinMargins",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4886-L4888 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/Codegen.py | python | getWrapTemplateForType | (type, descriptorProvider, result, successCode,
returnsNewObject, exceptionCode, typedArraysAreStructs) | Reflect a C++ value stored in "result", of IDL type "type" into JS. The
"successCode" is the code to run once we have successfully done the
conversion and must guarantee that execution of the conversion template
stops once the successCode has executed (e.g. by doing a 'return', or by
doing a 'break' if... | Reflect a C++ value stored in "result", of IDL type "type" into JS. The
"successCode" is the code to run once we have successfully done the
conversion and must guarantee that execution of the conversion template
stops once the successCode has executed (e.g. by doing a 'return', or by
doing a 'break' if... | [
"Reflect",
"a",
"C",
"++",
"value",
"stored",
"in",
"result",
"of",
"IDL",
"type",
"type",
"into",
"JS",
".",
"The",
"successCode",
"is",
"the",
"code",
"to",
"run",
"once",
"we",
"have",
"successfully",
"done",
"the",
"conversion",
"and",
"must",
"guara... | def getWrapTemplateForType(type, descriptorProvider, result, successCode,
returnsNewObject, exceptionCode, typedArraysAreStructs):
"""
Reflect a C++ value stored in "result", of IDL type "type" into JS. The
"successCode" is the code to run once we have successfully done the
c... | [
"def",
"getWrapTemplateForType",
"(",
"type",
",",
"descriptorProvider",
",",
"result",
",",
"successCode",
",",
"returnsNewObject",
",",
"exceptionCode",
",",
"typedArraysAreStructs",
")",
":",
"if",
"successCode",
"is",
"None",
":",
"successCode",
"=",
"\"return t... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/Codegen.py#L5395-L5810 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | snapx/snapx/classes/graph.py | python | Graph._edge_iter | (self) | return _TNEANetEdgeIter(self._graph.Edges(), directed=False) | Returns a SNAP edge iterator. | Returns a SNAP edge iterator. | [
"Returns",
"a",
"SNAP",
"edge",
"iterator",
"."
] | def _edge_iter(self):
"""Returns a SNAP edge iterator."""
return _TNEANetEdgeIter(self._graph.Edges(), directed=False) | [
"def",
"_edge_iter",
"(",
"self",
")",
":",
"return",
"_TNEANetEdgeIter",
"(",
"self",
".",
"_graph",
".",
"Edges",
"(",
")",
",",
"directed",
"=",
"False",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/snapx/snapx/classes/graph.py#L1360-L1362 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_matmul_selfatt_qk | (node, **kwargs) | return nodes | Map MXNet's _contrib_interleaved_matmul_selfatt_qk operator | Map MXNet's _contrib_interleaved_matmul_selfatt_qk operator | [
"Map",
"MXNet",
"s",
"_contrib_interleaved_matmul_selfatt_qk",
"operator"
] | def convert_matmul_selfatt_qk(node, **kwargs):
"""Map MXNet's _contrib_interleaved_matmul_selfatt_qk operator
"""
from onnx.helper import make_node
from onnx import TensorProto
name, input_nodes, attrs = get_inputs(node, kwargs)
heads = int(attrs.get('heads'))
# a, b, c, d, e are seq_len, ... | [
"def",
"convert_matmul_selfatt_qk",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"from",
"onnx",
"import",
"TensorProto",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L2940-L3003 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/combine_libs.py | python | CombineLibraries | (output, remove_re, inputs) | Combines all the libraries and objects in inputs, while removing any
object files that match remove_re. | Combines all the libraries and objects in inputs, while removing any
object files that match remove_re. | [
"Combines",
"all",
"the",
"libraries",
"and",
"objects",
"in",
"inputs",
"while",
"removing",
"any",
"object",
"files",
"that",
"match",
"remove_re",
"."
] | def CombineLibraries(output, remove_re, inputs):
'''Combines all the libraries and objects in inputs, while removing any
object files that match remove_re.
'''
removals = []
if remove_re:
removals = CollectRemovals(remove_re, inputs)
if len(removals) > 0:
print('Removals: ', removals)
args = ['l... | [
"def",
"CombineLibraries",
"(",
"output",
",",
"remove_re",
",",
"inputs",
")",
":",
"removals",
"=",
"[",
"]",
"if",
"remove_re",
":",
"removals",
"=",
"CollectRemovals",
"(",
"remove_re",
",",
"inputs",
")",
"if",
"len",
"(",
"removals",
")",
">",
"0",... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/combine_libs.py#L47-L61 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/_exceptions.py | python | SAXParseException.getLineNumber | (self) | return self._linenum | The line number of the end of the text where the exception occurred. | The line number of the end of the text where the exception occurred. | [
"The",
"line",
"number",
"of",
"the",
"end",
"of",
"the",
"text",
"where",
"the",
"exception",
"occurred",
"."
] | def getLineNumber(self):
"The line number of the end of the text where the exception occurred."
return self._linenum | [
"def",
"getLineNumber",
"(",
"self",
")",
":",
"return",
"self",
".",
"_linenum"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/_exceptions.py#L77-L79 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/decorators.py | python | jit_module | (**kwargs) | Automatically ``jit``-wraps functions defined in a Python module
Note that ``jit_module`` should only be called at the end of the module to
be jitted. In addition, only functions which are defined in the module
``jit_module`` is called from are considered for automatic jit-wrapping.
See the Numba docum... | Automatically ``jit``-wraps functions defined in a Python module | [
"Automatically",
"jit",
"-",
"wraps",
"functions",
"defined",
"in",
"a",
"Python",
"module"
] | def jit_module(**kwargs):
""" Automatically ``jit``-wraps functions defined in a Python module
Note that ``jit_module`` should only be called at the end of the module to
be jitted. In addition, only functions which are defined in the module
``jit_module`` is called from are considered for automatic jit... | [
"def",
"jit_module",
"(",
"*",
"*",
"kwargs",
")",
":",
"# Get the module jit_module is being called from",
"frame",
"=",
"inspect",
".",
"stack",
"(",
")",
"[",
"1",
"]",
"module",
"=",
"inspect",
".",
"getmodule",
"(",
"frame",
"[",
"0",
"]",
")",
"# Rep... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/decorators.py#L265-L286 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Tux/NavigationIndicatorGui.py | python | onMenu | (action) | Set navigation style on selection. | Set navigation style on selection. | [
"Set",
"navigation",
"style",
"on",
"selection",
"."
] | def onMenu(action):
"""Set navigation style on selection."""
s = False
if action and action.data() != "Undefined":
s = True
setCompact(action)
menu.setDefaultAction(action)
indicator.setIcon(action.icon())
indicator.setToolTip(action.toolTip())
pView.SetStri... | [
"def",
"onMenu",
"(",
"action",
")",
":",
"s",
"=",
"False",
"if",
"action",
"and",
"action",
".",
"data",
"(",
")",
"!=",
"\"Undefined\"",
":",
"s",
"=",
"True",
"setCompact",
"(",
"action",
")",
"menu",
".",
"setDefaultAction",
"(",
"action",
")",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Tux/NavigationIndicatorGui.py#L517-L540 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/tracemalloc.py | python | take_snapshot | () | return Snapshot(traces, traceback_limit) | Take a snapshot of traces of memory blocks allocated by Python. | Take a snapshot of traces of memory blocks allocated by Python. | [
"Take",
"a",
"snapshot",
"of",
"traces",
"of",
"memory",
"blocks",
"allocated",
"by",
"Python",
"."
] | def take_snapshot():
"""
Take a snapshot of traces of memory blocks allocated by Python.
"""
if not is_tracing():
raise RuntimeError("the tracemalloc module must be tracing memory "
"allocations to take a snapshot")
traces = _get_traces()
traceback_limit = get_... | [
"def",
"take_snapshot",
"(",
")",
":",
"if",
"not",
"is_tracing",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"\"the tracemalloc module must be tracing memory \"",
"\"allocations to take a snapshot\"",
")",
"traces",
"=",
"_get_traces",
"(",
")",
"traceback_limit",
"="... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/tracemalloc.py#L551-L560 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.HomeWrapExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_HomeWrapExtend(*args, **kwargs) | HomeWrapExtend(self) | HomeWrapExtend(self) | [
"HomeWrapExtend",
"(",
"self",
")"
] | def HomeWrapExtend(*args, **kwargs):
"""HomeWrapExtend(self)"""
return _stc.StyledTextCtrl_HomeWrapExtend(*args, **kwargs) | [
"def",
"HomeWrapExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_HomeWrapExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4755-L4757 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/special/_precompute/gammainc_data.py | python | gammaincc | (a, x, dps=50, maxterms=10**8) | Compute gammaincc exactly like mpmath does but allow for more
terms in hypercomb. See
mpmath/functions/expintegrals.py#L187
in the mpmath github repository. | Compute gammaincc exactly like mpmath does but allow for more
terms in hypercomb. See | [
"Compute",
"gammaincc",
"exactly",
"like",
"mpmath",
"does",
"but",
"allow",
"for",
"more",
"terms",
"in",
"hypercomb",
".",
"See"
] | def gammaincc(a, x, dps=50, maxterms=10**8):
"""Compute gammaincc exactly like mpmath does but allow for more
terms in hypercomb. See
mpmath/functions/expintegrals.py#L187
in the mpmath github repository.
"""
with mp.workdps(dps):
z, a = a, x
if mp.isint(z):
... | [
"def",
"gammaincc",
"(",
"a",
",",
"x",
",",
"dps",
"=",
"50",
",",
"maxterms",
"=",
"10",
"**",
"8",
")",
":",
"with",
"mp",
".",
"workdps",
"(",
"dps",
")",
":",
"z",
",",
"a",
"=",
"a",
",",
"x",
"if",
"mp",
".",
"isint",
"(",
"z",
")"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/_precompute/gammainc_data.py#L57-L88 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PrintDialog.GetPrintData | (*args, **kwargs) | return _windows_.PrintDialog_GetPrintData(*args, **kwargs) | GetPrintData(self) -> PrintData | GetPrintData(self) -> PrintData | [
"GetPrintData",
"(",
"self",
")",
"-",
">",
"PrintData"
] | def GetPrintData(*args, **kwargs):
"""GetPrintData(self) -> PrintData"""
return _windows_.PrintDialog_GetPrintData(*args, **kwargs) | [
"def",
"GetPrintData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialog_GetPrintData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5189-L5191 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/ChannelHeader.py | python | ChannelHeader.getObj | (self) | return self.__obj | Return the object to the visitor. | Return the object to the visitor. | [
"Return",
"the",
"object",
"to",
"the",
"visitor",
"."
] | def getObj(self):
"""
Return the object to the visitor.
"""
return self.__obj | [
"def",
"getObj",
"(",
"self",
")",
":",
"return",
"self",
".",
"__obj"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/ChannelHeader.py#L101-L105 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/template.py | python | Template.__init__ | (self, name, func, create_scope_now=False, unique_name=None) | Creates a template for the given function.
Args:
name: A name for the scope created by this template. The
name will be made unique by appending `_N` to the it (see how
`tf.variable_scope` treats the `default_name` for details).
func: The function to apply each time.
create_scope_n... | Creates a template for the given function. | [
"Creates",
"a",
"template",
"for",
"the",
"given",
"function",
"."
] | def __init__(self, name, func, create_scope_now=False, unique_name=None):
"""Creates a template for the given function.
Args:
name: A name for the scope created by this template. The
name will be made unique by appending `_N` to the it (see how
`tf.variable_scope` treats the `default_name... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"func",
",",
"create_scope_now",
"=",
"False",
",",
"unique_name",
"=",
"None",
")",
":",
"self",
".",
"_func",
"=",
"func",
"self",
".",
"_stacktrace",
"=",
"traceback",
".",
"format_stack",
"(",
")",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/template.py#L162-L200 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/lookup_ops.py | python | KeyValueTensorInitializer.__init__ | (self, keys, values, key_dtype=None, value_dtype=None, name=None) | Constructs a table initializer object based on keys and values tensors.
Args:
keys: The tensor for the keys.
values: The tensor for the values.
key_dtype: The `keys` data type. Used when `keys` is a python array.
value_dtype: The `values` data type. Used when `values` is a python array.
... | Constructs a table initializer object based on keys and values tensors. | [
"Constructs",
"a",
"table",
"initializer",
"object",
"based",
"on",
"keys",
"and",
"values",
"tensors",
"."
] | def __init__(self, keys, values, key_dtype=None, value_dtype=None, name=None):
"""Constructs a table initializer object based on keys and values tensors.
Args:
keys: The tensor for the keys.
values: The tensor for the values.
key_dtype: The `keys` data type. Used when `keys` is a python array... | [
"def",
"__init__",
"(",
"self",
",",
"keys",
",",
"values",
",",
"key_dtype",
"=",
"None",
",",
"value_dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"key_value_init\"",
",",
"[",
"keys",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/lookup_ops.py#L310-L327 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/stringold.py | python | find | (s, *args) | return _apply(s.find, args) | find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure. | find(s, sub [,start [,end]]) -> in | [
"find",
"(",
"s",
"sub",
"[",
"start",
"[",
"end",
"]]",
")",
"-",
">",
"in"
] | def find(s, *args):
"""find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
"""
return _apply(s.find, args... | [
"def",
"find",
"(",
"s",
",",
"*",
"args",
")",
":",
"return",
"_apply",
"(",
"s",
".",
"find",
",",
"args",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/stringold.py#L165-L175 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py | python | Treeview.delete | (self, *items) | Delete all specified items and all their descendants. The root
item may not be deleted. | Delete all specified items and all their descendants. The root
item may not be deleted. | [
"Delete",
"all",
"specified",
"items",
"and",
"all",
"their",
"descendants",
".",
"The",
"root",
"item",
"may",
"not",
"be",
"deleted",
"."
] | def delete(self, *items):
"""Delete all specified items and all their descendants. The root
item may not be deleted."""
self.tk.call(self._w, "delete", items) | [
"def",
"delete",
"(",
"self",
",",
"*",
"items",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"delete\"",
",",
"items",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L1250-L1253 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py | python | escape | (pattern) | Escape special characters in a string. | Escape special characters in a string. | [
"Escape",
"special",
"characters",
"in",
"a",
"string",
"."
] | def escape(pattern):
"""
Escape special characters in a string.
"""
if isinstance(pattern, str):
return pattern.translate(_special_chars_map)
else:
pattern = str(pattern, 'latin1')
return pattern.translate(_special_chars_map).encode('latin1') | [
"def",
"escape",
"(",
"pattern",
")",
":",
"if",
"isinstance",
"(",
"pattern",
",",
"str",
")",
":",
"return",
"pattern",
".",
"translate",
"(",
"_special_chars_map",
")",
"else",
":",
"pattern",
"=",
"str",
"(",
"pattern",
",",
"'latin1'",
")",
"return"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py#L254-L262 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | utils/pylit/pylit.py | python | execute | (infile="-", txt2code=True, **keyw) | Execute the input file. Convert first, if it is a text source. | Execute the input file. Convert first, if it is a text source. | [
"Execute",
"the",
"input",
"file",
".",
"Convert",
"first",
"if",
"it",
"is",
"a",
"text",
"source",
"."
] | def execute(infile="-", txt2code=True, **keyw):
"""Execute the input file. Convert first, if it is a text source.
"""
data = open(infile)
if txt2code:
data = str(Text2Code(data, **keyw))
# print("executing " + options.infile)
exec(data) | [
"def",
"execute",
"(",
"infile",
"=",
"\"-\"",
",",
"txt2code",
"=",
"True",
",",
"*",
"*",
"keyw",
")",
":",
"data",
"=",
"open",
"(",
"infile",
")",
"if",
"txt2code",
":",
"data",
"=",
"str",
"(",
"Text2Code",
"(",
"data",
",",
"*",
"*",
"keyw"... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/utils/pylit/pylit.py#L1670-L1678 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.