Parse data and save to pickle/hickle

def parse_data_to_internal(self, data=None):
        """
        Parse data and save to pickle/hickle
        """
        if data is None:
            data = parse.getdata(open(self.location_dat, "rb"),
                                 argnum=self.argnum, close=True)
        if self.filetype is "pickle":
            pickle.dump(data, open(self.location_internal, "wb"))
        elif self.filetype is "hickle":
            import hickle
            hickle.dump(data, open(self.location_internal, "wb"))
        else:
            raise ValueError(
                "Invalid filetype {} (must be {} or {})".format(
                    self.filetype, "pickle", "hickle"
                )
            )