<commit_before>import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyOAuth
import os, ast, requests

#Spotify API keys
scope = "playlist-read-private playlist-modify-private playlist-modify-public"
uirs = ["http://localhost:8000/authorize_plot/", "http://localhost:8000/authorize_sift/"]
#uirs = ["http://plotify.herokuapp.com/authorize_plot/", "http://plotify.herokuapp.com/authorize_sift/"]

def keys():
  spotify_keys = os.environ["SPOTIFY_KEYS"]
  spotify_keys = ast.literal_eval(spotify_keys)
  return spotify_keys[0]

def auth_url(mode):
  key = keys()
  sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope)
  auth_url = sp_oauth.get_authorize_url()
  return auth_url

#set up access
def get_token(code, mode):
  key = keys()
  sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope)
  token_info = sp_oauth.get_access_token(code)
  if token_info:  
    return token_info['access_token']
  else:
    return None
<commit_msg>uir error<commit_after>import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyOAuth
import os, ast, requests

#Spotify API keys
scope = "playlist-read-private playlist-modify-private playlist-modify-public"
#uirs = ["http://localhost:8000/authorize_plot/", "http://localhost:8000/authorize_sift/"]
uirs = ["http://plotify.herokuapp.com/authorize_plot/", "http://plotify.herokuapp.com/authorize_sift/"]

def keys():
  spotify_keys = os.environ["SPOTIFY_KEYS"]
  spotify_keys = ast.literal_eval(spotify_keys)
  return spotify_keys[0]

def auth_url(mode):
  key = keys()
  sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope)
  auth_url = sp_oauth.get_authorize_url()
  return auth_url

#set up access
def get_token(code, mode):
  key = keys()
  sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope)
  token_info = sp_oauth.get_access_token(code)
  if token_info:  
    return token_info['access_token']
  else:
    return None

{'fraction_non_alphanumeric': 0.1383838383838384, 'fraction_numerical': 0.010101010101010102, 'mean_word_length': 5.516447368421052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1297521', 'n_tokens_mistral': 749, 'n_tokens_neox': 736, 'n_words': 141}