code: def calc_path_and_create_folders(folder, import_path):
      
      file_path = abspath(path_join(folder, import_path[:import_path.rfind(".")].replace(".", folder_seperator) + ".py"))
      mkdir_p(dirname(file_path))
      return file_path
docs: calculate the path and create the needed folders