code: def convert(cls, method):
      if method and isinstance(method, str):
          try:
              method = Method[method.upper()]
          except KeyError:
              raise exception.InvalidMethodError(method)
      return method
  
file_path: sklearn-porter/sklearn_porter/enums/__init__.py
imports: from enum import Enum
  from sklearn_porter.language import *
  from sklearn_porter import exceptions
label_desc: Use image node_id 1 for calling the Method obj's underlying member method code with example usage: obj.convert(cls, method) and returns: method