Data representation of the datasource sent to the frontend
320081
def data(self):
        """"""
        order_by_choices = []
        # self.column_names return sorted column_names
        for s in self.column_names:
            s = str(s or '')
            order_by_choices.append((json.dumps([s, True]), s + ' [asc]'))
            order_by_choices.append((json.dumps([s, False]), s + ' [desc]'))

        verbose_map = {'__timestamp': 'Time'}
        verbose_map.update({
            o.metric_name: o.verbose_name or o.metric_name
            for o in self.metrics
        })
        verbose_map.update({
            o.column_name: o.verbose_name or o.column_name
            for o in self.columns
        })
        return {
            # simple fields
            'id': self.id,
            'column_formats': self.column_formats,
            'description': self.description,
            'database': self.database.data,  # pylint: disable=no-member
            'default_endpoint': self.default_endpoint,
            'filter_select': self.filter_select_enabled,  # TODO deprecate
            'filter_select_enabled': self.filter_select_enabled,
            'name': self.name,
            'datasource_name': self.datasource_name,
            'type': self.type,
            'schema': self.schema,
            'offset': self.offset,
            'cache_timeout': self.cache_timeout,
            'params': self.params,
            'perm': self.perm,
            'edit_url': self.url,

            # sqla-specific
            'sql': self.sql,

            # one to many
            'columns': [o.data for o in self.columns],
            'metrics': [o.data for o in self.metrics],

            # TODO deprecate, move logic to JS
            'order_by_choices': order_by_choices,
            'owners': [owner.id for owner in self.owners],
            'verbose_map': verbose_map,
            'select_star': self.select_star,
        }
551769
function getData(el, attr, isInt, prefix) {
    if (prefix === undefined) {
      prefix = 'wookmark-';
    }
    var val = el.getAttribute('data-' + prefix + attr);
    if (isInt === true) {
      return parseInt(val, 10);
    }
    return val;
  }
602187
def send_data(self, data):
        ''' 
        '''
        for frontend_data in data:
            serialized_data = self.serialize_data(frontend_data)
            if sys.version_info >= (3, 0):
                serialized_data = serialized_data.encode('utf-8')
            for actual_backend in self.backends:
                actual_backend[1].send(serialized_data)
997443
function() {

		this._data_names = this._data_source.getNames();
		this._data_values = this._data_source.getValues();
		this._data_uids = this._data_source.getUIDs();
		this._count = this._data_uids.length;
		this._fire('collection_changed');

	}
756529
function findDataSource(connections, dataSource, cb) {
  var query = {

  };

  //Searching By ID.
  query[CONSTANTS.DATA_SOURCE_ID] = dataSource[CONSTANTS.DATA_SOURCE_ID];

  //Looking up a full data source document as we are updating
  lookUpDataSources(connections, {
    query: query,
    lean: false
  }, function(err, dataSources) {
    if (err) {
      return cb(buildErrorResponse({
        error: err,
        userDetail: "Unexpected Error When Searching For A Data Source",
        code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
      }));
    }

    //Should only be one data source
    if (dataSources.length !== 1) {
      return cb(buildErrorResponse({
        error: new Error("Data Source Not Found"),
        systemDetail: "Requested ID: "  + dataSource[CONSTANTS.DATA_SOURCE_ID],
        code: ERROR_CODES.FH_FORMS_NOT_FOUND
      }));
    }

    return cb(undefined, dataSource, dataSources[0]);
  });
}
446084
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data.get("properties", {})

        frontend_ip_configurations = []
        for raw_content in properties.get("frontendIPConfigurations", []):
            resource = Resource.from_raw_data(raw_content)
            frontend_ip_configurations.append(resource)
        properties["frontendIPConfigurations"] = frontend_ip_configurations

        raw_content = properties.get("backendAddressPool", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["backendAddressPool"] = resource

        raw_content = properties.get("probe", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["probe"] = resource

        return super(LoadBalancingRules, cls).process_raw_data(raw_data)
409470
def get_frontend_data_dict_for_plugin(request, plugin, editable):
    
    json_data = {}
    instance, plugin = plugin.get_plugin_instance()

    if not instance:
        return json_data

    renderer = renderer_pool.renderer_for_plugin(plugin)
    if renderer:
        json_data = renderer.render(request=request, plugin=plugin, instance=instance, editable=editable)

    if hasattr(plugin, 'parse_child_plugins') and plugin.parse_child_plugins:
        children = []
        for child_plugin in instance.get_children().order_by(settings.DJANGOCMS_SPA_PLUGIN_ORDER_FIELD):
            # Parse all children
            children.append(
                get_frontend_data_dict_for_plugin(
                    request=request,
                    plugin=child_plugin,
                    editable=editable
                )
            )

        if children:
            json_data['plugins'] = children

    return json_data
164662
def export_datasources(print_stdout, datasource_file,
                       back_references, include_defaults):
    """"""
    data = dict_import_export.export_to_dict(
        session=db.session,
        recursive=True,
        back_references=back_references,
        include_defaults=include_defaults)
    if print_stdout or not datasource_file:
        yaml.safe_dump(data, stdout, default_flow_style=False)
    if datasource_file:
        logging.info('Exporting datasources to %s', datasource_file)
        with open(datasource_file, 'w') as data_stream:
            yaml.safe_dump(data, data_stream, default_flow_style=False)
545941
function dataFormatter(data) {
	var instanceInfoArray = [];
	var instanceInfoObject = {};

	var reservations = data.Reservations;
	for (var reservation in reservations) {
		var instances = reservations[reservation].Instances;
		for (var instance in instances) {
			var tags = instances[instance].Tags;
			for (var tag in tags) {
				if (tags[tag].Key === 'Name') {
					instanceInfoObject = _.assign(instanceInfoObject,
					{Name: tags[tag].Value});
				}
			}
			instanceInfoObject = _.assign(instanceInfoObject,
				{State: instances[instance].State.Name},
				{id: instances[instance].InstanceId});
			instanceInfoArray.push(instanceInfoObject);
			instanceInfoObject = {};
		}
	}
	return Promise.resolve(instanceInfoArray);
}
969806
def data(self):
        """"""
        data = super(DynamicListSerializer, self).data
        processed_data = ReturnDict(
            SideloadingProcessor(self, data).data,
            serializer=self
        ) if self.child.envelope else ReturnList(
            data,
            serializer=self
        )
        processed_data = post_process(processed_data)
        return processed_data
286010
def map_to_data_element(self, resource):
        
        trv = ResourceTreeTraverser(resource, self.as_pruning())
        visitor = DataElementBuilderResourceTreeVisitor(self)
        trv.run(visitor)
        return visitor.data_element
1078302
function createData(id, date, name, shipTo, paymentMethod, amount) {
  return { id, date, name, shipTo, paymentMethod, amount };
}
137329
def to_api_data(self, restrict_keys=None):
        
        cc = self.parent._cc  # alias
        data = {
            cc('bold'): self._bold,
            cc('color'): self._color,
            cc('italic'): self._italic,
            cc('name'): self._name,
            cc('size'): self._size,
            cc('underline'): self._underline
        }

        if restrict_keys:
            for key in list(data.keys()):
                if key not in restrict_keys:
                    del data[key]
        return data
721446
def process_subscription_data(post_data):
    """"""
    subscription_data = post_data.pop("subscription", {})
    # As our database saves the auth and p256dh key in separate field,
    # we need to refactor it and insert the auth and p256dh keys in the same dictionary
    keys = subscription_data.pop("keys", {})
    subscription_data.update(keys)
    # Insert the browser name
    subscription_data["browser"] = post_data.pop("browser")
    return subscription_data
1151214
function dataPreprocess (version) {
        var util = require('./util');

        if (util.isNumber(version)) {
            version = version.toString();
        }
        if (util.isArray(version)) {
            version = version.join('.');
        }

        if (util.isCorrectVersion(version)) {
            return util.toArray(version);
        }

        return 'Wrong Params.';
    }
105582
def _repr_data_resource_(self):
        
        if config.get_option("display.html.table_schema"):
            data = self.head(config.get_option('display.max_rows'))
            payload = json.loads(data.to_json(orient='table'),
                                 object_pairs_hook=collections.OrderedDict)
            return payload
555672
function(data_source) {

		this.guid = Lava.guid++;

		if (data_source) {

			var count = 0,
				i = 0,
				name;

			if (Array.isArray(data_source)) {

				for (count = data_source.length; i < count; i++) {

					this._push(this._uid++, data_source[i], null);

				}

			} else if (data_source.isCollection) {

				this._data_names = data_source.getNames();
				this._data_values = data_source.getValues();
				for (count = this._data_values.length; i < count; i++) {

					this._data_uids.push(this._uid++);

				}

			} else {

				if (data_source.isProperties) {

					data_source = data_source.getProperties();

				}

				for (name in data_source) {

					this._push(this._uid++, data_source[name], name);

				}

			}

			this._count = this._data_uids.length;

		}

	}