Renames specified attributes if present.

@memberof module:jsx
@private
@method rename
@param {Object} object  - the object to perform replacements on
@param {string} fromKey - a key to look for
@param {string} toKey   - a key to rename to
346642
function rename(object, fromKey, toKey) {
  if ((0, _has2.default)(object, fromKey)) {
    object[toKey] = object[fromKey];
    delete object[fromKey];
  }
}
400534
function renameKey (name, opts) {
  if (opts && opts.renameKey) {
    return opts.renameKey(name, opts)
  }
  return name
}
1002638
function renamenx(key, newkey, req) {
  var exists = this.keyExists(newkey);
  if(!exists) {
    this.rename(key, newkey, req);
  }
  return exists ? 0 : 1;
}
440296
function (from, to) {
      return rename(path.resolve(target, from), path.resolve(target, to))
    }
306014
function (from, to) {
            return (new java.io.File(from)).renameTo((new java.io.File(to)));
        }
782856
def rename_property(self, old, new):
        """"""
        self._properties.replace(old, new)
        pairs = self._pairs
        pairs |= {(o, new) for o in self._objects
            if (o, old) in pairs and not pairs.remove((o, old))}
689052
def rename(self, old_name, new_name):
        """"""
        try:
            self.api.rename(mkey(old_name), mkey(new_name))
        except ResponseError, exc:
            if "no such key" in exc.args:
                raise KeyError(old_name)
            raise
373085
protected function addRenameColumn(&$property, $from, $to)
    {
        $property .= sprintf("%s('%s', '%s')", $this->getPropertyBase('renameColumn'), $from, $to);

        return $this;
    }
62823
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
1211911
function mergeAttributes(from, to) {
    mergeClassNames(from, to);

    // It’s important to preserve attributes order: ones in `from` have higher
    // priority than in `to`. Collect attributes in map in order they should
    // appear in `to`
    const attrMap = new Map();

    let attrs = from.attributes;
    for (let i = 0; i < attrs.length; i++) {
        attrMap.set(attrs[i].name, attrs[i].clone());
    }

    attrs = to.attributes.slice();
    for (let i = 0, attr, a; i < attrs.length; i++) {
        attr = attrs[i];
        if (attrMap.has(attr.name)) {
            a = attrMap.get(attr.name);
            a.value = attr.value;

            // If user explicitly wrote attribute in abbreviation, it’s no longer
            // implied and should be outputted even if value is empty
            if (a.options.implied) {
                a.options.implied = false;
            }
        } else {
            attrMap.set(attr.name, attr);
        }

        to.removeAttribute(attr);
    }

    const newAttrs = Array.from(attrMap.values());
    for (let i = 0; i < newAttrs.length; i++) {
        to.setAttribute(newAttrs[i]);
    }

    return to;
}
141710
public function rename($from, $to)
    {
        if (is_null($key = $this->search($from))) {
            return false;
        }

        $this->items[$key] = $this->getSlugFromName($to);

        return true;
    }
515610
function transformKeysToCamelCase (obj) {
  var camelKey;
  var key;
  for (key in obj) {
    camelKey = toCamelCase(key);
    if (key === camelKey) { continue; }
    obj[camelKey] = obj[key];
    delete obj[key];
  }
  return obj;
}
981715
public Response<String> rename(final String oldkey, final String newkey) {
		return new PipelineOperation<String>() {

			@Override
			Response<String> execute(Pipeline jedisPipeline) throws DynoException {
				return jedisPipeline.rename(oldkey, newkey);
			}
		}.execute(oldkey, OpName.RENAME);

	}
164374
def rename_if(attributes, conditions = {})
      if block_given?
        set(attributes) if yield self
      else
        set(attributes) if conditions.all? do |key, value|
          respond_to?(key) && send(key) == value
        end
      end

      self
    end
350013
def rename(self, oldkey, newkey):
        
        if oldkey in self.scalars:
            the_list = self.scalars
        elif oldkey in self.sections:
            the_list = self.sections
        else:
            raise KeyError('Key "%s" not found.' % oldkey)
        pos = the_list.index(oldkey)
        #
        val = self[oldkey]
        dict.__delitem__(self, oldkey)
        dict.__setitem__(self, newkey, val)
        the_list.remove(oldkey)
        the_list.insert(pos, newkey)
        comm = self.comments[oldkey]
        inline_comment = self.inline_comments[oldkey]
        del self.comments[oldkey]
        del self.inline_comments[oldkey]
        self.comments[newkey] = comm
        self.inline_comments[newkey] = inline_comment
1058082
public function rename(string $from, string $to) : Assoc
    {
        return $this->pipe(
            function (array $values) use ($from, $to) : array {
                if (isset($values[$from])) {
                    $values[$to] = $values[$from];
                    unset($values[$from]);
                }

                return $values;
            }
        );
    }
1066599
def record_rename(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/rename' % object_id, input_params, always_retry=always_retry, **kwargs)