def _parse_interval(value):
 try:
  return sorted(aniso8601.parse_interval(value))
 except ValueError:
  try:
   return (aniso8601.parse_datetime(value), None)
  except ValueError:
   return (aniso8601.parse_date(value), None)

def _parse_interval ( value ) : try : return sorted ( aniso8601 . parse_interval ( value ) ) except ValueError : try : return ( aniso8601 . parse_datetime ( value ) , None ) except ValueError : return ( aniso8601 . parse_date ( value ) , None )
convert an interval string like 1w3d6h into the number of seconds .