def _caa_request(mbid, imageid=None, size=None, entitytype='release'):
 path = [entitytype, mbid]
 if (imageid and size):
  path.append(('%s-%s' % (imageid, size)))
 elif imageid:
  path.append(imageid)
 url = compat.urlunparse(('http', hostname, ('/%s' % '/'.join(path)), '', '', ''))
 musicbrainz._log.debug(('GET request for %s' % (url,)))
 httpHandler = compat.HTTPHandler(debuglevel=0)
 handlers = [httpHandler]
 opener = compat.build_opener(*handlers)
 req = musicbrainz._MusicbrainzHttpRequest('GET', url, None)
 if (musicbrainz._useragent != ''):
  req.add_header('User-Agent', musicbrainz._useragent)
  musicbrainz._log.debug(('requesting with UA %s' % musicbrainz._useragent))
 resp = musicbrainz._safe_read(opener, req, None)
 if imageid:
  return resp
 else:
  return json.loads(resp)

def _caa_request ( mbid , imageid = None , size = None , entitytype = 'release' ) : path = [ entitytype , mbid ] if ( imageid and size ) : path . append ( ( '%s-%s' % ( imageid , size ) ) ) elif imageid : path . append ( imageid ) url = compat . urlunparse ( ( 'http' , hostname , ( '/%s' % '/' . join ( path ) ) , '' , '' , '' ) ) musicbrainz . _log . debug ( ( 'GET request for %s' % ( url , ) ) ) httpHandler = compat . HTTPHandler ( debuglevel = 0 ) handlers = [ httpHandler ] opener = compat . build_opener ( * handlers ) req = musicbrainz . _MusicbrainzHttpRequest ( 'GET' , url , None ) if ( musicbrainz . _useragent != '' ) : req . add_header ( 'User-Agent' , musicbrainz . _useragent ) musicbrainz . _log . debug ( ( 'requesting with UA %s' % musicbrainz . _useragent ) ) resp = musicbrainz . _safe_read ( opener , req , None ) if imageid : return resp else : return json . loads ( resp )
make a caa request .