<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def url_for(self, resource, **kwargs):
 """Create a url for the given resource. :param resource: The resource :type resource: :class:`Resource` :param kwargs: Same arguments you would give :class:`flask.url_for` """

        if self.blueprint:
            return flask.url_for('.' + resource.endpoint, **kwargs)
        return flask.url_for(resource.endpoint, **kwargs)