class_docstr: Base class for all ``dateutil`` ``tzinfo`` objects.
docstr: Given a timezone-aware datetime in a given timezone, calculates a
  timezone-aware datetime in a new timezone.
  
  Since this is the one time that we *know* we have an unambiguous
  datetime object, we take this opportunity to determine whether the
  datetime is ambiguous and in a "fold" state (e.g. if it's the first
  occurrence, chronologically, of the ambiguous datetime).
  
  :param dt:
      A timezone-aware :class:`datetime.datetime` object.
docstr_tok: ["Given","a","timezone-aware","datetime","in","a","given","timezone",",","calculates","a","timezone-aware","datetime","in","a","new","timezone",".","Since","this","is","the","one","time","that","we","*","know","*","we","have","an","unambiguous","datetime","object",",","we","take","this","opportunity","to","determine","whether","the","datetime","is","ambiguous","and","in","a","``","fold","''","state","(","e.g",".","if","it","'s","the","first","occurrence",",","chronologically",",","of","the","ambiguous","datetime",")",".",":","param","dt",":","A","timezone-aware",":","class",":","`","datetime.datetime","`","object","."]
code: def _fromutc(self, dt):
      """
      Given a timezone-aware datetime in a given timezone, calculates a
      timezone-aware datetime in a new timezone.
  
      Since this is the one time that we *know* we have an unambiguous
      datetime object, we take this opportunity to determine whether the
      datetime is ambiguous and in a "fold" state (e.g. if it's the first
      occurrence, chronologically, of the ambiguous datetime).
  
      :param dt:
          A timezone-aware :class:`datetime.datetime` object.
      """
  
      # Re-implement the algorithm from Python's datetime.py
      dtoff = dt.utcoffset()
      if dtoff is None:
          raise ValueError(
              "fromutc() requires a non-None utcoffset() " "result"
          )
  
      # The original datetime.py code assumes that `dst()` defaults to
      # zero during ambiguous times. PEP 495 inverts this presumption, so
      # for pre-PEP 495 versions of python, we need to tweak the algorithm.
      dtdst = dt.dst()
      if dtdst is None:
          raise ValueError("fromutc() requires a non-None dst() result")
      delta = dtoff - dtdst
  
      dt += delta
      # Set fold=1 so we can default to being in the fold for
      # ambiguous dates.
      dtdst = enfold(dt, fold=1).dst()
      if dtdst is None:
          raise ValueError(
              "fromutc(): dt.dst gave inconsistent "
              "results; cannot convert"
          )
      return dt + dtdst
  
imports: from six import PY2
  from functools import wraps
  from datetime import datetime, timedelta, tzinfo
label_desc: Use image node_id 4 for calling the _tzinfo obj's underlying member method code with example usage: obj._fromutc(dt) and returns: unknown