#NEWLINE# def bind_expression_to_resources( expr , resources ) : #NEWLINE# #INDENT# '\n    Bind a Blaze expression to resources.\n\n    Parameters\n    ----------\n    expr : bz.Expr\n        The expression to which we want to bind resources.\n    resources : dict[bz.Symbol -> any]\n        Mapping from the loadable terms of ``expr`` to actual data resources.\n\n    Returns\n    -------\n    bound_expr : bz.Expr\n        ``expr`` with bound resources.\n    ' #NEWLINE# if ( resources is None ) : #NEWLINE# #INDENT# resources = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return expr . _subs ( { k : bz . data ( v , dshape = k . dshape ) for ( k , v ) in iteritems ( resources ) } )