Repository: activeloopai/Hub
File: deeplake/api/dataset.py (Python)

Code before:

        feature_report_path(
            dest,
            "ingest_coco",
            {"num_workers": num_workers},
            token=token,
        )

        unstructured = CocoDataset(
            source=images_directory,
            annotation_files=annotation_files,
            key_to_tensor_mapping=key_to_tensor_mapping,
            file_to_group_mapping=file_to_group_mapping,
            ignore_one_group=ignore_one_group,
            ignore_keys=ignore_keys,
            image_params=image_params,
            image_creds_key=image_creds_key,
            creds=src_creds,
        )
        structure = unstructured.prepare_structure(inspect_limit)

        ds = deeplake.empty(
            dest, creds=dest_creds, verbose=False, token=token, **dataset_kwargs
        )
        if connect_kwargs is not None:
            connect_kwargs["token"] = token or connect_kwargs.get("token", None)
            ds.connect(**connect_kwargs)

        structure.create_missing(ds)

        unstructured.structure(
            ds,
            progressbar,
            num_workers,
        )

        return ds

    @staticmethod
    def ingest_yolo(
        data_directory: Union[str, pathlib.Path],
        dest: Union[str, pathlib.Path],
        class_names_file: Optional[Union[str, pathlib.Path]] = None,
        annotations_directory: Optional[Union[str, pathlib.Path]] = None,
        allow_no_annotation: bool = False,
        image_params: Optional[Dict] = None,
        label_params: Optional[Dict] = None,
        coordinates_params: Optional[Dict] = None,
        src_creds: Optional[Dict] = None,
        dest_creds: Optional[Dict] = None,
        image_creds_key: Optional[str] = None,

Review comment (suggestion):
```suggestion
            connect_kwargs["token"] = token or connect_kwargs.get("token")
```
just `get(...)` should be enough

Code after:
            else convert_pathlib_to_string_if_needed(annotation_files)
        )

        feature_report_path(
            dest,
            "ingest_coco",
            {"num_workers": num_workers},
            token=token,
        )

        unstructured = CocoDataset(
            source=images_directory,
            annotation_files=annotation_files,
            key_to_tensor_mapping=key_to_tensor_mapping,
            file_to_group_mapping=file_to_group_mapping,
            ignore_one_group=ignore_one_group,
            ignore_keys=ignore_keys,
            image_params=image_params,
            image_creds_key=image_creds_key,
            creds=src_creds,
        )
        structure = unstructured.prepare_structure(inspect_limit)

        ds = deeplake.empty(
            dest, creds=dest_creds, verbose=False, token=token, **dataset_kwargs
        )
        if connect_kwargs is not None:
            connect_kwargs["token"] = token or connect_kwargs.get("token")
            ds.connect(**connect_kwargs)

        structure.create_missing(ds)

        unstructured.structure(ds, progressbar, num_workers, shuffle)

        return ds

    @staticmethod
    def ingest_yolo(
        data_directory: Union[str, pathlib.Path],
        dest: Union[str, pathlib.Path],
        class_names_file: Optional[Union[str, pathlib.Path]] = None,
        annotations_directory: Optional[Union[str, pathlib.Path]] = None,
        allow_no_annotation: bool = False,
        image_params: Optional[Dict] = None,
        label_params: Optional[Dict] = None,
        coordinates_params: Optional[Dict] = None,
        src_creds: Optional[Dict] = None,
        dest_creds: Optional[Dict] = None,
        image_creds_key: Optional[str] = None,
        inspect_limit: int = 1000,
        progressbar: bool = True,