(self, name, description=None)
return self.get_sketch(sketch_id)
Create a new sketch.

        Args:
            name: Name of the sketch.
            description: Description of the sketch.

        Returns:
            Instance of a Sketch object.
Create a new sketch.
Create a new sketch .
def create_sketch(self, name, description=None):
        """Create a new sketch.

        Args:
            name: Name of the sketch.
            description: Description of the sketch.

        Returns:
            Instance of a Sketch object.
        """
        if not description:
            description = name

        retry_count = 0
        objects = None
        while True:
            resource_url = '{0:s}/sketches/'.format(self.api_root)
            form_data = {'name': name, 'description': description}
            response = self.session.post(resource_url, json=form_data)
            response_dict = error.get_response_json(response, logger)
            objects = response_dict.get('objects')
            if objects:
                break
            retry_count += 1

            if retry_count >= self.DEFAULT_RETRY_COUNT:
                raise RuntimeError('Unable to create a new sketch.')

        sketch_id = objects[0]['id']
        return self.get_sketch(sketch_id)
def create_sketch ( self , name , description = None ) : if not description : description = name retry_count = 0 objects = None while True : resource_url = '{0:s}/sketches/' . format ( self . api_root ) form_data = { 'name' : name , 'description' : description } response = self . session . post ( resource_url , json = form_data ) response_dict = error . get_response_json ( response , logger ) objects = response_dict . get ( 'objects' ) if objects : break retry_count += 1 if retry_count >= self . DEFAULT_RETRY_COUNT : raise RuntimeError ( 'Unable to create a new sketch.' ) sketch_id = objects [ 0 ] [ 'id' ] return self . get_sketch ( sketch_id )