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,600
huge-success/sanic
huge-success_sanic/guide/webapp/display/plugins/mermaid.py
webapp.display.plugins.mermaid.Mermaid
from mistune.block_parser import BlockParser from html import unescape from mistune import HTMLRenderer from re import Match from textwrap import dedent from mistune.core import BlockState from mistune.markdown import Markdown from typing import Any from mistune.directives import DirectivePlugin, RSTDirective from html...
class Mermaid(DirectivePlugin): def parse(self, block: BlockParser, m: Match, state: BlockState) -> dict[str, Any]: pass def __call__(self, directive: RSTDirective, md: Markdown) -> None: pass def _render_mermaid(self, renderer: HTMLRenderer, text: str, **attrs): pass
4
0
8
1
7
0
1
0.05
1
6
0
0
3
0
3
3
27
6
21
9
15
1
14
7
10
2
1
1
4
17,601
huge-success/sanic
huge-success_sanic/guide/webapp/display/plugins/notification.py
webapp.display.plugins.notification.Notification
from html5tagger import HTML, E from mistune.directives import Admonition class Notification(Admonition): SUPPORTED_NAMES = {'success', 'info', 'warning', 'danger', 'tip', 'new', 'note'} def __call__(self, directive, md): for name in self.SUPPORTED_NAMES: directive.register(name, self.pars...
class Notification(Admonition): def __call__(self, directive, md): pass def _render_admonition(self, _, text, name, **attrs) -> str: pass def _render_admonition_title(self, _, text) -> str: pass def _render_admonition_content(self, _, text) -> str: pass
5
0
7
0
7
0
2
0
1
1
0
0
4
0
4
4
42
5
37
7
32
0
15
7
10
3
1
1
6
17,602
huge-success/sanic
huge-success_sanic/guide/webapp/display/plugins/tabs.py
webapp.display.plugins.tabs.Tabs
from re import Match from mistune.core import BlockState from textwrap import dedent from typing import Any from mistune.markdown import Markdown from mistune import HTMLRenderer from mistune.block_parser import BlockParser from mistune.directives import DirectivePlugin, RSTDirective class Tabs(DirectivePlugin): ...
class Tabs(DirectivePlugin): def parse(self, block: BlockParser, m: Match, state: BlockState) -> dict[str, Any]: pass def __call__(self, directive: RSTDirective, md: Markdown) -> None: pass def _render_tab(self, renderer: HTMLRenderer, text: str, **attrs): pass
4
0
13
1
12
0
2
0.03
1
6
0
0
3
0
3
3
43
5
38
16
28
1
17
10
13
3
1
1
6
17,603
huge-success/sanic
huge-success_sanic/guide/webapp/display/search/renderer.py
webapp.display.search.renderer.SearchRenderer
from html5tagger import Builder, E from contextlib import contextmanager from ..base import BaseRenderer from webapp.display.search.search import Searcher from urllib.parse import unquote from ..layouts.main import MainLayout from sanic import Request class SearchRenderer(BaseRenderer): def render(self, request: ...
class SearchRenderer(BaseRenderer): def render(self, request: Request, language: str, searcher: Searcher, full: bool) -> Builder: pass def _body(self, request: Request, builder: Builder, language: str, searcher: Searcher, full: bool): pass @contextmanager def _base(self, request: Requ...
6
0
13
0
13
0
2
0.02
1
4
2
0
4
0
4
8
56
4
52
26
31
1
23
10
18
3
1
3
6
17,604
huge-success/sanic
huge-success_sanic/guide/webapp/display/search/search.py
webapp.display.search.search.Document
from typing import ClassVar from webapp.display.page import Page from collections import Counter from msgspec import Struct class Document(Struct, kw_only=True): TITLE_WEIGHT: ClassVar[int] = 3 BODY_WEIGHT: ClassVar[int] = 1 page: Page language: str term_frequency: dict[str, float] = {} @prope...
class Document(Struct, kw_only=True): @property def title(self) -> str: pass @property def text(self) -> str: pass @property def weighted_text(self) -> str: '''Return the text with the title repeated.''' pass def _term_frequency(self, stemmer: Stemmer) -> N...
9
3
5
0
4
1
1
0.1
2
3
1
0
5
0
5
5
40
6
31
15
22
3
20
12
14
1
1
0
5
17,605
huge-success/sanic
huge-success_sanic/guide/webapp/display/search/search.py
webapp.display.search.search.Searcher
class Searcher: def __init__(self, stemmer: Stemmer, documents: list[Document]): self._documents: dict[str, list[Document]] = {} for document in documents: self._documents.setdefault(document.language, []).append(document) self._idf = {language: _inverse_document_frequency(docum...
class Searcher: def __init__(self, stemmer: Stemmer, documents: list[Document]): pass def search(self, query: str, language: str) -> list[tuple[float, Document]]: pass
3
0
16
0
16
0
2
0
0
7
2
0
2
4
2
2
33
1
32
14
23
0
10
8
7
2
0
1
3
17,606
huge-success/sanic
huge-success_sanic/guide/webapp/display/search/search.py
webapp.display.search.search.Stemmer
from typing import ClassVar class Stemmer: STOP_WORDS: ClassVar[set[str]] = set("a about above after again against all am an and any are aren't as at be because been before being below between both but by can't cannot could couldn't did didn't do does doesn't doing don't down during each few for from further had h...
class Stemmer: def stem(self, word: str) -> str: pass def _stem(self, word: str) -> str: pass def __call__(self, word: str) -> str: pass
4
0
6
0
6
0
3
0.07
0
1
0
0
3
0
3
3
30
3
27
10
23
2
23
10
19
5
0
2
9
17,607
huge-success/sanic
huge-success_sanic/guide/webapp/worker/reload.py
webapp.worker.reload.Livereload
from asyncio import sleep from sanic import Request, Sanic, Websocket from pathlib import Path import ujson from typing import Any from queue import Empty, Queue class Livereload: SERVER_NAME = 'Reloader' HELLO = {'command': 'hello', 'protocols': ['http://livereload.com/protocols/official-7'], 'serverName': SE...
class Livereload: def __init__(self, reload_queue: Queue, debug: bool, state: dict[str, Any]): pass def run(self): pass async def _listen_to_queue(self): pass async def livereload_handler(self, request: Request, ws: Websocket): pass async def _wait_for_state(sel...
6
0
10
0
10
0
2
0
0
7
1
0
5
4
5
5
63
6
57
16
49
0
36
14
30
3
0
2
10
17,608
spotify/luigi
spotify_luigi/examples/dynamic_requirements.py
examples.dynamic_requirements.Configuration
import luigi import time import random as rnd class Configuration(luigi.Task): seed = luigi.IntParameter() def output(self): """ Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the ...
class Configuration(luigi.Task): def output(self): ''' Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the target output for this task. :rtype: object (:py:class:`luigi.target.Ta...
3
1
9
1
5
3
1
0.55
1
4
1
0
2
0
2
80
21
4
11
6
8
6
10
5
7
1
5
1
2
17,609
spotify/luigi
spotify_luigi/examples/dynamic_requirements.py
examples.dynamic_requirements.Data
import time import luigi class Data(luigi.Task): magic_number = luigi.IntParameter() def output(self): """ Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the target output for this...
class Data(luigi.Task): def output(self): ''' Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the target output for this task. :rtype: object (:py:class:`luigi.target.Target`) ...
3
1
7
1
3
3
1
0.75
1
1
1
0
2
0
2
80
17
3
8
5
5
6
8
4
5
1
5
1
2
17,610
spotify/luigi
spotify_luigi/examples/dynamic_requirements.py
examples.dynamic_requirements.Dynamic
import os import luigi class Dynamic(luigi.Task): seed = luigi.IntParameter(default=1) def output(self): """ Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the target output for th...
class Dynamic(luigi.Task): def output(self): ''' Returns the target output for this task. In this case, a successful execution of this task will create a file on the local filesystem. :return: the target output for this task. :rtype: object (:py:class:`luigi.target.Target`)...
4
1
15
2
8
6
1
0.7
1
5
4
0
2
0
2
80
41
8
20
11
16
14
20
10
16
2
5
1
4
17,611
spotify/luigi
spotify_luigi/examples/elasticsearch_index.py
examples.elasticsearch_index.FakeDocuments
import json import luigi import datetime class FakeDocuments(luigi.Task): """ Generates a local file containing 5 elements of data in JSON format. """ date = luigi.DateParameter(default=datetime.date.today()) def run(self): """ Writes data in JSON format into the task's output targ...
class FakeDocuments(luigi.Task): ''' Generates a local file containing 5 elements of data in JSON format. ''' def run(self): ''' Writes data in JSON format into the task's output target. The data objects have the following attributes: * `_id` is the default Elasticsearc...
3
3
13
2
5
7
2
1.55
1
4
1
0
2
0
2
80
35
7
11
7
8
17
10
6
7
2
5
2
3
17,612
spotify/luigi
spotify_luigi/examples/elasticsearch_index.py
examples.elasticsearch_index.IndexDocuments
import datetime from luigi.contrib.esindex import CopyToIndex import luigi class IndexDocuments(CopyToIndex): """ This task loads JSON data contained in a :py:class:`luigi.target.Target` into an ElasticSearch index. This task's input will the target returned by :py:meth:`~.FakeDocuments.output`. This...
class IndexDocuments(CopyToIndex): ''' This task loads JSON data contained in a :py:class:`luigi.target.Target` into an ElasticSearch index. This task's input will the target returned by :py:meth:`~.FakeDocuments.output`. This class uses :py:meth:`luigi.contrib.esindex.CopyToIndex.run`. After runni...
2
2
9
2
2
5
1
3.25
1
1
1
0
1
0
1
100
51
17
8
7
6
26
8
7
6
1
6
0
1
17,613
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.Bar
import luigi class Bar(luigi.Task): task_namespace = 'examples' num = luigi.IntParameter() def run(self): self.output().open('w').close() def output(self): return luigi.LocalTarget('/tmp/bar/%d' % self.num)
class Bar(luigi.Task): def run(self): pass def output(self): pass
3
0
2
0
2
0
1
0
1
1
1
0
2
0
2
80
9
2
7
5
4
0
7
5
4
1
5
0
2
17,614
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.Boom
import luigi class Boom(luigi.Task): task_namespace = 'examples' this_is_a_really_long_I_mean_way_too_long_and_annoying_parameter = luigi.IntParameter() def run(self): print('Running Boom') def requires(self): for i in range(5, 200): yield Bar(i)
class Boom(luigi.Task): def run(self): pass def requires(self): pass
3
0
3
0
3
0
2
0
1
2
1
0
2
0
2
80
10
2
8
6
5
0
8
6
5
2
5
1
3
17,615
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.DateTask
import luigi class DateTask(luigi.Task): task_namespace = 'examples' date = luigi.DateParameter() num = luigi.IntParameter() def run(self): print('Running DateTask') def requires(self): yield MyExternal() yield Boom(0)
class DateTask(luigi.Task): def run(self): pass def requires(self): pass
3
0
3
0
3
0
1
0
1
2
2
0
2
0
2
80
11
2
9
6
6
0
9
6
6
1
5
0
2
17,616
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.EntryPoint
import datetime import luigi class EntryPoint(luigi.Task): task_namespace = 'examples' def run(self): print('Running EntryPoint') def requires(self): for i in range(10): yield Foo(100, 2 * i) for i in range(10): yield DateTask(datetime.date(1998, 3, 23) + d...
class EntryPoint(luigi.Task): def run(self): pass def requires(self): pass
3
0
4
0
4
0
2
0
1
5
2
0
2
0
2
80
11
2
9
5
6
0
9
5
6
3
5
1
4
17,617
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.Foo
import luigi class Foo(luigi.Task): task_namespace = 'examples' num = luigi.IntParameter() num2 = luigi.IntParameter() def run(self): print('Running Foo') def requires(self): yield MyExternal() yield Boom(0)
class Foo(luigi.Task): def run(self): pass def requires(self): pass
3
0
3
0
3
0
1
0
1
2
2
0
2
0
2
80
11
2
9
6
6
0
9
6
6
1
5
0
2
17,618
spotify/luigi
spotify_luigi/examples/execution_summary_example.py
examples.execution_summary_example.MyExternal
import luigi class MyExternal(luigi.ExternalTask): def complete(self): return False
class MyExternal(luigi.ExternalTask): def complete(self): pass
2
0
2
0
2
0
1
0
1
0
0
0
1
0
1
79
4
1
3
2
1
0
3
2
1
1
6
0
1
17,619
spotify/luigi
spotify_luigi/examples/foo.py
examples.foo.Bar
import luigi import time class Bar(luigi.Task): task_namespace = 'examples' num = luigi.IntParameter() def run(self): time.sleep(1) self.output().open('w').close() def output(self): """ Returns the target output for this task. :return: the target output for th...
class Bar(luigi.Task): def run(self): pass def output(self): ''' Returns the target output for this task. :return: the target output for this task. :rtype: object (:py:class:`~luigi.target.Target`) ''' pass
3
1
6
1
3
3
1
0.56
1
1
1
0
2
0
2
80
17
3
9
5
6
5
9
5
6
1
5
0
2
17,620
spotify/luigi
spotify_luigi/examples/foo.py
examples.foo.Foo
import luigi class Foo(luigi.WrapperTask): task_namespace = 'examples' def run(self): print('Running Foo') def requires(self): for i in range(10): yield Bar(i)
class Foo(luigi.WrapperTask): def run(self): pass def requires(self): pass
3
0
3
0
3
0
2
0
1
2
1
0
2
0
2
81
9
2
7
5
4
0
7
5
4
2
6
1
3
17,621
spotify/luigi
spotify_luigi/examples/foo_complex.py
examples.foo_complex.Bar
import time import luigi import random class Bar(luigi.Task): task_namespace = 'examples' num = luigi.IntParameter() def run(self): time.sleep(1) self.output().open('w').close() def requires(self): global current_nodes if max_total_nodes > current_nodes: va...
class Bar(luigi.Task): def run(self): pass def requires(self): pass def output(self): ''' Returns the target output for this task. :return: the target output for this task. :rtype: object (:py:class:`~luigi.target.Target`) ''' pass
4
1
7
1
4
2
2
0.31
1
3
1
0
3
0
3
81
27
6
16
9
11
5
16
9
11
3
5
2
5
17,622
spotify/luigi
spotify_luigi/examples/foo_complex.py
examples.foo_complex.Foo
import luigi class Foo(luigi.Task): task_namespace = 'examples' def run(self): print('Running Foo') def requires(self): global current_nodes for i in range(30 // max_depth): current_nodes += 1 yield Bar(i)
class Foo(luigi.Task): def run(self): pass def requires(self): pass
3
0
4
0
4
0
2
0
1
2
1
0
2
0
2
80
11
2
9
6
5
0
9
6
5
2
5
1
3
17,623
spotify/luigi
spotify_luigi/examples/ftp_experiment_outputs.py
examples.ftp_experiment_outputs.ExperimentTask
from luigi.contrib.ftp import RemoteTarget import luigi class ExperimentTask(luigi.ExternalTask): """ This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. """ def output(self): """ Returns the tar...
class ExperimentTask(luigi.ExternalTask): ''' This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. ''' def output(self): ''' Returns the target output for this task. In this case, a succes...
3
3
9
1
4
5
1
1.44
1
1
1
0
2
0
2
80
25
3
9
4
6
13
9
3
6
1
6
1
2
17,624
spotify/luigi
spotify_luigi/examples/ftp_experiment_outputs.py
examples.ftp_experiment_outputs.ProcessingTask
import luigi class ProcessingTask(luigi.Task): """ This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. """ def requires(self): """ This task's dependencies: * :py:class:`~.ExperimentTask...
class ProcessingTask(luigi.Task): ''' This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. ''' def requires(self): ''' This task's dependencies: * :py:class:`~.ExperimentTask` :ret...
4
3
12
2
5
5
1
1.12
1
3
2
0
3
0
3
81
45
9
17
10
13
19
17
9
13
2
5
1
4
17,625
spotify/luigi
spotify_luigi/examples/hello_world.py
examples.hello_world.HelloWorldTask
import luigi class HelloWorldTask(luigi.Task): task_namespace = 'examples' def run(self): print('{task} says: Hello world!'.format(task=self.__class__.__name__))
class HelloWorldTask(luigi.Task): def run(self): pass
2
0
2
0
2
0
1
0
1
0
0
0
1
0
1
79
5
1
4
3
2
0
4
3
2
1
5
0
1
17,626
spotify/luigi
spotify_luigi/examples/kubernetes.py
examples.kubernetes.PerlPi
from luigi.contrib.kubernetes import KubernetesJobTask class PerlPi(KubernetesJobTask): name = 'pi' max_retrials = 3 spec_schema = {'containers': [{'name': 'pi', 'image': 'perl', 'command': ['perl', '-Mbignum=bpi', '-wle', 'print bpi(2000)']}]}
class PerlPi(KubernetesJobTask): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
104
11
1
10
4
9
0
4
4
3
0
6
0
0
17,627
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.DynamicErrorTask1
import luigi class DynamicErrorTask1(luigi.Task): """ This dynamic error task raises error to retry the task. retry-count for this task is 3 """ retry = 0 retry_count = 3 def run(self): self.retry += 1 raise Exception('Test Exception. Retry Index %s for %s' % (self.retry, s...
class DynamicErrorTask1(luigi.Task): ''' This dynamic error task raises error to retry the task. retry-count for this task is 3 ''' def run(self): pass def output(self): pass
3
1
3
0
3
0
1
0.38
1
2
1
0
2
0
2
80
15
4
8
5
5
3
8
5
5
1
5
0
2
17,628
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.DynamicErrorTaskSubmitter
import luigi class DynamicErrorTaskSubmitter(luigi.Task): target = None def run(self): target = (yield DynamicErrorTask1()) if target.exists(): with self.output().open('w') as output: output.write('SUCCESS DynamicErrorTaskSubmitter\n') def output(self): ...
class DynamicErrorTaskSubmitter(luigi.Task): def run(self): pass def output(self): pass
3
0
4
1
4
0
2
0
1
2
2
0
2
0
2
80
12
3
9
6
6
0
9
5
6
2
5
2
3
17,629
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.ErrorTask1
import luigi class ErrorTask1(luigi.Task): """ This error class raises error to retry the task. retry-count for this task is 5. It can be seen on """ retry = 0 retry_count = 5 def run(self): self.retry += 1 raise Exception('Test Exception. Retry Index %s for %s' % (self.ret...
class ErrorTask1(luigi.Task): ''' This error class raises error to retry the task. retry-count for this task is 5. It can be seen on ''' def run(self): pass def output(self): pass
3
1
3
0
3
0
1
0.38
1
2
1
0
2
0
2
80
15
4
8
5
5
3
8
5
5
1
5
0
2
17,630
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.ErrorTask2
import luigi class ErrorTask2(luigi.Task): """ This error class raises error to retry the task. retry-count for this task is 2 """ retry = 0 retry_count = 2 def run(self): self.retry += 1 raise Exception('Test Exception. Retry Index %s for %s' % (self.retry, self.task_famil...
class ErrorTask2(luigi.Task): ''' This error class raises error to retry the task. retry-count for this task is 2 ''' def run(self): pass def output(self): pass
3
1
3
0
3
0
1
0.38
1
2
1
0
2
0
2
80
15
4
8
5
5
3
8
5
5
1
5
0
2
17,631
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.PerTaskRetryPolicy
import luigi class PerTaskRetryPolicy(luigi.Task): """ Wrapper class for some error and success tasks. Worker won't be shutdown unless there is pending tasks or failed tasks which will be retried. While keep-alive is active, workers are not shutdown while there is/are some pending task(s). ...
class PerTaskRetryPolicy(luigi.Task): ''' Wrapper class for some error and success tasks. Worker won't be shutdown unless there is pending tasks or failed tasks which will be retried. While keep-alive is active, workers are not shutdown while there is/are some pending task(s). ''' ...
3
1
2
0
2
0
1
0.83
1
5
5
0
2
0
2
80
15
4
6
4
3
5
6
4
3
1
5
0
2
17,632
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.SuccessSubTask1
import luigi class SuccessSubTask1(luigi.Task): """ This success task sleeps for a while and then it is completed successfully. """ def run(self): with self.output().open('w') as output: output.write('SUCCESS Test Task 4.1\n') def output(self): return luigi.LocalTa...
class SuccessSubTask1(luigi.Task): ''' This success task sleeps for a while and then it is completed successfully. ''' def run(self): pass def output(self): pass
3
1
3
0
3
0
1
0.5
1
1
1
0
2
0
2
80
11
2
6
4
3
3
6
3
3
1
5
1
2
17,633
spotify/luigi
spotify_luigi/examples/per_task_retry_policy.py
examples.per_task_retry_policy.SuccessTask1
import luigi class SuccessTask1(luigi.Task): def requires(self): return [SuccessSubTask1()] def run(self): with self.output().open('w') as output: output.write('SUCCESS Test Task 4\n') def output(self): return luigi.LocalTarget(path='/tmp/_docs-%s.ldj' % self.task_id)
class SuccessTask1(luigi.Task): def requires(self): pass def run(self): pass def output(self): pass
4
0
2
0
2
0
1
0
1
2
2
0
3
0
3
81
10
2
8
5
4
0
8
4
4
1
5
1
3
17,634
spotify/luigi
spotify_luigi/examples/pyspark_wc.py
examples.pyspark_wc.InlinePySparkWordCount
from luigi.contrib.s3 import S3Target from luigi.contrib.spark import SparkSubmitTask, PySparkTask class InlinePySparkWordCount(PySparkTask): """ This task runs a :py:class:`luigi.contrib.spark.PySparkTask` task over the target data in :py:meth:`wordcount.input` (a file in S3) and writes the result int...
class InlinePySparkWordCount(PySparkTask): ''' This task runs a :py:class:`luigi.contrib.spark.PySparkTask` task over the target data in :py:meth:`wordcount.input` (a file in S3) and writes the result into its :py:meth:`wordcount.output` target (a file in S3). This class uses :py:meth:`luigi.contri...
4
1
3
0
3
0
1
0.85
1
1
1
0
3
0
3
139
31
7
13
6
9
11
9
6
5
1
8
0
3
17,635
spotify/luigi
spotify_luigi/examples/pyspark_wc.py
examples.pyspark_wc.PySparkWordCount
from luigi.contrib.s3 import S3Target import luigi from luigi.contrib.spark import SparkSubmitTask, PySparkTask class PySparkWordCount(SparkSubmitTask): """ This task is the same as :py:class:`InlinePySparkWordCount` above but uses an external python driver file specified in :py:meth:`app` It runs a :...
class PySparkWordCount(SparkSubmitTask): ''' This task is the same as :py:class:`InlinePySparkWordCount` above but uses an external python driver file specified in :py:meth:`app` It runs a :py:class:`luigi.contrib.spark.SparkSubmitTask` task over the target data in :py:meth:`wordcount.input` (a fil...
4
1
2
0
2
0
1
1.17
1
1
1
0
3
0
3
128
35
9
12
9
8
14
12
9
8
1
7
0
3
17,636
spotify/luigi
spotify_luigi/examples/spark_als.py
examples.spark_als.SparkALS
import luigi.contrib.hdfs from luigi.contrib.spark import SparkSubmitTask import luigi.format import luigi class SparkALS(SparkSubmitTask): """ This task runs a :py:class:`luigi.contrib.spark.SparkSubmitTask` task over the target data returned by :py:meth:`~/.UserItemMatrix.output` and writes the resul...
class SparkALS(SparkSubmitTask): ''' This task runs a :py:class:`luigi.contrib.spark.SparkSubmitTask` task over the target data returned by :py:meth:`~/.UserItemMatrix.output` and writes the result into its :py:meth:`~.SparkALS.output` target (a file in HDFS). This class uses :py:meth:`luigi.contri...
4
3
7
1
2
4
1
1.77
1
1
1
0
3
0
3
128
48
12
13
10
9
23
13
10
9
1
7
0
3
17,637
spotify/luigi
spotify_luigi/examples/spark_als.py
examples.spark_als.UserItemMatrix
import luigi.format import luigi import random import luigi.contrib.hdfs class UserItemMatrix(luigi.Task): data_size = luigi.IntParameter() def run(self): """ Generates :py:attr:`~.UserItemMatrix.data_size` elements. Writes this data in \\ separated value format into the target :py:fun...
class UserItemMatrix(luigi.Task): def run(self): ''' Generates :py:attr:`~.UserItemMatrix.data_size` elements. Writes this data in \ separated value format into the target :py:func:`~/.UserItemMatrix.output`. The data has the following elements: * `user` is the default Elas...
3
2
13
2
4
7
2
1.5
1
2
0
0
2
0
2
80
32
7
10
7
7
15
10
7
7
2
5
1
3
17,638
spotify/luigi
spotify_luigi/examples/ssh_remote_execution.py
examples.ssh_remote_execution.CreateRemoteData
from luigi.contrib.ssh import RemoteContext, RemoteTarget import luigi class CreateRemoteData(luigi.Task): """ Dump info on running processes on remote host. Data is still stored on the remote host """ def output(self): """ Returns the target output for this task. In this c...
class CreateRemoteData(luigi.Task): ''' Dump info on running processes on remote host. Data is still stored on the remote host ''' def output(self): ''' Returns the target output for this task. In this case, a successful execution of this task will create a file on a remote...
3
2
9
1
5
3
1
0.91
1
2
2
0
2
0
2
80
24
3
11
4
8
10
6
4
3
1
5
0
2
17,639
spotify/luigi
spotify_luigi/examples/ssh_remote_execution.py
examples.ssh_remote_execution.ProcessRemoteData
from luigi.mock import MockTarget from collections import defaultdict import luigi class ProcessRemoteData(luigi.Task): """ Create a toplist of users based on how many running processes they have on a remote machine. In this example the processed data is stored in a MockTarget. """ def requires(s...
class ProcessRemoteData(luigi.Task): ''' Create a toplist of users based on how many running processes they have on a remote machine. In this example the processed data is stored in a MockTarget. ''' def requires(self): ''' This task's dependencies: * :py:class:`~.CreateRem...
4
3
11
2
6
4
2
0.79
1
3
2
0
3
0
3
81
43
9
19
11
15
15
15
9
11
3
5
2
5
17,640
spotify/luigi
spotify_luigi/examples/terasort.py
examples.terasort.TeraGen
import luigi.contrib.hadoop_jar import luigi import luigi.contrib.hdfs class TeraGen(luigi.contrib.hadoop_jar.HadoopJarJobTask): """ Runs TeraGen, by default with 1TB of data (10B records) """ records = luigi.Parameter(default='10000000000', description='Number of records, each record is 100 Bytes') ...
class TeraGen(luigi.contrib.hadoop_jar.HadoopJarJobTask): ''' Runs TeraGen, by default with 1TB of data (10B records) ''' def output(self): ''' Returns the target output for this task. In this case, a successful execution of this task will create a file in HDFS. :re...
5
2
4
0
2
2
1
0.77
1
0
0
0
4
0
4
100
29
6
13
7
8
10
11
7
6
1
7
0
4
17,641
spotify/luigi
spotify_luigi/examples/terasort.py
examples.terasort.TeraSort
import luigi import luigi.contrib.hadoop_jar import luigi.contrib.hdfs class TeraSort(luigi.contrib.hadoop_jar.HadoopJarJobTask): """ Runs TeraGent, by default using """ terasort_in = luigi.Parameter(default=DEFAULT_TERASORT_IN, description='directory to store terasort input into.') terasort_out = ...
class TeraSort(luigi.contrib.hadoop_jar.HadoopJarJobTask): ''' Runs TeraGent, by default using ''' def requires(self): ''' This task's dependencies: * :py:class:`~.TeraGen` :return: object (:py:class:`luigi.task.Task`) ''' pass def output(self):...
6
3
5
1
2
2
1
0.93
1
1
1
0
5
0
5
101
38
9
15
8
9
14
13
8
7
1
7
0
5
17,642
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.AggregateArtists
import luigi.contrib.spark import luigi.contrib.postgres import luigi.contrib.hdfs from collections import defaultdict import luigi class AggregateArtists(luigi.Task): """ This task runs over the target data returned by :py:meth:`~/.Streams.output` and writes the result into its :py:meth:`~.AggregateArtist...
class AggregateArtists(luigi.Task): ''' This task runs over the target data returned by :py:meth:`~/.Streams.output` and writes the result into its :py:meth:`~.AggregateArtists.output` target (local file). ''' def output(self): ''' Returns the target output for this task. I...
4
3
10
2
5
4
2
0.94
1
3
2
0
3
0
3
81
40
9
16
12
12
15
16
10
12
4
5
3
6
17,643
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.AggregateArtistsSpark
import luigi.contrib.spark import luigi import luigi.contrib.postgres import luigi.contrib.hdfs class AggregateArtistsSpark(luigi.contrib.spark.SparkSubmitTask): """ This task runs a :py:class:`luigi.contrib.spark.SparkSubmitTask` task over each target data returned by :py:meth:`~/.StreamsHdfs.output` and ...
class AggregateArtistsSpark(luigi.contrib.spark.SparkSubmitTask): ''' This task runs a :py:class:`luigi.contrib.spark.SparkSubmitTask` task over each target data returned by :py:meth:`~/.StreamsHdfs.output` and writes the result into its :py:meth:`~.AggregateArtistsSpark.output` target (a file in HDFS)...
4
3
8
1
2
4
1
2.36
1
1
1
0
3
0
3
128
47
10
11
7
7
26
10
7
6
1
7
0
3
17,644
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.ArtistToplistToDatabase
import luigi.contrib.spark import luigi.contrib.hdfs import luigi.contrib.postgres import luigi class ArtistToplistToDatabase(luigi.contrib.postgres.CopyToTable): """ This task runs a :py:class:`luigi.contrib.postgres.CopyToTable` task over the target data returned by :py:meth:`~/.Top10Artists.output` and ...
class ArtistToplistToDatabase(luigi.contrib.postgres.CopyToTable): ''' This task runs a :py:class:`luigi.contrib.postgres.CopyToTable` task over the target data returned by :py:meth:`~/.Top10Artists.output` and writes the result into its :py:meth:`~.ArtistToplistToDatabase.output` target which, by ...
2
2
9
2
2
5
1
1
1
1
1
0
1
0
1
104
34
7
14
10
12
14
11
10
9
1
7
0
1
17,645
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.ExternalStreams
import luigi.contrib.hdfs import luigi.contrib.postgres import luigi import luigi.contrib.spark class ExternalStreams(luigi.ExternalTask): """ Example of a possible external data dump To depend on external targets (typically at the top of your dependency graph), you can define an ExternalTask like thi...
class ExternalStreams(luigi.ExternalTask): ''' Example of a possible external data dump To depend on external targets (typically at the top of your dependency graph), you can define an ExternalTask like this. ''' def output(self): ''' Returns the target output for this task. ...
2
2
9
1
2
6
1
2.75
1
0
0
0
1
0
1
79
18
3
4
3
2
11
4
3
2
1
6
0
1
17,646
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.Streams
import luigi import luigi.contrib.hdfs import random import luigi.contrib.postgres import luigi.contrib.spark class Streams(luigi.Task): """ Faked version right now, just generates bogus data. """ date = luigi.DateParameter() def run(self): """ Generates bogus data and writes it in...
class Streams(luigi.Task): ''' Faked version right now, just generates bogus data. ''' def run(self): ''' Generates bogus data and writes it into the :py:meth:`~.Streams.output` target. ''' pass def output(self): ''' Returns the target output for th...
3
3
10
1
5
5
2
1.09
1
2
1
1
2
0
2
80
26
3
11
6
8
12
8
5
5
2
5
2
3
17,647
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.StreamsHdfs
import luigi.contrib.postgres import luigi.contrib.spark import luigi import luigi.contrib.hdfs class StreamsHdfs(Streams): """ This task performs the same work as :py:class:`~.Streams` but its output is written to HDFS. This class uses :py:meth:`~.Streams.run` and overrides :py:meth:`~.Streams.output...
class StreamsHdfs(Streams): ''' This task performs the same work as :py:class:`~.Streams` but its output is written to HDFS. This class uses :py:meth:`~.Streams.run` and overrides :py:meth:`~.Streams.output` so redefine HDFS as its target. ''' def output(self): ''' Returns ...
2
2
9
1
2
6
1
3.67
1
0
0
0
1
0
1
81
17
3
3
2
1
11
3
2
1
1
6
0
1
17,648
spotify/luigi
spotify_luigi/examples/top_artists.py
examples.top_artists.Top10Artists
import luigi.contrib.spark import luigi.contrib.hdfs import luigi import luigi.contrib.postgres from heapq import nlargest class Top10Artists(luigi.Task): """ This task runs over the target data returned by :py:meth:`~/.AggregateArtists.output` or :py:meth:`~/.AggregateArtistsSpark.output` in case :py:attr...
class Top10Artists(luigi.Task): ''' This task runs over the target data returned by :py:meth:`~/.AggregateArtists.output` or :py:meth:`~/.AggregateArtistsSpark.output` in case :py:attr:`~/.Top10Artists.use_spark` is set and writes the result into its :py:meth:`~.Top10Artists.output` target (a file in l...
5
3
10
1
6
3
2
0.65
1
5
3
0
4
0
4
82
51
8
26
14
21
17
20
12
15
2
5
2
7
17,649
spotify/luigi
spotify_luigi/examples/wordcount.py
examples.wordcount.InputText
import luigi class InputText(luigi.ExternalTask): """ This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. """ date = luigi.DateParameter() def output(self): """ Returns the target output for ...
class InputText(luigi.ExternalTask): ''' This class represents something that was created elsewhere by an external process, so all we want to do is to implement the output method. ''' def output(self): ''' Returns the target output for this task. In this case, it expects a ...
2
2
9
1
2
6
1
2.5
1
1
1
0
1
0
1
79
16
2
4
3
2
10
4
3
2
1
6
0
1
17,650
spotify/luigi
spotify_luigi/examples/wordcount.py
examples.wordcount.WordCount
import luigi class WordCount(luigi.Task): date_interval = luigi.DateIntervalParameter() def requires(self): """ This task's dependencies: * :py:class:`~.InputText` :return: list of object (:py:class:`luigi.task.Task`) """ return [InputText(date) for date in se...
class WordCount(luigi.Task): def requires(self): ''' This task's dependencies: * :py:class:`~.InputText` :return: list of object (:py:class:`luigi.task.Task`) ''' pass def output(self): ''' Returns the target output for this task. In thi...
4
3
12
2
5
7
2
1.25
1
2
2
0
3
0
3
81
41
8
16
9
12
20
16
9
12
5
5
3
7
17,651
spotify/luigi
spotify_luigi/examples/wordcount_hadoop.py
examples.wordcount_hadoop.InputText
import luigi.contrib.hdfs import luigi.contrib.hadoop import luigi class InputText(luigi.ExternalTask): """ This task is a :py:class:`luigi.task.ExternalTask` which means it doesn't generate the :py:meth:`~.InputText.output` target on its own instead relying on the execution something outside of Luigi ...
class InputText(luigi.ExternalTask): ''' This task is a :py:class:`luigi.task.ExternalTask` which means it doesn't generate the :py:meth:`~.InputText.output` target on its own instead relying on the execution something outside of Luigi to produce it. ''' def output(self): ''' R...
2
2
9
1
2
6
1
2.75
1
0
0
0
1
0
1
79
18
3
4
3
2
11
4
3
2
1
6
0
1
17,652
spotify/luigi
spotify_luigi/examples/wordcount_hadoop.py
examples.wordcount_hadoop.WordCount
import luigi.contrib.hadoop import luigi.contrib.hdfs import luigi class WordCount(luigi.contrib.hadoop.JobTask): """ This task runs a :py:class:`luigi.contrib.hadoop.JobTask` over the target data returned by :py:meth:`~/.InputText.output` and writes the result into its :py:meth:`~.WordCount.output` ta...
class WordCount(luigi.contrib.hadoop.JobTask): ''' This task runs a :py:class:`luigi.contrib.hadoop.JobTask` over the target data returned by :py:meth:`~/.InputText.output` and writes the result into its :py:meth:`~.WordCount.output` target. This class uses :py:meth:`luigi.contrib.hadoop.JobTask.ru...
5
3
6
1
2
3
1
1.55
1
1
1
0
4
0
4
120
37
9
11
7
6
17
11
7
6
2
7
1
5
17,653
spotify/luigi
spotify_luigi/luigi/batch_notifier.py
luigi.batch_notifier.BatchNotifier
import collections from luigi.notifications import send_email, email import time class BatchNotifier: def __init__(self, **kwargs): self._config = batch_email(**kwargs) self._fail_counts = collections.defaultdict(collections.Counter) self._disabled_counts = collections.defaultdict(collecti...
class BatchNotifier: def __init__(self, **kwargs): pass def _update_next_send(self): pass def _key(self, task_name, family, unbatched_args): pass def _format_expl(self, expl): pass def _expl_body(self, expls): pass def _format_task(self, task_tuple)...
19
0
8
0
7
0
2
0
0
8
2
1
18
8
18
18
154
19
135
59
116
0
108
59
89
4
0
2
36
17,654
spotify/luigi
spotify_luigi/luigi/batch_notifier.py
luigi.batch_notifier.ExplQueue
from datetime import datetime import collections class ExplQueue(collections.OrderedDict): def __init__(self, num_items): self.num_items = num_items super(ExplQueue, self).__init__() def enqueue(self, item): self.pop(item, None) self[item] = datetime.now() if len(self)...
class ExplQueue(collections.OrderedDict): def __init__(self, num_items): pass def enqueue(self, item): pass
3
0
4
0
4
1
2
0.11
1
2
0
0
2
1
2
52
10
1
9
4
6
1
9
4
6
2
3
1
3
17,655
spotify/luigi
spotify_luigi/luigi/batch_notifier.py
luigi.batch_notifier.batch_email
import luigi import luigi.parameter class batch_email(luigi.Config): email_interval = luigi.parameter.IntParameter(default=60, config_path=dict(section='batch-notifier', name='email-interval-minutes'), description='Number of minutes between e-mail sends (default: 60)') batch_mode = luigi.parameter.ChoiceParame...
class batch_email(luigi.Config): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
78
17
0
17
6
16
0
6
6
5
0
6
0
0
17,656
spotify/luigi
spotify_luigi/luigi/cmdline_parser.py
luigi.cmdline_parser.CmdlineParser
import sys from luigi.task_register import Register from contextlib import contextmanager import argparse class CmdlineParser: """ Helper for parsing command line arguments and used as part of the context when instantiating task objects. Normal luigi users should just use :py:func:`luigi.run`. """...
class CmdlineParser: ''' Helper for parsing command line arguments and used as part of the context when instantiating task objects. Normal luigi users should just use :py:func:`luigi.run`. ''' @classmethod def get_instance(cls): ''' Singleton getter ''' pass @classmethod...
16
9
11
0
8
3
2
0.44
0
3
1
0
4
1
9
9
124
14
77
33
61
34
58
28
48
5
0
2
18
17,657
spotify/luigi
spotify_luigi/luigi/configuration/base_parser.py
luigi.configuration.base_parser.BaseParser
import logging class BaseParser: @classmethod def instance(cls, *args, **kwargs): """ Singleton getter """ if cls._instance is None: cls._instance = cls(*args, **kwargs) loaded = cls._instance.reload() logging.getLogger('luigi-interface').info('Loaded %r', l...
class BaseParser: @classmethod def instance(cls, *args, **kwargs): ''' Singleton getter ''' pass @classmethod def add_config_path(cls, path): pass @classmethod def reload(cls): pass
7
1
4
0
4
0
1
0.07
0
0
0
2
0
0
3
3
19
3
15
8
8
1
12
5
8
2
0
1
4
17,658
spotify/luigi
spotify_luigi/luigi/configuration/cfg_parser.py
luigi.configuration.cfg_parser.CombinedInterpolation
from configparser import Interpolation, BasicInterpolation class CombinedInterpolation(Interpolation): """ Custom interpolation which applies multiple interpolations in series. :param interpolations: a sequence of configparser.Interpolation objects. """ def __init__(self, interpolations): ...
class CombinedInterpolation(Interpolation): ''' Custom interpolation which applies multiple interpolations in series. :param interpolations: a sequence of configparser.Interpolation objects. ''' def __init__(self, interpolations): pass def before_get(self, parser, section, option, val...
6
1
4
0
4
0
2
0.21
1
0
0
0
5
1
5
9
29
6
19
11
13
4
19
11
13
2
1
1
9
17,659
spotify/luigi
spotify_luigi/luigi/configuration/cfg_parser.py
luigi.configuration.cfg_parser.EnvironmentInterpolation
import re import os from configparser import Interpolation, BasicInterpolation class EnvironmentInterpolation(Interpolation): """ Custom interpolation which allows values to refer to environment variables using the ``${ENVVAR}`` syntax. """ _ENVRE = re.compile('\\$\\{([^}]+)\\}') def before_ge...
class EnvironmentInterpolation(Interpolation): ''' Custom interpolation which allows values to refer to environment variables using the ``${ENVVAR}`` syntax. ''' def before_get(self, parser, section, option, value, defaults): pass def _interpolate_env(self, option, section, value): ...
3
1
11
0
11
0
3
0.22
1
2
1
0
2
0
2
6
29
2
23
10
20
5
22
10
19
4
1
2
5
17,660
spotify/luigi
spotify_luigi/luigi/configuration/cfg_parser.py
luigi.configuration.cfg_parser.InterpolationMissingEnvvarError
from configparser import ConfigParser, NoOptionError, NoSectionError, InterpolationError class InterpolationMissingEnvvarError(InterpolationError): """ Raised when option value refers to a nonexisting environment variable. """ def __init__(self, option, section, value, envvar): msg = 'Config r...
class InterpolationMissingEnvvarError(InterpolationError): ''' Raised when option value refers to a nonexisting environment variable. ''' def __init__(self, option, section, value, envvar): pass
2
1
6
0
6
0
1
0.43
1
0
0
0
1
0
1
14
11
1
7
3
5
3
4
3
2
1
5
0
1
17,661
spotify/luigi
spotify_luigi/luigi/configuration/cfg_parser.py
luigi.configuration.cfg_parser.LuigiConfigParser
from configparser import ConfigParser, NoOptionError, NoSectionError, InterpolationError from .base_parser import BaseParser from configparser import Interpolation, BasicInterpolation import warnings import os class LuigiConfigParser(BaseParser, ConfigParser): NO_DEFAULT = object() enabled = True optionxfo...
class LuigiConfigParser(BaseParser, ConfigParser): @classmethod def reload(cls): pass def _get_with_default(self, method, section, option, default, expected_type=None, **kwargs): ''' Gets the value of the section/option using method. Returns default if value is not found. ...
11
2
9
1
6
2
2
0.28
2
7
0
0
8
0
9
96
100
16
68
24
57
19
56
22
46
5
9
2
18
17,662
spotify/luigi
spotify_luigi/luigi/configuration/toml_parser.py
luigi.configuration.toml_parser.LuigiTomlParser
from typing import Any, Dict from .base_parser import BaseParser from ..freezing import recursively_freeze from configparser import ConfigParser import os.path class LuigiTomlParser(BaseParser, ConfigParser): NO_DEFAULT = object() enabled = bool(toml_enabled) data: Dict[str, Any] = dict() _instance = N...
class LuigiTomlParser(BaseParser, ConfigParser): @staticmethod def _update_data(data, new_data): pass def read(self, config_paths): pass def get(self, section, option, default=NO_DEFAULT, **kwargs): pass def getboolean(self, section, option, default=NO_DEFAULT): ...
12
0
5
0
4
0
2
0.02
2
2
0
0
9
0
10
97
66
12
53
21
41
1
49
20
38
6
9
3
22
17,663
spotify/luigi
spotify_luigi/luigi/contrib/azureblob.py
luigi.contrib.azureblob.AtomicAzureBlobFile
import os from luigi.target import FileAlreadyExists, FileSystem, AtomicLocalFile, FileSystemTarget class AtomicAzureBlobFile(AtomicLocalFile): def __init__(self, container, blob, client, **kwargs): super(AtomicAzureBlobFile, self).__init__(os.path.join(container, blob)) self.container = container...
class AtomicAzureBlobFile(AtomicLocalFile): def __init__(self, container, blob, client, **kwargs): pass def move_to_final_destination(self): pass
3
0
4
0
4
0
1
0
1
1
0
0
2
4
2
9
10
1
9
7
6
0
9
7
6
1
1
0
2
17,664
spotify/luigi
spotify_luigi/luigi/contrib/azureblob.py
luigi.contrib.azureblob.AzureBlobClient
import logging from luigi.target import FileAlreadyExists, FileSystem, AtomicLocalFile, FileSystemTarget from azure.storage.blob import BlobServiceClient class AzureBlobClient(FileSystem): """ Create an Azure Blob Storage client for authentication. Users can create multiple storage account, each of which a...
class AzureBlobClient(FileSystem): ''' Create an Azure Blob Storage client for authentication. Users can create multiple storage account, each of which acts like a silo. Under each storage account, we can create a container. Inside each container, the user can create multiple blobs. For each accoun...
20
3
9
0
7
1
2
0.27
1
2
1
0
16
2
17
46
184
22
128
49
108
34
94
45
76
4
4
2
31
17,665
spotify/luigi
spotify_luigi/luigi/contrib/azureblob.py
luigi.contrib.azureblob.AzureBlobTarget
from luigi.format import get_default_format import os from luigi.target import FileAlreadyExists, FileSystem, AtomicLocalFile, FileSystemTarget class AzureBlobTarget(FileSystemTarget): """ Create an Azure Blob Target for storing data on Azure Blob Storage """ def __init__(self, container, blob, client...
class AzureBlobTarget(FileSystemTarget): ''' Create an Azure Blob Target for storing data on Azure Blob Storage ''' def __init__(self, container, blob, client=None, format=None, download_when_reading=True, **kwargs): ''' :param str account_name: The storage account name. Th...
5
4
17
1
6
10
2
1.52
1
5
3
0
3
6
3
33
58
5
21
11
16
32
19
10
15
3
5
1
6
17,666
spotify/luigi
spotify_luigi/luigi/contrib/azureblob.py
luigi.contrib.azureblob.ReadableAzureBlobFile
import datetime import tempfile import os class ReadableAzureBlobFile: def __init__(self, container, blob, client, download_when_reading, **kwargs): self.container = container self.blob = blob self.client = client self.closed = False self.download_when_reading = download_wh...
class ReadableAzureBlobFile: def __init__(self, container, blob, client, download_when_reading, **kwargs): pass def read(self, n=None): pass def __enter__(self): pass def __exit__(self, exc_type, exc, traceback): pass def __del__(self): pass def clo...
11
0
4
0
4
0
1
0
0
2
0
0
10
8
10
10
47
9
38
19
27
0
37
19
26
3
0
2
14
17,667
spotify/luigi
spotify_luigi/luigi/contrib/batch.py
luigi.contrib.batch.BatchClient
import time import json class BatchClient: def __init__(self, poll_time=POLL_TIME): self.poll_time = poll_time self._client = boto3.client('batch') self._log_client = boto3.client('logs') self._queue = self.get_active_queue() def get_active_queue(self): """Get name of ...
class BatchClient: def __init__(self, poll_time=POLL_TIME): pass def get_active_queue(self): '''Get name of first active job queue''' pass def get_job_id_from_name(self, job_name): '''Retrieve the first job ID matching the given name''' pass def get_job_statu...
9
7
11
1
8
2
2
0.21
0
3
1
0
8
4
8
8
98
17
67
32
58
14
55
31
46
4
0
2
16
17,668
spotify/luigi
spotify_luigi/luigi/contrib/batch.py
luigi.contrib.batch.BatchJobException
class BatchJobException(Exception): pass
class BatchJobException(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,669
spotify/luigi
spotify_luigi/luigi/contrib/batch.py
luigi.contrib.batch.BatchTask
import luigi class BatchTask(luigi.Task): """ Base class for an Amazon Batch job Amazon Batch requires you to register "job definitions", which are JSON descriptions for how to issue the ``docker run`` command. This Luigi Task requires a pre-registered Batch jobDefinition name passed as a Paramete...
class BatchTask(luigi.Task): ''' Base class for an Amazon Batch job Amazon Batch requires you to register "job definitions", which are JSON descriptions for how to issue the ``docker run`` command. This Luigi Task requires a pre-registered Batch jobDefinition name passed as a Parameter :param j...
4
2
6
0
5
1
1
0.63
1
1
1
0
2
0
2
80
32
6
16
10
12
10
11
9
8
1
5
0
2
17,670
spotify/luigi
spotify_luigi/luigi/contrib/beam_dataflow.py
luigi.contrib.beam_dataflow.BeamDataflowJobTask
import json import os import subprocess import luigi from luigi.task import MixinNaiveBulkComplete import abc from luigi.contrib import bigquery, gcs class BeamDataflowJobTask(MixinNaiveBulkComplete, luigi.Task, metaclass=abc.ABCMeta): """ Luigi wrapper for a Dataflow job. Must be overridden for each Beam SDK ...
class BeamDataflowJobTask(MixinNaiveBulkComplete, luigi.Task, metaclass=abc.ABCMeta): ''' Luigi wrapper for a Dataflow job. Must be overridden for each Beam SDK with that SDK's dataflow_executable(). For more documentation, see: https://cloud.google.com/dataflow/docs/guides/specifying-exec-para...
20
12
15
2
9
4
3
0.62
3
12
5
4
15
0
16
95
340
59
173
59
153
108
151
56
133
18
5
2
54
17,671
spotify/luigi
spotify_luigi/luigi/contrib/beam_dataflow.py
luigi.contrib.beam_dataflow.DataflowParamKeys
import abc class DataflowParamKeys(metaclass=abc.ABCMeta): """ Defines the naming conventions for Dataflow execution params. For example, the Java API expects param names in lower camel case, whereas the Python implementation expects snake case. """ @property @abc.abstractmethod def r...
class DataflowParamKeys(metaclass=abc.ABCMeta): ''' Defines the naming conventions for Dataflow execution params. For example, the Java API expects param names in lower camel case, whereas the Python implementation expects snake case. ''' @property @abc.abstractmethod def runner(self): ...
55
1
2
0
2
0
1
0.07
1
0
0
1
18
0
18
38
96
18
73
37
18
5
37
19
18
1
3
0
18
17,672
spotify/luigi
spotify_luigi/luigi/contrib/beam_dataflow.py
luigi.contrib.beam_dataflow._CmdLineRunner
import subprocess class _CmdLineRunner: """ Executes a given command line class in a subprocess, logging its output. If more complex monitoring/logging is desired, user can implement their own launcher class and set it in BeamDataflowJobTask.cmd_line_runner. """ @staticmethod def run(cmd,...
class _CmdLineRunner: ''' Executes a given command line class in a subprocess, logging its output. If more complex monitoring/logging is desired, user can implement their own launcher class and set it in BeamDataflowJobTask.cmd_line_runner. ''' @staticmethod def run(cmd, task=None): ...
3
1
20
0
20
0
4
0.23
0
2
0
0
0
0
1
1
28
1
22
8
19
5
16
7
14
4
0
2
4
17,673
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BQTable
import collections class BQTable(collections.namedtuple('BQTable', 'project_id dataset_id table_id location')): @property def dataset(self): return BQDataset(project_id=self.project_id, dataset_id=self.dataset_id, location=self.location) @property def uri(self): return 'bq://' + self....
class BQTable(collections.namedtuple('BQTable', 'project_id dataset_id table_id location')): @property def dataset(self): pass @property def uri(self): pass
5
0
3
0
3
0
1
0
1
0
0
0
2
2
2
7
9
1
8
6
3
0
5
3
2
1
1
0
2
17,674
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryClient
from luigi.contrib import gcp import time import luigi.target class BigQueryClient: """A client for Google BigQuery. For details of how authentication and the descriptor work, see the documentation for the GCS client. The descriptor URL for BigQuery is https://www.googleapis.com/discovery/v1/apis/bigq...
class BigQueryClient: '''A client for Google BigQuery. For details of how authentication and the descriptor work, see the documentation for the GCS client. The descriptor URL for BigQuery is https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest ''' def __init__(self, oauth_credentials=...
16
12
21
3
12
5
3
0.45
0
5
4
0
13
4
13
13
292
57
162
44
142
73
105
34
91
6
0
3
43
17,675
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryCreateViewTask
import luigi.target class BigQueryCreateViewTask(luigi.Task): """ Creates (or updates) a view in BigQuery. The output of this task needs to be a BigQueryTarget. Instances of this class should specify the view SQL in the view property. If a view already exist in BigQuery at output(), it will be up...
class BigQueryCreateViewTask(luigi.Task): ''' Creates (or updates) a view in BigQuery. The output of this task needs to be a BigQueryTarget. Instances of this class should specify the view SQL in the view property. If a view already exist in BigQuery at output(), it will be updated. ''' @pr...
5
2
8
2
6
0
1
0.35
1
2
1
0
3
0
3
81
37
10
20
9
15
7
19
8
15
2
5
1
4
17,676
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryExecutionError
class BigQueryExecutionError(Exception): def __init__(self, job_id, error_message) -> None: """ :param job_id: BigQuery Job ID :type job_id: str :param error_message: status['status']['errorResult'] for the failed job :type error_message: str """ super().__in...
class BigQueryExecutionError(Exception): def __init__(self, job_id, error_message) -> None: ''' :param job_id: BigQuery Job ID :type job_id: str :param error_message: status['status']['errorResult'] for the failed job :type error_message: str ''' pass
2
1
10
0
4
6
1
1.2
1
1
0
0
1
2
1
11
11
0
5
4
3
6
5
4
3
1
3
0
1
17,677
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryExtractTask
import luigi.target class BigQueryExtractTask(luigi.Task): """ Extracts (unloads) a table from BigQuery to GCS. This tasks requires the input to be exactly one BigQueryTarget while the output should be one or more GCSTargets from luigi.contrib.gcs depending on the use of destinationUris property. ...
class BigQueryExtractTask(luigi.Task): ''' Extracts (unloads) a table from BigQuery to GCS. This tasks requires the input to be exactly one BigQueryTarget while the output should be one or more GCSTargets from luigi.contrib.gcs depending on the use of destinationUris property. ''' @property...
13
7
11
1
7
3
1
0.57
1
5
5
2
7
0
7
85
99
16
53
16
40
30
28
11
20
2
5
1
8
17,678
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryLoadTask
import luigi.target class BigQueryLoadTask(MixinBigQueryBulkComplete, luigi.Task): """Load data into BigQuery from GCS.""" @property def source_format(self): """The source format to use (see :py:class:`SourceFormat`).""" return SourceFormat.NEWLINE_DELIMITED_JSON @property def enc...
class BigQueryLoadTask(MixinBigQueryBulkComplete, luigi.Task): '''Load data into BigQuery from GCS.''' @property def source_format(self): '''The source format to use (see :py:class:`SourceFormat`).''' pass @property def encoding(self): '''The encoding of the data that is goi...
24
13
8
2
4
2
1
0.41
2
5
5
3
13
0
13
92
129
32
69
28
45
28
42
18
28
3
5
1
15
17,679
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryRunQueryTask
import luigi.target class BigQueryRunQueryTask(MixinBigQueryBulkComplete, luigi.Task): @property def write_disposition(self): """What to do if the table already exists. By default this will fail the job. See :py:class:`WriteDisposition`""" return WriteDisposition.WRITE_TRUNCATE ...
class BigQueryRunQueryTask(MixinBigQueryBulkComplete, luigi.Task): @property def write_disposition(self): '''What to do if the table already exists. By default this will fail the job. See :py:class:`WriteDisposition`''' pass @property def create_disposition(self): '''Wh...
17
8
8
1
5
2
1
0.3
2
5
4
2
9
0
9
88
88
18
54
21
37
16
29
14
19
1
5
0
9
17,680
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.BigQueryTarget
import luigi.target class BigQueryTarget(luigi.target.Target): def __init__(self, project_id, dataset_id, table_id, client=None, location=None): self.table = BQTable(project_id=project_id, dataset_id=dataset_id, table_id=table_id, location=location) self.client = client or BigQueryClient() @c...
class BigQueryTarget(luigi.target.Target): def __init__(self, project_id, dataset_id, table_id, client=None, location=None): pass @classmethod def from_bqtable(cls, table, client=None): '''A constructor that takes a :py:class:`BQTable`. :param table: :type table: BQTa...
6
1
4
0
2
1
1
0.36
1
3
2
0
3
2
4
25
19
4
11
8
5
4
10
7
5
1
4
0
4
17,681
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.Compression
class Compression: GZIP = 'GZIP' NONE = 'NONE'
class Compression: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
3
2
0
3
3
2
0
0
0
0
17,682
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.CreateDisposition
class CreateDisposition: CREATE_IF_NEEDED = 'CREATE_IF_NEEDED' CREATE_NEVER = 'CREATE_NEVER'
class CreateDisposition: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
3
2
0
3
3
2
0
0
0
0
17,683
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.DestinationFormat
class DestinationFormat: AVRO = 'AVRO' CSV = 'CSV' NEWLINE_DELIMITED_JSON = 'NEWLINE_DELIMITED_JSON'
class DestinationFormat: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
4
4
3
0
4
4
3
0
0
0
0
17,684
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.Encoding
class Encoding: """ [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. """ UTF_8 = 'UTF-8' ISO_8...
class Encoding: ''' [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. ''' pass
1
1
0
0
0
0
0
1.33
0
0
0
0
0
0
0
0
9
2
3
3
2
4
3
3
2
0
0
0
0
17,685
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.ExternalBigQueryTask
import luigi.target class ExternalBigQueryTask(MixinBigQueryBulkComplete, luigi.ExternalTask): """ An external task for a BigQuery target. """ pass
class ExternalBigQueryTask(MixinBigQueryBulkComplete, luigi.ExternalTask): ''' An external task for a BigQuery target. ''' pass
1
1
0
0
0
0
0
1.5
2
0
0
0
0
0
0
79
5
0
2
1
1
3
2
1
1
0
6
0
0
17,686
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.FieldDelimiter
class FieldDelimiter: """ The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encode...
class FieldDelimiter: ''' The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encode...
1
1
0
0
0
0
0
2.5
0
0
0
0
0
0
0
0
15
2
4
4
3
10
4
4
3
0
0
0
0
17,687
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.MixinBigQueryBulkComplete
class MixinBigQueryBulkComplete: """ Allows to efficiently check if a range of BigQueryTargets are complete. This enables scheduling tasks with luigi range tools. If you implement a custom Luigi task with a BigQueryTarget output, make sure to also inherit from this mixin to enable range support. ...
class MixinBigQueryBulkComplete: ''' Allows to efficiently check if a range of BigQueryTargets are complete. This enables scheduling tasks with luigi range tools. If you implement a custom Luigi task with a BigQueryTarget output, make sure to also inherit from this mixin to enable range support. ...
3
1
20
3
13
4
4
0.67
0
2
0
3
0
0
1
1
30
5
15
9
12
10
14
8
12
4
0
2
4
17,688
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.PrintHeader
class PrintHeader: TRUE = True FALSE = False
class PrintHeader: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
3
2
0
3
3
2
0
0
0
0
17,689
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.QueryMode
class QueryMode: INTERACTIVE = 'INTERACTIVE' BATCH = 'BATCH'
class QueryMode: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
3
2
0
3
3
2
0
0
0
0
17,690
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.SourceFormat
class SourceFormat: AVRO = 'AVRO' CSV = 'CSV' DATASTORE_BACKUP = 'DATASTORE_BACKUP' NEWLINE_DELIMITED_JSON = 'NEWLINE_DELIMITED_JSON' PARQUET = 'PARQUET'
class SourceFormat: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0
6
6
5
0
6
6
5
0
0
0
0
17,691
spotify/luigi
spotify_luigi/luigi/contrib/bigquery.py
luigi.contrib.bigquery.WriteDisposition
class WriteDisposition: WRITE_TRUNCATE = 'WRITE_TRUNCATE' WRITE_APPEND = 'WRITE_APPEND' WRITE_EMPTY = 'WRITE_EMPTY'
class WriteDisposition: pass
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
4
4
3
0
4
4
3
0
0
0
0
17,692
spotify/luigi
spotify_luigi/luigi/contrib/bigquery_avro.py
luigi.contrib.bigquery_avro.BigQueryLoadAvro
from luigi.task import flatten from luigi.contrib.bigquery import BigQueryLoadTask, SourceFormat from luigi.contrib.gcs import GCSClient class BigQueryLoadAvro(BigQueryLoadTask): """A helper for loading specifically Avro data into BigQuery from GCS. Copies table level description from Avro schema doc, Big...
class BigQueryLoadAvro(BigQueryLoadTask): '''A helper for loading specifically Avro data into BigQuery from GCS. Copies table level description from Avro schema doc, BigQuery internally will copy field-level descriptions to the table. Suitable for use via subclassing: override requires() to return Task...
9
3
12
1
8
3
2
0.45
1
5
1
1
5
0
6
98
92
18
51
23
42
23
44
20
36
5
6
2
15
17,693
spotify/luigi
spotify_luigi/luigi/contrib/datadog_metric.py
luigi.contrib.datadog_metric.DatadogMetricsCollector
from luigi.metrics import MetricsCollector class DatadogMetricsCollector(MetricsCollector): def __init__(self, *args, **kwargs): self._config = datadog(**kwargs) initialize(api_key=self._config.api_key, app_key=self._config.app_key, statsd_host=self._config.statsd_host, statsd_port=self._config.st...
class DatadogMetricsCollector(MetricsCollector): def __init__(self, *args, **kwargs): pass def handle_task_started(self, task): pass def handle_task_failed(self, task): pass def handle_task_disabled(self, task, config): pass def handle_task_done(self, task): ...
12
0
9
2
7
0
1
0.01
1
1
0
0
10
1
10
37
103
30
72
40
60
1
63
39
52
2
4
1
13
17,694
spotify/luigi
spotify_luigi/luigi/contrib/datadog_metric.py
luigi.contrib.datadog_metric.datadog
from luigi.task import Config from luigi import parameter class datadog(Config): api_key = parameter.Parameter(default='dummy_api_key', description='API key provided by Datadog') app_key = parameter.Parameter(default='dummy_app_key', description='APP key provided by Datadog') default_tags = parameter.Param...
class datadog(Config): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
78
8
0
8
8
7
0
8
8
7
0
6
0
0
17,695
spotify/luigi
spotify_luigi/luigi/contrib/dataproc.py
luigi.contrib.dataproc.CreateDataprocClusterTask
import time import luigi class CreateDataprocClusterTask(_DataprocBaseTask): """ Task for creating a Dataproc cluster. """ gcloud_zone = luigi.Parameter(default='europe-west1-c') gcloud_network = luigi.Parameter(default='default') master_node_type = luigi.Parameter(default='n1-standard-2') master_d...
class CreateDataprocClusterTask(_DataprocBaseTask): ''' Task for creating a Dataproc cluster. ''' def _get_cluster_status(self): pass def complete(self): pass def run(self): pass
4
1
22
1
21
1
3
0.06
1
1
0
0
3
2
3
81
81
8
72
20
68
4
34
18
30
5
6
2
9
17,696
spotify/luigi
spotify_luigi/luigi/contrib/dataproc.py
luigi.contrib.dataproc.DataprocBaseTask
import os import time class DataprocBaseTask(_DataprocBaseTask): """ Base task for running jobs in Dataproc. It is recommended to use one of the tasks specific to your job type. Extend this class if you need fine grained control over what kind of job gets submitted to your Dataproc cluster. """ _jo...
class DataprocBaseTask(_DataprocBaseTask): ''' Base task for running jobs in Dataproc. It is recommended to use one of the tasks specific to your job type. Extend this class if you need fine grained control over what kind of job gets submitted to your Dataproc cluster. ''' def submit_job(self,...
5
1
14
1
13
0
3
0.07
1
2
0
2
4
2
4
82
69
9
56
13
51
4
36
12
31
5
6
2
10
17,697
spotify/luigi
spotify_luigi/luigi/contrib/dataproc.py
luigi.contrib.dataproc.DataprocPysparkTask
import luigi class DataprocPysparkTask(DataprocBaseTask): """ Runs a pyspark jobs on your Dataproc cluster """ job_file = luigi.Parameter() extra_files = luigi.Parameter(default='') job_args = luigi.Parameter(default='') def run(self): self.submit_pyspark_job(job_file=self.job_file...
class DataprocPysparkTask(DataprocBaseTask): ''' Runs a pyspark jobs on your Dataproc cluster ''' def run(self): pass
2
1
5
0
5
0
3
0.33
1
0
0
0
1
0
1
83
13
1
9
5
7
3
7
5
5
3
7
0
3
17,698
spotify/luigi
spotify_luigi/luigi/contrib/dataproc.py
luigi.contrib.dataproc.DataprocSparkTask
import luigi class DataprocSparkTask(DataprocBaseTask): """ Runs a spark jobs on your Dataproc cluster """ main_class = luigi.Parameter() jars = luigi.Parameter(default='') job_args = luigi.Parameter(default='') def run(self): self.submit_spark_job(main_class=self.main_class, jars=...
class DataprocSparkTask(DataprocBaseTask): ''' Runs a spark jobs on your Dataproc cluster ''' def run(self): pass
2
1
5
0
5
0
3
0.33
1
0
0
0
1
0
1
83
13
1
9
5
7
3
7
5
5
3
7
0
3
17,699
spotify/luigi
spotify_luigi/luigi/contrib/dataproc.py
luigi.contrib.dataproc.DeleteDataprocClusterTask
import time class DeleteDataprocClusterTask(_DataprocBaseTask): """ Task for deleting a Dataproc cluster. One of the uses for this class is to extend it and have it require a Dataproc task that does a calculation and have that task extend the cluster creation task. This allows you to create chains wher...
class DeleteDataprocClusterTask(_DataprocBaseTask): ''' Task for deleting a Dataproc cluster. One of the uses for this class is to extend it and have it require a Dataproc task that does a calculation and have that task extend the cluster creation task. This allows you to create chains where you create...
4
1
8
0
7
0
2
0.35
1
0
0
0
3
3
3
81
34
4
23
8
20
8
19
5
15
3
6
2
7