<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)