<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def call_plugin(plugin, f, *args, **kwargs):
 """Calls function f from plugin, returns None if plugin does not implement f."""

    try:
        getattr(plugin, f)
    except AttributeError:
        return None
    if kwargs:
        getattr(plugin, f)(
            *args,
            **kwargs
        )
    else:
        return getattr(plugin, f)(
            *args
        )