Unwrap items at range from their list.
340545
function unwrapList(opts: Options, change: Change): Change {
    const items = getItemsAtRange(opts, change.value);

    if (items.isEmpty()) {
        return change;
    }

    // Unwrap the items from their list
    items.forEach(item =>
        change.unwrapNodeByKey(item.key, { normalize: false })
    );

    // Parent of the list of the items
    const firstItem = items.first();
    const parent = change.value.document.getParent(firstItem.key);

    let index = parent.nodes.findIndex(node => node.key === firstItem.key);

    // Unwrap the items' children
    items.forEach(item => {
        item.nodes.forEach(node => {
            change.moveNodeByKey(node.key, parent.key, index, {
                normalize: false
            });
            index += 1;
        });
    });

    // Finally, remove the now empty items
    items.forEach(item =>
        change.removeNodeByKey(item.key, { normalize: false })
    );

    return change;
}
1084334
def _unweave(target, advices, pointcut, ctx, depth, depth_predicate):
    """"""

    # if weaving has to be done
    if pointcut is None or pointcut(target):
        # do something only if target is intercepted
        if is_intercepted(target):
            _remove_advices(target=target, advices=advices, ctx=ctx)

    # search inside the target
    if depth > 0:  # for an object or a class, weave on methods
        # get base ctx
        _base_ctx = None
        if ctx is not None:
            _base_ctx = base_ctx(ctx)
        for _, member in getmembers(target, depth_predicate):
            _unweave(
                target=member, advices=advices, pointcut=pointcut,
                depth=depth - 1, depth_predicate=depth_predicate, ctx=_base_ctx
            )
211463
def remove(self, items):
        """"""
        items = coerce_to_list(items)
        new_options = {k: v for k, v in self.options.items() if v not in items}
        self.widget.options = new_options
        self.widget.param.trigger('options')
841176
def unwrap(self):
        '''
        
        '''
        red = [self.red[i]/65535.0 for i in range(self.size)]
        green = [self.green[i]/65535.0 for i in range(self.size)]
        blue = [self.blue[i]/65535.0 for i in range(self.size)]
        return red, green, blue
1113394
def unrank(n, sequence=string.ascii_lowercase):
    
    return list(map(sequence.__getitem__, indexes(n)))
449171
def items(self, limit=0):
        """"""
        i = ItemIterator(self.iterator)
        i.limit = limit
        return i
769735
def unpack(self, buff, offset=0):
        """"""
        super().unpack(buff)

        class_name = self._get_body_class()
        buff = self.body.value
        self.body = FixedTypeList(pyof_class=class_name)
        self.body.unpack(buff)
1325961
def wrap_list(item):
    
    if item is None:
        return []
    elif isinstance(item, list):
        return item
    elif isinstance(item, (tuple, set)):
        return list(item)
    else:
        return [item]
979031
def unweave(target, *advices):
        """"""

        advices = (
            advice if isinstance(advice, Advice) else Advice(advice)
            for advice in advices
        )

        unweave(target=target, *advices)
934062
def _list_handle(self, listmatch):
        """"""
        out = []
        name = listmatch.group(1)
        args = listmatch.group(2)
        for arg in self._list_members.findall(args):
            out.append(self._unquote(arg))
        return name, out
1253608
def unwrap_arrays(l):
    
    # keep processing until all nesting is removed
    process = True
    # fail safe: cap the loops at 20, so we don't run into an error and loop infinitely.
    # if it takes more than 20 loops then there is a problem with the data given.
    loops = 25
    while process and loops > 0:
        try:
            # new "flat" list
            l2 = []
            for k in l:
                # all items in this list are numeric, so this list is done. append to main list
                if all(isinstance(i, float) or isinstance(i, int) for i in k):
                    l2.append(k)
                # this list has more nested lists inside. append each individual nested list to the main one.
                elif all(isinstance(i, list) or isinstance(i, np.ndarray) for i in k):
                    for i in k:
                        l2.append(i)
        except Exception:
            print("something went wrong during process")
        # verify the main list
        try:
            # if every list has a numeric at index 0, then there is no more nesting and we can stop processing
            if all(isinstance(i[0], (int, str, float)) for i in l2):
                process = False
            else:
                l = l2
        except IndexError:
            # there's no index 0, so there must be mixed data types or empty data somewhere.
            print("something went wrong during verify")
        loops -= 1
    return l2
598065
def fromkeys (cls, iterable, value=None):
        """"""
        d = cls()
        for k in iterable:
            dict.__setitem__(d, k.lower(), value)
        return d
893353
def _unwrap_result(action, result):
    
    if not result:
        return
    elif action in {'DeleteItem', 'PutItem', 'UpdateItem'}:
        return _unwrap_delete_put_update_item(result)
    elif action == 'GetItem':
        return _unwrap_get_item(result)
    elif action == 'Query' or action == 'Scan':
        return _unwrap_query_scan(result)
    elif action == 'CreateTable':
        return _unwrap_create_table(result)
    elif action == 'DescribeTable':
        return _unwrap_describe_table(result)
    return result
868972
def unwrap_single(self):
        
        try:
            return next(self.itervalues())
        except AttributeError:
            return next(iter(self.values()))
108061
def _crop_list_to_size(l, size):
    """"""
    for x in range(size - len(l)):
        l.append(False)
    for x in range(len(l) - size):
        l.pop()
    return l
1002687
def _parse_list(self, text, i):
        """"""

        res = []
        end_match = self.end_list_re.match(text, i)
        old_current_type = self.current_type
        while not end_match:
            list_item, i = self._parse(text, i)
            res.append(list_item)

            end_match = self.end_list_re.match(text, i)

            if not end_match:
                m = self.list_delim_re.match(text, i)
                if not m:
                    self._fail("Missing delimiter in list before content", text, i)
                parsed = m.group(0)
                i += len(parsed)
            self.current_type = old_current_type

        parsed = end_match.group(0)
        i += len(parsed)
        return res, i
638409
def from_list(cls, l):
        """"""
        if len(l) == 3:
                x, y, z = map(float, l)
                return cls(x, y, z)
        elif len(l) == 2:
            x, y = map(float, l)
            return cls(x, y)
        else:
            raise AttributeError