

def read_credentials_file(file):
    user = ''
    token = ''
    with open(file, 'r') as f:
        content = [x.strip('\n') for x in f.readlines()]
        for line in content:
            if ('user=' in line):
                str_line = line.strip()
                user = str_line[len('user='):].strip()
            elif ('password=' in line):
                str_line = line.strip()
                token = str_line[len('password='):].strip()
    if (user == ''):
        show_error_and_exit(("Could not resolve github username from the file: %s. Please make sure that it's supplied in its own line as,\nuser= $USERNAME" % file))
    if (token == ''):
        show_error_and_exit(("Could not resolve github token from the file: %s. Please make sure that it's supplied in its own line as,\npassword= $TOKEN" % file))
    return (user, token)

dataset/ETHPy150Open databricks/spark-package-cmd-tool/python/spark_package/spark_package.py read_credentials_file/original