Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
get_global_namespace
(decls)
Get the global namespace (::) from a declaration tree. Args: decls (list[declaration_t]): a list of declarations Returns: namespace_t: the global namespace_t object (::)
Get the global namespace (::) from a declaration tree.
def get_global_namespace(decls): """ Get the global namespace (::) from a declaration tree. Args: decls (list[declaration_t]): a list of declarations Returns: namespace_t: the global namespace_t object (::) """ found = [ decl for decl in scopedef.make_flatten(decls) if...
[ "def", "get_global_namespace", "(", "decls", ")", ":", "found", "=", "[", "decl", "for", "decl", "in", "scopedef", ".", "make_flatten", "(", "decls", ")", "if", "decl", ".", "name", "==", "'::'", "and", "isinstance", "(", "decl", ",", "namespace_t", ")",...
[ 337, 0 ]
[ 353, 58 ]
python
en
['en', 'error', 'th']
False
namespace_t.__init__
(self, name='', declarations=None)
Creates an object that describes a C++ namespace declaration. Args: name (str): name of the namespace declarations (list[declaration_t]): list of declarations
Creates an object that describes a C++ namespace declaration.
def __init__(self, name='', declarations=None): """ Creates an object that describes a C++ namespace declaration. Args: name (str): name of the namespace declarations (list[declaration_t]): list of declarations """ scopedef.scopedef_t.__init__(self, name...
[ "def", "__init__", "(", "self", ",", "name", "=", "''", ",", "declarations", "=", "None", ")", ":", "scopedef", ".", "scopedef_t", ".", "__init__", "(", "self", ",", "name", ")", "if", "not", "declarations", ":", "declarations", "=", "[", "]", "# List ...
[ 22, 4 ]
[ 35, 41 ]
python
en
['en', 'error', 'th']
False
namespace_t._get__cmp__scope_items
(self)
Implementation detail.
Implementation detail.
def _get__cmp__scope_items(self): """ Implementation detail. """ return [self.declarations.sort()]
[ "def", "_get__cmp__scope_items", "(", "self", ")", ":", "return", "[", "self", ".", "declarations", ".", "sort", "(", ")", "]" ]
[ 43, 4 ]
[ 48, 41 ]
python
en
['en', 'error', 'th']
False
namespace_t.declarations
(self)
List of children declarations. Returns: list[declaration_t]
List of children declarations.
def declarations(self): """ List of children declarations. Returns: list[declaration_t] """ return scopedef.scopedef_t.declarations.fget(self)
[ "def", "declarations", "(", "self", ")", ":", "return", "scopedef", ".", "scopedef_t", ".", "declarations", ".", "fget", "(", "self", ")" ]
[ 54, 4 ]
[ 61, 58 ]
python
en
['en', 'error', 'th']
False
namespace_t.declarations
(self, declarations)
Set list of all declarations defined in the namespace. Args: declarations (list[declaration_t]): list of declarations
Set list of all declarations defined in the namespace.
def declarations(self, declarations): """ Set list of all declarations defined in the namespace. Args: declarations (list[declaration_t]): list of declarations """ self._declarations = declarations
[ "def", "declarations", "(", "self", ",", "declarations", ")", ":", "self", ".", "_declarations", "=", "declarations" ]
[ 64, 4 ]
[ 72, 41 ]
python
en
['en', 'error', 'th']
False
namespace_t.take_parenting
(self, inst)
Takes parenting from inst and transfers it to self. Args: inst (namespace_t): a namespace declaration
Takes parenting from inst and transfers it to self.
def take_parenting(self, inst): """ Takes parenting from inst and transfers it to self. Args: inst (namespace_t): a namespace declaration """ if self is inst: return for decl in inst.declarations: decl.parent = self self....
[ "def", "take_parenting", "(", "self", ",", "inst", ")", ":", "if", "self", "is", "inst", ":", "return", "for", "decl", "in", "inst", ".", "declarations", ":", "decl", ".", "parent", "=", "self", "self", ".", "declarations", ".", "append", "(", "decl", ...
[ 74, 4 ]
[ 88, 30 ]
python
en
['en', 'error', 'th']
False
namespace_t.remove_declaration
(self, decl)
Removes declaration from members list. :param decl: declaration to be removed :type decl: :class:`declaration_t`
Removes declaration from members list.
def remove_declaration(self, decl): """ Removes declaration from members list. :param decl: declaration to be removed :type decl: :class:`declaration_t` """ del self.declarations[self.declarations.index(decl)] decl.cache.reset()
[ "def", "remove_declaration", "(", "self", ",", "decl", ")", ":", "del", "self", ".", "declarations", "[", "self", ".", "declarations", ".", "index", "(", "decl", ")", "]", "decl", ".", "cache", ".", "reset", "(", ")" ]
[ 95, 4 ]
[ 105, 26 ]
python
en
['en', 'error', 'th']
False
namespace_t.namespace
(self, name=None, function=None, recursive=None)
Returns reference to namespace declaration that matches a defined criteria.
Returns reference to namespace declaration that matches a defined criteria.
def namespace(self, name=None, function=None, recursive=None): """ Returns reference to namespace declaration that matches a defined criteria. """ return ( self._find_single( scopedef.scopedef_t._impl_matchers[namespace_t.namespace], ...
[ "def", "namespace", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "recursive", "=", "None", ")", ":", "return", "(", "self", ".", "_find_single", "(", "scopedef", ".", "scopedef_t", ".", "_impl_matchers", "[", "namespace_t", "...
[ 110, 4 ]
[ 123, 9 ]
python
en
['en', 'error', 'th']
False
namespace_t.namespaces
( self, name=None, function=None, recursive=None, allow_empty=None)
Returns a set of namespace declarations that match a defined criteria.
Returns a set of namespace declarations that match a defined criteria.
def namespaces( self, name=None, function=None, recursive=None, allow_empty=None): """ Returns a set of namespace declarations that match a defined criteria. """ return ( self._find_multiple( ...
[ "def", "namespaces", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "recursive", "=", "None", ",", "allow_empty", "=", "None", ")", ":", "return", "(", "self", ".", "_find_multiple", "(", "scopedef", ".", "scopedef_t", ".", "...
[ 125, 4 ]
[ 144, 9 ]
python
en
['en', 'error', 'th']
False
namespace_t.nss
(self, name=None, function=None, recursive=None, allow_empty=None)
Deprecated method. Use the namespaces() method instead. Deprecated since v1.9.0. Will be removed in v2.0.0
Deprecated method. Use the namespaces() method instead.
def nss(self, name=None, function=None, recursive=None, allow_empty=None): """ Deprecated method. Use the namespaces() method instead. Deprecated since v1.9.0. Will be removed in v2.0.0 """ warnings.warn( "The nss() method is deprecated. \n" + "Please use...
[ "def", "nss", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "recursive", "=", "None", ",", "allow_empty", "=", "None", ")", ":", "warnings", ".", "warn", "(", "\"The nss() method is deprecated. \\n\"", "+", "\"Please use the namespa...
[ 146, 4 ]
[ 157, 70 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_function
( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)
Returns reference to free function declaration that matches a defined criteria.
Returns reference to free function declaration that matches a defined criteria.
def free_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None): """ Returns reference to free function declaration that matches ...
[ "def", "free_function", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ",", "recursive", "=", "None", ...
[ 159, 4 ]
[ 185, 9 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_fun
( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)
Deprecated method. Use the free_function() method instead. Deprecated since v1.9.0. Will be removed in v2.0.0
Deprecated method. Use the free_function() method instead.
def free_fun( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None): """ Deprecated method. Use the free_function() method instead. Depr...
[ "def", "free_fun", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ",", "recursive", "=", "None", ")",...
[ 187, 4 ]
[ 210, 22 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_functions
( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)
Returns a set of free function declarations that match a defined criteria.
Returns a set of free function declarations that match a defined criteria.
def free_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None): """ Returns a set of free function decla...
[ "def", "free_functions", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ",", "recursive", "=", "None", ...
[ 212, 4 ]
[ 240, 9 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_funs
( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)
Deprecated method. Use the free_functions() method instead. Deprecated since v1.9.0. Will be removed in v2.0.0
Deprecated method. Use the free_functions() method instead.
def free_funs( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None): """ Deprecated method. Use the free_functions...
[ "def", "free_funs", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ",", "recursive", "=", "None", ","...
[ 242, 4 ]
[ 266, 35 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_operator
( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)
Returns reference to free operator declaration that matches a defined criteria.
Returns reference to free operator declaration that matches a defined criteria.
def free_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None): """ Returns reference to free operator declara...
[ "def", "free_operator", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "symbol", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ",...
[ 268, 4 ]
[ 295, 9 ]
python
en
['en', 'error', 'th']
False
namespace_t.free_operators
( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)
Returns a set of free operator declarations that match a defined criteria.
Returns a set of free operator declarations that match a defined criteria.
def free_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None): """ Returns a s...
[ "def", "free_operators", "(", "self", ",", "name", "=", "None", ",", "function", "=", "None", ",", "symbol", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", "...
[ 297, 4 ]
[ 327, 9 ]
python
en
['en', 'error', 'th']
False
WinTool._UseSeparateMspdbsrv
(self, env, args)
Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.
Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.
def _UseSeparateMspdbsrv(self, env, args): """Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.""" if len(args) < 1: raise Exception("Not enough arguments") if args[0] != 'link.exe': return # Use the output filename passed to the linker to generate an ...
[ "def", "_UseSeparateMspdbsrv", "(", "self", ",", "env", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "raise", "Exception", "(", "\"Not enough arguments\"", ")", "if", "args", "[", "0", "]", "!=", "'link.exe'", ":", "return", "# ...
[ 36, 2 ]
[ 61, 46 ]
python
en
['en', 'en', 'en']
True
WinTool.Dispatch
(self, args)
Dispatches a string command to a method.
Dispatches a string command to a method.
def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) return getattr(self, method)(*args[1:])
[ "def", "Dispatch", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "raise", "Exception", "(", "\"Not enough arguments\"", ")", "method", "=", "\"Exec%s\"", "%", "self", ".", "_CommandifyName", "(", "args", "[", "0", "]...
[ 63, 2 ]
[ 69, 43 ]
python
en
['en', 'en', 'en']
True
WinTool._CommandifyName
(self, name_string)
Transforms a tool name like recursive-mirror to RecursiveMirror.
Transforms a tool name like recursive-mirror to RecursiveMirror.
def _CommandifyName(self, name_string): """Transforms a tool name like recursive-mirror to RecursiveMirror.""" return name_string.title().replace('-', '')
[ "def", "_CommandifyName", "(", "self", ",", "name_string", ")", ":", "return", "name_string", ".", "title", "(", ")", ".", "replace", "(", "'-'", ",", "''", ")" ]
[ 71, 2 ]
[ 73, 47 ]
python
en
['en', 'el-Latn', 'en']
True
WinTool._GetEnv
(self, arch)
Gets the saved environment from a file for a given architecture.
Gets the saved environment from a file for a given architecture.
def _GetEnv(self, arch): """Gets the saved environment from a file for a given architecture.""" # The environment is saved as an "environment block" (see CreateProcess # and msvs_emulation for details). We convert to a dict here. # Drop last 2 NULs, one for list terminator, one for trailing vs. separato...
[ "def", "_GetEnv", "(", "self", ",", "arch", ")", ":", "# The environment is saved as an \"environment block\" (see CreateProcess", "# and msvs_emulation for details). We convert to a dict here.", "# Drop last 2 NULs, one for list terminator, one for trailing vs. separator.", "pairs", "=", ...
[ 75, 2 ]
[ 82, 20 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecStamp
(self, path)
Simple stamp command.
Simple stamp command.
def ExecStamp(self, path): """Simple stamp command.""" open(path, 'w').close()
[ "def", "ExecStamp", "(", "self", ",", "path", ")", ":", "open", "(", "path", ",", "'w'", ")", ".", "close", "(", ")" ]
[ 84, 2 ]
[ 86, 27 ]
python
en
['et', 'en', 'en']
True
WinTool.ExecRecursiveMirror
(self, source, dest)
Emulation of rm -rf out && cp -af in out.
Emulation of rm -rf out && cp -af in out.
def ExecRecursiveMirror(self, source, dest): """Emulation of rm -rf out && cp -af in out.""" if os.path.exists(dest): if os.path.isdir(dest): def _on_error(fn, path, excinfo): # The operation failed, possibly because the file is set to # read-only. If that's why, make it writab...
[ "def", "ExecRecursiveMirror", "(", "self", ",", "source", ",", "dest", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "dest", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "dest", ")", ":", "def", "_on_error", "(", "fn", ",", "pat...
[ 88, 2 ]
[ 108, 32 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecLinkWrapper
(self, arch, use_separate_mspdbsrv, *args)
Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe.
Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe.
def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): """Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe. """ env = self._GetEnv(arch) if use_separate_mspdbsrv == 'True': ...
[ "def", "ExecLinkWrapper", "(", "self", ",", "arch", ",", "use_separate_mspdbsrv", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "if", "use_separate_mspdbsrv", "==", "'True'", ":", "self", ".", "_UseSeparateMspdbsrv", "(", ...
[ 110, 2 ]
[ 129, 26 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecLinkWithManifests
(self, arch, embed_manifest, out, ldcmd, resname, mt, rc, intermediate_manifest, *manifests)
A wrapper for handling creating a manifest resource and then executing a link command.
A wrapper for handling creating a manifest resource and then executing a link command.
def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, mt, rc, intermediate_manifest, *manifests): """A wrapper for handling creating a manifest resource and then executing a link command.""" # The 'normal' way to do manifests is to have link generate a manife...
[ "def", "ExecLinkWithManifests", "(", "self", ",", "arch", ",", "embed_manifest", ",", "out", ",", "ldcmd", ",", "resname", ",", "mt", ",", "rc", ",", "intermediate_manifest", ",", "*", "manifests", ")", ":", "# The 'normal' way to do manifests is to have link genera...
[ 131, 2 ]
[ 205, 16 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecManifestWrapper
(self, arch, *args)
Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).
Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).
def ExecManifestWrapper(self, arch, *args): """Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, ...
[ "def", "ExecManifestWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "popen", "=", "subprocess", ".", "Popen", "(", "args", ",", "shell", "=", "True", ",", "env", "=", "env", ",",...
[ 207, 2 ]
[ 218, 27 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecManifestToRc
(self, arch, *args)
Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).
Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).
def ExecManifestToRc(self, arch, *args): """Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).""" manifest_path, resource_path, resource_name = args ...
[ "def", "ExecManifestToRc", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "manifest_path", ",", "resource_path", ",", "resource_name", "=", "args", "with", "open", "(", "resource_path", ",", "'wb'", ")", "as", "output", ":", "output", ".", "write", ...
[ 220, 2 ]
[ 228, 59 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecMidlWrapper
(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags)
Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags.
Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags.
def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): """Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags. """ args = ['midl', '/nologo'] + list(flags) + [ '/out', outdir, '/tlb', tlb, ...
[ "def", "ExecMidlWrapper", "(", "self", ",", "arch", ",", "outdir", ",", "tlb", ",", "h", ",", "dlldata", ",", "iid", ",", "proxy", ",", "idl", ",", "*", "flags", ")", ":", "args", "=", "[", "'midl'", ",", "'/nologo'", "]", "+", "list", "(", "flag...
[ 230, 2 ]
[ 258, 27 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecAsmWrapper
(self, arch, *args)
Filter logo banner from invocations of asm.exe.
Filter logo banner from invocations of asm.exe.
def ExecAsmWrapper(self, arch, *args): """Filter logo banner from invocations of asm.exe.""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() for line in out.splitl...
[ "def", "ExecAsmWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "popen", "=", "subprocess", ".", "Popen", "(", "args", ",", "shell", "=", "True", ",", "env", "=", "env", ",", "s...
[ 260, 2 ]
[ 272, 27 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecRcWrapper
(self, arch, *args)
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
def ExecRcWrapper(self, arch, *args): """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ...
[ "def", "ExecRcWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "popen", "=", "subprocess", ".", "Popen", "(", "args", ",", "shell", "=", "True", ",", "env", "=", "env", ",", "st...
[ 274, 2 ]
[ 286, 27 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecActionWrapper
(self, arch, rspfile, *dir)
Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.
Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.
def ExecActionWrapper(self, arch, rspfile, *dir): """Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.""" env = self._GetEnv(arch) # TODO(scottmg): This is a temporary hack to get some specific variables # thro...
[ "def", "ExecActionWrapper", "(", "self", ",", "arch", ",", "rspfile", ",", "*", "dir", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "# TODO(scottmg): This is a temporary hack to get some specific variables", "# through to actions that are set after gyp-...
[ 288, 2 ]
[ 299, 62 ]
python
en
['en', 'en', 'en']
True
WinTool.ExecClCompile
(self, project_dir, selected_files)
Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.
Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.
def ExecClCompile(self, project_dir, selected_files): """Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.""" project_dir = os.path.relpath(project_dir, BASE_DIR) selected_files = selected_files.split(';') ninja_targets = [os.path.join(project_dir, fi...
[ "def", "ExecClCompile", "(", "self", ",", "project_dir", ",", "selected_files", ")", ":", "project_dir", "=", "os", ".", "path", ".", "relpath", "(", "project_dir", ",", "BASE_DIR", ")", "selected_files", "=", "selected_files", ".", "split", "(", "';'", ")",...
[ 301, 2 ]
[ 310, 57 ]
python
en
['en', 'en', 'en']
True
_objdump_lexer_tokens
(asm_lexer)
Common objdump lexer tokens to wrap an ASM lexer.
Common objdump lexer tokens to wrap an ASM lexer.
def _objdump_lexer_tokens(asm_lexer): """ Common objdump lexer tokens to wrap an ASM lexer. """ hex_re = r'[0-9A-Za-z]' return { 'root': [ # File name & format: ('(.*?)(:)( +file format )(.*?)$', bygroups(Name.Label, Punctuation, Text, String)), ...
[ "def", "_objdump_lexer_tokens", "(", "asm_lexer", ")", ":", "hex_re", "=", "r'[0-9A-Za-z]'", "return", "{", "'root'", ":", "[", "# File name & format:", "(", "'(.*?)(:)( +file format )(.*?)$'", ",", "bygroups", "(", "Name", ".", "Label", ",", "Punctuation", ",", "...
[ 100, 0 ]
[ 146, 5 ]
python
en
['en', 'error', 'th']
False
PreProcessor.__init__
( self, clean_whitespace: bool = True, clean_header_footer: bool = False, clean_empty_lines: bool = True, split_by: str = "word", split_length: int = 1000, split_overlap: int = 0, split_respect_sentence_boundary: bool = True, )
:param clean_header_footer: Use heuristic to remove footers and headers across different pages by searching for the longest common string. This heuristic uses exact matches and therefore works well for footers like "Copyright 2019 by XXX...
:param clean_header_footer: Use heuristic to remove footers and headers across different pages by searching for the longest common string. This heuristic uses exact matches and therefore works well for footers like "Copyright 2019 by XXX...
def __init__( self, clean_whitespace: bool = True, clean_header_footer: bool = False, clean_empty_lines: bool = True, split_by: str = "word", split_length: int = 1000, split_overlap: int = 0, split_respect_sentence_boundary: bool = True, ): """...
[ "def", "__init__", "(", "self", ",", "clean_whitespace", ":", "bool", "=", "True", ",", "clean_header_footer", ":", "bool", "=", "False", ",", "clean_empty_lines", ":", "bool", "=", "True", ",", "split_by", ":", "str", "=", "\"word\"", ",", "split_length", ...
[ 16, 4 ]
[ 57, 78 ]
python
en
['en', 'error', 'th']
False
PreProcessor.process
( self, document: dict, clean_whitespace: Optional[bool] = None, clean_header_footer: Optional[bool] = None, clean_empty_lines: Optional[bool] = None, split_by: Optional[str] = None, split_length: Optional[int] = None, split_overlap: Optional[int] = None, ...
Perform document cleaning and splitting. Takes a single document as input and returns a list of documents.
Perform document cleaning and splitting. Takes a single document as input and returns a list of documents.
def process( self, document: dict, clean_whitespace: Optional[bool] = None, clean_header_footer: Optional[bool] = None, clean_empty_lines: Optional[bool] = None, split_by: Optional[str] = None, split_length: Optional[int] = None, split_overlap: Optional[in...
[ "def", "process", "(", "self", ",", "document", ":", "dict", ",", "clean_whitespace", ":", "Optional", "[", "bool", "]", "=", "None", ",", "clean_header_footer", ":", "Optional", "[", "bool", "]", "=", "None", ",", "clean_empty_lines", ":", "Optional", "["...
[ 59, 4 ]
[ 101, 30 ]
python
en
['en', 'error', 'th']
False
PreProcessor.clean
( self, document: dict, clean_whitespace: bool, clean_header_footer: bool, clean_empty_lines: bool, )
Perform document cleaning on a single document and return a single document. This method will deal with whitespaces, headers, footers and empty lines. Its exact functionality is defined by the parameters passed into PreProcessor.__init__().
Perform document cleaning on a single document and return a single document. This method will deal with whitespaces, headers, footers and empty lines. Its exact functionality is defined by the parameters passed into PreProcessor.__init__().
def clean( self, document: dict, clean_whitespace: bool, clean_header_footer: bool, clean_empty_lines: bool, ) -> dict: """ Perform document cleaning on a single document and return a single document. This method will deal with whitespaces, headers, footers ...
[ "def", "clean", "(", "self", ",", "document", ":", "dict", ",", "clean_whitespace", ":", "bool", ",", "clean_header_footer", ":", "bool", ",", "clean_empty_lines", ":", "bool", ",", ")", "->", "dict", ":", "text", "=", "document", "[", "\"text\"", "]", "...
[ 103, 4 ]
[ 133, 23 ]
python
en
['en', 'error', 'th']
False
PreProcessor.split
( self, document: dict, split_by: str, split_length: int, split_overlap: int, split_respect_sentence_boundary: bool, )
Perform document splitting on a single document. This method can split on different units, at different lengths, with different strides. It can also respect sentence boundaries. Its exact functionality is defined by the parameters passed into PreProcessor.__init__(). Takes a single document as input and...
Perform document splitting on a single document. This method can split on different units, at different lengths, with different strides. It can also respect sentence boundaries. Its exact functionality is defined by the parameters passed into PreProcessor.__init__(). Takes a single document as input and...
def split( self, document: dict, split_by: str, split_length: int, split_overlap: int, split_respect_sentence_boundary: bool, ) -> List[dict]: """Perform document splitting on a single document. This method can split on different units, at different lengths, ...
[ "def", "split", "(", "self", ",", "document", ":", "dict", ",", "split_by", ":", "str", ",", "split_length", ":", "int", ",", "split_overlap", ":", "int", ",", "split_respect_sentence_boundary", ":", "bool", ",", ")", "->", "List", "[", "dict", "]", ":",...
[ 135, 4 ]
[ 229, 24 ]
python
en
['en', 'en', 'en']
True
PreProcessor._find_and_remove_header_footer
( self, text: str, n_chars: int, n_first_pages_to_ignore: int, n_last_pages_to_ignore: int )
Heuristic to find footers and headers across different pages by searching for the longest common string. For headers we only search in the first n_chars characters (for footer: last n_chars). Note: This heuristic uses exact matches and therefore works well for footers like "Copyright 2019 by XX...
Heuristic to find footers and headers across different pages by searching for the longest common string. For headers we only search in the first n_chars characters (for footer: last n_chars). Note: This heuristic uses exact matches and therefore works well for footers like "Copyright 2019 by XX...
def _find_and_remove_header_footer( self, text: str, n_chars: int, n_first_pages_to_ignore: int, n_last_pages_to_ignore: int ) -> str: """ Heuristic to find footers and headers across different pages by searching for the longest common string. For headers we only search in the first ...
[ "def", "_find_and_remove_header_footer", "(", "self", ",", "text", ":", "str", ",", "n_chars", ":", "int", ",", "n_first_pages_to_ignore", ":", "int", ",", "n_last_pages_to_ignore", ":", "int", ")", "->", "str", ":", "pages", "=", "text", ".", "split", "(", ...
[ 231, 4 ]
[ 261, 19 ]
python
en
['en', 'error', 'th']
False
PreProcessor._ngram
(self, seq: str, n: int)
Return ngram (of tokens - currently split by whitespace) :param seq: str, string from which the ngram shall be created :param n: int, n of ngram :return: str, ngram as string
Return ngram (of tokens - currently split by whitespace) :param seq: str, string from which the ngram shall be created :param n: int, n of ngram :return: str, ngram as string
def _ngram(self, seq: str, n: int) -> Generator[str, None, None]: """ Return ngram (of tokens - currently split by whitespace) :param seq: str, string from which the ngram shall be created :param n: int, n of ngram :return: str, ngram as string """ # In order to ...
[ "def", "_ngram", "(", "self", ",", "seq", ":", "str", ",", "n", ":", "int", ")", "->", "Generator", "[", "str", ",", "None", ",", "None", "]", ":", "# In order to maintain the original whitespace, but still consider \\n and \\t for n-gram tokenization,", "# we add a s...
[ 263, 4 ]
[ 281, 21 ]
python
en
['en', 'error', 'th']
False
PreProcessor._find_longest_common_ngram
( self, sequences: List[str], max_ngram: int = 30, min_ngram: int = 3 )
Find the longest common ngram across different text sequences (e.g. start of pages). Considering all ngrams between the specified range. Helpful for finding footers, headers etc. :param sequences: list[str], list of strings that shall be searched for common n_grams :param max_ngram: in...
Find the longest common ngram across different text sequences (e.g. start of pages). Considering all ngrams between the specified range. Helpful for finding footers, headers etc.
def _find_longest_common_ngram( self, sequences: List[str], max_ngram: int = 30, min_ngram: int = 3 ) -> Optional[str]: """ Find the longest common ngram across different text sequences (e.g. start of pages). Considering all ngrams between the specified range. Helpful for finding foo...
[ "def", "_find_longest_common_ngram", "(", "self", ",", "sequences", ":", "List", "[", "str", "]", ",", "max_ngram", ":", "int", "=", "30", ",", "min_ngram", ":", "int", "=", "3", ")", "->", "Optional", "[", "str", "]", ":", "sequences", "=", "[", "s"...
[ 289, 4 ]
[ 312, 51 ]
python
en
['en', 'error', 'th']
False
bob_columnar_table_multi_batch
()
About the "Bob" User Workflow Fixture Bob is working with monthly batches of taxi fare data. His data has the following columns:vendor_id,pickup_datetime,dropoff_datetime,passenger_count,trip_distance,rate_code_id,store_and_fwd_flag,pickup_location_id,dropoff_location_id,payment_type,fare_amount,extra,mta_tax...
About the "Bob" User Workflow Fixture
def bob_columnar_table_multi_batch(): """ About the "Bob" User Workflow Fixture Bob is working with monthly batches of taxi fare data. His data has the following columns:vendor_id,pickup_datetime,dropoff_datetime,passenger_count,trip_distance,rate_code_id,store_and_fwd_flag,pickup_location_id,dropoff_locat...
[ "def", "bob_columnar_table_multi_batch", "(", ")", ":", "with", "open", "(", "\"bob_user_workflow_verbose_profiler_config.yml\"", ")", "as", "f", ":", "verbose_profiler_config", "=", "f", ".", "read", "(", ")", "profiler_configs", ":", "List", "[", "str", "]", "="...
[ 6, 0 ]
[ 33, 49 ]
python
en
['en', 'error', 'th']
False
BaseSummarizer.predict
(self, documents: List[Document], generate_single_summary: bool = False)
Abstract method for creating a summary. :param documents: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on. :param generate_single_summary: Whether to generate a single summary for all documents or one summary per document. ...
Abstract method for creating a summary.
def predict(self, documents: List[Document], generate_single_summary: bool = False) -> List[Document]: """ Abstract method for creating a summary. :param documents: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on. :param generate_single_summary: ...
[ "def", "predict", "(", "self", ",", "documents", ":", "List", "[", "Document", "]", ",", "generate_single_summary", ":", "bool", "=", "False", ")", "->", "List", "[", "Document", "]", ":", "pass" ]
[ 14, 4 ]
[ 26, 12 ]
python
en
['en', 'error', 'th']
False
SqlAlchemyDatasource.build_configuration
( cls, data_asset_type=None, batch_kwargs_generators=None, **kwargs )
Build a full configuration object for a datasource, potentially including generators with defaults. Args: data_asset_type: A ClassConfig dictionary batch_kwargs_generators: Generator configuration dictionary **kwargs: Additional kwargs to be part of the datasource c...
Build a full configuration object for a datasource, potentially including generators with defaults.
def build_configuration( cls, data_asset_type=None, batch_kwargs_generators=None, **kwargs ): """ Build a full configuration object for a datasource, potentially including generators with defaults. Args: data_asset_type: A ClassConfig dictionary batch_kwargs_...
[ "def", "build_configuration", "(", "cls", ",", "data_asset_type", "=", "None", ",", "batch_kwargs_generators", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "data_asset_type", "is", "None", ":", "data_asset_type", "=", "{", "\"class_name\"", ":", "\"Sq...
[ 171, 4 ]
[ 200, 28 ]
python
en
['en', 'error', 'th']
False
TikaConverter.__init__
( self, tika_url: str = "http://localhost:9998/tika", remove_numeric_tables: bool = False, valid_languages: Optional[List[str]] = None )
:param tika_url: URL of the Tika server :param remove_numeric_tables: This option uses heuristics to remove numeric rows from the tables. The tabular structures in documents might be noise for the reader model if it does not ha...
:param tika_url: URL of the Tika server :param remove_numeric_tables: This option uses heuristics to remove numeric rows from the tables. The tabular structures in documents might be noise for the reader model if it does not ha...
def __init__( self, tika_url: str = "http://localhost:9998/tika", remove_numeric_tables: bool = False, valid_languages: Optional[List[str]] = None ): """ :param tika_url: URL of the Tika server :param remove_numeric_tables: This option uses heuristics to remov...
[ "def", "__init__", "(", "self", ",", "tika_url", ":", "str", "=", "\"http://localhost:9998/tika\"", ",", "remove_numeric_tables", ":", "bool", "=", "False", ",", "valid_languages", ":", "Optional", "[", "List", "[", "str", "]", "]", "=", "None", ")", ":", ...
[ 41, 4 ]
[ 65, 102 ]
python
en
['en', 'error', 'th']
False
TikaConverter.convert
( self, file_path: Path, meta: Optional[Dict[str, str]] = None, remove_numeric_tables: Optional[bool] = None, valid_languages: Optional[List[str]] = None, )
:param file_path: path of the file to convert :param meta: dictionary of meta data key-value pairs to append in the returned document. :param remove_numeric_tables: This option uses heuristics to remove numeric rows from the tables. The tabular structures i...
:param file_path: path of the file to convert :param meta: dictionary of meta data key-value pairs to append in the returned document. :param remove_numeric_tables: This option uses heuristics to remove numeric rows from the tables. The tabular structures i...
def convert( self, file_path: Path, meta: Optional[Dict[str, str]] = None, remove_numeric_tables: Optional[bool] = None, valid_languages: Optional[List[str]] = None, ) -> Dict[str, Any]: """ :param file_path: path of the file to convert :param meta: di...
[ "def", "convert", "(", "self", ",", "file_path", ":", "Path", ",", "meta", ":", "Optional", "[", "Dict", "[", "str", ",", "str", "]", "]", "=", "None", ",", "remove_numeric_tables", ":", "Optional", "[", "bool", "]", "=", "None", ",", "valid_languages"...
[ 67, 4 ]
[ 129, 23 ]
python
en
['en', 'error', 'th']
False
DocxToTextConverter.convert
( self, file_path: Path, meta: Optional[Dict[str, str]] = None, remove_numeric_tables: Optional[bool] = None, valid_languages: Optional[List[str]] = None, )
Extract text from a .docx file. Note: As docx doesn't contain "page" information, we actually extract and return a list of paragraphs here. For compliance with other converters we nevertheless opted for keeping the methods name. :param file_path: Path to the .docx file you want to conv...
Extract text from a .docx file. Note: As docx doesn't contain "page" information, we actually extract and return a list of paragraphs here. For compliance with other converters we nevertheless opted for keeping the methods name.
def convert( self, file_path: Path, meta: Optional[Dict[str, str]] = None, remove_numeric_tables: Optional[bool] = None, valid_languages: Optional[List[str]] = None, ) -> Dict[str, Any]: """ Extract text from a .docx file. Note: As docx doesn't contain...
[ "def", "convert", "(", "self", ",", "file_path", ":", "Path", ",", "meta", ":", "Optional", "[", "Dict", "[", "str", ",", "str", "]", "]", "=", "None", ",", "remove_numeric_tables", ":", "Optional", "[", "bool", "]", "=", "None", ",", "valid_languages"...
[ 12, 4 ]
[ 50, 23 ]
python
en
['en', 'error', 'th']
False
ColumnDomainBuilder._get_domains
( self, variables: Optional[ParameterContainer] = None, )
Obtains and returns domains for all columns of a table.
Obtains and returns domains for all columns of a table.
def _get_domains( self, variables: Optional[ParameterContainer] = None, ) -> List[Domain]: """ Obtains and returns domains for all columns of a table. """ batch_id: str = self.get_batch_id(variables=variables) table_column_names: List[str] = self.get_validator...
[ "def", "_get_domains", "(", "self", ",", "variables", ":", "Optional", "[", "ParameterContainer", "]", "=", "None", ",", ")", "->", "List", "[", "Domain", "]", ":", "batch_id", ":", "str", "=", "self", ".", "get_batch_id", "(", "variables", "=", "variabl...
[ 9, 4 ]
[ 41, 22 ]
python
en
['en', 'error', 'th']
False
BaseRLearner.__init__
(self, learner=None, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None)
Initialize an R-learner. Args: learner (optional): a model to estimate outcomes and treatment effects outcome_learner (optional): a model to estimate outcomes effect_learner (optional): a model to estimate treatment effects. It needs to take `sample_weight` as an ...
Initialize an R-learner.
def __init__(self, learner=None, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None):...
[ "def", "__init__", "(", "self", ",", "learner", "=", "None", ",", "outcome_learner", "=", "None", ",", "effect_learner", "=", "None", ",", "propensity_learner", "=", "ElasticNetPropensityModel", "(", ")", ",", "ate_alpha", "=", ".05", ",", "control_name", "=",...
[ 27, 4 ]
[ 64, 36 ]
python
en
['en', 'en', 'nl']
True
BaseRLearner.fit
(self, X, treatment, y, p=None, verbose=True)
Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): an outcome vector p (np.ndarray or pd.Series or dict, ...
Fit the treatment effect and outcome models of the R learner.
def fit(self, X, treatment, y, p=None, verbose=True): """Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): a...
[ "def", "fit", "(", "self", ",", "X", ",", "treatment", ",", "y", ",", "p", "=", "None", ",", "verbose", "=", "True", ")", ":", "X", ",", "treatment", ",", "y", "=", "convert_pd_to_np", "(", "X", ",", "treatment", ",", "y", ")", "check_treatment_vec...
[ 72, 4 ]
[ 119, 75 ]
python
en
['en', 'en', 'en']
True
BaseRLearner.predict
(self, X, p=None)
Predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix Returns: (numpy.ndarray): Predictions of treatment effects.
Predict treatment effects.
def predict(self, X, p=None): """Predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix Returns: (numpy.ndarray): Predictions of treatment effects. """ X = convert_pd_to_np(X) te = np.zeros((X.shape[0], self....
[ "def", "predict", "(", "self", ",", "X", ",", "p", "=", "None", ")", ":", "X", "=", "convert_pd_to_np", "(", "X", ")", "te", "=", "np", ".", "zeros", "(", "(", "X", ".", "shape", "[", "0", "]", ",", "self", ".", "t_groups", ".", "shape", "[",...
[ 121, 4 ]
[ 136, 17 ]
python
en
['fr', 'en', 'en']
True
BaseRLearner.fit_predict
(self, X, treatment, y, p=None, return_ci=False, n_bootstraps=1000, bootstrap_size=10000, verbose=True)
Fit the treatment effect and outcome models of the R learner and predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): an outcome vector p (np....
Fit the treatment effect and outcome models of the R learner and predict treatment effects.
def fit_predict(self, X, treatment, y, p=None, return_ci=False, n_bootstraps=1000, bootstrap_size=10000, verbose=True): """Fit the treatment effect and outcome models of the R learner and predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a featu...
[ "def", "fit_predict", "(", "self", ",", "X", ",", "treatment", ",", "y", ",", "p", "=", "None", ",", "return_ci", "=", "False", ",", "n_bootstraps", "=", "1000", ",", "bootstrap_size", "=", "10000", ",", "verbose", "=", "True", ")", ":", "X", ",", ...
[ 138, 4 ]
[ 189, 43 ]
python
en
['en', 'en', 'en']
True
BaseRLearner.estimate_ate
(self, X, treatment, y, p=None, bootstrap_ci=False, n_bootstraps=1000, bootstrap_size=10000)
Estimate the Average Treatment Effect (ATE). Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): an outcome vector p (np.ndarray or pd.Series or dict, optional): an arr...
Estimate the Average Treatment Effect (ATE).
def estimate_ate(self, X, treatment, y, p=None, bootstrap_ci=False, n_bootstraps=1000, bootstrap_size=10000): """Estimate the Average Treatment Effect (ATE). Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector ...
[ "def", "estimate_ate", "(", "self", ",", "X", ",", "treatment", ",", "y", ",", "p", "=", "None", ",", "bootstrap_ci", "=", "False", ",", "n_bootstraps", "=", "1000", ",", "bootstrap_size", "=", "10000", ")", ":", "X", ",", "treatment", ",", "y", "=",...
[ 191, 4 ]
[ 258, 44 ]
python
en
['en', 'it', 'en']
True
BaseRRegressor.__init__
(self, learner=None, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None)
Initialize an R-learner regressor. Args: learner (optional): a model to estimate outcomes and treatment effects outcome_learner (optional): a model to estimate outcomes effect_learner (optional): a model to estimate treatment effects. It needs to take `sample_weight` as an ...
Initialize an R-learner regressor.
def __init__(self, learner=None, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None):...
[ "def", "__init__", "(", "self", ",", "learner", "=", "None", ",", "outcome_learner", "=", "None", ",", "effect_learner", "=", "None", ",", "propensity_learner", "=", "ElasticNetPropensityModel", "(", ")", ",", "ate_alpha", "=", ".05", ",", "control_name", "=",...
[ 266, 4 ]
[ 297, 38 ]
python
en
['en', 'fy', 'nl']
False
BaseRClassifier.__init__
(self, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None)
Initialize an R-learner classifier. Args: outcome_learner: a model to estimate outcomes. Should be a classifier. effect_learner: a model to estimate treatment effects. It needs to take `sample_weight` as an input argument for `fit()`. Should be a regressor. p...
Initialize an R-learner classifier.
def __init__(self, outcome_learner=None, effect_learner=None, propensity_learner=ElasticNetPropensityModel(), ate_alpha=.05, control_name=0, n_fold=5, random_state=None): """Initialize an R-lea...
[ "def", "__init__", "(", "self", ",", "outcome_learner", "=", "None", ",", "effect_learner", "=", "None", ",", "propensity_learner", "=", "ElasticNetPropensityModel", "(", ")", ",", "ate_alpha", "=", ".05", ",", "control_name", "=", "0", ",", "n_fold", "=", "...
[ 305, 4 ]
[ 337, 99 ]
python
en
['en', 'fy', 'nl']
False
BaseRClassifier.fit
(self, X, treatment, y, p=None, verbose=True)
Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): an outcome vector p (np.ndarray or pd.Series or dict, ...
Fit the treatment effect and outcome models of the R learner.
def fit(self, X, treatment, y, p=None, verbose=True): """Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix treatment (np.array or pd.Series): a treatment vector y (np.array or pd.Series): a...
[ "def", "fit", "(", "self", ",", "X", ",", "treatment", ",", "y", ",", "p", "=", "None", ",", "verbose", "=", "True", ")", ":", "X", ",", "treatment", ",", "y", "=", "convert_pd_to_np", "(", "X", ",", "treatment", ",", "y", ")", "check_treatment_vec...
[ 339, 4 ]
[ 386, 75 ]
python
en
['en', 'en', 'en']
True
BaseRClassifier.predict
(self, X, p=None)
Predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix Returns: (numpy.ndarray): Predictions of treatment effects.
Predict treatment effects.
def predict(self, X, p=None): """Predict treatment effects. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix Returns: (numpy.ndarray): Predictions of treatment effects. """ X = convert_pd_to_np(X) te = np.zeros((X.shape[0], self....
[ "def", "predict", "(", "self", ",", "X", ",", "p", "=", "None", ")", ":", "X", "=", "convert_pd_to_np", "(", "X", ")", "te", "=", "np", ".", "zeros", "(", "(", "X", ".", "shape", "[", "0", "]", ",", "self", ".", "t_groups", ".", "shape", "[",...
[ 388, 4 ]
[ 403, 17 ]
python
en
['fr', 'en', 'en']
True
XGBRRegressor.__init__
(self, early_stopping=True, test_size=0.3, early_stopping_rounds=30, effect_learner_objective='rank:pairwise', effect_learner_n_estimators=500, random_state=42, *args, **kwargs)
Initialize an R-learner regressor with XGBoost model using pairwise ranking objective. Args: early_stopping: whether or not to use early stopping when fitting effect learner test_size (float, optional): the proportion of the dataset to use as validation set when early stopping is ...
Initialize an R-learner regressor with XGBoost model using pairwise ranking objective.
def __init__(self, early_stopping=True, test_size=0.3, early_stopping_rounds=30, effect_learner_objective='rank:pairwise', effect_learner_n_estimators=500, random_state=42, *args, **kw...
[ "def", "__init__", "(", "self", ",", "early_stopping", "=", "True", ",", "test_size", "=", "0.3", ",", "early_stopping_rounds", "=", "30", ",", "effect_learner_objective", "=", "'rank:pairwise'", ",", "effect_learner_n_estimators", "=", "500", ",", "random_state", ...
[ 407, 4 ]
[ 447, 9 ]
python
en
['en', 'en', 'en']
True
XGBRRegressor.fit
(self, X, treatment, y, p=None, verbose=True)
Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix y (np.array or pd.Series): an outcome vector p (np.ndarray or pd.Series or dict, optional): an array of propensity scores of float (0,1) in the ...
Fit the treatment effect and outcome models of the R learner.
def fit(self, X, treatment, y, p=None, verbose=True): """Fit the treatment effect and outcome models of the R learner. Args: X (np.matrix or np.array or pd.Dataframe): a feature matrix y (np.array or pd.Series): an outcome vector p (np.ndarray or pd.Series or dict, o...
[ "def", "fit", "(", "self", ",", "X", ",", "treatment", ",", "y", ",", "p", "=", "None", ",", "verbose", "=", "True", ")", ":", "X", ",", "treatment", ",", "y", "=", "convert_pd_to_np", "(", "X", ",", "treatment", ",", "y", ")", "check_treatment_vec...
[ 449, 4 ]
[ 516, 75 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions._ExpectedWarnings
(self, expected)
Compares recorded lines to expected warnings.
Compares recorded lines to expected warnings.
def _ExpectedWarnings(self, expected): """Compares recorded lines to expected warnings.""" self.stderr.seek(0) actual = self.stderr.read().split('\n') actual = [line for line in actual if line] self.assertEqual(sorted(expected), sorted(actual))
[ "def", "_ExpectedWarnings", "(", "self", ",", "expected", ")", ":", "self", ".", "stderr", ".", "seek", "(", "0", ")", "actual", "=", "self", ".", "stderr", ".", "read", "(", ")", ".", "split", "(", "'\\n'", ")", "actual", "=", "[", "line", "for", ...
[ 18, 2 ]
[ 23, 54 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testValidateMSVSSettings_tool_names
(self)
Tests that only MSVS tool names are allowed.
Tests that only MSVS tool names are allowed.
def testValidateMSVSSettings_tool_names(self): """Tests that only MSVS tool names are allowed.""" MSVSSettings.ValidateMSVSSettings( {'VCCLCompilerTool': {}, 'VCLinkerTool': {}, 'VCMIDLTool': {}, 'foo': {}, 'VCResourceCompilerTool': {}, 'VCLibrarianTool': {},...
[ "def", "testValidateMSVSSettings_tool_names", "(", "self", ")", ":", "MSVSSettings", ".", "ValidateMSVSSettings", "(", "{", "'VCCLCompilerTool'", ":", "{", "}", ",", "'VCLinkerTool'", ":", "{", "}", ",", "'VCMIDLTool'", ":", "{", "}", ",", "'foo'", ":", "{", ...
[ 25, 2 ]
[ 39, 48 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testValidateMSVSSettings_settings
(self)
Tests that for invalid MSVS settings.
Tests that for invalid MSVS settings.
def testValidateMSVSSettings_settings(self): """Tests that for invalid MSVS settings.""" MSVSSettings.ValidateMSVSSettings( {'VCCLCompilerTool': { 'AdditionalIncludeDirectories': 'folder1;folder2', 'AdditionalOptions': ['string1', 'string2'], 'AdditionalUsingDirectori...
[ "def", "testValidateMSVSSettings_settings", "(", "self", ")", ":", "MSVSSettings", ".", "ValidateMSVSSettings", "(", "{", "'VCCLCompilerTool'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'folder1;folder2'", ",", "'AdditionalOptions'", ":", "[", "'string1'", ",", ...
[ 41, 2 ]
[ 280, 12 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testValidateMSBuildSettings_settings
(self)
Tests that for invalid MSBuild settings.
Tests that for invalid MSBuild settings.
def testValidateMSBuildSettings_settings(self): """Tests that for invalid MSBuild settings.""" MSVSSettings.ValidateMSBuildSettings( {'ClCompile': { 'AdditionalIncludeDirectories': 'folder1;folder2', 'AdditionalOptions': ['string1', 'string2'], 'AdditionalUsingDirecto...
[ "def", "testValidateMSBuildSettings_settings", "(", "self", ")", ":", "MSVSSettings", ".", "ValidateMSBuildSettings", "(", "{", "'ClCompile'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'folder1;folder2'", ",", "'AdditionalOptions'", ":", "[", "'string1'", ",", "...
[ 282, 2 ]
[ 558, 78 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testConvertToMSBuildSettings_empty
(self)
Tests an empty conversion.
Tests an empty conversion.
def testConvertToMSBuildSettings_empty(self): """Tests an empty conversion.""" msvs_settings = {} expected_msbuild_settings = {} actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr) self.assertEqual(expected_msbuild_settings, actual_msbuild_set...
[ "def", "testConvertToMSBuildSettings_empty", "(", "self", ")", ":", "msvs_settings", "=", "{", "}", "expected_msbuild_settings", "=", "{", "}", "actual_msbuild_settings", "=", "MSVSSettings", ".", "ConvertToMSBuildSettings", "(", "msvs_settings", ",", "self", ".", "st...
[ 560, 2 ]
[ 568, 30 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testConvertToMSBuildSettings_minimal
(self)
Tests a minimal conversion.
Tests a minimal conversion.
def testConvertToMSBuildSettings_minimal(self): """Tests a minimal conversion.""" msvs_settings = { 'VCCLCompilerTool': { 'AdditionalIncludeDirectories': 'dir1', 'AdditionalOptions': '/foo', 'BasicRuntimeChecks': '0', }, 'VCLinkerTool': { ...
[ "def", "testConvertToMSBuildSettings_minimal", "(", "self", ")", ":", "msvs_settings", "=", "{", "'VCCLCompilerTool'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'dir1'", ",", "'AdditionalOptions'", ":", "'/foo'", ",", "'BasicRuntimeChecks'", ":", "'0'", ",", "...
[ 570, 2 ]
[ 600, 30 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testConvertToMSBuildSettings_warnings
(self)
Tests conversion that generates warnings.
Tests conversion that generates warnings.
def testConvertToMSBuildSettings_warnings(self): """Tests conversion that generates warnings.""" msvs_settings = { 'VCCLCompilerTool': { 'AdditionalIncludeDirectories': '1', 'AdditionalOptions': '2', # These are incorrect values: 'BasicRuntimeChecks': '12'...
[ "def", "testConvertToMSBuildSettings_warnings", "(", "self", ")", ":", "msvs_settings", "=", "{", "'VCCLCompilerTool'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'1'", ",", "'AdditionalOptions'", ":", "'2'", ",", "# These are incorrect values:", "'BasicRuntimeChecks...
[ 602, 2 ]
[ 652, 10 ]
python
en
['en', 'jv', 'en']
True
TestSequenceFunctions.testConvertToMSBuildSettings_full_synthetic
(self)
Tests conversion of all the MSBuild settings.
Tests conversion of all the MSBuild settings.
def testConvertToMSBuildSettings_full_synthetic(self): """Tests conversion of all the MSBuild settings.""" msvs_settings = { 'VCCLCompilerTool': { 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', 'AdditionalOptions': 'a_string', 'AdditionalUsingDirectories':...
[ "def", "testConvertToMSBuildSettings_full_synthetic", "(", "self", ")", ":", "msvs_settings", "=", "{", "'VCCLCompilerTool'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'folder1;folder2;folder3'", ",", "'AdditionalOptions'", ":", "'a_string'", ",", "'AdditionalUsingDir...
[ 654, 2 ]
[ 1087, 30 ]
python
en
['en', 'en', 'en']
True
TestSequenceFunctions.testConvertToMSBuildSettings_actual
(self)
Tests the conversion of an actual project. A VS2008 project with most of the options defined was created through the VS2008 IDE. It was then converted to VS2010. The tool settings found in the .vcproj and .vcxproj files were converted to the two dictionaries msvs_settings and expected_msbuild_setting...
Tests the conversion of an actual project.
def testConvertToMSBuildSettings_actual(self): """Tests the conversion of an actual project. A VS2008 project with most of the options defined was created through the VS2008 IDE. It was then converted to VS2010. The tool settings found in the .vcproj and .vcxproj files were converted to the two dicti...
[ "def", "testConvertToMSBuildSettings_actual", "(", "self", ")", ":", "msvs_settings", "=", "{", "'VCCLCompilerTool'", ":", "{", "'AdditionalIncludeDirectories'", ":", "'dir1'", ",", "'AdditionalOptions'", ":", "'/more'", ",", "'AdditionalUsingDirectories'", ":", "'test'",...
[ 1089, 2 ]
[ 1478, 30 ]
python
en
['en', 'en', 'en']
True
EVI
(ds, G=2.5, C1=6, C2=7.5, L=1, normalize=True)
Computes the 3-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G * (NIR - RED) / (NIR + C1*RED - C2*BLUE + L). Usually, G = 2.5, C1 = 6, C2 = 7.5, and L = 1. For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, ...
Computes the 3-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G * (NIR - RED) / (NIR + C1*RED - C2*BLUE + L). Usually, G = 2.5, C1 = 6, C2 = 7.5, and L = 1. For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, ...
def EVI(ds, G=2.5, C1=6, C2=7.5, L=1, normalize=True): """ Computes the 3-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G * (NIR - RED) / (NIR + C1*RED - C2*BLUE + L). Usually, G = 2.5, C1 = 6, C2 = 7.5, and L = 1. For Landsat data, returned values should be in the rang...
[ "def", "EVI", "(", "ds", ",", "G", "=", "2.5", ",", "C1", "=", "6", ",", "C2", "=", "7.5", ",", "L", "=", "1", ",", "normalize", "=", "True", ")", ":", "evi", "=", "G", "*", "(", "ds", ".", "nir", "-", "ds", ".", "red", ")", "/", "(", ...
[ 2, 0 ]
[ 40, 14 ]
python
en
['en', 'ja', 'th']
False
EVI2
(ds, G=2.5, C=2.4, L=1, normalize=True)
Computes the 2-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G*((NIR-RED)/(NIR+C*Red+L)). Usually, G = 2.5, C = 2.4, and L = 1. For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, returned values should be in...
Computes the 2-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G*((NIR-RED)/(NIR+C*Red+L)). Usually, G = 2.5, C = 2.4, and L = 1. For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, returned values should be in...
def EVI2(ds, G=2.5, C=2.4, L=1, normalize=True): """ Computes the 2-band Enhanced Vegetation Index for an `xarray.Dataset`. The formula is G*((NIR-RED)/(NIR+C*Red+L)). Usually, G = 2.5, C = 2.4, and L = 1. For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. ...
[ "def", "EVI2", "(", "ds", ",", "G", "=", "2.5", ",", "C", "=", "2.4", ",", "L", "=", "1", ",", "normalize", "=", "True", ")", ":", "evi", "=", "G", "*", "(", "ds", ".", "nir", "-", "ds", ".", "red", ")", "/", "(", "ds", ".", "nir", "+",...
[ 43, 0 ]
[ 82, 14 ]
python
en
['en', 'ja', 'th']
False
NBR
(ds)
Computes the Normalized Burn Ratio for an `xarray.Dataset`. The formula is (NIR - SWIR2) / (NIR + SWIR2). Values should be in the range [-1,1] for valid LANDSAT data (nir and swir2 are positive). Parameters ---------- ds: xarray.Dataset An `xarray.Dataset` that must contain 'ni...
Computes the Normalized Burn Ratio for an `xarray.Dataset`. The formula is (NIR - SWIR2) / (NIR + SWIR2). Values should be in the range [-1,1] for valid LANDSAT data (nir and swir2 are positive). Parameters ---------- ds: xarray.Dataset An `xarray.Dataset` that must contain 'ni...
def NBR(ds): """ Computes the Normalized Burn Ratio for an `xarray.Dataset`. The formula is (NIR - SWIR2) / (NIR + SWIR2). Values should be in the range [-1,1] for valid LANDSAT data (nir and swir2 are positive). Parameters ---------- ds: xarray.Dataset An `xarray.Dataset` ...
[ "def", "NBR", "(", "ds", ")", ":", "return", "(", "ds", ".", "nir", "-", "ds", ".", "swir2", ")", "/", "(", "ds", ".", "nir", "+", "ds", ".", "swir2", ")" ]
[ 84, 0 ]
[ 101, 52 ]
python
en
['en', 'ja', 'th']
False
NDVI
(ds)
Computes the Normalized Difference Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED). Values should be in the range [-1,1] for valid LANDSAT data (nir and red are positive). Parameters ---------- ds: xarray.Dataset An `xarray.Dataset` that must ...
Computes the Normalized Difference Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED). Values should be in the range [-1,1] for valid LANDSAT data (nir and red are positive). Parameters ---------- ds: xarray.Dataset An `xarray.Dataset` that must ...
def NDVI(ds): """ Computes the Normalized Difference Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED). Values should be in the range [-1,1] for valid LANDSAT data (nir and red are positive). Parameters ---------- ds: xarray.Dataset An `xarr...
[ "def", "NDVI", "(", "ds", ")", ":", "return", "(", "ds", ".", "nir", "-", "ds", ".", "red", ")", "/", "(", "ds", ".", "nir", "+", "ds", ".", "red", ")" ]
[ 103, 0 ]
[ 120, 48 ]
python
en
['en', 'ja', 'th']
False
SAVI
(ds, L=0.5, normalize=True)
Computes the Soil-Adjusted Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED + L) * (1 + L). For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, returned values should be in the range [-1-L,1+L]. In ...
Computes the Soil-Adjusted Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED + L) * (1 + L). For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, returned values should be in the range [-1-L,1+L]. In ...
def SAVI(ds, L=0.5, normalize=True): """ Computes the Soil-Adjusted Vegetation Index for an `xarray.Dataset`. The formula is (NIR - RED) / (NIR + RED + L) * (1 + L). For Landsat data, returned values should be in the range [-1,1] if `normalize == True`. If `normalize == False`, returned values ...
[ "def", "SAVI", "(", "ds", ",", "L", "=", "0.5", ",", "normalize", "=", "True", ")", ":", "savi", "=", "(", "ds", ".", "nir", "-", "ds", ".", "red", ")", "/", "(", "ds", ".", "nir", "+", "ds", ".", "red", "+", "L", ")", "*", "(", "1", "+...
[ 123, 0 ]
[ 160, 15 ]
python
en
['en', 'ja', 'th']
False
typedef_t.__init__
(self, name='', decl_type=None)
creates class that describes C++ typedef
creates class that describes C++ typedef
def __init__(self, name='', decl_type=None): """creates class that describes C++ typedef""" declaration.declaration_t.__init__(self, name) byte_info.byte_info.__init__(self) self._decl_type = decl_type if not isinstance(decl_type, str): self.byte_size = decl_type.byte...
[ "def", "__init__", "(", "self", ",", "name", "=", "''", ",", "decl_type", "=", "None", ")", ":", "declaration", ".", "declaration_t", ".", "__init__", "(", "self", ",", "name", ")", "byte_info", ".", "byte_info", ".", "__init__", "(", "self", ")", "sel...
[ 18, 4 ]
[ 25, 50 ]
python
en
['en', 'nl', 'en']
True
typedef_t._get__cmp__items
(self)
implementation details
implementation details
def _get__cmp__items(self): """implementation details""" return [self.decl_type]
[ "def", "_get__cmp__items", "(", "self", ")", ":", "return", "[", "self", ".", "decl_type", "]" ]
[ 27, 4 ]
[ 29, 31 ]
python
da
['eo', 'da', 'en']
False
typedef_t.decl_type
(self)
reference to the original :class:`decl_type <type_t>`
reference to the original :class:`decl_type <type_t>`
def decl_type(self): """reference to the original :class:`decl_type <type_t>`""" return self._decl_type
[ "def", "decl_type", "(", "self", ")", ":", "return", "self", ".", "_decl_type" ]
[ 40, 4 ]
[ 42, 30 ]
python
en
['en', 'en', 'en']
True
score5
(fa, matrix=None)
Calculate 5' splice site strength (exon)XXX|XXXXXX(intron) ** >>> round(score5('cagGTAAGT'), 2) 10.86 >>> round(score5('gagGTAAGT'), 2) 11.08 >>> round(score5('taaATAAGT'), 2) -0.12 >>> matrix = load_matrix(5) >>> round(score5('cagGTAAGT', matrix=matrix), 2) 10...
Calculate 5' splice site strength (exon)XXX|XXXXXX(intron) ** >>> round(score5('cagGTAAGT'), 2) 10.86 >>> round(score5('gagGTAAGT'), 2) 11.08 >>> round(score5('taaATAAGT'), 2) -0.12 >>> matrix = load_matrix(5) >>> round(score5('cagGTAAGT', matrix=matrix), 2) 10...
def score5(fa, matrix=None): ''' Calculate 5' splice site strength (exon)XXX|XXXXXX(intron) ** >>> round(score5('cagGTAAGT'), 2) 10.86 >>> round(score5('gagGTAAGT'), 2) 11.08 >>> round(score5('taaATAAGT'), 2) -0.12 >>> matrix = load_matrix(5) >>> round(score5('c...
[ "def", "score5", "(", "fa", ",", "matrix", "=", "None", ")", ":", "# check length of fa", "if", "len", "(", "fa", ")", "!=", "9", ":", "sys", ".", "exit", "(", "'Wrong length of fa!'", ")", "# check matrix", "if", "not", "matrix", ":", "matrix", "=", "...
[ 34, 0 ]
[ 62, 42 ]
python
en
['en', 'error', 'th']
False
score3
(fa, matrix=None)
Calculate 3' splice site strength (intron)XXXXXXXXXXXXXXXXXXXX|XXX(exon) ** >>> round(score3('ttccaaacgaacttttgtAGgga'), 2) 2.89 >>> round(score3('tgtctttttctgtgtggcAGtgg'), 2) 8.19 >>> round(score3('ttctctcttcagacttatAGcaa'), 2) -0.08 >>> matrix = load...
Calculate 3' splice site strength (intron)XXXXXXXXXXXXXXXXXXXX|XXX(exon) ** >>> round(score3('ttccaaacgaacttttgtAGgga'), 2) 2.89 >>> round(score3('tgtctttttctgtgtggcAGtgg'), 2) 8.19 >>> round(score3('ttctctcttcagacttatAGcaa'), 2) -0.08 >>> matrix = load...
def score3(fa, matrix=None): ''' Calculate 3' splice site strength (intron)XXXXXXXXXXXXXXXXXXXX|XXX(exon) ** >>> round(score3('ttccaaacgaacttttgtAGgga'), 2) 2.89 >>> round(score3('tgtctttttctgtgtggcAGtgg'), 2) 8.19 >>> round(score3('ttctctcttcagacttatAGcaa')...
[ "def", "score3", "(", "fa", ",", "matrix", "=", "None", ")", ":", "# check length of fa", "if", "len", "(", "fa", ")", "!=", "23", ":", "sys", ".", "exit", "(", "'Wrong length of fa!'", ")", "# check matrix", "if", "not", "matrix", ":", "matrix", "=", ...
[ 65, 0 ]
[ 102, 42 ]
python
en
['en', 'error', 'th']
False
install_ambassador
(namespace, single_namespace=True, envs=None)
Install Ambassador into a given namespace. NOTE WELL that although there is a 'single_namespace' parameter, this function probably needs work to do the fully-correct thing with single_namespace False. :param namespace: namespace to install Ambassador in :param single_namespace: should we set AMBAS...
Install Ambassador into a given namespace. NOTE WELL that although there is a 'single_namespace' parameter, this function probably needs work to do the fully-correct thing with single_namespace False.
def install_ambassador(namespace, single_namespace=True, envs=None): """ Install Ambassador into a given namespace. NOTE WELL that although there is a 'single_namespace' parameter, this function probably needs work to do the fully-correct thing with single_namespace False. :param namespace: namespa...
[ "def", "install_ambassador", "(", "namespace", ",", "single_namespace", "=", "True", ",", "envs", "=", "None", ")", ":", "if", "envs", "is", "None", ":", "envs", "=", "[", "]", "found_single_namespace", "=", "False", "if", "single_namespace", ":", "for", "...
[ 54, 0 ]
[ 146, 92 ]
python
en
['en', 'error', 'th']
False
project
()
Project operations
Project operations
def project(): """Project operations""" pass
[ "def", "project", "(", ")", ":", "pass" ]
[ 14, 0 ]
[ 16, 8 ]
python
en
['en', 'en', 'en']
False
project_check_config
(directory)
Check a config for validity and help with migrations.
Check a config for validity and help with migrations.
def project_check_config(directory): """Check a config for validity and help with migrations.""" cli_message("Checking your config files for validity...\n") is_config_ok, error_message, context = do_config_check(directory) if context: toolkit.send_usage_message( data_context=context,...
[ "def", "project_check_config", "(", "directory", ")", ":", "cli_message", "(", "\"Checking your config files for validity...\\n\"", ")", "is_config_ok", ",", "error_message", ",", "context", "=", "do_config_check", "(", "directory", ")", "if", "context", ":", "toolkit",...
[ 26, 0 ]
[ 39, 65 ]
python
en
['en', 'en', 'en']
True
project_upgrade
(directory)
Upgrade a project after installing the next Great Expectations major version.
Upgrade a project after installing the next Great Expectations major version.
def project_upgrade(directory): """Upgrade a project after installing the next Great Expectations major version.""" cli_message("\nChecking project...") cli_message(SECTION_SEPARATOR) if load_data_context_with_error_handling( directory=directory, from_cli_upgrade_command=True ): up_t...
[ "def", "project_upgrade", "(", "directory", ")", ":", "cli_message", "(", "\"\\nChecking project...\"", ")", "cli_message", "(", "SECTION_SEPARATOR", ")", "if", "load_data_context_with_error_handling", "(", "directory", "=", "directory", ",", "from_cli_upgrade_command", "...
[ 49, 0 ]
[ 60, 19 ]
python
en
['en', 'en', 'en']
True
Pipeline.add_node
(self, component, name: str, inputs: List[str])
Add a new node to the pipeline. :param component: The object to be called when the data is passed to the node. It can be a Haystack component (like Retriever, Reader, or Generator) or a user-defined object that implements a run() method to process in...
Add a new node to the pipeline.
def add_node(self, component, name: str, inputs: List[str]): """ Add a new node to the pipeline. :param component: The object to be called when the data is passed to the node. It can be a Haystack component (like Retriever, Reader, or Generator) or a user-defined objec...
[ "def", "add_node", "(", "self", ",", "component", ",", "name", ":", "str", ",", "inputs", ":", "List", "[", "str", "]", ")", ":", "self", ".", "graph", ".", "add_node", "(", "name", ",", "component", "=", "component", ",", "inputs", "=", "inputs", ...
[ 42, 4 ]
[ 80, 77 ]
python
en
['en', 'error', 'th']
False
Pipeline.get_node
(self, name: str)
Get a node from the Pipeline. :param name: The name of the node.
Get a node from the Pipeline.
def get_node(self, name: str): """ Get a node from the Pipeline. :param name: The name of the node. """ component = self.graph.nodes[name]["component"] return component
[ "def", "get_node", "(", "self", ",", "name", ":", "str", ")", ":", "component", "=", "self", ".", "graph", ".", "nodes", "[", "name", "]", "[", "\"component\"", "]", "return", "component" ]
[ 82, 4 ]
[ 89, 24 ]
python
en
['en', 'error', 'th']
False
Pipeline.set_node
(self, name: str, component)
Set the component for a node in the Pipeline. :param name: The name of the node. :param component: The component object to be set at the node.
Set the component for a node in the Pipeline.
def set_node(self, name: str, component): """ Set the component for a node in the Pipeline. :param name: The name of the node. :param component: The component object to be set at the node. """ self.graph.nodes[name]["component"] = component
[ "def", "set_node", "(", "self", ",", "name", ":", "str", ",", "component", ")", ":", "self", ".", "graph", ".", "nodes", "[", "name", "]", "[", "\"component\"", "]", "=", "component" ]
[ 91, 4 ]
[ 98, 55 ]
python
en
['en', 'error', 'th']
False
Pipeline.draw
(self, path: Path = Path("pipeline.png"))
Create a Graphviz visualization of the pipeline. :param path: the path to save the image.
Create a Graphviz visualization of the pipeline.
def draw(self, path: Path = Path("pipeline.png")): """ Create a Graphviz visualization of the pipeline. :param path: the path to save the image. """ try: import pygraphviz except ImportError: raise ImportError(f"Could not import `pygraphviz`. Plea...
[ "def", "draw", "(", "self", ",", "path", ":", "Path", "=", "Path", "(", "\"pipeline.png\"", ")", ")", ":", "try", ":", "import", "pygraphviz", "except", "ImportError", ":", "raise", "ImportError", "(", "f\"Could not import `pygraphviz`. Please install via: \\n\"", ...
[ 139, 4 ]
[ 154, 27 ]
python
en
['en', 'error', 'th']
False
Pipeline.load_from_yaml
(cls, path: Path, pipeline_name: Optional[str] = None, overwrite_with_env_variables: bool = True)
Load Pipeline from a YAML file defining the individual components and how they're tied together to form a Pipeline. A single YAML can declare multiple Pipelines, in which case an explicit `pipeline_name` must be passed. Here's a sample configuration: ```yaml | ...
Load Pipeline from a YAML file defining the individual components and how they're tied together to form a Pipeline. A single YAML can declare multiple Pipelines, in which case an explicit `pipeline_name` must be passed.
def load_from_yaml(cls, path: Path, pipeline_name: Optional[str] = None, overwrite_with_env_variables: bool = True): """ Load Pipeline from a YAML file defining the individual components and how they're tied together to form a Pipeline. A single YAML can declare multiple Pipelines, in which case...
[ "def", "load_from_yaml", "(", "cls", ",", "path", ":", "Path", ",", "pipeline_name", ":", "Optional", "[", "str", "]", "=", "None", ",", "overwrite_with_env_variables", ":", "bool", "=", "True", ")", ":", "with", "open", "(", "path", ",", "\"r\"", ",", ...
[ 157, 4 ]
[ 229, 23 ]
python
en
['en', 'error', 'th']
False
Pipeline._load_or_get_component
(cls, name: str, definitions: dict, components: dict)
Load a component from the definition or return if component object already present in `components` dict. :param name: name of the component to load or get. :param definitions: dict containing definitions of all components retrieved from the YAML. :param components: dict containing comp...
Load a component from the definition or return if component object already present in `components` dict.
def _load_or_get_component(cls, name: str, definitions: dict, components: dict): """ Load a component from the definition or return if component object already present in `components` dict. :param name: name of the component to load or get. :param definitions: dict containing definition...
[ "def", "_load_or_get_component", "(", "cls", ",", "name", ":", "str", ",", "definitions", ":", "dict", ",", "components", ":", "dict", ")", ":", "if", "name", "in", "components", ".", "keys", "(", ")", ":", "# check if component is already loaded.", "return", ...
[ 232, 4 ]
[ 256, 23 ]
python
en
['en', 'error', 'th']
False
Pipeline._overwrite_with_env_variables
(cls, definition: dict)
Overwrite the YAML configuration with environment variables. For example, to change index name param for an ElasticsearchDocumentStore, an env variable 'MYDOCSTORE_PARAMS_INDEX=documents-2021' can be set. Note that an `_` sign must be used to specify nested hierarchical properties. :pa...
Overwrite the YAML configuration with environment variables. For example, to change index name param for an ElasticsearchDocumentStore, an env variable 'MYDOCSTORE_PARAMS_INDEX=documents-2021' can be set. Note that an `_` sign must be used to specify nested hierarchical properties.
def _overwrite_with_env_variables(cls, definition: dict): """ Overwrite the YAML configuration with environment variables. For example, to change index name param for an ElasticsearchDocumentStore, an env variable 'MYDOCSTORE_PARAMS_INDEX=documents-2021' can be set. Note that an `_` sign...
[ "def", "_overwrite_with_env_variables", "(", "cls", ",", "definition", ":", "dict", ")", ":", "env_prefix", "=", "f\"{definition['name']}_params_\"", ".", "upper", "(", ")", "for", "key", ",", "value", "in", "os", ".", "environ", ".", "items", "(", ")", ":",...
[ 259, 4 ]
[ 271, 56 ]
python
en
['en', 'error', 'th']
False
BaseStandardPipeline.add_node
(self, component, name: str, inputs: List[str])
Add a new node to the pipeline. :param component: The object to be called when the data is passed to the node. It can be a Haystack component (like Retriever, Reader, or Generator) or a user-defined object that implements a run() method to process in...
Add a new node to the pipeline.
def add_node(self, component, name: str, inputs: List[str]): """ Add a new node to the pipeline. :param component: The object to be called when the data is passed to the node. It can be a Haystack component (like Retriever, Reader, or Generator) or a user-defined objec...
[ "def", "add_node", "(", "self", ",", "component", ",", "name", ":", "str", ",", "inputs", ":", "List", "[", "str", "]", ")", ":", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "component", ",", "name", "=", "name", ",", "inputs", ...
[ 277, 4 ]
[ 293, 77 ]
python
en
['en', 'error', 'th']
False
BaseStandardPipeline.get_node
(self, name: str)
Get a node from the Pipeline. :param name: The name of the node.
Get a node from the Pipeline.
def get_node(self, name: str): """ Get a node from the Pipeline. :param name: The name of the node. """ component = self.pipeline.get_node(name) return component
[ "def", "get_node", "(", "self", ",", "name", ":", "str", ")", ":", "component", "=", "self", ".", "pipeline", ".", "get_node", "(", "name", ")", "return", "component" ]
[ 295, 4 ]
[ 302, 24 ]
python
en
['en', 'error', 'th']
False
BaseStandardPipeline.set_node
(self, name: str, component)
Set the component for a node in the Pipeline. :param name: The name of the node. :param component: The component object to be set at the node.
Set the component for a node in the Pipeline.
def set_node(self, name: str, component): """ Set the component for a node in the Pipeline. :param name: The name of the node. :param component: The component object to be set at the node. """ self.pipeline.set_node(name, component)
[ "def", "set_node", "(", "self", ",", "name", ":", "str", ",", "component", ")", ":", "self", ".", "pipeline", ".", "set_node", "(", "name", ",", "component", ")" ]
[ 304, 4 ]
[ 311, 47 ]
python
en
['en', 'error', 'th']
False
BaseStandardPipeline.draw
(self, path: Path = Path("pipeline.png"))
Create a Graphviz visualization of the pipeline. :param path: the path to save the image.
Create a Graphviz visualization of the pipeline.
def draw(self, path: Path = Path("pipeline.png")): """ Create a Graphviz visualization of the pipeline. :param path: the path to save the image. """ self.pipeline.draw(path)
[ "def", "draw", "(", "self", ",", "path", ":", "Path", "=", "Path", "(", "\"pipeline.png\"", ")", ")", ":", "self", ".", "pipeline", ".", "draw", "(", "path", ")" ]
[ 313, 4 ]
[ 319, 32 ]
python
en
['en', 'error', 'th']
False
ExtractiveQAPipeline.__init__
(self, reader: BaseReader, retriever: BaseRetriever)
Initialize a Pipeline for Extractive Question Answering. :param reader: Reader instance :param retriever: Retriever instance
Initialize a Pipeline for Extractive Question Answering.
def __init__(self, reader: BaseReader, retriever: BaseRetriever): """ Initialize a Pipeline for Extractive Question Answering. :param reader: Reader instance :param retriever: Retriever instance """ self.pipeline = Pipeline() self.pipeline.add_node(component=retr...
[ "def", "__init__", "(", "self", ",", "reader", ":", "BaseReader", ",", "retriever", ":", "BaseRetriever", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "retriever", ",", "na...
[ 323, 4 ]
[ 332, 85 ]
python
en
['en', 'error', 'th']
False
DocumentSearchPipeline.__init__
(self, retriever: BaseRetriever)
Initialize a Pipeline for semantic document search. :param retriever: Retriever instance
Initialize a Pipeline for semantic document search.
def __init__(self, retriever: BaseRetriever): """ Initialize a Pipeline for semantic document search. :param retriever: Retriever instance """ self.pipeline = Pipeline() self.pipeline.add_node(component=retriever, name="Retriever", inputs=["Query"])
[ "def", "__init__", "(", "self", ",", "retriever", ":", "BaseRetriever", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "retriever", ",", "name", "=", "\"Retriever\"", ",", "i...
[ 342, 4 ]
[ 349, 87 ]
python
en
['en', 'error', 'th']
False
GenerativeQAPipeline.__init__
(self, generator: BaseGenerator, retriever: BaseRetriever)
Initialize a Pipeline for Generative Question Answering. :param generator: Generator instance :param retriever: Retriever instance
Initialize a Pipeline for Generative Question Answering.
def __init__(self, generator: BaseGenerator, retriever: BaseRetriever): """ Initialize a Pipeline for Generative Question Answering. :param generator: Generator instance :param retriever: Retriever instance """ self.pipeline = Pipeline() self.pipeline.add_node(co...
[ "def", "__init__", "(", "self", ",", "generator", ":", "BaseGenerator", ",", "retriever", ":", "BaseRetriever", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "retriever", ",",...
[ 359, 4 ]
[ 368, 91 ]
python
en
['en', 'error', 'th']
False
SearchSummarizationPipeline.__init__
(self, summarizer: BaseSummarizer, retriever: BaseRetriever)
Initialize a Pipeline that retrieves documents for a query and then summarizes those documents. :param summarizer: Summarizer instance :param retriever: Retriever instance
Initialize a Pipeline that retrieves documents for a query and then summarizes those documents.
def __init__(self, summarizer: BaseSummarizer, retriever: BaseRetriever): """ Initialize a Pipeline that retrieves documents for a query and then summarizes those documents. :param summarizer: Summarizer instance :param retriever: Retriever instance """ self.pipeline = P...
[ "def", "__init__", "(", "self", ",", "summarizer", ":", "BaseSummarizer", ",", "retriever", ":", "BaseRetriever", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "retriever", ",...
[ 378, 4 ]
[ 387, 93 ]
python
en
['en', 'error', 'th']
False
SearchSummarizationPipeline.run
( self, query: str, filters: Optional[Dict] = None, top_k_retriever: int = 10, generate_single_summary: bool = False, return_in_answer_format=False )
:param query: Your search query :param filters: :param top_k_retriever: Number of top docs the retriever should pass to the summarizer. The higher this value, the slower your pipeline. :param generate_single_summary: Whether to generate single summary fro...
:param query: Your search query :param filters: :param top_k_retriever: Number of top docs the retriever should pass to the summarizer. The higher this value, the slower your pipeline. :param generate_single_summary: Whether to generate single summary fro...
def run( self, query: str, filters: Optional[Dict] = None, top_k_retriever: int = 10, generate_single_summary: bool = False, return_in_answer_format=False ): """ :param query: Your search query :param filters: :param top_k_retriever: Nu...
[ "def", "run", "(", "self", ",", "query", ":", "str", ",", "filters", ":", "Optional", "[", "Dict", "]", "=", "None", ",", "top_k_retriever", ":", "int", "=", "10", ",", "generate_single_summary", ":", "bool", "=", "False", ",", "return_in_answer_format", ...
[ 389, 4 ]
[ 430, 22 ]
python
en
['en', 'error', 'th']
False
FAQPipeline.__init__
(self, retriever: BaseRetriever)
Initialize a Pipeline for finding similar FAQs using semantic document search. :param retriever: Retriever instance
Initialize a Pipeline for finding similar FAQs using semantic document search.
def __init__(self, retriever: BaseRetriever): """ Initialize a Pipeline for finding similar FAQs using semantic document search. :param retriever: Retriever instance """ self.pipeline = Pipeline() self.pipeline.add_node(component=retriever, name="Retriever", inputs=["Que...
[ "def", "__init__", "(", "self", ",", "retriever", ":", "BaseRetriever", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ".", "add_node", "(", "component", "=", "retriever", ",", "name", "=", "\"Retriever\"", ",", "i...
[ 434, 4 ]
[ 441, 87 ]
python
en
['en', 'error', 'th']
False
TranslationWrapperPipeline.__init__
( self, input_translator: BaseTranslator, output_translator: BaseTranslator, pipeline: BaseStandardPipeline )
Wrap a given `pipeline` with the `input_translator` and `output_translator`. :param input_translator: A Translator node that shall translate the input query from language A to B :param output_translator: A Translator node that shall translate the pipeline results from language B to A :...
Wrap a given `pipeline` with the `input_translator` and `output_translator`.
def __init__( self, input_translator: BaseTranslator, output_translator: BaseTranslator, pipeline: BaseStandardPipeline ): """ Wrap a given `pipeline` with the `input_translator` and `output_translator`. :param input_translator: A Translator node that shall t...
[ "def", "__init__", "(", "self", ",", "input_translator", ":", "BaseTranslator", ",", "output_translator", ":", "BaseTranslator", ",", "pipeline", ":", "BaseStandardPipeline", ")", ":", "self", ".", "pipeline", "=", "Pipeline", "(", ")", "self", ".", "pipeline", ...
[ 473, 4 ]
[ 505, 111 ]
python
en
['en', 'error', 'th']
False
JoinDocuments.__init__
( self, join_mode: str = "concatenate", weights: Optional[List[float]] = None, top_k_join: Optional[int] = None )
:param join_mode: `concatenate` to combine documents from multiple retrievers or `merge` to aggregate scores of individual documents. :param weights: A node-wise list(length of list must be equal to the number of input nodes) of weights for adjusting do...
:param join_mode: `concatenate` to combine documents from multiple retrievers or `merge` to aggregate scores of individual documents. :param weights: A node-wise list(length of list must be equal to the number of input nodes) of weights for adjusting do...
def __init__( self, join_mode: str = "concatenate", weights: Optional[List[float]] = None, top_k_join: Optional[int] = None ): """ :param join_mode: `concatenate` to combine documents from multiple retrievers or `merge` to aggregate scores of individual documents. ...
[ "def", "__init__", "(", "self", ",", "join_mode", ":", "str", "=", "\"concatenate\"", ",", "weights", ":", "Optional", "[", "List", "[", "float", "]", "]", "=", "None", ",", "top_k_join", ":", "Optional", "[", "int", "]", "=", "None", ")", ":", "asse...
[ 531, 4 ]
[ 549, 31 ]
python
en
['en', 'error', 'th']
False
test_context_profiler
(filesystem_csv_data_context)
This just validates that it's possible to profile using the datasource hook, and have validation results available in the DataContext
This just validates that it's possible to profile using the datasource hook, and have validation results available in the DataContext
def test_context_profiler(filesystem_csv_data_context): """ This just validates that it's possible to profile using the datasource hook, and have validation results available in the DataContext """ context = filesystem_csv_data_context assert isinstance(context.datasources["rad_datasource"], Pa...
[ "def", "test_context_profiler", "(", "filesystem_csv_data_context", ")", ":", "context", "=", "filesystem_csv_data_context", "assert", "isinstance", "(", "context", ".", "datasources", "[", "\"rad_datasource\"", "]", ",", "PandasDatasource", ")", "assert", "context", "....
[ 382, 0 ]
[ 438, 63 ]
python
en
['en', 'error', 'th']
False