Make sure the location exists.
961902
def ensure_exists(self):
        """"""
        if not self.context.is_directory(self.directory):
            # This can also happen when we don't have permission to one of the
            # parent directories so we'll point that out in the error message
            # when it seems applicable (so as not to confuse users).
            if self.context.have_superuser_privileges:
                msg = "The directory %s doesn't exist!"
                raise ValueError(msg % self)
            else:
                raise ValueError(compact("""
                    The directory {location} isn't accessible, most likely
                    because it doesn't exist or because of permissions. If
                    you're sure the directory exists you can use the
                    --use-sudo option.
                """, location=self))
1149562
def validate(self):
        """"""
        validate_marked_location(self.location)
        if not isinstance(self.optional, bool):
            raise TypeError(u'Expected bool optional, got: {} {}'.format(
                type(self.optional).__name__, self.optional))
64176
def ensure_dir(path):
    """"""
    if not (os.path.exists(path) and
            os.path.isdir(path)):
        os.mkdir(path)
399725
def contains(self, location):
    
    for i, coord in enumerate(location):
      if self.almostEqual(abs(coord), self.dimensions[i] / 2.):
        return True
    return False
85461
def _get_location(package, location):
    """"""
    for region in package['regions']:
        if region['location']['location']['name'] == location:
            return region

    raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % location)
3596
def ensure_directory_exists(self):
        
        if not os.path.isdir(self.directory):
            msg = "The password storage directory doesn't exist! (%s)"
            raise MissingPasswordStoreError(msg % self.directory)
667732
private boolean checkLocations(long length, CompoundLocation<Location> locations) {
        for(Location location : locations.getLocations()){
        	if(location instanceof RemoteLocation)
        		continue;
            if(location.getIntBeginPosition() == null || 
                    location.getIntBeginPosition() < 0){
                return false;
            }
            if(location.getIntEndPosition() == null ||
                    location.getIntEndPosition() > length){
                return false;
            }
        }
        return true;
    }
143038
def check(self, url_data):
        """"""
        location = get_location(url_data.host)
        if location:
            url_data.add_info(_("URL is located in %(location)s.") %
            {"location": _(location)})
923416
def _sanity_check_registered_locations_parent_locations(query_metadata_table):
    """"""
    for location, location_info in query_metadata_table.registered_locations:
        if (location != query_metadata_table.root_location and
                not query_metadata_table.root_location.is_revisited_at(location)):
            # If the location is not the root location and is not a revisit of the root,
            # then it must have a parent location.
            if location_info.parent_location is None:
                raise AssertionError(u'Found a location that is not the root location of the query '
                                     u'or a revisit of the root, but does not have a parent: '
                                     u'{} {}'.format(location, location_info))

        if location_info.parent_location is not None:
            # Make sure the parent_location is also registered.
            # If the location is not registered, the following line will raise an error.
            query_metadata_table.get_location_info(location_info.parent_location)
862635
def _on_new_location(self, form):
        """"""
        self._desired_longitude = float(form.data["long"])
        self._desired_latitude = float(form.data["lat"])
        self._desired_zoom = 13
        self._screen.force_update()
1286899
def exists(path):
    """"""
    try:
        return path.expanduser().absolute().exists()
    except AttributeError:
        return os.path.exists(os.path.abspath(os.path.expanduser(str(path))))
325520
def make_file_exist(self):
        """"""
        self.parent.make_directory_exist()
        self.parent.touch_file(self.name)
        return self
1064959
def _ensure_directory_exists(self, directory):
        """"""
        if not os.path.lexists(directory):
            os.makedirs(directory)
        return directory
1327333
def exists(self, filepath):
        """"""
        if self.is_ssh(filepath):
            self._check_ftp()
            remotepath = self._get_remote(filepath)
            try:
                self.ftp.stat(remotepath)
            except IOError as e:
                if e.errno == errno.ENOENT:
                    return False
            else:
                return True
        else:
            return os.path.exists(filepath)
1030802
function createLocation () {
  var deferred = q.defer();

  // Make the directory, and report status
  mkdirp(globalConfig.db.location, function (err, made) {
    if(err) return deferred.reject(err);

    deferred.resolve(made);
  });

  return deferred.promise;
}
393826
def check_valid_locations(self, locations=None):
        
        if locations is None:
            locations = self.locations
        for location in locations:
            if (not self.is_server(location) and
                not self.is_ssh_url(location) and
                not self.has_host(location)):
                err_exit('Unknown location: %(location)s' % locals())
1058588
protected function _ensureHere() {
		if (empty($this->_here) || empty($this->_hereQuery)) {
			$this->_here = rtrim(preg_replace(
				'/^' . preg_quote($this->request->base, '/') . '/',
				'',
				$this->request->here,
				1
			), '/');
			$this->_hereQuery = rtrim($this->request->here(false), '/');
		}
	}