Q:

function decorators to specify the first two lines of the def?

I'm on python 3.5:
I have a repeating pattern in some of my python functions. For a large collection of classes the first two lines are:
obj_a = <..... obtain something I need.....>
obj_b = <..... obtain another thing I need....>

I'm simplifying it here, but the process of obtaining obj_a and obj_b isn't a one liner... I would like to avoid repeating this code anywhere in a more elegant way than a util function to obtain obj_a and obj_b (e.g. obj_a = getObjectA()...) 
Is there any way to take those lines and put them as part of a decorator of a function where I have something like:
@function_where_I_need_my_objects
def foo:
  <....do something with obj_a and obj_b already initialized....>

A:

obj_a and obj_b sound a lot like state.
class Thing:
    def __init__(self):
        # These could also be class attributes instead
        # if they can be initialized when Thing is first
        # defined.
        self.obj_a = ...
        self.obj_b = ...

    def foo(self):
        # use self.obj_a and self.obj_b

t = Thing()
t.foo()

Defining a decorator that returns a closure around obj_a and obj_b is also possible.
def decorator(f):
    obj_a = ...
    obj_b = ...
    def _():
       # use obj_a and obj_b
    return _

@decorator
def foo():
    ...

However, it is hardly any longer and much more flexible to simply write a function that returns the two objects, and lets the caller use whatever names they like:
def _get_a_b():
    a = ...
    b = ...
    return a, b

def foo():
   obj_a, obj_b = _get_a_b()
   ...

def bar():
    a1, a2 = _get_a_b()
    ...

