id
int64
0
328k
repository_name
stringlengths
7
58
file_path
stringlengths
9
302
class_name
stringlengths
5
256
human_written_code
stringlengths
16
2.16M
class_skeleton
stringlengths
18
1.49M
⌀
total_program_units
int64
1
1.76k
total_doc_str
int64
0
771
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
297
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
168
CountClassBase
float64
0
40
CountClassCoupled
float64
0
583
CountClassCoupledModified
float64
0
575
CountClassDerived
float64
0
5.35k
CountDeclInstanceMethod
float64
0
529
CountDeclInstanceVariable
float64
0
296
CountDeclMethod
float64
0
599
CountDeclMethodAll
float64
0
1.12k
CountLine
float64
1
40.4k
CountLineBlank
float64
0
8.16k
CountLineCode
float64
1
25.7k
CountLineCodeDecl
float64
1
8.15k
CountLineCodeExe
float64
0
24.2k
CountLineComment
float64
0
16.5k
CountStmt
float64
1
9.71k
CountStmtDecl
float64
1
8.15k
CountStmtExe
float64
0
9.69k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
2.9k
20,000
saltstack/salt
saltstack_salt/salt/utils/parsers.py
salt.utils.parsers.SaltfileMixIn
import salt.exceptions import salt.utils.jid import salt.utils.win_functions import salt.defaults.exitcodes import salt.utils.files import salt.utils.user import salt.config as config import salt.utils.data import salt.utils.stringutils import salt._logging import salt.version as version import salt.utils.args import o...
class SaltfileMixIn(metaclass=MixInMeta): def _mixin_setup(self): pass def process_saltfile(self): pass
3
0
58
9
36
14
11
0.37
1
2
1
12
2
0
2
16
119
20
73
13
70
27
61
12
58
21
3
3
22
20,001
saltstack/salt
saltstack_salt/salt/utils/parsers.py
salt.utils.parsers.SyndicOptionParser
import salt.config as config class SyndicOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn, LogLevelMixIn, RunUserMixin, DaemonMixIn, SaltfileMixIn, metaclass=OptionParserMeta): description = 'The Salt Syndic daemon, a special Minion that passes through commands from a\nhigher Master. Scale Salt to thous...
class SyndicOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn, LogLevelMixIn, RunUserMixin, DaemonMixIn, SaltfileMixIn, metaclass=OptionParserMeta): def setup_config(self): pass
2
0
4
0
4
0
1
0.08
8
0
0
1
1
0
1
110
30
3
25
16
14
2
8
7
6
1
4
0
1
20,002
saltstack/salt
saltstack_salt/salt/utils/parsers.py
salt.utils.parsers.TargetOptionsMixIn
from functools import partial from salt.defaults import DEFAULT_TARGET_DELIM import optparse class TargetOptionsMixIn(metaclass=MixInMeta): _mixin_prio_ = 20 selected_target_option = None def _mixin_setup(self): group = self.target_options_group = optparse.OptionGroup(self, 'Target Options', 'Targ...
class TargetOptionsMixIn(metaclass=MixInMeta): def _mixin_setup(self): pass def _create_process_functions(self): pass def process(opt): pass def _mixin_after_parsed(self): pass
5
0
32
1
31
0
2
0
1
1
0
3
3
2
3
17
131
9
122
12
117
0
30
11
25
3
3
2
8
20,003
saltstack/salt
saltstack_salt/salt/utils/parsers.py
salt.utils.parsers.TimeoutMixIn
class TimeoutMixIn(metaclass=MixInMeta): _mixin_prio_ = 10 def _mixin_setup(self): if not hasattr(self, 'default_timeout'): raise RuntimeError("You need to define the 'default_timeout' attribute on {}".format(self.__class__.__name__)) self.add_option('-t', '--timeout', type=int, def...
class TimeoutMixIn(metaclass=MixInMeta): def _mixin_setup(self): pass
2
0
17
0
17
0
2
0
1
2
0
3
1
1
1
15
20
1
19
4
17
0
6
3
4
2
3
1
2
20,004
saltstack/salt
saltstack_salt/salt/utils/pkg/deb.py
salt.utils.pkg.deb.SourceEntry
import os import pathlib class SourceEntry: def __init__(self, line, file=None): self.invalid = False self.comps = [] self.disabled = False self.comment = '' self.dist = '' self.type = '' self.uri = '' self.line = line self.architectures = []...
class SourceEntry: def __init__(self, line, file=None): pass def str(self): pass def repo_line(self): ''' Return the repo line for the sources file ''' pass def _parse_sources(self, line): ''' Parse lines from sources files '''...
5
2
20
1
17
2
6
0.13
0
3
0
0
4
11
4
4
82
7
69
23
64
9
69
23
64
11
0
4
22
20,005
saltstack/salt
saltstack_salt/salt/utils/pkg/deb.py
salt.utils.pkg.deb.SourcesList
import tempfile import os import shutil import salt.utils.files import pathlib class SourcesList: def __init__(self): self.list = [] self.files = [pathlib.Path(os.sep, 'etc', 'apt', 'sources.list'), pathlib.Path(os.sep, 'etc', 'apt', 'sources.list.d')] for file in self.files: i...
class SourcesList: def __init__(self): pass def __iter__(self): pass def add_file(self, file): ''' Add the lines of a file to self.list ''' pass def add_file(self, file): pass def remove(self, source): ''' remove a source ...
7
3
11
0
9
2
3
0.2
0
4
1
0
6
2
6
6
72
6
56
21
49
11
44
18
37
5
0
3
18
20,006
saltstack/salt
saltstack_salt/salt/utils/pkg/win.py
salt.utils.pkg.win.RegSoftwareInfo
import re import platform import os.path import time import datetime class RegSoftwareInfo: """ Retrieve Registry data on a single installed software item or component. Attribute: None :codeauthor: Damon Atkins <https://github.com/damon-atkins> """ __guid_pattern = re.compile('^\\{(\\...
class RegSoftwareInfo: ''' Retrieve Registry data on a single installed software item or component. Attribute: None :codeauthor: Damon Atkins <https://github.com/damon-atkins> ''' def __init__(self, key_guid, sid=None, use_32bit=False): ''' Initialise against a software...
28
17
36
3
23
12
4
0.51
0
6
0
0
14
13
16
16
636
70
400
91
372
203
214
72
197
14
0
4
71
20,007
saltstack/salt
saltstack_salt/salt/utils/pkg/win.py
salt.utils.pkg.win.WinSoftware
from salt.utils.versions import Version import datetime import locale import platform from functools import cmp_to_key import collections import re class WinSoftware: """ Point in time snapshot of the software and components installed on a system. Attributes: None :codeauthor: Damon Atkin...
class WinSoftware: ''' Point in time snapshot of the software and components installed on a system. Attributes: None :codeauthor: Damon Atkins <https://github.com/damon-atkins> ''' def __init__(self, version_only=False, user_pkgs=False, pkg_obj=None): ''' Point in t...
25
20
36
4
22
11
5
0.49
0
14
2
0
16
5
19
19
736
90
453
93
426
222
271
84
251
46
0
5
100
20,008
saltstack/salt
saltstack_salt/salt/utils/process.py
salt.utils.process.Process
import salt.utils.versions import salt.utils.path import functools import multiprocessing import salt._logging import salt.utils.platform import multiprocessing.util import salt.defaults.exitcodes import salt.utils.files import copy class Process(multiprocessing.Process): """ Salt relies on this custom impleme...
class Process(multiprocessing.Process): ''' Salt relies on this custom implementation of :py:class:`~multiprocessing.Process` to simplify/automate some common procedures, for example, logging in the new process is configured for "free" for every new process. This is most important in platforms whic...
9
6
36
2
24
12
3
1.11
1
3
0
4
6
1
6
6
247
36
104
21
95
115
72
19
64
12
1
4
23
20,009
saltstack/salt
saltstack_salt/salt/utils/process.py
salt.utils.process.ProcessManager
import multiprocessing.util import time from tornado import gen import inspect import salt.defaults.exitcodes import multiprocessing import salt.utils.path import salt._logging import salt.utils.files import errno import subprocess import salt.utils.platform import salt.utils.versions import signal import os class Pro...
class ProcessManager: ''' A class which will manage processes that should be running ''' def __init__(self, name=None, wait_for_kill=1): pass def add_process(self, tgt, args=None, kwargs=None, name=None): ''' Create a processes and args + kwargs This will deter...
12
7
30
2
21
7
6
0.34
0
5
2
0
10
6
10
10
315
32
213
30
201
72
158
25
147
24
0
5
59
20,010
saltstack/salt
saltstack_salt/salt/utils/process.py
salt.utils.process.SignalHandlingProcess
import salt._logging import salt.utils.versions import salt.utils.files import salt.defaults.exitcodes import os import salt.utils.path import signal import salt.utils.platform class SignalHandlingProcess(Process): def __new__(cls, *args, **kwargs): instance = super().__new__(cls, *args, **kwargs) ...
class SignalHandlingProcess(Process): def __new__(cls, *args, **kwargs): pass def _setup_signals(self): pass def _handle_signals(self, signum, sigframe): pass def start(self): pass
5
0
16
1
14
1
4
0.05
1
4
0
17
4
0
4
10
66
6
58
10
53
3
39
10
34
11
2
6
14
20,011
saltstack/salt
saltstack_salt/salt/utils/process.py
salt.utils.process.SubprocessList
import multiprocessing import multiprocessing.util class SubprocessList: def __init__(self, processes=None, lock=None): if processes is None: self.processes = [] else: self.processes = processes if lock is None: self.lock = multiprocessing.Lock() ...
class SubprocessList: def __init__(self, processes=None, lock=None): pass def add(self, proc): pass def cleanup(self): pass
4
0
8
0
8
0
2
0
0
0
0
0
3
3
3
3
27
2
25
8
21
0
23
8
19
3
0
3
7
20,012
saltstack/salt
saltstack_salt/salt/utils/process.py
salt.utils.process.ThreadPool
import queue import multiprocessing.util import threading import multiprocessing class ThreadPool: """ This is a very VERY basic threadpool implementation This was made instead of using multiprocessing ThreadPool because we want to set max queue size and we want to daemonize threads (neither is exp...
class ThreadPool: ''' This is a very VERY basic threadpool implementation This was made instead of using multiprocessing ThreadPool because we want to set max queue size and we want to daemonize threads (neither is exposed in the stdlib version). Since there isn't much use for this class as of ...
4
1
17
1
14
3
4
0.52
0
6
0
0
3
3
3
3
70
8
42
11
38
22
37
10
33
5
0
3
12
20,013
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.Options
class Options(dict): def __getattr__(self, name): return self.get(name)
class Options(dict): def __getattr__(self, name): pass
2
0
2
0
2
0
1
0
1
0
0
0
1
0
1
28
3
0
3
2
1
0
3
2
1
1
2
0
1
20,014
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.PyDslError
class PyDslError(Exception): pass
class PyDslError(Exception): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
10
2
0
2
1
1
0
2
1
1
0
3
0
0
20,015
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.Sls
from salt.state import HighState from salt.utils.odict import OrderedDict from uuid import uuid4 as _uuid class Sls: def __init__(self, sls, saltenv, rendered_sls): self.name = sls self.saltenv = saltenv self.includes = [] self.included_highstate = HighState.get_active().building_h...
class Sls: def __init__(self, sls, saltenv, rendered_sls): pass @classmethod def get_all_decls(cls): pass @classmethod def get_render_stack(cls): pass def set(self, **options): pass def include(self, *sls_names, **kws): pass def extend(self, *...
14
0
12
1
11
1
4
0.09
0
9
4
0
9
9
11
11
148
20
121
52
106
11
111
48
98
13
0
4
42
20,016
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.StateDeclaration
from salt.state import HighState from salt.utils.odict import OrderedDict class StateDeclaration: def __init__(self, id): self._id = id self._mods = [] def __getattr__(self, name): for m in self._mods: if m._name == name: return m m = StateModule(na...
class StateDeclaration: def __init__(self, id): pass def __getattr__(self, name): pass def __str__(self): pass def __iter__(self): pass def _repr(self, context=None): pass def __call__(self, check=True): pass
7
0
11
1
10
0
3
0.02
0
7
4
0
6
2
6
6
71
10
60
17
52
1
42
17
34
9
0
3
16
20,017
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.StateFunction
class StateFunction: def __init__(self, name, parent_mod): self.mod = parent_mod self.name = name self.args = [] self.require_index = None sls = Sls.get_render_stack()[-1] if sls.options.ordered: last_f = sls.last_func() if last_f: ...
class StateFunction: def __init__(self, name, parent_mod): pass def _remove_auto_require(self): pass def __call__(self, *args, **kws): pass def _repr(self, context=None): pass def configure(self, args, kws): pass def reference(self, req_type, mod, re...
7
0
10
1
8
0
3
0.04
0
6
3
0
6
4
6
6
70
12
56
17
49
2
49
17
42
4
0
2
16
20,018
saltstack/salt
saltstack_salt/salt/utils/pydsl.py
salt.utils.pydsl.StateModule
class StateModule: def __init__(self, name, parent_decl): self._state_id = parent_decl self._name = name self._func = None def __getattr__(self, name): if self._func: if name == self._func.name: return self._func else: if ...
class StateModule: def __init__(self, name, parent_decl): pass def __getattr__(self, name): pass def __call__(self, _fname, *args, **kws): pass def __str__(self): pass def _repr(self, context=None): pass
6
0
6
0
6
0
2
0
0
2
2
0
5
3
5
5
36
5
31
10
25
0
26
9
20
6
0
4
10
20,019
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.DuplicateState
class DuplicateState(StateException): pass
class DuplicateState(StateException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
10
2
0
2
1
1
0
2
1
1
0
4
0
0
20,020
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.InvalidFunction
class InvalidFunction(StateException): pass
class InvalidFunction(StateException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
10
2
0
2
1
1
0
2
1
1
0
4
0
0
20,021
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.Map
class Map(metaclass=MapMeta): __salt__ = {'grains.filter_by': need_salt, 'pillar.get': need_salt}
class Map(metaclass=MapMeta): pass
1
0
0
0
0
0
0
0.5
1
0
0
0
0
0
0
17
2
0
2
2
1
1
2
2
1
0
3
0
0
20,022
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.MapMeta
import inspect from salt.utils.odict import OrderedDict class MapMeta(type): """ This is the metaclass for our Map class, used for building data maps based off of grain data. """ @classmethod def __prepare__(metacls, name, bases): return OrderedDict() def __new__(cls, name, bases,...
class MapMeta(type): ''' This is the metaclass for our Map class, used for building data maps based off of grain data. ''' @classmethod def __prepare__(metacls, name, bases): pass def __new__(cls, name, bases, attrs): pass def __init__(cls, name, bases, nmspc): ...
6
1
21
3
14
4
6
0.36
1
8
1
1
3
0
4
17
94
15
59
20
53
21
57
19
52
19
2
6
22
20,023
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.Registry
from salt.utils.odict import OrderedDict class Registry: """ The StateRegistry holds all of the states that have been created. """ states = OrderedDict() requisites = [] includes = [] extends = OrderedDict() enabled = True @classmethod def empty(cls): cls.states = Order...
class Registry: ''' The StateRegistry holds all of the states that have been created. ''' @classmethod def empty(cls): pass @classmethod def include(cls, *args): pass @classmethod def salt_data(cls): pass @classmethod def add(cls, id_, state, extend=F...
17
1
8
1
7
0
3
0.06
0
3
2
0
0
0
8
8
91
20
67
25
50
4
51
17
42
8
0
3
20
20,024
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.SaltObject
class SaltObject: """ Object based interface to the functions in __salt__ .. code-block:: python :linenos: Salt = SaltObject(__salt__) Salt.cmd.run(bar) """ def __init__(self, salt): self._salt = salt def __getattr__(self, mod): class __wrapper__: ...
class SaltObject: ''' Object based interface to the functions in __salt__ .. code-block:: python :linenos: Salt = SaltObject(__salt__) Salt.cmd.run(bar) ''' def __init__(self, salt): pass def __getattr__(self, mod): pass class __wrapper__: d...
5
1
5
0
5
1
1
0.73
0
1
1
0
2
1
2
2
23
5
11
6
6
8
11
6
6
2
0
1
4
20,025
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.State
class State: """ This represents a single item in the state tree The id_ is the id of the state, the func is the full name of the salt state (i.e. file.managed). All the keyword args you pass in become the properties of your state. """ def __init__(self, id_, module, func, **kwargs): ...
class State: ''' This represents a single item in the state tree The id_ is the id of the state, the func is the full name of the salt state (i.e. file.managed). All the keyword args you pass in become the properties of your state. ''' def __init__(self, id_, module, func, **kwargs): ...
10
1
7
1
5
1
2
0.36
0
4
3
0
7
5
7
7
66
13
39
18
29
14
33
16
25
5
0
3
14
20,026
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.StateException
class StateException(Exception): pass
class StateException(Exception): pass
1
0
0
0
0
0
0
0
1
0
0
2
0
0
0
10
2
0
2
1
1
0
2
1
1
0
3
0
0
20,027
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.StateExtend
class StateExtend: def __init__(self, name): self.name = name
class StateExtend: def __init__(self, name): pass
2
0
2
0
2
0
1
0
0
0
0
0
1
1
1
1
3
0
3
3
1
0
3
3
1
1
0
0
1
20,028
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.StateFactory
class StateFactory: """ The StateFactory is used to generate new States through a natural syntax It is used by initializing it with the name of the salt module:: File = StateFactory("file") Any attribute accessed on the instance returned by StateFactory is a lambda that is a short cut for...
class StateFactory: ''' The StateFactory is used to generate new States through a natural syntax It is used by initializing it with the name of the salt module:: File = StateFactory("file") Any attribute accessed on the instance returned by StateFactory is a lambda that is a short cut for ge...
5
2
6
1
5
1
2
0.72
0
3
3
0
3
2
3
3
41
10
18
7
13
13
14
7
9
2
0
1
6
20,029
saltstack/salt
saltstack_salt/salt/utils/pyobjects.py
salt.utils.pyobjects.StateRequisite
class StateRequisite: def __init__(self, requisite, module, id_): self.requisite = requisite self.module = module self.id_ = id_ def __call__(self): return {self.module: self.id_} def __enter__(self): Registry.push_requisite(self) def __exit__(self, type, valu...
class StateRequisite: def __init__(self, requisite, module, id_): pass def __call__(self): pass def __enter__(self): pass def __exit__(self, type, value, traceback): pass
5
0
3
0
3
0
1
0
0
1
1
0
4
3
4
4
14
3
11
8
6
0
11
8
6
1
0
0
4
20,030
saltstack/salt
saltstack_salt/salt/utils/reactor.py
salt.utils.reactor.ReactWrap
import salt.utils.master import salt.client import salt.utils.event import salt.runner import salt.utils.data import salt.utils.args import salt.wheel import salt.utils.files import salt.state import salt.utils.yaml import salt.utils.process import salt.utils.cache import salt.defaults.exitcodes class ReactWrap: "...
class ReactWrap: ''' Wrapper that executes low data for the Reactor System ''' def __init__(self, opts): pass def populate_client_cache(self, low): ''' Populate the client cache with an instance of the specified type ''' pass def run(self, low): ...
8
7
26
1
17
8
4
0.44
0
7
2
0
7
2
7
7
203
17
131
23
123
58
72
23
64
17
0
5
26
20,031
saltstack/salt
saltstack_salt/salt/utils/reactor.py
salt.utils.reactor.Reactor
import fnmatch import salt.utils.process import salt.utils.data import salt.state import salt.runner import salt.utils.files import salt.defaults.exitcodes import salt.utils.master import salt.utils.event import glob import salt.wheel import salt.utils.args import salt.utils.yaml import os import salt.utils.cache impor...
class Reactor(salt.utils.process.SignalHandlingProcess, salt.state.Compiler): ''' Read in the reactor configuration variable and compare it to events processed on the master. The reactor has the capability to execute pre-programmed executions as reactions to events ''' def __init__(self, o...
11
10
24
1
19
4
5
0.26
2
9
1
0
10
4
10
27
259
20
195
51
184
50
145
46
134
16
3
6
54
20,032
saltstack/salt
saltstack_salt/salt/utils/requisite.py
salt.utils.requisite.DependencyGraph
from collections.abc import Generator, Iterable, Sequence from collections import defaultdict import networkx as nx import fnmatch class DependencyGraph: """ Class used to track dependencies (requisites) among salt states. This class utilizes a Directed Acyclic Graph to determine the ordering of state...
class DependencyGraph: ''' Class used to track dependencies (requisites) among salt states. This class utilizes a Directed Acyclic Graph to determine the ordering of states. The nodes represent the individual states that can be depended on and edges represent the types of requisites between the...
18
7
21
0
17
4
4
0.25
0
14
1
0
16
3
16
16
382
26
286
94
258
72
210
79
192
12
0
5
76
20,033
saltstack/salt
saltstack_salt/salt/utils/requisite.py
salt.utils.requisite.RequisiteType
from enum import Enum, auto from typing import TYPE_CHECKING, Any class RequisiteType(str, Enum): """Types of direct requisites""" @staticmethod_hack def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> tuple[str, int]: return (name.lower(), count) def __new...
class RequisiteType(str, Enum): '''Types of direct requisites''' @staticmethod_hack def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> tuple[str, int]: pass def __new__(cls, value, weight): pass def __init__(self, value, weight): pass ...
6
1
4
0
4
0
1
0.22
2
5
0
0
3
2
3
118
37
4
27
22
20
6
24
19
20
1
4
0
3
20,034
saltstack/salt
saltstack_salt/salt/utils/roster_matcher.py
salt.utils.roster_matcher.RosterMatcher
import re import functools import copy import fnmatch class RosterMatcher: """ Matcher for the roster data structure """ def __init__(self, raw, tgt, tgt_type, ipv='ipv4'): self.tgt = tgt self.tgt_type = tgt_type self.raw = raw self.ipv = ipv def targets(self): ...
class RosterMatcher: ''' Matcher for the roster data structure ''' def __init__(self, raw, tgt, tgt_type, ipv='ipv4'): pass def targets(self): ''' Execute the correct tgt_type routine and return ''' pass def _ret_minions(self, filter_): ''' ...
10
9
8
0
5
3
2
0.6
0
5
0
0
9
4
9
9
85
10
47
25
37
28
46
25
36
3
0
2
15
20,035
saltstack/salt
saltstack_salt/salt/utils/rsax931.py
salt.utils.rsax931.RSAX931Signer
import salt.utils.stringutils import salt.utils.platform from ctypes import c_char_p, c_int, c_void_p, cdll, create_string_buffer, pointer class RSAX931Signer: """ Create ANSI X9.31 RSA signatures using OpenSSL libcrypto """ def __init__(self, keydata): """ Init an RSAX931Signer instan...
class RSAX931Signer: ''' Create ANSI X9.31 RSA signatures using OpenSSL libcrypto ''' def __init__(self, keydata): ''' Init an RSAX931Signer instance :param str keydata: The RSA private key in PEM format ''' pass def __del__(self): pass def sig...
4
3
11
1
7
4
2
0.76
0
2
0
0
3
2
3
3
43
6
21
8
17
16
17
8
13
2
0
1
5
20,036
saltstack/salt
saltstack_salt/salt/utils/rsax931.py
salt.utils.rsax931.RSAX931Verifier
import salt.utils.platform from ctypes import c_char_p, c_int, c_void_p, cdll, create_string_buffer, pointer import salt.utils.stringutils class RSAX931Verifier: """ Verify ANSI X9.31 RSA signatures using OpenSSL libcrypto """ def __init__(self, pubdata): """ Init an RSAX931Verifier in...
class RSAX931Verifier: ''' Verify ANSI X9.31 RSA signatures using OpenSSL libcrypto ''' def __init__(self, pubdata): ''' Init an RSAX931Verifier instance :param str pubdata: The RSA public key in PEM format ''' pass def __del__(self): pass def ...
4
3
12
1
7
4
2
0.77
0
2
0
0
3
2
3
3
45
6
22
8
18
17
18
8
14
2
0
1
5
20,037
saltstack/salt
saltstack_salt/salt/utils/sanitizers.py
salt.utils.sanitizers.InputSanitizer
import re from salt.exceptions import CommandExecutionError import os.path class InputSanitizer: @staticmethod def trim(value): """ Raise an exception if value is empty. Otherwise strip it down. :param value: :return: """ value = (value or '').strip() if...
class InputSanitizer: @staticmethod def trim(value): ''' Raise an exception if value is empty. Otherwise strip it down. :param value: :return: ''' pass @staticmethod def filename(value): ''' Remove everything that would affect paths in th...
7
3
10
1
4
5
1
0.94
0
2
1
0
0
0
3
3
37
6
16
7
9
15
11
4
7
2
0
1
4
20,038
saltstack/salt
saltstack_salt/salt/utils/schedule.py
salt.utils.schedule.Schedule
import sys import salt.utils.user import signal import salt.utils.stringutils import random import salt.utils.process import os import salt.utils.platform import logging import salt.utils.minion import itertools import salt.utils.master import errno import salt.utils.jid import datetime import salt.utils.files import c...
class Schedule: ''' Create a Schedule object, pass in the opts and the functions dict to use ''' def __new__(cls, opts, functions, returners=None, intervals=None, cleanup=None, proxy=None, standalone=False, new_instance=False, utils=None, _subprocess_list=None): ''' Only create one ins...
42
37
55
5
42
7
8
0.19
0
22
4
0
29
15
29
29
1,813
215
1,346
215
1,267
255
884
162
842
77
0
5
342
20,039
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.AllOfItem
class AllOfItem(OneOfItem): __type__ = 'allOf'
class AllOfItem(OneOfItem): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
24
3
1
2
2
1
0
2
2
1
0
5
0
0
20,040
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.AnyOfItem
class AnyOfItem(OneOfItem): __type__ = 'anyOf'
class AnyOfItem(OneOfItem): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
24
3
1
2
2
1
0
2
2
1
0
5
0
0
20,041
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.ArrayItem
class ArrayItem(BaseSchemaItem): __type__ = 'array' __serialize_attr_aliases__ = {'min_items': 'minItems', 'max_items': 'maxItems', 'unique_items': 'uniqueItems', 'additional_items': 'additionalItems'} items = None min_items = None max_items = None unique_items = None additional_items = None...
class ArrayItem(BaseSchemaItem): def __init__(self, items=None, min_items=None, max_items=None, unique_items=None, additional_items=None, **kwargs): ''' :param required: If the configuration item is required. Defaults to ``False``. :param title: A short explanation a...
4
1
26
0
15
10
6
0.53
1
5
1
0
3
0
3
27
95
5
59
22
47
31
37
14
33
7
5
4
17
20,042
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.BaseSchemaItem
import textwrap class BaseSchemaItem(SchemaItem): """ Base configuration items class. All configurations must subclass it """ description = None title = None default = None enum = None enumNames = None def __init__(self, title=None, description=None, default=None, enum=None, e...
class BaseSchemaItem(SchemaItem): ''' Base configuration items class. All configurations must subclass it ''' def __init__(self, title=None, description=None, default=None, enum=None, enumNames=None, **kwargs): ''' :param required: If the configuration item is requi...
5
3
20
0
16
5
6
0.47
1
5
0
7
4
0
4
24
106
6
68
21
55
32
49
13
44
8
4
3
23
20,043
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.BaseSchemaItemMeta
from salt.utils.odict import OrderedDict import salt.utils.args import inspect class BaseSchemaItemMeta(type): """ Config item metaclass to "tag" the class as a configuration item """ @classmethod def __prepare__(mcs, name, bases): return OrderedDict() def __new__(mcs, name, bases, at...
class BaseSchemaItemMeta(type): ''' Config item metaclass to "tag" the class as a configuration item ''' @classmethod def __prepare__(mcs, name, bases): pass def __new__(mcs, name, bases, attrs): pass def __call__(cls, *args, **kwargs): pass
5
1
20
0
15
5
5
0.4
1
4
0
1
2
0
3
16
69
3
47
13
42
19
40
12
36
8
2
4
16
20,044
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.BooleanItem
class BooleanItem(BaseSchemaItem): __type__ = 'boolean'
class BooleanItem(BaseSchemaItem): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
24
2
0
2
2
1
0
2
2
1
0
5
0
0
20,045
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.ComplexSchemaItem
class ComplexSchemaItem(BaseSchemaItem): """ .. versionadded:: 2016.11.0 Complex Schema Item """ _attributes = [] _definition_name = None def __init__(self, definition_name=None, required=None): super().__init__(required=required) self.__type__ = 'object' self._defi...
class ComplexSchemaItem(BaseSchemaItem): ''' .. versionadded:: 2016.11.0 Complex Schema Item ''' def __init__(self, definition_name=None, required=None): pass def _add_missing_schema_attributes(self): ''' Adds any missed schema attributes to the _attributes list ...
8
5
11
1
8
3
2
0.47
1
1
0
26
6
1
6
30
85
14
49
18
41
23
39
17
32
6
5
3
14
20,046
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.DateTimeItem
class DateTimeItem(StringItem): """ An ISO 8601 formatted date-time configuration field, as defined by `RFC 3339, section 5.6`__. .. __: http://tools.ietf.org/html/rfc3339 """ __format__ = 'date-time'
class DateTimeItem(StringItem): ''' An ISO 8601 formatted date-time configuration field, as defined by `RFC 3339, section 5.6`__. .. __: http://tools.ietf.org/html/rfc3339 ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
26
8
2
2
2
1
4
2
2
1
0
6
0
0
20,047
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.DefinitionsSchema
from salt.utils.odict import OrderedDict class DefinitionsSchema(Schema): """ .. versionadded:: 2016.11.0 JSON schema class that supports ComplexSchemaItem objects by adding a definitions section to the JSON schema, containing the item definitions. All references to ComplexSchemaItems are built u...
class DefinitionsSchema(Schema): ''' .. versionadded:: 2016.11.0 JSON schema class that supports ComplexSchemaItem objects by adding a definitions section to the JSON schema, containing the item definitions. All references to ComplexSchemaItems are built using schema inline dereferencing. '...
3
1
37
5
27
5
10
0.41
1
8
5
12
0
0
1
20
49
8
29
9
26
12
24
8
22
10
4
3
10
20,048
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.DictItem
from salt.utils.odict import OrderedDict class DictItem(BaseSchemaItem): __type__ = 'object' __serialize_attr_aliases__ = {'min_properties': 'minProperties', 'max_properties': 'maxProperties', 'pattern_properties': 'patternProperties', 'additional_properties': 'additionalProperties'} properties = None ...
class DictItem(BaseSchemaItem): def __init__(self, properties=None, pattern_properties=None, additional_properties=None, min_properties=None, max_properties=None, **kwargs): ''' :param required: If the configuration item is required. Defaults to ``False``. :type required: ...
8
1
20
0
15
5
5
0.3
1
6
1
0
7
1
7
31
163
10
118
33
102
35
78
25
70
13
5
4
37
20,049
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.EMailItem
class EMailItem(StringItem): """ An internet email address, see `RFC 5322, section 3.4.1`__. .. __: http://tools.ietf.org/html/rfc5322 """ __format__ = 'email'
class EMailItem(StringItem): ''' An internet email address, see `RFC 5322, section 3.4.1`__. .. __: http://tools.ietf.org/html/rfc5322 ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
26
8
2
2
2
1
4
2
2
1
0
6
0
0
20,050
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.HostnameItem
class HostnameItem(StringItem): """ An Internet host name configuration field, see `RFC 1034, section 3.1`__. .. __: http://tools.ietf.org/html/rfc1034 """ __format__ = 'hostname'
class HostnameItem(StringItem): ''' An Internet host name configuration field, see `RFC 1034, section 3.1`__. .. __: http://tools.ietf.org/html/rfc1034 ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
26
8
2
2
2
1
4
2
2
1
0
6
0
0
20,051
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.IPv4Item
class IPv4Item(StringItem): """ An IPv4 address configuration field, according to dotted-quad ABNF syntax as defined in `RFC 2673, section 3.2`__. .. __: http://tools.ietf.org/html/rfc2673 """ __format__ = 'ipv4'
class IPv4Item(StringItem): ''' An IPv4 address configuration field, according to dotted-quad ABNF syntax as defined in `RFC 2673, section 3.2`__. .. __: http://tools.ietf.org/html/rfc2673 ''' pass
1
1
0
0
0
0
0
2.5
1
0
0
0
0
0
0
26
9
2
2
2
1
5
2
2
1
0
6
0
0
20,052
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.IPv6Item
class IPv6Item(StringItem): """ An IPv6 address configuration field, as defined in `RFC 2373, section 2.2`__. .. __: http://tools.ietf.org/html/rfc2373 """ __format__ = 'ipv6'
class IPv6Item(StringItem): ''' An IPv6 address configuration field, as defined in `RFC 2373, section 2.2`__. .. __: http://tools.ietf.org/html/rfc2373 ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
26
8
2
2
2
1
4
2
2
1
0
6
0
0
20,053
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.IntegerItem
class IntegerItem(NumberItem): __type__ = 'integer'
class IntegerItem(NumberItem): pass
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
25
2
0
2
2
1
0
2
2
1
0
6
0
0
20,054
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.NotItem
class NotItem(SchemaItem): __type__ = 'not' item = None def __init__(self, item=None): if item is not None: self.item = item super().__init__() def __validate_attributes__(self): if not self.item: raise RuntimeError('An item must be passed') if n...
class NotItem(SchemaItem): def __init__(self, item=None): pass def __validate_attributes__(self): pass def serialize(self): pass
4
0
5
0
5
0
2
0
1
3
1
0
3
0
3
23
22
5
17
6
13
0
14
6
10
3
4
1
6
20,055
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.NullItem
class NullItem(BaseSchemaItem): __type__ = 'null'
class NullItem(BaseSchemaItem): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
24
3
1
2
2
1
0
2
2
1
0
5
0
0
20,056
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.NullSentinel
class NullSentinel: """ A class which instance represents a null value. Allows specifying fields with a default value of null. """ def __bool__(self): return False __nonzero__ = __bool__
class NullSentinel: ''' A class which instance represents a null value. Allows specifying fields with a default value of null. ''' def __bool__(self): pass
2
1
2
0
2
0
1
1
0
0
0
0
1
0
1
1
10
2
4
3
2
4
4
3
2
1
0
0
1
20,057
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.NumberItem
class NumberItem(BaseSchemaItem): __type__ = 'number' __serialize_attr_aliases__ = {'multiple_of': 'multipleOf', 'exclusive_minimum': 'exclusiveMinimum', 'exclusive_maximum': 'exclusiveMaximum'} multiple_of = None minimum = None exclusive_minimum = None maximum = None exclusive_maximum = Non...
class NumberItem(BaseSchemaItem): def __init__(self, multiple_of=None, minimum=None, exclusive_minimum=None, maximum=None, exclusive_maximum=None, **kwargs): ''' :param required: If the configuration item is required. Defaults to ``False``. :param title: A short expl...
2
1
43
0
20
23
6
0.72
1
1
0
1
1
0
1
25
59
4
32
17
22
23
20
9
18
6
5
1
6
20,058
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.OneOfItem
class OneOfItem(SchemaItem): __type__ = 'oneOf' items = None def __init__(self, items=None, required=None): if items is not None: self.items = items super().__init__(required=required) def __validate_attributes__(self): if not self.items: raise RuntimeEr...
class OneOfItem(SchemaItem): def __init__(self, items=None, required=None): pass def __validate_attributes__(self): pass def __call__(self, flatten=False): pass def serialize(self): pass
5
0
7
0
7
0
3
0
1
6
1
2
4
1
4
24
36
6
30
9
25
0
22
9
17
6
4
2
10
20,059
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.PortItem
class PortItem(IntegerItem): minimum = 0 maximum = 65535
class PortItem(IntegerItem): pass
1
0
0
0
0
0
0
0.33
1
0
0
0
0
0
0
25
3
0
3
3
2
1
3
3
2
0
7
0
0
20,060
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.RequirementsItem
class RequirementsItem(SchemaItem): __type__ = 'object' requirements = None def __init__(self, requirements=None): if requirements is not None: self.requirements = requirements super().__init__() def __validate_attributes__(self): if self.requirements is None: ...
class RequirementsItem(SchemaItem): def __init__(self, requirements=None): pass def __validate_attributes__(self): pass def serialize(self): pass
4
0
11
1
11
0
4
0
1
7
0
0
3
0
3
23
41
6
35
9
31
0
28
9
24
7
4
3
13
20,061
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.Schema
from salt.utils.odict import OrderedDict import textwrap class Schema(metaclass=SchemaMeta): """ Configuration definition class """ title = None description = None _items = _sections = _order = None __flatten__ = False __allow_additional_items__ = False @classmethod def seriali...
class Schema(metaclass=SchemaMeta): ''' Configuration definition class ''' @classmethod def serialize(cls, id_=None): pass @classmethod def defaults(cls): pass @classmethod def as_requirements_item(cls): pass
7
1
38
2
32
6
12
0.21
1
3
1
76
0
0
3
19
132
11
104
33
97
22
93
30
89
28
3
5
37
20,062
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.SchemaItem
class SchemaItem(metaclass=BaseSchemaItemMeta): """ Base configuration items class. All configurations must subclass it """ __type__ = None __format__ = None _attributes = None __flatten__ = False __serialize_attr_aliases__ = None required = False def __init__(self, require...
class SchemaItem(metaclass=BaseSchemaItemMeta): ''' Base configuration items class. All configurations must subclass it ''' def __init__(self, required=None, **extra): ''' :param required: If the configuration item is required. Defaults to ``False``. ''' pass ...
5
5
11
1
5
5
3
0.96
1
2
0
4
4
1
4
20
62
10
27
13
22
26
27
13
22
5
3
1
10
20,063
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.SchemaMeta
from salt.utils.odict import OrderedDict class SchemaMeta(type): @classmethod def __prepare__(mcs, name, bases): return OrderedDict() def __new__(mcs, name, bases, attrs): attrs['__config__'] = True attrs['__flatten__'] = False attrs['__config_name__'] = None items...
class SchemaMeta(type): @classmethod def __prepare__(mcs, name, bases): pass def __new__(mcs, name, bases, attrs): pass def __call__(cls, flatten=False, allow_additional_items=False, **kwargs): pass
5
0
19
1
14
4
5
0.3
1
2
0
1
2
0
3
16
62
5
44
12
39
13
43
11
39
10
2
3
14
20,064
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.SecretItem
class SecretItem(StringItem): """ A string configuration field containing a secret, for example, passwords, API keys, etc """ __format__ = 'secret'
class SecretItem(StringItem): ''' A string configuration field containing a secret, for example, passwords, API keys, etc ''' pass
1
1
0
0
0
0
0
1.5
1
0
0
0
0
0
0
26
6
1
2
2
1
3
2
2
1
0
6
0
0
20,065
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.StringItem
class StringItem(BaseSchemaItem): """ A string configuration field """ __type__ = 'string' __serialize_attr_aliases__ = {'min_length': 'minLength', 'max_length': 'maxLength'} format = None pattern = None min_length = None max_length = None def __init__(self, format=None, pattern...
class StringItem(BaseSchemaItem): ''' A string configuration field ''' def __init__(self, format=None, pattern=None, min_length=None, max_length=None, **kwargs): ''' :param required: If the configuration item is required. Defaults to ``False``. :param title: ...
3
2
21
0
10
12
4
0.96
1
1
0
9
2
1
2
26
56
5
27
16
17
26
20
9
17
5
5
1
7
20,066
saltstack/salt
saltstack_salt/salt/utils/schema.py
salt.utils.schema.UriItem
class UriItem(StringItem): """ A universal resource identifier (URI) configuration field, according to `RFC3986`__. .. __: http://tools.ietf.org/html/rfc3986 """ __format__ = 'uri'
class UriItem(StringItem): ''' A universal resource identifier (URI) configuration field, according to `RFC3986`__. .. __: http://tools.ietf.org/html/rfc3986 ''' pass
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
26
8
2
2
2
1
4
2
2
1
0
6
0
0
20,067
saltstack/salt
saltstack_salt/salt/utils/smb.py
salt.utils.smb.SMBProto
import uuid import socket class SMBProto: def __init__(self, server, username, password, port=445): connection_id = uuid.uuid4() addr = socket.getaddrinfo(server, None, 0, 0, socket.IPPROTO_TCP)[0][4][0] self.server = server connection = Connection(connection_id, addr, port, requir...
null
13
0
9
0
8
0
1
0.04
0
0
0
0
5
2
8
8
82
9
70
29
57
3
49
25
40
2
0
1
10
20,068
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.SSDPBase
import logging import socket class SSDPBase: """ Salt Service Discovery Protocol. """ log = logging.getLogger(__name__) SIGNATURE = 'signature' ANSWER = 'answer' PORT = 'port' LISTEN_IP = 'listen_ip' TIMEOUT = 'timeout' DEFAULTS = {SIGNATURE: '__salt_master_service', PORT: 4520,...
class SSDPBase: ''' Salt Service Discovery Protocol. ''' @staticmethod def _is_available(): ''' Return True if the USSDP dependencies are satisfied. :return: ''' pass @staticmethod def get_self_ip(): ''' Find out localhost outside IP. ...
5
3
11
1
6
5
2
0.54
0
3
0
3
0
0
2
2
47
6
28
14
23
15
19
12
16
2
0
1
3
20,069
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.SSDPDiscoveryClient
import salt.utils.stringutils import socket import salt.utils.json import time class SSDPDiscoveryClient(SSDPBase): """ Class to discover Salt Master via UDP broadcast. """ @staticmethod def is_available(): """ Return availability of the Client :return: """ ...
class SSDPDiscoveryClient(SSDPBase): ''' Class to discover Salt Master via UDP broadcast. ''' @staticmethod def is_available(): ''' Return availability of the Client :return: ''' pass def __init__(self, **config): ''' Initialize '...
7
6
19
1
14
4
3
0.33
1
2
0
0
4
2
5
7
103
8
73
19
66
24
50
17
44
8
1
6
17
20,070
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.SSDPDiscoveryServer
import socket import copy class SSDPDiscoveryServer(SSDPBase): """ Discovery service publisher. """ @staticmethod def is_available(): """ Return availability of the Server. :return: """ return SSDPBase._is_available() def __init__(self, **config): ...
class SSDPDiscoveryServer(SSDPBase): ''' Discovery service publisher. ''' @staticmethod def is_available(): ''' Return availability of the Server. :return: ''' pass def __init__(self, **config): ''' Initialize. :param config: ...
7
5
34
1
29
5
6
0.19
1
7
1
0
2
1
4
6
147
8
118
35
103
23
76
24
71
18
1
5
23
20,071
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.SSDPFactory
import salt.utils.json import random import salt.utils.stringutils import datetime import time import socket class SSDPFactory(SSDPBase): """ Socket protocol factory. """ def __init__(self, **config): """ Initialize :param config: """ for attr in (self.SIGNATUR...
class SSDPFactory(SSDPBase): ''' Socket protocol factory. ''' def __init__(self, **config): ''' Initialize :param config: ''' pass def __call__(self, *args, **kwargs): ''' Return instance on Factory call. :param args: :param ...
7
6
18
1
12
5
3
0.5
1
6
0
0
5
5
5
7
115
13
68
18
61
34
46
15
39
7
1
3
15
20,072
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.TimeOutException
class TimeOutException(Exception): pass
class TimeOutException(Exception): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
10
2
0
2
1
1
0
2
1
1
0
3
0
0
20,073
saltstack/salt
saltstack_salt/salt/utils/ssdp.py
salt.utils.ssdp.TimeStampException
class TimeStampException(Exception): pass
class TimeStampException(Exception): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
10
2
0
2
1
1
0
2
1
1
0
3
0
0
20,074
saltstack/salt
saltstack_salt/salt/utils/templates.py
salt.utils.templates.AliasedLoader
class AliasedLoader: """ Light wrapper around the LazyLoader to redirect 'cmd.run' calls to 'cmd.shell', for easy use of shellisms during templating calls Dotted aliases ('cmd.run') must resolve to another dotted alias (e.g. 'cmd.shell') Non-dotted aliases ('cmd') must resolve to a dictionary ...
class AliasedLoader: ''' Light wrapper around the LazyLoader to redirect 'cmd.run' calls to 'cmd.shell', for easy use of shellisms during templating calls Dotted aliases ('cmd.run') must resolve to another dotted alias (e.g. 'cmd.shell') Non-dotted aliases ('cmd') must resolve to a dictionary of...
5
1
2
0
2
0
1
0.89
0
0
0
0
4
1
4
4
23
6
9
6
4
8
9
6
4
1
0
0
4
20,075
saltstack/salt
saltstack_salt/salt/utils/templates.py
salt.utils.templates.AliasedModule
class AliasedModule: """ Light wrapper around module objects returned by the LazyLoader's getattr for the purposes of `salt.cmd.run()` syntax in templates Allows for aliasing specific functions, such as `run` to `shell` for easy use of shellisms during templating calls """ def __init__(sel...
class AliasedModule: ''' Light wrapper around module objects returned by the LazyLoader's getattr for the purposes of `salt.cmd.run()` syntax in templates Allows for aliasing specific functions, such as `run` to `shell` for easy use of shellisms during templating calls ''' def __init__(self...
3
1
3
0
3
0
1
1
0
0
0
0
2
2
2
2
15
3
6
5
3
6
6
5
3
1
0
0
2
20,076
saltstack/salt
saltstack_salt/salt/utils/textformat.py
salt.utils.textformat.TextFormat
class TextFormat: """ ANSI Select Graphic Rendition (SGR) code escape sequence. """ def __init__(self, *attrs, **kwargs): """ :param attrs: are the attribute names of any format codes in `codes` :param kwargs: may contain `x`, an integer in the range [0-255] that selec...
class TextFormat: ''' ANSI Select Graphic Rendition (SGR) code escape sequence. ''' def __init__(self, *attrs, **kwargs): ''' :param attrs: are the attribute names of any format codes in `codes` :param kwargs: may contain `x`, an integer in the range [0-255] that selects...
7
3
14
3
6
5
2
1.06
0
4
0
0
4
2
4
4
87
24
31
10
24
33
27
10
20
6
0
1
14
20,077
saltstack/salt
saltstack_salt/salt/utils/timed_subprocess.py
salt.utils.timed_subprocess.TimedProc
import subprocess import salt.utils.stringutils import threading import salt.utils.platform import salt.exceptions import shlex import salt.utils.data class TimedProc: """ Create a TimedProc object, calls subprocess.Popen with passed args and **kwargs """ def __init__(self, args, **kwargs): se...
class TimedProc: ''' Create a TimedProc object, calls subprocess.Popen with passed args and **kwargs ''' def __init__(self, args, **kwargs): pass def run(self): ''' wait for subprocess to terminate and return subprocess' return code. If timeout is reached, throw Ti...
5
2
26
2
21
3
6
0.18
0
11
1
0
2
9
2
2
102
11
77
18
72
14
63
18
58
17
0
4
25
20,078
saltstack/salt
saltstack_salt/salt/utils/versions.py
salt.utils.versions.LooseVersion
import looseversion class LooseVersion(looseversion.LooseVersion): def parse(self, vstring): super().parse(vstring) self._str_version = [str(vp).zfill(8) if isinstance(vp, int) else vp for vp in self.version] def _cmp(self, other): if isinstance(other, str): other = LooseV...
class LooseVersion(looseversion.LooseVersion): def parse(self, vstring): pass def _cmp(self, other): pass
3
0
14
2
11
2
5
0.14
1
3
0
0
2
1
2
2
29
4
22
6
19
3
20
6
17
8
1
2
10
20,079
saltstack/salt
saltstack_salt/salt/utils/versions.py
salt.utils.versions.StrictVersion
class StrictVersion(Version): def __init__(self, *args, **kwargs): warn_until(3008, f"'{__name__}.StrictVersion' is no longer a subclass of 'distutils.versions.StrictVersion'. It's usage has been deprecated and should no longer be used. Please switch to '{__name__}.Version' which is a subclass of 'packagin...
class StrictVersion(Version): def __init__(self, *args, **kwargs): pass
2
0
11
0
11
0
1
0
1
1
0
0
1
0
1
31
12
0
12
2
10
0
4
2
2
1
3
0
1
20,080
saltstack/salt
saltstack_salt/salt/utils/versions.py
salt.utils.versions.Version
import packaging.version class Version(packaging.version.Version): def __lt__(self, other): if isinstance(other, str): other = Version(other) return super().__lt__(other) def __le__(self, other): if isinstance(other, str): other = Version(other) return ...
class Version(packaging.version.Version): def __lt__(self, other): pass def __le__(self, other): pass def __eq__(self, other): pass def __ge__(self, other): pass def __gt__(self, other): pass def __ne__(self, other): pass
7
0
4
0
4
0
2
0
1
2
0
1
6
0
6
30
30
5
25
7
18
0
25
7
18
2
2
1
12
20,081
saltstack/salt
saltstack_salt/salt/utils/virt.py
salt.utils.virt.VirtKey
import salt.utils.files import salt.utils.verify import os import time class VirtKey: """ Used to manage key signing requests. """ def __init__(self, hyper, id_, opts): self.opts = opts self.hyper = hyper self.id = id_ path = salt.utils.verify.clean_join(self.opts['pki_...
class VirtKey: ''' Used to manage key signing requests. ''' def __init__(self, hyper, id_, opts): pass def accept(self, pub): ''' Accept the provided key ''' pass def authorize(self): ''' Prepare the master to expect a signing request ...
5
4
15
1
12
3
2
0.3
0
4
0
0
4
4
4
4
67
6
47
14
42
14
37
12
32
4
0
2
9
20,082
saltstack/salt
saltstack_salt/salt/utils/vt.py
salt.utils.vt.Terminal
import os import salt.utils.stringutils import signal import time import salt.utils.crypt import subprocess import salt.utils.data import functools import sys import errno from salt._logging import LOG_LEVELS import logging import select class Terminal: """ I'm a virtual terminal """ def __init__(self...
class Terminal: ''' I'm a virtual terminal ''' def __init__(self, args=None, executable=None, shell=False, cwd=None, env=None, preexec_fn=None, rows=None, cols=None, log_stdin=None, log_stdin_level='debug', log_stdout=None, log_stdout_level='debug', log_stderr=None, log_stderr_level='debug', log_sanit...
31
13
27
1
21
5
5
0.22
0
11
1
0
26
34
27
27
751
65
567
130
504
126
403
92
374
31
0
5
147
20,083
saltstack/salt
saltstack_salt/salt/utils/vt.py
salt.utils.vt.TerminalException
class TerminalException(Exception): """ Terminal specific exception """
class TerminalException(Exception): ''' Terminal specific exception ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
10
4
0
1
1
0
3
1
1
0
0
3
0
0
20,084
saltstack/salt
saltstack_salt/salt/utils/vt_helper.py
salt.utils.vt_helper.SSHConnection
import re from salt.utils.vt import Terminal, TerminalException import os class SSHConnection: """ SSH Connection to a remote server. """ def __init__(self, username='salt', password='password', host='localhost', key_accept=False, prompt='(Cmd)', passwd_retries=3, linesep=os.linesep, ssh_args=''): ...
null
4
4
37
4
21
12
5
0.61
0
2
2
0
3
3
3
3
117
14
64
22
50
39
39
12
35
8
0
3
14
20,085
saltstack/salt
saltstack_salt/salt/utils/win_pdh.py
salt.utils.win_pdh.Counter
from salt.exceptions import CommandExecutionError class Counter: """ Counter object Has enumerations and functions for working with counters """ PERF_SIZE_DWORD = 0 PERF_SIZE_LARGE = 256 PERF_SIZE_ZERO = 512 PERF_SIZE_VARIABLE_LEN = 768 PERF_TYPE_NUMBER = 0 PERF_TYPE_COUNTER = 1...
class Counter: ''' Counter object Has enumerations and functions for working with counters ''' def build_counter(obj, instance, instance_index, counter): ''' Makes a fully resolved counter path. Counter names are formatted like this: ``\Processor(*)\% Processor Time...
8
6
16
2
8
6
2
1.01
0
1
1
0
7
8
7
7
180
30
89
55
81
90
70
55
62
4
0
3
12
20,086
saltstack/salt
saltstack_salt/salt/utils/win_reg.py
salt.utils.win_reg.Registry
from salt.exceptions import CommandExecutionError class Registry: """ This was put in a class to delay usage until this module is actually used This class contains all the lookup dicts for working with the registry """ def __init__(self): self.hkeys = {'HKEY_CURRENT_CONFIG': win32con.HKEY_...
class Registry: ''' This was put in a class to delay usage until this module is actually used This class contains all the lookup dicts for working with the registry ''' def __init__(self): pass def __getattr__(self, k): pass
3
1
28
1
26
2
2
0.15
0
2
1
0
2
7
2
2
62
3
52
12
49
8
16
12
13
2
0
1
3
20,087
saltstack/salt
saltstack_salt/salt/utils/win_update.py
salt.utils.win_update.Updates
import salt.utils.data import salt.utils.args import salt.utils.winapi class Updates: """ Wrapper around the 'Microsoft.Update.UpdateColl' instance Adds the list and summary functions. For use by the WindowUpdateAgent class. Code Example: .. code-block:: python # Create an instance ...
class Updates: ''' Wrapper around the 'Microsoft.Update.UpdateColl' instance Adds the list and summary functions. For use by the WindowUpdateAgent class. Code Example: .. code-block:: python # Create an instance updates = Updates() # Bind to the collection object fou...
5
5
48
8
19
21
4
1.32
0
4
1
0
4
1
4
4
227
44
79
14
74
104
46
14
41
10
0
3
17
20,088
saltstack/salt
saltstack_salt/salt/utils/win_update.py
salt.utils.win_update.WindowsUpdateAgent
import salt.utils.data import salt.utils.winapi import subprocess from salt.exceptions import CommandExecutionError import salt.utils.args class WindowsUpdateAgent: """ Class for working with the Windows update agent """ fail_codes = {-2145107924: 'WinHTTP Send/Receive failed: 0x8024402C', -2145124300:...
class WindowsUpdateAgent: ''' Class for working with the Windows update agent ''' def __init__(self, online=True): ''' Initialize the session and load all updates into the ``_updates`` collection. This collection is used by the other class functions instead of querying ...
11
11
81
17
37
28
8
0.72
0
11
3
0
10
2
10
10
859
183
396
88
375
285
297
73
286
21
0
8
78
20,089
saltstack/salt
saltstack_salt/salt/utils/winapi.py
salt.utils.winapi.Com
import threading class Com: def __init__(self): self.need_com_init = not self._is_main_thread() def _is_main_thread(self): return threading.current_thread().name == 'MainThread' def __enter__(self): if self.need_com_init: log.debug('Initializing COM library') ...
class Com: def __init__(self): pass def _is_main_thread(self): pass def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass
5
0
3
0
3
0
2
0
0
0
0
0
4
1
4
4
16
3
13
6
8
0
13
6
8
2
0
1
6
20,090
saltstack/salt
saltstack_salt/salt/utils/x509.py
salt.utils.x509.KEY_TYPE
from enum import Enum class KEY_TYPE(Enum): RSA = 1 EC = 2 ED25519 = 3 ED448 = 4
class KEY_TYPE(Enum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
49
5
0
5
5
4
0
5
5
4
0
4
0
0
20,091
saltstack/salt
saltstack_salt/salt/utils/yamldumper.py
salt.utils.yamldumper.IndentMixin
class IndentMixin(Dumper): """ Mixin that improves YAML dumped list readability by indenting them by two spaces, instead of being flush with the key they are under. """ def increase_indent(self, flow=False, indentless=False): return super().increase_indent(flow, False)
class IndentMixin(Dumper): ''' Mixin that improves YAML dumped list readability by indenting them by two spaces, instead of being flush with the key they are under. ''' def increase_indent(self, flow=False, indentless=False): pass
2
1
2
0
2
0
1
1.67
1
1
0
1
1
0
1
1
9
1
3
2
1
5
3
2
1
1
1
0
1
20,092
saltstack/salt
saltstack_salt/salt/utils/yamldumper.py
salt.utils.yamldumper.IndentedSafeOrderedDumper
class IndentedSafeOrderedDumper(IndentMixin, SafeOrderedDumper): """ A YAML safe dumper that represents python OrderedDict as simple YAML map, and also indents lists by two spaces. """
class IndentedSafeOrderedDumper(IndentMixin, SafeOrderedDumper): ''' A YAML safe dumper that represents python OrderedDict as simple YAML map, and also indents lists by two spaces. ''' pass
1
1
0
0
0
0
0
4
2
0
0
0
0
0
0
1
5
0
1
1
0
4
1
1
0
0
2
0
0
20,093
saltstack/salt
saltstack_salt/salt/utils/yamldumper.py
salt.utils.yamldumper.OrderedDumper
class OrderedDumper(Dumper): """ A YAML dumper that represents python OrderedDict as simple YAML map. """
class OrderedDumper(Dumper): ''' A YAML dumper that represents python OrderedDict as simple YAML map. ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
0
4
0
1
1
0
3
1
1
0
0
1
0
0
20,094
saltstack/salt
saltstack_salt/salt/utils/yamldumper.py
salt.utils.yamldumper.SafeOrderedDumper
class SafeOrderedDumper(SafeDumper): """ A YAML safe dumper that represents python OrderedDict as simple YAML map. """
class SafeOrderedDumper(SafeDumper): ''' A YAML safe dumper that represents python OrderedDict as simple YAML map. ''' pass
1
1
0
0
0
0
0
3
1
0
0
1
0
0
0
0
4
0
1
1
0
3
1
1
0
0
1
0
0
20,095
saltstack/salt
saltstack_salt/salt/utils/yamlloader.py
salt.utils.yamlloader.SaltYamlSafeLoader
from yaml.nodes import MappingNode, SequenceNode from yaml.constructor import ConstructorError import salt.utils.stringutils class SaltYamlSafeLoader(BaseLoader): """ Create a custom YAML loader that uses the custom constructor. This allows for the YAML loading defaults to be manipulated based on needs wit...
class SaltYamlSafeLoader(BaseLoader): ''' Create a custom YAML loader that uses the custom constructor. This allows for the YAML loading defaults to be manipulated based on needs within salt to make things like sls file more intuitive. ''' def __init__(self, stream, dictclass=dict): pa...
8
3
18
1
15
2
4
0.15
1
7
0
0
7
1
7
7
136
11
109
25
101
16
72
25
64
10
1
5
25
20,096
saltstack/salt
saltstack_salt/salt/utils/yamlloader_old.py
salt.utils.yamlloader_old.SaltYamlSafeLoader
import yaml import salt.utils.stringutils from yaml.constructor import ConstructorError from yaml.nodes import MappingNode, SequenceNode import re class SaltYamlSafeLoader(yaml.SafeLoader): """ Create a custom YAML loader that uses the custom constructor. This allows for the YAML loading defaults to be man...
class SaltYamlSafeLoader(yaml.SafeLoader): ''' Create a custom YAML loader that uses the custom constructor. This allows for the YAML loading defaults to be manipulated based on needs within salt to make things like sls file more intuitive. ''' def __init__(self, stream, dictclass=dict): ...
9
4
21
1
17
3
4
0.22
1
7
0
0
8
4
8
8
182
12
140
37
131
31
100
36
91
10
1
5
33
20,097
saltstack/salt
saltstack_salt/salt/version.py
salt.version.SaltStackVersion
import re class SaltStackVersion: """ Handle SaltStack versions class. Knows how to parse ``git describe`` output, knows about release candidates and also supports version comparison. """ __slots__ = ('name', 'major', 'minor', 'bugfix', 'mbugfix', 'pre_type', 'pre_num', 'noc', 'sha') git_s...
class SaltStackVersion: ''' Handle SaltStack versions class. Knows how to parse ``git describe`` output, knows about release candidates and also supports version comparison. ''' def __init__(self, major, minor=None, bugfix=None, mbugfix=0, pre_type=None, pre_num=None, noc=0, sha=None): ...
42
4
10
1
9
1
3
0.08
0
9
1
0
22
9
27
27
341
47
272
88
219
23
195
64
166
18
0
3
82
20,098
saltstack/salt
saltstack_salt/salt/version.py
salt.version.SaltVersion
from collections import namedtuple from functools import total_ordering @total_ordering class SaltVersion(namedtuple('SaltVersion', 'name, info, released')): __slots__ = () def __new__(cls, name, info, released=False): if isinstance(info, int): info = (info,) return super().__new__...
@total_ordering class SaltVersion(namedtuple('SaltVersion', 'name, info, released')): def __new__(cls, name, info, released=False): pass def __eq__(self, other): pass def __gt__(self, other): pass
5
0
3
0
3
0
1
0
1
2
0
0
3
0
3
8
13
3
10
5
6
0
10
5
6
2
1
1
4
20,099
saltstack/salt
saltstack_salt/salt/version.py
salt.version.SaltVersionsInfo
import operator class SaltVersionsInfo(type): _sorted_versions = () _current_release = None _previous_release = None _next_release = None HYDROGEN = SaltVersion('Hydrogen', info=(2014, 1), released=True) HELIUM = SaltVersion('Helium', info=(2014, 7), released=True) LITHIUM = SaltVersion('Li...
class SaltVersionsInfo(type): @classmethod def versions(cls): pass @classmethod def current_release(cls): pass @classmethod def next_release(cls): pass @classmethod def previous_release(cls): pass
9
0
8
0
8
0
4
0.06
1
1
0
0
0
0
4
17
176
6
160
136
151
10
153
132
148
5
2
3
15