def is_valid_esi(esi):
 if isinstance(esi, numbers.Integral):
  return (0 <= esi <= 4722366482869645213695L)
 return isinstance(esi, dict)

def is_valid_esi ( esi ) : if isinstance ( esi , numbers . Integral ) : return ( 0 <= esi <= 4722366482869645213695 L ) return isinstance ( esi , dict )
returns true if the given evpn ethernet segmentethernet id is valid .