def assoc(objects, sitecol, assoc_dist, mode, asset_refs=()):
    """
    Associate geographic objects to a site collection.

    :param objects:
        something with .lons, .lats or ['lon'] ['lat'], or a list of lists
        of objects with a .location attribute (i.e. assets_by_site)
    :param assoc_dist:
        the maximum distance for association
    :param mode:
        if 'strict' fail if at least one site is not associated
        if 'error' fail if all sites are not associated
    :returns: (filtered site collection, filtered objects)
    """
    if isinstance(objects, numpy.ndarray) or hasattr(objects, 'lons'):
        # objects is a geo array with lon, lat fields or a mesh-like instance
        return _GeographicObjects(objects).assoc(sitecol, assoc_dist, mode)
    else:  # objects is the list assets_by_site
        return _GeographicObjects(sitecol).assoc2(
            objects, assoc_dist, mode, asset_refs)
def assoc ( objects , sitecol , assoc_dist , mode , asset_refs = ( ) ) : if isinstance ( objects , numpy . ndarray ) or hasattr ( objects , 'lons' ) : return _GeographicObjects ( objects ) . assoc ( sitecol , assoc_dist , mode ) else : return _GeographicObjects ( sitecol ) . assoc2 ( objects , assoc_dist , mode , asset_refs )
Associate geographic objects to a site collection.

    :param objects:
        something with .lons, .lats or ['lon'] ['lat'], or a list of lists
        of objects with a .location attribute (i.e. assets_by_site)
    :param assoc_dist:
        the maximum distance for association
    :param mode:
        if 'strict' fail if at least one site is not associated
        if 'error' fail if all sites are not associated
    :returns: (filtered site collection, filtered objects)