<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_path_and_create_folders(folder, import_path):
 """ calculate the path and create the needed folders """

    file_path = abspath(path_join(folder, import_path[:import_path.rfind(".")].replace(".", folder_seperator) + ".py"))
    mkdir_p(dirname(file_path))
    return file_path