Make a copy of one AFF4 object to a different URN.
343292
def Copy(self,
           old_urn,
           new_urn,
           age=NEWEST_TIME,
           limit=None,
           update_timestamps=False):
    """"""
    new_urn = rdfvalue.RDFURN(new_urn)

    if update_timestamps and age != NEWEST_TIME:
      raise ValueError(
          "Can't update timestamps unless reading the latest version.")

    values = {}
    for predicate, value, ts in data_store.DB.ResolvePrefix(
        old_urn,
        AFF4_PREFIXES,
        timestamp=self.ParseAgeSpecification(age),
        limit=limit):
      if update_timestamps:
        values.setdefault(predicate, []).append((value, None))
      else:
        values.setdefault(predicate, []).append((value, ts))

    if values:
      with data_store.DB.GetMutationPool() as pool:
        pool.MultiSet(new_urn, values, replace=False)
        self._UpdateChildIndex(new_urn, pool)
253149
def CreateAFF4Object(stat_response, client_id_urn, mutation_pool, token=None):
  """"""

  urn = stat_response.pathspec.AFF4Path(client_id_urn)

  if stat.S_ISDIR(stat_response.st_mode):
    ftype = standard.VFSDirectory
  else:
    ftype = aff4_grr.VFSFile

  with aff4.FACTORY.Create(
      urn, ftype, mode="w", mutation_pool=mutation_pool, token=token) as fd:
    fd.Set(fd.Schema.STAT(stat_response))
    fd.Set(fd.Schema.PATHSPEC(stat_response.pathspec))
833420
def _clone(self):
        '''
        
        '''
        instance = super(Bungiesearch, self)._clone()
        instance._raw_results_only = self._raw_results_only
        return instance
820404
def copy(self):
        
        new_filter = BloomFilter(self.capacity, self.error_rate)
        new_filter.bitarray = self.bitarray.copy()
        return new_filter
1056068
def copy(self, key=None):
        
        other = self.__class__(
            maxsize=self.maxsize, redis=self.persistence.redis, key=key
        )
        other.update(self)

        return other
1091746
function cloneObj(a,b) {
  Object.keys(b).forEach(function(k) {
    a[k] = b[k];
  });
  return a;
}
229109
def clone(self, **override_vars):
        """"""
        c = Context(self.vars, self.data)
        c.executed_actions = set(self.executed_actions)
        c.vars.update(override_vars)
        return c
1221876
def copy(self):
        """"""
        return self.__class__(self, key=self._key, load=self._load)
468636
def copy(other)
      reserve = [
                 :xf_index,
                 :dxf_index,
                 :xdf_format_indices,
                 :palette
                ]
      (instance_variables - reserve).each do |v|
        instance_variable_set(v, other.instance_variable_get(v))
      end
    end
127293
def merge_parts(self, version_id=None, **kwargs):
        """"""
        self.file.update_checksum(**kwargs)
        with db.session.begin_nested():
            obj = ObjectVersion.create(
                self.bucket,
                self.key,
                _file_id=self.file_id,
                version_id=version_id
            )
            self.delete()
        return obj
1146209
def copy(self):
    ''''''
    if self.object_getattr is Query.object_getattr:
      other = Query(self.key)
    else:
      other = Query(self.key, object_getattr=self.object_getattr)
    other.limit = self.limit
    other.offset = self.offset
    other.offset_key = self.offset_key
    other.filters = self.filters
    other.orders = self.orders
    return other
572373
def __copy(cls, view):
        '''
        
        '''

        return cls(view.map, view.device, view.version, view.forceviewserveruse, view.windowId, view.uiAutomatorHelper)
491099
def copy_from(self, other_state):
    """"""
    for prop in self.properties().values():
      setattr(self, prop.name, getattr(other_state, prop.name))
481799
def copy_object(self, obj, new_container, new_obj_name=None,
            content_type=None):
        
        return self.manager.copy_object(self, obj, new_container,
                new_obj_name=new_obj_name, content_type=content_type)
676059
def copy(self, **replacements):
    """"""
    cls = type(self)
    kwargs = self._asdict()
    for key, val in replacements.items():
      if key == 'excludes':
        val = JarDependency._prepare_excludes(val)
      kwargs[key] = val
    org = kwargs.pop('org')
    base_name = kwargs.pop('base_name')
    return cls(org, base_name, **kwargs)
171013
def copy(self):
        """"""
        return Poly(self.A.copy(), self.dim, self.shape,
            self.dtype)
749425
def copy(self, o=None):
        """"""
        if o is None: o = self.__class__(self.project)
        o.scripts = [s.copy() for s in self.scripts]
        o.variables = dict((n, v.copy()) for (n, v) in self.variables.items())
        o.lists = dict((n, l.copy()) for (n, l) in self.lists.items())
        o.costumes = [c.copy() for c in self.costumes]
        o.sounds = [s.copy() for s in self.sounds]
        o.costume_index = self.costume_index
        o.volume = self.volume
        return o