compile list of all headers belonging to all specified groups
        eliminate all headers that are already included
        add any req'd drop-down menus
        return errors
330894
def add_new_header_groups(self, groups):
        
        already_present = []
        for group in groups:
            col_names = self.dm[self.dm['group'] == group].index
            for col in col_names:
                if col not in self.grid.col_labels:
                    col_number = self.grid.add_col(col)
                    # add to appropriate headers list
                    # add drop down menus for user-added column
                    if col in self.contribution.vocab.vocabularies:
                        self.drop_down_menu.add_drop_down(col_number, col)
                    elif col in self.contribution.vocab.suggested:
                        self.drop_down_menu.add_drop_down(col_number, col)
                    elif col in ['specimen', 'sample', 'site', 'location',
                                 'specimens', 'samples', 'sites']:
                        self.drop_down_menu.add_drop_down(col_number, col)
                    elif col == 'experiments':
                        self.drop_down_menu.add_drop_down(col_number, col)
                    if col == "method_codes":
                        self.drop_down_menu.add_method_drop_down(col_number, col)
                else:
                    already_present.append(col)
        return already_present
287364
function setHeaders (res, headers) {
  if (!headers) {
    return
  }

  var keys = Object.keys(headers)
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i]
    res.setHeader(key, headers[key])
  }
}
410551
protected function compile()
  {

    global $objPage;


		if (FE_USER_LOGGED_IN)
    {
      $this->import('FrontendUser', 'User');
    }

    switch ($this->strType)
    {
      case "track":
        $objData = $this->Database->prepare("SELECT * FROM tl_c4g_tracking_tracks WHERE id=? AND member=?")
                               ->execute($this->intTrackId, $this->User->id);
        break;
      case "poi":
        $objData = $this->Database->prepare("SELECT * FROM tl_c4g_tracking_pois WHERE id=? AND member=?")
                               ->execute($this->intPoiId, $this->User->id);
        break;
    }

		if ($objData->numRows == 0)
		{
			// Do not index or cache the page
			$objPage->noSearch = 1;
			$objPage->cache = 0;

			// Send a 404 header
			header('HTTP/1.1 404 Not Found');
			$this->Template->error = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
			return;
		}


		if (!$this->editWithoutFilter && (FE_USER_LOGGED_IN && $this->User->id!=$objData->member))
		{
			// Do not index or cache the page
			$objPage->noSearch = 1;
			$objPage->cache = 0;

			// Send a 404 header
			header('HTTP/1.1 404 Not Found');
			$this->Template->error = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
			return;
		}

		$arrFields = $this->getFields($objData);
		$arrFieldsForTemplate = array();

		foreach ($arrFields as $arrField)
    {

      $strClass = $GLOBALS['TL_FFL'][$arrField['inputType']];
      if (!$this->classFileExists($strClass))
      {
          continue;
      }

      $arrField['mandatory'] = $arrField['eval']['mandatory'];
      $arrField['tableless'] = true;

      $objWidget = new $strClass($arrField);

      if ($arrField['eval']['rgxp'])
      {
        $objWidget->rgxp = $arrField['eval']['rgxp'];
      }

      if ($arrField['eval']['maxlength'])
      {
        $objWidget->maxlength = $arrField['eval']['maxlength'];
      }

      if (!$arrField['id'] && $arrField['name'])
      {
        $objWidget->id = $arrField['name'];
      }

      if ($arrField['eval']['toggleFields'])
      {
        $objWidget->class = $objWidget->class ? ($objWidget->class . " toggle") : "toggle";
      }

      if ($arrField['eval']['toggleBy'])
      {
        $strToggleByClass = "toggleBy" . ucfirst($arrField['eval']['toggleBy']);

        $blnIsVisible = false;

        $arrToggleField = $this->arrFields[$arrField['eval']['toggleBy']];

        if ($arrToggleField['inputType'] == "checkbox")
        {
          if (\Input::post($arrToggleField['name']))
          {
            $blnIsVisible = true;

            if (!$arrField['eval']['mandatory'] && $arrField['eval']['toggleMandatory'])
            {
              $objWidget->mandatory = true;
            }
          }
        }

        if (!$blnIsVisible)
        {
          $strToggleByClass .= " toggleInvisible";
        }
        else
        {
          $strToggleByClass .= " toggleVisible";
        }

        $objWidget->class = $objWidget->class ? ($objWidget->class . " " . $strToggleByClass) : $strToggleByClass;
      }

      if ($this->Input->post('FORM_SUBMIT') == 'formTrackEdit')
      {
          $objWidget->validate();
          if ($objWidget->hasErrors())
          {
            $this->doNotSubmit = true;
          }
      }

      if ($arrField['eval']['toggleMandatory'] && !$objWidget->mandatory)
      {
        $objWidget->label = '<span class="invisible">Pflichtfeld</span>' . $arrField['label'] . '<span class="mandatory">*</span>';
      }

      $this->Template->fields .= $objWidget->parse();
      $arrFieldsForTemplate[$arrField['name']] = $objWidget->parse();
    }

    if ($this->Input->post('FORM_SUBMIT') == 'formTrackEdit' && !$this->doNotSubmit)
    {
      // Check whether there is a jumpTo page

      $arrForDatabaseUpdate = array();
      $arrForDatabaseUpdate['name'] = \Input::post('name');
      $arrForDatabaseUpdate['visibility'] = \Input::post('visibility');
      $arrForDatabaseUpdate['comment'] = \Input::post('comment');
      if ($arrForDatabaseUpdate['visibility'] == "membergroups")
      {
        $arrForDatabaseUpdate['groups'] = serialize(\Input::post('visibilityGroups'));
      }
      else
      {
        $arrForDatabaseUpdate['groups'] = null;
      }

      if (\Input::post('deleteEntry') == 'delete')
      {
        $arrForDatabaseUpdate['forDelete'] = true;
      }
      else
      {
        $arrForDatabaseUpdate['forDelete'] = false;
      }

      switch ($this->strType)
      {
        case "track":
          $this->Database->prepare("UPDATE tl_c4g_tracking_tracks %s WHERE id=?")
                     ->set($arrForDatabaseUpdate)
                     ->execute($this->intTrackId);
          break;
        case "poi":
          $this->Database->prepare("UPDATE tl_c4g_tracking_pois %s WHERE id=?")
                     ->set($arrForDatabaseUpdate)
                     ->execute($this->intPoiId);
          break;
      }



    	if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null)
    	{
    		$this->jumpToOrReload($objJumpTo->row());
    	}

    	$this->reload();
    }

    $this->Template->fieldData = $arrFieldsForTemplate;
    $this->Template->action = "";
    $this->Template->formId = "formTrackEdit";
    $this->Template->method = "post";
    $this->Template->enctype = "";
    $this->Template->attributes = "";
    //$this->Template->novalidate = "novalidate";
    $this->Template->formSubmit = "formTrackEdit";

    $this->Template->submitTitle = "Speichern";


  }
12531
def _compile_all_contracts(self) -> Dict:
        
        ret = {}
        old_working_dir = Path.cwd()
        chdir(_BASE)

        def relativise(path):
            return path.relative_to(_BASE)
        import_dir_map = [
            '%s=%s' % (k, relativise(v))
            for k, v in self.contracts_source_dirs.items()
        ]
        import_dir_map.insert(0, '.=.')  # allow solc to compile contracts in all subdirs
        try:
            for contracts_dir in self.contracts_source_dirs.values():
                res = compile_files(
                    [str(relativise(file)) for file in contracts_dir.glob('*.sol')],
                    output_values=PRECOMPILED_DATA_FIELDS + ['ast'],
                    import_remappings=import_dir_map,
                    optimize=False,
                )

                # Strip `ast` part from result
                # TODO: Remove after https://github.com/ethereum/py-solc/issues/56 is fixed
                res = {
                    contract_name: {
                        content_key: content_value
                        for content_key, content_value in contract_content.items()
                        if content_key != 'ast'
                    } for contract_name, contract_content in res.items()
                }
                ret.update(_fix_contract_key_names(res))
        except FileNotFoundError as ex:
            raise ContractSourceManagerCompilationError(
                'Could not compile the contract. Check that solc is available.',
            ) from ex
        finally:
            chdir(old_working_dir)
        return ret
282164
def fix_django_headers(meta):
	
	ret = {}
	for k, v in meta.items():
		if k.startswith("HTTP_"):
			k = k[len("HTTP_") :]
		elif k not in ("CONTENT_LENGTH", "CONTENT_TYPE"):
			# Skip CGI garbage
			continue

		ret[k.lower().replace("_", "-")] = v

	return ret
271383
def beautify_headers(headers)
      headers.inject({}) { |out, (key, value)| out[key.gsub(/-/, '_').downcase.to_sym] = value; out }
    end
1248367
def compile_results
      utf_status = @valid_rows.map { |hsh| hsh[:utf_status] }
      mapped_details = utf_status.map { |str| str.split(', ') }.flatten.compact
      groups = make_groups_from_array(mapped_details)
      wchar = groups['wchar']
      perfect = groups['perfect']

      header_row_count = @headers.any? ? 1 : 0

      utf_result = {
        stats: { total_rows: @row_id, header_row: header_row_count, valid_rows: @valid_rows.count, error_rows: @error_rows.count, defective_rows: @defective_rows.count, perfect_rows: perfect, encoded_rows: @encoded_rows.count, wchar_rows: wchar },
        data: { valid_data: @valid_rows, encoded_data: @encoded_rows, defective_data: @defective_rows, error_data: @error_rows }
      }
      utf_result
    end
157920
function defineTaskGroups() {
  const gulpTasks = gulp.tree({ deep: false }).nodes
  const gulpMode = options.parallel ? gulp.parallel : gulp.series
  const groups = Object.keys(options.groups).map(key => [
    key.trim().replace(/[^a-z]+/gi, ''),
    options.groups[key]
  ])

  groups.forEach(group => {
    const [name, value] = group
    let children = []

    if (Array.isArray(value)) {
      children = value
    } else if (typeof value === 'function') {
      children = gulpTasks
        .filter(value)
        // Group tasks should not call themselves/other groups
        .filter(child => !groups.includes(child))
    } else {
      return
    }

    if (children.length === 0) {
      gulp.task(name, done => {
        handleError(new Error(`No tasks found in '${name}' group`))
        done()
      })
    } else {
      gulp.task(name, gulpMode.apply(null, children))
    }
  })
}
1139817
def with_headers(self, headers=None, **params):
                
        if isinstance(headers, (tuple, list)):
            headers = dict(headers)

        if params:
            if isinstance(headers, dict):
                headers.update(params)
            elif headers is None:
                headers = params

        self._headers.update(headers)
        return self
304182
def compile_all(self):
        

        # Solidity input JSON
        solc_input = self.get_solc_input()

        # Compile the contracts
        real_path = os.path.realpath(self.contracts_dir)
        compilation_result = compile_standard(solc_input, allow_paths=real_path)

        # Create the output folder if it doesn't already exist
        os.makedirs(self.output_dir, exist_ok=True)

        # Write the contract ABI to output files
        compiled_contracts = compilation_result['contracts']
        for contract_file in compiled_contracts:
            for contract in compiled_contracts[contract_file]:
                contract_name = contract.split('.')[0]
                contract_data = compiled_contracts[contract_file][contract_name]

                contract_data_path = self.output_dir + '/{0}.json'.format(contract_name)
                with open(contract_data_path, "w+") as contract_data_file:
                    json.dump(contract_data, contract_data_file)
538400
function initSubHeaders () {
    var each = [].forEach
    var main = document.getElementById('main')
    var header = document.getElementById('header')
    var sidebar = document.querySelector('.sidebar')
    var content = document.querySelector('.content')

    // build sidebar
    var currentPageAnchor = sidebar.querySelector('.sidebar-link.current')
    var isAPI = document.querySelector('.content').classList.contains('api')
    if (currentPageAnchor || isAPI) {
      var allHeaders = []
      var sectionContainer
      if (isAPI) {
        sectionContainer = document.querySelector('.menu-root')
      } else {
        sectionContainer = document.createElement('ul')
        sectionContainer.className = 'menu-sub'
        currentPageAnchor.parentNode.appendChild(sectionContainer)
      }
      var headers = content.querySelectorAll('h2')
      if (headers.length) {
        each.call(headers, function (h) {
          sectionContainer.appendChild(makeLink(h))
          var h3s = collectH3s(h)
          allHeaders.push(h)
          allHeaders.push.apply(allHeaders, h3s)
          if (h3s.length) {
            sectionContainer.appendChild(makeSubLinks(h3s, isAPI))
          }
        })
      } else {
        headers = content.querySelectorAll('h3')
        each.call(headers, function (h) {
          sectionContainer.appendChild(makeLink(h))
          allHeaders.push(h)
        })
      }

      var animating = false
      sectionContainer.addEventListener('click', function (e) {
        e.preventDefault()
        if (e.target.classList.contains('section-link')) {
          sidebar.classList.remove('open')
          setActive(e.target)
          animating = true
          setTimeout(function () {
            animating = false
          }, 400)
        }
      }, true)

      // make links clickable
      allHeaders.forEach(makeHeaderClickable)

      smoothScroll.init({
        speed: 400,
        offset: 0
      })
    }

    var hoveredOverSidebar = false
    sidebar.addEventListener('mouseover', function () {
      hoveredOverSidebar = true
    })
    sidebar.addEventListener('mouseleave', function () {
      hoveredOverSidebar = false
    })

    // listen for scroll event to do positioning & highlights
    window.addEventListener('scroll', updateSidebar)
    window.addEventListener('resize', updateSidebar)

    function updateSidebar () {
      var doc = document.documentElement
      var top = doc && doc.scrollTop || document.body.scrollTop
      if (animating || !allHeaders) return
      var last
      for (var i = 0; i < allHeaders.length; i++) {
        var link = allHeaders[i]
        if (link.offsetTop > top) {
          if (!last) last = link
          break
        } else {
          last = link
        }
      }
      if (last)
      setActive(last.id, !hoveredOverSidebar)
    }

    function makeLink (h) {
      var link = document.createElement('li')
      var text = h.textContent.replace(/\(.*\)$/, '')
      link.innerHTML =
        '<a class="section-link" data-scroll href="#' + h.id + '">' +
          htmlEscape(text) +
        '</a>'
      return link
    }

    function htmlEscape (text) {
      return text
        .replace(/&/g, '&amp;')
        .replace(/"/g, '&quot;')
        .replace(/'/g, '&#39;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
    }

    function collectH3s (h) {
      var h3s = []
      var next = h.nextSibling
      while (next && next.tagName !== 'H2') {
        if (next.tagName === 'H3') {
          h3s.push(next)
        }
        next = next.nextSibling
      }
      return h3s
    }

    function makeSubLinks (h3s, small) {
      var container = document.createElement('ul')
      if (small) {
        container.className = 'menu-sub'
      }
      h3s.forEach(function (h) {
        container.appendChild(makeLink(h))
      })
      return container
    }

    function setActive (id, shouldScrollIntoView) {
      var previousActive = sidebar.querySelector('.section-link.active')
      var currentActive = typeof id === 'string'
        ? sidebar.querySelector('.section-link[href="#' + id + '"]')
        : id
      if (currentActive !== previousActive) {
        if (previousActive) previousActive.classList.remove('active')
        currentActive.classList.add('active')
        if (shouldScrollIntoView) {
          var currentPageOffset = currentPageAnchor
            ? currentPageAnchor.offsetTop - 8
            : 0
          var currentActiveOffset = currentActive.offsetTop + currentActive.parentNode.clientHeight
          var sidebarHeight = sidebar.clientHeight
          var currentActiveIsInView = (
            currentActive.offsetTop >= sidebar.scrollTop &&
            currentActiveOffset <= sidebar.scrollTop + sidebarHeight
          )
          var linkNotFurtherThanSidebarHeight = currentActiveOffset - currentPageOffset < sidebarHeight
          var newScrollTop = currentActiveIsInView
            ? sidebar.scrollTop
            : linkNotFurtherThanSidebarHeight
              ? currentPageOffset
              : currentActiveOffset - sidebarHeight
          sidebar.scrollTop = newScrollTop
        }
      }
    }

    function makeHeaderClickable (link) {
      var wrapper = document.createElement('a')
      wrapper.href = '#' + link.id
      wrapper.setAttribute('data-scroll', '')
      link.parentNode.insertBefore(wrapper, link)
      wrapper.appendChild(link)
    }
  }
1011897
function groupIncludes(includes, body) {
    var root = rootName(body);
    var requestsByType = {};

    _.each(includes, function(include) {
      var type = ((body.links && body.links[root + "." + include]) || {}).type,
        split = include.split(".");

      if (_.isUndefined(body.links) || _.isUndefined(body.links[root + "." + split[0]])) {
        return;
      }

      if (type && body.linked[type] && body.linked[type] !== "external") {
        // The type exists but is not an external reference exit.
        return;
      }

      var ancestorType = body.links[root + "." + split[0]].type;
      var ids = linkedIds(body[root], split[0]);
      if (ids.length) {
        var requestData = requestsByType[ancestorType] || {ids: [], includes: []};
        requestData.ids = requestData.ids.concat(ids);
        requestData.includes.push(split);
        requestsByType[ancestorType] = requestData;
      }
    });

    return requestsByType;
  }
1064037
def write_headers(self):
        
        hlist = []
        for h in self.headers:
            hlist.append("{}: {}".format(h.key, h.value))
        return hlist
104620
private function genericDefaultHeaders()
    {

        //Cache-Control: no-cache
        $this->addRawHeaderLine('Cache-Control', 'no-cache');

        //Pragma: no-cache
        $this->addRawHeaderLine('Pragma', 'no-cache');

        //Connection: keep-alive
        $this->addRawHeaderLine('Connection', 'keep-alive');

        //Upgrade-Insecure-Requests: 1
        $this->addRawHeaderLine('Upgrade-Insecure-Requests', '1');

        //User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
        $this->addRawHeaderLine('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36');

        //Accept-Encoding: gzip, deflate Only support the 2 types
        $this->addRawHeaderLine('Accept-Encoding', ['gzip', 'deflate']);

        //Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
        $this->addRawHeaderLine('Accept-Language', ['zh-CN', 'zh;q=0.8', 'zh-TW;q=0.7', 'zh-HK;q=0.5', 'en-US;q=0.3', 'en;q=0.2']);

    }
66046
def ensure_headers
      missing = missing_headers
      return if missing.size == 0

      message = "Compilation cannot proceed as the following header files are missing:\n" + missing.join("\n") 
      raise Error.new(message)
    end
888309
function compileAllFiles (src, isDebug, options)
{
    glob(src,
        function (err, files)
        {
            if (err) throw err;

            for (var i = 0, l = files.length; i < l; i++)
            {
                // only start compilation at root files
                if (sassHelpers.isRootFile(files[i]))
                {
                    compileSingleFile(files[i], isDebug, options);
                }
            }
        }
    );
}
274293
def add_conditional_headers(req, opts)

      # if path is cached send since and/or match

      e = @cache[opts[:c_uri]]

      return unless e # not cached

      req['If-Modified-Since'] = e.lastmod if e.lastmod
      req['If-None-Match'] = e.etag if e.etag

      opts[:c_cached] = e
    end