EXPECTING A is_data(relation) THAT MAPS VALUES TO lists
    THE LISTS ARE EXPECTED TO POINT TO MEMBERS OF A SET
    A set() IS RETURNED
6760
def map2set(data, relation):
    
    if data == None:
        return Null
    if isinstance(relation, Data):
        Log.error("Does not accept a Data")

    if is_data(relation):
        try:
            # relation[d] is expected to be a list
            # return set(cod for d in data for cod in relation[d])
            output = set()
            for d in data:
                for cod in relation.get(d, []):
                    output.add(cod)
            return output
        except Exception as e:
            Log.error("Expecting a dict with lists in codomain", e)
    else:
        try:
            # relation[d] is expected to be a list
            # return set(cod for d in data for cod in relation[d])
            output = set()
            for d in data:
                cod = relation(d)
                if cod == None:
                    continue
                output.add(cod)
            return output
        except Exception as e:
            Log.error("Expecting a dict with lists in codomain", e)
    return Null
842480
def _is_nested(self, name, relation):
        
        dots = name.find(".")

        return dots and name.startswith(relation + ".")
402031
protected final Set<?> set(Object... datas) {
    Set<Object> items = CollectUtils.newHashSet();
    for (Object obj : datas) {
      if (obj instanceof Class<?>) {
        items.add(buildInnerReference((Class<?>) obj));
      } else {
        items.add(obj);
      }
    }
    return items;
  }
1007460
def has_data(self, datatype, mode, disp):
        

        # Imports
        from ..error import RepoError

        # Just try to get the data. Simply pass up all exceptions except for
        #  those if the group or data doesn't exist. DO re-raise a non-bound
        #  repo. Initialize value to DATA PRESENT (True) for case where data
        #  is present and the 'try' succeeds.
        retval = True
        try:
            self.get_data(datatype, mode, disp)
        except RepoError as RErr:
            if RErr.tc in (RErr.DATA, RErr.GROUP):
                retval = False
            ## end if
        ## end try

        # Should be good to return
        return retval
1364663
def issubset(list1, list2):
    
    n = len(list1)
    for startpos in range(len(list2) - n + 1):
        if list2[startpos:startpos+n] == list1:
            return True
    return False
689067
def map_collection(func, collection):
    
    datatype = type(collection)
    if isinstance(collection, Mapping):
        return datatype((key, func(val)) for key, val in collection.items())
    if is_string(collection):
        return collection
    elif isinstance(collection, Iterable):
        return datatype(map(func, collection))
    else:
        return collection
195974
def is_relation_made(relation, keys='private-address'):
    '''
    
    '''
    if isinstance(keys, str):
        keys = [keys]
    for r_id in relation_ids(relation):
        for unit in related_units(r_id):
            context = {}
            for k in keys:
                context[k] = relation_get(k, rid=r_id,
                                          unit=unit)
            if None not in context.values():
                return True
    return False
1306485
function _isList(gqlTye) {
  if (gqlTye instanceof GraphQLList) {
    return true;
  }

  if (gqlTye instanceof GraphQLNonNull) {
    return _isList(gqlTye.ofType);
  }

  return false;
}
947201
def mapping_of(cls):
    """"""
    def mapper(data):
        if not isinstance(data, Mapping):
            raise TypeError(
                "data must be a mapping, not %s"
                % type(data).__name__)
        return {
            key: cls(value)
            for key, value in data.items()
        }
    return mapper
1016812
def is_set(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], set)
1203197
def parse_list(cls, data):
        """"""
        results = ResultSet()
        data = data or []
        for obj in data:
            if obj:
                results.append(cls.parse(obj))
        return results
824473
def set_data_from_iterable(self, frames, values, labels=None):
        
        if not isinstance(frames, collections.Iterable):
            raise TypeError, "frames must be an iterable"
        if not isinstance(values, collections.Iterable):
            raise TypeError, "values must be an iterable"
        assert(len(frames) == len(values))
        self.frames = frames
        self.values = values
        if labels is None:
            self.label2int['New Point'] = 0
            self.int2label[0] = 'New Point'
            self.labels = [0 for i in xrange(len(frames))]
        else:
            if not isinstance(labels, collections.Iterable):
                raise TypeError, "labels must be an iterable"
            for l in labels:
                if l not in self.label2int:
                    self.label2int[l] = len(self.label2int)
                    self.int2label[len(self.int2label)] = l
                self.labels.append(self.label2int[l])
21910
def handle_has_members(self, _, __, tokens: ParseResults) -> ParseResults:
        """"""
        return self._handle_list_helper(tokens, HAS_MEMBER)
1118070
def coord_list_mapping(subset, superset, atol=1e-8):
    
    c1 = np.array(subset)
    c2 = np.array(superset)
    inds = np.where(np.all(np.isclose(c1[:, None, :], c2[None, :, :], atol=atol),
                           axis=2))[1]
    result = c2[inds]
    if not np.allclose(c1, result, atol=atol):
        if not is_coord_subset(subset, superset):
            raise ValueError("subset is not a subset of superset")
    if not result.shape == c1.shape:
        raise ValueError("Something wrong with the inputs, likely duplicates "
                         "in superset")
    return inds
318284
def as_set(obj):
    
    if obj is None or isinstance(obj, collections.Set):
        return obj

    if not isinstance(obj, collections.Iterable):
        return set((obj,))
    else:
        return set(obj)
600467
def _members(self):
        
        return {
            key: value
            for key, value in self.__dict__.items()
            # NB: ignore internal SQLAlchemy state and nested relationships
            if not key.startswith("_") and not isinstance(value, Model)
        }
176444
function isSubSet (aTestArray, aRefArray) {
		function isOutsideSet(sTestValue) {
			return aRefArray.indexOf(sTestValue) < 0; // value is not part of the reference set
		}
		return aTestArray && aRefArray && !aTestArray.some(isOutsideSet);
	}