Reads a command sequence from the given filename (defaults to
    self.pathname).
504623
def read (self, filename=None):
    
    if filename is None:
      filename = self.pathname

    stream = open(filename, 'rb')
    magic  = struct.unpack('>H', stream.read(2))[0]
    stream.close()

    if magic == Seq.Magic:
      self.readBinary(filename)
    else:
      self.readText(filename)
484241
def read_relative_file(filename, relative_to=None):
    """"""
    if relative_to is None:
        relative_to = os.path.dirname(__file__)
    with open(os.path.join(os.path.dirname(relative_to), filename)) as f:
        return f.read()
111720
def _read_text(self, filename):
        
        with io.open(filename, 'rt', encoding='utf-8') as f:
            return f.read()
745100
def read_file(filename):
        
        lines = []
        with open(filename) as f:
            for line in f:
                if len(line.strip()) != 0:
                    lines.append(line.strip())
        return lines
551873
def read(fname):
    
    path = os.path.join(SCRIPTDIR, fname)
    if PY3:
        f = open(path, 'r', encoding='utf8')
    else:
        f = open(path, 'r')
    content = f.read()
    f.close()
    return content
138615
def read_relative_file(filename):
    
    path = join(dirname(abspath(__file__)), filename)
    with io.open(path, encoding='utf-8') as f:
        return f.read()
106145
def _readfile(self, filename):
        
        f = open(filename)
        self.content = f.readlines()
        f.close()
1077928
public CharSequence readSource(JavaFileObject filename) {
        try {
            inputFiles.add(filename);
            return filename.getCharContent(false);
        } catch (IOException e) {
            log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
            return null;
        }
    }
204387
def read(*paths):
    """"""
    try:
        f_name = os.path.join(*paths)
        with open(f_name, 'r') as f:
            return f.read()
    except IOError:
        print('%s not existing ... skipping' % f_name)
        return ''
68205
def read(fname, fail_silently=False):
        
        try:
            filepath = os.path.join(os.path.dirname(__file__), fname)
            with io.open(filepath, 'rt', encoding='utf8') as f:
                return f.read()
        except:
            if not fail_silently:
                raise
            return ''
1071086
def read_file_in_root_directory(*names, **kwargs):
    """"""
    return read_file(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf-8"),
    )
766476
def reads(s, filename, loader, implicit_tuple, allow_errors):
  """"""
  try:
    the_context.filename = filename
    the_context.loader = loader

    grammar = make_grammar(allow_errors=allow_errors)
    root = grammar.start_tuple if implicit_tuple else grammar.start

    return root.parseWithTabs().parseString(s, parseAll=True)[0]
  except (p.ParseException, p.ParseSyntaxException) as e:
    loc = SourceLocation(s, find_offset(s, e.lineno, e.col))
    raise exceptions.ParseError(the_context.filename, loc, e.msg)
809742
def _read_from_file(self, filename):
        """"""
        try:
            with open(filename, 'rb') as f:
                return self._loads(f.read())
        except (IOError, OSError):
            logger.warning('Error opening file: {}'.format(filename))
            return None
1018706
def read_from_file(filename):
        
        with open(filename) as f:
            result = CP2KInputFile()
            try:
                while True:
                    result.load_children(f)
            except EOFError:
                pass
        return result
211621
def read_moc(self, filename):
        

        if self.moc is None:
            self.moc = MOC(filename=filename)

        else:
            self.moc.read(filename)
712524
def from_filename(cls, path_string, origin=MISSING, **kwargs):
        
        path = Path(path_string)
        return cls.from_path(path, origin, **kwargs)
784614
def from_filename(cls, filename):
    """"""
    result = cls._FROM_FILENAME_CACHE.get(filename)
    if result is None:
      result = cls(cls._normalize(filename))
      cls._FROM_FILENAME_CACHE.store(filename, result)
    return result