def _get_kernel(value):
 if ((value is None) or (value.lower() == u'builtin')):
  return None
 if (value.lower() == u'jpl'):
  value = DEFAULT_JPL_EPHEMERIS
 if (value.lower() in (u'de430', u'de432s')):
  value = u'http://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/{:s}.bsp'.format(value.lower())
 else:
  try:
   six.moves.urllib.parse.urlparse(value)
  except Exception:
   raise ValueError(u'{} was not one of the standard strings and could not be parsed as a URL'.format(value))
 try:
  from jplephem.spk import SPK
 except ImportError:
  raise ImportError(u'Solar system JPL ephemeris calculations require the jplephem package (https://pypi.python.org/pypi/jplephem)')
 return SPK.open(download_file(value, cache=True))

def _get_kernel ( value ) : if ( ( value is None ) or ( value . lower ( ) == u'builtin' ) ) : return None if ( value . lower ( ) == u'jpl' ) : value = DEFAULT_JPL_EPHEMERIS if ( value . lower ( ) in ( u'de430' , u'de432s' ) ) : value = u'http://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/{:s}.bsp' . format ( value . lower ( ) ) else : try : six . moves . urllib . parse . urlparse ( value ) except Exception : raise ValueError ( u'{} was not one of the standard strings and could not be parsed as a URL' . format ( value ) ) try : from jplephem . spk import SPK except ImportError : raise ImportError ( u'Solar system JPL ephemeris calculations require the jplephem package (https://pypi.python.org/pypi/jplephem)' ) return SPK . open ( download_file ( value , cache = True ) )
try importing jplephem .