Get information on the specified sketch.

    Args:
      sketch_id (int): ID of sketch

    Returns:
      dict: Dictionary of sketch information

    Raises:
      ValueError: Sketch is inaccessible
964646
def get_sketch(self, sketch_id):
    
    resource_url = '{0:s}/sketches/{1:d}/'.format(self.api_base_url, sketch_id)
    response = self.session.get(resource_url)
    response_dict = response.json()
    try:
      response_dict['objects']
    except KeyError:
      raise ValueError('Sketch does not exist or you have no access')
    return response_dict
1176082
def get_details(self, ids):
        
        if isinstance(ids, list):
            if len(ids) > 5:
                ids = ids[:5]
            id_param = ';'.join(ids) + '/'
        else:
            ids = str(ids)
            id_param = ids + '/'

        header, content = self._http_request(id_param)
        resp = json.loads(content)
        if not self._is_http_response_ok(header):
            error = resp.get('error_message', 'Unknown Error')
            raise HttpException(header.status, header.reason, error) 
        return resp
1333674
def flask_ctx_get_request_id():
    
    from flask import _app_ctx_stack as stack  # We do not support < Flask 0.9

    if stack.top is None:
        raise ExecutedOutsideContext()

    g_object_attr = stack.top.app.config['LOG_REQUEST_ID_G_OBJECT_ATTRIBUTE']
    return g.get(g_object_attr, None)
276529
def export_artifacts(self, processed_artifacts, sketch_id):
    

    # Export processed timeline(s)
    for timeline_name, artifact_path in processed_artifacts:
      print('Uploading {0:s} to timeline {1:s}'.format(
          artifact_path, timeline_name))
      new_timeline_id = self.upload_timeline(timeline_name, artifact_path)
      self.add_timeline_to_sketch(sketch_id, new_timeline_id)

    return sketch_id
797656
def create_sketch(self, name, description):
    
    resource_url = '{0:s}/sketches/'.format(self.api_base_url)
    form_data = {'name': name, 'description': description}
    response = self.session.post(resource_url, json=form_data)
    response_dict = response.json()
    sketch_id = response_dict['objects'][0]['id']
    return sketch_id
1147820
def get_mark(self, mark_id):
        
        if mark_id in self.idx:
            return Cmarkable(self.idx[mark_id], self.type)
        else:
            return None
827515
def get(self, node_id):
        
        return \
            self._nodes[_node.Root.ID].get(node_id) or \
            self._nodes[_node.Root.ID].get(self._sid_map.get(node_id))
601509
def usable_ids(cls, id, accept_multi=True):
        
        try:
            qry_id = [int(id)]
        except ValueError:
            try:
                qry_id = cls.from_cn(id)
            except Exception:
                qry_id = None

        if not qry_id or not accept_multi and len(qry_id) != 1:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id if accept_multi else qry_id[0]
182510
def getReference(self, id_):
        
        if id_ not in self._referenceIdMap:
            raise exceptions.ReferenceNotFoundException(id_)
        return self._referenceIdMap[id_]
444019
def sprint_info(self, board_id, sprint_id):
        
        sprint = Sprint(self._options, self._session)
        sprint.find(sprint_id)
        return sprint.raw
1319543
def get_item_with_id(self, uid):
        
        for item in self.get_items():
            if item.id == uid:
                return item

        return None
1330990
def get(cls, id):
        

        # cached?
        if CACHE:
            if id in _cache['VRF']:
                log.debug('cache hit for VRF %d' % id)
                return _cache['VRF'][id]
            log.debug('cache miss for VRF %d' % id)

        try:
            vrf = VRF.list({ 'id': id })[0]
        except IndexError:
            raise NipapNonExistentError('no VRF with ID ' + str(id) + ' found')

        _cache['VRF'][id] = vrf
        return vrf
356659
def registration_info_request(self, registration_id):
        
        return self.requests_session.get(
            self.INFO_END_POINT + registration_id,
            params={'details': 'true'}
        )
809654
def handle_sketch_version(msg):
    """"""
    if not msg.gateway.is_sensor(msg.node_id):
        return None
    msg.gateway.sensors[msg.node_id].sketch_version = msg.payload
    msg.gateway.alert(msg)
    return None
169707
def usable_id(cls, id):
        
        try:
            # id is maybe a sshkey name
            qry_id = cls.from_name(id)
            if not qry_id:
                qry_id = int(id)
        except DuplicateResults as exc:
            cls.error(exc.errors)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
243134
def get_widget_from_id(id):
    

    res = id.split('-')
    try:
        model_cls = apps.get_model(res[0], res[1])
        obj = model_cls.objects.get(parent=res[2], id=res[3])
    except:
        obj = None
    return obj
1201732
def get_model_info(self, model_id, token=None, url=API_GET_MODEL_INFO):
        
        auth = 'Bearer ' + self.check_for_token(token)
        h = {'Authorization': auth, 'Cache-Control':'no-cache'}
        the_url = url + '/' + model_id
        r = requests.get(the_url, headers=h)

        return r