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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/appdirs.py | python | user_cache_dir | (appname=None, appauthor=None, version=None, opinion=True) | return path | r"""Return full path to the user-specific cache 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 cache dir for this application. | [
"r",
"Return",
"full",
"path",
"to",
"the",
"user",
"-",
"specific",
"cache",
"dir",
"for",
"this",
"application",
"."
] | def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):
r"""Return full path to the user-specific cache 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... | [
"def",
"user_cache_dir",
"(",
"appname",
"=",
"None",
",",
"appauthor",
"=",
"None",
",",
"version",
"=",
"None",
",",
"opinion",
"=",
"True",
")",
":",
"if",
"system",
"==",
"\"win32\"",
":",
"if",
"appauthor",
"is",
"None",
":",
"appauthor",
"=",
"ap... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/appdirs.py#L257-L311 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py | python | ReplaceAll | (pattern, rep, s) | return _regexp_compile_cache[pattern].sub(rep, s) | Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if no replacements) | Replaces instances of pattern in a string with a replacement. | [
"Replaces",
"instances",
"of",
"pattern",
"in",
"a",
"string",
"with",
"a",
"replacement",
"."
] | def ReplaceAll(pattern, rep, s):
"""Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if... | [
"def",
"ReplaceAll",
"(",
"pattern",
",",
"rep",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_c... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L798-L813 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBInstruction.DumpEmulation | (self, triple) | return _lldb.SBInstruction_DumpEmulation(self, triple) | DumpEmulation(SBInstruction self, char const * triple) -> bool | DumpEmulation(SBInstruction self, char const * triple) -> bool | [
"DumpEmulation",
"(",
"SBInstruction",
"self",
"char",
"const",
"*",
"triple",
")",
"-",
">",
"bool"
] | def DumpEmulation(self, triple):
"""DumpEmulation(SBInstruction self, char const * triple) -> bool"""
return _lldb.SBInstruction_DumpEmulation(self, triple) | [
"def",
"DumpEmulation",
"(",
"self",
",",
"triple",
")",
":",
"return",
"_lldb",
".",
"SBInstruction_DumpEmulation",
"(",
"self",
",",
"triple",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6233-L6235 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiNotebook.GetImageList | (self) | return self._imageList | Returns the associated image list (if any). | Returns the associated image list (if any). | [
"Returns",
"the",
"associated",
"image",
"list",
"(",
"if",
"any",
")",
"."
] | def GetImageList(self):
""" Returns the associated image list (if any). """
return self._imageList | [
"def",
"GetImageList",
"(",
"self",
")",
":",
"return",
"self",
".",
"_imageList"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L3719-L3722 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/parse-lisp-expression.py | python | Solution.evaluate | (self, expression) | return int(tokens[0]) | :type expression: str
:rtype: int | :type expression: str
:rtype: int | [
":",
"type",
"expression",
":",
"str",
":",
"rtype",
":",
"int"
] | def evaluate(self, expression):
"""
:type expression: str
:rtype: int
"""
def getval(lookup, x):
return lookup.get(x, x)
def evaluate(tokens, lookup):
if tokens[0] in ('add', 'mult'):
a, b = map(int, map(lambda x: getval(lookup, x)... | [
"def",
"evaluate",
"(",
"self",
",",
"expression",
")",
":",
"def",
"getval",
"(",
"lookup",
",",
"x",
")",
":",
"return",
"lookup",
".",
"get",
"(",
"x",
",",
"x",
")",
"def",
"evaluate",
"(",
"tokens",
",",
"lookup",
")",
":",
"if",
"tokens",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/parse-lisp-expression.py#L5-L37 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeExportEnvString | (self, env) | return ' '.join(export_str) | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | [
"Given",
"an",
"environment",
"returns",
"a",
"string",
"looking",
"like",
"export",
"FOO",
"=",
"foo",
";",
"export",
"BAR",
"=",
"$",
"{",
"FOO",
"}",
"bar",
";",
"that",
"exports",
"|env|",
"to",
"the",
"shell",
"."
] | def ComputeExportEnvString(self, env):
"""Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell."""
export_str = []
for k, v in env:
export_str.append('export %s=%s;' %
(k, ninja_syntax.escape(gyp.common.Enco... | [
"def",
"ComputeExportEnvString",
"(",
"self",
",",
"env",
")",
":",
"export_str",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"env",
":",
"export_str",
".",
"append",
"(",
"'export %s=%s;'",
"%",
"(",
"k",
",",
"ninja_syntax",
".",
"escape",
"(",
"gyp",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/ninja.py#L1472-L1480 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | src_python/habitat_sim/robots/robot_interface.py | python | RobotInterface.get_link_and_joint_names | (self) | return link_joint_names | Get a string listing all robot link and joint names for debugging purposes. | Get a string listing all robot link and joint names for debugging purposes. | [
"Get",
"a",
"string",
"listing",
"all",
"robot",
"link",
"and",
"joint",
"names",
"for",
"debugging",
"purposes",
"."
] | def get_link_and_joint_names(self) -> str:
"""Get a string listing all robot link and joint names for debugging purposes."""
link_joint_names = ""
# print relevant joint/link info for debugging
for link_id in self.sim_obj.get_link_ids():
link_joint_names += f"{link_id} = {sel... | [
"def",
"get_link_and_joint_names",
"(",
"self",
")",
"->",
"str",
":",
"link_joint_names",
"=",
"\"\"",
"# print relevant joint/link info for debugging",
"for",
"link_id",
"in",
"self",
".",
"sim_obj",
".",
"get_link_ids",
"(",
")",
":",
"link_joint_names",
"+=",
"f... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/robots/robot_interface.py#L30-L36 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/compat/chainmap_impl.py | python | recursive_repr | (fillvalue='...') | return decorating_function | Decorator to make a repr function return fillvalue for a recursive call | Decorator to make a repr function return fillvalue for a recursive call | [
"Decorator",
"to",
"make",
"a",
"repr",
"function",
"return",
"fillvalue",
"for",
"a",
"recursive",
"call"
] | def recursive_repr(fillvalue='...'):
'Decorator to make a repr function return fillvalue for a recursive call'
def decorating_function(user_function):
repr_running = set()
def wrapper(self):
key = id(self), get_ident()
if key in repr_running:
return fill... | [
"def",
"recursive_repr",
"(",
"fillvalue",
"=",
"'...'",
")",
":",
"def",
"decorating_function",
"(",
"user_function",
")",
":",
"repr_running",
"=",
"set",
"(",
")",
"def",
"wrapper",
"(",
"self",
")",
":",
"key",
"=",
"id",
"(",
"self",
")",
",",
"ge... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/compat/chainmap_impl.py#L16-L39 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | SplashScreen.__init__ | (self, *args, **kwargs) | __init__(self, Bitmap bitmap, long splashStyle, int milliseconds,
Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP) -> SplashScreen | __init__(self, Bitmap bitmap, long splashStyle, int milliseconds,
Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP) -> SplashScreen | [
"__init__",
"(",
"self",
"Bitmap",
"bitmap",
"long",
"splashStyle",
"int",
"milliseconds",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"wxSIMPLE_BORDER|wxFRAME_... | def __init__(self, *args, **kwargs):
"""
__init__(self, Bitmap bitmap, long splashStyle, int milliseconds,
Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP) -> SplashScreen
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"SplashScreen_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_SplashScreen",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L1136-L1143 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdftex.py | python | PDFTeXLaTeXFunction | (target = None, source= None, env=None) | return result | A builder for TeX and LaTeX that scans the source file to
decide the "flavor" of the source and then executes the appropriate
program. | A builder for TeX and LaTeX that scans the source file to
decide the "flavor" of the source and then executes the appropriate
program. | [
"A",
"builder",
"for",
"TeX",
"and",
"LaTeX",
"that",
"scans",
"the",
"source",
"file",
"to",
"decide",
"the",
"flavor",
"of",
"the",
"source",
"and",
"then",
"executes",
"the",
"appropriate",
"program",
"."
] | def PDFTeXLaTeXFunction(target = None, source= None, env=None):
"""A builder for TeX and LaTeX that scans the source file to
decide the "flavor" of the source and then executes the appropriate
program."""
basedir = os.path.split(str(source[0]))[0]
abspath = os.path.abspath(basedir)
if SCons.Too... | [
"def",
"PDFTeXLaTeXFunction",
"(",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"basedir",
"=",
"os",
".",
"path",
".",
"split",
"(",
"str",
"(",
"source",
"[",
"0",
"]",
")",
")",
"[",
"0",
"]",
"abspath"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdftex.py#L52-L67 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/imaplib.py | python | Time2Internaldate | (date_time) | return '"' + dt + " %+03d%02d" % divmod(zone//60, 60) + '"' | Convert 'date_time' to IMAP4 INTERNALDATE representation.
Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' | Convert 'date_time' to IMAP4 INTERNALDATE representation. | [
"Convert",
"date_time",
"to",
"IMAP4",
"INTERNALDATE",
"representation",
"."
] | def Time2Internaldate(date_time):
"""Convert 'date_time' to IMAP4 INTERNALDATE representation.
Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'
"""
if isinstance(date_time, (int, float)):
tt = time.localtime(date_time)
elif isinstance(date_time, (tuple, time.struct_time)):
tt... | [
"def",
"Time2Internaldate",
"(",
"date_time",
")",
":",
"if",
"isinstance",
"(",
"date_time",
",",
"(",
"int",
",",
"float",
")",
")",
":",
"tt",
"=",
"time",
".",
"localtime",
"(",
"date_time",
")",
"elif",
"isinstance",
"(",
"date_time",
",",
"(",
"t... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imaplib.py#L1381-L1404 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/io_util.py | python | options_reader | (options_proto, options_proto_path: Text,
overwrite: Optional[Text]) | return ret | Generic options reader, which can also be easily saved as protos.
Arguments:
options_proto: Type of the options proto object.
options_proto_path: Path to file containing an options_proto.
overwrite: A string containing options proto object.
Returns:
An options_proto proto containing parsed options... | Generic options reader, which can also be easily saved as protos. | [
"Generic",
"options",
"reader",
"which",
"can",
"also",
"be",
"easily",
"saved",
"as",
"protos",
"."
] | def options_reader(options_proto, options_proto_path: Text,
overwrite: Optional[Text]):
"""Generic options reader, which can also be easily saved as protos.
Arguments:
options_proto: Type of the options proto object.
options_proto_path: Path to file containing an options_proto.
overw... | [
"def",
"options_reader",
"(",
"options_proto",
",",
"options_proto_path",
":",
"Text",
",",
"overwrite",
":",
"Optional",
"[",
"Text",
"]",
")",
":",
"ret",
"=",
"load_text_proto",
"(",
"options_proto_path",
",",
"options_proto",
")",
"if",
"overwrite",
":",
"... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/io_util.py#L199-L215 | |
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | _OutputFormat | () | return _cpplint_state.output_format | Gets the module's output format. | Gets the module's output format. | [
"Gets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _OutputFormat():
"""Gets the module's output format."""
return _cpplint_state.output_format | [
"def",
"_OutputFormat",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"output_format"
] | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L767-L769 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlWindow.SetPage | (*args, **kwargs) | return _html.HtmlWindow_SetPage(*args, **kwargs) | SetPage(self, String source) -> bool | SetPage(self, String source) -> bool | [
"SetPage",
"(",
"self",
"String",
"source",
")",
"-",
">",
"bool"
] | def SetPage(*args, **kwargs):
"""SetPage(self, String source) -> bool"""
return _html.HtmlWindow_SetPage(*args, **kwargs) | [
"def",
"SetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindow_SetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L986-L988 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py | python | PolDiffILLReduction._apply_polarisation_corrections | (self, ws, pol_eff_ws) | return ws | Applies the polarisation correction based on the output from quartz reduction. | Applies the polarisation correction based on the output from quartz reduction. | [
"Applies",
"the",
"polarisation",
"correction",
"based",
"on",
"the",
"output",
"from",
"quartz",
"reduction",
"."
] | def _apply_polarisation_corrections(self, ws, pol_eff_ws):
"""Applies the polarisation correction based on the output from quartz reduction."""
nPolarisations = None
singleCorrectionPerPOL = False
if mtd[ws].getNumberOfEntries() != 2*mtd[pol_eff_ws].getNumberOfEntries():
sing... | [
"def",
"_apply_polarisation_corrections",
"(",
"self",
",",
"ws",
",",
"pol_eff_ws",
")",
":",
"nPolarisations",
"=",
"None",
"singleCorrectionPerPOL",
"=",
"False",
"if",
"mtd",
"[",
"ws",
"]",
".",
"getNumberOfEntries",
"(",
")",
"!=",
"2",
"*",
"mtd",
"["... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py#L1031-L1078 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/character/character_module.py | python | Trait.preferred_discount_multiplier | (self, alternatives) | return None | Select a discount multiplier from the alternatives provided for
use in evaluate planet in Colonisation.py to scale pilot rating and
a long list of technologies. | Select a discount multiplier from the alternatives provided for
use in evaluate planet in Colonisation.py to scale pilot rating and
a long list of technologies. | [
"Select",
"a",
"discount",
"multiplier",
"from",
"the",
"alternatives",
"provided",
"for",
"use",
"in",
"evaluate",
"planet",
"in",
"Colonisation",
".",
"py",
"to",
"scale",
"pilot",
"rating",
"and",
"a",
"long",
"list",
"of",
"technologies",
"."
] | def preferred_discount_multiplier(self, alternatives): # pylint: disable=no-self-use,unused-argument
"""Select a discount multiplier from the alternatives provided for
use in evaluate planet in Colonisation.py to scale pilot rating and
a long list of technologies.
"""
# TODO Rem... | [
"def",
"preferred_discount_multiplier",
"(",
"self",
",",
"alternatives",
")",
":",
"# pylint: disable=no-self-use,unused-argument",
"# TODO Remove this tap it is one of the empire id dependent taps. See EmpireIDTrait.",
"return",
"None"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/character/character_module.py#L194-L200 | |
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_model.py | python | GeNNModel.pull_connectivity_from_device | (self, pop_name) | Pull connectivity from the device for a given population | Pull connectivity from the device for a given population | [
"Pull",
"connectivity",
"from",
"the",
"device",
"for",
"a",
"given",
"population"
] | def pull_connectivity_from_device(self, pop_name):
"""Pull connectivity from the device for a given population"""
if not self._loaded:
raise Exception("GeNN model has to be loaded before pulling")
self._slm.pull_connectivity_from_device(pop_name) | [
"def",
"pull_connectivity_from_device",
"(",
"self",
",",
"pop_name",
")",
":",
"if",
"not",
"self",
".",
"_loaded",
":",
"raise",
"Exception",
"(",
"\"GeNN model has to be loaded before pulling\"",
")",
"self",
".",
"_slm",
".",
"pull_connectivity_from_device",
"(",
... | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_model.py#L741-L746 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/scons.py | python | _ProcessNodes | (grd, base_dir, lang_folders) | return (structure_outputs, translated_files, static_files) | Processes the GRD nodes to figure out file dependencies.
Args:
grd: An open GRD reader.
base_dir: The base directory for filenames.
lang_folders: THe output language folders.
Returns:
A tuple of (structure_outputs, translated_files, static_files):
structure_outputs: Structures marked as scon... | Processes the GRD nodes to figure out file dependencies. | [
"Processes",
"the",
"GRD",
"nodes",
"to",
"figure",
"out",
"file",
"dependencies",
"."
] | def _ProcessNodes(grd, base_dir, lang_folders):
"""Processes the GRD nodes to figure out file dependencies.
Args:
grd: An open GRD reader.
base_dir: The base directory for filenames.
lang_folders: THe output language folders.
Returns:
A tuple of (structure_outputs, translated_files, static_files... | [
"def",
"_ProcessNodes",
"(",
"grd",
",",
"base_dir",
",",
"lang_folders",
")",
":",
"structure_outputs",
"=",
"[",
"]",
"translated_files",
"=",
"[",
"]",
"static_files",
"=",
"[",
"]",
"# Go through nodes, figuring out resources. Also output certain resources",
"# as ... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/scons.py#L116-L166 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/msgpack/ext.py | python | Timestamp.to_datetime | (self) | return datetime.datetime.fromtimestamp(0, _utc) + datetime.timedelta(
seconds=self.to_unix()
) | Get the timestamp as a UTC datetime.
Python 2 is not supported.
:rtype: datetime. | Get the timestamp as a UTC datetime. | [
"Get",
"the",
"timestamp",
"as",
"a",
"UTC",
"datetime",
"."
] | def to_datetime(self):
"""Get the timestamp as a UTC datetime.
Python 2 is not supported.
:rtype: datetime.
"""
return datetime.datetime.fromtimestamp(0, _utc) + datetime.timedelta(
seconds=self.to_unix()
) | [
"def",
"to_datetime",
"(",
"self",
")",
":",
"return",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"0",
",",
"_utc",
")",
"+",
"datetime",
".",
"timedelta",
"(",
"seconds",
"=",
"self",
".",
"to_unix",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/msgpack/ext.py#L347-L365 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPML_PCR_SELECTION.initFromTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def initFromTpm(self, buf):
""" TpmMarshaller method """
self.pcrSelections = buf.readObjArr(TPMS_PCR_SELECTION) | [
"def",
"initFromTpm",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"pcrSelections",
"=",
"buf",
".",
"readObjArr",
"(",
"TPMS_PCR_SELECTION",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4680-L4682 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/signature_serialization.py | python | create_signature_map | (signatures) | return signature_map | Creates an object containing `signatures`. | Creates an object containing `signatures`. | [
"Creates",
"an",
"object",
"containing",
"signatures",
"."
] | def create_signature_map(signatures):
"""Creates an object containing `signatures`."""
signature_map = _SignatureMap()
for name, func in signatures.items():
# This true of any signature that came from canonicalize_signatures. Here as
# a sanity check on saving; crashing on load (e.g. in _add_signature) wo... | [
"def",
"create_signature_map",
"(",
"signatures",
")",
":",
"signature_map",
"=",
"_SignatureMap",
"(",
")",
"for",
"name",
",",
"func",
"in",
"signatures",
".",
"items",
"(",
")",
":",
"# This true of any signature that came from canonicalize_signatures. Here as",
"# a... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/signature_serialization.py#L282-L299 | |
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/doc/pattern_tools/svgfig.py | python | template | (fileName, svg, replaceme="REPLACEME") | return output | Loads an SVG image from a file, replacing instances of
<REPLACEME /> with a given svg object.
fileName required name of the template SVG
svg required SVG object for replacement
replaceme default="REPLACEME" fake SVG element to be replaced by... | Loads an SVG image from a file, replacing instances of
<REPLACEME /> with a given svg object. | [
"Loads",
"an",
"SVG",
"image",
"from",
"a",
"file",
"replacing",
"instances",
"of",
"<REPLACEME",
"/",
">",
"with",
"a",
"given",
"svg",
"object",
"."
] | def template(fileName, svg, replaceme="REPLACEME"):
"""Loads an SVG image from a file, replacing instances of
<REPLACEME /> with a given svg object.
fileName required name of the template SVG
svg required SVG object for replacement
replaceme ... | [
"def",
"template",
"(",
"fileName",
",",
"svg",
",",
"replaceme",
"=",
"\"REPLACEME\"",
")",
":",
"output",
"=",
"load",
"(",
"fileName",
")",
"for",
"ti",
",",
"s",
"in",
"output",
":",
"if",
"isinstance",
"(",
"s",
",",
"SVG",
")",
"and",
"s",
".... | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/doc/pattern_tools/svgfig.py#L567-L589 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/odom_visualization/build/devel/_setup_util.py | python | _get_workspaces | (environ, include_fuerte=False, include_non_existing=False) | return workspaces | Based on CMAKE_PREFIX_PATH return all catkin workspaces.
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool`` | Based on CMAKE_PREFIX_PATH return all catkin workspaces. | [
"Based",
"on",
"CMAKE_PREFIX_PATH",
"return",
"all",
"catkin",
"workspaces",
"."
] | def _get_workspaces(environ, include_fuerte=False, include_non_existing=False):
'''
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
'''
# get all cmake prefix paths
env_na... | [
"def",
"_get_workspaces",
"(",
"environ",
",",
"include_fuerte",
"=",
"False",
",",
"include_non_existing",
"=",
"False",
")",
":",
"# get all cmake prefix paths",
"env_name",
"=",
"'CMAKE_PREFIX_PATH'",
"value",
"=",
"environ",
"[",
"env_name",
"]",
"if",
"env_name... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/odom_visualization/build/devel/_setup_util.py#L114-L126 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | third_party/cpplint.py | python | CheckBracesSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for horizontal spacing near commas.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A NestingState instance which maintains information about
the current stack o... | Checks for horizontal spacing near commas. | [
"Checks",
"for",
"horizontal",
"spacing",
"near",
"commas",
"."
] | def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for horizontal spacing near commas.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A NestingStat... | [
"def",
"CheckBracesSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Except after an opening paren, or after another opening brace (in case of",
... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L3548-L3634 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHandler.py | python | IdleConf.GetHighlight | (self, theme, element, fgBg=None) | return individual highlighting theme elements.
fgBg - string ('fg'or'bg') or None, if None return a dictionary
containing fg and bg colours (appropriate for passing to Tkinter in,
e.g., a tag_config call), otherwise fg or bg colour only as specified. | return individual highlighting theme elements.
fgBg - string ('fg'or'bg') or None, if None return a dictionary
containing fg and bg colours (appropriate for passing to Tkinter in,
e.g., a tag_config call), otherwise fg or bg colour only as specified. | [
"return",
"individual",
"highlighting",
"theme",
"elements",
".",
"fgBg",
"-",
"string",
"(",
"fg",
"or",
"bg",
")",
"or",
"None",
"if",
"None",
"return",
"a",
"dictionary",
"containing",
"fg",
"and",
"bg",
"colours",
"(",
"appropriate",
"for",
"passing",
... | def GetHighlight(self, theme, element, fgBg=None):
"""
return individual highlighting theme elements.
fgBg - string ('fg'or'bg') or None, if None return a dictionary
containing fg and bg colours (appropriate for passing to Tkinter in,
e.g., a tag_config call), otherwise fg or bg ... | [
"def",
"GetHighlight",
"(",
"self",
",",
"theme",
",",
"element",
",",
"fgBg",
"=",
"None",
")",
":",
"if",
"self",
".",
"defaultCfg",
"[",
"'highlight'",
"]",
".",
"has_section",
"(",
"theme",
")",
":",
"themeDict",
"=",
"self",
".",
"GetThemeDict",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHandler.py#L297-L322 | ||
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | libVeles/cpplint.py | python | FindNextMatchingAngleBracket | (clean_lines, linenum, init_suffix) | return True | Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a matching bracket exists. | Find the corresponding > to close a template. | [
"Find",
"the",
"corresponding",
">",
"to",
"close",
"a",
"template",
"."
] | def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix):
"""Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a ... | [
"def",
"FindNextMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_suffix",
")",
":",
"line",
"=",
"init_suffix",
"nesting_stack",
"=",
"[",
"'<'",
"]",
"while",
"True",
":",
"# Find the next operator that can tell us whether < is used as an",
"# openin... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L2074-L2141 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/resmokelib/core/programs.py | python | _apply_set_parameters | (args, set_parameter) | Converts key-value pairs from 'kwargs' into --setParameter key=value
arguments to an executable and appends them to 'args'. | Converts key-value pairs from 'kwargs' into --setParameter key=value
arguments to an executable and appends them to 'args'. | [
"Converts",
"key",
"-",
"value",
"pairs",
"from",
"kwargs",
"into",
"--",
"setParameter",
"key",
"=",
"value",
"arguments",
"to",
"an",
"executable",
"and",
"appends",
"them",
"to",
"args",
"."
] | def _apply_set_parameters(args, set_parameter):
"""
Converts key-value pairs from 'kwargs' into --setParameter key=value
arguments to an executable and appends them to 'args'.
"""
for param_name in set_parameter:
param_value = set_parameter[param_name]
# --setParameter takes boolean... | [
"def",
"_apply_set_parameters",
"(",
"args",
",",
"set_parameter",
")",
":",
"for",
"param_name",
"in",
"set_parameter",
":",
"param_value",
"=",
"set_parameter",
"[",
"param_name",
"]",
"# --setParameter takes boolean values as lowercase strings.",
"if",
"isinstance",
"(... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/resmokelib/core/programs.py#L334-L346 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py | python | Context.to_sci_string | (self, a) | return a.__str__(context=self) | Converts a number to a string, using scientific notation.
The operation is not affected by the context. | Converts a number to a string, using scientific notation. | [
"Converts",
"a",
"number",
"to",
"a",
"string",
"using",
"scientific",
"notation",
"."
] | def to_sci_string(self, a):
"""Converts a number to a string, using scientific notation.
The operation is not affected by the context.
"""
a = _convert_other(a, raiseit=True)
return a.__str__(context=self) | [
"def",
"to_sci_string",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"__str__",
"(",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L5544-L5550 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/gdb/mongo_printers.py | python | MongoPrettyPrinterCollection.__init__ | (self) | Initialize MongoPrettyPrinterCollection. | Initialize MongoPrettyPrinterCollection. | [
"Initialize",
"MongoPrettyPrinterCollection",
"."
] | def __init__(self):
"""Initialize MongoPrettyPrinterCollection."""
super(MongoPrettyPrinterCollection, self).__init__("mongo", []) | [
"def",
"__init__",
"(",
"self",
")",
":",
"super",
"(",
"MongoPrettyPrinterCollection",
",",
"self",
")",
".",
"__init__",
"(",
"\"mongo\"",
",",
"[",
"]",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo_printers.py#L616-L618 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/yply/yparse.py | python | p_definition_token | (p) | definition : toktype opttype idlist optsemi | definition : toktype opttype idlist optsemi | [
"definition",
":",
"toktype",
"opttype",
"idlist",
"optsemi"
] | def p_definition_token(p):
'''definition : toktype opttype idlist optsemi '''
for i in p[3]:
if i[0] not in "'\"":
tokenlist.append(i)
if p[1] == '%left':
preclist.append(('left',) + tuple(p[3]))
elif p[1] == '%right':
preclist.append(('right',) + tuple(p[3]))
elif ... | [
"def",
"p_definition_token",
"(",
"p",
")",
":",
"for",
"i",
"in",
"p",
"[",
"3",
"]",
":",
"if",
"i",
"[",
"0",
"]",
"not",
"in",
"\"'\\\"\"",
":",
"tokenlist",
".",
"append",
"(",
"i",
")",
"if",
"p",
"[",
"1",
"]",
"==",
"'%left'",
":",
"p... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/yply/yparse.py#L48-L58 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py | python | ComponentWriterBase.buildFileName | (self, obj) | return filename | Build the file name | Build the file name | [
"Build",
"the",
"file",
"name"
] | def buildFileName(self, obj):
"""
Build the file name
"""
if self.config("component", "XMLDefaultFileName") == "True":
filename = (
obj.get_namespace()
+ obj.get_name()
+ self.config("component", self.__writer)
)
... | [
"def",
"buildFileName",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"config",
"(",
"\"component\"",
",",
"\"XMLDefaultFileName\"",
")",
"==",
"\"True\"",
":",
"filename",
"=",
"(",
"obj",
".",
"get_namespace",
"(",
")",
"+",
"obj",
".",
"get_na... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py#L84-L113 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/config.py | python | read_configuration | (
filepath, find_others=False, ignore_option_errors=False) | return configuration_to_dict(handlers) | Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other configuration files
which could be on in various places.
:param bool ignore_option_errors:... | Read given configuration file and returns options from it as a dict. | [
"Read",
"given",
"configuration",
"file",
"and",
"returns",
"options",
"from",
"it",
"as",
"a",
"dict",
"."
] | def read_configuration(
filepath, find_others=False, ignore_option_errors=False):
"""Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other config... | [
"def",
"read_configuration",
"(",
"filepath",
",",
"find_others",
"=",
"False",
",",
"ignore_option_errors",
"=",
"False",
")",
":",
"from",
"setuptools",
".",
"dist",
"import",
"Distribution",
",",
"_Distribution",
"filepath",
"=",
"os",
".",
"path",
".",
"ab... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/config.py#L22-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/api.py | python | _memory_size_from_info | (shape, strides, itemsize) | return e - s | Get the byte size of a contiguous memory buffer given the shape, strides
and itemsize. | Get the byte size of a contiguous memory buffer given the shape, strides
and itemsize. | [
"Get",
"the",
"byte",
"size",
"of",
"a",
"contiguous",
"memory",
"buffer",
"given",
"the",
"shape",
"strides",
"and",
"itemsize",
"."
] | def _memory_size_from_info(shape, strides, itemsize):
"""Get the byte size of a contiguous memory buffer given the shape, strides
and itemsize.
"""
assert len(shape) == len(strides), "# dim mismatch"
ndim = len(shape)
s, e = mviewbuf.memoryview_get_extents_info(shape, strides, ndim, itemsize)
... | [
"def",
"_memory_size_from_info",
"(",
"shape",
",",
"strides",
",",
"itemsize",
")",
":",
"assert",
"len",
"(",
"shape",
")",
"==",
"len",
"(",
"strides",
")",
",",
"\"# dim mismatch\"",
"ndim",
"=",
"len",
"(",
"shape",
")",
"s",
",",
"e",
"=",
"mview... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/api.py#L159-L166 | |
mgbellemare/Arcade-Learning-Environment | 0af0ff4a49a981d113c67b866fa152dbc7a1c0a7 | src/gym/envs/atari/environment.py | python | AtariEnv.restore_full_state | (self, state: ALEState) | Restore emulator state w/ system state including pseudorandomness. | Restore emulator state w/ system state including pseudorandomness. | [
"Restore",
"emulator",
"state",
"w",
"/",
"system",
"state",
"including",
"pseudorandomness",
"."
] | def restore_full_state(self, state: ALEState) -> None:
"""Restore emulator state w/ system state including pseudorandomness."""
logger.warn(
"restore_full_state() is deprecated and will be removed in a future release of `ale-py`. "
"Please use `restore_state(state)` which will re... | [
"def",
"restore_full_state",
"(",
"self",
",",
"state",
":",
"ALEState",
")",
"->",
"None",
":",
"logger",
".",
"warn",
"(",
"\"restore_full_state() is deprecated and will be removed in a future release of `ale-py`. \"",
"\"Please use `restore_state(state)` which will restore the s... | https://github.com/mgbellemare/Arcade-Learning-Environment/blob/0af0ff4a49a981d113c67b866fa152dbc7a1c0a7/src/gym/envs/atari/environment.py#L359-L365 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pprint.py | python | pprint | (object, stream=None, indent=1, width=80, depth=None) | Pretty-print a Python object to a stream [default is sys.stdout]. | Pretty-print a Python object to a stream [default is sys.stdout]. | [
"Pretty",
"-",
"print",
"a",
"Python",
"object",
"to",
"a",
"stream",
"[",
"default",
"is",
"sys",
".",
"stdout",
"]",
"."
] | def pprint(object, stream=None, indent=1, width=80, depth=None):
"""Pretty-print a Python object to a stream [default is sys.stdout]."""
printer = PrettyPrinter(
stream=stream, indent=indent, width=width, depth=depth)
printer.pprint(object) | [
"def",
"pprint",
"(",
"object",
",",
"stream",
"=",
"None",
",",
"indent",
"=",
"1",
",",
"width",
"=",
"80",
",",
"depth",
"=",
"None",
")",
":",
"printer",
"=",
"PrettyPrinter",
"(",
"stream",
"=",
"stream",
",",
"indent",
"=",
"indent",
",",
"wi... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pprint.py#L55-L59 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | ChildDocTemplate.CreateDocument | (self, path, flags, data=None, parentDocument=None) | Called when a ChildDocument is to be created and does the minimum such that the
ChildDocument looks like a real Document to the framework. | Called when a ChildDocument is to be created and does the minimum such that the
ChildDocument looks like a real Document to the framework. | [
"Called",
"when",
"a",
"ChildDocument",
"is",
"to",
"be",
"created",
"and",
"does",
"the",
"minimum",
"such",
"that",
"the",
"ChildDocument",
"looks",
"like",
"a",
"real",
"Document",
"to",
"the",
"framework",
"."
] | def CreateDocument(self, path, flags, data=None, parentDocument=None):
"""
Called when a ChildDocument is to be created and does the minimum such that the
ChildDocument looks like a real Document to the framework.
"""
doc = self._docType()
doc.SetFilename(path)
do... | [
"def",
"CreateDocument",
"(",
"self",
",",
"path",
",",
"flags",
",",
"data",
"=",
"None",
",",
"parentDocument",
"=",
"None",
")",
":",
"doc",
"=",
"self",
".",
"_docType",
"(",
")",
"doc",
".",
"SetFilename",
"(",
"path",
")",
"doc",
".",
"SetData"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L2823-L2840 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py | python | BasicFittingPresenter.initialize_model_options | (self) | Initialise the model with the default fitting options. | Initialise the model with the default fitting options. | [
"Initialise",
"the",
"model",
"with",
"the",
"default",
"fitting",
"options",
"."
] | def initialize_model_options(self) -> None:
"""Initialise the model with the default fitting options."""
self.model.minimizer = self.view.minimizer
self.model.evaluation_type = self.view.evaluation_type
self.model.fit_to_raw = self.view.fit_to_raw | [
"def",
"initialize_model_options",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"model",
".",
"minimizer",
"=",
"self",
".",
"view",
".",
"minimizer",
"self",
".",
"model",
".",
"evaluation_type",
"=",
"self",
".",
"view",
".",
"evaluation_type",
"sel... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py#L89-L93 | ||
apache/madlib | be297fe6beada0640f93317e8948834032718e32 | src/madpack/sort-module.py | python | main | (file_paths) | Args:
@param: file_paths: List of paths to SQL files, where each path
is of the form: '.../modules/<module_name>/...'. | Args: | [
"Args",
":"
] | def main(file_paths):
"""
Args:
@param: file_paths: List of paths to SQL files, where each path
is of the form: '.../modules/<module_name>/...'.
"""
file_order = sorted(file_paths, key=find_order)
print " ".join(file_order) | [
"def",
"main",
"(",
"file_paths",
")",
":",
"file_order",
"=",
"sorted",
"(",
"file_paths",
",",
"key",
"=",
"find_order",
")",
"print",
"\" \"",
".",
"join",
"(",
"file_order",
")"
] | https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/sort-module.py#L60-L67 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/cpp.py | python | PreProcessor.start_handling_includes | (self, t=None) | Causes the PreProcessor object to start processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates True, or when we reach the #else in a #if, #ifdef,
#ifndef or #elif block where a condition already evaluated
F... | Causes the PreProcessor object to start processing #import,
#include and #include_next lines. | [
"Causes",
"the",
"PreProcessor",
"object",
"to",
"start",
"processing",
"#import",
"#include",
"and",
"#include_next",
"lines",
"."
] | def start_handling_includes(self, t=None):
"""
Causes the PreProcessor object to start processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates True, or when we reach the #else in a #if, #ifdef,
#ifnd... | [
"def",
"start_handling_includes",
"(",
"self",
",",
"t",
"=",
"None",
")",
":",
"d",
"=",
"self",
".",
"dispatch_table",
"p",
"=",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
"if",
"self",
".",
"stack",
"else",
"self",
".",
"default_table",
"for",
"k",... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/cpp.py#L425-L440 | ||
rougier/CPP-Crash-Course | e85478d296890cf657198ba961227f63e54278f3 | rst2html.py | python | Lexer.__iter__ | (self) | Parse self.code and yield "classified" tokens | Parse self.code and yield "classified" tokens | [
"Parse",
"self",
".",
"code",
"and",
"yield",
"classified",
"tokens"
] | def __iter__(self):
"""Parse self.code and yield "classified" tokens
"""
codestring = u'\n'.join(self.code)
if self.lexer is None:
yield [('', codestring)]
return
tokens = pygments.lex(codestring, self.lexer)
for ttype, value in self.merge(tokens):... | [
"def",
"__iter__",
"(",
"self",
")",
":",
"codestring",
"=",
"u'\\n'",
".",
"join",
"(",
"self",
".",
"code",
")",
"if",
"self",
".",
"lexer",
"is",
"None",
":",
"yield",
"[",
"(",
"''",
",",
"codestring",
")",
"]",
"return",
"tokens",
"=",
"pygmen... | https://github.com/rougier/CPP-Crash-Course/blob/e85478d296890cf657198ba961227f63e54278f3/rst2html.py#L117-L127 | ||
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/tools/scan-build-py/libscanbuild/intercept.py | python | entry_hash | (entry) | return '<>'.join([filename, directory, command]) | Implement unique hash method for compilation database entries. | Implement unique hash method for compilation database entries. | [
"Implement",
"unique",
"hash",
"method",
"for",
"compilation",
"database",
"entries",
"."
] | def entry_hash(entry):
""" Implement unique hash method for compilation database entries. """
# For faster lookup in set filename is reverted
filename = entry['file'][::-1]
# For faster lookup in set directory is reverted
directory = entry['directory'][::-1]
# On OS X the 'cc' and 'c++' compile... | [
"def",
"entry_hash",
"(",
"entry",
")",
":",
"# For faster lookup in set filename is reverted",
"filename",
"=",
"entry",
"[",
"'file'",
"]",
"[",
":",
":",
"-",
"1",
"]",
"# For faster lookup in set directory is reverted",
"directory",
"=",
"entry",
"[",
"'directory'... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libscanbuild/intercept.py#L250-L263 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/requireprovidesorter.py | python | RequireProvideSorter._GetRequireOrProvideTokens | (self, token, token_string) | return tokens | Gets all goog.provide or goog.require tokens in the given token stream.
Args:
token: The first token in the token stream.
token_string: One of 'goog.provide' or 'goog.require' to indicate which
tokens to find.
Returns:
A list of goog.provide or goog.require tokens in the ... | Gets all goog.provide or goog.require tokens in the given token stream. | [
"Gets",
"all",
"goog",
".",
"provide",
"or",
"goog",
".",
"require",
"tokens",
"in",
"the",
"given",
"token",
"stream",
"."
] | def _GetRequireOrProvideTokens(self, token, token_string):
"""Gets all goog.provide or goog.require tokens in the given token stream.
Args:
token: The first token in the token stream.
token_string: One of 'goog.provide' or 'goog.require' to indicate which
tokens to find.
Re... | [
"def",
"_GetRequireOrProvideTokens",
"(",
"self",
",",
"token",
",",
"token_string",
")",
":",
"tokens",
"=",
"[",
"]",
"while",
"token",
":",
"if",
"token",
".",
"type",
"==",
"Type",
".",
"IDENTIFIER",
":",
"if",
"token",
".",
"string",
"==",
"token_st... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/requireprovidesorter.py#L153-L180 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/utils.py | python | check_header_validity | (header) | Verifies that header value is a string which doesn't contain
leading whitespace or return characters. This prevents unintended
header injection.
:param header: tuple, in the format (name, value). | Verifies that header value is a string which doesn't contain
leading whitespace or return characters. This prevents unintended
header injection. | [
"Verifies",
"that",
"header",
"value",
"is",
"a",
"string",
"which",
"doesn",
"t",
"contain",
"leading",
"whitespace",
"or",
"return",
"characters",
".",
"This",
"prevents",
"unintended",
"header",
"injection",
"."
] | def check_header_validity(header):
"""Verifies that header value is a string which doesn't contain
leading whitespace or return characters. This prevents unintended
header injection.
:param header: tuple, in the format (name, value).
"""
name, value = header
if isinstance(value, bytes):
... | [
"def",
"check_header_validity",
"(",
"header",
")",
":",
"name",
",",
"value",
"=",
"header",
"if",
"isinstance",
"(",
"value",
",",
"bytes",
")",
":",
"pat",
"=",
"_CLEAN_HEADER_REGEX_BYTE",
"else",
":",
"pat",
"=",
"_CLEAN_HEADER_REGEX_STR",
"try",
":",
"i... | 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/utils.py#L932-L950 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/utils/creduce-clang-crash.py | python | check_cmd | (cmd_name, cmd_dir, cmd_path=None) | Returns absolute path to cmd_path if it is given,
or absolute path to cmd_dir/cmd_name. | Returns absolute path to cmd_path if it is given,
or absolute path to cmd_dir/cmd_name. | [
"Returns",
"absolute",
"path",
"to",
"cmd_path",
"if",
"it",
"is",
"given",
"or",
"absolute",
"path",
"to",
"cmd_dir",
"/",
"cmd_name",
"."
] | def check_cmd(cmd_name, cmd_dir, cmd_path=None):
"""
Returns absolute path to cmd_path if it is given,
or absolute path to cmd_dir/cmd_name.
"""
if cmd_path:
cmd = find_executable(cmd_path)
if cmd:
return cmd
sys.exit("ERROR: executable `%s` not found" % (cmd_path))
cmd = find_executable(... | [
"def",
"check_cmd",
"(",
"cmd_name",
",",
"cmd_dir",
",",
"cmd_path",
"=",
"None",
")",
":",
"if",
"cmd_path",
":",
"cmd",
"=",
"find_executable",
"(",
"cmd_path",
")",
"if",
"cmd",
":",
"return",
"cmd",
"sys",
".",
"exit",
"(",
"\"ERROR: executable `%s` n... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/utils/creduce-clang-crash.py#L37-L54 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py | python | ParserElement.__ror__ | (self, other ) | return other | self | Implementation of | operator when left operand is not a C{L{ParserElement}} | Implementation of | operator when left operand is not a C{L{ParserElement}} | [
"Implementation",
"of",
"|",
"operator",
"when",
"left",
"operand",
"is",
"not",
"a",
"C",
"{",
"L",
"{",
"ParserElement",
"}}"
] | def __ror__(self, other ):
"""
Implementation of | operator when left operand is not a C{L{ParserElement}}
"""
if isinstance( other, basestring ):
other = ParserElement._literalStringClass( other )
if not isinstance( other, ParserElement ):
warnings.warn("... | [
"def",
"__ror__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElement... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py#L1960-L1970 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/pipes.py | python | Template.reset | (self) | t.reset() restores a pipeline template to its initial state. | t.reset() restores a pipeline template to its initial state. | [
"t",
".",
"reset",
"()",
"restores",
"a",
"pipeline",
"template",
"to",
"its",
"initial",
"state",
"."
] | def reset(self):
"""t.reset() restores a pipeline template to its initial state."""
self.steps = [] | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"steps",
"=",
"[",
"]"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/pipes.py#L94-L96 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | cnx/broker/tickFillStrategy.py | python | DefaultStrategy.setSlippageModel | (self, slippageModel) | Set the slippage model to use.
:param slippageModel: The slippage model.
:type slippageModel: :class:`pyalgotrade.broker.slippage.SlippageModel` | Set the slippage model to use. | [
"Set",
"the",
"slippage",
"model",
"to",
"use",
"."
] | def setSlippageModel(self, slippageModel):
"""
Set the slippage model to use.
:param slippageModel: The slippage model.
:type slippageModel: :class:`pyalgotrade.broker.slippage.SlippageModel`
"""
self.__slippageModel = slippageModel | [
"def",
"setSlippageModel",
"(",
"self",
",",
"slippageModel",
")",
":",
"self",
".",
"__slippageModel",
"=",
"slippageModel"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/cnx/broker/tickFillStrategy.py#L291-L299 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/packaging/version.py | python | _parse_local_version | (local) | Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve"). | Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve"). | [
"Takes",
"a",
"string",
"like",
"abc",
".",
"1",
".",
"twelve",
"and",
"turns",
"it",
"into",
"(",
"abc",
"1",
"twelve",
")",
"."
] | def _parse_local_version(local):
"""
Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
"""
if local is not None:
return tuple(
part.lower() if not part.isdigit() else int(part)
for part in _local_version_separators.split(local)
) | [
"def",
"_parse_local_version",
"(",
"local",
")",
":",
"if",
"local",
"is",
"not",
"None",
":",
"return",
"tuple",
"(",
"part",
".",
"lower",
"(",
")",
"if",
"not",
"part",
".",
"isdigit",
"(",
")",
"else",
"int",
"(",
"part",
")",
"for",
"part",
"... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/packaging/version.py#L367-L375 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/generic_utils.py | python | to_list | (x) | return [x] | Normalizes a list/tensor into a list.
If a tensor is passed, we return
a list of size 1 containing the tensor.
Arguments:
x: target object to be normalized.
Returns:
A list. | Normalizes a list/tensor into a list. | [
"Normalizes",
"a",
"list",
"/",
"tensor",
"into",
"a",
"list",
"."
] | def to_list(x):
"""Normalizes a list/tensor into a list.
If a tensor is passed, we return
a list of size 1 containing the tensor.
Arguments:
x: target object to be normalized.
Returns:
A list.
"""
if isinstance(x, list):
return x
return [x] | [
"def",
"to_list",
"(",
"x",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"list",
")",
":",
"return",
"x",
"return",
"[",
"x",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/generic_utils.py#L544-L558 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py | python | Client.connect_srv | (self, domain=None, keepalive=60, bind_address="") | Connect to a remote broker.
domain is the DNS domain to search for SRV records; if None,
try to determine local domain name.
keepalive and bind_address are as for connect() | Connect to a remote broker. | [
"Connect",
"to",
"a",
"remote",
"broker",
"."
] | def connect_srv(self, domain=None, keepalive=60, bind_address=""):
"""Connect to a remote broker.
domain is the DNS domain to search for SRV records; if None,
try to determine local domain name.
keepalive and bind_address are as for connect()
"""
if HAVE_DNS is False:
... | [
"def",
"connect_srv",
"(",
"self",
",",
"domain",
"=",
"None",
",",
"keepalive",
"=",
"60",
",",
"bind_address",
"=",
"\"\"",
")",
":",
"if",
"HAVE_DNS",
"is",
"False",
":",
"raise",
"ValueError",
"(",
"'No DNS resolver library found.'",
")",
"if",
"domain",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/protocol/paho/client.py#L667-L703 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pyparsing/py2/pyparsing.py | python | ParserElement.setFailAction | (self, fn) | return self | Define action to perform if parsing fails at this expression.
Fail acton fn is a callable function that takes the arguments
``fn(s, loc, expr, err)`` where:
- s = string being parsed
- loc = location where expression match was attempted and failed
- expr = the pars... | Define action to perform if parsing fails at this expression.
Fail acton fn is a callable function that takes the arguments
``fn(s, loc, expr, err)`` where:
- s = string being parsed
- loc = location where expression match was attempted and failed
- expr = the pars... | [
"Define",
"action",
"to",
"perform",
"if",
"parsing",
"fails",
"at",
"this",
"expression",
".",
"Fail",
"acton",
"fn",
"is",
"a",
"callable",
"function",
"that",
"takes",
"the",
"arguments",
"fn",
"(",
"s",
"loc",
"expr",
"err",
")",
"where",
":",
"-",
... | def setFailAction(self, fn):
"""Define action to perform if parsing fails at this expression.
Fail acton fn is a callable function that takes the arguments
``fn(s, loc, expr, err)`` where:
- s = string being parsed
- loc = location where expression match was attempted... | [
"def",
"setFailAction",
"(",
"self",
",",
"fn",
")",
":",
"self",
".",
"failAction",
"=",
"fn",
"return",
"self"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py2/pyparsing.py#L1602-L1613 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tempfile.py | python | gettempprefixb | () | return _os.fsencode(gettempprefix()) | The default prefix for temporary directories as bytes. | The default prefix for temporary directories as bytes. | [
"The",
"default",
"prefix",
"for",
"temporary",
"directories",
"as",
"bytes",
"."
] | def gettempprefixb():
"""The default prefix for temporary directories as bytes."""
return _os.fsencode(gettempprefix()) | [
"def",
"gettempprefixb",
"(",
")",
":",
"return",
"_os",
".",
"fsencode",
"(",
"gettempprefix",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tempfile.py#L281-L283 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/factory.py | python | ResourceFactory._create_collection | (factory_self, resource_name, collection_model,
service_context) | return property(get_collection) | Creates a new property on the resource to lazy-load a collection. | Creates a new property on the resource to lazy-load a collection. | [
"Creates",
"a",
"new",
"property",
"on",
"the",
"resource",
"to",
"lazy",
"-",
"load",
"a",
"collection",
"."
] | def _create_collection(factory_self, resource_name, collection_model,
service_context):
"""
Creates a new property on the resource to lazy-load a collection.
"""
cls = factory_self._collection_factory.load_from_definition(
resource_name=resource_nam... | [
"def",
"_create_collection",
"(",
"factory_self",
",",
"resource_name",
",",
"collection_model",
",",
"service_context",
")",
":",
"cls",
"=",
"factory_self",
".",
"_collection_factory",
".",
"load_from_definition",
"(",
"resource_name",
"=",
"resource_name",
",",
"co... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/factory.py#L382-L400 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/kfac/python/ops/utils.py | python | column_to_tensors | (tensors_template, colvec) | return tensors | Converts a column vector back to the shape of the given template.
Args:
tensors_template: A tensor or list of tensors.
colvec: A 2d column vector with the same shape as the value of
tensors_to_column(tensors_template).
Returns:
X, where X is tensor or list of tensors with the properties:
... | Converts a column vector back to the shape of the given template. | [
"Converts",
"a",
"column",
"vector",
"back",
"to",
"the",
"shape",
"of",
"the",
"given",
"template",
"."
] | def column_to_tensors(tensors_template, colvec):
"""Converts a column vector back to the shape of the given template.
Args:
tensors_template: A tensor or list of tensors.
colvec: A 2d column vector with the same shape as the value of
tensors_to_column(tensors_template).
Returns:
X, where X i... | [
"def",
"column_to_tensors",
"(",
"tensors_template",
",",
"colvec",
")",
":",
"if",
"isinstance",
"(",
"tensors_template",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"offset",
"=",
"0",
"tensors",
"=",
"[",
"]",
"for",
"tensor_template",
"in",
"tensors... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/kfac/python/ops/utils.py#L82-L110 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/winres.py | python | configure | (conf) | Detect the programs RC or windres, depending on the C/C++ compiler in use | Detect the programs RC or windres, depending on the C/C++ compiler in use | [
"Detect",
"the",
"programs",
"RC",
"or",
"windres",
"depending",
"on",
"the",
"C",
"/",
"C",
"++",
"compiler",
"in",
"use"
] | def configure(conf):
"""
Detect the programs RC or windres, depending on the C/C++ compiler in use
"""
v = conf.env
v['WINRC_TGT_F'] = '-o'
v['WINRC_SRC_F'] = '-i'
# find rc.exe
if not conf.env.WINRC:
if v.CC_NAME == 'msvc':
conf.find_program('RC', var='WINRC', path_list = v['PATH'], silent_output=True)
... | [
"def",
"configure",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
"[",
"'WINRC_TGT_F'",
"]",
"=",
"'-o'",
"v",
"[",
"'WINRC_SRC_F'",
"]",
"=",
"'-i'",
"# find rc.exe",
"if",
"not",
"conf",
".",
"env",
".",
"WINRC",
":",
"if",
"v",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/winres.py#L96-L115 | ||
tum-vision/fusenet | a1451be2971b348a01b0f525c2a3a7a0e215a591 | scripts/cpp_lint.py | python | CheckCheck | (filename, clean_lines, linenum, error) | Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks the use of CHECK and EXPECT macros. | [
"Checks",
"the",
"use",
"of",
"CHECK",
"and",
"EXPECT",
"macros",
"."
] | def CheckCheck(filename, clean_lines, linenum, error):
"""Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
... | [
"def",
"CheckCheck",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Decide the set of replacement macros that should be suggested",
"lines",
"=",
"clean_lines",
".",
"elided",
"check_macro",
"=",
"None",
"start_pos",
"=",
"-",
"1",
"... | https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/scripts/cpp_lint.py#L3278-L3402 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/rfc2217.py | python | Serial.write | (self, data) | return len(data) | \
Output the given byte string over the serial port. Can block if the
connection is blocked. May raise SerialException if the connection is
closed. | \
Output the given byte string over the serial port. Can block if the
connection is blocked. May raise SerialException if the connection is
closed. | [
"\\",
"Output",
"the",
"given",
"byte",
"string",
"over",
"the",
"serial",
"port",
".",
"Can",
"block",
"if",
"the",
"connection",
"is",
"blocked",
".",
"May",
"raise",
"SerialException",
"if",
"the",
"connection",
"is",
"closed",
"."
] | def write(self, data):
"""\
Output the given byte string over the serial port. Can block if the
connection is blocked. May raise SerialException if the connection is
closed.
"""
if not self.is_open:
raise portNotOpenError
# XXX use protocol_socket's wr... | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"# XXX use protocol_socket's write",
"with",
"self",
".",
"_write_lock",
":",
"try",
":",
"self",
".",
"_socket",
".",
"sendall",
"(",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/rfc2217.py#L623-L637 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/coordinates.py | python | Group.setRobotModel | (self,robotModel) | return | Sets this group to contain all links of a robot model | Sets this group to contain all links of a robot model | [
"Sets",
"this",
"group",
"to",
"contain",
"all",
"links",
"of",
"a",
"robot",
"model"
] | def setRobotModel(self,robotModel):
"""Sets this group to contain all links of a robot model"""
root = self.frames['root']
for i in range(robotModel.numLinks()):
p = robotModel.link(i).getParent()
if p >= 0:
Fp = self.frames[robotModel.link(p).getName()]
... | [
"def",
"setRobotModel",
"(",
"self",
",",
"robotModel",
")",
":",
"root",
"=",
"self",
".",
"frames",
"[",
"'root'",
"]",
"for",
"i",
"in",
"range",
"(",
"robotModel",
".",
"numLinks",
"(",
")",
")",
":",
"p",
"=",
"robotModel",
".",
"link",
"(",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/coordinates.py#L260-L271 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_openpyxl.py | python | _OpenpyxlWriter._convert_to_color | (cls, color_spec) | Convert ``color_spec`` to an openpyxl v2 Color object.
Parameters
----------
color_spec : str, dict
A 32-bit ARGB hex string, or a dict with zero or more of the
following keys.
'rgb'
'indexed'
'auto'
'theme'... | Convert ``color_spec`` to an openpyxl v2 Color object. | [
"Convert",
"color_spec",
"to",
"an",
"openpyxl",
"v2",
"Color",
"object",
"."
] | def _convert_to_color(cls, color_spec):
"""
Convert ``color_spec`` to an openpyxl v2 Color object.
Parameters
----------
color_spec : str, dict
A 32-bit ARGB hex string, or a dict with zero or more of the
following keys.
'rgb'
... | [
"def",
"_convert_to_color",
"(",
"cls",
",",
"color_spec",
")",
":",
"from",
"openpyxl",
".",
"styles",
"import",
"Color",
"if",
"isinstance",
"(",
"color_spec",
",",
"str",
")",
":",
"return",
"Color",
"(",
"color_spec",
")",
"else",
":",
"return",
"Color... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_openpyxl.py#L110-L137 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/autocomp/completer.py | python | BaseCompleter.GetChooseSingle | (self) | return self._choose_single | Get whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@return: bool | Get whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@return: bool | [
"Get",
"whether",
"the",
"completer",
"should",
"automatically",
"choose",
"a",
"selection",
"when",
"there",
"is",
"only",
"one",
"symbol",
"in",
"the",
"completion",
"list",
".",
"@return",
":",
"bool"
] | def GetChooseSingle(self):
"""Get whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@return: bool
"""
return self._choose_single | [
"def",
"GetChooseSingle",
"(",
"self",
")",
":",
"return",
"self",
".",
"_choose_single"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/autocomp/completer.py#L277-L283 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | tools/stats/scribe.py | python | rds_saved_query | (query_names: Union[str, List[str]]) | return invoke_rds(events) | Execute a hardcoded RDS query by name. See
https://github.com/pytorch/test-infra/blob/main/aws/lambda/rds-proxy/lambda_function.py#L52
for available queries or submit a PR there to add a new one. | Execute a hardcoded RDS query by name. See
https://github.com/pytorch/test-infra/blob/main/aws/lambda/rds-proxy/lambda_function.py#L52
for available queries or submit a PR there to add a new one. | [
"Execute",
"a",
"hardcoded",
"RDS",
"query",
"by",
"name",
".",
"See",
"https",
":",
"//",
"github",
".",
"com",
"/",
"pytorch",
"/",
"test",
"-",
"infra",
"/",
"blob",
"/",
"main",
"/",
"aws",
"/",
"lambda",
"/",
"rds",
"-",
"proxy",
"/",
"lambda_... | def rds_saved_query(query_names: Union[str, List[str]]) -> Any:
"""
Execute a hardcoded RDS query by name. See
https://github.com/pytorch/test-infra/blob/main/aws/lambda/rds-proxy/lambda_function.py#L52
for available queries or submit a PR there to add a new one.
"""
if not isinstance(query_name... | [
"def",
"rds_saved_query",
"(",
"query_names",
":",
"Union",
"[",
"str",
",",
"List",
"[",
"str",
"]",
"]",
")",
"->",
"Any",
":",
"if",
"not",
"isinstance",
"(",
"query_names",
",",
"list",
")",
":",
"query_names",
"=",
"[",
"query_names",
"]",
"events... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/stats/scribe.py#L146-L159 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/SimpleHTTPServer.py | python | SimpleHTTPRequestHandler.copyfile | (self, source, outputfile) | Copy all data between two file objects.
The SOURCE argument is a file object open for reading
(or anything with a read() method) and the DESTINATION
argument is a file object open for writing (or
anything with a write() method).
The only reason for overriding this would be to c... | Copy all data between two file objects. | [
"Copy",
"all",
"data",
"between",
"two",
"file",
"objects",
"."
] | def copyfile(self, source, outputfile):
"""Copy all data between two file objects.
The SOURCE argument is a file object open for reading
(or anything with a read() method) and the DESTINATION
argument is a file object open for writing (or
anything with a write() method).
... | [
"def",
"copyfile",
"(",
"self",
",",
"source",
",",
"outputfile",
")",
":",
"shutil",
".",
"copyfileobj",
"(",
"source",
",",
"outputfile",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/SimpleHTTPServer.py#L163-L177 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/ops.py | python | Operation.type | (self) | return self._node_def.op | The type of the op (e.g. `"MatMul"`). | The type of the op (e.g. `"MatMul"`). | [
"The",
"type",
"of",
"the",
"op",
"(",
"e",
".",
"g",
".",
"MatMul",
")",
"."
] | def type(self):
"""The type of the op (e.g. `"MatMul"`)."""
return self._node_def.op | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"self",
".",
"_node_def",
".",
"op"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L1476-L1478 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/sign.py | python | sign.is_atom_convex | (self) | return False | Is the atom convex? | Is the atom convex? | [
"Is",
"the",
"atom",
"convex?"
] | def is_atom_convex(self) -> bool:
"""Is the atom convex?
"""
return False | [
"def",
"is_atom_convex",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"False"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/sign.py#L46-L49 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.validate | ( self, validateTrace=[] ) | Check defined expressions for valid structure, check for infinite recursive definitions. | Check defined expressions for valid structure, check for infinite recursive definitions. | [
"Check",
"defined",
"expressions",
"for",
"valid",
"structure",
"check",
"for",
"infinite",
"recursive",
"definitions",
"."
] | def validate( self, validateTrace=[] ):
"""
Check defined expressions for valid structure, check for infinite recursive definitions.
"""
self.checkRecursion( [] ) | [
"def",
"validate",
"(",
"self",
",",
"validateTrace",
"=",
"[",
"]",
")",
":",
"self",
".",
"checkRecursion",
"(",
"[",
"]",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py#L2167-L2171 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexers.py | python | is_empty_indexer | (indexer, arr_value: np.ndarray) | return False | Check if we have an empty indexer.
Parameters
----------
indexer : object
arr_value : np.ndarray
Returns
-------
bool | Check if we have an empty indexer. | [
"Check",
"if",
"we",
"have",
"an",
"empty",
"indexer",
"."
] | def is_empty_indexer(indexer, arr_value: np.ndarray) -> bool:
"""
Check if we have an empty indexer.
Parameters
----------
indexer : object
arr_value : np.ndarray
Returns
-------
bool
"""
if is_list_like(indexer) and not len(indexer):
return True
if arr_value.nd... | [
"def",
"is_empty_indexer",
"(",
"indexer",
",",
"arr_value",
":",
"np",
".",
"ndarray",
")",
"->",
"bool",
":",
"if",
"is_list_like",
"(",
"indexer",
")",
"and",
"not",
"len",
"(",
"indexer",
")",
":",
"return",
"True",
"if",
"arr_value",
".",
"ndim",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexers.py#L54-L73 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/nntplib.py | python | _NNTPBase.xpath | (self, id) | Process an XPATH command (optional server extension) Arguments:
- id: Message id of article
Returns:
resp: server response if successful
path: directory path to article | Process an XPATH command (optional server extension) Arguments:
- id: Message id of article
Returns:
resp: server response if successful
path: directory path to article | [
"Process",
"an",
"XPATH",
"command",
"(",
"optional",
"server",
"extension",
")",
"Arguments",
":",
"-",
"id",
":",
"Message",
"id",
"of",
"article",
"Returns",
":",
"resp",
":",
"server",
"response",
"if",
"successful",
"path",
":",
"directory",
"path",
"... | def xpath(self, id):
"""Process an XPATH command (optional server extension) Arguments:
- id: Message id of article
Returns:
resp: server response if successful
path: directory path to article
"""
warnings.warn("The XPATH extension is not actively used",
... | [
"def",
"xpath",
"(",
"self",
",",
"id",
")",
":",
"warnings",
".",
"warn",
"(",
"\"The XPATH extension is not actively used\"",
",",
"DeprecationWarning",
",",
"2",
")",
"resp",
"=",
"self",
".",
"_shortcmd",
"(",
"'XPATH {0}'",
".",
"format",
"(",
"id",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/nntplib.py#L853-L871 | ||
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/utils/log.py | python | set_python_log | (loglevel, use_log_file=None, rotateAtRuntime=None) | Redirect the python log to stdio or to a file | Redirect the python log to stdio or to a file | [
"Redirect",
"the",
"python",
"log",
"to",
"stdio",
"or",
"to",
"a",
"file"
] | def set_python_log(loglevel, use_log_file=None, rotateAtRuntime=None):
""" Redirect the python log to stdio or to a file
"""
loglevels = {
0: logging.ERROR,
1: logging.WARNING,
2: logging.INFO,
3: logging.INFO,
4: logging.DEBUG
}
if use_log_file:
if ro... | [
"def",
"set_python_log",
"(",
"loglevel",
",",
"use_log_file",
"=",
"None",
",",
"rotateAtRuntime",
"=",
"None",
")",
":",
"loglevels",
"=",
"{",
"0",
":",
"logging",
".",
"ERROR",
",",
"1",
":",
"logging",
".",
"WARNING",
",",
"2",
":",
"logging",
"."... | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/utils/log.py#L69-L93 | ||
netease-youdao/hex | d7b8773dae8dde63f3807cef1d48c017077db727 | tools/make_hexium.py | python | create_archive | (input_dir, zip_file) | Creates a zip archive of the specified input directory. | Creates a zip archive of the specified input directory. | [
"Creates",
"a",
"zip",
"archive",
"of",
"the",
"specified",
"input",
"directory",
"."
] | def create_archive(input_dir, zip_file):
""" Creates a zip archive of the specified input directory. """
zf = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED)
def addDir(dir):
for f in os.listdir(dir):
full_path = os.path.join(dir, f)
if os.path.isdir(full_path):
addDir(full_path)
... | [
"def",
"create_archive",
"(",
"input_dir",
",",
"zip_file",
")",
":",
"zf",
"=",
"zipfile",
".",
"ZipFile",
"(",
"zip_file",
",",
"'w'",
",",
"zipfile",
".",
"ZIP_DEFLATED",
")",
"def",
"addDir",
"(",
"dir",
")",
":",
"for",
"f",
"in",
"os",
".",
"li... | https://github.com/netease-youdao/hex/blob/d7b8773dae8dde63f3807cef1d48c017077db727/tools/make_hexium.py#L17-L29 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py | python | LayerNormLSTMCell.call | (self, inputs, state) | return m, new_state | Run one step of LSTM.
Args:
inputs: input Tensor, 2D, batch x num_units.
state: this must be a tuple of state Tensors,
both `2-D`, with column sizes `c_state` and
`m_state`.
Returns:
A tuple containing:
- A `2-D, [batch x output_dim]`, Tensor representing the output of ... | Run one step of LSTM. | [
"Run",
"one",
"step",
"of",
"LSTM",
"."
] | def call(self, inputs, state):
"""Run one step of LSTM.
Args:
inputs: input Tensor, 2D, batch x num_units.
state: this must be a tuple of state Tensors,
both `2-D`, with column sizes `c_state` and
`m_state`.
Returns:
A tuple containing:
- A `2-D, [batch x output_dim... | [
"def",
"call",
"(",
"self",
",",
"inputs",
",",
"state",
")",
":",
"sigmoid",
"=",
"math_ops",
".",
"sigmoid",
"(",
"c_prev",
",",
"m_prev",
")",
"=",
"state",
"dtype",
"=",
"inputs",
".",
"dtype",
"input_size",
"=",
"inputs",
".",
"get_shape",
"(",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L2643-L2735 | |
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/dfxml.py | python | fileobjects_dom | (xmlfile=None,imagefile=None,flags=0) | return (doc,ret) | Returns a tuple consisting of (XML,LIST) where XML is the
document of the imagefile's fiwalk and LIST is a list of file
objects extracted from that document. | Returns a tuple consisting of (XML,LIST) where XML is the
document of the imagefile's fiwalk and LIST is a list of file
objects extracted from that document. | [
"Returns",
"a",
"tuple",
"consisting",
"of",
"(",
"XML",
"LIST",
")",
"where",
"XML",
"is",
"the",
"document",
"of",
"the",
"imagefile",
"s",
"fiwalk",
"and",
"LIST",
"is",
"a",
"list",
"of",
"file",
"objects",
"extracted",
"from",
"that",
"document",
".... | def fileobjects_dom(xmlfile=None,imagefile=None,flags=0):
"""Returns a tuple consisting of (XML,LIST) where XML is the
document of the imagefile's fiwalk and LIST is a list of file
objects extracted from that document."""
import xml.dom.minidom
doc = xml.dom.minidom.parseString(xmlfile.read())
... | [
"def",
"fileobjects_dom",
"(",
"xmlfile",
"=",
"None",
",",
"imagefile",
"=",
"None",
",",
"flags",
"=",
"0",
")",
":",
"import",
"xml",
".",
"dom",
".",
"minidom",
"doc",
"=",
"xml",
".",
"dom",
".",
"minidom",
".",
"parseString",
"(",
"xmlfile",
".... | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L1605-L1616 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | SimBody.setCollisionPadding | (self, padding) | return _robotsim.SimBody_setCollisionPadding(self, padding) | setCollisionPadding(SimBody self, double padding)
Sets the collision padding used for contact generation. At 0 padding the
simulation will be unstable for triangle mesh and point cloud geometries. A
larger value is useful to maintain simulation stability for thin or soft
objects. Defa... | setCollisionPadding(SimBody self, double padding) | [
"setCollisionPadding",
"(",
"SimBody",
"self",
"double",
"padding",
")"
] | def setCollisionPadding(self, padding):
"""
setCollisionPadding(SimBody self, double padding)
Sets the collision padding used for contact generation. At 0 padding the
simulation will be unstable for triangle mesh and point cloud geometries. A
larger value is useful to maintain... | [
"def",
"setCollisionPadding",
"(",
"self",
",",
"padding",
")",
":",
"return",
"_robotsim",
".",
"SimBody_setCollisionPadding",
"(",
"self",
",",
"padding",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L8020-L8032 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Build.py | python | InstallContext.run_task_now | (self, tsk, postpone) | This method is called by :py:meth:`waflib.Build.InstallContext.install_files`,
:py:meth:`waflib.Build.InstallContext.install_as` and :py:meth:`waflib.Build.InstallContext.symlink_as` immediately
after the installation task is created. Its role is to force the immediate execution if necessary, that is when
``postp... | This method is called by :py:meth:`waflib.Build.InstallContext.install_files`,
:py:meth:`waflib.Build.InstallContext.install_as` and :py:meth:`waflib.Build.InstallContext.symlink_as` immediately
after the installation task is created. Its role is to force the immediate execution if necessary, that is when
``postp... | [
"This",
"method",
"is",
"called",
"by",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Build",
".",
"InstallContext",
".",
"install_files",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Build",
".",
"InstallContext",
".",
"install_as",
"and",
":",
"py",
"... | def run_task_now(self, tsk, postpone):
"""
This method is called by :py:meth:`waflib.Build.InstallContext.install_files`,
:py:meth:`waflib.Build.InstallContext.install_as` and :py:meth:`waflib.Build.InstallContext.symlink_as` immediately
after the installation task is created. Its role is to force the immediate... | [
"def",
"run_task_now",
"(",
"self",
",",
"tsk",
",",
"postpone",
")",
":",
"tsk",
".",
"post",
"(",
")",
"if",
"not",
"postpone",
":",
"if",
"tsk",
".",
"runnable_status",
"(",
")",
"==",
"Task",
".",
"ASK_LATER",
":",
"raise",
"self",
".",
"WafError... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Build.py#L1042-L1053 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/html_build_viewer.py | python | BuildViewerServer.add_resource_json_file | (self, key, path) | Register a resource JSON file with the server.
The file will be made available under the name/key specified. | Register a resource JSON file with the server. | [
"Register",
"a",
"resource",
"JSON",
"file",
"with",
"the",
"server",
"."
] | def add_resource_json_file(self, key, path):
"""Register a resource JSON file with the server.
The file will be made available under the name/key specified."""
self.json_files[key] = path | [
"def",
"add_resource_json_file",
"(",
"self",
",",
"key",
",",
"path",
")",
":",
"self",
".",
"json_files",
"[",
"key",
"]",
"=",
"path"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/html_build_viewer.py#L104-L108 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events.error | (self, _object=None, _attributes={}, **_arguments) | error: Raise an error
Required argument: anything
Keyword argument number: an error number
Keyword argument partial_result: any partial result occurring before the error
Keyword argument from_: the object that caused the error
Keyword argument to: the desired class for a failed c... | error: Raise an error
Required argument: anything
Keyword argument number: an error number
Keyword argument partial_result: any partial result occurring before the error
Keyword argument from_: the object that caused the error
Keyword argument to: the desired class for a failed c... | [
"error",
":",
"Raise",
"an",
"error",
"Required",
"argument",
":",
"anything",
"Keyword",
"argument",
"number",
":",
"an",
"error",
"number",
"Keyword",
"argument",
"partial_result",
":",
"any",
"partial",
"result",
"occurring",
"before",
"the",
"error",
"Keywor... | def error(self, _object=None, _attributes={}, **_arguments):
"""error: Raise an error
Required argument: anything
Keyword argument number: an error number
Keyword argument partial_result: any partial result occurring before the error
Keyword argument from_: the object that caused... | [
"def",
"error",
"(",
"self",
",",
"_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'err '",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L413-L435 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/sdist.py | python | sdist.read_manifest | (self) | Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution. | Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution. | [
"Read",
"the",
"manifest",
"file",
"(",
"named",
"by",
"self",
".",
"manifest",
")",
"and",
"use",
"it",
"to",
"fill",
"in",
"self",
".",
"filelist",
"the",
"list",
"of",
"files",
"to",
"include",
"in",
"the",
"source",
"distribution",
"."
] | def read_manifest(self):
"""Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution.
"""
log.info("reading manifest file '%s'", self.manifest)
manifest = open(self.manifest, 'rb')
... | [
"def",
"read_manifest",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"\"reading manifest file '%s'\"",
",",
"self",
".",
"manifest",
")",
"manifest",
"=",
"open",
"(",
"self",
".",
"manifest",
",",
"'rb'",
")",
"for",
"line",
"in",
"manifest",
":",
"#... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/sdist.py#L201-L221 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/ConnectionRepository.py | python | ConnectionRepository.disconnect | (self) | Closes the previously-established connection. | Closes the previously-established connection. | [
"Closes",
"the",
"previously",
"-",
"established",
"connection",
"."
] | def disconnect(self):
"""
Closes the previously-established connection.
"""
self.notify.info("Closing connection to server.")
self._serverAddress = ''
CConnectionRepository.disconnect(self)
self.stopReaderPollTask() | [
"def",
"disconnect",
"(",
"self",
")",
":",
"self",
".",
"notify",
".",
"info",
"(",
"\"Closing connection to server.\"",
")",
"self",
".",
"_serverAddress",
"=",
"''",
"CConnectionRepository",
".",
"disconnect",
"(",
"self",
")",
"self",
".",
"stopReaderPollTas... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/ConnectionRepository.py#L522-L529 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.srp_client_get_key_lease_interval | (self) | return self.__parse_int(self.execute_command('srp client keyleaseinterval')) | Get SRP client key lease interval (in seconds). | Get SRP client key lease interval (in seconds). | [
"Get",
"SRP",
"client",
"key",
"lease",
"interval",
"(",
"in",
"seconds",
")",
"."
] | def srp_client_get_key_lease_interval(self) -> int:
"""Get SRP client key lease interval (in seconds)."""
return self.__parse_int(self.execute_command('srp client keyleaseinterval')) | [
"def",
"srp_client_get_key_lease_interval",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"__parse_int",
"(",
"self",
".",
"execute_command",
"(",
"'srp client keyleaseinterval'",
")",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L1143-L1145 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.__reversed__ | (self) | od.__reversed__() <==> reversed(od) | od.__reversed__() <==> reversed(od) | [
"od",
".",
"__reversed__",
"()",
"<",
"==",
">",
"reversed",
"(",
"od",
")"
] | def __reversed__(self):
'od.__reversed__() <==> reversed(od)'
root = self.__root
curr = root[0]
while curr is not root:
yield curr[2]
curr = curr[0] | [
"def",
"__reversed__",
"(",
"self",
")",
":",
"root",
"=",
"self",
".",
"__root",
"curr",
"=",
"root",
"[",
"0",
"]",
"while",
"curr",
"is",
"not",
"root",
":",
"yield",
"curr",
"[",
"2",
"]",
"curr",
"=",
"curr",
"[",
"0",
"]"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/ordered_dict.py#L98-L104 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStrV.__add__ | (self, *args) | return _snap.TStrV___add__(self, *args) | __add__(TStrV self, TStr Val) -> TStrV
Parameters:
Val: TStr const & | __add__(TStrV self, TStr Val) -> TStrV | [
"__add__",
"(",
"TStrV",
"self",
"TStr",
"Val",
")",
"-",
">",
"TStrV"
] | def __add__(self, *args):
"""
__add__(TStrV self, TStr Val) -> TStrV
Parameters:
Val: TStr const &
"""
return _snap.TStrV___add__(self, *args) | [
"def",
"__add__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStrV___add__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19176-L19184 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/depends.py | python | get_module_constant | (module, symbol, default=-1, paths=None) | return extract_constant(code, symbol, default) | Find 'module' by searching 'paths', and extract 'symbol'
Return 'None' if 'module' does not exist on 'paths', or it does not define
'symbol'. If the module defines 'symbol' as a constant, return the
constant. Otherwise, return 'default'. | Find 'module' by searching 'paths', and extract 'symbol' | [
"Find",
"module",
"by",
"searching",
"paths",
"and",
"extract",
"symbol"
] | def get_module_constant(module, symbol, default=-1, paths=None):
"""Find 'module' by searching 'paths', and extract 'symbol'
Return 'None' if 'module' does not exist on 'paths', or it does not define
'symbol'. If the module defines 'symbol' as a constant, return the
constant. Otherwise, return 'defau... | [
"def",
"get_module_constant",
"(",
"module",
",",
"symbol",
",",
"default",
"=",
"-",
"1",
",",
"paths",
"=",
"None",
")",
":",
"try",
":",
"f",
",",
"path",
",",
"(",
"suffix",
",",
"mode",
",",
"kind",
")",
"=",
"find_module",
"(",
"module",
",",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/depends.py#L101-L132 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/struct.py | python | NamedStruct.as_dict | (self) | return {attr: getattr(self, attr) for attr in self._attributes} | Returns a key-value dict for all attributes. | Returns a key-value dict for all attributes. | [
"Returns",
"a",
"key",
"-",
"value",
"dict",
"for",
"all",
"attributes",
"."
] | def as_dict(self):
"""
Returns a key-value dict for all attributes.
"""
# pylint: disable=not-an-iterable
return {attr: getattr(self, attr) for attr in self._attributes} | [
"def",
"as_dict",
"(",
"self",
")",
":",
"# pylint: disable=not-an-iterable",
"return",
"{",
"attr",
":",
"getattr",
"(",
"self",
",",
"attr",
")",
"for",
"attr",
"in",
"self",
".",
"_attributes",
"}"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/struct.py#L185-L190 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/proc.py | python | run_psimrcc_scf | (name, **kwargs) | return psimrcc_wfn | Function encoding sequence of PSI module calls for a PSIMRCC computation
using a reference from the SCF module | Function encoding sequence of PSI module calls for a PSIMRCC computation
using a reference from the SCF module | [
"Function",
"encoding",
"sequence",
"of",
"PSI",
"module",
"calls",
"for",
"a",
"PSIMRCC",
"computation",
"using",
"a",
"reference",
"from",
"the",
"SCF",
"module"
] | def run_psimrcc_scf(name, **kwargs):
"""Function encoding sequence of PSI module calls for a PSIMRCC computation
using a reference from the SCF module
"""
# Bypass the scf call if a reference wavefunction is given
ref_wfn = kwargs.get('ref_wfn', None)
if ref_wfn is None:
ref_wfn = scf_... | [
"def",
"run_psimrcc_scf",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"# Bypass the scf call if a reference wavefunction is given",
"ref_wfn",
"=",
"kwargs",
".",
"get",
"(",
"'ref_wfn'",
",",
"None",
")",
"if",
"ref_wfn",
"is",
"None",
":",
"ref_wfn",
"=",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L4216-L4232 | |
facebook/fboss | 60063db1df37c2ec0e7dcd0955c54885ea9bf7f0 | build/fbcode_builder/CMake/make_fbpy_archive.py | python | build_zipapp | (args, path_map) | Create a self executing python binary using Python 3's built-in
zipapp module.
This type of Python binary is relatively simple, as zipapp is part of the
standard library, but it does not support native language extensions
(.so/.dll files). | Create a self executing python binary using Python 3's built-in
zipapp module. | [
"Create",
"a",
"self",
"executing",
"python",
"binary",
"using",
"Python",
"3",
"s",
"built",
"-",
"in",
"zipapp",
"module",
"."
] | def build_zipapp(args, path_map):
"""Create a self executing python binary using Python 3's built-in
zipapp module.
This type of Python binary is relatively simple, as zipapp is part of the
standard library, but it does not support native language extensions
(.so/.dll files).
"""
dest_dir =... | [
"def",
"build_zipapp",
"(",
"args",
",",
"path_map",
")",
":",
"dest_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"args",
".",
"output",
")",
"with",
"tempfile",
".",
"TemporaryDirectory",
"(",
"prefix",
"=",
"\"make_fbpy.\"",
",",
"dir",
"=",
"des... | https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/build/fbcode_builder/CMake/make_fbpy_archive.py#L126-L143 | ||
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | caffe/python/caffe/coord_map.py | python | coord_map_from_to | (top_from, top_to) | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | [
"Determine",
"the",
"coordinate",
"mapping",
"betweeen",
"a",
"top",
"(",
"from",
")",
"and",
"a",
"top",
"(",
"to",
")",
".",
"Walk",
"the",
"graph",
"to",
"find",
"a",
"common",
"ancestor",
"while",
"composing",
"the",
"coord",
"maps",
"for",
"from",
... | def coord_map_from_to(top_from, top_to):
"""
Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted.
"""
# We need to find a common anc... | [
"def",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
":",
"# We need to find a common ancestor of top_from and top_to.",
"# We'll assume that all ancestors are equivalent here (otherwise the graph",
"# is an inconsistent state (which we could improve this to check for)).",
"# For n... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/caffe/python/caffe/coord_map.py#L115-L169 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/refactor.py | python | RefactoringTool.refactor_file | (self, filename, write=False, doctests_only=False) | Refactors a file. | Refactors a file. | [
"Refactors",
"a",
"file",
"."
] | def refactor_file(self, filename, write=False, doctests_only=False):
"""Refactors a file."""
input, encoding = self._read_python_source(filename)
if input is None:
# Reading the file failed.
return
input += "\n" # Silence certain parse errors
if doctests_o... | [
"def",
"refactor_file",
"(",
"self",
",",
"filename",
",",
"write",
"=",
"False",
",",
"doctests_only",
"=",
"False",
")",
":",
"input",
",",
"encoding",
"=",
"self",
".",
"_read_python_source",
"(",
"filename",
")",
"if",
"input",
"is",
"None",
":",
"# ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/refactor.py#L320-L341 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | python | ExpandWildcardDependencies | (targets, data) | Expands dependencies specified as build_file:*.
For each target in |targets|, examines sections containing links to other
targets. If any such section contains a link of the form build_file:*, it
is taken as a wildcard link, and is expanded to list each target in
build_file. The |data| dict provides access t... | Expands dependencies specified as build_file:*. | [
"Expands",
"dependencies",
"specified",
"as",
"build_file",
":",
"*",
"."
] | def ExpandWildcardDependencies(targets, data):
"""Expands dependencies specified as build_file:*.
For each target in |targets|, examines sections containing links to other
targets. If any such section contains a link of the form build_file:*, it
is taken as a wildcard link, and is expanded to list each targ... | [
"def",
"ExpandWildcardDependencies",
"(",
"targets",
",",
"data",
")",
":",
"for",
"target",
",",
"target_dict",
"in",
"targets",
".",
"items",
"(",
")",
":",
"target_build_file",
"=",
"gyp",
".",
"common",
".",
"BuildFile",
"(",
"target",
")",
"for",
"dep... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py#L1528-L1607 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/roundinghelper.py | python | declare_rounding_property | (o) | Declares the properties needed for rounding. | Declares the properties needed for rounding. | [
"Declares",
"the",
"properties",
"needed",
"for",
"rounding",
"."
] | def declare_rounding_property(o):
'''
Declares the properties needed for rounding.
'''
rounding = StringListValidator()
rounding.addAllowedValue(ROUNDING_NONE)
rounding.addAllowedValue(ROUNDING_TEN_TO_INT)
o.declareProperty(name=PROP_NAME_ROUNDING_MODE,
defaultValue=ROU... | [
"def",
"declare_rounding_property",
"(",
"o",
")",
":",
"rounding",
"=",
"StringListValidator",
"(",
")",
"rounding",
".",
"addAllowedValue",
"(",
"ROUNDING_NONE",
")",
"rounding",
".",
"addAllowedValue",
"(",
"ROUNDING_TEN_TO_INT",
")",
"o",
".",
"declareProperty",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/roundinghelper.py#L24-L33 | ||
freelan-developers/freelan | 779a1421adbbfa35568cea9b212d1ba0635570e1 | packaging/osx/pkgbuild.py | python | pkgbuild_generator | (target, source, env, for_signature) | return '{executable} {options_str} --root $SOURCE $TARGET'.format(
executable=env['PKGBUILD'],
options_str=options_str,
) | The generator | The generator | [
"The",
"generator"
] | def pkgbuild_generator(target, source, env, for_signature):
"""The generator"""
options = env['PKGBUILD_OPTIONS'].value
options_str = ' '.join(
'--%s %s' % (key, value)
for key, value in options.items()
)
if env['PKGBUILD_SCRIPTS']:
options_str = options_str + ' --scripts $... | [
"def",
"pkgbuild_generator",
"(",
"target",
",",
"source",
",",
"env",
",",
"for_signature",
")",
":",
"options",
"=",
"env",
"[",
"'PKGBUILD_OPTIONS'",
"]",
".",
"value",
"options_str",
"=",
"' '",
".",
"join",
"(",
"'--%s %s'",
"%",
"(",
"key",
",",
"v... | https://github.com/freelan-developers/freelan/blob/779a1421adbbfa35568cea9b212d1ba0635570e1/packaging/osx/pkgbuild.py#L16-L31 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/misc/shapeformat.py | python | guess_utm_from_coord | (coord) | return "+proj=utm +zone=%d +ellps=WGS84 +datum=WGS84 +units=m +no_defs" % zone | Returns UTM projection parameters from an example point
with coord = (lat,lon) | Returns UTM projection parameters from an example point
with coord = (lat,lon) | [
"Returns",
"UTM",
"projection",
"parameters",
"from",
"an",
"example",
"point",
"with",
"coord",
"=",
"(",
"lat",
"lon",
")"
] | def guess_utm_from_coord(coord):
"""
Returns UTM projection parameters from an example point
with coord = (lat,lon)
"""
zone = get_zone(coord)
return "+proj=utm +zone=%d +ellps=WGS84 +datum=WGS84 +units=m +no_defs" % zone | [
"def",
"guess_utm_from_coord",
"(",
"coord",
")",
":",
"zone",
"=",
"get_zone",
"(",
"coord",
")",
"return",
"\"+proj=utm +zone=%d +ellps=WGS84 +datum=WGS84 +units=m +no_defs\"",
"%",
"zone"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/misc/shapeformat.py#L120-L126 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | URI.fragment | (self) | return ret | Get the fragment part from an URI | Get the fragment part from an URI | [
"Get",
"the",
"fragment",
"part",
"from",
"an",
"URI"
] | def fragment(self):
"""Get the fragment part from an URI """
ret = libxml2mod.xmlURIGetFragment(self._o)
return ret | [
"def",
"fragment",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlURIGetFragment",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6974-L6977 | |
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/BasicPlace.py | python | BasicPlace.load | (self, params, placedb, filename) | @brief dump intermediate solution as compressed pickle file (.pklz)
@param params parameters
@param placedb placement database
@param iteration optimization step
@param pos locations of cells
@param filename output file name | [] | def load(self, params, placedb, filename):
"""
@brief dump intermediate solution as compressed pickle file (.pklz)
@param params parameters
@param placedb placement database
@param iteration optimization step
@param pos locations of cells
@param filename output fi... | [
"def",
"load",
"(",
"self",
",",
"params",
",",
"placedb",
",",
"filename",
")",
":",
"with",
"gzip",
".",
"open",
"(",
"filename",
",",
"\"rb\"",
")",
"as",
"f",
":",
"data",
"=",
"pickle",
".",
"load",
"(",
"f",
")",
"self",
".",
"data_collection... | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/BasicPlace.py#L1064-L1111 | |||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Menu.add_cascade | (self, cnf={}, **kw) | Add hierarchical menu item. | Add hierarchical menu item. | [
"Add",
"hierarchical",
"menu",
"item",
"."
] | def add_cascade(self, cnf={}, **kw):
"""Add hierarchical menu item."""
self.add('cascade', cnf or kw) | [
"def",
"add_cascade",
"(",
"self",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"add",
"(",
"'cascade'",
",",
"cnf",
"or",
"kw",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2879-L2881 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/aio/_server.py | python | Server.add_secure_port | (self, address: str,
server_credentials: grpc.ServerCredentials) | return _common.validate_port_binding_result(
address,
self._server.add_secure_port(_common.encode(address),
server_credentials)) | Opens a secure port for accepting RPCs.
This method may only be called before starting the server.
Args:
address: The address for which to open a port.
if the port is 0, or not specified in the address, then the gRPC
runtime will choose a port.
server_creden... | Opens a secure port for accepting RPCs. | [
"Opens",
"a",
"secure",
"port",
"for",
"accepting",
"RPCs",
"."
] | def add_secure_port(self, address: str,
server_credentials: grpc.ServerCredentials) -> int:
"""Opens a secure port for accepting RPCs.
This method may only be called before starting the server.
Args:
address: The address for which to open a port.
i... | [
"def",
"add_secure_port",
"(",
"self",
",",
"address",
":",
"str",
",",
"server_credentials",
":",
"grpc",
".",
"ServerCredentials",
")",
"->",
"int",
":",
"return",
"_common",
".",
"validate_port_binding_result",
"(",
"address",
",",
"self",
".",
"_server",
"... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_server.py#L87-L105 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/protocol.py | python | TelnetProtocolParser._parse_coroutine | (self) | Parser state machine.
Every 'yield' expression returns the next byte. | Parser state machine.
Every 'yield' expression returns the next byte. | [
"Parser",
"state",
"machine",
".",
"Every",
"yield",
"expression",
"returns",
"the",
"next",
"byte",
"."
] | def _parse_coroutine(self) -> Generator[None, bytes, None]:
"""
Parser state machine.
Every 'yield' expression returns the next byte.
"""
while True:
d = yield
if d == int2byte(0):
pass # NOP
# Go to state escaped.
... | [
"def",
"_parse_coroutine",
"(",
"self",
")",
"->",
"Generator",
"[",
"None",
",",
"bytes",
",",
"None",
"]",
":",
"while",
"True",
":",
"d",
"=",
"yield",
"if",
"d",
"==",
"int2byte",
"(",
"0",
")",
":",
"pass",
"# NOP",
"# Go to state escaped.",
"elif... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/protocol.py#L154-L200 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/elastic/multiprocessing/redirects.py | python | redirect | (std: str, to_file: str) | Redirects ``std`` (one of ``"stdout"`` or ``"stderr"``) to a file
in the path specified by ``to_file``. This method redirects the
underlying std file descriptor (not just pyton's ``sys.stdout|stderr``).
See usage for details.
Directory of ``dst_filename`` is assumed to exist and the destination file
... | Redirects ``std`` (one of ``"stdout"`` or ``"stderr"``) to a file
in the path specified by ``to_file``. This method redirects the
underlying std file descriptor (not just pyton's ``sys.stdout|stderr``).
See usage for details. | [
"Redirects",
"std",
"(",
"one",
"of",
"stdout",
"or",
"stderr",
")",
"to",
"a",
"file",
"in",
"the",
"path",
"specified",
"by",
"to_file",
".",
"This",
"method",
"redirects",
"the",
"underlying",
"std",
"file",
"descriptor",
"(",
"not",
"just",
"pyton",
... | def redirect(std: str, to_file: str):
"""
Redirects ``std`` (one of ``"stdout"`` or ``"stderr"``) to a file
in the path specified by ``to_file``. This method redirects the
underlying std file descriptor (not just pyton's ``sys.stdout|stderr``).
See usage for details.
Directory of ``dst_filename... | [
"def",
"redirect",
"(",
"std",
":",
"str",
",",
"to_file",
":",
"str",
")",
":",
"if",
"std",
"not",
"in",
"_VALID_STD",
":",
"raise",
"ValueError",
"(",
"f\"unknown standard stream <{std}>, must be one of {_VALID_STD}\"",
")",
"c_std",
"=",
"_c_std",
"(",
"std"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/multiprocessing/redirects.py#L50-L97 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/controlflow.py | python | ControlFlowAnalysis.iterliveblocks | (self) | Return all live blocks in sequence of occurrence | Return all live blocks in sequence of occurrence | [
"Return",
"all",
"live",
"blocks",
"in",
"sequence",
"of",
"occurrence"
] | def iterliveblocks(self):
"""
Return all live blocks in sequence of occurrence
"""
for i in self.blockseq:
if i in self.liveblocks:
yield self.blocks[i] | [
"def",
"iterliveblocks",
"(",
"self",
")",
":",
"for",
"i",
"in",
"self",
".",
"blockseq",
":",
"if",
"i",
"in",
"self",
".",
"liveblocks",
":",
"yield",
"self",
".",
"blocks",
"[",
"i",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/controlflow.py#L660-L666 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/rook/rook_cluster.py | python | KubernetesResource._fetch | (self) | return metadata.resource_version | Execute the requested api method as a one-off fetch | Execute the requested api method as a one-off fetch | [
"Execute",
"the",
"requested",
"api",
"method",
"as",
"a",
"one",
"-",
"off",
"fetch"
] | def _fetch(self) -> str:
""" Execute the requested api method as a one-off fetch"""
response = self.api_func(**self.kwargs)
metadata = response.metadata
self._items = {item.metadata.name: item for item in response.items}
log.info('Full fetch of {}. result: {}'.format(self.api_fun... | [
"def",
"_fetch",
"(",
"self",
")",
"->",
"str",
":",
"response",
"=",
"self",
".",
"api_func",
"(",
"*",
"*",
"self",
".",
"kwargs",
")",
"metadata",
"=",
"response",
".",
"metadata",
"self",
".",
"_items",
"=",
"{",
"item",
".",
"metadata",
".",
"... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/rook/rook_cluster.py#L240-L246 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | Expression.isConstant | (self) | Returns true if this expression is identically a constant. If so,
then the expression can be safely replaced with its evalf() value
without any possible change in meaning. | Returns true if this expression is identically a constant. If so,
then the expression can be safely replaced with its evalf() value
without any possible change in meaning. | [
"Returns",
"true",
"if",
"this",
"expression",
"is",
"identically",
"a",
"constant",
".",
"If",
"so",
"then",
"the",
"expression",
"can",
"be",
"safely",
"replaced",
"with",
"its",
"evalf",
"()",
"value",
"without",
"any",
"possible",
"change",
"in",
"meanin... | def isConstant(self):
"""Returns true if this expression is identically a constant. If so,
then the expression can be safely replaced with its evalf() value
without any possible change in meaning.
"""
raise NotImplementedError() | [
"def",
"isConstant",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L2537-L2542 | ||
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | scripts/cpp_lint.py | python | _VerboseLevel | () | return _cpplint_state.verbose_level | Returns the module's verbosity setting. | Returns the module's verbosity setting. | [
"Returns",
"the",
"module",
"s",
"verbosity",
"setting",
"."
] | def _VerboseLevel():
"""Returns the module's verbosity setting."""
return _cpplint_state.verbose_level | [
"def",
"_VerboseLevel",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"verbose_level"
] | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L777-L779 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.