def valid_statement(source):
    """ Is source a valid statement?

    >>> valid_statement('x = 1')
    True
    >>> valid_statement('x = print foo')
    False
    """
    try:
        compile(source, '', 'single')
        return True
    except SyntaxError:
        return False