def get_account(url, token, marker=None, limit=None, prefix=None, end_marker=None, http_conn=None, full_listing=False, service_token=None, headers=None):
 req_headers = {'X-Auth-Token': token, 'Accept-Encoding': 'gzip'}
 if service_token:
  req_headers['X-Service-Token'] = service_token
 if headers:
  req_headers.update(headers)
 if (not http_conn):
  http_conn = http_connection(url)
 if full_listing:
  rv = get_account(url, token, marker, limit, prefix, end_marker, http_conn, headers=req_headers)
  listing = rv[1]
  while listing:
   marker = listing[(-1)]['name']
   listing = get_account(url, token, marker, limit, prefix, end_marker, http_conn, headers=req_headers)[1]
   if listing:
    rv[1].extend(listing)
  return rv
 (parsed, conn) = http_conn
 qs = 'format=json'
 if marker:
  qs += ('&marker=%s' % quote(marker))
 if limit:
  qs += ('&limit=%d' % limit)
 if prefix:
  qs += ('&prefix=%s' % quote(prefix))
 if end_marker:
  qs += ('&end_marker=%s' % quote(end_marker))
 full_path = ('%s?%s' % (parsed.path, qs))
 method = 'GET'
 conn.request(method, full_path, '', req_headers)
 resp = conn.getresponse()
 body = resp.read()
 http_log((('%s?%s' % (url, qs)), method), {'headers': req_headers}, resp, body)
 resp_headers = resp_header_dict(resp)
 if ((resp.status < 200) or (resp.status >= 300)):
  raise ClientException.from_response(resp, 'Account GET failed', body)
 if (resp.status == 204):
  return (resp_headers, [])
 return (resp_headers, parse_api_response(resp_headers, body))

def get_account ( url , token , marker = None , limit = None , prefix = None , end_marker = None , http_conn = None , full_listing = False , service_token = None , headers = None ) : req_headers = { 'X-Auth-Token' : token , 'Accept-Encoding' : 'gzip' } if service_token : req_headers [ 'X-Service-Token' ] = service_token if headers : req_headers . update ( headers ) if ( not http_conn ) : http_conn = http_connection ( url ) if full_listing : rv = get_account ( url , token , marker , limit , prefix , end_marker , http_conn , headers = req_headers ) listing = rv [ 1 ] while listing : marker = listing [ ( - 1 ) ] [ 'name' ] listing = get_account ( url , token , marker , limit , prefix , end_marker , http_conn , headers = req_headers ) [ 1 ] if listing : rv [ 1 ] . extend ( listing ) return rv ( parsed , conn ) = http_conn qs = 'format=json' if marker : qs += ( '&marker=%s' % quote ( marker ) ) if limit : qs += ( '&limit=%d' % limit ) if prefix : qs += ( '&prefix=%s' % quote ( prefix ) ) if end_marker : qs += ( '&end_marker=%s' % quote ( end_marker ) ) full_path = ( '%s?%s' % ( parsed . path , qs ) ) method = 'GET' conn . request ( method , full_path , '' , req_headers ) resp = conn . getresponse ( ) body = resp . read ( ) http_log ( ( ( '%s?%s' % ( url , qs ) ) , method ) , { 'headers' : req_headers } , resp , body ) resp_headers = resp_header_dict ( resp ) if ( ( resp . status < 200 ) or ( resp . status >= 300 ) ) : raise ClientException . from_response ( resp , 'Account GET failed' , body ) if ( resp . status == 204 ) : return ( resp_headers , [ ] ) return ( resp_headers , parse_api_response ( resp_headers , body ) )
looks in last_cache for the lastfm account name .