Sets a global variable for tracking the timer accross multiple
    files
334857
def code_timer(reset=False):
    ''' '''

    global CODE_TIMER
    if reset:
        CODE_TIMER = CodeTimer()
    else:
        if CODE_TIMER is None:
            return CodeTimer()
        else:
            return CODE_TIMER
33700
def set_to_current(self, ):
        
        cur = self.get_current_file()
        if cur is not None:
            self.set_selection(cur)
        else:
            self.init_selection()
750181
def use_file(self, enabled=True,
                 file_name=None,
                 level=logging.WARNING,
                 when='d',
                 interval=1,
                 backup_count=30,
                 delay=False,
                 utc=False,
                 at_time=None,
                 log_format=None,
                 date_format=None):
        
        if enabled:
            if not self.__file_handler:
                assert file_name, 'File name is missing!'

                # Create new TimedRotatingFileHandler instance
                kwargs = {
                    'filename': file_name,
                    'when': when,
                    'interval': interval,
                    'backupCount': backup_count,
                    'encoding': 'UTF-8',
                    'delay': delay,
                    'utc': utc,
                }

                if sys.version_info[0] >= 3:
                    kwargs['atTime'] = at_time

                self.__file_handler = TimedRotatingFileHandler(**kwargs)

                # Use this format for default case
                if not log_format:
                    log_format = '%(asctime)s %(name)s[%(process)d] ' \
                                 '%(programname)s/%(module)s/%(funcName)s[%(lineno)d] ' \
                                 '%(levelname)s %(message)s'

                # Set formatter
                formatter = logging.Formatter(fmt=log_format, datefmt=date_format)
                self.__file_handler.setFormatter(fmt=formatter)

                # Set level for this handler
                self.__file_handler.setLevel(level=level)

                # Add this handler to logger
                self.add_handler(hdlr=self.__file_handler)
        elif self.__file_handler:
            # Remove handler from logger
            self.remove_handler(hdlr=self.__file_handler)
            self.__file_handler = None
416420
function watchFile(file, callback) {
	let absolutePath = File.find(file).path();
	let watcher = chokidar
		.watch(
			absolutePath,
			{
				persistent: true
			}
		)
		.on(
			'change',
			function () {
				if (typeof callback === 'function') {
					callback(file);
				}
				watcher.unwatch(absolutePath);
				watchFile(file, callback);
			}
		)
	;
}
540125
def on_add(self, widget, data=None):
        
        gv_name = "new_global_%s" % self.global_variable_counter
        self.global_variable_counter += 1
        try:
            self.model.global_variable_manager.set_variable(gv_name, None)
        except (RuntimeError, AttributeError, TypeError) as e:
            logger.warning("Addition of new global variable '{0}' failed: {1}".format(gv_name, e))
        self.select_entry(gv_name)
        return True
1267917
def add_global_variable(*pVariable)
      pVariable.flatten.each do |element|
        next unless element.is_a?(Languages::VariableGlobalData)
        @global_variables.push(element)
      end
    end
561560
def refresh( self ):
        
        self.clear()
        
        for i, filename in enumerate(self.filenames()):
            name   = '%i. %s' % (i+1, os.path.basename(filename))
            action = self.addAction(name)
            action.setData(wrapVariant(filename))
380751
public void setGlobalVariable(String name, GlobalVariable variable) {

		assert (name != null);

		if (variable != null) {
			globalVariables.put(name, variable);
		} else {
			globalVariables.remove(name);
		}
	}
1084431
def add_global(self, **values):
        """"""
        with self._lock:
            self._ensure_global()
            self._gpayload.update(**values)
272340
def globals(self):
        """"""
        defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)

        while defglobal != ffi.NULL:
            yield Global(self._env, defglobal)

            defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
202437
function setCurrent (state, type, value) {
  let dest
  if (type === 'file') {
    dest = utils.getRefFilePath(value)
  }

  if (dest) {
    state.current = dest
  }
}
855944
function Timer(timer, clear, fn) {
      this.clear = clear;
      this.timer = timer;
      this.fns = [fn];
    }
994936
def globally_paused?
      paused = false
      current_path = '/api/v1/variables?name=wip_pause_global'
      begin
        res = @conn.get(current_path)
        paused = res['wip_pause_global']
      rescue SFRest::SFError => error
        paused = false if error.message =~ /Variable not found/
      end
      paused
    end
1192169
def track(context, file_names):
    
    context.obj.find_repo_type()
    for fn in file_names:
        context.obj.call([context.obj.vc_name, 'add', fn])
93135
def _set_global_vars(metadata):
    
    fnames = collections.defaultdict(list)
    for sample in metadata.keys():
        for k, v in metadata[sample].items():
            if isinstance(v, six.string_types) and os.path.isfile(v):
                v = _expand_file(v)
                metadata[sample][k] = v
                fnames[v].append(k)
    global_vars = {}
    # Skip global vars -- more confusing than useful
    # loc_counts = collections.defaultdict(int)
    # global_var_sub = {}
    # for fname, locs in fnames.items():
    #     if len(locs) > 1:
    #         loc_counts[locs[0]] += 1
    #         name = "%s%s" % (locs[0], loc_counts[locs[0]])
    #         global_var_sub[fname] = name
    #         global_vars[name] = fname
    # for sample in metadata.keys():
    #     for k, v in metadata[sample].items():
    #         if isinstance(v, six.string_types) and v in global_var_sub:
    #             metadata[sample][k] = global_var_sub[v]
    return metadata, global_vars
402541
def process_files():
    

    with enlighten.Counter(total=100, desc='Simple', unit='ticks') as pbar:
        for num in range(100):  # pylint: disable=unused-variable
            time.sleep(0.05)
            pbar.update()
1251309
private function set_global_variable()
    {
        $var_name = "";
        
        if( null != $this->config->global_variable )
        {
            $var_name = $this->config->global_variable;
        }
        else
        {
            $var_name = $this->page->get_slug().'_options';
        }
        
        $GLOBALS[$var_name] = $this->options->get();
    }