(self, template_id, sketch_id=0)
Initialize the search template from a saved template, by ID value.

        Args:
            template_id: integer value for the saved search template.
            sketch_id: optional integer value for a sketch ID. If not
                provided, an attempt is made to figure it out.

        Raises:
            ValueError: If issues came up during processing.
Initialize the search template from a saved template, by ID value.
Initialize the search template from a saved template by ID value .
def from_saved(self, template_id, sketch_id=0):
        """Initialize the search template from a saved template, by ID value.

        Args:
            template_id: integer value for the saved search template.
            sketch_id: optional integer value for a sketch ID. If not
                provided, an attempt is made to figure it out.

        Raises:
            ValueError: If issues came up during processing.
        """
        self._resource_id = template_id
        self.resource_uri = f'searchtemplate/{self._resource_id}/'

        if sketch_id:
            self._sketch_id = sketch_id
        else:
            data = self.lazyload_data(refresh_cache=True)
            meta = data.get('meta', {})
            sketch_ids = meta.get('sketch_ids', [])
            if len(sketch_ids) > 1:
                sketch_string = ', '.join(sketch_ids)
                raise ValueError(
                    'Search template has too many attached saved searches, '
                    'please pick one from: {0:s}'.format(sketch_string))
            self._sketch_id = sketch_ids[0]
def from_saved ( self , template_id , sketch_id = 0 ) : self . _resource_id = template_id self . resource_uri = f'searchtemplate/{self._resource_id}/' if sketch_id : self . _sketch_id = sketch_id else : data = self . lazyload_data ( refresh_cache = True ) meta = data . get ( 'meta' , { } ) sketch_ids = meta . get ( 'sketch_ids' , [ ] ) if len ( sketch_ids ) > 1 : sketch_string = ', ' . join ( sketch_ids ) raise ValueError ( 'Search template has too many attached saved searches, ' 'please pick one from: {0:s}' . format ( sketch_string ) ) self . _sketch_id = sketch_ids [ 0 ]