Check if we have at least one snapshot.
329963
def haveSnapshots(self):
		""""""
		return os.path.islink(self.latestLink) and os.path.isdir(self.latestLink)
1301474
def delete_snapshot(self, path, snapshotname, **kwargs):
        """"""
        response = self._delete(path, 'DELETESNAPSHOT', snapshotname=snapshotname, **kwargs)
        assert not response.content
1006213
def root_snapshot
      return nil if current_snapshot.nil?

      current = current_snapshot
      current = current.parent while current.parent != nil
      current
    end
750643
def find_snapshot(name)
      find_helper = lambda do |name, root|
        return nil if root.nil?
        return root if root.name == name || root.uuid == name

        root.children.each do |child|
          result = find_helper.call(name, child)
          return result unless result.nil?
        end

        nil
      end

      find_helper.call(name, root_snapshot)
    end
1263173
def _check_insersection(self, version, ranges):
        """"""

        for ver_range in ranges:
            if not self._check_ver_range(version, ver_range):
                return False

        return True
1060800
function validateSnapshotStorage(snapshotStorage) {
	if (typeof snapshotStorage !== 'object' || !snapshotStorage)
		throw new TypeError('snapshotStorage argument must be an Object');
	if (typeof snapshotStorage.getAggregateSnapshot !== 'function')
		throw new TypeError('snapshotStorage.getAggregateSnapshot argument must be a Function');
	if (typeof snapshotStorage.saveAggregateSnapshot !== 'function')
		throw new TypeError('snapshotStorage.saveAggregateSnapshot argument must be a Function');
}
915708
def apply(self, snapshot):
        """"""

        for name in snapshot:
            setattr(self, name, snapshot[name])
61625
def _get_snapshot(name, suffix, blade):
    '''
    
    '''
    try:
        filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix)
        res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt)
        return res.items[0]
    except rest.ApiException:
        return None
1115051
def _find_snapshot(self, name):
        
        remote_snapshots = self._get_snapshots(self.client)
        for remote in reversed(remote_snapshots):
            if remote["Name"] == name or \
                    re.match(name, remote["Name"]):
                return remote
        return None
568171
def get_snapshot_brok(self, snap_output, exit_status):
        
        data = {
            'uuid': self.uuid,
            'snapshot_output': snap_output,
            'snapshot_time': int(time.time()),
            'snapshot_exit_status': exit_status,
        }
        self.fill_data_brok_from(data, 'check_result')
        return Brok({'type': self.my_type + '_snapshot', 'data': data})
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)
354655
def show_snapshot(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The show_snapshot function must be called with -f or --function.'
        )
    if not kwargs or 'name' not in kwargs:
        log.error(
            'Must specify name.'
        )
        return False

    conn = get_conn()
    return _expand_item(conn.ex_get_snapshot(kwargs['name']))
678733
function(thing) {
    if (L.existy(thing) && L.existy(thing.snapshot))
      return thing.snapshot();
    else
      fail("snapshot not currently implemented")
      //return L.snapshot(thing);
  }
628585
def download_needed?(task)
      return true if !File.exist?(name)

      if snapshot?
        return false if offline? && File.exist?(name)
        return true if update_snapshot? || old?
      end

      return false
    end
1214851
def blob_is_snapshot(url):
    # type: (str) -> bool
    
    if '?snapshot=' in url:
        try:
            dateutil.parser.parse(url.split('?snapshot=')[-1])
            return True
        except (ValueError, OverflowError):
            pass
    return False
634549
protected synchronized void completeSnapshot(Snapshot snapshot) {
    checkNotNull(snapshot, "snapshot cannot be null");

    Map.Entry<Long, Snapshot> lastEntry = snapshots.lastEntry();
    if (lastEntry == null) {
      snapshots.put(snapshot.index(), snapshot);
    } else if (lastEntry.getValue().index() < snapshot.index()) {
      snapshots.put(snapshot.index(), snapshot);
      Snapshot lastSnapshot = lastEntry.getValue();
      lastSnapshot.close();
      lastSnapshot.delete();
    } else if (storage.isRetainStaleSnapshots()) {
      snapshots.put(snapshot.index(), snapshot);
    } else {
      snapshot.close();
      snapshot.delete();
    }
  }
344654
def list_snapshots(self):
        
        return [snap for snap in self.manager.list_snapshots()
                if snap.volume_id == self.id]