code: def maybe_infer_tz(tz, inferred_tz):
      
      if tz is None:
          tz = inferred_tz
      elif inferred_tz is None:
          pass
      elif not timezones.tz_compare(tz, inferred_tz):
          raise TypeError('data is already tz-aware {inferred_tz}, unable to '
                          'set specified tz: {tz}'
                          .format(inferred_tz=inferred_tz, tz=tz))
      return tz
docs: If a timezone is inferred from data, check that it is compatible with
      the user-provided timezone, if any.
  
      Parameters
      ----------
      tz : tzinfo or None
      inferred_tz : tzinfo or None
  
      Returns
      -------
      tz : tzinfo or None
  
      Raises
      ------
      TypeError : if both timezones are present but do not match