Checks if a CloudFormation stack with given name exists
        :param stack_name: Name or ID of the stack
        :return: True if stack exists. False otherwise
16303
def has_stack(self, stack_name):
        
        cf = self.cf_client
        try:
            resp = cf.describe_stacks(StackName=stack_name)
            if len(resp["Stacks"]) != 1:
                return False

            # When you run CreateChangeSet on a a stack that does not exist,
            # CloudFormation will create a stack and set it's status
            # REVIEW_IN_PROGRESS. However this stack is cannot be manipulated
            # by "update" commands. Under this circumstances, we treat like
            # this stack does not exist and call CreateChangeSet will
            # ChangeSetType set to CREATE and not UPDATE.
            stack = resp["Stacks"][0]
            return stack["StackStatus"] != "REVIEW_IN_PROGRESS"

        except botocore.exceptions.ClientError as e:
            # If a stack does not exist, describe_stacks will throw an
            # exception. Unfortunately we don't have a better way than parsing
            # the exception msg to understand the nature of this exception.
            msg = str(e)

            if "Stack with id {0} does not exist".format(stack_name) in msg:
                LOG.debug("Stack with id {0} does not exist".format(
                    stack_name))
                return False
            else:
                # We don't know anything about this exception. Don't handle
                LOG.debug("Unable to get stack details.", exc_info=e)
                raise e
984898
def stack_template_key_name(blueprint):
    
    name = blueprint.name
    return "stack_templates/%s/%s-%s.json" % (blueprint.context.get_fqn(name),
                                              name,
                                              blueprint.version)
1291431
def cluster_exists(self, name):
        """"""
        clusters = self.data['clusters']
        for cluster in clusters:
            if cluster['name'] == name:
                return True
        return False
929590
def exists(self, qname):
        '''
        
        '''
        try:
            # First if not exists() -> exit
            if self.conn.queue_exists(qname):
                return True
            return False
        except pyrax.exceptions as err_msg:
            log.error('RackSpace API got some problems during '
                      'existing queue check: %s',
                      err_msg)
        return False
306768
def exists(name):
    '''
    
    '''
    contextkey = 'nspawn.exists.{0}'.format(name)
    if contextkey in __context__:
        return __context__[contextkey]
    __context__[contextkey] = name in list_all()
    return __context__[contextkey]
343166
def exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.get_queue_url(QueueName=name)
    except botocore.exceptions.ClientError as e:
        missing_code = 'AWS.SimpleQueueService.NonExistentQueue'
        if e.response.get('Error', {}).get('Code') == missing_code:
            return {'result': False}
        return {'error': __utils__['boto3.get_error'](e)}
    return {'result': True}
456581
def exists(Name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        events = conn.list_rules(NamePrefix=Name)
        if not events:
            return {'exists': False}
        for rule in events.get('Rules', []):
            if rule.get('Name', None) == Name:
                return {'exists': True}
        return {'exists': False}
    except ClientError as e:
        err = __utils__['boto3.get_error'](e)
        return {'error': err}
119812
def show_stack(name=None, profile=None):
    '''
    
    '''
    h_client = _auth(profile)
    if not name:
        return {
            'result': False,
            'comment':
                'Parameter name missing or None'
            }
    try:
        ret = {}
        stack = h_client.stacks.get(name)
        links = {}
        for link in stack.links:
            links[link['rel']] = link['href']
        ret[stack.stack_name] = {
            'status': stack.stack_status,
            'id': stack.id,
            'name': stack.stack_name,
            'creation': stack.creation_time,
            'owner': stack.stack_owner,
            'reason': stack.stack_status_reason,
            'parameters': stack.parameters,
            'links': links,
        }
        ret['result'] = True
    except heatclient.exc.HTTPNotFound:
        return {
            'result': False,
            'comment': 'No stack {0}'.format(name)
            }
    return ret
22244
def exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.describe_cache_clusters(name)
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return False
547443
def check_cluster_exists(self, name):
        """"""
        self.kubeconf.open()
        clusters = self.kubeconf.get_clusters()
        names = [c['name'] for c in clusters]
        if name in names:
            return True
        return False
888662
def exists_dimension(dimension_name,**kwargs):
    
    try:
        dimension = db.DBSession.query(Dimension).filter(Dimension.name==dimension_name).one()
        # At this point the dimension exists
        return True
    except NoResultFound:
        # The dimension does not exist
        raise 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
756126
function _doesEventContainsNestedStackId(stack) {
    if (stack.ResourceType !== 'AWS::CloudFormation::Stack') {
        return false;
    }
    if (stack.ResourceStatusReason !== 'Resource creation Initiated') {
        return false;
    }
    if (stack.ResourceStatus !== 'CREATE_IN_PROGRESS') {
        return false;
    }
    if (_.isNil(stack.PhysicalResourceId)) {
        return false;
    }

    return _hasLabelNestedStackName(stack.PhysicalResourceId);
}
219858
def exists(cls, **kwargs):
        
        if not kwargs:
            raise ValueError(u"`Exists` method requires at least one kwarg.")

        # special case to check for a simple pk
        if len(kwargs) == 1 and cls._field_is_pk(list(kwargs.keys())[0]):
            return cls.get_field('pk').exists(list(kwargs.values())[0])

        # get only the first element of the unsorted collection (the fastest)
        try:
            cls.collection(**kwargs).sort(by='nosort')[0]
        except IndexError:
            return False
        else:
            return True
744617
def bucket_exists(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)

        try:
            self._url_open('HEAD', bucket_name=bucket_name)
        # If the bucket has not been created yet, MinIO will return a "NoSuchBucket" error.
        except NoSuchBucket:
            return False
        except ResponseError:
            raise
        return True
849682
def should_submit(stack):
    
    if stack.enabled:
        return True

    logger.debug("Stack %s is not enabled.  Skipping.", stack.name)
    return False
874218
def method_name_exist(self, meth_name):
        

        methods = self.current_class.get_methods()
        for m in methods:
            if m.name == meth_name:
                return True
        return False