code: def test_factor_and_dimension():
      assert (3000, Dimension(1)) == SI._collect_factor_and_dimension(
          3000
      )
      assert (1001, length) == SI._collect_factor_and_dimension(
          meter + km
      )
      assert (2, length / time) == SI._collect_factor_and_dimension(
          meter / second + 36 * km / (10 * hour)
      )
  
      x, y = symbols("x y")
      assert (x + y / 100, length) == SI._collect_factor_and_dimension(
          x * m + y * centimeter
      )
  
      cH = Quantity("cH")
      SI.set_quantity_dimension(cH, amount_of_substance / volume)
  
      pH = -log(cH)
  
      assert (
          1,
          volume / amount_of_substance,
      ) == SI._collect_factor_and_dimension(exp(pH))
  
      v_w1 = Quantity("v_w1")
      v_w2 = Quantity("v_w2")
  
      v_w1.set_global_relative_scale_factor(
          Rational(3, 2), meter / second
      )
      v_w2.set_global_relative_scale_factor(2, meter / second)
  
      expr = Abs(v_w1 / 2 - v_w2)
      assert (
          Rational(5, 4),
          length / time,
      ) == SI._collect_factor_and_dimension(expr)
  
      expr = Rational(5, 2) * second / meter * v_w1 - 3000
      assert (
          -(2996 + Rational(1, 4)),
          Dimension(1),
      ) == SI._collect_factor_and_dimension(expr)
  
      expr = v_w1 ** (v_w2 / v_w1)
      assert (
          (Rational(3, 2)) ** Rational(4, 3),
          (length / time) ** Rational(4, 3),
      ) == SI._collect_factor_and_dimension(expr)
  
imports: import warnings
  from sympy.core.add import Add
  from sympy.core.function import Function, diff
  from sympy.core.numbers import Number, Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.complexes import Abs
  from sympy.functions.elementary.exponential import exp, log
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import sin
  from sympy.integrals.integrals import integrate
  from sympy.physics.units import amount_of_substance, area, convert_to, find_unit, volume, kilometer, joule, molar_gas_constant, vacuum_permittivity, elementary_charge, volt, ohm
  from sympy.physics.units.definitions import amu, au, centimeter, coulomb, day, foot, grams, hour, inch, kg, km, m, meter, millimeter, minute, quart, s, second, speed_of_light, bit, byte, kibibyte, mebibyte, gibibyte, tebibyte, pebibyte, exbibyte, kilogram, gravitational_constant, electron_rest_mass
  from sympy.physics.units.definitions.dimension_definitions import Dimension, charge, length, time, temperature, pressure, energy, mass
  from sympy.physics.units.prefixes import PREFIXES, kilo
  from sympy.physics.units.quantities import PhysicalConstant, Quantity
  from sympy.physics.units.systems import SI
  from sympy.testing.pytest import raises
label_desc: Use image node_id 19 for calling a global function with example usage: test_factor_and_dimension() without return types