    def dns_safe_name(self):
        """Get a dns-safe encoding of my name

        - always safe value for a single DNS label
        - max 40 characters, leaving room for additional components

        .. versionadded:: 5.0
        """
        return _strict_dns_safe(self.name, max_length=40)
Get a dns-safe encoding of my name

- always safe value for a single DNS label
- max 40 characters, leaving room for additional components

.. versionadded:: 5.0
jupyterhub/user.py