def hash_vector(self, v, querying=False):
        if scipy.sparse.issparse(v):
            # If vector is sparse, make sure we have the CSR representation
            # of the projection matrix
            if self.components_csr == None:
                self.components_csr = scipy.sparse.csr_matrix(self.components)
            # Make sure that we are using CSR format for multiplication
            if not scipy.sparse.isspmatrix_csr(v):
                v = scipy.sparse.csr_matrix(v)
            # Project vector onto all hyperplane normals
            projection = self.components_csr.dot(v).toarray()
        else:
            # Project vector onto all hyperplane normals
            projection = numpy.dot(self.components, v)
        # Return binary key
        return [''.join(['1' if x > 0.0 else '0' for x in projection])]
Pop the previous state from the stack.
dataset/ETHPy150Open pixelogik/NearPy/nearpy/hashes/pcabinaryprojections.py/PCABinaryProjections.hash_vector--crossover with--dataset/ETHPy150Open google/grr/grr/lib/lexer.py/Lexer.PopState