def get_permissions_from_urls(urls):
 permissions = set()
 for url in urls:
  if (hasattr(url, 'permissions') and url.permissions):
   permissions.update(url.permissions)
 return permissions

def get_permissions_from_urls ( urls ) : permissions = set ( ) for url in urls : if ( hasattr ( url , 'permissions' ) and url . permissions ) : permissions . update ( url . permissions ) return permissions
return a set of permissions for a given iterable of urls .