def _get_function_name(function, class_name=None):
    """Return a string representation of the function as
    module_path.Class_name.function_name

    note: the class name is the first parent class
    """
    names = [function.__module__]
    if class_name:
        names.append(class_name)
    names.append(function.__name__)
    return '.'.join(names)
