<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_index( self, columns, name, is_unique, is_primary, flags=None, options=None ):
 """ Creates an Index instance. :param columns: The index columns :type columns: list :param name: The index name :type name: str :param is_unique: Whether the index is unique or not :type is_unique: bool :param is_primary: Whether the index is primary or not :type is_primary: bool :param flags: The index flags :type: dict :param options: The options :type options: dict :rtype: Index """

        if re.match("[^a-zA-Z0-9_]+", self._normalize_identifier(name)):
            raise IndexNameInvalid(name)

        for column in columns:
            if isinstance(column, dict):
                column = list(column.keys())[0]

            if not self.has_column(column):
                raise ColumnDoesNotExist(column, self._name)

        return Index(name, columns, is_unique, is_primary, flags, options)