def METHOD_NAME(name):
    """Returns a portmidi.Input instance for name."""
    for n in range(get_count()):
        i = portmidi.get_device_info(n)
        input_name = _decode_name(i.name)
        if i.isinput and input_name.startswith(name) and not i.isopen:
            return portmidi.Input(n)