<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_baremetal_switch_info(self, link_info):
 """Get switch_info dictionary from context."""


        try:
            switch_info = link_info['switch_info']
            if not isinstance(switch_info, dict):
                switch_info = jsonutils.loads(switch_info)
        except Exception as e:
            LOG.error("switch_info can't be decoded: %(exp)s",
                      {"exp": e})
            switch_info = {}

        return switch_info