:return: cadquery.Vector instance
323156
def vector(vect_in):
    
    if isinstance(vect_in, cadquery.Vector):
        return vect_in
    elif isinstance(vect_in, (tuple, list)):
        return cadquery.Vector(vect_in)

    raise CastingError(
        "Cannot cast object type of {!r} to a vector".format(vect_in)
    )
1332659
def hash_vector(self, v, querying=False):
        

        bucket_keys = []

        if querying:
            # If we are querying, use the permuted indexes to get bucket keys
            for child_hash in self.child_hashes:
                lshash = child_hash['hash']
                # Make sure the permuted index for this hash is existing
                if not lshash.hash_name in self.permutation.permutedIndexs:
                    raise AttributeError('Permuted index is not existing for hash with name %s' % lshash.hash_name)

                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    #print 'Regular bucket key %s' % bucket_key
                    # Get neighbour keys from permuted index
                    neighbour_keys = self.permutation.get_neighbour_keys(lshash.hash_name,bucket_key)
                    # Add them to result, but prefix with hash name
                    for n in neighbour_keys:
                        bucket_keys.append(lshash.hash_name+'_'+n)

        else:
            # If we are indexing (storing) just use child hashes without permuted index
            for child_hash in self.child_hashes:
                lshash = child_hash['hash']

                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    # Register bucket key in child hash dict
                    child_hash['bucket_keys'][bucket_key] = bucket_key
                    # Append bucket key to result prefixed with child hash name
                    bucket_keys.append(lshash.hash_name+'_'+bucket_key)

        # Return all the bucket keys
        return bucket_keys
439740
def patternVector(self, vector):
        
        if not self.patterned: return vector
        if type(vector) == int:
            if self.getWord(vector) != '':
                return self.getWord(vector)
            else:
                return vector
        elif type(vector) == float:
            if self.getWord(vector) != '':
                return self.getWord(vector)
            else:
                return vector
        elif type(vector) == str:
            return vector
        elif type(vector) == list:
            if self.getWord(vector) != '':
                return self.getWord(vector)
        # should be a list
        vec = []
        for v in vector:
            if self.getWord(v) != '':
                retval = self.getWord(v)
                vec.append( retval )
            else:
                retval = self.patternVector(v)
                vec.append( retval )                
        return vec
1168128
def std(self):
        
        return self._constructor(self.values.std(axis=0, keepdims=True))
403892
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.normals_csr == None:
                self.normals_csr = scipy.sparse.csr_matrix(self.normals)
            # 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.normals_csr.dot(v)
        else:
            # Project vector onto all hyperplane normals
            projection = numpy.dot(self.normals, v)
        # Return binary key
        return [''.join(['1' if x > 0.0 else '0' for x in projection])]
112724
def filter_vector vec, &block
      Daru::Vector.new(each_row.select(&block).map { |row| row[vec] })
    end
453396
def vector(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
        """"""
        ...
757711
def __vector_to_string(self, vector):
        
        return numpy.array_str(numpy.round(unitvec(vector), decimals=3))
750395
def copy(self):
        '''
            
        '''
        ret = QueryBuilder()
        ret.filters = copy.copy(self.filters)
        return ret
762216
def _asarray(self, vec):
        
        shape = self.domain[0, 0].shape + self.pshape
        arr = np.empty(shape, dtype=self.domain.dtype)
        for i, xi in enumerate(vec):
            for j, xij in enumerate(xi):
                arr[..., i, j] = xij.asarray()

        return arr
1110955
def get_value(self, query):
        
        indices = self.get_dimension_indices(query)
        index = self.get_value_index(indices)
        value = self.get_value_by_index(index)
        return value
1050364
def hash_vector(self, v, querying=False):
        

        bucket_keys = []

        if querying:
            # If we are querying, use the bucket key map
            for lshash in self.child_hashes:
                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    prefixed_key = lshash.hash_name+'_'+bucket_key
                    # Get entries from map (bucket keys with hamming distance of 1)
                    if prefixed_key in self.bucket_key_map:
                        bucket_keys.extend(self.bucket_key_map[prefixed_key].keys())
        else:
            # If we are indexing (storing) just use child hashes without permuted index
            for lshash in self.child_hashes:
                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    # Get permuted keys
                    perm_keys = self.permuted_keys(bucket_key)
                    # Put extact hit key into list
                    perm_keys.append(bucket_key)

                    # Append key for storage (not the permutations)
                    bucket_keys.append(lshash.hash_name+'_'+bucket_key)

                    # For every permutation register all the variants
                    for perm_key in perm_keys:
                        prefixed_key = lshash.hash_name+'_'+perm_key

                        # Make sure dictionary exists
                        if not prefixed_key in self.bucket_key_map:
                            self.bucket_key_map[prefixed_key] = {}

                        for variant in perm_keys:
                            prefixed_variant = lshash.hash_name+'_'+variant
                            self.bucket_key_map[prefixed_key][prefixed_variant] = 1

        # Return all the bucket keys
        return bucket_keys
483012
def fromvector(cls, v):
        """"""
        return cls(v.x, v.y, v.z)
573532
def get(self, schema, query=None, **kwargs):
        
        ret = self._get_query(self._get, schema, query, **kwargs)
        if not ret: ret = []
        return ret
728045
def _get_vectors(self, tree, precomputed_info):
        
        little_m = []
        big_m = []

        leaf_nodes = sorted(tree.leaf_nodes(), key=lambda x: x.taxon.label)
        # inner nodes, sorted order
        for leaf_a, leaf_b in combinations(leaf_nodes, 2):
            mrca = tree.mrca(taxa=[leaf_a.taxon, leaf_b.taxon])
            little_m.append(precomputed_info[mrca].edges_from_root)
            big_m.append(precomputed_info[mrca].dist_from_root)
        
        # leaf nodes, sorted order
        for leaf in leaf_nodes:
            little_m.append(1)
            big_m.append(leaf.edge_length)

        return np.array(little_m), np.array(big_m)
1010991
def physical_vector_from_hypercube_vector(self, hypercube_vector):
        
        return list(
            map(lambda prior_tuple, unit: prior_tuple.prior.value_for(unit), self.prior_tuples_ordered_by_id,
                hypercube_vector))
102220
def query(self,
              layerDefsFilter=None,
              geometryFilter=None,
              timeFilter=None,
              returnGeometry=True,
              returnIdsOnly=False,
              returnCountOnly=False,
              returnZ=False,
              returnM=False,
              outSR=None
              ):
        
        qurl = self._url + "/query"
        params = {"f": "json",
                  "returnGeometry": returnGeometry,
                  "returnIdsOnly": returnIdsOnly,
                  "returnCountOnly": returnCountOnly,
                  "returnZ": returnZ,
                  "returnM" : returnM}
        if not layerDefsFilter is None and \
           isinstance(layerDefsFilter, LayerDefinitionFilter):
            params['layerDefs'] = layerDefsFilter.filter
        if not geometryFilter is None and \
           isinstance(geometryFilter, GeometryFilter):
            gf = geometryFilter.filter
            params['geometryType'] = gf['geometryType']
            params['spatialRel'] = gf['spatialRel']
            params['geometry'] = gf['geometry']
            params['inSR'] = gf['inSR']
        if not outSR is None and \
           isinstance(outSR, SpatialReference):
            params['outSR'] = outSR.asDictionary
        if not timeFilter is None and \
           isinstance(timeFilter, TimeFilter):
            params['time'] = timeFilter.filter

        res = self._post(url=qurl,
                            param_dict=params,
                            securityHandler=self._securityHandler,
                            proxy_url=self._proxy_url,
                            proxy_port=self._proxy_port)
        if returnIdsOnly == False and returnCountOnly == False:
            if isinstance(res, str):
                jd = json.loads(res)
                return [FeatureSet.fromJSON(json.dumps(lyr)) for lyr in jd['layers']]
            elif isinstance(res, dict):
                return [FeatureSet.fromJSON(json.dumps(lyr)) for lyr in res['layers']]
            else:
                return res
        return res