The starting point for a preview of a future object.
        This is the object which will have future revisions iterated and applied to.

        :param dict dct: The starting object dictionary
        :return: The preview object id
        :rtype: str
168577
def __create_preview_object_base(self, dct):
        
        if dct.get("_id"):
            del dct["_id"]

        preview_object_id = yield self.previews.insert(dct)

        raise Return(preview_object_id)
770262
def getobjectref(blocklst, commdct):
    
    objlst_dct = {}
    for eli in commdct:
        for elj in eli:
            if 'object-list' in elj:
                objlist = elj['object-list'][0]
                objlst_dct[objlist] = []

    for objlist in list(objlst_dct.keys()):
        for i in range(len(commdct)):
            for j in range(len(commdct[i])):
                if 'reference' in commdct[i][j]:
                    for ref in commdct[i][j]['reference']:
                        if ref == objlist:
                            objlst_dct[objlist].append((blocklst[i][0], j))
    return objlst_dct
239015
def get_initial_state(self, source_length: mx.sym.Symbol, source_seq_len: int) -> AttentionState:
        
        dynamic_source = mx.sym.reshape(mx.sym.zeros_like(source_length), shape=(-1, 1, 1))
        # dynamic_source: (batch_size, source_seq_len, num_hidden_dynamic_source)
        dynamic_source = mx.sym.broadcast_to(dynamic_source, shape=(0, source_seq_len, self.dynamic_source_num_hidden))
        return AttentionState(context=None, probs=None, dynamic_source=dynamic_source)
902125
def get_initial(self):
        
        initial = {}

        if self.kwargs.get('mode', None):
            filename = "{}.txt".format(self.kwargs['mode'])
            filepath = os.path.join(settings.BASE_DIR, 'demo_datas', filename)
            if os.path.exists(filepath):
                with io.open(filepath, 'r', encoding='utf-8') as fp:
                    initial['foo'] = fp.read()

        return initial
616054
def json_numpy_obj_hook(dct):
    
    if isinstance(dct, dict) and '__ndarray__' in dct:
        data = np.asarray(dct['__ndarray__'], dtype=dct['dtype'])
        return data.reshape(dct['shape'])
    return dct
1227637
def load_from_dict(dct=None, **kwargs):
    
    dct = dct or dict()
    dct.update(kwargs)

    def _load_from_dict(metadata):
        return dict(dct)
    return _load_from_dict
107524
def preview(self):
        
        if self.id:
            resource = self.PREVIEW
            resource = resource.format(account_id=self.account.id, id=self.id)
            response = Request(self.account.client, 'get', resource).perform()
            return response.body['data']
1114195
def time_context_from_ref(self, timex):
        """"""
        # If the timex has a value set, it means that it refers to a DCT or
        # a TimeExpression e.g. "value": {"@id": "_:DCT_1"} and the parameters
        # need to be taken from there
        value = timex.get('value')
        if value:
            # Here we get the TimeContext directly from the stashed DCT
            # dictionary
            tc = self.doc.timexes.get(value['@id'])
            return tc
        return None
676487
def load(self, path):
        
        self.dct = wrapper.Dictionary.load(path)
        return self
822542
def preview(ident):
    ''''''
    source = get_source(ident)
    cls = backends.get(current_app, source.backend)
    max_items = current_app.config['HARVEST_PREVIEW_MAX_ITEMS']
    backend = cls(source, dryrun=True, max_items=max_items)
    return backend.harvest()
66507
def _nodeGetNonDefaultsDict(self):
        
        dct = {}
        if self.data != self.defaultData:
            dct['data'] = self.data.toString() # calls QFont.toString()
        return dct
655518
def relpath(self, start='.'):
        
        cwd = self._next_class(start)
        return cwd.relpathto(self)
184455
def embedded_preview(src_path):
  '''  '''
  try:
    assert(exists(src_path) and isdir(src_path))

    preview_list = glob(join(src_path, '[Q|q]uicklook', '[P|p]review.*'))
    assert(preview_list)  # Assert there's at least one preview file
    preview_path = preview_list[0]  # Simplistically, assume there's only one

    with NamedTemporaryFile(prefix='pyglass', suffix=extension(preview_path), delete=False) as tempfileobj:
      dest_path = tempfileobj.name
      shutil.copy(preview_path, dest_path)

    assert(exists(dest_path))
    return dest_path
  except:
    return None
40264
def preview_stream(stream):
    
    # together with waitkeys later, helps to close the video window effectively
    _cv2.startWindowThread()
    
    for frame in stream.frame_generator():
        if frame is not None:
            _cv2.imshow('Video', frame)
            _cv2.moveWindow('Video',5,5)
        else:
            break
        key = _cv2.waitKey(1) & 0xFF
        if key == ord("q"):
            break
    _cv2.waitKey(1)
    _cv2.destroyAllWindows()
    _cv2.waitKey(1)
208990
def omit(dct, *keys):
    
    copy = dict()
    for key in dct:
        if key not in keys:
            copy[key] = dct[key]
    return copy
689451
def get_object(self):
        
        obj = super(PreviewWrapper, self).get_object()

        if not obj:
            raise http.Http404

        return obj
467891
def fetch_starting_at_coord(self,coord):
    #b2 = BAMFile(self.path,blockStart=coord[0],innerStart=coord[1],index_obj=self.index,reference=self._reference)
    
    b2 = BAMFile(self.path,BAMFile.Options(blockStart=coord[0],innerStart=coord[1],reference=self.reference))
    return b2