26453d58671e01410b22287a723f76d6bb98803f,optuna/storages/in_memory.py,InMemoryStorage,create_new_study,#InMemoryStorage#Any#,53

Before Change


    def create_new_study(self, study_name=None):
        // type: (Optional[str]) -> int

        if study_name is not None:
            self.study_name = study_name

        return IN_MEMORY_STORAGE_STUDY_ID  // TODO(akiba)

    def delete_study(self, study_id):
        // type: (int) -> None

After Change


        study_id = self._max_study_id + 1
        self._max_study_id += 1

        if study_name is not None:
            if study_name in self._study_name_to_id:
                raise DuplicatedStudyError
            self._study_name[study_id] = study_name
            self._study_name_to_id[study_name] = study_id
        else:
            study_uuid = str(uuid.uuid4())
            study_name = DEFAULT_STUDY_NAME_PREFIX + study_uuid
            self._study_name[study_id] = study_name
            self._study_name_to_id[study_name] = study_id

        return study_id

    def delete_study(self, study_id):
        // type: (int) -> None
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: pfnet/optuna
Commit Name: 26453d58671e01410b22287a723f76d6bb98803f
Time: 2020-05-11
Author: ytsmiling@gmail.com
File Name: optuna/storages/in_memory.py
Class Name: InMemoryStorage
Method Name: create_new_study


Project Name: quiltdata/quilt
Commit Name: 511dd8aa75f9148415c8f9efc91257c62e503e2e
Time: 2019-10-09
Author: armandmcqueen@users.noreply.github.com
File Name: api/python/quilt3/packages.py
Class Name: Package
Method Name: set


Project Name: pfnet/optuna
Commit Name: d5d2a849496362535ceaeef92aff9bec4e2edeba
Time: 2020-04-30
Author: ytsmiling@gmail.com
File Name: optuna/storages/in_memory.py
Class Name: InMemoryStorage
Method Name: create_new_study