<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def crud_url(instance_or_model, action, prefix=None, additional_kwargs=None):
 """Shortcut function returns URL for instance or model and action. Example:: crud_url(author, 'update') Is same as: reverse('testapp_author_update', kwargs={'pk': author.pk}) Example:: crud_url(Author, 'update') Is same as: reverse('testapp_author_list') """

    if additional_kwargs is None:
        additional_kwargs = {}
    if isinstance(instance_or_model, Model):
        additional_kwargs['pk'] = instance_or_model.pk
        model_name = instance_or_model._meta.model
    else:
        model_name = instance_or_model
    return reverse(
        crud_url_name(model_name, action, prefix),
        kwargs=additional_kwargs
    )