code: def expand_url(status):
      
  
      try:
          txt = get_full_text(status)
          for url in status.entities['urls']:
              txt = txt.replace(url['url'], url['expanded_url'])
      except:
          # Manually replace
          txt = status
          tco_pattern = re.compile(r'https://t.co/\S+')
          urls = tco_pattern.findall(txt)
          for url in urls:
              with urlopen(url) as resp:
                  expanded_url = resp.url
              txt = txt.replace(url, expanded_url)
  
      return txt
docs: Expand url on statuses.
  
      :param status: A tweepy status to expand urls.
      :type status: :class:`tweepy.models.Status`
      :returns: A string with expanded urls.
      :rtype: :class:`str`