def user_agent_from_type()

in identity-resolution/notebooks/identity-graph/nepytune/cli/add.py [0:0]


    def user_agent_from_type(self, type_):
        """Given type, generate appropriate user agent."""
        while True:
            user_agent = self.user_agent()
            if type_ == "device":
                if "Mobile" in user_agent:
                    return user_agent
            elif type_ == "cookie":
                if "Mobile" not in user_agent:
                    return user_agent
            else:
                raise ValueError(f"Unsupported {type_}")