CONTENT == tuple of non-sparse values
505599
def rom(addr, dout, CONTENT):
    '''  '''
    @always_comb
    def read():
        dout.next = CONTENT[int(addr)]

    return read
413976
def _not_none(items):
    """"""
    if not isinstance(items, (tuple, list)):
        items = (items,)
    return all(item is not _none for item in items)
357787
def _conv_general_shape_tuple(self, lhs_shape, rhs_shape, window_strides,
                                padding, dimension_numbers):
    """"""
    lhs_perm, rhs_perm, out_perm = self._conv_general_permutations(
        dimension_numbers)
    lhs_trans = onp.take(lhs_shape, lhs_perm)
    rhs_trans = onp.take(rhs_shape, rhs_perm)
    out_trans = self._conv_shape_tuple(
        lhs_trans, rhs_trans, window_strides, padding)
    return tuple(onp.take(out_trans, onp.argsort(out_perm)))
769050
def parse_lazy_data(content, variables_mapping=None):
    
    # TODO: refactor type check
    if content is None or isinstance(content, (numeric_types, bool, type)):
        return content

    elif isinstance(content, LazyString):
        variables_mapping = utils.ensure_mapping_format(variables_mapping or {})
        return content.to_value(variables_mapping)

    elif isinstance(content, (list, set, tuple)):
        return [
            parse_lazy_data(item, variables_mapping)
            for item in content
        ]

    elif isinstance(content, dict):
        parsed_content = {}
        for key, value in content.items():
            parsed_key = parse_lazy_data(key, variables_mapping)
            parsed_value = parse_lazy_data(value, variables_mapping)
            parsed_content[parsed_key] = parsed_value

        return parsed_content

    return content
1004532
def __i(self, other, func):
        """"""

        if isinstance(other, type(self)):
            other = tuple(other)

        elif isinstance(other, self.__contenttype__):
            other = (other, )

        for melt in list(other):
            if not isinstance(melt, self.__contenttype__):
                raise TypeError('Wrong element {0}'.format(melt))

            else:
                func(melt)

        return self
1194171
def ensure_tuple(obj):
    """"""
    if obj is None:
        return tuple()
    if isinstance(obj, Iterable) and not isinstance(obj, six.string_types):
        return tuple(obj)
    return obj,
80933
def _is_sparse(x):
  """"""
  return (
      isinstance(x, (tf.SparseTensor, tf_v1.SparseTensorValue)) or
      (hasattr(x, "is_sparse") and x.is_sparse))
980329
def encode_tuple(data, encoding=None, errors='strict', keep=False,
                 preserve_dict_class=False):
    '''
    
    '''
    return tuple(
        encode_list(data, encoding, errors, keep, preserve_dict_class, True))
145355
def parse(s):
        
        start = s.find('(')
        if start == -1:
            raise ValueError("Tuple should start with '('")
        end = s.find(')')
        if end == -1:
            raise ValueError("Tuple should end with ')'")
        s = s[start + 1: end].strip()

        size = s[: s.find(',')]
        try:
            size = int(size)
        except ValueError:
            raise ValueError("Cannot parse size %s." % size)

        ind_start = s.find('[')
        if ind_start == -1:
            raise ValueError("Indices array should start with '['.")
        ind_end = s.find(']')
        if ind_end == -1:
            raise ValueError("Indices array should end with ']'")
        new_s = s[ind_start + 1: ind_end]
        ind_list = new_s.split(',')
        try:
            indices = [int(ind) for ind in ind_list if ind]
        except ValueError:
            raise ValueError("Unable to parse indices from %s." % new_s)
        s = s[ind_end + 1:].strip()

        val_start = s.find('[')
        if val_start == -1:
            raise ValueError("Values array should start with '['.")
        val_end = s.find(']')
        if val_end == -1:
            raise ValueError("Values array should end with ']'.")
        val_list = s[val_start + 1: val_end].split(',')
        try:
            values = [float(val) for val in val_list if val]
        except ValueError:
            raise ValueError("Unable to parse values from %s." % s)
        return SparseVector(size, indices, values)
1112988
def normalize(self, inst, value):
        
        if (not (self.or_none and value is None) and
            self.seq):
            value = tuple(value)
        return value
803492
def is_tuple(node):
    """"""
    if isinstance(node, Node) and node.children == [LParen(), RParen()]:
        return True
    return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == u"("
            and node.children[2].value == u")")
395010
function tokenize(content, rules = parseOrder) {
    let data = []
    if(content) {
        let lines = content.split(/(\r\n|\n)/)
        for (let idx = 0; idx < lines.length; idx++) {
            for (let i = 0; i < lines[idx].length;) {
                let chunk = lines[idx].slice(i)
                let match = rules.some(item => {
                    if (item.pattern.test(chunk)) {
                        let matchObject = chunk.match(item.pattern)
                        i += matchObject[0].length
                        data.push([ item.label, matchObject[0] ])
                        return true
                    }
                })
                if (!match) {
                    data.push([ UNKNOWN, chunk[i] ])
                    i++
                }
            }
        }
    }
    return data
}
1001812
def xrify_tuples(self, tup):
        """"""
        return xr.DataArray(tup,
                            dims=['bands'],
                            coords={'bands': self.data['bands']})
69403
def content_children(self):
        
        text_types = {CT_RegularTextRun, CT_TextLineBreak, CT_TextField}
        return tuple(elm for elm in self if type(elm) in text_types)
1283007
def as_sparse_array(self, kind=None, fill_value=None, copy=False):
        

        if fill_value is None:
            fill_value = self.fill_value
        if kind is None:
            kind = self.kind
        return SparseArray(self.values, sparse_index=self.sp_index,
                           fill_value=fill_value, kind=kind, copy=copy)
264758
def as_tuple(self):
        
        ptr = self._pointer
        return (ptr.xx, ptr.yx, ptr.xy, ptr.yy, ptr.x0, ptr.y0)
1345783
def _totuple( x ):
    """"""

    if isinstance( x, basestring ):
        out = x,
    elif isinstance( x, ( int, long, float ) ):
        out = str( x ),
    elif x is None:
        out = None,
    else:
        out = tuple( x )

    return out