def store_file(self, file_content, file_info):
        import weblab.data.experiments as Experiments

        # TODO: this is a very dirty way to implement this. Anyway until the good approach is taken, this will store the students programs
        # TODO: there should be two global variables: first, if store_student_files is not activated, do nothing.
        #       but, if store_student_files is activated, it should check that for a given experiment, they should be stored or not.
        #       For instance, I may want to store GPIB experiments but not FPGA experiments. Indeed, this should be stored in the db
        #       in the permission of the student/group with the particular experiment, with a default value to True.
        should_i_store = self._cfg_manager.get_doc_value(configuration_doc.CORE_STORE_STUDENTS_PROGRAMS)
        timestamp_before   = self._utc_timestamp()
        if should_i_store:
            # TODO not tested
            if isinstance(file_content, unicode):
                file_content_encoded = file_content.encode('utf8')
            else:
                file_content_encoded = file_content
            deserialized_file_content = ExperimentUtil.deserialize(file_content_encoded)
            storage_path = self._cfg_manager.get_doc_value(configuration_doc.CORE_STORE_STUDENTS_PROGRAMS_PATH)
            relative_file_path = _get_time_in_str() + '_' + self._reservation_id
            sha_obj            = hashlib.new('sha')
            sha_obj.update(deserialized_file_content)
            file_hash          = sha_obj.hexdigest()

            where = storage_path + '/' + relative_file_path
            f = open(where,'w')
            f.write(deserialized_file_content)
            f.close()

            return Experiments.FileSent(relative_file_path, "{sha}%s" % file_hash, timestamp_before, file_info = file_info)
        else:
            return Experiments.FileSent("<file not stored>","<file not stored>", timestamp_before, file_info = file_info)
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/file_storer.py/FileStorer.store_file/original