Rest helpers

def rest(self, method, uri, data=None, status_codes=None, parse=True, **kwargs):
    """ Rest helpers
    """
    r = self.pool.request_encode_body(method, uri, fields=data, encode_multipart=False)
    if not r.status in (status_codes if status_codes else (200,201)):
      print cl('\n---------\nURI / REQUEST TYPE : %s %s' % (uri, method), 'red')
      print cl(data, 'red')
      print r.headers
      raise Exception, "Invalid status code: %s" % r.status
    if not parse: 
      " return raw urllib3 response"
      return r
    if not self.debug_loads:
      " return parsed edn"
      return loads(r.data)
    "time edn parse time and return parsed edn"
    return self.debug(loads, args=(r_data, ), kwargs={},
          fmt='<<< parsed edn datastruct in {ms}ms', color='green')