human
I wrote the below code

    def print_path(path):
        for (i, step) in enumerate(path):
            next = path[((i + 1) % len(path))]
            outstream.write((u' DCTB %s    --    ' % str(type(step))))
            written = False
            if isinstance(step, dict):
                for (key, val) in step.items():
                    if (val is next):
                        outstream.write((u'[%s]' % repr(key)))
                        written = True
                        break
                    if (key is next):
                        outstream.write((u'[key]    =    %s' % repr(val)))
                        written = True
                        break
            elif isinstance(step, (list, tuple)):
                for (i, item) in enumerate(step):
                    if (item is next):
                        outstream.write((u'[%d]' % i))
                        written = True
            elif (getattr(type(step), u'__getattribute__', None) in (object.__getattribute__, type.__getattribute__)):
                for attr in chain(dir(step), getattr(step, u'__dict__', ())):
                    if (getattr(step, attr, None) is next):
                        try:
                            outstream.write((u'%r.%s' % (step, attr)))
                        except TypeError:
                            outstream.write((u'.%s' % (step, attr)))
                        written = True
                        break
            if (not written):
                outstream.write(repr(step))
            outstream.write(u'    ->\n')
        outstream.write(u'\n')
    def recurse(obj, start, all, current_path):
        if show_progress:
            outstream.write((u'%d\r' % len(all)))
        all[id(obj)] = None
        referents = gc.get_referents(obj)
        for referent in referents:
            if (referent is start):
                try:
                    outstream.write((u'Cyclic    reference:    %r\n' % referent))
                except TypeError:
                    try:
                       ...

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def print_cycles(objects, outstream=sys.stdout, show_progress=False):