def load_data(self, filename, ext):
        """Load data from filename"""
        from spyder_kernels.utils.iofuncs import iofunctions
        from spyder_kernels.utils.misc import fix_reference_name

        glbs = self._mglobals()

        load_func = iofunctions.load_funcs[ext]
        data, error_message = load_func(filename)

        if error_message:
            return error_message

        for key in list(data.keys()):
            new_key = fix_reference_name(key, blacklist=list(glbs.keys()))
            if new_key != key:
                data[new_key] = data.pop(key)

        try:
            glbs.update(data)
        except Exception as error:
            return str(error)

        return None
def load_data ( self , filename , ext ) : from spyder_kernels . utils . iofuncs import iofunctions from spyder_kernels . utils . misc import fix_reference_name glbs = self . _mglobals ( ) load_func = iofunctions . load_funcs [ ext ] data , error_message = load_func ( filename ) if error_message : return error_message for key in list ( data . keys ( ) ) : new_key = fix_reference_name ( key , blacklist = list ( glbs . keys ( ) ) ) if new_key != key : data [ new_key ] = data . pop ( key ) try : glbs . update ( data ) except Exception as error : return str ( error ) return None
Load data from filename