from datetime import datetime


def gather_files(files_arg, suffix=".py"):
    if all([f.endswith(".txt") for f in files_arg]):
        files = []
        for f in files_arg:
            with open(f) as fp:
                for line in fp.readlines():
                    files.append(line.rstrip())
    else:
        for f in files_arg:
            if not f.endswith(suffix):
                raise Exception(f"Incorrect argument, expected {suffix} file: {f}")
        files = files_arg
    return files


def timestamp():
    epoch = datetime.utcfromtimestamp(0)
    now = datetime.now()
    return round((now-epoch).total_seconds()*1000000.0)
