def sanity_check_actions(actions_spec):
<EOL>actions = copy.deepcopy(actions_spec)<EOL>is_unique = ('<STR_LIT:type>' in actions)<EOL>if is_unique:<EOL><INDENT>actions = dict(action=actions)<EOL><DEDENT>for name, action in actions.items():<EOL><INDENT>if '<STR_LIT:type>' not in action:<EOL><INDENT>action['<STR_LIT:type>'] = '<STR_LIT:int>'<EOL><DEDENT>if action['<STR_LIT:type>'] == '<STR_LIT:int>':<EOL><INDENT>if '<STR_LIT>' not in action:<EOL><INDENT>raise TensorForceError("<STR_LIT>")<EOL><DEDENT><DEDENT>elif action['<STR_LIT:type>'] == '<STR_LIT:float>':<EOL><INDENT>if ('<STR_LIT>' in action) != ('<STR_LIT>' in action):<EOL><INDENT>raise TensorForceError("<STR_LIT>")<EOL><DEDENT><DEDENT>if '<STR_LIT>' not in action:<EOL><INDENT>action['<STR_LIT>'] = ()<EOL><DEDENT>if isinstance(action['<STR_LIT>'], int):<EOL><INDENT>action['<STR_LIT>'] = (action['<STR_LIT>'],)<EOL><DEDENT><DEDENT>return actions, is_unique<EOL>
Sanity checks an actions dict, used to define the action space for an MDP.
Throws an error or warns if mismatches are found.

Args:
    actions_spec (Union[None,dict]): The spec-dict to check (or None).

Returns: Tuple of 1) the action space desc and 2) whether there is only one component in the action space.