class_docstr: The reason why a trial exited early
  
  The following reasons are supported:
  
  - `ERRORED`: The Trial encountered an exception
  - `USER_CANCELLED`: The Trial was manually closed by the user
  - `INVALID_HP`: The hyperparameters the trial was created with were invalid
class_docstr_tok: ["The","reason","why","a","trial","exited","early","The","following","reasons","are","supported",":","-","`","ERRORED","`",":","The","Trial","encountered","an","exception","-","`","USER_CANCELLED","`",":","The","Trial","was","manually","closed","by","the","user","-","`","INVALID_HP","`",":","The","hyperparameters","the","trial","was","created","with","were","invalid"]
code: def _from_bindings(
      cls,
      bindings_exited_reason: bindings.v1TrialExitedEarlyExitedReason,
  ) -> "ExitedReason":
      if (
          bindings_exited_reason
          == bindings.v1TrialExitedEarlyExitedReason.INVALID_HP
      ):
          return cls.INVALID_HP
      if (
          bindings_exited_reason
          == bindings.v1TrialExitedEarlyExitedReason.USER_REQUESTED_STOP
      ):
          return cls.USER_CANCELED
      if (
          bindings_exited_reason
          == bindings.v1TrialExitedEarlyExitedReason.UNSPECIFIED
      ):
          return cls.ERRORED
      raise RuntimeError(
          f"Invalid exited reason: {bindings_exited_reason}"
      )
  
imports: import abc
  import dataclasses
  import json
  import pathlib
  import uuid
  from abc import abstractmethod
  from enum import Enum
  from typing import Any, Dict, List, Optional, Set, Tuple
  from determined import experimental
  from determined.common.api import bindings
label_desc: Use image node_id 1 for calling the ExitedReason obj's underlying member method code with example usage: obj._from_bindings(cls, bindings_exited_reason) and returns: cls, cls, cls