TODO: merge child_order_id and child_order_acceptance_id
180886
def my_cancel_child_order(product_code:, child_order_id: nil, child_order_acceptance_id: nil)
      return unless child_order_id || child_order_acceptance_id

      body =
        if child_order_id
          "{
            'product_code': \"#{product_code}\",
            'child_order_id': \"#{child_order_id}\"
          }"
        elsif child_order_acceptance_id
          "{
            'product_code': \"#{product_code}\",
            'child_order_acceptance_id': \"#{child_order_acceptance_id}\"
          }"
        end

      res = conn.post do |req|
        req.url "/v1/me/cancelchildorder"
        req.body = body
      end

      res.body
    end
424189
public function merge()
    {
        $marged = NULL;
        foreach (func_get_args() as $arg) {
            // first is override.
            if ($marged === null) {
                $marged = $arg;

            // when mismatch variable type, then override.
            } elseif (gettype($marged) !== gettype($arg)) {
                $marged = $arg;

            // when not array, then override.
            } elseif (! is_array($arg)) {
                $marged = $arg;

            // when both array, then merge recursive.
            } else {
                foreach ($arg as $_key => $_val) {
                    // when int key, then push.
                    if(is_int($_key)) {
                        $marged[] = $_val;
                    // when not exists key, then override.
                    } elseif(! isset($marged[$_key])) {
                        $marged[$_key] = $_val;
                    // merge.
                    } else {
                        $marged[$_key] = $this->merge($marged[$_key], $_val);
                    }
                }
            }
        }
        return $marged;
    }
539790
def fill_parentidid2obj_r0(self, id2obj, child_obj):
        """"""
        for parent_obj in child_obj.parents:
            if parent_obj.item_id not in id2obj:
                id2obj[parent_obj.item_id] = parent_obj
                self.fill_parentidid2obj_r0(id2obj, parent_obj)
622439
function mergeHook (
  parentVal,
  childVal
) {
  return childVal
    ? parentVal
      ? parentVal.concat(childVal)
      : Array.isArray(childVal)
        ? childVal
        : [childVal]
    : parentVal
}
568467
def fetch(self, order_id, data={}, **kwargs):
        "
        return super(Order, self).fetch(order_id, data, **kwargs)
1285030
function mergeEmoticons(child, index, parent) {
  var siblings
  var value
  var siblingIndex
  var node
  var emoticon
  var subvalue

  /* Check if `child`s first character could be used
   * to start an emoticon. */
  if (start.indexOf(toString(child).charAt(0)) !== -1) {
    siblings = parent.children
    siblingIndex = index
    node = child
    value = ''

    while (node) {
      if (value.length >= MAX_EMOTICON_LENGTH) {
        return
      }

      subvalue = toString(node)

      value += subvalue

      /* The second test, if the last character of
       * the current node is superfluous but
       * improves performance by 30%. */
      if (
        node.type !== EMOTICON_NODE &&
        end.indexOf(subvalue.charAt(subvalue.length - 1)) !== -1 &&
        emoticons.indexOf(value) !== -1
      ) {
        emoticon = {type: EMOTICON_NODE, value: value}

        if (child.position && node.position) {
          emoticon.position = {
            start: child.position.start,
            end: node.position.end
          }
        }

        siblings.splice(index, siblingIndex - index + 1, emoticon)

        /* Some emoticons, like `:-`, can be followed by
         * more characters to form other emoticons. */
        return index - 1
      }

      node = siblings[++siblingIndex]
    }
  }
}
602102
function after_process() {
    global $insert_id, $db;
    $sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )";
    $sql = $db->bindVars($sql, ':orderComments', 'eCheck payment.  AUTH: ' . $this->auth_code . '. TransID: ' . $this->transaction_id . '.', 'string');
    $sql = $db->bindVars($sql, ':orderID', $insert_id, 'integer');
    $sql = $db->bindVars($sql, ':orderStatus', $this->order_status, 'integer');
    $db->Execute($sql);
    return false;
  }
1251993
function merge(parent, child) {
	        for (var prop in child) {
	            parent[prop] = child[prop];
	        }
	        return parent;
	    }
133806
def orderStatus(self, orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld):
        """"""
        return _swigibpy.EWrapper_orderStatus(self, orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld)
964066
function mergeChildren( from, into, refNode, forward ) {
		var child, itemDir;
		while ( ( child = from[ forward ? 'getLast' : 'getFirst' ]( elementType ) ) ) {
			if ( ( itemDir = child.getDirection( 1 ) ) !== into.getDirection( 1 ) )
				child.setAttribute( 'dir', itemDir );

			child.remove();

			refNode ? child[ forward ? 'insertBefore' : 'insertAfter' ]( refNode ) : into.append( child, forward );
		}
	}
510756
protected void mergeExistedElement(XmlElement src, XmlElement dest) {

    // 合并属性
    List<Attribute> srcAttributes = src.getAttributes();
    List<Attribute> destAttributes = dest.getAttributes();
    for (Attribute srcAttr : srcAttributes) {
      Attribute matched = null;
      for (Attribute destAttr : destAttributes) {
        if (StringUtils.equals(srcAttr.getName(), destAttr.getName()) &&
            StringUtils.equals(srcAttr.getValue(), destAttr.getValue())) {
          matched = destAttr;
        }
      }
      // 不存在则添加到目标元素的属性列表中
      if (matched == null) {
        destAttributes.add(srcAttributes.indexOf(srcAttr), srcAttr);
      }
    }

    // 重组子节点
    // reformationTheElementChilds(src);
    // reformationTheElementChilds(dest);

    // 暂时不做处理 ---留待后续添加
  }
1364101
function mergeOptions (
  parent,
  child,
  vm
) {
  {
    checkComponents(child);
  }

  if (typeof child === 'function') {
    child = child.options;
  }

  normalizeProps(child, vm);
  normalizeInject(child, vm);
  normalizeDirectives(child);

  // Apply extends and mixins on the child options,
  // but only if it is a raw options object that isn't
  // the result of another mergeOptions call.
  // Only merged options has the _base property.
  if (!child._base) {
    if (child.extends) {
      parent = mergeOptions(parent, child.extends, vm);
    }
    if (child.mixins) {
      for (let i = 0, l = child.mixins.length; i < l; i++) {
        parent = mergeOptions(parent, child.mixins[i], vm);
      }
    }
  }

  const options = {};
  let key;
  for (key in parent) {
    mergeField(key);
  }
  for (key in child) {
    if (!hasOwn(parent, key)) {
      mergeField(key);
    }
  }
  function mergeField (key) {
    const strat = strats[key] || defaultStrat;
    options[key] = strat(parent[key], child[key], vm, key);
  }
  return options
}
38789
public function finishOrder($orders_id){
        // Sanity check
        if(!isset($orders_id) || !is_int($orders_id)) throw new \Exception('Specificati comanda');

        // Set method and action
        $method = 'orders';
        $action = 'finishOrder';

        // Set data
        $data = array('orders_id' => $orders_id);

        // Send request and retrieve response
        $result = Dispatcher::send($method, $action, $data);

        return $result;
    }
149182
function merge(prev, current, next) {
  return prev
    .concat()
    .reverse()
    .concat([current], next)
}
1205817
function mergeAffixEmoticon(child, index, parent) {
  var children = child.children
  var position
  var node
  var prev

  if (children && children.length !== 0 && index !== 0) {
    position = -1

    while (children[++position]) {
      node = children[position]

      if (node.type === EMOTICON_NODE) {
        prev = parent.children[index - 1]

        prev.children = prev.children.concat(children.slice(0, position + 1))
        child.children = children.slice(position + 1)

        if (node.position && child.position && prev.position) {
          prev.position.end = node.position.end
          child.position.start = node.position.end
        }

        /* Next, iterate over the node again. */
        return index
      }

      if (node.type !== 'WhiteSpaceNode') {
        break
      }
    }
  }
}
895325
def batchcancel_orders(self, order_ids: list, _async=False):
        
        assert isinstance(order_ids, list)
        params = {'order-ids': order_ids}
        path = f'/v1/order/orders/batchcancel'
        return api_key_post(params, path, _async=_async)
1300455
def cancel_order(self, order_id: str) -> str:
        """"""
        self.log.debug(f'Canceling order id={order_id} on {self.name}')

        if self.dry_run:  # Don't cancel if dry run
            self.log.warning(f'DRY RUN: Order cancelled on {self.name}: id={order_id}')
            return order_id

        try:  # Cancel order
            self._cancel_order(order_id)
        except Exception as e:
            raise self.exception(OrderNotFound, f'Failed to cancel order: id={order_id}', e) from e

        self.log.info(f'Order cancelled on {self.name}: id={order_id}')
        return order_id