repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spotify/luigi | luigi/local_target.py | LocalTarget.makedirs | def makedirs(self):
"""
Create all parent folders if they do not exist.
"""
normpath = os.path.normpath(self.path)
parentfolder = os.path.dirname(normpath)
if parentfolder:
try:
os.makedirs(parentfolder)
except OSError:
... | python | def makedirs(self):
"""
Create all parent folders if they do not exist.
"""
normpath = os.path.normpath(self.path)
parentfolder = os.path.dirname(normpath)
if parentfolder:
try:
os.makedirs(parentfolder)
except OSError:
... | [
"def",
"makedirs",
"(",
"self",
")",
":",
"normpath",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"self",
".",
"path",
")",
"parentfolder",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"normpath",
")",
"if",
"parentfolder",
":",
"try",
":",
"os",
... | Create all parent folders if they do not exist. | [
"Create",
"all",
"parent",
"folders",
"if",
"they",
"do",
"not",
"exist",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/local_target.py#L146-L156 | train | Create all parent folders if they do not exist. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/lsf.py | track_job | def track_job(job_id):
"""
Tracking is done by requesting each job and then searching for whether the job
has one of the following states:
- "RUN",
- "PEND",
- "SSUSP",
- "EXIT"
based on the LSF documentation
"""
cmd = "bjobs -noheader -o stat {}".format(job_id)
track_job_pro... | python | def track_job(job_id):
"""
Tracking is done by requesting each job and then searching for whether the job
has one of the following states:
- "RUN",
- "PEND",
- "SSUSP",
- "EXIT"
based on the LSF documentation
"""
cmd = "bjobs -noheader -o stat {}".format(job_id)
track_job_pro... | [
"def",
"track_job",
"(",
"job_id",
")",
":",
"cmd",
"=",
"\"bjobs -noheader -o stat {}\"",
".",
"format",
"(",
"job_id",
")",
"track_job_proc",
"=",
"subprocess",
".",
"Popen",
"(",
"cmd",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"shell",
"=",
"... | Tracking is done by requesting each job and then searching for whether the job
has one of the following states:
- "RUN",
- "PEND",
- "SSUSP",
- "EXIT"
based on the LSF documentation | [
"Tracking",
"is",
"done",
"by",
"requesting",
"each",
"job",
"and",
"then",
"searching",
"for",
"whether",
"the",
"job",
"has",
"one",
"of",
"the",
"following",
"states",
":",
"-",
"RUN",
"-",
"PEND",
"-",
"SSUSP",
"-",
"EXIT",
"based",
"on",
"the",
"L... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/lsf.py#L74-L88 | train | Track the status of a job in the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/lsf.py | LSFJobTask.fetch_task_failures | def fetch_task_failures(self):
"""
Read in the error file from bsub
"""
error_file = os.path.join(self.tmp_dir, "job.err")
if os.path.isfile(error_file):
with open(error_file, "r") as f_err:
errors = f_err.readlines()
else:
errors =... | python | def fetch_task_failures(self):
"""
Read in the error file from bsub
"""
error_file = os.path.join(self.tmp_dir, "job.err")
if os.path.isfile(error_file):
with open(error_file, "r") as f_err:
errors = f_err.readlines()
else:
errors =... | [
"def",
"fetch_task_failures",
"(",
"self",
")",
":",
"error_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"tmp_dir",
",",
"\"job.err\"",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"error_file",
")",
":",
"with",
"open",
"(",
"e... | Read in the error file from bsub | [
"Read",
"in",
"the",
"error",
"file",
"from",
"bsub"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/lsf.py#L119-L129 | train | Read in the error file from bsub
Read in the error file from bsub
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/lsf.py | LSFJobTask.fetch_task_output | def fetch_task_output(self):
"""
Read in the output file
"""
# Read in the output file
if os.path.isfile(os.path.join(self.tmp_dir, "job.out")):
with open(os.path.join(self.tmp_dir, "job.out"), "r") as f_out:
outputs = f_out.readlines()
else:
... | python | def fetch_task_output(self):
"""
Read in the output file
"""
# Read in the output file
if os.path.isfile(os.path.join(self.tmp_dir, "job.out")):
with open(os.path.join(self.tmp_dir, "job.out"), "r") as f_out:
outputs = f_out.readlines()
else:
... | [
"def",
"fetch_task_output",
"(",
"self",
")",
":",
"# Read in the output file",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"tmp_dir",
",",
"\"job.out\"",
")",
")",
":",
"with",
"open",
"(",
"os",
".",... | Read in the output file | [
"Read",
"in",
"the",
"output",
"file"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/lsf.py#L131-L141 | train | Read in the output file and return the list of the task outputs | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/lsf.py | LSFJobTask._run_job | def _run_job(self):
"""
Build a bsub argument that will run lsf_runner.py on the directory we've specified.
"""
args = []
if isinstance(self.output(), list):
log_output = os.path.split(self.output()[0].path)
else:
log_output = os.path.split(self.... | python | def _run_job(self):
"""
Build a bsub argument that will run lsf_runner.py on the directory we've specified.
"""
args = []
if isinstance(self.output(), list):
log_output = os.path.split(self.output()[0].path)
else:
log_output = os.path.split(self.... | [
"def",
"_run_job",
"(",
"self",
")",
":",
"args",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"self",
".",
"output",
"(",
")",
",",
"list",
")",
":",
"log_output",
"=",
"os",
".",
"path",
".",
"split",
"(",
"self",
".",
"output",
"(",
")",
"[",
"0"... | Build a bsub argument that will run lsf_runner.py on the directory we've specified. | [
"Build",
"a",
"bsub",
"argument",
"that",
"will",
"run",
"lsf_runner",
".",
"py",
"on",
"the",
"directory",
"we",
"ve",
"specified",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/lsf.py#L219-L283 | train | Run the job and return the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | examples/spark_als.py | UserItemMatrix.run | 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 Elasticsearch id field,
* `track`... | python | 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 Elasticsearch id field,
* `track`... | [
"def",
"run",
"(",
"self",
")",
":",
"w",
"=",
"self",
".",
"output",
"(",
")",
".",
"open",
"(",
"'w'",
")",
"for",
"user",
"in",
"range",
"(",
"self",
".",
"data_size",
")",
":",
"track",
"=",
"int",
"(",
"random",
".",
"random",
"(",
")",
... | 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 Elasticsearch id field,
* `track`: the text,
* `rating`: the... | [
"Generates",
":",
"py",
":",
"attr",
":",
"~",
".",
"UserItemMatrix",
".",
"data_size",
"elements",
".",
"Writes",
"this",
"data",
"in",
"\\\\",
"separated",
"value",
"format",
"into",
"the",
"target",
":",
"py",
":",
"func",
":",
"~",
"/",
".",
"UserI... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/examples/spark_als.py#L31-L47 | train | Generates the data in the target format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | examples/spark_als.py | UserItemMatrix.output | 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.
:return: the target output for this task.
:rtype: object (:py:class:`~luigi.target.Target`)
"""
return luigi.contrib.hdfs.... | python | 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.
:return: the target output for this task.
:rtype: object (:py:class:`~luigi.target.Target`)
"""
return luigi.contrib.hdfs.... | [
"def",
"output",
"(",
"self",
")",
":",
"return",
"luigi",
".",
"contrib",
".",
"hdfs",
".",
"HdfsTarget",
"(",
"'data-matrix'",
",",
"format",
"=",
"luigi",
".",
"format",
".",
"Gzip",
")"
] | Returns the target output for this task.
In this case, a successful execution of this task will create a file in HDFS.
:return: the target output for this task.
:rtype: object (:py:class:`~luigi.target.Target`) | [
"Returns",
"the",
"target",
"output",
"for",
"this",
"task",
".",
"In",
"this",
"case",
"a",
"successful",
"execution",
"of",
"this",
"task",
"will",
"create",
"a",
"file",
"in",
"HDFS",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/examples/spark_als.py#L49-L57 | train | Returns the target output for this task. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/server.py | from_utc | def from_utc(utcTime, fmt=None):
"""convert UTC time string to time.struct_time: change datetime.datetime to time, return time.struct_time type"""
if fmt is None:
try_formats = ["%Y-%m-%d %H:%M:%S.%f", "%Y-%m-%d %H:%M:%S"]
else:
try_formats = [fmt]
for fmt in try_formats:
try:
... | python | def from_utc(utcTime, fmt=None):
"""convert UTC time string to time.struct_time: change datetime.datetime to time, return time.struct_time type"""
if fmt is None:
try_formats = ["%Y-%m-%d %H:%M:%S.%f", "%Y-%m-%d %H:%M:%S"]
else:
try_formats = [fmt]
for fmt in try_formats:
try:
... | [
"def",
"from_utc",
"(",
"utcTime",
",",
"fmt",
"=",
"None",
")",
":",
"if",
"fmt",
"is",
"None",
":",
"try_formats",
"=",
"[",
"\"%Y-%m-%d %H:%M:%S.%f\"",
",",
"\"%Y-%m-%d %H:%M:%S\"",
"]",
"else",
":",
"try_formats",
"=",
"[",
"fmt",
"]",
"for",
"fmt",
... | convert UTC time string to time.struct_time: change datetime.datetime to time, return time.struct_time type | [
"convert",
"UTC",
"time",
"string",
"to",
"time",
".",
"struct_time",
":",
"change",
"datetime",
".",
"datetime",
"to",
"time",
"return",
"time",
".",
"struct_time",
"type"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/server.py#L228-L244 | train | convert UTC time string to time. struct_time return datetime. struct_time type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/server.py | run | def run(api_port=8082, address=None, unix_socket=None, scheduler=None):
"""
Runs one instance of the API server.
"""
if scheduler is None:
scheduler = Scheduler()
# load scheduler state
scheduler.load()
_init_api(
scheduler=scheduler,
api_port=api_port,
addr... | python | def run(api_port=8082, address=None, unix_socket=None, scheduler=None):
"""
Runs one instance of the API server.
"""
if scheduler is None:
scheduler = Scheduler()
# load scheduler state
scheduler.load()
_init_api(
scheduler=scheduler,
api_port=api_port,
addr... | [
"def",
"run",
"(",
"api_port",
"=",
"8082",
",",
"address",
"=",
"None",
",",
"unix_socket",
"=",
"None",
",",
"scheduler",
"=",
"None",
")",
":",
"if",
"scheduler",
"is",
"None",
":",
"scheduler",
"=",
"Scheduler",
"(",
")",
"# load scheduler state",
"s... | Runs one instance of the API server. | [
"Runs",
"one",
"instance",
"of",
"the",
"API",
"server",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/server.py#L322-L362 | train | Runs one instance of the API server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | get_soql_fields | def get_soql_fields(soql):
"""
Gets queried columns names.
"""
soql_fields = re.search('(?<=select)(?s)(.*)(?=from)', soql, re.IGNORECASE) # get fields
soql_fields = re.sub(' ', '', soql_fields.group()) # remove extra spaces
soql_fields = re.sub('\t', '', soql_fi... | python | def get_soql_fields(soql):
"""
Gets queried columns names.
"""
soql_fields = re.search('(?<=select)(?s)(.*)(?=from)', soql, re.IGNORECASE) # get fields
soql_fields = re.sub(' ', '', soql_fields.group()) # remove extra spaces
soql_fields = re.sub('\t', '', soql_fi... | [
"def",
"get_soql_fields",
"(",
"soql",
")",
":",
"soql_fields",
"=",
"re",
".",
"search",
"(",
"'(?<=select)(?s)(.*)(?=from)'",
",",
"soql",
",",
"re",
".",
"IGNORECASE",
")",
"# get fields",
"soql_fields",
"=",
"re",
".",
"sub",
"(",
"' '",
",",
"''",
","... | Gets queried columns names. | [
"Gets",
"queried",
"columns",
"names",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L43-L52 | train | Gets queried columns names. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | parse_results | def parse_results(fields, data):
"""
Traverses ordered dictionary, calls _traverse_results() to recursively read into the dictionary depth of data
"""
master = []
for record in data['records']: # for each 'record' in response
row = [None] * len(fields) # create null list the length of num... | python | def parse_results(fields, data):
"""
Traverses ordered dictionary, calls _traverse_results() to recursively read into the dictionary depth of data
"""
master = []
for record in data['records']: # for each 'record' in response
row = [None] * len(fields) # create null list the length of num... | [
"def",
"parse_results",
"(",
"fields",
",",
"data",
")",
":",
"master",
"=",
"[",
"]",
"for",
"record",
"in",
"data",
"[",
"'records'",
"]",
":",
"# for each 'record' in response",
"row",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"fields",
")",
"# create n... | Traverses ordered dictionary, calls _traverse_results() to recursively read into the dictionary depth of data | [
"Traverses",
"ordered",
"dictionary",
"calls",
"_traverse_results",
"()",
"to",
"recursively",
"read",
"into",
"the",
"dictionary",
"depth",
"of",
"data"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L59-L77 | train | Parses the results of the get_record_cache_list_of_objects_in_dict call into the dictionary depth of data
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | _traverse_results | def _traverse_results(value, fields, row, path):
"""
Helper method for parse_results().
Traverses through ordered dict and recursively calls itself when encountering a dictionary
"""
for f, v in value.iteritems(): # for each item in obj
field_name = '{path}.{name}'.format(path=path, name=f... | python | def _traverse_results(value, fields, row, path):
"""
Helper method for parse_results().
Traverses through ordered dict and recursively calls itself when encountering a dictionary
"""
for f, v in value.iteritems(): # for each item in obj
field_name = '{path}.{name}'.format(path=path, name=f... | [
"def",
"_traverse_results",
"(",
"value",
",",
"fields",
",",
"row",
",",
"path",
")",
":",
"for",
"f",
",",
"v",
"in",
"value",
".",
"iteritems",
"(",
")",
":",
"# for each item in obj",
"field_name",
"=",
"'{path}.{name}'",
".",
"format",
"(",
"path",
... | Helper method for parse_results().
Traverses through ordered dict and recursively calls itself when encountering a dictionary | [
"Helper",
"method",
"for",
"parse_results",
"()",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L80-L94 | train | Traverse through ordered dict and recursively calls _parse_results. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | QuerySalesforce.merge_batch_results | def merge_batch_results(self, result_ids):
"""
Merges the resulting files of a multi-result batch bulk query.
"""
outfile = open(self.output().path, 'w')
if self.content_type.lower() == 'csv':
for i, result_id in enumerate(result_ids):
with open("%s.%... | python | def merge_batch_results(self, result_ids):
"""
Merges the resulting files of a multi-result batch bulk query.
"""
outfile = open(self.output().path, 'w')
if self.content_type.lower() == 'csv':
for i, result_id in enumerate(result_ids):
with open("%s.%... | [
"def",
"merge_batch_results",
"(",
"self",
",",
"result_ids",
")",
":",
"outfile",
"=",
"open",
"(",
"self",
".",
"output",
"(",
")",
".",
"path",
",",
"'w'",
")",
"if",
"self",
".",
"content_type",
".",
"lower",
"(",
")",
"==",
"'csv'",
":",
"for",
... | Merges the resulting files of a multi-result batch bulk query. | [
"Merges",
"the",
"resulting",
"files",
"of",
"a",
"multi",
"-",
"result",
"batch",
"bulk",
"query",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L212-L229 | train | Merges the results of a multi - result batch bulk query into a single - result batch bulk query. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.start_session | def start_session(self):
"""
Starts a Salesforce session and determines which SF instance to use for future requests.
"""
if self.has_active_session():
raise Exception("Session already in progress.")
response = requests.post(self._get_login_url(),
... | python | def start_session(self):
"""
Starts a Salesforce session and determines which SF instance to use for future requests.
"""
if self.has_active_session():
raise Exception("Session already in progress.")
response = requests.post(self._get_login_url(),
... | [
"def",
"start_session",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_active_session",
"(",
")",
":",
"raise",
"Exception",
"(",
"\"Session already in progress.\"",
")",
"response",
"=",
"requests",
".",
"post",
"(",
"self",
".",
"_get_login_url",
"(",
")",
... | Starts a Salesforce session and determines which SF instance to use for future requests. | [
"Starts",
"a",
"Salesforce",
"session",
"and",
"determines",
"which",
"SF",
"instance",
"to",
"use",
"for",
"future",
"requests",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L255-L281 | train | Starts a Salesforce session and determines which SF instance to use for future requests. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.query | def query(self, query, **kwargs):
"""
Return the result of a Salesforce SOQL query as a dict decoded from the Salesforce response JSON payload.
:param query: the SOQL query to send to Salesforce, e.g. "SELECT id from Lead WHERE email = 'a@b.com'"
"""
params = {'q': query}
... | python | def query(self, query, **kwargs):
"""
Return the result of a Salesforce SOQL query as a dict decoded from the Salesforce response JSON payload.
:param query: the SOQL query to send to Salesforce, e.g. "SELECT id from Lead WHERE email = 'a@b.com'"
"""
params = {'q': query}
... | [
"def",
"query",
"(",
"self",
",",
"query",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"{",
"'q'",
":",
"query",
"}",
"response",
"=",
"requests",
".",
"get",
"(",
"self",
".",
"_get_norm_query_url",
"(",
")",
",",
"headers",
"=",
"self",
"."... | Return the result of a Salesforce SOQL query as a dict decoded from the Salesforce response JSON payload.
:param query: the SOQL query to send to Salesforce, e.g. "SELECT id from Lead WHERE email = 'a@b.com'" | [
"Return",
"the",
"result",
"of",
"a",
"Salesforce",
"SOQL",
"query",
"as",
"a",
"dict",
"decoded",
"from",
"the",
"Salesforce",
"response",
"JSON",
"payload",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L286-L300 | train | Query the Salesforce API for the specified set of local resources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.query_more | def query_more(self, next_records_identifier, identifier_is_url=False, **kwargs):
"""
Retrieves more results from a query that returned more results
than the batch maximum. Returns a dict decoded from the Salesforce
response JSON payload.
:param next_records_identifier: either t... | python | def query_more(self, next_records_identifier, identifier_is_url=False, **kwargs):
"""
Retrieves more results from a query that returned more results
than the batch maximum. Returns a dict decoded from the Salesforce
response JSON payload.
:param next_records_identifier: either t... | [
"def",
"query_more",
"(",
"self",
",",
"next_records_identifier",
",",
"identifier_is_url",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"identifier_is_url",
":",
"# Don't use `self.base_url` here because the full URI is provided",
"url",
"=",
"(",
"u'https://... | Retrieves more results from a query that returned more results
than the batch maximum. Returns a dict decoded from the Salesforce
response JSON payload.
:param next_records_identifier: either the Id of the next Salesforce
object in the result, or a URL to th... | [
"Retrieves",
"more",
"results",
"from",
"a",
"query",
"that",
"returned",
"more",
"results",
"than",
"the",
"batch",
"maximum",
".",
"Returns",
"a",
"dict",
"decoded",
"from",
"the",
"Salesforce",
"response",
"JSON",
"payload",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L302-L328 | train | Query the Salesforce server for more results. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.query_all | def query_all(self, query, **kwargs):
"""
Returns the full set of results for the `query`. This is a
convenience wrapper around `query(...)` and `query_more(...)`.
The returned dict is the decoded JSON payload from the final call to
Salesforce, but with the `totalSize` field repr... | python | def query_all(self, query, **kwargs):
"""
Returns the full set of results for the `query`. This is a
convenience wrapper around `query(...)` and `query_more(...)`.
The returned dict is the decoded JSON payload from the final call to
Salesforce, but with the `totalSize` field repr... | [
"def",
"query_all",
"(",
"self",
",",
"query",
",",
"*",
"*",
"kwargs",
")",
":",
"# Make the initial query to Salesforce",
"response",
"=",
"self",
".",
"query",
"(",
"query",
",",
"*",
"*",
"kwargs",
")",
"# get fields",
"fields",
"=",
"get_soql_fields",
"... | Returns the full set of results for the `query`. This is a
convenience wrapper around `query(...)` and `query_more(...)`.
The returned dict is the decoded JSON payload from the final call to
Salesforce, but with the `totalSize` field representing the full
number of results retrieved and ... | [
"Returns",
"the",
"full",
"set",
"of",
"results",
"for",
"the",
"query",
".",
"This",
"is",
"a",
"convenience",
"wrapper",
"around",
"query",
"(",
"...",
")",
"and",
"query_more",
"(",
"...",
")",
".",
"The",
"returned",
"dict",
"is",
"the",
"decoded",
... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L330-L373 | train | Query the Salesforce server for all entries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.restful | def restful(self, path, params):
"""
Allows you to make a direct REST call if you know the path
Arguments:
:param path: The path of the request. Example: sobjects/User/ABC123/password'
:param params: dict of parameters to pass to the path
"""
url = self._get_norm... | python | def restful(self, path, params):
"""
Allows you to make a direct REST call if you know the path
Arguments:
:param path: The path of the request. Example: sobjects/User/ABC123/password'
:param params: dict of parameters to pass to the path
"""
url = self._get_norm... | [
"def",
"restful",
"(",
"self",
",",
"path",
",",
"params",
")",
":",
"url",
"=",
"self",
".",
"_get_norm_base_url",
"(",
")",
"+",
"path",
"response",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"headers",
"=",
"self",
".",
"_get_rest_headers",
"(",
... | Allows you to make a direct REST call if you know the path
Arguments:
:param path: The path of the request. Example: sobjects/User/ABC123/password'
:param params: dict of parameters to pass to the path | [
"Allows",
"you",
"to",
"make",
"a",
"direct",
"REST",
"call",
"if",
"you",
"know",
"the",
"path",
"Arguments",
":",
":",
"param",
"path",
":",
"The",
"path",
"of",
"the",
"request",
".",
"Example",
":",
"sobjects",
"/",
"User",
"/",
"ABC123",
"/",
"p... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L376-L393 | train | Allows you to make a direct REST call to the path
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.create_operation_job | def create_operation_job(self, operation, obj, external_id_field_name=None, content_type=None):
"""
Creates a new SF job that for doing any operation (insert, upsert, update, delete, query)
:param operation: delete, insert, query, upsert, update, hardDelete. Must be lowercase.
:param ob... | python | def create_operation_job(self, operation, obj, external_id_field_name=None, content_type=None):
"""
Creates a new SF job that for doing any operation (insert, upsert, update, delete, query)
:param operation: delete, insert, query, upsert, update, hardDelete. Must be lowercase.
:param ob... | [
"def",
"create_operation_job",
"(",
"self",
",",
"operation",
",",
"obj",
",",
"external_id_field_name",
"=",
"None",
",",
"content_type",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"has_active_session",
"(",
")",
":",
"self",
".",
"start_session",
"("... | Creates a new SF job that for doing any operation (insert, upsert, update, delete, query)
:param operation: delete, insert, query, upsert, update, hardDelete. Must be lowercase.
:param obj: Parent SF object
:param external_id_field_name: Optional. | [
"Creates",
"a",
"new",
"SF",
"job",
"that",
"for",
"doing",
"any",
"operation",
"(",
"insert",
"upsert",
"update",
"delete",
"query",
")"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L395-L413 | train | Creates a new SF job that for doing any operation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.get_job_details | def get_job_details(self, job_id):
"""
Gets all details for existing job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: job info as xml
"""
response = requests.get(self._get_job_details_url(job_id))
response.raise_for_status()
... | python | def get_job_details(self, job_id):
"""
Gets all details for existing job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: job info as xml
"""
response = requests.get(self._get_job_details_url(job_id))
response.raise_for_status()
... | [
"def",
"get_job_details",
"(",
"self",
",",
"job_id",
")",
":",
"response",
"=",
"requests",
".",
"get",
"(",
"self",
".",
"_get_job_details_url",
"(",
"job_id",
")",
")",
"response",
".",
"raise_for_status",
"(",
")",
"return",
"response"
] | Gets all details for existing job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: job info as xml | [
"Gets",
"all",
"details",
"for",
"existing",
"job"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L415-L426 | train | Gets all details for an existing job | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.abort_job | def abort_job(self, job_id):
"""
Abort an existing job. When a job is aborted, no more records are processed.
Changes to data may already have been committed and aren't rolled back.
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: abort response as xml
... | python | def abort_job(self, job_id):
"""
Abort an existing job. When a job is aborted, no more records are processed.
Changes to data may already have been committed and aren't rolled back.
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: abort response as xml
... | [
"def",
"abort_job",
"(",
"self",
",",
"job_id",
")",
":",
"response",
"=",
"requests",
".",
"post",
"(",
"self",
".",
"_get_abort_job_url",
"(",
"job_id",
")",
",",
"headers",
"=",
"self",
".",
"_get_abort_job_headers",
"(",
")",
",",
"data",
"=",
"self"... | Abort an existing job. When a job is aborted, no more records are processed.
Changes to data may already have been committed and aren't rolled back.
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: abort response as xml | [
"Abort",
"an",
"existing",
"job",
".",
"When",
"a",
"job",
"is",
"aborted",
"no",
"more",
"records",
"are",
"processed",
".",
"Changes",
"to",
"data",
"may",
"already",
"have",
"been",
"committed",
"and",
"aren",
"t",
"rolled",
"back",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L428-L441 | train | Abort an existing job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.close_job | def close_job(self, job_id):
"""
Closes job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: close response as xml
"""
if not job_id or not self.has_active_session():
raise Exception("Can not close job without valid job_id and an acti... | python | def close_job(self, job_id):
"""
Closes job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: close response as xml
"""
if not job_id or not self.has_active_session():
raise Exception("Can not close job without valid job_id and an acti... | [
"def",
"close_job",
"(",
"self",
",",
"job_id",
")",
":",
"if",
"not",
"job_id",
"or",
"not",
"self",
".",
"has_active_session",
"(",
")",
":",
"raise",
"Exception",
"(",
"\"Can not close job without valid job_id and an active session.\"",
")",
"response",
"=",
"r... | Closes job
:param job_id: job_id as returned by 'create_operation_job(...)'
:return: close response as xml | [
"Closes",
"job"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L443-L458 | train | Closes a job with the given id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.create_batch | def create_batch(self, job_id, data, file_type):
"""
Creates a batch with either a string of data or a file containing data.
If a file is provided, this will pull the contents of the file_target into memory when running.
That shouldn't be a problem for any files that meet the Salesforce... | python | def create_batch(self, job_id, data, file_type):
"""
Creates a batch with either a string of data or a file containing data.
If a file is provided, this will pull the contents of the file_target into memory when running.
That shouldn't be a problem for any files that meet the Salesforce... | [
"def",
"create_batch",
"(",
"self",
",",
"job_id",
",",
"data",
",",
"file_type",
")",
":",
"if",
"not",
"job_id",
"or",
"not",
"self",
".",
"has_active_session",
"(",
")",
":",
"raise",
"Exception",
"(",
"\"Can not create a batch without a valid job_id and an act... | Creates a batch with either a string of data or a file containing data.
If a file is provided, this will pull the contents of the file_target into memory when running.
That shouldn't be a problem for any files that meet the Salesforce single batch upload
size limit (10MB) and is done to ensure ... | [
"Creates",
"a",
"batch",
"with",
"either",
"a",
"string",
"of",
"data",
"or",
"a",
"file",
"containing",
"data",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L460-L486 | train | Creates a batch with either a string of data or a file containing data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.block_on_batch | def block_on_batch(self, job_id, batch_id, sleep_time_seconds=5, max_wait_time_seconds=-1):
"""
Blocks until @batch_id is completed or failed.
:param job_id:
:param batch_id:
:param sleep_time_seconds:
:param max_wait_time_seconds:
"""
if not job_id or not... | python | def block_on_batch(self, job_id, batch_id, sleep_time_seconds=5, max_wait_time_seconds=-1):
"""
Blocks until @batch_id is completed or failed.
:param job_id:
:param batch_id:
:param sleep_time_seconds:
:param max_wait_time_seconds:
"""
if not job_id or not... | [
"def",
"block_on_batch",
"(",
"self",
",",
"job_id",
",",
"batch_id",
",",
"sleep_time_seconds",
"=",
"5",
",",
"max_wait_time_seconds",
"=",
"-",
"1",
")",
":",
"if",
"not",
"job_id",
"or",
"not",
"batch_id",
"or",
"not",
"self",
".",
"has_active_session",
... | Blocks until @batch_id is completed or failed.
:param job_id:
:param batch_id:
:param sleep_time_seconds:
:param max_wait_time_seconds: | [
"Blocks",
"until"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L488-L509 | train | Blocks until the batch is complete or failed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.get_batch_results | def get_batch_results(self, job_id, batch_id):
"""
DEPRECATED: Use `get_batch_result_ids`
"""
warnings.warn("get_batch_results is deprecated and only returns one batch result. Please use get_batch_result_ids")
return self.get_batch_result_ids(job_id, batch_id)[0] | python | def get_batch_results(self, job_id, batch_id):
"""
DEPRECATED: Use `get_batch_result_ids`
"""
warnings.warn("get_batch_results is deprecated and only returns one batch result. Please use get_batch_result_ids")
return self.get_batch_result_ids(job_id, batch_id)[0] | [
"def",
"get_batch_results",
"(",
"self",
",",
"job_id",
",",
"batch_id",
")",
":",
"warnings",
".",
"warn",
"(",
"\"get_batch_results is deprecated and only returns one batch result. Please use get_batch_result_ids\"",
")",
"return",
"self",
".",
"get_batch_result_ids",
"(",
... | DEPRECATED: Use `get_batch_result_ids` | [
"DEPRECATED",
":",
"Use",
"get_batch_result_ids"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L511-L516 | train | Get the batch result for a given job and batch id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.get_batch_result_ids | def get_batch_result_ids(self, job_id, batch_id):
"""
Get result IDs of a batch that has completed processing.
:param job_id: job_id as returned by 'create_operation_job(...)'
:param batch_id: batch_id as returned by 'create_batch(...)'
:return: list of batch result IDs to be us... | python | def get_batch_result_ids(self, job_id, batch_id):
"""
Get result IDs of a batch that has completed processing.
:param job_id: job_id as returned by 'create_operation_job(...)'
:param batch_id: batch_id as returned by 'create_batch(...)'
:return: list of batch result IDs to be us... | [
"def",
"get_batch_result_ids",
"(",
"self",
",",
"job_id",
",",
"batch_id",
")",
":",
"response",
"=",
"requests",
".",
"get",
"(",
"self",
".",
"_get_batch_results_url",
"(",
"job_id",
",",
"batch_id",
")",
",",
"headers",
"=",
"self",
".",
"_get_batch_info... | Get result IDs of a batch that has completed processing.
:param job_id: job_id as returned by 'create_operation_job(...)'
:param batch_id: batch_id as returned by 'create_batch(...)'
:return: list of batch result IDs to be used in 'get_batch_result(...)' | [
"Get",
"result",
"IDs",
"of",
"a",
"batch",
"that",
"has",
"completed",
"processing",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L518-L533 | train | Get result IDs of a batch that has completed processing. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/salesforce.py | SalesforceAPI.get_batch_result | def get_batch_result(self, job_id, batch_id, result_id):
"""
Gets result back from Salesforce as whatever type was originally sent in create_batch (xml, or csv).
:param job_id:
:param batch_id:
:param result_id:
"""
response = requests.get(self._get_batch_result_... | python | def get_batch_result(self, job_id, batch_id, result_id):
"""
Gets result back from Salesforce as whatever type was originally sent in create_batch (xml, or csv).
:param job_id:
:param batch_id:
:param result_id:
"""
response = requests.get(self._get_batch_result_... | [
"def",
"get_batch_result",
"(",
"self",
",",
"job_id",
",",
"batch_id",
",",
"result_id",
")",
":",
"response",
"=",
"requests",
".",
"get",
"(",
"self",
".",
"_get_batch_result_url",
"(",
"job_id",
",",
"batch_id",
",",
"result_id",
")",
",",
"headers",
"... | Gets result back from Salesforce as whatever type was originally sent in create_batch (xml, or csv).
:param job_id:
:param batch_id:
:param result_id: | [
"Gets",
"result",
"back",
"from",
"Salesforce",
"as",
"whatever",
"type",
"was",
"originally",
"sent",
"in",
"create_batch",
"(",
"xml",
"or",
"csv",
")",
".",
":",
"param",
"job_id",
":",
":",
"param",
"batch_id",
":",
":",
"param",
"result_id",
":"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/salesforce.py#L535-L547 | train | Gets the result from Salesforce as whatever type was originally sent in create_batch ( xml or csv. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/sge.py | _parse_qstat_state | def _parse_qstat_state(qstat_out, job_id):
"""Parse "state" column from `qstat` output for given job_id
Returns state for the *first* job matching job_id. Returns 'u' if
`qstat` output is empty or job_id is not found.
"""
if qstat_out.strip() == '':
return 'u'
lines = qstat_out.split('... | python | def _parse_qstat_state(qstat_out, job_id):
"""Parse "state" column from `qstat` output for given job_id
Returns state for the *first* job matching job_id. Returns 'u' if
`qstat` output is empty or job_id is not found.
"""
if qstat_out.strip() == '':
return 'u'
lines = qstat_out.split('... | [
"def",
"_parse_qstat_state",
"(",
"qstat_out",
",",
"job_id",
")",
":",
"if",
"qstat_out",
".",
"strip",
"(",
")",
"==",
"''",
":",
"return",
"'u'",
"lines",
"=",
"qstat_out",
".",
"split",
"(",
"'\\n'",
")",
"# skip past header",
"while",
"not",
"lines",
... | Parse "state" column from `qstat` output for given job_id
Returns state for the *first* job matching job_id. Returns 'u' if
`qstat` output is empty or job_id is not found. | [
"Parse",
"state",
"column",
"from",
"qstat",
"output",
"for",
"given",
"job_id"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/sge.py#L113-L131 | train | Parse the state column from qstat output for given job_id. Returns u if the first job matching job_id is not found. Returns u if the qstat output is empty. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/sge.py | _build_qsub_command | def _build_qsub_command(cmd, job_name, outfile, errfile, pe, n_cpu):
"""Submit shell command to SGE queue via `qsub`"""
qsub_template = """echo {cmd} | qsub -o ":{outfile}" -e ":{errfile}" -V -r y -pe {pe} {n_cpu} -N {job_name}"""
return qsub_template.format(
cmd=cmd, job_name=job_name, outfile=outf... | python | def _build_qsub_command(cmd, job_name, outfile, errfile, pe, n_cpu):
"""Submit shell command to SGE queue via `qsub`"""
qsub_template = """echo {cmd} | qsub -o ":{outfile}" -e ":{errfile}" -V -r y -pe {pe} {n_cpu} -N {job_name}"""
return qsub_template.format(
cmd=cmd, job_name=job_name, outfile=outf... | [
"def",
"_build_qsub_command",
"(",
"cmd",
",",
"job_name",
",",
"outfile",
",",
"errfile",
",",
"pe",
",",
"n_cpu",
")",
":",
"qsub_template",
"=",
"\"\"\"echo {cmd} | qsub -o \":{outfile}\" -e \":{errfile}\" -V -r y -pe {pe} {n_cpu} -N {job_name}\"\"\"",
"return",
"qsub_temp... | Submit shell command to SGE queue via `qsub` | [
"Submit",
"shell",
"command",
"to",
"SGE",
"queue",
"via",
"qsub"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/sge.py#L145-L150 | train | Build command to submit to SGE queue via qsub | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/sge.py | SGEJobTask._dump | def _dump(self, out_dir=''):
"""Dump instance to file."""
with self.no_unpicklable_properties():
self.job_file = os.path.join(out_dir, 'job-instance.pickle')
if self.__module__ == '__main__':
d = pickle.dumps(self)
module_name = os.path.basename(sy... | python | def _dump(self, out_dir=''):
"""Dump instance to file."""
with self.no_unpicklable_properties():
self.job_file = os.path.join(out_dir, 'job-instance.pickle')
if self.__module__ == '__main__':
d = pickle.dumps(self)
module_name = os.path.basename(sy... | [
"def",
"_dump",
"(",
"self",
",",
"out_dir",
"=",
"''",
")",
":",
"with",
"self",
".",
"no_unpicklable_properties",
"(",
")",
":",
"self",
".",
"job_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"out_dir",
",",
"'job-instance.pickle'",
")",
"if",
"s... | Dump instance to file. | [
"Dump",
"instance",
"to",
"file",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/sge.py#L273-L283 | train | Dump instance to file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | examples/elasticsearch_index.py | FakeDocuments.run | 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 Elasticsearch id field,
* `text`: the text,
* `date`: the day when the data was created.
"""
today = date... | python | 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 Elasticsearch id field,
* `text`: the text,
* `date`: the day when the data was created.
"""
today = date... | [
"def",
"run",
"(",
"self",
")",
":",
"today",
"=",
"datetime",
".",
"date",
".",
"today",
"(",
")",
"with",
"self",
".",
"output",
"(",
")",
".",
"open",
"(",
"'w'",
")",
"as",
"output",
":",
"for",
"i",
"in",
"range",
"(",
"5",
")",
":",
"ou... | Writes data in JSON format into the task's output target.
The data objects have the following attributes:
* `_id` is the default Elasticsearch id field,
* `text`: the text,
* `date`: the day when the data was created. | [
"Writes",
"data",
"in",
"JSON",
"format",
"into",
"the",
"task",
"s",
"output",
"target",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/examples/elasticsearch_index.py#L32-L48 | train | Writes data in JSON format into the task s output target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/clients.py | get_autoconfig_client | def get_autoconfig_client(client_cache=_AUTOCONFIG_CLIENT):
"""
Creates the client as specified in the `luigi.cfg` configuration.
"""
try:
return client_cache.client
except AttributeError:
configured_client = hdfs_config.get_configured_hdfs_client()
if configured_client == "w... | python | def get_autoconfig_client(client_cache=_AUTOCONFIG_CLIENT):
"""
Creates the client as specified in the `luigi.cfg` configuration.
"""
try:
return client_cache.client
except AttributeError:
configured_client = hdfs_config.get_configured_hdfs_client()
if configured_client == "w... | [
"def",
"get_autoconfig_client",
"(",
"client_cache",
"=",
"_AUTOCONFIG_CLIENT",
")",
":",
"try",
":",
"return",
"client_cache",
".",
"client",
"except",
"AttributeError",
":",
"configured_client",
"=",
"hdfs_config",
".",
"get_configured_hdfs_client",
"(",
")",
"if",
... | Creates the client as specified in the `luigi.cfg` configuration. | [
"Creates",
"the",
"client",
"as",
"specified",
"in",
"the",
"luigi",
".",
"cfg",
"configuration",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/clients.py#L36-L57 | train | Creates the client based on the configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | wrap_traceback | def wrap_traceback(traceback):
"""
For internal use only (until further notice)
"""
if email().format == 'html':
try:
from pygments import highlight
from pygments.lexers import PythonTracebackLexer
from pygments.formatters import HtmlFormatter
with... | python | def wrap_traceback(traceback):
"""
For internal use only (until further notice)
"""
if email().format == 'html':
try:
from pygments import highlight
from pygments.lexers import PythonTracebackLexer
from pygments.formatters import HtmlFormatter
with... | [
"def",
"wrap_traceback",
"(",
"traceback",
")",
":",
"if",
"email",
"(",
")",
".",
"format",
"==",
"'html'",
":",
"try",
":",
"from",
"pygments",
"import",
"highlight",
"from",
"pygments",
".",
"lexers",
"import",
"PythonTracebackLexer",
"from",
"pygments",
... | For internal use only (until further notice) | [
"For",
"internal",
"use",
"only",
"(",
"until",
"further",
"notice",
")"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L159-L180 | train | Wraps a traceback into a single HTML block. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | send_email_ses | def send_email_ses(sender, subject, message, recipients, image_png):
"""
Sends notification through AWS SES.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configuration.html.
"""
from bot... | python | def send_email_ses(sender, subject, message, recipients, image_png):
"""
Sends notification through AWS SES.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configuration.html.
"""
from bot... | [
"def",
"send_email_ses",
"(",
"sender",
",",
"subject",
",",
"message",
",",
"recipients",
",",
"image_png",
")",
":",
"from",
"boto3",
"import",
"client",
"as",
"boto3_client",
"client",
"=",
"boto3_client",
"(",
"'ses'",
")",
"msg_root",
"=",
"generate_email... | Sends notification through AWS SES.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configuration.html. | [
"Sends",
"notification",
"through",
"AWS",
"SES",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L210-L232 | train | Sends an email to AWS SES. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | send_email_sns | def send_email_sns(sender, subject, message, topic_ARN, image_png):
"""
Sends notification through AWS SNS. Takes Topic ARN from recipients.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configur... | python | def send_email_sns(sender, subject, message, topic_ARN, image_png):
"""
Sends notification through AWS SNS. Takes Topic ARN from recipients.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configur... | [
"def",
"send_email_sns",
"(",
"sender",
",",
"subject",
",",
"message",
",",
"topic_ARN",
",",
"image_png",
")",
":",
"from",
"boto3",
"import",
"resource",
"as",
"boto3_resource",
"sns",
"=",
"boto3_resource",
"(",
"'sns'",
")",
"topic",
"=",
"sns",
".",
... | Sends notification through AWS SNS. Takes Topic ARN from recipients.
Does not handle access keys. Use either
1/ configuration file
2/ EC2 instance profile
See also https://boto3.readthedocs.io/en/latest/guide/configuration.html. | [
"Sends",
"notification",
"through",
"AWS",
"SNS",
".",
"Takes",
"Topic",
"ARN",
"from",
"recipients",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L264-L288 | train | Sends an email to SNS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | send_email | def send_email(subject, message, sender, recipients, image_png=None):
"""
Decides whether to send notification. Notification is cancelled if there are
no recipients or if stdout is onto tty or if in debug mode.
Dispatches on config value email.method. Default is 'smtp'.
"""
notifiers = {
... | python | def send_email(subject, message, sender, recipients, image_png=None):
"""
Decides whether to send notification. Notification is cancelled if there are
no recipients or if stdout is onto tty or if in debug mode.
Dispatches on config value email.method. Default is 'smtp'.
"""
notifiers = {
... | [
"def",
"send_email",
"(",
"subject",
",",
"message",
",",
"sender",
",",
"recipients",
",",
"image_png",
"=",
"None",
")",
":",
"notifiers",
"=",
"{",
"'ses'",
":",
"send_email_ses",
",",
"'sendgrid'",
":",
"send_email_sendgrid",
",",
"'smtp'",
":",
"send_em... | Decides whether to send notification. Notification is cancelled if there are
no recipients or if stdout is onto tty or if in debug mode.
Dispatches on config value email.method. Default is 'smtp'. | [
"Decides",
"whether",
"to",
"send",
"notification",
".",
"Notification",
"is",
"cancelled",
"if",
"there",
"are",
"no",
"recipients",
"or",
"if",
"stdout",
"is",
"onto",
"tty",
"or",
"if",
"in",
"debug",
"mode",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L291-L327 | train | Sends an email to the specified recipients. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | send_error_email | def send_error_email(subject, message, additional_recipients=None):
"""
Sends an email to the configured error email, if it's configured.
"""
recipients = _email_recipients(additional_recipients)
sender = email().sender
send_email(
subject=subject,
message=message,
sender... | python | def send_error_email(subject, message, additional_recipients=None):
"""
Sends an email to the configured error email, if it's configured.
"""
recipients = _email_recipients(additional_recipients)
sender = email().sender
send_email(
subject=subject,
message=message,
sender... | [
"def",
"send_error_email",
"(",
"subject",
",",
"message",
",",
"additional_recipients",
"=",
"None",
")",
":",
"recipients",
"=",
"_email_recipients",
"(",
"additional_recipients",
")",
"sender",
"=",
"email",
"(",
")",
".",
"sender",
"send_email",
"(",
"subjec... | Sends an email to the configured error email, if it's configured. | [
"Sends",
"an",
"email",
"to",
"the",
"configured",
"error",
"email",
"if",
"it",
"s",
"configured",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L341-L352 | train | Sends an email to the configured error email. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/notifications.py | format_task_error | def format_task_error(headline, task, command, formatted_exception=None):
"""
Format a message body for an error email related to a luigi.task.Task
:param headline: Summary line for the message
:param task: `luigi.task.Task` instance where this error occurred
:param formatted_exception: optional st... | python | def format_task_error(headline, task, command, formatted_exception=None):
"""
Format a message body for an error email related to a luigi.task.Task
:param headline: Summary line for the message
:param task: `luigi.task.Task` instance where this error occurred
:param formatted_exception: optional st... | [
"def",
"format_task_error",
"(",
"headline",
",",
"task",
",",
"command",
",",
"formatted_exception",
"=",
"None",
")",
":",
"if",
"formatted_exception",
":",
"formatted_exception",
"=",
"wrap_traceback",
"(",
"formatted_exception",
")",
"else",
":",
"formatted_exce... | Format a message body for an error email related to a luigi.task.Task
:param headline: Summary line for the message
:param task: `luigi.task.Task` instance where this error occurred
:param formatted_exception: optional string showing traceback
:return: message body | [
"Format",
"a",
"message",
"body",
"for",
"an",
"error",
"email",
"related",
"to",
"a",
"luigi",
".",
"task",
".",
"Task"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/notifications.py#L366-L434 | train | Format a message body for an error email related to a luigi. task. Task object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/webhdfs_client.py | WebHdfsClient.exists | def exists(self, path):
"""
Returns true if the path exists and false otherwise.
"""
import hdfs
try:
self.client.status(path)
return True
except hdfs.util.HdfsError as e:
if str(e).startswith('File does not exist: '):
r... | python | def exists(self, path):
"""
Returns true if the path exists and false otherwise.
"""
import hdfs
try:
self.client.status(path)
return True
except hdfs.util.HdfsError as e:
if str(e).startswith('File does not exist: '):
r... | [
"def",
"exists",
"(",
"self",
",",
"path",
")",
":",
"import",
"hdfs",
"try",
":",
"self",
".",
"client",
".",
"status",
"(",
"path",
")",
"return",
"True",
"except",
"hdfs",
".",
"util",
".",
"HdfsError",
"as",
"e",
":",
"if",
"str",
"(",
"e",
"... | Returns true if the path exists and false otherwise. | [
"Returns",
"true",
"if",
"the",
"path",
"exists",
"and",
"false",
"otherwise",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/webhdfs_client.py#L89-L101 | train | Returns true if the path exists and false otherwise. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/webhdfs_client.py | WebHdfsClient.mkdir | def mkdir(self, path, parents=True, mode=0o755, raise_if_exists=False):
"""
Has no returnvalue (just like WebHDFS)
"""
if not parents or raise_if_exists:
warnings.warn('webhdfs mkdir: parents/raise_if_exists not implemented')
permission = int(oct(mode)[2:]) # Convert... | python | def mkdir(self, path, parents=True, mode=0o755, raise_if_exists=False):
"""
Has no returnvalue (just like WebHDFS)
"""
if not parents or raise_if_exists:
warnings.warn('webhdfs mkdir: parents/raise_if_exists not implemented')
permission = int(oct(mode)[2:]) # Convert... | [
"def",
"mkdir",
"(",
"self",
",",
"path",
",",
"parents",
"=",
"True",
",",
"mode",
"=",
"0o755",
",",
"raise_if_exists",
"=",
"False",
")",
":",
"if",
"not",
"parents",
"or",
"raise_if_exists",
":",
"warnings",
".",
"warn",
"(",
"'webhdfs mkdir: parents/r... | Has no returnvalue (just like WebHDFS) | [
"Has",
"no",
"returnvalue",
"(",
"just",
"like",
"WebHDFS",
")"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/webhdfs_client.py#L128-L135 | train | Create a directory in the HDFS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/webhdfs_client.py | WebHdfsClient.touchz | def touchz(self, path):
"""
To touchz using the web hdfs "write" cmd.
"""
self.client.write(path, data='', overwrite=False) | python | def touchz(self, path):
"""
To touchz using the web hdfs "write" cmd.
"""
self.client.write(path, data='', overwrite=False) | [
"def",
"touchz",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"client",
".",
"write",
"(",
"path",
",",
"data",
"=",
"''",
",",
"overwrite",
"=",
"False",
")"
] | To touchz using the web hdfs "write" cmd. | [
"To",
"touchz",
"using",
"the",
"web",
"hdfs",
"write",
"cmd",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/webhdfs_client.py#L179-L183 | train | To touchz using the web hdfs write command. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/azureblob.py | AzureBlobTarget.open | def open(self, mode):
"""
Open the target for reading or writing
:param char mode:
'r' for reading and 'w' for writing.
'b' is not supported and will be stripped if used. For binary mode, use `format`
:return:
* :class:`.ReadableAzureBlobFile` if 'r'... | python | def open(self, mode):
"""
Open the target for reading or writing
:param char mode:
'r' for reading and 'w' for writing.
'b' is not supported and will be stripped if used. For binary mode, use `format`
:return:
* :class:`.ReadableAzureBlobFile` if 'r'... | [
"def",
"open",
"(",
"self",
",",
"mode",
")",
":",
"if",
"mode",
"not",
"in",
"(",
"'r'",
",",
"'w'",
")",
":",
"raise",
"ValueError",
"(",
"\"Unsupported open mode '%s'\"",
"%",
"mode",
")",
"if",
"mode",
"==",
"'r'",
":",
"return",
"self",
".",
"fo... | Open the target for reading or writing
:param char mode:
'r' for reading and 'w' for writing.
'b' is not supported and will be stripped if used. For binary mode, use `format`
:return:
* :class:`.ReadableAzureBlobFile` if 'r'
* :class:`.AtomicAzureBlobFil... | [
"Open",
"the",
"target",
"for",
"reading",
"or",
"writing"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/azureblob.py#L275-L292 | train | Open the target for reading or writing. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | examples/top_artists.py | Streams.run | def run(self):
"""
Generates bogus data and writes it into the :py:meth:`~.Streams.output` target.
"""
with self.output().open('w') as output:
for _ in range(1000):
output.write('{} {} {}\n'.format(
random.randint(0, 999),
... | python | def run(self):
"""
Generates bogus data and writes it into the :py:meth:`~.Streams.output` target.
"""
with self.output().open('w') as output:
for _ in range(1000):
output.write('{} {} {}\n'.format(
random.randint(0, 999),
... | [
"def",
"run",
"(",
"self",
")",
":",
"with",
"self",
".",
"output",
"(",
")",
".",
"open",
"(",
"'w'",
")",
"as",
"output",
":",
"for",
"_",
"in",
"range",
"(",
"1000",
")",
":",
"output",
".",
"write",
"(",
"'{} {} {}\\n'",
".",
"format",
"(",
... | Generates bogus data and writes it into the :py:meth:`~.Streams.output` target. | [
"Generates",
"bogus",
"data",
"and",
"writes",
"it",
"into",
"the",
":",
"py",
":",
"meth",
":",
"~",
".",
"Streams",
".",
"output",
"target",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/examples/top_artists.py#L56-L65 | train | Generates bogus data and writes it into the target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | examples/top_artists.py | Top10Artists.requires | def requires(self):
"""
This task's dependencies:
* :py:class:`~.AggregateArtists` or
* :py:class:`~.AggregateArtistsSpark` if :py:attr:`~/.Top10Artists.use_spark` is set.
:return: object (:py:class:`luigi.task.Task`)
"""
if self.use_spark:
return Ag... | python | def requires(self):
"""
This task's dependencies:
* :py:class:`~.AggregateArtists` or
* :py:class:`~.AggregateArtistsSpark` if :py:attr:`~/.Top10Artists.use_spark` is set.
:return: object (:py:class:`luigi.task.Task`)
"""
if self.use_spark:
return Ag... | [
"def",
"requires",
"(",
"self",
")",
":",
"if",
"self",
".",
"use_spark",
":",
"return",
"AggregateArtistsSpark",
"(",
"self",
".",
"date_interval",
")",
"else",
":",
"return",
"AggregateArtists",
"(",
"self",
".",
"date_interval",
")"
] | This task's dependencies:
* :py:class:`~.AggregateArtists` or
* :py:class:`~.AggregateArtistsSpark` if :py:attr:`~/.Top10Artists.use_spark` is set.
:return: object (:py:class:`luigi.task.Task`) | [
"This",
"task",
"s",
"dependencies",
":"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/examples/top_artists.py#L198-L210 | train | This task s dependencies. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/simulate.py | RunAnywayTarget.get_path | def get_path(self):
"""
Returns a temporary file path based on a MD5 hash generated with the task's name and its arguments
"""
md5_hash = hashlib.md5(self.task_id.encode()).hexdigest()
logger.debug('Hash %s corresponds to task %s', md5_hash, self.task_id)
return os.path.... | python | def get_path(self):
"""
Returns a temporary file path based on a MD5 hash generated with the task's name and its arguments
"""
md5_hash = hashlib.md5(self.task_id.encode()).hexdigest()
logger.debug('Hash %s corresponds to task %s', md5_hash, self.task_id)
return os.path.... | [
"def",
"get_path",
"(",
"self",
")",
":",
"md5_hash",
"=",
"hashlib",
".",
"md5",
"(",
"self",
".",
"task_id",
".",
"encode",
"(",
")",
")",
".",
"hexdigest",
"(",
")",
"logger",
".",
"debug",
"(",
"'Hash %s corresponds to task %s'",
",",
"md5_hash",
","... | Returns a temporary file path based on a MD5 hash generated with the task's name and its arguments | [
"Returns",
"a",
"temporary",
"file",
"path",
"based",
"on",
"a",
"MD5",
"hash",
"generated",
"with",
"the",
"task",
"s",
"name",
"and",
"its",
"arguments"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/simulate.py#L82-L89 | train | Returns a temporary file path based on the MD5 hash generated with the task s name and its arguments | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/simulate.py | RunAnywayTarget.done | def done(self):
"""
Creates temporary file to mark the task as `done`
"""
logger.info('Marking %s as done', self)
fn = self.get_path()
try:
os.makedirs(os.path.dirname(fn))
except OSError:
pass
open(fn, 'w').close() | python | def done(self):
"""
Creates temporary file to mark the task as `done`
"""
logger.info('Marking %s as done', self)
fn = self.get_path()
try:
os.makedirs(os.path.dirname(fn))
except OSError:
pass
open(fn, 'w').close() | [
"def",
"done",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'Marking %s as done'",
",",
"self",
")",
"fn",
"=",
"self",
".",
"get_path",
"(",
")",
"try",
":",
"os",
".",
"makedirs",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"fn",
")",
"... | Creates temporary file to mark the task as `done` | [
"Creates",
"temporary",
"file",
"to",
"mark",
"the",
"task",
"as",
"done"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/simulate.py#L97-L108 | train | Creates a temporary file to mark the task as done | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.exists | def exists(self, path):
"""
Does provided path exist on S3?
"""
(bucket, key) = self._path_to_bucket_and_key(path)
# root always exists
if self._is_root(key):
return True
# file
if self._exists(bucket, key):
return True
i... | python | def exists(self, path):
"""
Does provided path exist on S3?
"""
(bucket, key) = self._path_to_bucket_and_key(path)
# root always exists
if self._is_root(key):
return True
# file
if self._exists(bucket, key):
return True
i... | [
"def",
"exists",
"(",
"self",
",",
"path",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"path",
")",
"# root always exists",
"if",
"self",
".",
"_is_root",
"(",
"key",
")",
":",
"return",
"True",
"# file",
... | Does provided path exist on S3? | [
"Does",
"provided",
"path",
"exist",
"on",
"S3?"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L177-L195 | train | Does provided path exist on S3? | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.remove | def remove(self, path, recursive=True):
"""
Remove a file or directory from S3.
:param path: File or directory to remove
:param recursive: Boolean indicator to remove object and children
:return: Boolean indicator denoting success of the removal of 1 or more files
"""
... | python | def remove(self, path, recursive=True):
"""
Remove a file or directory from S3.
:param path: File or directory to remove
:param recursive: Boolean indicator to remove object and children
:return: Boolean indicator denoting success of the removal of 1 or more files
"""
... | [
"def",
"remove",
"(",
"self",
",",
"path",
",",
"recursive",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"exists",
"(",
"path",
")",
":",
"logger",
".",
"debug",
"(",
"'Could not delete %s; path does not exist'",
",",
"path",
")",
"return",
"False",
... | Remove a file or directory from S3.
:param path: File or directory to remove
:param recursive: Boolean indicator to remove object and children
:return: Boolean indicator denoting success of the removal of 1 or more files | [
"Remove",
"a",
"file",
"or",
"directory",
"from",
"S3",
".",
":",
"param",
"path",
":",
"File",
"or",
"directory",
"to",
"remove",
":",
"param",
"recursive",
":",
"Boolean",
"indicator",
"to",
"remove",
"object",
"and",
"children",
":",
"return",
":",
"B... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L197-L235 | train | Remove a file or directory from S3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.get_key | def get_key(self, path):
"""
Returns the object summary at the path
"""
(bucket, key) = self._path_to_bucket_and_key(path)
if self._exists(bucket, key):
return self.s3.ObjectSummary(bucket, key) | python | def get_key(self, path):
"""
Returns the object summary at the path
"""
(bucket, key) = self._path_to_bucket_and_key(path)
if self._exists(bucket, key):
return self.s3.ObjectSummary(bucket, key) | [
"def",
"get_key",
"(",
"self",
",",
"path",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"path",
")",
"if",
"self",
".",
"_exists",
"(",
"bucket",
",",
"key",
")",
":",
"return",
"self",
".",
"s3",
"."... | Returns the object summary at the path | [
"Returns",
"the",
"object",
"summary",
"at",
"the",
"path"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L247-L254 | train | Returns the object summary at the path | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.put | def put(self, local_path, destination_s3_path, **kwargs):
"""
Put an object stored locally to an S3 path.
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto function `put_obje... | python | def put(self, local_path, destination_s3_path, **kwargs):
"""
Put an object stored locally to an S3 path.
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto function `put_obje... | [
"def",
"put",
"(",
"self",
",",
"local_path",
",",
"destination_s3_path",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_check_deprecated_argument",
"(",
"*",
"*",
"kwargs",
")",
"# put the file",
"self",
".",
"put_multipart",
"(",
"local_path",
",",
"des... | Put an object stored locally to an S3 path.
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto function `put_object` | [
"Put",
"an",
"object",
"stored",
"locally",
"to",
"an",
"S3",
"path",
".",
":",
"param",
"local_path",
":",
"Path",
"to",
"source",
"local",
"file",
":",
"param",
"destination_s3_path",
":",
"URL",
"for",
"target",
"S3",
"location",
":",
"param",
"kwargs",... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L256-L266 | train | Put an object stored locally to an S3 path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.put_string | def put_string(self, content, destination_s3_path, **kwargs):
"""
Put a string to an S3 path.
:param content: Data str
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto3 function `put_object`
"""
self._c... | python | def put_string(self, content, destination_s3_path, **kwargs):
"""
Put a string to an S3 path.
:param content: Data str
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto3 function `put_object`
"""
self._c... | [
"def",
"put_string",
"(",
"self",
",",
"content",
",",
"destination_s3_path",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_check_deprecated_argument",
"(",
"*",
"*",
"kwargs",
")",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and... | Put a string to an S3 path.
:param content: Data str
:param destination_s3_path: URL for target S3 location
:param kwargs: Keyword arguments are passed to the boto3 function `put_object` | [
"Put",
"a",
"string",
"to",
"an",
"S3",
"path",
".",
":",
"param",
"content",
":",
"Data",
"str",
":",
"param",
"destination_s3_path",
":",
"URL",
"for",
"target",
"S3",
"location",
":",
"param",
"kwargs",
":",
"Keyword",
"arguments",
"are",
"passed",
"t... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L268-L280 | train | Put a string to an S3 path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.put_multipart | def put_multipart(self, local_path, destination_s3_path, part_size=DEFAULT_PART_SIZE, **kwargs):
"""
Put an object stored locally to an S3 path
using S3 multi-part upload (for files > 8Mb).
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3... | python | def put_multipart(self, local_path, destination_s3_path, part_size=DEFAULT_PART_SIZE, **kwargs):
"""
Put an object stored locally to an S3 path
using S3 multi-part upload (for files > 8Mb).
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3... | [
"def",
"put_multipart",
"(",
"self",
",",
"local_path",
",",
"destination_s3_path",
",",
"part_size",
"=",
"DEFAULT_PART_SIZE",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_check_deprecated_argument",
"(",
"*",
"*",
"kwargs",
")",
"from",
"boto3",
".",
... | Put an object stored locally to an S3 path
using S3 multi-part upload (for files > 8Mb).
:param local_path: Path to source local file
:param destination_s3_path: URL for target S3 location
:param part_size: Part size in bytes. Default: 8388608 (8MB)
:param kwargs: Keyword argumen... | [
"Put",
"an",
"object",
"stored",
"locally",
"to",
"an",
"S3",
"path",
"using",
"S3",
"multi",
"-",
"part",
"upload",
"(",
"for",
"files",
">",
"8Mb",
")",
".",
":",
"param",
"local_path",
":",
"Path",
"to",
"source",
"local",
"file",
":",
"param",
"d... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L282-L301 | train | Put an object stored locally to an S3 path and upload it to an S3 path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.copy | def copy(self, source_path, destination_path, threads=DEFAULT_THREADS, start_time=None, end_time=None,
part_size=DEFAULT_PART_SIZE, **kwargs):
"""
Copy object(s) from one S3 location to another. Works for individual keys or entire directories.
When files are larger than `part_size`,... | python | def copy(self, source_path, destination_path, threads=DEFAULT_THREADS, start_time=None, end_time=None,
part_size=DEFAULT_PART_SIZE, **kwargs):
"""
Copy object(s) from one S3 location to another. Works for individual keys or entire directories.
When files are larger than `part_size`,... | [
"def",
"copy",
"(",
"self",
",",
"source_path",
",",
"destination_path",
",",
"threads",
"=",
"DEFAULT_THREADS",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"part_size",
"=",
"DEFAULT_PART_SIZE",
",",
"*",
"*",
"kwargs",
")",
":",
"#... | Copy object(s) from one S3 location to another. Works for individual keys or entire directories.
When files are larger than `part_size`, multipart uploading will be used.
:param source_path: The `s3://` path of the directory or key to copy from
:param destination_path: The `s3://` path of the di... | [
"Copy",
"object",
"(",
"s",
")",
"from",
"one",
"S3",
"location",
"to",
"another",
".",
"Works",
"for",
"individual",
"keys",
"or",
"entire",
"directories",
".",
"When",
"files",
"are",
"larger",
"than",
"part_size",
"multipart",
"uploading",
"will",
"be",
... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L303-L327 | train | Copy object from one S3 location to another. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.get | def get(self, s3_path, destination_local_path):
"""
Get an object stored in S3 and write it to a local path.
"""
(bucket, key) = self._path_to_bucket_and_key(s3_path)
# download the file
self.s3.meta.client.download_file(bucket, key, destination_local_path) | python | def get(self, s3_path, destination_local_path):
"""
Get an object stored in S3 and write it to a local path.
"""
(bucket, key) = self._path_to_bucket_and_key(s3_path)
# download the file
self.s3.meta.client.download_file(bucket, key, destination_local_path) | [
"def",
"get",
"(",
"self",
",",
"s3_path",
",",
"destination_local_path",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"s3_path",
")",
"# download the file",
"self",
".",
"s3",
".",
"meta",
".",
"client",
".",... | Get an object stored in S3 and write it to a local path. | [
"Get",
"an",
"object",
"stored",
"in",
"S3",
"and",
"write",
"it",
"to",
"a",
"local",
"path",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L383-L389 | train | Get an object stored in S3 and write it to a local path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.get_as_bytes | def get_as_bytes(self, s3_path):
"""
Get the contents of an object stored in S3 as bytes
:param s3_path: URL for target S3 location
:return: File contents as pure bytes
"""
(bucket, key) = self._path_to_bucket_and_key(s3_path)
obj = self.s3.Object(bucket, key)
... | python | def get_as_bytes(self, s3_path):
"""
Get the contents of an object stored in S3 as bytes
:param s3_path: URL for target S3 location
:return: File contents as pure bytes
"""
(bucket, key) = self._path_to_bucket_and_key(s3_path)
obj = self.s3.Object(bucket, key)
... | [
"def",
"get_as_bytes",
"(",
"self",
",",
"s3_path",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"s3_path",
")",
"obj",
"=",
"self",
".",
"s3",
".",
"Object",
"(",
"bucket",
",",
"key",
")",
"contents",
... | Get the contents of an object stored in S3 as bytes
:param s3_path: URL for target S3 location
:return: File contents as pure bytes | [
"Get",
"the",
"contents",
"of",
"an",
"object",
"stored",
"in",
"S3",
"as",
"bytes"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L391-L401 | train | Get the contents of an object stored in S3 as bytes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.get_as_string | def get_as_string(self, s3_path, encoding='utf-8'):
"""
Get the contents of an object stored in S3 as string.
:param s3_path: URL for target S3 location
:param encoding: Encoding to decode bytes to string
:return: File contents as a string
"""
content = self.get_... | python | def get_as_string(self, s3_path, encoding='utf-8'):
"""
Get the contents of an object stored in S3 as string.
:param s3_path: URL for target S3 location
:param encoding: Encoding to decode bytes to string
:return: File contents as a string
"""
content = self.get_... | [
"def",
"get_as_string",
"(",
"self",
",",
"s3_path",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"content",
"=",
"self",
".",
"get_as_bytes",
"(",
"s3_path",
")",
"return",
"content",
".",
"decode",
"(",
"encoding",
")"
] | Get the contents of an object stored in S3 as string.
:param s3_path: URL for target S3 location
:param encoding: Encoding to decode bytes to string
:return: File contents as a string | [
"Get",
"the",
"contents",
"of",
"an",
"object",
"stored",
"in",
"S3",
"as",
"string",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L403-L412 | train | Get the contents of an object stored in S3 as a string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.isdir | def isdir(self, path):
"""
Is the parameter S3 path a directory?
"""
(bucket, key) = self._path_to_bucket_and_key(path)
s3_bucket = self.s3.Bucket(bucket)
# root is a directory
if self._is_root(key):
return True
for suffix in (S3_DIRECTORY_M... | python | def isdir(self, path):
"""
Is the parameter S3 path a directory?
"""
(bucket, key) = self._path_to_bucket_and_key(path)
s3_bucket = self.s3.Bucket(bucket)
# root is a directory
if self._is_root(key):
return True
for suffix in (S3_DIRECTORY_M... | [
"def",
"isdir",
"(",
"self",
",",
"path",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"path",
")",
"s3_bucket",
"=",
"self",
".",
"s3",
".",
"Bucket",
"(",
"bucket",
")",
"# root is a directory",
"if",
"s... | Is the parameter S3 path a directory? | [
"Is",
"the",
"parameter",
"S3",
"path",
"a",
"directory?"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L414-L444 | train | Is the parameter S3 path a directory? | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/s3.py | S3Client.listdir | def listdir(self, path, start_time=None, end_time=None, return_key=False):
"""
Get an iterable with S3 folder contents.
Iterable contains paths relative to queried path.
:param path: URL for target S3 location
:param start_time: Optional argument to list files with modified (offs... | python | def listdir(self, path, start_time=None, end_time=None, return_key=False):
"""
Get an iterable with S3 folder contents.
Iterable contains paths relative to queried path.
:param path: URL for target S3 location
:param start_time: Optional argument to list files with modified (offs... | [
"def",
"listdir",
"(",
"self",
",",
"path",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"return_key",
"=",
"False",
")",
":",
"(",
"bucket",
",",
"key",
")",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"path",
")",
"# grab ... | Get an iterable with S3 folder contents.
Iterable contains paths relative to queried path.
:param path: URL for target S3 location
:param start_time: Optional argument to list files with modified (offset aware) datetime after start_time
:param end_time: Optional argument to list files wi... | [
"Get",
"an",
"iterable",
"with",
"S3",
"folder",
"contents",
".",
"Iterable",
"contains",
"paths",
"relative",
"to",
"queried",
"path",
".",
":",
"param",
"path",
":",
"URL",
"for",
"target",
"S3",
"location",
":",
"param",
"start_time",
":",
"Optional",
"... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/s3.py#L464-L495 | train | Get an iterable with S3 folder contents. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem.exists | def exists(self, path, mtime=None):
"""
Return `True` if file or directory at `path` exist, False otherwise.
Additional check on modified time when mtime is passed in.
Return False if the file's modified time is older mtime.
"""
self._connect()
if self.sftp:
... | python | def exists(self, path, mtime=None):
"""
Return `True` if file or directory at `path` exist, False otherwise.
Additional check on modified time when mtime is passed in.
Return False if the file's modified time is older mtime.
"""
self._connect()
if self.sftp:
... | [
"def",
"exists",
"(",
"self",
",",
"path",
",",
"mtime",
"=",
"None",
")",
":",
"self",
".",
"_connect",
"(",
")",
"if",
"self",
".",
"sftp",
":",
"exists",
"=",
"self",
".",
"_sftp_exists",
"(",
"path",
",",
"mtime",
")",
"else",
":",
"exists",
... | Return `True` if file or directory at `path` exist, False otherwise.
Additional check on modified time when mtime is passed in.
Return False if the file's modified time is older mtime. | [
"Return",
"True",
"if",
"file",
"or",
"directory",
"at",
"path",
"exist",
"False",
"otherwise",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L109-L126 | train | Return True if file or directory at path exist False otherwise. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem.remove | def remove(self, path, recursive=True):
"""
Remove file or directory at location ``path``.
:param path: a path within the FileSystem to remove.
:type path: str
:param recursive: if the path is a directory, recursively remove the directory and
all of its... | python | def remove(self, path, recursive=True):
"""
Remove file or directory at location ``path``.
:param path: a path within the FileSystem to remove.
:type path: str
:param recursive: if the path is a directory, recursively remove the directory and
all of its... | [
"def",
"remove",
"(",
"self",
",",
"path",
",",
"recursive",
"=",
"True",
")",
":",
"self",
".",
"_connect",
"(",
")",
"if",
"self",
".",
"sftp",
":",
"self",
".",
"_sftp_remove",
"(",
"path",
",",
"recursive",
")",
"else",
":",
"self",
".",
"_ftp_... | Remove file or directory at location ``path``.
:param path: a path within the FileSystem to remove.
:type path: str
:param recursive: if the path is a directory, recursively remove the directory and
all of its descendants. Defaults to ``True``.
:type recursive:... | [
"Remove",
"file",
"or",
"directory",
"at",
"location",
"path",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L151-L168 | train | Removes a file or directory at the given path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem._rm_recursive | def _rm_recursive(self, ftp, path):
"""
Recursively delete a directory tree on a remote server.
Source: https://gist.github.com/artlogic/2632647
"""
wd = ftp.pwd()
# check if it is a file first, because some FTP servers don't return
# correctly on ftp.nlst(file)... | python | def _rm_recursive(self, ftp, path):
"""
Recursively delete a directory tree on a remote server.
Source: https://gist.github.com/artlogic/2632647
"""
wd = ftp.pwd()
# check if it is a file first, because some FTP servers don't return
# correctly on ftp.nlst(file)... | [
"def",
"_rm_recursive",
"(",
"self",
",",
"ftp",
",",
"path",
")",
":",
"wd",
"=",
"ftp",
".",
"pwd",
"(",
")",
"# check if it is a file first, because some FTP servers don't return",
"# correctly on ftp.nlst(file)",
"try",
":",
"ftp",
".",
"cwd",
"(",
"path",
")"... | Recursively delete a directory tree on a remote server.
Source: https://gist.github.com/artlogic/2632647 | [
"Recursively",
"delete",
"a",
"directory",
"tree",
"on",
"a",
"remote",
"server",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L197-L236 | train | Recursively delete a directory tree on a remote server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem.put | def put(self, local_path, path, atomic=True):
"""
Put file from local filesystem to (s)FTP.
"""
self._connect()
if self.sftp:
self._sftp_put(local_path, path, atomic)
else:
self._ftp_put(local_path, path, atomic)
self._close() | python | def put(self, local_path, path, atomic=True):
"""
Put file from local filesystem to (s)FTP.
"""
self._connect()
if self.sftp:
self._sftp_put(local_path, path, atomic)
else:
self._ftp_put(local_path, path, atomic)
self._close() | [
"def",
"put",
"(",
"self",
",",
"local_path",
",",
"path",
",",
"atomic",
"=",
"True",
")",
":",
"self",
".",
"_connect",
"(",
")",
"if",
"self",
".",
"sftp",
":",
"self",
".",
"_sftp_put",
"(",
"local_path",
",",
"path",
",",
"atomic",
")",
"else"... | Put file from local filesystem to (s)FTP. | [
"Put",
"file",
"from",
"local",
"filesystem",
"to",
"(",
"s",
")",
"FTP",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L238-L249 | train | Put file from local filesystem to FTP. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem.get | def get(self, path, local_path):
"""
Download file from (s)FTP to local filesystem.
"""
normpath = os.path.normpath(local_path)
folder = os.path.dirname(normpath)
if folder and not os.path.exists(folder):
os.makedirs(folder)
tmp_local_path = local_pat... | python | def get(self, path, local_path):
"""
Download file from (s)FTP to local filesystem.
"""
normpath = os.path.normpath(local_path)
folder = os.path.dirname(normpath)
if folder and not os.path.exists(folder):
os.makedirs(folder)
tmp_local_path = local_pat... | [
"def",
"get",
"(",
"self",
",",
"path",
",",
"local_path",
")",
":",
"normpath",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"local_path",
")",
"folder",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"normpath",
")",
"if",
"folder",
"and",
"not",
... | Download file from (s)FTP to local filesystem. | [
"Download",
"file",
"from",
"(",
"s",
")",
"FTP",
"to",
"local",
"filesystem",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L291-L312 | train | Download file from SFTP to local filesystem. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteFileSystem.listdir | def listdir(self, path='.'):
"""
Gets an list of the contents of path in (s)FTP
"""
self._connect()
if self.sftp:
contents = self._sftp_listdir(path)
else:
contents = self._ftp_listdir(path)
self._close()
return contents | python | def listdir(self, path='.'):
"""
Gets an list of the contents of path in (s)FTP
"""
self._connect()
if self.sftp:
contents = self._sftp_listdir(path)
else:
contents = self._ftp_listdir(path)
self._close()
return contents | [
"def",
"listdir",
"(",
"self",
",",
"path",
"=",
"'.'",
")",
":",
"self",
".",
"_connect",
"(",
")",
"if",
"self",
".",
"sftp",
":",
"contents",
"=",
"self",
".",
"_sftp_listdir",
"(",
"path",
")",
"else",
":",
"contents",
"=",
"self",
".",
"_ftp_l... | Gets an list of the contents of path in (s)FTP | [
"Gets",
"an",
"list",
"of",
"the",
"contents",
"of",
"path",
"in",
"(",
"s",
")",
"FTP"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L320-L333 | train | Gets an list of the contents of path in FTP or FTP. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/ftp.py | RemoteTarget.open | def open(self, mode):
"""
Open the FileSystem target.
This method returns a file-like object which can either be read from or written to depending
on the specified mode.
:param mode: the mode `r` opens the FileSystemTarget in read-only mode, whereas `w` will
... | python | def open(self, mode):
"""
Open the FileSystem target.
This method returns a file-like object which can either be read from or written to depending
on the specified mode.
:param mode: the mode `r` opens the FileSystemTarget in read-only mode, whereas `w` will
... | [
"def",
"open",
"(",
"self",
",",
"mode",
")",
":",
"if",
"mode",
"==",
"'w'",
":",
"return",
"self",
".",
"format",
".",
"pipe_writer",
"(",
"AtomicFtpFile",
"(",
"self",
".",
"_fs",
",",
"self",
".",
"path",
")",
")",
"elif",
"mode",
"==",
"'r'",
... | Open the FileSystem target.
This method returns a file-like object which can either be read from or written to depending
on the specified mode.
:param mode: the mode `r` opens the FileSystemTarget in read-only mode, whereas `w` will
open the FileSystemTarget in write mode.... | [
"Open",
"the",
"FileSystem",
"target",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/ftp.py#L394-L419 | train | Open the FileSystem target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoTarget.get_collection | def get_collection(self):
"""
Return targeted mongo collection to query on
"""
db_mongo = self._mongo_client[self._index]
return db_mongo[self._collection] | python | def get_collection(self):
"""
Return targeted mongo collection to query on
"""
db_mongo = self._mongo_client[self._index]
return db_mongo[self._collection] | [
"def",
"get_collection",
"(",
"self",
")",
":",
"db_mongo",
"=",
"self",
".",
"_mongo_client",
"[",
"self",
".",
"_index",
"]",
"return",
"db_mongo",
"[",
"self",
".",
"_collection",
"]"
] | Return targeted mongo collection to query on | [
"Return",
"targeted",
"mongo",
"collection",
"to",
"query",
"on"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L38-L43 | train | Return targeted mongo collection to query on
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoCellTarget.read | def read(self):
"""
Read the target value
Use $project aggregate operator in order to support nested objects
"""
result = self.get_collection().aggregate([
{'$match': {'_id': self._document_id}},
{'$project': {'_value': '$' + self._path, '_id': False}}
... | python | def read(self):
"""
Read the target value
Use $project aggregate operator in order to support nested objects
"""
result = self.get_collection().aggregate([
{'$match': {'_id': self._document_id}},
{'$project': {'_value': '$' + self._path, '_id': False}}
... | [
"def",
"read",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"get_collection",
"(",
")",
".",
"aggregate",
"(",
"[",
"{",
"'$match'",
":",
"{",
"'_id'",
":",
"self",
".",
"_document_id",
"}",
"}",
",",
"{",
"'$project'",
":",
"{",
"'_value'",
... | Read the target value
Use $project aggregate operator in order to support nested objects | [
"Read",
"the",
"target",
"value",
"Use",
"$project",
"aggregate",
"operator",
"in",
"order",
"to",
"support",
"nested",
"objects"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L75-L89 | train | Read the target value of the object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoCellTarget.write | def write(self, value):
"""
Write value to the target
"""
self.get_collection().update_one(
{'_id': self._document_id},
{'$set': {self._path: value}},
upsert=True
) | python | def write(self, value):
"""
Write value to the target
"""
self.get_collection().update_one(
{'_id': self._document_id},
{'$set': {self._path: value}},
upsert=True
) | [
"def",
"write",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"get_collection",
"(",
")",
".",
"update_one",
"(",
"{",
"'_id'",
":",
"self",
".",
"_document_id",
"}",
",",
"{",
"'$set'",
":",
"{",
"self",
".",
"_path",
":",
"value",
"}",
"}",
... | Write value to the target | [
"Write",
"value",
"to",
"the",
"target"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L91-L99 | train | Write value to the target
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoRangeTarget.read | def read(self):
"""
Read the targets value
"""
cursor = self.get_collection().find(
{
'_id': {'$in': self._document_ids},
self._field: {'$exists': True}
},
{self._field: True}
)
return {doc['_id']: doc[s... | python | def read(self):
"""
Read the targets value
"""
cursor = self.get_collection().find(
{
'_id': {'$in': self._document_ids},
self._field: {'$exists': True}
},
{self._field: True}
)
return {doc['_id']: doc[s... | [
"def",
"read",
"(",
"self",
")",
":",
"cursor",
"=",
"self",
".",
"get_collection",
"(",
")",
".",
"find",
"(",
"{",
"'_id'",
":",
"{",
"'$in'",
":",
"self",
".",
"_document_ids",
"}",
",",
"self",
".",
"_field",
":",
"{",
"'$exists'",
":",
"True",... | Read the targets value | [
"Read",
"the",
"targets",
"value"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L125-L137 | train | Read the targets value | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoRangeTarget.write | def write(self, values):
"""
Write values to the targeted documents
Values need to be a dict as : {document_id: value}
"""
# Insert only for docs targeted by the target
filtered = {_id: value for _id, value in values.items() if _id in self._document_ids}
if not f... | python | def write(self, values):
"""
Write values to the targeted documents
Values need to be a dict as : {document_id: value}
"""
# Insert only for docs targeted by the target
filtered = {_id: value for _id, value in values.items() if _id in self._document_ids}
if not f... | [
"def",
"write",
"(",
"self",
",",
"values",
")",
":",
"# Insert only for docs targeted by the target",
"filtered",
"=",
"{",
"_id",
":",
"value",
"for",
"_id",
",",
"value",
"in",
"values",
".",
"items",
"(",
")",
"if",
"_id",
"in",
"self",
".",
"_document... | Write values to the targeted documents
Values need to be a dict as : {document_id: value} | [
"Write",
"values",
"to",
"the",
"targeted",
"documents",
"Values",
"need",
"to",
"be",
"a",
"dict",
"as",
":",
"{",
"document_id",
":",
"value",
"}"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L139-L155 | train | Writes the values to the targeted documents
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/mongodb.py | MongoRangeTarget.get_empty_ids | def get_empty_ids(self):
"""
Get documents id with missing targeted field
"""
cursor = self.get_collection().find(
{
'_id': {'$in': self._document_ids},
self._field: {'$exists': True}
},
{'_id': True}
)
... | python | def get_empty_ids(self):
"""
Get documents id with missing targeted field
"""
cursor = self.get_collection().find(
{
'_id': {'$in': self._document_ids},
self._field: {'$exists': True}
},
{'_id': True}
)
... | [
"def",
"get_empty_ids",
"(",
"self",
")",
":",
"cursor",
"=",
"self",
".",
"get_collection",
"(",
")",
".",
"find",
"(",
"{",
"'_id'",
":",
"{",
"'$in'",
":",
"self",
".",
"_document_ids",
"}",
",",
"self",
".",
"_field",
":",
"{",
"'$exists'",
":",
... | Get documents id with missing targeted field | [
"Get",
"documents",
"id",
"with",
"missing",
"targeted",
"field"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/mongodb.py#L157-L169 | train | Get documents id with missing targeted field
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | BaseLogging._section | def _section(cls, opts):
"""Get logging settings from config file section "logging"."""
if isinstance(cls.config, LuigiConfigParser):
return False
try:
logging_config = cls.config['logging']
except (TypeError, KeyError, NoSectionError):
return False
... | python | def _section(cls, opts):
"""Get logging settings from config file section "logging"."""
if isinstance(cls.config, LuigiConfigParser):
return False
try:
logging_config = cls.config['logging']
except (TypeError, KeyError, NoSectionError):
return False
... | [
"def",
"_section",
"(",
"cls",
",",
"opts",
")",
":",
"if",
"isinstance",
"(",
"cls",
".",
"config",
",",
"LuigiConfigParser",
")",
":",
"return",
"False",
"try",
":",
"logging_config",
"=",
"cls",
".",
"config",
"[",
"'logging'",
"]",
"except",
"(",
"... | Get logging settings from config file section "logging". | [
"Get",
"logging",
"settings",
"from",
"config",
"file",
"section",
"logging",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L40-L49 | train | Get logging settings from config file section logging. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | BaseLogging.setup | def setup(cls,
opts=type('opts', (), {
'background': None,
'logdir': None,
'logging_conf_file': None,
'log_level': 'DEBUG'
})):
"""Setup logging via CLI params and config."""
logger = logging.getLogger('l... | python | def setup(cls,
opts=type('opts', (), {
'background': None,
'logdir': None,
'logging_conf_file': None,
'log_level': 'DEBUG'
})):
"""Setup logging via CLI params and config."""
logger = logging.getLogger('l... | [
"def",
"setup",
"(",
"cls",
",",
"opts",
"=",
"type",
"(",
"'opts'",
",",
"(",
")",
",",
"{",
"'background'",
":",
"None",
",",
"'logdir'",
":",
"None",
",",
"'logging_conf_file'",
":",
"None",
",",
"'log_level'",
":",
"'DEBUG'",
"}",
")",
")",
":",
... | Setup logging via CLI params and config. | [
"Setup",
"logging",
"via",
"CLI",
"params",
"and",
"config",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L52-L93 | train | Setup logging via CLI params and config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | DaemonLogging._cli | def _cli(cls, opts):
"""Setup logging via CLI options
If `--background` -- set INFO level for root logger.
If `--logdir` -- set logging with next params:
default Luigi's formatter,
INFO level,
output in logdir in `luigi-server.log` file
"""
if... | python | def _cli(cls, opts):
"""Setup logging via CLI options
If `--background` -- set INFO level for root logger.
If `--logdir` -- set logging with next params:
default Luigi's formatter,
INFO level,
output in logdir in `luigi-server.log` file
"""
if... | [
"def",
"_cli",
"(",
"cls",
",",
"opts",
")",
":",
"if",
"opts",
".",
"background",
":",
"logging",
".",
"getLogger",
"(",
")",
".",
"setLevel",
"(",
"logging",
".",
"INFO",
")",
"return",
"True",
"if",
"opts",
".",
"logdir",
":",
"logging",
".",
"b... | Setup logging via CLI options
If `--background` -- set INFO level for root logger.
If `--logdir` -- set logging with next params:
default Luigi's formatter,
INFO level,
output in logdir in `luigi-server.log` file | [
"Setup",
"logging",
"via",
"CLI",
"options"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L103-L123 | train | Setup logging via CLI options | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | DaemonLogging._conf | def _conf(cls, opts):
"""Setup logging via ini-file from logging_conf_file option."""
logging_conf = cls.config.get('core', 'logging_conf_file', None)
if logging_conf is None:
return False
if not os.path.exists(logging_conf):
# FileNotFoundError added only in Pyt... | python | def _conf(cls, opts):
"""Setup logging via ini-file from logging_conf_file option."""
logging_conf = cls.config.get('core', 'logging_conf_file', None)
if logging_conf is None:
return False
if not os.path.exists(logging_conf):
# FileNotFoundError added only in Pyt... | [
"def",
"_conf",
"(",
"cls",
",",
"opts",
")",
":",
"logging_conf",
"=",
"cls",
".",
"config",
".",
"get",
"(",
"'core'",
",",
"'logging_conf_file'",
",",
"None",
")",
"if",
"logging_conf",
"is",
"None",
":",
"return",
"False",
"if",
"not",
"os",
".",
... | Setup logging via ini-file from logging_conf_file option. | [
"Setup",
"logging",
"via",
"ini",
"-",
"file",
"from",
"logging_conf_file",
"option",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L126-L138 | train | Setup logging via ini - file from logging_conf_file option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | DaemonLogging._default | def _default(cls, opts):
"""Setup default logger"""
logging.basicConfig(level=logging.INFO, format=cls._log_format)
return True | python | def _default(cls, opts):
"""Setup default logger"""
logging.basicConfig(level=logging.INFO, format=cls._log_format)
return True | [
"def",
"_default",
"(",
"cls",
",",
"opts",
")",
":",
"logging",
".",
"basicConfig",
"(",
"level",
"=",
"logging",
".",
"INFO",
",",
"format",
"=",
"cls",
".",
"_log_format",
")",
"return",
"True"
] | Setup default logger | [
"Setup",
"default",
"logger"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L141-L144 | train | Setup default logger | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | InterfaceLogging._conf | def _conf(cls, opts):
"""Setup logging via ini-file from logging_conf_file option."""
if not opts.logging_conf_file:
return False
if not os.path.exists(opts.logging_conf_file):
# FileNotFoundError added only in Python 3.3
# https://docs.python.org/3/whatsnew/... | python | def _conf(cls, opts):
"""Setup logging via ini-file from logging_conf_file option."""
if not opts.logging_conf_file:
return False
if not os.path.exists(opts.logging_conf_file):
# FileNotFoundError added only in Python 3.3
# https://docs.python.org/3/whatsnew/... | [
"def",
"_conf",
"(",
"cls",
",",
"opts",
")",
":",
"if",
"not",
"opts",
".",
"logging_conf_file",
":",
"return",
"False",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"opts",
".",
"logging_conf_file",
")",
":",
"# FileNotFoundError added only in Pytho... | Setup logging via ini-file from logging_conf_file option. | [
"Setup",
"logging",
"via",
"ini",
"-",
"file",
"from",
"logging_conf_file",
"option",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L157-L168 | train | Setup logging via ini - file from logging_conf_file option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/setup_logging.py | InterfaceLogging._default | def _default(cls, opts):
"""Setup default logger"""
level = getattr(logging, opts.log_level, logging.DEBUG)
logger = logging.getLogger('luigi-interface')
logger.setLevel(level)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(level)
formatter = ... | python | def _default(cls, opts):
"""Setup default logger"""
level = getattr(logging, opts.log_level, logging.DEBUG)
logger = logging.getLogger('luigi-interface')
logger.setLevel(level)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(level)
formatter = ... | [
"def",
"_default",
"(",
"cls",
",",
"opts",
")",
":",
"level",
"=",
"getattr",
"(",
"logging",
",",
"opts",
".",
"log_level",
",",
"logging",
".",
"DEBUG",
")",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"'luigi-interface'",
")",
"logger",
".",
"... | Setup default logger | [
"Setup",
"default",
"logger"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/setup_logging.py#L171-L185 | train | Setup default logger | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/config.py | get_configured_hdfs_client | def get_configured_hdfs_client():
"""
This is a helper that fetches the configuration value for 'client' in
the [hdfs] section. It will return the client that retains backwards
compatibility when 'client' isn't configured.
"""
config = hdfs()
custom = config.client
conf_usinf_snakebite =... | python | def get_configured_hdfs_client():
"""
This is a helper that fetches the configuration value for 'client' in
the [hdfs] section. It will return the client that retains backwards
compatibility when 'client' isn't configured.
"""
config = hdfs()
custom = config.client
conf_usinf_snakebite =... | [
"def",
"get_configured_hdfs_client",
"(",
")",
":",
"config",
"=",
"hdfs",
"(",
")",
"custom",
"=",
"config",
".",
"client",
"conf_usinf_snakebite",
"=",
"[",
"\"snakebite_with_hadoopcli_fallback\"",
",",
"\"snakebite\"",
",",
"]",
"if",
"six",
".",
"PY3",
"and"... | This is a helper that fetches the configuration value for 'client' in
the [hdfs] section. It will return the client that retains backwards
compatibility when 'client' isn't configured. | [
"This",
"is",
"a",
"helper",
"that",
"fetches",
"the",
"configuration",
"value",
"for",
"client",
"in",
"the",
"[",
"hdfs",
"]",
"section",
".",
"It",
"will",
"return",
"the",
"client",
"that",
"retains",
"backwards",
"compatibility",
"when",
"client",
"isn"... | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/config.py#L80-L99 | train | Returns the client that is configured for hadoopcli | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/hdfs/config.py | tmppath | def tmppath(path=None, include_unix_username=True):
"""
@param path: target path for which it is needed to generate temporary location
@type path: str
@type include_unix_username: bool
@rtype: str
Note that include_unix_username might work on windows too.
"""
addon = "luigitemp-%08d" % ... | python | def tmppath(path=None, include_unix_username=True):
"""
@param path: target path for which it is needed to generate temporary location
@type path: str
@type include_unix_username: bool
@rtype: str
Note that include_unix_username might work on windows too.
"""
addon = "luigitemp-%08d" % ... | [
"def",
"tmppath",
"(",
"path",
"=",
"None",
",",
"include_unix_username",
"=",
"True",
")",
":",
"addon",
"=",
"\"luigitemp-%08d\"",
"%",
"random",
".",
"randrange",
"(",
"1e9",
")",
"temp_dir",
"=",
"'/tmp'",
"# default tmp dir if none is specified in config",
"#... | @param path: target path for which it is needed to generate temporary location
@type path: str
@type include_unix_username: bool
@rtype: str
Note that include_unix_username might work on windows too. | [
"@param",
"path",
":",
"target",
"path",
"for",
"which",
"it",
"is",
"needed",
"to",
"generate",
"temporary",
"location",
"@type",
"path",
":",
"str",
"@type",
"include_unix_username",
":",
"bool",
"@rtype",
":",
"str"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/config.py#L102-L144 | train | Generate a temporary path for the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcs.py | _wait_for_consistency | def _wait_for_consistency(checker):
"""Eventual consistency: wait until GCS reports something is true.
This is necessary for e.g. create/delete where the operation might return,
but won't be reflected for a bit.
"""
for _ in xrange(EVENTUAL_CONSISTENCY_MAX_SLEEPS):
if checker():
... | python | def _wait_for_consistency(checker):
"""Eventual consistency: wait until GCS reports something is true.
This is necessary for e.g. create/delete where the operation might return,
but won't be reflected for a bit.
"""
for _ in xrange(EVENTUAL_CONSISTENCY_MAX_SLEEPS):
if checker():
... | [
"def",
"_wait_for_consistency",
"(",
"checker",
")",
":",
"for",
"_",
"in",
"xrange",
"(",
"EVENTUAL_CONSISTENCY_MAX_SLEEPS",
")",
":",
"if",
"checker",
"(",
")",
":",
"return",
"time",
".",
"sleep",
"(",
"EVENTUAL_CONSISTENCY_SLEEP_INTERVAL",
")",
"logger",
"."... | Eventual consistency: wait until GCS reports something is true.
This is necessary for e.g. create/delete where the operation might return,
but won't be reflected for a bit. | [
"Eventual",
"consistency",
":",
"wait",
"until",
"GCS",
"reports",
"something",
"is",
"true",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcs.py#L68-L81 | train | Wait until GCS reports something is true. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcs.py | GCSClient.move | def move(self, source_path, destination_path):
"""
Rename/move an object from one GCS location to another.
"""
self.copy(source_path, destination_path)
self.remove(source_path) | python | def move(self, source_path, destination_path):
"""
Rename/move an object from one GCS location to another.
"""
self.copy(source_path, destination_path)
self.remove(source_path) | [
"def",
"move",
"(",
"self",
",",
"source_path",
",",
"destination_path",
")",
":",
"self",
".",
"copy",
"(",
"source_path",
",",
"destination_path",
")",
"self",
".",
"remove",
"(",
"source_path",
")"
] | Rename/move an object from one GCS location to another. | [
"Rename",
"/",
"move",
"an",
"object",
"from",
"one",
"GCS",
"location",
"to",
"another",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcs.py#L344-L349 | train | Rename an object from one GCS location to another. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcs.py | GCSClient.listdir | def listdir(self, path):
"""
Get an iterable with GCS folder contents.
Iterable contains paths relative to queried path.
"""
bucket, obj = self._path_to_bucket_and_key(path)
obj_prefix = self._add_path_delimiter(obj)
if self._is_root(obj_prefix):
obj_... | python | def listdir(self, path):
"""
Get an iterable with GCS folder contents.
Iterable contains paths relative to queried path.
"""
bucket, obj = self._path_to_bucket_and_key(path)
obj_prefix = self._add_path_delimiter(obj)
if self._is_root(obj_prefix):
obj_... | [
"def",
"listdir",
"(",
"self",
",",
"path",
")",
":",
"bucket",
",",
"obj",
"=",
"self",
".",
"_path_to_bucket_and_key",
"(",
"path",
")",
"obj_prefix",
"=",
"self",
".",
"_add_path_delimiter",
"(",
"obj",
")",
"if",
"self",
".",
"_is_root",
"(",
"obj_pr... | Get an iterable with GCS folder contents.
Iterable contains paths relative to queried path. | [
"Get",
"an",
"iterable",
"with",
"GCS",
"folder",
"contents",
".",
"Iterable",
"contains",
"paths",
"relative",
"to",
"queried",
"path",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcs.py#L351-L364 | train | Get an iterable with GCS folder contents. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcs.py | GCSClient.list_wildcard | def list_wildcard(self, wildcard_path):
"""Yields full object URIs matching the given wildcard.
Currently only the '*' wildcard after the last path delimiter is supported.
(If we need "full" wildcard functionality we should bring in gsutil dependency with its
https://github.com/GoogleC... | python | def list_wildcard(self, wildcard_path):
"""Yields full object URIs matching the given wildcard.
Currently only the '*' wildcard after the last path delimiter is supported.
(If we need "full" wildcard functionality we should bring in gsutil dependency with its
https://github.com/GoogleC... | [
"def",
"list_wildcard",
"(",
"self",
",",
"wildcard_path",
")",
":",
"path",
",",
"wildcard_obj",
"=",
"wildcard_path",
".",
"rsplit",
"(",
"'/'",
",",
"1",
")",
"assert",
"'*'",
"not",
"in",
"path",
",",
"\"The '*' wildcard character is only supported after the l... | Yields full object URIs matching the given wildcard.
Currently only the '*' wildcard after the last path delimiter is supported.
(If we need "full" wildcard functionality we should bring in gsutil dependency with its
https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/wildcard_iter... | [
"Yields",
"full",
"object",
"URIs",
"matching",
"the",
"given",
"wildcard",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcs.py#L366-L382 | train | Yields full object URIs matching the given wildcard. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcs.py | GCSClient.download | def download(self, path, chunksize=None, chunk_callback=lambda _: False):
"""Downloads the object contents to local file system.
Optionally stops after the first chunk for which chunk_callback returns True.
"""
chunksize = chunksize or self.chunksize
bucket, obj = self._path_to_... | python | def download(self, path, chunksize=None, chunk_callback=lambda _: False):
"""Downloads the object contents to local file system.
Optionally stops after the first chunk for which chunk_callback returns True.
"""
chunksize = chunksize or self.chunksize
bucket, obj = self._path_to_... | [
"def",
"download",
"(",
"self",
",",
"path",
",",
"chunksize",
"=",
"None",
",",
"chunk_callback",
"=",
"lambda",
"_",
":",
"False",
")",
":",
"chunksize",
"=",
"chunksize",
"or",
"self",
".",
"chunksize",
"bucket",
",",
"obj",
"=",
"self",
".",
"_path... | Downloads the object contents to local file system.
Optionally stops after the first chunk for which chunk_callback returns True. | [
"Downloads",
"the",
"object",
"contents",
"to",
"local",
"file",
"system",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcs.py#L384-L428 | train | Downloads the contents of the object to local file system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/format.py | InputPipeProcessWrapper.create_subprocess | def create_subprocess(self, command):
"""
http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html
"""
def subprocess_setup():
# Python installs a SIGPIPE handler by default. This is usually not what
# non-Python subprocesses expect... | python | def create_subprocess(self, command):
"""
http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html
"""
def subprocess_setup():
# Python installs a SIGPIPE handler by default. This is usually not what
# non-Python subprocesses expect... | [
"def",
"create_subprocess",
"(",
"self",
",",
"command",
")",
":",
"def",
"subprocess_setup",
"(",
")",
":",
"# Python installs a SIGPIPE handler by default. This is usually not what",
"# non-Python subprocesses expect.",
"signal",
".",
"signal",
"(",
"signal",
".",
"SIGPIP... | http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html | [
"http",
":",
"//",
"www",
".",
"chiark",
".",
"greenend",
".",
"org",
".",
"uk",
"/",
"ucgi",
"/",
"~cjwatson",
"/",
"blosxom",
"/",
"2009",
"-",
"07",
"-",
"02",
"-",
"python",
"-",
"sigpipe",
".",
"html"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/format.py#L93-L107 | train | Create a subprocess for the given command. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/format.py | OutputPipeProcessWrapper._finish | def _finish(self):
"""
Closes and waits for subprocess to exit.
"""
if self._process.returncode is None:
self._process.stdin.flush()
self._process.stdin.close()
self._process.wait()
self.closed = True | python | def _finish(self):
"""
Closes and waits for subprocess to exit.
"""
if self._process.returncode is None:
self._process.stdin.flush()
self._process.stdin.close()
self._process.wait()
self.closed = True | [
"def",
"_finish",
"(",
"self",
")",
":",
"if",
"self",
".",
"_process",
".",
"returncode",
"is",
"None",
":",
"self",
".",
"_process",
".",
"stdin",
".",
"flush",
"(",
")",
"self",
".",
"_process",
".",
"stdin",
".",
"close",
"(",
")",
"self",
".",... | Closes and waits for subprocess to exit. | [
"Closes",
"and",
"waits",
"for",
"subprocess",
"to",
"exit",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/format.py#L197-L205 | train | Closes and waits for subprocess to exit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | check_complete | def check_complete(task, out_queue):
"""
Checks if task is complete, puts the result to out_queue.
"""
logger.debug("Checking if %s is complete", task)
try:
is_complete = task.complete()
except Exception:
is_complete = TracebackWrapper(traceback.format_exc())
out_queue.put((t... | python | def check_complete(task, out_queue):
"""
Checks if task is complete, puts the result to out_queue.
"""
logger.debug("Checking if %s is complete", task)
try:
is_complete = task.complete()
except Exception:
is_complete = TracebackWrapper(traceback.format_exc())
out_queue.put((t... | [
"def",
"check_complete",
"(",
"task",
",",
"out_queue",
")",
":",
"logger",
".",
"debug",
"(",
"\"Checking if %s is complete\"",
",",
"task",
")",
"try",
":",
"is_complete",
"=",
"task",
".",
"complete",
"(",
")",
"except",
"Exception",
":",
"is_complete",
"... | Checks if task is complete, puts the result to out_queue. | [
"Checks",
"if",
"task",
"is",
"complete",
"puts",
"the",
"result",
"to",
"out_queue",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L395-L404 | train | Checks if task is complete puts the result to out_queue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker._add_task | def _add_task(self, *args, **kwargs):
"""
Call ``self._scheduler.add_task``, but store the values too so we can
implement :py:func:`luigi.execution_summary.summary`.
"""
task_id = kwargs['task_id']
status = kwargs['status']
runnable = kwargs['runnable']
ta... | python | def _add_task(self, *args, **kwargs):
"""
Call ``self._scheduler.add_task``, but store the values too so we can
implement :py:func:`luigi.execution_summary.summary`.
"""
task_id = kwargs['task_id']
status = kwargs['status']
runnable = kwargs['runnable']
ta... | [
"def",
"_add_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"task_id",
"=",
"kwargs",
"[",
"'task_id'",
"]",
"status",
"=",
"kwargs",
"[",
"'status'",
"]",
"runnable",
"=",
"kwargs",
"[",
"'runnable'",
"]",
"task",
"=",
"sel... | Call ``self._scheduler.add_task``, but store the values too so we can
implement :py:func:`luigi.execution_summary.summary`. | [
"Call",
"self",
".",
"_scheduler",
".",
"add_task",
"but",
"store",
"the",
"values",
"too",
"so",
"we",
"can",
"implement",
":",
"py",
":",
"func",
":",
"luigi",
".",
"execution_summary",
".",
"summary",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L561-L583 | train | Add a new task to the scheduler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker.add | def add(self, task, multiprocess=False, processes=0):
"""
Add a Task for the worker to check and possibly schedule and run.
Returns True if task and its dependencies were successfully scheduled or completed before.
"""
if self._first_task is None and hasattr(task, 'task_id'):
... | python | def add(self, task, multiprocess=False, processes=0):
"""
Add a Task for the worker to check and possibly schedule and run.
Returns True if task and its dependencies were successfully scheduled or completed before.
"""
if self._first_task is None and hasattr(task, 'task_id'):
... | [
"def",
"add",
"(",
"self",
",",
"task",
",",
"multiprocess",
"=",
"False",
",",
"processes",
"=",
"0",
")",
":",
"if",
"self",
".",
"_first_task",
"is",
"None",
"and",
"hasattr",
"(",
"task",
",",
"'task_id'",
")",
":",
"self",
".",
"_first_task",
"=... | Add a Task for the worker to check and possibly schedule and run.
Returns True if task and its dependencies were successfully scheduled or completed before. | [
"Add",
"a",
"Task",
"for",
"the",
"worker",
"to",
"check",
"and",
"possibly",
"schedule",
"and",
"run",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L725-L769 | train | Adds a Task to the queue and checks if it s successfully scheduled or completed before. Returns True if the task and its dependencies were successfully scheduled or completed before. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker._purge_children | def _purge_children(self):
"""
Find dead children and put a response on the result queue.
:return:
"""
for task_id, p in six.iteritems(self._running_tasks):
if not p.is_alive() and p.exitcode:
error_msg = 'Task {} died unexpectedly with exit code {}'.... | python | def _purge_children(self):
"""
Find dead children and put a response on the result queue.
:return:
"""
for task_id, p in six.iteritems(self._running_tasks):
if not p.is_alive() and p.exitcode:
error_msg = 'Task {} died unexpectedly with exit code {}'.... | [
"def",
"_purge_children",
"(",
"self",
")",
":",
"for",
"task_id",
",",
"p",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_running_tasks",
")",
":",
"if",
"not",
"p",
".",
"is_alive",
"(",
")",
"and",
"p",
".",
"exitcode",
":",
"error_msg",
"=",... | Find dead children and put a response on the result queue.
:return: | [
"Find",
"dead",
"children",
"and",
"put",
"a",
"response",
"on",
"the",
"result",
"queue",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L1021-L1039 | train | Remove dead children from the result queue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker._handle_next_task | def _handle_next_task(self):
"""
We have to catch three ways a task can be "done":
1. normal execution: the task runs/fails and puts a result back on the queue,
2. new dependencies: the task yielded new deps that were not complete and
will be rescheduled and dependencies adde... | python | def _handle_next_task(self):
"""
We have to catch three ways a task can be "done":
1. normal execution: the task runs/fails and puts a result back on the queue,
2. new dependencies: the task yielded new deps that were not complete and
will be rescheduled and dependencies adde... | [
"def",
"_handle_next_task",
"(",
"self",
")",
":",
"self",
".",
"_idle_since",
"=",
"None",
"while",
"True",
":",
"self",
".",
"_purge_children",
"(",
")",
"# Deal with subprocess failures",
"try",
":",
"task_id",
",",
"status",
",",
"expl",
",",
"missing",
... | We have to catch three ways a task can be "done":
1. normal execution: the task runs/fails and puts a result back on the queue,
2. new dependencies: the task yielded new deps that were not complete and
will be rescheduled and dependencies added,
3. child process dies: we need to catc... | [
"We",
"have",
"to",
"catch",
"three",
"ways",
"a",
"task",
"can",
"be",
"done",
":"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L1041-L1109 | train | This method handles the next task in the queue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker._keep_alive | def _keep_alive(self, get_work_response):
"""
Returns true if a worker should stay alive given.
If worker-keep-alive is not set, this will always return false.
For an assistant, it will always return the value of worker-keep-alive.
Otherwise, it will return true for nonzero n_pe... | python | def _keep_alive(self, get_work_response):
"""
Returns true if a worker should stay alive given.
If worker-keep-alive is not set, this will always return false.
For an assistant, it will always return the value of worker-keep-alive.
Otherwise, it will return true for nonzero n_pe... | [
"def",
"_keep_alive",
"(",
"self",
",",
"get_work_response",
")",
":",
"if",
"not",
"self",
".",
"_config",
".",
"keep_alive",
":",
"return",
"False",
"elif",
"self",
".",
"_assistant",
":",
"return",
"True",
"elif",
"self",
".",
"_config",
".",
"count_las... | Returns true if a worker should stay alive given.
If worker-keep-alive is not set, this will always return false.
For an assistant, it will always return the value of worker-keep-alive.
Otherwise, it will return true for nonzero n_pending_tasks.
If worker-count-uniques is true, it will... | [
"Returns",
"true",
"if",
"a",
"worker",
"should",
"stay",
"alive",
"given",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L1120-L1148 | train | Returns True if a worker should stay alive given. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/worker.py | Worker.run | def run(self):
"""
Returns True if all scheduled tasks were executed successfully.
"""
logger.info('Running Worker with %d processes', self.worker_processes)
sleeper = self._sleeper()
self.run_succeeded = True
self._add_worker()
while True:
... | python | def run(self):
"""
Returns True if all scheduled tasks were executed successfully.
"""
logger.info('Running Worker with %d processes', self.worker_processes)
sleeper = self._sleeper()
self.run_succeeded = True
self._add_worker()
while True:
... | [
"def",
"run",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'Running Worker with %d processes'",
",",
"self",
".",
"worker_processes",
")",
"sleeper",
"=",
"self",
".",
"_sleeper",
"(",
")",
"self",
".",
"run_succeeded",
"=",
"True",
"self",
".",
"_a... | Returns True if all scheduled tasks were executed successfully. | [
"Returns",
"True",
"if",
"all",
"scheduled",
"tasks",
"were",
"executed",
"successfully",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/worker.py#L1165-L1208 | train | This method runs the worker process. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/db_task_history.py | _upgrade_schema | def _upgrade_schema(engine):
"""
Ensure the database schema is up to date with the codebase.
:param engine: SQLAlchemy engine of the underlying database.
"""
inspector = reflection.Inspector.from_engine(engine)
with engine.connect() as conn:
# Upgrade 1. Add task_id column and index t... | python | def _upgrade_schema(engine):
"""
Ensure the database schema is up to date with the codebase.
:param engine: SQLAlchemy engine of the underlying database.
"""
inspector = reflection.Inspector.from_engine(engine)
with engine.connect() as conn:
# Upgrade 1. Add task_id column and index t... | [
"def",
"_upgrade_schema",
"(",
"engine",
")",
":",
"inspector",
"=",
"reflection",
".",
"Inspector",
".",
"from_engine",
"(",
"engine",
")",
"with",
"engine",
".",
"connect",
"(",
")",
"as",
"conn",
":",
"# Upgrade 1. Add task_id column and index to tasks",
"if",... | Ensure the database schema is up to date with the codebase.
:param engine: SQLAlchemy engine of the underlying database. | [
"Ensure",
"the",
"database",
"schema",
"is",
"up",
"to",
"date",
"with",
"the",
"codebase",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/db_task_history.py#L243-L283 | train | Ensure the database schema is up to date with the codebase. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/db_task_history.py | DbTaskHistory.find_all_by_parameters | def find_all_by_parameters(self, task_name, session=None, **task_params):
"""
Find tasks with the given task_name and the same parameters as the kwargs.
"""
with self._session(session) as session:
query = session.query(TaskRecord).join(TaskEvent).filter(TaskRecord.name == tas... | python | def find_all_by_parameters(self, task_name, session=None, **task_params):
"""
Find tasks with the given task_name and the same parameters as the kwargs.
"""
with self._session(session) as session:
query = session.query(TaskRecord).join(TaskEvent).filter(TaskRecord.name == tas... | [
"def",
"find_all_by_parameters",
"(",
"self",
",",
"task_name",
",",
"session",
"=",
"None",
",",
"*",
"*",
"task_params",
")",
":",
"with",
"self",
".",
"_session",
"(",
"session",
")",
"as",
"session",
":",
"query",
"=",
"session",
".",
"query",
"(",
... | Find tasks with the given task_name and the same parameters as the kwargs. | [
"Find",
"tasks",
"with",
"the",
"given",
"task_name",
"and",
"the",
"same",
"parameters",
"as",
"the",
"kwargs",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/db_task_history.py#L134-L149 | train | Find all tasks with the given name and the same parameters as the kwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/db_task_history.py | DbTaskHistory.find_all_runs | def find_all_runs(self, session=None):
"""
Return all tasks that have been updated.
"""
with self._session(session) as session:
return session.query(TaskRecord).all() | python | def find_all_runs(self, session=None):
"""
Return all tasks that have been updated.
"""
with self._session(session) as session:
return session.query(TaskRecord).all() | [
"def",
"find_all_runs",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"with",
"self",
".",
"_session",
"(",
"session",
")",
"as",
"session",
":",
"return",
"session",
".",
"query",
"(",
"TaskRecord",
")",
".",
"all",
"(",
")"
] | Return all tasks that have been updated. | [
"Return",
"all",
"tasks",
"that",
"have",
"been",
"updated",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/db_task_history.py#L170-L175 | train | Return all tasks that have been updated. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/db_task_history.py | DbTaskHistory.find_all_events | def find_all_events(self, session=None):
"""
Return all running/failed/done events.
"""
with self._session(session) as session:
return session.query(TaskEvent).all() | python | def find_all_events(self, session=None):
"""
Return all running/failed/done events.
"""
with self._session(session) as session:
return session.query(TaskEvent).all() | [
"def",
"find_all_events",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"with",
"self",
".",
"_session",
"(",
"session",
")",
"as",
"session",
":",
"return",
"session",
".",
"query",
"(",
"TaskEvent",
")",
".",
"all",
"(",
")"
] | Return all running/failed/done events. | [
"Return",
"all",
"running",
"/",
"failed",
"/",
"done",
"events",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/db_task_history.py#L177-L182 | train | Return all running or failed events. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/db_task_history.py | DbTaskHistory.find_task_by_id | def find_task_by_id(self, id, session=None):
"""
Find task with the given record ID.
"""
with self._session(session) as session:
return session.query(TaskRecord).get(id) | python | def find_task_by_id(self, id, session=None):
"""
Find task with the given record ID.
"""
with self._session(session) as session:
return session.query(TaskRecord).get(id) | [
"def",
"find_task_by_id",
"(",
"self",
",",
"id",
",",
"session",
"=",
"None",
")",
":",
"with",
"self",
".",
"_session",
"(",
"session",
")",
"as",
"session",
":",
"return",
"session",
".",
"query",
"(",
"TaskRecord",
")",
".",
"get",
"(",
"id",
")"... | Find task with the given record ID. | [
"Find",
"task",
"with",
"the",
"given",
"record",
"ID",
"."
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/db_task_history.py#L184-L189 | train | Find task with the given record ID. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
spotify/luigi | luigi/contrib/gcp.py | get_authenticate_kwargs | def get_authenticate_kwargs(oauth_credentials=None, http_=None):
"""Returns a dictionary with keyword arguments for use with discovery
Prioritizes oauth_credentials or a http client provided by the user
If none provided, falls back to default credentials provided by google's command line
utilities. If ... | python | def get_authenticate_kwargs(oauth_credentials=None, http_=None):
"""Returns a dictionary with keyword arguments for use with discovery
Prioritizes oauth_credentials or a http client provided by the user
If none provided, falls back to default credentials provided by google's command line
utilities. If ... | [
"def",
"get_authenticate_kwargs",
"(",
"oauth_credentials",
"=",
"None",
",",
"http_",
"=",
"None",
")",
":",
"if",
"oauth_credentials",
":",
"authenticate_kwargs",
"=",
"{",
"\"credentials\"",
":",
"oauth_credentials",
"}",
"elif",
"http_",
":",
"authenticate_kwarg... | Returns a dictionary with keyword arguments for use with discovery
Prioritizes oauth_credentials or a http client provided by the user
If none provided, falls back to default credentials provided by google's command line
utilities. If that also fails, tries using httplib2.Http()
Used by `gcs.GCSClient... | [
"Returns",
"a",
"dictionary",
"with",
"keyword",
"arguments",
"for",
"use",
"with",
"discovery"
] | c5eca1c3c3ee2a7eb612486192a0da146710a1e9 | https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/gcp.py#L15-L46 | train | Returns a dictionary with keyword arguments for use with discovery
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.