Process a builtin type or an unknown type which
           will be treated as a regular file.
178550
def _proc_builtin(self, tarfile):
        
        self.offset_data = tarfile.fileobj.tell()
        offset = self.offset_data
        if self.isreg() or self.type not in SUPPORTED_TYPES:
            # Skip the following data blocks.
            offset += self._block(self.size)
        tarfile.offset = offset

        # Patch the TarInfo object with saved global
        # header information.
        self._apply_pax_info(tarfile.pax_headers, tarfile.encoding, tarfile.errors)

        return self
512068
def _ProcessFileSource(self, source):
    """"""

    if source.path_type != rdf_paths.PathSpec.PathType.OS:
      raise ValueError("Only supported path type is OS.")

    paths = artifact_utils.InterpolateListKbAttributes(
        source.base_source.attributes["paths"], self.knowledge_base,
        self.ignore_interpolation_errors)

    file_finder_action = rdf_file_finder.FileFinderAction.Stat()
    request = rdf_file_finder.FileFinderArgs(
        paths=paths, pathtype=source.path_type, action=file_finder_action)
    action = file_finder.FileFinderOSFromClient

    yield action, request
104822
function processInputType (type) {
  var fields = _.map(type.inputFields, analyzeField.bind(this))
  return {
    name: type.name,
    isInputType: true,
    fields: fields
  }
}
511634
def process(self, data, type, history):
        
        if type in history:
            return
        if type.enum():
            return
        history.append(type)
        resolved = type.resolve()
        value = None
        if type.multi_occurrence():
            value = []
        else:
            if len(resolved) > 0:
                if resolved.mixed():
                    value = Factory.property(resolved.name)
                    md = value.__metadata__
                    md.sxtype = resolved
                else:
                    value = Factory.object(resolved.name)
                    md = value.__metadata__
                    md.sxtype = resolved
                    md.ordering = self.ordering(resolved)
        setattr(data, type.name, value)
        if value is not None:
            data = value
        if not isinstance(data, list):
            self.add_attributes(data, resolved)
            for child, ancestry in resolved.children():
                if self.skip_child(child, ancestry):
                    continue
                self.process(data, child, history[:])
22826
def file_add_types(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTypes' % object_id, input_params, always_retry=always_retry, **kwargs)
752404
def process(name)
      self.ext = File.extname(name)
      self.basename = name[0..-ext.length - 1].gsub(%r!\.*\z!, "")
    end
1354278
def processAndSetDefaults(self):
        
        # INPUT, OUTPUT, GIVEN + BUILDABLE DEPS
        if not self.input:
            raise ValueError(NO_INPUT_FILE)

        if not self.output:
            # Build directory must exist, right?
            if not self.build_directory:
                File()
            pass  # Can it be built? / reference self.output_format for this
        else:
            pass  # if it is not congruent with other info provided

        if not self.build_directory:
            pass  # Initialize it

        for dependency in self.given_dependencies:
            pass  # Check if the dependcy exists

        if self.output_format != self.output.getType():
            raise ValueError("")
        # Given dependencies must actually exist!
        # output_name must be at a lower extenion level than input_name
        # The build directory
        return
248003
def _process_module(self, name, contents, parent, match, filepath=None):
        """"""
        #First, get hold of the name and contents of the module so that we can process the other
        #parts of the module.
        modifiers = []

        #We need to check for the private keyword before any type or contains declarations
        if self.RE_PRIV.search(contents):
            modifiers.append("private")
        #The only other modifier for modules ought to be implicit none
        if re.search("implicit\s+none", contents):
            modifiers.append("implicit none")

        #Next, parse out the dependencies of the module on other modules
        dependencies = self._parse_use(contents)
        publics, pubstart = self._process_publics(match.string)

        #We can now create the CodeElement
        result = Module(name, modifiers, dependencies, publics, contents, parent)
        if filepath is not None:
            result.filepath = filepath.lower()
        result.start = match.start()
        result.end = match.end()
        result.refstring = match.string
        result.set_public_start(pubstart)
        if self.RE_PRECOMP.search(contents):
            result.precompile = True

        self.xparser.parse(result)
        self.tparser.parse(result)

        #It is possible for the module to have members, parse those
        self._parse_members(contents, result)
        self.iparser.parse(result)

        #Now we can update the docstrings for the types. They rely on data
        #extracted during parse_members() which is why they have to run
        #separately over here.
        for t in result.types:
            self.tparser.update_docs(result.types[t], result)

        return result
535036
def sanitize_mimetype(mimetype, filename=None):
    """"""
    # Allow some few mime type like plain text, images and audio.
    if mimetype in MIMETYPE_WHITELIST:
        return mimetype
    # Rewrite HTML, JavaScript, CSS etc to text/plain.
    if mimetype in MIMETYPE_PLAINTEXT or \
            (filename and filename.lower() in MIMETYPE_TEXTFILES):
        return 'text/plain'
    # Default
    return 'application/octet-stream'
1095827
def byFileType( fileType ):
        
        XLanguage.load()
        
        for lang in XLanguage._plugins.values():
            if ( fileType in lang.fileTypes() ):
                return lang
        return None
1267050
def get_file(type_str, open_files, basedir):
    """"""
    if type_str not in open_files:
        filename = type_str+".html"
        encoding = 'utf-8'
        fd = codecs.open(os.path.join(basedir, filename), 'w', encoding)
        open_files[type_str] = fd
        write_html_header(fd, type_str, encoding)
    return open_files[type_str]
565073
def process_strings(self, string, docstrings=False):
        """"""

        m = RE_STRING_TYPE.match(string)
        stype = self.get_string_type(m.group(1) if m.group(1) else '')
        if not self.match_string(stype) and not docstrings:
            return '', False
        is_bytes = 'b' in stype
        is_raw = 'r' in stype
        is_format = 'f' in stype
        content = m.group(3)
        if is_raw and (not is_format or not self.decode_escapes):
            string = self.norm_nl(content)
        elif is_raw and is_format:
            string = self.norm_nl(FE_RFESC.sub(self.replace_unicode, content))
        elif is_bytes:
            string = self.norm_nl(RE_BESC.sub(self.replace_bytes, content))
        elif is_format:
            string = self.norm_nl(RE_FESC.sub(self.replace_unicode, content))
        else:
            string = self.norm_nl(RE_ESC.sub(self.replace_unicode, content))

        return textwrap.dedent(RE_NON_PRINTABLE.sub('\n', string) if is_bytes else string), is_bytes
469434
def _process_execs(self, execmatch, parent, module):
        """"""
        #Get the matches that must be present for every executable.
        name = execmatch.group("name").strip()
        modifiers = execmatch.group("modifiers")
        if modifiers is None:
            modifiers = []
        else:
            modifiers = re.split(",[ \t]*", modifiers)
        codetype = execmatch.group("codetype")
        params = re.split("[\s,]+", execmatch.group("parameters"))
        contents = execmatch.group("contents")

        #If the exec is a function, we also may have a type and kind specified.
        if codetype.lower() == "function":
            dtype = execmatch.group("type")
            kind = execmatch.group("kind")
            result = Function(name, modifiers, dtype, kind, parent)
        else:
            result = Subroutine(name, modifiers, parent)

        #Set the regex start and end char indices
        result.start, result.end = module.absolute_charindex(execmatch.string, execmatch.start(),
                                                             execmatch.end())
        result.contents = contents

        #Now we can handle the rest which is common to both types of executable
        #Extract a list of local variables
        self._parse_members(contents, result, params)
        if isinstance(result, Function):
            #We need to handle the syntax for defining a function with result(variable)
            #to specify the return type of the function.
            if execmatch.group("result") is not None:
                resvar = execmatch.group("result").lower().split("result(")[1].replace(")", "")
            else:
                resvar = None
            result.update_dtype(resvar)
        
        #Fortran allows lines to be continued using &. The easiest way
        #to deal with this is to remove all of those before processing
        #any of the regular expressions
        decommented = "\n".join([ self._depend_exec_clean(l) for l in contents.split("\n") ])
        cleaned = re.sub("&\s*", "", decommented)

        #Finally, process the dependencies. These are calls to functions and
        #subroutines from within the executable body
        self._process_dependencies(result, cleaned)
        self._process_assignments(result, cleaned)
        
        return result
569136
function getFileTypeReg(type) {
    var map = [],
        ext = ""; // fis.config.get('project.fileType.' + type);
    if (type === 'text') {
        map = TEXT_FILE_EXTS;
    } else if (type === 'image') {
        map = IMAGE_FILE_EXTS;
    } else {
        xgulp.log.error('invalid file type [%s]', type);
    }
    if (ext && ext.length) {
        if (typeof ext === 'string') {
            ext = ext.split(/\s*,\s*/);
        }
        map = map.concat(ext);
    }
    map = map.join('|');
    return new RegExp('\\.(?:' + map + ')$', 'i');
}
1285505
function processFile(autogenContext, commentInfo, callback) {
    fs.readFile(path.resolve(__dirname, "..", autogenContext.filePath), function (readError, sourceFileContentsBuffer) {
        if (readError) {
            callback(autogenContext.filePath, readError);
            return;
        }

        processNextAutogenBlock(autogenContext, sourceFileContentsBuffer.toString(), commentInfo, 0, function (result, autogenError) {
            //Write results if the content was changed (don't need to re-write the same content)
            if (sourceFileContentsBuffer.toString() != result)
                fs.writeFile(path.resolve(__dirname, "..", autogenContext.filePath), result, {}, function (writeError) {
                    callback(autogenContext.filePath, writeError);
                });
            else
                callback(autogenContext.filePath, autogenError);
        });
    });
}
303980
def _preprocess(self, filehandle, metadata):
        ""
        for process in self._preprocessors:
            filehandle = process(filehandle, metadata)
        return filehandle
777619
function(type) {
		//define if put type is present in config
		if (config.moduleTypes.indexOf(type) > -1) {
            config.moduleType = type;
            fs.writeFile(path.resolve(__dirname, 'config.json'), JSON.stringify(config, null, 4), 'utf8', function (err) {
                if (err) {
                    return console.log(err);
                }
            });
		} else {
			return console.log('Wrong type, available types: %j', config.moduleTypes);
		}
	}