
    5i                     V    d Z ddlmZmZmZmZ ddlmZ d Zd Z	ddd	d
Z
d Zd Zd Zy)z
Python templating code
    )print_functionunicode_literalsdivisionabsolute_import   )fillc                       y)Npython3 r       x/home/marpiech/ifpan-abm-pgxpred/analysis/marpiech-gwas-test/venv/lib/python3.12/site-packages/dxpy/templating/python.pyget_interpreterr      s    r   c                       y)Npythonr   r   r   r   get_pathr      s    r   zdxpy.DXFilezdxpy.DXRecordzdxpy.DXApplet)filerecordappletc                     | d   }d}|j                  d      r!|dd  }|t        v rd| d   z   dz   }|S | d   }|S |t        v rd| d   z   d	z   }|S | d   }|S )
Nclass array   z[dxpy.dxlink(item) for item in name]zdxpy.dxlink())
startswithclass_to_dxclass)output_paramoutput_class
output_fmt
item_classs       r   get_output_fmtr#   $   s    (LJw'!!"%
)):\&=QQTWWJ  &f-J
 	 
)	)#l6&::S@
  "&)
r   c                 p   |d   t         v r!dj                  |d   t         |d            }nH|d   j                  d      r2|d   dd  t         v r$dj                  |d   t         |d   dd           }nd }|@|r'| j                  dj                  |d   	             d
}nd}| j                  ||z          y y )Nr   z{name} = {dxclass}({name})r   )r   dxclasszarray:r   z-{name} = [{dxclass}(item) for item in {name}]zif {name} is not None:r       r   )r   formatr   append)init_inputsinput_parammay_be_missinginit_strindents        r   add_init_input_linesr/   3   s    7///66K<O?OP[\cPd?e 7 g	W		(	(	2{77KAB7OSc7cBII{[aObRbcnovcwxyxzc{R| J ~ 7>>KPVDW>XYFF6H,- r   c                    d}d}d}	d}
d}g }g }g }d| v r| d   D ]Q  }|j                  d      xr d|v}|r|j                  |d          n|j                  |d          t        |||       S dj                  ||D cg c]  }|dz   	 c}z         }nd}|r0d	t	        d
ddd      z   }|dz  }|dj                  |      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  }	|r2|	d	j                  |D cg c]  }dj                  |       c}      z  }	|r2|	d	j                  |D cg c]  }dj                  |       c}      z  }	|r2|	d	j                  |D cg c]  }dj                  |       c}      z  }	|rLd	t	        dddd      z   }
|
dz  }
|
dj                  |D cg c]  }dj                  |       c}      d	z   z  }
d| v rJ| d   rEddj                  | d   D cg c]!  }dj                  |d   t        |            # c}      z   d	z   }|||	|
|fS c c}w c c}w c c}w c c}w c c}w c c}w c c}w )Nr   	inputSpecoptionaldefaultr   z, z=Nonez**kwargs
zThe following line(s) initialize your data object inputs on the platform into dxpy.DXDataObject instances that you can start using immediately.z    # P   )initial_indentsubsequent_indentwidthz

    z
    zpThe following line(s) download your file inputs to the local file system using variable names for the filenames.z

z4    dxpy.download_dxfile({name}.get_id(), "{name}")
r&   zS    if {name} is not None:
        dxpy.download_dxfile({name}.get_id(), "{name}")
z`    for i, f in enumerate({name}):
        dxpy.download_dxfile(f.get_id(), "{name}-" + str(i))
z    if {name} is not None:
        for i, f in enumerate({name}):
            dxpy.download_dxfile(f.get_id(), "{name}-" + str(i))
a  The following line(s) use the Python bindings 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.z){name} = dxpy.upload_local_file("{name}")
outputSpecr'   zoutput["{name}"] = {value})r   value)getr)   r/   joinr   r(   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input_sig_strinit_inputs_strdl_files_strul_files_stroutputs_str	args_listkwargs_listr*   r+   r,   r   params                      r   get_stringsrL   E   s    MOLLKIKKh $K0 
	KK(__Z8YYk=YN"";v#67   V!45 !k>J
	K 		)+.V$tg~.V"VW"  'x  IQ  em  uw  "x  x:%8==554 $=&*Id  $V  go  CK  SU  V  V  Y_  _$DII";'=(
FF( '= > >L$DII";'=(
FF( '= > >L +DII"A'C(
FF( 'C D DL +DII #B'C ( FF( 'C D DL
 d  $u  FN  bj  rt  u  uz!  rC  'Dim'R'Y'Y_c'Y'd  'D  E  HL  L  	LxH\$:x}}  QY  Zf  Qg  .h  HM.J.Q.QW\]cWdlz  |A  mB.Q  /C  .h   i  i  lp  p/<{RRM /W'='='C'C 'D .hs*   >I
7I
+I"
I'
I,
I1
&I6
N)__doc__
__future__r   r   r   r   utils.printingr   r   r   r   r#   r/   rL   r   r   r   <module>rP      sD   " S R !  .$@Sr   