def local_prefix(scope):
    """Get the prefix for local variables"""
    if scope.globals is scope.locals:
        return '_.'
    if scope.explicit_locals:
        return '__%d.' % len(scope.parent_locals)
    return ''
