<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove(packagename, save, save_dev, save_test, filename):
 """ Uninstall the package and remove it from requirements file. """

    print(sh_pip.uninstall(packagename, "-y"))
    if not filename:
        filename = get_filename(save, save_dev, save_test)
    remove_requirements(packagename, filename)