<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_hierarchy_uploader(root):
 """ Returns uploader, that uses get_hierarch_path to store files """

    # Workaround to avoid Django 1.7 makemigrations wierd behaviour:
    # More details: https://code.djangoproject.com/ticket/22436
    import sys
    if len(sys.argv) > 1 and sys.argv[1] in ('makemigrations', 'migrate'):
        # Hide ourselves from Django migrations
        return None

    from pymisc.utils.files import get_hierarchy_path
    def upload_to(instance, filename):
        file_name, file_ext = os.path.splitext(filename)
        return get_hierarchy_path(str(instance.id), file_ext, root, prefix_path_length=settings.PREFIX_PATH_LENGTH)
    return upload_to