def robust_line_iter(istream):
    tries_since_success = 0
    sub = _color_pattern.sub

    lines = unbuffered_lines(istream)
    while True:
        try:
            l = next(lines)
            tries_since_success = 0

            # trim and remove shell colors
            l_no_color = sub(u'', l.rstrip())

            yield l_no_color

        except StopIteration:
            break

        except IOError:
            # sometimes we can get interrupted on a blocking read
            # let's retry a few times
            tries_since_success += 1

            if tries_since_success >= MAX_IO_RETRIES:
                # something's really wrong
                break
Get the full app-label-qualified permission name (as required by
dataset/ETHPy150Open larsyencken/anytop/anytop/common.py/robust_line_iter--crossover with--dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailcore/permission_policies/base.py/BaseDjangoAuthPermissionPolicy._get_permission_name