def check_installation():
 if can_import('requests'):
  import requests
  requests_version = requests.__version__
 else:
  requests_version = 'no'
 if can_import('OpenSSL'):
  import OpenSSL
  openssl_version = OpenSSL.__version__
 else:
  openssl_version = 'no'
 if can_import('cryptography'):
  import cryptography
  cryptography_version = cryptography.__version__
 else:
  cryptography_version = 'no'
 if can_import('pyasn1'):
  import pyasn1
  pyasn1_version = pyasn1.__version__
 else:
  pyasn1_version = 'no'
 if can_import('ndg.httpsclient'):
  from ndg import httpsclient
  ndg_version = httpsclient.__date__
 else:
  ndg_version = 'no'
 sys.stdout.write(('* Checking Python version: %s.%s.%s\n' % sys.version_info[:3]))
 sys.stdout.write(('* Operating system: %s\n' % sys.platform))
 sys.stdout.write(('* Checking if requests can be imported: %s\n' % requests_version))
 sys.stdout.write(('* Checking if pyOpenSSL is installed: %s\n' % openssl_version))
 sys.stdout.write(('* Checking if cryptography is installed: %s\n' % cryptography_version))
 sys.stdout.write(('* Checking if pyasn1 is installed: %s\n' % pyasn1_version))
 sys.stdout.write(('* Checking if ndg.httpsclient is installed: %s\n' % ndg_version))

def check_installation ( ) : if can_import ( 'requests' ) : import requests requests_version = requests . __version__ else : requests_version = 'no' if can_import ( 'OpenSSL' ) : import OpenSSL openssl_version = OpenSSL . __version__ else : openssl_version = 'no' if can_import ( 'cryptography' ) : import cryptography cryptography_version = cryptography . __version__ else : cryptography_version = 'no' if can_import ( 'pyasn1' ) : import pyasn1 pyasn1_version = pyasn1 . __version__ else : pyasn1_version = 'no' if can_import ( 'ndg.httpsclient' ) : from ndg import httpsclient ndg_version = httpsclient . __date__ else : ndg_version = 'no' sys . stdout . write ( ( '* Checking Python version: %s.%s.%s\n' % sys . version_info [ : 3 ] ) ) sys . stdout . write ( ( '* Operating system: %s\n' % sys . platform ) ) sys . stdout . write ( ( '* Checking if requests can be imported: %s\n' % requests_version ) ) sys . stdout . write ( ( '* Checking if pyOpenSSL is installed: %s\n' % openssl_version ) ) sys . stdout . write ( ( '* Checking if cryptography is installed: %s\n' % cryptography_version ) ) sys . stdout . write ( ( '* Checking if pyasn1 is installed: %s\n' % pyasn1_version ) ) sys . stdout . write ( ( '* Checking if ndg.httpsclient is installed: %s\n' % ndg_version ) )
check if some core modules are available .