frombehaveimport*frombehave_pandasimporttable_to_dataframe,dataframe_to_tableuse_step_matcher("parse")@when('converted to a data frame using {column_levels:d} row as column names and {index_levels:d} column as index')defstep_impl(context,column_levels,index_levels):context.parsed=table_to_dataframe(context.input,column_levels=column_levels,index_levels=index_levels)@then("it prints a valid string copy pasteable into gherkin files")defstep_impl(context):assertcontext.result==context.text@step("printed using data_frame_to_table")defstep_impl(context):context.result=dataframe_to_table(context.parsed)