def osf_crawl(k, *pths, **kw):
from six.moves import reduce<EOL>base = kw.pop('<STR_LIT>', '<STR_LIT>')<EOL>root = kw.pop('<STR_LIT:root>', None)<EOL>if len(kw) > <NUM_LIT:0>: raise ValueError('<STR_LIT>' % (list(kw.keys()),))<EOL>if k.lower().startswith('<STR_LIT>'): k = k[<NUM_LIT:4>:]<EOL>k = k.lstrip('<STR_LIT:/>')<EOL>pths = [p.lstrip('<STR_LIT:/>') for p in (k.split('<STR_LIT:/>') + list(pths))]<EOL>(bpth, pths) = (pths[<NUM_LIT:0>], pths[<NUM_LIT:1>:])<EOL>if root is None: root = _osf_tree(bpth, base=base)<EOL>return reduce(lambda m,k: m[k], pths, root)<EOL>
osf_crawl(k) crawls the osf repository k and returns a lazy nested map structure of the
  repository's files. Folders have values that are maps of their contents while files have
  values that are their download links.
osf_crawl(k1, k2, ...) is equivalent to osf_crawl(posixpath.join(k1, k2...)).

The optional named argument base (default: 'osfstorage') may be specified to search in a
non-standard storage position in the OSF URL; e.g. in the github storage.