@pimms.calc('<STR_LIT>')<EOL>def calc_subject(argv, worklog):
if len(argv) == <NUM_LIT:0>: raise ValueError('<STR_LIT>')<EOL>elif len(argv) > <NUM_LIT:1>: worklog.warn('<STR_LIT>' % (argv[<NUM_LIT:1>:],))<EOL>subject_id = argv[<NUM_LIT:0>]<EOL>try:<EOL><INDENT>sub = freesurfer_subject(subject_id)<EOL>if sub is not None:<EOL><INDENT>worklog('<STR_LIT>' % sub.path)<EOL>return sub<EOL><DEDENT><DEDENT>except Exception: pass<EOL>try:<EOL><INDENT>sub = hcp_subject(subject_id)<EOL>if sub is not None:<EOL><INDENT>worklog('<STR_LIT>' % sub.path)<EOL>return sub<EOL><DEDENT><DEDENT>except Exception: pass<EOL>raise ValueError('<STR_LIT>' % subject_id)<EOL>
calc_subject converts a subject_id into a subject object.

Afferent parameters:
  @ argv
    The FreeSurfer subject name(s), HCP subject ID(s), or path(s) of the subject(s) to which the
    atlas should be applied.