I tried searching for similar questions but non of the ones I found do quite what I need.
I am trying to build a generic function that can take the 2 arguments: