code: def topports(sort_by='records', limit=10, date=None, return_format=None):
      uri = '/'.join(['topports', sort_by, str(limit)])
      if date:
          try:
              uri = '/'.join([uri, date.strftime("%Y-%m-%d")])
          except AttributeError:
              uri = '/'.join([uri, date])
      return _get(uri, return_format)