Open a file specified by path.
14540
def open(self, path, filename=None):
        
        scheme, key = self.getkey(path, filename=filename)
        return BotoReadFileHandle(scheme, key)
1281762
def open(self, file_path):
        

        if self.is_opened() and self.workbook.file_path == file_path:
            self._logger.logger.debug("workbook already opened: {}".format(self.workbook.file_path))
            return

        self.close()
        self._open(file_path)
665755
def _open_for_write(filename):
    """"""
    dirname = os.path.dirname(filename)
    pathlib.Path(dirname).mkdir(parents=True, exist_ok=True)

    return io.open(filename, 'w')
937673
def open_file(path, grib_errors='warn', **kwargs):
    """"""
    if 'mode' in kwargs:
        warnings.warn("the `mode` keyword argument is ignored and deprecated", FutureWarning)
        kwargs.pop('mode')
    stream = messages.FileStream(path, message_class=cfmessage.CfMessage, errors=grib_errors)
    return Dataset(*build_dataset_components(stream, **kwargs))
392661
def open_file(filepath):
    
    if sys.platform.startswith('darwin'):
        subprocess.Popen(('open', filepath))
    elif os.name == 'nt':
        os.startfile(filepath)
    elif os.name == 'posix':
        subprocess.Popen(('xdg-open', filepath))
1081377
def open(self, path):
        
        self.current.append(self.create(path))
        return self.current[-1]
714937
def fileobj(path_or_file, mode='r'):
    """"""
    if isinstance(path_or_file, six.string_types):
        try:
            return open(path_or_file, mode)
        except IOError:
            log = logging.getLogger('sos')
            log.debug("fileobj: %s could not be opened" % path_or_file)
            return closing(six.StringIO())
    else:
        return closing(path_or_file)
1350916
def open(self):
        

        if not os.path.exists(self.path):
            raise IOError("No such path: {0}".format(self.path))


        with open(self.path, "rb") as f:
            msg = f.read()
        result = chardet.detect(msg)

        self.buffer = codecs.open(self.path, "rb", encoding=result['encoding'])

        self.at_eof = False
1274722
def read(*paths):
    ''''''
    with open(os.path.join(os.path.dirname(__file__), *paths)) as fp:
        return fp.read()
497829
private File withPath(Path path, File dir) {
        return new File(dir, path.getPath());
    }
1192714
def try_opening_file(self):
        ''''''
        if os.path.isfile(self.path):
            self.file = open(self.path, 'r')
            self.file_is_opened = True
814008
def open(self, filename, mode='r'):
        """"""

        self._raise_if_none()
        fn = path_join(self.path, filename)

        return open(fn, mode)
1167840
def read_file(filename):
    
    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()
673747
def read_file(*path):
    """"""
    real_path = os.path.realpath(os.path.join(*path))
    with click.open_file(real_path, "r") as fp:
        return fp.read()
1224690
def get_file(self, file_path, mode="r"):
        
        return open(self.cont_path(file_path), mode=mode)
1031854
def read_file(self, path, **kwargs):
        
        try:
            parsed_data = Parser().parse_file(path)
            return parsed_data
        except (IOError, TypeError, ImportError):
            LOGGER.warning("Error reading file: {0}".format(path))
        return None
1305717
def open(cls, path):
        
        filename = fspath(path)
        with _LeptonicaErrorTrap():
            return cls(lept.pixRead(os.fsencode(filename)))