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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-filter/python/filter/qa_pm_remez.py | python | remezord | (fcuts, mags, devs, fsamp=2) | return (n, ff, aa, wts) | FIR order estimator (lowpass, highpass, bandpass, mulitiband). | FIR order estimator (lowpass, highpass, bandpass, mulitiband). | [
"FIR",
"order",
"estimator",
"(",
"lowpass",
"highpass",
"bandpass",
"mulitiband",
")",
"."
] | def remezord(fcuts, mags, devs, fsamp=2):
'''
FIR order estimator (lowpass, highpass, bandpass, mulitiband).
'''
# get local copies
fcuts = fcuts[:]
mags = mags[:]
devs = devs[:]
for i in range(len(fcuts)):
fcuts[i] = float(fcuts[i]) / fsamp
nf = len(fcuts)
nm = len(ma... | [
"def",
"remezord",
"(",
"fcuts",
",",
"mags",
",",
"devs",
",",
"fsamp",
"=",
"2",
")",
":",
"# get local copies",
"fcuts",
"=",
"fcuts",
"[",
":",
"]",
"mags",
"=",
"mags",
"[",
":",
"]",
"devs",
"=",
"devs",
"[",
":",
"]",
"for",
"i",
"in",
"... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-filter/python/filter/qa_pm_remez.py#L32-L100 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | ValidCtxt.validCtxtNormalizeAttributeValue | (self, doc, elem, name, value) | return ret | Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any leading and trailing
space (#x20) characters, and by replacing sequen... | Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any leading and trailing
space (#x20) characters, and by replacing sequen... | [
"Does",
"the",
"validation",
"related",
"extra",
"step",
"of",
"the",
"normalization",
"of",
"attribute",
"values",
":",
"If",
"the",
"declared",
"value",
"is",
"not",
"CDATA",
"then",
"the",
"XML",
"processor",
"must",
"further",
"process",
"the",
"normalized... | def validCtxtNormalizeAttributeValue(self, doc, elem, name, value):
"""Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any ... | [
"def",
"validCtxtNormalizeAttributeValue",
"(",
"self",
",",
"doc",
",",
"elem",
",",
"name",
",",
"value",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"if",
"elem",
"is",
"None",
":"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6304-L6318 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.PositionToXY | (*args, **kwargs) | return _stc.StyledTextCtrl_PositionToXY(*args, **kwargs) | PositionToXY(long pos) -> (x, y) | PositionToXY(long pos) -> (x, y) | [
"PositionToXY",
"(",
"long",
"pos",
")",
"-",
">",
"(",
"x",
"y",
")"
] | def PositionToXY(*args, **kwargs):
"""PositionToXY(long pos) -> (x, y)"""
return _stc.StyledTextCtrl_PositionToXY(*args, **kwargs) | [
"def",
"PositionToXY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_PositionToXY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6899-L6901 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/filelike/abstract.py | python | FileLikeObject.close | (self) | Frees internal resources, making the object unusable.
May be a no-op. | Frees internal resources, making the object unusable.
May be a no-op. | [
"Frees",
"internal",
"resources",
"making",
"the",
"object",
"unusable",
".",
"May",
"be",
"a",
"no",
"-",
"op",
"."
] | def close(self):
"""
Frees internal resources, making the object unusable.
May be a no-op.
""" | [
"def",
"close",
"(",
"self",
")",
":"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/filelike/abstract.py#L84-L88 | ||
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | python/open3d/visualization/tensorboard_plugin/plugin.py | python | Open3DPluginWindow.__init__ | (self,
data_reader,
title="Open3D for Tensorboard",
width=1024,
height=768) | Args:
data_reader: Open3DPluginDataReader object to read Tensorboard event
files and Open3D geometry files.
title (str): Window title. [Unused in WebRTC]
width (int): Window width (px).
height (int): Window height (px). | Args:
data_reader: Open3DPluginDataReader object to read Tensorboard event
files and Open3D geometry files.
title (str): Window title. [Unused in WebRTC]
width (int): Window width (px).
height (int): Window height (px). | [
"Args",
":",
"data_reader",
":",
"Open3DPluginDataReader",
"object",
"to",
"read",
"Tensorboard",
"event",
"files",
"and",
"Open3D",
"geometry",
"files",
".",
"title",
"(",
"str",
")",
":",
"Window",
"title",
".",
"[",
"Unused",
"in",
"WebRTC",
"]",
"width",... | def __init__(self,
data_reader,
title="Open3D for Tensorboard",
width=1024,
height=768):
"""
Args:
data_reader: Open3DPluginDataReader object to read Tensorboard event
files and Open3D geometry files.
... | [
"def",
"__init__",
"(",
"self",
",",
"data_reader",
",",
"title",
"=",
"\"Open3D for Tensorboard\"",
",",
"width",
"=",
"1024",
",",
"height",
"=",
"768",
")",
":",
"self",
".",
"data_reader",
"=",
"data_reader",
"self",
".",
"run",
"=",
"\".\"",
"# fixed ... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/visualization/tensorboard_plugin/plugin.py#L52-L85 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/lower.py | python | _HybridDecl.inType | (self, side) | return self.constRefType(side) | Return this decl's C++ Type with inparam semantics. | Return this decl's C++ Type with inparam semantics. | [
"Return",
"this",
"decl",
"s",
"C",
"++",
"Type",
"with",
"inparam",
"semantics",
"."
] | def inType(self, side):
"""Return this decl's C++ Type with inparam semantics."""
if self.ipdltype.isIPDL() and self.ipdltype.isActor():
return self.bareType(side)
return self.constRefType(side) | [
"def",
"inType",
"(",
"self",
",",
"side",
")",
":",
"if",
"self",
".",
"ipdltype",
".",
"isIPDL",
"(",
")",
"and",
"self",
".",
"ipdltype",
".",
"isActor",
"(",
")",
":",
"return",
"self",
".",
"bareType",
"(",
"side",
")",
"return",
"self",
".",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/lower.py#L611-L615 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/tools/jsmin.py | python | JavaScriptMinifier.JSMinify | (self, text) | return "\n".join(new_lines) + "\n" | The main entry point. Takes a text and returns a compressed version.
The compressed version hopefully does the same thing. Line breaks are
preserved.
Args:
text: The text of the code snippet as a multiline string.
Returns:
The compressed text of the code snippet as a multiline string. | The main entry point. Takes a text and returns a compressed version. | [
"The",
"main",
"entry",
"point",
".",
"Takes",
"a",
"text",
"and",
"returns",
"a",
"compressed",
"version",
"."
] | def JSMinify(self, text):
"""The main entry point. Takes a text and returns a compressed version.
The compressed version hopefully does the same thing. Line breaks are
preserved.
Args:
text: The text of the code snippet as a multiline string.
Returns:
The compressed text of the code... | [
"def",
"JSMinify",
"(",
"self",
",",
"text",
")",
":",
"new_lines",
"=",
"[",
"]",
"for",
"line",
"in",
"re",
".",
"split",
"(",
"r\"\\n\"",
",",
"text",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"\"\\t\"",
",",
"\" \"",
")",
"if",
"sel... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/tools/jsmin.py#L191-L282 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/msvc.py | python | SystemInfo.FrameworkVersion64 | (self) | return self._find_dot_net_versions(64) | Microsoft .NET Framework 64bit versions.
Return
------
tuple of str
versions | Microsoft .NET Framework 64bit versions. | [
"Microsoft",
".",
"NET",
"Framework",
"64bit",
"versions",
"."
] | def FrameworkVersion64(self):
"""
Microsoft .NET Framework 64bit versions.
Return
------
tuple of str
versions
"""
return self._find_dot_net_versions(64) | [
"def",
"FrameworkVersion64",
"(",
"self",
")",
":",
"return",
"self",
".",
"_find_dot_net_versions",
"(",
"64",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/msvc.py#L982-L991 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/sql.py | python | execute | (sql, con, cur=None, params=None) | return pandas_sql.execute(*args) | Execute the given SQL query using the provided connection object.
Parameters
----------
sql : string
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
Using SQLAlchemy makes it possible to use any DB supported by the
library.
... | Execute the given SQL query using the provided connection object. | [
"Execute",
"the",
"given",
"SQL",
"query",
"using",
"the",
"provided",
"connection",
"object",
"."
] | def execute(sql, con, cur=None, params=None):
"""
Execute the given SQL query using the provided connection object.
Parameters
----------
sql : string
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
Using SQLAlchemy makes it possib... | [
"def",
"execute",
"(",
"sql",
",",
"con",
",",
"cur",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"cur",
"is",
"None",
":",
"pandas_sql",
"=",
"pandasSQL_builder",
"(",
"con",
")",
"else",
":",
"pandas_sql",
"=",
"pandasSQL_builder",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/sql.py#L185-L210 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/ide/activegrid/tool/FindService.py | python | FindService.SaveFindConfig | (self, findString, wholeWord, matchCase, regExpr = None, wrap = None, upDown = None, replaceString = None) | Save find/replace patterns and search flags to registry.
findString = search pattern
wholeWord = match whole word only
matchCase = match case
regExpr = use regular expressions in search pattern
wrap = return to top/bottom of file on search
... | Save find/replace patterns and search flags to registry.
findString = search pattern
wholeWord = match whole word only
matchCase = match case
regExpr = use regular expressions in search pattern
wrap = return to top/bottom of file on search
... | [
"Save",
"find",
"/",
"replace",
"patterns",
"and",
"search",
"flags",
"to",
"registry",
".",
"findString",
"=",
"search",
"pattern",
"wholeWord",
"=",
"match",
"whole",
"word",
"only",
"matchCase",
"=",
"match",
"case",
"regExpr",
"=",
"use",
"regular",
"exp... | def SaveFindConfig(self, findString, wholeWord, matchCase, regExpr = None, wrap = None, upDown = None, replaceString = None):
""" Save find/replace patterns and search flags to registry.
findString = search pattern
wholeWord = match whole word only
matchCase = match ... | [
"def",
"SaveFindConfig",
"(",
"self",
",",
"findString",
",",
"wholeWord",
",",
"matchCase",
",",
"regExpr",
"=",
"None",
",",
"wrap",
"=",
"None",
",",
"upDown",
"=",
"None",
",",
"replaceString",
"=",
"None",
")",
":",
"config",
"=",
"wx",
".",
"Conf... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/FindService.py#L266-L289 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/environment.py | python | Environment.preprocess | (self, source, name=None, filename=None) | return reduce(lambda s, e: e.preprocess(s, name, filename),
self.iter_extensions(), text_type(source)) | Preprocesses the source with all extensions. This is automatically
called for all parsing and compiling methods but *not* for :meth:`lex`
because there you usually only want the actual source tokenized. | Preprocesses the source with all extensions. This is automatically
called for all parsing and compiling methods but *not* for :meth:`lex`
because there you usually only want the actual source tokenized. | [
"Preprocesses",
"the",
"source",
"with",
"all",
"extensions",
".",
"This",
"is",
"automatically",
"called",
"for",
"all",
"parsing",
"and",
"compiling",
"methods",
"but",
"*",
"not",
"*",
"for",
":",
"meth",
":",
"lex",
"because",
"there",
"you",
"usually",
... | def preprocess(self, source, name=None, filename=None):
"""Preprocesses the source with all extensions. This is automatically
called for all parsing and compiling methods but *not* for :meth:`lex`
because there you usually only want the actual source tokenized.
"""
return reduce... | [
"def",
"preprocess",
"(",
"self",
",",
"source",
",",
"name",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"return",
"reduce",
"(",
"lambda",
"s",
",",
"e",
":",
"e",
".",
"preprocess",
"(",
"s",
",",
"name",
",",
"filename",
")",
",",
"s... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/environment.py#L489-L495 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/formatters.py | python | Formatters.functionUnpackName | (self, id, name, itype="iface", verbose=False) | return self.functionStringName(id, name, "_ac_unpack", itype, verbose) | Return a mod_unpack_name form name.
@param id: The module id.
@param name: Original function name with '_' separation. | Return a mod_unpack_name form name. | [
"Return",
"a",
"mod_unpack_name",
"form",
"name",
"."
] | def functionUnpackName(self, id, name, itype="iface", verbose=False):
"""
Return a mod_unpack_name form name.
@param id: The module id.
@param name: Original function name with '_' separation.
"""
return self.functionStringName(id, name, "_ac_unpack", itype, verbose) | [
"def",
"functionUnpackName",
"(",
"self",
",",
"id",
",",
"name",
",",
"itype",
"=",
"\"iface\"",
",",
"verbose",
"=",
"False",
")",
":",
"return",
"self",
".",
"functionStringName",
"(",
"id",
",",
"name",
",",
"\"_ac_unpack\"",
",",
"itype",
",",
"verb... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/formatters.py#L566-L572 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Variable.__del__ | (self) | Unset the variable in Tcl. | Unset the variable in Tcl. | [
"Unset",
"the",
"variable",
"in",
"Tcl",
"."
] | def __del__(self):
"""Unset the variable in Tcl."""
if self._tk is None:
return
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
self._tk.globalunsetvar(self._name)
if self._tclCommands is not None:
for name in self._tclCommands:
... | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tk",
"is",
"None",
":",
"return",
"if",
"self",
".",
"_tk",
".",
"getboolean",
"(",
"self",
".",
"_tk",
".",
"call",
"(",
"\"info\"",
",",
"\"exists\"",
",",
"self",
".",
"_name",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L328-L338 | ||
CGRU/cgru | 1881a4128530e3d31ac6c25314c18314fc50c2c7 | lib/python/cgruTempFolder.py | python | cgruTempFolder.closeTempFolder | (self) | Missing DocString | Missing DocString | [
"Missing",
"DocString"
] | def closeTempFolder(self):
"""Missing DocString
"""
if self.lock_file is not None:
# Make sure that the lock-file gets deleted again
self.deleteLockFile()
else:
print("ERROR: The Temp-Folder was already closed")
# Set back the variables
self.folderPath = None
self.lock_folder = None
self.lock_... | [
"def",
"closeTempFolder",
"(",
"self",
")",
":",
"if",
"self",
".",
"lock_file",
"is",
"not",
"None",
":",
"# Make sure that the lock-file gets deleted again",
"self",
".",
"deleteLockFile",
"(",
")",
"else",
":",
"print",
"(",
"\"ERROR: The Temp-Folder was already cl... | https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/lib/python/cgruTempFolder.py#L72-L84 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/locomotion_controller_example.py | python | _load_config | (render=True, run_on_robot=False) | Builds the environment for the quadruped robot.
Args:
render: Enable/disable rendering.
run_on_robot: Whether deploy to robot or run in sim. | Builds the environment for the quadruped robot. | [
"Builds",
"the",
"environment",
"for",
"the",
"quadruped",
"robot",
"."
] | def _load_config(render=True, run_on_robot=False):
"""Builds the environment for the quadruped robot.
Args:
render: Enable/disable rendering.
run_on_robot: Whether deploy to robot or run in sim.
"""
if run_on_robot:
locomotion_controller_setup.load_real_config()
else:
locomotion_controller_se... | [
"def",
"_load_config",
"(",
"render",
"=",
"True",
",",
"run_on_robot",
"=",
"False",
")",
":",
"if",
"run_on_robot",
":",
"locomotion_controller_setup",
".",
"load_real_config",
"(",
")",
"else",
":",
"locomotion_controller_setup",
".",
"load_sim_config",
"(",
"r... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/locomotion_controller_example.py#L37-L49 | ||
choasup/caffe-yolo9000 | e8a476c4c23d756632f7a26c681a96e3ab672544 | scripts/cpp_lint.py | python | CheckCaffeRandom | (filename, clean_lines, linenum, error) | Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which should produce deterministic results for a
fixed Caffe seed set u... | Checks for calls to C random functions (rand, rand_r, random, ...). | [
"Checks",
"for",
"calls",
"to",
"C",
"random",
"functions",
"(",
"rand",
"rand_r",
"random",
"...",
")",
"."
] | def CheckCaffeRandom(filename, clean_lines, linenum, error):
"""Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which s... | [
"def",
"CheckCaffeRandom",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
"in",
"c_random_function_list",
":",
"ix",
"=",
"line",
".",
"find",
... | https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/scripts/cpp_lint.py#L1644-L1667 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/clients/base.py | python | Client._add_bearer_token | (self, uri, http_method='GET', body=None,
headers=None, token_placement=None) | return uri, headers, body | Add a bearer token to the request uri, body or authorization header. | Add a bearer token to the request uri, body or authorization header. | [
"Add",
"a",
"bearer",
"token",
"to",
"the",
"request",
"uri",
"body",
"or",
"authorization",
"header",
"."
] | def _add_bearer_token(self, uri, http_method='GET', body=None,
headers=None, token_placement=None):
"""Add a bearer token to the request uri, body or authorization header."""
if token_placement == AUTH_HEADER:
headers = tokens.prepare_bearer_headers(self.access_toke... | [
"def",
"_add_bearer_token",
"(",
"self",
",",
"uri",
",",
"http_method",
"=",
"'GET'",
",",
"body",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"token_placement",
"=",
"None",
")",
":",
"if",
"token_placement",
"==",
"AUTH_HEADER",
":",
"headers",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/clients/base.py#L435-L449 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hypertreelist.py | python | TreeListItem.GetWindow | (self, column=None) | return self._wnd[column] | Returns the window associated to the item.
:param `column`: if not ``None``, an integer specifying the column index.
If it is ``None``, the main column index is used. | Returns the window associated to the item. | [
"Returns",
"the",
"window",
"associated",
"to",
"the",
"item",
"."
] | def GetWindow(self, column=None):
"""
Returns the window associated to the item.
:param `column`: if not ``None``, an integer specifying the column index.
If it is ``None``, the main column index is used.
"""
column = (column is not None and [column] or [self._... | [
"def",
"GetWindow",
"(",
"self",
",",
"column",
"=",
"None",
")",
":",
"column",
"=",
"(",
"column",
"is",
"not",
"None",
"and",
"[",
"column",
"]",
"or",
"[",
"self",
".",
"_owner",
".",
"GetMainColumn",
"(",
")",
"]",
")",
"[",
"0",
"]",
"if",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L1679-L1692 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py | python | take | (a, indices, axis=None, out=None, mode='raise') | return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode) | Take elements from an array along an axis.
When axis is not None, this function does the same thing as "fancy"
indexing (indexing arrays using arrays); however, it can be easier to use
if you need elements along a given axis. A call such as
``np.take(arr, indices, axis=3)`` is equivalent to
``arr[:... | Take elements from an array along an axis. | [
"Take",
"elements",
"from",
"an",
"array",
"along",
"an",
"axis",
"."
] | def take(a, indices, axis=None, out=None, mode='raise'):
"""
Take elements from an array along an axis.
When axis is not None, this function does the same thing as "fancy"
indexing (indexing arrays using arrays); however, it can be easier to use
if you need elements along a given axis. A call such ... | [
"def",
"take",
"(",
"a",
",",
"indices",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"mode",
"=",
"'raise'",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'take'",
",",
"indices",
",",
"axis",
"=",
"axis",
",",
"out",
"=",
"out",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L98-L194 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/plot.py | python | PlotCanvas.SetEnableAntiAliasing | (self, enableAntiAliasing) | Set True to enable anti-aliasing. | Set True to enable anti-aliasing. | [
"Set",
"True",
"to",
"enable",
"anti",
"-",
"aliasing",
"."
] | def SetEnableAntiAliasing(self, enableAntiAliasing):
"""Set True to enable anti-aliasing."""
self._antiAliasingEnabled = enableAntiAliasing
self.Redraw() | [
"def",
"SetEnableAntiAliasing",
"(",
"self",
",",
"enableAntiAliasing",
")",
":",
"self",
".",
"_antiAliasingEnabled",
"=",
"enableAntiAliasing",
"self",
".",
"Redraw",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L870-L873 | ||
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.semantic_parent | (self) | return self._semantic_parent | Return the semantic parent for this cursor. | Return the semantic parent for this cursor. | [
"Return",
"the",
"semantic",
"parent",
"for",
"this",
"cursor",
"."
] | def semantic_parent(self):
"""Return the semantic parent for this cursor."""
if not hasattr(self, '_semantic_parent'):
self._semantic_parent = conf.lib.clang_getCursorSemanticParent(self)
return self._semantic_parent | [
"def",
"semantic_parent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_semantic_parent'",
")",
":",
"self",
".",
"_semantic_parent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorSemanticParent",
"(",
"self",
")",
"return",
"self",
"."... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1252-L1257 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/os2emxpath.py | python | abspath | (path) | return normpath(path) | Return the absolute version of a path | Return the absolute version of a path | [
"Return",
"the",
"absolute",
"version",
"of",
"a",
"path"
] | def abspath(path):
"""Return the absolute version of a path"""
if not isabs(path):
if isinstance(path, unicode):
cwd = os.getcwdu()
else:
cwd = os.getcwd()
path = join(cwd, path)
return normpath(path) | [
"def",
"abspath",
"(",
"path",
")",
":",
"if",
"not",
"isabs",
"(",
"path",
")",
":",
"if",
"isinstance",
"(",
"path",
",",
"unicode",
")",
":",
"cwd",
"=",
"os",
".",
"getcwdu",
"(",
")",
"else",
":",
"cwd",
"=",
"os",
".",
"getcwd",
"(",
")",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/os2emxpath.py#L146-L154 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | xpcom/idl-parser/xpidl.py | python | IDLParser.p_member_method | (self, p) | member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises '; | member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises '; | [
"member",
":",
"attributes",
"IDENTIFIER",
"IDENTIFIER",
"(",
"paramlist",
")",
"raises",
";"
] | def p_member_method(self, p):
"""member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises ';'"""
if 'doccomments' in p[1]:
doccomments = p[1]['doccomments']
else:
doccomments = p.slice[2].doccomments
p[0] = Method(type=p[2],
name=p... | [
"def",
"p_member_method",
"(",
"self",
",",
"p",
")",
":",
"if",
"'doccomments'",
"in",
"p",
"[",
"1",
"]",
":",
"doccomments",
"=",
"p",
"[",
"1",
"]",
"[",
"'doccomments'",
"]",
"else",
":",
"doccomments",
"=",
"p",
".",
"slice",
"[",
"2",
"]",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/xpcom/idl-parser/xpidl.py#L1303-L1316 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Joystick.GetMaxAxes | (*args, **kwargs) | return _misc_.Joystick_GetMaxAxes(*args, **kwargs) | GetMaxAxes(self) -> int | GetMaxAxes(self) -> int | [
"GetMaxAxes",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMaxAxes(*args, **kwargs):
"""GetMaxAxes(self) -> int"""
return _misc_.Joystick_GetMaxAxes(*args, **kwargs) | [
"def",
"GetMaxAxes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_GetMaxAxes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2222-L2224 | |
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/service.xbmc.versioncheck/resources/lib/version_check/common.py | python | upgrade_message2 | (version_installed, version_available, version_stable, old_version) | Prompt user with upgrade suggestion message
:param version_installed: currently installed version
:type version_installed: dict
:param version_available: available version
:type version_available: dict
:param version_stable: latest stable version
:type version_stable: dict
:param old_versio... | Prompt user with upgrade suggestion message | [
"Prompt",
"user",
"with",
"upgrade",
"suggestion",
"message"
] | def upgrade_message2(version_installed, version_available, version_stable, old_version):
""" Prompt user with upgrade suggestion message
:param version_installed: currently installed version
:type version_installed: dict
:param version_available: available version
:type version_available: dict
... | [
"def",
"upgrade_message2",
"(",
"version_installed",
",",
"version_available",
",",
"version_stable",
",",
"old_version",
")",
":",
"# shorten releasecandidate to rc",
"if",
"version_installed",
"[",
"'tag'",
"]",
"==",
"'releasecandidate'",
":",
"version_installed",
"[",... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/service.xbmc.versioncheck/resources/lib/version_check/common.py#L183-L241 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/TaskGen.py | python | after_method | (*k) | return deco | Decorator: register a task generator method which will be executed
after the functions of given name(s)::
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def f... | Decorator: register a task generator method which will be executed
after the functions of given name(s):: | [
"Decorator",
":",
"register",
"a",
"task",
"generator",
"method",
"which",
"will",
"be",
"executed",
"after",
"the",
"functions",
"of",
"given",
"name",
"(",
"s",
")",
"::"
] | def after_method(*k):
"""
Decorator: register a task generator method which will be executed
after the functions of given name(s)::
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@... | [
"def",
"after_method",
"(",
"*",
"k",
")",
":",
"def",
"deco",
"(",
"func",
")",
":",
"setattr",
"(",
"task_gen",
",",
"func",
".",
"__name__",
",",
"func",
")",
"for",
"fun_name",
"in",
"k",
":",
"if",
"not",
"fun_name",
"in",
"task_gen",
".",
"pr... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/TaskGen.py#L423-L449 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py | python | SessionRedirectMixin.rebuild_auth | (self, prepared_request, response) | When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss. | When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss. | [
"When",
"being",
"redirected",
"we",
"may",
"want",
"to",
"strip",
"authentication",
"from",
"the",
"request",
"to",
"avoid",
"leaking",
"credentials",
".",
"This",
"method",
"intelligently",
"removes",
"and",
"reapplies",
"authentication",
"where",
"possible",
"t... | def rebuild_auth(self, prepared_request, response):
"""When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.
"""
headers = pr... | [
"def",
"rebuild_auth",
"(",
"self",
",",
"prepared_request",
",",
"response",
")",
":",
"headers",
"=",
"prepared_request",
".",
"headers",
"url",
"=",
"prepared_request",
".",
"url",
"if",
"'Authorization'",
"in",
"headers",
"and",
"self",
".",
"should_strip_au... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py#L254-L270 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlPrintout.__init__ | (self, *args, **kwargs) | __init__(self, String title=HtmlPrintoutTitleStr) -> HtmlPrintout | __init__(self, String title=HtmlPrintoutTitleStr) -> HtmlPrintout | [
"__init__",
"(",
"self",
"String",
"title",
"=",
"HtmlPrintoutTitleStr",
")",
"-",
">",
"HtmlPrintout"
] | def __init__(self, *args, **kwargs):
"""__init__(self, String title=HtmlPrintoutTitleStr) -> HtmlPrintout"""
_html.HtmlPrintout_swiginit(self,_html.new_HtmlPrintout(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlPrintout_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlPrintout",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1273-L1275 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/square.py | python | _square_tbe | () | return | Square TBE register | Square TBE register | [
"Square",
"TBE",
"register"
] | def _square_tbe():
"""Square TBE register"""
return | [
"def",
"_square_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/square.py#L36-L38 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.get_tensor_file_paths | (self,
node_name,
output_slot,
debug_op,
device_name=None) | return [datum.file_path for datum in
self._watch_key_to_datum[device_name][watch_key]] | Get the file paths from a debug-dumped tensor.
Args:
node_name: (`str`) name of the node that the tensor is produced by.
output_slot: (`int`) output slot index of tensor.
debug_op: (`str`) name of the debug op.
device_name: (`str`) name of the device. If there is only one device or if
... | Get the file paths from a debug-dumped tensor. | [
"Get",
"the",
"file",
"paths",
"from",
"a",
"debug",
"-",
"dumped",
"tensor",
"."
] | def get_tensor_file_paths(self,
node_name,
output_slot,
debug_op,
device_name=None):
"""Get the file paths from a debug-dumped tensor.
Args:
node_name: (`str`) name of the node that the tensor ... | [
"def",
"get_tensor_file_paths",
"(",
"self",
",",
"node_name",
",",
"output_slot",
",",
"debug_op",
",",
"device_name",
"=",
"None",
")",
":",
"device_name",
"=",
"self",
".",
"_infer_device_name",
"(",
"device_name",
",",
"node_name",
")",
"watch_key",
"=",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py#L1466-L1498 | |
zhubenfu/License-Plate-Detect-Recognition-via-Deep-Neural-Networks-accuracy-up-to-99.9 | a2cf438a8d2df7b3a55f869fb01f5410741aae5e | tools/extra/extract_seconds.py | python | get_start_time | (line_iterable, year) | return start_datetime | Find start time from group of lines | Find start time from group of lines | [
"Find",
"start",
"time",
"from",
"group",
"of",
"lines"
] | def get_start_time(line_iterable, year):
"""Find start time from group of lines
"""
start_datetime = None
for line in line_iterable:
line = line.strip()
if line.find('Solving') != -1:
start_datetime = extract_datetime_from_line(line, year)
break
return start_... | [
"def",
"get_start_time",
"(",
"line_iterable",
",",
"year",
")",
":",
"start_datetime",
"=",
"None",
"for",
"line",
"in",
"line_iterable",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
".",
"find",
"(",
"'Solving'",
")",
"!=",
"-",
"1... | https://github.com/zhubenfu/License-Plate-Detect-Recognition-via-Deep-Neural-Networks-accuracy-up-to-99.9/blob/a2cf438a8d2df7b3a55f869fb01f5410741aae5e/tools/extra/extract_seconds.py#L31-L41 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | pytorch/edgeml_pytorch/trainer/drocclf_trainer.py | python | compute_mahalanobis_distance | (grad, diff, radius, device, gamma) | return lamda, mhlnbs_dis | Compute the mahalanobis distance.
grad: (batch,-1)
diff: (batch,-1) | Compute the mahalanobis distance.
grad: (batch,-1)
diff: (batch,-1) | [
"Compute",
"the",
"mahalanobis",
"distance",
".",
"grad",
":",
"(",
"batch",
"-",
"1",
")",
"diff",
":",
"(",
"batch",
"-",
"1",
")"
] | def compute_mahalanobis_distance(grad, diff, radius, device, gamma):
"""
Compute the mahalanobis distance.
grad: (batch,-1)
diff: (batch,-1)
"""
mhlnbs_dis = torch.sqrt(torch.sum(grad*diff**2, dim=1))
#Categorize the batches based on mahalanobis distance
#lamda = 1 : mahalanobis distance... | [
"def",
"compute_mahalanobis_distance",
"(",
"grad",
",",
"diff",
",",
"radius",
",",
"device",
",",
"gamma",
")",
":",
"mhlnbs_dis",
"=",
"torch",
".",
"sqrt",
"(",
"torch",
".",
"sum",
"(",
"grad",
"*",
"diff",
"**",
"2",
",",
"dim",
"=",
"1",
")",
... | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/pytorch/edgeml_pytorch/trainer/drocclf_trainer.py#L40-L53 | |
ucla-vision/xivo | 1b97bf5a3124e62bf4920429af5bb91c7a6de876 | thirdparty/eigen/debug/gdb/printers.py | python | lookup_function | (val) | return None | Look-up and return a pretty-printer that can print va. | Look-up and return a pretty-printer that can print va. | [
"Look",
"-",
"up",
"and",
"return",
"a",
"pretty",
"-",
"printer",
"that",
"can",
"print",
"va",
"."
] | def lookup_function(val):
"Look-up and return a pretty-printer that can print va."
type = val.type
if type.code == gdb.TYPE_CODE_REF:
type = type.target()
type = type.unqualified().strip_typedefs()
typename = type.tag
if typename == None:
return None
for function in pretty_printers_dict:
if funct... | [
"def",
"lookup_function",
"(",
"val",
")",
":",
"type",
"=",
"val",
".",
"type",
"if",
"type",
".",
"code",
"==",
"gdb",
".",
"TYPE_CODE_REF",
":",
"type",
"=",
"type",
".",
"target",
"(",
")",
"type",
"=",
"type",
".",
"unqualified",
"(",
")",
"."... | https://github.com/ucla-vision/xivo/blob/1b97bf5a3124e62bf4920429af5bb91c7a6de876/thirdparty/eigen/debug/gdb/printers.py#L192-L210 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/core.py | python | _recursive_set_fill_value | (fillvalue, dt) | return tuple(output_value) | Create a fill value for a structured dtype.
Parameters
----------
fillvalue : scalar or array_like
Scalar or array representing the fill value. If it is of shorter
length than the number of fields in dt, it will be resized.
dt : dtype
The structured dtype for which to create the... | Create a fill value for a structured dtype. | [
"Create",
"a",
"fill",
"value",
"for",
"a",
"structured",
"dtype",
"."
] | def _recursive_set_fill_value(fillvalue, dt):
"""
Create a fill value for a structured dtype.
Parameters
----------
fillvalue : scalar or array_like
Scalar or array representing the fill value. If it is of shorter
length than the number of fields in dt, it will be resized.
dt : ... | [
"def",
"_recursive_set_fill_value",
"(",
"fillvalue",
",",
"dt",
")",
":",
"fillvalue",
"=",
"np",
".",
"resize",
"(",
"fillvalue",
",",
"len",
"(",
"dt",
".",
"names",
")",
")",
"output_value",
"=",
"[",
"]",
"for",
"(",
"fval",
",",
"name",
")",
"i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L396-L425 | |
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/arraytypes.py | python | VigraArray.sendSocket | (self, socket, flags=0, copy=True, track=False) | return socket.send(transposed, flags, copy=copy, track=track) | Send array and metadata over a ZMQ socket. Only works if the 'zmq' module is available.
The meaning of the arguments is described in zmq.Socket.send(). | Send array and metadata over a ZMQ socket. Only works if the 'zmq' module is available.
The meaning of the arguments is described in zmq.Socket.send(). | [
"Send",
"array",
"and",
"metadata",
"over",
"a",
"ZMQ",
"socket",
".",
"Only",
"works",
"if",
"the",
"zmq",
"module",
"is",
"available",
".",
"The",
"meaning",
"of",
"the",
"arguments",
"is",
"described",
"in",
"zmq",
".",
"Socket",
".",
"send",
"()",
... | def sendSocket(self, socket, flags=0, copy=True, track=False):
'''
Send array and metadata over a ZMQ socket. Only works if the 'zmq' module is available.
The meaning of the arguments is described in zmq.Socket.send().
'''
import zmq
transposed = self.transposeToNumpyOrd... | [
"def",
"sendSocket",
"(",
"self",
",",
"socket",
",",
"flags",
"=",
"0",
",",
"copy",
"=",
"True",
",",
"track",
"=",
"False",
")",
":",
"import",
"zmq",
"transposed",
"=",
"self",
".",
"transposeToNumpyOrder",
"(",
")",
".",
"view",
"(",
"numpy",
".... | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L637-L652 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc.winfo_screenwidth | (self) | return self.tk.getint(
self.tk.call('winfo', 'screenwidth', self._w)) | Return the number of pixels of the width of the screen of
this widget in pixel. | Return the number of pixels of the width of the screen of
this widget in pixel. | [
"Return",
"the",
"number",
"of",
"pixels",
"of",
"the",
"width",
"of",
"the",
"screen",
"of",
"this",
"widget",
"in",
"pixel",
"."
] | def winfo_screenwidth(self):
"""Return the number of pixels of the width of the screen of
this widget in pixel."""
return self.tk.getint(
self.tk.call('winfo', 'screenwidth', self._w)) | [
"def",
"winfo_screenwidth",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'screenwidth'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1098-L1102 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/models/rnn/translate/data_utils.py | python | create_vocabulary | (vocabulary_path, data_path, max_vocabulary_size,
tokenizer=None, normalize_digits=True) | Create vocabulary file (if it does not exist yet) from data file.
Data file is assumed to contain one sentence per line. Each sentence is
tokenized and digits are normalized (if normalize_digits is set).
Vocabulary contains the most-frequent tokens up to max_vocabulary_size.
We write it to vocabulary_path in a... | Create vocabulary file (if it does not exist yet) from data file. | [
"Create",
"vocabulary",
"file",
"(",
"if",
"it",
"does",
"not",
"exist",
"yet",
")",
"from",
"data",
"file",
"."
] | def create_vocabulary(vocabulary_path, data_path, max_vocabulary_size,
tokenizer=None, normalize_digits=True):
"""Create vocabulary file (if it does not exist yet) from data file.
Data file is assumed to contain one sentence per line. Each sentence is
tokenized and digits are normalized (if... | [
"def",
"create_vocabulary",
"(",
"vocabulary_path",
",",
"data_path",
",",
"max_vocabulary_size",
",",
"tokenizer",
"=",
"None",
",",
"normalize_digits",
"=",
"True",
")",
":",
"if",
"not",
"gfile",
".",
"Exists",
"(",
"vocabulary_path",
")",
":",
"print",
"("... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/rnn/translate/data_utils.py#L114-L154 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py | python | Decimal.is_signed | (self) | return self._sign == 1 | Return True if self is negative; otherwise return False. | Return True if self is negative; otherwise return False. | [
"Return",
"True",
"if",
"self",
"is",
"negative",
";",
"otherwise",
"return",
"False",
"."
] | def is_signed(self):
"""Return True if self is negative; otherwise return False."""
return self._sign == 1 | [
"def",
"is_signed",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sign",
"==",
"1"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L3043-L3045 | |
evanw/rapt | 88573a51e4e4f96b0369b3748552ec71354aa813 | build/game/jsparser.py | python | parse | (source, filename=None, starting_line_number=1) | return n | Parse some Javascript
Args:
source: the Javascript source, as a string
filename: the filename to include in messages
starting_line_number: the line number of the first line of the
passed in source, for output messages
Returns:
the parsed source code data structure
... | Parse some Javascript | [
"Parse",
"some",
"Javascript"
] | def parse(source, filename=None, starting_line_number=1):
"""Parse some Javascript
Args:
source: the Javascript source, as a string
filename: the filename to include in messages
starting_line_number: the line number of the first line of the
passed in source, for output messa... | [
"def",
"parse",
"(",
"source",
",",
"filename",
"=",
"None",
",",
"starting_line_number",
"=",
"1",
")",
":",
"t",
"=",
"Tokenizer",
"(",
"source",
",",
"filename",
",",
"starting_line_number",
")",
"x",
"=",
"CompilerContext",
"(",
"False",
")",
"n",
"=... | https://github.com/evanw/rapt/blob/88573a51e4e4f96b0369b3748552ec71354aa813/build/game/jsparser.py#L1125-L1143 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py | python | SConfBuildTask.display_cached_string | (self, bi) | Logs the original builder messages, given the SConfBuildInfo instance
bi. | Logs the original builder messages, given the SConfBuildInfo instance
bi. | [
"Logs",
"the",
"original",
"builder",
"messages",
"given",
"the",
"SConfBuildInfo",
"instance",
"bi",
"."
] | def display_cached_string(self, bi):
"""
Logs the original builder messages, given the SConfBuildInfo instance
bi.
"""
if not isinstance(bi, SConfBuildInfo):
SCons.Warnings.warn(SConfWarning,
"The stored build information has an unexpected class: %s" % b... | [
"def",
"display_cached_string",
"(",
"self",
",",
"bi",
")",
":",
"if",
"not",
"isinstance",
"(",
"bi",
",",
"SConfBuildInfo",
")",
":",
"SCons",
".",
"Warnings",
".",
"warn",
"(",
"SConfWarning",
",",
"\"The stored build information has an unexpected class: %s\"",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py#L231-L241 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.IsEmbedManifest | (self, config) | return embed == 'true' | Returns whether manifest should be linked into binary. | Returns whether manifest should be linked into binary. | [
"Returns",
"whether",
"manifest",
"should",
"be",
"linked",
"into",
"binary",
"."
] | def IsEmbedManifest(self, config):
"""Returns whether manifest should be linked into binary."""
config = self._TargetConfig(config)
embed = self._Setting(('VCManifestTool', 'EmbedManifest'), config,
default='true')
return embed == 'true' | [
"def",
"IsEmbedManifest",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"embed",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCManifestTool'",
",",
"'EmbedManifest'",
")",
",",
"config",
",",
"default"... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/msvs_emulation.py#L754-L759 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/appdirs.py | python | user_log_dir | (appname=None, appauthor=None, version=None, opinion=True) | return path | r"""Return full path to the user-specific log dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only used on Windows) is the name of the
appauthor or distributing body for this application. Typically
... | r"""Return full path to the user-specific log dir for this application. | [
"r",
"Return",
"full",
"path",
"to",
"the",
"user",
"-",
"specific",
"log",
"dir",
"for",
"this",
"application",
"."
] | def user_log_dir(appname=None, appauthor=None, version=None, opinion=True):
r"""Return full path to the user-specific log dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only used on Windows) is the name of the... | [
"def",
"user_log_dir",
"(",
"appname",
"=",
"None",
",",
"appauthor",
"=",
"None",
",",
"version",
"=",
"None",
",",
"opinion",
"=",
"True",
")",
":",
"if",
"system",
"==",
"\"darwin\"",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/appdirs.py#L356-L404 | |
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py | python | Datasource.send_datasource_interfaces_report | (self, seqno, interfaces=None, success=True, message=None) | When acting as a Kismet datasource, send a list of supported interfaces. This
should be called from a child implementation of this class which implements the
datasource_listinterfaces function.
:param seqno: Sequence number of the interface list request
:param interfaces: Array of data... | When acting as a Kismet datasource, send a list of supported interfaces. This
should be called from a child implementation of this class which implements the
datasource_listinterfaces function. | [
"When",
"acting",
"as",
"a",
"Kismet",
"datasource",
"send",
"a",
"list",
"of",
"supported",
"interfaces",
".",
"This",
"should",
"be",
"called",
"from",
"a",
"child",
"implementation",
"of",
"this",
"class",
"which",
"implements",
"the",
"datasource_listinterfa... | def send_datasource_interfaces_report(self, seqno, interfaces=None, success=True, message=None):
"""
When acting as a Kismet datasource, send a list of supported interfaces. This
should be called from a child implementation of this class which implements the
datasource_listinterfaces fu... | [
"def",
"send_datasource_interfaces_report",
"(",
"self",
",",
"seqno",
",",
"interfaces",
"=",
"None",
",",
"success",
"=",
"True",
",",
"message",
"=",
"None",
")",
":",
"report",
"=",
"datasource_pb2",
".",
"InterfacesReport",
"(",
")",
"report",
".",
"suc... | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py#L1002-L1031 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Check_Syntax | (self, _object, _attributes={}, **_arguments) | Check Syntax: Check the syntax of the specified file(s)
Required argument: List of files to check the syntax of
Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller?
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Err... | Check Syntax: Check the syntax of the specified file(s)
Required argument: List of files to check the syntax of
Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller?
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Err... | [
"Check",
"Syntax",
":",
"Check",
"the",
"syntax",
"of",
"the",
"specified",
"file",
"(",
"s",
")",
"Required",
"argument",
":",
"List",
"of",
"files",
"to",
"check",
"the",
"syntax",
"of",
"Keyword",
"argument",
"ExternalEditor",
":",
"Should",
"the",
"con... | def Check_Syntax(self, _object, _attributes={}, **_arguments):
"""Check Syntax: Check the syntax of the specified file(s)
Required argument: List of files to check the syntax of
Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller?
Keyword ... | [
"def",
"Check_Syntax",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'Chek'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_Che... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L45-L65 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseEvent.LeftUp | (*args, **kwargs) | return _core_.MouseEvent_LeftUp(*args, **kwargs) | LeftUp(self) -> bool
Returns true if the left mouse button state changed to up. | LeftUp(self) -> bool | [
"LeftUp",
"(",
"self",
")",
"-",
">",
"bool"
] | def LeftUp(*args, **kwargs):
"""
LeftUp(self) -> bool
Returns true if the left mouse button state changed to up.
"""
return _core_.MouseEvent_LeftUp(*args, **kwargs) | [
"def",
"LeftUp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseEvent_LeftUp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5665-L5671 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ctypes/_aix.py | python | get_libpaths | () | return libpaths | On AIX, the buildtime searchpath is stored in the executable.
as "loader header information".
The command /usr/bin/dump -H extracts this info.
Prefix searched libraries with LD_LIBRARY_PATH (preferred),
or LIBPATH if defined. These paths are appended to the paths
to libraries the python executable i... | On AIX, the buildtime searchpath is stored in the executable.
as "loader header information".
The command /usr/bin/dump -H extracts this info.
Prefix searched libraries with LD_LIBRARY_PATH (preferred),
or LIBPATH if defined. These paths are appended to the paths
to libraries the python executable i... | [
"On",
"AIX",
"the",
"buildtime",
"searchpath",
"is",
"stored",
"in",
"the",
"executable",
".",
"as",
"loader",
"header",
"information",
".",
"The",
"command",
"/",
"usr",
"/",
"bin",
"/",
"dump",
"-",
"H",
"extracts",
"this",
"info",
".",
"Prefix",
"sear... | def get_libpaths():
"""
On AIX, the buildtime searchpath is stored in the executable.
as "loader header information".
The command /usr/bin/dump -H extracts this info.
Prefix searched libraries with LD_LIBRARY_PATH (preferred),
or LIBPATH if defined. These paths are appended to the paths
to l... | [
"def",
"get_libpaths",
"(",
")",
":",
"libpaths",
"=",
"environ",
".",
"get",
"(",
"\"LD_LIBRARY_PATH\"",
")",
"if",
"libpaths",
"is",
"None",
":",
"libpaths",
"=",
"environ",
".",
"get",
"(",
"\"LIBPATH\"",
")",
"if",
"libpaths",
"is",
"None",
":",
"lib... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ctypes/_aix.py#L240-L264 | |
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | CheckCStyleCast | (filename, clean_lines, linenum, cast_type, pattern, error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The string for the C++ cast to recommend. This is either
reinterpret_cast, static_... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
... | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L5187-L5287 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/mox.py | python | And.equals | (self, rhs) | return True | Checks whether all Comparators are equal to rhs.
Args:
# rhs: can be anything
Returns:
bool | Checks whether all Comparators are equal to rhs. | [
"Checks",
"whether",
"all",
"Comparators",
"are",
"equal",
"to",
"rhs",
"."
] | def equals(self, rhs):
"""Checks whether all Comparators are equal to rhs.
Args:
# rhs: can be anything
Returns:
bool
"""
for comparator in self._comparators:
if not comparator.equals(rhs):
return False
return True | [
"def",
"equals",
"(",
"self",
",",
"rhs",
")",
":",
"for",
"comparator",
"in",
"self",
".",
"_comparators",
":",
"if",
"not",
"comparator",
".",
"equals",
"(",
"rhs",
")",
":",
"return",
"False",
"return",
"True"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L1059-L1073 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/problems/iterative.py | python | constr_unpack | (constraints, vector) | return values | Unpacks a vector into a list of values for constraints. | Unpacks a vector into a list of values for constraints. | [
"Unpacks",
"a",
"vector",
"into",
"a",
"list",
"of",
"values",
"for",
"constraints",
"."
] | def constr_unpack(constraints, vector):
"""Unpacks a vector into a list of values for constraints.
"""
values = []
offset = 0
for constr in constraints:
rows, cols = constr.size
val = np.zeros((rows, cols))
for col in range(cols):
val[:, col] = vector[offset:offse... | [
"def",
"constr_unpack",
"(",
"constraints",
",",
"vector",
")",
":",
"values",
"=",
"[",
"]",
"offset",
"=",
"0",
"for",
"constr",
"in",
"constraints",
":",
"rows",
",",
"cols",
"=",
"constr",
".",
"size",
"val",
"=",
"np",
".",
"zeros",
"(",
"(",
... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/problems/iterative.py#L47-L59 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/eager/tape.py | python | Tape.record_operation | (self, op_type, output_tensors, input_tensors,
backward_function) | Records an operation in the tape. | Records an operation in the tape. | [
"Records",
"an",
"operation",
"in",
"the",
"tape",
"."
] | def record_operation(self, op_type, output_tensors, input_tensors,
backward_function):
"""Records an operation in the tape."""
pywrap_tensorflow.TFE_Py_TapeRecordOperation(
self._tape,
compat.as_bytes(op_type),
output_tensors,
[x._id for x in input_tensors]... | [
"def",
"record_operation",
"(",
"self",
",",
"op_type",
",",
"output_tensors",
",",
"input_tensors",
",",
"backward_function",
")",
":",
"pywrap_tensorflow",
".",
"TFE_Py_TapeRecordOperation",
"(",
"self",
".",
"_tape",
",",
"compat",
".",
"as_bytes",
"(",
"op_typ... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/tape.py#L85-L93 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/feature.py | python | extend | (name, values) | Adds the given values to the given feature. | Adds the given values to the given feature. | [
"Adds",
"the",
"given",
"values",
"to",
"the",
"given",
"feature",
"."
] | def extend (name, values):
""" Adds the given values to the given feature.
"""
assert isinstance(name, basestring)
assert is_iterable_typed(values, basestring)
name = add_grist (name)
__validate_feature (name)
feature = __all_features [name]
if feature.implicit:
for v in values:... | [
"def",
"extend",
"(",
"name",
",",
"values",
")",
":",
"assert",
"isinstance",
"(",
"name",
",",
"basestring",
")",
"assert",
"is_iterable_typed",
"(",
"values",
",",
"basestring",
")",
"name",
"=",
"add_grist",
"(",
"name",
")",
"__validate_feature",
"(",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/feature.py#L389-L410 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py | python | read_stringnl_noescape_pair | (f) | return "%s %s" % (read_stringnl_noescape(f), read_stringnl_noescape(f)) | r"""
>>> import io
>>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
'Queue Empty' | r"""
>>> import io
>>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
'Queue Empty' | [
"r",
">>>",
"import",
"io",
">>>",
"read_stringnl_noescape_pair",
"(",
"io",
".",
"BytesIO",
"(",
"b",
"Queue",
"\\",
"nEmpty",
"\\",
"njunk",
"))",
"Queue",
"Empty"
] | def read_stringnl_noescape_pair(f):
r"""
>>> import io
>>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
'Queue Empty'
"""
return "%s %s" % (read_stringnl_noescape(f), read_stringnl_noescape(f)) | [
"def",
"read_stringnl_noescape_pair",
"(",
"f",
")",
":",
"return",
"\"%s %s\"",
"%",
"(",
"read_stringnl_noescape",
"(",
"f",
")",
",",
"read_stringnl_noescape",
"(",
"f",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py#L386-L393 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/ops/arrow_dataset_ops.py | python | ArrowStreamDataset.from_record_batches | (
cls,
record_batch_iter,
output_types,
output_shapes=None,
columns=None,
batch_size=None,
batch_mode="keep_remainder",
record_batch_iter_factory=None,
) | return cls(
endpoint, columns, output_types, output_shapes, batch_size, batch_mode
) | Create an ArrowStreamDataset by serving a sequence of Arrow record
batches in a background thread. This constructor requires pyarrow to
be installed.
Args:
record_batch_iter: A sequence or iterator of Arrow record batches
output_types: Tensor dtypes of the output tensors... | Create an ArrowStreamDataset by serving a sequence of Arrow record
batches in a background thread. This constructor requires pyarrow to
be installed. | [
"Create",
"an",
"ArrowStreamDataset",
"by",
"serving",
"a",
"sequence",
"of",
"Arrow",
"record",
"batches",
"in",
"a",
"background",
"thread",
".",
"This",
"constructor",
"requires",
"pyarrow",
"to",
"be",
"installed",
"."
] | def from_record_batches(
cls,
record_batch_iter,
output_types,
output_shapes=None,
columns=None,
batch_size=None,
batch_mode="keep_remainder",
record_batch_iter_factory=None,
):
"""Create an ArrowStreamDataset by serving a sequence of Arrow rec... | [
"def",
"from_record_batches",
"(",
"cls",
",",
"record_batch_iter",
",",
"output_types",
",",
"output_shapes",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"batch_mode",
"=",
"\"keep_remainder\"",
",",
"record_batch_iter_factory",
... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/arrow_dataset_ops.py#L509-L592 | |
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | TagValueList.empty | (self) | return _swigibpy.TagValueList_empty(self) | empty(TagValueList self) -> bool | empty(TagValueList self) -> bool | [
"empty",
"(",
"TagValueList",
"self",
")",
"-",
">",
"bool"
] | def empty(self):
"""empty(TagValueList self) -> bool"""
return _swigibpy.TagValueList_empty(self) | [
"def",
"empty",
"(",
"self",
")",
":",
"return",
"_swigibpy",
".",
"TagValueList_empty",
"(",
"self",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L764-L766 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/python/caffe/pycaffe.py | python | _Net_deprocess | (self, input_name, input_) | return decaf_in | Invert Caffe formatting; see Net.preprocess(). | Invert Caffe formatting; see Net.preprocess(). | [
"Invert",
"Caffe",
"formatting",
";",
"see",
"Net",
".",
"preprocess",
"()",
"."
] | def _Net_deprocess(self, input_name, input_):
"""
Invert Caffe formatting; see Net.preprocess().
"""
decaf_in = input_.copy().squeeze()
input_scale = self.input_scale.get(input_name)
channel_order = self.channel_swap.get(input_name)
mean = self.mean.get(input_name)
if mean is not None:
... | [
"def",
"_Net_deprocess",
"(",
"self",
",",
"input_name",
",",
"input_",
")",
":",
"decaf_in",
"=",
"input_",
".",
"copy",
"(",
")",
".",
"squeeze",
"(",
")",
"input_scale",
"=",
"self",
".",
"input_scale",
".",
"get",
"(",
"input_name",
")",
"channel_ord... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/python/caffe/pycaffe.py#L276-L293 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py | python | MLPClassifier.predict | (self, X) | return self._label_binarizer.inverse_transform(y_pred) | Predict using the multi-layer perceptron classifier
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data.
Returns
-------
y : array-like, shape (n_samples,) or (n_samples, n_classes)
The predicted cl... | Predict using the multi-layer perceptron classifier | [
"Predict",
"using",
"the",
"multi",
"-",
"layer",
"perceptron",
"classifier"
] | def predict(self, X):
"""Predict using the multi-layer perceptron classifier
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data.
Returns
-------
y : array-like, shape (n_samples,) or (n_samples, n_clas... | [
"def",
"predict",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
",",
"\"coefs_\"",
")",
"y_pred",
"=",
"self",
".",
"_predict",
"(",
"X",
")",
"if",
"self",
".",
"n_outputs_",
"==",
"1",
":",
"y_pred",
"=",
"y_pred",
".",
"ravel",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py#L920-L939 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | bindings/pydrake/examples/_manipulation_station_extra.py | python | CreateClutterClearingYcbObjectList | () | return ycb_object_pairs | Creates a list of (model_file, pose) pairs to add six YCB objects to a
ManipulationStation with the ClutterClearing setup. | Creates a list of (model_file, pose) pairs to add six YCB objects to a
ManipulationStation with the ClutterClearing setup. | [
"Creates",
"a",
"list",
"of",
"(",
"model_file",
"pose",
")",
"pairs",
"to",
"add",
"six",
"YCB",
"objects",
"to",
"a",
"ManipulationStation",
"with",
"the",
"ClutterClearing",
"setup",
"."
] | def CreateClutterClearingYcbObjectList():
"""Creates a list of (model_file, pose) pairs to add six YCB objects to a
ManipulationStation with the ClutterClearing setup.
"""
ycb_object_pairs = []
# The cracker box pose.
X_WCracker = _xyz_rpy_deg([-0.3, -0.55, 0.2], [-90, 0, 170])
ycb_object_p... | [
"def",
"CreateClutterClearingYcbObjectList",
"(",
")",
":",
"ycb_object_pairs",
"=",
"[",
"]",
"# The cracker box pose.",
"X_WCracker",
"=",
"_xyz_rpy_deg",
"(",
"[",
"-",
"0.3",
",",
"-",
"0.55",
",",
"0.2",
"]",
",",
"[",
"-",
"90",
",",
"0",
",",
"170",... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/examples/_manipulation_station_extra.py#L48-L85 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sched.py | python | scheduler.empty | (self) | return not self._queue | Check whether the queue is empty. | Check whether the queue is empty. | [
"Check",
"whether",
"the",
"queue",
"is",
"empty",
"."
] | def empty(self):
"""Check whether the queue is empty."""
return not self._queue | [
"def",
"empty",
"(",
"self",
")",
":",
"return",
"not",
"self",
".",
"_queue"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sched.py#L76-L78 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | Runner._node | (self, ext) | return node('{}.{}'.format(self.__basename, ext)) | The Node of an output file. E.g., `self.output('valgrind')`
to generate the Valgrind output for this runner. | The Node of an output file. E.g., `self.output('valgrind')`
to generate the Valgrind output for this runner. | [
"The",
"Node",
"of",
"an",
"output",
"file",
".",
"E",
".",
"g",
".",
"self",
".",
"output",
"(",
"valgrind",
")",
"to",
"generate",
"the",
"Valgrind",
"output",
"for",
"this",
"runner",
"."
] | def _node(self, ext):
'''The Node of an output file. E.g., `self.output('valgrind')`
to generate the Valgrind output for this runner.'''
return node('{}.{}'.format(self.__basename, ext)) | [
"def",
"_node",
"(",
"self",
",",
"ext",
")",
":",
"return",
"node",
"(",
"'{}.{}'",
".",
"format",
"(",
"self",
".",
"__basename",
",",
"ext",
")",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L4103-L4106 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pythonize.py | python | createProperties | () | Autocreate properties for getXYZ/setXYZ functions. | Autocreate properties for getXYZ/setXYZ functions. | [
"Autocreate",
"properties",
"for",
"getXYZ",
"/",
"setXYZ",
"functions",
"."
] | def createProperties():
""" Autocreate properties for getXYZ/setXYZ functions.
"""
try:
import inspect
getargspec = inspect.getargspec
except ImportError:
print("Pythonize: inspect not available - properties are generated with dummy argspec.")
getargspec = lambda func : ([],'args',None,None)
def isSimpleG... | [
"def",
"createProperties",
"(",
")",
":",
"try",
":",
"import",
"inspect",
"getargspec",
"=",
"inspect",
".",
"getargspec",
"except",
"ImportError",
":",
"print",
"(",
"\"Pythonize: inspect not available - properties are generated with dummy argspec.\"",
")",
"getargspec",
... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pythonize.py#L59-L111 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/basic_fitting_context.py | python | BasicFittingContext.dataset_indices_for_undo | (self, dataset_indices: list) | Sets the dataset indices from previous fits used for single fitting. | Sets the dataset indices from previous fits used for single fitting. | [
"Sets",
"the",
"dataset",
"indices",
"from",
"previous",
"fits",
"used",
"for",
"single",
"fitting",
"."
] | def dataset_indices_for_undo(self, dataset_indices: list) -> None:
"""Sets the dataset indices from previous fits used for single fitting."""
self._dataset_indices_for_undo = dataset_indices | [
"def",
"dataset_indices_for_undo",
"(",
"self",
",",
"dataset_indices",
":",
"list",
")",
"->",
"None",
":",
"self",
".",
"_dataset_indices_for_undo",
"=",
"dataset_indices"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/basic_fitting_context.py#L133-L135 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/parallel/_dp_allreduce_fusion.py | python | _c_array | (ctype, values) | return (ctype * len(values))(*values) | Create ctypes array from a python array. | Create ctypes array from a python array. | [
"Create",
"ctypes",
"array",
"from",
"a",
"python",
"array",
"."
] | def _c_array(ctype, values):
"""Create ctypes array from a python array."""
return (ctype * len(values))(*values) | [
"def",
"_c_array",
"(",
"ctype",
",",
"values",
")",
":",
"return",
"(",
"ctype",
"*",
"len",
"(",
"values",
")",
")",
"(",
"*",
"values",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_dp_allreduce_fusion.py#L39-L41 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py | python | ndiff | (a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK) | return Differ(linejunk, charjunk).compare(a, b) | r"""
Compare `a` and `b` (lists of strings); return a `Differ`-style delta.
Optional keyword parameters `linejunk` and `charjunk` are for filter
functions (or None):
- linejunk: A function that should accept a single string argument, and
return true iff the string is junk. The default is None, ... | r"""
Compare `a` and `b` (lists of strings); return a `Differ`-style delta. | [
"r",
"Compare",
"a",
"and",
"b",
"(",
"lists",
"of",
"strings",
")",
";",
"return",
"a",
"Differ",
"-",
"style",
"delta",
"."
] | def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
r"""
Compare `a` and `b` (lists of strings); return a `Differ`-style delta.
Optional keyword parameters `linejunk` and `charjunk` are for filter
functions (or None):
- linejunk: A function that should accept a single string argument, and
... | [
"def",
"ndiff",
"(",
"a",
",",
"b",
",",
"linejunk",
"=",
"None",
",",
"charjunk",
"=",
"IS_CHARACTER_JUNK",
")",
":",
"return",
"Differ",
"(",
"linejunk",
",",
"charjunk",
")",
".",
"compare",
"(",
"a",
",",
"b",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py#L1316-L1350 | |
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | FileInfo.IsSource | (self) | return _IsSourceExtension(self.Extension()[1:]) | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return _IsSourceExtension(self.Extension()[1:]) | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"_IsSourceExtension",
"(",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
")"
] | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1405-L1407 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/wx/wxVTKRenderWindowInteractor.py | python | wxVTKRenderWindowInteractor.OnButtonUp | (self,event) | Handles the wx.EVT_LEFT/RIGHT/MIDDLE_UP events for
wxVTKRenderWindowInteractor. | Handles the wx.EVT_LEFT/RIGHT/MIDDLE_UP events for
wxVTKRenderWindowInteractor. | [
"Handles",
"the",
"wx",
".",
"EVT_LEFT",
"/",
"RIGHT",
"/",
"MIDDLE_UP",
"events",
"for",
"wxVTKRenderWindowInteractor",
"."
] | def OnButtonUp(self,event):
"""Handles the wx.EVT_LEFT/RIGHT/MIDDLE_UP events for
wxVTKRenderWindowInteractor.
"""
# event processing should continue
event.Skip()
button = 0
if event.RightUp():
button = 'Right'
elif event.LeftUp():
... | [
"def",
"OnButtonUp",
"(",
"self",
",",
"event",
")",
":",
"# event processing should continue",
"event",
".",
"Skip",
"(",
")",
"button",
"=",
"0",
"if",
"event",
".",
"RightUp",
"(",
")",
":",
"button",
"=",
"'Right'",
"elif",
"event",
".",
"LeftUp",
"(... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/wx/wxVTKRenderWindowInteractor.py#L497-L532 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Base.get_labspath | (self) | return self.dir.entry_labspath(self.name) | Get the absolute path of the file. | Get the absolute path of the file. | [
"Get",
"the",
"absolute",
"path",
"of",
"the",
"file",
"."
] | def get_labspath(self):
"""Get the absolute path of the file."""
return self.dir.entry_labspath(self.name) | [
"def",
"get_labspath",
"(",
"self",
")",
":",
"return",
"self",
".",
"dir",
".",
"entry_labspath",
"(",
"self",
".",
"name",
")"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L830-L832 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/assembly_graph.py | python | AssemblyGraph.choose_largest_component | (self) | Special logic: throw out all of the graph's connected components except for the largest one. | Special logic: throw out all of the graph's connected components except for the largest one. | [
"Special",
"logic",
":",
"throw",
"out",
"all",
"of",
"the",
"graph",
"s",
"connected",
"components",
"except",
"for",
"the",
"largest",
"one",
"."
] | def choose_largest_component(self):
"""
Special logic: throw out all of the graph's connected components except for the largest one.
"""
largest_component_length = None
connected_components = self.get_connected_components()
for component_nums in connected_components:
... | [
"def",
"choose_largest_component",
"(",
"self",
")",
":",
"largest_component_length",
"=",
"None",
"connected_components",
"=",
"self",
".",
"get_connected_components",
"(",
")",
"for",
"component_nums",
"in",
"connected_components",
":",
"component_segments",
"=",
"[",... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L363-L383 | ||
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/property.py | python | translate_indirect | (properties, context_module) | return result | Assumes that all feature values that start with '@' are
names of rules, used in 'context-module'. Such rules can be
either local to the module or global. Qualified local rules
with the name of the module. | Assumes that all feature values that start with ' | [
"Assumes",
"that",
"all",
"feature",
"values",
"that",
"start",
"with"
] | def translate_indirect(properties, context_module):
"""Assumes that all feature values that start with '@' are
names of rules, used in 'context-module'. Such rules can be
either local to the module or global. Qualified local rules
with the name of the module."""
assert is_iterable_typed(properties, ... | [
"def",
"translate_indirect",
"(",
"properties",
",",
"context_module",
")",
":",
"assert",
"is_iterable_typed",
"(",
"properties",
",",
"Property",
")",
"assert",
"isinstance",
"(",
"context_module",
",",
"basestring",
")",
"result",
"=",
"[",
"]",
"for",
"p",
... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/property.py#L338-L354 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py | python | ModuleMakefile.__init__ | (self, configuration, build_file, install_dir=None, static=0,
console=0, qt=0, opengl=0, threaded=0, warnings=1, debug=0,
dir=None, makefile="Makefile", installs=None, strip=1,
export_all=0, universal=None, arch=None,
deployment_target=None) | Initialise an instance of a module Makefile.
build_file is the file containing the target specific information. If
it is a dictionary instead then its contents are validated.
install_dir is the directory the target will be installed in.
static is set if the module should be built as a ... | Initialise an instance of a module Makefile. | [
"Initialise",
"an",
"instance",
"of",
"a",
"module",
"Makefile",
"."
] | def __init__(self, configuration, build_file, install_dir=None, static=0,
console=0, qt=0, opengl=0, threaded=0, warnings=1, debug=0,
dir=None, makefile="Makefile", installs=None, strip=1,
export_all=0, universal=None, arch=None,
deployment_target=None... | [
"def",
"__init__",
"(",
"self",
",",
"configuration",
",",
"build_file",
",",
"install_dir",
"=",
"None",
",",
"static",
"=",
"0",
",",
"console",
"=",
"0",
",",
"qt",
"=",
"0",
",",
"opengl",
"=",
"0",
",",
"threaded",
"=",
"0",
",",
"warnings",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L1522-L1570 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py | python | Process.resume | (self) | Resume process execution with SIGCONT pre-emptively checking
whether PID has been reused.
On Windows this has the effect of resuming all process threads. | Resume process execution with SIGCONT pre-emptively checking
whether PID has been reused.
On Windows this has the effect of resuming all process threads. | [
"Resume",
"process",
"execution",
"with",
"SIGCONT",
"pre",
"-",
"emptively",
"checking",
"whether",
"PID",
"has",
"been",
"reused",
".",
"On",
"Windows",
"this",
"has",
"the",
"effect",
"of",
"resuming",
"all",
"process",
"threads",
"."
] | def resume(self):
"""Resume process execution with SIGCONT pre-emptively checking
whether PID has been reused.
On Windows this has the effect of resuming all process threads.
"""
if _POSIX:
self._send_signal(signal.SIGCONT)
else:
self._proc.resume(... | [
"def",
"resume",
"(",
"self",
")",
":",
"if",
"_POSIX",
":",
"self",
".",
"_send_signal",
"(",
"signal",
".",
"SIGCONT",
")",
"else",
":",
"self",
".",
"_proc",
".",
"resume",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L1005-L1013 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/collector.py | python | Collector.__init__ | (self, should_trace, timid, branch, warn) | Create a collector.
`should_trace` is a function, taking a filename, and returning a
canonicalized filename, or False depending on whether the file should
be traced or not.
If `timid` is true, then a slower simpler trace function will be
used. This is important for some enviro... | Create a collector. | [
"Create",
"a",
"collector",
"."
] | def __init__(self, should_trace, timid, branch, warn):
"""Create a collector.
`should_trace` is a function, taking a filename, and returning a
canonicalized filename, or False depending on whether the file should
be traced or not.
If `timid` is true, then a slower simpler trace... | [
"def",
"__init__",
"(",
"self",
",",
"should_trace",
",",
"timid",
",",
"branch",
",",
"warn",
")",
":",
"self",
".",
"should_trace",
"=",
"should_trace",
"self",
".",
"warn",
"=",
"warn",
"self",
".",
"branch",
"=",
"branch",
"self",
".",
"reset",
"("... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/collector.py#L145-L176 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py | python | MultiIndex.remove_unused_levels | (self) | return result | Create a new MultiIndex from the current that removes
unused levels, meaning that they are not expressed in the labels.
The resulting MultiIndex will have the same outward
appearance, meaning the same .values and ordering. It will also
be .equals() to the original.
Returns
... | Create a new MultiIndex from the current that removes
unused levels, meaning that they are not expressed in the labels. | [
"Create",
"a",
"new",
"MultiIndex",
"from",
"the",
"current",
"that",
"removes",
"unused",
"levels",
"meaning",
"that",
"they",
"are",
"not",
"expressed",
"in",
"the",
"labels",
"."
] | def remove_unused_levels(self):
"""
Create a new MultiIndex from the current that removes
unused levels, meaning that they are not expressed in the labels.
The resulting MultiIndex will have the same outward
appearance, meaning the same .values and ordering. It will also
... | [
"def",
"remove_unused_levels",
"(",
"self",
")",
":",
"new_levels",
"=",
"[",
"]",
"new_codes",
"=",
"[",
"]",
"changed",
"=",
"False",
"for",
"lev",
",",
"level_codes",
"in",
"zip",
"(",
"self",
".",
"levels",
",",
"self",
".",
"codes",
")",
":",
"#... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L1796-L1879 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/poolmanager.py | python | PoolManager._merge_pool_kwargs | (self, override) | return base_pool_kwargs | Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary. | Merge a dictionary of override values for self.connection_pool_kw. | [
"Merge",
"a",
"dictionary",
"of",
"override",
"values",
"for",
"self",
".",
"connection_pool_kw",
"."
] | def _merge_pool_kwargs(self, override):
"""
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary... | [
"def",
"_merge_pool_kwargs",
"(",
"self",
",",
"override",
")",
":",
"base_pool_kwargs",
"=",
"self",
".",
"connection_pool_kw",
".",
"copy",
"(",
")",
"if",
"override",
":",
"for",
"key",
",",
"value",
"in",
"override",
".",
"items",
"(",
")",
":",
"if"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/poolmanager.py#L289-L307 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/json_format.py | python | _Parser._ConvertMapFieldValue | (self, value, message, field) | Convert map field value for a message map field.
Args:
value: A JSON object to convert the map field value.
message: A protocol message to record the converted data.
field: The descriptor of the map field to be converted.
Raises:
ParseError: In case of convert problems. | Convert map field value for a message map field. | [
"Convert",
"map",
"field",
"value",
"for",
"a",
"message",
"map",
"field",
"."
] | def _ConvertMapFieldValue(self, value, message, field):
"""Convert map field value for a message map field.
Args:
value: A JSON object to convert the map field value.
message: A protocol message to record the converted data.
field: The descriptor of the map field to be converted.
Raises:... | [
"def",
"_ConvertMapFieldValue",
"(",
"self",
",",
"value",
",",
"message",
",",
"field",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"raise",
"ParseError",
"(",
"'Map field {0} must be in a dict which is {1}.'",
".",
"format",
"(",
... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/json_format.py#L674-L698 | ||
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/grtzMarkerScopes.py | python | grtzMarkerScopes.IQuitTelescope | (self) | Disengage and exit the telescope mode | Disengage and exit the telescope mode | [
"Disengage",
"and",
"exit",
"the",
"telescope",
"mode"
] | def IQuitTelescope(self):
"Disengage and exit the telescope mode"
global LocalAvatar
global boolScopeOperator
global Telescope
Telescope.popTelescope()
# exit every thing
note = ptNotify(self.key)
note.addVarNumber("Quit",1)
note.netPropagate(0)
... | [
"def",
"IQuitTelescope",
"(",
"self",
")",
":",
"global",
"LocalAvatar",
"global",
"boolScopeOperator",
"global",
"Telescope",
"Telescope",
".",
"popTelescope",
"(",
")",
"# exit every thing",
"note",
"=",
"ptNotify",
"(",
"self",
".",
"key",
")",
"note",
".",
... | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/grtzMarkerScopes.py#L185-L206 | ||
adnanaziz/epicode | e81d4387d2ae442d21631dfc958690d424e1d84d | cpp/cpplint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of the... | Retrieves all the text between matching open and close parentheses. | [
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sym... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.... | https://github.com/adnanaziz/epicode/blob/e81d4387d2ae442d21631dfc958690d424e1d84d/cpp/cpplint.py#L2447-L2500 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/six.py | python | add_move | (move) | Add an item to six.moves. | Add an item to six.moves. | [
"Add",
"an",
"item",
"to",
"six",
".",
"moves",
"."
] | def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move) | [
"def",
"add_move",
"(",
"move",
")",
":",
"setattr",
"(",
"_MovedItems",
",",
"move",
".",
"name",
",",
"move",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/six.py#L486-L488 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/partisn.py | python | _get_material_lib | (hdf5, data_hdf5path, **kwargs) | return mat_lib, unique_names | Read material properties from the loaded dagmc geometry. | Read material properties from the loaded dagmc geometry. | [
"Read",
"material",
"properties",
"from",
"the",
"loaded",
"dagmc",
"geometry",
"."
] | def _get_material_lib(hdf5, data_hdf5path, **kwargs):
"""Read material properties from the loaded dagmc geometry.
"""
# If a set of nuc_names is provided, then collapse elements
if 'nuc_names' in kwargs:
nuc_names = kwargs['nuc_names']
collapse = True
# set of exception nuclides... | [
"def",
"_get_material_lib",
"(",
"hdf5",
",",
"data_hdf5path",
",",
"*",
"*",
"kwargs",
")",
":",
"# If a set of nuc_names is provided, then collapse elements",
"if",
"'nuc_names'",
"in",
"kwargs",
":",
"nuc_names",
"=",
"kwargs",
"[",
"'nuc_names'",
"]",
"collapse",
... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/partisn.py#L208-L252 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextPrintout.SetHeaderFooterData | (*args, **kwargs) | return _richtext.RichTextPrintout_SetHeaderFooterData(*args, **kwargs) | SetHeaderFooterData(self, wxRichTextHeaderFooterData data) | SetHeaderFooterData(self, wxRichTextHeaderFooterData data) | [
"SetHeaderFooterData",
"(",
"self",
"wxRichTextHeaderFooterData",
"data",
")"
] | def SetHeaderFooterData(*args, **kwargs):
"""SetHeaderFooterData(self, wxRichTextHeaderFooterData data)"""
return _richtext.RichTextPrintout_SetHeaderFooterData(*args, **kwargs) | [
"def",
"SetHeaderFooterData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrintout_SetHeaderFooterData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4465-L4467 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Environment.py | python | SubstitutionEnvironment.subst | (self, string, raw=0, target=None, source=None, conv=None, executor=None) | return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, lvars, conv) | Recursively interpolates construction variables from the
Environment into the specified string, returning the expanded
result. Construction variables are specified by a $ prefix
in the string and begin with an initial underscore or
alphabetic character followed by any number of undersco... | Recursively interpolates construction variables from the
Environment into the specified string, returning the expanded
result. Construction variables are specified by a $ prefix
in the string and begin with an initial underscore or
alphabetic character followed by any number of undersco... | [
"Recursively",
"interpolates",
"construction",
"variables",
"from",
"the",
"Environment",
"into",
"the",
"specified",
"string",
"returning",
"the",
"expanded",
"result",
".",
"Construction",
"variables",
"are",
"specified",
"by",
"a",
"$",
"prefix",
"in",
"the",
"... | def subst(self, string, raw=0, target=None, source=None, conv=None, executor=None):
"""Recursively interpolates construction variables from the
Environment into the specified string, returning the expanded
result. Construction variables are specified by a $ prefix
in the string and begi... | [
"def",
"subst",
"(",
"self",
",",
"string",
",",
"raw",
"=",
"0",
",",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"conv",
"=",
"None",
",",
"executor",
"=",
"None",
")",
":",
"gvars",
"=",
"self",
".",
"gvars",
"(",
")",
"lvars",
"... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Environment.py#L490-L505 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | tf/edgeml_tf/graph/rnn.py | python | EMI_DataPipeline.__call__ | (self) | return self.x_batch, self.y_batch | The call method performs graph construction either by
creating a new graph or, if a restored meta graph is provided, by
restoring operators from this meta graph.
returns iterators (x_batch, y_batch) | The call method performs graph construction either by
creating a new graph or, if a restored meta graph is provided, by
restoring operators from this meta graph. | [
"The",
"call",
"method",
"performs",
"graph",
"construction",
"either",
"by",
"creating",
"a",
"new",
"graph",
"or",
"if",
"a",
"restored",
"meta",
"graph",
"is",
"provided",
"by",
"restoring",
"operators",
"from",
"this",
"meta",
"graph",
"."
] | def __call__(self):
'''
The call method performs graph construction either by
creating a new graph or, if a restored meta graph is provided, by
restoring operators from this meta graph.
returns iterators (x_batch, y_batch)
'''
if self.graphCreated is True:
... | [
"def",
"__call__",
"(",
"self",
")",
":",
"if",
"self",
".",
"graphCreated",
"is",
"True",
":",
"return",
"self",
".",
"x_batch",
",",
"self",
".",
"y_batch",
"if",
"self",
".",
"graph",
"is",
"None",
":",
"self",
".",
"_createGraph",
"(",
")",
"else... | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/graph/rnn.py#L1187-L1202 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py | python | _NamespaceLoader.create_module | (self, spec) | Use default semantics for module creation. | Use default semantics for module creation. | [
"Use",
"default",
"semantics",
"for",
"module",
"creation",
"."
] | def create_module(self, spec):
"""Use default semantics for module creation.""" | [
"def",
"create_module",
"(",
"self",
",",
"spec",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L1290-L1291 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/common/tokens.py | python | Token.__init__ | (self, string, token_type, line, line_number, values=None) | Creates a new Token object.
Args:
string: The string of input the token contains.
token_type: The type of token.
line: The text of the line this token is in.
line_number: The line number of the token.
values: A dict of named values within the token. For instance, a
function d... | Creates a new Token object. | [
"Creates",
"a",
"new",
"Token",
"object",
"."
] | def __init__(self, string, token_type, line, line_number, values=None):
"""Creates a new Token object.
Args:
string: The string of input the token contains.
token_type: The type of token.
line: The text of the line this token is in.
line_number: The line number of the token.
value... | [
"def",
"__init__",
"(",
"self",
",",
"string",
",",
"token_type",
",",
"line",
",",
"line_number",
",",
"values",
"=",
"None",
")",
":",
"self",
".",
"type",
"=",
"token_type",
"self",
".",
"string",
"=",
"string",
"self",
".",
"length",
"=",
"len",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/common/tokens.py#L50-L79 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/landuse/wxgui.py | python | WxGui.on_import_zones_from_shape | (self, event=None) | Import zones from shape file format. | Import zones from shape file format. | [
"Import",
"zones",
"from",
"shape",
"file",
"format",
"."
] | def on_import_zones_from_shape(self, event=None):
"""
Import zones from shape file format.
"""
proc = landuse.ZonesFromShapeImporter('shapeimporter', self._landuse.zones, logger=self._mainframe.get_logger())
dlg = ProcessDialog(self._mainframe, proc, immediate_apply=True)
... | [
"def",
"on_import_zones_from_shape",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"proc",
"=",
"landuse",
".",
"ZonesFromShapeImporter",
"(",
"'shapeimporter'",
",",
"self",
".",
"_landuse",
".",
"zones",
",",
"logger",
"=",
"self",
".",
"_mainframe",
"... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/landuse/wxgui.py#L884-L910 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewTreeStoreNode.SetData | (*args, **kwargs) | return _dataview.DataViewTreeStoreNode_SetData(*args, **kwargs) | SetData(self, wxClientData data) | SetData(self, wxClientData data) | [
"SetData",
"(",
"self",
"wxClientData",
"data",
")"
] | def SetData(*args, **kwargs):
"""SetData(self, wxClientData data)"""
return _dataview.DataViewTreeStoreNode_SetData(*args, **kwargs) | [
"def",
"SetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewTreeStoreNode_SetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2244-L2246 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/concat_benchmark.py | python | build_graph | (device, input_shape, variable, num_inputs, axis, grad) | Build a graph containing a sequence of batch normalizations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensors.
variable: whether or not to randomize the input shape
num_inputs: the number of inputs to concat
axis: axis to be concat'ed
grad: if True compute t... | Build a graph containing a sequence of batch normalizations. | [
"Build",
"a",
"graph",
"containing",
"a",
"sequence",
"of",
"batch",
"normalizations",
"."
] | def build_graph(device, input_shape, variable, num_inputs, axis, grad):
"""Build a graph containing a sequence of batch normalizations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensors.
variable: whether or not to randomize the input shape
num_inputs: the number o... | [
"def",
"build_graph",
"(",
"device",
",",
"input_shape",
",",
"variable",
",",
"num_inputs",
",",
"axis",
",",
"grad",
")",
":",
"with",
"tf",
".",
"device",
"(",
"\"/%s:0\"",
"%",
"device",
")",
":",
"if",
"not",
"variable",
":",
"inputs",
"=",
"[",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/concat_benchmark.py#L30-L69 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/resmokelib/utils/globstar.py | python | is_glob_pattern | (s) | return _CONTAINS_GLOB_PATTERN.search(s) is not None | Returns true if 's' represents a glob pattern, and false otherwise. | Returns true if 's' represents a glob pattern, and false otherwise. | [
"Returns",
"true",
"if",
"s",
"represents",
"a",
"glob",
"pattern",
"and",
"false",
"otherwise",
"."
] | def is_glob_pattern(s):
"""
Returns true if 's' represents a glob pattern, and false otherwise.
"""
# Copied from glob.has_magic().
return _CONTAINS_GLOB_PATTERN.search(s) is not None | [
"def",
"is_glob_pattern",
"(",
"s",
")",
":",
"# Copied from glob.has_magic().",
"return",
"_CONTAINS_GLOB_PATTERN",
".",
"search",
"(",
"s",
")",
"is",
"not",
"None"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/utils/globstar.py#L17-L23 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_nonmem.py | python | StyleText | (_stc, start, end) | Style the text
@param _stc: Styled text control instance
@param start: Start position
@param end: end position | Style the text
@param _stc: Styled text control instance
@param start: Start position
@param end: end position | [
"Style",
"the",
"text",
"@param",
"_stc",
":",
"Styled",
"text",
"control",
"instance",
"@param",
"start",
":",
"Start",
"position",
"@param",
"end",
":",
"end",
"position"
] | def StyleText(_stc, start, end):
"""Style the text
@param _stc: Styled text control instance
@param start: Start position
@param end: end position
"""
for index, token, txt in lexer.get_tokens_unprocessed(_stc.GetTextRange(0, end)):
# print index, token, txt
style = TOKEN_MAP.get... | [
"def",
"StyleText",
"(",
"_stc",
",",
"start",
",",
"end",
")",
":",
"for",
"index",
",",
"token",
",",
"txt",
"in",
"lexer",
".",
"get_tokens_unprocessed",
"(",
"_stc",
".",
"GetTextRange",
"(",
"0",
",",
"end",
")",
")",
":",
"# print index, tok... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_nonmem.py#L107-L122 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/MolStandardize/standardize.py | python | Standardizer.__call__ | (self, mol) | return self.standardize(mol) | Calling a Standardizer instance like a function is the same as calling its
:meth:`~molvs.standardize.Standardizer.standardize` method. | Calling a Standardizer instance like a function is the same as calling its
:meth:`~molvs.standardize.Standardizer.standardize` method. | [
"Calling",
"a",
"Standardizer",
"instance",
"like",
"a",
"function",
"is",
"the",
"same",
"as",
"calling",
"its",
":",
"meth",
":",
"~molvs",
".",
"standardize",
".",
"Standardizer",
".",
"standardize",
"method",
"."
] | def __call__(self, mol):
"""Calling a Standardizer instance like a function is the same as calling its
:meth:`~molvs.standardize.Standardizer.standardize` method."""
return self.standardize(mol) | [
"def",
"__call__",
"(",
"self",
",",
"mol",
")",
":",
"return",
"self",
".",
"standardize",
"(",
"mol",
")"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/MolStandardize/standardize.py#L73-L76 | |
dlunion/CC4.0 | 6fb51e494b6a88f0987b9dd99117ec21766e3aee | python/caffe/io.py | python | resize_image | (im, new_dims, interp_order=1) | return resized_im.astype(np.float32) | Resize an image array with interpolation.
Parameters
----------
im : (H x W x K) ndarray
new_dims : (height, width) tuple of new dimensions.
interp_order : interpolation order, default is linear.
Returns
-------
im : resized ndarray with shape (new_dims[0], new_dims[1], K) | Resize an image array with interpolation. | [
"Resize",
"an",
"image",
"array",
"with",
"interpolation",
"."
] | def resize_image(im, new_dims, interp_order=1):
"""
Resize an image array with interpolation.
Parameters
----------
im : (H x W x K) ndarray
new_dims : (height, width) tuple of new dimensions.
interp_order : interpolation order, default is linear.
Returns
-------
im : resized n... | [
"def",
"resize_image",
"(",
"im",
",",
"new_dims",
",",
"interp_order",
"=",
"1",
")",
":",
"if",
"im",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"1",
"or",
"im",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"3",
":",
"im_min",
",",
"im_max",
"=",
"... | https://github.com/dlunion/CC4.0/blob/6fb51e494b6a88f0987b9dd99117ec21766e3aee/python/caffe/io.py#L306-L338 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/util.py | python | source_hash | (source_bytes) | return _imp.source_hash(_RAW_MAGIC_NUMBER, source_bytes) | Return the hash of *source_bytes* as used in hash-based pyc files. | Return the hash of *source_bytes* as used in hash-based pyc files. | [
"Return",
"the",
"hash",
"of",
"*",
"source_bytes",
"*",
"as",
"used",
"in",
"hash",
"-",
"based",
"pyc",
"files",
"."
] | def source_hash(source_bytes):
"Return the hash of *source_bytes* as used in hash-based pyc files."
return _imp.source_hash(_RAW_MAGIC_NUMBER, source_bytes) | [
"def",
"source_hash",
"(",
"source_bytes",
")",
":",
"return",
"_imp",
".",
"source_hash",
"(",
"_RAW_MAGIC_NUMBER",
",",
"source_bytes",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/util.py#L22-L24 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | base/android/jni_generator/jni_generator.py | python | InlHeaderFileGenerator.GetJNIRegisterNativesString | (self) | return template.substitute(values) | Returns the implementation for the JNI registration of native methods. | Returns the implementation for the JNI registration of native methods. | [
"Returns",
"the",
"implementation",
"for",
"the",
"JNI",
"registration",
"of",
"native",
"methods",
"."
] | def GetJNIRegisterNativesString(self):
"""Returns the implementation for the JNI registration of native methods."""
if not self.init_native:
return ''
template = Template("""\
extern "C" JNIEXPORT bool JNICALL
Java_${FULLY_QUALIFIED_CLASS}_${INIT_NATIVE_NAME}(JNIEnv* env, jclass clazz) {
return ${N... | [
"def",
"GetJNIRegisterNativesString",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"init_native",
":",
"return",
"''",
"template",
"=",
"Template",
"(",
"\"\"\"\\\nextern \"C\" JNIEXPORT bool JNICALL\nJava_${FULLY_QUALIFIED_CLASS}_${INIT_NATIVE_NAME}(JNIEnv* env, jclass clazz... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/base/android/jni_generator/jni_generator.py#L818-L838 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlBookRecord.GetContentsEnd | (*args, **kwargs) | return _html.HtmlBookRecord_GetContentsEnd(*args, **kwargs) | GetContentsEnd(self) -> int | GetContentsEnd(self) -> int | [
"GetContentsEnd",
"(",
"self",
")",
"-",
">",
"int"
] | def GetContentsEnd(*args, **kwargs):
"""GetContentsEnd(self) -> int"""
return _html.HtmlBookRecord_GetContentsEnd(*args, **kwargs) | [
"def",
"GetContentsEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlBookRecord_GetContentsEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1435-L1437 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Goto_Function | (self, _object, _attributes={}, **_arguments) | Goto Function: Goto Specified Function Name
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary | Goto Function: Goto Specified Function Name
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary | [
"Goto",
"Function",
":",
"Goto",
"Specified",
"Function",
"Name",
"Required",
"argument",
":",
"undocumented",
"typecode",
"TEXT",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def Goto_Function(self, _object, _attributes={}, **_arguments):
"""Goto Function: Goto Specified Function Name
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'MMPR'
_subcode = 'GoFn'
if _... | [
"def",
"Goto_Function",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'GoFn'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L338-L356 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/ninja.py | python | QuoteShellArgument | (arg, flavor) | return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" | Quote a string such that it will be interpreted as a single argument
by the shell. | Quote a string such that it will be interpreted as a single argument
by the shell. | [
"Quote",
"a",
"string",
"such",
"that",
"it",
"will",
"be",
"interpreted",
"as",
"a",
"single",
"argument",
"by",
"the",
"shell",
"."
] | def QuoteShellArgument(arg, flavor):
"""Quote a string such that it will be interpreted as a single argument
by the shell."""
# Rather than attempting to enumerate the bad shell characters, just
# whitelist common OK ones and quote anything else.
if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):
return arg # N... | [
"def",
"QuoteShellArgument",
"(",
"arg",
",",
"flavor",
")",
":",
"# Rather than attempting to enumerate the bad shell characters, just",
"# whitelist common OK ones and quote anything else.",
"if",
"re",
".",
"match",
"(",
"r'^[a-zA-Z0-9_=.\\\\/-]+$'",
",",
"arg",
")",
":",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/ninja.py#L73-L82 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/EventVisitor.py | python | EventVisitor._writeTmpl | (self, c, fp, visit_str) | Wrapper to write tmpl to files desc. | Wrapper to write tmpl to files desc. | [
"Wrapper",
"to",
"write",
"tmpl",
"to",
"files",
"desc",
"."
] | def _writeTmpl(self, c, fp, visit_str):
"""
Wrapper to write tmpl to files desc.
"""
DEBUG.debug("EventVisitor:%s" % visit_str)
DEBUG.debug("===================================")
DEBUG.debug(c)
fp.writelines(c.__str__())
DEBUG.debug("======================... | [
"def",
"_writeTmpl",
"(",
"self",
",",
"c",
",",
"fp",
",",
"visit_str",
")",
":",
"DEBUG",
".",
"debug",
"(",
"\"EventVisitor:%s\"",
"%",
"visit_str",
")",
"DEBUG",
".",
"debug",
"(",
"\"===================================\"",
")",
"DEBUG",
".",
"debug",
"(... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/EventVisitor.py#L78-L86 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/util/tf_inspect.py | python | getsource | (object) | return _inspect.getsource(tf_decorator.unwrap(object)[1]) | TFDecorator-aware replacement for inspect.getsource. | TFDecorator-aware replacement for inspect.getsource. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"getsource",
"."
] | def getsource(object): # pylint: disable=redefined-builtin
"""TFDecorator-aware replacement for inspect.getsource."""
return _inspect.getsource(tf_decorator.unwrap(object)[1]) | [
"def",
"getsource",
"(",
"object",
")",
":",
"# pylint: disable=redefined-builtin",
"return",
"_inspect",
".",
"getsource",
"(",
"tf_decorator",
".",
"unwrap",
"(",
"object",
")",
"[",
"1",
"]",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/util/tf_inspect.py#L113-L115 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/algorithm.py | python | PPOAlgorithm.experience | (self, observ, action, reward, unused_done, unused_nextob) | Process the transition tuple of the current step.
When training, add the current transition tuple to the memory and update
the streaming statistics for observations and rewards. A summary string is
returned if requested at this step.
Args:
observ: Batch tensor of observations.
action: Batc... | Process the transition tuple of the current step. | [
"Process",
"the",
"transition",
"tuple",
"of",
"the",
"current",
"step",
"."
] | def experience(self, observ, action, reward, unused_done, unused_nextob):
"""Process the transition tuple of the current step.
When training, add the current transition tuple to the memory and update
the streaming statistics for observations and rewards. A summary string is
returned if requested at thi... | [
"def",
"experience",
"(",
"self",
",",
"observ",
",",
"action",
",",
"reward",
",",
"unused_done",
",",
"unused_nextob",
")",
":",
"with",
"tf",
".",
"name_scope",
"(",
"'experience/'",
")",
":",
"return",
"tf",
".",
"cond",
"(",
"self",
".",
"_is_traini... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/algorithm.py#L140-L159 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/textwrap.py | python | TextWrapper._wrap_chunks | (self, chunks) | return lines | _wrap_chunks(chunks : [string]) -> [string]
Wrap a sequence of text chunks and return a list of lines of
length 'self.width' or less. (If 'break_long_words' is false,
some lines may be longer than this.) Chunks correspond roughly
to words and the whitespace between them: each chunk is... | _wrap_chunks(chunks : [string]) -> [string] | [
"_wrap_chunks",
"(",
"chunks",
":",
"[",
"string",
"]",
")",
"-",
">",
"[",
"string",
"]"
] | def _wrap_chunks(self, chunks):
"""_wrap_chunks(chunks : [string]) -> [string]
Wrap a sequence of text chunks and return a list of lines of
length 'self.width' or less. (If 'break_long_words' is false,
some lines may be longer than this.) Chunks correspond roughly
to words and... | [
"def",
"_wrap_chunks",
"(",
"self",
",",
"chunks",
")",
":",
"lines",
"=",
"[",
"]",
"if",
"self",
".",
"width",
"<=",
"0",
":",
"raise",
"ValueError",
"(",
"\"invalid width %r (must be > 0)\"",
"%",
"self",
".",
"width",
")",
"# Arrange in reverse order so it... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/textwrap.py#L243-L311 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/array_manager.py | python | ArrayManager.as_array | (
self,
transpose: bool = False,
dtype=None,
copy: bool = False,
na_value=lib.no_default,
) | return result | Convert the blockmanager data into an numpy array.
Parameters
----------
transpose : bool, default False
If True, transpose the return array.
dtype : object, default None
Data type of the return array.
copy : bool, default False
If True then g... | Convert the blockmanager data into an numpy array. | [
"Convert",
"the",
"blockmanager",
"data",
"into",
"an",
"numpy",
"array",
"."
] | def as_array(
self,
transpose: bool = False,
dtype=None,
copy: bool = False,
na_value=lib.no_default,
) -> np.ndarray:
"""
Convert the blockmanager data into an numpy array.
Parameters
----------
transpose : bool, default False
... | [
"def",
"as_array",
"(",
"self",
",",
"transpose",
":",
"bool",
"=",
"False",
",",
"dtype",
"=",
"None",
",",
"copy",
":",
"bool",
"=",
"False",
",",
"na_value",
"=",
"lib",
".",
"no_default",
",",
")",
"->",
"np",
".",
"ndarray",
":",
"if",
"len",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/array_manager.py#L1104-L1162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.