@given('the model elements with name and tags')
def step_given_named_model_elements_with_tags(context):
    """
    .. code-block:: gherkin

        Given the model elements with name and tags:
            | name | tags   |
            | S1   | @foo   |
        Then the tag expression select model elements with:
            | tag expression | selected?    |
            |  @foo          | S1, S3       |
            | -@foo          | S0, S2, S3   |
    """
    assert context.table, "REQUIRE: context.table"
    context.table.require_columns(["name", "tags"])

    # -- PREPARE:
    model_element_names = set()
    model_elements = []
    for row in context.table.rows:
        name = row["name"].strip()
        tags = convert_model_element_tags(row["tags"])
        assert name not in model_element_names, "DUPLICATED: name=%s" % name
        model_elements.append(ModelElement(name, tags=tags))
        model_element_names.add(name)

    # -- SETUP:
    context.model_elements = model_elements
dataset/ETHPy150Open behave/behave/features/steps/behave_tag_expression_steps.py/step_given_named_model_elements_with_tags/original