def find_dimension(name, locale=None, provider=None, namespace=None):
 templates = {}
 missing = [name]
 while missing:
  dimension = None
  name = missing.pop()
  dimension = None
  required_template = None
  try:
   dimension = _lookup_dimension(name, templates, namespace, provider)
  except TemplateRequired as e:
   required_template = e.template
  if (required_template in templates):
   raise BackendError(("Some model provider didn't make use of dimension template '%s' for '%s'" % (required_template, name)))
  if required_template:
   missing.append(name)
   if (required_template in missing):
    raise ModelError(("Dimension templates cycle in '%s'" % required_template))
   missing.append(required_template)
  if dimension:
   templates[name] = dimension
 if namespace:
  lookup = namespace.translation_lookup(locale)
  if lookup:
   context = LocalizationContext(lookup[0])
   trans = context.object_localization('dimensions', 'inner')
   dimension = dimension.localized(trans)
 return dimension

def find_dimension ( name , locale = None , provider = None , namespace = None ) : templates = { } missing = [ name ] while missing : dimension = None name = missing . pop ( ) dimension = None required_template = None try : dimension = _lookup_dimension ( name , templates , namespace , provider ) except TemplateRequired as e : required_template = e . template if ( required_template in templates ) : raise BackendError ( ( "Some model provider didn't make use of dimension template '%s' for '%s'" % ( required_template , name ) ) ) if required_template : missing . append ( name ) if ( required_template in missing ) : raise ModelError ( ( "Dimension templates cycle in '%s'" % required_template ) ) missing . append ( required_template ) if dimension : templates [ name ] = dimension if namespace : lookup = namespace . translation_lookup ( locale ) if lookup : context = LocalizationContext ( lookup [ 0 ] ) trans = context . object_localization ( 'dimensions' , 'inner' ) dimension = dimension . localized ( trans ) return dimension
returns a localized dimension with name .