<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _save_sciobj_bytes_from_request(request, pid):
 """Django stores small uploads in memory and streams large uploads directly to disk. Uploads stored in memory are represented by UploadedFile and on disk, TemporaryUploadedFile. To store an UploadedFile on disk, it's iterated and saved in chunks. To store a TemporaryUploadedFile, it's moved from the temporary to the final location. Django automatically handles this when using the file related fields in the models, but GMN is not using those, so has to do it manually here. """

    sciobj_path = d1_gmn.app.sciobj_store.get_abs_sciobj_file_path_by_pid(pid)
    if hasattr(request.FILES['object'], 'temporary_file_path'):
        d1_common.utils.filesystem.create_missing_directories_for_file(sciobj_path)
        django.core.files.move.file_move_safe(
            request.FILES['object'].temporary_file_path(), sciobj_path
        )
    else:
        with d1_gmn.app.sciobj_store.open_sciobj_file_by_path_ctx(
            sciobj_path, write=True
        ) as sciobj_stream:
            for chunk in request.FILES['object'].chunks():
                sciobj_stream.write(chunk)