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
19,800
saltstack/salt
saltstack_salt/salt/state.py
salt.state.Compiler
import salt.utils.msgpack from collections.abc import Callable, Hashable, Iterable, Mapping, Sequence import salt.utils.jid import salt.utils.immutabletypes as immutabletypes import salt.utils.hashutils import salt.utils.files import salt.utils.event import salt.utils.dictupdate import salt.utils.decorators.state impor...
class Compiler: ''' Class used to compile and manage the High Data structure ''' def __init__(self, opts, renderers): pass def render_template(self, template, **kwargs): ''' Enforce the states in a template ''' pass def pad_funcs(self, high): '...
8
7
25
0
19
5
6
0.29
0
11
1
1
7
3
7
7
186
10
136
43
123
40
118
38
110
20
0
8
44
19,801
saltstack/salt
saltstack_salt/salt/state.py
salt.state.HighState
import salt.utils.url import salt.utils.process import salt.utils.platform import salt.utils.msgpack import salt.utils.jid import salt.utils.immutabletypes as immutabletypes import salt.utils.hashutils import salt.utils.files import salt.utils.event import salt.utils.dictupdate import salt.utils.decorators.state import...
class HighState(BaseHighState): ''' Generate and execute the salt "High State". The High State is the compound state derived from a group of template files stored on the salt master or in the local cache. ''' def __init__(self, opts, pillar_override=None, jid=None, pillar_enc=None, proxy=None,...
12
1
8
0
7
1
1
0.22
1
2
1
2
5
8
8
40
84
11
60
33
36
13
33
18
24
2
1
1
11
19,802
saltstack/salt
saltstack_salt/salt/state.py
salt.state.LazyAvailStates
from collections.abc import Callable, Hashable, Iterable, Mapping, Sequence class LazyAvailStates: """ The LazyAvailStates lazily loads the list of states of available environments. This is particularly useful when top_file_merging_strategy=same and there are many environments. """ def __...
class LazyAvailStates: ''' The LazyAvailStates lazily loads the list of states of available environments. This is particularly useful when top_file_merging_strategy=same and there are many environments. ''' def __init__(self, hs: BaseHighState): pass def _fill(self) -> None: ...
6
1
5
0
5
0
2
0.21
0
6
1
0
5
3
5
5
40
6
28
12
22
6
28
11
22
4
0
2
11
19,803
saltstack/salt
saltstack_salt/salt/state.py
salt.state.MasterHighState
import copy class MasterHighState(HighState): """ Execute highstate compilation from the master """ def __init__(self, master_opts, minion_opts, grains, id_, saltenv=None): opts = copy.deepcopy(minion_opts) opts['file_client'] = 'local' opts['file_roots'] = master_opts['master_...
class MasterHighState(HighState): ''' Execute highstate compilation from the master ''' def __init__(self, master_opts, minion_opts, grains, id_, saltenv=None): pass
2
1
10
0
9
1
1
0.4
1
0
0
0
1
0
1
41
15
1
10
3
8
4
10
3
8
1
2
0
1
19,804
saltstack/salt
saltstack_salt/salt/state.py
salt.state.MasterState
import salt.utils.msgpack import salt.utils.jid import salt.utils.immutabletypes as immutabletypes import salt.utils.hashutils import salt.utils.files import salt.utils.event import salt.utils.dictupdate import salt.utils.decorators.state import salt.utils.data import salt.utils.crypt import salt.utils.args import salt...
class MasterState(State): ''' Create a State object for master side compiling ''' def __init__(self, opts, minion): pass def load_modules(self, data=None, proxy=None): ''' Load the modules into the state ''' pass
3
2
11
0
7
4
1
0.79
1
0
0
0
2
6
2
52
27
2
14
9
11
11
10
8
7
1
1
0
2
19,805
saltstack/salt
saltstack_salt/salt/state.py
salt.state.RemoteHighState
import salt.utils.url import salt.utils.process import salt.utils.platform import salt.utils.msgpack import salt.utils.jid import salt.utils.immutabletypes as immutabletypes import salt.utils.hashutils import salt.utils.files import salt.utils.event import salt.utils.dictupdate import salt.utils.decorators.state import...
class RemoteHighState: ''' Manage gathering the data from the master ''' def __init__(self, opts, grains): pass def compile_master(self): ''' Return the state data from the master ''' pass def destroy(self): pass def __del__(self): ...
5
2
6
0
5
1
2
0.47
0
2
2
0
4
4
4
4
33
5
19
10
14
9
19
10
14
2
0
1
6
19,806
saltstack/salt
saltstack_salt/salt/state.py
salt.state.State
import salt.utils.url from typing import Any, Union import salt.utils.process import salt.utils.platform import salt.utils.msgpack from collections.abc import Callable, Hashable, Iterable, Mapping, Sequence import salt.utils.jid import traceback import salt.utils.immutabletypes as immutabletypes import time import salt...
class State: ''' Class used to execute salt states ''' def __init__(self, opts, pillar_override=None, jid=None, pillar_enc=None, proxy=None, context=None, mocked=False, loader='states', initial_pillar=None, file_client=None, _invocation_id=None): ''' When instantiating an object of thi...
58
42
47
2
40
6
10
0.15
0
31
8
2
49
25
50
50
2,569
152
2,101
429
1,992
325
1,382
363
1,327
60
0
13
529
19,807
saltstack/salt
saltstack_salt/salt/state.py
salt.state.StateError
class StateError(Exception): """ Custom exception class. """
class StateError(Exception): ''' Custom exception class. ''' 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
19,808
saltstack/salt
saltstack_salt/salt/states/ansiblegate.py
salt.states.ansiblegate.AnsibleState
from salt.utils.decorators import depends @depends('ansible') class AnsibleState: """ Ansible state caller. """ def get_args(self, argset): """ Get args and kwargs from the argset. :param argset: :return: """ args = [] kwargs = {} for el...
@depends('ansible') class AnsibleState: ''' Ansible state caller. ''' def get_args(self, argset): ''' Get args and kwargs from the argset. :param argset: :return: ''' pass def __call__(self, **kwargs): ''' Call Ansible module. ...
4
3
22
3
15
5
3
0.43
0
2
0
0
2
0
2
2
49
7
30
11
27
13
20
10
17
3
0
2
6
19,809
saltstack/salt
saltstack_salt/salt/states/firewalld.py
salt.states.firewalld.ForwardingMapping
class ForwardingMapping: """ Represents a port forwarding statement mapping a local port to a remote port for a specific protocol (TCP or UDP) """ def __init__(self, srcport, destport, protocol, destaddr): self.srcport = srcport self.destport = destport self.protocol = proto...
class ForwardingMapping: ''' Represents a port forwarding statement mapping a local port to a remote port for a specific protocol (TCP or UDP) ''' def __init__(self, srcport, destport, protocol, destaddr): pass def __eq__(self, other): pass def __ne__(self, other): ...
6
2
6
0
6
1
1
0.28
0
0
0
0
5
4
5
5
42
5
29
10
23
8
14
10
8
1
0
0
5
19,810
saltstack/salt
saltstack_salt/salt/states/gpg.py
salt.states.gpg.KeyNotContained
from salt.exceptions import CommandExecutionError, SaltInvocationError class KeyNotContained(CommandExecutionError): """ Raised when a data source does not contain a requested key """
class KeyNotContained(CommandExecutionError): ''' Raised when a data source does not contain a requested key ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
13
4
0
1
1
0
3
1
1
0
0
5
0
0
19,811
saltstack/salt
saltstack_salt/salt/thorium/__init__.py
salt.thorium.ThorState
from salt.exceptions import SaltRenderError import salt.loader import salt.cache import salt.payload import time import traceback import salt.state class ThorState(salt.state.HighState): """ Compile the thorium state and manage it in the thorium runtime """ def __init__(self, opts, grains=False, grain...
class ThorState(salt.state.HighState): ''' Compile the thorium state and manage it in the thorium runtime ''' def __init__(self, opts, grains=False, grain_keys=None, pillar=False, pillar_keys=None): pass def gather_cache(self): ''' Gather the specified data from the minion...
7
6
25
1
21
3
6
0.17
1
3
1
0
6
9
6
46
157
10
128
45
119
22
121
42
114
13
2
7
38
19,812
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.DaemonizedPublishServer
from abc import ABC, abstractmethod class DaemonizedPublishServer(PublishServer): """ PublishServer that has a daemon associated with it. """ @abstractmethod def __init__(self, opts, pub_host=None, pub_port=None, pub_path=None, pull_host=None, pull_port=None, pull_path=None, pull_path_perms=384, p...
class DaemonizedPublishServer(PublishServer): ''' PublishServer that has a daemon associated with it. ''' @abstractmethod def __init__(self, opts, pub_host=None, pub_port=None, pub_path=None, pull_host=None, pull_port=None, pull_path=None, pull_path_perms=384, pub_path_perms=384, started=None): ...
20
4
11
1
5
6
1
1.4
1
1
0
3
2
0
2
3
27
3
10
8
2
14
5
3
2
1
1
0
2
19,813
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.DaemonizedRequestServer
class DaemonizedRequestServer(RequestServer): def pre_fork(self, process_manager): raise NotImplementedError def post_fork(self, message_handler, io_loop): """ The message handler is a coroutine that will be called called when a new request comes into the server. The return fro...
class DaemonizedRequestServer(RequestServer): def pre_fork(self, process_manager): pass def post_fork(self, message_handler, io_loop): ''' The message handler is a coroutine that will be called called when a new request comes into the server. The return from the message handler...
3
1
5
0
2
3
1
1
1
1
0
3
2
0
2
4
11
1
5
3
2
5
5
3
2
1
1
0
2
19,814
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.PublishClient
class PublishClient(Transport): """ The PublishClient receives messages from the PublishServer and runs a callback. """ def __init__(self, opts, io_loop, **kwargs): super().__init__() def on_recv(self, callback): """ Add a message handler when we receive a message from the ...
class PublishClient(Transport): ''' The PublishClient receives messages from the PublishServer and runs a callback. ''' def __init__(self, opts, io_loop, **kwargs): pass def on_recv(self, callback): ''' Add a message handler when we receive a message from the PublishServer ...
8
5
5
0
2
2
1
1.18
1
2
0
3
7
0
7
10
44
8
17
10
7
20
15
8
7
1
1
0
7
19,815
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.PublishServer
from abc import ABC, abstractmethod class PublishServer(ABC): """ The PublishServer publishes messages to PublishClients or to a borker service. """ @abstractmethod def publish(self, payload, **kwargs): """ Publish "load" to minions. This send the load to the publisher daemon ...
class PublishServer(ABC): ''' The PublishServer publishes messages to PublishClients or to a borker service. ''' @abstractmethod def publish(self, payload, **kwargs): ''' Publish "load" to minions. This send the load to the publisher daemon process with does the actual s...
3
2
8
1
2
5
1
3
0
1
0
1
1
0
1
1
14
2
3
2
1
9
3
2
1
1
0
0
1
19,816
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.RequestClient
class RequestClient(Transport): """ The RequestClient transport is used to make requests and get corresponding replies from the RequestServer. """ def __init__(self, opts, io_loop, **kwargs): super().__init__() async def send(self, load, timeout=60): """ Send a request ...
class RequestClient(Transport): ''' The RequestClient transport is used to make requests and get corresponding replies from the RequestServer. ''' def __init__(self, opts, io_loop, **kwargs): pass async def send(self, load, timeout=60): ''' Send a request message and re...
5
4
4
0
2
3
1
1.56
1
2
0
3
4
0
4
7
26
4
9
5
4
14
9
5
4
1
1
0
4
19,817
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.RequestServer
class RequestServer: """ The RequestServer transport is responsible for handling requests from RequestClients and sending replies to those requests. """ def __init__(self, opts): pass def close(self): """ Close the underlying network connection. """ rais...
class RequestServer: ''' The RequestServer transport is responsible for handling requests from RequestClients and sending replies to those requests. ''' def __init__(self, opts): pass def close(self): ''' Close the underlying network connection. ''' pass
3
2
4
0
2
2
1
1.4
0
1
0
1
2
0
2
2
14
2
5
3
2
7
5
3
2
1
0
0
2
19,818
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.Transport
import traceback import warnings class Transport: def __init__(self, *args, **kwargs): self._trace = '\n'.join(traceback.format_stack()[:-1]) if not hasattr(self, '_closing'): self._closing = False if not hasattr(self, '_connect_called'): self._connect_called = Fals...
class Transport: def __init__(self, *args, **kwargs): pass def connect(self, *args, **kwargs): pass def __del__(self): ''' Warn the user if the transport's close method was never called. If the _closing attribute is missing we won't raise a warning. This p...
4
1
8
0
5
3
2
0.56
0
1
1
2
3
3
3
3
28
3
16
7
12
9
12
7
8
3
0
1
6
19,819
saltstack/salt
saltstack_salt/salt/transport/base.py
salt.transport.base.TransportWarning
class TransportWarning(Warning): """ Transport warning. """
class TransportWarning(Warning): ''' Transport warning. ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
11
4
0
1
1
0
3
1
1
0
0
4
0
0
19,820
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.AsyncPubChannel
from salt.utils.versions import warn_until class AsyncPubChannel: """ Factory class to create subscription channels to the master's Publisher """ @classmethod def factory(cls, opts, **kwargs): import salt.channel.client warn_until(3008, 'This module is deprecated. Please use salt.c...
class AsyncPubChannel: ''' Factory class to create subscription channels to the master's Publisher ''' @classmethod def factory(cls, opts, **kwargs): pass
3
1
8
1
7
0
1
0.33
0
1
1
0
0
0
1
1
14
2
9
4
5
3
5
3
2
1
0
0
1
19,821
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.AsyncPullChannel
from salt.utils.versions import warn_until class AsyncPullChannel: """ Factory class to create IPC pull channels """ @staticmethod def factory(opts, **kwargs): """ If we have additional IPC transports other than UXD and TCP, add them here """ import salt.channel.cli...
class AsyncPullChannel: ''' Factory class to create IPC pull channels ''' @staticmethod def factory(opts, **kwargs): ''' If we have additional IPC transports other than UXD and TCP, add them here ''' pass
3
2
11
1
7
3
1
0.67
0
1
1
0
0
0
1
1
17
2
9
4
5
6
5
3
2
1
0
0
1
19,822
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.AsyncPushChannel
from salt.utils.versions import warn_until class AsyncPushChannel: """ Factory class to create IPC Push channels """ @staticmethod def factory(opts, **kwargs): """ If we have additional IPC transports other than UxD and TCP, add them here """ import salt.channel.cli...
class AsyncPushChannel: ''' Factory class to create IPC Push channels ''' @staticmethod def factory(opts, **kwargs): ''' If we have additional IPC transports other than UxD and TCP, add them here ''' pass
3
2
11
1
7
3
1
0.67
0
1
1
0
0
0
1
1
17
2
9
4
5
6
5
3
2
1
0
0
1
19,823
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.AsyncReqChannel
from salt.utils.versions import warn_until class AsyncReqChannel: """ Factory class to create a asynchronous communication channels to the master's ReqServer. ReqChannels connect to the master's ReqServerChannel on the minion's master_port (default: 4506) option. """ @classmethod def facto...
class AsyncReqChannel: ''' Factory class to create a asynchronous communication channels to the master's ReqServer. ReqChannels connect to the master's ReqServerChannel on the minion's master_port (default: 4506) option. ''' @classmethod def factory(cls, opts, **kwargs): pass
3
1
8
1
7
0
1
0.56
0
1
1
0
0
0
1
1
16
2
9
4
5
5
5
3
2
1
0
0
1
19,824
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.PullChannel
from salt.utils.versions import warn_until class PullChannel: """ Factory class to create Sync channel for pull side of push/pull IPC """ @staticmethod def factory(opts, **kwargs): import salt.channel.client warn_until(3008, 'This module is deprecated. Please use salt.channel.clien...
class PullChannel: ''' Factory class to create Sync channel for pull side of push/pull IPC ''' @staticmethod def factory(opts, **kwargs): pass
3
1
8
1
7
0
1
0.33
0
1
1
0
0
0
1
1
14
2
9
4
5
3
5
3
2
1
0
0
1
19,825
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.PushChannel
from salt.utils.versions import warn_until class PushChannel: """ Factory class to create Sync channel for push side of push/pull IPC """ @staticmethod def factory(opts, **kwargs): import salt.channel.client warn_until(3008, 'This module is deprecated. Please use salt.channel.clien...
class PushChannel: ''' Factory class to create Sync channel for push side of push/pull IPC ''' @staticmethod def factory(opts, **kwargs): pass
3
1
8
1
7
0
1
0.33
0
1
1
0
0
0
1
1
14
2
9
4
5
3
5
3
2
1
0
0
1
19,826
saltstack/salt
saltstack_salt/salt/transport/client.py
salt.transport.client.ReqChannel
from salt.utils.versions import warn_until class ReqChannel: """ Factory class to create a sychronous communication channels to the master's ReqServer. """ @staticmethod def factory(opts, **kwargs): import salt.channel.client warn_until(3008, 'This module is deprecated. Please ...
class ReqChannel: ''' Factory class to create a sychronous communication channels to the master's ReqServer. ''' @staticmethod def factory(opts, **kwargs): pass
3
1
8
1
7
0
1
0.44
0
1
1
0
0
0
1
1
15
2
9
4
5
4
5
3
2
1
0
0
1
19,827
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.FutureWithTimeout
import tornado.ioloop import tornado from tornado.ioloop import TimeoutError as TornadoTimeoutError import tornado.concurrent import tornado.gen import tornado.netutil class FutureWithTimeout(tornado.concurrent.Future): def __init__(self, io_loop, future, timeout): super().__init__() self.io_loop ...
class FutureWithTimeout(tornado.concurrent.Future): def __init__(self, io_loop, future, timeout): pass def _timeout_callback(self): pass def _done_callback(self, future): pass
4
0
13
1
10
3
3
0.25
1
2
0
0
3
3
3
3
43
4
32
8
28
8
28
7
24
5
1
2
9
19,828
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCClient
import tornado import tornado.gen import salt.utils.msgpack import salt.defaults import errno import socket import tornado.ioloop import salt.transport.frame from tornado.iostream import IOStream, StreamClosedError import tornado.netutil import time import tornado.concurrent class IPCClient: """ A Tornado IPC ...
class IPCClient: ''' A Tornado IPC client very similar to Tornado's TCPClient class but using either UNIX domain sockets or TCP sockets This was written because Tornado does not have its own IPC server/client implementation. :param IOLoop io_loop: A Tornado ioloop to handle scheduling :para...
11
5
12
2
8
2
3
0.49
0
7
1
2
8
6
8
8
135
25
75
24
64
37
72
21
62
10
0
4
26
19,829
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCMessageClient
import salt.transport.frame import salt.defaults import salt.utils.msgpack class IPCMessageClient(IPCClient): """ Salt IPC message client Create an IPC client to send messages to an IPC server An example of a very simple IPCMessageClient connecting to an IPCServer. This example assumes an already...
class IPCMessageClient(IPCClient): ''' Salt IPC message client Create an IPC client to send messages to an IPC server An example of a very simple IPCMessageClient connecting to an IPCServer. This example assumes an already running IPCMessage server. IMPORTANT: The below example also assumes a r...
2
2
13
2
5
6
2
1.93
1
0
0
0
1
0
1
9
55
14
14
5
12
27
8
5
6
2
1
1
2
19,830
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCMessagePublisher
import salt.defaults import salt.transport.frame import datetime from tornado.iostream import IOStream, StreamClosedError import salt.utils.msgpack import tornado.ioloop import socket import tornado.concurrent from tornado.ioloop import IOLoop import tornado.netutil import tornado import tornado.gen class IPCMessagePu...
class IPCMessagePublisher: ''' A Tornado IPC Publisher similar to Tornado's TCPServer class but using either UNIX domain sockets or TCP sockets ''' def __init__(self, opts, socket_path, io_loop=None): ''' Create a new Tornado IPC server :param dict opts: Salt options ...
11
5
12
1
8
3
2
0.46
0
7
0
0
8
7
8
8
120
14
74
25
63
34
66
22
56
4
0
2
20
19,831
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCMessageServer
class IPCMessageServer(IPCServer): """ Salt IPC message server Creates a message server which can create and bind to a socket on a given path and then respond to messages asynchronously. An example of a very simple IPCServer which prints received messages to a console: # Import Tornad...
class IPCMessageServer(IPCServer): ''' Salt IPC message server Creates a message server which can create and bind to a socket on a given path and then respond to messages asynchronously. An example of a very simple IPCServer which prints received messages to a console: # Import Tornado l...
1
1
0
0
0
0
0
23
1
0
0
0
0
0
0
8
32
8
1
1
0
23
1
1
0
0
1
0
0
19,832
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCMessageSubscriber
from tornado.ioloop import TimeoutError as TornadoTimeoutError import tornado.concurrent import tornado.gen import tornado import tornado.netutil from tornado.iostream import IOStream, StreamClosedError import tornado.ioloop from tornado.locks import Lock import logging class IPCMessageSubscriber(IPCClient): """ ...
class IPCMessageSubscriber(IPCClient): ''' Salt IPC message subscriber Create an IPC client to receive messages from IPC publisher An example of a very simple IPCMessageSubscriber connecting to an IPCMessagePublisher. This example assumes an already running IPCMessagePublisher. IMPORTANT: The b...
10
5
23
1
17
6
5
0.51
1
7
1
0
6
3
6
14
188
24
111
25
101
57
88
19
81
14
1
5
30
19,833
saltstack/salt
saltstack_salt/salt/transport/ipc.py
salt.transport.ipc.IPCServer
import tornado.ioloop import socket import tornado from tornado.iostream import IOStream, StreamClosedError import salt.transport.frame import tornado.concurrent import tornado.netutil import salt.defaults import salt.utils.msgpack import tornado.gen class IPCServer: """ A Tornado IPC server very similar to To...
class IPCServer: ''' A Tornado IPC server very similar to Tornado's TCPServer class but using either UNIX domain sockets or TCP sockets ''' def __init__(self, socket_path, io_loop=None, payload_handler=None): ''' Create a new Tornado IPC server :param str/int socket_path: P...
15
5
15
1
10
3
2
0.42
0
9
1
1
8
6
8
8
160
21
99
31
84
42
69
26
57
7
0
3
24
19,834
saltstack/salt
saltstack_salt/salt/transport/local.py
salt.transport.local.LocalChannel
import salt.utils.files from salt.channel.client import ReqChannel class LocalChannel(ReqChannel): """ Local channel for testing purposes """ def __init__(self, opts, **kwargs): self.opts = opts self.kwargs = kwargs self.tries = 0 def close(self): """ Close...
class LocalChannel(ReqChannel): ''' Local channel for testing purposes ''' def __init__(self, opts, **kwargs): pass def close(self): ''' Close the local channel. Currently a NOOP ''' pass def send(self, load, tries=3, timeout=60, raw=False): ...
5
2
9
1
7
2
1
0.39
1
1
0
0
4
3
4
5
45
6
28
12
21
11
17
9
12
2
1
2
5
19,835
saltstack/salt
saltstack_salt/salt/transport/server.py
salt.transport.server.PubServerChannel
from salt.utils.versions import warn_until class PubServerChannel: """ Factory class to create subscription channels to the master's Publisher """ @classmethod def factory(cls, opts, **kwargs): import salt.channel.server warn_until(3008, 'This module is deprecated. Please use salt....
class PubServerChannel: ''' Factory class to create subscription channels to the master's Publisher ''' @classmethod def factory(cls, opts, **kwargs): pass
3
1
8
1
7
0
1
0.33
0
1
1
0
0
0
1
1
14
2
9
4
5
3
5
3
2
1
0
0
1
19,836
saltstack/salt
saltstack_salt/salt/transport/server.py
salt.transport.server.ReqServerChannel
from salt.utils.versions import warn_until class ReqServerChannel: """ ReqServerChannel handles request/reply messages from ReqChannels. The server listens on the master's ret_port (default: 4506) option. """ @classmethod def factory(cls, opts, **kwargs): import salt.channel.server ...
class ReqServerChannel: ''' ReqServerChannel handles request/reply messages from ReqChannels. The server listens on the master's ret_port (default: 4506) option. ''' @classmethod def factory(cls, opts, **kwargs): pass
3
1
8
1
7
0
1
0.44
0
1
1
0
0
0
1
1
15
2
9
4
5
4
5
3
2
1
0
0
1
19,837
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.ClosingError
class ClosingError(Exception): """ """
class ClosingError(Exception): ''' ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
19,838
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.LoadBalancerServer
import tornado import salt.utils.versions import salt.utils.process import socket import salt.utils.platform import salt.utils.msgpack import salt.utils.files import salt.utils.asynchronous import salt.transport.frame import errno import salt.transport.base import salt.payload import salt.master import tornado.util imp...
class LoadBalancerServer(salt.utils.process.SignalHandlingProcess): ''' Raw TCP server which runs in its own process and will listen for incoming connections. Each incoming connection will be sent via multiprocessing queue to the workers. Since the queue is shared amongst workers, only one worker w...
5
2
10
0
7
3
2
0.76
1
2
0
0
4
3
4
14
58
7
29
11
24
22
29
10
24
4
3
3
8
19,839
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.LoadBalancerWorker
import queue import threading class LoadBalancerWorker(SaltMessageServer): """ This will receive TCP connections from 'LoadBalancerServer' via a multiprocessing queue. Since the queue is shared amongst workers, only one worker will handle a given connection. """ def __init__(self, socket_q...
class LoadBalancerWorker(SaltMessageServer): ''' This will receive TCP connections from 'LoadBalancerServer' via a multiprocessing queue. Since the queue is shared amongst workers, only one worker will handle a given connection. ''' def __init__(self, socket_queue, message_handler, *args, ...
4
1
9
0
8
1
2
0.36
1
5
0
0
3
3
3
16
37
3
25
8
21
9
23
8
19
5
3
4
7
19,840
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.MessageClient
import tornado import tornado.concurrent import tornado.gen import tornado.iostream import tornado.netutil import tornado.tcpclient import tornado.tcpserver import tornado.util import salt.master import salt.payload import salt.transport.base import salt.transport.frame import salt.utils.asynchronous import salt.utils....
class MessageClient: ''' Low-level message sending client ''' def __init__(self, opts, host, port, io_loop=None, resolver=None, connect_callback=None, disconnect_callback=None, source_ip=None, source_port=None): pass def close(self): pass @tornado.gen.coroutine def check_c...
22
2
15
1
14
1
3
0.1
0
10
5
0
12
18
12
12
245
27
201
70
168
20
150
51
134
17
0
5
49
19,841
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.PubServer
import tornado.util import salt.utils.process import salt.utils.files import salt.payload import salt.utils.msgpack import tornado.concurrent import salt.utils.versions import tornado.tcpserver import salt.utils.platform import salt.master import salt.transport.frame import tornado import tornado.iostream import salt.u...
class PubServer(tornado.tcpserver.TCPServer): ''' TCP publisher ''' def __init__(self, opts, io_loop=None, presence_callback=None, remove_presence_callback=None, ssl=None): pass def close(self): pass def __del__(self): pass async def _stream_read(self, client): ...
7
1
17
0
17
1
4
0.1
1
8
2
0
6
8
6
15
116
7
100
36
86
10
84
28
77
10
2
5
26
19,842
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.PublishClient
from salt.utils.network import ip_bracket import asyncio.exceptions import salt.utils.versions import tornado.util import salt.utils.process import salt.master import salt.utils.platform import tornado.tcpclient import tornado.netutil import select import socket import time import salt.utils.msgpack import tornado.gen ...
class PublishClient(salt.transport.base.PublishClient): ''' Tornado based TCP Pub Client ''' def __init__(self, opts, io_loop, **kwargs): pass def close(self): pass async def getstream(self, **kwargs): pass async def _connect(self, timeout=None): pass ...
13
2
19
0
18
2
5
0.1
1
11
2
1
12
22
12
22
259
15
224
57
205
23
172
49
159
17
2
6
55
19,843
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.PublishServer
import salt.utils.versions import salt.utils.process import socket import salt.utils.platform import salt.utils.msgpack import salt.utils.files import multiprocessing import salt.utils.asynchronous import salt.transport.frame import salt.transport.base import salt.payload import salt.master import tornado.util import t...
class PublishServer(salt.transport.base.DaemonizedPublishServer): ''' Tornado based TCP PublishServer ''' def __init__(self, opts, pub_host=None, pub_port=None, pub_path=None, pull_host=None, pull_port=None, pull_path=None, pull_path_perms=384, pub_path_perms=384, started=None, ssl=None): pass...
14
4
14
0
13
2
2
0.15
1
6
4
1
11
11
11
14
185
15
149
56
113
22
71
32
59
5
2
1
18
19,844
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.RequestClient
import tornado.concurrent import tornado from salt.utils.network import ip_bracket import uuid import urllib from salt.exceptions import SaltClientError, SaltReqTimeoutError import salt.utils.versions import salt.utils.process import salt.utils.platform import salt.utils.msgpack import salt.utils.files import salt.util...
class RequestClient(salt.transport.base.RequestClient): ''' Tornado based TCP RequestClient ''' def __init__(self, opts, io_loop, **kwargs): pass async def getstream(self, **kwargs): pass async def connect(self): pass async def _stream_return(self): pass ...
10
1
22
1
20
2
5
0.1
1
10
5
1
8
23
8
15
205
19
175
57
165
18
148
55
138
17
2
5
45
19,845
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.RequestServer
import socket import salt.transport.base import salt.utils.platform import salt.payload import salt.utils.msgpack import salt.master import salt.utils.files import multiprocessing import salt.utils.asynchronous import salt.utils.versions import salt.transport.frame import salt.utils.process import errno class RequestS...
class RequestServer(salt.transport.base.DaemonizedRequestServer): ''' Tornado based TCP Request/Reply Server :param dict opts: Salt master config options. ''' def __init__(self, opts): pass @property def socket(self): pass def close(self): pass def __enter...
11
3
12
0
10
2
3
0.24
1
6
3
1
9
6
9
13
125
13
91
23
80
22
73
21
63
8
2
3
23
19,846
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.Resolver
import tornado.gen import tornado.netutil import tornado.tcpserver import tornado.concurrent import tornado.tcpclient import tornado.iostream import tornado import tornado.util class Resolver(tornado.netutil.DefaultLoopResolver): """ Default resolver for tornado """
class Resolver(tornado.netutil.DefaultLoopResolver): ''' Default resolver for tornado ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
13
4
0
1
1
0
3
1
1
0
0
4
0
0
19,847
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.SaltMessageServer
import tornado.tcpserver import salt.transport.frame import tornado import salt.utils.process import tornado.tcpclient import salt.utils.versions import salt.transport.base import salt.utils.platform import tornado.netutil import salt.payload import salt.utils.msgpack import tornado.iostream import salt.master import s...
class SaltMessageServer(tornado.tcpserver.TCPServer): ''' Raw TCP server which will receive all of the TCP streams and re-assemble messages that are sent through to us ''' def __init__(self, message_handler, *args, **kwargs): pass async def handle_stream(self, stream, address, _Stream...
5
3
14
0
13
2
3
0.23
1
6
1
1
4
4
4
13
66
4
52
23
42
12
45
16
40
5
2
3
13
19,848
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.Subscriber
import warnings class Subscriber: """ Client object for use with the TCP publisher server """ def __init__(self, stream, address): self.stream = stream self.address = address self._closing = False self._read_until_future = None self.id_ = None def close(sel...
class Subscriber: ''' Client object for use with the TCP publisher server ''' def __init__(self, stream, address): pass def close(self): pass def __del__(self): pass
4
1
8
0
6
2
2
0.5
0
1
0
0
3
5
3
3
33
3
20
9
16
10
18
9
14
4
0
2
7
19,849
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPClientKeepAlive
import tornado.netutil import tornado.concurrent import tornado.gen import tornado.tcpclient import tornado.util import tornado.iostream import tornado.tcpserver import tornado class TCPClientKeepAlive(tornado.tcpclient.TCPClient): """ Override _create_stream() in TCPClient to enable keep alive support. ""...
class TCPClientKeepAlive(tornado.tcpclient.TCPClient): ''' Override _create_stream() in TCPClient to enable keep alive support. ''' def __init__(self, opts, resolver=None): pass def _create_stream(self, max_buffer_size, af, addr, **kwargs): ''' Override _create_stream() in...
3
2
10
1
5
5
1
1.09
1
2
0
0
2
1
2
6
25
3
11
8
6
12
9
6
6
1
2
0
2
19,850
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPPubClient
import salt.utils.msgpack import salt.utils.process import salt.transport.base import salt.utils.files import salt.utils.versions import salt.utils.platform import salt.payload import salt.master import salt.transport.frame import salt.utils.asynchronous class TCPPubClient(PublishClient): def __init__(self, *args...
class TCPPubClient(PublishClient): def __init__(self, *args, **kwargs): pass
2
0
6
0
6
1
1
0.14
1
1
0
0
1
0
1
23
7
0
7
2
5
1
4
2
2
1
3
0
1
19,851
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPPublishServer
import salt.transport.frame import salt.utils.process import salt.transport.base import salt.utils.platform import salt.payload import salt.utils.msgpack import salt.master import salt.utils.files import salt.utils.asynchronous import salt.utils.versions class TCPPublishServer(PublishServer): def __init__(self, *...
class TCPPublishServer(PublishServer): def __init__(self, *args, **kwargs): pass
2
0
6
0
6
1
1
0.14
1
1
0
0
1
0
1
15
7
0
7
2
5
1
4
2
2
1
3
0
1
19,852
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPPuller
import warnings import salt.utils.platform import tornado import salt.utils.process import tornado.concurrent import tornado.gen import tornado.tcpclient import tornado.netutil import tornado.tcpserver import tornado.iostream import socket import salt.utils.files import tornado.util import salt.utils.msgpack import sal...
class TCPPuller: ''' A Tornado IPC server very similar to Tornado's TCPServer class but using either UNIX domain sockets or TCP sockets ''' def __init__(self, host=None, port=None, path=None, mode=384, io_loop=None, payload_handler=None): ''' Create a new Tornado IPC server ...
9
5
15
1
11
3
2
0.42
0
7
1
0
8
8
8
8
159
20
99
30
85
42
71
26
59
8
0
3
25
19,853
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPReqClient
import salt.utils.versions import salt.utils.asynchronous import salt.utils.files import salt.utils.platform import salt.utils.process import salt.utils.msgpack import salt.payload import salt.transport.base import salt.transport.frame import salt.master class TCPReqClient(RequestClient): def __init__(self, *args...
class TCPReqClient(RequestClient): def __init__(self, *args, **kwargs): pass
2
0
6
0
6
1
1
0.14
1
1
0
0
1
0
1
16
7
0
7
2
5
1
4
2
2
1
3
0
1
19,854
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp.TCPReqServer
import salt.transport.frame import salt.utils.platform import salt.utils.msgpack import salt.utils.asynchronous import salt.master import salt.utils.versions import salt.utils.files import salt.utils.process import salt.transport.base import salt.payload class TCPReqServer(RequestServer): def __init__(self, *args...
class TCPReqServer(RequestServer): def __init__(self, *args, **kwargs): pass
2
0
6
0
6
1
1
0.14
1
1
0
0
1
0
1
14
7
0
7
2
5
1
4
2
2
1
3
0
1
19,855
saltstack/salt
saltstack_salt/salt/transport/tcp.py
salt.transport.tcp._TCPPubServerPublisher
import tornado import warnings import time import salt.utils.versions import salt.utils.process import socket import salt.utils.platform import salt.utils.msgpack import salt.utils.files import salt.utils.asynchronous import salt.transport.frame import errno import salt.transport.base import salt.payload import salt.ma...
class _TCPPubServerPublisher: ''' Salt IPC message client Create an IPC client to send messages to an IPC server An example of a very simple IPCMessageClient connecting to an IPCServer. This example assumes an already running IPCMessage server. IMPORTANT: The below example also assumes a runnin...
11
6
13
2
9
3
3
0.56
0
6
1
0
9
8
9
9
179
36
93
29
82
52
81
27
70
10
0
4
28
19,856
saltstack/salt
saltstack_salt/salt/transport/ws.py
salt.transport.ws.PublishClient
import warnings import aiohttp import salt.payload import salt.transport.frame import salt.transport.base import aiohttp.web import asyncio import time class PublishClient(salt.transport.base.PublishClient): """ Tornado based TCP Pub Client """ ttype = 'ws' async_methods = ['connect', 'connect_uri'...
class PublishClient(salt.transport.base.PublishClient): ''' Tornado based TCP Pub Client ''' def __init__(self, opts, io_loop, **kwargs): pass async def _close(self): pass def close(self): pass def __del__(self): pass def _decode_messages(self, messa...
15
2
13
0
12
1
4
0.08
1
5
0
0
14
18
14
24
211
19
181
53
160
14
144
46
129
14
2
4
55
19,857
saltstack/salt
saltstack_salt/salt/transport/ws.py
salt.transport.ws.PublishServer
import socket import salt.payload import aiohttp.web import asyncio import salt.transport.base from salt.transport.tcp import USE_LOAD_BALANCER, LoadBalancerServer, _get_bind_addr, _get_socket, _set_tcp_keepalive import tornado.ioloop import aiohttp import os import multiprocessing import salt.transport.frame class Pu...
class PublishServer(salt.transport.base.DaemonizedPublishServer): ''' ''' def __init__(self, opts, pub_host=None, pub_port=None, pub_path=None, pull_host=None, pull_port=None, pull_path=None, pull_path_perms=384, pub_path_perms=384, started=None, ssl=None): pass @classmethod def support_ssl(cl...
17
4
13
0
12
1
2
0.1
1
7
0
0
14
15
14
17
213
17
179
71
140
18
121
47
106
7
2
2
34
19,858
saltstack/salt
saltstack_salt/salt/transport/ws.py
salt.transport.ws.RequestClient
import aiohttp.web import asyncio import aiohttp import warnings import salt.transport.frame import salt.transport.base import tornado.ioloop import salt.payload class RequestClient(salt.transport.base.RequestClient): ttype = 'ws' def __init__(self, opts, io_loop): self.opts = opts self.sendin...
class RequestClient(salt.transport.base.RequestClient): def __init__(self, opts, io_loop): pass async def connect(self): pass async def send(self, load, timeout=60): pass async def _close(self): pass def close(self): pass def get_master_uri(self, op...
8
0
8
0
8
0
3
0.05
1
2
0
0
7
9
7
14
70
8
61
23
53
3
58
23
50
4
2
3
18
19,859
saltstack/salt
saltstack_salt/salt/transport/ws.py
salt.transport.ws.RequestServer
import multiprocessing import aiohttp import salt.transport.frame import salt.transport.base import salt.payload from salt.transport.tcp import USE_LOAD_BALANCER, LoadBalancerServer, _get_bind_addr, _get_socket, _set_tcp_keepalive import asyncio import tornado.ioloop import socket import aiohttp.web class RequestServe...
class RequestServer(salt.transport.base.DaemonizedRequestServer): def __init__(self, opts): pass def pre_fork(self, process_manager): ''' Pre-fork we need to create the zmq router device ''' pass def post_fork(self, message_handler, io_loop): ''' A...
7
2
15
1
13
2
3
0.18
1
2
1
0
5
8
5
9
79
7
62
24
55
11
56
24
49
8
2
3
17
19,860
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.AsyncReqMessageClient
import salt.transport.base import tornado.gen from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq import zmq.error import salt.utils.process import tornado.concurrent import zmq.eventloop.future import salt.utils.stringutils import tornado.ioloop import salt.payload import tornado.locks import salt...
class AsyncReqMessageClient: ''' This class wraps the underlying zeromq REQ socket and gives a future-based interface to sending and recieving messages. This works around the primary limitation of serialized send/recv on the underlying socket by queueing the message sends in this class. In the futu...
11
3
14
2
10
2
3
0.27
0
7
1
0
7
9
7
7
125
23
81
27
70
22
71
24
62
6
0
4
26
19,861
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.PublishClient
import salt.utils.process import asyncio import salt.utils.files import zmq.asyncio import zmq.error import salt.payload import salt.utils.stringutils from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq import zmq.eventloop.zmqstream import hashlib import asyncio.exceptions import salt.transport.ba...
class PublishClient(salt.transport.base.PublishClient): ''' A transport channel backed by ZeroMQ for a Salt Publisher to use to publish commands to connected minions ''' def _legacy_setup(self, _id, role, zmq_filtering=False, tcp_keepalive=True, tcp_keepalive_idle=300, tcp_keepalive_cnt=-1, tcp_ke...
13
3
22
1
19
2
4
0.23
1
6
1
0
11
18
11
21
298
31
219
65
188
50
149
46
136
9
2
4
50
19,862
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.PublishServer
import salt.utils.zeromq import zmq.eventloop.zmqstream import tornado.ioloop import salt.transport.base import salt.utils.process import hashlib import tornado.concurrent import tornado import salt.utils.files import zmq.error import salt.payload from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq...
class PublishServer(salt.transport.base.DaemonizedPublishServer): ''' Encapsulate synchronous operations for a publisher channel ''' def __init__(self, opts, pub_host=None, pub_port=None, pub_path=None, pull_host=None, pull_port=None, pull_path=None, pull_path_perms=384, pub_path_perms=384, started=No...
18
6
16
0
13
3
3
0.27
1
6
1
0
13
16
13
16
231
17
173
59
142
46
127
41
113
7
2
3
33
19,863
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.RequestClient
import tornado import tornado.ioloop from salt.exceptions import SaltException, SaltReqTimeoutError import zmq.error import tornado.gen from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq import salt.utils.files import salt.payload import asyncio import tornado.locks import asyncio.exceptions impor...
class RequestClient(salt.transport.base.RequestClient): def __init__(self, opts, io_loop, linger=0): pass async def connect(self): pass def _init_socket(self): pass def close(self): pass async def _send_recv(self, message): pass async def send(self,...
9
1
13
0
12
2
3
0.16
1
8
2
0
6
11
7
14
106
10
85
22
76
14
77
21
69
6
2
2
23
19,864
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.RequestServer
import salt.transport.base import salt.utils.process import salt.utils.zeromq import os import salt.utils.stringutils import sys import errno import salt.payload import zmq.error import threading import asyncio import zmq.eventloop.future import asyncio.exceptions from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_...
class RequestServer(salt.transport.base.DaemonizedRequestServer): def __init__(self, opts): pass def zmq_device(self): ''' Multiprocessing target for the zmq queue device ''' pass def close(self): ''' Cleanly shutdown the router socket ''' ...
14
5
14
1
12
2
3
0.2
1
9
1
0
12
13
12
16
196
21
148
35
134
29
132
33
118
11
2
3
41
19,865
saltstack/salt
saltstack_salt/salt/transport/zeromq.py
salt.transport.zeromq.ZeroMQSocketMonitor
from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq import zmq.error import asyncio.exceptions import asyncio import zmq.eventloop.future import zmq.eventloop.zmqstream import zmq.asyncio class ZeroMQSocketMonitor: __EVENT_MAP = None def __init__(self, socket): """ Create ...
class ZeroMQSocketMonitor: def __init__(self, socket): ''' Create ZMQ monitor sockets More information: http://api.zeromq.org/4-0:zmq-socket-monitor ''' pass def start_io_loop(self, io_loop): pass async def consume(self): pass def ...
9
1
9
0
8
1
3
0.15
0
4
0
0
7
4
7
7
76
8
60
21
51
9
58
19
50
5
0
3
19
19,866
saltstack/salt
saltstack_salt/salt/utils/aggregation.py
salt.utils.aggregation.Aggregate
class Aggregate: """ Aggregation base. """
class Aggregate: ''' Aggregation base. ''' pass
1
1
0
0
0
0
0
3
0
0
0
2
0
0
0
0
4
0
1
1
0
3
1
1
0
0
0
0
0
19,867
saltstack/salt
saltstack_salt/salt/utils/aggregation.py
salt.utils.aggregation.Map
from salt.utils.odict import OrderedDict class Map(OrderedDict, Aggregate): """ Map aggregation. """
class Map(OrderedDict, Aggregate): ''' Map aggregation. ''' pass
1
1
0
0
0
0
0
3
2
0
0
1
0
0
0
50
4
0
1
1
0
3
1
1
0
0
3
0
0
19,868
saltstack/salt
saltstack_salt/salt/utils/aggregation.py
salt.utils.aggregation.Sequence
class Sequence(list, Aggregate): """ Sequence aggregation. """
class Sequence(list, Aggregate): ''' Sequence aggregation. ''' pass
1
1
0
0
0
0
0
3
2
0
0
1
0
0
0
33
4
0
1
1
0
3
1
1
0
0
2
0
0
19,869
saltstack/salt
saltstack_salt/salt/utils/asymmetric.py
salt.utils.asymmetric.InvalidSignature
from salt.exceptions import CommandExecutionError, SaltInvocationError class InvalidSignature(CommandExecutionError): """ Raised when a signature is invalid. We save the file hash to avoid computing it multiple times for signed_by_any, if a path has been passed in and the signature algorithm suppor...
class InvalidSignature(CommandExecutionError): ''' Raised when a signature is invalid. We save the file hash to avoid computing it multiple times for signed_by_any, if a path has been passed in and the signature algorithm supports prehashed data. ''' def __init__(self, *args, file_digest=N...
2
1
5
0
5
0
1
1
1
1
0
0
1
3
1
14
13
1
6
5
4
6
6
5
4
1
5
0
1
19,870
saltstack/salt
saltstack_salt/salt/utils/asynchronous.py
salt.utils.asynchronous.SyncWrapper
import tornado.concurrent import tornado.ioloop import asyncio import sys import threading class SyncWrapper: """ A wrapper to make Async classes synchronous This is uses as a simple wrapper, for example: asynchronous = AsyncClass() # this method would regularly return a future future = async...
class SyncWrapper: ''' A wrapper to make Async classes synchronous This is uses as a simple wrapper, for example: asynchronous = AsyncClass() # this method would regularly return a future future = asynchronous.async_method() sync = SyncWrapper(async_factory_method, (arg1, arg2), {'kwarg1': ...
11
2
13
0
12
1
3
0.16
0
7
0
0
9
7
9
9
136
13
108
34
89
17
86
26
75
7
0
3
30
19,871
saltstack/salt
saltstack_salt/salt/utils/atomicfile.py
salt.utils.atomicfile._AtomicWFile
import salt.utils.files import salt.utils.win_dacl import shutil import os class _AtomicWFile: """ Helper class for :func:`atomic_open`. """ def __init__(self, fhanle, tmp_filename, filename): self._fh = fhanle self._tmp_filename = tmp_filename self._filename = filename de...
class _AtomicWFile: ''' Helper class for :func:`atomic_open`. ''' def __init__(self, fhanle, tmp_filename, filename): pass def __getattr__(self, attr): pass def __enter__(self): pass def close(self): pass def __exit__(self, exc_type, exc_value, t...
7
1
6
0
6
0
2
0.08
0
1
0
0
6
3
6
6
48
6
39
11
32
3
30
11
23
4
0
2
11
19,872
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.CacheCli
from salt.utils.zeromq import zmq import salt.payload import salt.utils.dictupdate import salt.version import salt.utils.atomicfile import salt.utils.files import salt.utils.data import salt.config import salt.utils.msgpack import salt.utils.path import os class CacheCli: """ Connection client for the ConCache...
class CacheCli: ''' Connection client for the ConCache. Should be used by all components that need the list of currently connected minions ''' def __init__(self, opts): ''' Sets up the zmq-connection to the ConCache ''' pass def put_cache(self, minions): ...
4
4
11
1
6
4
1
0.79
0
0
0
0
3
5
3
3
40
6
19
12
15
15
19
12
15
1
0
0
3
19,873
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.CacheDict
import time class CacheDict(dict): """ Subclass of dict that will lazily delete items past ttl """ def __init__(self, ttl, *args, **kwargs): dict.__init__(self, *args, **kwargs) self._ttl = ttl self._key_cache_time = {} def _enforce_ttl_key(self, key): """ ...
class CacheDict(dict): ''' Subclass of dict that will lazily delete items past ttl ''' def __init__(self, ttl, *args, **kwargs): pass def _enforce_ttl_key(self, key): ''' Enforce the TTL to a specific key, delete if its past TTL ''' pass def __geti...
6
4
6
0
4
2
1
0.6
1
0
0
1
5
2
5
32
37
5
20
8
14
12
20
8
14
3
2
1
7
19,874
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.CacheDisk
import salt.version import salt.config import logging import salt.utils.atomicfile import time import salt.utils.data import os import salt.utils.msgpack import salt.utils.dictupdate import salt.utils.path import salt.payload import salt.utils.files class CacheDisk(CacheDict): """ Class that represents itself ...
class CacheDisk(CacheDict): ''' Class that represents itself as a dictionary to a consumer but uses a disk-based backend. Serialization and de-serialization is done with msgpack ''' def __init__(self, ttl, path, *args, **kwargs): pass def _enforce_ttl_key(self, key): ''' ...
10
8
11
0
7
3
2
0.55
1
3
0
0
9
3
9
41
111
12
65
20
55
36
59
17
49
9
3
2
20
19,875
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.CacheFactory
class CacheFactory: """ Cache which can use a number of backends """ @classmethod def factory(cls, backend, ttl, *args, **kwargs): log.debug('Factory backend: %s', backend) if backend == 'memory': return CacheDict(ttl, *args, **kwargs) elif backend == 'disk': ...
class CacheFactory: ''' Cache which can use a number of backends ''' @classmethod def factory(cls, backend, ttl, *args, **kwargs): pass
3
1
8
0
8
0
3
0.3
0
2
2
0
0
0
1
1
14
1
10
3
7
3
7
2
5
3
0
1
3
19,876
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.CacheRegex
import re import time class CacheRegex: """ Create a regular expression object cache for the most frequently used patterns to minimize compilation of the same patterns over and over again """ def __init__(self, prepend='', append='', size=1000, keep_fraction=0.8, max_age=3600): self.pr...
class CacheRegex: ''' Create a regular expression object cache for the most frequently used patterns to minimize compilation of the same patterns over and over again ''' def __init__(self, prepend='', append='', size=1000, keep_fraction=0.8, max_age=3600): pass def clear(self): ...
5
4
12
0
9
3
3
0.43
0
4
0
0
4
7
4
4
57
4
37
17
30
16
34
15
29
3
0
2
10
19,877
saltstack/salt
saltstack_salt/salt/utils/cache.py
salt.utils.cache.ContextCache
import salt.utils.msgpack import salt.utils.data import salt.config import os import salt.utils.dictupdate import salt.version import salt.payload import salt.utils.files import salt.utils.atomicfile import salt.utils.path class ContextCache: def __init__(self, opts, name): """ Create a context ca...
class ContextCache: def __init__(self, opts, name): ''' Create a context cache ''' pass def cache_context(self, context): ''' Cache the given context to disk ''' pass def get_cache_context(self): ''' Retrieve a context cache...
4
3
7
0
4
3
1
0.75
0
0
0
0
3
2
3
3
23
2
12
8
8
9
12
6
8
2
0
1
4
19,878
saltstack/salt
saltstack_salt/salt/utils/cloud.py
salt.utils.cloud.Client
import time class Client: """ Wrap pypsexec.client.Client to fix some stability issues: - Set the service name from a keyword arg, this allows multiple service instances to be created in a single process. - Keep trying service and file deletes since they may not succeed on the firs...
null
9
2
10
0
8
1
2
0.26
0
0
0
0
8
3
8
8
95
12
66
24
49
17
55
14
46
7
0
3
15
19,879
saltstack/salt
saltstack_salt/salt/utils/configparser.py
salt.utils.configparser.GitConfigParser
from collections import OrderedDict import salt.utils.stringutils import re class GitConfigParser(RawConfigParser): """ Custom ConfigParser which reads and writes git config files. READ A GIT CONFIG FILE INTO THE PARSER OBJECT >>> import salt.utils.configparser >>> conf = salt.utils.configparser....
class GitConfigParser(RawConfigParser): ''' Custom ConfigParser which reads and writes git config files. READ A GIT CONFIG FILE INTO THE PARSER OBJECT >>> import salt.utils.configparser >>> conf = salt.utils.configparser.GitConfigParser() >>> conf.read('/home/user/.git/config') MAKE SOME CH...
10
9
25
0
17
8
6
0.59
1
11
0
0
9
0
9
90
263
20
159
37
144
94
127
32
117
18
8
6
52
19,880
saltstack/salt
saltstack_salt/salt/utils/context.py
salt.utils.context.ChildContextDict
from collections.abc import MutableMapping import copy class ChildContextDict(MutableMapping): """An overrideable child of ContextDict""" def __init__(self, parent, overrides=None, threadsafe=False): self.parent = parent self._data = {} if overrides is None else overrides self._old_dat...
class ChildContextDict(MutableMapping): '''An overrideable child of ContextDict''' def __init__(self, parent, overrides=None, threadsafe=False): pass def __setitem__(self, key, val): pass def __delitem__(self, key): pass def __getitem__(self, key): pass def ...
9
1
4
0
4
1
2
0.24
1
0
0
0
8
3
8
49
45
9
29
13
20
7
28
13
19
7
7
3
15
19,881
saltstack/salt
saltstack_salt/salt/utils/context.py
salt.utils.context.ContextDict
from collections.abc import MutableMapping import copy import threading class ContextDict(MutableMapping): """ A context manager that saves some per-thread state globally. Intended for use with Tornado's StackContext. Provide arbitrary data as kwargs upon creation, then allow any children to overr...
class ContextDict(MutableMapping): ''' A context manager that saves some per-thread state globally. Intended for use with Tornado's StackContext. Provide arbitrary data as kwargs upon creation, then allow any children to override the values of the parent. ''' def __init__(self, threadsafe=...
12
3
7
0
5
1
2
0.32
1
3
1
0
10
3
10
51
85
11
56
18
44
18
46
17
35
2
7
1
18
19,882
saltstack/salt
saltstack_salt/salt/utils/context.py
salt.utils.context.NamespacedDictWrapper
import copy from collections.abc import MutableMapping class NamespacedDictWrapper(MutableMapping, dict): """ Create a dict which wraps another dict with a specific prefix of key(s) MUST inherit from dict to serialize through msgpack correctly """ def __init__(self, d, pre_keys): self.__d...
class NamespacedDictWrapper(MutableMapping, dict): ''' Create a dict which wraps another dict with a specific prefix of key(s) MUST inherit from dict to serialize through msgpack correctly ''' def __init__(self, d, pre_keys): pass def _dict(self): pass def __repr__(self):...
12
1
3
0
3
0
1
0.15
2
2
0
0
11
2
11
79
49
12
33
16
21
5
30
16
18
2
7
1
13
19,883
saltstack/salt
saltstack_salt/salt/utils/data.py
salt.utils.data.CaseInsensitiveDict
from collections.abc import Mapping, MutableMapping, Sequence from salt.utils.odict import OrderedDict class CaseInsensitiveDict(MutableMapping): """ Inspired by requests' case-insensitive dict implementation, but works with non-string keys as well. """ def __init__(self, init=None, **kwargs): ...
class CaseInsensitiveDict(MutableMapping): ''' Inspired by requests' case-insensitive dict implementation, but works with non-string keys as well. ''' def __init__(self, init=None, **kwargs): ''' Force internal dict to be ordered to ensure a consistent iteration order, irre...
11
4
4
0
2
1
1
0.71
1
2
0
0
10
1
10
51
51
10
24
12
13
17
24
12
13
2
7
1
11
19,884
saltstack/salt
saltstack_salt/salt/utils/decorators/__init__.py
salt.utils.decorators.Depends
import subprocess import errno import salt.utils.data import salt.utils.versions import salt.utils.args from collections import defaultdict import inspect class Depends: """ This decorator will check the module when it is loaded and check that the dependencies passed in are in the globals of the module. If...
class Depends: ''' This decorator will check the module when it is loaded and check that the dependencies passed in are in the globals of the module. If not, it will cause the function to be unloaded (or replaced). ''' def __init__(self, *dependencies, **kwargs): ''' The decora...
7
4
51
5
33
13
7
0.44
0
6
0
0
2
2
4
4
218
25
135
28
128
59
77
24
72
23
0
6
29
19,885
saltstack/salt
saltstack_salt/salt/utils/decorators/__init__.py
salt.utils.decorators._DeprecationDecorator
import salt.utils.data import salt.utils.versions import salt.utils.args from salt.exceptions import CommandExecutionError, SaltConfigurationError, SaltInvocationError class _DeprecationDecorator: """ Base mix-in class for the deprecation decorator. Takes care of a common functionality, used in its derivat...
class _DeprecationDecorator: ''' Base mix-in class for the deprecation decorator. Takes care of a common functionality, used in its derivatives. ''' def __init__(self, globals, version): ''' Constructor. :param globals: Module globals. Important for finding out replacement ...
5
5
18
2
11
6
2
0.6
0
6
2
2
4
7
4
4
84
12
47
19
41
28
34
18
28
5
0
2
8
19,886
saltstack/salt
saltstack_salt/salt/utils/decorators/__init__.py
salt.utils.decorators._IsDeprecated
from functools import wraps from salt.exceptions import CommandExecutionError, SaltConfigurationError, SaltInvocationError class _IsDeprecated(_DeprecationDecorator): """ This decorator should be used only with the deprecated functions to mark them as deprecated and alter its behavior a corresponding way. ...
class _IsDeprecated(_DeprecationDecorator): ''' This decorator should be used only with the deprecated functions to mark them as deprecated and alter its behavior a corresponding way. The usage is only suitable if deprecation process is renaming the function from one to another. In case function na...
5
4
33
2
23
8
2
1.33
1
1
1
0
2
1
2
6
109
18
39
7
34
52
19
6
15
4
1
2
6
19,887
saltstack/salt
saltstack_salt/salt/utils/decorators/__init__.py
salt.utils.decorators._WithDeprecated
from functools import wraps from salt.exceptions import CommandExecutionError, SaltConfigurationError, SaltInvocationError class _WithDeprecated(_DeprecationDecorator): """ This decorator should be used with the successor functions to mark them as a new and alter its behavior in a corresponding way. It...
class _WithDeprecated(_DeprecationDecorator): ''' This decorator should be used with the successor functions to mark them as a new and alter its behavior in a corresponding way. It is used alone if a function content or function signature needs to be replaced, leaving the name of the function same....
7
6
45
2
36
7
3
0.59
1
3
2
0
4
4
4
8
241
38
128
26
119
75
48
23
42
6
1
3
14
19,888
saltstack/salt
saltstack_salt/salt/utils/decorators/jinja.py
salt.utils.decorators.jinja.JinjaFilter
class JinjaFilter: """ This decorator is used to specify that a function is to be loaded as a Jinja filter. """ salt_jinja_filters = {} def __init__(self, name=None): """ """ self.name = name def __call__(self, function): """ """ name = self.name or function...
class JinjaFilter: ''' This decorator is used to specify that a function is to be loaded as a Jinja filter. ''' def __init__(self, name=None): ''' ''' pass def __call__(self, function): ''' ''' pass
3
3
5
0
4
1
2
0.6
0
0
0
0
2
1
2
2
19
3
10
6
7
6
10
6
7
2
0
1
3
19,889
saltstack/salt
saltstack_salt/salt/utils/decorators/jinja.py
salt.utils.decorators.jinja.JinjaGlobal
class JinjaGlobal: """ This decorator is used to specify that a function is to be loaded as a Jinja global. """ salt_jinja_globals = {} def __init__(self, name=None): """ """ self.name = name def __call__(self, function): """ """ name = self.name or function...
class JinjaGlobal: ''' This decorator is used to specify that a function is to be loaded as a Jinja global. ''' def __init__(self, name=None): ''' ''' pass def __call__(self, function): ''' ''' pass
3
3
5
0
4
1
2
0.6
0
0
0
0
2
1
2
2
19
3
10
6
7
6
10
6
7
2
0
1
3
19,890
saltstack/salt
saltstack_salt/salt/utils/decorators/state.py
salt.utils.decorators.state.OutputUnifier
import logging import salt.utils.stringutils from salt.exceptions import SaltException class OutputUnifier: def __init__(self, *policies): self.policies = [] for pls in policies: if not hasattr(self, pls): raise SaltException(f'Unknown policy: {pls}') else: ...
class OutputUnifier: def __init__(self, *policies): pass def _run_policies(self, data): pass def __call__(self, func): pass def _func(*args, **kwargs): pass def content_check(self, result): ''' Checks for specific types in the state o...
7
2
17
1
13
3
4
0.25
0
5
1
0
5
1
5
5
96
12
68
17
61
17
48
16
41
8
0
3
21
19,891
saltstack/salt
saltstack_salt/salt/utils/dictdiffer.py
salt.utils.dictdiffer.DictDiffer
class DictDiffer: """ Calculate the difference between two dictionaries as: (1) items added (2) items removed (3) keys same in both but changed values (4) keys same in both and unchanged values """ def __init__(self, current_dict, past_dict): self.current_dict, self.past_dict = ...
class DictDiffer: ''' Calculate the difference between two dictionaries as: (1) items added (2) items removed (3) keys same in both but changed values (4) keys same in both and unchanged values ''' def __init__(self, current_dict, past_dict): pass def added(self): p...
6
1
2
0
2
0
1
0.54
0
2
0
1
5
5
5
5
25
5
13
9
7
7
13
9
7
1
0
0
5
19,892
saltstack/salt
saltstack_salt/salt/utils/dictdiffer.py
salt.utils.dictdiffer.RecursiveDictDiffer
class RecursiveDictDiffer(DictDiffer): """ Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the format...
23
13
27
2
20
5
4
0.42
1
5
0
0
10
3
13
18
387
52
239
57
203
100
107
36
91
11
1
4
55
19,893
saltstack/salt
saltstack_salt/salt/utils/dns.py
salt.utils.dns.RFC
from salt.utils.odict import OrderedDict class RFC: """ Simple holding class for all RFC/IANA registered lists & standards """ CAA_TAGS = ('issue', 'issuewild', 'iodef') SSHFP_ALGO = OrderedDict(((1, 'rsa'), (2, 'dsa'), (3, 'ecdsa'), (4, 'ed25519'))) SSHFP_HASH = OrderedDict(((1, 'sha1'), (2, '...
class RFC: ''' Simple holding class for all RFC/IANA registered lists & standards ''' @staticmethod def validate(lookup, ref, match=None): pass
3
1
8
0
7
1
3
0.15
0
0
0
0
0
0
1
1
61
8
46
11
43
7
13
9
11
3
0
1
3
19,894
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.Etcd3DirectoryException
from salt.exceptions import SaltException class Etcd3DirectoryException(SaltException): """ We didn't find the required etcd library """
class Etcd3DirectoryException(SaltException): ''' We didn't find the required etcd library ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
12
4
0
1
1
0
3
1
1
0
0
4
0
0
19,895
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.EtcdBase
class EtcdBase: """ Base class for the different versions of etcd clients. This also serves as a documentation hub for all superclasses. """ def __init__(self, opts, profile=None, host=None, port=None, username=None, password=None, ca=None, client_key=None, client_cert=None, **kwargs): if ...
null
15
13
14
1
7
6
2
0.85
0
3
0
2
14
4
14
14
213
34
97
50
62
82
67
30
52
6
0
2
24
19,896
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.EtcdClient
import salt.utils.versions import salt.utils.msgpack class EtcdClient(EtcdBase): def __init__(self, opts, **kwargs): if not HAS_ETCD_V2: raise EtcdLibraryNotInstalled("Don't have python-etcd, need to install it.") log.debug('etcd_util has the libraries needed for etcd v2') supe...
class EtcdClient(EtcdBase): def __init__(self, opts, **kwargs): pass def watch(self, key, recurse=False, timeout=0, start_revision=None, **kwargs): pass def get(self, key, recurse=False): pass def read(self, key, recurse=False, wait=False, timeout=None, start_revision=None, ...
12
1
28
1
24
3
6
0.11
1
10
3
0
11
2
11
25
320
24
270
49
250
30
206
34
194
12
1
3
69
19,897
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.EtcdClientV3
import salt.utils.versions import salt.utils.msgpack class EtcdClientV3(EtcdBase): """ .. versionadded:: 3005 Since etcd3 has no concept of directories, this class leaves write_directory unimplemented. """ def __init__(self, opts, encode_keys=None, encode_values=None, raw_keys=False, raw_values=F...
class EtcdClientV3(EtcdBase): ''' .. versionadded:: 3005 Since etcd3 has no concept of directories, this class leaves write_directory unimplemented. ''' def __init__(self, opts, encode_keys=None, encode_values=None, raw_keys=False, raw_values=False, unicode_errors=None, **kwargs): pass...
18
3
16
1
14
2
4
0.13
1
9
3
0
17
7
17
31
291
32
232
72
197
30
167
53
149
9
1
4
60
19,898
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.EtcdLibraryNotInstalled
from salt.exceptions import SaltException class EtcdLibraryNotInstalled(SaltException): """ We didn't find the required etcd library """
class EtcdLibraryNotInstalled(SaltException): ''' We didn't find the required etcd library ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
12
4
0
1
1
0
3
1
1
0
0
4
0
0
19,899
saltstack/salt
saltstack_salt/salt/utils/etcd_util.py
salt.utils.etcd_util.EtcdUtilWatchTimeout
class EtcdUtilWatchTimeout(Exception): """ A watch timed out without returning a result """
class EtcdUtilWatchTimeout(Exception): ''' A watch timed out without returning a result ''' 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