Syncs this object from the stripe data provided.

		:param data: stripe object
		:type data: dict
333713
def sync_from_stripe_data(cls, data, field_name="id"):
		
		current_ids = set()

		if data.get(field_name, None):
			# stop nested objects from trying to retrieve this object before initial sync is complete
			current_ids.add(cls._id_from_data(data.get(field_name)))

		instance, created = cls._get_or_create_from_stripe_object(
			data, field_name=field_name, current_ids=current_ids
		)

		if not created:
			instance._sync(cls._stripe_object_to_record(data))
			instance._attach_objects_hook(cls, data)
			instance.save()
			instance._attach_objects_post_save_hook(cls, data)

		return instance
162808
def update(self, data):
        
        data = values.of({'Data': serialize.object(data), })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
            key=self._solution['key'],
        )
1049151
def put(self, data):
        
        self._to_put.append(data)

        if self.should_flush():
            self.flush()
1290016
def update(self, data):
        
        result = None
        if data:
            pipe = self._client.pipeline(transaction=False)
            for k in data.keys():
                pipe.exists(self.get_key(k))
            exists = pipe.execute()
            exists = exists.count(True)
            _rk, _dumps = self.get_key, self._dumps
            data = {
                _rk(key): _dumps(value)
                for key, value in data.items()}
            pipe.mset(data)
            pipe.hincrby(self._bucket_key, self.key_prefix, len(data)-exists)
            result = pipe.execute()[0]
        return result
1124610
def _flush_data(self):
        
        if self._data and self._data.modified:
            hookenv.relation_set(self.relation_id, dict(self.to_publish.data))
791607
def create(self, data):
        
        data = values.of({'Data': serialize.object(data), })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return SyncListItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            list_sid=self._solution['list_sid'],
        )
1312856
def sync(self):
        
        layerData = self.layerData()
        for item in self.scene().items():
            try:
                if item._layer == self:
                    item.syncLayerData(layerData)
            except AttributeError:
                continue
25599
def send(self, data):
        
        if not self._connected:
            raise ConnectionError('Not connected')

        return self._send_queue.put(data)
298461
def add_data(self, data):
        

        if self.state == self.ErrorState:
            return

        self.raw_data += bytearray(data)

        still_processing = True
        while still_processing:
            still_processing = self.process_data()
1296491
def serialize(self, data):
        

        super(Serializer, self).serialize(data)
        self.resp.body = json.dumps(data)
1271891
def data(self, data):
        
        self._buffer = self._buffer + data

        while self._data_handler():
            pass
780024
def update(self, data):
        
        data = values.of({'Data': serialize.object(data), })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return DocumentInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
119772
def feed(self, data):
        
        self._lock.acquire()
        try:
            if self._event is not None:
                self._event.set()
            self._buffer_frombytes(b(data))
            self._cv.notifyAll()
        finally:
            self._lock.release()
408370
def _update_data(self, data, update_original=False, remove_missing=False):
        
        self._data.update(dict((key, self._deserialize(key, value))
                               for key, value in data.items()))

        # In certain situations, we want to treat missing keys as removals
        if remove_missing:
            for key in set(self._data.keys()) - set(data.keys()):
                self._data[key] = None

        if update_original:
            self._original_data = copy.deepcopy(self._data)
384148
def sync(self):
        
        if self._sync is None:
            from twilio.rest.sync import Sync
            self._sync = Sync(self)
        return self._sync
385287
def feed(self, data):
        
        try:
            self.rawdata = self.rawdata + data
        except TypeError:
            data = unicode(data)
            self.rawdata = self.rawdata + data

        self.goahead(0)
788549
def sync_subscriber(subscriber):
	""""""
	customer, _created = Customer.get_or_create(subscriber=subscriber)
	try:
		customer.sync_from_stripe_data(customer.api_retrieve())
		customer._sync_subscriptions()
		customer._sync_invoices()
		customer._sync_cards()
		customer._sync_charges()
	except InvalidRequestError as e:
		print("ERROR: " + str(e))
	return customer