The native Python datatype representation of this value

        :return:
            A list or None. If a list, all child values are recursively
            converted to native representation also.
767823
def native(self):
        

        if self.contents is None:
            return None

        if self._native is None:
            if self.children is None:
                self._parse_children(recurse=True)
            try:
                self._native = [child.native for child in self]
            except (ValueError, TypeError) as e:
                args = e.args[1:]
                e.args = (e.args[0] + '\n    while parsing %s' % type_name(self),) + args
                raise e
        return self._native
326242
def _format_native_types(self, na_rep='', quoting=None, **kwargs):
        
        mask = isna(self)
        if not self.is_object() and not quoting:
            values = np.asarray(self).astype(str)
        else:
            values = np.array(self, dtype=object, copy=True)

        values[mask] = na_rep
        return values
255429
def get_child_types(tree):
    
    child_types = defaultdict(list)
    for i, child in enumerate(tree):
        child_types[get_tree_type(child)].append(i)
    return child_types
683985
def serialize_list(self, value):
        

        # Check if this is a list or a tuple
        if not isinstance(value, (list, tuple)):
            return value

        # Loop over all the values and serialize the values
        return [
            self.serialize_value(list_value)
            for list_value in value
        ]
155499
def get_child(self, *types):
        
        children = list(self.get_children(*types))
        return children[0] if any(children) else None
955484
def getTypeFunc(self, data):
        
        if data is None:
            return self.writeNull

        t = type(data)

        # try types that we know will work
        if t is str or issubclass(t, str):
            return self.writeBytes
        if t is unicode or issubclass(t, unicode):
            return self.writeString
        elif t is bool:
            return self.writeBoolean
        elif t is float:
            return self.writeNumber
        elif t in python.int_types:
            return self.writeNumber
        elif t in (list, tuple):
            return self.writeList
        elif isinstance(data, (list, tuple)):
            return self.writeSequence
        elif t is types.GeneratorType:
            return self.writeGenerator
        elif t is pyamf.UndefinedType:
            return self.writeUndefined
        elif t in (datetime.date, datetime.datetime, datetime.time):
            return self.writeDate
        elif xml.is_xml(data):
            return self.writeXML

        # check for any overridden types
        for type_, func in pyamf.TYPE_MAP.iteritems():
            try:
                if isinstance(data, type_):
                    return _CustomTypeFunc(self, func)
            except TypeError:
                if python.callable(type_) and type_(data):
                    return _CustomTypeFunc(self, func)

        # now try some types that won't encode
        if t in python.class_types:
            # can't encode classes
            return None
        elif isinstance(data, python.func_types):
            # can't encode code objects
            return None
        elif isinstance(t, types.ModuleType):
            # cannot encode module objects
            return None

        # well, we tried ..
        return self.writeObject
1012671
def to_list_str(value, encode=None):
    
    result = []
    for index, v in enumerate(value):
        if isinstance(v, dict):
            result.append(to_dict_str(v, encode))
            continue

        if isinstance(v, list):
            result.append(to_list_str(v, encode))
            continue

        if encode:
            result.append(encode(v))
        else:
            result.append(default_encode(v))

    return result
1051532
def to_python(self):
        
        if isinstance(self.data, str):
            return self.data.strip().lower() == 'true'
        if isinstance(self.data, int):
            return self.data > 0
        return bool(self.data)
434371
async def serialize(self, value, native=False):
        '''
        
        '''
        if native:
            return self.to_python(value)
        return self.to_data(value)
273209
def values(self):
        
        return [
            (
                np.array(dim.numeric_values)
                if (dim.numeric_values and any(~np.isnan(dim.numeric_values)))
                else None
            )
            for dim in self._slice.dimensions
        ]
616016
def p_type_list(self, p):
        ''''''
        if p[1] is None:
            p[0] = []
        else:
            p[1].append(p[2])
            p[0] = p[1]
1081514
def values(self):
        
        enm = javabridge.call(self.jobject, "enumerateValues", "()Ljava/util/Enumeration;")
        if enm is None:
            return None
        else:
            return types.enumeration_to_list(enm)
129960
def typecast(self, type_):
        
        self.value = SymbolTYPECAST.make_node(type_, self.value, self.lineno)
        return self.value is not None
459315
def types(self):
        
        output = set()
        for var in self.values():
            if var.has_value():
                output.update(var.types())
        return list(output)
852218
def _recognize_basic_types(s):
    
    tps = [int, float]
    if not six.PY3:  # compat for older versions of six that don't have PY2
        tps.append(long)
    for tp in tps:
        try:
            return tp(s)
        except ValueError:
            pass
    if s.lower() == 'true':
        return True
    if s.lower() == 'false':
        return False
    if s.lower() in ['none', 'null']:
        return None

    return s
332398
def to_python(self, value):
        
        if not value:
            value = []

        # If a list is set then validated its items
        if isinstance(value, list):
            py_list = self.validate_list(value)
        else:  # try to de-serialize value and expect list and then validate
            try:
                py_list = json.loads(value)

                if not isinstance(py_list, list):
                    raise TypeError

                self.validate_list(py_list)
            except (ValueError, TypeError):
                raise ValidationError(u'Must be a valid list of strings.')

        return py_list
537226
def to_python(self, data):
        
        if data is None:
            return data
        if self.datatype:
            return self.datatype(data)
        else:
            return data