def _maybe_match_name(a, b):
a_has = hasattr(a, '<STR_LIT:name>')<EOL>b_has = hasattr(b, '<STR_LIT:name>')<EOL>if a_has and b_has:<EOL><INDENT>if a.name == b.name:<EOL><INDENT>return a.name<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>elif a_has:<EOL><INDENT>return a.name<EOL><DEDENT>elif b_has:<EOL><INDENT>return b.name<EOL><DEDENT>return None<EOL>
Try to find a name to attach to the result of an operation between
a and b.  If only one of these has a `name` attribute, return that
name.  Otherwise return a consensus name if they match of None if
they have different names.

Parameters
----------
a : object
b : object

Returns
-------
name : str or None

See Also
--------
pandas.core.common.consensus_name_attr