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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/bindings/python/llvm/core.py | python | LLVMEnumeration.register | (cls, name, value) | Registers a new enumeration.
This is called by this module for each enumeration defined in
enumerations. You should not need to call this outside this module. | Registers a new enumeration. | [
"Registers",
"a",
"new",
"enumeration",
"."
] | def register(cls, name, value):
"""Registers a new enumeration.
This is called by this module for each enumeration defined in
enumerations. You should not need to call this outside this module.
"""
if value in cls._value_map:
raise ValueError('%s value already regist... | [
"def",
"register",
"(",
"cls",
",",
"name",
",",
"value",
")",
":",
"if",
"value",
"in",
"cls",
".",
"_value_map",
":",
"raise",
"ValueError",
"(",
"'%s value already registered: %d'",
"%",
"(",
"cls",
".",
"__name__",
",",
"value",
")",
")",
"enum",
"="... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/bindings/python/llvm/core.py#L63-L74 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Widget.keypress | (self, c: str) | return _robotsim.Widget_keypress(self, c) | r"""
Args:
c (str) | r"""
Args:
c (str) | [
"r",
"Args",
":",
"c",
"(",
"str",
")"
] | def keypress(self, c: str) ->None:
r"""
Args:
c (str)
"""
return _robotsim.Widget_keypress(self, c) | [
"def",
"keypress",
"(",
"self",
",",
"c",
":",
"str",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"Widget_keypress",
"(",
"self",
",",
"c",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3341-L3346 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | masked_greater | (x, value, copy=True) | return masked_where(greater(x, value), x, copy=copy) | Mask an array where greater than a given value.
This function is a shortcut to ``masked_where``, with
`condition` = (x > value).
See Also
--------
masked_where : Mask where a condition is met.
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0,... | Mask an array where greater than a given value. | [
"Mask",
"an",
"array",
"where",
"greater",
"than",
"a",
"given",
"value",
"."
] | def masked_greater(x, value, copy=True):
"""
Mask an array where greater than a given value.
This function is a shortcut to ``masked_where``, with
`condition` = (x > value).
See Also
--------
masked_where : Mask where a condition is met.
Examples
--------
>>> import numpy.ma a... | [
"def",
"masked_greater",
"(",
"x",
",",
"value",
",",
"copy",
"=",
"True",
")",
":",
"return",
"masked_where",
"(",
"greater",
"(",
"x",
",",
"value",
")",
",",
"x",
",",
"copy",
"=",
"copy",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L1954-L1977 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/scripts/utility.py | python | initialize_variables | (sess, saver, logdir, checkpoint=None, resume=None) | Initialize or restore variables from a checkpoint if available.
Args:
sess: Session to initialize variables in.
saver: Saver to restore variables.
logdir: Directory to search for checkpoints.
checkpoint: Specify what checkpoint name to use; defaults to most recent.
resume: Whether to expect recov... | Initialize or restore variables from a checkpoint if available. | [
"Initialize",
"or",
"restore",
"variables",
"from",
"a",
"checkpoint",
"if",
"available",
"."
] | def initialize_variables(sess, saver, logdir, checkpoint=None, resume=None):
"""Initialize or restore variables from a checkpoint if available.
Args:
sess: Session to initialize variables in.
saver: Saver to restore variables.
logdir: Directory to search for checkpoints.
checkpoint: Specify what ch... | [
"def",
"initialize_variables",
"(",
"sess",
",",
"saver",
",",
"logdir",
",",
"checkpoint",
"=",
"None",
",",
"resume",
"=",
"None",
")",
":",
"sess",
".",
"run",
"(",
"tf",
".",
"group",
"(",
"tf",
".",
"local_variables_initializer",
"(",
")",
",",
"t... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/scripts/utility.py#L118-L145 | ||
sfzhang15/RefineDet | 52b6fe23dc1a160fe710b7734576dca509bf4fae | tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/tools/extra/parse_log.py#L79-L118 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | CloseEvent.GetLoggingOff | (*args, **kwargs) | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) | GetLoggingOff(self) -> bool
Returns ``True`` if the user is logging off or ``False`` if the
system is shutting down. This method can only be called for end
session and query end session events, it doesn't make sense for close
window event. | GetLoggingOff(self) -> bool | [
"GetLoggingOff",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetLoggingOff(*args, **kwargs):
"""
GetLoggingOff(self) -> bool
Returns ``True`` if the user is logging off or ``False`` if the
system is shutting down. This method can only be called for end
session and query end session events, it doesn't make sense for close
windo... | [
"def",
"GetLoggingOff",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"CloseEvent_GetLoggingOff",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L6516-L6525 | |
CleverRaven/Cataclysm-DDA | 03e7363df0835ec1b39da973ea29f26f27833b38 | tools/generate_changelog.py | python | PullRequestApiGenerator.generate | (self) | Returns an HTTP request to get Pull Requests for a different API
result page each call until deactivate(). | Returns an HTTP request to get Pull Requests for a different API
result page each call until deactivate(). | [
"Returns",
"an",
"HTTP",
"request",
"to",
"get",
"Pull",
"Requests",
"for",
"a",
"different",
"API",
"result",
"page",
"each",
"call",
"until",
"deactivate",
"()",
"."
] | def generate(self):
"""Returns an HTTP request to get Pull Requests for a different API
result page each call until deactivate()."""
with self.lock:
if self.is_active:
req = self.create_request(self.state, self.page)
self.page += self.step
... | [
"def",
"generate",
"(",
"self",
")",
":",
"with",
"self",
".",
"lock",
":",
"if",
"self",
".",
"is_active",
":",
"req",
"=",
"self",
".",
"create_request",
"(",
"self",
".",
"state",
",",
"self",
".",
"page",
")",
"self",
".",
"page",
"+=",
"self",... | https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/generate_changelog.py#L899-L908 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimelike.py | python | DatetimeLikeArrayMixin._sub_nat | (self) | return result.view("timedelta64[ns]") | Subtract pd.NaT from self | Subtract pd.NaT from self | [
"Subtract",
"pd",
".",
"NaT",
"from",
"self"
] | def _sub_nat(self):
"""
Subtract pd.NaT from self
"""
# GH#19124 Timedelta - datetime is not in general well-defined.
# We make an exception for pd.NaT, which in this case quacks
# like a timedelta.
# For datetime64 dtypes by convention we treat NaT as a datetime,... | [
"def",
"_sub_nat",
"(",
"self",
")",
":",
"# GH#19124 Timedelta - datetime is not in general well-defined.",
"# We make an exception for pd.NaT, which in this case quacks",
"# like a timedelta.",
"# For datetime64 dtypes by convention we treat NaT as a datetime, so",
"# this subtraction returns ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimelike.py#L1198-L1210 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/dateutil/dateutil/tz/_common.py | python | tzrangebase.fromutc | (self, dt) | return enfold(dt_wall, fold=_fold) | Given a datetime in UTC, return local time | Given a datetime in UTC, return local time | [
"Given",
"a",
"datetime",
"in",
"UTC",
"return",
"local",
"time"
] | def fromutc(self, dt):
""" Given a datetime in UTC, return local time """
if not isinstance(dt, datetime):
raise TypeError("fromutc() requires a datetime argument")
if dt.tzinfo is not self:
raise ValueError("dt.tzinfo is not self")
# Get transitions - if there ... | [
"def",
"fromutc",
"(",
"self",
",",
"dt",
")",
":",
"if",
"not",
"isinstance",
"(",
"dt",
",",
"datetime",
")",
":",
"raise",
"TypeError",
"(",
"\"fromutc() requires a datetime argument\"",
")",
"if",
"dt",
".",
"tzinfo",
"is",
"not",
"self",
":",
"raise",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/dateutil/dateutil/tz/_common.py#L319-L350 | |
whai362/PSENet | 4d95395658662f2223805c36dcd573d9e190ce26 | eval/tt_rec/rrc_evaluation_funcs_1_1.py | python | main_evaluation | (p,default_evaluation_params_fn,validate_data_fn,evaluate_method_fn,show_result=True,per_sample=True) | return resDict | This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample.
Params:
p: Dictionary of parmeters with the GT/submission locations. If None is passed, the parameters send by the system are used.
default_evaluation_params_fn: points to a function that r... | This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample.
Params:
p: Dictionary of parmeters with the GT/submission locations. If None is passed, the parameters send by the system are used.
default_evaluation_params_fn: points to a function that r... | [
"This",
"process",
"validates",
"a",
"method",
"evaluates",
"it",
"and",
"if",
"it",
"succed",
"generates",
"a",
"ZIP",
"file",
"with",
"a",
"JSON",
"entry",
"for",
"each",
"sample",
".",
"Params",
":",
"p",
":",
"Dictionary",
"of",
"parmeters",
"with",
... | def main_evaluation(p,default_evaluation_params_fn,validate_data_fn,evaluate_method_fn,show_result=True,per_sample=True):
"""
This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample.
Params:
p: Dictionary of parmeters with the GT/submission l... | [
"def",
"main_evaluation",
"(",
"p",
",",
"default_evaluation_params_fn",
",",
"validate_data_fn",
",",
"evaluate_method_fn",
",",
"show_result",
"=",
"True",
",",
"per_sample",
"=",
"True",
")",
":",
"# if (p == None):",
"# p = dict([s[1:].split('=') for s in sys.argv[1... | https://github.com/whai362/PSENet/blob/4d95395658662f2223805c36dcd573d9e190ce26/eval/tt_rec/rrc_evaluation_funcs_1_1.py#L371-L436 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/diis.py | python | normalize_input | (x) | return square / square.sum() | Transform input vector to be normalized and have positive components only. | Transform input vector to be normalized and have positive components only. | [
"Transform",
"input",
"vector",
"to",
"be",
"normalized",
"and",
"have",
"positive",
"components",
"only",
"."
] | def normalize_input(x):
""" Transform input vector to be normalized and have positive components only. """
square = x ** 2
return square / square.sum() | [
"def",
"normalize_input",
"(",
"x",
")",
":",
"square",
"=",
"x",
"**",
"2",
"return",
"square",
"/",
"square",
".",
"sum",
"(",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/diis.py#L26-L29 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/util.py | python | convert_path | (pathname) | return os.path.join(*paths) | Return 'pathname' as a name that will work on the native filesystem.
The path is split on '/' and put back together again using the current
directory separator. Needed because filenames in the setup script are
always supplied in Unix style, and have to be converted to the local
convention before we ca... | Return 'pathname' as a name that will work on the native filesystem. | [
"Return",
"pathname",
"as",
"a",
"name",
"that",
"will",
"work",
"on",
"the",
"native",
"filesystem",
"."
] | def convert_path(pathname):
"""Return 'pathname' as a name that will work on the native filesystem.
The path is split on '/' and put back together again using the current
directory separator. Needed because filenames in the setup script are
always supplied in Unix style, and have to be converted to th... | [
"def",
"convert_path",
"(",
"pathname",
")",
":",
"if",
"os",
".",
"sep",
"==",
"'/'",
":",
"return",
"pathname",
"if",
"not",
"pathname",
":",
"return",
"pathname",
"if",
"pathname",
"[",
"0",
"]",
"==",
"'/'",
":",
"raise",
"ValueError",
"(",
"\"path... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/util.py#L451-L475 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/utils/path.py | python | ensure_dir_exists | (path, mode=0o755) | ensure that a directory exists
If it doesn't exist, try to create it and protect against a race condition
if another process is doing the same.
The default permissions are 755, which differ from os.makedirs default of 777. | ensure that a directory exists | [
"ensure",
"that",
"a",
"directory",
"exists"
] | def ensure_dir_exists(path, mode=0o755):
"""ensure that a directory exists
If it doesn't exist, try to create it and protect against a race condition
if another process is doing the same.
The default permissions are 755, which differ from os.makedirs default of 777.
"""
if not os.path.exists(p... | [
"def",
"ensure_dir_exists",
"(",
"path",
",",
"mode",
"=",
"0o755",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"path",
",",
"mode",
"=",
"mode",
")",
"except",
"OSError",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/utils/path.py#L421-L436 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/codecontext.py | python | CodeContext.__del__ | (self) | Cancel scheduled events. | Cancel scheduled events. | [
"Cancel",
"scheduled",
"events",
"."
] | def __del__(self):
"Cancel scheduled events."
if self.t1 is not None:
try:
self.text.after_cancel(self.t1)
except tkinter.TclError: # pragma: no cover
pass
self.t1 = None | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"self",
".",
"t1",
"is",
"not",
"None",
":",
"try",
":",
"self",
".",
"text",
".",
"after_cancel",
"(",
"self",
".",
"t1",
")",
"except",
"tkinter",
".",
"TclError",
":",
"# pragma: no cover",
"pass",
"s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/codecontext.py#L81-L88 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/PythonUtil.py | python | printNumberedTyped | (items, maxLen=5000) | print out each item of the list on its own line,
with each item numbered on the left from zero | print out each item of the list on its own line,
with each item numbered on the left from zero | [
"print",
"out",
"each",
"item",
"of",
"the",
"list",
"on",
"its",
"own",
"line",
"with",
"each",
"item",
"numbered",
"on",
"the",
"left",
"from",
"zero"
] | def printNumberedTyped(items, maxLen=5000):
"""print out each item of the list on its own line,
with each item numbered on the left from zero"""
digits = 0
n = len(items)
while n > 0:
digits += 1
n //= 10
format = '%0' + '%s' % digits + 'i:%s \t%s'
for i in range(len(items)):... | [
"def",
"printNumberedTyped",
"(",
"items",
",",
"maxLen",
"=",
"5000",
")",
":",
"digits",
"=",
"0",
"n",
"=",
"len",
"(",
"items",
")",
"while",
"n",
">",
"0",
":",
"digits",
"+=",
"1",
"n",
"//=",
"10",
"format",
"=",
"'%0'",
"+",
"'%s'",
"%",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/PythonUtil.py#L1617-L1631 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/ecmametadatapass.py | python | EcmaMetaDataPass._EndStatement | (self) | Process the end of a statement. | Process the end of a statement. | [
"Process",
"the",
"end",
"of",
"a",
"statement",
"."
] | def _EndStatement(self):
"""Process the end of a statement."""
self._PopContextType(EcmaContext.STATEMENT)
if self._context.type == EcmaContext.IMPLIED_BLOCK:
self._token.metadata.is_implied_block_close = True
self._PopContext() | [
"def",
"_EndStatement",
"(",
"self",
")",
":",
"self",
".",
"_PopContextType",
"(",
"EcmaContext",
".",
"STATEMENT",
")",
"if",
"self",
".",
"_context",
".",
"type",
"==",
"EcmaContext",
".",
"IMPLIED_BLOCK",
":",
"self",
".",
"_token",
".",
"metadata",
".... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/ecmametadatapass.py#L246-L251 | ||
vmware/concord-bft | ec036a384b4c81be0423d4b429bd37900b13b864 | util/pyclient/bft_client.py | python | TcpTlsClient._get_cert_path | (self, replica_id, *, is_client) | return os.path.join(self.config.certs_path, str(replica_id), cert_type, cert_type + ".cert") | Certificate is under <certificate root path>/replica_id/<node type>/cert.pem,
where node type is "server" or "client". | Certificate is under <certificate root path>/replica_id/<node type>/cert.pem,
where node type is "server" or "client". | [
"Certificate",
"is",
"under",
"<certificate",
"root",
"path",
">",
"/",
"replica_id",
"/",
"<node",
"type",
">",
"/",
"cert",
".",
"pem",
"where",
"node",
"type",
"is",
"server",
"or",
"client",
"."
] | def _get_cert_path(self, replica_id, *, is_client):
"""
Certificate is under <certificate root path>/replica_id/<node type>/cert.pem,
where node type is "server" or "client".
"""
cert_type = "client" if is_client else "server"
return os.path.join(self.config.certs_path, s... | [
"def",
"_get_cert_path",
"(",
"self",
",",
"replica_id",
",",
"*",
",",
"is_client",
")",
":",
"cert_type",
"=",
"\"client\"",
"if",
"is_client",
"else",
"\"server\"",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"config",
".",
"certs_path",... | https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/util/pyclient/bft_client.py#L468-L474 | |
facebookresearch/ELF | 1f790173095cd910976d9f651b80beb872ec5d12 | rlpytorch/methods/utils.py | python | add_stats | (stats, key, value) | Feed ``value`` to ``stats[key]`` | Feed ``value`` to ``stats[key]`` | [
"Feed",
"value",
"to",
"stats",
"[",
"key",
"]"
] | def add_stats(stats, key, value):
''' Feed ``value`` to ``stats[key]``'''
if stats:
stats[key].feed(value) | [
"def",
"add_stats",
"(",
"stats",
",",
"key",
",",
"value",
")",
":",
"if",
"stats",
":",
"stats",
"[",
"key",
"]",
".",
"feed",
"(",
"value",
")"
] | https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/methods/utils.py#L56-L59 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/offline_debug/dbg_services.py | python | Parameter.hit | (self) | return self.instance.get_hit() | Function to receive Parameter hit value.
Returns:
hit of Parameter instance (bool).
Examples:
>>> from mindspore.ccsrc.debug.debugger.offline_debug import dbg_services
>>> parameter = dbg_services.Parameter(name="param",
... ... | Function to receive Parameter hit value. | [
"Function",
"to",
"receive",
"Parameter",
"hit",
"value",
"."
] | def hit(self):
"""
Function to receive Parameter hit value.
Returns:
hit of Parameter instance (bool).
Examples:
>>> from mindspore.ccsrc.debug.debugger.offline_debug import dbg_services
>>> parameter = dbg_services.Parameter(name="param",
... | [
"def",
"hit",
"(",
"self",
")",
":",
"return",
"self",
".",
"instance",
".",
"get_hit",
"(",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/offline_debug/dbg_services.py#L1339-L1355 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/nn/python/ops/scaled_softplus.py | python | _reduce_and_reshape_grad | (g, t) | return array_ops.reshape(math_ops.reduce_sum(g, bcast_dims), shape) | Returns the gradient, sum-reduced and reshaped to `t`'s shape. | Returns the gradient, sum-reduced and reshaped to `t`'s shape. | [
"Returns",
"the",
"gradient",
"sum",
"-",
"reduced",
"and",
"reshaped",
"to",
"t",
"s",
"shape",
"."
] | def _reduce_and_reshape_grad(g, t):
"""Returns the gradient, sum-reduced and reshaped to `t`'s shape."""
shape = array_ops.shape(t)
g_shape = array_ops.shape(g)
bcast_dims, _ = gen_array_ops.broadcast_gradient_args(shape, g_shape)
return array_ops.reshape(math_ops.reduce_sum(g, bcast_dims), shape) | [
"def",
"_reduce_and_reshape_grad",
"(",
"g",
",",
"t",
")",
":",
"shape",
"=",
"array_ops",
".",
"shape",
"(",
"t",
")",
"g_shape",
"=",
"array_ops",
".",
"shape",
"(",
"g",
")",
"bcast_dims",
",",
"_",
"=",
"gen_array_ops",
".",
"broadcast_gradient_args",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/nn/python/ops/scaled_softplus.py#L29-L34 | |
JDAI-CV/DNNLibrary | e17f11e966b2cce7d747799b76bb9843813d4b01 | quant.py | python | set_quant_info_of_bias | (m: onnx.ModelProto, quant_layers: List[str]) | NNAPI requires scales[bias] equals scales[input]*scales[weight] and zps[scale]=0
:param m: the model
:param quant_layers: layers need to be quantized | NNAPI requires scales[bias] equals scales[input]*scales[weight] and zps[scale]=0
:param m: the model
:param quant_layers: layers need to be quantized | [
"NNAPI",
"requires",
"scales",
"[",
"bias",
"]",
"equals",
"scales",
"[",
"input",
"]",
"*",
"scales",
"[",
"weight",
"]",
"and",
"zps",
"[",
"scale",
"]",
"=",
"0",
":",
"param",
"m",
":",
"the",
"model",
":",
"param",
"quant_layers",
":",
"layers",... | def set_quant_info_of_bias(m: onnx.ModelProto, quant_layers: List[str]) -> None:
"""
NNAPI requires scales[bias] equals scales[input]*scales[weight] and zps[scale]=0
:param m: the model
:param quant_layers: layers need to be quantized
"""
for node in m.graph.node:
if node.name not in qua... | [
"def",
"set_quant_info_of_bias",
"(",
"m",
":",
"onnx",
".",
"ModelProto",
",",
"quant_layers",
":",
"List",
"[",
"str",
"]",
")",
"->",
"None",
":",
"for",
"node",
"in",
"m",
".",
"graph",
".",
"node",
":",
"if",
"node",
".",
"name",
"not",
"in",
... | https://github.com/JDAI-CV/DNNLibrary/blob/e17f11e966b2cce7d747799b76bb9843813d4b01/quant.py#L161-L176 | ||
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | applications/GesturePod/training/genDataHeader.py | python | loadTLCMatrices | (dfolder) | return W, B, Z | Loads Matrices B, W and Z from TLC format | Loads Matrices B, W and Z from TLC format | [
"Loads",
"Matrices",
"B",
"W",
"and",
"Z",
"from",
"TLC",
"format"
] | def loadTLCMatrices(dfolder):
'''
Loads Matrices B, W and Z from TLC format
'''
# W is stored as d_cap x d
df = pd.read_csv(dfolder + 'W', sep='\t', header=None)
W = np.matrix(df)
d_cap = W.shape[0]
# B is stored as d_cap x m
df = pd.read_csv(dfolder + 'B', sep='\t', header=None)
... | [
"def",
"loadTLCMatrices",
"(",
"dfolder",
")",
":",
"# W is stored as d_cap x d",
"df",
"=",
"pd",
".",
"read_csv",
"(",
"dfolder",
"+",
"'W'",
",",
"sep",
"=",
"'\\t'",
",",
"header",
"=",
"None",
")",
"W",
"=",
"np",
".",
"matrix",
"(",
"df",
")",
... | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/applications/GesturePod/training/genDataHeader.py#L14-L34 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _AsinGrad | (op, grad) | Returns grad * 1/sqrt(1-x^2). | Returns grad * 1/sqrt(1-x^2). | [
"Returns",
"grad",
"*",
"1",
"/",
"sqrt",
"(",
"1",
"-",
"x^2",
")",
"."
] | def _AsinGrad(op, grad):
"""Returns grad * 1/sqrt(1-x^2)."""
x = op.inputs[0]
with ops.control_dependencies([grad.op]):
x2 = math_ops.square(x)
one = constant_op.constant(1, dtype=grad.dtype)
den = math_ops.sqrt(math_ops.sub(one, x2))
inv = math_ops.inv(den)
return grad * inv | [
"def",
"_AsinGrad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
"grad",
".",
"op",
"]",
")",
":",
"x2",
"=",
"math_ops",
".",
"square",
"(",
"x",
")",
"on... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L452-L460 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/EditorLib/ThresholdEffect.py | python | ThresholdEffectTool.processEvent | (self, caller=None, event=None) | handle events from the render window interactor | handle events from the render window interactor | [
"handle",
"events",
"from",
"the",
"render",
"window",
"interactor"
] | def processEvent(self, caller=None, event=None):
"""
handle events from the render window interactor
"""
# TODO: might want to do something special here, like
# adjust the threshold based on a gesture in the slice
# view - but for now everything is driven by the options gui
pass | [
"def",
"processEvent",
"(",
"self",
",",
"caller",
"=",
"None",
",",
"event",
"=",
"None",
")",
":",
"# TODO: might want to do something special here, like",
"# adjust the threshold based on a gesture in the slice",
"# view - but for now everything is driven by the options gui",
"p... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/ThresholdEffect.py#L246-L254 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.set_treeview_font | (self) | Update the TreeView Font | Update the TreeView Font | [
"Update",
"the",
"TreeView",
"Font"
] | def set_treeview_font(self):
"""Update the TreeView Font"""
self.renderer_text.set_property('font-desc', pango.FontDescription(self.tree_font))
self.treeview_refresh() | [
"def",
"set_treeview_font",
"(",
"self",
")",
":",
"self",
".",
"renderer_text",
".",
"set_property",
"(",
"'font-desc'",
",",
"pango",
".",
"FontDescription",
"(",
"self",
".",
"tree_font",
")",
")",
"self",
".",
"treeview_refresh",
"(",
")"
] | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L1476-L1479 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py | python | undefine | (self, key) | Remove a define from conf.env.DEFINES
:param key: define name
:type key: string | Remove a define from conf.env.DEFINES | [
"Remove",
"a",
"define",
"from",
"conf",
".",
"env",
".",
"DEFINES"
] | def undefine(self, key):
"""
Remove a define from conf.env.DEFINES
:param key: define name
:type key: string
"""
assert key and isinstance(key, str)
ban = key + '='
lst = [x for x in self.env['DEFINES'] if not x.startswith(ban)]
self.env['DEFINES'] = lst
self.env.append_unique(DEFKEYS, key) | [
"def",
"undefine",
"(",
"self",
",",
"key",
")",
":",
"assert",
"key",
"and",
"isinstance",
"(",
"key",
",",
"str",
")",
"ban",
"=",
"key",
"+",
"'='",
"lst",
"=",
"[",
"x",
"for",
"x",
"in",
"self",
".",
"env",
"[",
"'DEFINES'",
"]",
"if",
"no... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py#L837-L849 | ||
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | scripts/cpp_lint.py | python | _CppLintState.ResetErrorCounts | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCounts(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errors_by_category = {} | [
"def",
"ResetErrorCounts",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errors_by_category",
"=",
"{",
"}"
] | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L742-L745 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/MdDocPage.py | python | MdDocPage.__call__ | (self, args) | Main execution point.
Calls the accept method on each visitor to generate the code. | Main execution point.
Calls the accept method on each visitor to generate the code. | [
"Main",
"execution",
"point",
".",
"Calls",
"the",
"accept",
"method",
"on",
"each",
"visitor",
"to",
"generate",
"the",
"code",
"."
] | def __call__(self, args):
"""
Main execution point.
Calls the accept method on each visitor to generate the code.
"""
# Note that name handling for params goes
# here so that the visitor in accept can
# process all.
self.__obj = args
for v in self.... | [
"def",
"__call__",
"(",
"self",
",",
"args",
")",
":",
"# Note that name handling for params goes",
"# here so that the visitor in accept can",
"# process all.",
"self",
".",
"__obj",
"=",
"args",
"for",
"v",
"in",
"self",
".",
"__visitor_list",
":",
"self",
".",
"a... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/MdDocPage.py#L57-L67 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/exodus/ExodusResult.py | python | ExodusResult.getCenter | (self) | return ((b[0]-a[0])/2., (b[1]-a[1])/2., (b[2]-a[2])/2.) | Return the center (based on the bounds) of all the objects. | Return the center (based on the bounds) of all the objects. | [
"Return",
"the",
"center",
"(",
"based",
"on",
"the",
"bounds",
")",
"of",
"all",
"the",
"objects",
"."
] | def getCenter(self):
"""
Return the center (based on the bounds) of all the objects.
"""
a, b = self.getBounds()
return ((b[0]-a[0])/2., (b[1]-a[1])/2., (b[2]-a[2])/2.) | [
"def",
"getCenter",
"(",
"self",
")",
":",
"a",
",",
"b",
"=",
"self",
".",
"getBounds",
"(",
")",
"return",
"(",
"(",
"b",
"[",
"0",
"]",
"-",
"a",
"[",
"0",
"]",
")",
"/",
"2.",
",",
"(",
"b",
"[",
"1",
"]",
"-",
"a",
"[",
"1",
"]",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/exodus/ExodusResult.py#L98-L103 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/perf/measurements/endure.py | python | Endure.DidStartBrowser | (self, browser) | Saves the Browser object. Called after the browser is started. | Saves the Browser object. Called after the browser is started. | [
"Saves",
"the",
"Browser",
"object",
".",
"Called",
"after",
"the",
"browser",
"is",
"started",
"."
] | def DidStartBrowser(self, browser):
"""Saves the Browser object. Called after the browser is started."""
self._browser = browser | [
"def",
"DidStartBrowser",
"(",
"self",
",",
"browser",
")",
":",
"self",
".",
"_browser",
"=",
"browser"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/measurements/endure.py#L74-L76 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/utils/check_cfc/check_cfc.py | python | derive_output_file | (args) | Derive output file from the input file (if just one) or None
otherwise. | Derive output file from the input file (if just one) or None
otherwise. | [
"Derive",
"output",
"file",
"from",
"the",
"input",
"file",
"(",
"if",
"just",
"one",
")",
"or",
"None",
"otherwise",
"."
] | def derive_output_file(args):
"""Derive output file from the input file (if just one) or None
otherwise."""
infile = get_input_file(args)
if infile is None:
return None
else:
return '{}.o'.format(os.path.splitext(infile)[0]) | [
"def",
"derive_output_file",
"(",
"args",
")",
":",
"infile",
"=",
"get_input_file",
"(",
"args",
")",
"if",
"infile",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"'{}.o'",
".",
"format",
"(",
"os",
".",
"path",
".",
"splitext",
"(",
"i... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/utils/check_cfc/check_cfc.py#L118-L125 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/window/common.py | python | WindowGroupByMixin._apply | (
self,
func: Callable,
center: bool,
require_min_periods: int = 0,
floor: int = 1,
is_weighted: bool = False,
name: Optional[str] = None,
use_numba_cache: bool = False,
**kwargs,
) | return self._groupby.apply(f) | Dispatch to apply; we are stripping all of the _apply kwargs and
performing the original function call on the grouped object. | Dispatch to apply; we are stripping all of the _apply kwargs and
performing the original function call on the grouped object. | [
"Dispatch",
"to",
"apply",
";",
"we",
"are",
"stripping",
"all",
"of",
"the",
"_apply",
"kwargs",
"and",
"performing",
"the",
"original",
"function",
"call",
"on",
"the",
"grouped",
"object",
"."
] | def _apply(
self,
func: Callable,
center: bool,
require_min_periods: int = 0,
floor: int = 1,
is_weighted: bool = False,
name: Optional[str] = None,
use_numba_cache: bool = False,
**kwargs,
):
"""
Dispatch to apply; we are strip... | [
"def",
"_apply",
"(",
"self",
",",
"func",
":",
"Callable",
",",
"center",
":",
"bool",
",",
"require_min_periods",
":",
"int",
"=",
"0",
",",
"floor",
":",
"int",
"=",
"1",
",",
"is_weighted",
":",
"bool",
"=",
"False",
",",
"name",
":",
"Optional",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/window/common.py#L65-L91 | |
Qihoo360/mongosync | 55b647e81c072ebe91daaa3b9dc1a953c3c22e19 | dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if no Copyright message appears at the top of the file. | Logs an error if no Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"no",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if no Copyright message appears at the top of the file."""
# We'll say it should occur by line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if re.search(r'Copyright', lines[line], re.I): bre... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll say it should occur by line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
","... | https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L1007-L1017 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | onnxruntime/python/tools/quantization/quant_utils.py | python | write_calibration_table | (calibration_cache) | Helper function to write calibration table to files. | Helper function to write calibration table to files. | [
"Helper",
"function",
"to",
"write",
"calibration",
"table",
"to",
"files",
"."
] | def write_calibration_table(calibration_cache):
'''
Helper function to write calibration table to files.
'''
import json
import flatbuffers
import onnxruntime.quantization.CalTableFlatBuffers.TrtTable as TrtTable
import onnxruntime.quantization.CalTableFlatBuffers.KeyValue as KeyValue
... | [
"def",
"write_calibration_table",
"(",
"calibration_cache",
")",
":",
"import",
"json",
"import",
"flatbuffers",
"import",
"onnxruntime",
".",
"quantization",
".",
"CalTableFlatBuffers",
".",
"TrtTable",
"as",
"TrtTable",
"import",
"onnxruntime",
".",
"quantization",
... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/quantization/quant_utils.py#L346-L408 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeExportEnvString | (self, env) | return ' '.join(export_str) | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | [
"Given",
"an",
"environment",
"returns",
"a",
"string",
"looking",
"like",
"export",
"FOO",
"=",
"foo",
";",
"export",
"BAR",
"=",
"$",
"{",
"FOO",
"}",
"bar",
";",
"that",
"exports",
"|env|",
"to",
"the",
"shell",
"."
] | def ComputeExportEnvString(self, env):
"""Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell."""
export_str = []
for k, v in env:
export_str.append('export %s=%s;' %
(k, ninja_syntax.escape(gyp.common.Enco... | [
"def",
"ComputeExportEnvString",
"(",
"self",
",",
"env",
")",
":",
"export_str",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"env",
":",
"export_str",
".",
"append",
"(",
"'export %s=%s;'",
"%",
"(",
"k",
",",
"ninja_syntax",
".",
"escape",
"(",
"gyp",... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/ninja.py#L1426-L1434 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/spatial/distance.py | python | hamming | (u, v, w=None) | return np.average(u_ne_v, weights=w) | Compute the Hamming distance between two 1-D arrays.
The Hamming distance between 1-D arrays `u` and `v`, is simply the
proportion of disagreeing components in `u` and `v`. If `u` and `v` are
boolean vectors, the Hamming distance is
.. math::
\\frac{c_{01} + c_{10}}{n}
where :math:`c_{ij}... | Compute the Hamming distance between two 1-D arrays. | [
"Compute",
"the",
"Hamming",
"distance",
"between",
"two",
"1",
"-",
"D",
"arrays",
"."
] | def hamming(u, v, w=None):
"""
Compute the Hamming distance between two 1-D arrays.
The Hamming distance between 1-D arrays `u` and `v`, is simply the
proportion of disagreeing components in `u` and `v`. If `u` and `v` are
boolean vectors, the Hamming distance is
.. math::
\\frac{c_{01... | [
"def",
"hamming",
"(",
"u",
",",
"v",
",",
"w",
"=",
"None",
")",
":",
"u",
"=",
"_validate_vector",
"(",
"u",
")",
"v",
"=",
"_validate_vector",
"(",
"v",
")",
"if",
"u",
".",
"shape",
"!=",
"v",
".",
"shape",
":",
"raise",
"ValueError",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/spatial/distance.py#L751-L802 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py | python | Client.message_callback_remove | (self, sub) | Remove a message callback previously registered with
message_callback_add(). | Remove a message callback previously registered with
message_callback_add(). | [
"Remove",
"a",
"message",
"callback",
"previously",
"registered",
"with",
"message_callback_add",
"()",
"."
] | def message_callback_remove(self, sub):
"""Remove a message callback previously registered with
message_callback_add()."""
if sub is None:
raise ValueError("sub must defined.")
self._callback_mutex.acquire()
for i in range(0, len(self.on_message_filtered)):
... | [
"def",
"message_callback_remove",
"(",
"self",
",",
"sub",
")",
":",
"if",
"sub",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"sub must defined.\"",
")",
"self",
".",
"_callback_mutex",
".",
"acquire",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"0",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py#L1448-L1460 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/feature_column.py | python | _RealValuedColumn.key | (self) | return self._key_without_properties(["normalizer"]) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
return self._key_without_properties(["normalizer"]) | [
"def",
"key",
"(",
"self",
")",
":",
"return",
"self",
".",
"_key_without_properties",
"(",
"[",
"\"normalizer\"",
"]",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column.py#L1185-L1187 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/cr/cr/context.py | python | Context.AddCommonArguments | (cls, parser) | Adds the command line arguments common to all commands in cr. | Adds the command line arguments common to all commands in cr. | [
"Adds",
"the",
"command",
"line",
"arguments",
"common",
"to",
"all",
"commands",
"in",
"cr",
"."
] | def AddCommonArguments(cls, parser):
"""Adds the command line arguments common to all commands in cr."""
parser.add_argument(
'-h', '--help',
action=_ShowHelp, nargs=0,
help='show the help message and exit.'
)
parser.add_argument(
'--dry-run', dest='CR_DRY_RUN',
a... | [
"def",
"AddCommonArguments",
"(",
"cls",
",",
"parser",
")",
":",
"parser",
".",
"add_argument",
"(",
"'-h'",
",",
"'--help'",
",",
"action",
"=",
"_ShowHelp",
",",
"nargs",
"=",
"0",
",",
"help",
"=",
"'show the help message and exit.'",
")",
"parser",
".",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/context.py#L134-L157 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/cluster/hierarchy.py | python | is_valid_linkage | (Z, warning=False, throw=False, name=None) | return valid | Checks the validity of a linkage matrix.
A linkage matrix is valid if it is a two dimensional array (type double)
with :math:`n` rows and 4 columns. The first two columns must contain
indices between 0 and :math:`2n-1`. For a given row ``i``, the following
two expressions have to hold:
.. math::
... | Checks the validity of a linkage matrix. | [
"Checks",
"the",
"validity",
"of",
"a",
"linkage",
"matrix",
"."
] | def is_valid_linkage(Z, warning=False, throw=False, name=None):
"""
Checks the validity of a linkage matrix.
A linkage matrix is valid if it is a two dimensional array (type double)
with :math:`n` rows and 4 columns. The first two columns must contain
indices between 0 and :math:`2n-1`. For a give... | [
"def",
"is_valid_linkage",
"(",
"Z",
",",
"warning",
"=",
"False",
",",
"throw",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"Z",
"=",
"np",
".",
"asarray",
"(",
"Z",
",",
"order",
"=",
"'c'",
")",
"valid",
"=",
"True",
"name_str",
"=",
"\"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/cluster/hierarchy.py#L1367-L1445 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | apps/ngs_roi/tool_shed/ctd2galaxy.py | python | XMLWriter.appendTag | (self, tag, text='', args={}) | Append a tag to self.result with text content only or no content at all. | Append a tag to self.result with text content only or no content at all. | [
"Append",
"a",
"tag",
"to",
"self",
".",
"result",
"with",
"text",
"content",
"only",
"or",
"no",
"content",
"at",
"all",
"."
] | def appendTag(self, tag, text='', args={}):
"""Append a tag to self.result with text content only or no content at all."""
e = xml.sax.saxutils.quoteattr
args_str = ' '.join('%s=%s' % (key, e(str(value))) for key, value in args.items() if value is not None)
if args_str:
args_... | [
"def",
"appendTag",
"(",
"self",
",",
"tag",
",",
"text",
"=",
"''",
",",
"args",
"=",
"{",
"}",
")",
":",
"e",
"=",
"xml",
".",
"sax",
".",
"saxutils",
".",
"quoteattr",
"args_str",
"=",
"' '",
".",
"join",
"(",
"'%s=%s'",
"%",
"(",
"key",
","... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/apps/ngs_roi/tool_shed/ctd2galaxy.py#L315-L328 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBProcess.SaveCore | (self, file_name) | return _lldb.SBProcess_SaveCore(self, file_name) | SaveCore(SBProcess self, char const * file_name) -> SBError | SaveCore(SBProcess self, char const * file_name) -> SBError | [
"SaveCore",
"(",
"SBProcess",
"self",
"char",
"const",
"*",
"file_name",
")",
"-",
">",
"SBError"
] | def SaveCore(self, file_name):
"""SaveCore(SBProcess self, char const * file_name) -> SBError"""
return _lldb.SBProcess_SaveCore(self, file_name) | [
"def",
"SaveCore",
"(",
"self",
",",
"file_name",
")",
":",
"return",
"_lldb",
".",
"SBProcess_SaveCore",
"(",
"self",
",",
"file_name",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8775-L8777 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py | python | BuildFileTargets | (target_list, build_file) | return [p for p in target_list if BuildFile(p) == build_file] | From a target_list, returns the subset from the specified build_file. | From a target_list, returns the subset from the specified build_file. | [
"From",
"a",
"target_list",
"returns",
"the",
"subset",
"from",
"the",
"specified",
"build_file",
"."
] | def BuildFileTargets(target_list, build_file):
"""From a target_list, returns the subset from the specified build_file.
"""
return [p for p in target_list if BuildFile(p) == build_file] | [
"def",
"BuildFileTargets",
"(",
"target_list",
",",
"build_file",
")",
":",
"return",
"[",
"p",
"for",
"p",
"in",
"target_list",
"if",
"BuildFile",
"(",
"p",
")",
"==",
"build_file",
"]"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py#L315-L318 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/compiler.py | python | CodeGenerator.push_parameter_definitions | (self, frame) | Pushes all parameter targets from the given frame into a local
stack that permits tracking of yet to be assigned parameters. In
particular this enables the optimization from `visit_Name` to skip
undefined expressions for parameters in macros as macros can reference
otherwise unbound par... | Pushes all parameter targets from the given frame into a local
stack that permits tracking of yet to be assigned parameters. In
particular this enables the optimization from `visit_Name` to skip
undefined expressions for parameters in macros as macros can reference
otherwise unbound par... | [
"Pushes",
"all",
"parameter",
"targets",
"from",
"the",
"given",
"frame",
"into",
"a",
"local",
"stack",
"that",
"permits",
"tracking",
"of",
"yet",
"to",
"be",
"assigned",
"parameters",
".",
"In",
"particular",
"this",
"enables",
"the",
"optimization",
"from"... | def push_parameter_definitions(self, frame):
"""Pushes all parameter targets from the given frame into a local
stack that permits tracking of yet to be assigned parameters. In
particular this enables the optimization from `visit_Name` to skip
undefined expressions for parameters in macr... | [
"def",
"push_parameter_definitions",
"(",
"self",
",",
"frame",
")",
":",
"self",
".",
"_param_def_block",
".",
"append",
"(",
"frame",
".",
"symbols",
".",
"dump_param_targets",
"(",
")",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/compiler.py#L614-L621 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/monitoring.py | python | APICallEvent.new_api_call_attempt | (self, timestamp) | return attempt_event | Instantiates APICallAttemptEvent associated to the APICallEvent
:type timestamp: int
:param timestamp: Epoch time in milliseconds to associate to the
APICallAttemptEvent | Instantiates APICallAttemptEvent associated to the APICallEvent | [
"Instantiates",
"APICallAttemptEvent",
"associated",
"to",
"the",
"APICallEvent"
] | def new_api_call_attempt(self, timestamp):
"""Instantiates APICallAttemptEvent associated to the APICallEvent
:type timestamp: int
:param timestamp: Epoch time in milliseconds to associate to the
APICallAttemptEvent
"""
attempt_event = APICallAttemptEvent(
... | [
"def",
"new_api_call_attempt",
"(",
"self",
",",
"timestamp",
")",
":",
"attempt_event",
"=",
"APICallAttemptEvent",
"(",
"service",
"=",
"self",
".",
"service",
",",
"operation",
"=",
"self",
".",
"operation",
",",
"timestamp",
"=",
"timestamp",
")",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/monitoring.py#L222-L235 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/_psbsd.py | python | Process.get_num_fds | (self) | return _psutil_bsd.get_process_num_fds(self.pid) | Return the number of file descriptors opened by this process. | Return the number of file descriptors opened by this process. | [
"Return",
"the",
"number",
"of",
"file",
"descriptors",
"opened",
"by",
"this",
"process",
"."
] | def get_num_fds(self):
"""Return the number of file descriptors opened by this process."""
return _psutil_bsd.get_process_num_fds(self.pid) | [
"def",
"get_num_fds",
"(",
"self",
")",
":",
"return",
"_psutil_bsd",
".",
"get_process_num_fds",
"(",
"self",
".",
"pid",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/_psbsd.py#L280-L282 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/ensemble/_gb_losses.py | python | LeastSquaresError.__call__ | (self, y, raw_predictions, sample_weight=None) | Compute the least squares loss.
Parameters
----------
y : 1d array, shape (n_samples,)
True labels.
raw_predictions : 2d array, shape (n_samples, K)
The raw_predictions (i.e. values from the tree leaves).
sample_weight : 1d array, shape (n_samples,), op... | Compute the least squares loss. | [
"Compute",
"the",
"least",
"squares",
"loss",
"."
] | def __call__(self, y, raw_predictions, sample_weight=None):
"""Compute the least squares loss.
Parameters
----------
y : 1d array, shape (n_samples,)
True labels.
raw_predictions : 2d array, shape (n_samples, K)
The raw_predictions (i.e. values from the ... | [
"def",
"__call__",
"(",
"self",
",",
"y",
",",
"raw_predictions",
",",
"sample_weight",
"=",
"None",
")",
":",
"if",
"sample_weight",
"is",
"None",
":",
"return",
"np",
".",
"mean",
"(",
"(",
"y",
"-",
"raw_predictions",
".",
"ravel",
"(",
")",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_gb_losses.py#L194-L212 | ||
Ifsttar/I-Simpa | 2283385f4cac769a92e265edabb9c79cb6c42d03 | src/python_bindings/doxygen.py | python | doxygen_doc_extractor.clear_str | (self, tmp_str) | return tmp_str.lstrip() | Replace */! by Space and \breaf, \fn, \param, ... | Replace */! by Space and \breaf, \fn, \param, ... | [
"Replace",
"*",
"/",
"!",
"by",
"Space",
"and",
"\\",
"breaf",
"\\",
"fn",
"\\",
"param",
"..."
] | def clear_str(self, tmp_str):
"""
Replace */! by Space and \breaf, \fn, \param, ...
"""
clean = lambda tmp_str, sym, change2 = '': tmp_str.replace(sym, change2)
tmp_str = reduce(clean, [tmp_str, '/', '*', '!', "\\brief", "\\fn",\
"@brief", "@fn", "@ref", "\\ref", "\"", "\'", "\\c"])
tmp_str = clean(... | [
"def",
"clear_str",
"(",
"self",
",",
"tmp_str",
")",
":",
"clean",
"=",
"lambda",
"tmp_str",
",",
"sym",
",",
"change2",
"=",
"''",
":",
"tmp_str",
".",
"replace",
"(",
"sym",
",",
"change2",
")",
"tmp_str",
"=",
"reduce",
"(",
"clean",
",",
"[",
... | https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/src/python_bindings/doxygen.py#L102-L129 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/passmanagers.py | python | PassManager.add_dead_code_elimination_pass | (self) | See http://llvm.org/docs/Passes.html#dce-dead-code-elimination. | See http://llvm.org/docs/Passes.html#dce-dead-code-elimination. | [
"See",
"http",
":",
"//",
"llvm",
".",
"org",
"/",
"docs",
"/",
"Passes",
".",
"html#dce",
"-",
"dead",
"-",
"code",
"-",
"elimination",
"."
] | def add_dead_code_elimination_pass(self):
"""See http://llvm.org/docs/Passes.html#dce-dead-code-elimination."""
ffi.lib.LLVMPY_AddDeadCodeEliminationPass(self) | [
"def",
"add_dead_code_elimination_pass",
"(",
"self",
")",
":",
"ffi",
".",
"lib",
".",
"LLVMPY_AddDeadCodeEliminationPass",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/passmanagers.py#L49-L51 | ||
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | create_skeleton_parameters | (all_parameters) | return skeleton_parameters | Converts a parameter list to a skeleton version.
The skeleton only has one word for the parameter name, one word for the type,
and commas after each parameter and only there. Everything in the skeleton
remains in the same columns as the original. | Converts a parameter list to a skeleton version. | [
"Converts",
"a",
"parameter",
"list",
"to",
"a",
"skeleton",
"version",
"."
] | def create_skeleton_parameters(all_parameters):
"""Converts a parameter list to a skeleton version.
The skeleton only has one word for the parameter name, one word for the type,
and commas after each parameter and only there. Everything in the skeleton
remains in the same columns as the original."""
... | [
"def",
"create_skeleton_parameters",
"(",
"all_parameters",
")",
":",
"all_simplifications",
"=",
"(",
"# Remove template parameters, function declaration parameters, etc.",
"r'(<[^<>]*?>)|(\\([^\\(\\)]*?\\))|(\\{[^\\{\\}]*?\\})'",
",",
"# Remove all initializers.",
"r'=[^,]*'",
",",
"... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L439-L466 | |
meganz/sdk | 00ace479a434b2d5c329cfe4f7178392fcfd1cdb | examples/python/crud_example.py | python | AppListener.onRequestFinish | (self, api, request, error) | Called upon finishing the async API operation.
:param api: Reference to the API object.
:param request: Reference to the request this operation belongs to.
:param eror: Error information. API_OK if it finishes without a
problem. | Called upon finishing the async API operation. | [
"Called",
"upon",
"finishing",
"the",
"async",
"API",
"operation",
"."
] | def onRequestFinish(self, api, request, error):
"""
Called upon finishing the async API operation.
:param api: Reference to the API object.
:param request: Reference to the request this operation belongs to.
:param eror: Error information. API_OK if it finishes without a
... | [
"def",
"onRequestFinish",
"(",
"self",
",",
"api",
",",
"request",
",",
"error",
")",
":",
"logging",
".",
"info",
"(",
"'Request finished ({}); Result: {}'",
".",
"format",
"(",
"request",
",",
"error",
")",
")",
"request_type",
"=",
"request",
".",
"getTyp... | https://github.com/meganz/sdk/blob/00ace479a434b2d5c329cfe4f7178392fcfd1cdb/examples/python/crud_example.py#L73-L102 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | ResourceManager.cleanup_resources | (self, force=False) | Delete all extracted resource files and directories, returning a list
of the file and directory names that could not be successfully removed.
This function does not have any concurrency protection, so it should
generally only be called when the extraction path is a temporary
directory ex... | Delete all extracted resource files and directories, returning a list
of the file and directory names that could not be successfully removed.
This function does not have any concurrency protection, so it should
generally only be called when the extraction path is a temporary
directory ex... | [
"Delete",
"all",
"extracted",
"resource",
"files",
"and",
"directories",
"returning",
"a",
"list",
"of",
"the",
"file",
"and",
"directory",
"names",
"that",
"could",
"not",
"be",
"successfully",
"removed",
".",
"This",
"function",
"does",
"not",
"have",
"any",... | def cleanup_resources(self, force=False):
"""
Delete all extracted resource files and directories, returning a list
of the file and directory names that could not be successfully removed.
This function does not have any concurrency protection, so it should
generally only be calle... | [
"def",
"cleanup_resources",
"(",
"self",
",",
"force",
"=",
"False",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L1293-L1303 | ||
llvm-dcpu16/llvm-dcpu16 | ae6b01fecd03219677e391d4421df5d966d80dcf | utils/llvm-build/llvmbuild/main.py | python | add_magic_target_components | (parser, project, opts) | add_magic_target_components(project, opts) -> None
Add the "magic" target based components to the project, which can only be
determined based on the target configuration options.
This currently is responsible for populating the required_libraries list of
the "all-targets", "Native", "NativeCodeGen", a... | add_magic_target_components(project, opts) -> None | [
"add_magic_target_components",
"(",
"project",
"opts",
")",
"-",
">",
"None"
] | def add_magic_target_components(parser, project, opts):
"""add_magic_target_components(project, opts) -> None
Add the "magic" target based components to the project, which can only be
determined based on the target configuration options.
This currently is responsible for populating the required_librar... | [
"def",
"add_magic_target_components",
"(",
"parser",
",",
"project",
",",
"opts",
")",
":",
"# Determine the available targets.",
"available_targets",
"=",
"dict",
"(",
"(",
"ci",
".",
"name",
",",
"ci",
")",
"for",
"ci",
"in",
"project",
".",
"component_infos",... | https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/utils/llvm-build/llvmbuild/main.py#L634-L738 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | assembler/ext/src/python_libs/joblib2/logger.py | python | PrintTime.__call__ | (self, msg='', total=False) | Print the time elapsed between the last call and the current
call, with an optional message. | Print the time elapsed between the last call and the current
call, with an optional message. | [
"Print",
"the",
"time",
"elapsed",
"between",
"the",
"last",
"call",
"and",
"the",
"current",
"call",
"with",
"an",
"optional",
"message",
"."
] | def __call__(self, msg='', total=False):
""" Print the time elapsed between the last call and the current
call, with an optional message.
"""
if not total:
time_lapse = time.time() - self.last_time
full_msg = "%s: %s" % (msg, format_time(time_lapse))
e... | [
"def",
"__call__",
"(",
"self",
",",
"msg",
"=",
"''",
",",
"total",
"=",
"False",
")",
":",
"if",
"not",
"total",
":",
"time_lapse",
"=",
"time",
".",
"time",
"(",
")",
"-",
"self",
".",
"last_time",
"full_msg",
"=",
"\"%s: %s\"",
"%",
"(",
"msg",... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/joblib2/logger.py#L128-L151 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/Modules/facial/utils.py | python | closestVertOnMesh | (mesh, node) | return (mesh + '.vtx[' + str(closestVert) + ']') | Returns closest vertex component on mesh to transform/pivot of node | [] | def closestVertOnMesh(mesh, node):
'''
Returns closest vertex component on mesh to transform/pivot of node
'''
closestVert = None
minLength = None
verts = cmds.getAttr(mesh+".vrts", multiIndices=True)
nodePos = cmds.xform(node, q=1, translation=1, ws=1)
for v in verts:
v... | [
"def",
"closestVertOnMesh",
"(",
"mesh",
",",
"node",
")",
":",
"closestVert",
"=",
"None",
"minLength",
"=",
"None",
"verts",
"=",
"cmds",
".",
"getAttr",
"(",
"mesh",
"+",
"\".vrts\"",
",",
"multiIndices",
"=",
"True",
")",
"nodePos",
"=",
"cmds",
".",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/Modules/facial/utils.py#L693-L721 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/tracking/resource.py | python | resource_tracker_scope | (resource_tracker) | A context to manage resource trackers.
Use this in order to collect up all resources created within a block of code.
Example usage:
```python
resource_tracker = ResourceTracker()
with resource_tracker_scope(resource_tracker):
resource = TrackableResource()
assert resource_tracker.resources == [resour... | A context to manage resource trackers. | [
"A",
"context",
"to",
"manage",
"resource",
"trackers",
"."
] | def resource_tracker_scope(resource_tracker):
"""A context to manage resource trackers.
Use this in order to collect up all resources created within a block of code.
Example usage:
```python
resource_tracker = ResourceTracker()
with resource_tracker_scope(resource_tracker):
resource = TrackableResourc... | [
"def",
"resource_tracker_scope",
"(",
"resource_tracker",
")",
":",
"global",
"_RESOURCE_TRACKER_STACK",
"old",
"=",
"list",
"(",
"_RESOURCE_TRACKER_STACK",
")",
"_RESOURCE_TRACKER_STACK",
".",
"append",
"(",
"resource_tracker",
")",
"try",
":",
"yield",
"finally",
":... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/tracking/resource.py#L51-L76 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.WriteImageBlock | (*args, **kwargs) | return _richtext.RichTextCtrl_WriteImageBlock(*args, **kwargs) | WriteImageBlock(self, wxRichTextImageBlock imageBlock) -> bool
Write an image block at the current insertion point. | WriteImageBlock(self, wxRichTextImageBlock imageBlock) -> bool | [
"WriteImageBlock",
"(",
"self",
"wxRichTextImageBlock",
"imageBlock",
")",
"-",
">",
"bool"
] | def WriteImageBlock(*args, **kwargs):
"""
WriteImageBlock(self, wxRichTextImageBlock imageBlock) -> bool
Write an image block at the current insertion point.
"""
return _richtext.RichTextCtrl_WriteImageBlock(*args, **kwargs) | [
"def",
"WriteImageBlock",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_WriteImageBlock",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3279-L3285 | |
hyperledger-archives/iroha | ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9 | example/python/irohalib.py | python | IrohaGrpc.send_blocks_stream_query | (self, query) | Send a query for blocks stream to Iroha
:param query: protobuf BlocksQuery
:return: an iterable over a stream of blocks
:raise: grpc.RpcError with .code() available in case of any error | Send a query for blocks stream to Iroha
:param query: protobuf BlocksQuery
:return: an iterable over a stream of blocks
:raise: grpc.RpcError with .code() available in case of any error | [
"Send",
"a",
"query",
"for",
"blocks",
"stream",
"to",
"Iroha",
":",
"param",
"query",
":",
"protobuf",
"BlocksQuery",
":",
"return",
":",
"an",
"iterable",
"over",
"a",
"stream",
"of",
"blocks",
":",
"raise",
":",
"grpc",
".",
"RpcError",
"with",
".",
... | def send_blocks_stream_query(self, query):
"""
Send a query for blocks stream to Iroha
:param query: protobuf BlocksQuery
:return: an iterable over a stream of blocks
:raise: grpc.RpcError with .code() available in case of any error
"""
response = self._query_serv... | [
"def",
"send_blocks_stream_query",
"(",
"self",
",",
"query",
")",
":",
"response",
"=",
"self",
".",
"_query_service_stub",
".",
"FetchCommits",
"(",
"query",
")",
"for",
"block",
"in",
"response",
":",
"yield",
"block"
] | https://github.com/hyperledger-archives/iroha/blob/ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9/example/python/irohalib.py#L339-L348 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.GetPrevVisible | (self, item) | return lastGoodItem | Returns the previous visible item.
:param `item`: an instance of :class:`GenericTreeItem`.
:return: An instance of :class:`GenericTreeItem` or ``None`` if there are no
previous visible items. | Returns the previous visible item. | [
"Returns",
"the",
"previous",
"visible",
"item",
"."
] | def GetPrevVisible(self, item):
"""
Returns the previous visible item.
:param `item`: an instance of :class:`GenericTreeItem`.
:return: An instance of :class:`GenericTreeItem` or ``None`` if there are no
previous visible items.
"""
# find a previous sibling o... | [
"def",
"GetPrevVisible",
"(",
"self",
",",
"item",
")",
":",
"# find a previous sibling or parent which is visible",
"lastGoodItem",
"=",
"self",
".",
"GetPrevSibling",
"(",
"item",
")",
"if",
"not",
"lastGoodItem",
"or",
"not",
"self",
".",
"IsVisible",
"(",
"las... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L4742-L4779 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/TemplatePyMod/FeaturePython.py | python | ViewProviderBox.getDefaultDisplayMode | (self) | return "Shaded" | Return the name of the default display mode. It must be defined in getDisplayModes. | Return the name of the default display mode. It must be defined in getDisplayModes. | [
"Return",
"the",
"name",
"of",
"the",
"default",
"display",
"mode",
".",
"It",
"must",
"be",
"defined",
"in",
"getDisplayModes",
"."
] | def getDefaultDisplayMode(self):
''' Return the name of the default display mode. It must be defined in getDisplayModes. '''
return "Shaded" | [
"def",
"getDefaultDisplayMode",
"(",
"self",
")",
":",
"return",
"\"Shaded\""
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TemplatePyMod/FeaturePython.py#L51-L53 | |
google/iree | 1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76 | scripts/update_tflite_models.py | python | upload_model | (source, destination, tmpfile) | Uploads a file to the bucket. | Uploads a file to the bucket. | [
"Uploads",
"a",
"file",
"to",
"the",
"bucket",
"."
] | def upload_model(source, destination, tmpfile):
"""Uploads a file to the bucket."""
urllib.request.urlretrieve(source, tmpfile)
storage_client = storage.Client()
bucket = storage_client.get_bucket(BUCKET_NAME)
blob = bucket.blob("/".join([FOLDER_NAME, destination]))
blob.upload_from_filename(tmpfile) | [
"def",
"upload_model",
"(",
"source",
",",
"destination",
",",
"tmpfile",
")",
":",
"urllib",
".",
"request",
".",
"urlretrieve",
"(",
"source",
",",
"tmpfile",
")",
"storage_client",
"=",
"storage",
".",
"Client",
"(",
")",
"bucket",
"=",
"storage_client",
... | https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/scripts/update_tflite_models.py#L44-L51 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | SizerItem.AssignSizer | (*args, **kwargs) | return _core_.SizerItem_AssignSizer(*args, **kwargs) | AssignSizer(self, Sizer sizer)
Set the subsizer to be managed by this sizer item. | AssignSizer(self, Sizer sizer) | [
"AssignSizer",
"(",
"self",
"Sizer",
"sizer",
")"
] | def AssignSizer(*args, **kwargs):
"""
AssignSizer(self, Sizer sizer)
Set the subsizer to be managed by this sizer item.
"""
return _core_.SizerItem_AssignSizer(*args, **kwargs) | [
"def",
"AssignSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizerItem_AssignSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14299-L14305 | |
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/doc/pattern_tools/svgfig.py | python | LineGlobal.SVG | (self, trans=None) | return line | Apply the transformation "trans" and return an SVG object. | Apply the transformation "trans" and return an SVG object. | [
"Apply",
"the",
"transformation",
"trans",
"and",
"return",
"an",
"SVG",
"object",
"."
] | def SVG(self, trans=None):
"""Apply the transformation "trans" and return an SVG object."""
if isinstance(trans, basestring):
trans = totrans(trans)
X1, Y1, X2, Y2 = self.x1, self.y1, self.x2, self.y2
if self.local1:
X1, Y1 = trans(X1, Y1)
if self.local2... | [
"def",
"SVG",
"(",
"self",
",",
"trans",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"trans",
",",
"basestring",
")",
":",
"trans",
"=",
"totrans",
"(",
"trans",
")",
"X1",
",",
"Y1",
",",
"X2",
",",
"Y2",
"=",
"self",
".",
"x1",
",",
"self... | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/doc/pattern_tools/svgfig.py#L2293-L2333 | |
deepmind/streetlearn | ccf1d60b9c45154894d45a897748aee85d7eb69b | streetlearn/python/environment/instructions_base.py | python | InstructionsBase.instructions | (self) | return self._instructions | Returns instructions.
Args:
None
Returns:
instructions: string containing game specific instructions. | Returns instructions. | [
"Returns",
"instructions",
"."
] | def instructions(self):
"""Returns instructions.
Args:
None
Returns:
instructions: string containing game specific instructions.
"""
return self._instructions | [
"def",
"instructions",
"(",
"self",
")",
":",
"return",
"self",
".",
"_instructions"
] | https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/instructions_base.py#L469-L477 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py | python | Pickler.dump | (self, obj) | Write a pickled representation of obj to the open file. | Write a pickled representation of obj to the open file. | [
"Write",
"a",
"pickled",
"representation",
"of",
"obj",
"to",
"the",
"open",
"file",
"."
] | def dump(self, obj):
"""Write a pickled representation of obj to the open file."""
if self.proto >= 2:
self.write(PROTO + chr(self.proto))
self.save(obj)
self.write(STOP) | [
"def",
"dump",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"proto",
">=",
"2",
":",
"self",
".",
"write",
"(",
"PROTO",
"+",
"chr",
"(",
"self",
".",
"proto",
")",
")",
"self",
".",
"save",
"(",
"obj",
")",
"self",
".",
"write",
"("... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py#L220-L225 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.Add | (self, file_desc_proto) | Adds the FileDescriptorProto and its types to this pool.
Args:
file_desc_proto: The FileDescriptorProto to add. | Adds the FileDescriptorProto and its types to this pool. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"pool",
"."
] | def Add(self, file_desc_proto):
"""Adds the FileDescriptorProto and its types to this pool.
Args:
file_desc_proto: The FileDescriptorProto to add.
"""
self._internal_db.Add(file_desc_proto) | [
"def",
"Add",
"(",
"self",
",",
"file_desc_proto",
")",
":",
"self",
".",
"_internal_db",
".",
"Add",
"(",
"file_desc_proto",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L111-L118 | ||
ElunaLuaEngine/Eluna | 4d862f0bf6b08de451fe215ee0645fbdf7a23a9b | docs/ElunaDoc/parser.py | python | ClassParser.next_line | (self, line) | Parse the next line of the file.
This method returns a `Method` when enough data to form a `Method` has been parsed.
Otherwise, it returns None. | Parse the next line of the file. | [
"Parse",
"the",
"next",
"line",
"of",
"the",
"file",
"."
] | def next_line(self, line):
"""Parse the next line of the file.
This method returns a `Method` when enough data to form a `Method` has been parsed.
Otherwise, it returns None.
"""
# Get the list of expected regular expressions using the last one handled.
valid_regexes = s... | [
"def",
"next_line",
"(",
"self",
",",
"line",
")",
":",
"# Get the list of expected regular expressions using the last one handled.",
"valid_regexes",
"=",
"self",
".",
"next_regexes",
"[",
"self",
".",
"last_regex",
"]",
"# Try to find a match.",
"for",
"regex",
"in",
... | https://github.com/ElunaLuaEngine/Eluna/blob/4d862f0bf6b08de451fe215ee0645fbdf7a23a9b/docs/ElunaDoc/parser.py#L283-L308 | ||
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | nexus/lib/gaussian_process.py | python | GaussianProcessOptimizer.vlog | (self,msg,n=0,indent=' ') | Prints a message if verbose=True. | Prints a message if verbose=True. | [
"Prints",
"a",
"message",
"if",
"verbose",
"=",
"True",
"."
] | def vlog(self,msg,n=0,indent=' '):
"""
Prints a message if verbose=True.
"""
if self.verbose:
self.log(msg,indent=n*indent) | [
"def",
"vlog",
"(",
"self",
",",
"msg",
",",
"n",
"=",
"0",
",",
"indent",
"=",
"' '",
")",
":",
"if",
"self",
".",
"verbose",
":",
"self",
".",
"log",
"(",
"msg",
",",
"indent",
"=",
"n",
"*",
"indent",
")"
] | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/nexus/lib/gaussian_process.py#L1620-L1625 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/graph_editor/transform.py | python | Transformer._transform_sgv | (self, sgv) | return sgv_.remap(input_map_, output_map_) | Transform a subgraph view.
For convenience, a transform operation returns a subgraph view of the
transformed graph.
Args:
sgv: the subgraph to be transformed.
Returns:
The transformed subgraph. | Transform a subgraph view. | [
"Transform",
"a",
"subgraph",
"view",
"."
] | def _transform_sgv(self, sgv):
"""Transform a subgraph view.
For convenience, a transform operation returns a subgraph view of the
transformed graph.
Args:
sgv: the subgraph to be transformed.
Returns:
The transformed subgraph.
"""
ops_ = [op_ for _, op_ in iteritems(self._info... | [
"def",
"_transform_sgv",
"(",
"self",
",",
"sgv",
")",
":",
"ops_",
"=",
"[",
"op_",
"for",
"_",
",",
"op_",
"in",
"iteritems",
"(",
"self",
".",
"_info",
".",
"transformed_ops",
")",
"]",
"sgv_",
"=",
"subgraph",
".",
"SubGraphView",
"(",
"ops_",
")... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/transform.py#L462-L500 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | CollapsiblePaneEvent.GetCollapsed | (*args, **kwargs) | return _controls_.CollapsiblePaneEvent_GetCollapsed(*args, **kwargs) | GetCollapsed(self) -> bool | GetCollapsed(self) -> bool | [
"GetCollapsed",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetCollapsed(*args, **kwargs):
"""GetCollapsed(self) -> bool"""
return _controls_.CollapsiblePaneEvent_GetCollapsed(*args, **kwargs) | [
"def",
"GetCollapsed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"CollapsiblePaneEvent_GetCollapsed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7406-L7408 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | tools/coreml/converter/_layers.py | python | convert_flatten | (net, node, module, builder) | Convert a flatten layer from mxnet to coreml.
Parameters
----------
network: net
A mxnet network object.
layer: node
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | Convert a flatten layer from mxnet to coreml. | [
"Convert",
"a",
"flatten",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | def convert_flatten(net, node, module, builder):
"""Convert a flatten layer from mxnet to coreml.
Parameters
----------
network: net
A mxnet network object.
layer: node
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neu... | [
"def",
"convert_flatten",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"]",
"mode",
"=",
"0",
"# CHANN... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/tools/coreml/converter/_layers.py#L141-L161 | ||
OpenNebula/one | 982e09706fc444ae60a8ad2f818d6a795cbbdab4 | src/oca/python/pyone/__init__.py | python | RequestsTransport.parse_response | (self, response) | return u.close() | Parse the xmlrpc response. | Parse the xmlrpc response. | [
"Parse",
"the",
"xmlrpc",
"response",
"."
] | def parse_response(self, response):
"""
Parse the xmlrpc response.
"""
p, u = self.getparser()
p.feed(response.content)
p.close()
return u.close() | [
"def",
"parse_response",
"(",
"self",
",",
"response",
")",
":",
"p",
",",
"u",
"=",
"self",
".",
"getparser",
"(",
")",
"p",
".",
"feed",
"(",
"response",
".",
"content",
")",
"p",
".",
"close",
"(",
")",
"return",
"u",
".",
"close",
"(",
")"
] | https://github.com/OpenNebula/one/blob/982e09706fc444ae60a8ad2f818d6a795cbbdab4/src/oca/python/pyone/__init__.py#L335-L344 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | GtkGraphicRenderer.size_allocate | (self, widget, allocation) | ! Size Allocate
@param self this object
@param widget widget
@param allocation allocation
@return none | ! Size Allocate | [
"!",
"Size",
"Allocate"
] | def size_allocate(self, widget, allocation):
"""! Size Allocate
@param self this object
@param widget widget
@param allocation allocation
@return none
"""
self.__width = allocation.width
self.__height = allocation.height
self.__data.layout(allocati... | [
"def",
"size_allocate",
"(",
"self",
",",
"widget",
",",
"allocation",
")",
":",
"self",
".",
"__width",
"=",
"allocation",
".",
"width",
"self",
".",
"__height",
"=",
"allocation",
".",
"height",
"self",
".",
"__data",
".",
"layout",
"(",
"allocation",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L1473-L1484 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py | python | asksaveasfile | (mode = "w", **options) | return None | Ask for a filename to save as, and returned the opened file | Ask for a filename to save as, and returned the opened file | [
"Ask",
"for",
"a",
"filename",
"to",
"save",
"as",
"and",
"returned",
"the",
"opened",
"file"
] | def asksaveasfile(mode = "w", **options):
"Ask for a filename to save as, and returned the opened file"
filename = SaveAs(**options).show()
if filename:
return open(filename, mode)
return None | [
"def",
"asksaveasfile",
"(",
"mode",
"=",
"\"w\"",
",",
"*",
"*",
"options",
")",
":",
"filename",
"=",
"SaveAs",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")",
"if",
"filename",
":",
"return",
"open",
"(",
"filename",
",",
"mode",
")",
"ret... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py#L168-L174 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/labeled_tensor/python/ops/ops.py | python | boolean_mask | (labeled_tensor, mask, name=None) | Apply a boolean mask to a labeled tensor.
Unlike `tf.boolean_mask`, this currently only works on 1-dimensional masks.
The mask is applied to the first axis of `labeled_tensor`. Labels on the first
axis are removed, because True indices in `mask` may not be known dynamically.
Args:
labeled_tensor: The inpu... | Apply a boolean mask to a labeled tensor. | [
"Apply",
"a",
"boolean",
"mask",
"to",
"a",
"labeled",
"tensor",
"."
] | def boolean_mask(labeled_tensor, mask, name=None):
"""Apply a boolean mask to a labeled tensor.
Unlike `tf.boolean_mask`, this currently only works on 1-dimensional masks.
The mask is applied to the first axis of `labeled_tensor`. Labels on the first
axis are removed, because True indices in `mask` may not be ... | [
"def",
"boolean_mask",
"(",
"labeled_tensor",
",",
"mask",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"'lt_boolean_mask'",
",",
"[",
"labeled_tensor",
",",
"mask",
"]",
")",
"as",
"scope",
":",
"labeled_tensor",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/labeled_tensor/python/ops/ops.py#L1213-L1247 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | GridTableBase.GetValueAsLong | (*args, **kwargs) | return _grid.GridTableBase_GetValueAsLong(*args, **kwargs) | GetValueAsLong(self, int row, int col) -> long | GetValueAsLong(self, int row, int col) -> long | [
"GetValueAsLong",
"(",
"self",
"int",
"row",
"int",
"col",
")",
"-",
">",
"long"
] | def GetValueAsLong(*args, **kwargs):
"""GetValueAsLong(self, int row, int col) -> long"""
return _grid.GridTableBase_GetValueAsLong(*args, **kwargs) | [
"def",
"GetValueAsLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_GetValueAsLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L834-L836 | |
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | 3rdparty/benchmark/mingw.py | python | main | () | Invoked when the script is run directly by the python interpreter | Invoked when the script is run directly by the python interpreter | [
"Invoked",
"when",
"the",
"script",
"is",
"run",
"directly",
"by",
"the",
"python",
"interpreter"
] | def main():
'''
Invoked when the script is run directly by the python interpreter
'''
parser = argparse.ArgumentParser(
description = 'Downloads a specific version of MinGW',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument('--location',
help... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Downloads a specific version of MinGW'",
",",
"formatter_class",
"=",
"argparse",
".",
"ArgumentDefaultsHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
... | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/benchmark/mingw.py#L261-L307 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py | python | FSM.process | (self, input_symbol) | This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action is None then the action
is not called ... | This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action is None then the action
is not called ... | [
"This",
"is",
"the",
"main",
"method",
"that",
"you",
"call",
"to",
"process",
"input",
".",
"This",
"may",
"cause",
"the",
"FSM",
"to",
"change",
"state",
"and",
"call",
"an",
"action",
".",
"This",
"method",
"calls",
"get_transition",
"()",
"to",
"find... | def process (self, input_symbol):
'''This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action ... | [
"def",
"process",
"(",
"self",
",",
"input_symbol",
")",
":",
"self",
".",
"input_symbol",
"=",
"input_symbol",
"(",
"self",
".",
"action",
",",
"self",
".",
"next_state",
")",
"=",
"self",
".",
"get_transition",
"(",
"self",
".",
"input_symbol",
",",
"s... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py#L228-L243 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudformation/connection.py | python | CloudFormationConnection.describe_stack_events | (self, stack_name_or_id=None, next_token=None) | return self.get_list('DescribeStackEvents', params, [('member',
StackEvent)]) | Returns all stack related events for a specified stack. For
more information about a stack's event history, go to
`Stacks`_ in the AWS CloudFormation User Guide.
Events are returned, even if the stack never existed or has
been successfully deleted.
:type stack_name_or_id: string... | Returns all stack related events for a specified stack. For
more information about a stack's event history, go to
`Stacks`_ in the AWS CloudFormation User Guide.
Events are returned, even if the stack never existed or has
been successfully deleted. | [
"Returns",
"all",
"stack",
"related",
"events",
"for",
"a",
"specified",
"stack",
".",
"For",
"more",
"information",
"about",
"a",
"stack",
"s",
"event",
"history",
"go",
"to",
"Stacks",
"_",
"in",
"the",
"AWS",
"CloudFormation",
"User",
"Guide",
".",
"Eve... | def describe_stack_events(self, stack_name_or_id=None, next_token=None):
"""
Returns all stack related events for a specified stack. For
more information about a stack's event history, go to
`Stacks`_ in the AWS CloudFormation User Guide.
Events are returned, even if the stack ne... | [
"def",
"describe_stack_events",
"(",
"self",
",",
"stack_name_or_id",
"=",
"None",
",",
"next_token",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"stack_name_or_id",
":",
"params",
"[",
"'StackName'",
"]",
"=",
"stack_name_or_id",
"if",
"next_token",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudformation/connection.py#L555-L580 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/api/classes.py | python | BaseDefinition.docstring | (self, raw=False, fast=True) | return _Help(self._name).docstring(fast=fast, raw=raw) | r"""
Return a document string for this completion object.
Example:
>>> from jedi import Script
>>> source = '''\
... def f(a, b=1):
... "Document for function f."
... '''
>>> script = Script(source, 1, len('def f'), 'example.py')
>>> doc = sc... | r"""
Return a document string for this completion object. | [
"r",
"Return",
"a",
"document",
"string",
"for",
"this",
"completion",
"object",
"."
] | def docstring(self, raw=False, fast=True):
r"""
Return a document string for this completion object.
Example:
>>> from jedi import Script
>>> source = '''\
... def f(a, b=1):
... "Document for function f."
... '''
>>> script = Script(source, ... | [
"def",
"docstring",
"(",
"self",
",",
"raw",
"=",
"False",
",",
"fast",
"=",
"True",
")",
":",
"return",
"_Help",
"(",
"self",
".",
"_name",
")",
".",
"docstring",
"(",
"fast",
"=",
"fast",
",",
"raw",
"=",
"raw",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/api/classes.py#L224-L255 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsContext.SetBrush | (*args) | return _gdi_.GraphicsContext_SetBrush(*args) | SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush)
Sets the brush for filling | SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush) | [
"SetBrush",
"(",
"self",
"GraphicsBrush",
"brush",
")",
"SetBrush",
"(",
"self",
"Brush",
"brush",
")"
] | def SetBrush(*args):
"""
SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush)
Sets the brush for filling
"""
return _gdi_.GraphicsContext_SetBrush(*args) | [
"def",
"SetBrush",
"(",
"*",
"args",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_SetBrush",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6341-L6348 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | power | (a, b, third=None) | return result | Returns element-wise base array raised to power from second array.
This is the masked array version of `numpy.power`. For details see
`numpy.power`.
See Also
--------
numpy.power
Notes
-----
The *out* argument to `numpy.power` is not supported, `third` has to be
None. | Returns element-wise base array raised to power from second array. | [
"Returns",
"element",
"-",
"wise",
"base",
"array",
"raised",
"to",
"power",
"from",
"second",
"array",
"."
] | def power(a, b, third=None):
"""
Returns element-wise base array raised to power from second array.
This is the masked array version of `numpy.power`. For details see
`numpy.power`.
See Also
--------
numpy.power
Notes
-----
The *out* argument to `numpy.power` is not supported,... | [
"def",
"power",
"(",
"a",
",",
"b",
",",
"third",
"=",
"None",
")",
":",
"if",
"third",
"is",
"not",
"None",
":",
"raise",
"MaskError",
"(",
"\"3-argument power not supported.\"",
")",
"# Get the masks",
"ma",
"=",
"getmask",
"(",
"a",
")",
"mb",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L6726-L6775 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiFloatingFrame.OnClose | (self, event) | Handles the ``wx.EVT_CLOSE`` event for :class:`AuiFloatingFrame`.
:param `event`: a :class:`CloseEvent` to be processed. | Handles the ``wx.EVT_CLOSE`` event for :class:`AuiFloatingFrame`. | [
"Handles",
"the",
"wx",
".",
"EVT_CLOSE",
"event",
"for",
":",
"class",
":",
"AuiFloatingFrame",
"."
] | def OnClose(self, event):
"""
Handles the ``wx.EVT_CLOSE`` event for :class:`AuiFloatingFrame`.
:param `event`: a :class:`CloseEvent` to be processed.
"""
if self._owner_mgr:
self._owner_mgr.OnFloatingPaneClosed(self._pane_window, event)
if not event.GetVet... | [
"def",
"OnClose",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"_owner_mgr",
":",
"self",
".",
"_owner_mgr",
".",
"OnFloatingPaneClosed",
"(",
"self",
".",
"_pane_window",
",",
"event",
")",
"if",
"not",
"event",
".",
"GetVeto",
"(",
")",
":... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L3091-L3112 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/hooks.py | python | HierarchicalEmitter.emit | (self, event_name, **kwargs) | return self._emit(event_name, kwargs) | Emit an event by name with arguments passed as keyword args.
>>> responses = emitter.emit(
... 'my-event.service.operation', arg1='one', arg2='two')
:rtype: list
:return: List of (handler, response) tuples from all processed
handlers. | Emit an event by name with arguments passed as keyword args. | [
"Emit",
"an",
"event",
"by",
"name",
"with",
"arguments",
"passed",
"as",
"keyword",
"args",
"."
] | def emit(self, event_name, **kwargs):
"""
Emit an event by name with arguments passed as keyword args.
>>> responses = emitter.emit(
... 'my-event.service.operation', arg1='one', arg2='two')
:rtype: list
:return: List of (handler, response) tuples from all p... | [
"def",
"emit",
"(",
"self",
",",
"event_name",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_emit",
"(",
"event_name",
",",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/hooks.py#L217-L228 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/ensure_gn_version.py | python | ChmodGnFile | (path_to_exe) | Makes the gn binary executable for all and writable for the user. | Makes the gn binary executable for all and writable for the user. | [
"Makes",
"the",
"gn",
"binary",
"executable",
"for",
"all",
"and",
"writable",
"for",
"the",
"user",
"."
] | def ChmodGnFile(path_to_exe):
"""Makes the gn binary executable for all and writable for the user."""
os.chmod(path_to_exe,
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | # This is 0o755.
stat.S_IRGRP | stat.S_IXGRP |
stat.S_IROTH | stat.S_IXOTH) | [
"def",
"ChmodGnFile",
"(",
"path_to_exe",
")",
":",
"os",
".",
"chmod",
"(",
"path_to_exe",
",",
"stat",
".",
"S_IRUSR",
"|",
"stat",
".",
"S_IWUSR",
"|",
"stat",
".",
"S_IXUSR",
"|",
"# This is 0o755.",
"stat",
".",
"S_IRGRP",
"|",
"stat",
".",
"S_IXGRP... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/ensure_gn_version.py#L40-L45 | ||
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/clib.py | python | _ProxyBaseCopyable.deep_copy | (self) | return copy | Return new instance containing a (deep)copy of underlying C object | Return new instance containing a (deep)copy of underlying C object | [
"Return",
"new",
"instance",
"containing",
"a",
"(",
"deep",
")",
"copy",
"of",
"underlying",
"C",
"object"
] | def deep_copy(self):
"""Return new instance containing a (deep)copy of underlying C object"""
copy = self.__new__(self.__class__)
copy._obj = self._cproxy_type()()
call(self._abi("Copy"), REF(self._obj), REF(copy._obj))
copy._alive = True
return copy | [
"def",
"deep_copy",
"(",
"self",
")",
":",
"copy",
"=",
"self",
".",
"__new__",
"(",
"self",
".",
"__class__",
")",
"copy",
".",
"_obj",
"=",
"self",
".",
"_cproxy_type",
"(",
")",
"(",
")",
"call",
"(",
"self",
".",
"_abi",
"(",
"\"Copy\"",
")",
... | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/clib.py#L73-L79 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/se3.py | python | Se3.matrix | (self) | return (R.row_join(self.t)).col_join(sympy.Matrix(1, 4, [0, 0, 0, 1])) | returns matrix representation | returns matrix representation | [
"returns",
"matrix",
"representation"
] | def matrix(self):
""" returns matrix representation """
R = self.so3.matrix()
return (R.row_join(self.t)).col_join(sympy.Matrix(1, 4, [0, 0, 0, 1])) | [
"def",
"matrix",
"(",
"self",
")",
":",
"R",
"=",
"self",
".",
"so3",
".",
"matrix",
"(",
")",
"return",
"(",
"R",
".",
"row_join",
"(",
"self",
".",
"t",
")",
")",
".",
"col_join",
"(",
"sympy",
".",
"Matrix",
"(",
"1",
",",
"4",
",",
"[",
... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/se3.py#L79-L82 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | samples/python/yolov3_onnx/yolov3_to_onnx.py | python | ConvParams.generate_param_name | (self, param_category, suffix) | return param_name | Generates a name based on two string inputs,
and checks if the combination is valid. | Generates a name based on two string inputs,
and checks if the combination is valid. | [
"Generates",
"a",
"name",
"based",
"on",
"two",
"string",
"inputs",
"and",
"checks",
"if",
"the",
"combination",
"is",
"valid",
"."
] | def generate_param_name(self, param_category, suffix):
"""Generates a name based on two string inputs,
and checks if the combination is valid."""
assert suffix
assert param_category in ['bn', 'conv']
assert(suffix in ['scale', 'mean', 'var', 'weights', 'bias'])
if param_c... | [
"def",
"generate_param_name",
"(",
"self",
",",
"param_category",
",",
"suffix",
")",
":",
"assert",
"suffix",
"assert",
"param_category",
"in",
"[",
"'bn'",
",",
"'conv'",
"]",
"assert",
"(",
"suffix",
"in",
"[",
"'scale'",
",",
"'mean'",
",",
"'var'",
",... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/yolov3_onnx/yolov3_to_onnx.py#L185-L199 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py | python | GenPage.create_page_general | (self) | Return frame of widgets for General tab.
Enable users to provisionally change general options. Function
load_general_cfg initializes tk variables and helplist using
idleConf. Radiobuttons startup_shell_on and startup_editor_on
set var startup_edit. Radiobuttons save_ask_on and save_aut... | Return frame of widgets for General tab. | [
"Return",
"frame",
"of",
"widgets",
"for",
"General",
"tab",
"."
] | def create_page_general(self):
"""Return frame of widgets for General tab.
Enable users to provisionally change general options. Function
load_general_cfg initializes tk variables and helplist using
idleConf. Radiobuttons startup_shell_on and startup_editor_on
set var startup_e... | [
"def",
"create_page_general",
"(",
"self",
")",
":",
"# Integer values need StringVar because int('') raises.",
"self",
".",
"startup_edit",
"=",
"tracers",
".",
"add",
"(",
"IntVar",
"(",
"self",
")",
",",
"(",
"'main'",
",",
"'General'",
",",
"'editor-on-startup'"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py#L1793-L2085 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dummy_thread.py | python | start_new_thread | (function, args, kwargs={}) | Dummy implementation of thread.start_new_thread().
Compatibility is maintained by making sure that ``args`` is a
tuple and ``kwargs`` is a dictionary. If an exception is raised
and it is SystemExit (which can be done by thread.exit()) it is
caught and nothing is done; all other exceptions are printed ... | Dummy implementation of thread.start_new_thread(). | [
"Dummy",
"implementation",
"of",
"thread",
".",
"start_new_thread",
"()",
"."
] | def start_new_thread(function, args, kwargs={}):
"""Dummy implementation of thread.start_new_thread().
Compatibility is maintained by making sure that ``args`` is a
tuple and ``kwargs`` is a dictionary. If an exception is raised
and it is SystemExit (which can be done by thread.exit()) it is
caugh... | [
"def",
"start_new_thread",
"(",
"function",
",",
"args",
",",
"kwargs",
"=",
"{",
"}",
")",
":",
"if",
"type",
"(",
"args",
")",
"!=",
"type",
"(",
"tuple",
"(",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"2nd arg must be a tuple\"",
")",
"if",
"type"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dummy_thread.py#L27-L56 | ||
HyeonwooNoh/caffe | d9e8494a2832d67b25dee37194c7bcb9d52d0e42 | tools/extra/parse_log.py | python | get_line_type | (line) | return line_type | Return either 'test' or 'train' depending on line type | Return either 'test' or 'train' depending on line type | [
"Return",
"either",
"test",
"or",
"train",
"depending",
"on",
"line",
"type"
] | def get_line_type(line):
"""Return either 'test' or 'train' depending on line type
"""
line_type = None
if line.find('Train') != -1:
line_type = 'train'
elif line.find('Test') != -1:
line_type = 'test'
return line_type | [
"def",
"get_line_type",
"(",
"line",
")",
":",
"line_type",
"=",
"None",
"if",
"line",
".",
"find",
"(",
"'Train'",
")",
"!=",
"-",
"1",
":",
"line_type",
"=",
"'train'",
"elif",
"line",
".",
"find",
"(",
"'Test'",
")",
"!=",
"-",
"1",
":",
"line_t... | https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/tools/extra/parse_log.py#L16-L25 | |
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | Path.exists | (self) | return _OS.path.exists(str(self)) | Whether the designated file or directory exists.
>>> p = Path('/tmp/.drake.foo')
>>> p.touch()
>>> p.exists()
True
>>> p.remove()
>>> p.exists()
False | Whether the designated file or directory exists. | [
"Whether",
"the",
"designated",
"file",
"or",
"directory",
"exists",
"."
] | def exists(self):
"""Whether the designated file or directory exists.
>>> p = Path('/tmp/.drake.foo')
>>> p.touch()
>>> p.exists()
True
>>> p.remove()
>>> p.exists()
False
"""
if _OS.path.islink(str(self)):
return True
return _OS.path.exists(s... | [
"def",
"exists",
"(",
"self",
")",
":",
"if",
"_OS",
".",
"path",
".",
"islink",
"(",
"str",
"(",
"self",
")",
")",
":",
"return",
"True",
"return",
"_OS",
".",
"path",
".",
"exists",
"(",
"str",
"(",
"self",
")",
")"
] | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L787-L800 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py | python | RequestsCookieJar.iteritems | (self) | Dict-like iteritems() that returns an iterator of name-value tuples
from the jar. See iterkeys() and itervalues(). | Dict-like iteritems() that returns an iterator of name-value tuples
from the jar. See iterkeys() and itervalues(). | [
"Dict",
"-",
"like",
"iteritems",
"()",
"that",
"returns",
"an",
"iterator",
"of",
"name",
"-",
"value",
"tuples",
"from",
"the",
"jar",
".",
"See",
"iterkeys",
"()",
"and",
"itervalues",
"()",
"."
] | def iteritems(self):
"""Dict-like iteritems() that returns an iterator of name-value tuples
from the jar. See iterkeys() and itervalues()."""
for cookie in iter(self):
yield cookie.name, cookie.value | [
"def",
"iteritems",
"(",
"self",
")",
":",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"yield",
"cookie",
".",
"name",
",",
"cookie",
".",
"value"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L226-L230 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/rnn_cell.py | python | OutputProjectionWrapper.__call__ | (self, inputs, state, scope=None) | return projected, res_state | Run the cell and output projection on inputs, starting from state. | Run the cell and output projection on inputs, starting from state. | [
"Run",
"the",
"cell",
"and",
"output",
"projection",
"on",
"inputs",
"starting",
"from",
"state",
"."
] | def __call__(self, inputs, state, scope=None):
"""Run the cell and output projection on inputs, starting from state."""
output, res_state = self._cell(inputs, state)
# Default scope: "OutputProjectionWrapper"
with vs.variable_scope(scope or type(self).__name__):
projected = _linear(output, self._o... | [
"def",
"__call__",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"scope",
"=",
"None",
")",
":",
"output",
",",
"res_state",
"=",
"self",
".",
"_cell",
"(",
"inputs",
",",
"state",
")",
"# Default scope: \"OutputProjectionWrapper\"",
"with",
"vs",
".",
"v... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/rnn_cell.py#L582-L588 | |
GXYM/DRRG | 9e074fa9052de8d131f55ca1f6ae6673c1bfeca4 | dataset/icdar15/Evaluation_Protocol/script.py | python | default_evaluation_params | () | return {
'IOU_CONSTRAINT' :0.5,
'AREA_PRECISION_CONSTRAINT' :0.5,
'GT_SAMPLE_NAME_2_ID':'gt_img_([0-9]+).txt',
'DET_SAMPLE_NAME_2_ID':'res_img_([0-9]+).txt',
'LTRB':False, #LTRB:2points(left,top,right,bottom) or 4 points(x1,y1,x2,y2,x3,y3,x... | default_evaluation_params: Default parameters to use for the validation and evaluation. | default_evaluation_params: Default parameters to use for the validation and evaluation. | [
"default_evaluation_params",
":",
"Default",
"parameters",
"to",
"use",
"for",
"the",
"validation",
"and",
"evaluation",
"."
] | def default_evaluation_params():
"""
default_evaluation_params: Default parameters to use for the validation and evaluation.
"""
return {
'IOU_CONSTRAINT' :0.5,
'AREA_PRECISION_CONSTRAINT' :0.5,
'GT_SAMPLE_NAME_2_ID':'gt_img_([0-9]+).txt',
... | [
"def",
"default_evaluation_params",
"(",
")",
":",
"return",
"{",
"'IOU_CONSTRAINT'",
":",
"0.5",
",",
"'AREA_PRECISION_CONSTRAINT'",
":",
"0.5",
",",
"'GT_SAMPLE_NAME_2_ID'",
":",
"'gt_img_([0-9]+).txt'",
",",
"'DET_SAMPLE_NAME_2_ID'",
":",
"'res_img_([0-9]+).txt'",
",",... | https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/icdar15/Evaluation_Protocol/script.py#L22-L35 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | NativePixelData_Accessor.MoveTo | (*args, **kwargs) | return _gdi_.NativePixelData_Accessor_MoveTo(*args, **kwargs) | MoveTo(self, NativePixelData data, int x, int y) | MoveTo(self, NativePixelData data, int x, int y) | [
"MoveTo",
"(",
"self",
"NativePixelData",
"data",
"int",
"x",
"int",
"y",
")"
] | def MoveTo(*args, **kwargs):
"""MoveTo(self, NativePixelData data, int x, int y)"""
return _gdi_.NativePixelData_Accessor_MoveTo(*args, **kwargs) | [
"def",
"MoveTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativePixelData_Accessor_MoveTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1116-L1118 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/builtins.py | python | redirect_type_ctor | (context, builder, sig, args) | return context.compile_internal(builder, call_ctor, sig, args) | Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`,
which should be overloaded by type implementator.
For example:
d = Dict()
`d` will be typed as `TypeRef[DictType]()`. Thus, it will call into this
implementation. We need to redirect the lowering to a function
name... | Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`,
which should be overloaded by type implementator. | [
"Redirect",
"constructor",
"implementation",
"to",
"numba_typeref_ctor",
"(",
"cls",
"*",
"args",
")",
"which",
"should",
"be",
"overloaded",
"by",
"type",
"implementator",
"."
] | def redirect_type_ctor(context, builder, sig, args):
"""Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`,
which should be overloaded by type implementator.
For example:
d = Dict()
`d` will be typed as `TypeRef[DictType]()`. Thus, it will call into this
implementati... | [
"def",
"redirect_type_ctor",
"(",
"context",
",",
"builder",
",",
"sig",
",",
"args",
")",
":",
"cls",
"=",
"sig",
".",
"return_type",
"def",
"call_ctor",
"(",
"cls",
",",
"*",
"args",
")",
":",
"return",
"numba_typeref_ctor",
"(",
"cls",
",",
"*",
"ar... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/builtins.py#L554-L579 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/extensions/civet.py | python | CivetExtension.testBaseFileName | (self, test) | return self.__test_result_numbers.get(test, None) | Return the test page filename base. | Return the test page filename base. | [
"Return",
"the",
"test",
"page",
"filename",
"base",
"."
] | def testBaseFileName(self, test):
"""
Return the test page filename base.
"""
return self.__test_result_numbers.get(test, None) | [
"def",
"testBaseFileName",
"(",
"self",
",",
"test",
")",
":",
"return",
"self",
".",
"__test_result_numbers",
".",
"get",
"(",
"test",
",",
"None",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/civet.py#L79-L83 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/filesystem.py | python | Filesystem.erase_metadata_objects | (self, prefix) | For all objects in the metadata pool matching the prefix,
erase them.
This O(N) with the number of objects in the pool, so only suitable
for use on toy test filesystems. | For all objects in the metadata pool matching the prefix,
erase them. | [
"For",
"all",
"objects",
"in",
"the",
"metadata",
"pool",
"matching",
"the",
"prefix",
"erase",
"them",
"."
] | def erase_metadata_objects(self, prefix):
"""
For all objects in the metadata pool matching the prefix,
erase them.
This O(N) with the number of objects in the pool, so only suitable
for use on toy test filesystems.
"""
all_objects = self.radosmo(["ls"], stdout=S... | [
"def",
"erase_metadata_objects",
"(",
"self",
",",
"prefix",
")",
":",
"all_objects",
"=",
"self",
".",
"radosmo",
"(",
"[",
"\"ls\"",
"]",
",",
"stdout",
"=",
"StringIO",
"(",
")",
")",
".",
"strip",
"(",
")",
".",
"split",
"(",
"\"\\n\"",
")",
"mat... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/filesystem.py#L1424-L1435 | ||
yuxng/DA-RNN | 77fbb50b4272514588a10a9f90b7d5f8d46974fb | lib/datasets/lov.py | python | lov.metadata_path_at | (self, i) | return self.metadata_path_from_index(self.image_index[i]) | Return the absolute path to metadata i in the image sequence. | Return the absolute path to metadata i in the image sequence. | [
"Return",
"the",
"absolute",
"path",
"to",
"metadata",
"i",
"in",
"the",
"image",
"sequence",
"."
] | def metadata_path_at(self, i):
"""
Return the absolute path to metadata i in the image sequence.
"""
return self.metadata_path_from_index(self.image_index[i]) | [
"def",
"metadata_path_at",
"(",
"self",
",",
"i",
")",
":",
"return",
"self",
".",
"metadata_path_from_index",
"(",
"self",
".",
"image_index",
"[",
"i",
"]",
")"
] | https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/lov.py#L93-L97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.