def generate_mount_url(self, regex, v_or_f, mod):
        """The self.mounts can be None, which means no url generation.

        url is being managed by urlpatterns.
        else self.mounts is a dict, containing app name and where to mount
        if where it mount is None then again don't mount this fellow.
        """
        if getattr(self, "mounts", None) is None:
            return  # we don't want to mount anything
        if not regex.startswith("/"):
            return regex

        if not mod:
            if isinstance(v_or_f, basestring):
                mod = v_or_f
            else:  # if hasattr(v_or_f, "__module__")?
                mod = v_or_f.__module__

        best_k, best_v = "", None

        for k, v in tuple(self.mounts.items()):
            if mod.startswith(k) and len(k) is not len(best_k):
                best_k, best_v = k, v

        if best_k:
            if not best_v:
                return
            if not best_v.endswith("/"):
                best_k += "/"
            if best_v != "/":
                regex = best_v[:-1] + regex

        return regex
dataset/ETHPy150Open amitu/importd/importd/__init__.py/D.generate_mount_url/operator `>` -> `is not`