def get_github_creds():
 netrc_auth = requests.utils.get_netrc_auth(u'https://api.github.com')
 if netrc_auth:
  return netrc_auth
 config_file = path(u'~/.config/edx-release').expand()
 if config_file.isfile():
  with open(config_file) as f:
   config = json.load(f)
  github_creds = config.get(u'credentials', {}).get(u'api.github.com', {})
  username = github_creds.get(u'username', u'')
  token = github_creds.get(u'token', u'')
  if (username and token):
   return (username, token)
 return None

def get_github_creds ( ) : netrc_auth = requests . utils . get_netrc_auth ( u'https://api.github.com' ) if netrc_auth : return netrc_auth config_file = path ( u'~/.config/edx-release' ) . expand ( ) if config_file . isfile ( ) : with open ( config_file ) as f : config = json . load ( f ) github_creds = config . get ( u'credentials' , { } ) . get ( u'api.github.com' , { } ) username = github_creds . get ( u'username' , u'' ) token = github_creds . get ( u'token' , u'' ) if ( username and token ) : return ( username , token ) return None
returns github credentials if they exist .