import gzip


def read_file(filepath):
    """
    Read normal or gz file (based on their extension .gz)
    """
    data = None
    if filepath.endswith(".gz"):
        with gzip.open(filepath, "rb") as f:
            data = f.read()
    else:
        with open(filepath, 'r') as myfile:
            data = myfile.read()
    return data