code: def get_biopax_stmts(self, filter=False, query='pathsbetween',
                           database_filter=None):
          if self.basename is not None:
              biopax_stmt_path = '%s_biopax_stmts.pkl' % self.basename
              biopax_ras_owl_path = '%s_pc_pathsbetween.owl' % self.basename
          if self.basename is not None and os.path.isfile(biopax_stmt_path):
              logger.info("Loading Biopax statements from %s" % biopax_stmt_path)
              with open(biopax_stmt_path, 'rb') as f:
                  bp_statements = pickle.load(f)
              return bp_statements
          if self.basename is not None and os.path.isfile(biopax_ras_owl_path):
              logger.info("Loading Biopax from OWL file %s" % biopax_ras_owl_path)
              bp = biopax.process_owl(biopax_ras_owl_path)
          else:
              if (len(self.gene_list) < 2) and (query == 'pathsbetween'):
                  logger.warning('Using neighborhood query for one gene.')
                  query = 'neighborhood'
              if query == 'pathsbetween':
                  if len(self.gene_list) > 60:
                      block_size = 60
                  else:
                      block_size = None
                  bp = biopax.process_pc_pathsbetween(self.gene_list,
                                                  database_filter=database_filter,
                                                  block_size=block_size)
              elif query == 'neighborhood':
                  bp = biopax.process_pc_neighborhood(self.gene_list,
                                                  database_filter=database_filter)
              else:
                  logger.error('Invalid query type: %s' % query)
                  return []
              if self.basename is not None:
                  bp.save_model(biopax_ras_owl_path)
          if self.basename is not None:
              with open(biopax_stmt_path, 'wb') as f:
                  pickle.dump(bp.statements, f)
          if filter:
              policy = 'one' if len(self.gene_list) > 1 else 'all'
              stmts = ac.filter_gene_list(bp.statements, self.gene_list, policy)
          else:
              stmts = bp.statements
          return stmts