def get_travis_token(*, GitHub_token=None, **login_kwargs):
_headers = {<EOL>'<STR_LIT:Content-Type>': '<STR_LIT:application/json>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}<EOL>headersv2 = {**_headers, **Travis_APIv2}<EOL>token_id = None<EOL>try:<EOL><INDENT>if not GitHub_token:<EOL><INDENT>print(green("<STR_LIT>"))<EOL>print(green("<STR_LIT>"))<EOL>tok_dict = generate_GitHub_token(scopes=["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"],<EOL>note="<STR_LIT>",<EOL>**login_kwargs)<EOL>GitHub_token = tok_dict['<STR_LIT>']<EOL>token_id = tok_dict['<STR_LIT:id>']<EOL><DEDENT>data = {'<STR_LIT>': GitHub_token}<EOL>res = requests.post('<STR_LIT>', data=json.dumps(data), headers=headersv2)<EOL>return res.json()['<STR_LIT>']<EOL><DEDENT>finally:<EOL><INDENT>if token_id:<EOL><INDENT>delete_GitHub_token(token_id, **login_kwargs)<EOL><DEDENT><DEDENT>
Generate a temporary token for authenticating with Travis

The GitHub token can be passed in to the ``GitHub_token`` keyword
argument. If no token is passed in, a GitHub token is generated
temporarily, and then immediately deleted.

This is needed to activate a private repo

Returns the secret token. It should be added to the headers like

    headers['Authorization'] = "token {}".format(token)