Copy the data from the it's point of origin, serializing it,
        storing it serialized as well as in it's raw form and calculate
        a running hash of the serialized representation
547681
def copy_data(self):
        
        HASH_FUNCTION = hashlib.sha256()

        try:
            raw_iterator = self.get_binary_iterator()
        except AttributeError:
            raw_iterator = self.get_non_binary_iterator()
            self.copy_file = tempfile.NamedTemporaryFile(mode='w+')

            for part in raw_iterator:
                encoded_part = dbsafe_encode(part)
                self.copy_file.write(encoded_part)
                self.copy_file.write('\n')
                HASH_FUNCTION.update(encoded_part)

            self.copy_file.seek(0)
            self.data_iterator = (dbsafe_decode(line) for line in self.copy_file)

        else:
            self.copy_file = tempfile.NamedTemporaryFile(mode='w+b')

            for part in raw_iterator:
                self.copy_file.write(part)
                HASH_FUNCTION.update(part)

            self.copy_file.seek(0)
            self.data_iterator = self.copy_file

        self.new_hash = HASH_FUNCTION.hexdigest()
930801
def copy(self):
        """"""
        clone = self.__class__()
        clone.fields = self.copy_fields_dict(self.fields)
        clone.default_fields = self.copy_fields_dict(self.default_fields)
        clone.overloaded_fields = self.overloaded_fields.copy()
        clone.underlayer = self.underlayer
        clone.explicit = self.explicit
        clone.raw_packet_cache = self.raw_packet_cache
        clone.raw_packet_cache_fields = self.copy_fields_dict(
            self.raw_packet_cache_fields
        )
        clone.wirelen = self.wirelen
        clone.post_transforms = self.post_transforms[:]
        clone.payload = self.payload.copy()
        clone.payload.add_underlayer(clone)
        clone.time = self.time
        return clone
1296439
def copy(self):
        
        _conns = self._conns
        self._conns = {}
        c = copy.deepcopy(self)
        self._conns = _conns
        return c
16708
def _copy(self):
        """"""
        s_copy = self.__class__()
        s_copy._setbytes_unsafe(self._datastore.getbyteslice(0, self._datastore.bytelength),
                                self.len, self._offset)
        return s_copy
617390
def copy(defaults={}, context={})
      self.class.find(rpc_execute('copy', id, defaults, context), context: context)
    end
1306286
def FromData(cls, stream, json_data, http=None, auto_transfer=None,
                 **kwds):
        """"""
        info = json.loads(json_data)
        missing_keys = cls._REQUIRED_SERIALIZATION_KEYS - set(info.keys())
        if missing_keys:
            raise exceptions.InvalidDataError(
                'Invalid serialization data, missing keys: %s' % (
                    ', '.join(missing_keys)))
        download = cls.FromStream(stream, **kwds)
        if auto_transfer is not None:
            download.auto_transfer = auto_transfer
        else:
            download.auto_transfer = info['auto_transfer']
        setattr(download, '_Download__progress', info['progress'])
        setattr(download, '_Download__total_size', info['total_size'])
        download._Initialize(  # pylint: disable=protected-access
            http, info['url'])
        return download
999668
def do_execute(self):
        
        if isinstance(self.input.payload, classes.JavaObject) and self.input.payload.is_serializable:
            copy = serialization.deepcopy(self.input.payload)
            if copy is not None:
                self._output.append(Token(copy))
        else:
            self._output.append(self.input)
        return None
76760
def serialize(self, buf, offset):
        
        fields = [ofproto.oxs_from_user(k, uv) for (k, uv)
                  in self.fields]

        hdr_pack_str = '!HH'
        field_offset = offset + struct.calcsize(hdr_pack_str)
        for (n, value, _) in fields:
            # No mask
            field_offset += ofproto.oxs_serialize(n, value, None, buf,
                                                  field_offset)

        reserved = 0
        length = field_offset - offset
        msg_pack_into(hdr_pack_str, buf, offset, reserved, length)
        self.length = length

        pad_len = utils.round_up(length, 8) - length
        msg_pack_into("%dx" % pad_len, buf, field_offset)

        return length + pad_len
391122
def copy(self, request, **kwargs):
        # pylint: disable=unused-argument
        '''
        
        '''
        instance = self.copy_instance(self.get_object())
        serializer = self.get_serializer(instance, data=request.data, partial=True)
        serializer.is_valid()
        serializer.save()
        return Response(serializer.data, status.HTTP_201_CREATED).resp
910505
def serialize_transaction(inputs, outputs, lock_time=0, version=1):
    

    # add in the inputs
    serialized_inputs = ''.join([serialize_input(input) for input in inputs])

    # add in the outputs
    serialized_outputs = ''.join([serialize_output(output) for output in outputs])

    return ''.join([
        # add in the version number
        hexlify(struct.pack('<I', version)),
        # add in the number of inputs
        hexlify(variable_length_int(len(inputs))),
        # add in the inputs
        serialized_inputs,
        # add in the number of outputs
        hexlify(variable_length_int(len(outputs))),
        # add in the outputs
        serialized_outputs,
        # add in the lock time
        hexlify(struct.pack('<I', lock_time)),
    ])
724856
def serialize_old_format
      buf = [version].pack('V')
      buf << Bitcoin.pack_var_int(inputs.length) << inputs.map(&:to_payload).join
      buf << Bitcoin.pack_var_int(outputs.length) << outputs.map(&:to_payload).join
      buf << [lock_time].pack('V')
      buf
    end
784362
function serializeHash() {
      var hash = {}
      eachFormElement.apply(function (name, value) {
        if (name in hash) {
          hash[name] && !isArray(hash[name]) && (hash[name] = [hash[name]])
          hash[name].push(value)
        } else hash[name] = value
      }, arguments)
      return hash
    }
1185440
def _serialize(self, include_run_logs=False, strict_json=False):
        

        result = {'command': self.command,
                  'name': self.name,
                  'started_at': self.started_at,
                  'completed_at': self.completed_at,
                  'success': self.successful,
                  'soft_timeout': self.soft_timeout,
                  'hard_timeout': self.hard_timeout,
                  'hostname': self.hostname}

        if include_run_logs:
            last_run = self.backend.get_latest_run_log(self.parent_job.job_id,
                                                       self.name)
            if last_run:
                run_log = last_run.get('tasks', {}).get(self.name, {})
                if run_log:
                    result['run_log'] = run_log

        if strict_json:
            result = json.loads(json.dumps(result, cls=StrictJSONEncoder))
        return result
467717
def copy(status_code = STATUS_SUCCESS)

      # use Marshal dump and load to make a deep object copy
      copied_header = Marshal.load( Marshal.dump(header))
      copied_body   = Marshal.load( Marshal.dump(body))

      copied_header.set("message_id",UUIDTools::UUID.timestamp_create.to_s)
      copied_header.set("created_at",now_stamp)
      copied_header.set("status.code",status_code)

      Message.new(copied_header, copied_body)
    end
1033951
def serialize(self):
        

        self.data = bytearray()
        r = self.protocols[::-1]
        for i, p in enumerate(r):
            if isinstance(p, packet_base.PacketBase):
                if i == len(r) - 1:
                    prev = None
                else:
                    prev = r[i + 1]
                data = p.serialize(self.data, prev)
            else:
                data = six.binary_type(p)
            self.data = bytearray(data + self.data)
1188693
function data(originalName, hashedName) {
    var newData = {};
    var key = path.parse(originalName).base;
    var value = path.parse(hashedName).base;

    newData[key] = value;
    return newData;
}
1069293
def _copy_content(self, origin, dstPath):
        

        if hasattr(origin, 'read'):
            copy_content(origin, dstPath, self.BLOCK_SIZE, self._conf['fmode'])
        elif os.path.isfile(origin):
            with open(origin, 'rb') as f:
                copy_content(f, dstPath, self.BLOCK_SIZE, self._conf['fmode'])
        else:
            raise ValueError("Could not copy content, `origin` should be a path or a readable object")