class_docstr: DimensionSystem represents a coherent set of dimensions.
  
  The constructor takes three parameters:
  
  - base dimensions;
  - derived dimensions: these are defined in terms of the base dimensions
    (for example velocity is defined from the division of length by time);
  - dependency of dimensions: how the derived dimensions depend
    on the base dimensions.
  
  Optionally either the ``derived_dims`` or the ``dimensional_dependencies``
  may be omitted.
code: def __new__(
      cls, base_dims, derived_dims=(), dimensional_dependencies={}
  ):
      dimensional_dependencies = dict(dimensional_dependencies)
  
      def parse_dim(dim):
          if isinstance(dim, str):
              dim = Dimension(Symbol(dim))
          elif isinstance(dim, Dimension):
              pass
          elif isinstance(dim, Symbol):
              dim = Dimension(dim)
          else:
              raise TypeError("%s wrong type" % dim)
          return dim
  
      base_dims = [parse_dim(i) for i in base_dims]
      derived_dims = [parse_dim(i) for i in derived_dims]
  
      for dim in base_dims:
          if dim in dimensional_dependencies and (
              len(dimensional_dependencies[dim]) != 1
              or dimensional_dependencies[dim].get(dim, None) != 1
          ):
              raise IndexError("Repeated value in base dimensions")
          dimensional_dependencies[dim] = Dict({dim: 1})
  
      def parse_dim_name(dim):
          if isinstance(dim, Dimension):
              return dim
          elif isinstance(dim, str):
              return Dimension(Symbol(dim))
          elif isinstance(dim, Symbol):
              return Dimension(dim)
          else:
              raise TypeError(
                  "unrecognized type %s for %s" % (type(dim), dim)
              )
  
      for dim in dimensional_dependencies.keys():
          dim = parse_dim(dim)
          if (dim not in derived_dims) and (dim not in base_dims):
              derived_dims.append(dim)
  
      def parse_dict(d):
          return Dict({parse_dim_name(i): j for i, j in d.items()})
  
      # Make sure everything is a SymPy type:
      dimensional_dependencies = {
          parse_dim_name(i): parse_dict(j)
          for i, j in dimensional_dependencies.items()
      }
  
      for dim in derived_dims:
          if dim in base_dims:
              raise ValueError(
                  "Dimension %s both in base and derived" % dim
              )
          if dim not in dimensional_dependencies:
              # TODO: should this raise a warning?
              dimensional_dependencies[dim] = Dict({dim: 1})
  
      base_dims.sort(key=default_sort_key)
      derived_dims.sort(key=default_sort_key)
  
      base_dims = Tuple(*base_dims)
      derived_dims = Tuple(*derived_dims)
      dimensional_dependencies = Dict(
          {i: Dict(j) for i, j in dimensional_dependencies.items()}
      )
      obj = Basic.__new__(
          cls, base_dims, derived_dims, dimensional_dependencies
      )
      return obj
  
imports: from __future__ import annotations
  import collections
  from functools import reduce
  from sympy.core.basic import Basic
  from sympy.core.containers import Dict, Tuple
  from sympy.core.singleton import S
  from sympy.core.sorting import default_sort_key
  from sympy.core.symbol import Symbol
  from sympy.core.sympify import sympify
  from sympy.matrices.dense import Matrix
  from sympy.functions.elementary.trigonometric import TrigonometricFunction
  from sympy.core.expr import Expr
  from sympy.core.power import Pow
label_desc: Use image node_id 1 for calling the DimensionSystem obj's underlying member method code with example usage: obj.__new__(cls, base_dims, derived_dims, dimensional_dependencies) and returns: obj, dim, Dict, dim, Dimension, Dimension