parameters: (self, dt)
return_statement: return dt + dtdst
docstring: datetime in UTC -> datetime in local time.
docstring_summary: datetime in UTC -> datetime in local time.
docstring_tokens: datetime in UTC - > datetime in local time .
function: def fromutc(self, dt):
          "datetime in UTC -> datetime in local time."
  
          if not isinstance(dt, datetime):
              raise TypeError("fromutc() requires a datetime argument")
          if dt.tzinfo is not self:
              raise ValueError("dt.tzinfo is not self")
  
          dtoff = dt.utcoffset()
          if dtoff is None:
              raise ValueError("fromutc() requires a non-None utcoffset() "
                               "result")
  
          # See the long comment block at the end of this file for an
          # explanation of this algorithm.
          dtdst = dt.dst()
          if dtdst is None:
              raise ValueError("fromutc() requires a non-None dst() result")
          delta = dtoff - dtdst
          if delta:
              dt += delta
              dtdst = dt.dst()
              if dtdst is None:
                  raise ValueError("fromutc(): dt.dst gave inconsistent "
                                   "results; cannot convert")
          return dt + dtdst
function_tokens: def fromutc ( self , dt ) : if not isinstance ( dt , datetime ) : raise TypeError ( "fromutc() requires a datetime argument" ) if dt . tzinfo is not self : raise ValueError ( "dt.tzinfo is not self" ) dtoff = dt . utcoffset ( ) if dtoff is None : raise ValueError ( "fromutc() requires a non-None utcoffset() " "result" ) # See the long comment block at the end of this file for an # explanation of this algorithm. dtdst = dt . dst ( ) if dtdst is None : raise ValueError ( "fromutc() requires a non-None dst() result" ) delta = dtoff - dtdst if delta : dt += delta dtdst = dt . dst ( ) if dtdst is None : raise ValueError ( "fromutc(): dt.dst gave inconsistent " "results; cannot convert" ) return dt + dtdst