Enumerate the onm data models supported by this node instance. Use the data model to create an onm store via POST /store/create/:model
505633
function(req, res) {
            var models = [];
            for (modelName in onmModelDictionary) {
                models.push({
                    modelName: modelName,
                    modelPackage: onmModelDictionary[modelName].package
                });
            }
            res.send(200, models);
        }
1353203
def data_store
      @data_store ||= begin
        result = @options[:data_store] || DataStore::DefaultFacade.new(DataStore::MemoryStoreV2.new, options[:single_org], options[:osc_compat])
        if options[:single_org]

          if !result.respond_to?(:interface_version) || result.interface_version == 1
            result = ChefZero::DataStore::V1ToV2Adapter.new(result, options[:single_org])
            result = ChefZero::DataStore::DefaultFacade.new(result, options[:single_org], options[:osc_compat])
          end

        else
          if !result.respond_to?(:interface_version) || result.interface_version == 1
            raise "Multi-org not supported by data store #{result}!"
          end
        end

        result
      end
    end
1114648
def enumerate(context, data):
    """"""
    items = ensure_list(context.params.get('items'))
    for item in items:
        data['item'] = item
        context.emit(data=data)
594625
def create(self, data, fields=[], models={}):
        '''
        
        '''
        if not fields: fields = self.fields
        if not models and hasattr(self, 'models'): models = self.models
        for field in fields:
            setattr(self,field,None)
        if not data: return None
        for k, v in data.iteritems():
            if type(v) in (str, unicode):
                v = v.strip()
            if models and k in models:
                if type(v) == dict:
                    lists = []
                    for k2, v2 in v.iteritems():
                        if type(v2) == list:
                            for d in v2:
                                model = models[k]()
                                lists.append(model.create(d))
                    if not lists:
                        model = models[k]()
                        v = model.create(v)
                    else:
                        v = lists
                else:
                    model = models[k]()
                    v = model.create(v)
            setattr(self,k,v)
        return self
84912
function(req, res) {
            var stores = [];
            for (key in onmStoreDictionary) {
                stores.push({
                    dataModel: onmStoreDictionary[key].model.jsonTag,
                    storeKey: key
                });
            }
            res.send(200, stores);
        }
551569
public static List<CommerceSubscriptionEntry> toModels(
		CommerceSubscriptionEntrySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceSubscriptionEntry> models = new ArrayList<CommerceSubscriptionEntry>(soapModels.length);

		for (CommerceSubscriptionEntrySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
589193
def baremetal_models(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The baremetal_models function must be called with '
            '-f or --function'
        )

    conn = get_conn()

    bmodels = conn.list_baremetal_models()

    return bmodels
597540
def create_model_offline(schema, collection_factory, class_name):
    
    model_class = type(class_name,
                       (Model,),
                       dict(schema=schema, _collection_factory=staticmethod(collection_factory)))

    # Since we are dynamically creating this class here, we modify __module__ on the
    # created class to point back to the module from which `create_model_offline` was called
    model_class.__module__ = _module_name_from_previous_frame(1)

    return model_class
784262
def _load_output_data_port_models(self):
        
        self.output_data_ports = []
        for output_data_port in self.state.output_data_ports.values():
            self._add_model(self.output_data_ports, output_data_port, DataPortModel)
243117
public static List<CommerceWishListItem> toModels(
		CommerceWishListItemSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceWishListItem> models = new ArrayList<CommerceWishListItem>(soapModels.length);

		for (CommerceWishListItemSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
565067
def parse_network_osm_query(data):
    
    if len(data['elements']) == 0:
        raise RuntimeError('OSM query results contain no data.')

    nodes = []
    ways = []
    waynodes = []

    for e in data['elements']:
        if e['type'] == 'node':
            nodes.append(process_node(e))
        elif e['type'] == 'way':
            w, wn = process_way(e)
            ways.append(w)
            waynodes.extend(wn)

    nodes = pd.DataFrame.from_records(nodes, index='id')
    ways = pd.DataFrame.from_records(ways, index='id')
    waynodes = pd.DataFrame.from_records(waynodes, index='way_id')

    return (nodes, ways, waynodes)
1290403
function BaseModel(store) {
  if (!(this instanceof BaseModel)) {
    return new BaseModel(store);
  }
  Base.call(this);
  this.options = this.options || {};
  this.cache = this.cache || {};
  this.use(utils.option());
  this.use(utils.plugin());

  this.define('List', List);
  this.define('View', View);
  this.define('Registry', Registry);
  this.define('store', store || new Memory());
}
862630
def model(self, model, create=True):
        ''''''
        manager = self.manager(model)
        sm = self._models.get(manager)
        if sm is None and create:
            sm = SessionModel(manager)
            self._models[manager] = sm
        return sm
402667
def get_data_for model
      model = apply_search_to(model)

      @data = model.limit(options[:per_page]).offset(start_item).order(options[:order])

      options[:total_count] = model.count
      options[:page_total] = (options[:total_count] / options[:per_page].to_f).ceil
    end
980419
def model_classes(classes = Map.model_classes)
      nested_hash = classes.each_with_object({}) do |klass, hash|
        hash[klass] = Node.new(klass)
      end
      nested_hash.each do |klass, node|
        node.parent = parent = nested_hash[klass.superclass]
        parent.children << node if parent
      end
      nested_hash.values.select { |v| v.parent.nil? }
    end
418111
def enumerate_params_by_node(node)
      attrs = enumerate_attrs_by_node(node)
      Set.new(attrs.select { |a| @param_set.include?(a) })
    end
1133883
def find_model(object):
        

        models = []
        for model in GraphModel._GraphModel__models_instances.itervalues():
            for node in foundations.walkers.nodes_walker(model.root_node):
                if node is object:
                    models.append(model)

                for attribute in node.get_attributes():
                    if attribute is object:
                        models.append(model)
        return models