def create_cursor_from_old_cursor(old_cursor, table_class):
  """This method creates the cursor from an existing cursor.

  This is mainly used for creating lookup cursor during db operations on
  other database tables.

  Args:
    old_cursor: existing cursor from which important params are evaluated.
    table_class: table for which the cursor is being created.

  Returns:
    cursor
  """
  cursor = table_class.create_vtgate_cursor(old_cursor._conn,
                                            old_cursor.tablet_type,
                                            old_cursor.is_writable())
  return cursor