Add a name or namespace preorder record, if it doesn't exist already.

    DO NOT CALL THIS DIRECTLY.
9561
def namedb_preorder_insert( cur, preorder_rec ):
    

    preorder_row = copy.deepcopy( preorder_rec )
    
    assert 'preorder_hash' in preorder_row, "BUG: missing preorder_hash"

    try:
        preorder_query, preorder_values = namedb_insert_prepare( cur, preorder_row, "preorders" )
    except Exception, e:
        log.exception(e)
        log.error("FATAL: Failed to insert name preorder '%s'" % preorder_row['preorder_hash']) 
        os.abort()

    namedb_query_execute( cur, preorder_query, preorder_values )
    return True
1331811
private void addNewGenderName(EntityIdValue entityIdValue, String name) {
		this.genderNames.put(entityIdValue, name);
		this.genderNamesList.add(entityIdValue);
	}
819172
@Action(
            publishing = Publishing.ENABLED // using the default payload factory
    )
    public PublishedCustomer addOrder(
            @ParameterLayout(named="Name")
            final String name) {
        final ReferencedOrder order = repositoryService.instantiate(ReferencedOrder.class);
        order.setName(name);
        getOrders().add(order);
        repositoryService.persist(order);
        return this;
    }
716610
function (cfg) {
            this.log("addRecordStore");
            var lrs;
            if (cfg instanceof TinCan.LRS) {
                lrs = cfg;
            }
            else {
                lrs = new TinCan.LRS (cfg);
            }
            this.recordStores.push(lrs);
        }
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)
1355815
def add_namespace(self, namespace, interface=None, check_extras=True,
                      load_now=False):
        
        tempo = self._namespaces.get(namespace)

        if tempo is None:
            tempo = _Plugins(namespace, interface, check_extras)
            self._namespaces[namespace] = tempo

        if load_now:
            tempo.load()

        return tempo
256213
private void createNamespace(boolean isUpdate)
    {
        boolean isNameSpaceAvailable = isNamespaceAvailable(databaseName);
        if (isNameSpaceAvailable && !isUpdate)
        {
            drop();
        }
        if (!(isNameSpaceAvailable && isUpdate))
        {
            try
            {
                NamespaceDescriptor descriptor = NamespaceDescriptor.create(databaseName).build();
                admin.createNamespace(descriptor);
            }
            catch (IOException ioex)
            {
                logger.error("Either table isn't in enabled state or some network problem, Caused by: ", ioex);
                throw new SchemaGenerationException(ioex, "Hbase");
            }
        }
    }
1057632
def add_thing(self, name, location, **kwargs):
        
        if name in self.thing:
            raise WorldIntegrityError(
                "Already have a Thing named {}".format(name)
            )
        self.add_node(name, **kwargs)
        if isinstance(location, Node):
            location = location.name
        self.place2thing(name, location,)
204762
public void ensureNamespace(String schema)
    {
        try {
            // If the table schema is not "default" and the namespace does not exist, create it
            if (!schema.equals(DEFAULT) && !connector.namespaceOperations().exists(schema)) {
                connector.namespaceOperations().create(schema);
            }
        }
        catch (AccumuloException | AccumuloSecurityException e) {
            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Failed to check for existence or create Accumulo namespace", e);
        }
        catch (NamespaceExistsException e) {
            // Suppress race condition between test for existence and creation
            LOG.warn("NamespaceExistsException suppressed when creating " + schema);
        }
    }
425805
def update(self, name):
        

        if name is None:
            return

        if name not in self._names:
            # add the name if it isn't already tracked
            self._names[name] = len(self._names)

        result = self._names[name] - self._current
        self._current = self._names[name]
        return result
567657
def put(self, namespace, key):
        """"""
        args = request.json

        if not self.dbconfig.key_exists(namespace, key):
            return self.make_response('No such config entry: {}/{}'.format(namespace, key), HTTP.BAD_REQUEST)

        if (args['type'] == 'choice' and
                not args['value']['min_items'] <= len(args['value']['enabled']) <= args['value']['max_items']):
            return self.make_response(
                'You should select {} {}item{}'.format(
                    args['value']['min_items'],
                    '' if args['value']['min_items'] == args['value']['max_items'] else 'to {} '.format(
                        args['value']['max_items']
                    ),
                    's' if args['value']['max_items'] > 1 else ''
                ),
                HTTP.BAD_REQUEST
            )

        if args['type'] == 'choice' and not set(args['value']['enabled']).issubset(args['value']['available']):
            return self.make_response('Invalid item', HTTP.BAD_REQUEST)

        item = db.ConfigItem.find_one(
            ConfigItem.namespace_prefix == namespace, ConfigItem.key == key
        )

        if item.value != args['value']:
            item.value = args['value']

        if item.type != args['type']:
            item.type = args['type']

        if item.description != args['description']:
            item.description = args['description']

        self.dbconfig.set(namespace, key, _to_dbc_class(args))
        auditlog(event='configItem.update', actor=session['user'].username, data=args)

        return self.make_response('Config entry updated')
763360
def add_name_variant(self, name):
        
        self._ensure_field('name', {})
        self.obj['name'].setdefault('name_variants', []).append(name)
628546
def add_record(cls, fqdn, name, type, value, ttl):
        """"""
        data = {
            "rrset_name": name,
            "rrset_type": type,
            "rrset_values": value,
        }
        if ttl:
            data['rrset_ttl'] = int(ttl)
        meta = cls.get_fqdn_info(fqdn)
        url = meta['domain_records_href']
        return cls.json_post(url, data=json.dumps(data))
652132
public synchronized void addProperty(Object source, String name, Object value, boolean beforeUpdate) {
        if (beforeUpdate == false && isLog4JProperty(name)) {
            overrideProps.put(name, value);
            reConfigureAsynchronously();
        }
    }
880314
def is_namespace_preordered( self, namespace_id_hash ):
        
        namespace_preorder = self.get_namespace_preorder(namespace_id_hash)
        if namespace_preorder is None:
            return False 
        else:
            return True
751569
public OrmDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
1268520
def add_source(self, source_name, description=None):
        

        # TODO: shoud be able to do this inside a transaction

        if not source_name:
            raise ValueError('"source_name" may not be None or an empty string')

        sel = select([self.source.c.id], self.source.c.name == source_name).execute()
        result = sel.fetchone()
        if result:
            return result[0], False
        else:
            ins = self.source.insert().execute(
                name=source_name, description=description)
            return ins.inserted_primary_key[0], True