def slugify(value: str, allow_dots: bool = False, allow_unicode: bool = False) -> str:
    """
    Converts to lowercase, removes non-word characters (alphanumerics and
    underscores) and converts spaces to hyphens. Also strips leading and
    trailing whitespace. Modified to optionally allow dots.

    Adapted from Django 1.9
    """
    pattern: Pattern = _re_pattern_allow_dots if allow_dots else _re_pattern

    value = str(value)
    if allow_unicode:
        value = unicodedata.normalize("NFKC", value)
        value = pattern.sub("", value).strip().lower()
        return _re_spaces.sub("-", value)
    value = unicodedata.normalize("NFKD", value).encode("ascii", "ignore").decode("ascii")
    value = pattern.sub("", value).strip().lower()
    return _re_spaces.sub("-", value)

    Converts to lowercase, removes non-word characters (alphanumerics and
    underscores) and converts spaces to hyphens. Also strips leading and
    trailing whitespace. Modified to optionally allow dots.

    Adapted from Django 1.9
    
faker/utils/text.py