Ejemplo n.º 1
0
Archivo: graph.py Proyecto: xoltar/atk
def initialize_graph(graph, graph_info):
    """Initializes a graph according to given graph_info"""
    graph._id = graph_info.id_number
    graph._name = graph_info.name
    graph._ia_uri = graph_info.ia_uri
    graph._uri = server.create_full_uri("graphs/" + str(graph._id))
    return graph
Ejemplo n.º 2
0
Archivo: graph.py Proyecto: xoltar/atk
def initialize_graph(graph, graph_info):
    """Initializes a graph according to given graph_info"""
    graph._id = graph_info.id_number
    graph._name = graph_info.name
    graph._ia_uri = graph_info.ia_uri
    graph._uri= server.create_full_uri("graphs/"+ str(graph._id))
    return graph
Ejemplo n.º 3
0
def default_repr(self, collection_name):
    """Default __repr__ for a synthesized class"""
    entity = type(self).__name__
    try:
        from trustedanalytics.rest.atkserver import server
        uri = server.create_full_uri(self.uri)
        response = server.get(uri).json()
        name = response.get('name', None)
        if name:
            details = ' "%s"' % response['name']
        else:
            details = ' <unnamed@%s>' % response['uri']
    except:
        raise
        #details = " (Unable to collect details from server)"
    return entity + details
Ejemplo n.º 4
0
def default_repr(self, collection_name):
    """Default __repr__ for a synthesized class"""
    entity = type(self).__name__
    try:
        from trustedanalytics.rest.atkserver import server
        uri = server.create_full_uri(collection_name + "/" + str(self._id))
        response = server.get(uri).json()
        name = response.get('name', None)
        if name:
            details = ' "%s"' % response['name']
        else:
            details = ' <unnamed@%s>' % response['id']
    except:
        raise
        #details = " (Unable to collect details from server)"
    return entity + details
Ejemplo n.º 5
0
 def _get_model_full_uri(self):
     return server.create_full_uri(self.uri)
Ejemplo n.º 6
0
Archivo: model.py Proyecto: xoltar/atk
 def _get_model_full_uri(self):
     return server.create_full_uri('models/%d' % self._id)