# tf.compat.v1.flags.EnumClassParser

<br />

Parser of an Enum class member.

Inherits From: [`ArgumentParser`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/compat/v1/flags/ArgumentParser)

    tf.compat.v1.flags.EnumClassParser(
        enum_class: Type[_ET], case_sensitive: bool = True
    ) -> None

<br />

<br />

<br />

| ## Args ||
|---|---|
| `enum_class` | class, the Enum class with all possible flag values. |
| `case_sensitive` | bool, whether or not the enum is to be case-sensitive. If False, all member names must be unique when case is ignored. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | When enum_class is not a subclass of Enum. |
| `ValueError` | When enum_class is empty. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `member_names` | The accepted enum names, in lowercase if not case sensitive. |

<br />

## Methods

### `flag_type`

    flag_type() -> Text

See base class.

### `parse`

    parse(
        argument: Union[_ET, Text]
    ) -> _ET

Determines validity of argument and returns the correct element of enum.

<br />

<br />

<br />

| Args ||
|---|---|
| `argument` | str or Enum class member, the supplied flag value. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| The first matching Enum class member in Enum class. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | Raised when argument didn't match anything in enum. |

<br />

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| syntactic_help | `''` |

<br />