from typing import Dict


def read_map(path: str) -> Dict[str, str]:
    """
    Given a file-like object (`String`, `File`) as a parameter, this will read each
    line from a file and expect the line to have the format `col1\tcol2`. In other
    words, the file-like object must be a two-column TSV file.

    WDL syntax: Map[String, String] read_map(String|File)
    """
    d = dict()
    with open(path, "r") as f:
        for line in f:
            line = line.rstrip()
            if not line:
                # remove extra lines
                continue
            key, value = line.split('\t', 1)
            d[key] = value.strip()
    return d