def _get_attention_cell(attention_cell, units=None,<EOL>scaled=True, num_heads=None,<EOL>use_bias=False, dropout=<NUM_LIT:0.0>):
if isinstance(attention_cell, str):<EOL><INDENT>if attention_cell == '<STR_LIT>':<EOL><INDENT>return DotProductAttentionCell(units=units, scaled=True, normalized=False,<EOL>use_bias=use_bias, dropout=dropout, luong_style=True)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>return DotProductAttentionCell(units=units, scaled=True, normalized=False,<EOL>use_bias=use_bias, dropout=dropout, luong_style=False)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>return DotProductAttentionCell(units=units, scaled=False, normalized=False,<EOL>use_bias=use_bias, dropout=dropout, luong_style=False)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>return DotProductAttentionCell(units=units, scaled=False, use_bias=use_bias,<EOL>dropout=dropout, normalized=True)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>return MLPAttentionCell(units=units, normalized=False)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>return MLPAttentionCell(units=units, normalized=True)<EOL><DEDENT>elif attention_cell == '<STR_LIT>':<EOL><INDENT>base_cell = DotProductAttentionCell(scaled=scaled, dropout=dropout)<EOL>return MultiHeadAttentionCell(base_cell=base_cell, query_units=units, use_bias=use_bias,<EOL>key_units=units, value_units=units, num_heads=num_heads)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError<EOL><DEDENT><DEDENT>else:<EOL><INDENT>assert isinstance(attention_cell, AttentionCell),'<STR_LIT>'.format(attention_cell)<EOL>return attention_cell<EOL><DEDENT>
Parameters
----------
attention_cell : AttentionCell or str
units : int or None

Returns
-------
attention_cell : AttentionCell