#NEWLINE# def get_composite_specs_and_mapping( self , model ) : #NEWLINE# #INDENT# '\n        Build the composite data_specs and a mapping to flatten it, return both\n\n        Build the composite data_specs described in `get_composite_specs`, and\n        build a DataSpecsMapping that can convert between it and a flat\n        equivalent version. In particular, it helps building a flat data_specs\n        to request data, and nesting this data back to the composite\n        data_specs, so it can be dispatched among the different sub-costs.\n\n        Parameters\n        ----------\n        model : pylearn2.models.Model\n\n        Notes\n        -----\n        This is a helper function used by `get_data_specs` and `get_gradients`,\n        and possibly other methods.\n        ' #NEWLINE# ( composite_space , sources ) = self . get_composite_data_specs ( model ) #NEWLINE# mapping = DataSpecsMapping ( ( composite_space , sources ) ) #NEWLINE# return ( ( composite_space , sources ) , mapping )