<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_attention(config: AttentionConfig, max_seq_len: int, prefix: str = C.ATTENTION_PREFIX) -> 'Attention': """ Returns an Attention instance based on attention_type. :param config: Attention configuration. :param max_seq_len: Maximum length of source sequences. :param prefix: Name prefix. :return: Instance of Attention. """


    att_cls = Attention.get_attention_cls(config.type)
    params = config.__dict__.copy()
    params.pop('_frozen')
    params['max_seq_len'] = max_seq_len
    params['prefix'] = prefix
    return _instantiate(att_cls, params)