def _generate_arg_types(coordlist_length, shape_name):
from .ds9_region_parser import ds9_shape_defs<EOL>from .ds9_attr_parser import ds9_shape_in_comment_defs<EOL>if shape_name in ds9_shape_defs:<EOL><INDENT>shape_def = ds9_shape_defs[shape_name]<EOL><DEDENT>else:<EOL><INDENT>shape_def = ds9_shape_in_comment_defs[shape_name]<EOL><DEDENT>initial_arg_types = shape_def.args_list<EOL>arg_repeats = shape_def.args_repeat<EOL>if arg_repeats is None:<EOL><INDENT>return initial_arg_types<EOL><DEDENT>n1, n2 = arg_repeats<EOL>arg_types = list(initial_arg_types[:n1])<EOL>num_of_repeats = coordlist_length - (len(initial_arg_types) - n2)<EOL>arg_types.extend((num_of_repeats - n1) //<EOL>(n2 - n1) * initial_arg_types[n1:n2])<EOL>arg_types.extend(initial_arg_types[n2:])<EOL>return arg_types<EOL>
Find coordinate types based on shape name and coordlist length

    This function returns a list of coordinate types based on which
    coordinates can be repeated for a given type of shap

    Parameters
    ----------
    coordlist_length : int
        The number of coordinates or arguments used to define the shape.

    shape_name : str
        One of the names in `pyregion.ds9_shape_defs`.

    Returns
    -------
    arg_types : list
        A list of objects from `pyregion.region_numbers` with a length equal to
        coordlist_length.