def parse_metadata_file(input_metadata_filename):
    """Return dictionary of metadata in filename, which should be in the format:

    [Heading]
    key1 = value1
    key2 = value2
    """

    with open(input_metadata_filename) as f:
        raw_lines = f.readlines()

    stripped_lines = [l.strip() for l in raw_lines]
    # Skip first line (heading) and last line (blank)
    split_lines = [l.split(' = ') for l in stripped_lines[1:-1]]

    return dict(split_lines)