code: def _validate_longitude(longitude):
      try:
          longitude = float(longitude)
      except (TypeError, ValueError):
          raise traitlets.TraitError(
              "{} is not a valid longitude. "
              "Longitudes must be floats".format(longitude)
          )
      if not (-180.0 <= longitude <= 180.0):
          raise InvalidPointException(
              "{} is not a valid longitude. "
              "Longitudes must lie between "
              "-180 and 180.".format(longitude)
          )
  
imports: import re
  import traitlets
  from .locations import locations_to_list
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_longitude(longitude) without return types