from typing import Dict, List


def parse_commands(
        tags_file,  # type: Dict
        commands    # type: List[str]
):
    # type: (...) -> str

    parsed = ""
    for command in commands:
        if command in tags_file:
            tags = tags_file[command]
            parsed += parse_tags(tags)

    return bytes(parsed)


def parse_tags(
    tags,       # type: Dict
    key=None,   # type: str
    cols=56     # type: int
):
    # type: (...) -> str

    parsed = ""
    for tag in tags:
        if key and "SeparatorDash" == key:
            tag = (tag * cols)
        parsed += b"{}".format(tag)

    return parsed
