Check if resource view exists in HDX and if so, update resource view

        Returns:
            bool: True if updated and False if not
198007
def _update_resource_view(self, log=False):
        # type: () -> bool
        
        update = False
        if 'id' in self.data and self._load_from_hdx('resource view', self.data['id']):
            update = True
        else:
            if 'resource_id' in self.data:
                resource_views = self.get_all_for_resource(self.data['resource_id'])
                for resource_view in resource_views:
                    if self.data['title'] == resource_view['title']:
                        self.old_data = self.data
                        self.data = resource_view.data
                        update = True
                        break
        if update:
            if log:
                logger.warning('resource view exists. Updating %s' % self.data['id'])
            self._merge_hdx_update('resource view', 'id')
        return update
1281626
private boolean hasNextValue(boolean update_pos) {
    final int size = iterators.length;
    for (int i = pos + 1; i < size; i++) {
      if (timestamps[i] != 0) {
        //LOG.debug("hasNextValue -> true #" + i);
        if (update_pos) {
          pos = i;
        }
        return true;
      }
    }
    //LOG.debug("hasNextValue -> false (ran out)");
    return false;
  }
1157373
def update
      if @resource.update(resource_params)
        redirect_to [main_app, @resource], notice: t('.notice', default: update_message)
      else
        render :edit
      end
    end
544420
public static boolean doesResourceExist(final Resource res) {
        if (res != null) {
            try {
                IOUtils.read(res.getInputStream(), new byte[1]);
                return res.contentLength() > 0;
            } catch (final FileNotFoundException e) {
                LOGGER.trace(e.getMessage());
                return false;
            } catch (final Exception e) {
                LOGGER.trace(e.getMessage(), e);
                return false;
            }
        }
        return false;
    }
1281589
def is_current(self, paths=None):
        """'"""
        version = self.get_version(paths)
        if version is None:
            return False
        return self.version_ok(version)
79368
def exists(self, **kwargs):
        

        if LooseVersion(self.tmos_ver) == LooseVersion('11.6.0'):
            return self._exists_11_6(**kwargs)
        else:
            return super(Network, self)._exists(**kwargs)
187193
def handle_resource_update_success(resource):
    
    update_fields = []
    if resource.state == resource.States.ERRED:
        resource.recover()
        update_fields.append('state')

    if resource.state in (resource.States.UPDATING, resource.States.CREATING):
        resource.set_ok()
        update_fields.append('state')

    if resource.error_message:
        resource.error_message = ''
        update_fields.append('error_message')

    if update_fields:
        resource.save(update_fields=update_fields)
    logger.warning('%s %s (PK: %s) was successfully updated.' % (
        resource.__class__.__name__, resource, resource.pk))
175549
def update_resources_from_dict(self, res, types=None, names=None, 
                                   languages=None):
        
        UpdateResourcesFromDict(self.filename, res, types, names, 
                                languages)
43604
protected boolean isOperationOnMovedResource() {

        Iterator<String> i = getResourceList().iterator();
        while (i.hasNext()) {
            String resName = i.next();
            String target = resourceOriginalPath(getCms(), resName);
            if ((target != null) && !target.equals(resName)) {
                // found a moved resource
                return true;
            }
        }
        return false;
    }
1308567
protected boolean checkResourcesModified(GeneratorContext context, List<FilePathMapping> fMappings) {
		boolean resourceModified = false;

		for (Iterator<FilePathMapping> iter = fMappings.iterator(); iter.hasNext() && !resourceModified;) {
			FilePathMapping fMapping = iter.next();
			resourceModified = fMapping.getLastModified() != rsHandler.getLastModified(fMapping.getPath());
		}
		return resourceModified;
	}
1064422
private static boolean resourceExist(ExternalContext externalContext, String path)
    {
        if ("/".equals(path))
        {
            // The root context exists always
            return true;
        }
        Object ctx = externalContext.getContext();
        if (ctx instanceof ServletContext)
        {
            ServletContext servletContext = (ServletContext) ctx;
            InputStream stream = servletContext.getResourceAsStream(path);
            if (stream != null)
            {
                try
                {
                    stream.close();
                }
                catch (IOException e)
                {
                    // Ignore here, since we donnot wanted to read from this
                    // resource anyway
                }
                return true;
            }
        }
        return false;
    }
1162443
def resource_exists(self, slug, locale, project_slug=None):
        """"""

        try:
            resource = resources.Resource.get(
                project_slug=project_slug or self.get_project_slug(locale),
                slug=slug,
            )

            return resource

        except NotFoundError:
            pass

        return None
923215
function _is_compiled($resource_name, $compile_path)
	{
		if (!$this->force_compile && file_exists($compile_path)) {
			if (!$this->compile_check) {
				// no need to check compiled file
				return true;
			} else {
				// get file source and timestamp
				$_params = array('resource_name' => $resource_name, 'get_source'=>false);
				if (!$this->_fetch_resource_info($_params)) {
					return false;
				}
				if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
					// template not expired, no recompile
					return true;
				} else {
					// compile template
					return false;
				}
			}
		} else {
			// compiled template does not exist, or forced compile
			return false;
		}
	}
1274011
def update_resources(self, dstpath, names=None, languages=None):
        
        UpdateManifestResourcesFromXML(dstpath, self.toprettyxml(), names, 
                                       languages)
53680
def table_or_view_exists(engine: Engine, table_or_view_name: str) -> bool:
    
    tables_and_views = get_table_names(engine) + get_view_names(engine)
    return table_or_view_name in tables_and_views
864717
def syncView(self):
        
        if not self.updatesEnabled():
            return
        
        for item in self.topLevelItems():
            try:
                item.syncView(recursive=True)
            except AttributeError:
                continue
86446
@Override
  public boolean resourceExists(String path) {
    String completePath = getCompleteResourceUrl(path);
    return ResourceDataBroker.class.getResource(completePath) != null;
  }