generate url for named url pattern with kwargs

def generate(self, name: str, **kwargs: Dict[str, str]) -> str:
        """ generate url for named url pattern with kwargs
        """
        template = self.patterns[name]
        return template.substitute(kwargs)