Returns a description for an array's items.

    :param item: The Array type whose items should be documented.
    :returns: A string documenting what type the array's items should be.
178422
def get_array_items_description(item: Array) -> str:
    
    desc = ''
    if isinstance(item.items, list):
        # This means the type has a list of types where each position is
        # mapped to a different type.  Document what each type should be.
        desc = ''
        item_pos_template = (
            ' *Item {pos} must be*: {description}{enum}{ref}')
        for pos, item in enumerate(item.items):
            _enum = ''
            ref = ''
            if issubclass(item, Enum):
                _enum = ' Must be one of: `{}`'.format(item.enum)
                if item.case_insensitive:
                    _enum += ' (case-insensitive)'
                _enum += '.'
            elif issubclass(item, Object):
                ref = get_object_reference(item)

            desc += item_pos_template.format(
                pos=pos, description=item.description, enum=_enum,
                ref=ref)

    else:
        # Otherwise just document the type assigned to `items`.
        desc = item.items.description
        _enum = ''
        ref = ''
        if issubclass(item.items, Enum):
            _enum = ' Must be one of: `{}`'.format(
                item.items.enum)
            if item.items.case_insensitive:
                _enum += ' (case-insensitive)'
            _enum += '.'
        elif issubclass(item.items, Object):
            ref = get_object_reference(item.items)
        desc = '  *Items must be*: {description}{enum}{ref}'.format(
            description=desc, enum=_enum, ref=ref)
    return desc
325896
public function __item($item = null)
    {
        $result['name'] = $this->getName();
        $result['content'] = '0';
        $result['active'] = is_null($item) ? true : $item['active'];
        $result['settings'] = Eresus_CMS::getLegacyKernel()->db->
            escape(is_null($item) ? encodeOptions($this->settings) : $item['settings']);
        $result['title'] = $this->title;
        $result['version'] = $this->version;
        $result['description'] = $this->description;
        return $result;
    }
999530
def itemize(data):
    
    if isinstance(data, dict):
        ret = {}
        for key in data:
            ret[key] = itemize(data[key])
        return ret
    elif isinstance(data, list):
        return {'item': [itemize(value) for value in data]}
    else:
        return data
1114007
def _extract_item(self, item):
        
        ver = 0
        if isinstance(item, tuple):
            ver_sent = True
            nitem = len(item)
            if nitem == 1:
                ext = item[0]
            elif nitem == 2:
                ext, ver = item
        else:
            ver_sent = False
            ext = item
        return ext, ver, ver_sent
513872
def _getitem(item, i):
    
    if not isinstance(i, (tuple, list)):
        return item.get(i, _none)
    type_ = list if isinstance(item, list) else tuple
    return type_(item.get(j, _none) for j in i)
1211054
private function getDataFromItem($item)
    {
        if (!is_object($item) && !is_array($item)) {
            return array();
        }

        return is_object($item) ? get_object_vars($item) : $item;
    }
1191435
def items(iterable):
    
    if hasattr(iterable, 'iteritems'):
        return (p for p in iterable.iteritems())
    elif hasattr(iterable, 'items'):
        return (p for p in iterable.items())
    else:
        return (p for p in enumerate(iterable))
239746
def phys_name(self, item: str) -> str:
        
        v = self.__dict__[item]
        return v if v is not None else item
132104
def to_list(item_or_list):
    
    if isinstance(item_or_list, list):
        return item_or_list
    elif isinstance(item_or_list, (str, bytes)):
        return [item_or_list]
    elif isinstance(item_or_list, Iterable):
        return list(item_or_list)
    else:
        return [item_or_list]
46390
def _get_description(string):
    
    ann = set()
    if not string:
        return "This cluster is inter-genic."
    for item in string:
        for db in item:
            ann = ann.union(set(item[db]))
    return "annotated as: %s ..." % ",".join(list(ann)[:3])
590141
def _get_array_serializer(self):
        
        if not self._items:
            raise ValueError('Must specify \'items\' for \'array\' type')

        field = SchemaField(self._items)

        def encode(value, field=field):
            if not isinstance(value, list):
                value = [value]

            return [field.encode(i) for i in value]

        def decode(value, field=field):
            return [field.decode(i) for i in value]

        return (encode, decode)
1216635
def _deserialize_list(cls, type_item, list_):
        

        list_deserialized = []

        for item in list_:
            item_deserialized = cls.deserialize(type_item, item)
            list_deserialized.append(item_deserialized)

        return list_deserialized
289963
def _api_config_item(self, item):
        
        response.content_type = 'application/json; charset=utf-8'

        config_dict = self.config.as_dict()
        if item not in config_dict:
            abort(400, "Unknown configuration item %s" % item)

        try:
            # Get the JSON value of the config' dict
            args_json = json.dumps(config_dict[item])
        except Exception as e:
            abort(404, "Cannot get config item (%s)" % str(e))
        return args_json
178318
def match(self, item):
        
        result = self._value == getattr(item, self._name)
        #log.debug("%r for %r = %r, name %r, item %r" % (
        #    result, getattr(item, self._name), self._value, self._name, item))
        return result
494863
def info(self):
        """"""
        itext = self.class_info
        if self.prop.info:
            itext += ' (each item is {})'.format(self.prop.info)
        if self.max_length is None and self.min_length is None:
            return itext
        if self.max_length is None:
            lentext = 'length >= {}'.format(self.min_length)
        elif self.max_length == self.min_length:
            lentext = 'length of {}'.format(self.min_length)
        else:
            lentext = 'length between {mn} and {mx}'.format(
                mn='0' if self.min_length is None else self.min_length,
                mx=self.max_length,
            )
        return '{} with {}'.format(itext, lentext)
811123
function(item){
    var children,node, nodes;
    if(!item) return;
    if(typeof item.node === "function") return item.node();
    if(typeof item.nodeType === "number") return item;
    if(item.group) return combine.node(item.group)

    item = item.children || item;
    if( Array.isArray(item )){
      var len = item.length;
      if(len === 1){
        return combine.node(item[0]);
      }
      nodes = [];
      for(var i = 0, len = item.length; i < len; i++ ){
        node = combine.node(item[i]);
        if(Array.isArray(node)){
          for (var j = 0, len1 = node.length; j < len1; j++){
            nodes.push(node[j])
          }
        }else if(node) {
          nodes.push(node)
        }
      }
      return nodes;
    }
    
  }
1176226
def _format_obj(self, item=None):
        
        # Order here matters, odd behavior with tuples
        if item is None:
            return getattr(self, 'number')(item)
        elif isinstance(item, self.str_):
            #: String
            return item + " "
        elif isinstance(item, bytes):
            #: Bytes
            return getattr(self, 'bytes')(item)
        elif isinstance(item, self.numeric_):
            #: Float, int, etc.
            return getattr(self, 'number')(item)
        elif isinstance(item, self.dict_):
            #: Dict
            return getattr(self, 'dict')(item)
        elif isinstance(item, self.list_):
            #: List
            return getattr(self, 'list')(item)
        elif isinstance(item, tuple):
            #: Tuple
            return getattr(self, 'tuple')(item)
        elif isinstance(item, types.GeneratorType):
            #: Generator
            return getattr(self, 'generator')(item)
        elif isinstance(item, self.set_):
            #: Set
            return getattr(self, 'set')(item)
        elif isinstance(item, deque):
            #: Deque
            return getattr(self, 'deque')(item)
        elif isinstance(item, Sequence):
            #: Sequence
            return getattr(self, 'sequence')(item)
        #: Any other object
        return getattr(self, 'object')(item)