def get_label_from_id_name(self, label_info_dict, key_name=None, label_prefix='', non_formatted=False):
        """
        Expects a dict in one of 2 formats (where key_name is "status"):
            Format 1:
            "status": { "id": 1, "name": "New"  },
        
            Format 2:
            { "id":3, "name":"UX/UI Component"}
            
        """
        if not type(label_info_dict) is dict:
            return None
        
        # For Format 1 above
        if key_name is not None:
            label_info_dict = label_info_dict.get(key_name, None)
            if label_info_dict is None:
                return None
        
        if label_info_dict.has_key('id') and label_info_dict.has_key('name'):
            if non_formatted:
                return label_info_dict['name']
                
            if label_prefix:
                return '%s %s' % (label_prefix, label_info_dict['name'])

            return label_info_dict['name']
        
        return None
dataset/ETHPy150Open IQSS/redmine2github/src/github_issues/label_helper.py/LabelHelper.get_label_from_id_name/original