(self, graph_id)
Initialize the graph object from a saved graph.

        Args:
            graph_id: integer value for the saved graph (primary key).

        Raises:
            ValueError: If issues came up during processing.
Initialize the graph object from a saved graph.
Initialize the graph object from a saved graph .
def from_saved(self, graph_id):  # pylint: disable=arguments-differ
        """Initialize the graph object from a saved graph.

        Args:
            graph_id: integer value for the saved graph (primary key).

        Raises:
            ValueError: If issues came up during processing.
        """
        resource_id = f'sketches/{self._sketch.id}/graphs/{graph_id}/'
        data = self.api.fetch_resource_data(resource_id)

        objects = data.get('objects')
        if not objects:
            logger.warning(
                'Unable to load saved graph with ID: %d, '
                'are you sure it exists?', graph_id)
        graph_dict = objects[0]
        self._parse_graph_dict(graph_dict)

        self._resource_id = graph_id
        self._name = graph_dict.get('name', 'No name')
        self._description = graph_dict.get('description', '')
        self._username = graph_dict.get('user', {}).get('username', 'System')
        self._created_at = dateutil.parser.parse(
            graph_dict.get('created_at', ''))
        self._updated_at = dateutil.parser.parse(
            graph_dict.get('updated_at', ''))
def from_saved ( self , graph_id ) : # pylint: disable=arguments-differ resource_id = f'sketches/{self._sketch.id}/graphs/{graph_id}/' data = self . api . fetch_resource_data ( resource_id ) objects = data . get ( 'objects' ) if not objects : logger . warning ( 'Unable to load saved graph with ID: %d, ' 'are you sure it exists?' , graph_id ) graph_dict = objects [ 0 ] self . _parse_graph_dict ( graph_dict ) self . _resource_id = graph_id self . _name = graph_dict . get ( 'name' , 'No name' ) self . _description = graph_dict . get ( 'description' , '' ) self . _username = graph_dict . get ( 'user' , { } ) . get ( 'username' , 'System' ) self . _created_at = dateutil . parser . parse ( graph_dict . get ( 'created_at' , '' ) ) self . _updated_at = dateutil . parser . parse ( graph_dict . get ( 'updated_at' , '' ) )