Function do set links to watch

@param array setArr
@param function cb
@return void
322238
function(setArr, cb){
            if(typeof setArr === "string")
                var postData = querystring.stringify([setArr]);
            else if(typeof setArr === "object" || typeof setArr === "array")
                var postData = querystring.stringify(setArr);
            
            var options = {
                host: urlArr.hostname,
                path: "/set",
                port: urlArr.port,
                method: 'POST',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'Content-Length': Buffer.byteLength(postData)
                }
            };
                                    
            var postRequest = 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);
                }
            });
                        
            postRequest.write(postData);
            postRequest.end();
        }
1139094
function watch(arg_src_dir)
{
	console.info('Watching for change on: ' + arg_src_dir)
	
	const watch_settings = { ignored: /[\/\\]\./, persistent: true }
	var watcher = chokidar.watch(arg_src_dir, watch_settings)
	watcher.on('change', reload_file)
	
	return watcher
}
154205
function SetArr() {
  let arr = {}
  let set = {
    size: 0,
    clear() {
      set.size = 0
    },
    add(item) {
      let index = arr.indexOf(item)
      if (index !== -1) return arr
      arr.push(item)
      set.size = arr.length
      return set
    },
    delete(item) {
      let index = arr.indexOf(item)
      if (index === -1) return false
      arr.splice(index, 1)
      set.size = arr.length
      return true
    },
    [Symbol.iterator]: () => arr[Symbol.iterator]()
  }
  return set
}
1291016
function (pageRequest, cb) {
            var pageId = pageRequest.pageId;
            var forceReload = pageRequest.forceReload;
            if (!forceReload && pageId && pageId == this.currentPageId) {
                this.$callback(cb);
                if (this._navigationManager) {
                    this._navigationManager.update(pageRequest);
                    ariaUtilsJson.setValue(this._data, "pageInfo", pageRequest);
                }
            } else {
                this._previousPageCSS = this._currentPageCSS;
                this._currentPageCSS = [];
                this._pageProvider.loadPageDefinition(pageRequest, {
                    onsuccess : {
                        fn : this._getPageDependencies,
                        scope : this,
                        args : {
                            pageRequest : pageRequest,
                            cb : cb
                        }
                    },
                    onfailure : this._getErrorCallbackConfig([this.PAGE_NOT_AVAILABLE, pageId])
                });
            }
        }
1018802
public function setTimeout(callable $cb, float $timeout)
    {
        $triggerTime = microtime(true) + ($timeout);

        if (!$this->timers) {
            // Special case when the timers array was empty.
            $this->timers[] = [$triggerTime, $cb];

            return;
        }

        // We need to insert these values in the timers array, but the timers
        // array must be in reverse-order of trigger times.
        //
        // So here we search the array for the insertion point.
        $index = count($this->timers) - 1;
        while (true) {
            if ($triggerTime < $this->timers[$index][0]) {
                array_splice(
                    $this->timers,
                    $index + 1,
                    0,
                    [[$triggerTime, $cb]]
                );
                break;
            } elseif (0 === $index) {
                array_unshift($this->timers, [$triggerTime, $cb]);
                break;
            }
            --$index;
        }
    }
238378
function addWatcher(file, handler, callback)
{
  fs.stat(file, function(err, stat)
  {
    if (err) return callback(false);

    fs.watch(file, handler(file));

    callback(true, stat.mtime.getTime());
  });
}
1223973
public function watch()
    {
        $watcher = new Watcher();
        $watcher->watchPath(getcwd());

        $watcher->addListener(function() {
            $paths = implode(' ', self::$console->getPaths());
            $descriptor = [
                0 => ['pipe', 'r'],
                1 => ['pipe', 'w']
            ];

            // Rebuild option string, without watch
            $optionString = '';
            foreach (self::$console->options as $key => $val) {
                if ($key == 'watch') {
                    continue;
                } elseif ($val === true) { // test
                    $optionString .= "--$key ";
                } elseif ($val) {
                    $optionString .= "--$key $val ";
                }
            }

            // Run pho in another process and echo its stdout
            $procStr = "{$_SERVER['SCRIPT_FILENAME']} {$optionString} {$paths}";
            $process = proc_open($procStr, $descriptor, $pipes);

            if (is_resource($process)) {
                while ($buffer = fread($pipes[1], 16)) {
                    self::$console->write($buffer);
                }

                fclose($pipes[0]);
                fclose($pipes[1]);
                proc_close($process);
            }
        });

        // Ever vigilant
        $watcher->watch();
    }
791275
function watch(watchOptions) {

      var watcher = chokidar.watch(watchOptions.dirs, {
        ignoreInitial: true,
        ignored: /[/\\]\./
      });

      watcher.on('add', function(pathFile) {
        onWatcher(pathFile);
      });

      watcher.on('change', function(pathFile) {
        onWatcher(pathFile);
      });

      watcher.on('unlink', function(pathFile) {
        onWatcher(pathFile);
      });

      var updating = false;
      var queued = null;

      function onWatcher(pathFile) {

        if (updating) {
          queued = pathFile;
          return;
        }

        queued = null;
        updating = true;

        return Promise.resolve()
          .then(function() {
            return watchOptions.onFile(pathFile);
          })
          .then(function() {
            return Promise.delay(1000);
          })
          .then(function() {
            updating = false;
            if (queued) {
              return onWatcher(queued);
            }
          });
      }
    }
1067212
public function setPager ($total_count, $current_page, $url, $limit = PagerUtility::DISP_PER_PAGE, $options = []) {
 		$current_page	= $current_page ?: 1;
 		$options		= [
			'in_list_position'	=> $options['in_list_position']	?? 3,
			'max_link_disp'		=> $options['max_link_disp'] ?? 5,
 		];
 		$this->pager = PagerUtility::CreatePagerData($total_count, $current_page, $limit, $options);
 		$this->pager['enable']	= $total_count > $limit;
 		$this->pager['url']		= $url;

 		return $this->pager;
 	}
1286864
function watch(sourcePath, patterns, commands) {
  var isBusy = false;
  var isPending = false;
  var runnable = function() {
    if (isBusy) return (isPending = true);
    isBusy = true;
    run(commands, function(err) {
      if (err) console.error(err.stack || err);
      isBusy = false;
      if (isPending) runnable(isPending = false);
    });
  };
  chokidar.watch(patterns, {
    cwd: sourcePath,
    ignoreInitial: true
  }).on('add', runnable).on('change', runnable).on('unlink', runnable);
}
343682
function(callback) {
			var t = this;
	
			t._interval(callback);

			t.timer = setInterval(function() {		
				t._interval(callback);
			}, this.interval);
		}
290796
function setCallbackAsWatcherOf(callback, watchersSet) {
    if (!callback[WATCHER_IDENTIFIER]) {
        defineProperty(callback, WATCHER_IDENTIFIER, { watching: new Set() });

        defineProperty(callback, "stopWatchingAll", function(){
            callback[WATCHER_IDENTIFIER].watching.forEach(watcherList =>
                watcherList.delete(callback)
            );
            callback[WATCHER_IDENTIFIER].watching.clear();
        });
    }

    callback[WATCHER_IDENTIFIER].watching.add(watchersSet);
}
251952
protected function __linkPage($arguments)
	{
		if(isset($arguments[1]))
		{
			$this->limit($this->calcLimitStart($arguments[0], $arguments[1]),$arguments[1]);
		}
	}
319366
function run(element, cb) {
    return function level(error, content) {
      debug('Traversing children of element %s', element.name);

      if (sync) {
        return traverser(element, content, cb)();
      }

      setImmediate(traverser(element, content, cb));
    }
  }
398642
def set_callback(self, func):
        

        if isinstance(func, str if py3k else basestring) and func:
            self.arguments.update({'callback': '%s' % func})
        else:
            raise TwitterSearchException(1006)
986055
public function setScheduledLink(TimelineLinkEvent $event): void
    {
        $action = $event->getAction();

        if ('scheduled' != $action->getVerb()) {
            return;
        }

        $production = $action->getComponent('indirectComplement')->getData();
        $schedule = $action->getComponent('directComplement')->getData();
        $event->setLink($this->url_generator->generate('bkstg_schedule_read', [
            'id' => $schedule->getId(),
            'production_slug' => $production->getSlug(),
        ]));
    }
858771
function (args, cb) {

            this.setData(args.dataModel);
            var itemsInfo = args.itemsInfo;

            var res = this._mergeItemsAndSelectionInfo(itemsInfo.items, itemsInfo.selectedValues, itemsInfo.selectedIndex);
            this._setItems(res.items);

            this.json.setValue(this._data, "selectedIndex", res.selectedIndex);
            this.json.setValue(this._data, "selectedCount", res.selectedCount);
            // this.json.setValue(this._data, "selectedValues", res.selectedValues);

            if (itemsInfo.selectedValues == null) {
                this.setSelectedIndex(itemsInfo.selectedIndex);
            }
            var itemsView = new ariaTemplatesView(this._data.items);
            this.json.setValue(this._data, "itemsView", itemsView);

            if (this._data.activateSort) {
                itemsView.setSort(itemsView.SORT_ASCENDING, "sortByLabel", this._sortByLabel);
            }

            this.$callback(cb);

        }