<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select(self, pyliste):
 """Build sub-pdf with page numbers in 'list'."""

        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")

        val = _fitz.Document_select(self, pyliste)

        self._reset_page_refs()
        self.initData()

        return val