def __call__(self, vector={}):
        if isinstance(vector, (Document, Model)):
            vector = vector.vector
        v = self.copy()
        s = dict.__setitem__
        for f, w in vector.items():
            if f in v:
                s(v, f, w)
        return v

#--- VECTOR DISTANCE -------------------------------------------------------------------------------
# The "distance" between two vectors can be calculated using different metrics.
# For vectors that represent text, cosine similarity is a good metric.
# For more information, see Domain Similarity Measures (Vincent Van Asch, 2012).

# The following functions can be used if you work with Vectors or plain dictionaries, 
# instead of Documents and Models (which use caching for cosine similarity).
Call all extension drivers during PA creation.
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/Vector.__call__--crossover with--dataset/ETHPy150Open openstack/group-based-policy/gbpservice/neutron/services/grouppolicy/extension_manager.py/ExtensionManager.process_create_policy_action