@lru_cache()
def is_crypto_available():
 from stem.util import log
 try:
  from Crypto.PublicKey import RSA
  from Crypto.Util import asn1
  from Crypto.Util.number import long_to_bytes
  return True
 except ImportError:
  log.log_once('stem.prereq.is_crypto_available', log.INFO, CRYPTO_UNAVAILABLE)
  return False

@ lru_cache ( ) def is_crypto_available ( ) : from stem . util import log try : from Crypto . PublicKey import RSA from Crypto . Util import asn1 from Crypto . Util . number import long_to_bytes return True except ImportError : log . log_once ( 'stem.prereq.is_crypto_available' , log . INFO , CRYPTO_UNAVAILABLE ) return False
checks if the pycrypto functions we use are available .