@staticmethod
    def _construct_params(entity, include, full, page_limit,
                          page_offset, sort_by, parent, query):
        if entity is not None:
            params = {}
        else:
            params = {'page_limit': page_limit,
                      'page_offset': page_offset,
                      'sort_by': sort_by,
                      'parent': parent,
                      'q': query, }

        # include can be either a string (e.g. 'advertiser'),
        # list of *non-traversable* relations (e.g. ['vendor', 'concept']),
        # or a list of lists/strings of traversable elements, e.g.
        # [['advertiser', 'agency'], 'vendor'],
        # [['advertiser', 'agency'], ['vendor', 'vendor_domains']]
        # If we're given a string, leave it as-is
        # If we're given a list, for each element:
        # -> If the item is a string, leave it as-is
        # -> If the item is a list, comma-join it
        # Examples from above:
        # include='advertiser' -> with=advertiser
        # include=['vendor', 'concept'] -> with=vendor&with=concept
        # include=[['advertiser', 'agency'], 'vendor']
        # -> with=advertiser,agency&with=vendor
        # include=[['advertiser', 'agency'], ['vendor', 'vendor_domains']]
        # -> with=advertiser,agency&with=vendor,vendor_domains
        if include is not None:
            if isinstance(include, list):
                for i, item in enumerate(include):
                    if isinstance(item, list):
                        include[i] = ','.join(item)
            params['with'] = include

        if isinstance(full, list):
            params['full'] = ','.join(full)
        elif full is True:
            params['full'] = '*'
        elif full is not None:
            params['full'] = full

        return params
Construct URL params
dataset/ETHPy150Open MediaMath/t1-python/terminalone/service.py/T1._construct_params