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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ChenglongChen/kaggle-CrowdFlower | a72eabb2e53c308c345905eff79c3c8e3a389239 | Code/Feat/feat_utils.py | python | dump_feat_name | (feat_names, feat_name_file) | save feat_names to feat_name_file | save feat_names to feat_name_file | [
"save",
"feat_names",
"to",
"feat_name_file"
] | def dump_feat_name(feat_names, feat_name_file):
"""
save feat_names to feat_name_file
"""
with open(feat_name_file, "wb") as f:
for i,feat_name in enumerate(feat_names):
if feat_name.startswith("count") or feat_name.startswith("pos_of"):
f.write("('%s', SimpleTransform(config.count_feat_... | [
"def",
"dump_feat_name",
"(",
"feat_names",
",",
"feat_name_file",
")",
":",
"with",
"open",
"(",
"feat_name_file",
",",
"\"wb\"",
")",
"as",
"f",
":",
"for",
"i",
",",
"feat_name",
"in",
"enumerate",
"(",
"feat_names",
")",
":",
"if",
"feat_name",
".",
... | https://github.com/ChenglongChen/kaggle-CrowdFlower/blob/a72eabb2e53c308c345905eff79c3c8e3a389239/Code/Feat/feat_utils.py#L43-L52 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlDoc.stringGetNodeList | (self, value) | return __tmp | Parse the value string and build the node list associated.
Should produce a flat tree with only TEXTs and ENTITY_REFs. | Parse the value string and build the node list associated.
Should produce a flat tree with only TEXTs and ENTITY_REFs. | [
"Parse",
"the",
"value",
"string",
"and",
"build",
"the",
"node",
"list",
"associated",
".",
"Should",
"produce",
"a",
"flat",
"tree",
"with",
"only",
"TEXTs",
"and",
"ENTITY_REFs",
"."
] | def stringGetNodeList(self, value):
"""Parse the value string and build the node list associated.
Should produce a flat tree with only TEXTs and ENTITY_REFs. """
ret = libxml2mod.xmlStringGetNodeList(self._o, value)
if ret is None:raise treeError('xmlStringGetNodeList() failed')
... | [
"def",
"stringGetNodeList",
"(",
"self",
",",
"value",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlStringGetNodeList",
"(",
"self",
".",
"_o",
",",
"value",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlStringGetNodeList() failed'",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4573-L4579 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/plan/robotoptimize.py | python | KlamptVariable.bind | (self,obj) | Binds all Variables associated with this to the value of Klamp't object obj | Binds all Variables associated with this to the value of Klamp't object obj | [
"Binds",
"all",
"Variables",
"associated",
"with",
"this",
"to",
"the",
"value",
"of",
"Klamp",
"t",
"object",
"obj"
] | def bind(self,obj):
"""Binds all Variables associated with this to the value of Klamp't object obj"""
if self.type in ['Config','Vector','Vector3','Point']:
self.variables[0].bind(obj)
elif self.type == 'Configs':
assert len(obj) == len(self.variables),"Invalid number of ... | [
"def",
"bind",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"type",
"in",
"[",
"'Config'",
",",
"'Vector'",
",",
"'Vector3'",
",",
"'Point'",
"]",
":",
"self",
".",
"variables",
"[",
"0",
"]",
".",
"bind",
"(",
"obj",
")",
"elif",
"self"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/robotoptimize.py#L30-L52 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/mscv_helper.py | python | copy_redist_files | (self, package, filter_list) | return any_files | Copies redistributable files matching a given filter list from a redistributable package
The function returns True if at least one files will be copied, False otherwise
Note: If the filter list is an empty list, all files from the package are copied | Copies redistributable files matching a given filter list from a redistributable package
The function returns True if at least one files will be copied, False otherwise
Note: If the filter list is an empty list, all files from the package are copied | [
"Copies",
"redistributable",
"files",
"matching",
"a",
"given",
"filter",
"list",
"from",
"a",
"redistributable",
"package",
"The",
"function",
"returns",
"True",
"if",
"at",
"least",
"one",
"files",
"will",
"be",
"copied",
"False",
"otherwise",
"Note",
":",
"... | def copy_redist_files(self, package, filter_list):
"""
Copies redistributable files matching a given filter list from a redistributable package
The function returns True if at least one files will be copied, False otherwise
Note: If the filter list is an empty list, all files from the package are copied
"""
folde... | [
"def",
"copy_redist_files",
"(",
"self",
",",
"package",
",",
"filter_list",
")",
":",
"folder",
"=",
"''",
"if",
"'REDIST_PATH'",
"in",
"self",
".",
"env",
":",
"if",
"package",
"in",
"self",
".",
"env",
"[",
"'REDIST_PATH'",
"]",
":",
"folder",
"=",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/mscv_helper.py#L1231-L1268 | |
mozilla/DeepSpeech | aa1d28530d531d0d92289bf5f11a49fe516fdc86 | native_client/ctcdecode/__init__.py | python | UTF8Alphabet.EncodeSingle | (self, input) | return super(UTF8Alphabet, self).EncodeSingle(input.encode('utf-8')) | Encode a single character/output class into a label. Character must be in
the alphabet, this method will assert that. Use `CanEncodeSingle` to test. | Encode a single character/output class into a label. Character must be in
the alphabet, this method will assert that. Use `CanEncodeSingle` to test. | [
"Encode",
"a",
"single",
"character",
"/",
"output",
"class",
"into",
"a",
"label",
".",
"Character",
"must",
"be",
"in",
"the",
"alphabet",
"this",
"method",
"will",
"assert",
"that",
".",
"Use",
"CanEncodeSingle",
"to",
"test",
"."
] | def EncodeSingle(self, input):
'''
Encode a single character/output class into a label. Character must be in
the alphabet, this method will assert that. Use `CanEncodeSingle` to test.
'''
return super(UTF8Alphabet, self).EncodeSingle(input.encode('utf-8')) | [
"def",
"EncodeSingle",
"(",
"self",
",",
"input",
")",
":",
"return",
"super",
"(",
"UTF8Alphabet",
",",
"self",
")",
".",
"EncodeSingle",
"(",
"input",
".",
"encode",
"(",
"'utf-8'",
")",
")"
] | https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/native_client/ctcdecode/__init__.py#L113-L118 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/modules/module.py | python | Module.xpu | (self: T, device: Optional[Union[int, device]] = None) | return self._apply(lambda t: t.xpu(device)) | r"""Moves all model parameters and buffers to the XPU.
This also makes associated parameters and buffers different objects. So
it should be called before constructing optimizer if the module will
live on XPU while being optimized.
.. note::
This method modifies the module i... | r"""Moves all model parameters and buffers to the XPU. | [
"r",
"Moves",
"all",
"model",
"parameters",
"and",
"buffers",
"to",
"the",
"XPU",
"."
] | def xpu(self: T, device: Optional[Union[int, device]] = None) -> T:
r"""Moves all model parameters and buffers to the XPU.
This also makes associated parameters and buffers different objects. So
it should be called before constructing optimizer if the module will
live on XPU while being... | [
"def",
"xpu",
"(",
"self",
":",
"T",
",",
"device",
":",
"Optional",
"[",
"Union",
"[",
"int",
",",
"device",
"]",
"]",
"=",
"None",
")",
"->",
"T",
":",
"return",
"self",
".",
"_apply",
"(",
"lambda",
"t",
":",
"t",
".",
"xpu",
"(",
"device",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/modules/module.py#L691-L708 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | timemory/profiler/profiler.py | python | FakeProfiler.__call__ | (self, func) | return function_wrapper | Decorator | Decorator | [
"Decorator"
] | def __call__(self, func):
"""Decorator"""
@wraps(func)
def function_wrapper(*args, **kwargs):
return func(*args, **kwargs)
return function_wrapper | [
"def",
"__call__",
"(",
"self",
",",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"function_wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"fu... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/profiler/profiler.py#L357-L364 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/validate.py | python | is_mixed_list | (value, *args) | Check that the value is a list.
Allow specifying the type of each member.
Work on lists of specific lengths.
You specify each member as a positional argument specifying type
Each type should be one of the following strings :
'integer', 'float', 'ip_addr', 'string', 'boolean'
So ... | Check that the value is a list.
Allow specifying the type of each member.
Work on lists of specific lengths.
You specify each member as a positional argument specifying type
Each type should be one of the following strings :
'integer', 'float', 'ip_addr', 'string', 'boolean'
So ... | [
"Check",
"that",
"the",
"value",
"is",
"a",
"list",
".",
"Allow",
"specifying",
"the",
"type",
"of",
"each",
"member",
".",
"Work",
"on",
"lists",
"of",
"specific",
"lengths",
".",
"You",
"specify",
"each",
"member",
"as",
"a",
"positional",
"argument",
... | def is_mixed_list(value, *args):
"""
Check that the value is a list.
Allow specifying the type of each member.
Work on lists of specific lengths.
You specify each member as a positional argument specifying type
Each type should be one of the following strings :
'integer', 'float'... | [
"def",
"is_mixed_list",
"(",
"value",
",",
"*",
"args",
")",
":",
"try",
":",
"length",
"=",
"len",
"(",
"value",
")",
"except",
"TypeError",
":",
"raise",
"VdtTypeError",
"(",
"value",
")",
"if",
"length",
"<",
"len",
"(",
"args",
")",
":",
"raise",... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/validate.py#L1231-L1296 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/Scaffolds/MurckoScaffold.py | python | MakeScaffoldGeneric | (mol) | return Chem.RemoveHs(res) | Makes a Murcko scaffold generic (i.e. all atom types->C and all bonds ->single
>>> Chem.MolToSmiles(MakeScaffoldGeneric(Chem.MolFromSmiles('c1ccccc1')))
'C1CCCCC1'
>>> Chem.MolToSmiles(MakeScaffoldGeneric(Chem.MolFromSmiles('c1ncccc1')))
'C1CCCCC1'
The following were associated with sf.net issue 246
>>> C... | Makes a Murcko scaffold generic (i.e. all atom types->C and all bonds ->single | [
"Makes",
"a",
"Murcko",
"scaffold",
"generic",
"(",
"i",
".",
"e",
".",
"all",
"atom",
"types",
"-",
">",
"C",
"and",
"all",
"bonds",
"-",
">",
"single"
] | def MakeScaffoldGeneric(mol):
""" Makes a Murcko scaffold generic (i.e. all atom types->C and all bonds ->single
>>> Chem.MolToSmiles(MakeScaffoldGeneric(Chem.MolFromSmiles('c1ccccc1')))
'C1CCCCC1'
>>> Chem.MolToSmiles(MakeScaffoldGeneric(Chem.MolFromSmiles('c1ncccc1')))
'C1CCCCC1'
The following were asso... | [
"def",
"MakeScaffoldGeneric",
"(",
"mol",
")",
":",
"res",
"=",
"Chem",
".",
"Mol",
"(",
"mol",
")",
"for",
"atom",
"in",
"res",
".",
"GetAtoms",
"(",
")",
":",
"if",
"atom",
".",
"GetAtomicNum",
"(",
")",
"!=",
"1",
":",
"atom",
".",
"SetAtomicNum... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Scaffolds/MurckoScaffold.py#L18-L47 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/dev/v8gen.py | python | GenerateGnArgs._goma_args | (self) | Gn args for using goma. | Gn args for using goma. | [
"Gn",
"args",
"for",
"using",
"goma",
"."
] | def _goma_args(self):
"""Gn args for using goma."""
# Specify goma args if we want to use goma and if goma isn't specified
# via command line already. The command-line always has precedence over
# any other specification.
if (self._use_goma and
not any(re.match(r'use_goma\s*=.*', x) for x in... | [
"def",
"_goma_args",
"(",
"self",
")",
":",
"# Specify goma args if we want to use goma and if goma isn't specified",
"# via command line already. The command-line always has precedence over",
"# any other specification.",
"if",
"(",
"self",
".",
"_use_goma",
"and",
"not",
"any",
"... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/dev/v8gen.py#L244-L256 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/credentials.py | python | AssumeRoleWithWebIdentityCredentialFetcher._get_credentials | (self) | return client.assume_role_with_web_identity(**kwargs) | Get credentials by calling assume role. | Get credentials by calling assume role. | [
"Get",
"credentials",
"by",
"calling",
"assume",
"role",
"."
] | def _get_credentials(self):
"""Get credentials by calling assume role."""
kwargs = self._assume_role_kwargs()
# Assume role with web identity does not require credentials other than
# the token, explicitly configure the client to not sign requests.
config = Config(signature_versi... | [
"def",
"_get_credentials",
"(",
"self",
")",
":",
"kwargs",
"=",
"self",
".",
"_assume_role_kwargs",
"(",
")",
"# Assume role with web identity does not require credentials other than",
"# the token, explicitly configure the client to not sign requests.",
"config",
"=",
"Config",
... | 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/credentials.py#L856-L863 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _FunctionState.begin | (self, function_name, function_name_start_position, body_start_position, end_position,
parameter_start_position, parameter_end_position, clean_lines) | Start analyzing function body.
Args:
function_name: The name of the function being tracked.
function_name_start_position: Position in elided where the function name starts.
body_start_position: Position in elided of the { or the ; for a prototype.
end_position: P... | Start analyzing function body. | [
"Start",
"analyzing",
"function",
"body",
"."
] | def begin(self, function_name, function_name_start_position, body_start_position, end_position,
parameter_start_position, parameter_end_position, clean_lines):
"""Start analyzing function body.
Args:
function_name: The name of the function being tracked.
function_n... | [
"def",
"begin",
"(",
"self",
",",
"function_name",
",",
"function_name_start_position",
",",
"body_start_position",
",",
"end_position",
",",
"parameter_start_position",
",",
"parameter_end_position",
",",
"clean_lines",
")",
":",
"self",
".",
"in_a_function",
"=",
"T... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L539-L566 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/tooltip.py | python | TooltipBase.showtip | (self) | display the tooltip | display the tooltip | [
"display",
"the",
"tooltip"
] | def showtip(self):
"""display the tooltip"""
if self.tipwindow:
return
self.tipwindow = tw = Toplevel(self.anchor_widget)
# show no border on the top level window
tw.wm_overrideredirect(1)
try:
# This command is only needed and available on Tk >= 8... | [
"def",
"showtip",
"(",
"self",
")",
":",
"if",
"self",
".",
"tipwindow",
":",
"return",
"self",
".",
"tipwindow",
"=",
"tw",
"=",
"Toplevel",
"(",
"self",
".",
"anchor_widget",
")",
"# show no border on the top level window",
"tw",
".",
"wm_overrideredirect",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/tooltip.py#L26-L45 | ||
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/ecl_ekf/plotting/data_plots.py | python | get_min_arg_time_value | (
time_series_data: np.ndarray, data_time: np.ndarray) | return (min_arg, min_value, min_time) | :param time_series_data:
:param data_time:
:return: | :param time_series_data:
:param data_time:
:return: | [
":",
"param",
"time_series_data",
":",
":",
"param",
"data_time",
":",
":",
"return",
":"
] | def get_min_arg_time_value(
time_series_data: np.ndarray, data_time: np.ndarray) -> Tuple[int, float, float]:
"""
:param time_series_data:
:param data_time:
:return:
"""
min_arg = np.argmin(time_series_data)
min_time = data_time[min_arg]
min_value = np.amin(time_series_data)
... | [
"def",
"get_min_arg_time_value",
"(",
"time_series_data",
":",
"np",
".",
"ndarray",
",",
"data_time",
":",
"np",
".",
"ndarray",
")",
"->",
"Tuple",
"[",
"int",
",",
"float",
",",
"float",
"]",
":",
"min_arg",
"=",
"np",
".",
"argmin",
"(",
"time_series... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/ecl_ekf/plotting/data_plots.py#L14-L24 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/service.py | python | RpcController.Failed | (self) | Returns true if the call failed.
After a call has finished, returns true if the call failed. The possible
reasons for failure depend on the RPC implementation. Failed() must not
be called before a call has finished. If Failed() returns true, the
contents of the response message are undefined. | Returns true if the call failed. | [
"Returns",
"true",
"if",
"the",
"call",
"failed",
"."
] | def Failed(self):
"""Returns true if the call failed.
After a call has finished, returns true if the call failed. The possible
reasons for failure depend on the RPC implementation. Failed() must not
be called before a call has finished. If Failed() returns true, the
contents of the response mess... | [
"def",
"Failed",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/service.py#L142-L150 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/throbber.py | python | Throbber.SetRest | (self, rest) | Set rest image | Set rest image | [
"Set",
"rest",
"image"
] | def SetRest(self, rest):
"""Set rest image"""
self.rest = rest | [
"def",
"SetRest",
"(",
"self",
",",
"rest",
")",
":",
"self",
".",
"rest",
"=",
"rest"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/throbber.py#L234-L236 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py | python | find_duplicates | (a, key=None, ignoremask=True, return_index=False) | Find the duplicates in a structured array along a given key
Parameters
----------
a : array-like
Input array
key : {string, None}, optional
Name of the fields along which to check the duplicates.
If None, the search is performed by records
ignoremask : {True, False}, optiona... | Find the duplicates in a structured array along a given key | [
"Find",
"the",
"duplicates",
"in",
"a",
"structured",
"array",
"along",
"a",
"given",
"key"
] | def find_duplicates(a, key=None, ignoremask=True, return_index=False):
"""
Find the duplicates in a structured array along a given key
Parameters
----------
a : array-like
Input array
key : {string, None}, optional
Name of the fields along which to check the duplicates.
... | [
"def",
"find_duplicates",
"(",
"a",
",",
"key",
"=",
"None",
",",
"ignoremask",
"=",
"True",
",",
"return_index",
"=",
"False",
")",
":",
"a",
"=",
"np",
".",
"asanyarray",
"(",
"a",
")",
".",
"ravel",
"(",
")",
"# Get a dictionary of fields",
"fields",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py#L1348-L1402 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | python | RegistersPane.get_frame_content | (self, frame) | return result | Returns a list of key-value pairs ("name", "value") of registers in frame | Returns a list of key-value pairs ("name", "value") of registers in frame | [
"Returns",
"a",
"list",
"of",
"key",
"-",
"value",
"pairs",
"(",
"name",
"value",
")",
"of",
"registers",
"in",
"frame"
] | def get_frame_content(self, frame):
""" Returns a list of key-value pairs ("name", "value") of registers in frame """
result = []
for register_sets in frame.GetRegisters():
# hack the register group name into the list of registers...
result.append((" = = %s =" % register... | [
"def",
"get_frame_content",
"(",
"self",
",",
"frame",
")",
":",
"result",
"=",
"[",
"]",
"for",
"register_sets",
"in",
"frame",
".",
"GetRegisters",
"(",
")",
":",
"# hack the register group name into the list of registers...",
"result",
".",
"append",
"(",
"(",
... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L519-L529 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/graph_editor/edit.py | python | detach_control_outputs | (sgv, control_outputs) | Detach all the external control outputs of the subgraph sgv.
Args:
sgv: the subgraph view to be detached. This argument is converted to a
subgraph using the same rules as the function subgraph.make_view.
control_outputs: a util.ControlOutputs instance. | Detach all the external control outputs of the subgraph sgv. | [
"Detach",
"all",
"the",
"external",
"control",
"outputs",
"of",
"the",
"subgraph",
"sgv",
"."
] | def detach_control_outputs(sgv, control_outputs):
"""Detach all the external control outputs of the subgraph sgv.
Args:
sgv: the subgraph view to be detached. This argument is converted to a
subgraph using the same rules as the function subgraph.make_view.
control_outputs: a util.ControlOutputs insta... | [
"def",
"detach_control_outputs",
"(",
"sgv",
",",
"control_outputs",
")",
":",
"if",
"not",
"isinstance",
"(",
"control_outputs",
",",
"util",
".",
"ControlOutputs",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected a util.ControlOutputs, got: {}\"",
",",
"type",
"("... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/edit.py#L42-L58 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/bccache.py | python | BytecodeCache.set_bucket | (self, bucket) | Put the bucket into the cache. | Put the bucket into the cache. | [
"Put",
"the",
"bucket",
"into",
"the",
"cache",
"."
] | def set_bucket(self, bucket):
"""Put the bucket into the cache."""
self.dump_bytecode(bucket) | [
"def",
"set_bucket",
"(",
"self",
",",
"bucket",
")",
":",
"self",
".",
"dump_bytecode",
"(",
"bucket",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/bccache.py#L190-L192 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.HasAlignment | (*args, **kwargs) | return _controls_.TextAttr_HasAlignment(*args, **kwargs) | HasAlignment(self) -> bool | HasAlignment(self) -> bool | [
"HasAlignment",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasAlignment(*args, **kwargs):
"""HasAlignment(self) -> bool"""
return _controls_.TextAttr_HasAlignment(*args, **kwargs) | [
"def",
"HasAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1776-L1778 | |
h2oai/deepwater | 80e345c582e6ef912a31f42707a2f31c01b064da | tensorflow/src/main/resources/deepwater/train.py | python | ImageClassificationTrainStrategy.accuracy | (self) | return self._accuracy | Returns the tensor containing the accuracy | Returns the tensor containing the accuracy | [
"Returns",
"the",
"tensor",
"containing",
"the",
"accuracy"
] | def accuracy(self):
""" Returns the tensor containing the accuracy"""
return self._accuracy | [
"def",
"accuracy",
"(",
"self",
")",
":",
"return",
"self",
".",
"_accuracy"
] | https://github.com/h2oai/deepwater/blob/80e345c582e6ef912a31f42707a2f31c01b064da/tensorflow/src/main/resources/deepwater/train.py#L116-L118 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvmmzeroplus.py | python | NvmAccessProviderCmsisDapMZeroPlus.read | (self, memory_info, offset, numbytes) | return self.sam.read_flash(address=offset, numbytes=numbytes) | Read the memory in chunks
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset in the memory type
:param numbytes: number of bytes to read
:return: array of bytes read | Read the memory in chunks | [
"Read",
"the",
"memory",
"in",
"chunks"
] | def read(self, memory_info, offset, numbytes):
"""
Read the memory in chunks
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset in the memory type
:param numbytes: number of bytes to read
:return: array ... | [
"def",
"read",
"(",
"self",
",",
"memory_info",
",",
"offset",
",",
"numbytes",
")",
":",
"offset",
"+=",
"memory_info",
"[",
"DeviceMemoryInfoKeys",
".",
"ADDRESS",
"]",
"return",
"self",
".",
"sam",
".",
"read_flash",
"(",
"address",
"=",
"offset",
",",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvmmzeroplus.py#L51-L62 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/jupyterconsole.py | python | InProcessJupyterConsole.__init__ | (self, *args, **kwargs) | A constructor matching that of RichJupyterWidget
:param args: Positional arguments passed directly to RichJupyterWidget
:param kwargs: Keyword arguments. The following keywords are understood by this widget:
- startup_code: A code snippet to run on startup.
the rest are passed to Ric... | A constructor matching that of RichJupyterWidget
:param args: Positional arguments passed directly to RichJupyterWidget
:param kwargs: Keyword arguments. The following keywords are understood by this widget: | [
"A",
"constructor",
"matching",
"that",
"of",
"RichJupyterWidget",
":",
"param",
"args",
":",
"Positional",
"arguments",
"passed",
"directly",
"to",
"RichJupyterWidget",
":",
"param",
"kwargs",
":",
"Keyword",
"arguments",
".",
"The",
"following",
"keywords",
"are... | def __init__(self, *args, **kwargs):
"""
A constructor matching that of RichJupyterWidget
:param args: Positional arguments passed directly to RichJupyterWidget
:param kwargs: Keyword arguments. The following keywords are understood by this widget:
- startup_code: A code snipp... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"startup_code",
"=",
"kwargs",
".",
"pop",
"(",
"\"startup_code\"",
",",
"\"\"",
")",
"super",
"(",
"InProcessJupyterConsole",
",",
"self",
")",
".",
"__init__",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/jupyterconsole.py#L35-L68 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/session_manager.py | python | SessionManager._model_not_ready | (self, sess) | Checks if the model is ready or not.
Args:
sess: A `Session`.
Returns:
`None` if the model is ready, a `String` with the reason why it is not
ready otherwise. | Checks if the model is ready or not. | [
"Checks",
"if",
"the",
"model",
"is",
"ready",
"or",
"not",
"."
] | def _model_not_ready(self, sess):
"""Checks if the model is ready or not.
Args:
sess: A `Session`.
Returns:
`None` if the model is ready, a `String` with the reason why it is not
ready otherwise.
"""
if self._ready_op is None:
return None
else:
try:
ready_... | [
"def",
"_model_not_ready",
"(",
"self",
",",
"sess",
")",
":",
"if",
"self",
".",
"_ready_op",
"is",
"None",
":",
"return",
"None",
"else",
":",
"try",
":",
"ready_value",
"=",
"sess",
".",
"run",
"(",
"self",
".",
"_ready_op",
")",
"# The model is consi... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/session_manager.py#L312-L344 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray_doc.py | python | _build_doc | (func_name,
desc,
arg_names,
arg_types,
arg_desc,
key_var_num_args=None,
ret_type=None) | return doc_str | Build docstring for imperative functions. | Build docstring for imperative functions. | [
"Build",
"docstring",
"for",
"imperative",
"functions",
"."
] | def _build_doc(func_name,
desc,
arg_names,
arg_types,
arg_desc,
key_var_num_args=None,
ret_type=None):
"""Build docstring for imperative functions."""
param_str = _build_param_doc(arg_names, arg_types, arg_desc)
# if k... | [
"def",
"_build_doc",
"(",
"func_name",
",",
"desc",
",",
"arg_names",
",",
"arg_types",
",",
"arg_desc",
",",
"key_var_num_args",
"=",
"None",
",",
"ret_type",
"=",
"None",
")",
":",
"param_str",
"=",
"_build_param_doc",
"(",
"arg_names",
",",
"arg_types",
"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray_doc.py#L132-L157 | |
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/tensorflow/parse_med_2_ak.py | python | MedTransAK.map_med_2_ak | (self, ak_node, med_node) | entrance for trans med graph 2 ak graph
:param ak_node:
:param med_node:
:return: | entrance for trans med graph 2 ak graph
:param ak_node:
:param med_node:
:return: | [
"entrance",
"for",
"trans",
"med",
"graph",
"2",
"ak",
"graph",
":",
"param",
"ak_node",
":",
":",
"param",
"med_node",
":",
":",
"return",
":"
] | def map_med_2_ak(self, ak_node, med_node):
'''
entrance for trans med graph 2 ak graph
:param ak_node:
:param med_node:
:return:
'''
type_name = med_node['ak_type']
func = getattr(self, type_name, None)
param = OpsParam()
ak_op = OpsProtoIO... | [
"def",
"map_med_2_ak",
"(",
"self",
",",
"ak_node",
",",
"med_node",
")",
":",
"type_name",
"=",
"med_node",
"[",
"'ak_type'",
"]",
"func",
"=",
"getattr",
"(",
"self",
",",
"type_name",
",",
"None",
")",
"param",
"=",
"OpsParam",
"(",
")",
"ak_op",
"=... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/tensorflow/parse_med_2_ak.py#L235-L254 | ||
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | NestingState.InClassDeclaration | (self) | return self.stack and isinstance(self.stack[-1], _ClassInfo) | Check if we are currently one level inside a class or struct declaration.
Returns:
True if top of the stack is a class/struct, False otherwise. | Check if we are currently one level inside a class or struct declaration. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"class",
"or",
"struct",
"declaration",
"."
] | def InClassDeclaration(self):
"""Check if we are currently one level inside a class or struct declaration.
Returns:
True if top of the stack is a class/struct, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _ClassInfo) | [
"def",
"InClassDeclaration",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_ClassInfo",
")"
] | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L2255-L2261 | |
lmb-freiburg/flownet2 | b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc | scripts/cpp_lint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L881-L883 | |
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | GetLineWidth | (line) | Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters. | Determines the width of the line in column positions. | [
"Determines",
"the",
"width",
"of",
"the",
"line",
"in",
"column",
"positions",
"."
] | def GetLineWidth(line):
"""Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
if isinstance(line, unicode):
width =... | [
"def",
"GetLineWidth",
"(",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"unicode",
")",
":",
"width",
"=",
"0",
"for",
"uc",
"in",
"unicodedata",
".",
"normalize",
"(",
"'NFC'",
",",
"line",
")",
":",
"if",
"unicodedata",
".",
"east_asian_w... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L4354-L4373 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/crash_server.py | python | CrashHTTPRequestHandler.do_HEAD | (self) | Default empty implementation for handling HEAD requests. | Default empty implementation for handling HEAD requests. | [
"Default",
"empty",
"implementation",
"for",
"handling",
"HEAD",
"requests",
"."
] | def do_HEAD(self):
""" Default empty implementation for handling HEAD requests. """
self._send_default_response_headers() | [
"def",
"do_HEAD",
"(",
"self",
")",
":",
"self",
".",
"_send_default_response_headers",
"(",
")"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/crash_server.py#L220-L222 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py | python | FSM.add_transition | (self, input_symbol, state, action=None, next_state=None) | This adds a transition that associates:
(input_symbol, current_state) --> (action, next_state)
The action may be set to None in which case the process() method will
ignore the action and only set the next_state. The next_state may be
set to None in which case the current state ... | This adds a transition that associates: | [
"This",
"adds",
"a",
"transition",
"that",
"associates",
":"
] | def add_transition (self, input_symbol, state, action=None, next_state=None):
'''This adds a transition that associates:
(input_symbol, current_state) --> (action, next_state)
The action may be set to None in which case the process() method will
ignore the action and only set ... | [
"def",
"add_transition",
"(",
"self",
",",
"input_symbol",
",",
"state",
",",
"action",
"=",
"None",
",",
"next_state",
"=",
"None",
")",
":",
"if",
"next_state",
"is",
"None",
":",
"next_state",
"=",
"state",
"self",
".",
"state_transitions",
"[",
"(",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py#L131-L146 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/simple.py | python | demo1 | () | Simple demo that create the following pipeline::
sphere - shrink +
cone + > append | Simple demo that create the following pipeline:: | [
"Simple",
"demo",
"that",
"create",
"the",
"following",
"pipeline",
"::"
] | def demo1():
"""
Simple demo that create the following pipeline::
sphere - shrink +
cone + > append
"""
# Create a sphere of radius = 2, theta res. = 32
# This object becomes the active source.
ss = Sphere(Radius=2, ThetaResolution=32)
# Apply the shrink filter. Th... | [
"def",
"demo1",
"(",
")",
":",
"# Create a sphere of radius = 2, theta res. = 32",
"# This object becomes the active source.",
"ss",
"=",
"Sphere",
"(",
"Radius",
"=",
"2",
",",
"ThetaResolution",
"=",
"32",
")",
"# Apply the shrink filter. The Input property is optional. If In... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L2549-L2572 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/platforms/compile_settings_android.py | python | load_android_common_settings | (conf) | Setup all compiler and linker settings shared over all android configurations | Setup all compiler and linker settings shared over all android configurations | [
"Setup",
"all",
"compiler",
"and",
"linker",
"settings",
"shared",
"over",
"all",
"android",
"configurations"
] | def load_android_common_settings(conf):
"""
Setup all compiler and linker settings shared over all android configurations
"""
env = conf.env
ndk_root = env['ANDROID_NDK_HOME']
defines = []
if env['ANDROID_NDK_REV_MAJOR'] < 19:
defines += [
'__ANDROID_API__={}'.format(e... | [
"def",
"load_android_common_settings",
"(",
"conf",
")",
":",
"env",
"=",
"conf",
".",
"env",
"ndk_root",
"=",
"env",
"[",
"'ANDROID_NDK_HOME'",
"]",
"defines",
"=",
"[",
"]",
"if",
"env",
"[",
"'ANDROID_NDK_REV_MAJOR'",
"]",
"<",
"19",
":",
"defines",
"+=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/platforms/compile_settings_android.py#L88-L181 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | ImageHistogram.MakeKey | (*args, **kwargs) | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | MakeKey(byte r, byte g, byte b) -> unsigned long
Get the key in the histogram for the given RGB values | MakeKey(byte r, byte g, byte b) -> unsigned long | [
"MakeKey",
"(",
"byte",
"r",
"byte",
"g",
"byte",
"b",
")",
"-",
">",
"unsigned",
"long"
] | def MakeKey(*args, **kwargs):
"""
MakeKey(byte r, byte g, byte b) -> unsigned long
Get the key in the histogram for the given RGB values
"""
return _core_.ImageHistogram_MakeKey(*args, **kwargs) | [
"def",
"MakeKey",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ImageHistogram_MakeKey",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2747-L2753 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py | python | ParseResults.pprint | (self, *args, **kwargs) | Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})
Example::
ident = Word(alphas, alphanums)
n... | Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) | [
"Pretty",
"-",
"printer",
"for",
"parsed",
"results",
"as",
"a",
"list",
"using",
"the",
"C",
"{",
"pprint",
"}",
"module",
".",
"Accepts",
"additional",
"positional",
"or",
"keyword",
"args",
"as",
"defined",
"for",
"the",
"C",
"{",
"pprint",
".",
"ppri... | def pprint(self, *args, **kwargs):
"""
Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})
Example::
... | [
"def",
"pprint",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"pprint",
".",
"pprint",
"(",
"self",
".",
"asList",
"(",
")",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L916-L937 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Tool/aixlink.py | python | generate | (env) | Add Builders and construction variables for Visual Age linker to
an Environment. | Add Builders and construction variables for Visual Age linker to
an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"Visual",
"Age",
"linker",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""
Add Builders and construction variables for Visual Age linker to
an Environment.
"""
link.generate(env)
env['SMARTLINKFLAGS'] = smart_linkflags
env['LINKFLAGS'] = SCons.Util.CLVar('$SMARTLINKFLAGS')
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -qmkshr... | [
"def",
"generate",
"(",
"env",
")",
":",
"link",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'SMARTLINKFLAGS'",
"]",
"=",
"smart_linkflags",
"env",
"[",
"'LINKFLAGS'",
"]",
"=",
"SCons",
".",
"Util",
".",
"CLVar",
"(",
"'$SMARTLINKFLAGS'",
")",
"env",... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/aixlink.py#L51-L61 | ||
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | 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/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L746-L749 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | RobotModel.getComJacobian | (self) | return _robotsim.RobotModel_getComJacobian(self) | getComJacobian(RobotModel self)
Returns the Jacobian matrix of the current center of mass.
Returns:
(list of 3 lists): a 3xn matrix J such that np.dot(J,dq) gives the
COM velocity at the currene configuration | getComJacobian(RobotModel self) | [
"getComJacobian",
"(",
"RobotModel",
"self",
")"
] | def getComJacobian(self):
"""
getComJacobian(RobotModel self)
Returns the Jacobian matrix of the current center of mass.
Returns:
(list of 3 lists): a 3xn matrix J such that np.dot(J,dq) gives the
COM velocity at the currene configuration
"""
... | [
"def",
"getComJacobian",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModel_getComJacobian",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4842-L4856 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.InheritsBackgroundColour | (*args, **kwargs) | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | InheritsBackgroundColour(self) -> bool | InheritsBackgroundColour(self) -> bool | [
"InheritsBackgroundColour",
"(",
"self",
")",
"-",
">",
"bool"
] | def InheritsBackgroundColour(*args, **kwargs):
"""InheritsBackgroundColour(self) -> bool"""
return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | [
"def",
"InheritsBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_InheritsBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10902-L10904 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/serverui/__init__.py | python | we_are_frozen | () | return hasattr(sys, "frozen") | Returns whether we are frozen via py2exe.
This will affect how we find out where we are located. | Returns whether we are frozen via py2exe.
This will affect how we find out where we are located. | [
"Returns",
"whether",
"we",
"are",
"frozen",
"via",
"py2exe",
".",
"This",
"will",
"affect",
"how",
"we",
"find",
"out",
"where",
"we",
"are",
"located",
"."
] | def we_are_frozen():
"""Returns whether we are frozen via py2exe.
This will affect how we find out where we are located."""
return hasattr(sys, "frozen") | [
"def",
"we_are_frozen",
"(",
")",
":",
"return",
"hasattr",
"(",
"sys",
",",
"\"frozen\"",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/serverui/__init__.py#L16-L19 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/toolbar.py | python | RibbonToolBar.GetToolState | (self, tool_id) | return tool.state & RIBBON_TOOLBAR_TOOL_TOGGLED | Gets the on/off state of a toggle tool.
:param `tool_id`: id of the tool in question, as passed to :meth:`~RibbonToolBar.AddTool`.
:return: ``True`` if the tool is toggled on, ``False`` otherwise.
:see: :meth:`~RibbonToolBar.ToggleTool`
.. versionadded:: 0.9.5 | Gets the on/off state of a toggle tool. | [
"Gets",
"the",
"on",
"/",
"off",
"state",
"of",
"a",
"toggle",
"tool",
"."
] | def GetToolState(self, tool_id):
"""
Gets the on/off state of a toggle tool.
:param `tool_id`: id of the tool in question, as passed to :meth:`~RibbonToolBar.AddTool`.
:return: ``True`` if the tool is toggled on, ``False`` otherwise.
:see: :meth:`~RibbonToolBar.ToggleTool`
... | [
"def",
"GetToolState",
"(",
"self",
",",
"tool_id",
")",
":",
"tool",
"=",
"self",
".",
"FindById",
"(",
"tool_id",
")",
"if",
"tool",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"Invalid tool id\"",
")",
"return",
"tool",
".",
"state",
"&",
"RIBBON_... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/toolbar.py#L722-L739 | |
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | _NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L1940-L1946 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/chat.py | python | Chat.user | (self, user) | Sets the user of this Chat.
:param user: The user of this Chat. # noqa: E501
:type: str | Sets the user of this Chat. | [
"Sets",
"the",
"user",
"of",
"this",
"Chat",
"."
] | def user(self, user):
"""Sets the user of this Chat.
:param user: The user of this Chat. # noqa: E501
:type: str
"""
if user is None:
raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501
self._user = user | [
"def",
"user",
"(",
"self",
",",
"user",
")",
":",
"if",
"user",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `user`, must not be `None`\"",
")",
"# noqa: E501",
"self",
".",
"_user",
"=",
"user"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/chat.py#L131-L141 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/cast.py | python | infer_dtype_from | (val, pandas_dtype: bool = False) | return infer_dtype_from_array(val, pandas_dtype=pandas_dtype) | Interpret the dtype from a scalar or array.
Parameters
----------
val : object
pandas_dtype : bool, default False
whether to infer dtype including pandas extension types.
If False, scalar/array belongs to pandas extension types is inferred as
object | Interpret the dtype from a scalar or array. | [
"Interpret",
"the",
"dtype",
"from",
"a",
"scalar",
"or",
"array",
"."
] | def infer_dtype_from(val, pandas_dtype: bool = False) -> tuple[DtypeObj, Any]:
"""
Interpret the dtype from a scalar or array.
Parameters
----------
val : object
pandas_dtype : bool, default False
whether to infer dtype including pandas extension types.
If False, scalar/array be... | [
"def",
"infer_dtype_from",
"(",
"val",
",",
"pandas_dtype",
":",
"bool",
"=",
"False",
")",
"->",
"tuple",
"[",
"DtypeObj",
",",
"Any",
"]",
":",
"if",
"not",
"is_list_like",
"(",
"val",
")",
":",
"return",
"infer_dtype_from_scalar",
"(",
"val",
",",
"pa... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/cast.py#L672-L686 | |
Vipermdl/OCR_detection_IC15 | 8eebd353d6fac97f5832a138d7af3bd3071670db | model/modules/pspnet.py | python | ResNet.__mean_image_subtraction | (self, images, means = [123.68, 116.78, 103.94]) | return images | image normalization
:param images: bs * w * h * channel
:param means:
:return: | image normalization
:param images: bs * w * h * channel
:param means:
:return: | [
"image",
"normalization",
":",
"param",
"images",
":",
"bs",
"*",
"w",
"*",
"h",
"*",
"channel",
":",
"param",
"means",
":",
":",
"return",
":"
] | def __mean_image_subtraction(self, images, means = [123.68, 116.78, 103.94]):
'''
image normalization
:param images: bs * w * h * channel
:param means:
:return:
'''
num_channels = images.data.shape[1]
if len(means) != num_channels:
raise ValueE... | [
"def",
"__mean_image_subtraction",
"(",
"self",
",",
"images",
",",
"means",
"=",
"[",
"123.68",
",",
"116.78",
",",
"103.94",
"]",
")",
":",
"num_channels",
"=",
"images",
".",
"data",
".",
"shape",
"[",
"1",
"]",
"if",
"len",
"(",
"means",
")",
"!=... | https://github.com/Vipermdl/OCR_detection_IC15/blob/8eebd353d6fac97f5832a138d7af3bd3071670db/model/modules/pspnet.py#L175-L188 | |
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/3rdparty/jinja2/ext.py | python | InternationalizationExtension._parse_block | (self, parser, allow_pluralize) | return referenced, concat(buf) | Parse until the next block tag with a given name. | Parse until the next block tag with a given name. | [
"Parse",
"until",
"the",
"next",
"block",
"tag",
"with",
"a",
"given",
"name",
"."
] | def _parse_block(self, parser, allow_pluralize):
"""Parse until the next block tag with a given name."""
referenced = []
buf = []
while 1:
if parser.stream.current.type == 'data':
buf.append(parser.stream.current.value.replace('%', '%%'))
next(... | [
"def",
"_parse_block",
"(",
"self",
",",
"parser",
",",
"allow_pluralize",
")",
":",
"referenced",
"=",
"[",
"]",
"buf",
"=",
"[",
"]",
"while",
"1",
":",
"if",
"parser",
".",
"stream",
".",
"current",
".",
"type",
"==",
"'data'",
":",
"buf",
".",
... | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/ext.py#L309-L339 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/cpp_lint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'counting='",
",",
"'filter='",
",",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L4779-L4846 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | GeneratorInterface/Herwig7Interface/scripts/parallelization.py | python | uint | (string) | return value | Unsigned int type | Unsigned int type | [
"Unsigned",
"int",
"type"
] | def uint(string):
"""Unsigned int type"""
value = int(string)
if value < 0:
msg = '{0} is negative'.format(string)
raise argparse.ArgumentTypeError(msg)
return value | [
"def",
"uint",
"(",
"string",
")",
":",
"value",
"=",
"int",
"(",
"string",
")",
"if",
"value",
"<",
"0",
":",
"msg",
"=",
"'{0} is negative'",
".",
"format",
"(",
"string",
")",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"msg",
")",
"return",... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/GeneratorInterface/Herwig7Interface/scripts/parallelization.py#L50-L56 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/sparse/linalg/matfuncs.py | python | _smart_matrix_product | (A, B, alpha=None, structure=None) | return out | A matrix product that knows about sparse and structured matrices.
Parameters
----------
A : 2d ndarray
First matrix.
B : 2d ndarray
Second matrix.
alpha : float
The matrix product will be scaled by this constant.
structure : str, optional
A string describing the ... | A matrix product that knows about sparse and structured matrices. | [
"A",
"matrix",
"product",
"that",
"knows",
"about",
"sparse",
"and",
"structured",
"matrices",
"."
] | def _smart_matrix_product(A, B, alpha=None, structure=None):
"""
A matrix product that knows about sparse and structured matrices.
Parameters
----------
A : 2d ndarray
First matrix.
B : 2d ndarray
Second matrix.
alpha : float
The matrix product will be scaled by this... | [
"def",
"_smart_matrix_product",
"(",
"A",
",",
"B",
",",
"alpha",
"=",
"None",
",",
"structure",
"=",
"None",
")",
":",
"if",
"len",
"(",
"A",
".",
"shape",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"'expected A to be a rectangular matrix'",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/linalg/matfuncs.py#L145-L184 | |
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__delslice__ | (self, start, stop) | Deletes the subset of items from between the specified indices. | Deletes the subset of items from between the specified indices. | [
"Deletes",
"the",
"subset",
"of",
"items",
"from",
"between",
"the",
"specified",
"indices",
"."
] | def __delslice__(self, start, stop):
"""Deletes the subset of items from between the specified indices."""
del self._values[start:stop]
self._message_listener.Modified() | [
"def",
"__delslice__",
"(",
"self",
",",
"start",
",",
"stop",
")",
":",
"del",
"self",
".",
"_values",
"[",
"start",
":",
"stop",
"]",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L257-L260 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | softsign | (x) | return nn.softsign(x) | Softsign of a tensor.
Arguments:
x: A tensor or variable.
Returns:
A tensor. | Softsign of a tensor. | [
"Softsign",
"of",
"a",
"tensor",
"."
] | def softsign(x):
"""Softsign of a tensor.
Arguments:
x: A tensor or variable.
Returns:
A tensor.
"""
return nn.softsign(x) | [
"def",
"softsign",
"(",
"x",
")",
":",
"return",
"nn",
".",
"softsign",
"(",
"x",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L4309-L4318 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | CertifyResponse.signatureSigAlg | (self) | return signature.GetUnionSelector() if signature else TPM_ALG_ID.NULL | Selector of the algorithm used to construct the signature | Selector of the algorithm used to construct the signature | [
"Selector",
"of",
"the",
"algorithm",
"used",
"to",
"construct",
"the",
"signature"
] | def signatureSigAlg(self): # TPM_ALG_ID
""" Selector of the algorithm used to construct the signature """
return signature.GetUnionSelector() if signature else TPM_ALG_ID.NULL | [
"def",
"signatureSigAlg",
"(",
"self",
")",
":",
"# TPM_ALG_ID",
"return",
"signature",
".",
"GetUnionSelector",
"(",
")",
"if",
"signature",
"else",
"TPM_ALG_ID",
".",
"NULL"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L12473-L12475 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.next | (self) | return tarinfo | Return the next member of the archive as a TarInfo object, when
TarFile is opened for reading. Return None if there is no more
available. | Return the next member of the archive as a TarInfo object, when
TarFile is opened for reading. Return None if there is no more
available. | [
"Return",
"the",
"next",
"member",
"of",
"the",
"archive",
"as",
"a",
"TarInfo",
"object",
"when",
"TarFile",
"is",
"opened",
"for",
"reading",
".",
"Return",
"None",
"if",
"there",
"is",
"no",
"more",
"available",
"."
] | def next(self):
"""Return the next member of the archive as a TarInfo object, when
TarFile is opened for reading. Return None if there is no more
available.
"""
self._check("ra")
if self.firstmember is not None:
m = self.firstmember
self.firs... | [
"def",
"next",
"(",
"self",
")",
":",
"self",
".",
"_check",
"(",
"\"ra\"",
")",
"if",
"self",
".",
"firstmember",
"is",
"not",
"None",
":",
"m",
"=",
"self",
".",
"firstmember",
"self",
".",
"firstmember",
"=",
"None",
"return",
"m",
"# Read the next ... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L2414-L2458 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/docbook/__init__.py | python | DocbookHtml | (env, target, source=None, *args, **kw) | return result | A pseudo-Builder, providing a Docbook toolchain for HTML output. | A pseudo-Builder, providing a Docbook toolchain for HTML output. | [
"A",
"pseudo",
"-",
"Builder",
"providing",
"a",
"Docbook",
"toolchain",
"for",
"HTML",
"output",
"."
] | def DocbookHtml(env, target, source=None, *args, **kw):
"""
A pseudo-Builder, providing a Docbook toolchain for HTML output.
"""
# Init list of targets/sources
target, source = __extend_targets_sources(target, source)
# Init XSL stylesheet
__init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XS... | [
"def",
"DocbookHtml",
"(",
"env",
",",
"target",
",",
"source",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"# Init list of targets/sources",
"target",
",",
"source",
"=",
"__extend_targets_sources",
"(",
"target",
",",
"source",
")",
"# ... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/docbook/__init__.py#L549-L569 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShell.readlines | (self) | return lines | Replacement for stdin.readlines(). | Replacement for stdin.readlines(). | [
"Replacement",
"for",
"stdin",
".",
"readlines",
"()",
"."
] | def readlines(self):
"""Replacement for stdin.readlines()."""
lines = []
while lines[-1:] != ['\n']:
lines.append(self.readline())
return lines | [
"def",
"readlines",
"(",
"self",
")",
":",
"lines",
"=",
"[",
"]",
"while",
"lines",
"[",
"-",
"1",
":",
"]",
"!=",
"[",
"'\\n'",
"]",
":",
"lines",
".",
"append",
"(",
"self",
".",
"readline",
"(",
")",
")",
"return",
"lines"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L2990-L2995 | |
lmnt-com/haste | 5f704f6132c4aacf2310120b7a1c8d0eea441ab9 | frameworks/tf/layer_norm_gru.py | python | LayerNormGRU.__init__ | (self, num_units, direction='unidirectional', **kwargs) | Initialize the parameters of the GRU layer.
Arguments:
num_units: int, the number of units in the GRU cell.
direction: string, 'unidirectional' or 'bidirectional'.
**kwargs: Dict, keyword arguments (see below).
Keyword Arguments:
kernel_initializer: (optional) the initializer to use fo... | Initialize the parameters of the GRU layer. | [
"Initialize",
"the",
"parameters",
"of",
"the",
"GRU",
"layer",
"."
] | def __init__(self, num_units, direction='unidirectional', **kwargs):
"""
Initialize the parameters of the GRU layer.
Arguments:
num_units: int, the number of units in the GRU cell.
direction: string, 'unidirectional' or 'bidirectional'.
**kwargs: Dict, keyword arguments (see below).
... | [
"def",
"__init__",
"(",
"self",
",",
"num_units",
",",
"direction",
"=",
"'unidirectional'",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"LayerNormGRULayer",
",",
"num_units",
",",
"direction",
",",
"'gru_cell'",
",",
"*",
... | https://github.com/lmnt-com/haste/blob/5f704f6132c4aacf2310120b7a1c8d0eea441ab9/frameworks/tf/layer_norm_gru.py#L194-L231 | ||
abforce/xposed_art_n | ec3fbe417d74d4664cec053d91dd4e3881176374 | tools/cpplint.py | python | FindPreviousMatchingAngleBracket | (clean_lines, linenum, init_prefix) | return False | Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True if a matching bracket exists. | Find the corresponding < that started a template. | [
"Find",
"the",
"corresponding",
"<",
"that",
"started",
"a",
"template",
"."
] | def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
"""Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True i... | [
"def",
"FindPreviousMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_prefix",
")",
":",
"line",
"=",
"init_prefix",
"nesting_stack",
"=",
"[",
"'>'",
"]",
"while",
"True",
":",
"# Find the previous operator",
"match",
"=",
"Search",
"(",
"r'^(... | https://github.com/abforce/xposed_art_n/blob/ec3fbe417d74d4664cec053d91dd4e3881176374/tools/cpplint.py#L2178-L2232 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/api.py | python | sorted_partitioned_columns | (pf, filters=None) | return out | The columns that are known to be sorted partition-by-partition
They may not be sorted within each partition, but all elements in one
row group are strictly greater than all elements in previous row groups.
Examples
--------
>>> sorted_partitioned_columns(pf)
{'id': {'min': [1, 5, 10], 'max': [... | The columns that are known to be sorted partition-by-partition | [
"The",
"columns",
"that",
"are",
"known",
"to",
"be",
"sorted",
"partition",
"-",
"by",
"-",
"partition"
] | def sorted_partitioned_columns(pf, filters=None):
"""
The columns that are known to be sorted partition-by-partition
They may not be sorted within each partition, but all elements in one
row group are strictly greater than all elements in previous row groups.
Examples
--------
>>> sorted_p... | [
"def",
"sorted_partitioned_columns",
"(",
"pf",
",",
"filters",
"=",
"None",
")",
":",
"s",
"=",
"statistics",
"(",
"pf",
")",
"if",
"(",
"filters",
"is",
"not",
"None",
")",
"&",
"(",
"filters",
"!=",
"[",
"]",
")",
":",
"idx_list",
"=",
"[",
"i",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/api.py#L758-L800 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.ChangeLexerState | (*args, **kwargs) | return _stc.StyledTextCtrl_ChangeLexerState(*args, **kwargs) | ChangeLexerState(self, int start, int end) -> int | ChangeLexerState(self, int start, int end) -> int | [
"ChangeLexerState",
"(",
"self",
"int",
"start",
"int",
"end",
")",
"-",
">",
"int"
] | def ChangeLexerState(*args, **kwargs):
"""ChangeLexerState(self, int start, int end) -> int"""
return _stc.StyledTextCtrl_ChangeLexerState(*args, **kwargs) | [
"def",
"ChangeLexerState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_ChangeLexerState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6333-L6335 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/sandbox.py | python | SandboxedEnvironment.is_safe_attribute | (self, obj, attr, value) | return not (attr.startswith('_') or is_internal_attribute(obj, attr)) | The sandboxed environment will call this method to check if the
attribute of an object is safe to access. Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python objects as returned by the
:func:`is_internal_attr... | The sandboxed environment will call this method to check if the
attribute of an object is safe to access. Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python objects as returned by the
:func:`is_internal_attr... | [
"The",
"sandboxed",
"environment",
"will",
"call",
"this",
"method",
"to",
"check",
"if",
"the",
"attribute",
"of",
"an",
"object",
"is",
"safe",
"to",
"access",
".",
"Per",
"default",
"all",
"attributes",
"starting",
"with",
"an",
"underscore",
"are",
"cons... | def is_safe_attribute(self, obj, attr, value):
"""The sandboxed environment will call this method to check if the
attribute of an object is safe to access. Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python ... | [
"def",
"is_safe_attribute",
"(",
"self",
",",
"obj",
",",
"attr",
",",
"value",
")",
":",
"return",
"not",
"(",
"attr",
".",
"startswith",
"(",
"'_'",
")",
"or",
"is_internal_attribute",
"(",
"obj",
",",
"attr",
")",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/sandbox.py#L323-L330 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.GetDisplayedCommonValueCount | (*args, **kwargs) | return _propgrid.PGProperty_GetDisplayedCommonValueCount(*args, **kwargs) | GetDisplayedCommonValueCount(self) -> int | GetDisplayedCommonValueCount(self) -> int | [
"GetDisplayedCommonValueCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetDisplayedCommonValueCount(*args, **kwargs):
"""GetDisplayedCommonValueCount(self) -> int"""
return _propgrid.PGProperty_GetDisplayedCommonValueCount(*args, **kwargs) | [
"def",
"GetDisplayedCommonValueCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_GetDisplayedCommonValueCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L504-L506 | |
rethinkdb/rethinkdb_rebirth | 54a76551512bebfe1ab1071d9b19dec2cd9c40e6 | packaging/osx/ds_store/store.py | python | DSStoreEntry.read | (cls, block) | return DSStoreEntry(filename, code, typecode, value) | Read a ``.DS_Store`` entry from the containing Block | Read a ``.DS_Store`` entry from the containing Block | [
"Read",
"a",
".",
"DS_Store",
"entry",
"from",
"the",
"containing",
"Block"
] | def read(cls, block):
"""Read a ``.DS_Store`` entry from the containing Block"""
# First read the filename
nlen = block.read(b'>I')[0]
filename = block.read(2 * nlen).decode('utf-16be')
# Next, read the code and type
code, typecode = block.read(b'>4s4s')
# Final... | [
"def",
"read",
"(",
"cls",
",",
"block",
")",
":",
"# First read the filename",
"nlen",
"=",
"block",
".",
"read",
"(",
"b'>I'",
")",
"[",
"0",
"]",
"filename",
"=",
"block",
".",
"read",
"(",
"2",
"*",
"nlen",
")",
".",
"decode",
"(",
"'utf-16be'",
... | https://github.com/rethinkdb/rethinkdb_rebirth/blob/54a76551512bebfe1ab1071d9b19dec2cd9c40e6/packaging/osx/ds_store/store.py#L74-L106 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/find-k-pairs-with-smallest-sums.py | python | Solution2.kSmallestPairs | (self, nums1, nums2, k) | return nsmallest(k, product(nums1, nums2), key=sum) | :type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]] | :type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]] | [
":",
"type",
"nums1",
":",
"List",
"[",
"int",
"]",
":",
"type",
"nums2",
":",
"List",
"[",
"int",
"]",
":",
"type",
"k",
":",
"int",
":",
"rtype",
":",
"List",
"[",
"List",
"[",
"int",
"]]"
] | def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]]
"""
return nsmallest(k, product(nums1, nums2), key=sum) | [
"def",
"kSmallestPairs",
"(",
"self",
",",
"nums1",
",",
"nums2",
",",
"k",
")",
":",
"return",
"nsmallest",
"(",
"k",
",",
"product",
"(",
"nums1",
",",
"nums2",
")",
",",
"key",
"=",
"sum",
")"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/find-k-pairs-with-smallest-sums.py#L43-L50 | |
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | robot-arm/python/iot_robot_arm/hardware/board.py | python | Board.remove_event_handler | (self, event, handler) | Remove hardware event handler. | Remove hardware event handler. | [
"Remove",
"hardware",
"event",
"handler",
"."
] | def remove_event_handler(self, event, handler):
"""
Remove hardware event handler.
"""
self.emitter.remove(event, handler) | [
"def",
"remove_event_handler",
"(",
"self",
",",
"event",
",",
"handler",
")",
":",
"self",
".",
"emitter",
".",
"remove",
"(",
"event",
",",
"handler",
")"
] | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/robot-arm/python/iot_robot_arm/hardware/board.py#L86-L92 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/concat.py | python | union_categoricals | (
to_union, sort_categories: bool = False, ignore_order: bool = False
) | return Categorical(new_codes, categories=categories, ordered=ordered, fastpath=True) | Combine list-like of Categorical-like, unioning categories.
All categories must have the same dtype.
Parameters
----------
to_union : list-like
Categorical, CategoricalIndex, or Series with dtype='category'.
sort_categories : bool, default False
If true, resulting categories will b... | Combine list-like of Categorical-like, unioning categories. | [
"Combine",
"list",
"-",
"like",
"of",
"Categorical",
"-",
"like",
"unioning",
"categories",
"."
] | def union_categoricals(
to_union, sort_categories: bool = False, ignore_order: bool = False
):
"""
Combine list-like of Categorical-like, unioning categories.
All categories must have the same dtype.
Parameters
----------
to_union : list-like
Categorical, CategoricalIndex, or Serie... | [
"def",
"union_categoricals",
"(",
"to_union",
",",
"sort_categories",
":",
"bool",
"=",
"False",
",",
"ignore_order",
":",
"bool",
"=",
"False",
")",
":",
"from",
"pandas",
"import",
"Categorical",
"from",
"pandas",
".",
"core",
".",
"arrays",
".",
"categori... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/concat.py#L154-L319 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/pydoc.py | python | Doc.document | (self, object, name=None, *args) | return self.docother(*args) | Generate documentation for an object. | Generate documentation for an object. | [
"Generate",
"documentation",
"for",
"an",
"object",
"."
] | def document(self, object, name=None, *args):
"""Generate documentation for an object."""
args = (object, name) + args
# 'try' clause is to attempt to handle the possibility that inspect
# identifies something in a way that pydoc itself has issues handling;
# think 'super' and ho... | [
"def",
"document",
"(",
"self",
",",
"object",
",",
"name",
"=",
"None",
",",
"*",
"args",
")",
":",
"args",
"=",
"(",
"object",
",",
"name",
")",
"+",
"args",
"# 'try' clause is to attempt to handle the possibility that inspect",
"# identifies something in a way th... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L351-L367 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/deprecation.py | python | deprecated | (func) | return f | This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used. | This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used. | [
"This",
"is",
"a",
"decorator",
"which",
"can",
"be",
"used",
"to",
"mark",
"functions",
"as",
"deprecated",
".",
"It",
"will",
"result",
"in",
"a",
"warning",
"being",
"emmitted",
"when",
"the",
"function",
"is",
"used",
"."
] | def deprecated(func):
'''This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used.'''
@functools.wraps(func)
def f(*args, **kwargs):
warnings.warn(
'Call to deprecated function {}.'.format(func.__name__),
ca... | [
"def",
"deprecated",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"f",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"'Call to deprecated function {}.'",
".",
"format",
"(",
"func"... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/deprecation.py#L12-L23 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | python/caffe/net_spec.py | python | Top.to_proto | (self) | return to_proto(self) | Generate a NetParameter that contains all layers needed to compute
this top. | Generate a NetParameter that contains all layers needed to compute
this top. | [
"Generate",
"a",
"NetParameter",
"that",
"contains",
"all",
"layers",
"needed",
"to",
"compute",
"this",
"top",
"."
] | def to_proto(self):
"""Generate a NetParameter that contains all layers needed to compute
this top."""
return to_proto(self) | [
"def",
"to_proto",
"(",
"self",
")",
":",
"return",
"to_proto",
"(",
"self",
")"
] | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/python/caffe/net_spec.py#L90-L94 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.SetEndAtLastLine | (*args, **kwargs) | return _stc.StyledTextCtrl_SetEndAtLastLine(*args, **kwargs) | SetEndAtLastLine(self, bool endAtLastLine)
Sets the scroll range so that maximum scroll position has
the last line at the bottom of the view (default).
Setting this to false allows scrolling one page below the last line. | SetEndAtLastLine(self, bool endAtLastLine) | [
"SetEndAtLastLine",
"(",
"self",
"bool",
"endAtLastLine",
")"
] | def SetEndAtLastLine(*args, **kwargs):
"""
SetEndAtLastLine(self, bool endAtLastLine)
Sets the scroll range so that maximum scroll position has
the last line at the bottom of the view (default).
Setting this to false allows scrolling one page below the last line.
"""
... | [
"def",
"SetEndAtLastLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetEndAtLastLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4209-L4217 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/optimizer.py | python | Optimizer._slot_dict | (self, slot_name) | return named_slots | Returns a dict for caching slots created under the given name.
Args:
slot_name: Name for the slot.
Returns:
A dict that maps primary `Variable` objects to the slot created
for that variable, under the given slot name. | Returns a dict for caching slots created under the given name. | [
"Returns",
"a",
"dict",
"for",
"caching",
"slots",
"created",
"under",
"the",
"given",
"name",
"."
] | def _slot_dict(self, slot_name):
"""Returns a dict for caching slots created under the given name.
Args:
slot_name: Name for the slot.
Returns:
A dict that maps primary `Variable` objects to the slot created
for that variable, under the given slot name.
"""
named_slots = self._sl... | [
"def",
"_slot_dict",
"(",
"self",
",",
"slot_name",
")",
":",
"named_slots",
"=",
"self",
".",
"_slots",
".",
"get",
"(",
"slot_name",
",",
"None",
")",
"if",
"named_slots",
"is",
"None",
":",
"named_slots",
"=",
"{",
"}",
"self",
".",
"_slots",
"[",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/optimizer.py#L446-L460 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/graph_util.py | python | extract_sub_graph | (graph_def, dest_nodes) | return out | Extract the subgraph that can reach any of the nodes in 'dest_nodes'.
Args:
graph_def: A graph_pb2.GraphDef proto.
dest_nodes: A list of strings specifying the destination node names.
Returns:
The GraphDef of the sub-graph.
Raises:
TypeError: If 'graph_def' is not a graph_pb2.GraphDef proto. | Extract the subgraph that can reach any of the nodes in 'dest_nodes'. | [
"Extract",
"the",
"subgraph",
"that",
"can",
"reach",
"any",
"of",
"the",
"nodes",
"in",
"dest_nodes",
"."
] | def extract_sub_graph(graph_def, dest_nodes):
"""Extract the subgraph that can reach any of the nodes in 'dest_nodes'.
Args:
graph_def: A graph_pb2.GraphDef proto.
dest_nodes: A list of strings specifying the destination node names.
Returns:
The GraphDef of the sub-graph.
Raises:
TypeError: If... | [
"def",
"extract_sub_graph",
"(",
"graph_def",
",",
"dest_nodes",
")",
":",
"if",
"not",
"isinstance",
"(",
"graph_def",
",",
"graph_pb2",
".",
"GraphDef",
")",
":",
"raise",
"TypeError",
"(",
"\"graph_def must be a graph_pb2.GraphDef proto.\"",
")",
"edges",
"=",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/graph_util.py#L127-L178 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py | python | TransferConfig.__init__ | (self,
multipart_threshold=8 * MB,
multipart_chunksize=8 * MB,
max_request_concurrency=10,
max_submission_concurrency=5,
max_request_queue_size=1000,
max_submission_queue_size=1000,
max_io_queue_size=1... | Configurations for the transfer mangager
:param multipart_threshold: The threshold for which multipart
transfers occur.
:param max_request_concurrency: The maximum number of S3 API
transfer-related requests that can happen at a time.
:param max_submission_concurrency: ... | Configurations for the transfer mangager | [
"Configurations",
"for",
"the",
"transfer",
"mangager"
] | def __init__(self,
multipart_threshold=8 * MB,
multipart_chunksize=8 * MB,
max_request_concurrency=10,
max_submission_concurrency=5,
max_request_queue_size=1000,
max_submission_queue_size=1000,
max_io_... | [
"def",
"__init__",
"(",
"self",
",",
"multipart_threshold",
"=",
"8",
"*",
"MB",
",",
"multipart_chunksize",
"=",
"8",
"*",
"MB",
",",
"max_request_concurrency",
"=",
"10",
",",
"max_submission_concurrency",
"=",
"5",
",",
"max_request_queue_size",
"=",
"1000",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py#L48-L147 | ||
assimp/assimp | 97c7e084c2f7f8c9355ea42f73605890481bddc5 | port/PyAssimp/scripts/transformations.py | python | euler_matrix | (ai, aj, ak, axes='sxyz') | return M | Return homogeneous rotation matrix from Euler angles and axis sequence.
ai, aj, ak : Euler's roll, pitch and yaw angles
axes : One of 24 axis sequences as string or encoded tuple
>>> R = euler_matrix(1, 2, 3, 'syxz')
>>> numpy.allclose(numpy.sum(R[0]), -1.34786452)
True
>>> R = euler_matrix(1,... | Return homogeneous rotation matrix from Euler angles and axis sequence. | [
"Return",
"homogeneous",
"rotation",
"matrix",
"from",
"Euler",
"angles",
"and",
"axis",
"sequence",
"."
] | def euler_matrix(ai, aj, ak, axes='sxyz'):
"""Return homogeneous rotation matrix from Euler angles and axis sequence.
ai, aj, ak : Euler's roll, pitch and yaw angles
axes : One of 24 axis sequences as string or encoded tuple
>>> R = euler_matrix(1, 2, 3, 'syxz')
>>> numpy.allclose(numpy.sum(R[0]),... | [
"def",
"euler_matrix",
"(",
"ai",
",",
"aj",
",",
"ak",
",",
"axes",
"=",
"'sxyz'",
")",
":",
"try",
":",
"firstaxis",
",",
"parity",
",",
"repetition",
",",
"frame",
"=",
"_AXES2TUPLE",
"[",
"axes",
"]",
"except",
"(",
"AttributeError",
",",
"KeyError... | https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L968-L1028 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/MolStandardize/resonance.py | python | enumerate_resonance_smiles | (smiles) | return {Chem.MolToSmiles(m, isomericSmiles=True) for m in mesomers} | Return a set of resonance forms as SMILES strings, given a SMILES string.
:param smiles: A SMILES string.
:returns: A set containing SMILES strings for every possible resonance form.
:rtype: set of strings. | Return a set of resonance forms as SMILES strings, given a SMILES string. | [
"Return",
"a",
"set",
"of",
"resonance",
"forms",
"as",
"SMILES",
"strings",
"given",
"a",
"SMILES",
"string",
"."
] | def enumerate_resonance_smiles(smiles):
"""Return a set of resonance forms as SMILES strings, given a SMILES string.
:param smiles: A SMILES string.
:returns: A set containing SMILES strings for every possible resonance form.
:rtype: set of strings.
"""
mol = Chem.MolFromSmiles(smiles)
# Ch... | [
"def",
"enumerate_resonance_smiles",
"(",
"smiles",
")",
":",
"mol",
"=",
"Chem",
".",
"MolFromSmiles",
"(",
"smiles",
")",
"# Chem.SanitizeMol(mol) # MolFromSmiles does Sanitize by default",
"mesomers",
"=",
"ResonanceEnumerator",
"(",
")",
".",
"enumerate",
"(",
"mol... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/MolStandardize/resonance.py#L79-L89 | |
doxygen/doxygen | c5d4b67565a5fadea5d84d28cfe86db605b4593f | doc/translator.py | python | xopen | (fname, mode='r', encoding='utf-8-sig') | Unified file opening for Python 2 an Python 3.
Python 2 does not have the encoding argument. Python 3 has one, and
the default 'utf-8-sig' is used (skips the BOM automatically). | Unified file opening for Python 2 an Python 3. | [
"Unified",
"file",
"opening",
"for",
"Python",
"2",
"an",
"Python",
"3",
"."
] | def xopen(fname, mode='r', encoding='utf-8-sig'):
'''Unified file opening for Python 2 an Python 3.
Python 2 does not have the encoding argument. Python 3 has one, and
the default 'utf-8-sig' is used (skips the BOM automatically).
'''
if sys.version_info[0] == 2:
return open(fname, mode=mo... | [
"def",
"xopen",
"(",
"fname",
",",
"mode",
"=",
"'r'",
",",
"encoding",
"=",
"'utf-8-sig'",
")",
":",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
"==",
"2",
":",
"return",
"open",
"(",
"fname",
",",
"mode",
"=",
"mode",
")",
"# Python 2 without ... | https://github.com/doxygen/doxygen/blob/c5d4b67565a5fadea5d84d28cfe86db605b4593f/doc/translator.py#L79-L89 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchWall.py | python | areSameWallTypes | (walls) | return True | Check if a list of walls have the same height, width and alignment.
Parameters
----------
walls: list of <ArchComponent.Component>
Returns
-------
bool
True if the walls have the same height, width and alignment, False if
otherwise. | Check if a list of walls have the same height, width and alignment. | [
"Check",
"if",
"a",
"list",
"of",
"walls",
"have",
"the",
"same",
"height",
"width",
"and",
"alignment",
"."
] | def areSameWallTypes(walls):
"""Check if a list of walls have the same height, width and alignment.
Parameters
----------
walls: list of <ArchComponent.Component>
Returns
-------
bool
True if the walls have the same height, width and alignment, False if
otherwise.
"""
... | [
"def",
"areSameWallTypes",
"(",
"walls",
")",
":",
"for",
"att",
"in",
"[",
"\"Width\"",
",",
"\"Height\"",
",",
"\"Align\"",
"]",
":",
"value",
"=",
"None",
"for",
"w",
"in",
"walls",
":",
"if",
"not",
"hasattr",
"(",
"w",
",",
"att",
")",
":",
"r... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchWall.py#L225-L253 | |
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | python/caffe/pycaffe.py | python | _Net_get_id_name | (func, field) | return get_id_name | Generic property that maps func to the layer names into an OrderedDict.
Used for top_names and bottom_names.
Parameters
----------
func: function id -> [id]
field: implementation field name (cache)
Returns
------
A one-parameter function that can be set as a property. | Generic property that maps func to the layer names into an OrderedDict. | [
"Generic",
"property",
"that",
"maps",
"func",
"to",
"the",
"layer",
"names",
"into",
"an",
"OrderedDict",
"."
] | def _Net_get_id_name(func, field):
"""
Generic property that maps func to the layer names into an OrderedDict.
Used for top_names and bottom_names.
Parameters
----------
func: function id -> [id]
field: implementation field name (cache)
Returns
------
A one-parameter function ... | [
"def",
"_Net_get_id_name",
"(",
"func",
",",
"field",
")",
":",
"@",
"property",
"def",
"get_id_name",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"field",
")",
":",
"id_to_name",
"=",
"list",
"(",
"self",
".",
"blobs",
")",
"res... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/python/caffe/pycaffe.py#L295-L319 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/fractions.py | python | Fraction.__abs__ | (a) | return Fraction(abs(a._numerator), a._denominator, _normalize=False) | abs(a) | abs(a) | [
"abs",
"(",
"a",
")"
] | def __abs__(a):
"""abs(a)"""
return Fraction(abs(a._numerator), a._denominator, _normalize=False) | [
"def",
"__abs__",
"(",
"a",
")",
":",
"return",
"Fraction",
"(",
"abs",
"(",
"a",
".",
"_numerator",
")",
",",
"a",
".",
"_denominator",
",",
"_normalize",
"=",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/fractions.py#L500-L502 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py | python | get_input_alternatives | (input_ops) | return input_alternatives, features | Obtain all input alternatives using the input_fn output and heuristics. | Obtain all input alternatives using the input_fn output and heuristics. | [
"Obtain",
"all",
"input",
"alternatives",
"using",
"the",
"input_fn",
"output",
"and",
"heuristics",
"."
] | def get_input_alternatives(input_ops):
"""Obtain all input alternatives using the input_fn output and heuristics."""
input_alternatives = {}
if isinstance(input_ops, input_fn_utils.InputFnOps):
features, unused_labels, default_inputs = input_ops
input_alternatives[DEFAULT_INPUT_ALTERNATIVE_KEY] = default_... | [
"def",
"get_input_alternatives",
"(",
"input_ops",
")",
":",
"input_alternatives",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"input_ops",
",",
"input_fn_utils",
".",
"InputFnOps",
")",
":",
"features",
",",
"unused_labels",
",",
"default_inputs",
"=",
"input_ops",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py#L158-L180 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/slsqp.py | python | fmin_slsqp | (func, x0, eqcons=(), f_eqcons=None, ieqcons=(), f_ieqcons=None,
bounds=(), fprime=None, fprime_eqcons=None,
fprime_ieqcons=None, args=(), iter=100, acc=1.0E-6,
iprint=1, disp=None, full_output=0, epsilon=_epsilon,
callback=None) | Minimize a function using Sequential Least SQuares Programming
Python interface function for the SLSQP Optimization subroutine
originally implemented by Dieter Kraft.
Parameters
----------
func : callable f(x,*args)
Objective function. Must return a scalar.
x0 : 1-D ndarray of float
... | Minimize a function using Sequential Least SQuares Programming | [
"Minimize",
"a",
"function",
"using",
"Sequential",
"Least",
"SQuares",
"Programming"
] | def fmin_slsqp(func, x0, eqcons=(), f_eqcons=None, ieqcons=(), f_ieqcons=None,
bounds=(), fprime=None, fprime_eqcons=None,
fprime_ieqcons=None, args=(), iter=100, acc=1.0E-6,
iprint=1, disp=None, full_output=0, epsilon=_epsilon,
callback=None):
"""
Min... | [
"def",
"fmin_slsqp",
"(",
"func",
",",
"x0",
",",
"eqcons",
"=",
"(",
")",
",",
"f_eqcons",
"=",
"None",
",",
"ieqcons",
"=",
"(",
")",
",",
"f_ieqcons",
"=",
"None",
",",
"bounds",
"=",
"(",
")",
",",
"fprime",
"=",
"None",
",",
"fprime_eqcons",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/slsqp.py#L69-L212 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/compute_api.py | python | mutate | (domain, fcompute, name=None) | Perform a computation repeatedly in the given mutation domain.
This API allows users to write a loop in a tensorized way, which makes it
easier to exploit the parallelism when performing optimizations. The rules
for the computation function are the same as that of :obj:`compute`.
Parameters
------... | Perform a computation repeatedly in the given mutation domain. | [
"Perform",
"a",
"computation",
"repeatedly",
"in",
"the",
"given",
"mutation",
"domain",
"."
] | def mutate(domain, fcompute, name=None):
"""
Perform a computation repeatedly in the given mutation domain.
This API allows users to write a loop in a tensorized way, which makes it
easier to exploit the parallelism when performing optimizations. The rules
for the computation function are the same ... | [
"def",
"mutate",
"(",
"domain",
",",
"fcompute",
",",
"name",
"=",
"None",
")",
":",
"# check API correctness",
"if",
"not",
"isinstance",
"(",
"domain",
",",
"tuple",
")",
":",
"raise",
"APIError",
"(",
"\"The mutation domain must be a tuple\"",
")",
"name",
... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/compute_api.py#L332-L389 | ||
christinaa/LLVM-VideoCore4 | 7773c3c9e5d22b785d4b96ed0acea37c8aa9c183 | bindings/python/llvm/object.py | python | ObjectFile.get_sections | (self, cache=False) | Obtain the sections in this object file.
This is a generator for llvm.object.Section instances.
Sections are exposed as limited-use objects. See the module's
documentation on iterators for more. | Obtain the sections in this object file. | [
"Obtain",
"the",
"sections",
"in",
"this",
"object",
"file",
"."
] | def get_sections(self, cache=False):
"""Obtain the sections in this object file.
This is a generator for llvm.object.Section instances.
Sections are exposed as limited-use objects. See the module's
documentation on iterators for more.
"""
sections = lib.LLVMGetSections(... | [
"def",
"get_sections",
"(",
"self",
",",
"cache",
"=",
"False",
")",
":",
"sections",
"=",
"lib",
".",
"LLVMGetSections",
"(",
"self",
")",
"last",
"=",
"None",
"while",
"True",
":",
"if",
"lib",
".",
"LLVMIsSectionIteratorAtEnd",
"(",
"self",
",",
"sect... | https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/bindings/python/llvm/object.py#L123-L149 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/training_utils.py | python | standardize_weights | (y,
sample_weight=None,
class_weight=None,
sample_weight_mode=None) | return None | Performs sample weight validation and standardization.
Everything gets normalized to a single sample-wise (or timestep-wise)
weight array. If both `sample_weight` and `class_weight` are provided,
the weights are multiplied.
Arguments:
y: Numpy array of model targets to be weighted.
sample_weight: ... | Performs sample weight validation and standardization. | [
"Performs",
"sample",
"weight",
"validation",
"and",
"standardization",
"."
] | def standardize_weights(y,
sample_weight=None,
class_weight=None,
sample_weight_mode=None):
"""Performs sample weight validation and standardization.
Everything gets normalized to a single sample-wise (or timestep-wise)
weight array. If both... | [
"def",
"standardize_weights",
"(",
"y",
",",
"sample_weight",
"=",
"None",
",",
"class_weight",
"=",
"None",
",",
"sample_weight_mode",
"=",
"None",
")",
":",
"# Iterator may return sample_weight as 1-tuple",
"if",
"isinstance",
"(",
"sample_weight",
",",
"tuple",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/training_utils.py#L849-L953 | |
0ad/0ad | f58db82e0e925016d83f4e3fa7ca599e3866e2af | source/tools/fontbuilder2/Packer.py | python | CygonRectanglePacker.tryFindBestPlacement | (self, rectangleWidth, rectangleHeight) | Finds the best position for a rectangle of the given dimensions
rectangleWidth: Width of the rectangle to find a position for
rectangleHeight: Height of the rectangle to find a position for
Returns a Point instance if a valid placement for the rectangle could
be found, otherwise retu... | Finds the best position for a rectangle of the given dimensions
rectangleWidth: Width of the rectangle to find a position for
rectangleHeight: Height of the rectangle to find a position for
Returns a Point instance if a valid placement for the rectangle could
be found, otherwise retu... | [
"Finds",
"the",
"best",
"position",
"for",
"a",
"rectangle",
"of",
"the",
"given",
"dimensions",
"rectangleWidth",
":",
"Width",
"of",
"the",
"rectangle",
"to",
"find",
"a",
"position",
"for",
"rectangleHeight",
":",
"Height",
"of",
"the",
"rectangle",
"to",
... | def tryFindBestPlacement(self, rectangleWidth, rectangleHeight):
"""Finds the best position for a rectangle of the given dimensions
rectangleWidth: Width of the rectangle to find a position for
rectangleHeight: Height of the rectangle to find a position for
Returns a Point instance i... | [
"def",
"tryFindBestPlacement",
"(",
"self",
",",
"rectangleWidth",
",",
"rectangleHeight",
")",
":",
"# Slice index, vertical position and score of the best placement we",
"# could find",
"bestSliceIndex",
"=",
"-",
"1",
"# Slice index where the best placement was found",
"bestSlic... | https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/fontbuilder2/Packer.py#L151-L224 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/diffraction/diffraction_filter_setup_script.py | python | FilterSetupScript.set_default_pars | (self, inst_name) | return | Default parameters | Default parameters | [
"Default",
"parameters"
] | def set_default_pars(self, inst_name):
""" Default parameters
"""
return | [
"def",
"set_default_pars",
"(",
"self",
",",
"inst_name",
")",
":",
"return"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/diffraction/diffraction_filter_setup_script.py#L83-L87 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommandReturnObject.GetError | (self, *args) | return _lldb.SBCommandReturnObject_GetError(self, *args) | GetError(SBCommandReturnObject self) -> char const
GetError(SBCommandReturnObject self, bool if_no_immediate) -> char const * | GetError(SBCommandReturnObject self) -> char const
GetError(SBCommandReturnObject self, bool if_no_immediate) -> char const * | [
"GetError",
"(",
"SBCommandReturnObject",
"self",
")",
"-",
">",
"char",
"const",
"GetError",
"(",
"SBCommandReturnObject",
"self",
"bool",
"if_no_immediate",
")",
"-",
">",
"char",
"const",
"*"
] | def GetError(self, *args):
"""
GetError(SBCommandReturnObject self) -> char const
GetError(SBCommandReturnObject self, bool if_no_immediate) -> char const *
"""
return _lldb.SBCommandReturnObject_GetError(self, *args) | [
"def",
"GetError",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBCommandReturnObject_GetError",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2878-L2883 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecFilterLibtool | (self, *cmd_list) | return libtoolout.returncode | Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'. | Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'. | [
"Calls",
"libtool",
"and",
"filters",
"out",
"/",
"path",
"/",
"to",
"/",
"libtool",
":",
"file",
":",
"foo",
".",
"o",
"has",
"no",
"symbols",
"."
] | def ExecFilterLibtool(self, *cmd_list):
"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'."""
libtool_re = re.compile(r'^.*libtool: (?:for architecture: \S* )?'
r'file: .* has no symbols$')
libtool_re5 = re.compile(
r'^.*libtool: warning ... | [
"def",
"ExecFilterLibtool",
"(",
"self",
",",
"*",
"cmd_list",
")",
":",
"libtool_re",
"=",
"re",
".",
"compile",
"(",
"r'^.*libtool: (?:for architecture: \\S* )?'",
"r'file: .* has no symbols$'",
")",
"libtool_re5",
"=",
"re",
".",
"compile",
"(",
"r'^.*libtool: warn... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/mac_tool.py#L246-L273 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py | python | _RightShift | (x) | return array_ops.pad(x[..., :-1, :], pad) | Shifts next-to-last dimension to the right, adding zero on the left. | Shifts next-to-last dimension to the right, adding zero on the left. | [
"Shifts",
"next",
"-",
"to",
"-",
"last",
"dimension",
"to",
"the",
"right",
"adding",
"zero",
"on",
"the",
"left",
"."
] | def _RightShift(x):
"""Shifts next-to-last dimension to the right, adding zero on the left."""
rank = array_ops.rank(x)
zeros = array_ops.zeros((rank - 2, 2), dtype=dtypes.int32)
pad = array_ops.concat([zeros, array_ops.constant([[1, 0], [0, 0]])], axis=0)
return array_ops.pad(x[..., :-1, :], pad) | [
"def",
"_RightShift",
"(",
"x",
")",
":",
"rank",
"=",
"array_ops",
".",
"rank",
"(",
"x",
")",
"zeros",
"=",
"array_ops",
".",
"zeros",
"(",
"(",
"rank",
"-",
"2",
",",
"2",
")",
",",
"dtype",
"=",
"dtypes",
".",
"int32",
")",
"pad",
"=",
"arr... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py#L479-L484 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/compilerop.py | python | CachingCompiler.cache | (self, transformed_code, number=0, raw_code=None) | return name | Make a name for a block of code, and cache the code.
Parameters
----------
transformed_code : str
The executable Python source code to cache and compile.
number : int
A number which forms part of the code's name. Used for the execution
counter.
raw_... | Make a name for a block of code, and cache the code. | [
"Make",
"a",
"name",
"for",
"a",
"block",
"of",
"code",
"and",
"cache",
"the",
"code",
"."
] | def cache(self, transformed_code, number=0, raw_code=None):
"""Make a name for a block of code, and cache the code.
Parameters
----------
transformed_code : str
The executable Python source code to cache and compile.
number : int
A number which forms part of ... | [
"def",
"cache",
"(",
"self",
",",
"transformed_code",
",",
"number",
"=",
"0",
",",
"raw_code",
"=",
"None",
")",
":",
"if",
"raw_code",
"is",
"None",
":",
"raw_code",
"=",
"transformed_code",
"name",
"=",
"self",
".",
"get_code_name",
"(",
"raw_code",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/compilerop.py#L134-L164 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py | python | _report_compression_stats | (bucket, state) | Report compression stats at the frequency of `compression_stats_logging_frequency` specified in PowerSGD state. | Report compression stats at the frequency of `compression_stats_logging_frequency` specified in PowerSGD state. | [
"Report",
"compression",
"stats",
"at",
"the",
"frequency",
"of",
"compression_stats_logging_frequency",
"specified",
"in",
"PowerSGD",
"state",
"."
] | def _report_compression_stats(bucket, state):
"""
Report compression stats at the frequency of `compression_stats_logging_frequency` specified in PowerSGD state.
"""
if (
bucket.is_last()
and state.iter >= state.next_stats_report
):
stats = state.compression_stats()
l... | [
"def",
"_report_compression_stats",
"(",
"bucket",
",",
"state",
")",
":",
"if",
"(",
"bucket",
".",
"is_last",
"(",
")",
"and",
"state",
".",
"iter",
">=",
"state",
".",
"next_stats_report",
")",
":",
"stats",
"=",
"state",
".",
"compression_stats",
"(",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py#L89-L102 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/tools/scan-build-py/libscanbuild/report.py | python | bug_summary | (output_dir, bug_counter) | return name | Bug summary is a HTML table to give a better overview of the bugs. | Bug summary is a HTML table to give a better overview of the bugs. | [
"Bug",
"summary",
"is",
"a",
"HTML",
"table",
"to",
"give",
"a",
"better",
"overview",
"of",
"the",
"bugs",
"."
] | def bug_summary(output_dir, bug_counter):
""" Bug summary is a HTML table to give a better overview of the bugs. """
name = os.path.join(output_dir, 'summary.html.fragment')
with open(name, 'w') as handle:
indent = 4
handle.write(reindent("""
|<h2>Bug Summary</h2>
|<table>
... | [
"def",
"bug_summary",
"(",
"output_dir",
",",
"bug_counter",
")",
":",
"name",
"=",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"'summary.html.fragment'",
")",
"with",
"open",
"(",
"name",
",",
"'w'",
")",
"as",
"handle",
":",
"indent",
"=",
... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libscanbuild/report.py#L110-L159 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | CheckCheck | (filename, clean_lines, linenum, error) | Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks the use of CHECK and EXPECT macros. | [
"Checks",
"the",
"use",
"of",
"CHECK",
"and",
"EXPECT",
"macros",
"."
] | def CheckCheck(filename, clean_lines, linenum, error):
"""Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
... | [
"def",
"CheckCheck",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Decide the set of replacement macros that should be suggested",
"lines",
"=",
"clean_lines",
".",
"elided",
"check_macro",
"=",
"None",
"start_pos",
"=",
"-",
"1",
"... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L3282-L3406 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | python | VARMA.get_state_transition | (self) | return array_ops.concat([ar_coefs_padded, shift_matrix], axis=0) | Construct state transition matrix from VARMA parameters.
Returns:
the state transition matrix. It has shape
[self.state_dimendion, self.state_dimension]. | Construct state transition matrix from VARMA parameters. | [
"Construct",
"state",
"transition",
"matrix",
"from",
"VARMA",
"parameters",
"."
] | def get_state_transition(self):
"""Construct state transition matrix from VARMA parameters.
Returns:
the state transition matrix. It has shape
[self.state_dimendion, self.state_dimension].
"""
# Pad any unused AR blocks with zeros. The extra state is necessary if
# ma_order >= ar_orde... | [
"def",
"get_state_transition",
"(",
"self",
")",
":",
"# Pad any unused AR blocks with zeros. The extra state is necessary if",
"# ma_order >= ar_order.",
"ar_coefs_padded",
"=",
"array_ops",
".",
"reshape",
"(",
"array_ops",
".",
"pad",
"(",
"self",
".",
"ar_coefs",
",",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py#L105-L123 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ThreadEvent.SetString | (*args, **kwargs) | return _core_.ThreadEvent_SetString(*args, **kwargs) | SetString(self, String string) | SetString(self, String string) | [
"SetString",
"(",
"self",
"String",
"string",
")"
] | def SetString(*args, **kwargs):
"""SetString(self, String string)"""
return _core_.ThreadEvent_SetString(*args, **kwargs) | [
"def",
"SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ThreadEvent_SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L5402-L5404 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/maya/scripts/walterPanel/walterOutliner.py | python | TreeItem.getName | (self) | return "Unknown" | The label of the item. | The label of the item. | [
"The",
"label",
"of",
"the",
"item",
"."
] | def getName(self):
"""The label of the item."""
if self.getType() == self.TYPE_ORIGIN:
return self.originObject
elif self.getType() == self.TYPE_ALEMBIC:
if self.alembicObject == "/":
# It's a root node
return "Walter Root"
ret... | [
"def",
"getName",
"(",
"self",
")",
":",
"if",
"self",
".",
"getType",
"(",
")",
"==",
"self",
".",
"TYPE_ORIGIN",
":",
"return",
"self",
".",
"originObject",
"elif",
"self",
".",
"getType",
"(",
")",
"==",
"self",
".",
"TYPE_ALEMBIC",
":",
"if",
"se... | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterOutliner.py#L1787-L1802 | |
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/lib/datasets/pascal_voc_det.py | python | PascalVOCDet._load_pascal_annotations | (self, index) | return {'boxes': boxes,
'gt_classes': gt_classes,
'gt_overlaps': overlaps,
'flipped': False} | Load image and bounding boxes info from XML file
in the PASCAL VOC format according to image index | Load image and bounding boxes info from XML file
in the PASCAL VOC format according to image index | [
"Load",
"image",
"and",
"bounding",
"boxes",
"info",
"from",
"XML",
"file",
"in",
"the",
"PASCAL",
"VOC",
"format",
"according",
"to",
"image",
"index"
] | def _load_pascal_annotations(self, index):
"""
Load image and bounding boxes info from XML file
in the PASCAL VOC format according to image index
"""
image_name = self._image_index[index]
filename = os.path.join(self._data_path, 'Annotations', image_name + '.xml')
... | [
"def",
"_load_pascal_annotations",
"(",
"self",
",",
"index",
")",
":",
"image_name",
"=",
"self",
".",
"_image_index",
"[",
"index",
"]",
"filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_data_path",
",",
"'Annotations'",
",",
"image_na... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/lib/datasets/pascal_voc_det.py#L151-L193 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.SetFont | (self, font) | return True | Sets the :class:`CustomTreeCtrl` font.
:param `font`: a valid :class:`Font` instance.
:note: Overridden from :class:`PyScrolledWindow`. | Sets the :class:`CustomTreeCtrl` font. | [
"Sets",
"the",
":",
"class",
":",
"CustomTreeCtrl",
"font",
"."
] | def SetFont(self, font):
"""
Sets the :class:`CustomTreeCtrl` font.
:param `font`: a valid :class:`Font` instance.
:note: Overridden from :class:`PyScrolledWindow`.
"""
wx.PyScrolledWindow.SetFont(self, font)
self._normalFont = font
family = s... | [
"def",
"SetFont",
"(",
"self",
",",
"font",
")",
":",
"wx",
".",
"PyScrolledWindow",
".",
"SetFont",
"(",
"self",
",",
"font",
")",
"self",
".",
"_normalFont",
"=",
"font",
"family",
"=",
"self",
".",
"_normalFont",
".",
"GetFamily",
"(",
")",
"if",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L3842-L3871 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/FindGoniometerFromUB.py | python | getSignMaxAbsValInCol | (mat) | return np.sign(mat) * (abs(mat) == abs(mat).max(axis=0)) | Used to find most likely permutation of axes to provide consistency with reference UB.
:param mat: a 2D array
:return out: sign of largest element in each column of abs(matrix) | Used to find most likely permutation of axes to provide consistency with reference UB.
:param mat: a 2D array
:return out: sign of largest element in each column of abs(matrix) | [
"Used",
"to",
"find",
"most",
"likely",
"permutation",
"of",
"axes",
"to",
"provide",
"consistency",
"with",
"reference",
"UB",
".",
":",
"param",
"mat",
":",
"a",
"2D",
"array",
":",
"return",
"out",
":",
"sign",
"of",
"largest",
"element",
"in",
"each"... | def getSignMaxAbsValInCol(mat):
"""
Used to find most likely permutation of axes to provide consistency with reference UB.
:param mat: a 2D array
:return out: sign of largest element in each column of abs(matrix)
"""
return np.sign(mat) * (abs(mat) == abs(mat).max(axis=0)) | [
"def",
"getSignMaxAbsValInCol",
"(",
"mat",
")",
":",
"return",
"np",
".",
"sign",
"(",
"mat",
")",
"*",
"(",
"abs",
"(",
"mat",
")",
"==",
"abs",
"(",
"mat",
")",
".",
"max",
"(",
"axis",
"=",
"0",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/FindGoniometerFromUB.py#L18-L24 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/utils/Options.py | python | Option.get | (self) | return self.__value | Get the value of this option. | Get the value of this option. | [
"Get",
"the",
"value",
"of",
"this",
"option",
"."
] | def get(self):
"""
Get the value of this option.
"""
return self.__value | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"self",
".",
"__value"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/utils/Options.py#L90-L94 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.