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
17,800
spotify/luigi
spotify_luigi/luigi/contrib/presto.py
luigi.contrib.presto.PrestoTask
from luigi.contrib import rdbms class PrestoTask(rdbms.Query, metaclass=WithPrestoClient): """ Task for executing presto queries During its executions tracking url and percentage progress are set """ _tracking_url_set = False @property def host(self): return presto().host @pro...
null
33
1
3
0
3
0
1
0.06
2
2
2
2
18
3
18
109
88
19
65
39
32
4
43
22
24
2
6
1
21
17,801
spotify/luigi
spotify_luigi/luigi/contrib/presto.py
luigi.contrib.presto.WithPrestoClient
import inspect from luigi.task_register import Register class WithPrestoClient(Register): """ A metaclass for injecting `PrestoClient` as a `_client` field into a new instance of class `T` Presto connection options are taken from `T`-instance fields Fields should have the same names as in `pyhive.prest...
class WithPrestoClient(Register): ''' A metaclass for injecting `PrestoClient` as a `_client` field into a new instance of class `T` Presto connection options are taken from `T`-instance fields Fields should have the same names as in `pyhive.presto.Cursor` ''' def __new__(cls, name, bases, att...
4
2
18
1
10
7
2
0.8
1
4
1
1
1
0
1
36
30
3
15
8
11
12
13
8
9
3
4
2
5
17,802
spotify/luigi
spotify_luigi/luigi/contrib/presto.py
luigi.contrib.presto.presto
import luigi class presto(luigi.Config): host = luigi.Parameter(default='localhost', description='Presto host') port = luigi.IntParameter(default=8090, description='Presto port') user = luigi.Parameter(default='anonymous', description='Presto user') catalog = luigi.Parameter(default='hive', description...
class presto(luigi.Config): pass
1
0
0
0
0
0
0
0.09
1
0
0
0
0
0
0
78
11
0
11
8
10
1
8
8
7
0
6
0
0
17,803
spotify/luigi
spotify_luigi/luigi/contrib/prometheus_metric.py
luigi.contrib.prometheus_metric.PrometheusMetricsCollector
from luigi.metrics import MetricsCollector from prometheus_client import CollectorRegistry, Counter, Gauge, generate_latest, CONTENT_TYPE_LATEST class PrometheusMetricsCollector(MetricsCollector): def _generate_task_labels(self, task): return {label: task.family if label == 'family' else task.params.get(l...
class PrometheusMetricsCollector(MetricsCollector): def _generate_task_labels(self, task): pass def __init__(self, *args, **kwargs): pass def generate_latest(self): pass def handle_task_started(self, task): pass def handle_task_failed(self, task): pass ...
9
0
8
0
8
0
2
0.02
1
4
1
0
8
7
8
35
71
8
62
17
53
1
34
17
25
3
4
1
12
17,804
spotify/luigi
spotify_luigi/luigi/contrib/prometheus_metric.py
luigi.contrib.prometheus_metric.prometheus
from luigi import parameter from luigi.task import Config class prometheus(Config): use_task_family_in_labels = parameter.BoolParameter(default=True, parsing=parameter.BoolParameter.EXPLICIT_PARSING) task_parameters_to_use_in_labels = parameter.ListParameter(default=[])
class prometheus(Config): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
78
5
0
5
3
4
0
3
3
2
0
6
0
0
17,805
spotify/luigi
spotify_luigi/luigi/contrib/pyspark_runner.py
luigi.contrib.pyspark_runner.AbstractPySparkRunner
import os import sys import pickle class AbstractPySparkRunner(object): _entry_point_class = None def __init__(self, job, *args): sys.path.append(os.path.dirname(job)) with open(job, 'rb') as fd: self.job = pickle.load(fd) self.args = args def run(self): from p...
class AbstractPySparkRunner(object): def __init__(self, job, *args): pass def run(self): pass
3
0
7
0
6
1
1
0.14
1
0
0
0
2
2
2
2
18
2
14
10
10
2
14
8
10
1
1
1
2
17,806
spotify/luigi
spotify_luigi/luigi/contrib/pyspark_runner.py
luigi.contrib.pyspark_runner.SparkContextEntryPoint
class SparkContextEntryPoint(_SparkEntryPoint): sc = None def __enter__(self): from pyspark import SparkContext self.sc = SparkContext(conf=self.conf) return (self.sc, self.sc) def __exit__(self, exc_type, exc_val, exc_tb): self.sc.stop()
class SparkContextEntryPoint(_SparkEntryPoint): def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): pass
3
0
3
0
3
0
1
0
1
0
0
0
2
0
2
25
10
2
8
5
4
0
8
5
4
1
4
0
2
17,807
spotify/luigi
spotify_luigi/luigi/contrib/pyspark_runner.py
luigi.contrib.pyspark_runner.SparkSessionEntryPoint
class SparkSessionEntryPoint(_SparkEntryPoint): spark = None def _check_major_spark_version(self): from pyspark import __version__ as spark_version major_version = int(spark_version.split('.')[0]) if major_version < 2: raise RuntimeError("\n Apache Spark {} do...
class SparkSessionEntryPoint(_SparkEntryPoint): def _check_major_spark_version(self): pass def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): pass
4
0
7
0
7
0
1
0
1
2
0
0
3
0
3
26
27
4
23
8
17
0
14
8
8
2
4
1
4
17,808
spotify/luigi
spotify_luigi/luigi/contrib/pyspark_runner.py
luigi.contrib.pyspark_runner._SparkEntryPoint
import abc class _SparkEntryPoint(metaclass=abc.ABCMeta): def __init__(self, conf): self.conf = conf @abc.abstractmethod def __enter__(self): pass @abc.abstractmethod def __exit__(self, exc_type, exc_val, exc_tb): pass
class _SparkEntryPoint(metaclass=abc.ABCMeta): def __init__(self, conf): pass @abc.abstractmethod def __enter__(self): pass @abc.abstractmethod def __exit__(self, exc_type, exc_val, exc_tb): pass
6
0
2
0
2
0
1
0
1
0
0
2
3
1
3
23
11
2
9
7
3
0
7
5
3
1
3
0
3
17,809
spotify/luigi
spotify_luigi/luigi/contrib/rdbms.py
luigi.contrib.rdbms.CopyToTable
import abc import luigi.task import luigi class CopyToTable(luigi.task.MixinNaiveBulkComplete, _MetadataColumnsMixin, luigi.Task): """ An abstract task for inserting a data set into RDBMS. Usage: Subclass and override the following attributes: * `host`, * `database`, * `u...
null
27
5
5
1
3
2
1
0.85
3
2
0
3
12
0
12
98
118
24
52
28
25
44
35
18
22
3
5
1
16
17,810
spotify/luigi
spotify_luigi/luigi/contrib/rdbms.py
luigi.contrib.rdbms.Query
import abc import luigi.task import luigi class Query(luigi.task.MixinNaiveBulkComplete, luigi.Task): """ An abstract task for executing an RDBMS query. Usage: Subclass and override the following attributes: * `host`, * `database`, * `user`, * `password`, ...
null
29
5
3
0
2
1
1
0.78
2
1
0
2
11
0
11
90
89
18
40
23
11
31
23
12
11
1
5
0
11
17,811
spotify/luigi
spotify_luigi/luigi/contrib/rdbms.py
luigi.contrib.rdbms._MetadataColumnsMixin
class _MetadataColumnsMixin: """Provide an additional behavior that adds columns and values to tables This mixin is used to provide an additional behavior that allow a task to add generic metadata columns to every table created for both PSQL and Redshift. Example: This is a use-case examp...
class _MetadataColumnsMixin: '''Provide an additional behavior that adds columns and values to tables This mixin is used to provide an additional behavior that allow a task to add generic metadata columns to every table created for both PSQL and Redshift. Example: This is a use-case example ...
11
2
7
1
6
0
2
0.87
0
2
0
1
7
1
7
7
116
28
47
19
36
41
35
16
27
4
0
2
15
17,812
spotify/luigi
spotify_luigi/luigi/contrib/redis_store.py
luigi.contrib.redis_store.RedisTarget
from luigi.parameter import Parameter from luigi.target import Target import datetime class RedisTarget(Target): """ Target for a resource in Redis.""" marker_prefix = Parameter(default='luigi', config_path=dict(section='redis', name='marker-prefix')) def __init__(self, host, port, db, update_id, password...
null
6
5
12
1
6
5
1
0.87
1
1
0
0
5
8
5
26
69
11
31
17
24
27
23
16
17
2
4
1
6
17,813
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.KillOpenRedshiftSessions
import luigi import time import abc class KillOpenRedshiftSessions(luigi.Task): """ An task for killing any open Redshift sessions in a given database. This is necessary to prevent open user sessions with transactions against the table from blocking drop or truncate table commands. Usage: ...
null
17
4
9
0
7
2
1
0.51
1
1
1
0
7
0
7
85
99
13
57
18
40
29
36
12
28
3
5
2
9
17,814
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.RedshiftManifestTask
import json from luigi.contrib.s3 import S3PathTask, S3Target import luigi class RedshiftManifestTask(S3PathTask): """ Generic task to generate a manifest file that can be used in S3CopyToTable in order to copy multiple files from your s3 folder into a redshift table at once. For full description ...
class RedshiftManifestTask(S3PathTask): ''' Generic task to generate a manifest file that can be used in S3CopyToTable in order to copy multiple files from your s3 folder into a redshift table at once. For full description on how to use the manifest file see http://docs.aws.amazon.com/redshift/...
2
1
17
0
17
0
4
0.85
1
1
1
0
1
0
1
80
44
7
20
12
18
17
17
12
15
4
7
2
4
17,815
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.RedshiftQuery
from luigi.contrib import postgres class RedshiftQuery(postgres.PostgresQuery): """ Template task for querying an Amazon Redshift database Usage: Subclass and override the required `host`, `database`, `user`, `password`, `table`, and `query` attributes. Override the `run` method if your use case ...
class RedshiftQuery(postgres.PostgresQuery): ''' Template task for querying an Amazon Redshift database Usage: Subclass and override the required `host`, `database`, `user`, `password`, `table`, and `query` attributes. Override the `run` method if your use case requires some action with the query r...
2
2
14
1
9
4
1
1.2
1
1
1
1
1
5
1
93
28
6
10
7
8
12
3
2
1
1
7
0
1
17,816
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.RedshiftTarget
from luigi.contrib import postgres import luigi class RedshiftTarget(postgres.PostgresTarget): """ Target for a resource in Redshift. Redshift is similar to postgres with a few adjustments required by redshift. """ marker_table = luigi.configuration.get_config().get('redshift', 'marker-table',...
class RedshiftTarget(postgres.PostgresTarget): ''' Target for a resource in Redshift. Redshift is similar to postgres with a few adjustments required by redshift. ''' pass
1
1
0
0
0
0
0
0.86
1
0
0
0
0
0
0
28
16
3
7
4
6
6
4
4
3
0
5
0
0
17,817
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.RedshiftUnloadTask
from luigi.contrib import postgres class RedshiftUnloadTask(postgres.PostgresQuery, _CredentialsMixin): """ Template task for running UNLOAD on an Amazon Redshift database Usage: Subclass and override the required `host`, `database`, `user`, `password`, `table`, and `query` attributes. Optionally,...
class RedshiftUnloadTask(postgres.PostgresQuery, _CredentialsMixin): ''' Template task for running UNLOAD on an Amazon Redshift database Usage: Subclass and override the required `host`, `database`, `user`, `password`, `table`, and `query` attributes. Optionally, override the `autocommit` attribute...
9
5
10
1
6
3
1
0.69
2
1
1
1
5
5
5
105
72
11
36
17
27
25
20
9
14
1
7
0
5
17,818
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.S3CopyJSONToTable
import abc class S3CopyJSONToTable(S3CopyToTable, _CredentialsMixin): """ Template task for inserting a JSON data set into Redshift from s3. Usage: * Subclass and override the required attributes: * `host`, * `database`, * `user`, * `password`, ...
class S3CopyJSONToTable(S3CopyToTable, _CredentialsMixin): ''' Template task for inserting a JSON data set into Redshift from s3. Usage: * Subclass and override the required attributes: * `host`, * `database`, * `user`, * `password`, * `ta...
8
4
9
1
4
4
1
1.56
2
0
0
1
3
0
3
132
55
9
18
6
10
28
8
4
4
1
7
0
3
17,819
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift.S3CopyToTable
import abc from luigi.contrib import rdbms class S3CopyToTable(rdbms.CopyToTable, _CredentialsMixin): """ Template task for inserting a data set into Redshift from s3. Usage: * Subclass and override the required attributes: * `host`, * `database`, * `user`, * `password`, ...
class S3CopyToTable(rdbms.CopyToTable, _CredentialsMixin): ''' Template task for inserting a data set into Redshift from s3. Usage: * Subclass and override the required attributes: * `host`, * `database`, * `user`, * `password`, * `table`, * `columns`, * `s3_lo...
35
22
13
1
8
4
2
0.56
2
6
1
3
23
5
23
129
361
54
197
62
162
110
127
46
103
6
6
2
43
17,820
spotify/luigi
spotify_luigi/luigi/contrib/redshift.py
luigi.contrib.redshift._CredentialsMixin
import os import luigi class _CredentialsMixin: """ This mixin is used to provide the same credential properties for AWS to all Redshift tasks. It also provides a helper method to generate the credentials string for the task. """ @property def configuration_section(self): """ ...
class _CredentialsMixin: ''' This mixin is used to provide the same credential properties for AWS to all Redshift tasks. It also provides a helper method to generate the credentials string for the task. ''' @property def configuration_section(self): ''' Override to change th...
15
8
8
1
5
3
2
0.64
0
1
0
3
8
0
8
8
84
12
44
17
29
28
24
11
15
4
0
1
12
17,821
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.AtomicS3File
from luigi.target import FileAlreadyExists, FileSystem, FileSystemException, FileSystemTarget, AtomicLocalFile, MissingParentDirectory class AtomicS3File(AtomicLocalFile): """ An S3 file that writes to a temp file and puts to S3 on close. :param kwargs: Keyword arguments are passed to the boto function `i...
class AtomicS3File(AtomicLocalFile): ''' An S3 file that writes to a temp file and puts to S3 on close. :param kwargs: Keyword arguments are passed to the boto function `initiate_multipart_upload` ''' def __init__(self, path, s3_client, **kwargs): pass def move_to_final_destination(se...
3
1
4
0
4
0
1
0.5
1
1
0
0
2
2
2
9
15
3
8
5
5
4
7
5
4
1
1
0
2
17,822
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.DeprecatedBotoClientException
class DeprecatedBotoClientException(Exception): pass
class DeprecatedBotoClientException(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
17,823
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.FileNotFoundException
from luigi.target import FileAlreadyExists, FileSystem, FileSystemException, FileSystemTarget, AtomicLocalFile, MissingParentDirectory class FileNotFoundException(FileSystemException): pass
class FileNotFoundException(FileSystemException): 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
17,824
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.InvalidDeleteException
from luigi.target import FileAlreadyExists, FileSystem, FileSystemException, FileSystemTarget, AtomicLocalFile, MissingParentDirectory class InvalidDeleteException(FileSystemException): pass
class InvalidDeleteException(FileSystemException): 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
17,825
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.ReadableS3File
import os import os.path class ReadableS3File: def __init__(self, s3_key): self.s3_key = s3_key.get()['Body'] self.buffer = [] self.closed = False self.finished = False def read(self, size=None): f = self.s3_key.read(size) return f def close(self): ...
class ReadableS3File: def __init__(self, s3_key): pass def read(self, size=None): pass def close(self): pass def __del__(self): pass def __exit__(self, exc_type, exc, traceback): pass def __enter__(self): pass def _add_to_buffer(self, l...
13
0
5
0
4
0
2
0.1
0
1
0
0
12
4
12
12
70
14
51
24
38
5
49
24
36
7
0
5
18
17,826
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3Client
from luigi.target import FileAlreadyExists, FileSystem, FileSystemException, FileSystemTarget, AtomicLocalFile, MissingParentDirectory import datetime from luigi import configuration from urllib.parse import urlsplit import itertools from multiprocessing.pool import ThreadPool import os.path from configparser import No...
class S3Client(FileSystem): ''' boto3-powered S3 client. ''' def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None, **kwargs): pass @property def s3(self): pass @s3.setter def s3(self): pass def exists(self, path): ...
34
16
17
2
11
5
3
0.44
1
15
4
0
21
1
26
55
484
79
285
117
246
124
235
104
206
8
4
3
75
17,827
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3EmrTarget
import warnings class S3EmrTarget(S3FlagTarget): """ Deprecated. Use :py:class:`S3FlagTarget` """ def __init__(self, *args, **kwargs): warnings.warn('S3EmrTarget is deprecated. Please use S3FlagTarget') super(S3EmrTarget, self).__init__(*args, **kwargs)
class S3EmrTarget(S3FlagTarget): ''' Deprecated. Use :py:class:`S3FlagTarget` ''' def __init__(self, *args, **kwargs): pass
2
1
3
0
3
0
1
0.75
1
1
0
0
1
0
1
35
8
1
4
2
2
3
4
2
2
1
7
0
1
17,828
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3EmrTask
from luigi.task import ExternalTask from luigi.parameter import OptionalParameter, Parameter class S3EmrTask(ExternalTask): """ An external task that requires the existence of EMR output in S3. """ path = Parameter() def output(self): return S3EmrTarget(self.path)
class S3EmrTask(ExternalTask): ''' An external task that requires the existence of EMR output in S3. ''' def output(self): pass
2
1
2
0
2
0
1
0.75
1
1
1
0
1
0
1
79
8
1
4
3
2
3
4
3
2
1
6
0
1
17,829
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3FlagTarget
from luigi.format import get_default_format class S3FlagTarget(S3Target): """ Defines a target directory with a flag-file (defaults to `_SUCCESS`) used to signify job success. This checks for two things: * the path exists (just like the S3Target) * the _SUCCESS file exists within the director...
class S3FlagTarget(S3Target): ''' Defines a target directory with a flag-file (defaults to `_SUCCESS`) used to signify job success. This checks for two things: * the path exists (just like the S3Target) * the _SUCCESS file exists within the directory. Because Hadoop outputs into a directory...
3
2
11
1
6
5
2
1.62
1
2
0
1
2
1
2
34
45
11
13
6
10
21
12
6
9
3
6
1
4
17,830
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3FlagTask
from luigi.task import ExternalTask from luigi.parameter import OptionalParameter, Parameter class S3FlagTask(ExternalTask): """ An external task that requires the existence of EMR output in S3. """ path = Parameter() flag = OptionalParameter(default=None) def output(self): return S3Fl...
class S3FlagTask(ExternalTask): ''' An external task that requires the existence of EMR output in S3. ''' def output(self): pass
2
1
2
0
2
0
1
0.6
1
1
1
0
1
0
1
79
9
1
5
4
3
3
5
4
3
1
6
0
1
17,831
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3PathTask
from luigi.task import ExternalTask from luigi.parameter import OptionalParameter, Parameter class S3PathTask(ExternalTask): """ A external task that to require existence of a path in S3. """ path = Parameter() def output(self): return S3Target(self.path)
class S3PathTask(ExternalTask): ''' A external task that to require existence of a path in S3. ''' def output(self): pass
2
1
2
0
2
0
1
0.75
1
1
1
1
1
0
1
79
8
1
4
3
2
3
4
3
2
1
6
0
1
17,832
spotify/luigi
spotify_luigi/luigi/contrib/s3.py
luigi.contrib.s3.S3Target
from luigi.target import FileAlreadyExists, FileSystem, FileSystemException, FileSystemTarget, AtomicLocalFile, MissingParentDirectory from luigi.format import get_default_format class S3Target(FileSystemTarget): """ Target S3 file object :param kwargs: Keyword arguments are passed to the boto function `i...
class S3Target(FileSystemTarget): ''' Target S3 file object :param kwargs: Keyword arguments are passed to the boto function `initiate_multipart_upload` ''' def __init__(self, path, format=None, client=None, **kwargs): pass def open(self, mode='r'): pass
3
1
12
2
10
0
3
0.18
1
6
4
1
2
3
2
32
33
7
22
9
19
4
20
9
17
4
5
2
6
17,833
spotify/luigi
spotify_luigi/luigi/contrib/salesforce.py
luigi.contrib.salesforce.QuerySalesforce
import csv from luigi import Task import abc class QuerySalesforce(Task): @property @abc.abstractmethod def object_name(self): """ Override to return the SF object we are querying. Must have the SF "__c" suffix if it is a customer object. """ return None @prope...
class QuerySalesforce(Task): @property @abc.abstractmethod def object_name(self): ''' Override to return the SF object we are querying. Must have the SF "__c" suffix if it is a customer object. ''' pass @property def use_sandbox(self): ''' Ov...
17
7
13
1
9
3
3
0.27
1
4
2
1
8
0
8
8
121
17
82
34
65
22
66
25
57
9
1
5
20
17,834
spotify/luigi
spotify_luigi/luigi/contrib/salesforce.py
luigi.contrib.salesforce.SalesforceAPI
from urllib.parse import urlsplit import warnings import tempfile import csv import xml.etree.ElementTree as ET import luigi from collections import OrderedDict import time class SalesforceAPI: """ Class used to interact with the SalesforceAPI. Currently provides only the methods necessary for performing ...
null
46
15
9
1
6
2
2
0.42
0
3
0
0
45
8
45
45
477
95
269
101
223
113
209
101
163
7
0
2
69
17,835
spotify/luigi
spotify_luigi/luigi/contrib/salesforce.py
luigi.contrib.salesforce.salesforce
import luigi class salesforce(luigi.Config): """ Config system to get config vars from 'salesforce' section in configuration file. Did not include sandbox_name here, as the user may have multiple sandboxes. """ username = luigi.Parameter(default='') password = luigi.Parameter(default='') s...
class salesforce(luigi.Config): ''' Config system to get config vars from 'salesforce' section in configuration file. Did not include sandbox_name here, as the user may have multiple sandboxes. ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
78
12
2
5
5
4
5
5
5
4
0
6
0
0
17,836
spotify/luigi
spotify_luigi/luigi/contrib/scalding.py
luigi.contrib.scalding.ScaldingJobRunner
import subprocess import warnings import os import re import luigi.configuration from luigi import LocalTarget import luigi.contrib.hadoop import luigi.contrib.hadoop_jar import luigi.contrib.hdfs class ScaldingJobRunner(luigi.contrib.hadoop.JobRunner): """ JobRunner for `pyscald` commands. Used to run a Scald...
class ScaldingJobRunner(luigi.contrib.hadoop.JobRunner): ''' JobRunner for `pyscald` commands. Used to run a ScaldingJobTask. ''' def __init__(self): pass def _get_jars(self, path): pass def get_scala_jars(self, include_compiler=False): pass def get_scalding_jars...
13
1
12
2
10
1
3
0.07
1
5
2
0
12
5
12
12
165
30
126
50
113
9
114
50
101
7
1
3
30
17,837
spotify/luigi
spotify_luigi/luigi/contrib/scalding.py
luigi.contrib.scalding.ScaldingJobTask
import luigi.contrib.hadoop_jar import luigi.configuration import luigi.contrib.hadoop import os import luigi.contrib.hdfs from luigi.task import flatten class ScaldingJobTask(luigi.contrib.hadoop.BaseHadoopJobTask): """ A job task for Scalding that define a scala source and (optional) main method. requir...
class ScaldingJobTask(luigi.contrib.hadoop.BaseHadoopJobTask): ''' A job task for Scalding that define a scala source and (optional) main method. requires() should return a dictionary where the keys are Scalding argument names and values are sub tasks or lists of subtasks. For example: .. code-...
11
9
6
0
3
3
1
1.24
1
1
1
1
10
0
10
100
81
16
29
14
18
36
29
14
18
2
6
1
11
17,838
spotify/luigi
spotify_luigi/luigi/contrib/sge.py
luigi.contrib.sge.LocalSGEJobTask
class LocalSGEJobTask(SGEJobTask): """A local version of SGEJobTask, for easier debugging. This version skips the ``qsub`` steps and simply runs ``work()`` on the local node, so you don't need to be on an SGE cluster to use your Task in a test workflow. """ def run(self): self.work()
class LocalSGEJobTask(SGEJobTask): '''A local version of SGEJobTask, for easier debugging. This version skips the ``qsub`` steps and simply runs ``work()`` on the local node, so you don't need to be on an SGE cluster to use your Task in a test workflow. ''' def run(self): pass
2
1
2
0
2
0
1
1.67
1
0
0
0
1
0
1
87
10
2
3
2
1
5
3
2
1
1
6
0
1
17,839
spotify/luigi
spotify_luigi/luigi/contrib/sge.py
luigi.contrib.sge.SGEJobTask
import luigi import pickle import time from luigi.contrib.hadoop import create_packages_archive import os import logging from luigi.contrib import sge_runner import subprocess import sys import random class SGEJobTask(luigi.Task): """Base class for executing a job on SunGrid Engine Override ``work()`` (rather...
null
9
3
16
1
12
3
3
0.42
1
2
0
2
8
5
8
86
192
23
120
40
111
51
96
38
87
7
5
3
25
17,840
spotify/luigi
spotify_luigi/luigi/contrib/simulate.py
luigi.contrib.simulate.RunAnywayTarget
from multiprocessing import Value import luigi import tempfile import os import hashlib class RunAnywayTarget(luigi.Target): """ A target used to make a task run every time it is called. Usage: Pass `self` as the first argument in your task's `output`: .. code-block: python def output(s...
class RunAnywayTarget(luigi.Target): ''' A target used to make a task run every time it is called. Usage: Pass `self` as the first argument in your task's `output`: .. code-block: python def output(self): return RunAnywayTarget(self) And then mark it as `done` in your task's...
6
4
9
1
6
2
2
0.83
1
2
0
0
5
1
5
26
80
18
35
17
27
29
35
17
27
6
4
3
11
17,841
spotify/luigi
spotify_luigi/luigi/contrib/spark.py
luigi.contrib.spark.PySparkTask
from luigi import configuration import shutil import os import pickle import importlib import inspect import tarfile import tempfile import sys import re class PySparkTask(SparkSubmitTask): """ Template task for running an inline PySpark job Simply implement the ``main`` method in your subclass You c...
class PySparkTask(SparkSubmitTask): ''' Template task for running an inline PySpark job Simply implement the ``main`` method in your subclass You can optionally define package names to be distributed to the cluster with ``py_packages`` (uses luigi's global py-packages configuration by default) ...
16
4
7
0
5
1
2
0.31
1
4
0
3
11
2
11
136
103
18
65
32
49
20
58
27
46
4
7
2
18
17,842
spotify/luigi
spotify_luigi/luigi/contrib/spark.py
luigi.contrib.spark.SparkSubmitTask
from luigi.contrib.external_program import ExternalProgramTask import collections from luigi import configuration import os class SparkSubmitTask(ExternalProgramTask): """ Template task for running a Spark job Supports running jobs on Spark local, standalone, Mesos or Yarn See http://spark.apache.org...
class SparkSubmitTask(ExternalProgramTask): ''' Template task for running a Spark job Supports running jobs on Spark local, standalone, Mesos or Yarn See http://spark.apache.org/docs/latest/submitting-applications.html for more information ''' @property def tracking_url_pattern(self): ...
69
2
3
0
3
0
1
0.08
1
8
0
6
40
0
40
125
227
47
167
81
98
13
135
53
94
3
6
2
53
17,843
spotify/luigi
spotify_luigi/luigi/contrib/sparkey.py
luigi.contrib.sparkey.SparkeyExportTask
import luigi class SparkeyExportTask(luigi.Task): """ A luigi task that writes to a local sparkey log file. Subclasses should implement the requires and output methods. The output must be a luigi.LocalTarget. The resulting sparkey log file will contain one entry for every line in the input, m...
class SparkeyExportTask(luigi.Task): ''' A luigi task that writes to a local sparkey log file. Subclasses should implement the requires and output methods. The output must be a luigi.LocalTarget. The resulting sparkey log file will contain one entry for every line in the input, mapping from the...
4
1
7
1
6
1
2
0.63
1
3
1
0
3
0
3
81
41
10
19
12
14
12
19
12
14
3
5
1
5
17,844
spotify/luigi
spotify_luigi/luigi/contrib/sqla.py
luigi.contrib.sqla.CopyToTable
import sqlalchemy import abc import luigi import itertools import logging class CopyToTable(luigi.Task): """ An abstract task for inserting a data set into SQLAlchemy RDBMS Usage: * subclass and override the required `connection_string`, `table` and `columns` attributes. * optionally override the...
class CopyToTable(luigi.Task): ''' An abstract task for inserting a data set into SQLAlchemy RDBMS Usage: * subclass and override the required `connection_string`, `table` and `columns` attributes. * optionally override the `schema` attribute to use a different schema for the target table. ...
14
5
11
1
7
3
2
0.72
1
7
1
9
8
1
8
86
144
20
74
37
60
53
60
31
50
7
5
4
17
17,845
spotify/luigi
spotify_luigi/luigi/contrib/sqla.py
luigi.contrib.sqla.SQLAlchemyTarget
import datetime import collections import luigi import os import sqlalchemy class SQLAlchemyTarget(luigi.Target): """ Database target using SQLAlchemy. This will rarely have to be directly instantiated by the user. Typical usage would be to override `luigi.contrib.sqla.CopyToTable` class to creat...
class SQLAlchemyTarget(luigi.Target): ''' Database target using SQLAlchemy. This will rarely have to be directly instantiated by the user. Typical usage would be to override `luigi.contrib.sqla.CopyToTable` class to create a task to write to the database. ''' def __init__(self, connection_...
9
5
14
1
9
4
2
0.48
1
2
0
0
7
6
7
28
120
16
71
32
62
34
55
28
47
3
4
2
14
17,846
spotify/luigi
spotify_luigi/luigi/contrib/ssh.py
luigi.contrib.ssh.AtomicRemoteFileWriter
import luigi.target import luigi.format import luigi import os import random class AtomicRemoteFileWriter(luigi.format.OutputPipeProcessWrapper): def __init__(self, fs, path): self._fs = fs self.path = path normpath = os.path.normpath(self.path) folder = os.path.dirname(normpath) ...
class AtomicRemoteFileWriter(luigi.format.OutputPipeProcessWrapper): def __init__(self, fs, path): pass def __del__(self): pass def close(self): pass @property def tmp_path(self): pass @property def fs(self): pass
8
0
6
1
5
0
2
0.07
1
2
0
0
5
3
5
18
37
8
27
13
19
2
24
11
18
3
1
2
8
17,847
spotify/luigi
spotify_luigi/luigi/contrib/ssh.py
luigi.contrib.ssh.RemoteCalledProcessError
import subprocess class RemoteCalledProcessError(subprocess.CalledProcessError): def __init__(self, returncode, command, host, output=None): super(RemoteCalledProcessError, self).__init__(returncode, command, output) self.host = host def __str__(self): return "Command '%s' on host %s ...
class RemoteCalledProcessError(subprocess.CalledProcessError): def __init__(self, returncode, command, host, output=None): pass def __str__(self): pass
3
0
3
0
3
0
1
0
1
1
0
0
2
1
2
16
8
1
7
4
4
0
6
4
3
1
5
0
2
17,848
spotify/luigi
spotify_luigi/luigi/contrib/ssh.py
luigi.contrib.ssh.RemoteContext
import subprocess import contextlib class RemoteContext: def __init__(self, host, **kwargs): self.host = host self.username = kwargs.get('username', None) self.key_file = kwargs.get('key_file', None) self.connect_timeout = kwargs.get('connect_timeout', None) self.port = kwa...
class RemoteContext: def __init__(self, host, **kwargs): pass def __repr__(self): pass def __eq__(self, other): pass def __hash__(self): pass def _host_ref(self): pass def _prepare_cmd(self, cmd): pass def Popen(self, cmd, **kwargs): ...
11
3
9
1
7
2
2
0.26
0
3
1
0
9
8
9
9
91
15
62
26
51
16
53
25
43
7
0
1
17
17,849
spotify/luigi
spotify_luigi/luigi/contrib/ssh.py
luigi.contrib.ssh.RemoteFileSystem
import subprocess import luigi import random import luigi.format import luigi.target import os import posixpath class RemoteFileSystem(luigi.target.FileSystem): def __init__(self, host, **kwargs): self.remote_context = RemoteContext(host, **kwargs) def exists(self, path): """ Return `...
class RemoteFileSystem(luigi.target.FileSystem): def __init__(self, host, **kwargs): pass def exists(self, path): ''' Return `True` if file or directory at `path` exist, False otherwise. ''' pass def listdir(self, path): pass def isdir(self, path): ...
10
3
12
1
10
1
3
0.12
1
7
4
0
9
1
9
38
116
15
90
26
80
11
82
23
72
7
4
2
30
17,850
spotify/luigi
spotify_luigi/luigi/contrib/ssh.py
luigi.contrib.ssh.RemoteTarget
import luigi.format import luigi.target import luigi class RemoteTarget(luigi.target.FileSystemTarget): """ Target used for reading from remote files. The target is implemented using ssh commands streaming data over the network. """ def __init__(self, path, host, format=None, **kwargs): s...
class RemoteTarget(luigi.target.FileSystemTarget): ''' Target used for reading from remote files. The target is implemented using ssh commands streaming data over the network. ''' def __init__(self, path, host, format=None, **kwargs): pass @property def fs(self): pass ...
7
1
6
0
6
0
2
0.13
1
5
3
0
5
2
5
35
40
6
30
11
23
4
24
10
18
5
5
2
10
17,851
spotify/luigi
spotify_luigi/luigi/contrib/target.py
luigi.contrib.target.CascadingClient
from types import MethodType import luigi.target class CascadingClient: """ A FilesystemClient that will cascade failing function calls through a list of clients. Which clients are used are specified at time of construction. """ ALL_METHOD_NAMES = ['exists', 'rename', 'remove', 'chmod', 'chown', '...
class CascadingClient: ''' A FilesystemClient that will cascade failing function calls through a list of clients. Which clients are used are specified at time of construction. ''' def __init__(self, clients, method_names=None): pass @classmethod def _make_method(cls, method_name): ...
6
1
8
0
7
0
3
0.22
0
3
1
0
2
1
3
3
50
6
36
15
30
8
27
14
22
5
0
3
10
17,852
spotify/luigi
spotify_luigi/luigi/contrib/webhdfs.py
luigi.contrib.webhdfs.AtomicWebHdfsFile
from luigi.target import FileSystemTarget, AtomicLocalFile class AtomicWebHdfsFile(AtomicLocalFile): """ An Hdfs file that writes to a temp file and put to WebHdfs on close. """ def __init__(self, path, client): self.client = client super(AtomicWebHdfsFile, self).__init__(path) de...
class AtomicWebHdfsFile(AtomicLocalFile): ''' An Hdfs file that writes to a temp file and put to WebHdfs on close. ''' def __init__(self, path, client): pass def move_to_final_destination(self): pass
3
1
3
0
3
0
2
0.43
1
1
0
0
2
1
2
9
12
2
7
4
4
3
7
4
4
2
1
1
3
17,853
spotify/luigi
spotify_luigi/luigi/contrib/webhdfs.py
luigi.contrib.webhdfs.ReadableWebHdfsFile
class ReadableWebHdfsFile: def __init__(self, path, client): self.path = path self.client = client self.generator = None def read(self): self.generator = self.client.read(self.path) res = list(self.generator)[0] return res def readlines(self, char='\n'): ...
class ReadableWebHdfsFile: def __init__(self, path, client): pass def read(self): pass def readlines(self, char='\n'): pass def __enter__(self): pass def __exit__(self, exc_type, exc, traceback): pass def __iter__(self): pass def close(s...
8
0
3
0
3
0
1
0
0
1
0
0
7
3
7
7
29
7
22
12
14
0
22
12
14
1
0
0
7
17,854
spotify/luigi
spotify_luigi/luigi/contrib/webhdfs.py
luigi.contrib.webhdfs.WebHdfsTarget
from luigi.target import FileSystemTarget, AtomicLocalFile from luigi.format import get_default_format class WebHdfsTarget(FileSystemTarget): fs = None def __init__(self, path, client=None, format=None): super(WebHdfsTarget, self).__init__(path) path = self.path self.fs = client or Web...
class WebHdfsTarget(FileSystemTarget): def __init__(self, path, client=None, format=None): pass def open(self, mode='r'): pass
3
0
10
2
9
0
3
0
1
4
2
0
2
2
2
32
24
5
19
6
16
0
15
5
12
3
5
1
5
17,855
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.Custom
import re import datetime class Custom(DateInterval): """Custom date interval (does not implement prev and next methods) Actually the ISO 8601 specifies <start>/<end> as the time interval format Not sure if this goes for date intervals as well. In any case slashes will most likely cause problems with ...
class Custom(DateInterval): '''Custom date interval (does not implement prev and next methods) Actually the ISO 8601 specifies <start>/<end> as the time interval format Not sure if this goes for date intervals as well. In any case slashes will most likely cause problems with paths etc. ''' def...
4
1
4
0
4
0
2
0.5
1
4
0
0
1
0
2
22
18
3
10
7
6
5
9
6
6
2
1
1
3
17,856
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.Date
import re import datetime class Date(DateInterval): """ Most simple :class:`DateInterval` where ``date_b == date_a + datetime.timedelta(1)``.""" def __init__(self, y, m, d): a = datetime.date(y, m, d) b = datetime.date(y, m, d) + datetime.timedelta(1) super(Date, self).__init__(a, b) ...
class Date(DateInterval): ''' Most simple :class:`DateInterval` where ``date_b == date_a + datetime.timedelta(1)``.''' def __init__(self, y, m, d): pass def to_string(self): pass @classmethod def from_date(cls, d): pass @classmethod def parse(cls, s): pass
7
1
3
0
3
0
1
0.07
1
5
0
0
2
0
4
24
20
5
14
9
7
1
12
7
7
2
1
1
5
17,857
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.DateInterval
import datetime class DateInterval: """ The :class:`DateInterval` is the base class with subclasses :class:`Date`, :class:`Week`, :class:`Month`, :class:`Year`, and :class:`Custom`. Note that the :class:`DateInterval` is abstract and should not be used directly: use :class:`Custom` for arbitrary date inter...
class DateInterval: ''' The :class:`DateInterval` is the base class with subclasses :class:`Date`, :class:`Week`, :class:`Month`, :class:`Year`, and :class:`Custom`. Note that the :class:`DateInterval` is abstract and should not be used directly: use :class:`Custom` for arbitrary date intervals. The ba...
23
7
4
0
3
0
2
0.31
0
7
0
5
18
2
20
20
116
28
67
30
44
21
64
28
43
3
0
2
31
17,858
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.Month
import re import datetime class Month(DateInterval): def __init__(self, y, m): date_a = datetime.date(y, m, 1) date_b = datetime.date(y + m // 12, 1 + m % 12, 1) super(Month, self).__init__(date_a, date_b) def to_string(self): return self.date_a.strftime('%Y-%m') @classme...
class Month(DateInterval): def __init__(self, y, m): pass def to_string(self): pass @classmethod def from_date(cls, d): pass @classmethod def parse(cls, s): pass
7
0
3
0
3
0
1
0
1
4
0
0
2
0
4
24
19
4
15
10
8
0
13
8
8
2
1
1
5
17,859
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.Week
import datetime import re class Week(DateInterval): """ ISO 8601 week. Note that it has some counterintuitive behavior around new year. For instance Monday 29 December 2008 is week 2009-W01, and Sunday 3 January 2010 is week 2009-W53 This example was taken from from http://en.wikipedia.org/wiki/ISO_8601#We...
class Week(DateInterval): ''' ISO 8601 week. Note that it has some counterintuitive behavior around new year. For instance Monday 29 December 2008 is week 2009-W01, and Sunday 3 January 2010 is week 2009-W53 This example was taken from from http://en.wikipedia.org/wiki/ISO_8601#Week_dates ''' def ...
7
2
5
0
5
0
2
0.24
1
7
0
0
2
0
4
24
30
4
21
12
14
5
19
10
14
3
1
2
7
17,860
spotify/luigi
spotify_luigi/luigi/date_interval.py
luigi.date_interval.Year
import datetime import re class Year(DateInterval): def __init__(self, y): date_a = datetime.date(y, 1, 1) date_b = datetime.date(y + 1, 1, 1) super(Year, self).__init__(date_a, date_b) def to_string(self): return self.date_a.strftime('%Y') @classmethod def from_date(...
class Year(DateInterval): def __init__(self, y): pass def to_string(self): pass @classmethod def from_date(cls, d): pass @classmethod def parse(cls, s): pass
7
0
3
0
3
0
1
0
1
3
0
0
2
0
4
24
18
4
14
9
7
0
12
7
7
2
1
1
5
17,861
spotify/luigi
spotify_luigi/luigi/db_task_history.py
luigi.db_task_history.DbTaskHistory
from luigi import configuration from luigi import task_history from luigi.task_status import DONE, FAILED, PENDING, RUNNING import datetime import sqlalchemy.ext.declarative import sqlalchemy import sqlalchemy.orm import sqlalchemy.orm.collections from contextlib import contextmanager class DbTaskHistory(task_history....
class DbTaskHistory(task_history.TaskHistory): ''' Task History that writes to a database using sqlalchemy. Also has methods for useful db queries. ''' @contextmanager def _session(self, session=None): pass def __init__(self): pass def task_scheduled(self, task): ...
17
8
8
0
6
2
2
0.28
1
9
4
0
15
3
15
38
139
18
95
38
78
27
86
36
70
5
4
3
27
17,862
spotify/luigi
spotify_luigi/luigi/db_task_history.py
luigi.db_task_history.TaskEvent
import sqlalchemy import sqlalchemy.orm import sqlalchemy.orm.collections import sqlalchemy.ext.declarative class TaskEvent(Base): """ Table to track when a task is scheduled, starts, finishes, and fails. """ __tablename__ = 'task_events' id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)...
class TaskEvent(Base): ''' Table to track when a task is scheduled, starts, finishes, and fails. ''' def __repr__(self): pass
2
1
2
0
2
0
1
0.5
1
0
0
0
1
0
1
1
12
1
8
6
6
4
8
6
6
1
1
0
1
17,863
spotify/luigi
spotify_luigi/luigi/db_task_history.py
luigi.db_task_history.TaskParameter
import sqlalchemy.orm import sqlalchemy.ext.declarative import sqlalchemy import sqlalchemy.orm.collections class TaskParameter(Base): """ Table to track luigi.Parameter()s of a Task. """ __tablename__ = 'task_parameters' task_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey('tasks....
class TaskParameter(Base): ''' Table to track luigi.Parameter()s of a Task. ''' def __repr__(self): pass
2
1
2
0
2
0
1
0.57
1
0
0
0
1
0
1
1
11
1
7
6
5
4
7
6
5
1
1
0
1
17,864
spotify/luigi
spotify_luigi/luigi/db_task_history.py
luigi.db_task_history.TaskRecord
import sqlalchemy.orm import sqlalchemy import sqlalchemy.ext.declarative import sqlalchemy.orm.collections class TaskRecord(Base): """ Base table to track information about a luigi.Task. References to other tables are available through task.events, task.parameters, etc. """ __tablename__ = 'tasks...
class TaskRecord(Base): ''' Base table to track information about a luigi.Task. References to other tables are available through task.events, task.parameters, etc. ''' def __repr__(self): pass
2
1
2
0
2
0
1
0.31
1
0
0
0
1
0
1
1
22
2
16
8
14
5
10
8
8
1
1
0
1
17,865
spotify/luigi
spotify_luigi/luigi/event.py
luigi.event.Event
class Event: DEPENDENCY_DISCOVERED = 'event.core.dependency.discovered' DEPENDENCY_MISSING = 'event.core.dependency.missing' DEPENDENCY_PRESENT = 'event.core.dependency.present' BROKEN_TASK = 'event.core.task.broken' START = 'event.core.start' PROGRESS = 'event.core.progress' FAILURE = 'even...
class Event: pass
1
0
0
0
0
0
0
0.58
0
0
0
1
0
0
0
0
16
0
12
12
11
7
12
12
11
0
0
0
0
17,866
spotify/luigi
spotify_luigi/luigi/execution_summary.py
luigi.execution_summary.LuigiRunResult
class LuigiRunResult: """ The result of a call to build/run when passing the detailed_summary=True argument. Attributes: - one_line_summary (str): One line summary of the progress. - summary_text (str): Detailed summary of the progress. - status (LuigiStatusCode): Luigi Status Code....
class LuigiRunResult: ''' The result of a call to build/run when passing the detailed_summary=True argument. Attributes: - one_line_summary (str): One line summary of the progress. - summary_text (str): Detailed summary of the progress. - status (LuigiStatusCode): Luigi Status Code. ...
4
1
4
0
4
0
1
0.75
0
0
0
0
3
5
3
3
25
4
12
10
8
9
12
10
8
1
0
0
3
17,867
spotify/luigi
spotify_luigi/luigi/execution_summary.py
luigi.execution_summary.LuigiStatusCode
import enum class LuigiStatusCode(enum.Enum): """ All possible status codes for the attribute ``status`` in :class:`~luigi.execution_summary.LuigiRunResult` when the argument ``detailed_summary=True`` in *luigi.run() / luigi.build*. Here are the codes and what they mean: ==========================...
class LuigiStatusCode(enum.Enum): ''' All possible status codes for the attribute ``status`` in :class:`~luigi.execution_summary.LuigiRunResult` when the argument ``detailed_summary=True`` in *luigi.run() / luigi.build*. Here are the codes and what they mean: ============================= ========...
1
1
0
0
0
0
0
2
1
0
0
0
0
0
0
49
26
2
8
8
7
16
8
8
7
0
4
0
0
17,868
spotify/luigi
spotify_luigi/luigi/execution_summary.py
luigi.execution_summary.execution_summary
import luigi class execution_summary(luigi.Config): summary_length = luigi.IntParameter(default=5)
class execution_summary(luigi.Config): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
78
2
0
2
2
1
0
2
2
1
0
6
0
0
17,869
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.BaseWrapper
class BaseWrapper: def __init__(self, stream, *args, **kwargs): self._stream = stream try: super(BaseWrapper, self).__init__(stream, *args, **kwargs) except TypeError: pass def __getattr__(self, name): if name == '_stream': raise AttributeErr...
class BaseWrapper: def __init__(self, stream, *args, **kwargs): pass def __getattr__(self, name): pass def __enter__(self): pass def __exit__(self, *args): pass def __iter__(self): pass
6
0
4
0
4
0
2
0
0
3
0
2
5
1
5
5
27
5
22
8
16
0
21
8
15
2
0
2
8
17,870
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.Bzip2Format
class Bzip2Format(Format): input = 'bytes' output = 'bytes' def pipe_reader(self, input_pipe): return InputPipeProcessWrapper(['bzcat'], input_pipe) def pipe_writer(self, output_pipe): return OutputPipeProcessWrapper(['bzip2'], output_pipe)
class Bzip2Format(Format): def pipe_reader(self, input_pipe): pass def pipe_writer(self, output_pipe): pass
3
0
2
0
2
0
1
0
1
2
2
0
2
0
2
5
10
3
7
4
4
0
7
4
4
1
1
0
2
17,871
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.ChainFormat
class ChainFormat(Format): def __init__(self, *args, **kwargs): self.args = args try: self.input = args[0].input except AttributeError: pass try: self.output = args[-1].output except AttributeError: pass if not kwargs.g...
class ChainFormat(Format): def __init__(self, *args, **kwargs): pass def pipe_reader(self, input_pipe): pass def pipe_writer(self, output_pipe): pass
4
0
11
0
11
0
4
0
1
4
0
0
3
3
3
6
38
3
35
10
31
0
27
10
23
7
1
3
11
17,872
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.FileWrapper
class FileWrapper: """ Wrap `file` in a "real" so stuff can be added to it after creation. """ def __init__(self, file_object): self._subpipe = file_object def __getattr__(self, name): return getattr(self._subpipe, name) def __enter__(self, *args, **kwargs): return sel...
class FileWrapper: ''' Wrap `file` in a "real" so stuff can be added to it after creation. ''' def __init__(self, file_object): pass def __getattr__(self, name): pass def __enter__(self, *args, **kwargs): pass def __exit__(self, *args, **kwargs): pass ...
6
1
3
0
2
1
1
0.73
0
0
0
0
5
1
5
5
24
5
11
7
5
8
11
7
5
1
0
0
5
17,873
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.Format
class Format: """ Interface for format specifications. """ @classmethod def pipe_reader(cls, input_pipe): raise NotImplementedError() @classmethod def pipe_writer(cls, output_pipe): raise NotImplementedError() def __rshift__(a, b): return ChainFormat(a, b)
class Format: ''' Interface for format specifications. ''' @classmethod def pipe_reader(cls, input_pipe): pass @classmethod def pipe_writer(cls, output_pipe): pass def __rshift__(a, b): pass
6
1
2
0
2
0
1
0.33
0
2
1
10
1
0
3
3
15
3
9
6
3
3
7
4
3
1
0
0
3
17,874
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.GzipFormat
class GzipFormat(Format): input = 'bytes' output = 'bytes' def __init__(self, compression_level=None): self.compression_level = compression_level def pipe_reader(self, input_pipe): return InputPipeProcessWrapper(['gunzip'], input_pipe) def pipe_writer(self, output_pipe): a...
class GzipFormat(Format): def __init__(self, compression_level=None): pass def pipe_reader(self, input_pipe): pass def pipe_writer(self, output_pipe): pass
4
0
3
0
3
0
1
0
1
4
2
0
3
1
3
6
16
4
12
7
8
0
12
7
8
2
1
1
4
17,875
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.InputPipeProcessWrapper
import signal import tempfile import os import subprocess import io class InputPipeProcessWrapper: def __init__(self, command, input_pipe=None): """ Initializes a InputPipeProcessWrapper instance. :param command: a subprocess.Popen instance with stdin=input_pipe and ...
class InputPipeProcessWrapper: def __init__(self, command, input_pipe=None): ''' Initializes a InputPipeProcessWrapper instance. :param command: a subprocess.Popen instance with stdin=input_pipe and stdout=subprocess.PIPE. Alternatively, just...
15
3
8
1
5
2
2
0.28
0
6
1
1
13
5
13
13
115
21
74
23
59
21
69
23
54
6
0
4
28
17,876
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.MixedUnicodeBytesFormat
class MixedUnicodeBytesFormat(WrappedFormat): output = 'bytes' wrapper_cls = MixedUnicodeBytesWrapper
class MixedUnicodeBytesFormat(WrappedFormat): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
6
4
1
3
3
2
0
3
3
2
0
2
0
0
17,877
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.MixedUnicodeBytesWrapper
import warnings import locale class MixedUnicodeBytesWrapper(BaseWrapper): """ """ def __init__(self, stream, encoding=None): if encoding is None: encoding = locale.getpreferredencoding() self.encoding = encoding super(MixedUnicodeBytesWrapper, self).__init__(stream) ...
class MixedUnicodeBytesWrapper(BaseWrapper): ''' ''' def __init__(self, stream, encoding=None): pass def write(self, b): pass def writelines(self, lines): pass def _convert(self, b): pass
5
1
4
0
4
0
2
0.13
1
2
0
0
4
1
4
9
21
4
15
6
10
2
15
6
10
2
1
1
6
17,878
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.NewlineFormat
class NewlineFormat(WrappedFormat): input = 'bytes' output = 'bytes' wrapper_cls = NewlineWrapper
class NewlineFormat(WrappedFormat): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
6
5
1
4
3
3
0
4
3
3
0
2
0
0
17,879
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.NewlineWrapper
import os import re class NewlineWrapper(BaseWrapper): def __init__(self, stream, newline=None): if newline is None: self.newline = newline else: self.newline = newline.encode('ascii') if self.newline not in (b'', b'\r\n', b'\n', b'\r', None): raise Valu...
class NewlineWrapper(BaseWrapper): def __init__(self, stream, newline=None): pass def read(self, n=-1): pass def writelines(self, lines): pass def writelines(self, lines): pass
5
0
9
2
7
0
3
0
1
2
0
0
4
1
4
9
40
10
30
10
25
0
25
10
20
3
1
1
10
17,880
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.NopFormat
class NopFormat(Format): def pipe_reader(self, input_pipe): return input_pipe def pipe_writer(self, output_pipe): return output_pipe
class NopFormat(Format): def pipe_reader(self, input_pipe): pass def pipe_writer(self, output_pipe): pass
3
0
2
0
2
0
1
0
1
0
0
0
2
0
2
5
6
1
5
3
2
0
5
3
2
1
1
0
2
17,881
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.OutputPipeProcessWrapper
import subprocess class OutputPipeProcessWrapper: WRITES_BEFORE_FLUSH = 10000 def __init__(self, command, output_pipe=None): self.closed = False self._command = command self._output_pipe = output_pipe self._process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=outpu...
class OutputPipeProcessWrapper: def __init__(self, command, output_pipe=None): pass def write(self, *args, **kwargs): pass def writeLine(self, line): pass def _finish(self): ''' Closes and waits for subprocess to exit. ''' pass def __del_...
14
1
5
0
4
0
2
0.05
0
3
0
3
13
5
13
13
74
13
58
20
44
3
53
20
39
3
0
2
21
17,882
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.TextFormat
class TextFormat(WrappedFormat): input = 'unicode' output = 'bytes' wrapper_cls = TextWrapper
class TextFormat(WrappedFormat): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
6
5
1
4
3
3
0
4
3
3
0
2
0
0
17,883
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.TextWrapper
import io class TextWrapper(io.TextIOWrapper): def __exit__(self, *args): if not self.closed and self.writable(): super(TextWrapper, self).flush() self._stream.__exit__(*args) def __del__(self, *args): if not self.closed and self.writable(): super(TextWrapper, ...
class TextWrapper(io.TextIOWrapper): def __exit__(self, *args): pass def __del__(self, *args): pass def __init__(self, stream, *args, **kwargs): pass def __getattr__(self, name): pass def __enter__(self): pass
6
0
6
0
5
0
2
0.08
0
3
0
0
5
1
5
5
34
7
25
7
19
2
25
7
19
3
0
1
10
17,884
spotify/luigi
spotify_luigi/luigi/format.py
luigi.format.WrappedFormat
class WrappedFormat(Format): def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs def pipe_reader(self, input_pipe): return self.wrapper_cls(input_pipe, *self.args, **self.kwargs) def pipe_writer(self, output_pipe): return self.wrapper_cls(output_pipe...
class WrappedFormat(Format): def __init__(self, *args, **kwargs): pass def pipe_reader(self, input_pipe): pass def pipe_writer(self, output_pipe): pass
4
0
2
0
2
0
1
0
1
0
0
3
3
2
3
6
11
3
8
6
4
0
8
6
4
1
1
0
3
17,885
spotify/luigi
spotify_luigi/luigi/freezing.py
luigi.freezing.FrozenOrderedDict
from collections import OrderedDict import operator import functools class FrozenOrderedDict(Mapping): """ It is an immutable wrapper around ordered dictionaries that implements the complete :py:class:`collections.Mapping` interface. It can be used as a drop-in replacement for dictionaries where immutabili...
class FrozenOrderedDict(Mapping): ''' It is an immutable wrapper around ordered dictionaries that implements the complete :py:class:`collections.Mapping` interface. It can be used as a drop-in replacement for dictionaries where immutability and ordering are desired. ''' def __init__(self, *args, *...
8
1
3
0
3
0
1
0.26
1
3
0
0
7
2
7
41
32
8
19
11
11
5
19
11
11
2
6
1
8
17,886
spotify/luigi
spotify_luigi/luigi/interface.py
luigi.interface.PidLockAlreadyTakenExit
class PidLockAlreadyTakenExit(SystemExit): """ The exception thrown by :py:func:`luigi.run`, when the lock file is inaccessible """ pass
class PidLockAlreadyTakenExit(SystemExit): ''' The exception thrown by :py:func:`luigi.run`, when the lock file is inaccessible ''' pass
1
1
0
0
0
0
0
1.5
1
0
0
0
0
0
0
10
5
0
2
1
1
3
2
1
1
0
3
0
0
17,887
spotify/luigi
spotify_luigi/luigi/interface.py
luigi.interface._WorkerSchedulerFactory
from luigi import worker from luigi import rpc from luigi import scheduler class _WorkerSchedulerFactory: def create_local_scheduler(self): return scheduler.Scheduler(prune_on_get_work=True, record_task_history=False) def create_remote_scheduler(self, url): return rpc.RemoteScheduler(url) ...
class _WorkerSchedulerFactory: def create_local_scheduler(self): pass def create_remote_scheduler(self, url): pass def create_worker(self, scheduler, worker_processes, assistant=False): pass
4
0
2
0
2
0
1
0
0
3
3
0
3
0
3
3
11
3
8
4
4
0
7
4
3
1
0
0
3
17,888
spotify/luigi
spotify_luigi/luigi/interface.py
luigi.interface.core
from luigi import task from luigi import parameter import os import tempfile class core(task.Config): """ Keeps track of a bunch of environment params. Uses the internal luigi parameter mechanism. The nice thing is that we can instantiate this class and get an object with all the environment variables...
class core(task.Config): ''' Keeps track of a bunch of environment params. Uses the internal luigi parameter mechanism. The nice thing is that we can instantiate this class and get an object with all the environment variables set. This is arguably a bit of a hack. ''' pass
1
1
0
0
0
0
0
0.09
1
0
0
0
0
0
0
78
76
3
67
20
66
6
20
20
19
0
6
0
0
17,889
spotify/luigi
spotify_luigi/luigi/local_target.py
luigi.local_target.LocalFileSystem
import random from luigi.target import FileAlreadyExists, MissingParentDirectory, NotADirectory, FileSystem, FileSystemTarget, AtomicLocalFile import shutil import errno import os class LocalFileSystem(FileSystem): """ Wrapper for access to file system operations. Work in progress - add things as needed. ...
class LocalFileSystem(FileSystem): ''' Wrapper for access to file system operations. Work in progress - add things as needed. ''' def copy(self, old_path, new_path, raise_if_exists=False): pass def exists(self, path): pass def mkdir(self, path, parents=True, raise_if_exis...
9
3
9
0
7
1
3
0.26
1
5
3
0
8
0
8
37
83
10
58
16
49
15
53
14
44
8
4
3
24
17,890
spotify/luigi
spotify_luigi/luigi/local_target.py
luigi.local_target.LocalTarget
import io import tempfile import random from luigi.format import FileWrapper, get_default_format from luigi.target import FileAlreadyExists, MissingParentDirectory, NotADirectory, FileSystem, FileSystemTarget, AtomicLocalFile import os import warnings class LocalTarget(FileSystemTarget): fs = LocalFileSystem() ...
class LocalTarget(FileSystemTarget): def __init__(self, path=None, format=None, is_tmp=False): pass def makedirs(self): ''' Create all parent folders if they do not exist. ''' pass def open(self, mode='r'): pass def move(self, new_path, raise_if_exist...
11
1
5
0
5
0
2
0.07
1
6
2
0
9
3
9
39
60
12
45
19
34
3
42
17
32
4
5
2
17
17,891
spotify/luigi
spotify_luigi/luigi/local_target.py
luigi.local_target.atomic_file
from luigi.target import FileAlreadyExists, MissingParentDirectory, NotADirectory, FileSystem, FileSystemTarget, AtomicLocalFile import random import os class atomic_file(AtomicLocalFile): """Simple class that writes to a temp file and moves it on close() Also cleans up the temp file if close is not invoked ...
class atomic_file(AtomicLocalFile): '''Simple class that writes to a temp file and moves it on close() Also cleans up the temp file if close is not invoked ''' def move_to_final_destination(self): pass def generate_tmp_path(self, path): pass
3
1
2
0
2
0
1
0.6
1
0
0
0
2
0
2
9
10
2
5
3
2
3
5
3
2
1
1
0
2
17,892
spotify/luigi
spotify_luigi/luigi/metrics.py
luigi.metrics.MetricsCollector
import abc class MetricsCollector(metaclass=abc.ABCMeta): """Abstractable MetricsCollector base class that can be replace by tool specific implementation. """ @abc.abstractmethod def __init__(self): pass @abc.abstractmethod def handle_task_started(self, task): pass @a...
class MetricsCollector(metaclass=abc.ABCMeta): '''Abstractable MetricsCollector base class that can be replace by tool specific implementation. ''' @abc.abstractmethod def __init__(self): pass @abc.abstractmethod def handle_task_started(self, task): pass @abc.abstractmet...
14
1
2
0
2
0
1
0.15
1
0
0
3
7
0
7
27
30
7
20
13
7
3
15
8
7
1
3
0
7
17,893
spotify/luigi
spotify_luigi/luigi/metrics.py
luigi.metrics.MetricsCollectors
import importlib from enum import Enum class MetricsCollectors(Enum): custom = -1 default = 1 none = 1 datadog = 2 prometheus = 3 @classmethod def get(cls, which, custom_import=None): if which == MetricsCollectors.none: return NoMetricsCollector() elif which == ...
class MetricsCollectors(Enum): @classmethod def get(cls, which, custom_import=None): pass
3
0
27
4
23
0
7
0
1
5
4
0
0
0
1
50
35
5
30
15
25
0
24
14
20
7
4
2
7
17,894
spotify/luigi
spotify_luigi/luigi/metrics.py
luigi.metrics.NoMetricsCollector
class NoMetricsCollector(MetricsCollector): """Empty MetricsCollector when no collector is being used """ def __init__(self): pass def handle_task_started(self, task): pass def handle_task_failed(self, task): pass def handle_task_disabled(self, task, config): ...
class NoMetricsCollector(MetricsCollector): '''Empty MetricsCollector when no collector is being used ''' def __init__(self): pass def handle_task_started(self, task): pass def handle_task_failed(self, task): pass def handle_task_disabled(self, task, config): ...
6
1
2
0
2
0
1
0.18
1
0
0
0
5
0
5
32
18
5
11
6
5
2
11
6
5
1
4
0
5
17,895
spotify/luigi
spotify_luigi/luigi/mock.py
luigi.mock.MockFileSystem
import multiprocessing from luigi import target class MockFileSystem(target.FileSystem): """ MockFileSystem inspects/modifies _data to simulate file system operations. """ _data = None def copy(self, path, dest, raise_if_exists=False): """ Copies the contents of a single file path ...
class MockFileSystem(target.FileSystem): ''' MockFileSystem inspects/modifies _data to simulate file system operations. ''' def copy(self, path, dest, raise_if_exists=False): ''' Copies the contents of a single file path to dest ''' pass def get_all_data(self): ...
11
6
5
0
4
2
2
0.49
1
2
1
0
10
0
10
39
68
10
39
16
28
19
37
16
26
5
4
3
17
17,896
spotify/luigi
spotify_luigi/luigi/mock.py
luigi.mock.MockTarget
from luigi import target from luigi.format import get_default_format import sys from io import BytesIO class MockTarget(target.FileSystemTarget): fs = MockFileSystem() def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None): self._mirror_on_stderr = mirror_on_stderr self.path ...
class MockTarget(target.FileSystemTarget): def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None): pass def exists(self): pass def move(self, path, raise_if_exists=False): ''' Call MockFileSystem's move command ''' pass def rename(se...
15
2
8
1
7
1
2
0.12
1
1
1
0
5
3
5
35
80
16
57
24
42
7
54
24
39
5
5
2
21
17,897
spotify/luigi
spotify_luigi/luigi/mypy.py
luigi.mypy.TaskAttribute
from mypy.plugins.common import add_method_to_class, deserialize_and_fixup_type from mypy.types import AnyType, CallableType, Instance, NoneType, Type, TypeOfAny, get_proper_type from mypy.nodes import ARG_NAMED_OPT, ARG_POS, Argument, AssignmentStmt, Block, CallExpr, ClassDef, Context, EllipsisExpr, Expression, FuncDe...
class TaskAttribute: def __init__(self, name: str, has_default: bool, line: int, column: int, type: Type | None, info: TypeInfo, api: SemanticAnalyzerPluginInterface) -> None: pass def to_argument(self, current_info: TypeInfo, *, of: Literal['__init__',]) -> Argument: pass def expand_typ...
9
1
9
0
8
1
2
0.17
0
3
0
0
6
7
7
7
74
6
60
31
38
10
31
17
23
3
0
2
11
17,898
spotify/luigi
spotify_luigi/luigi/mypy.py
luigi.mypy.TaskPlugin
from typing import Callable, Dict, Final, Iterator, List, Literal, Optional from mypy.types import AnyType, CallableType, Instance, NoneType, Type, TypeOfAny, get_proper_type from mypy.plugin import ClassDefContext, FunctionContext, Plugin, SemanticAnalyzerPluginInterface from mypy.nodes import ARG_NAMED_OPT, ARG_POS, ...
class TaskPlugin(Plugin): def get_base_class_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None: pass def get_function_hook(self, fullname: str) -> Callable[[FunctionContext], Type] | None: '''Adjust the return type of the `Parameters` function.''' pass def che...
6
2
11
1
7
3
2
0.5
1
3
1
0
5
0
5
5
59
8
34
17
24
17
30
13
24
4
1
2
12
17,899
spotify/luigi
spotify_luigi/luigi/mypy.py
luigi.mypy.TaskTransformer
from mypy.plugin import ClassDefContext, FunctionContext, Plugin, SemanticAnalyzerPluginInterface from typing import Callable, Dict, Final, Iterator, List, Literal, Optional from mypy.nodes import ARG_NAMED_OPT, ARG_POS, Argument, AssignmentStmt, Block, CallExpr, ClassDef, Context, EllipsisExpr, Expression, FuncDef, If...
class TaskTransformer: '''Implement the behavior of gokart.Task.''' def __init__(self, cls: ClassDef, reason: Expression | Statement, api: SemanticAnalyzerPluginInterface, task_plugin: TaskPlugin) -> None: pass def transform(self) -> bool: '''Apply all the necessary transformations to the...
9
6
31
4
21
6
5
0.31
0
9
2
0
8
4
8
8
255
36
167
58
144
52
115
44
106
12
0
3
43