<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read(path, corpus=True, index_by='wosid', streaming=False, parse_only=None, corpus_class=Corpus, **kwargs):
 """ Parse one or more WoS field-tagged data files. Examples -------- .. code-block:: python <tethne.classes.corpus.Corpus object at 0x10057c2d0> Parameters path : str Path to WoS field-tagged data. Can be a path directly to a single data file, or to a directory containing several data files. corpus : bool If True (default), returns a :class:`.Corpus`\. If False, will return only a list of :class:`.Paper`\s. Returns ------- :class:`.Corpus` or :class:`.Paper` """


    if not os.path.exists(path):
        raise ValueError('No such file or directory')

    # We need the primary index field in the parse results.
    if parse_only:
        parse_only.append(index_by)

    if streaming:
        return streaming_read(path, corpus=corpus, index_by=index_by,
                              parse_only=parse_only, **kwargs)

    if os.path.isdir(path):    # Directory containing 1+ WoS data files.
        papers = []
        for sname in os.listdir(path):
            if sname.endswith('txt') and not sname.startswith('.'):
                papers += read(os.path.join(path, sname),
                               corpus=False,
                               parse_only=parse_only)
    else:   # A single data file.
        papers = WoSParser(path).parse(parse_only=parse_only)

    if corpus:
        return corpus_class(papers, index_by=index_by, **kwargs)
    return papers