Returns a new data element for the given mapped class.

        :returns: object implementing :class:`IResourceDataElement`.
518717
def create_data_element(self, mapped_class=None):
        
        if not mapped_class is None and mapped_class != self.__mapped_cls:
            mp = self.__mp_reg.find_or_create_mapping(mapped_class)
            data_el = mp.create_data_element()
        else:
            data_el = self.__de_cls.create()
        return data_el
9636
function ElementDataSource(config) {
	var newData = [],
		newColumns = [];

	var headings = config.data.all('tr th');

	headings.each(function(th){
		newColumns.push(th.getHtml());
	});

	config.data.all('tr').each(function(tr){
		var newRow = {},
			populated = false;

		for (var i = 0, numCols = headings.size(); i < numCols; i++) {

			if (!tr.all('td').item(i)) { continue; }

			newRow[headings.item(i).getHtml()] = tr.all('td').item(i).getHtml();
			populated = true;
		}

		if (populated) {
			newData.push(newRow);
		}
	});

	config.columns = newColumns;
	config.data = newData;

	return new JSONDataSource(config);
}
181266
def data(self):
        
        # Cache the data for next time .data is called.
        if self._data is None:
            self._data = self.to_value(self.instance)
        return self._data
1333131
def repr_new_instance(self, class_data):
        
        classname = self.formatted_classname(class_data["classname"])
        instancename = self.formatted_instancename(class_data["classname"])
        arguments = list()
        for key, value in self.sorted_dict(class_data.get("metadata", dict())):
            arguments.append("%s=%r" % (key, value))
        return "%s = %s(%s)" % (
            instancename, classname, ", ".join(arguments))
624089
def get_attribute(self, attribute_name, mapped_class=None, key=None):
        
        attr_map = self.__get_attribute_map(mapped_class, key, 0)
        try:
            return attr_map[attribute_name]
        except KeyError:
            raise AttributeError(attribute_name)
956093
def load(cls, data):
        
        if len(data) == 1:
            for key, value in data.items():
                if "__classname__" not in value:  # pragma: no cover
                    raise ValueError
                name = key
                bases = (Constant,)
                attrs = dict()
                for k, v in value.items():
                    if isinstance(v, dict):
                        if "__classname__" in v:
                            attrs[k] = cls.load({k: v})
                        else:
                            attrs[k] = v
                    else:
                        attrs[k] = v
            return type(name, bases, attrs)
        else:  # pragma: no cover
            raise ValueError
74130
def element( i )
      sources, table = @sources, @table
      if sources.any? { |source| source.dimension > 0 }
        sources = sources.
          collect { |source| source.dimension > 0 ? source.element( i ) : source }
        self.class.new *( sources + [ table ] )
      elsif table.dimension > sources.size
        n = sources.size
        self.class.new *( sources + [ table.unroll( n ).element( i ).roll( n ) ] )
      else
        super i
      end
    end
1222412
def get_data_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['data'])
        metadata.update({'existing_object_values': self._my_map['data']})
        return Metadata(**metadata)
219776
def datasetsGenerator(self, request):
        
        return self._topLevelObjectGenerator(
            request, self.getDataRepository().getNumDatasets(),
            self.getDataRepository().getDatasetByIndex)
493821
def getIRData(self):
        '''
        

        '''     
        if self.hasproxy():
            self.lock.acquire()
            ir = self.ir
            self.lock.release()
            return ir

        return None
1179465
@Override
    protected void importDataElement(Tuple<String, Element> data) {
        final RuntimeRequestResponse request = new RuntimeRequestResponse();
        request.setAttribute(Attributes.NODE, data.second);
        request.setAttribute(Attributes.LOCATION, StringUtils.trimToEmpty(data.first));

        final ReturnValueImpl result = new ReturnValueImpl();
        final TaskResponse response =
                new RuntimeRequestResponse(
                        Collections.<String, Object>singletonMap(
                                "Attributes.RETURN_VALUE", result));

        this.task.perform(request, response);
    }
125628
def _new_instance(self):
        

        new_obj = self.__class__()
        new_obj.class_ = self.class_
        new_obj.tag = self.tag
        new_obj.implicit = self.implicit
        new_obj.explicit = self.explicit
        return new_obj
889608
def copy(self, newdata=None):
        ''''''
        if newdata is None:
            newdata = self.data.copy()
        return self.__class__(
            self.molecule, self.origin.copy(), self.axes.copy(),
            self.nrep.copy(), newdata, self.subtitle, self.nuclear_charges
        )
575836
def get_selected_elements_of_core_class(self, core_element_type):
        
        if core_element_type is Outcome:
            return self.outcomes
        elif core_element_type is InputDataPort:
            return self.input_data_ports
        elif core_element_type is OutputDataPort:
            return self.output_data_ports
        elif core_element_type is ScopedVariable:
            return self.scoped_variables
        elif core_element_type is Transition:
            return self.transitions
        elif core_element_type is DataFlow:
            return self.data_flows
        elif core_element_type is State:
            return self.states
        raise RuntimeError("Invalid core element type: " + core_element_type)
48537
def retrieve(self):
        

        data = self.resource(self.id).get()
        self.data = data

        return data
395999
def _add_get_or_adder(self):
        
        def get_or_add_child(obj):
            child = getattr(obj, self._prop_name)
            if child is None:
                add_method = getattr(obj, self._add_method_name)
                child = add_method()
            return child
        get_or_add_child.__doc__ = (
            'Return the ``<%s>`` child element, newly added if not present.'
        ) % self._nsptagname
        self._add_to_class(self._get_or_add_method_name, get_or_add_child)
126026
def get_elements(self, filter_cls, elem_id=None):
        
        result = []
        if elem_id is not None:
            try:
                result = [self._class_collection_map[filter_cls][elem_id]]
            except KeyError:
                result = []
        else:
            for e in self._class_collection_map[filter_cls].values():
                result.append(e)
        return result