docs: def get_arcpy():  
    '''
    Allows arcpy to imported on 'unmanaged' python installations (i.e. python installations
    arcgis is not aware of).
    Gets the location of arcpy and related libs and adds it to sys.path
    '''
    install_dir = locate_arcgis()  
    arcpy = path.join(install_dir, "arcpy")
    # Check we have the arcpy directory.
    if not path.exists(arcpy):
      raise ImportError("Could not find arcpy directory in {0}".format(install_dir))
  
    # First check if we have a bin64 directory - this exists when arcgis is 64bit
    bin_dir = path.join(install_dir, "bin64")
    
    # check if we are using a 64-bit version of Python
    is_64bits = sys.maxsize > 2**32
    
    if not path.exists(bin_dir) or is_64bits == False:
      # Fall back to regular 'bin' dir otherwise.
      bin_dir = path.join(install_dir, "bin")
  
    scripts = path.join(install_dir, "ArcToolbox", "Scripts")  
    sys.path.extend([arcpy, bin_dir, scripts])