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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dnanexus/dx-toolkit | src/python/dxpy/bindings/download_all_inputs.py | _create_dirs | def _create_dirs(idir, dirs):
'''
Create a set of directories, so we could store the input files.
For example, seq1 could be stored under:
/in/seq1/NC_001122.fasta
TODO: this call could fail, we need to report a reasonable error code
Note that we create a directory for every file array, ev... | python | def _create_dirs(idir, dirs):
'''
Create a set of directories, so we could store the input files.
For example, seq1 could be stored under:
/in/seq1/NC_001122.fasta
TODO: this call could fail, we need to report a reasonable error code
Note that we create a directory for every file array, ev... | [
"def",
"_create_dirs",
"(",
"idir",
",",
"dirs",
")",
":",
"# create the <idir> itself",
"file_load_utils",
".",
"ensure_dir",
"(",
"idir",
")",
"# create each subdir",
"for",
"d",
"in",
"dirs",
":",
"file_load_utils",
".",
"ensure_dir",
"(",
"os",
".",
"path",
... | Create a set of directories, so we could store the input files.
For example, seq1 could be stored under:
/in/seq1/NC_001122.fasta
TODO: this call could fail, we need to report a reasonable error code
Note that we create a directory for every file array, even if
it has zero inputs. | [
"Create",
"a",
"set",
"of",
"directories",
"so",
"we",
"could",
"store",
"the",
"input",
"files",
".",
"For",
"example",
"seq1",
"could",
"be",
"stored",
"under",
":",
"/",
"in",
"/",
"seq1",
"/",
"NC_001122",
".",
"fasta"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/download_all_inputs.py#L27-L42 | train | Create a set of directories that can be used to store the input files. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/download_all_inputs.py | _gen_helper_dict | def _gen_helper_dict(filtered_inputs):
'''
Create a dict of values for the downloaded files. This is similar to the variables created
when running a bash app.
'''
file_key_descs, _ignore = file_load_utils.analyze_bash_vars(
file_load_utils.get_input_json_file(), None)
flattened_dict = ... | python | def _gen_helper_dict(filtered_inputs):
'''
Create a dict of values for the downloaded files. This is similar to the variables created
when running a bash app.
'''
file_key_descs, _ignore = file_load_utils.analyze_bash_vars(
file_load_utils.get_input_json_file(), None)
flattened_dict = ... | [
"def",
"_gen_helper_dict",
"(",
"filtered_inputs",
")",
":",
"file_key_descs",
",",
"_ignore",
"=",
"file_load_utils",
".",
"analyze_bash_vars",
"(",
"file_load_utils",
".",
"get_input_json_file",
"(",
")",
",",
"None",
")",
"flattened_dict",
"=",
"{",
"}",
"def",... | Create a dict of values for the downloaded files. This is similar to the variables created
when running a bash app. | [
"Create",
"a",
"dict",
"of",
"values",
"for",
"the",
"downloaded",
"files",
".",
"This",
"is",
"similar",
"to",
"the",
"variables",
"created",
"when",
"running",
"a",
"bash",
"app",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/download_all_inputs.py#L82-L105 | train | Generate a dict of values for the downloaded files. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/download_all_inputs.py | _get_num_parallel_threads | def _get_num_parallel_threads(max_threads, num_cores, mem_available_mb):
'''
Ensure at least ~1.2 GB memory per thread, see PTFM-18767
'''
return min(max_threads, num_cores, max(int(mem_available_mb/1200), 1)) | python | def _get_num_parallel_threads(max_threads, num_cores, mem_available_mb):
'''
Ensure at least ~1.2 GB memory per thread, see PTFM-18767
'''
return min(max_threads, num_cores, max(int(mem_available_mb/1200), 1)) | [
"def",
"_get_num_parallel_threads",
"(",
"max_threads",
",",
"num_cores",
",",
"mem_available_mb",
")",
":",
"return",
"min",
"(",
"max_threads",
",",
"num_cores",
",",
"max",
"(",
"int",
"(",
"mem_available_mb",
"/",
"1200",
")",
",",
"1",
")",
")"
] | Ensure at least ~1.2 GB memory per thread, see PTFM-18767 | [
"Ensure",
"at",
"least",
"~1",
".",
"2",
"GB",
"memory",
"per",
"thread",
"see",
"PTFM",
"-",
"18767"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/download_all_inputs.py#L108-L112 | train | Get the number of threads that can be used in parallel. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/printing.py | refill_paragraphs | def refill_paragraphs(string, ignored_prefix=' '):
"""Refills the given text, where the text is composed of paragraphs
separated by blank lines (i.e. '\n\n'). Lines that begin with
ignored_prefix are not touched; this can be used to keep indented
code snippets from being incorrectly reformatted.
... | python | def refill_paragraphs(string, ignored_prefix=' '):
"""Refills the given text, where the text is composed of paragraphs
separated by blank lines (i.e. '\n\n'). Lines that begin with
ignored_prefix are not touched; this can be used to keep indented
code snippets from being incorrectly reformatted.
... | [
"def",
"refill_paragraphs",
"(",
"string",
",",
"ignored_prefix",
"=",
"' '",
")",
":",
"paragraphs",
"=",
"string",
".",
"split",
"(",
"'\\n\\n'",
")",
"refilled_paragraphs",
"=",
"[",
"fill",
"(",
"paragraph",
")",
"if",
"not",
"paragraph",
".",
"starts... | Refills the given text, where the text is composed of paragraphs
separated by blank lines (i.e. '\n\n'). Lines that begin with
ignored_prefix are not touched; this can be used to keep indented
code snippets from being incorrectly reformatted. | [
"Refills",
"the",
"given",
"text",
"where",
"the",
"text",
"is",
"composed",
"of",
"paragraphs",
"separated",
"by",
"blank",
"lines",
"(",
"i",
".",
"e",
".",
"\\",
"n",
"\\",
"n",
")",
".",
"Lines",
"that",
"begin",
"with",
"ignored_prefix",
"are",
"n... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/printing.py#L178-L187 | train | Refills the given text where the text is composed of paragraphs
separated by blank lines. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/printing.py | format_find_results | def format_find_results(args, results):
"""
Formats the output of ``dx find ...`` commands for `--json` and `--brief` arguments; also formats if no formatting
arguments are given.
Currently used for ``dx find projects``, ``dx find org_projects``, ``dx find org_apps``,
and ``dx find org_members``
... | python | def format_find_results(args, results):
"""
Formats the output of ``dx find ...`` commands for `--json` and `--brief` arguments; also formats if no formatting
arguments are given.
Currently used for ``dx find projects``, ``dx find org_projects``, ``dx find org_apps``,
and ``dx find org_members``
... | [
"def",
"format_find_results",
"(",
"args",
",",
"results",
")",
":",
"if",
"args",
".",
"json",
":",
"print",
"(",
"json",
".",
"dumps",
"(",
"list",
"(",
"results",
")",
",",
"indent",
"=",
"4",
")",
")",
"elif",
"args",
".",
"brief",
":",
"for",
... | Formats the output of ``dx find ...`` commands for `--json` and `--brief` arguments; also formats if no formatting
arguments are given.
Currently used for ``dx find projects``, ``dx find org_projects``, ``dx find org_apps``,
and ``dx find org_members`` | [
"Formats",
"the",
"output",
"of",
"dx",
"find",
"...",
"commands",
"for",
"--",
"json",
"and",
"--",
"brief",
"arguments",
";",
"also",
"formats",
"if",
"no",
"formatting",
"arguments",
"are",
"given",
".",
"Currently",
"used",
"for",
"dx",
"find",
"projec... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/printing.py#L215-L233 | train | Formats the output of dx find... commands for args. json and args. brief arguments. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | doc/examples/dx-apps/report_example/src/report_example.py | main | def main(**kwargs):
"""
Draw a couple of simple graphs and optionally generate an HTML file to upload them
"""
draw_lines()
draw_histogram()
draw_bar_chart()
destination = "-r /report"
if use_html:
generate_html()
command = "dx-build-report-html {h} {d}".format(h=html_fil... | python | def main(**kwargs):
"""
Draw a couple of simple graphs and optionally generate an HTML file to upload them
"""
draw_lines()
draw_histogram()
draw_bar_chart()
destination = "-r /report"
if use_html:
generate_html()
command = "dx-build-report-html {h} {d}".format(h=html_fil... | [
"def",
"main",
"(",
"*",
"*",
"kwargs",
")",
":",
"draw_lines",
"(",
")",
"draw_histogram",
"(",
")",
"draw_bar_chart",
"(",
")",
"destination",
"=",
"\"-r /report\"",
"if",
"use_html",
":",
"generate_html",
"(",
")",
"command",
"=",
"\"dx-build-report-html {h... | Draw a couple of simple graphs and optionally generate an HTML file to upload them | [
"Draw",
"a",
"couple",
"of",
"simple",
"graphs",
"and",
"optionally",
"generate",
"an",
"HTML",
"file",
"to",
"upload",
"them"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/doc/examples/dx-apps/report_example/src/report_example.py#L37-L53 | train | Generates a couple of simple graphs and optionally generates an HTML file to upload them | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | doc/examples/dx-apps/report_example/src/report_example.py | draw_histogram | def draw_histogram():
"""
Uses sample code from http://matplotlib.org/1.2.1/examples/api/histogram_demo.html
"""
mu, sigma = 100, 15
x = mu + sigma * numpy.random.randn(10000)
fig = pyplot.figure()
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(x, 50, normed=1, facecolor='green', ... | python | def draw_histogram():
"""
Uses sample code from http://matplotlib.org/1.2.1/examples/api/histogram_demo.html
"""
mu, sigma = 100, 15
x = mu + sigma * numpy.random.randn(10000)
fig = pyplot.figure()
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(x, 50, normed=1, facecolor='green', ... | [
"def",
"draw_histogram",
"(",
")",
":",
"mu",
",",
"sigma",
"=",
"100",
",",
"15",
"x",
"=",
"mu",
"+",
"sigma",
"*",
"numpy",
".",
"random",
".",
"randn",
"(",
"10000",
")",
"fig",
"=",
"pyplot",
".",
"figure",
"(",
")",
"ax",
"=",
"fig",
".",... | Uses sample code from http://matplotlib.org/1.2.1/examples/api/histogram_demo.html | [
"Uses",
"sample",
"code",
"from",
"http",
":",
"//",
"matplotlib",
".",
"org",
"/",
"1",
".",
"2",
".",
"1",
"/",
"examples",
"/",
"api",
"/",
"histogram_demo",
".",
"html"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/doc/examples/dx-apps/report_example/src/report_example.py#L56-L73 | train | Draws a histogram of random numbers. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | doc/examples/dx-apps/report_example/src/report_example.py | draw_bar_chart | def draw_bar_chart():
"""
Uses sample code from http://matplotlib.org/1.2.1/examples/api/barchart_demo.html
"""
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = numpy.arange(N)
width = 0.35
fig = pyplot.figure()
ax = fig.add_subplot(111)
rects1 = ax.bar(... | python | def draw_bar_chart():
"""
Uses sample code from http://matplotlib.org/1.2.1/examples/api/barchart_demo.html
"""
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = numpy.arange(N)
width = 0.35
fig = pyplot.figure()
ax = fig.add_subplot(111)
rects1 = ax.bar(... | [
"def",
"draw_bar_chart",
"(",
")",
":",
"N",
"=",
"5",
"menMeans",
"=",
"(",
"20",
",",
"35",
",",
"30",
",",
"35",
",",
"27",
")",
"menStd",
"=",
"(",
"2",
",",
"3",
",",
"4",
",",
"1",
",",
"2",
")",
"ind",
"=",
"numpy",
".",
"arange",
... | Uses sample code from http://matplotlib.org/1.2.1/examples/api/barchart_demo.html | [
"Uses",
"sample",
"code",
"from",
"http",
":",
"//",
"matplotlib",
".",
"org",
"/",
"1",
".",
"2",
".",
"1",
"/",
"examples",
"/",
"api",
"/",
"barchart_demo",
".",
"html"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/doc/examples/dx-apps/report_example/src/report_example.py#L76-L110 | train | Draws a bar chart for the next N elements. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | doc/examples/dx-apps/report_example/src/report_example.py | draw_lines | def draw_lines():
"""
Draws a line between a set of random values
"""
r = numpy.random.randn(200)
fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.plot(r)
ax.grid(True)
pyplot.savefig(lines_filename) | python | def draw_lines():
"""
Draws a line between a set of random values
"""
r = numpy.random.randn(200)
fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.plot(r)
ax.grid(True)
pyplot.savefig(lines_filename) | [
"def",
"draw_lines",
"(",
")",
":",
"r",
"=",
"numpy",
".",
"random",
".",
"randn",
"(",
"200",
")",
"fig",
"=",
"pyplot",
".",
"figure",
"(",
")",
"ax",
"=",
"fig",
".",
"add_subplot",
"(",
"111",
")",
"ax",
".",
"plot",
"(",
"r",
")",
"ax",
... | Draws a line between a set of random values | [
"Draws",
"a",
"line",
"between",
"a",
"set",
"of",
"random",
"values"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/doc/examples/dx-apps/report_example/src/report_example.py#L113-L124 | train | Draw a line between a set of random values
| GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | doc/examples/dx-apps/report_example/src/report_example.py | generate_html | def generate_html():
"""
Generate an HTML file incorporating the images produced by this script
"""
html_file = open(html_filename, "w")
html_file.write("<html><body>")
html_file.write("<h1>Here are some graphs for you!</h1>")
for image in [lines_filename, bars_filename, histogram_filename]:... | python | def generate_html():
"""
Generate an HTML file incorporating the images produced by this script
"""
html_file = open(html_filename, "w")
html_file.write("<html><body>")
html_file.write("<h1>Here are some graphs for you!</h1>")
for image in [lines_filename, bars_filename, histogram_filename]:... | [
"def",
"generate_html",
"(",
")",
":",
"html_file",
"=",
"open",
"(",
"html_filename",
",",
"\"w\"",
")",
"html_file",
".",
"write",
"(",
"\"<html><body>\"",
")",
"html_file",
".",
"write",
"(",
"\"<h1>Here are some graphs for you!</h1>\"",
")",
"for",
"image",
... | Generate an HTML file incorporating the images produced by this script | [
"Generate",
"an",
"HTML",
"file",
"incorporating",
"the",
"images",
"produced",
"by",
"this",
"script"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/doc/examples/dx-apps/report_example/src/report_example.py#L127-L137 | train | Generate an HTML file incorporating the images produced by this script
| GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_app_wizard.py | main | def main(**kwargs):
"""
Entry point for dx-app-wizard.
Note that this function is not meant to be used as a subroutine in your program.
"""
manifest = []
print_intro(API_VERSION)
if args.json_file is not None:
with open(args.json_file, 'r') as json_file:
app_json = json... | python | def main(**kwargs):
"""
Entry point for dx-app-wizard.
Note that this function is not meant to be used as a subroutine in your program.
"""
manifest = []
print_intro(API_VERSION)
if args.json_file is not None:
with open(args.json_file, 'r') as json_file:
app_json = json... | [
"def",
"main",
"(",
"*",
"*",
"kwargs",
")",
":",
"manifest",
"=",
"[",
"]",
"print_intro",
"(",
"API_VERSION",
")",
"if",
"args",
".",
"json_file",
"is",
"not",
"None",
":",
"with",
"open",
"(",
"args",
".",
"json_file",
",",
"'r'",
")",
"as",
"js... | Entry point for dx-app-wizard.
Note that this function is not meant to be used as a subroutine in your program. | [
"Entry",
"point",
"for",
"dx",
"-",
"app",
"-",
"wizard",
".",
"Note",
"that",
"this",
"function",
"is",
"not",
"meant",
"to",
"be",
"used",
"as",
"a",
"subroutine",
"in",
"your",
"program",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_app_wizard.py#L60-L451 | train | Entry point for dx - app - wizard. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/exec_utils.py | _safe_unicode | def _safe_unicode(o):
"""
Returns an equivalent unicode object, trying harder to avoid
dependencies on the Python default encoding.
"""
def clean(s):
return u''.join([c if c in ASCII_PRINTABLE else '?' for c in s])
if USING_PYTHON2:
try:
return unicode(o)
exce... | python | def _safe_unicode(o):
"""
Returns an equivalent unicode object, trying harder to avoid
dependencies on the Python default encoding.
"""
def clean(s):
return u''.join([c if c in ASCII_PRINTABLE else '?' for c in s])
if USING_PYTHON2:
try:
return unicode(o)
exce... | [
"def",
"_safe_unicode",
"(",
"o",
")",
":",
"def",
"clean",
"(",
"s",
")",
":",
"return",
"u''",
".",
"join",
"(",
"[",
"c",
"if",
"c",
"in",
"ASCII_PRINTABLE",
"else",
"'?'",
"for",
"c",
"in",
"s",
"]",
")",
"if",
"USING_PYTHON2",
":",
"try",
":... | Returns an equivalent unicode object, trying harder to avoid
dependencies on the Python default encoding. | [
"Returns",
"an",
"equivalent",
"unicode",
"object",
"trying",
"harder",
"to",
"avoid",
"dependencies",
"on",
"the",
"Python",
"default",
"encoding",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/exec_utils.py#L38-L58 | train | Returns an equivalent unicode object for the given object. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/exec_utils.py | _format_exception_message | def _format_exception_message(e):
"""
Formats the specified exception.
"""
# Prevent duplication of "AppError" in places that print "AppError"
# and then this formatted string
if isinstance(e, dxpy.AppError):
return _safe_unicode(e)
if USING_PYTHON2:
return unicode(e.__class_... | python | def _format_exception_message(e):
"""
Formats the specified exception.
"""
# Prevent duplication of "AppError" in places that print "AppError"
# and then this formatted string
if isinstance(e, dxpy.AppError):
return _safe_unicode(e)
if USING_PYTHON2:
return unicode(e.__class_... | [
"def",
"_format_exception_message",
"(",
"e",
")",
":",
"# Prevent duplication of \"AppError\" in places that print \"AppError\"",
"# and then this formatted string",
"if",
"isinstance",
"(",
"e",
",",
"dxpy",
".",
"AppError",
")",
":",
"return",
"_safe_unicode",
"(",
"e",
... | Formats the specified exception. | [
"Formats",
"the",
"specified",
"exception",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/exec_utils.py#L60-L71 | train | Formats the specified exception into a string that can be used in the log file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/exec_utils.py | run | def run(function_name=None, function_input=None):
"""Triggers the execution environment entry point processor.
Use this function in the program entry point code:
.. code-block:: python
import dxpy
@dxpy.entry_point('main')
def hello(i):
pass
dxpy.run()
This m... | python | def run(function_name=None, function_input=None):
"""Triggers the execution environment entry point processor.
Use this function in the program entry point code:
.. code-block:: python
import dxpy
@dxpy.entry_point('main')
def hello(i):
pass
dxpy.run()
This m... | [
"def",
"run",
"(",
"function_name",
"=",
"None",
",",
"function_input",
"=",
"None",
")",
":",
"global",
"RUN_COUNT",
"RUN_COUNT",
"+=",
"1",
"dx_working_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"if",
"dxpy",
".",
"JOB_ID",
"is",
"not",
"None",
":",
"... | Triggers the execution environment entry point processor.
Use this function in the program entry point code:
.. code-block:: python
import dxpy
@dxpy.entry_point('main')
def hello(i):
pass
dxpy.run()
This method may be used to invoke the program either in a produ... | [
"Triggers",
"the",
"execution",
"environment",
"entry",
"point",
"processor",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/exec_utils.py#L74-L171 | train | This function is called by the DXJob API server to execute the function specified in function_name and function_input. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/exec_utils.py | entry_point | def entry_point(entry_point_name):
"""Use this to decorate a DNAnexus execution environment entry point.
Example:
.. code-block:: python
@dxpy.entry_point('main')
def hello(i):
pass
"""
def wrap(f):
ENTRY_POINT_TABLE[entry_point_name] = f
@wraps(f)
... | python | def entry_point(entry_point_name):
"""Use this to decorate a DNAnexus execution environment entry point.
Example:
.. code-block:: python
@dxpy.entry_point('main')
def hello(i):
pass
"""
def wrap(f):
ENTRY_POINT_TABLE[entry_point_name] = f
@wraps(f)
... | [
"def",
"entry_point",
"(",
"entry_point_name",
")",
":",
"def",
"wrap",
"(",
"f",
")",
":",
"ENTRY_POINT_TABLE",
"[",
"entry_point_name",
"]",
"=",
"f",
"@",
"wraps",
"(",
"f",
")",
"def",
"wrapped_f",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
... | Use this to decorate a DNAnexus execution environment entry point.
Example:
.. code-block:: python
@dxpy.entry_point('main')
def hello(i):
pass | [
"Use",
"this",
"to",
"decorate",
"a",
"DNAnexus",
"execution",
"environment",
"entry",
"point",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/exec_utils.py#L240-L258 | train | Use this to decorate a DNAnexus execution environment entry point. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/cli/workflow.py | get_workflow_id_and_project | def get_workflow_id_and_project(path):
'''
:param path: a path or ID to a workflow object
:type path: string
:returns: tuple of (workflow ID, project ID)
Returns the workflow and project IDs from the given path if
available; otherwise, exits with an appropriate error message.
'''
projec... | python | def get_workflow_id_and_project(path):
'''
:param path: a path or ID to a workflow object
:type path: string
:returns: tuple of (workflow ID, project ID)
Returns the workflow and project IDs from the given path if
available; otherwise, exits with an appropriate error message.
'''
projec... | [
"def",
"get_workflow_id_and_project",
"(",
"path",
")",
":",
"project",
",",
"_folderpath",
",",
"entity_result",
"=",
"try_call",
"(",
"resolve_existing_path",
",",
"path",
",",
"expected",
"=",
"'entity'",
")",
"try",
":",
"if",
"entity_result",
"is",
"None",
... | :param path: a path or ID to a workflow object
:type path: string
:returns: tuple of (workflow ID, project ID)
Returns the workflow and project IDs from the given path if
available; otherwise, exits with an appropriate error message. | [
":",
"param",
"path",
":",
"a",
"path",
"or",
"ID",
"to",
"a",
"workflow",
"object",
":",
"type",
"path",
":",
"string",
":",
"returns",
":",
"tuple",
"of",
"(",
"workflow",
"ID",
"project",
"ID",
")"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/cli/workflow.py#L76-L91 | train | Get the workflow ID and project ID from a given path. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/auth.py | user_info | def user_info(authserver_host=None, authserver_port=None):
"""Returns the result of the user_info call against the specified auth
server.
.. deprecated:: 0.108.0
Use :func:`whoami` instead where possible.
"""
authserver = get_auth_server_name(authserver_host, authserver_port)
return DXH... | python | def user_info(authserver_host=None, authserver_port=None):
"""Returns the result of the user_info call against the specified auth
server.
.. deprecated:: 0.108.0
Use :func:`whoami` instead where possible.
"""
authserver = get_auth_server_name(authserver_host, authserver_port)
return DXH... | [
"def",
"user_info",
"(",
"authserver_host",
"=",
"None",
",",
"authserver_port",
"=",
"None",
")",
":",
"authserver",
"=",
"get_auth_server_name",
"(",
"authserver_host",
",",
"authserver_port",
")",
"return",
"DXHTTPRequest",
"(",
"authserver",
"+",
"\"/system/getU... | Returns the result of the user_info call against the specified auth
server.
.. deprecated:: 0.108.0
Use :func:`whoami` instead where possible. | [
"Returns",
"the",
"result",
"of",
"the",
"user_info",
"call",
"against",
"the",
"specified",
"auth",
"server",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/auth.py#L23-L32 | train | Returns the result of the user_info call against the specified auth
server. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | get_input_dir | def get_input_dir(job_homedir=None):
'''
:param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to input directory
Returns the input directory, where all inputs are downloaded
'''
if job_homedir is not None:
home_dir = job_home... | python | def get_input_dir(job_homedir=None):
'''
:param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to input directory
Returns the input directory, where all inputs are downloaded
'''
if job_homedir is not None:
home_dir = job_home... | [
"def",
"get_input_dir",
"(",
"job_homedir",
"=",
"None",
")",
":",
"if",
"job_homedir",
"is",
"not",
"None",
":",
"home_dir",
"=",
"job_homedir",
"else",
":",
"home_dir",
"=",
"environ",
".",
"get",
"(",
"'HOME'",
")",
"idir",
"=",
"os",
".",
"path",
"... | :param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to input directory
Returns the input directory, where all inputs are downloaded | [
":",
"param",
"job_homedir",
":",
"explicit",
"value",
"for",
"home",
"directory",
"used",
"for",
"testing",
"purposes",
":",
"rtype",
":",
"string",
":",
"returns",
":",
"path",
"to",
"input",
"directory"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L98-L111 | train | Returns the input directory for the current node. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | get_output_dir | def get_output_dir(job_homedir=None):
'''
:param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to output directory
Returns the output directory, where all outputs are created, and
uploaded from
'''
if job_homedir is not None:
... | python | def get_output_dir(job_homedir=None):
'''
:param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to output directory
Returns the output directory, where all outputs are created, and
uploaded from
'''
if job_homedir is not None:
... | [
"def",
"get_output_dir",
"(",
"job_homedir",
"=",
"None",
")",
":",
"if",
"job_homedir",
"is",
"not",
"None",
":",
"home_dir",
"=",
"job_homedir",
"else",
":",
"home_dir",
"=",
"environ",
".",
"get",
"(",
"'HOME'",
")",
"odir",
"=",
"os",
".",
"path",
... | :param job_homedir: explicit value for home directory, used for testing purposes
:rtype: string
:returns: path to output directory
Returns the output directory, where all outputs are created, and
uploaded from | [
":",
"param",
"job_homedir",
":",
"explicit",
"value",
"for",
"home",
"directory",
"used",
"for",
"testing",
"purposes",
":",
"rtype",
":",
"string",
":",
"returns",
":",
"path",
"to",
"output",
"directory"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L114-L128 | train | Returns the output directory where all outputs are created and uploaded from the base directory. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | rm_output_json_file | def rm_output_json_file():
""" Warning: this is not for casual use.
It erases the output json file, and should be used for testing purposes only.
"""
path = get_output_json_file()
try:
os.remove(path)
except OSError as e:
if e.errno == errno.ENOENT:
pass
else:... | python | def rm_output_json_file():
""" Warning: this is not for casual use.
It erases the output json file, and should be used for testing purposes only.
"""
path = get_output_json_file()
try:
os.remove(path)
except OSError as e:
if e.errno == errno.ENOENT:
pass
else:... | [
"def",
"rm_output_json_file",
"(",
")",
":",
"path",
"=",
"get_output_json_file",
"(",
")",
"try",
":",
"os",
".",
"remove",
"(",
"path",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"ENOENT",
":",
"pass",
"e... | Warning: this is not for casual use.
It erases the output json file, and should be used for testing purposes only. | [
"Warning",
":",
"this",
"is",
"not",
"for",
"casual",
"use",
".",
"It",
"erases",
"the",
"output",
"json",
"file",
"and",
"should",
"be",
"used",
"for",
"testing",
"purposes",
"only",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L149-L160 | train | Remove the output json file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | ensure_dir | def ensure_dir(path):
"""
:param path: path to directory to be created
Create a directory if it does not already exist.
"""
if not os.path.exists(path):
# path does not exist, create the directory
os.mkdir(path)
else:
# The path exists, check that it is not a file
... | python | def ensure_dir(path):
"""
:param path: path to directory to be created
Create a directory if it does not already exist.
"""
if not os.path.exists(path):
# path does not exist, create the directory
os.mkdir(path)
else:
# The path exists, check that it is not a file
... | [
"def",
"ensure_dir",
"(",
"path",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"# path does not exist, create the directory",
"os",
".",
"mkdir",
"(",
"path",
")",
"else",
":",
"# The path exists, check that it is not a file",
... | :param path: path to directory to be created
Create a directory if it does not already exist. | [
":",
"param",
"path",
":",
"path",
"to",
"directory",
"to",
"be",
"created"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L163-L175 | train | Ensures that the directory path exists and is a file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | make_unix_filename | def make_unix_filename(fname):
"""
:param fname: the basename of a file (e.g., xxx in /zzz/yyy/xxx).
:returns: a valid unix filename
:rtype: string
:raises: DXError if the filename is invalid on a Unix system
The problem being solved here is that *fname* is a python string, it
may contain c... | python | def make_unix_filename(fname):
"""
:param fname: the basename of a file (e.g., xxx in /zzz/yyy/xxx).
:returns: a valid unix filename
:rtype: string
:raises: DXError if the filename is invalid on a Unix system
The problem being solved here is that *fname* is a python string, it
may contain c... | [
"def",
"make_unix_filename",
"(",
"fname",
")",
":",
"# sanity check for filenames",
"bad_filenames",
"=",
"[",
"\".\"",
",",
"\"..\"",
"]",
"if",
"fname",
"in",
"bad_filenames",
":",
"raise",
"DXError",
"(",
"\"Invalid filename {}\"",
".",
"format",
"(",
"fname",... | :param fname: the basename of a file (e.g., xxx in /zzz/yyy/xxx).
:returns: a valid unix filename
:rtype: string
:raises: DXError if the filename is invalid on a Unix system
The problem being solved here is that *fname* is a python string, it
may contain characters that are invalid for a file name.... | [
":",
"param",
"fname",
":",
"the",
"basename",
"of",
"a",
"file",
"(",
"e",
".",
"g",
".",
"xxx",
"in",
"/",
"zzz",
"/",
"yyy",
"/",
"xxx",
")",
".",
":",
"returns",
":",
"a",
"valid",
"unix",
"filename",
":",
"rtype",
":",
"string",
":",
"rais... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L178-L194 | train | Make a valid Unix filename on Unix systems. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | get_job_input_filenames | def get_job_input_filenames(job_input_file):
"""Extract list of files, returns a set of directories to create, and
a set of files, with sources and destinations. The paths created are
relative to the input directory.
Note: we go through file names inside arrays, and create a
separate subdirectory f... | python | def get_job_input_filenames(job_input_file):
"""Extract list of files, returns a set of directories to create, and
a set of files, with sources and destinations. The paths created are
relative to the input directory.
Note: we go through file names inside arrays, and create a
separate subdirectory f... | [
"def",
"get_job_input_filenames",
"(",
"job_input_file",
")",
":",
"def",
"get_input_hash",
"(",
")",
":",
"with",
"open",
"(",
"job_input_file",
")",
"as",
"fh",
":",
"job_input",
"=",
"json",
".",
"load",
"(",
"fh",
")",
"return",
"job_input",
"job_input",... | Extract list of files, returns a set of directories to create, and
a set of files, with sources and destinations. The paths created are
relative to the input directory.
Note: we go through file names inside arrays, and create a
separate subdirectory for each. This avoids clobbering files when
dupli... | [
"Extract",
"list",
"of",
"files",
"returns",
"a",
"set",
"of",
"directories",
"to",
"create",
"and",
"a",
"set",
"of",
"files",
"with",
"sources",
"and",
"destinations",
".",
"The",
"paths",
"created",
"are",
"relative",
"to",
"the",
"input",
"directory",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L202-L271 | train | Extract list of files from the input directory and create a set of directories to create and a set of files with sources and destinations. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | get_input_spec_patterns | def get_input_spec_patterns():
''' Extract the inputSpec patterns, if they exist -- modifed from dx-upload-all-outputs
Returns a dict of all patterns, with keys equal to the respective
input parameter names.
'''
input_spec = None
if 'DX_JOB_ID' in environ:
# works in the cloud, not loca... | python | def get_input_spec_patterns():
''' Extract the inputSpec patterns, if they exist -- modifed from dx-upload-all-outputs
Returns a dict of all patterns, with keys equal to the respective
input parameter names.
'''
input_spec = None
if 'DX_JOB_ID' in environ:
# works in the cloud, not loca... | [
"def",
"get_input_spec_patterns",
"(",
")",
":",
"input_spec",
"=",
"None",
"if",
"'DX_JOB_ID'",
"in",
"environ",
":",
"# works in the cloud, not locally",
"job_desc",
"=",
"dxpy",
".",
"describe",
"(",
"dxpy",
".",
"JOB_ID",
")",
"if",
"job_desc",
"[",
"\"funct... | Extract the inputSpec patterns, if they exist -- modifed from dx-upload-all-outputs
Returns a dict of all patterns, with keys equal to the respective
input parameter names. | [
"Extract",
"the",
"inputSpec",
"patterns",
"if",
"they",
"exist",
"--",
"modifed",
"from",
"dx",
"-",
"upload",
"-",
"all",
"-",
"outputs"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L274-L313 | train | Extract the inputSpec patterns if they exist and return a dictionary of all patterns. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | analyze_bash_vars | def analyze_bash_vars(job_input_file, job_homedir):
'''
This function examines the input file, and calculates variables to
instantiate in the shell environment. It is called right before starting the
execution of an app in a worker.
For each input key, we want to have
$var
$var_filename
... | python | def analyze_bash_vars(job_input_file, job_homedir):
'''
This function examines the input file, and calculates variables to
instantiate in the shell environment. It is called right before starting the
execution of an app in a worker.
For each input key, we want to have
$var
$var_filename
... | [
"def",
"analyze_bash_vars",
"(",
"job_input_file",
",",
"job_homedir",
")",
":",
"_",
",",
"file_entries",
",",
"rest_hash",
"=",
"get_job_input_filenames",
"(",
"job_input_file",
")",
"patterns_dict",
"=",
"get_input_spec_patterns",
"(",
")",
"# Note: there may be mult... | This function examines the input file, and calculates variables to
instantiate in the shell environment. It is called right before starting the
execution of an app in a worker.
For each input key, we want to have
$var
$var_filename
$var_prefix
remove last dot (+gz), and/or remove pattern... | [
"This",
"function",
"examines",
"the",
"input",
"file",
"and",
"calculates",
"variables",
"to",
"instantiate",
"in",
"the",
"shell",
"environment",
".",
"It",
"is",
"called",
"right",
"before",
"starting",
"the",
"execution",
"of",
"an",
"app",
"in",
"a",
"w... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L327-L401 | train | This function calculates the variables to be used in the shell environment. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/file_load_utils.py | gen_bash_vars | def gen_bash_vars(job_input_file, job_homedir=None, check_name_collision=True):
"""
:param job_input_file: path to a JSON file describing the job inputs
:param job_homedir: path to home directory, used for testing purposes
:param check_name_collision: should we check for name collisions?
:return: li... | python | def gen_bash_vars(job_input_file, job_homedir=None, check_name_collision=True):
"""
:param job_input_file: path to a JSON file describing the job inputs
:param job_homedir: path to home directory, used for testing purposes
:param check_name_collision: should we check for name collisions?
:return: li... | [
"def",
"gen_bash_vars",
"(",
"job_input_file",
",",
"job_homedir",
"=",
"None",
",",
"check_name_collision",
"=",
"True",
")",
":",
"file_key_descs",
",",
"rest_hash",
"=",
"analyze_bash_vars",
"(",
"job_input_file",
",",
"job_homedir",
")",
"def",
"string_of_elem",... | :param job_input_file: path to a JSON file describing the job inputs
:param job_homedir: path to home directory, used for testing purposes
:param check_name_collision: should we check for name collisions?
:return: list of lines
:rtype: list of strings
Calculates a line for each shell variable to in... | [
":",
"param",
"job_input_file",
":",
"path",
"to",
"a",
"JSON",
"file",
"describing",
"the",
"job",
"inputs",
":",
"param",
"job_homedir",
":",
"path",
"to",
"home",
"directory",
"used",
"for",
"testing",
"purposes",
":",
"param",
"check_name_collision",
":",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/file_load_utils.py#L408-L464 | train | Generates a list of lines for each bash variable in the job input file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | wait_for_a_future | def wait_for_a_future(futures, print_traceback=False):
"""
Return the next future that completes. If a KeyboardInterrupt is
received, then the entire process is exited immediately. See
wait_for_all_futures for more notes.
"""
while True:
try:
future = next(concurrent.future... | python | def wait_for_a_future(futures, print_traceback=False):
"""
Return the next future that completes. If a KeyboardInterrupt is
received, then the entire process is exited immediately. See
wait_for_all_futures for more notes.
"""
while True:
try:
future = next(concurrent.future... | [
"def",
"wait_for_a_future",
"(",
"futures",
",",
"print_traceback",
"=",
"False",
")",
":",
"while",
"True",
":",
"try",
":",
"future",
"=",
"next",
"(",
"concurrent",
".",
"futures",
".",
"as_completed",
"(",
"futures",
",",
"timeout",
"=",
"THREAD_TIMEOUT_... | Return the next future that completes. If a KeyboardInterrupt is
received, then the entire process is exited immediately. See
wait_for_all_futures for more notes. | [
"Return",
"the",
"next",
"future",
"that",
"completes",
".",
"If",
"a",
"KeyboardInterrupt",
"is",
"received",
"then",
"the",
"entire",
"process",
"is",
"exited",
"immediately",
".",
"See",
"wait_for_all_futures",
"for",
"more",
"notes",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L40-L59 | train | Wait for a future that completes. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | wait_for_all_futures | def wait_for_all_futures(futures, print_traceback=False):
"""
Wait indefinitely for all futures in the input iterable to complete.
Use a timeout to enable interrupt handling.
Call os._exit() in case of KeyboardInterrupt. Otherwise, the atexit registered handler in concurrent.futures.thread
will run,... | python | def wait_for_all_futures(futures, print_traceback=False):
"""
Wait indefinitely for all futures in the input iterable to complete.
Use a timeout to enable interrupt handling.
Call os._exit() in case of KeyboardInterrupt. Otherwise, the atexit registered handler in concurrent.futures.thread
will run,... | [
"def",
"wait_for_all_futures",
"(",
"futures",
",",
"print_traceback",
"=",
"False",
")",
":",
"try",
":",
"while",
"True",
":",
"waited_futures",
"=",
"concurrent",
".",
"futures",
".",
"wait",
"(",
"futures",
",",
"timeout",
"=",
"60",
")",
"if",
"len",
... | Wait indefinitely for all futures in the input iterable to complete.
Use a timeout to enable interrupt handling.
Call os._exit() in case of KeyboardInterrupt. Otherwise, the atexit registered handler in concurrent.futures.thread
will run, and issue blocking join() on all worker threads, requiring us to list... | [
"Wait",
"indefinitely",
"for",
"all",
"futures",
"in",
"the",
"input",
"iterable",
"to",
"complete",
".",
"Use",
"a",
"timeout",
"to",
"enable",
"interrupt",
"handling",
".",
"Call",
"os",
".",
"_exit",
"()",
"in",
"case",
"of",
"KeyboardInterrupt",
".",
"... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L61-L85 | train | Wait indefinitely for all futures in the input iterable to complete. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | response_iterator | def response_iterator(request_iterator, thread_pool, max_active_tasks=None, do_first_task_sequentially=True):
"""
:param request_iterator:
An iterator producing inputs for consumption by the worker pool.
:type request_iterator: iterator of callable, args, kwargs
:param thread_pool: thread pool t... | python | def response_iterator(request_iterator, thread_pool, max_active_tasks=None, do_first_task_sequentially=True):
"""
:param request_iterator:
An iterator producing inputs for consumption by the worker pool.
:type request_iterator: iterator of callable, args, kwargs
:param thread_pool: thread pool t... | [
"def",
"response_iterator",
"(",
"request_iterator",
",",
"thread_pool",
",",
"max_active_tasks",
"=",
"None",
",",
"do_first_task_sequentially",
"=",
"True",
")",
":",
"tasks_in_progress",
"=",
"collections",
".",
"deque",
"(",
")",
"if",
"max_active_tasks",
"is",
... | :param request_iterator:
An iterator producing inputs for consumption by the worker pool.
:type request_iterator: iterator of callable, args, kwargs
:param thread_pool: thread pool to submit the requests to
:type thread_pool: concurrent.futures.thread.ThreadPoolExecutor
:param max_active_tasks:
... | [
":",
"param",
"request_iterator",
":",
"An",
"iterator",
"producing",
"inputs",
"for",
"consumption",
"by",
"the",
"worker",
"pool",
".",
":",
"type",
"request_iterator",
":",
"iterator",
"of",
"callable",
"args",
"kwargs",
":",
"param",
"thread_pool",
":",
"t... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L88-L149 | train | Returns an iterator that yields the results of the request and returns the result of the request. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | normalize_time_input | def normalize_time_input(t, future=False, default_unit='ms'):
"""
:param default_unit: units of the input time *t*; must be one of "s" or
"ms". This param is only respected if *t* looks like an int (e.g.
"12345", 12345).
:type default_unit: string
Converts inputs such as:
"2012-0... | python | def normalize_time_input(t, future=False, default_unit='ms'):
"""
:param default_unit: units of the input time *t*; must be one of "s" or
"ms". This param is only respected if *t* looks like an int (e.g.
"12345", 12345).
:type default_unit: string
Converts inputs such as:
"2012-0... | [
"def",
"normalize_time_input",
"(",
"t",
",",
"future",
"=",
"False",
",",
"default_unit",
"=",
"'ms'",
")",
":",
"error_msg",
"=",
"'Error: Expected an int timestamp, a date format (e.g. YYYY-MM-DD), or an int with a single-letter suffix (s=seconds, m=minutes, h=hours, d=days, w=wee... | :param default_unit: units of the input time *t*; must be one of "s" or
"ms". This param is only respected if *t* looks like an int (e.g.
"12345", 12345).
:type default_unit: string
Converts inputs such as:
"2012-05-01"
"-5d"
1352863174
"1352863174"
to millisecon... | [
":",
"param",
"default_unit",
":",
"units",
"of",
"the",
"input",
"time",
"*",
"t",
"*",
";",
"must",
"be",
"one",
"of",
"s",
"or",
"ms",
".",
"This",
"param",
"is",
"only",
"respected",
"if",
"*",
"t",
"*",
"looks",
"like",
"an",
"int",
"(",
"e"... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L159-L196 | train | Normalizes a time input to a number of milliseconds since epoch. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | normalize_timedelta | def normalize_timedelta(timedelta):
"""
Given a string like "1w" or "-5d", convert it to an integer in milliseconds.
Integers without a suffix are interpreted as seconds.
Note: not related to the datetime timedelta class.
"""
try:
return int(timedelta) * 1000
except ValueError as e:
... | python | def normalize_timedelta(timedelta):
"""
Given a string like "1w" or "-5d", convert it to an integer in milliseconds.
Integers without a suffix are interpreted as seconds.
Note: not related to the datetime timedelta class.
"""
try:
return int(timedelta) * 1000
except ValueError as e:
... | [
"def",
"normalize_timedelta",
"(",
"timedelta",
")",
":",
"try",
":",
"return",
"int",
"(",
"timedelta",
")",
"*",
"1000",
"except",
"ValueError",
"as",
"e",
":",
"t",
",",
"suffix",
"=",
"timedelta",
"[",
":",
"-",
"1",
"]",
",",
"timedelta",
"[",
"... | Given a string like "1w" or "-5d", convert it to an integer in milliseconds.
Integers without a suffix are interpreted as seconds.
Note: not related to the datetime timedelta class. | [
"Given",
"a",
"string",
"like",
"1w",
"or",
"-",
"5d",
"convert",
"it",
"to",
"an",
"integer",
"in",
"milliseconds",
".",
"Integers",
"without",
"a",
"suffix",
"are",
"interpreted",
"as",
"seconds",
".",
"Note",
":",
"not",
"related",
"to",
"the",
"datet... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L198-L212 | train | Normalizes a datetime timedelta string to an integer in milliseconds. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | _dict_raise_on_duplicates | def _dict_raise_on_duplicates(ordered_pairs):
"""
Reject duplicate keys.
"""
d = {}
for k, v in ordered_pairs:
if k in d:
raise ValueError("duplicate key: %r" % (k,))
else:
d[k] = v
return d | python | def _dict_raise_on_duplicates(ordered_pairs):
"""
Reject duplicate keys.
"""
d = {}
for k, v in ordered_pairs:
if k in d:
raise ValueError("duplicate key: %r" % (k,))
else:
d[k] = v
return d | [
"def",
"_dict_raise_on_duplicates",
"(",
"ordered_pairs",
")",
":",
"d",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"ordered_pairs",
":",
"if",
"k",
"in",
"d",
":",
"raise",
"ValueError",
"(",
"\"duplicate key: %r\"",
"%",
"(",
"k",
",",
")",
")",
"els... | Reject duplicate keys. | [
"Reject",
"duplicate",
"keys",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L258-L268 | train | Return a dictionary with the keys in ordered_pairs. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/utils/__init__.py | Nonce.update_nonce | def update_nonce(input_params):
'''
Static method to return a copy of the input dictionary with an
additional unique nonce
:param input: an input dictionary that may be empty
:type input: dict
:returns an extended copy of the input with an additional nonce field
... | python | def update_nonce(input_params):
'''
Static method to return a copy of the input dictionary with an
additional unique nonce
:param input: an input dictionary that may be empty
:type input: dict
:returns an extended copy of the input with an additional nonce field
... | [
"def",
"update_nonce",
"(",
"input_params",
")",
":",
"input_cp",
"=",
"input_params",
".",
"copy",
"(",
")",
"if",
"len",
"(",
"input_cp",
".",
"get",
"(",
"'nonce'",
",",
"''",
")",
")",
"==",
"0",
":",
"input_cp",
"[",
"'nonce'",
"]",
"=",
"str",
... | Static method to return a copy of the input dictionary with an
additional unique nonce
:param input: an input dictionary that may be empty
:type input: dict
:returns an extended copy of the input with an additional nonce field
The input dictionary is updated with a nonce only if... | [
"Static",
"method",
"to",
"return",
"a",
"copy",
"of",
"the",
"input",
"dictionary",
"with",
"an",
"additional",
"unique",
"nonce",
":",
"param",
"input",
":",
"an",
"input",
"dictionary",
"that",
"may",
"be",
"empty",
":",
"type",
"input",
":",
"dict",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L304-L318 | train | Static method to update the nonce field of the input dictionary with an additional unique nonce | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/executable_builder.py | inline_documentation_files | def inline_documentation_files(json_spec, src_dir):
"""
Modifies the provided json_spec dict (which may be an app, applet,
workflow spec) to inline the contents of the readme file into
"description" and the developer readme into "developerNotes".
"""
# Inline description from a readme file
i... | python | def inline_documentation_files(json_spec, src_dir):
"""
Modifies the provided json_spec dict (which may be an app, applet,
workflow spec) to inline the contents of the readme file into
"description" and the developer readme into "developerNotes".
"""
# Inline description from a readme file
i... | [
"def",
"inline_documentation_files",
"(",
"json_spec",
",",
"src_dir",
")",
":",
"# Inline description from a readme file",
"if",
"'description'",
"not",
"in",
"json_spec",
":",
"readme_filename",
"=",
"None",
"for",
"filename",
"in",
"'README.md'",
",",
"'Readme.md'",
... | Modifies the provided json_spec dict (which may be an app, applet,
workflow spec) to inline the contents of the readme file into
"description" and the developer readme into "developerNotes". | [
"Modifies",
"the",
"provided",
"json_spec",
"dict",
"(",
"which",
"may",
"be",
"an",
"app",
"applet",
"workflow",
"spec",
")",
"to",
"inline",
"the",
"contents",
"of",
"the",
"readme",
"file",
"into",
"description",
"and",
"the",
"developer",
"readme",
"into... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/executable_builder.py#L65-L88 | train | Inline the contents of the README. md file into the JSON_SPEC dictionary. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/executable_builder.py | verify_developer_rights | def verify_developer_rights(prefixed_name):
"""
Checks if the current user is a developer of the app or global workflow
with the given name. If the app/global workflow exists and the user has
developer rights to it, the function returns a named tuple representing
the executable that was queried.
... | python | def verify_developer_rights(prefixed_name):
"""
Checks if the current user is a developer of the app or global workflow
with the given name. If the app/global workflow exists and the user has
developer rights to it, the function returns a named tuple representing
the executable that was queried.
... | [
"def",
"verify_developer_rights",
"(",
"prefixed_name",
")",
":",
"assert",
"(",
"prefixed_name",
".",
"startswith",
"(",
"'app-'",
")",
"or",
"prefixed_name",
".",
"startswith",
"(",
"'globalworkflow-'",
")",
")",
"if",
"prefixed_name",
".",
"partition",
"(",
"... | Checks if the current user is a developer of the app or global workflow
with the given name. If the app/global workflow exists and the user has
developer rights to it, the function returns a named tuple representing
the executable that was queried. | [
"Checks",
"if",
"the",
"current",
"user",
"is",
"a",
"developer",
"of",
"the",
"app",
"or",
"global",
"workflow",
"with",
"the",
"given",
"name",
".",
"If",
"the",
"app",
"/",
"global",
"workflow",
"exists",
"and",
"the",
"user",
"has",
"developer",
"rig... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/executable_builder.py#L102-L152 | train | Verifies that the current user has the given developer rights to the app or global workflow with the given name. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/executable_builder.py | assert_consistent_regions | def assert_consistent_regions(from_spec, from_command_line, builder_exception):
"""
Verifies the regions passed with --region CLI argument and the ones
specified in regionalOptions are the same (if both CLI and spec were used)
"""
if from_spec is None or from_command_line is None:
return
... | python | def assert_consistent_regions(from_spec, from_command_line, builder_exception):
"""
Verifies the regions passed with --region CLI argument and the ones
specified in regionalOptions are the same (if both CLI and spec were used)
"""
if from_spec is None or from_command_line is None:
return
... | [
"def",
"assert_consistent_regions",
"(",
"from_spec",
",",
"from_command_line",
",",
"builder_exception",
")",
":",
"if",
"from_spec",
"is",
"None",
"or",
"from_command_line",
"is",
"None",
":",
"return",
"if",
"set",
"(",
"from_spec",
")",
"!=",
"set",
"(",
"... | Verifies the regions passed with --region CLI argument and the ones
specified in regionalOptions are the same (if both CLI and spec were used) | [
"Verifies",
"the",
"regions",
"passed",
"with",
"--",
"region",
"CLI",
"argument",
"and",
"the",
"ones",
"specified",
"in",
"regionalOptions",
"are",
"the",
"same",
"(",
"if",
"both",
"CLI",
"and",
"spec",
"were",
"used",
")"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/executable_builder.py#L155-L163 | train | Ensures that the regions passed in from_spec and from_command_line are the same. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/executable_builder.py | assert_consistent_reg_options | def assert_consistent_reg_options(exec_type, json_spec, executable_builder_exeception):
"""
Validates the "regionalOptions" field and verifies all the regions used
in "regionalOptions" have the same options.
"""
reg_options_spec = json_spec.get('regionalOptions')
json_fn = 'dxapp.json' if exec_t... | python | def assert_consistent_reg_options(exec_type, json_spec, executable_builder_exeception):
"""
Validates the "regionalOptions" field and verifies all the regions used
in "regionalOptions" have the same options.
"""
reg_options_spec = json_spec.get('regionalOptions')
json_fn = 'dxapp.json' if exec_t... | [
"def",
"assert_consistent_reg_options",
"(",
"exec_type",
",",
"json_spec",
",",
"executable_builder_exeception",
")",
":",
"reg_options_spec",
"=",
"json_spec",
".",
"get",
"(",
"'regionalOptions'",
")",
"json_fn",
"=",
"'dxapp.json'",
"if",
"exec_type",
"==",
"'app'... | Validates the "regionalOptions" field and verifies all the regions used
in "regionalOptions" have the same options. | [
"Validates",
"the",
"regionalOptions",
"field",
"and",
"verifies",
"all",
"the",
"regions",
"used",
"in",
"regionalOptions",
"have",
"the",
"same",
"options",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/executable_builder.py#L166-L200 | train | Validates the regionalOptions field and verifies all the regions used in the current workflow are in the same options. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/executable_builder.py | get_enabled_regions | def get_enabled_regions(exec_type, json_spec, from_command_line, executable_builder_exeception):
"""
Return a list of regions in which the global executable (app or global workflow)
will be enabled, based on the "regionalOption" in their JSON specification
and/or --region CLI argument used with "dx buil... | python | def get_enabled_regions(exec_type, json_spec, from_command_line, executable_builder_exeception):
"""
Return a list of regions in which the global executable (app or global workflow)
will be enabled, based on the "regionalOption" in their JSON specification
and/or --region CLI argument used with "dx buil... | [
"def",
"get_enabled_regions",
"(",
"exec_type",
",",
"json_spec",
",",
"from_command_line",
",",
"executable_builder_exeception",
")",
":",
"from_spec",
"=",
"json_spec",
".",
"get",
"(",
"'regionalOptions'",
")",
"if",
"from_spec",
"is",
"not",
"None",
":",
"asse... | Return a list of regions in which the global executable (app or global workflow)
will be enabled, based on the "regionalOption" in their JSON specification
and/or --region CLI argument used with "dx build".
:param exec_type: 'app' or 'globalworkflow'
:type json_spec: str.
:param json_spec: The cont... | [
"Return",
"a",
"list",
"of",
"regions",
"in",
"which",
"the",
"global",
"executable",
"(",
"app",
"or",
"global",
"workflow",
")",
"will",
"be",
"enabled",
"based",
"on",
"the",
"regionalOption",
"in",
"their",
"JSON",
"specification",
"and",
"/",
"or",
"-... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/executable_builder.py#L202-L231 | train | Returns a list of regions that are enabled for the global executable. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxanalysis.py | DXAnalysis.describe | def describe(self, fields=None, **kwargs):
"""
:param fields: dict where the keys are field names that should
be returned, and values should be set to True (by default,
all fields are returned)
:type fields: dict
:returns: Description of the analysis
:rtyp... | python | def describe(self, fields=None, **kwargs):
"""
:param fields: dict where the keys are field names that should
be returned, and values should be set to True (by default,
all fields are returned)
:type fields: dict
:returns: Description of the analysis
:rtyp... | [
"def",
"describe",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"describe_input",
"=",
"{",
"}",
"if",
"fields",
"is",
"not",
"None",
":",
"describe_input",
"[",
"'fields'",
"]",
"=",
"fields",
"self",
".",
"_desc",
"="... | :param fields: dict where the keys are field names that should
be returned, and values should be set to True (by default,
all fields are returned)
:type fields: dict
:returns: Description of the analysis
:rtype: dict
Returns a hash with key-value pairs containing... | [
":",
"param",
"fields",
":",
"dict",
"where",
"the",
"keys",
"are",
"field",
"names",
"that",
"should",
"be",
"returned",
"and",
"values",
"should",
"be",
"set",
"to",
"True",
"(",
"by",
"default",
"all",
"fields",
"are",
"returned",
")",
":",
"type",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxanalysis.py#L51-L68 | train | Returns the description of the current object. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxanalysis.py | DXAnalysis.add_tags | def add_tags(self, tags, **kwargs):
"""
:param tags: Tags to add to the analysis
:type tags: list of strings
Adds each of the specified tags to the analysis. Takes no
action for tags that are already listed for the analysis.
"""
dxpy.api.analysis_add_tags(self.... | python | def add_tags(self, tags, **kwargs):
"""
:param tags: Tags to add to the analysis
:type tags: list of strings
Adds each of the specified tags to the analysis. Takes no
action for tags that are already listed for the analysis.
"""
dxpy.api.analysis_add_tags(self.... | [
"def",
"add_tags",
"(",
"self",
",",
"tags",
",",
"*",
"*",
"kwargs",
")",
":",
"dxpy",
".",
"api",
".",
"analysis_add_tags",
"(",
"self",
".",
"_dxid",
",",
"{",
"\"tags\"",
":",
"tags",
"}",
",",
"*",
"*",
"kwargs",
")"
] | :param tags: Tags to add to the analysis
:type tags: list of strings
Adds each of the specified tags to the analysis. Takes no
action for tags that are already listed for the analysis. | [
":",
"param",
"tags",
":",
"Tags",
"to",
"add",
"to",
"the",
"analysis",
":",
"type",
"tags",
":",
"list",
"of",
"strings"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxanalysis.py#L70-L80 | train | Adds each of the specified tags to the analysis. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxanalysis.py | DXAnalysis.remove_tags | def remove_tags(self, tags, **kwargs):
"""
:param tags: Tags to remove from the analysis
:type tags: list of strings
Removes each of the specified tags from the analysis. Takes
no action for tags that the analysis does not currently have.
"""
dxpy.api.analysis_... | python | def remove_tags(self, tags, **kwargs):
"""
:param tags: Tags to remove from the analysis
:type tags: list of strings
Removes each of the specified tags from the analysis. Takes
no action for tags that the analysis does not currently have.
"""
dxpy.api.analysis_... | [
"def",
"remove_tags",
"(",
"self",
",",
"tags",
",",
"*",
"*",
"kwargs",
")",
":",
"dxpy",
".",
"api",
".",
"analysis_remove_tags",
"(",
"self",
".",
"_dxid",
",",
"{",
"\"tags\"",
":",
"tags",
"}",
",",
"*",
"*",
"kwargs",
")"
] | :param tags: Tags to remove from the analysis
:type tags: list of strings
Removes each of the specified tags from the analysis. Takes
no action for tags that the analysis does not currently have. | [
":",
"param",
"tags",
":",
"Tags",
"to",
"remove",
"from",
"the",
"analysis",
":",
"type",
"tags",
":",
"list",
"of",
"strings"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxanalysis.py#L82-L92 | train | Removes the specified tags from the analysis. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxanalysis.py | DXAnalysis.set_properties | def set_properties(self, properties, **kwargs):
"""
:param properties: Property names and values given as key-value pairs of strings
:type properties: dict
Given key-value pairs in *properties* for property names and
values, the properties are set on the analysis for the given
... | python | def set_properties(self, properties, **kwargs):
"""
:param properties: Property names and values given as key-value pairs of strings
:type properties: dict
Given key-value pairs in *properties* for property names and
values, the properties are set on the analysis for the given
... | [
"def",
"set_properties",
"(",
"self",
",",
"properties",
",",
"*",
"*",
"kwargs",
")",
":",
"dxpy",
".",
"api",
".",
"analysis_set_properties",
"(",
"self",
".",
"_dxid",
",",
"{",
"\"properties\"",
":",
"properties",
"}",
",",
"*",
"*",
"kwargs",
")"
] | :param properties: Property names and values given as key-value pairs of strings
:type properties: dict
Given key-value pairs in *properties* for property names and
values, the properties are set on the analysis for the given
property names. Any property with a value of :const:`None`
... | [
":",
"param",
"properties",
":",
"Property",
"names",
"and",
"values",
"given",
"as",
"key",
"-",
"value",
"pairs",
"of",
"strings",
":",
"type",
"properties",
":",
"dict"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxanalysis.py#L94-L109 | train | Sets the properties of the current analysis for the given key - value pairs. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxanalysis.py | DXAnalysis.get_output_ref | def get_output_ref(self, field, index=None, metadata=None):
'''
:param field: Output field name of this analysis
:type field: string
:param index: If the referenced field is an array, optionally specify an index (starting from 0) to indicate a particular member of the array
:type... | python | def get_output_ref(self, field, index=None, metadata=None):
'''
:param field: Output field name of this analysis
:type field: string
:param index: If the referenced field is an array, optionally specify an index (starting from 0) to indicate a particular member of the array
:type... | [
"def",
"get_output_ref",
"(",
"self",
",",
"field",
",",
"index",
"=",
"None",
",",
"metadata",
"=",
"None",
")",
":",
"link",
"=",
"{",
"\"$dnanexus_link\"",
":",
"{",
"\"analysis\"",
":",
"self",
".",
"_dxid",
",",
"\"field\"",
":",
"field",
"}",
"}"... | :param field: Output field name of this analysis
:type field: string
:param index: If the referenced field is an array, optionally specify an index (starting from 0) to indicate a particular member of the array
:type index: int
:param metadata: If the referenced field is of a data object... | [
":",
"param",
"field",
":",
"Output",
"field",
"name",
"of",
"this",
"analysis",
":",
"type",
"field",
":",
"string",
":",
"param",
"index",
":",
"If",
"the",
"referenced",
"field",
"is",
"an",
"array",
"optionally",
"specify",
"an",
"index",
"(",
"start... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxanalysis.py#L148-L165 | train | Returns a dictionary containing a valid reference to an output of this analysis. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _check_suggestions | def _check_suggestions(app_json, publish=False):
"""
Examines the specified dxapp.json file and warns about any
violations of suggestions guidelines.
:raises: AppBuilderException for data objects that could not be found
"""
for input_field in app_json.get('inputSpec', []):
for suggestio... | python | def _check_suggestions(app_json, publish=False):
"""
Examines the specified dxapp.json file and warns about any
violations of suggestions guidelines.
:raises: AppBuilderException for data objects that could not be found
"""
for input_field in app_json.get('inputSpec', []):
for suggestio... | [
"def",
"_check_suggestions",
"(",
"app_json",
",",
"publish",
"=",
"False",
")",
":",
"for",
"input_field",
"in",
"app_json",
".",
"get",
"(",
"'inputSpec'",
",",
"[",
"]",
")",
":",
"for",
"suggestion",
"in",
"input_field",
".",
"get",
"(",
"'suggestions'... | Examines the specified dxapp.json file and warns about any
violations of suggestions guidelines.
:raises: AppBuilderException for data objects that could not be found | [
"Examines",
"the",
"specified",
"dxapp",
".",
"json",
"file",
"and",
"warns",
"about",
"any",
"violations",
"of",
"suggestions",
"guidelines",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L86-L142 | train | Checks the suggestions guidelines for any data objects that can be found in the specified app. json file and raises an exception if any of the violations are not found. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _lint | def _lint(dxapp_json_filename, mode):
"""
Examines the specified dxapp.json file and warns about any
violations of app guidelines.
Precondition: the dxapp.json file exists and can be parsed.
"""
def _find_readme(dirname):
for basename in ['README.md', 'Readme.md', 'readme.md']:
... | python | def _lint(dxapp_json_filename, mode):
"""
Examines the specified dxapp.json file and warns about any
violations of app guidelines.
Precondition: the dxapp.json file exists and can be parsed.
"""
def _find_readme(dirname):
for basename in ['README.md', 'Readme.md', 'readme.md']:
... | [
"def",
"_lint",
"(",
"dxapp_json_filename",
",",
"mode",
")",
":",
"def",
"_find_readme",
"(",
"dirname",
")",
":",
"for",
"basename",
"in",
"[",
"'README.md'",
",",
"'Readme.md'",
",",
"'readme.md'",
"]",
":",
"if",
"os",
".",
"path",
".",
"exists",
"("... | Examines the specified dxapp.json file and warns about any
violations of app guidelines.
Precondition: the dxapp.json file exists and can be parsed. | [
"Examines",
"the",
"specified",
"dxapp",
".",
"json",
"file",
"and",
"warns",
"about",
"any",
"violations",
"of",
"app",
"guidelines",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L144-L223 | train | Check the dxapp. json file and raise an exception if it is not. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _check_syntax | def _check_syntax(code, lang, temp_dir, enforce=True):
"""
Checks that the code whose text is in CODE parses as LANG.
Raises DXSyntaxError if there is a problem and "enforce" is True.
"""
# This function needs the language to be explicitly set, so we can
# generate an appropriate temp filename.... | python | def _check_syntax(code, lang, temp_dir, enforce=True):
"""
Checks that the code whose text is in CODE parses as LANG.
Raises DXSyntaxError if there is a problem and "enforce" is True.
"""
# This function needs the language to be explicitly set, so we can
# generate an appropriate temp filename.... | [
"def",
"_check_syntax",
"(",
"code",
",",
"lang",
",",
"temp_dir",
",",
"enforce",
"=",
"True",
")",
":",
"# This function needs the language to be explicitly set, so we can",
"# generate an appropriate temp filename.",
"if",
"lang",
"==",
"'python2.7'",
":",
"temp_basename... | Checks that the code whose text is in CODE parses as LANG.
Raises DXSyntaxError if there is a problem and "enforce" is True. | [
"Checks",
"that",
"the",
"code",
"whose",
"text",
"is",
"in",
"CODE",
"parses",
"as",
"LANG",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L225-L242 | train | Checks that the code is in CODE parses as LANG. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _check_file_syntax | def _check_file_syntax(filename, temp_dir, override_lang=None, enforce=True):
"""
Checks that the code in FILENAME parses, attempting to autodetect
the language if necessary.
Raises IOError if the file cannot be read.
Raises DXSyntaxError if there is a problem and "enforce" is True.
"""
de... | python | def _check_file_syntax(filename, temp_dir, override_lang=None, enforce=True):
"""
Checks that the code in FILENAME parses, attempting to autodetect
the language if necessary.
Raises IOError if the file cannot be read.
Raises DXSyntaxError if there is a problem and "enforce" is True.
"""
de... | [
"def",
"_check_file_syntax",
"(",
"filename",
",",
"temp_dir",
",",
"override_lang",
"=",
"None",
",",
"enforce",
"=",
"True",
")",
":",
"def",
"check_python",
"(",
"filename",
")",
":",
"# Generate a semi-recognizable name to write the pyc to. Of",
"# course it's possi... | Checks that the code in FILENAME parses, attempting to autodetect
the language if necessary.
Raises IOError if the file cannot be read.
Raises DXSyntaxError if there is a problem and "enforce" is True. | [
"Checks",
"that",
"the",
"code",
"in",
"FILENAME",
"parses",
"attempting",
"to",
"autodetect",
"the",
"language",
"if",
"necessary",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L245-L305 | train | Checks that the code in FILENAME parses and checks that the language of the file is correct. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _verify_app_source_dir_impl | def _verify_app_source_dir_impl(src_dir, temp_dir, mode, enforce=True):
"""Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed.
"""
_lint(os.path.join(src_dir, "dxapp.json"), mode)
# Check that the entry point file parses as the type it is ... | python | def _verify_app_source_dir_impl(src_dir, temp_dir, mode, enforce=True):
"""Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed.
"""
_lint(os.path.join(src_dir, "dxapp.json"), mode)
# Check that the entry point file parses as the type it is ... | [
"def",
"_verify_app_source_dir_impl",
"(",
"src_dir",
",",
"temp_dir",
",",
"mode",
",",
"enforce",
"=",
"True",
")",
":",
"_lint",
"(",
"os",
".",
"path",
".",
"join",
"(",
"src_dir",
",",
"\"dxapp.json\"",
")",
",",
"mode",
")",
"# Check that the entry poi... | Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed. | [
"Performs",
"syntax",
"and",
"lint",
"checks",
"on",
"the",
"app",
"source",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L308-L415 | train | Checks that the dxapp. json file exists and parses as the type it is going to be parsed. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _verify_app_source_dir | def _verify_app_source_dir(src_dir, mode, enforce=True):
"""Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed.
"""
temp_dir = tempfile.mkdtemp(prefix='dx-build_tmp')
try:
_verify_app_source_dir_impl(src_dir, temp_dir, mode, enforce... | python | def _verify_app_source_dir(src_dir, mode, enforce=True):
"""Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed.
"""
temp_dir = tempfile.mkdtemp(prefix='dx-build_tmp')
try:
_verify_app_source_dir_impl(src_dir, temp_dir, mode, enforce... | [
"def",
"_verify_app_source_dir",
"(",
"src_dir",
",",
"mode",
",",
"enforce",
"=",
"True",
")",
":",
"temp_dir",
"=",
"tempfile",
".",
"mkdtemp",
"(",
"prefix",
"=",
"'dx-build_tmp'",
")",
"try",
":",
"_verify_app_source_dir_impl",
"(",
"src_dir",
",",
"temp_d... | Performs syntax and lint checks on the app source.
Precondition: the dxapp.json file exists and can be parsed. | [
"Performs",
"syntax",
"and",
"lint",
"checks",
"on",
"the",
"app",
"source",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L443-L452 | train | Performs syntax and lint checks on the app source directory. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _parse_app_spec | def _parse_app_spec(src_dir):
"""Returns the parsed contents of dxapp.json.
Raises either AppBuilderException or a parser error (exit codes 3 or
2 respectively) if this cannot be done.
"""
if not os.path.isdir(src_dir):
parser.error("%s is not a directory" % src_dir)
if not os.path.exis... | python | def _parse_app_spec(src_dir):
"""Returns the parsed contents of dxapp.json.
Raises either AppBuilderException or a parser error (exit codes 3 or
2 respectively) if this cannot be done.
"""
if not os.path.isdir(src_dir):
parser.error("%s is not a directory" % src_dir)
if not os.path.exis... | [
"def",
"_parse_app_spec",
"(",
"src_dir",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"src_dir",
")",
":",
"parser",
".",
"error",
"(",
"\"%s is not a directory\"",
"%",
"src_dir",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(... | Returns the parsed contents of dxapp.json.
Raises either AppBuilderException or a parser error (exit codes 3 or
2 respectively) if this cannot be done. | [
"Returns",
"the",
"parsed",
"contents",
"of",
"dxapp",
".",
"json",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L454-L468 | train | Parses the contents of dxapp. json and returns a dict of the parsed contents. Raises AppBuilderException if this cannot be done. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | _build_app | def _build_app(args, extra_args):
"""Builds an app or applet and returns the resulting executable ID
(unless it was a dry-run, in which case None is returned).
TODO: remote app builds still return None, but we should fix this.
"""
if not args.remote:
# LOCAL BUILD
try:
... | python | def _build_app(args, extra_args):
"""Builds an app or applet and returns the resulting executable ID
(unless it was a dry-run, in which case None is returned).
TODO: remote app builds still return None, but we should fix this.
"""
if not args.remote:
# LOCAL BUILD
try:
... | [
"def",
"_build_app",
"(",
"args",
",",
"extra_args",
")",
":",
"if",
"not",
"args",
".",
"remote",
":",
"# LOCAL BUILD",
"try",
":",
"output",
"=",
"build_and_upload_locally",
"(",
"args",
".",
"src_dir",
",",
"args",
".",
"mode",
",",
"overwrite",
"=",
... | Builds an app or applet and returns the resulting executable ID
(unless it was a dry-run, in which case None is returned).
TODO: remote app builds still return None, but we should fix this. | [
"Builds",
"an",
"app",
"or",
"applet",
"and",
"returns",
"the",
"resulting",
"executable",
"ID",
"(",
"unless",
"it",
"was",
"a",
"dry",
"-",
"run",
"in",
"which",
"case",
"None",
"is",
"returned",
")",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L895-L997 | train | Builds an app or applet and returns the resulting executable ID
. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/scripts/dx_build_app.py | main | def main(**kwargs):
"""
Entry point for dx-build-app(let).
Don't call this function as a subroutine in your program! It is liable to
sys.exit your program when it detects certain error conditions, so you
can't recover from those as you could if it raised exceptions. Instead,
call dx_build_app.b... | python | def main(**kwargs):
"""
Entry point for dx-build-app(let).
Don't call this function as a subroutine in your program! It is liable to
sys.exit your program when it detects certain error conditions, so you
can't recover from those as you could if it raised exceptions. Instead,
call dx_build_app.b... | [
"def",
"main",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
">",
"0",
":",
"if",
"sys",
".",
"argv",
"[",
"0",
"]",
".",
"endswith",
"(",
"'dx-build-app'",
")",
":",
"logging",
".",
"warn",
"(",
"'Warning: dx-buil... | Entry point for dx-build-app(let).
Don't call this function as a subroutine in your program! It is liable to
sys.exit your program when it detects certain error conditions, so you
can't recover from those as you could if it raised exceptions. Instead,
call dx_build_app.build_and_upload_locally which pr... | [
"Entry",
"point",
"for",
"dx",
"-",
"build",
"-",
"app",
"(",
"let",
")",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/scripts/dx_build_app.py#L1015-L1031 | train | Entry point for dx - build - app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.set_id | def set_id(self, dxid=None, name=None, alias=None):
'''
:param dxid: App ID
:type dxid: string
:param name: App name
:type name: string
:param alias: App version or tag
:type alias: string
:raises: :exc:`~dxpy.exceptions.DXError` if *dxid* and some other i... | python | def set_id(self, dxid=None, name=None, alias=None):
'''
:param dxid: App ID
:type dxid: string
:param name: App name
:type name: string
:param alias: App version or tag
:type alias: string
:raises: :exc:`~dxpy.exceptions.DXError` if *dxid* and some other i... | [
"def",
"set_id",
"(",
"self",
",",
"dxid",
"=",
"None",
",",
"name",
"=",
"None",
",",
"alias",
"=",
"None",
")",
":",
"self",
".",
"_dxid",
"=",
"None",
"self",
".",
"_name",
"=",
"None",
"self",
".",
"_alias",
"=",
"None",
"if",
"dxid",
"is",
... | :param dxid: App ID
:type dxid: string
:param name: App name
:type name: string
:param alias: App version or tag
:type alias: string
:raises: :exc:`~dxpy.exceptions.DXError` if *dxid* and some other input are both given or if neither *dxid* nor *name* are given
D... | [
":",
"param",
"dxid",
":",
"App",
"ID",
":",
"type",
"dxid",
":",
"string",
":",
"param",
"name",
":",
"App",
"name",
":",
"type",
"name",
":",
"string",
":",
"param",
"alias",
":",
"App",
"version",
"or",
"tag",
":",
"type",
"alias",
":",
"string"... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L84-L117 | train | Sets the ID of the currently stored handler. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.get_id | def get_id(self):
'''
:returns: Object ID of associated app
:rtype: string
Returns the object ID of the app that the handler is currently
associated with.
'''
if self._dxid is not None:
return self._dxid
else:
return 'app-' + self.... | python | def get_id(self):
'''
:returns: Object ID of associated app
:rtype: string
Returns the object ID of the app that the handler is currently
associated with.
'''
if self._dxid is not None:
return self._dxid
else:
return 'app-' + self.... | [
"def",
"get_id",
"(",
"self",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_dxid",
"else",
":",
"return",
"'app-'",
"+",
"self",
".",
"_name",
"+",
"'/'",
"+",
"self",
".",
"_alias"
] | :returns: Object ID of associated app
:rtype: string
Returns the object ID of the app that the handler is currently
associated with. | [
":",
"returns",
":",
"Object",
"ID",
"of",
"associated",
"app",
":",
"rtype",
":",
"string"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L119-L130 | train | Returns the object ID of the currently associated app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.new | def new(self, **kwargs):
'''
:param initializeFrom: ID of an existing app object from which to initialize the app
:type initializeFrom: string
:param applet: ID of the applet that the app will be created from
:type applet: string
:param name: Name of the app (inherits fro... | python | def new(self, **kwargs):
'''
:param initializeFrom: ID of an existing app object from which to initialize the app
:type initializeFrom: string
:param applet: ID of the applet that the app will be created from
:type applet: string
:param name: Name of the app (inherits fro... | [
"def",
"new",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"#TODO: add support for regionalOptions (and deprecate top-level applet and resources)",
"dx_hash",
"=",
"{",
"}",
"if",
"'applet'",
"not",
"in",
"kwargs",
"and",
"'initializeFrom'",
"not",
"in",
"kwargs",
... | :param initializeFrom: ID of an existing app object from which to initialize the app
:type initializeFrom: string
:param applet: ID of the applet that the app will be created from
:type applet: string
:param name: Name of the app (inherits from *initializeFrom* if possible)
:type... | [
":",
"param",
"initializeFrom",
":",
"ID",
"of",
"an",
"existing",
"app",
"object",
"from",
"which",
"to",
"initialize",
"the",
"app",
":",
"type",
"initializeFrom",
":",
"string",
":",
"param",
"applet",
":",
"ID",
"of",
"the",
"applet",
"that",
"the",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L132-L196 | train | Creates a new app with the given parameters. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.describe | def describe(self, fields=None, **kwargs):
'''
:param fields: Hash where the keys are field names that should be returned, and values should be set to True (default is that all fields are returned)
:type fields: dict
:returns: Description of the remote app object
:rtype: dict
... | python | def describe(self, fields=None, **kwargs):
'''
:param fields: Hash where the keys are field names that should be returned, and values should be set to True (default is that all fields are returned)
:type fields: dict
:returns: Description of the remote app object
:rtype: dict
... | [
"def",
"describe",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"describe_input",
"=",
"{",
"}",
"if",
"fields",
":",
"describe_input",
"[",
"'fields'",
"]",
"=",
"fields",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None... | :param fields: Hash where the keys are field names that should be returned, and values should be set to True (default is that all fields are returned)
:type fields: dict
:returns: Description of the remote app object
:rtype: dict
Returns a dict with a description of the app. The result
... | [
":",
"param",
"fields",
":",
"Hash",
"where",
"the",
"keys",
"are",
"field",
"names",
"that",
"should",
"be",
"returned",
"and",
"values",
"should",
"be",
"set",
"to",
"True",
"(",
"default",
"is",
"that",
"all",
"fields",
"are",
"returned",
")",
":",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L198-L221 | train | Returns a dict with the description of the app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.update | def update(self, **kwargs):
'''
:param applet: ID of the applet to replace the app's contents with
:type applet: string
:param details: Metadata to store with the app (optional)
:type details: dict or list
:param access: Access specification (optional)
:type acces... | python | def update(self, **kwargs):
'''
:param applet: ID of the applet to replace the app's contents with
:type applet: string
:param details: Metadata to store with the app (optional)
:type details: dict or list
:param access: Access specification (optional)
:type acces... | [
"def",
"update",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"updates",
"=",
"{",
"}",
"for",
"field",
"in",
"'applet'",
",",
"'billing'",
",",
"'access'",
",",
"'resources'",
",",
"'details'",
":",
"if",
"field",
"in",
"kwargs",
":",
"updates",
... | :param applet: ID of the applet to replace the app's contents with
:type applet: string
:param details: Metadata to store with the app (optional)
:type details: dict or list
:param access: Access specification (optional)
:type access: dict
:param resources: Specifies what... | [
":",
"param",
"applet",
":",
"ID",
"of",
"the",
"applet",
"to",
"replace",
"the",
"app",
"s",
"contents",
"with",
":",
"type",
"applet",
":",
"string",
":",
"param",
"details",
":",
"Metadata",
"to",
"store",
"with",
"the",
"app",
"(",
"optional",
")",... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L223-L252 | train | Updates the contents of the applet s resources and details of the app s resources container. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.add_tags | def add_tags(self, tags, **kwargs):
"""
:param tags: Tags to add to the app
:type tags: array
Adds the specified application name tags (aliases) to this app.
The current user must be a developer of the app.
"""
if self._dxid is not None:
return dxpy... | python | def add_tags(self, tags, **kwargs):
"""
:param tags: Tags to add to the app
:type tags: array
Adds the specified application name tags (aliases) to this app.
The current user must be a developer of the app.
"""
if self._dxid is not None:
return dxpy... | [
"def",
"add_tags",
"(",
"self",
",",
"tags",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_add_tags",
"(",
"self",
".",
"_dxid",
",",
"input_params",
"=",
"{",
"\"ta... | :param tags: Tags to add to the app
:type tags: array
Adds the specified application name tags (aliases) to this app.
The current user must be a developer of the app. | [
":",
"param",
"tags",
":",
"Tags",
"to",
"add",
"to",
"the",
"app",
":",
"type",
"tags",
":",
"array"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L254-L268 | train | Adds the specified tags to the app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.remove_tags | def remove_tags(self, tags, **kwargs):
"""
:param tags: Tags to remove from the app
:type tags: array
Removes the specified application name tags (aliases) from this
app, so that it is no longer addressable by those aliases.
The current user must be a developer of the a... | python | def remove_tags(self, tags, **kwargs):
"""
:param tags: Tags to remove from the app
:type tags: array
Removes the specified application name tags (aliases) from this
app, so that it is no longer addressable by those aliases.
The current user must be a developer of the a... | [
"def",
"remove_tags",
"(",
"self",
",",
"tags",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_remove_tags",
"(",
"self",
".",
"_dxid",
",",
"input_params",
"=",
"{",
... | :param tags: Tags to remove from the app
:type tags: array
Removes the specified application name tags (aliases) from this
app, so that it is no longer addressable by those aliases.
The current user must be a developer of the app. | [
":",
"param",
"tags",
":",
"Tags",
"to",
"remove",
"from",
"the",
"app",
":",
"type",
"tags",
":",
"array"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L277-L292 | train | Removes the specified tags from the app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.install | def install(self, **kwargs):
"""
Installs the app in the current user's account.
"""
if self._dxid is not None:
return dxpy.api.app_install(self._dxid, **kwargs)
else:
return dxpy.api.app_install('app-' + self._name, alias=self._alias, **kwargs) | python | def install(self, **kwargs):
"""
Installs the app in the current user's account.
"""
if self._dxid is not None:
return dxpy.api.app_install(self._dxid, **kwargs)
else:
return dxpy.api.app_install('app-' + self._name, alias=self._alias, **kwargs) | [
"def",
"install",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_install",
"(",
"self",
".",
"_dxid",
",",
"*",
"*",
"kwargs",
")",
"else",
":",
"retur... | Installs the app in the current user's account. | [
"Installs",
"the",
"app",
"in",
"the",
"current",
"user",
"s",
"account",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L301-L308 | train | Installs the app in the current user s account. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.uninstall | def uninstall(self, **kwargs):
"""
Uninstalls the app from the current user's account.
"""
if self._dxid is not None:
return dxpy.api.app_uninstall(self._dxid, **kwargs)
else:
return dxpy.api.app_uninstall('app-' + self._name, alias=self._alias, **kwargs) | python | def uninstall(self, **kwargs):
"""
Uninstalls the app from the current user's account.
"""
if self._dxid is not None:
return dxpy.api.app_uninstall(self._dxid, **kwargs)
else:
return dxpy.api.app_uninstall('app-' + self._name, alias=self._alias, **kwargs) | [
"def",
"uninstall",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_uninstall",
"(",
"self",
".",
"_dxid",
",",
"*",
"*",
"kwargs",
")",
"else",
":",
"r... | Uninstalls the app from the current user's account. | [
"Uninstalls",
"the",
"app",
"from",
"the",
"current",
"user",
"s",
"account",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L310-L317 | train | Uninstalls the app from the current user s account. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.get | def get(self, **kwargs):
"""
:returns: Full specification of the remote app object
:rtype: dict
Returns the contents of the app. The result includes the
key-value pairs as specified in the API documentation for the
`/app-xxxx/get
<https://wiki.dnanexus.com/API-Sp... | python | def get(self, **kwargs):
"""
:returns: Full specification of the remote app object
:rtype: dict
Returns the contents of the app. The result includes the
key-value pairs as specified in the API documentation for the
`/app-xxxx/get
<https://wiki.dnanexus.com/API-Sp... | [
"def",
"get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_get",
"(",
"self",
".",
"_dxid",
",",
"*",
"*",
"kwargs",
")",
"else",
":",
"return",
"d... | :returns: Full specification of the remote app object
:rtype: dict
Returns the contents of the app. The result includes the
key-value pairs as specified in the API documentation for the
`/app-xxxx/get
<https://wiki.dnanexus.com/API-Specification-v1.0.0/Apps#API-method%253A-%252F... | [
":",
"returns",
":",
"Full",
"specification",
"of",
"the",
"remote",
"app",
"object",
":",
"rtype",
":",
"dict"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L319-L333 | train | Returns the full specification of the remote app object. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.delete | def delete(self, **kwargs):
"""
Removes this app object from the platform.
The current user must be a developer of the app.
"""
if self._dxid is not None:
return dxpy.api.app_delete(self._dxid, **kwargs)
else:
return dxpy.api.app_delete('app-' + s... | python | def delete(self, **kwargs):
"""
Removes this app object from the platform.
The current user must be a developer of the app.
"""
if self._dxid is not None:
return dxpy.api.app_delete(self._dxid, **kwargs)
else:
return dxpy.api.app_delete('app-' + s... | [
"def",
"delete",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"return",
"dxpy",
".",
"api",
".",
"app_delete",
"(",
"self",
".",
"_dxid",
",",
"*",
"*",
"kwargs",
")",
"else",
":",
"return"... | Removes this app object from the platform.
The current user must be a developer of the app. | [
"Removes",
"this",
"app",
"object",
"from",
"the",
"platform",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L346-L355 | train | Removes this app object from the platform. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxapp.py | DXApp.run | def run(self, app_input, *args, **kwargs):
"""
Creates a new job that executes the function "main" of this app with
the given input *app_input*.
See :meth:`dxpy.bindings.dxapplet.DXExecutable.run` for the available
args.
"""
# Rename app_input to preserve API com... | python | def run(self, app_input, *args, **kwargs):
"""
Creates a new job that executes the function "main" of this app with
the given input *app_input*.
See :meth:`dxpy.bindings.dxapplet.DXExecutable.run` for the available
args.
"""
# Rename app_input to preserve API com... | [
"def",
"run",
"(",
"self",
",",
"app_input",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Rename app_input to preserve API compatibility when calling",
"# DXApp.run(app_input=...).",
"return",
"super",
"(",
"DXApp",
",",
"self",
")",
".",
"run",
"(",
... | Creates a new job that executes the function "main" of this app with
the given input *app_input*.
See :meth:`dxpy.bindings.dxapplet.DXExecutable.run` for the available
args. | [
"Creates",
"a",
"new",
"job",
"that",
"executes",
"the",
"function",
"main",
"of",
"this",
"app",
"with",
"the",
"given",
"input",
"*",
"app_input",
"*",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxapp.py#L380-L390 | train | Creates a new job that executes the function main of this app with the given input *app_input*. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _parse_executable_spec | def _parse_executable_spec(src_dir, json_file_name, parser):
"""
Returns the parsed contents of a json specification.
Raises WorkflowBuilderException (exit code 3) if this cannot be done.
"""
if not os.path.isdir(src_dir):
parser.error("{} is not a directory".format(src_dir))
if not os.... | python | def _parse_executable_spec(src_dir, json_file_name, parser):
"""
Returns the parsed contents of a json specification.
Raises WorkflowBuilderException (exit code 3) if this cannot be done.
"""
if not os.path.isdir(src_dir):
parser.error("{} is not a directory".format(src_dir))
if not os.... | [
"def",
"_parse_executable_spec",
"(",
"src_dir",
",",
"json_file_name",
",",
"parser",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"src_dir",
")",
":",
"parser",
".",
"error",
"(",
"\"{} is not a directory\"",
".",
"format",
"(",
"src_dir",
... | Returns the parsed contents of a json specification.
Raises WorkflowBuilderException (exit code 3) if this cannot be done. | [
"Returns",
"the",
"parsed",
"contents",
"of",
"a",
"json",
"specification",
".",
"Raises",
"WorkflowBuilderException",
"(",
"exit",
"code",
"3",
")",
"if",
"this",
"cannot",
"be",
"done",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L52-L69 | train | Parses a dxworkflow. json file into a list of dictionaries. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_destination_project | def _get_destination_project(json_spec, args, build_project_id=None):
"""
Returns destination project in which the workflow should be created.
In can be set in multiple ways whose order of precedence is:
1. --destination, -d option supplied with `dx build`,
2. 'project' specified in the json file,
... | python | def _get_destination_project(json_spec, args, build_project_id=None):
"""
Returns destination project in which the workflow should be created.
In can be set in multiple ways whose order of precedence is:
1. --destination, -d option supplied with `dx build`,
2. 'project' specified in the json file,
... | [
"def",
"_get_destination_project",
"(",
"json_spec",
",",
"args",
",",
"build_project_id",
"=",
"None",
")",
":",
"if",
"build_project_id",
":",
"return",
"build_project_id",
"if",
"'project'",
"in",
"json_spec",
":",
"return",
"json_spec",
"[",
"'project'",
"]",
... | Returns destination project in which the workflow should be created.
In can be set in multiple ways whose order of precedence is:
1. --destination, -d option supplied with `dx build`,
2. 'project' specified in the json file,
3. project set in the dxpy.WORKSPACE_ID environment variable. | [
"Returns",
"destination",
"project",
"in",
"which",
"the",
"workflow",
"should",
"be",
"created",
".",
"In",
"can",
"be",
"set",
"in",
"multiple",
"ways",
"whose",
"order",
"of",
"precedence",
"is",
":",
"1",
".",
"--",
"destination",
"-",
"d",
"option",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L72-L88 | train | Returns the project in which the workflow should be created. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_destination_folder | def _get_destination_folder(json_spec, folder_name=None):
"""
Returns destination project in which the workflow should be created.
It can be set in the json specification or by --destination option supplied
with `dx build`.
The order of precedence is:
1. --destination, -d option,
2. 'folder'... | python | def _get_destination_folder(json_spec, folder_name=None):
"""
Returns destination project in which the workflow should be created.
It can be set in the json specification or by --destination option supplied
with `dx build`.
The order of precedence is:
1. --destination, -d option,
2. 'folder'... | [
"def",
"_get_destination_folder",
"(",
"json_spec",
",",
"folder_name",
"=",
"None",
")",
":",
"dest_folder",
"=",
"folder_name",
"or",
"json_spec",
".",
"get",
"(",
"'folder'",
")",
"or",
"'/'",
"if",
"not",
"dest_folder",
".",
"endswith",
"(",
"'/'",
")",
... | Returns destination project in which the workflow should be created.
It can be set in the json specification or by --destination option supplied
with `dx build`.
The order of precedence is:
1. --destination, -d option,
2. 'folder' specified in the json file. | [
"Returns",
"destination",
"project",
"in",
"which",
"the",
"workflow",
"should",
"be",
"created",
".",
"It",
"can",
"be",
"set",
"in",
"the",
"json",
"specification",
"or",
"by",
"--",
"destination",
"option",
"supplied",
"with",
"dx",
"build",
".",
"The",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L91-L103 | train | Returns the folder name of the project where the workflow should be created. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _set_categories_on_workflow | def _set_categories_on_workflow(global_workflow_id, categories_to_set):
"""
Note: Categories are set on the workflow series level,
i.e. the same set applies to all versions.
"""
assert(isinstance(categories_to_set, list))
existing_categories = dxpy.api.global_workflow_list_categories(global_wor... | python | def _set_categories_on_workflow(global_workflow_id, categories_to_set):
"""
Note: Categories are set on the workflow series level,
i.e. the same set applies to all versions.
"""
assert(isinstance(categories_to_set, list))
existing_categories = dxpy.api.global_workflow_list_categories(global_wor... | [
"def",
"_set_categories_on_workflow",
"(",
"global_workflow_id",
",",
"categories_to_set",
")",
":",
"assert",
"(",
"isinstance",
"(",
"categories_to_set",
",",
"list",
")",
")",
"existing_categories",
"=",
"dxpy",
".",
"api",
".",
"global_workflow_list_categories",
"... | Note: Categories are set on the workflow series level,
i.e. the same set applies to all versions. | [
"Note",
":",
"Categories",
"are",
"set",
"on",
"the",
"workflow",
"series",
"level",
"i",
".",
"e",
".",
"the",
"same",
"set",
"applies",
"to",
"all",
"versions",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L122-L137 | train | Sets the categories on the given global workflow. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _version_exists | def _version_exists(json_spec, name=None, version=None):
"""
Returns True if a global workflow with the given name and version
already exists in the platform and the user has developer rights
to the workflow. "name" and "version" can be passed if we already
made a "describe" API call on the global w... | python | def _version_exists(json_spec, name=None, version=None):
"""
Returns True if a global workflow with the given name and version
already exists in the platform and the user has developer rights
to the workflow. "name" and "version" can be passed if we already
made a "describe" API call on the global w... | [
"def",
"_version_exists",
"(",
"json_spec",
",",
"name",
"=",
"None",
",",
"version",
"=",
"None",
")",
":",
"requested_name",
"=",
"json_spec",
"[",
"'name'",
"]",
"requested_version",
"=",
"json_spec",
"[",
"'version'",
"]",
"if",
"requested_name",
"==",
"... | Returns True if a global workflow with the given name and version
already exists in the platform and the user has developer rights
to the workflow. "name" and "version" can be passed if we already
made a "describe" API call on the global workflow and so know the
requested name and version already exists... | [
"Returns",
"True",
"if",
"a",
"global",
"workflow",
"with",
"the",
"given",
"name",
"and",
"version",
"already",
"exists",
"in",
"the",
"platform",
"and",
"the",
"user",
"has",
"developer",
"rights",
"to",
"the",
"workflow",
".",
"name",
"and",
"version",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L140-L163 | train | Returns True if a global workflow with the given name and version already exists in the platform. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | validate_ignore_reuse | def validate_ignore_reuse(stages, ignore_reuse_stages):
"""
Checks if each stage ID specified in ignore_reuse_stages exists in
the workflow definition. If ignore_reuse_stages contains
only '*', the field is valid.
"""
if not isinstance(ignore_reuse_stages, list):
raise WorkflowBuilderEx... | python | def validate_ignore_reuse(stages, ignore_reuse_stages):
"""
Checks if each stage ID specified in ignore_reuse_stages exists in
the workflow definition. If ignore_reuse_stages contains
only '*', the field is valid.
"""
if not isinstance(ignore_reuse_stages, list):
raise WorkflowBuilderEx... | [
"def",
"validate_ignore_reuse",
"(",
"stages",
",",
"ignore_reuse_stages",
")",
":",
"if",
"not",
"isinstance",
"(",
"ignore_reuse_stages",
",",
"list",
")",
":",
"raise",
"WorkflowBuilderException",
"(",
"'\"IgnoreReuse must be a list of strings - stage IDs or \"*\"'",
")"... | Checks if each stage ID specified in ignore_reuse_stages exists in
the workflow definition. If ignore_reuse_stages contains
only '*', the field is valid. | [
"Checks",
"if",
"each",
"stage",
"ID",
"specified",
"in",
"ignore_reuse_stages",
"exists",
"in",
"the",
"workflow",
"definition",
".",
"If",
"ignore_reuse_stages",
"contains",
"only",
"*",
"the",
"field",
"is",
"valid",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L183-L200 | train | Checks if the given list of stages contains a valid entry in the order they are not used. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_validated_stages | def _get_validated_stages(stages):
"""
Validates stages of the workflow as a list of dictionaries.
"""
if not isinstance(stages, list):
raise WorkflowBuilderException("Stages must be specified as a list of dictionaries")
validated_stages = []
for index, stage in enumerate(stages):
... | python | def _get_validated_stages(stages):
"""
Validates stages of the workflow as a list of dictionaries.
"""
if not isinstance(stages, list):
raise WorkflowBuilderException("Stages must be specified as a list of dictionaries")
validated_stages = []
for index, stage in enumerate(stages):
... | [
"def",
"_get_validated_stages",
"(",
"stages",
")",
":",
"if",
"not",
"isinstance",
"(",
"stages",
",",
"list",
")",
":",
"raise",
"WorkflowBuilderException",
"(",
"\"Stages must be specified as a list of dictionaries\"",
")",
"validated_stages",
"=",
"[",
"]",
"for",... | Validates stages of the workflow as a list of dictionaries. | [
"Validates",
"stages",
"of",
"the",
"workflow",
"as",
"a",
"list",
"of",
"dictionaries",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L203-L212 | train | Validates the given stages and returns a list of dictionaries. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _validate_json_for_regular_workflow | def _validate_json_for_regular_workflow(json_spec, args):
"""
Validates fields used only for building a regular, project-based workflow.
"""
validated = {}
override_project_id, override_folder, override_workflow_name = \
dxpy.executable_builder.get_parsed_destination(args.destination)
va... | python | def _validate_json_for_regular_workflow(json_spec, args):
"""
Validates fields used only for building a regular, project-based workflow.
"""
validated = {}
override_project_id, override_folder, override_workflow_name = \
dxpy.executable_builder.get_parsed_destination(args.destination)
va... | [
"def",
"_validate_json_for_regular_workflow",
"(",
"json_spec",
",",
"args",
")",
":",
"validated",
"=",
"{",
"}",
"override_project_id",
",",
"override_folder",
",",
"override_workflow_name",
"=",
"dxpy",
".",
"executable_builder",
".",
"get_parsed_destination",
"(",
... | Validates fields used only for building a regular, project-based workflow. | [
"Validates",
"fields",
"used",
"only",
"for",
"building",
"a",
"regular",
"project",
"-",
"based",
"workflow",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L215-L230 | train | Validates the JSON spec for a regular project - based workflow. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _validate_json_for_global_workflow | def _validate_json_for_global_workflow(json_spec, args):
"""
Validates fields used for building a global workflow.
Since building a global workflow is done after all the underlying workflows
are built, which may be time-consuming, we validate as much as possible here.
"""
# TODO: verify the bill... | python | def _validate_json_for_global_workflow(json_spec, args):
"""
Validates fields used for building a global workflow.
Since building a global workflow is done after all the underlying workflows
are built, which may be time-consuming, we validate as much as possible here.
"""
# TODO: verify the bill... | [
"def",
"_validate_json_for_global_workflow",
"(",
"json_spec",
",",
"args",
")",
":",
"# TODO: verify the billTo can build the workflow",
"# TODO: if the global workflow build fails add an option to interactively change billto",
"# TODO: (or other simple fields) instead of failing altogether",
... | Validates fields used for building a global workflow.
Since building a global workflow is done after all the underlying workflows
are built, which may be time-consuming, we validate as much as possible here. | [
"Validates",
"fields",
"used",
"for",
"building",
"a",
"global",
"workflow",
".",
"Since",
"building",
"a",
"global",
"workflow",
"is",
"done",
"after",
"all",
"the",
"underlying",
"workflows",
"are",
"built",
"which",
"may",
"be",
"time",
"-",
"consuming",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L233-L271 | train | Validates the JSON spec for a global workflow. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_validated_json | def _get_validated_json(json_spec, args):
"""
Validates dxworkflow.json and returns the json that can be sent with the
/workflow/new API or /globalworkflow/new request.
"""
if not json_spec:
return
if not args:
return
validated_spec = copy.deepcopy(json_spec)
# print ig... | python | def _get_validated_json(json_spec, args):
"""
Validates dxworkflow.json and returns the json that can be sent with the
/workflow/new API or /globalworkflow/new request.
"""
if not json_spec:
return
if not args:
return
validated_spec = copy.deepcopy(json_spec)
# print ig... | [
"def",
"_get_validated_json",
"(",
"json_spec",
",",
"args",
")",
":",
"if",
"not",
"json_spec",
":",
"return",
"if",
"not",
"args",
":",
"return",
"validated_spec",
"=",
"copy",
".",
"deepcopy",
"(",
"json_spec",
")",
"# print ignored keys if present in json_spec... | Validates dxworkflow.json and returns the json that can be sent with the
/workflow/new API or /globalworkflow/new request. | [
"Validates",
"dxworkflow",
".",
"json",
"and",
"returns",
"the",
"json",
"that",
"can",
"be",
"sent",
"with",
"the",
"/",
"workflow",
"/",
"new",
"API",
"or",
"/",
"globalworkflow",
"/",
"new",
"request",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L274-L317 | train | Validates dxworkflow. json and returns the json that can be sent with the dxworkflow API or globalworkflow API or dxworkflow. new API or dxworkflow. new API or dxworkflow. new API or dxworkflow. new API. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_validated_json_for_build_or_update | def _get_validated_json_for_build_or_update(json_spec, args):
"""
Validates those fields that can be used when either building
a new version (of a local, project-based workflow) or updating
an existing version (of a global workflow).
"""
validated = copy.deepcopy(json_spec)
dxpy.executable_... | python | def _get_validated_json_for_build_or_update(json_spec, args):
"""
Validates those fields that can be used when either building
a new version (of a local, project-based workflow) or updating
an existing version (of a global workflow).
"""
validated = copy.deepcopy(json_spec)
dxpy.executable_... | [
"def",
"_get_validated_json_for_build_or_update",
"(",
"json_spec",
",",
"args",
")",
":",
"validated",
"=",
"copy",
".",
"deepcopy",
"(",
"json_spec",
")",
"dxpy",
".",
"executable_builder",
".",
"inline_documentation_files",
"(",
"validated",
",",
"args",
".",
"... | Validates those fields that can be used when either building
a new version (of a local, project-based workflow) or updating
an existing version (of a global workflow). | [
"Validates",
"those",
"fields",
"that",
"can",
"be",
"used",
"when",
"either",
"building",
"a",
"new",
"version",
"(",
"of",
"a",
"local",
"project",
"-",
"based",
"workflow",
")",
"or",
"updating",
"an",
"existing",
"version",
"(",
"of",
"a",
"global",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L320-L339 | train | Validates that the json_spec is valid and returns the json_spec that can be used to build or update the current version of the current project. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _assert_executable_regions_match | def _assert_executable_regions_match(workflow_enabled_regions, workflow_spec):
"""
Check if the global workflow regions and the regions of stages (apps) match.
If the workflow contains any applets, the workflow can be currently enabled
in only one region - the region in which the applets are stored.
... | python | def _assert_executable_regions_match(workflow_enabled_regions, workflow_spec):
"""
Check if the global workflow regions and the regions of stages (apps) match.
If the workflow contains any applets, the workflow can be currently enabled
in only one region - the region in which the applets are stored.
... | [
"def",
"_assert_executable_regions_match",
"(",
"workflow_enabled_regions",
",",
"workflow_spec",
")",
":",
"executables",
"=",
"[",
"i",
".",
"get",
"(",
"\"executable\"",
")",
"for",
"i",
"in",
"workflow_spec",
".",
"get",
"(",
"\"stages\"",
")",
"]",
"for",
... | Check if the global workflow regions and the regions of stages (apps) match.
If the workflow contains any applets, the workflow can be currently enabled
in only one region - the region in which the applets are stored. | [
"Check",
"if",
"the",
"global",
"workflow",
"regions",
"and",
"the",
"regions",
"of",
"stages",
"(",
"apps",
")",
"match",
".",
"If",
"the",
"workflow",
"contains",
"any",
"applets",
"the",
"workflow",
"can",
"be",
"currently",
"enabled",
"in",
"only",
"on... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L342-L373 | train | Checks if the global workflow regions and the regions of the executables of the workflow are all matching. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _build_regular_workflow | def _build_regular_workflow(json_spec):
"""
Precondition: json_spec must be validated
"""
workflow_id = dxpy.api.workflow_new(json_spec)["id"]
dxpy.api.workflow_close(workflow_id)
return workflow_id | python | def _build_regular_workflow(json_spec):
"""
Precondition: json_spec must be validated
"""
workflow_id = dxpy.api.workflow_new(json_spec)["id"]
dxpy.api.workflow_close(workflow_id)
return workflow_id | [
"def",
"_build_regular_workflow",
"(",
"json_spec",
")",
":",
"workflow_id",
"=",
"dxpy",
".",
"api",
".",
"workflow_new",
"(",
"json_spec",
")",
"[",
"\"id\"",
"]",
"dxpy",
".",
"api",
".",
"workflow_close",
"(",
"workflow_id",
")",
"return",
"workflow_id"
] | Precondition: json_spec must be validated | [
"Precondition",
":",
"json_spec",
"must",
"be",
"validated"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L376-L382 | train | Builds a regular workflow. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _get_validated_enabled_regions | def _get_validated_enabled_regions(json_spec, from_command_line):
"""
Returns a set of regions (region names) in which the global workflow
should be enabled. Also validates and synchronizes the regions
passed via CLI argument and in the regionalOptions field.
"""
enabled_regions = dxpy.executabl... | python | def _get_validated_enabled_regions(json_spec, from_command_line):
"""
Returns a set of regions (region names) in which the global workflow
should be enabled. Also validates and synchronizes the regions
passed via CLI argument and in the regionalOptions field.
"""
enabled_regions = dxpy.executabl... | [
"def",
"_get_validated_enabled_regions",
"(",
"json_spec",
",",
"from_command_line",
")",
":",
"enabled_regions",
"=",
"dxpy",
".",
"executable_builder",
".",
"get_enabled_regions",
"(",
"'globalworkflow'",
",",
"json_spec",
",",
"from_command_line",
",",
"WorkflowBuilder... | Returns a set of regions (region names) in which the global workflow
should be enabled. Also validates and synchronizes the regions
passed via CLI argument and in the regionalOptions field. | [
"Returns",
"a",
"set",
"of",
"regions",
"(",
"region",
"names",
")",
"in",
"which",
"the",
"global",
"workflow",
"should",
"be",
"enabled",
".",
"Also",
"validates",
"and",
"synchronizes",
"the",
"regions",
"passed",
"via",
"CLI",
"argument",
"and",
"in",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L385-L410 | train | Returns a set of regions in which the global workflow
should be enabled. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _create_temporary_projects | def _create_temporary_projects(enabled_regions, args):
"""
Creates a temporary project needed to build an underlying workflow
for a global workflow. Returns a dictionary with region names as keys
and project IDs as values
The regions in which projects will be created can be:
i. regions specifie... | python | def _create_temporary_projects(enabled_regions, args):
"""
Creates a temporary project needed to build an underlying workflow
for a global workflow. Returns a dictionary with region names as keys
and project IDs as values
The regions in which projects will be created can be:
i. regions specifie... | [
"def",
"_create_temporary_projects",
"(",
"enabled_regions",
",",
"args",
")",
":",
"# Create one temp project in each region",
"projects_by_region",
"=",
"{",
"}",
"# Project IDs by region",
"for",
"region",
"in",
"enabled_regions",
":",
"try",
":",
"project_input",
"=",... | Creates a temporary project needed to build an underlying workflow
for a global workflow. Returns a dictionary with region names as keys
and project IDs as values
The regions in which projects will be created can be:
i. regions specified in dxworkflow.json "regionalOptions"
ii. regions specified as... | [
"Creates",
"a",
"temporary",
"project",
"needed",
"to",
"build",
"an",
"underlying",
"workflow",
"for",
"a",
"global",
"workflow",
".",
"Returns",
"a",
"dictionary",
"with",
"region",
"names",
"as",
"keys",
"and",
"project",
"IDs",
"as",
"values"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L413-L441 | train | Creates a temporary project for each region in enabled_regions and creates a temporary project for each region in enabled_regions. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _build_underlying_workflows | def _build_underlying_workflows(enabled_regions, json_spec, args):
"""
Creates a workflow in a temporary project for each enabled region.
Returns a tuple of dictionaries: workflow IDs by region and project IDs by region.
The caller is responsible for destroying the projects if this method returns proper... | python | def _build_underlying_workflows(enabled_regions, json_spec, args):
"""
Creates a workflow in a temporary project for each enabled region.
Returns a tuple of dictionaries: workflow IDs by region and project IDs by region.
The caller is responsible for destroying the projects if this method returns proper... | [
"def",
"_build_underlying_workflows",
"(",
"enabled_regions",
",",
"json_spec",
",",
"args",
")",
":",
"projects_by_region",
"=",
"_create_temporary_projects",
"(",
"enabled_regions",
",",
"args",
")",
"workflows_by_region",
"=",
"{",
"}",
"try",
":",
"for",
"region... | Creates a workflow in a temporary project for each enabled region.
Returns a tuple of dictionaries: workflow IDs by region and project IDs by region.
The caller is responsible for destroying the projects if this method returns properly. | [
"Creates",
"a",
"workflow",
"in",
"a",
"temporary",
"project",
"for",
"each",
"enabled",
"region",
".",
"Returns",
"a",
"tuple",
"of",
"dictionaries",
":",
"workflow",
"IDs",
"by",
"region",
"and",
"project",
"IDs",
"by",
"region",
".",
"The",
"caller",
"i... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L444-L465 | train | Creates a workflow in a temporary project for each enabled region. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _build_global_workflow | def _build_global_workflow(json_spec, args):
"""
Creates a workflow in a temporary project for each enabled region
and builds a global workflow on the platform based on these workflows.
"""
# First determine in which regions the global workflow needs to be available
enabled_regions = _get_valida... | python | def _build_global_workflow(json_spec, args):
"""
Creates a workflow in a temporary project for each enabled region
and builds a global workflow on the platform based on these workflows.
"""
# First determine in which regions the global workflow needs to be available
enabled_regions = _get_valida... | [
"def",
"_build_global_workflow",
"(",
"json_spec",
",",
"args",
")",
":",
"# First determine in which regions the global workflow needs to be available",
"enabled_regions",
"=",
"_get_validated_enabled_regions",
"(",
"json_spec",
",",
"args",
".",
"region",
")",
"# Verify all t... | Creates a workflow in a temporary project for each enabled region
and builds a global workflow on the platform based on these workflows. | [
"Creates",
"a",
"workflow",
"in",
"a",
"temporary",
"project",
"for",
"each",
"enabled",
"region",
"and",
"builds",
"a",
"global",
"workflow",
"on",
"the",
"platform",
"based",
"on",
"these",
"workflows",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L468-L524 | train | Builds a global workflow for each enabled region and creates a new global workflow on the platform based on these workflows. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | _build_or_update_workflow | def _build_or_update_workflow(json_spec, args):
"""
Creates or updates a workflow on the platform.
Returns the workflow ID, or None if the workflow cannot be created.
"""
try:
if args.mode == 'workflow':
json_spec = _get_validated_json(json_spec, args)
workflow_id = _... | python | def _build_or_update_workflow(json_spec, args):
"""
Creates or updates a workflow on the platform.
Returns the workflow ID, or None if the workflow cannot be created.
"""
try:
if args.mode == 'workflow':
json_spec = _get_validated_json(json_spec, args)
workflow_id = _... | [
"def",
"_build_or_update_workflow",
"(",
"json_spec",
",",
"args",
")",
":",
"try",
":",
"if",
"args",
".",
"mode",
"==",
"'workflow'",
":",
"json_spec",
"=",
"_get_validated_json",
"(",
"json_spec",
",",
"args",
")",
"workflow_id",
"=",
"_build_regular_workflow... | Creates or updates a workflow on the platform.
Returns the workflow ID, or None if the workflow cannot be created. | [
"Creates",
"or",
"updates",
"a",
"workflow",
"on",
"the",
"platform",
".",
"Returns",
"the",
"workflow",
"ID",
"or",
"None",
"if",
"the",
"workflow",
"cannot",
"be",
"created",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L571-L598 | train | Builds or updates a workflow on the platform. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/workflow_builder.py | build | def build(args, parser):
"""
Validates workflow source directory and creates a new (global) workflow based on it.
Raises: WorkflowBuilderException if the workflow cannot be created.
"""
if args is None:
raise Exception("arguments not provided")
try:
json_spec = _parse_executabl... | python | def build(args, parser):
"""
Validates workflow source directory and creates a new (global) workflow based on it.
Raises: WorkflowBuilderException if the workflow cannot be created.
"""
if args is None:
raise Exception("arguments not provided")
try:
json_spec = _parse_executabl... | [
"def",
"build",
"(",
"args",
",",
"parser",
")",
":",
"if",
"args",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"arguments not provided\"",
")",
"try",
":",
"json_spec",
"=",
"_parse_executable_spec",
"(",
"args",
".",
"src_dir",
",",
"\"dxworkflow.json\""... | Validates workflow source directory and creates a new (global) workflow based on it.
Raises: WorkflowBuilderException if the workflow cannot be created. | [
"Validates",
"workflow",
"source",
"directory",
"and",
"creates",
"a",
"new",
"(",
"global",
")",
"workflow",
"based",
"on",
"it",
".",
"Raises",
":",
"WorkflowBuilderException",
"if",
"the",
"workflow",
"cannot",
"be",
"created",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L612-L627 | train | Builds a new global workflow based on the given arguments. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/cli/cp.py | cp_to_noexistent_destination | def cp_to_noexistent_destination(args, dest_path, dx_dest, dest_proj):
''' Copy the source to a destination that does not currently
exist. This involves creating the target file/folder.
'''
# Destination folder path is new => renaming
if len(args.sources) != 1:
# Can't copy and rename more t... | python | def cp_to_noexistent_destination(args, dest_path, dx_dest, dest_proj):
''' Copy the source to a destination that does not currently
exist. This involves creating the target file/folder.
'''
# Destination folder path is new => renaming
if len(args.sources) != 1:
# Can't copy and rename more t... | [
"def",
"cp_to_noexistent_destination",
"(",
"args",
",",
"dest_path",
",",
"dx_dest",
",",
"dest_proj",
")",
":",
"# Destination folder path is new => renaming",
"if",
"len",
"(",
"args",
".",
"sources",
")",
"!=",
"1",
":",
"# Can't copy and rename more than one object... | Copy the source to a destination that does not currently
exist. This involves creating the target file/folder. | [
"Copy",
"the",
"source",
"to",
"a",
"destination",
"that",
"does",
"not",
"currently",
"exist",
".",
"This",
"involves",
"creating",
"the",
"target",
"file",
"/",
"folder",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/cli/cp.py#L34-L107 | train | Copy the source to a destination that does not currently have a corresponding object. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | _readable_part_size | def _readable_part_size(num_bytes):
"Returns the file size in readable form."
B = num_bytes
KB = float(1024)
MB = float(KB * 1024)
GB = float(MB * 1024)
TB = float(GB * 1024)
if B < KB:
return '{0} {1}'.format(B, 'bytes' if B != 1 else 'byte')
elif KB <= B < MB:
return '... | python | def _readable_part_size(num_bytes):
"Returns the file size in readable form."
B = num_bytes
KB = float(1024)
MB = float(KB * 1024)
GB = float(MB * 1024)
TB = float(GB * 1024)
if B < KB:
return '{0} {1}'.format(B, 'bytes' if B != 1 else 'byte')
elif KB <= B < MB:
return '... | [
"def",
"_readable_part_size",
"(",
"num_bytes",
")",
":",
"B",
"=",
"num_bytes",
"KB",
"=",
"float",
"(",
"1024",
")",
"MB",
"=",
"float",
"(",
"KB",
"*",
"1024",
")",
"GB",
"=",
"float",
"(",
"MB",
"*",
"1024",
")",
"TB",
"=",
"float",
"(",
"GB"... | Returns the file size in readable form. | [
"Returns",
"the",
"file",
"size",
"in",
"readable",
"form",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L62-L79 | train | Returns the file size in readable form. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile._new | def _new(self, dx_hash, media_type=None, **kwargs):
"""
:param dx_hash: Standard hash populated in :func:`dxpy.bindings.DXDataObject.new()` containing attributes common to all data object classes.
:type dx_hash: dict
:param media_type: Internet Media Type
:type media_type: string... | python | def _new(self, dx_hash, media_type=None, **kwargs):
"""
:param dx_hash: Standard hash populated in :func:`dxpy.bindings.DXDataObject.new()` containing attributes common to all data object classes.
:type dx_hash: dict
:param media_type: Internet Media Type
:type media_type: string... | [
"def",
"_new",
"(",
"self",
",",
"dx_hash",
",",
"media_type",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"media_type",
"is",
"not",
"None",
":",
"dx_hash",
"[",
"\"media\"",
"]",
"=",
"media_type",
"resp",
"=",
"dxpy",
".",
"api",
".",
... | :param dx_hash: Standard hash populated in :func:`dxpy.bindings.DXDataObject.new()` containing attributes common to all data object classes.
:type dx_hash: dict
:param media_type: Internet Media Type
:type media_type: string
Creates a new remote file with media type *media_type*, if giv... | [
":",
"param",
"dx_hash",
":",
"Standard",
"hash",
"populated",
"in",
":",
"func",
":",
"dxpy",
".",
"bindings",
".",
"DXDataObject",
".",
"new",
"()",
"containing",
"attributes",
"common",
"to",
"all",
"data",
"object",
"classes",
".",
":",
"type",
"dx_has... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L256-L271 | train | Create a new remote file with the given hash and media type. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.set_ids | def set_ids(self, dxid, project=None):
'''
:param dxid: Object ID
:type dxid: string
:param project: Project ID
:type project: string
Discards the currently stored ID and associates the handler with
*dxid*. As a side effect, it also flushes the buffer for the
... | python | def set_ids(self, dxid, project=None):
'''
:param dxid: Object ID
:type dxid: string
:param project: Project ID
:type project: string
Discards the currently stored ID and associates the handler with
*dxid*. As a side effect, it also flushes the buffer for the
... | [
"def",
"set_ids",
"(",
"self",
",",
"dxid",
",",
"project",
"=",
"None",
")",
":",
"if",
"self",
".",
"_dxid",
"is",
"not",
"None",
":",
"self",
".",
"flush",
"(",
")",
"DXDataObject",
".",
"set_ids",
"(",
"self",
",",
"dxid",
",",
"project",
")",
... | :param dxid: Object ID
:type dxid: string
:param project: Project ID
:type project: string
Discards the currently stored ID and associates the handler with
*dxid*. As a side effect, it also flushes the buffer for the
previous file object if the buffer is nonempty. | [
":",
"param",
"dxid",
":",
"Object",
"ID",
":",
"type",
"dxid",
":",
"string",
":",
"param",
"project",
":",
"Project",
"ID",
":",
"type",
"project",
":",
"string"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L355-L375 | train | Sets the IDs of the currently stored object. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.seek | def seek(self, offset, from_what=os.SEEK_SET):
'''
:param offset: Position in the file to seek to
:type offset: integer
Seeks to *offset* bytes from the beginning of the file. This is a no-op if the file is open for writing.
The position is computed from adding *offset* to a r... | python | def seek(self, offset, from_what=os.SEEK_SET):
'''
:param offset: Position in the file to seek to
:type offset: integer
Seeks to *offset* bytes from the beginning of the file. This is a no-op if the file is open for writing.
The position is computed from adding *offset* to a r... | [
"def",
"seek",
"(",
"self",
",",
"offset",
",",
"from_what",
"=",
"os",
".",
"SEEK_SET",
")",
":",
"if",
"from_what",
"==",
"os",
".",
"SEEK_SET",
":",
"reference_pos",
"=",
"0",
"elif",
"from_what",
"==",
"os",
".",
"SEEK_CUR",
":",
"reference_pos",
"... | :param offset: Position in the file to seek to
:type offset: integer
Seeks to *offset* bytes from the beginning of the file. This is a no-op if the file is open for writing.
The position is computed from adding *offset* to a reference point; the reference point is selected by the
*fro... | [
":",
"param",
"offset",
":",
"Position",
"in",
"the",
"file",
"to",
"seek",
"to",
":",
"type",
"offset",
":",
"integer"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L377-L434 | train | Seeks to a specific offset in the file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.flush | def flush(self, multithread=True, **kwargs):
'''
Flushes the internal write buffer.
'''
if self._write_buf.tell() > 0:
data = self._write_buf.getvalue()
self._write_buf = BytesIO()
if multithread:
self._async_upload_part_request(data, ... | python | def flush(self, multithread=True, **kwargs):
'''
Flushes the internal write buffer.
'''
if self._write_buf.tell() > 0:
data = self._write_buf.getvalue()
self._write_buf = BytesIO()
if multithread:
self._async_upload_part_request(data, ... | [
"def",
"flush",
"(",
"self",
",",
"multithread",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_write_buf",
".",
"tell",
"(",
")",
">",
"0",
":",
"data",
"=",
"self",
".",
"_write_buf",
".",
"getvalue",
"(",
")",
"self",
"."... | Flushes the internal write buffer. | [
"Flushes",
"the",
"internal",
"write",
"buffer",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L445-L467 | train | Flushes the internal write buffer. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile._write2 | def _write2(self, data, multithread=True, **kwargs):
'''
:param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. no... | python | def _write2(self, data, multithread=True, **kwargs):
'''
:param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. no... | [
"def",
"_write2",
"(",
"self",
",",
"data",
",",
"multithread",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"USING_PYTHON2",
":",
"assert",
"(",
"isinstance",
"(",
"data",
",",
"bytes",
")",
")",
"self",
".",
"_ensure_write_bufsize",
"... | :param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. note::
Writing to remote files is append-only. Using :meth:`se... | [
":",
"param",
"data",
":",
"Data",
"to",
"be",
"written",
":",
"type",
"data",
":",
"str",
"or",
"mmap",
"object",
":",
"param",
"multithread",
":",
"If",
"True",
"sends",
"multiple",
"write",
"requests",
"asynchronously",
":",
"type",
"multithread",
":",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L493-L549 | train | Write to the file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.write | def write(self, data, multithread=True, **kwargs):
'''
:param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. note... | python | def write(self, data, multithread=True, **kwargs):
'''
:param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. note... | [
"def",
"write",
"(",
"self",
",",
"data",
",",
"multithread",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"USING_PYTHON2",
":",
"self",
".",
"_write2",
"(",
"data",
",",
"multithread",
"=",
"multithread",
",",
"*",
"*",
"kwargs",
")",
"else... | :param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. note::
Writing to remote files is append-only. Using :meth:`se... | [
":",
"param",
"data",
":",
"Data",
"to",
"be",
"written",
":",
"type",
"data",
":",
"str",
"or",
"mmap",
"object",
":",
"param",
"multithread",
":",
"If",
"True",
"sends",
"multiple",
"write",
"requests",
"asynchronously",
":",
"type",
"multithread",
":",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L551-L590 | train | Writes the data to the file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.close | def close(self, block=False, **kwargs):
'''
:param block: If True, this function blocks until the remote file has closed.
:type block: boolean
Attempts to close the file.
.. note:: The remote file cannot be closed until all parts have
been fully uploaded. An exceptio... | python | def close(self, block=False, **kwargs):
'''
:param block: If True, this function blocks until the remote file has closed.
:type block: boolean
Attempts to close the file.
.. note:: The remote file cannot be closed until all parts have
been fully uploaded. An exceptio... | [
"def",
"close",
"(",
"self",
",",
"block",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"flush",
"(",
"*",
"*",
"kwargs",
")",
"# Also populates emptyLastPartAllowed",
"self",
".",
"_ensure_write_bufsize",
"(",
"*",
"*",
"kwargs",
")",
"... | :param block: If True, this function blocks until the remote file has closed.
:type block: boolean
Attempts to close the file.
.. note:: The remote file cannot be closed until all parts have
been fully uploaded. An exception will be thrown if this is
not the case. | [
":",
"param",
"block",
":",
"If",
"True",
"this",
"function",
"blocks",
"until",
"the",
"remote",
"file",
"has",
"closed",
".",
":",
"type",
"block",
":",
"boolean"
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L604-L639 | train | Closes the remote file. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.upload_part | def upload_part(self, data, index=None, display_progress=False, report_progress_fn=None, **kwargs):
"""
:param data: Data to be uploaded in this part
:type data: str or mmap object, bytes on python3
:param index: Index of part to be uploaded; must be in [1, 10000]
:type index: in... | python | def upload_part(self, data, index=None, display_progress=False, report_progress_fn=None, **kwargs):
"""
:param data: Data to be uploaded in this part
:type data: str or mmap object, bytes on python3
:param index: Index of part to be uploaded; must be in [1, 10000]
:type index: in... | [
"def",
"upload_part",
"(",
"self",
",",
"data",
",",
"index",
"=",
"None",
",",
"display_progress",
"=",
"False",
",",
"report_progress_fn",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"USING_PYTHON2",
":",
"# In python3, the underlying system... | :param data: Data to be uploaded in this part
:type data: str or mmap object, bytes on python3
:param index: Index of part to be uploaded; must be in [1, 10000]
:type index: integer
:param display_progress: Whether to print "." to stderr when done
:type display_progress: boolean
... | [
":",
"param",
"data",
":",
"Data",
"to",
"be",
"uploaded",
"in",
"this",
"part",
":",
"type",
"data",
":",
"str",
"or",
"mmap",
"object",
"bytes",
"on",
"python3",
":",
"param",
"index",
":",
"Index",
"of",
"part",
"to",
"be",
"uploaded",
";",
"must"... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L651-L727 | train | Uploads a part of data to the local file system. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile.get_download_url | def get_download_url(self, duration=None, preauthenticated=False, filename=None, project=None, **kwargs):
"""
:param duration: number of seconds for which the generated URL will be
valid, should only be specified when preauthenticated is True
:type duration: int
:param preaut... | python | def get_download_url(self, duration=None, preauthenticated=False, filename=None, project=None, **kwargs):
"""
:param duration: number of seconds for which the generated URL will be
valid, should only be specified when preauthenticated is True
:type duration: int
:param preaut... | [
"def",
"get_download_url",
"(",
"self",
",",
"duration",
"=",
"None",
",",
"preauthenticated",
"=",
"False",
",",
"filename",
"=",
"None",
",",
"project",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"args",
"=",
"{",
"\"preauthenticated\"",
":",
"pre... | :param duration: number of seconds for which the generated URL will be
valid, should only be specified when preauthenticated is True
:type duration: int
:param preauthenticated: if True, generates a 'preauthenticated'
download URL, which embeds authentication info in the URL and ... | [
":",
"param",
"duration",
":",
"number",
"of",
"seconds",
"for",
"which",
"the",
"generated",
"URL",
"will",
"be",
"valid",
"should",
"only",
"be",
"specified",
"when",
"preauthenticated",
"is",
"True",
":",
"type",
"duration",
":",
"int",
":",
"param",
"p... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L729-L820 | train | Generates a download URL for the specified file and optional duration. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxfile.py | DXFile._read2 | def _read2(self, length=None, use_compression=None, project=None, **kwargs):
'''
:param length: Maximum number of bytes to be read
:type length: integer
:param project: project to use as context for this download (may affect
which billing account is billed for this download).... | python | def _read2(self, length=None, use_compression=None, project=None, **kwargs):
'''
:param length: Maximum number of bytes to be read
:type length: integer
:param project: project to use as context for this download (may affect
which billing account is billed for this download).... | [
"def",
"_read2",
"(",
"self",
",",
"length",
"=",
"None",
",",
"use_compression",
"=",
"None",
",",
"project",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_file_length",
"==",
"None",
":",
"desc",
"=",
"self",
".",
"describe",... | :param length: Maximum number of bytes to be read
:type length: integer
:param project: project to use as context for this download (may affect
which billing account is billed for this download). If specified,
must be a project in which this file exists. If not specified, the
... | [
":",
"param",
"length",
":",
"Maximum",
"number",
"of",
"bytes",
"to",
"be",
"read",
":",
"type",
"length",
":",
"integer",
":",
"param",
"project",
":",
"project",
"to",
"use",
"as",
"context",
"for",
"this",
"download",
"(",
"may",
"affect",
"which",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L873-L949 | train | Reads a file from the file and returns the next length bytes. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/ssh_tunnel_app_support.py | setup_ssh_tunnel | def setup_ssh_tunnel(job_id, local_port, remote_port):
"""
Setup an ssh tunnel to the given job-id. This will establish
the port over the given local_port to the given remote_port
and then exit, keeping the tunnel in place until the job is
terminated.
"""
cmd = ['dx', 'ssh', '--suppress-run... | python | def setup_ssh_tunnel(job_id, local_port, remote_port):
"""
Setup an ssh tunnel to the given job-id. This will establish
the port over the given local_port to the given remote_port
and then exit, keeping the tunnel in place until the job is
terminated.
"""
cmd = ['dx', 'ssh', '--suppress-run... | [
"def",
"setup_ssh_tunnel",
"(",
"job_id",
",",
"local_port",
",",
"remote_port",
")",
":",
"cmd",
"=",
"[",
"'dx'",
",",
"'ssh'",
",",
"'--suppress-running-check'",
",",
"job_id",
",",
"'-o'",
",",
"'StrictHostKeyChecking no'",
"]",
"cmd",
"+=",
"[",
"'-f'",
... | Setup an ssh tunnel to the given job-id. This will establish
the port over the given local_port to the given remote_port
and then exit, keeping the tunnel in place until the job is
terminated. | [
"Setup",
"an",
"ssh",
"tunnel",
"to",
"the",
"given",
"job",
"-",
"id",
".",
"This",
"will",
"establish",
"the",
"port",
"over",
"the",
"given",
"local_port",
"to",
"the",
"given",
"remote_port",
"and",
"then",
"exit",
"keeping",
"the",
"tunnel",
"in",
"... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/ssh_tunnel_app_support.py#L31-L40 | train | Setup an ssh tunnel to the given job - id. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/ssh_tunnel_app_support.py | poll_for_server_running | def poll_for_server_running(job_id):
"""
Poll for the job to start running and post the SERVER_READY_TAG.
"""
sys.stdout.write('Waiting for server in {0} to initialize ...'.format(job_id))
sys.stdout.flush()
desc = dxpy.describe(job_id)
# Keep checking until the server has begun or it has fa... | python | def poll_for_server_running(job_id):
"""
Poll for the job to start running and post the SERVER_READY_TAG.
"""
sys.stdout.write('Waiting for server in {0} to initialize ...'.format(job_id))
sys.stdout.flush()
desc = dxpy.describe(job_id)
# Keep checking until the server has begun or it has fa... | [
"def",
"poll_for_server_running",
"(",
"job_id",
")",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"'Waiting for server in {0} to initialize ...'",
".",
"format",
"(",
"job_id",
")",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"desc",
"=",
"dxpy",
".... | Poll for the job to start running and post the SERVER_READY_TAG. | [
"Poll",
"for",
"the",
"job",
"to",
"start",
"running",
"and",
"post",
"the",
"SERVER_READY_TAG",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/ssh_tunnel_app_support.py#L43-L62 | train | Poll for the server to start running and post the SERVER_READY_TAG. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/ssh_tunnel_app_support.py | multi_platform_open | def multi_platform_open(cmd):
"""
Take the given command and use the OS to automatically open the appropriate
resource. For instance, if a URL is provided, this will have the OS automatically
open the URL in the default web browser.
"""
if platform == "linux" or platform == "linux2":
cm... | python | def multi_platform_open(cmd):
"""
Take the given command and use the OS to automatically open the appropriate
resource. For instance, if a URL is provided, this will have the OS automatically
open the URL in the default web browser.
"""
if platform == "linux" or platform == "linux2":
cm... | [
"def",
"multi_platform_open",
"(",
"cmd",
")",
":",
"if",
"platform",
"==",
"\"linux\"",
"or",
"platform",
"==",
"\"linux2\"",
":",
"cmd",
"=",
"[",
"'xdg-open'",
",",
"cmd",
"]",
"elif",
"platform",
"==",
"\"darwin\"",
":",
"cmd",
"=",
"[",
"'open'",
",... | Take the given command and use the OS to automatically open the appropriate
resource. For instance, if a URL is provided, this will have the OS automatically
open the URL in the default web browser. | [
"Take",
"the",
"given",
"command",
"and",
"use",
"the",
"OS",
"to",
"automatically",
"open",
"the",
"appropriate",
"resource",
".",
"For",
"instance",
"if",
"a",
"URL",
"is",
"provided",
"this",
"will",
"have",
"the",
"OS",
"automatically",
"open",
"the",
... | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/ssh_tunnel_app_support.py#L65-L77 | train | Open the given command and use the OS to automatically open the appropriate
resource. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/ssh_tunnel_app_support.py | get_notebook_app_versions | def get_notebook_app_versions():
"""
Get the valid version numbers of the notebook app.
"""
notebook_apps = dxpy.find_apps(name=NOTEBOOK_APP, all_versions=True)
versions = [str(dxpy.describe(app['id'])['version']) for app in notebook_apps]
return versions | python | def get_notebook_app_versions():
"""
Get the valid version numbers of the notebook app.
"""
notebook_apps = dxpy.find_apps(name=NOTEBOOK_APP, all_versions=True)
versions = [str(dxpy.describe(app['id'])['version']) for app in notebook_apps]
return versions | [
"def",
"get_notebook_app_versions",
"(",
")",
":",
"notebook_apps",
"=",
"dxpy",
".",
"find_apps",
"(",
"name",
"=",
"NOTEBOOK_APP",
",",
"all_versions",
"=",
"True",
")",
"versions",
"=",
"[",
"str",
"(",
"dxpy",
".",
"describe",
"(",
"app",
"[",
"'id'",
... | Get the valid version numbers of the notebook app. | [
"Get",
"the",
"valid",
"version",
"numbers",
"of",
"the",
"notebook",
"app",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/ssh_tunnel_app_support.py#L80-L86 | train | Get the valid version numbers of the notebook app. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
dnanexus/dx-toolkit | src/python/dxpy/ssh_tunnel_app_support.py | run_notebook | def run_notebook(args, ssh_config_check):
"""
Launch the notebook server.
"""
# Check that ssh is setup. Currently notebooks require ssh for tunelling.
ssh_config_check()
if args.only_check_config:
return
# If the user requested a specific version of the notebook server,
# get ... | python | def run_notebook(args, ssh_config_check):
"""
Launch the notebook server.
"""
# Check that ssh is setup. Currently notebooks require ssh for tunelling.
ssh_config_check()
if args.only_check_config:
return
# If the user requested a specific version of the notebook server,
# get ... | [
"def",
"run_notebook",
"(",
"args",
",",
"ssh_config_check",
")",
":",
"# Check that ssh is setup. Currently notebooks require ssh for tunelling.",
"ssh_config_check",
"(",
")",
"if",
"args",
".",
"only_check_config",
":",
"return",
"# If the user requested a specific version of... | Launch the notebook server. | [
"Launch",
"the",
"notebook",
"server",
"."
] | 74befb53ad90fcf902d8983ae6d74580f402d619 | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/ssh_tunnel_app_support.py#L89-L131 | train | Launch the notebook server. | GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.