Helper method for collection items

        :param item_type:
        :return:
12905
def create_for_collection_items(item_type, hint):
        
        # this leads to infinite loops
        # try:
        #     prt_type = get_pretty_type_str(item_type)
        # except:
        #     prt_type = str(item_type)
        return TypeInformationRequiredError("Cannot parse object of type {t} as a collection: this type has no valid "
                                            "PEP484 type hint about its contents: found {h}. Please use a standard "
                                            "PEP484 declaration such as Dict[str, Foo] or List[Foo]"
                                            "".format(t=str(item_type), h=hint))
322602
def data_items(self) -> typing.List[DataItem]:
        
        return [DataItem(data_item) for data_item in self.__document_model.data_items]
788405
def _batch_write_item(self, items):
        
        kwargs = {
            'RequestItems': {
                self.tablename: items,
            },
            'ReturnConsumedCapacity': self.return_capacity,
            'ReturnItemCollectionMetrics': self.return_item_collection_metrics,
        }
        return self.connection.call('batch_write_item', **kwargs)
987057
def index(self, item, **kwargs):
        # type: (Any, dict) -> int
        
        return list.index(self, self.ref(item), **kwargs)
263355
def display_items(self) -> typing.List[Display]:
        
        return [Display(display_item) for display_item in self.__document_model.display_items]
1237235
def item_at_line(root_item, line):
    
    previous_item = root_item
    item = root_item
    for item in get_item_children(root_item):
        if item.line > line:
            return previous_item
        previous_item = item
    else:
        return item
903757
def item_lister(command, _connection, page_size, page_number, sort_by,
    sort_order, item_class, result_set, **kwargs):
    
    # pylint: disable=R0913
    page = page_number
    while True:
        item_collection = _connection.get_list(command,
                                             page_size=page_size,
                                             page_number=page,
                                             sort_by=sort_by,
                                             sort_order=sort_order,
                                             item_class=item_class,
                                             **kwargs)
        result_set.total_count = item_collection.total_count
        result_set.page_number = page
        for item in item_collection.items:
            yield item
        if item_collection.total_count < 0 or item_collection.page_size == 0:
            break
        if len(item_collection.items) > 0:
            page += 1
        else:
            break
1091429
def founditem_view(request, item_id):
    
    founditem = get_object_or_404(FoundItem, id=item_id)
    return render(request, "itemreg/item_view.html", {"item": founditem, "type": "found"})
932851
def clean_item_no_list(i):
    
    itype = type(i)
    if itype == dict:
        return clean_dict(i, clean_item_no_list)
    elif itype == list:
        return clean_tuple(i, clean_item_no_list)
    elif itype == tuple:
        return clean_tuple(i, clean_item_no_list)
    elif itype == numpy.float32:
        return float(i)
    elif itype == numpy.float64:
        return float(i)
    elif itype == numpy.int16:
        return int(i)
    elif itype == numpy.uint16:
        return int(i)
    elif itype == numpy.int32:
        return int(i)
    elif itype == numpy.uint32:
        return int(i)
    elif itype == float:
        return i
    elif itype == str:
        return i
    elif itype == int:
        return i
    elif itype == bool:
        return i
    elif itype == type(None):
        return i
    logging.info("[2] Unable to handle type %s", itype)
    return None
1306519
def List(type='All'):
		
		r = clc.v1.API.Call('post','Queue/ListQueueRequests',{'ItemStatusType': Queue.item_status_type_map[type] })
		if int(r['StatusCode']) == 0:  return(r['Requests'])
1269128
def get(self, item_name):
		
		if self.prefix:
			item_name = self.prefix + self.seperator + item_name
		item_names = item_name.split(self.seperator)
		node = self._storage
		for item_name in item_names:
			node = node[item_name]
		return node
317748
def get(self, pk):
        
        for item in self.store.get(self.query_class):
            # coverts pk value to correct type
            pk = item.properties[item.pk].col_type(pk)
            if getattr(item, item.pk) == pk:
                return item
1286130
def array_item_type(type_):
    """"""
    if is_array(type_):
        type_ = remove_alias(type_)
        type_ = remove_cv(type_)
        return type_.base
    elif is_pointer(type_):
        return remove_pointer(type_)
    else:
        raise RuntimeError(
            "array_item_type functions takes as argument array or pointer " +
            "types")
1301264
def getItemType(self, itemID):
        

        collections = self.getAllItemTypes()

        for coll in collections:
            note = self.noteDB[coll].find_one({"ID": itemID})
            if note is not None:
                return coll
1216280
def infer_list_subtype(items):
        """"""
        subtype = End

        for item in items:
            item_type = type(item)
            if not issubclass(item_type, Base):
                continue

            if subtype is End:
                subtype = item_type
                if not issubclass(subtype, List):
                    return subtype
            elif subtype is not item_type:
                stype, itype = subtype, item_type
                generic = List
                while issubclass(stype, List) and issubclass(itype, List):
                    stype, itype = stype.subtype, itype.subtype
                    generic = List[generic]

                if stype is End:
                    subtype = item_type
                elif itype is not End:
                    return generic.subtype
        return subtype
309702
protected function prepareCollectionItem(array &$collection_item)
    {
        $item = $this->collection_item->getItem(array(
            'collection_item_id' => $collection_item['collection_item_id']));

        $collection_item['title'] = isset($item['title']) ? $item['title'] : '';
    }
1082869
def getItem(self, itemId):
        
        url = "%s/items/%s" % (self.root, itemId)
        return Item(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port)