def __parse_settings()

in pyignite/cache.py [0:0]


def __parse_settings(settings: Union[str, dict]) -> Tuple[Optional[str], Optional[dict]]:
    if isinstance(settings, str):
        return settings, None
    elif isinstance(settings, dict) and prop_codes.PROP_NAME in settings:
        name = settings[prop_codes.PROP_NAME]
        if len(settings) == 1:
            return name, None

        if not set(settings).issubset(PROP_CODES):
            raise ParameterError('One or more settings was not recognized')

        return name, settings
    else:
        raise ParameterError('You should supply at least cache name')