Checks to see if a slug is available. If the slug is already being used
        this method returns False.  Otherwise, return True.
763262
def is_slug_available(self, slug, **kwargs):
        
        try:
            self.get(slug=slug, **kwargs)
            return False
        except self.model.DoesNotExist:
            return True
649486
public function slugExists(Model $model, $slug) {
        return (bool) $model->find('count', array(
            'conditions' => array($this->settings[$model->alias]['slug'] => $slug),
            'recursive' => -1,
            'contain' => false
        ));
    }
60271
def exists(self, callback=None):
        
        def existence_tested(response):
            if callable(callback):
                callback(bool(response))
        self.bucket.lookup(self.name, callback=existence_tested)
967035
private function checkUpdatingSlug($slug)
    {
        if ($this->id >= 1) {
            // find entries matching slug, exclude updating entry
            $exist = self::where($this->slugOptions->slugField, $slug)
                ->where('id', '!=', $this->id)
                ->first();

            // no entries, save to use current slug
            if (!$exist) {
                return $slug;
            }
        }

        // unique slug needed
        return false;
    }
528631
function is_page_visible( $slug ) {
            if ( $this->is_admin_page( $slug ) ) {
                return true;
            }

            return $this->_menu->is_submenu_item_visible( $slug, true, true );
        }
1200463
def available(self, context):
	
		
		
		if self.__available is None:
			avail = False
			name = context.resolve(self.__name)
			for box in self.__box_list():
				if box["name"] == name and box["version"] == "0":
					avail = True
					break
			self.__available = avail
		return self.__available
295682
public function hasRoleSlug($slug)
    {
        $roles = $this->active_roles->filter(function (Role $role) use ($slug) {
            return $role->hasSlug($slug);
        });

        return ! $roles->isEmpty();
    }
967990
def get_search_for_slugs(self, slug):
    
    return _get_request(_SLUG_SEARCH.format(c_api=_C_API_BEGINNING,
                                            api=_API_VERSION,
                                            slug=_format_query(slug),
                                            at=self.access_token))
545538
public function is_plugin_installed( $slug )
	{
		$element = $this->search_plugin( $slug );
		if ( count( $element ) ) {
			return true;
		} else {
			return false;
		}
	}
866291
protected boolean isAvailable() {
        // If in memory, it's available.
        if (fileItem.isInMemory()) {
            return true;
        }
        // Check actual existence of temporary file.
        if (fileItem instanceof DiskFileItem) {
            return ((DiskFileItem)fileItem).getStoreLocation().exists();
        }
        // Check whether current file size is different than original one.
        return (fileItem.getSize() == size);
    }
640438
def exists(self, batch_id=None):
        
        try:
            self.model.objects.get(batch_id=batch_id)
        except self.model.DoesNotExist:
            return False
        return True
1329647
protected function getExistingSlugs($slug)
    {
        return static::where($this->slugOptions->slugField, 'LIKE', "{$slug}%")
            ->withoutGlobalScopes()// ignore scopes
            ->withTrashed()// trashed, when entry gets activated again
            ->orderBy($this->slugOptions->slugField)
            ->get()
            ->pluck($this->slugOptions->slugField);
    }
1255951
public function isAvailable(): bool
    {
        foreach ($this->items as $item) {
            if ($item->isVisible()) {
                return true;
            }
        }

        return false;
    }
203353
private function checkAvailability() {
		// Get the boldgrid_available transient.
		$available = get_site_transient( 'boldgrid_available' );

		// No transient was found.
		$wp_http = new WP_Http();
		$url = $this->getUrl();

		// Check that calling server is not blocked locally.
		if ( $wp_http->block_request( $url ) === false ) {
			$available = 1;
		}

		// Update the boldgrid_available transient.
		set_site_transient( 'boldgrid_available', ( int ) $available, 2 * MINUTE_IN_SECONDS );

		return $available;
	}
1087344
public function getAvailable()
    {
        if (!$this->getAvailableFrom() && !$this->getAvailableTill()) {
            return false;
        } elseif ($this->validateDate() && $this->validateAvailability()) {
            return true;
        }

        return false;
    }
1159152
protected function needsSlugging()
    {
        /** @var CmsModel|SluggableTrait $this */

        if ($this->storeSlugLocally()) {
            return $this->CviebrockNeedsSlugging();
        }

        $config    = $this->getSluggableConfig();
        $on_update = $config['on_update'];

        // check stored slug in shared table
        if ( ! $this->getSlugFromCmsTable()) return true;

        return ( ! $this->exists || $on_update);
    }
50885
def available(name):
    '''
    
    '''
    cmd = '{0} get {1}'.format(_cmd(), name)
    if __salt__['cmd.retcode'](cmd) == 2:
        return False
    return True