Reads the file with the given name and returns its contents as a String.
556855
private String readFile(String fileName) {
        String text;
        try {
            try (Reader r = new FileReader(fileName)) {
                text = Kit.readReader(r);
            }
        } catch (IOException ex) {
            MessageDialogWrapper.showMessageDialog(this,
                                                   ex.getMessage(),
                                                   "Error reading "+fileName,
                                                   JOptionPane.ERROR_MESSAGE);
            text = null;
        }
        return text;
    }
612902
def read(self, name, pwd=None):
        """"""
        with self.open(name, "r", pwd) as fp:
            return fp.read()
74121
def read_file(filename):
    """"""
    p = path.abspath(path.dirname(__file__))
    filepath = path.join(p, filename)
    try:
        return open(filepath).read()
    except IOError:
        return ''
450151
def read_file(filename, print_error=True):
    """"""
    try:
        for encoding in ['utf-8', 'latin1']:
            try:
                with io.open(filename, encoding=encoding) as fp:
                    return fp.read()
            except UnicodeDecodeError:
                pass
    except IOError as exception:
        if print_error:
            print(exception, file=sys.stderr)
        return None
370820
def parse(filename):
    """"""
    with open(filename) as f:
        parser = ASDLParser()
        return parser.parse(f.read())
984885
private String[] readFile(String fileName) throws IOException {
    ArrayList<String> result = new ArrayList<String>();
    FileReader fReader = new FileReader(fileName);
    BufferedReader bReader = new BufferedReader(fReader);
    while (true) {
      String line = bReader.readLine();
      if (line == null) {
        break;
      }
      result.add(line);
    }
    bReader.close();
    fReader.close();
    return (String[])result.toArray(new String[result.size()]);
  }
475098
def read_file(filename, binary_mode=False):
  
  mode = 'rb' if binary_mode else 'r'
  with open(filename, mode) as f:
    return f.read()
503496
def _read_file(name, encoding='utf-8'):
    
    with codecs.open(name, encoding=encoding) as f:
        return f.read()
45191
def load(name_or_file):
    
    f = name_or_file
    opened = False

    if isinstance(name_or_file, basestring):
        f = open(name_or_file, 'rb')
        opened = True
    elif not hasattr(f, 'read'):
        raise ValueError('Readable stream expected')

    name, values = decode(f.read())
    s = SOL(name)

    for n, v in values.iteritems():
        s[n] = v

    if opened is True:
        f.close()

    return s
1017969
def get_readme(name='README.rst'):
    """"""
    with open(name) as f:
        return '\n'.join(
            line for line in f.read().splitlines()
            if not line.startswith('|') or not line.endswith('|'))
1314434
def read(filename, loader=None, implicit_tuple=True, allow_errors=False):
  """"""
  with open(filename, 'r') as f:
    return reads(f.read(),
                 filename=filename,
                 loader=loader,
                 implicit_tuple=implicit_tuple,
                 allow_errors=allow_errors)
787547
def load_file(self, filename):
        """"""
        with open(filename, 'r') as sourcefile:
            self.set_string(sourcefile.read())
15025
def _read_file(self, filename):
        
        try:
            with open(filename, "r") as fhandle:
                stats = float(fhandle.readline().rstrip("\n"))
        except Exception:
            stats = None

        return stats
733470
def _read_file(folder, filename):
    '''
    
    '''
    path = os.path.join(folder, filename)
    try:
        with salt.utils.files.fopen(path, 'rb') as contents:
            return salt.utils.data.decode(contents.readlines())
    except (OSError, IOError):
        return ''
321124
def readme(fname):
    """"""
    md = open(os.path.join(os.path.dirname(__file__), fname)).read()
    output = md
    try:
        import pypandoc
        output = pypandoc.convert(md, 'rst', format='md')
    except ImportError:
        pass
    return output
515494
def read_file(file):
	
	if hasattr(file, "read"):
		return file.read()
	if hasattr(file, "read_bytes"):
		return file.read_bytes()
	with open(file, "rb") as f:
		return f.read()
841771
def parse_file(self, name):
        
        with open(name, "rb") as fp:
            return self.parse(fp.read())