def link_cube(cube, locale, provider=None, namespace=None, ignore_missing=False):
 linked = set()
 for dim_name in cube.dimension_links.keys():
  if (dim_name in linked):
   raise ModelError("Dimension '{}' linked twice".format(dim_name))
  try:
   dim = find_dimension(dim_name, locale, provider=provider, namespace=namespace)
  except TemplateRequired as e:
   raise ModelError(("Dimension template '%s' missing" % dim_name))
  if ((not dim) and (not ignore_missing)):
   raise CubesError("Dimension '{}' not found.".format(dim_name))
  cube.link_dimension(dim)
 return cube

def link_cube ( cube , locale , provider = None , namespace = None , ignore_missing = False ) : linked = set ( ) for dim_name in cube . dimension_links . keys ( ) : if ( dim_name in linked ) : raise ModelError ( "Dimension '{}' linked twice" . format ( dim_name ) ) try : dim = find_dimension ( dim_name , locale , provider = provider , namespace = namespace ) except TemplateRequired as e : raise ModelError ( ( "Dimension template '%s' missing" % dim_name ) ) if ( ( not dim ) and ( not ignore_missing ) ) : raise CubesError ( "Dimension '{}' not found." . format ( dim_name ) ) cube . link_dimension ( dim ) return cube
links dimensions to the cube in the context object .