
    5if                     D    d Z ddlmZmZmZmZ ddlmZ d Zd Z	d Z
d Zy	)
z
bash templating code
    )print_functionunicode_literalsdivisionabsolute_import   )fillc                       yNbash r       v/home/marpiech/ifpan-abm-pgxpred/analysis/marpiech-gwas-test/venv/lib/python3.12/site-packages/dxpy/templating/bash.pyget_interpreterr          r   c                       yr
   r   r   r   r   get_pathr      r   r   c                 6    d| z   dz   | z   dz   | z   dz   |z   dz   S )Nz    for i in "${!z([@]}"; do
        dx-jobutil-add-output z "${z[$i]}" --class=z	
    doner   )output_param_nameoutput_param_classs     r   get_array_output_strr      sW    !225``cttw}}  AR  R  Uf  f  i{  {  ~J  J  Jr   c                 l   d}d}d}	d}
d| v rc| d   r^ddj                  | d   D cg c]:  }dj                  |d   |d   j                  d      rd|d   z   d	z   n|d   
      < c}      z   dz   }|s|s|s|rdt        dddd      z   dz   }|r2|dj                  |D cg c]  }dj                  |       c}      z  }|r5|dj                  |D cg c]  }dj                  |       c}      dz   z  }|s|r5|dj                  ||z   D cg c]  }dj                  |       c}      z  }|rS|dk7  rdnd}	|	t        dddd      dz   z  }	|	dj                  |D cg c]  }dj                  |       c}      dz   z  }	d| v rq| d   rldt        dddd      z   dz   }
|
dj                  | d   D cg c]5  }d|d   vrd|d   z   dz   |d   z   dz   |d   z   nt	        |d   |d         7 c}      z  }
nd| vrdt        dddd      z   }
d|||	|
fS c c}w c c}w c c}w c c}w c c}w c c}w )N 	inputSpec
z$    echo "Value of {name}: '${var}'"nameclasszarray:{z[@]})r   varzThe following line(s) use the dx command-line tool to download
your file inputs to the local file system using variable names for the filenames.
To recover the original filenames, you can use the output of "dx describe "$variable" --name".z    # P   )initial_indentsubsequent_indentwidthz

z$    dx download "${name}" -o {name}
)r   zO    if [ -n "${name}" ]
    then
        dx download "${name}" -o {name}
    fiz`    for i in ${{!{name}[@]}}
    do
        dx download "${{{name}[$i]}}" -o {name}-$i
    done
aI  The following line(s) use the dx command-line tool to upload your file outputs after you have created them on the local file system.  It assumes that you have used the output field name for the filename for each output, but you can change that behavior to suit your needs.  Run "dx upload -h" to see more options to set metadata.z&    {name}=$(dx upload {name} --brief)
outputSpeczThe following line(s) use the utility dx-jobutil-add-output to format
and add output variables to your job's output as appropriate for the output class.  Run
"dx-jobutil-add-output -h" for more information on what it does.arrayz    dx-jobutil-add-output z "$z
" --class=a{  No output spec is specified, but
if you would like to add output fields, you can add invocations of the
dx-jobutil-add-output utility to format and add values to the
job_output.json file.  For example, "dx-jobutil-add-output keyname 32"
will add an output field called "keyname" with value equal to the
number 32.  Run "dx-jobutil-add-output -h" for more details on what
it does.)joinformat
startswithr   r   )app_jsonrequired_file_input_namesoptional_file_input_namesrequired_file_array_input_namesoptional_file_array_input_namesfile_output_namesdummy_output_hashinit_inputs_strdl_files_strul_files_stroutputs_strinput_paramr   output_params                 r   get_stringsr5   "   s    OLLKh8K#8  |D  EP  |Q  ,R  mx,T,[,[almsat  do  pw  dx  dC  dC  DL  dM|  CN  OU  CV  }V  Y_  }_  S^  _e  Sf,[  -h  ,R  "S  S  VZ  Z $=&*Id $b 4<x_ac c fll %DII";'=(
FF( '= > >L$DII )B'C !%(
 &d&
( 'C D GKK KL +.MDII #BDc"c	'e 	( FF	( 'e f fL ."4t"  m,4XZ\^de 	e		j{"|bf#K#R#RX\#R#]"|}  AE  E  	ExH\$:T #F +3hVXZ Z ]cc 	tyy6>|6L"N&2 `g  o{  |C  oD  `D">fAU"UX]"]`lms`t"t  xD  #D  GS  T[  G\  #\';L<PR^_fRg'h#i "N O 	O 
X	%T # 2:X]_a a lKGG_ ,R'='C
'e #}"Ns#   ?H
H
H"
H'
!H,
7:H1
N)__doc__
__future__r   r   r   r   utils.printingr   r   r   r   r5   r   r   r   <module>r9      s,   " S R !J9Hr   