docstr: Retrieve a single dimension by its name
  
  Parameters
  ----------
  name: Tuple, or str
      Name of the dimension in :attr:`dimensions` to return
  use_location: Boolean, default=True
      If True and a dimension has a non-null attribute called "location", its value will be
      used instead of that dimension's "name"
  default: Any (optional)
      If given and `name` is not found, `default` will be returned. Otherwise, `KeyError` will
      be raised when `name` is not found
  
  Returns
  -------
  Dimension
      Dimension subclass in :attr:`dimensions`, whose "name" attribute is equal to `name`
docstr_tok: ["Retrieve","a","single","dimension","by","its","name","Parameters","--","--","--","--","--","name",":","Tuple",",","or","str","Name","of","the","dimension","in",":","attr",":","`","dimensions","`","to","return","use_location",":","Boolean",",","default=True","If","True","and","a","dimension","has","a","non-null","attribute","called","``","location","''",",","its","value","will","be","used","instead","of","that","dimension","'s","``","name","''","default",":","Any","(","optional",")","If","given","and","`","name","`","is","not","found",",","`","default","`","will","be","returned",".","Otherwise",",","`","KeyError","`","will","be","raised","when","`","name","`","is","not","found","Returns","--","--","--","-","Dimension","Dimension","subclass","in",":","attr",":","`","dimensions","`",",","whose","``","name","''","attribute","is","equal","to","`","name","`"]
code: def get_by_name(self, name, use_location=True, default=NONE):
      """Retrieve a single dimension by its name
  
      Parameters
      ----------
      name: Tuple, or str
          Name of the dimension in :attr:`dimensions` to return
      use_location: Boolean, default=True
          If True and a dimension has a non-null attribute called "location", its value will be
          used instead of that dimension's "name"
      default: Any (optional)
          If given and `name` is not found, `default` will be returned. Otherwise, `KeyError` will
          be raised when `name` is not found
  
      Returns
      -------
      Dimension
          Dimension subclass in :attr:`dimensions`, whose "name" attribute is equal to `name`
      """
      for dimension in self.dimensions:
          if (
              use_location
              and getattr(dimension, "location", None) == name
          ):
              return dimension
          elif dimension.name == name:
              return dimension
  
      if default != NONE:
          return default
      raise KeyError(f"{name} not found in dimensions")
  
imports: from hyperparameter_hunter.space.dimensions import Dimension, Real, Integer, Categorical
  from hyperparameter_hunter.utils.general_utils import short_repr
  from functools import reduce
  import numbers
  import numpy
  from sys import maxsize
  from sklearn.utils import check_random_state
  from sklearn.utils.fixes import sp_version
label_desc: Use image node_id 17 for calling the Space obj's underlying member method code with example usage: obj.get_by_name(name, use_location, default) and returns: default, dimension, dimension