@public<EOL>def github_token(token_path=None, token=None):
if token is None:<EOL><INDENT>if token_path is None:<EOL><INDENT>token_path = '<STR_LIT>'<EOL><DEDENT>token_path = os.path.expandvars(os.path.expanduser(token_path))<EOL>if not os.path.isfile(token_path):<EOL><INDENT>print("<STR_LIT>".format(token_path))<EOL>print("<STR_LIT>")<EOL>raise EnvironmentError("<STR_LIT>" % token_path)<EOL><DEDENT>with open(token_path, '<STR_LIT:r>') as fdo:<EOL><INDENT>token = fdo.readline().strip()<EOL><DEDENT><DEDENT>return token<EOL>
Return a github oauth token as a string.  If `token` is defined, it is
    has precendece.  If `token` and `token_path` are `None`,
    `~/.sq_github_token` looked for as a fallback.

    Parameters
    ----------
    token_path : str, optional
        Path to the token file. The default token is used otherwise.

    token: str, optional
        Literial token string. If specifified, this value is used instead of
        reading from the token_path file.

    Returns
    -------
    token : `string`
        Hopefully, a valid github oauth token.