parameters: (self, dims, name="New Dimension")
return_statement: return ret
docstring: Builds a core.Dimension object from a python list or tuple. If a dimension
      object is passed a copy will be returned.
docstring_summary: Builds a core.Dimension object from a python list or tuple. If a dimension
      object is passed a copy will be returned.
docstring_tokens: Builds a core . Dimension object from a python list or tuple . If a dimension object is passed a copy will be returned .
function: def _dimension_from_list(self, dims, name="New Dimension"):
      """
      Builds a core.Dimension object from a python list or tuple. If a dimension
      object is passed a copy will be returned.
      """
  
      if isinstance(dims, (tuple, list, np.ndarray)):
          irreps = len(dims)
      elif isinstance(dims, core.Dimension):
          irreps = dims.n()
      else:
          raise ValidationError("Dimension from list: Type '%s' not understood" % type(dims))
  
      ret = core.Dimension(irreps, name)
      for i in range(irreps):
          ret[i] = dims[i]
      return ret
function_tokens: def _dimension_from_list ( self , dims , name = "New Dimension" ) : if isinstance ( dims , ( tuple , list , np . ndarray ) ) : irreps = len ( dims ) elif isinstance ( dims , core . Dimension ) : irreps = dims . n ( ) else : raise ValidationError ( "Dimension from list: Type '%s' not understood" % type ( dims ) ) ret = core . Dimension ( irreps , name ) for i in range ( irreps ) : ret [ i ] = dims [ i ] return ret