def interpolate(self, topo, data,<EOL>registration=None, mask=None, weights=None,<EOL>method='<STR_LIT>', n_jobs=<NUM_LIT:1>):
if is_address(topo):<EOL><INDENT>try: mesh = next(six.itervalues(self.registrations))<EOL>except Exception: mesh = None<EOL>try: mesh = next(six.itervalues(self.surfaces)) if mesh is None else mesh<EOL>except Exception: mesh = None<EOL>if mesh is None: raise ValueError('<STR_LIT>')<EOL>return mesh.interpolate(topo, data, mask=mask, weights=weights,<EOL>method=method, n_jobs=n_jobs)<EOL><DEDENT>elif not isinstance(topo, Topology):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if registration is None:<EOL><INDENT>reg_names = [k for k in six.iterkeys(topo.registrations) if k in self.registrations<EOL>if k != '<STR_LIT>']<EOL>if '<STR_LIT>' in reg_names:<EOL><INDENT>reg_names = ['<STR_LIT>'] + [rn for rn in reg_names if rn != '<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in reg_names:<EOL><INDENT>reg_names = ['<STR_LIT>'] + [rn for rn in reg_names if rn != '<STR_LIT>']<EOL><DEDENT><DEDENT>else: reg_names = [registration]<EOL>if not reg_names:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>res = None<EOL>errs = []<EOL>for reg_name in reg_names:<EOL><INDENT>if True:<EOL><INDENT>res = self.registrations[reg_name].interpolate(<EOL>topo.registrations[reg_name], data,<EOL>mask=mask, method=method, n_jobs=n_jobs);<EOL>break<EOL><DEDENT><DEDENT>if res is None:<EOL><INDENT>raise ValueError('<STR_LIT>', errs)<EOL><DEDENT>return res<EOL>
topology.interpolate(topo, data) yields a numpy array of the data interpolated from the
  given array, data, which must contain the same number of elements as there are vertices
  tracked by the topology object (topology), to the coordinates in the given topology
  (topo). In order to perform interpolation, the topologies topology and topo must share at
  least one registration by name.

The following options are accepted:
  * mask (default: None) indicates that the given True/False or 0/1 valued list/array should
    be used; any point whose nearest neighbor (see below) is in the given mask will, instead
    of an interpolated value, be set to the null value (see null option).
  * method (default: 'automatic') specifies what method to use for interpolation. The only
    currently supported methods are 'automatic', 'linear', or 'nearest'. The 'nearest'
    method does not  actually perform a nearest-neighbor interpolation but rather assigns to
    a destination vertex the value of the source vertex whose voronoi-like polygon contains
    the destination vertex; note that the term 'voronoi-like' is used here because it uses
    the Voronoi diagram that corresponds to the triangle mesh and not the true delaunay
    triangulation. The 'linear' method uses linear interpolation; though if the given data
    is non-numerical, then nearest interpolation is used instead. The 'automatic' method
    uses linear interpolation for any floating-point data and nearest interpolation for any
    integral or non-numeric data.
  * registration (default: None) specifies the registration to use. If None, interpolate
    will search for a shared registration aside from 'native'. If available, if will use the
    fsaverage, followed by the fs_LR.
  * n_jobs (default: 1) is passed along to the cKDTree.query method, so may be set to an
    integer to specify how many processors to use, or may be -1 to specify all processors.