def _lookup_dimension(name, templates, namespace, provider):
 dimension = None
 if provider:
  try:
   dimension = provider.dimension(name, templates=templates)
  except NoSuchDimensionError:
   pass
  else:
   return dimension
 if namespace:
  return namespace.dimension(name, templates=templates)
 raise NoSuchDimensionError(("Dimension '%s' not found" % name), name=name)

def _lookup_dimension ( name , templates , namespace , provider ) : dimension = None if provider : try : dimension = provider . dimension ( name , templates = templates ) except NoSuchDimensionError : pass else : return dimension if namespace : return namespace . dimension ( name , templates = templates ) raise NoSuchDimensionError ( ( "Dimension '%s' not found" % name ) , name = name )
look-up a dimension name in provider and then in namespace .