def METHOD_NAME(get_names):
    definitions = _check_names(get_names, """
    from module import f
    g = f(f)
    class C:
        h = g
    def foo(x=a):
       bar = x
       return bar
    """, ['f', 'g', 'C', 'foo'])
    C_subdefs = definitions[-2].defined_names()
    foo_subdefs = definitions[-1].defined_names()
    _assert_definition_names(C_subdefs, ['h'])
    _assert_definition_names(foo_subdefs, ['x', 'bar'])