def _friendly_name_to_mate(module_name):
    """Slightly hacky code to convert friendly mo.objects names to the mate4dummies mo.mate format"""
    all_modules = {'channel': '_Channel', 'clock': '_Clock', 'experiment':
        '_Experiment', 'gap_voltage_control': '_GapVoltageControl', 'pll':
        '_PLLControl', 'piezo_control': '_PiezoControl', 'regulator':
        '_Regulator', 'view': '_View', 'xy_scanner': '_XYScanner',
        'spectroscopy': '_Spectroscopy'}
    if module_name in all_modules.keys():
        mate_name = all_modules[module_name]
    elif module_name in all_modules.values():
        mate_name = module_name
    else:
        raise ValueError(
            f'Requested module {module_name} must be one of {all_modules.keys()}'
            )
    return mate_name
