class_docstr: A timezone that has a variable offset from UTC
  
  The offset might change if daylight saving time comes into effect,
  or at a point in history when the region decides to change their
  timezone definition.
class_docstr_tok: ["A","timezone","that","has","a","variable","offset","from","UTC","The","offset","might","change","if","daylight","saving","time","comes","into","effect",",","or","at","a","point","in","history","when","the","region","decides","to","change","their","timezone","definition","."]
docstr: See datetime.tzinfo.utcoffset
  
  The is_dst parameter may be used to remove ambiguity during DST
  transitions.
  
  >>> from pytz import timezone
  >>> tz = timezone('America/St_Johns')
  >>> ambiguous = datetime(2009, 10, 31, 23, 30)
  
  >>> str(tz.utcoffset(ambiguous, is_dst=False))
  '-1 day, 20:30:00'
  
  >>> str(tz.utcoffset(ambiguous, is_dst=True))
  '-1 day, 21:30:00'
  
  >>> try:
  ...     tz.utcoffset(ambiguous)
  ... except AmbiguousTimeError:
  ...     print('Ambiguous')
  Ambiguous
docstr_tok: ["See","datetime.tzinfo.utcoffset","The","is_dst","parameter","may","be","used","to","remove","ambiguity","during","DST","transitions",".",">",">",">","from","pytz","import","timezone",">",">",">","tz","=","timezone","(","'America\/St_Johns","'",")",">",">",">","ambiguous","=","datetime","(","2009",",","10",",","31",",","23",",","30",")",">",">",">","str","(","tz.utcoffset","(","ambiguous",",","is_dst=False",")",")","'-1","day",",","20:30:00'",">",">",">","str","(","tz.utcoffset","(","ambiguous",",","is_dst=True",")",")","'-1","day",",","21:30:00'",">",">",">","try",":","...","tz.utcoffset","(","ambiguous",")","...","except","AmbiguousTimeError",":","...","print","(","'Ambiguous","'",")","Ambiguous"]
code: def utcoffset(self, dt, is_dst=None):
      """See datetime.tzinfo.utcoffset
  
      The is_dst parameter may be used to remove ambiguity during DST
      transitions.
  
      >>> from pytz import timezone
      >>> tz = timezone('America/St_Johns')
      >>> ambiguous = datetime(2009, 10, 31, 23, 30)
  
      >>> str(tz.utcoffset(ambiguous, is_dst=False))
      '-1 day, 20:30:00'
  
      >>> str(tz.utcoffset(ambiguous, is_dst=True))
      '-1 day, 21:30:00'
  
      >>> try:
      ...     tz.utcoffset(ambiguous)
      ... except AmbiguousTimeError:
      ...     print('Ambiguous')
      Ambiguous
  
      """
      if dt is None:
          return None
      elif dt.tzinfo is not self:
          dt = self.localize(dt, is_dst)
          return dt.tzinfo._utcoffset
      else:
          return self._utcoffset
  
imports: from datetime import datetime, timedelta, tzinfo
  from bisect import bisect_right
  import pytz
  from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
label_desc: Use image node_id 5 for calling the DstTzInfo obj's underlying member method code with example usage: obj.utcoffset(dt, is_dst) and returns: None, dt, self