def METHOD_NAME(stmt, accel):
    """Returns stmt if an accelerator statement. otherwise it returns None.
    this function can be used as the following
    >>> if accelerator_statement(stmt, 'omp'):
        # do stuff
        ...
    In general you can use the functions omp_statement and acc_statement
    """
    assert(accel in ['omp', 'acc'])
    if not isinstance(stmt, CommentLine): return None
    if not stmt.value.startswith('#$'): return None
    directive = stmt.value[2:].lstrip()
    if not directive.startswith(accel): return None
    return stmt.value