code: def same_dimensions_as(self, other_unit):
          
          # test first for 'is' equality to avoid expensive sympy operation
          if self.dimensions is other_unit.dimensions:
              return True
          return (self.dimensions / other_unit.dimensions) == sympy_one
docs: Test if the dimensions of *other_unit* are the same as this unit
  
          Examples
          --------
          >>> from unyt import Msun, kg, mile
          >>> Msun.units.same_dimensions_as(kg.units)
          True
          >>> Msun.units.same_dimensions_as(mile.units)
          False