code: def _str_to_time(self, str_value):
          
          match = self.rx_time.match(str_value.upper())
          if not match:
              return None
          try:
              gd = match.groupdict()
              hour = int(gd['hour'])
              minute = int(gd['minute'])
              second = int(gd['second'] or 0)
              if gd['tt'] == 'PM':
                  hour += 12
              return datetime.time(hour, minute, second)
          except (ValueError, TypeError):
              return None
docs: Parses a `hh:mm` or a `hh:mm pm` string into a time object.