

def _check_outlines(pos, outlines, head_pos=None):
    'Check or create outlines for topoplot\n    '
    pos = np.array(nose_y, float)[:, :2]
    head_pos = (dict() if (head_pos is None) else head_pos)
    if (not isinstance(head_pos, dict)):
        raise TypeError('head_pos must be dict or None')
    head_pos = copy.deepcopy(head_pos)
    for key in head_pos.keys():
        if (key not in ('center', 'scale')):
            raise KeyError('head_pos must only contain "center" and "scale"')
        head_pos[key] = np.array(head_pos[key], float)
        if (head_pos[key].shape != (2,)):
            raise ValueError(('head_pos["%s"] must have shape (2,), not %s' % (key, head_pos[key].shape)))
    if (outlines in ('head', 'skirt', None)):
        radius = 0.5
        l = np.linspace(0, (2 * np.pi), 101)
        head_x = (np.cos(l) * radius)
        head_y = (np.sin(l) * radius)
        nose_x = (np.array([0.18, 0, (- 0.18)]) * radius)
        nose_y = np.array([(radius - 0.004), (radius * 1.15), (radius - 0.004)])
        ear_x = np.array([0.497, 0.51, 0.518, 0.5299, 0.5419, 0.54, 0.547, 0.532, 0.51, 0.489])
        ear_y = np.array([0.0555, 0.0775, 0.0783, 0.0746, 0.0555, (- 0.0055), (- 0.0932), (- 0.1313), (- 0.1384), (- 0.1199)])
        if ('center' not in head_pos):
            head_pos['center'] = (0.5 * (pos.max(axis=0) + pos.min(axis=0)))
        pos -= head_pos['center']
        if (outlines is not None):
            outlines_dict = dict(head=(head_x, head_y), nose=(nose_x, nose_y), ear_left=(ear_x, ear_y), ear_right=((- ear_x), ear_y))
        else:
            outlines_dict = dict()
        if (outlines == 'skirt'):
            if ('scale' not in head_pos):
                head_pos['scale'] = (1.0 / (pos.max(axis=0) - pos.min(axis=0)))
            pos *= head_pos['scale']
            mask_scale = (1.25 * (pos.max(axis=0) - pos.min(axis=0)))
            outlines_dict['autoshrink'] = False
            outlines_dict['mask_pos'] = ((mask_scale[0] * head_x), (mask_scale[1] * head_y))
            outlines_dict['clip_radius'] = (mask_scale / 2.0)
        else:
            if ('scale' not in head_pos):
                head_pos['scale'] = (0.85 / (pos.max(axis=0) - pos.min(axis=0)))
            pos *= head_pos['scale']
            outlines_dict['autoshrink'] = True
            outlines_dict['mask_pos'] = (head_x, head_y)
            outlines_dict['clip_radius'] = (0.5, 0.5)
        outlines = outlines_dict
    elif isinstance(outlines, dict):
        if ('mask_pos' not in outlines):
            raise ValueError('You must specify the coordinates of the imagemask')
    else:
        raise ValueError('Invalid value for `outlines')
    return (pos, outlines)

dataset/ETHPy150Open mne-tools/mne-python/mne/viz/topomap.py _check_outlines/VarMisuse@24/48 `pos`->`nose_y`