code: def get_names_in_namespace(namespace_id, offset=None, count=None, proxy=None, hostport=None):
      
      assert proxy or hostport, 'Need proxy or hostport'
      if proxy is None:
          proxy = connect_hostport(hostport)
  
      offset = 0 if offset is None else offset
      if count is None:
          # get all names in this namespace after this offset
          count = get_num_names_in_namespace(namespace_id, proxy=proxy, hostport=hostport)
          if json_is_error(count):
              return count
  
          count -= offset
  
      page_size = 100
      all_names = []
      while len(all_names) < count:
          request_size = page_size
          if count - len(all_names) < request_size:
              request_size = count - len(all_names)
  
          page = get_names_in_namespace_page(namespace_id, offset + len(all_names), request_size, proxy=proxy, hostport=hostport)
          if json_is_error(page):
              # error
              return page
  
          if len(page) > request_size:
              # error
              error_str = 'server replied too much data'
              return {'error': error_str, 'http_status': 503}
          elif len(page) == 0:
              # end-of-table
              break
  
          all_names += page
  
      return all_names[:count]
docs: Get all names in a namespace
      Returns the list of names on success
      Returns {'error': ..} on error