@staticmethod
    def _construct_url(collection, entity, child, limit):
        """Construct URL"""
        url = [collection, ]
        if entity is not None:
            url.append(str(entity))  # str so that we can use join

        child_id = None
        if child is not None:
            try:
                child_path = CHILD_PATHS[child.lower()]
            except AttributeError:
                raise ClientError("`child` must be a string of the entity to retrieve")
            except __HOLE__:
                raise ClientError("`child` must correspond to an entity in T1")
            # child_path should always be a tuple of (path, id). For children
            # that do not have IDs, like concepts and permissions, ID is 0
            if child_path[1]:
                child_id = child_path[1]
                url.append(child_path[0])
                # All values need to be strings for join
                url.append(str(child_path[1]))
            else:
                url.append(child_path[0])

        if isinstance(limit, dict):
            if len(limit) != 1:
                raise ClientError('Limit must consist of one parent collection '
                                  '(or chained parent collection) and a single '
                                  'value for it (e.g. {"advertiser": 1}, or '
                                  '{"advertiser.agency": 2)')
            url.extend(['limit',
                        '{0!s}={1:d}'.format(*next(six.iteritems(limit)))])

        return '/'.join(url), child_id
dataset/ETHPy150Open MediaMath/t1-python/terminalone/service.py/T1._construct_url