Returns True if the given EVPN Ethernet SegmentEthernet ID is valid.

def is_valid_esi(esi):
    """Returns True if the given EVPN Ethernet SegmentEthernet ID is valid."""
    if isinstance(esi, numbers.Integral):
        return 0 <= esi <= 0xffffffffffffffffff
    return isinstance(esi, dict)