def blanket_as_needed(expression):
    """blanket_as_needed

        >>> print blanket_as_needed('Huh?')
        (Huh?)

        >>> print blanket_as_needed(Not('0=0'))
        not (0=0)

        >>> print blanket_as_needed(And('0=0', '1=1', '2=2'))
        (
          (0=0) and
          (1=1) and
          (2=2)
        )
    """
    if is_composite(expression) or isinstance(expression, basestring): return Blanket(expression)
    else: return expression
blanket_as_needed

        >>> print blanket_as_needed('Huh?')
        (Huh?)

        >>> print blanket_as_needed(Not('0=0'))
        not (0=0)

        >>> print blanket_as_needed(And('0=0', '1=1', '2=2'))
        (
          (0=0) and
          (1=1) and
          (2=2)
        )
    
recipes/Python/415345_write_sql_via_python/recipe-415345.py