@param string $v
@param string $cb

@return string
767133
private function batch($v, $cb)
    {
        $functionList = explode('|', $cb);
        foreach ($functionList as $f) {
            if ('escape' === $f) {
                $v = $this->e($v);
                continue;
            }
            if (\array_key_exists($f, $this->callbackList)) {
                $f = $this->callbackList[$f];
            } else {
                if (!\function_exists($f)) {
                    throw new TplException(sprintf('function "%s" does not exist', $f));
                }
            }
            $v = \call_user_func($f, $v);
        }

        return $v;
    }
960713
public function sub($id, $obj, $cb)
    {
        if (!isset($this->events[$id])) {
            return false;
        }
        return $this->events[$id]->sub($obj, $cb);
    }
982234
function(link, cb){
            var options = {
                host: urlArr.hostname,
                port: urlArr.port,
                path: urlArr.path+"?link="+encodeURIComponent(link),
                method: 'GET'
            };
            
            var getRequest = protocol.request(options, function(res){
                var result = "";
                
                if(res.statusCode === 200){
                    res.on('error', function(error) {
                        if(typeof cb === "function")
                            cb(error);
                    });

                    res.on('data', function (chunk) {
                        result += chunk;
                    });

                    res.on('end', function (chunk) {
                        if(typeof cb === "function"){
                            var resultObj = JSON.parse(result);
                            var err = (resultObj.status === "error") ? resultObj["msg"] : null
                            cb(err, resultObj);
                        }                        
                    });
                }
                else{
                    if(typeof cb === "function")
                        cb("Request return HTTP "+res.statusCode);
                }
            });
            
            getRequest.end();
        }
1216580
private static function cvc($str)
    {
        $c = self::$regex_consonant;
        $v = self::$regex_vowel;

        return     preg_match("#($c$v$c)$#", $str, $matches)
               and strlen($matches[1]) == 3
               and $matches[1]{2} != 'w'
               and $matches[1]{2} != 'x'
               and $matches[1]{2} != 'y';
    }
467338
protected function exportVar($i, $v)
    {
        if (is_string($v) || is_bool($v) || is_numeric($v)) {
            return $i . htmlentities(var_export($v, true)) . '<br />';
        } elseif (is_null($v)) {
            return $i . 'null<br />';
        } elseif (is_resource($v)) {
            return $i . 'resource(' . get_resource_type($v) . ')<br />';
        } else {
            return $i . htmlentities(var_export($v, true)) . '<br />';
        }
    }
681312
protected static function get_sanitize_callback( $sanitize_cb ) {
		/**
		 * Filter the value before it is saved.a
		 *
		 * @param bool|mixed     $check      The check variable.
		 * @param mixed          $value      The value to be saved to this field.
		 * @param int            $object_id  The ID of the object where the value will be saved.
		 * @param array          $field_args The current field's arguments.
		 * @param \CMB2_Sanitize $sanitizer  The `CMB2_Sanitize` object.
		 *
		 * @return mixed
		 */
		return function( $check, $value, $object_id, $field_args, $sanitizer ) use ( $sanitize_cb ) {
			if ( $field_args['repeatable'] ) {
				return Utils::filter_blank(
					is_array( $value ) ? array_map( $sanitize_cb, $value ) : []
				);
			}

			return $sanitize_cb( $value );
		};
	}
840692
public function findAndModify($p, $cb)
    {
        $p['col'] = $this->name;
        $this->pool->findAndModify($p, $cb);
    }
205450
public function sum($cb = null)
    {
        $sum = 0;

        $this->recursive(
            $this->storage,
            function ($value) use (& $sum) {
                if (is_numeric($value)) {
                    $sum += $value;
                }
            }
        );

        if ($cb !== null) {
            call_user_func_array($cb, [$sum]);
        }

        return $sum;
    }
1238571
function DoDirectPayment($cc, $cvv2 = '', $exp, $fname = null, $lname = null, $cc_type, $options = array(), $nvp = array() ) {
    $values = $options;
    $values['ACCT'] = $cc;
    if ($cvv2 != '') $values['CVV2'] = $cvv2;
    $values['FIRSTNAME'] = $fname;
    $values['LASTNAME'] = $lname;
    if (isset($values['NAME'])) unset ($values['NAME']);

    if ($this->_mode == 'payflow') {
      $values['EXPDATE'] = $exp;
      $values['TENDER'] = 'C';
      $values['TRXTYPE'] = $this->_trxtype;
      $values['VERBOSITY'] = 'MEDIUM';
      $values['NOTIFYURL'] = zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true);
    } elseif ($this->_mode == 'nvp') {
      $values = array_merge($values, $nvp);
      if (isset($values['ECI'])) {
        $values['ECI3DS'] = $values['ECI'];
        unset($values['ECI']);
      }
      $values['CREDITCARDTYPE'] = ($cc_type == 'American Express') ? 'Amex' : $cc_type;
      $values['NOTIFYURL'] = urlencode(zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true));
      if (!isset($values['PAYMENTACTION'])) $values['PAYMENTACTION'] = ($this->_trxtype == 'S' ? 'Sale' : 'Authorization');

      if (isset($values['COUNTRY'])) unset ($values['COUNTRY']);
      if (isset($values['COMMENT1'])) unset ($values['COMMENT1']);
      if (isset($values['COMMENT2'])) unset ($values['COMMENT2']);
      if (isset($values['CUSTREF'])) unset ($values['CUSTREF']);
    }
    $this->values = $values;
    $this->notify('NOTIFY_PAYPAL_DODIRECTPAYMENT');
    ksort($this->values);
    return $this->_request($this->values, 'DoDirectPayment');
  }
1033167
public function filter($cb)
    {
        $r = [];

        foreach ($this->storage as $key => $value) {
            if (call_user_func_array($cb, [$value, $key])) {
                $r[] = $this->storage[$key];
            }
        }

        return new Collection($r);
    }
77674
protected function arraySort(callable $cb = null)
    {
        $ar = $this->toArray();
        if ($cb) {
            usort($ar, $cb);
        } else {
            sort($ar);
        }
        return static::fromArray($ar);
    }
151275
public function toArray($var = null, $key = null, $rows = [], $cb = null) {
        if (!$this->performed) {
            $this->select();
        }
        $rows = is_array($rows) ? $rows : [];
        if (is_array($var)) {
            $rows = $var;
            $var  = null;
        }
        if ($var == null && $key == null) {
            if ($rows) {
                foreach ($rows as $row) {
                    if (is_array($row)) {
                        array_unshift($this->resultSets, $row);
                    }
                }
            }

            return $this->resultSets;
        } else if ($var != null) {
            if ($cb instanceof \Closure) {
                foreach ($this->resultSets as $row) {
                    $value = $row [ $var ];
                    if ($key != null && isset ($row [ $key ])) {
                        $id           = $row [ $key ];
                        $rows [ $id ] = $cb($value, $id);
                    } else {
                        $rows [] = $cb($value);
                    }
                }
            } else {
                foreach ($this->resultSets as $row) {
                    $value = $row [ $var ];
                    if ($key != null && isset ($row [ $key ])) {
                        $id           = $row [ $key ];
                        $rows [ $id ] = $value;
                    } else {
                        $rows [] = $value;
                    }
                }
            }

            return $rows;
        } else if ($key != null) {
            if ($cb instanceof \Closure) {
                foreach ($this->resultSets as $row) {
                    $id           = $row [ $key ];
                    $rows [ $id ] = $cb($row);
                }
            } else {
                foreach ($this->resultSets as $row) {
                    $id           = $row [ $key ];
                    $rows [ $id ] = $row;
                }
            }

            return $rows;
        }

        return [];
    }
468203
protected function acquire($cb)
    {
        $this->appInstance->getkey('error:' . $this->sessId, function ($redis) use ($cb) {
            if (!$redis) {
                $this->internalServerError();
                return;
            }
            if ($redis->result !== null) {
                $this->error((int)$redis->result);
                return;
            }
            if ($this->appInstance->getLocalSubscribersCount('w8in:' . $this->sessId) > 0) {
                $this->anotherConnectionStillOpen();
                return;
            }
            $this->appInstance->publish('w8in:' . $this->sessId, '', function ($redis) use ($cb) {
                if (!$redis) {
                    $this->internalServerError();
                    return;
                }
                if ($redis->result > 0) {
                    $this->anotherConnectionStillOpen();
                    return;
                }
                $this->appInstance->subscribe('w8in:' . $this->sessId, [$this, 'w8in'], function ($redis) use ($cb) {
                    if (!$redis) {
                        $this->internalServerError();
                        return;
                    }
                    if ($this->appInstance->getLocalSubscribersCount('w8in:' . $this->sessId) > 1) {
                        $this->anotherConnectionStillOpen();
                        return;
                    }
                    $this->appInstance->publish('w8in:' . $this->sessId, '', function ($redis) use ($cb) {
                        if (!$redis) {
                            $this->internalServerError();
                            return;
                        }
                        if ($redis->result > 1) {
                            $this->anotherConnectionStillOpen();
                            return;
                        }
                        if ($this->appInstance->getLocalSubscribersCount('w8in:' . $this->sessId) > 1) {
                            $this->anotherConnectionStillOpen();
                            return;
                        }
                        $cb === null || $cb();
                    });
                });
            });
        });
    }
1218426
public function getkey($key, $cb = null)
    {
        $this->redis->get($this->config->redisprefix->value . $key, $cb);
    }
776521
public static WriteStreamOld openWrite(CharBuffer cb)
  {
    com.caucho.v5.vfs.VfsStringWriter s = new com.caucho.v5.vfs.VfsStringWriter(cb);
    WriteStreamOld os = new WriteStreamOld(s);
    
    try {
      os.setEncoding("utf-8");
    } catch (Exception e) {
    }

    return os;
  }
288311
public function getSize($cb, $uid = null)
    {
        $this->onResponse->push($cb);
        if ($uid) {
            $this->fetch('RFC822.SIZE', $uid, null, true, self::TAG_SIZE);
        } else {
            $this->fetch('RFC822.SIZE', 1, INF, true, self::TAG_SIZE);
        }
    }
991635
public static function toString ($v, $enhanced = true)
  {
    if (isset($v)) {
      if ($v instanceof \Closure)
        return '<i>(native code)</i>';
      elseif (is_bool ($v))
        return $v ? '<span class=__type>true</span>' : '<span class=__type>false</span>';
      elseif (is_string ($v)) {
        $l = strlen (self::RAW_TEXT);
        return substr ($v, 0, $l) == self::RAW_TEXT ? substr ($v, $l)
          : sprintf ("<i>'</i>%s<i>'</i>", htmlspecialchars ($v));
      }
      elseif ($v instanceof \PowerString)
        return sprintf ("<i>(</i>%s<i>)'</i>%s<i>'</i>",
          $enhanced ? self::shortenType (\PowerString::class) : typeOf ($v),
          htmlspecialchars ($v));
      elseif (!is_array ($v) && !is_object ($v))
        return htmlspecialchars (str_replace ('    ', '  ', trim (print_r ($v, true))));
    }
    return $enhanced ? sprintf ('<span class=__type>%s</span>', self::getType ($v)) : typeOf ($v);
  }