'Bind the presence of the instance(s) to another instance
@param table: table name of the other resource
@param record: record in the other resource (as Row or record ID)
@param timestmp: datetime of the check-in
@return: nothing'

def check_in(self, table, record, timestmp=None):

    db = current.db
    s3db = current.s3db
    ptable = s3db[PRESENCE]
    if isinstance(table, str):
        table = s3db[table]
    fields = self.__get_fields(table)
    if (not fields):
        raise SyntaxError(('No    location    data    in    %s' % table._tablename))
    interlock = None
    if isinstance(record, Rows):
        record = record.first()
    if (not isinstance(record, Row)):
        record = table[record]
    if self.__super_entity(record):
        table = s3db[record.instance_type]
        fields = self.__get_fields(table, super_entity=False)
        if (not fields):
            raise SyntaxError(('No    trackable    type:    %s' % table._tablename))
        query = (table[UID] == record[UID])
        record = db(query).select(limitby=(0, 1)).first()
    if (record and (table._id.name in record)):
        record = record[table._id.name]
        if record:
            interlock = ('%s,%s' % (table, record))
    else:
        raise SyntaxError(('No    record    specified    for    %s' % table._tablename))
    if interlock:
        if (timestmp is None):
            timestmp = datetime.utcnow()
        data = dict(location_id=None, timestmp=timestmp, interlock=interlock)
        q = ((ptable.deleted == False) & (ptable.timestmp <= timestmp))
        for r in self.records:
            if (TRACK_ID not in r):
                continue
            query = (q & (ptable[TRACK_ID] == r[TRACK_ID]))
            presence = db(query).select(orderby=(~ ptable.timestmp), limitby=(0, 1)).first()
            if (presence and (presence.interlock == interlock)):
                continue
            data.update({TRACK_ID: r[TRACK_ID]})
            ptable.insert(**data)
            self.__update_timestamp(r[TRACK_ID], timestmp)
