def _create(request, data_type, **kwargs):
request_class_attr_name = _ATTR_BY_TYPE[data_type]<EOL>data_source = request_class_attribute(request, request_class_attr_name)<EOL>_LOGGER.debug("<STR_LIT>",<EOL>data_source, data_type.__class__.__name__)<EOL>try:<EOL><INDENT>return data_type(data_source, **kwargs)<EOL><DEDENT>except EmptyDataError:<EOL><INDENT>with open(data_source, '<STR_LIT:r>') as datafile:<EOL><INDENT>_LOGGER.error("<STR_LIT>".format(datafile.readlines()))<EOL><DEDENT>raise<EOL><DEDENT>
Create instance of desired type, using file in request class.

:param _pytest.fixtures.FixtureRequest: test case that initiated the
    fixture request that triggered this call
:param type data_type: the data type to be created