code: def open(self, mode='r', encoding=None):
          
          access_type = self._get_access_type(mode)
  
          if encoding is None:
              encoding = self.encoding
  
          # here, we face the task of returning the correct data type
          if access_type == 'b':
              if not self._isbytes:
                  content = self._contents.encode(encoding)  # unicode in, bytes out
              else:
                  content = self._contents  # bytes in, bytes out
              return io.BytesIO(content)
          else:
              assert access_type == 't'
              if PYVERSION == 2 and self._isbytes:
                  return io.BytesIO(self._contents)  # bytes in, bytes out (python 2 only)
              elif self._isbytes:
                  content = self._contents.decode(encoding)  # bytes in, unicode out
              else:
                  content = self._contents  # unicode in, unicode out
              return io.StringIO(content)
docs: Return file-like object
  
          Args:
              mode (str): access mode (only reading modes are supported)
              encoding (str): encoding type (only for binary access)
  
          Returns:
              io.BytesIO OR io.TextIOWrapper: buffer accessing the file as bytes or characters