def _Open(self, path_spec=None, mode='rb'):
    if not path_spec:
      raise ValueError(u'Missing path specification.')

    if not path_spec.HasParent():
      raise errors.PathSpecError(
          u'Unsupported path specification without parent.')

    table_name = getattr(path_spec, u'table_name', None)
    if table_name is None:
      raise errors.PathSpecError(u'Path specification missing table name.')

    column_name = getattr(path_spec, u'column_name', None)
    if column_name is None:
      raise errors.PathSpecError(u'Path specification missing column name.')

    row_condition = getattr(path_spec, u'row_condition', None)
    if row_condition:
      if not isinstance(row_condition, tuple) or len(row_condition) != 3:
        raise errors.PathSpecError((
            u'Unsupported row_condition not a tuple in the form: '
            u'(column_name, operator, value).'))

    row_index = getattr(path_spec, u'row_index', None)
    if row_index is not None:
      if not isinstance(row_index, py2to3.INTEGER_TYPES):
        raise errors.PathSpecError(
            u'Unsupported row_index not of integer type.')

    if not row_condition and row_index is None:
      raise errors.PathSpecError(
          u'Path specification requires either a row_condition or row_index.')

    if self._database_object:
      raise IOError(u'Database file already set.')

    file_object = resolver.Resolver.OpenFileObject(
        path_spec.parent, resolver_context=self._resolver_context)

    try:
      database_object = sqlite_database.SQLiteDatabaseFile()
      database_object.Open(file_object)
    finally:
      file_object.close()

    # Sanity check the table and column names.
    error_string = u''
    if not database_object.HasTable(table_name):
      error_string = u'Missing table: {0:s}'.format(table_name)

    elif not database_object.HasColumn(table_name, column_name):
      error_string = u'Missing column: {0:s} in table: {1:s}'.format(
          column_name, table_name)

    elif not row_condition:
      query = u'SELECT {0:s} FROM {1:s} LIMIT 1 OFFSET {2:d}'.format(
          column_name, table_name, row_index)
      rows = database_object.Query(query)

    elif not database_object.HasColumn(table_name, row_condition[0]):
      error_string = (
          u'Missing row condition column: {0:s} in table: {1:s}'.format(
              row_condition[0], table_name))

    elif row_condition[1] not in self._OPERATORS:
      error_string = (
          u'Unsupported row condition operator: {0:s}.'.format(
              row_condition[1]))

    else:
      query = u'SELECT {0:s} FROM {1:s} WHERE {2:s} {3:s} ?'.format(
          column_name, table_name, row_condition[0], row_condition[1])
      rows = database_object.Query(query, parameters=(row_condition[2], ))

    # Make sure the query returns a single row, using cursor.rowcount
    # is not reliable for this purpose.
    if not error_string and (len(rows) != 1 or len(rows[0]) != 1):
      if not row_condition:
        error_string = (
            u'Unable to open blob in table: {0:s} and column: {1:s} '
            u'for row: {2:d}.').format(table_name, column_name, row_index)

      else:
        row_condition_string = u' '.join([
            u'{0!s}'.format(value) for value in row_condition])
        error_string = (
            u'Unable to open blob in table: {0:s} and column: {1:s} '
            u'where: {2:s}.').format(
                table_name, column_name, row_condition_string)

    if error_string:
      database_object.Close()
      raise IOError(error_string)

    self._blob = rows[0][0]
    self._current_offset = 0
    self._database_object = database_object
    self._size = len(self._blob)
    self._table_name = table_name

  # TODO: remove this when there is a move this to a central temp file
  # manager. https://github.com/log2timeline/dfvfs/issues/92
Deal one task
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/file_io/sqlite_blob_file_io.py/SQLiteBlobFile._Open--crossover with--dataset/ETHPy150Open binux/pyspider/pyspider/processor/processor.py/Processor.on_task