(select=None, deselect=None)
return ret
Change the "selected" field of blocks in the DB based on poll_ids,
    or lists of block ObjectIDs.

    :param select: A Poll ID or list of block IDs for which "selected"
                   should be set to True.
    :type select: list or str
    :param deselect: A Poll ID or list of block IDs for which "selected"
                     should be set to False.
    :type deselect: list or str
    :returns: dict with keys:
              "success" (bool) - DB Update Pass/Fail
              "msg" (str) - Failure message
Change the "selected" field of blocks in the DB based on poll_ids,
    or lists of block ObjectIDs.
Change the selected field of blocks in the DB based on poll_ids or lists of block ObjectIDs .
def select_blocks(select=None, deselect=None):
    """
    Change the "selected" field of blocks in the DB based on poll_ids,
    or lists of block ObjectIDs.

    :param select: A Poll ID or list of block IDs for which "selected"
                   should be set to True.
    :type select: list or str
    :param deselect: A Poll ID or list of block IDs for which "selected"
                     should be set to False.
    :type deselect: list or str
    :returns: dict with keys:
              "success" (bool) - DB Update Pass/Fail
              "msg" (str) - Failure message
    """
    ret = {'success': True, 'msg': ''}
    tc = taxii.TaxiiContent
    try:
        if isinstance(select, list) and select:
            tc.objects(id__in=select).update(set__selected=True)
        elif isinstance(select, basestring) and select:
            p_time = datetime.utcfromtimestamp(float(select))
            tc.objects(poll_time=p_time).update(set__selected=True)
        if isinstance(deselect, list) and deselect:
            tc.objects(id__in=deselect).update(set__selected=False)
        elif isinstance(deselect, basestring) and deselect:
            p_time = datetime.utcfromtimestamp(float(deselect))
            tc.objects(poll_time=p_time).update(set__selected=False)
    except Exception as e:
        ret['success'] = False
        ret['msg'] = str(e)
    return ret
def select_blocks ( select = None , deselect = None ) : ret = { 'success' : True , 'msg' : '' } tc = taxii . TaxiiContent try : if isinstance ( select , list ) and select : tc . objects ( id__in = select ) . update ( set__selected = True ) elif isinstance ( select , basestring ) and select : p_time = datetime . utcfromtimestamp ( float ( select ) ) tc . objects ( poll_time = p_time ) . update ( set__selected = True ) if isinstance ( deselect , list ) and deselect : tc . objects ( id__in = deselect ) . update ( set__selected = False ) elif isinstance ( deselect , basestring ) and deselect : p_time = datetime . utcfromtimestamp ( float ( deselect ) ) tc . objects ( poll_time = p_time ) . update ( set__selected = False ) except Exception as e : ret [ 'success' ] = False ret [ 'msg' ] = str ( e ) return ret