def _get_or_create_netrc_location():
    term = get_term()
    try:
        file = os.path.join(os.environ['HOME'], ".netrc")
    except __HOLE__:
        raise IOError("Could not find .netrc: $HOME is not set")

    if os.path.isfile(file):
        result = os.stat(file)
        mode = oct(stat.S_IMODE(result.st_mode))
        if mode != '0600':
            puts(
                term.yellow('Warning:') +
                'Found permission %s, on %s. It should be 0600' %
                (mode, file)
            )

    else:
        with os.fdopen(os.open(file, os.O_APPEND | os.O_CREAT, 0o600)) as out:
            out.close()

    return file
dataset/ETHPy150Open wercker/wercker-cli/werckercli/config.py/_get_or_create_netrc_location