@staticmethod
    def _clean_isbn(isbn):
        """
        Tidy up ISBN input - limit to only allowed characters, replacing * with
        X
        """
        
        # Replace * with X
        isbn = isbn.replace('*', 'X')
        
        # Replace extroneous characters
        isbn = ''.join(c for c in isbn if (c in '0123456789X'))
        
        return isbn
dataset/ETHPy150Open mollyproject/mollyproject/molly/apps/library/models.py/LibrarySearchQuery._clean_isbn/original