def add_subject_path(path, index=None):
paths = [p for p in path.split('<STR_LIT::>') if len(p) > <NUM_LIT:0>]<EOL>if len(paths) > <NUM_LIT:1>:<EOL><INDENT>tests = [add_subject_path(p, index=index) for p in reversed(paths)]<EOL>return all(t for t in tests)<EOL><DEDENT>else:<EOL><INDENT>spaths = config['<STR_LIT>']<EOL>path = os.path.expanduser(path)<EOL>if not os.path.isdir(path): return False<EOL>if path in spaths: return True<EOL>try:<EOL><INDENT>if index is None or index is Ellipsis:<EOL><INDENT>sd = spaths + [path]<EOL><DEDENT>else:<EOL><INDENT>sd = spaths + []<EOL>sd.insert(index, path)<EOL><DEDENT>config['<STR_LIT>'] = sd<EOL>return True<EOL><DEDENT>except Exception:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>
add_subject_path(path) will add the given path to the list of subject directories in which to
  search for HCP subjects. The optional argument index may be given to specify the precedence of
  this path when searching for a new subject; the default, 0, always inserts the path at the
  front of the list; a value of k indicates that the new list should have the new path at index
  k.
The path may contain :'s, in which case the individual directories are separated and added.  If
the given path is not a directory or the path could not be inserted, yields False; otherwise,
yields True. If the string contains a : and multiple paths, then True is yielded only if all
paths were successfully inserted.  See also subject_paths.