parameters: (self, url, data=None)
docstring: Calls the ReviewBoard API.
docstring_summary: Calls the ReviewBoard API.
docstring_tokens: Calls the ReviewBoard API .
function: def api(self, url, data=None):
          """Calls the ReviewBoard API."""
          if self._opener_installed is False:
              auth_handler = urllib2.HTTPBasicAuthHandler()
              auth_handler.add_password(
                  realm="Web API",
                  uri="reviews.apache.org",
                  user=self.user,
                  passwd=self.password)
              opener = urllib2.build_opener(auth_handler)
              urllib2.install_opener(opener)
              self._opener_installed = True
          if data is not None:
              data = data.encode(sys.getdefaultencoding())
          try:
              return json.loads(urllib2.urlopen(url, data=data).read().decode(
                  sys.getdefaultencoding()))
          except Exception as err:
              print("Error handling URL %s: %s" % (url, err))
              # raise the error after printing the message
              raise
function_tokens: def api ( self , url , data = None ) : if self . _opener_installed is False : auth_handler = urllib2 . HTTPBasicAuthHandler ( ) auth_handler . add_password ( realm = "Web API" , uri = "reviews.apache.org" , user = self . user , passwd = self . password ) opener = urllib2 . build_opener ( auth_handler ) urllib2 . install_opener ( opener ) self . _opener_installed = True if data is not None : data = data . encode ( sys . getdefaultencoding ( ) ) try : return json . loads ( urllib2 . urlopen ( url , data = data ) . read ( ) . decode ( sys . getdefaultencoding ( ) ) ) except Exception as err : print ( "Error handling URL %s: %s" % ( url , err ) ) # raise the error after printing the message raise