def _get_func(module, func_name):
    """
    Given a module and a function name, return the function.

    func_name can be of the forms:
        - 'foo': return a function
        - 'Class.foo': return a method
    """
    cls_name = None
    cls = None
    if '.' in func_name:
        cls_name, func_name = func_name.split('.')
    if cls_name:
        cls = getattr(module, cls_name)
        func = getattr(cls, func_name)
    else:
        func = getattr(module, func_name)
    return cls, func