class_docstr: Defines the optimisation domain of the objective function. It can be a
  continuous interval or a discrete set of numeric or non-numeric values.
  The latter is also designated as a categorical domain. It is represented as
  a Python dict object with the keys naming the variables and the values defining
  the set of allowed values. A :class:`Domain` can also be recursively
  specified. That is, a key can name a subdomain represented as a Python dict.
  
  For continuous sets use Python list to define an interval in the form
  [a, b], a < b. For discrete sets use Python sets, e.g. {1, 2, 5, -0.1}
  or {"option_a", "option_b"}.
  
  Examples:
      >>> simple_domain = {"x": {0, 1},
      >>>                  "y": [-1, 1],
      >>>                  "z": {-1, 2, 4}}
      >>> nested_domain = {"discrete": {"x": {1, 2, 3}, "y": {4, 5, 6}}
      >>>                  "continuous": {"x": [-4, 4], "y": [0, 1]}
      >>>                  "categorical": {"opt1", "opt2"}}
class_docstr_tok: ["Defines","the","optimisation","domain","of","the","objective","function",".","It","can","be","a","continuous","interval","or","a","discrete","set","of","numeric","or","non-numeric","values",".","The","latter","is","also","designated","as","a","categorical","domain",".","It","is","represented","as","a","Python","dict","object","with","the","keys","naming","the","variables","and","the","values","defining","the","set","of","allowed","values",".","A",":","class",":","`","Domain","`","can","also","be","recursively","specified",".","That","is",",","a","key","can","name","a","subdomain","represented","as","a","Python","dict",".","For","continuous","sets","use","Python","list","to","define","an","interval","in","the","form","[","a",",","b","]",",","a","<","b",".","For","discrete","sets","use","Python","sets",",","e.g",".","{","1",",","2",",","5",",","-0.1","}","or","{","``","option_a","''",",","``","option_b","''","}",".","Examples",":",">",">",">","simple_domain","=","{","``","x","''",":","{","0",",","1","}",",",">",">",">","``","y","''",":","[","-1",",","1","]",",",">",">",">","``","z","''",":","{","-1",",","2",",","4","}","}",">",">",">","nested_domain","=","{","``","discrete","''",":","{","``","x","''",":","{","1",",","2",",","3","}",",","``","y","''",":","{","4",",","5",",","6","}","}",">",">",">","``","continuous","''",":","{","``","x","''",":","[","-4",",","4","]",",","``","y","''",":","[","0",",","1","]","}",">",">",">","``","categorical","''",":","{","``","opt1","''",",","``","opt2","''","}","}"]
docstr: Return the type of the set of values in a subdomain.
  
  Args:
      subdomain: one of :obj:`dict`, :obj:`list` or :obj:`set`. The
          subdomain to get the type for.
  
  Returns:
      One of `Domain.Continuous`, `Domain.Discrete`, `Domain.Categorical`
      or `Domain.Invalid`.
docstr_tok: ["Return","the","type","of","the","set","of","values","in","a","subdomain",".","Args",":","subdomain",":","one","of",":","obj",":","`","dict","`",",",":","obj",":","`","list","`","or",":","obj",":","`","set","`",".","The","subdomain","to","get","the","type","for",".","Returns",":","One","of","`","Domain.Continuous","`",",","`","Domain.Discrete","`",",","`","Domain.Categorical","`","or","`","Domain.Invalid","`","."]
code: def get_type(cls, subdomain):
      """Return the type of the set of values in a subdomain.
  
      Args:
          subdomain: one of :obj:`dict`, :obj:`list` or :obj:`set`. The
              subdomain to get the type for.
  
      Returns:
          One of `Domain.Continuous`, `Domain.Discrete`, `Domain.Categorical`
          or `Domain.Invalid`.
      """
  
      def is_numeric(x):
          try:
              float(x)
          except ValueError:
              return False
          return True
  
      if isinstance(subdomain, list):
          return Domain.Continuous
      if isinstance(subdomain, set):
          if all(map(is_numeric, subdomain)):
              return Domain.Discrete
          return Domain.Categorical
      return Domain.Invalid
  
imports: import ast
  import copy
  import os
  import pickle
  import random
  from collections import namedtuple
  from typing import Tuple
label_desc: Use image node_id 6 for calling the Domain obj's underlying member method code with example usage: obj.get_type(cls, subdomain) and returns: Domain, True, Domain, Domain, Domain, False