Opens a file and parses it
349432
def parseFile(self, fil) :
		""""""
		f = open(fil)
		self.parseStr(f.read())
		f.close()
50335
def from_file(cls, fn, *args, **kwargs):
        
        return AmiraHeader(get_parsed_data(fn, *args, **kwargs))
1134242
def read_file(file)
      json = JSON.parse(File.read(file))
      json.key?('definitions') ? json['definitions'] : {}
    end
259381
def _parse(self):
        
        with open(self.path, "rt") as reader:
            return ast.parse(reader.read(), filename=self.path)
892342
def open(filename):
	
	buffer = _builtin_open(filename, 'rb')
	try:
		encoding, lines = detect_encoding(buffer.readline)
		buffer.seek(0)
		text = TextIOWrapper(buffer, encoding, line_buffering=True)
		text.mode = 'r'
		return text
	except:
		buffer.close()
		raise
746365
def _open(file_, mode='r'):
  """"""
  if isinstance(file_, string_types):
    _, ext = path.splitext(file_)
    if ext in {'.bz2', '.gz'}:
      s = tarfile.open(file_)
      return s.extractfile(s.next())
    else:
      return open(file_, mode)
  return file_
461433
def read(fname):
    "  "
    if exists(fname):
        return open(join(dirname(__file__), fname)).read()
988775
def _parse_file(self, file_obj):
        
        byte_data = file_obj.read(self.size)
        self._parse_byte_data(byte_data)
1093962
def parse_file(self, inputstring, addhash=True):
        """"""
        if addhash:
            use_hash = self.genhash(False, inputstring)
        else:
            use_hash = None
        return self.parse(inputstring, self.file_parser, {"nl_at_eof_check": True}, {"header": "file", "use_hash": use_hash})
144165
def read_file(path):
    """"""
    file_path = os.path.join(here, *path)
    with open(file_path, encoding="utf-8") as f:
        return f.read()
1353808
def _parse_file(self):
        """"""

        # We need to set the CPU type to pull in the right register definitions
        # only preprocess the file (-E) and get rid of gcc extensions that aren't
        # supported in ISO C.
        args = utilities.build_includes(self.arch.includes())

        # args.append('-mcpu=%s' % self.arch.property('chip'))
        args.append('-E')
        args.append('-D__attribute__(x)=')
        args.append('-D__extension__=')
        self.ast = parse_file(self.filepath, use_cpp=True, cpp_path='arm-none-eabi-gcc', cpp_args=args)
927332
def parse(self, file):
        '''
        
        '''
        parser = make_parser()
        self.clear()

        class Extractor(xml.sax.ContentHandler):

            def __init__(self, parent):
                self.parent = parent

            def startElement(self, name, attrs):
                attribs = {}
                for attrname in attrs.getNames():
                    attrvalue = attrs.get(attrname)
                    attribs[attrname] = attrvalue
                self.parent.StartTag(name, attribs)

            def characters(self, text):
                self.parent.NewData(text)

            def endElement(self, name):
                self.parent.EndTag(name)
        parser.setContentHandler(Extractor(self))
        # OFFLINE MODE
        parser.setFeature(handler.feature_external_ges, False)
        fob = open(file, 'r')
        parser.parse(fob)
        return self.piece
728922
def _parse(fileobj):
    """"""
    fileobj.seek(0)
    try:
        part = fileobj.read(2)
    except UnicodeDecodeError:
        part = ""

    if part == "#!":
        shebang = shlex.split(fileobj.readline().strip())
        if (platform.system() == "Windows" and
                len(shebang) and
                os.path.basename(shebang[0]) == "env"):
            return shebang[1:]

        return shebang

    return []
540952
function parseFile(filePath, encoding, callback) {
	fs.readFile(filePath, encoding, function(err, fileString) {
		if (err) {
			return callback(err);
		}
		return parse(fileString, callback);
	});
}
703458
private Object parseFile(File file, String scharset) {
        Charset charset = scharset==null || scharset.length ()==0 ? StandardCharsets.UTF_8 : Charset.forName ( scharset );

        if (file.length() > 2_000_000) {
            try (Reader reader = Files.newBufferedReader( Classpaths.path(file.toString()), charset )) {
                return parse(reader);
            } catch(IOException ioe) {
                throw new JsonException("Unable to process file: " + file.getPath(), ioe);
            }
        } else {
            try {
                return JsonFactory.create().fromJson ( Files.newBufferedReader( Classpaths.path(file.toString()), charset ) );
            } catch ( IOException e ) {
                throw new JsonException("Unable to process file: " + file.getPath(), e);
            }
        }
    }
1238278
def parsefile(self, filename):
        
        with open(filename, 'rb') as fd:
            return self.parse(fd.read())
510631
def read_file(cls, filepath):
        
        with open(filepath, mode='rb') as f:
            contents = f.read()
        return cls.decode(contents)