Check the meta file is valid
494726
private function isValidMetaFile()
	{
		if ( $this->metaFile ) return true;

		try
		{
			$this->metaFile = $this->getFileAsXML( XBRL_SEC_XML_Package::manifestFilename );
			$this->processElement( $this->metaFile->children() );
			$xbrlFilings = $this->metaFile->children('http://www.sec.gov/Archives/edgar')->xbrlFiling;
			$this->processElement( $xbrlFilings->children( XBRL_SEC_XML_Package::edgarNamespace ) );
			$xbrlFiles = $xbrlFilings->xbrlFiles;
			$this->processXBRLFiles( $xbrlFiles->children( XBRL_SEC_XML_Package::edgarNamespace ) );

			$schemaFileList = array_filter( $this->files, function( $item ) {
				return XBRL::endsWith( $item, '.xsd' );
			} );

			if ( count( $schemaFileList ) != 1 )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:schemaFileNotFound", "The package does not contain a schema (.xsd) file" );
			}

			// $this->schemaFile = reset( $schemaFileList );
			$this->determineSchemaFile();
		}
		catch ( XBRL_TaxonomyPackageException $ex )
		{
			throw $ex;
		}
		catch ( Exception $ex )
		{
			throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", $ex->getMessage() );
		}

		return true;
	}
1294934
def _eval_meta_as_summary(meta):
    """"""

    if meta == '':
        return False
    if len(meta)>500:
        return False
    if 'login' in meta.lower():
        return False
    return True
599004
def _validate_file_format(self, file_format):
        """"""

        if file_format not in self.valid_file_formats:
            raise InvalidFileFormatError(
                "{} is not a valid file format".format(file_format)
            )

        return file_format
350191
def valid_meta_data_type?(value)
      value.nil? || value.is_a?(String) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass)
    end
808867
def validate_metadata(target_dir, metadata):
    
    if not os.path.isdir(target_dir):
        print("Error: " + target_dir + " is not a directory")
        return False
    file_list = os.listdir(target_dir)
    for filename in file_list:
        if filename not in metadata:
            print("Error: " + filename + " present at" + target_dir +
                  " not found in metadata file")
            return False
    for filename in metadata:
        if filename not in file_list:
            print("Error: " + filename + " present in metadata file " +
                  " not found on disk at: " + target_dir)
            return False
    return True
1302474
def is_valid_file(path):
    '''  '''
    return os.path.exists(path) and os.path.isfile(path)
111075
def _check_all_metadata_found(metadata, items):
    """"""
    for name in metadata:
        seen = False
        for sample in items:
            check_file = sample["files"][0] if sample.get("files") else sample["vrn_file"]
            if isinstance(name, (tuple, list)):
                if check_file.find(name[0]) > -1:
                    seen = True
            elif check_file.find(name) > -1:
                seen = True
            elif "*" in name and fnmatch.fnmatch(check_file, "*/%s" % name):
                seen = True
        if not seen:
            print("WARNING: sample not found %s" % str(name))
209580
def isvalid(path, access=None, extensions=None, filetype=None, minsize=None):
    """"""
    return ((access is None or os.access(path, access)) and
            (extensions is None or checkext(path, extensions)) and
            (((filetype == 'all' and os.path.exists(path)) or
              (filetype == 'dir' and os.path.isdir(path)) or
              (filetype == 'file' and os.path.isfile(path))) or
             filetype is None) and
            (minsize is None or (not os.path.isfile(path) or
                                 os.path.getsize(path) > minsize)))
25918
function validateMetadata(metadataPath, cb) {
  validateJSonStructure(metadataPath, function(err, metadataObject) {
    if (err) {
      cb(err, null);
    } else {
      cb(null, metadataObject.files);
    }
  });
}
1316221
def _valid_file(self, base, name):
        """"""

        valid = False
        fullpath = os.path.join(base, name)
        if self.file_check is not None and self.compare_file(fullpath[self._base_len:] if self.file_pathname else name):
            valid = True
        if valid and (not self.show_hidden and util.is_hidden(fullpath)):
            valid = False
        return self.on_validate_file(base, name) if valid else valid
871130
def is_valid_py_file(path):
    '''
    
    '''
    import os

    is_valid = False
    if os.path.isfile(path) and not os.path.splitext(path)[1] == '.pyx':
        try:
            with open(path, 'rb') as f:
                compile(f.read(), path, 'exec')
                is_valid = True
        except:
            pass
    return is_valid
934244
function checkMetaRules(nodePaths, includeChildren, callback) {
            var parameters = {
                command: CONSTANTS.SERVER_WORKER_REQUESTS.CHECK_CONSTRAINTS,
                checkType: 'META', //TODO this should come from a constant
                includeChildren: includeChildren,
                nodePaths: nodePaths,
                commitHash: state.commitHash,
                projectId: state.project.projectId
            };

            storage.simpleRequest(parameters, function (err, result) {
                if (err) {
                    logger.error(err);
                }

                if (result) {
                    client.dispatchEvent(client.CONSTANTS.META_RULES_RESULT, result);
                } else {
                    client.notifyUser({
                        severity: 'error',
                        message: 'Evaluating Meta rules failed with error.'
                    });
                }

                if (callback) {
                    callback(err, result);
                }
            });
        }
248302
function isValid (path, entry) {
        var isValid = valid(path)
        if (isValid) {
          log.verbose('extracted file from tarball', path)
          extractCount++
        } else {
          // invalid
          log.silly('ignoring from tarball', path)
        }
        return isValid
      }
935036
def __isValidFilename(self, filename):
        """"""
        if filename and isinstance(filename, string_types):
            if re.match(r'^[\w\d\_\-\.]+$', filename, re.I):
                if self.__isValidTGZ(filename) or self.__isValidZIP(filename):
                    return True
        return False
1216063
def isValid( self ):
        
        check = nativestring(self._filepathEdit.text()).split(os.path.pathsep)[0]
        if ( self.filepathMode() == XFilepathEdit.Mode.SaveFile ):
            check = os.path.dirname(check)
        
        return os.path.exists(check)
1029696
def is_valid(file_path):
    
    from os import path, stat

    can_open = False

    try:
        with open(file_path) as fp:
            can_open = True
    except IOError:
        return False

    is_file = path.isfile(file_path)

    return path.exists(file_path) and is_file and stat(file_path).st_size > 0
1192677
def is_meta_url (attr, attrs):
    """"""
    res = False
    if attr == "content":
        equiv = attrs.get_true('http-equiv', u'').lower()
        scheme = attrs.get_true('scheme', u'').lower()
        res = equiv in (u'refresh',) or scheme in (u'dcterms.uri',)
    if attr == "href":
        rel = attrs.get_true('rel', u'').lower()
        res = rel in (u'shortcut icon', u'icon')
    return res