def _resolve_arg_ids(self, argnames, ids, parameters, item):
from _pytest._io.saferepr import saferepr<EOL>idfn = None<EOL>if callable(ids):<EOL><INDENT>idfn = ids<EOL>ids = None<EOL><DEDENT>if ids:<EOL><INDENT>func_name = self.function.__name__<EOL>if len(ids) != len(parameters):<EOL><INDENT>msg = "<STR_LIT>"<EOL>fail(msg.format(func_name, len(parameters), len(ids)), pytrace=False)<EOL><DEDENT>for id_value in ids:<EOL><INDENT>if id_value is not None and not isinstance(id_value, six.string_types):<EOL><INDENT>msg = "<STR_LIT>"<EOL>fail(<EOL>msg.format(func_name, saferepr(id_value), type(id_value)),<EOL>pytrace=False,<EOL>)<EOL><DEDENT><DEDENT><DEDENT>ids = idmaker(argnames, parameters, idfn, ids, self.config, item=item)<EOL>return ids<EOL>
Resolves the actual ids for the given argnames, based on the ``ids`` parameter given
        to ``parametrize``.

        :param List[str] argnames: list of argument names passed to ``parametrize()``.
        :param ids: the ids parameter of the parametrized call (see docs).
        :param List[ParameterSet] parameters: the list of parameter values, same size as ``argnames``.
        :param Item item: the item that generated this parametrized call.
        :rtype: List[str]
        :return: the list of ids for each argname given