def pattern_head(*args, conditions=None, wc_name=None, **kwargs) -> Pattern:
    """Constructor for a :class:`Pattern` matching a :class:`ProtoExpr`

    The patterns associated with :attr:`_rules` and :attr:`_binary_rules`
    of an :class:`Expression` subclass, or those passed to
    :meth:`Expression.add_rule`, must be instantiated through this
    routine. The function does not allow to set a wildcard name
    (`wc_name` must not be given / be None)"""
    # This routine is indented for the _rules and _binary_rules class
    # attributes of algebraic objects, which the match_replace and
    # match_replace_binary match against a ProtoExpr
    if len(args) == 0:
        args = None
    if len(kwargs) == 0:
        kwargs = None
    if wc_name is not None:
        raise ValueError("pattern_head cannot be used to set a wildcard "
                         "(`wc_name` must not be given")
    pat = Pattern(head=ProtoExpr, args=args, kwargs=kwargs, wc_name=None,
                  conditions=conditions)
    return pat
def pattern_head ( * args , conditions = None , wc_name = None , ** kwargs ) -> Pattern : if len ( args ) == 0 : args = None if len ( kwargs ) == 0 : kwargs = None if wc_name is not None : raise ValueError ( "pattern_head cannot be used to set a wildcard " "(`wc_name` must not be given" ) pat = Pattern ( head = ProtoExpr , args = args , kwargs = kwargs , wc_name = None , conditions = conditions ) return pat
Constructor for a :class:`Pattern` matching a :class:`ProtoExpr`

    The patterns associated with :attr:`_rules` and :attr:`_binary_rules`
    of an :class:`Expression` subclass, or those passed to
    :meth:`Expression.add_rule`, must be instantiated through this
    routine. The function does not allow to set a wildcard name
    (`wc_name` must not be given / be None)