def _get_metadata(field, expr, metadata_expr, no_metadata_rule):
 if (isinstance(metadata_expr, bz.Expr) or (metadata_expr is None)):
  return metadata_expr
 try:
  return expr._child['_'.join(((expr._name or ''), field))]
 except (ValueError, AttributeError):
  if (no_metadata_rule == 'raise'):
   raise ValueError(('no %s table could be reflected for %s' % (field, expr)))
  elif (no_metadata_rule == 'warn'):
   warnings.warn(NoMetaDataWarning(expr, field), stacklevel=4)
 return None

def _get_metadata ( field , expr , metadata_expr , no_metadata_rule ) : if ( isinstance ( metadata_expr , bz . Expr ) or ( metadata_expr is None ) ) : return metadata_expr try : return expr . _child [ '_' . join ( ( ( expr . _name or '' ) , field ) ) ] except ( ValueError , AttributeError ) : if ( no_metadata_rule == 'raise' ) : raise ValueError ( ( 'no %s table could be reflected for %s' % ( field , expr ) ) ) elif ( no_metadata_rule == 'warn' ) : warnings . warn ( NoMetaDataWarning ( expr , field ) , stacklevel = 4 ) return None
find the correct metadata expression for the expression .