(choice_opts, item, _type)
return ret_opts
Given a list of CRITs options, filter out options matching the given item
    and format those options for display as a choice in a multi-select box.

    :param choice_opts A dict of CRITs objects in (id, json_repr) format
    :param item The item being viewed for TAXII service
    :param _type The type of objects represented in the choice_opts dict
Given a list of CRITs options, filter out options matching the given item
    and format those options for display as a choice in a multi-select box.
Given a list of CRITs options filter out options matching the given item and format those options for display as a choice in a multi - select box .
def filter_and_format_choices(choice_opts, item, _type):
    """
    Given a list of CRITs options, filter out options matching the given item
    and format those options for display as a choice in a multi-select box.

    :param choice_opts A dict of CRITs objects in (id, json_repr) format
    :param item The item being viewed for TAXII service
    :param _type The type of objects represented in the choice_opts dict
    """

    from .handlers import has_cybox_repr

    ret_opts = [] # return storage array
    item_type = item._meta['crits_type'] # get the type of the subject
    choice_fmt = formats.get_format(_type) # get formatting option for current CRITs type
    ind_crits_type = class_from_type("Indicator")._meta['crits_type']
    for choice in choice_opts:
        obj = choice_opts.get(choice)[1]
        if _type == ind_crits_type and not has_cybox_repr(obj):
            # this indicator can't currently be converted to CybOX, so don't offer as option in UI
            continue
        if item.id != obj.id or item_type != _type:
            # only process if the item isn't the current context crits item
            ret_opts.append((choice, choice_fmt.format(obj).encode('utf-8')))
    return ret_opts
def filter_and_format_choices ( choice_opts , item , _type ) : from . handlers import has_cybox_repr ret_opts = [ ] # return storage array item_type = item . _meta [ 'crits_type' ] # get the type of the subject choice_fmt = formats . get_format ( _type ) # get formatting option for current CRITs type ind_crits_type = class_from_type ( "Indicator" ) . _meta [ 'crits_type' ] for choice in choice_opts : obj = choice_opts . get ( choice ) [ 1 ] if _type == ind_crits_type and not has_cybox_repr ( obj ) : # this indicator can't currently be converted to CybOX, so don't offer as option in UI continue if item . id != obj . id or item_type != _type : # only process if the item isn't the current context crits item ret_opts . append ( ( choice , choice_fmt . format ( obj ) . encode ( 'utf-8' ) ) ) return ret_opts