finds out if a ebs volume exists
515519
def ebs_volume_exists(connection, region, volume_id):
    
    for vol in connection.get_all_volumes():
        if vol.id == volume_id:
            return True
    return False
1214002
def exists(self, bbox_or_slices):
    
    if type(bbox_or_slices) is Bbox:
      requested_bbox = bbox_or_slices
    else:
      (requested_bbox, _, _) = self.__interpret_slices(bbox_or_slices)
    realized_bbox = self.__realized_bbox(requested_bbox)
    cloudpaths = txrx.chunknames(realized_bbox, self.bounds, self.key, self.underlying)
    cloudpaths = list(cloudpaths)

    with Storage(self.layer_cloudpath, progress=self.progress) as storage:
      existence_report = storage.files_exist(cloudpaths)
    return existence_report
494613
def exists(self):
        
        return gf.file_exists(self.file_path) or gf.directory_exists(self.file_path)
1052212
def status(name):
    '''
    
    '''
    # Get volume status
    root = _gluster_xml('volume status {0}'.format(name))
    if not _gluster_ok(root):
        # Most probably non-existing volume, the error output is logged
        # This return value is easy to test and intuitive
        return None

    ret = {'bricks': {}, 'nfs': {}, 'healers': {}}

    def etree_legacy_wrap(t):
        ret = _etree_to_dict(t)
        ret['online'] = (ret['status'] == '1')
        ret['host'] = ret['hostname']
        return ret

    # Build a hash to map hostname to peerid
    hostref = {}
    for node in _iter(root, 'node'):
        peerid = node.find('peerid').text
        hostname = node.find('hostname').text
        if hostname not in ('NFS Server', 'Self-heal Daemon'):
            hostref[peerid] = hostname

    for node in _iter(root, 'node'):
        hostname = node.find('hostname').text
        if hostname not in ('NFS Server', 'Self-heal Daemon'):
            path = node.find('path').text
            ret['bricks'][
                '{0}:{1}'.format(hostname, path)] = etree_legacy_wrap(node)
        elif hostname == 'NFS Server':
            peerid = node.find('peerid').text
            true_hostname = hostref[peerid]
            ret['nfs'][true_hostname] = etree_legacy_wrap(node)
        else:
            peerid = node.find('peerid').text
            true_hostname = hostref[peerid]
            ret['healers'][true_hostname] = etree_legacy_wrap(node)

    return ret
539796
def kill_zombie_volumes
      # Occasionaly, tearing down ec2 instances leaves orphaned EBS volumes behind -- these stack up quickly.
      # This simply looks for EBS volumes that are not in use
      @logger.notify("aws-sdk: Kill Zombie Volumes!")
      volume_count = 0

      regions.each do |region|
        @logger.debug "Reviewing: #{region}"
        available_volumes = client(region).describe_volumes(
          :filters => [
            { :name => 'status', :values => ['available'], }
          ]
        ).volumes

        available_volumes.each do |volume|
          begin
            client(region).delete_volume(:volume_id => volume.id)
            volume_count += 1
          rescue Aws::EC2::Errors::InvalidVolume::NotFound => e
            @logger.debug "Failed to remove volume: #{volume.id} #{e}"
          end
        end
      end

      @logger.notify "Freed #{volume_count} volume(s)"
    end
840807
def detect(self, volume_system, vstype='detect'):
        """"""

        # Loop over all volumes in image.
        for p in self._find_volumes(volume_system, vstype):
            import pytsk3

            volume = volume_system._make_subvolume(
                index=self._format_index(volume_system, p.addr),
                offset=p.start * volume_system.disk.block_size,
                size=p.len * volume_system.disk.block_size
            )
            # Fill volume with more information
            volume.info['fsdescription'] = p.desc.strip().decode('utf-8')

            if p.flags == pytsk3.TSK_VS_PART_FLAG_ALLOC:
                volume.flag = 'alloc'
                volume.slot = _util.determine_slot(p.table_num, p.slot_num)
                volume_system._assign_disktype_data(volume)
                logger.info("Found allocated {2}: block offset: {0}, length: {1} ".format(p.start, p.len,
                                                                                          volume.info['fsdescription']))
            elif p.flags == pytsk3.TSK_VS_PART_FLAG_UNALLOC:
                volume.flag = 'unalloc'
                logger.info("Found unallocated space: block offset: {0}, length: {1} ".format(p.start, p.len))
            elif p.flags == pytsk3.TSK_VS_PART_FLAG_META:
                volume.flag = 'meta'
                logger.info("Found meta volume: block offset: {0}, length: {1} ".format(p.start, p.len))

            yield volume
206958
def exists(self):
        """"""

        try:
            self.blob.reload()
            return True
        except google.cloud.exceptions.NotFound: return False
1229206
def _check_existence_by_collection(self, container, item_name):
        '''
        '''

        coll = container.get_collection()
        for item in coll:
            if item.name == item_name:
                return True
        return False
1327966
def db_exists(name, **client_args):
    '''
    
    '''
    if name in [db['name'] for db in list_dbs(**client_args)]:
        return True

    return False
572850
def exists(self, bucket, label):
        ''''''
        fn = self._zf(bucket, label)
        try:
            self.z.getinfo(fn)
            return True
        except KeyError:
            return False
575297
def exists?(type, hash)
      if directory(type, hash) &&
         directory(type, hash).files.head(key_component(type, hash))
        true
      else
        false
      end
    end
135438
def _volumes(self):
        

        # to find all the possible mbed volumes, we look for registry entries
        # under all possible USB tree which have a "BSD Name" that starts with
        # "disk" # (i.e. this is a USB disk), and have a IORegistryEntryName that
        # matches /\cmbed/
        # Once we've found a disk, we can search up for a parent with a valid
        # serial number, and then search down again to find a tty that's part
        # of the same composite device
        # ioreg -a -r -n <usb_controller_name> -l
        usb_controllers = [
            # Leaving these here for reference. The code nominally scanned each controller,
            # but a bug (?) caused it to only pay attention to the last one. That seems to
            # work fine, so the others are commented out.
#             "AppleUSBXHCI",
#             "AppleUSBUHCI",
#             "AppleUSBEHCI",
#             "AppleUSBOHCI",
            "IOUSBHostDevice",
        ]

        cmp_par = "-n"
        # For El Captain we need to list all the instances of (-c) rather than
        # compare names (-n)
        if self.mac_version >= 10.11:
            cmp_par = "-c"

        for usb_controller in usb_controllers:
            ioreg_usb = subprocess.Popen(
                ["ioreg", "-a", "-r", cmp_par, usb_controller, "-l"],
                stdout=subprocess.PIPE,
            )
            usb_tree = _plist_from_popen(ioreg_usb)

        r = {}

        for name, obj in enumerate(usb_tree):
            pruned_obj = _prune(
                obj,
                [
                    "USB Serial Number",
                    "idVendor",
                    "BSD Name",
                    "IORegistryEntryName",
                    "idProduct",
                ],
            )
            r.update(_dfs_usb_info(pruned_obj, []))

        return r
1087804
def _has_local_storage(self, pod=None):
        

        for vol in pod.volumes:
            if vol.emptyDir is not None:
                return True
        return False
1223747
def exist(name):
    '''
    
    '''
    dev = os.path.join(name, 'dev')
    proc = os.path.join(name, 'proc')
    return all(os.path.isdir(i) for i in (name, dev, proc))
893087
def exists(self, record_key):
        
        ''' 
            
        '''
        
        title = '%s.exists' % self.__class__.__name__
    
    # validate inputs
        input_fields = {
            'record_key': record_key
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
    
    # construct path to file
        from os import path
        file_path = path.join(self.collection_folder, record_key)

    # validate existence of file
        if not path.exists(file_path):
            return False
        return True
78348
def exists(self):
        """"""

        try:
            self.s3_object.load()
            return True
        except botocore.exceptions.ClientError: return False
943776
function fileExists( $path, $checkDFSFile = false )
    {
        $path = self::cleanPath( $path );
        eZDebugSetting::writeDebug( 'kernel-clustering', "dfs::fileExists( '$path' )" );
        return self::$dbbackend->_exists( $path, false, true, $checkDFSFile );
    }