def build_from_document(service, base, future=None, http=None, developerKey=None, model=None, requestBuilder=HttpRequest):
 service = simplejson.loads(service)
 base = urlparse.urljoin(base, service['basePath'])
 if future:
  future = simplejson.loads(future)
  auth_discovery = future.get('auth', {})
 else:
  future = {}
  auth_discovery = {}
 schema = Schemas(service)
 if (model is None):
  features = service.get('features', [])
  model = JsonModel(('dataWrapper' in features))
 resource = createResource(http, base, model, requestBuilder, developerKey, service, future, schema)
 def auth_method():
  'Discovery information about the authentication the API uses.'
  return auth_discovery
 setattr(resource, 'auth_discovery', auth_method)
 return resource

def build_from_document ( service , base , future = None , http = None , developerKey = None , model = None , requestBuilder = HttpRequest ) : service = simplejson . loads ( service ) base = urlparse . urljoin ( base , service [ 'basePath' ] ) if future : future = simplejson . loads ( future ) auth_discovery = future . get ( 'auth' , { } ) else : future = { } auth_discovery = { } schema = Schemas ( service ) if ( model is None ) : features = service . get ( 'features' , [ ] ) model = JsonModel ( ( 'dataWrapper' in features ) ) resource = createResource ( http , base , model , requestBuilder , developerKey , service , future , schema ) def auth_method ( ) : return auth_discovery setattr ( resource , 'auth_discovery' , auth_method ) return resource
create a resource for interacting with an api .