<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set(self, instance, value, **kw):
 """ Set Analyses to an AR :param instance: Analysis Request :param value: Single AS UID or a list of dictionaries containing AS UIDs :param kw: Additional keyword parameters passed to the field """


        if not isinstance(value, (list, tuple)):
            value = [value]

        uids = []
        for item in value:
            uid = None
            if isinstance(item, dict):
                uid = item.get("uid")
            if api.is_uid(value):
                uid = item
            if uid is None:
                logger.warn("Could extract UID of value")
                continue
            uids.append(uid)

        analyses = map(api.get_object_by_uid, uids)
        self._set(instance, analyses, **kw)