Get the most recent camera image.
434275
def refresh_image(self):
        """"""
        url = str.replace(CONST.TIMELINE_IMAGES_ID_URL,
                          '$DEVID$', self.device_id)
        response = self._abode.send_request("get", url)

        _LOGGER.debug("Get image response: %s", response.text)

        return self.update_image_location(json.loads(response.text))
321751
def snapshot(self):
        """"""
        self._snapshot = {
            'muted': self.muted,
            'volume': self.volume,
            'stream': self.stream
        }
        _LOGGER.info('took snapshot of current state of %s', self.friendly_name)
890419
def getImage(self):
        '''
        

        '''
        self.lock.acquire()
        image = self.data
        self.lock.release()
        
        return image
540287
def get(img, cache_dir=CACHE_DIR, iterative=False):
    """"""
    if os.path.isfile(img):
        wal_img = img

    elif os.path.isdir(img):
        if iterative:
            wal_img = get_next_image(img)

        else:
            wal_img = get_random_image(img)

    else:
        logging.error("No valid image file found.")
        sys.exit(1)

    wal_img = os.path.abspath(wal_img)

    # Cache the image file path.
    util.save_file(wal_img, os.path.join(cache_dir, "wal"))

    logging.info("Using image \033[1;37m%s\033[0m.", os.path.basename(wal_img))
    return wal_img
1311863
def compare_last_two_snapshots(obj, raw=False):
    

    if get_snapshot_count(obj) < 2:
        return {}

    version = get_version(obj)

    snap1 = get_snapshot_by_version(obj, version - 1)
    snap2 = get_snapshot_by_version(obj, version)

    return compare_snapshots(snap1, snap2, raw=raw)
1039288
def lastLogged(self):
        """"""
        d = copy.deepcopy(self.__lastLogged)
        d.pop(-1, None)
        return d
1183063
def _getProcessedImage(self):
        """"""
        if self.imageDisp is None:
            self.imageDisp = self.image
            self.levelMin, self.levelMax = self._quickLevels(
                self.imageDisp)
            #list( map(float, self._quickLevels(self.imageDisp)))
        return self.imageDisp
730974
def lookup_camera_by_id(self, device_id):
        """"""
        camera = list(filter(
            lambda cam: cam.device_id == device_id, self.cameras))[0]
        if camera:
            return camera
        return None
597495
def _get_album_or_image(json, imgur):
    """"""
    if json['is_album']:
        return Gallery_album(json, imgur, has_fetched=False)
    return Gallery_image(json, imgur)
152244
def snapshot(self):
        """"""

        return dict((n, self._slots[n].get()) for n in self._slots.keys())
1294121
def image(self):
        
        if not hasattr(self, 'ren_win') and hasattr(self, 'last_image'):
            return self.last_image
        ifilter = vtk.vtkWindowToImageFilter()
        ifilter.SetInput(self.ren_win)
        ifilter.ReadFrontBufferOff()
        if self.image_transparent_background:
            ifilter.SetInputBufferTypeToRGBA()
        else:
            ifilter.SetInputBufferTypeToRGB()
        return self._run_image_filter(ifilter)
48524
def _is_image_sequenced(image):
    """"""
    try:
        image.seek(1)
        image.seek(0)
        result = True
    except EOFError:
        result = False

    return result
1219726
def get_notebook_image_info(project: 'Project', job: Any) -> Tuple[str, str]:
    """"""
    image_name, _ = get_job_image_info(project, job)
    return image_name, LATEST_IMAGE_TAG
39575
def _get_last_snapshot(config='root'):
    '''
    
    '''
    snapshot_list = sorted(list_snapshots(config), key=lambda x: x['id'])
    return snapshot_list[-1]
152403
def query_most_pic(num, kind='1'):
        '''
        
        '''
        return TabPost.select().where(
            (TabPost.kind == kind) & (TabPost.logo != "")
        ).order_by(TabPost.view_count.desc()).limit(num)
295750
def default_photo(self):
        
        preferred = self.preferred_photo
        if preferred is not None:
            return preferred.binary

        if preferred is None:
            if self.user_type == "teacher":
                current_grade = 12
            else:
                current_grade = int(self.grade)
                if current_grade > 12:
                    current_grade = 12
            for i in reversed(range(9, current_grade + 1)):
                data = None
                if self.photos.filter(grade_number=i).exists():
                    data = self.photos.filter(grade_number=i).first().binary
                if data:
                    return data
1355691
def get_last_doc(self):
        """"""
        return max(self.doc_dict.values(), key=lambda x: x.ts).meta_dict