code: def _get_dimension_scales(self, dimension, preserve_domain=False):
          
          if preserve_domain:
              return [
                  self.scales[k] for k in self.scales if (
                      k in self.scales_metadata and
                      self.scales_metadata[k].get('dimension') == dimension and
                      not self.preserve_domain.get(k)
                  )
              ]
          else:
              return [
                  self.scales[k] for k in self.scales if (
                      k in self.scales_metadata and
                      self.scales_metadata[k].get('dimension') == dimension
                  )
              ]
docs: Return the list of scales corresponding to a given dimension.
  
          The preserve_domain optional argument specifies whether one should
          filter out the scales for which preserve_domain is set to True.