def MakeMetadataDict(self, post, user_post, user_photo):
    ph_dict = self._asdict()
    labels = post.labels.combine()
    if user_post is not None:
      labels = labels.union(user_post.labels.combine())
    asset_keys = set()
    if user_photo is not None and user_photo.asset_keys:
      asset_keys.update(user_photo.asset_keys)
    if asset_keys:
      ph_dict['asset_keys'] = list(UserPhoto.MakeAssetFingerprintSet(asset_keys))
    if len(labels) > 0:
      ph_dict['labels'] = list(labels)
    ph_dict.pop('client_data', None)
    return ph_dict
Test if the `sub` string is in the `url` path.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/photo.py/Photo.MakeMetadataDict--crossover with--dataset/ETHPy150Open openstack/django_openstack_auth/openstack_auth/utils.py/has_in_url_path