text:
using namespace OpenRAVE;
using namespace util;

// TODO: configuration should know something about what dofs are part of SO(1), SO(2) etc for functions like RandomDOFValues

namespace trajopt {

void RobotAndDOF::SetDOFValues(const DblVec& dofs) {
  if (affinedofs != 0) {
    OR::Transform T;
    OR::RaveGetTransformFromAffineDOFValues(T, dofs.begin()+joint_inds.size(), affinedofs, rotationaxis, true);
    robot->SetTransform(T);
    if (joint_inds.size() > 0)
      robot->SetDOFValues(dofs, false, joint_inds);
  }
  else {
    robot->SetDOFValues(dofs, false, joint_inds);
  }
}

DblVec RobotAndDOF::GetDOFValues() {
  DblVec out;
  if (joint_inds.size() > 0)
    robot->GetDOFValues(out, joint_inds);
  if (affinedofs != 0) {
    out.resize(GetDOF());
    OR::Transform T = robot->GetTransform();
    OR::RaveGetAffineDOFValuesFromTransform(out.begin() + joint_inds.size(), T, affinedofs, rotationaxis);
  }
  return out;
}

void RobotAndDOF::SetRobotActiveDOFs()  {
  RobotBasePtr robot1 = boost::dynamic_pointer_cast<RobotBase>(robot); // since robot is just a kinbody
  vector<int> current_active = robot1->GetActiveDOFIndices();
  if (robot1->GetActiveDOF() != GetDOF() || !std::equal(current_active.begin(), current_active.end(), joint_inds.begin()))
    robot1->SetActiveDOFs(joint_inds, affinedofs);
}

void RobotAndDOF::GetDOFLimits(DblVec& lower, DblVec& upper) const {
  if (joint_inds.size() > 0)
    robot->GetDOFLimits(lower, upper, joint_inds);
  const int translation_dofs[3] = {DOF_X, DOF_Y, DOF_Z};
  for (int i=0; i < 3; ++i) {
    if (affinedofs & translation_dofs[i]) {
      lower.push_back(-INFINITY);
      upper.push_back(INFINITY);
    }
  }
  if (affinedofs & DOF_RotationMask) {
    if (affinedofs & DOF_RotationAxis) {
      lower.push_back(-INFINITY);
      upper.push_back(INFINITY);
    }
    else if (affinedofs & DOF_Rotation3D) {
      for (int i=0; i < 3; ++i) {
        lower.push_back(-INFINITY);
        upper.push_back(INFINITY);
      }
    }
    else if (affinedofs & DOF_Rotation3D) {
      for (int i=0; i < 3; ++i) {
        lower.push_back(-INFINITY);
        upper.push_back(INFINITY);
      }
    }
    else if (affinedofs & DOF_RotationQuat) {
      for (int i=0; i < 4; ++i) {
        lower.push_back(-1);
        upper.push_back(1);
      }
    }
    else throw OR::openrave_exception("invalid rotation dofs", ORE_InvalidArguments);
  }
}
int RobotAndDOF::GetDOF() const {
  return joint_inds.size() + RaveGetAffineDOF(affinedofs);
}
DblMatrix RobotAndDOF::PositionJacobian(int link_ind, const OR::Vector& pt) const {
  Configuration::SaverPtr saver = const_cast<RobotAndDOF*>(this)->Save();
  const_cast<RobotAndDOF*>(this)->SetRobotActiveDOFs();
  vector<double> jacdata;
  boost::dynamic_pointer_cast<RobotBase>(robot)->CalculateActiveJacobian(link_ind, pt, jacdata);
  return Eigen::Map<DblMatrix>(jacdata.data(), 3, GetDOF());
}
DblMatrix RobotAndDOF::RotationJacobian(int link_ind) const {
  Configuration::SaverPtr saver = const_cast<RobotAndDOF*>(this)->Save();
  const_cast<RobotAndDOF*>(this)->SetRobotActiveDOFs();
  vector<double> jacdata;
  boost::dynamic_pointer_cast<RobotBase>(robot)->ComputeJacobianAxisAngle(link_ind, jacdata);
  return Eigen::Map<DblMatrix>(jacdata.data(), 3, GetDOF());
}
bool RobotAndDOF::DoesAffect(const KinBody::Link& link) {
  if (affinedofs > 0) return true;
  else if (link.GetParent() == GetRobot()) return trajopt::DoesAffect(*GetRobot(), joint_inds, GetRobotLinkIndex(*GetRobot(), link));
  else return false;
}

std::vector<KinBody::LinkPtr> RobotAndDOF::GetAffectedLinks() {
  vector<int> inds;
  std::vector<KinBody::LinkPtr> out;
  GetAffectedLinks(out,false,inds);
  return out;
}

void RobotAndDOF::GetAffectedLinks(std::vector<KinBody::LinkPtr>& links, bool only_with_geom, vector<int>& link_inds) {
  links.clear();
  link_inds.clear();
  BOOST_FOREACH(const KinBody::LinkPtr& link, GetRobot()->GetLinks()) {
    if (this->DoesAffect(*link) && !(only_with_geom && link->GetGeometries().empty())) {
      links.push_back(link);
      link_inds.push_back(link->GetIndex());
    }
  }

  vector<KinBodyPtr> grabbed;
  boost::dynamic_pointer_cast<RobotBase>(robot)->GetGrabbed(grabbed);
  BOOST_FOREACH(const KinBodyPtr& body, grabbed) {
    KinBody::LinkPtr grabberLink = boost::dynamic_pointer_cast<RobotBase>(robot)->IsGrabbing(body);
    assert(grabberLink);
    BOOST_FOREACH(const KinBody::LinkPtr& link, body->GetLinks()) {
      if (link->GetGeometries().size() > 0) {
        links.push_back(link);
        link_inds.push_back(grabberLink->GetIndex());
      }
    }
  }

}

vector<KinBodyPtr> RobotAndDOF::GetBodies() {
  std::set<KinBodyPtr> bodies;
  robot->GetAttached(bodies);
  return vector<KinBodyPtr> (bodies.begin(), bodies.end());
}

DblVec RobotAndDOF::RandomDOFValues() {
  int ndof = GetDOF();
  DblVec lower, upper;
  GetDOFLimits(lower, upper);
  DblVec out(ndof);
  for (int i=0; i < ndof; ++i) {
    // TODO this is only right for a circular joint!!
    lower[i] = fmax(lower[i], -2*M_PI);
    upper[i] = fmin(upper[i], 2*M_PI);
    out[i] = lower[i] + randf() * (upper[i] - lower[i]);
  }
  return out;
}

}


text:
package com.dremio.reflection.hints;

import static com.dremio.reflection.hints.ExplanationUtil.disjointFilterExplanation;
import static com.dremio.reflection.hints.ExplanationUtil.fieldMissingExplanation;
import static com.dremio.reflection.hints.ExplanationUtil.filterOverSpecified;
import static com.google.common.collect.ImmutableList.toImmutableList;

import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rex.RexNode;
import org.apache.commons.math.exception.NullArgumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dremio.reflection.hints.features.FieldMissingFeature;
import com.dremio.reflection.hints.features.FilterDisjointFeature;
import com.dremio.reflection.hints.features.HintFeature;
import com.dremio.reflection.hints.features.MaterializationFilterOverSpecifiedFeature;
import com.dremio.sabot.kernel.proto.ReflectionExplanation;

public class ReflectionExplanationManager {
  public static final int MAX_REFLECTIONS_TO_DISPLAY_TO_SHOW = 5;
  public static final int MAX_NUMBER_OF_HINTS_PER_REFLECTION = 5;
  private static final Logger LOGGER = LoggerFactory.getLogger(ReflectionExplanationManager.class);
  private final ReflectionExplanationFeatureGatherer reflectionExplanationFeatureGatherer;

  public ReflectionExplanationManager(ReflectionExplanationFeatureGatherer reflectionExplanationFeatureGatherer) {
    this.reflectionExplanationFeatureGatherer = reflectionExplanationFeatureGatherer;
  }

  public Stream<ReflectionExplanationsAndQueryDistance> generateDisplayExplanations() {
    List<ReflectionExplanationsAndQueryDistance> reflectionExplanationsAndQueryDistanceList
      = reflectionExplanationFeatureGatherer.reflectionIdToFeatureList.entrySet()
      .stream()
      .filter(e -> e.getValue().size() <= MAX_NUMBER_OF_HINTS_PER_REFLECTION)
      .map(this::entryToDisplayHint)
      .filter(this::nonZeroDistance)
      .sorted()
      .collect(Collectors.toList());

    for (int i = 0; i < reflectionExplanationsAndQueryDistanceList.size(); i++) {
      ReflectionExplanationsAndQueryDistance r = reflectionExplanationsAndQueryDistanceList.get(i);
      if (i < MAX_REFLECTIONS_TO_DISPLAY_TO_SHOW) {
        decorateWithDisplayMessages(r);
      } else {
        r.hintHidden = true;
      }
    }
    return reflectionExplanationsAndQueryDistanceList.stream();
  }

  private ReflectionExplanationsAndQueryDistance entryToDisplayHint(
    Entry<String, Set<HintFeature>> reflectionIdAndFeatureSet) {
    return new ReflectionExplanationsAndQueryDistance(reflectionIdAndFeatureSet.getKey(),
      queryDistance(reflectionIdAndFeatureSet.getValue()));
  }

  private void decorateWithDisplayMessages(ReflectionExplanationsAndQueryDistance reflectionExplanationsAndQueryDistance) {
    String reflectionId = reflectionExplanationsAndQueryDistance.reflectionId;
    Set<HintFeature> hintFeatureSet = reflectionExplanationFeatureGatherer.reflectionIdToFeatureList.get(reflectionId);
    reflectionExplanationsAndQueryDistance.displayHintMessageList = hintFeatureSet
      .stream()
      .map(this::featureToExplanation)
      .collect(toImmutableList());
  }

  private ReflectionExplanation featureToExplanation(HintFeature hintFeature) {
    if(hintFeature instanceof FieldMissingFeature){
      return fieldMissingToDisplayHintMessage((FieldMissingFeature) hintFeature);
    } else if(hintFeature instanceof MaterializationFilterOverSpecifiedFeature) {
      return featureToExplanation((MaterializationFilterOverSpecifiedFeature)hintFeature);
    } else if(hintFeature instanceof FilterDisjointFeature) {
      return clauseToDisplayHintMessage((FilterDisjointFeature) hintFeature);
    } else {
      throw new RuntimeException("Unknown Type" + hintFeature.getClass());
    }
  }

  private ReflectionExplanation clauseToDisplayHintMessage(FilterDisjointFeature filterDisjointFeature) {
    return disjointFilterExplanation(getFilterWithColumnName(filterDisjointFeature.getMaterializationFilter(), filterDisjointFeature.getDatasetRowType()));
  }

  private ReflectionExplanation fieldMissingToDisplayHintMessage(FieldMissingFeature fieldMissingFeature){
    try {
      List<String> names = fieldMissingFeature.getUserQueryNode().getRowType().getFieldNames();
      if(names.size() > fieldMissingFeature.getIndex()) {
        return fieldMissingExplanation(names.get(fieldMissingFeature.getIndex()), fieldMissingFeature.getIndex());
      } else {
        return fieldMissingExplanation(fieldMissingFeature.getName(), fieldMissingFeature.getIndex());
      }
    } catch (Exception ex) {
      LOGGER.warn("Failed to create display data",  ex);
      return fieldMissingExplanation(
          fieldMissingFeature.getName(),
          fieldMissingFeature.getIndex());
    }
  }

  private ReflectionExplanation featureToExplanation(
      MaterializationFilterOverSpecifiedFeature materializationFilterOverSpecified) {
    return filterOverSpecified(getFilterWithColumnName(materializationFilterOverSpecified.getMaterializationFilter(), materializationFilterOverSpecified.getDatasetRowType()));
  }

  private boolean nonZeroDistance(ReflectionExplanationsAndQueryDistance reflectionExplanationsAndQueryDistance) {
    return reflectionExplanationsAndQueryDistance.queryDistance != 0.0;
  }

  private double queryDistance(Set<HintFeature> hintFeatureSet) {
    return hintFeatureSet.size();
  }

  // Get filter and rewrite rex index with column name
  private String getFilterWithColumnName(RexNode materializationFilter, RelDataType datasetRowType) throws NullArgumentException {
    StringBuilder modified = new StringBuilder();

    String original = materializationFilter.toString();
    List<String> fields = datasetRowType.getFieldNames();

    if (fields == null) {
      throw new NullArgumentException();
    }

    int index = 0;
    while (index < original.length()) {
      if (original.charAt(index) == '\'') {
        // Index after the closing single quote
        int nextIndex = original.indexOf('\'', index + 1);
        nextIndex =  nextIndex != -1 ? nextIndex + 1 : index + 1;
        modified.append(original, index, nextIndex);
        index = nextIndex;
        continue;
      }
      if (original.charAt(index) == '$') {
        // Index after numbers after $
        int nextIndex = index + 1;
        while (nextIndex < original.length() && Character.isDigit(original.charAt(nextIndex))) {
          nextIndex++;
        }
        int columnIndex = Integer.valueOf(original.substring(index + 1, nextIndex));
        modified.append((nextIndex - index == 1 || columnIndex >= fields.size()) ? '$' : fields.get(columnIndex));
        index = nextIndex;
        continue;
      }
      modified.append(original.charAt(index));
      index++;
    }
    return modified.toString();
  }
}

redpajama_set_name: RedPajamaGithub


text:
require 'net/http'
require 'uri'
require 'contest'

module Cardio
  module Assertions
    def assert_gzipped(res)
      assert_header res, "Content-Encoding", "gzip"
    end

    ## TODO parse the XML and validate
    def assert_valid_xml(res)
      assert_content_type res, "application/xml"
    end

    def assert_html(res)
      assert_content_type res, "text/html"
      assert_content res, "<html>"
    end

    def assert_css(res)
      assert_content_type res, "text/css"
    end

    # TODO: Wishlist
    #def assert_valid_html
    #end

    # TODO: Wishlist
    #def assert_valid_css
    #end

    def assert_redirect(res, location)
      assert_in_array ["301", "302", "303", "307"], res.code
      assert_header res, "Location", location
    end

    def assert_code(res, code)
      assert_equal code.to_s, res.code
    end

    def assert_in_array(array, item)
      if ! array.include? item
        flunk build_message("", 'One of <?> was expected, but got <?> ', [302,303,307].inspect, item)
      end
    end

    def assert_content(res, content)
      assert_match /#{content}/, res.body
    end

    ## TODO: Make sure that JSON.parse raises an error
    def assert_valid_json(res)
      require 'json'
      assert_content_type res, "application/json"
      begin
        JSON.parse(res.body)
      rescue JSON::ParserError => e
        flunk build_message("", "String <?> is not valid JSON.  The Parser Error was: #{e.message}", res.body)
      end
    end

    def assert_etag(res)
      assert_header_present res, "ETag"
    end

    ## TODO: Make this much smarter to check types and duration of caches
    def assert_cached(res, value=nil)
      if value
        assert_header res, "Cache-Control", value
      else
        assert_header_present res, "Cache-Control"
      end
    end

    def assert_header_present(res, header)
      assert (! res[header].nil?)
    end

    def assert_header(res, header, value)
      assert_equal value, res[header]
    end

    ## TODO
    #def assert_basic_auth
    #end

    def assert_content_type(res, content_type)
      assert_header res, "Content-Type", content_type
    end

    ##
    # TODO: Use the headers argument
    #
    # Use Net::HTTP to get a url and associated headers. Cache the result,
    # and return the cached version if it is present.
    # Every individual test run will re-fetch all URLs
    #
    #
    # (ie, cache is cleared each test)
    # @param [String] The URL to fetch. If this has been fetched previously for this test, it will not be refetched
    # @return The Net::HTTP response object
    def fetch(url, headers={})
      @url_cache ||= Hash.new
      return @url_cache[url] if @url_cache.has_key?(url)

      uri = URI.parse(url)

      path = uri.path == "" ? "/" : uri.path

      req = Net::HTTP::Get.new(path)
      res = Net::HTTP.start(uri.host, uri.port) {|http|
        http.request(req)
      }

      @url_cache[url] = res

      return res
    end
  end
end


text:
package org.hibernate.validator.referenceguide.chapter07;

import java.util.List;

import org.hibernate.validator.referenceguide.chapter03.crossparameter.constrainttarget.Car;

public class Garage {

	public Car buildCar(List<Part> parts) {
		//...
		return null;
	}

	public Car paintCar(int color) {
		//...
		return null;
	}
}


text:
require 'rspec'
require 'rspec/autorun'
require 'rbconfig'
require 'capybara'

PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')).freeze

$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')

Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }

require 'capybara/webkit'
connection = Capybara::Webkit::Connection.new(:socket_class => TCPSocket)
$webkit_browser = Capybara::Webkit::Browser.new(connection)

if ENV['DEBUG']
  $webkit_browser.enable_logging
end

require 'capybara/spec/spec_helper'

Capybara.register_driver :reusable_webkit do |app|
  Capybara::Webkit::Driver.new(app, :browser => $webkit_browser)
end

RSpec.configure do |c|
  c.filter_run_excluding :skip_on_windows => !(RbConfig::CONFIG['host_os'] =~ /mingw32/).nil?
  Capybara::SpecHelper.configure(c)
end

def with_env_vars(vars)
  old_env_variables = {}
  vars.each do |key, value|
    old_env_variables[key] = ENV[key]
    ENV[key] = value
  end

  yield

  old_env_variables.each do |key, value|
    ENV[key] = value
  end
end


text:
package com.amazonaws.services.amplifybackend.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.amplifybackend.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * GetBackendResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetBackendResultJsonUnmarshaller implements Unmarshaller<GetBackendResult, JsonUnmarshallerContext> {

    public GetBackendResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        GetBackendResult getBackendResult = new GetBackendResult();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return getBackendResult;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("amplifyFeatureFlags", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setAmplifyFeatureFlags(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("amplifyMetaConfig", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setAmplifyMetaConfig(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("appId", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setAppId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("appName", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setAppName(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("backendEnvironmentList", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setBackendEnvironmentList(new ListUnmarshaller<String>(context.getUnmarshaller(String.class))

                    .unmarshall(context));
                }
                if (context.testExpression("backendEnvironmentName", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setBackendEnvironmentName(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("error", targetDepth)) {
                    context.nextToken();
                    getBackendResult.setError(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return getBackendResult;
    }

    private static GetBackendResultJsonUnmarshaller instance;

    public static GetBackendResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new GetBackendResultJsonUnmarshaller();
        return instance;
    }
}


text:
/*
 * This header file contains internal definitions that are not supposed to be
 * used outside of this library code.
 */

#ifndef XLAT_TABLES_V2_HELPERS_H
#define XLAT_TABLES_V2_HELPERS_H

#ifndef XLAT_TABLES_V2_H
#error "Do not include this header file directly. Include xlat_tables_v2.h instead."
#endif

#ifndef __ASSEMBLER__

#include <stdbool.h>
#include <stddef.h>

#include <platform_def.h>

#include <lib/cassert.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_arch.h>
#include <lib/xlat_tables/xlat_tables_defs.h>

/* Forward declaration */
struct mmap_region;

/*
 * Helper macro to define an mmap_region_t.  This macro allows to specify all
 * the fields of the structure but its parameter list is not guaranteed to
 * remain stable as we add members to mmap_region_t.
 */
#define MAP_REGION_FULL_SPEC(_pa, _va, _sz, _attr, _gr)		\
	{							\
		.base_pa = (_pa),				\
		.base_va = (_va),				\
		.size = (_sz),					\
		.attr = (_attr),				\
		.granularity = (_gr),				\
	}

/* Struct that holds all information about the translation tables. */
struct xlat_ctx {
	/*
	 * Max allowed Virtual and Physical Addresses.
	 */
	unsigned long long pa_max_address;
	uintptr_t va_max_address;

	/*
	 * Array of all memory regions stored in order of ascending end address
	 * and ascending size to simplify the code that allows overlapping
	 * regions. The list is terminated by the first entry with size == 0.
	 * The max size of the list is stored in `mmap_num`. `mmap` points to an
	 * array of mmap_num + 1 elements, so that there is space for the final
	 * null entry.
	 */
	struct mmap_region *mmap;
	int mmap_num;

	/*
	 * Array of finer-grain translation tables.
	 * For example, if the initial lookup level is 1 then this array would
	 * contain both level-2 and level-3 entries.
	 */
	uint64_t (*tables)[XLAT_TABLE_ENTRIES];
	int tables_num;
#if PLAT_RO_XLAT_TABLES
	bool readonly_tables;
#endif
	/*
	 * Keep track of how many regions are mapped in each table. The base
	 * table can't be unmapped so it isn't needed to keep track of it.
	 */
#if PLAT_XLAT_TABLES_DYNAMIC
	int *tables_mapped_regions;
#endif /* PLAT_XLAT_TABLES_DYNAMIC */

	int next_table;

	/*
	 * Base translation table. It doesn't need to have the same amount of
	 * entries as the ones used for other levels.
	 */
	uint64_t *base_table;
	unsigned int base_table_entries;

	/*
	* Max Physical and Virtual addresses currently in use by the
	* translation tables. These might get updated as we map/unmap memory
	* regions but they will never go beyond pa/va_max_address.
	*/
	unsigned long long max_pa;
	uintptr_t max_va;

	/* Level of the base translation table. */
	unsigned int base_level;

	/* Set to true when the translation tables are initialized. */
	bool initialized;

	/*
	 * Translation regime managed by this xlat_ctx_t. It should be one of
	 * the EL*_REGIME defines.
	 */
	int xlat_regime;
};

#if PLAT_XLAT_TABLES_DYNAMIC
#define XLAT_ALLOC_DYNMAP_STRUCT(_ctx_name, _xlat_tables_count)		\
	static int _ctx_name##_mapped_regions[_xlat_tables_count];

#define XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name)				\
	.tables_mapped_regions = _ctx_name##_mapped_regions,
#else
#define XLAT_ALLOC_DYNMAP_STRUCT(_ctx_name, _xlat_tables_count)		\
	/* do nothing */

#define XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name)				\
	/* do nothing */
#endif /* PLAT_XLAT_TABLES_DYNAMIC */

#if PLAT_RO_XLAT_TABLES
#define XLAT_CTX_INIT_TABLE_ATTR()					\
	.readonly_tables = false,
#else
#define XLAT_CTX_INIT_TABLE_ATTR()
	/* do nothing */
#endif

#define REGISTER_XLAT_CONTEXT_FULL_SPEC(_ctx_name, _mmap_count,		\
			_xlat_tables_count, _virt_addr_space_size,	\
			_phy_addr_space_size, _xlat_regime,		\
			_table_section, _base_table_section)		\
	CASSERT(CHECK_PHY_ADDR_SPACE_SIZE(_phy_addr_space_size),	\
		assert_invalid_physical_addr_space_sizefor_##_ctx_name);\
									\
	static mmap_region_t _ctx_name##_mmap[_mmap_count + 1];		\
									\
	static uint64_t _ctx_name##_xlat_tables[_xlat_tables_count]	\
		[XLAT_TABLE_ENTRIES]					\
		__aligned(XLAT_TABLE_SIZE) __section(_table_section);	\
									\
	static uint64_t _ctx_name##_base_xlat_table			\
		[GET_NUM_BASE_LEVEL_ENTRIES(_virt_addr_space_size)]	\
		__aligned(GET_NUM_BASE_LEVEL_ENTRIES(_virt_addr_space_size)\
			* sizeof(uint64_t))				\
		__section(_base_table_section);				\
									\
	XLAT_ALLOC_DYNMAP_STRUCT(_ctx_name, _xlat_tables_count)		\
									\
	static xlat_ctx_t _ctx_name##_xlat_ctx = {			\
		.pa_max_address = (_phy_addr_space_size) - 1ULL,	\
		.va_max_address = (_virt_addr_space_size) - 1UL,	\
		.mmap = _ctx_name##_mmap,				\
		.mmap_num = (_mmap_count),				\
		.tables = _ctx_name##_xlat_tables,			\
		.tables_num = ARRAY_SIZE(_ctx_name##_xlat_tables),	\
		 XLAT_CTX_INIT_TABLE_ATTR()				\
		 XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name)			\
		.next_table = 0,					\
		.base_table = _ctx_name##_base_xlat_table,		\
		.base_table_entries =					\
			ARRAY_SIZE(_ctx_name##_base_xlat_table),	\
		.max_pa = 0U,						\
		.max_va = 0U,						\
		.base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size),\
		.initialized = false,					\
		.xlat_regime = (_xlat_regime)				\
	}

#endif /*__ASSEMBLER__*/

#endif /* XLAT_TABLES_V2_HELPERS_H */


text:
"""
Tests added by robertmuil.
"""
from acpi import adapters

def adapters_test():
    data = adapters()
    assert(len(data)>0)
    assert(data[0][0] == 'Adapter 0')
    assert(data[0].name == 'Adapter 0')

# vim: expandtab:sw=4:ts=4


text:
package org.assertj.jodatime.api.datetime;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.jodatime.api.Assertions.assertThat;

import static org.joda.time.DateTimeZone.UTC;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.Test;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;

/**
 * @author Paweł Stawicki
 * @author Joel Costigliola
 */
@RunWith(Theories.class)
public class DateTimeAssert_isAfterOrEqualTo_Test extends DateTimeAssertBaseTest {

  @Theory
  public void test_isAfterOrEqual_assertion(DateTime referenceDate, DateTime dateBefore, DateTime dateAfter) {
    // GIVEN
    testAssumptions(referenceDate, dateBefore, dateAfter);
    // WHEN
    assertThat(dateAfter).isAfterOrEqualTo(referenceDate);
    assertThat(dateAfter).isAfterOrEqualTo(referenceDate.toString());
    assertThat(referenceDate).isAfterOrEqualTo(referenceDate);
    assertThat(referenceDate).isAfterOrEqualTo(referenceDate.toString());
    // THEN
    verify_that_isAfterOrEqual_assertion_fails_and_throws_AssertionError(dateBefore, referenceDate);
  }

  @Test
  public void isAfterOrEqualTo_should_compare_datetimes_in_actual_timezone() {
    DateTime utcDateTime = new DateTime(2013, 6, 10, 0, 0, DateTimeZone.UTC);
    DateTimeZone cestTimeZone = DateTimeZone.forID("Europe/Berlin");
    DateTime cestDateTime1 = new DateTime(2013, 6, 10, 2, 0, cestTimeZone);
    DateTime cestDateTime2 = new DateTime(2013, 6, 10, 1, 0, cestTimeZone);
    // utcDateTime = cestDateTime1
    assertThat(utcDateTime).as("in UTC time zone").isAfterOrEqualTo(cestDateTime1);
    // utcDateTime > cestDateTime2
    assertThat(utcDateTime).as("in UTC time zone").isAfterOrEqualTo(cestDateTime2);
  }

  @Test
  public void test_isAfterOrEqual_assertion_error_message() {
    try {
      assertThat(new DateTime(2000, 1, 5, 3, 0, 5, UTC)).isAfterOrEqualTo(new DateTime(2012, 1, 1, 3, 3, 3, UTC));
    } catch (AssertionError e) {
      assertThat(e).hasMessage("\nExpecting:\n  <2000-01-05T03:00:05.000Z>\nto be after or equals to:\n  <2012-01-01T03:03:03.000Z>\n");
      return;
    }
    fail("Should have thrown AssertionError");
  }

  @Test
  public void should_fail_if_actual_is_null() {
    expectException(AssertionError.class, actualIsNull());
    DateTime actual = null;
    assertThat(actual).isAfterOrEqualTo(new DateTime());
  }

  @Test
  public void should_fail_if_dateTime_parameter_is_null() {
    expectException(IllegalArgumentException.class, "The DateTime to compare actual with should not be null");
    assertThat(new DateTime()).isAfterOrEqualTo((DateTime) null);
  }

  @Test
  public void should_fail_if_dateTime_as_string_parameter_is_null() {
    expectException(IllegalArgumentException.class,
                    "The String representing the DateTime to compare actual with should not be null");
    assertThat(new DateTime()).isAfterOrEqualTo((String) null);
  }

  private static void verify_that_isAfterOrEqual_assertion_fails_and_throws_AssertionError(DateTime dateToCheck,
      DateTime reference) {
    try {
      assertThat(dateToCheck).isAfterOrEqualTo(reference);
    } catch (AssertionError e) {
      // AssertionError was expected, test same assertion with String based parameter
      try {
        assertThat(dateToCheck).isAfterOrEqualTo(reference.toString());
      } catch (AssertionError e2) {
        // AssertionError was expected (again)
        return;
      }
    }
    fail("Should have thrown AssertionError");
  }

}


text:
package glasskey.util

import java.security.interfaces.RSAPublicKey

import com.nimbusds.jose.jwk.{JWK, RSAKey}
import com.typesafe.config.ConfigFactory
import glasskey.model.fetchers.IDTokenAccessTokenValidatorMock
import org.scalatest._
import org.scalatest.enablers.Emptiness._

import scala.collection.JavaConverters._
import scala.collection.mutable

class PEMDERKeySourceSpec extends FlatSpec with Matchers with IDTokenAccessTokenValidatorMock {
  "Iterating RSA keys" should "convert to RSA public keys" in {
    val util = new PEMDERKeySource { override def source = ConfigFactory.load.getConfig("oauth").getConfig("provider").getString("access-token-JWT-key-url") }
    val pubKey = util.getPublicKey("1")
    pubKey shouldBe a [Option[RSAPublicKey]]
    pubKey shouldBe 'defined
  }

  "From file: Iterating RSA keys" should "convert to RSA public keys" in {
    val util = new FilePEMDERKeySource { override def source = staticX509PEMDER }
    val pubKey = util.getPublicKey("1")
    pubKey shouldBe a [Option[RSAPublicKey]]
    pubKey shouldBe 'defined
  }
}


text:
/* Common flash memory module for STM32F and STM32F0 */

#include "battery.h"
#include "console.h"
#include "flash.h"
#include "hooks.h"
#include "registers.h"
#include "panic.h"
#include "system.h"
#include "task.h"
#include "timer.h"
#include "util.h"
#include "watchdog.h"

/*
 * Approximate number of CPU cycles per iteration of the loop when polling
 * the flash status
 */
#define CYCLE_PER_FLASH_LOOP 10

/* Flash page programming timeout.  This is 2x the datasheet max. */
#define FLASH_TIMEOUT_US 16000
#define FLASH_TIMEOUT_LOOP \
	(FLASH_TIMEOUT_US * (CPU_CLOCK / SECOND) / CYCLE_PER_FLASH_LOOP)

/* Flash unlocking keys */
#define KEY1    0x45670123
#define KEY2    0xCDEF89AB

/* Lock bits for FLASH_CR register */
#define PG       (1<<0)
#define PER      (1<<1)
#define OPTPG    (1<<4)
#define OPTER    (1<<5)
#define STRT     (1<<6)
#define CR_LOCK  (1<<7)
#define PRG_LOCK 0
#define OPT_LOCK (1<<9)

static int write_optb(int byte, uint8_t value);

static int wait_busy(void)
{
	int timeout = FLASH_TIMEOUT_LOOP;
	while (STM32_FLASH_SR & (1 << 0) && timeout-- > 0)
		udelay(CYCLE_PER_FLASH_LOOP);
	return (timeout > 0) ? EC_SUCCESS : EC_ERROR_TIMEOUT;
}

static int unlock(int locks)
{
	/*
	 * We may have already locked the flash module and get a bus fault
	 * in the attempt to unlock. Need to disable bus fault handler now.
	 */
	ignore_bus_fault(1);

	/* unlock CR if needed */
	if (STM32_FLASH_CR & CR_LOCK) {
		STM32_FLASH_KEYR = KEY1;
		STM32_FLASH_KEYR = KEY2;
	}
	/* unlock option memory if required */
	if ((locks & OPT_LOCK) && !(STM32_FLASH_CR & OPT_LOCK)) {
		STM32_FLASH_OPTKEYR = KEY1;
		STM32_FLASH_OPTKEYR = KEY2;
	}

	/* Re-enable bus fault handler */
	ignore_bus_fault(0);

	return ((STM32_FLASH_CR ^ OPT_LOCK) & (locks | CR_LOCK)) ?
			EC_ERROR_UNKNOWN : EC_SUCCESS;
}

static void lock(void)
{
	STM32_FLASH_CR = CR_LOCK;
}

/*
 * Option byte organization
 *
 *                 [31:24]    [23:16]    [15:8]   [7:0]
 *
 *   0x1FFF_F800    nUSER      USER       nRDP     RDP
 *
 *   0x1FFF_F804    nData1     Data1     nData0    Data0
 *
 *   0x1FFF_F808    nWRP1      WRP1      nWRP0     WRP0
 *
 *   0x1FFF_F80C    nWRP3      WRP2      nWRP2     WRP2
 *
 * Note that the variable with n prefix means the complement.
 */
static uint8_t read_optb(int byte)
{
	return *(uint8_t *)(STM32_OPTB_BASE + byte);
}

static int erase_optb(void)
{
	int rv;

	rv = wait_busy();
	if (rv)
		return rv;

	rv = unlock(OPT_LOCK);
	if (rv)
		return rv;

	/* Must be set in 2 separate lines. */
	STM32_FLASH_CR |= OPTER;
	STM32_FLASH_CR |= STRT;

	rv = wait_busy();
	if (rv)
		return rv;
	lock();

	return EC_SUCCESS;
}

/*
 * Since the option byte erase is WHOLE erase, this function is to keep
 * rest of bytes, but make this byte 0xff.
 * Note that this could make a recursive call to write_optb().
 */
static int preserve_optb(int byte)
{
	int i, rv;
	uint8_t optb[8];

	/* The byte has been reset, no need to run preserve. */
	if (*(uint16_t *)(STM32_OPTB_BASE + byte) == 0xffff)
		return EC_SUCCESS;

	for (i = 0; i < ARRAY_SIZE(optb); ++i)
		optb[i] = read_optb(i * 2);

	optb[byte / 2] = 0xff;

	rv = erase_optb();
	if (rv)
		return rv;
	for (i = 0; i < ARRAY_SIZE(optb); ++i) {
		rv = write_optb(i * 2, optb[i]);
		if (rv)
			return rv;
	}

	return EC_SUCCESS;
}

static int write_optb(int byte, uint8_t value)
{
	volatile int16_t *hword = (uint16_t *)(STM32_OPTB_BASE + byte);
	int rv;

	rv = wait_busy();
	if (rv)
		return rv;

	/* The target byte is the value we want to write. */
	if (*(uint8_t *)hword == value)
		return EC_SUCCESS;

	/* Try to erase that byte back to 0xff. */
	rv = preserve_optb(byte);
	if (rv)
		return rv;

	/* The value is 0xff after erase. No need to write 0xff again. */
	if (value == 0xff)
		return EC_SUCCESS;

	rv = unlock(OPT_LOCK);
	if (rv)
		return rv;

	/* set OPTPG bit */
	STM32_FLASH_CR |= OPTPG;

	*hword = ((~value) << STM32_OPTB_COMPL_SHIFT) | value;

	/* reset OPTPG bit */
	STM32_FLASH_CR &= ~OPTPG;

	rv = wait_busy();
	if (rv)
		return rv;
	lock();

	return EC_SUCCESS;
}

/*****************************************************************************/
/* Physical layer APIs */

int flash_physical_write(int offset, int size, const char *data)
{
	uint16_t *address = (uint16_t *)(CONFIG_PROGRAM_MEMORY_BASE + offset);
	int res = EC_SUCCESS;
	int i;

	if (unlock(PRG_LOCK) != EC_SUCCESS) {
		res = EC_ERROR_UNKNOWN;
		goto exit_wr;
	}

	/* Clear previous error status */
	STM32_FLASH_SR = 0x34;

	/* set PG bit */
	STM32_FLASH_CR |= PG;

	for (; size > 0; size -= sizeof(uint16_t)) {
		/*
		 * Reload the watchdog timer to avoid watchdog reset when doing
		 * long writing with interrupt disabled.
		 */
		watchdog_reload();

		/* wait to be ready  */
		for (i = 0; (STM32_FLASH_SR & 1) && (i < FLASH_TIMEOUT_LOOP);
		     i++)
			;

		/* write the half word */
		*address++ = data[0] + (data[1] << 8);
		data += 2;

		/* Wait for writes to complete */
		for (i = 0; (STM32_FLASH_SR & 1) && (i < FLASH_TIMEOUT_LOOP);
		     i++)
			;

		if (STM32_FLASH_SR & 1) {
			res = EC_ERROR_TIMEOUT;
			goto exit_wr;
		}

		/* Check for error conditions - erase failed, voltage error,
		 * protection error */
		if (STM32_FLASH_SR & 0x14) {
			res = EC_ERROR_UNKNOWN;
			goto exit_wr;
		}
	}

exit_wr:
	/* Disable PG bit */
	STM32_FLASH_CR &= ~PG;

	lock();

	return res;
}

int flash_physical_erase(int offset, int size)
{
	int res = EC_SUCCESS;

	if (unlock(PRG_LOCK) != EC_SUCCESS)
		return EC_ERROR_UNKNOWN;

	/* Clear previous error status */
	STM32_FLASH_SR = 0x34;

	/* set PER bit */
	STM32_FLASH_CR |= PER;

	for (; size > 0; size -= CONFIG_FLASH_ERASE_SIZE,
	     offset += CONFIG_FLASH_ERASE_SIZE) {
		timestamp_t deadline;

		/* Do nothing if already erased */
		if (flash_is_erased(offset, CONFIG_FLASH_ERASE_SIZE))
			continue;

		/* select page to erase */
		STM32_FLASH_AR = CONFIG_PROGRAM_MEMORY_BASE + offset;

		/* set STRT bit : start erase */
		STM32_FLASH_CR |= STRT;

		/*
		 * Reload the watchdog timer to avoid watchdog reset during a
		 * long erase operation.
		 */
		watchdog_reload();

		deadline.val = get_time().val + FLASH_TIMEOUT_US;
		/* Wait for erase to complete */
		while ((STM32_FLASH_SR & 1) &&
		       (get_time().val < deadline.val)) {
			usleep(300);
		}
		if (STM32_FLASH_SR & 1) {
			res = EC_ERROR_TIMEOUT;
			goto exit_er;
		}

		/*
		 * Check for error conditions - erase failed, voltage error,
		 * protection error
		 */
		if (STM32_FLASH_SR & 0x14) {
			res = EC_ERROR_UNKNOWN;
			goto exit_er;
		}
	}

exit_er:
	/* reset PER bit */
	STM32_FLASH_CR &= ~PER;

	lock();

	return res;
}

static int flash_physical_get_protect_at_boot(int block)
{
	uint8_t val = read_optb(STM32_OPTB_WRP_OFF(block/8));
	return (!(val & (1 << (block % 8)))) ? 1 : 0;
}

int flash_physical_protect_at_boot(enum flash_wp_range range)
{
	int block;
	int i;
	int original_val[4], val[4];
	enum flash_wp_range cur_range;

	for (i = 0; i < 4; ++i)
		original_val[i] = val[i] = read_optb(i * 2 + 8);

	for (block = WP_BANK_OFFSET;
	     block < WP_BANK_OFFSET + PHYSICAL_BANKS;
	     block++) {
		int byte_off = STM32_OPTB_WRP_OFF(block/8) / 2 - 4;

		if (block >= WP_BANK_OFFSET + WP_BANK_COUNT)
			cur_range = FLASH_WP_ALL;
		else
			cur_range = FLASH_WP_RO;

		if (cur_range <= range)
			val[byte_off] = val[byte_off] & (~(1 << (block % 8)));
		else
			val[byte_off] = val[byte_off] | (1 << (block % 8));
	}

	for (i = 0; i < 4; ++i)
		if (original_val[i] != val[i])
			write_optb(i * 2 + 8, val[i]);

#ifdef CONFIG_WP_ALWAYS
	/*
	 * Set a permanent protection by increasing RDP to level 1,
	 * trying to unprotected the flash will trigger a full erase.
	 */
	write_optb(0, 0x11);
#endif

	return EC_SUCCESS;
}

/**
 * Check if write protect register state is inconsistent with RO_AT_BOOT and
 * ALL_AT_BOOT state.
 *
 * @return zero if consistent, non-zero if inconsistent.
 */
static int registers_need_reset(void)
{
	uint32_t flags = flash_get_protect();
	int i;
	int ro_at_boot = (flags & EC_FLASH_PROTECT_RO_AT_BOOT) ? 1 : 0;
	int ro_wp_region_start = WP_BANK_OFFSET;
	int ro_wp_region_end = WP_BANK_OFFSET + WP_BANK_COUNT;

	for (i = ro_wp_region_start; i < ro_wp_region_end; i++)
		if (flash_physical_get_protect_at_boot(i) != ro_at_boot)
			return 1;
	return 0;
}

static void unprotect_all_blocks(void)
{
	int i;
	for (i = 4; i < 8; ++i)
		write_optb(i * 2, 0xff);
}

/*****************************************************************************/
/* High-level APIs */

int flash_pre_init(void)
{
	uint32_t reset_flags = system_get_reset_flags();
	uint32_t prot_flags = flash_get_protect();
	int need_reset = 0;

	if (flash_physical_restore_state())
		return EC_SUCCESS;

	/*
	 * If we have already jumped between images, an earlier image could
	 * have applied write protection. Nothing additional needs to be done.
	 */
	if (reset_flags & RESET_FLAG_SYSJUMP)
		return EC_SUCCESS;

	if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) {
		if ((prot_flags & EC_FLASH_PROTECT_RO_AT_BOOT) &&
		    !(prot_flags & EC_FLASH_PROTECT_RO_NOW)) {
			/*
			 * Pstate wants RO protected at boot, but the write
			 * protect register wasn't set to protect it.  Force an
			 * update to the write protect register and reboot so
			 * it takes effect.
			 */
			flash_physical_protect_at_boot(FLASH_WP_RO);
			need_reset = 1;
		}

		if (registers_need_reset()) {
			/*
			 * Write protect register was in an inconsistent state.
			 * Set it back to a good state and reboot.
			 *
			 * TODO(crosbug.com/p/23798): this seems really similar
			 * to the check above.  One of them should be able to
			 * go away.
			 */
			flash_protect_at_boot(
				(prot_flags & EC_FLASH_PROTECT_RO_AT_BOOT) ?
				FLASH_WP_RO : FLASH_WP_NONE);
			need_reset = 1;
		}
	} else {
		if (prot_flags & EC_FLASH_PROTECT_RO_NOW) {
			/*
			 * Write protect pin unasserted but some section is
			 * protected. Drop it and reboot.
			 */
			unprotect_all_blocks();
			need_reset = 1;
		}
	}

	if ((flash_physical_get_valid_flags() & EC_FLASH_PROTECT_ALL_AT_BOOT) &&
	    (!!(prot_flags & EC_FLASH_PROTECT_ALL_AT_BOOT) !=
	     !!(prot_flags & EC_FLASH_PROTECT_ALL_NOW))) {
		/*
		 * ALL_AT_BOOT and ALL_NOW should be both set or both unset
		 * at boot. If they are not, it must be that the chip requires
		 * OBL_LAUNCH to be set to reload option bytes. Let's reset
		 * the system with OBL_LAUNCH set.
		 * This assumes OBL_LAUNCH is used for hard reset in
		 * chip/stm32/system.c.
		 */
		need_reset = 1;
	}

	if (need_reset)
		system_reset(SYSTEM_RESET_HARD | SYSTEM_RESET_PRESERVE_FLAGS);

	return EC_SUCCESS;
}


text:
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <style>
            table {
                border-collapse: collapse;
                border: 2px black solid;
                font: 12px sans-serif;
            }

            td {
                border: 1px black solid;
                padding: 5px;
            }
        </style>
    </head>
    <body>
        <script src="http://d3js.org/d3.v3.min.js"></script>
        <!-- <script src="d3.min.js?v=3.2.8"></script>-->

        <!-- help from

        http://bl.ocks.org/syntagmatic/3687826
        http://stackoverflow.com/questions/23747945/how-to-add-header-row-to-d3-csv-generated-table
        http://stackoverflow.com/questions/9268645/creating-a-table-linked-to-a-csv-file
        https://vis4.net/blog/posts/making-html-tables-in-d3-doesnt-need-to-be-a-pain/
        https://github.com/mbostock/d3/wiki/CSV
        http://stackoverflow.com/questions/16102505/d3-js-how-to-apply-multiple-classes-when-using-a-function
        -->

       <!--orginated from

        http://bl.ocks.org/ndarville/7075823
        -->
        <!----->
        <script type="text/javascript"charset="utf-8">
            d3.text("csv/data.csv", function(data) {
                var rows = d3.csv.parseRows(data);

                var container = d3.select("body")
                    .append("table");

                 // headers

                 container.append("thead").append("tr")
                    .selectAll("th")
                    .data(rows[0]) //grabs first row (which we know as header)
                    .enter().append("th")
                    .attr("class", function(d){
                        return d; // return name as class name as well
                    })
                    .text(function(column) {
                        return column; // return text in each element back as the header cell
                    });

                // data

                container.append("tbody")
                        .selectAll("tr")
                        .data(rows.slice(1)).enter() // skip past the header
                        .append("tr")

                    .selectAll("td")
                        .data(function(d) { return d; }).enter()
                        .append("td")
                        .text(function(d) { return d; })
                        .attr('class', function(d, i){ return rows[0][i]; });
            });
        </script>

        <!---->
        <!--
        <script type="text/javascript"charset="utf-8">

        // determine columns
        function returnColumns() {
        d3.text("data.csv", function(data) {
                var rows = d3.csv.parseRows(data);

                var container = d3.select("body")
                    .append("table");

                 // headers

                 var columns1 = container.data(rows[0]).enter()
        console.log(columns1);
        return columns1
        });
        }

        // Get the data
d3.csv("data.csv", function(error, data) {

// The table generation function
function tabulate(data) {
    var columns = ["car name",	"miles/gallon",	"cylinders",	"displacement",	"horsepower",	"weight",	"acceleration",	"model year",	"origin"]
    //console.log(columns);

    var table = d3.select("body").append("table")
            .attr("style", "margin-left: 250px"),
        thead = table.append("thead"),
        tbody = table.append("tbody");

    // append the header row
    thead.append("tr")
        .selectAll("th")
        .data(columns)
        .enter()
        .append("th")
            .text(function(column) { return column; });

    // create a row for each object in the data
    var rows = tbody.selectAll("tr")
        .data(data)
        .enter()
        .append("tr");

    // create a cell in each row for each column
    var cells = rows.selectAll("td")
        .data(function(row) {
            return columns.map(function(column) {
                return {column: column, value: row[column]};
            });
        })
        .enter()
        .append("td")
        .attr("class", function() {
            return columns.map(function(column) {
                return {column: column, value: columns[column]};
            });
        }) // sets the font style
        .attr("style", "font-family: Courier") // sets the font style
            .html(function(d) { return d.value; });

    return table;
}

// render the table
 var peopleTable = tabulate(data);

});

        </script>
        -->
        <!--
        <script type="text/javascript"charset="utf-8">
            d3.text("data.csv", function(data) {

                // parse csv

                var dummyrows = d3.csv.parseRows(data);

                var columns = dummyrows[0]

                var rows = d3.csv.parse(data);

                // create table

                var container = d3.select("body")
                    .append("table"),

                    thead = container.append("thead"),
                    tbody = container.append("tbody");

                 // header row

                thead.append("tr")
                    .selectAll("th")
                    .data(columns) //grabs first row (which we know as header)
                    .enter()
                    .append("th")
                    .attr("class", function(column){
                        return column; // return name as class name as well
                    })
                    .text(function(column) {
                        return column; // return text in each element back as the header cell
                    });

                // data

                container.append("tbody")
                        .selectAll("tr")
                        .data(rows.slice(1)).enter() // skip past the header
                        .append("tr")

                    .selectAll("td")
                        .data(function(d) { return d; }).enter()
                        .append("td")
                        .attr("class", columns[function(){
                            return columns.map(function(column){
                                return{column: column};
                            });
                        }])
                        .text(function(d) { return d; });
            });
        </script>
        -->
    </body>
</html>


text:
package de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.values;

import de.eorg.cumulusgenius.shared.cloudmapping.model.jama.Matrix;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class GoalWeightsMatrix implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 2699338070246707178L;

	// the order of this list must not be changed
	/**
	 * @uml.property  name="numberOfGoals"
	 */
	private int numberOfGoals = 1;

	/**
	 * @uml.property  name="values"
	 */
	private final List<GoalImportance> values = new ArrayList<GoalImportance>();

	/**
	 * @uml.property  name="matrix"
	 * @uml.associationEnd  multiplicity="(1 1)"
	 */
	private Matrix matrix = Matrix.identity(1, 1);

	/**
	 * @uml.property  name="comparison"
	 * @uml.associationEnd  qualifier="valueOf:java.lang.Double java.lang.Double"
	 */
	private final HashMap<Double, Double> comparison = new HashMap<Double, Double>();

	public GoalWeightsMatrix(int numGoals, List<GoalImportance> weights) {
		super();
		comparison.put(-9D, 1D / 10D);
		comparison.put(-8D, 1D / 9D);
		comparison.put(-7D, 1D / 8D);
		comparison.put(-6D, 1D / 7D);
		comparison.put(-5D, 1D / 6D);
		comparison.put(-4D, 1D / 5D);
		comparison.put(-3D, 1D / 4D);
		comparison.put(-2D, 1D / 3D);
		comparison.put(-1D, 1D / 2D);
		comparison.put(0D, 1D);
		comparison.put(1D, 2D);
		comparison.put(2D, 3D);
		comparison.put(3D, 4D);
		comparison.put(4D, 5D);
		comparison.put(5D, 6D);
		comparison.put(6D, 7D);
		comparison.put(7D, 8D);
		comparison.put(8D, 9D);
		comparison.put(9D, 10D);

		numberOfGoals = numGoals;

		if (weights != null && weights.size() > 0)
			values.addAll(weights);

		if (!(values.size() >= numberOfGoals * (numberOfGoals - 1) / 2))
			for (int i = 0; i < numberOfGoals - 1; i++)
				for (int j = i + 1; j < numberOfGoals; j++)
						values.add(new GoalImportance(i, j, 0D, null));

		setMatrixWeights();

	}

	/**
	 * @return
	 * @uml.property  name="matrix"
	 */
	public Matrix getMatrix() {
		return matrix;
	}

	private void setMatrixWeights() {
		if (numberOfGoals > 1) {
            double[][] mat = Matrix.identity(numberOfGoals, numberOfGoals).getArray();
            for (GoalImportance value : values) {
                if (value != null) {
                    double val = comparison.get(value.getComparisonAToB());
                    mat[value.getCritA()][value.getCritB()] = val;
                    if (val != 0D)
                        mat[value.getCritB()][value.getCritA()] = 1D / val;
                }
            }
            matrix = new Matrix(mat);
        }

	}

	public String checkMatrix() {

		// check matrix size
		int size = numberOfGoals;
		if (matrix.getColumnDimension() != size) {
			return "false column dimension";
		}

		if (matrix.getRowDimension() != size) {
			return "false row dimension";
		}

		// check diogonal in matrix (must be 1)
		for (int i = 0; i < size; i++) {
			if (matrix.get(i, i) != 1) {
				return "diagonal not 1";
			}
		}

		// check inverse
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) {
				if (matrix.get(i, j) != (1 / matrix.get(j, i))) {
					return "false inverse";
				}
			}
		}

		return "matrix ok";
	}

}


text:
import test_support
import os, struct, stat, sys

try:
    import signal
    # The default handler for SIGXFSZ is to abort the process.
    # By ignoring it, system calls exceeding the file size resource
    # limit will raise IOError instead of crashing the interpreter.
    oldhandler = signal.signal(signal.SIGXFSZ, signal.SIG_IGN)
except (ImportError, AttributeError):
    pass

# create >2GB file (2GB = 2147483648 bytes)
size = 2500000000L
name = test_support.TESTFN

# On Windows this test comsumes large resources; It takes a long time to build
# the >2GB file and takes >2GB of disk space therefore the resource must be
# enabled to run this test.  If not, nothing after this line stanza will be
# executed.
if sys.platform[:3] == 'win':
    test_support.requires(
        'largefile',
        'test requires %s bytes and a long time to run' % str(size))
else:
    # Only run if the current filesystem supports large files.
    # (Skip this test on Windows, since we now always support large files.)
    f = open(test_support.TESTFN, 'wb')
    try:
        # 2**31 == 2147483648
        f.seek(2147483649L)
        # Seeking is not enough of a test: you must write and flush, too!
        f.write("x")
        f.flush()
    except (IOError, OverflowError):
        f.close()
        os.unlink(test_support.TESTFN)
        raise test_support.TestSkipped, \
              "filesystem does not have largefile support"
    else:
        f.close()

def expect(got_this, expect_this):
    if test_support.verbose:
        print '%r =?= %r ...' % (got_this, expect_this),
    if got_this != expect_this:
        if test_support.verbose:
            print 'no'
        raise test_support.TestFailed, 'got %r, but expected %r' %\
              (got_this, expect_this)
    else:
        if test_support.verbose:
            print 'yes'

# test that each file function works as expected for a large (i.e. >2GB, do
# we have to check >4GB) files

if test_support.verbose:
    print 'create large file via seek (may be sparse file) ...'
f = open(name, 'wb')
f.write('z')
f.seek(0)
f.seek(size)
f.write('a')
f.flush()
if test_support.verbose:
    print 'check file size with os.fstat'
expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1)
f.close()
if test_support.verbose:
    print 'check file size with os.stat'
expect(os.stat(name)[stat.ST_SIZE], size+1)

if test_support.verbose:
    print 'play around with seek() and read() with the built largefile'
f = open(name, 'rb')
expect(f.tell(), 0)
expect(f.read(1), 'z')
expect(f.tell(), 1)
f.seek(0)
expect(f.tell(), 0)
f.seek(0, 0)
expect(f.tell(), 0)
f.seek(42)
expect(f.tell(), 42)
f.seek(42, 0)
expect(f.tell(), 42)
f.seek(42, 1)
expect(f.tell(), 84)
f.seek(0, 1)
expect(f.tell(), 84)
f.seek(0, 2) # seek from the end
expect(f.tell(), size + 1 + 0)
f.seek(-10, 2)
expect(f.tell(), size + 1 - 10)
f.seek(-size-1, 2)
expect(f.tell(), 0)
f.seek(size)
expect(f.tell(), size)
expect(f.read(1), 'a') # the 'a' that was written at the end of the file above
f.seek(-size-1, 1)
expect(f.read(1), 'z')
expect(f.tell(), 1)
f.close()

if test_support.verbose:
    print 'play around with os.lseek() with the built largefile'
f = open(name, 'rb')
expect(os.lseek(f.fileno(), 0, 0), 0)
expect(os.lseek(f.fileno(), 42, 0), 42)
expect(os.lseek(f.fileno(), 42, 1), 84)
expect(os.lseek(f.fileno(), 0, 1), 84)
expect(os.lseek(f.fileno(), 0, 2), size+1+0)
expect(os.lseek(f.fileno(), -10, 2), size+1-10)
expect(os.lseek(f.fileno(), -size-1, 2), 0)
expect(os.lseek(f.fileno(), size, 0), size)
expect(f.read(1), 'a') # the 'a' that was written at the end of the file above
f.close()

# XXX add tests for truncate if it exists
# XXX has truncate ever worked on Windows? specifically on WinNT I get:
#     "IOError: [Errno 13] Permission denied"
##try:
##      newsize = size - 10
##      f.seek(newsize)
##      f.truncate()
##      expect(f.tell(), newsize)
##      newsize = newsize - 1
##      f.seek(0)
##      f.truncate(newsize)
##      expect(f.tell(), newsize)
##except AttributeError:
##      pass

os.unlink(name)


text:
#ifndef ES_HTMLINPUTSTREAM_H
#define ES_HTMLINPUTSTREAM_H

#include "U16InputStream.h"

// cf. 10.2.2 The input stream
class HTMLInputStream : public U16ConverterInputStream
{
    static const char* getAttr(const char* p, std::string& name, std::string& value);
    static const char* handleTag(const char* p);
    static std::string handleContentType(const char* p);

    const char* handleMeta(const char* p);
    virtual bool detect(const char* p);
public:
    HTMLInputStream(std::istream& stream, const std::string& optionalEncoding = "");
};

#endif  // ES_HTMLINPUTSTREAM_H


text:
package dbtarzan.db.actor

import dbtarzan.db._
import org.scalatest.flatspec.AnyFlatSpec

class DatabaseWorkerCacheTest extends AnyFlatSpec {
  "the cache" should "extract the primary key for a table only the first time it gets called" in {
    val cache = new DatabaseWorkerCache()
    cache.cachedPrimaryKeys("user", new PrimaryKeys(List(PrimaryKey("key1", List("lastName")))))
    val keys = cache.cachedPrimaryKeys("user", new PrimaryKeys(List(PrimaryKey("key2", List("lastName")))))
	assert("key1" === keys.keys.head.keyName)
  }

 "the cache" should "contain the columns" in {
    val cache = new DatabaseWorkerCache()
    val fields = cache.cachedFields("user", new Fields(List(Field("lastName", FieldType.STRING, ""))))
	assert("lastName" === fields.fields.head.name)
  }

 "the cache" should "contain the foreign keys" in {
    val cache = new DatabaseWorkerCache()
    val keys = cache.cachedForeignKeys("user", ForeignKeys(List(
      ForeignKey("lastNameKey", FieldsOnTable("user", List("lastName")), FieldsOnTable("class", List("lastName")), ForeignKeyDirection.STRAIGHT)
      )))
	assert("lastNameKey" === keys.keys.head.name)
  }
 "the cache" should "have different keys for different tables" in {
    val cache = new DatabaseWorkerCache()
    cache.cachedPrimaryKeys("user", new PrimaryKeys(List(PrimaryKey("key1", List("lastName")))))
    cache.cachedPrimaryKeys("city", new PrimaryKeys(List(PrimaryKey("key2", List("name")))))
    val keysUser = cache.cachedPrimaryKeys("user", new PrimaryKeys(List.empty))
    val keysCity = cache.cachedPrimaryKeys("city", new PrimaryKeys(List.empty))
	assert("key1" === keysUser.keys.head.keyName)
	assert("key2" === keysCity.keys.head.keyName)
  }
}


text:
Test function get_cfg_var() by calling it more than or less than its expected arguments
--CREDITS--
Francesco Fullone ff@ideato.it
#PHPTestFest Cesena Italia on 2009-06-20
--INI--
session.use_cookies=0
session.serialize_handler=php
session.save_handler=files
--FILE--
<?php

echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";

var_dump(get_cfg_var( 'session.use_cookies', 'session.serialize_handler' ) );
var_dump(get_cfg_var(  ) );

?>
--EXPECTF--
*** Test by calling method or function with incorrect numbers of arguments ***

Warning: get_cfg_var() expects exactly 1 parameter, 2 given in %s on line %d
NULL

Warning: get_cfg_var() expects exactly 1 parameter, 0 given in %s on line %d
NULL


text: Native Language Identification


text:
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;

internal static partial class Interop
{
    internal static partial class Sys
    {
        [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", SetLastError = true)]
        internal static extern SafePipeHandle OpenPipe(string filename, OpenFlags flags, int mode);
    }
}


text:
import './setup';
import {If} from '../src/if';
import {TaskQueue} from 'aurelia-task-queue';
import {bootstrap} from 'aurelia-bootstrapper';
import {ComponentTester} from 'aurelia-testing';

describe('if', () => {
  let viewSlot, taskQueue, sut, viewFactory;

  beforeEach(() => {
    viewSlot = new ViewSlotMock();
    taskQueue = new TaskQueue();
    viewFactory = new BoundViewFactoryMock();
    sut = new If(viewFactory, viewSlot);
  });

  it('should remove and unbind view when showing and provided value is falsy', () => {
    let view = new ViewMock();
    sut.view = view;
    sut.showing = true;
    spyOn(viewSlot, 'remove');
    spyOn(view, 'unbind');

    sut.conditionChanged(false);
    taskQueue.flushMicroTaskQueue();

    expect(viewSlot.remove).toHaveBeenCalledWith(view);
    expect(view.unbind).toHaveBeenCalled();
    expect(sut.showing).toBe(false);
  });

  it('should correctly unbind and remove view when showing and being unbound itself', () => {
    let view = new ViewMock();
    sut.view = view;
    sut.showing = true;
    viewFactory.isCaching = true;
    spyOn(viewSlot, 'remove');
    spyOn(view, 'unbind');

    sut.unbind();
    taskQueue.flushMicroTaskQueue();

    expect(view.unbind).toHaveBeenCalled();
    expect(viewSlot.remove).toHaveBeenCalledWith(view, true, true);
    expect(sut.showing).toBe(false);
    expect(sut.view).toBeNull();
  });

  it('should correctly unbind view and return it to cache when not showing and being unbound itself', () => {
    let view = new ViewMock();
    sut.view = view;
    sut.showing = false;
    viewFactory.isCaching = true;
    spyOn(viewSlot, 'remove');
    spyOn(view, 'unbind');
    spyOn(view, 'returnToCache');

    sut.unbind();
    taskQueue.flushMicroTaskQueue();

    expect(view.unbind).toHaveBeenCalled();
    expect(viewSlot.remove).not.toHaveBeenCalled();
    expect(view.returnToCache).toHaveBeenCalled();
    expect(sut.view).toBeNull();
  });

  it('should correctly unbind view without removing it when viewFactory is caching and being unbound itself', () => {
    let view = new ViewMock();
    sut.view = view;
    sut.showing = true;
    viewFactory.isCaching = false;
    spyOn(viewSlot, 'remove');
    spyOn(view, 'unbind');
    spyOn(view, 'returnToCache');

    sut.unbind();
    taskQueue.flushMicroTaskQueue();

    expect(sut.showing).toBeTruthy();
    expect(view.unbind).toHaveBeenCalled();
    expect(viewSlot.remove).not.toHaveBeenCalled();
    expect(view.returnToCache).not.toHaveBeenCalled();
    expect(sut.view).not.toBeNull();
  });

  it('should do nothing when not showing and provided value is falsy', () => {
    let view = new ViewMock();
    sut.view = view;
    sut.showing = false;
    spyOn(viewSlot, 'remove');
    spyOn(view, 'unbind');

    sut.conditionChanged(false);
    taskQueue.flushMicroTaskQueue();

    expect(viewSlot.remove).not.toHaveBeenCalled();
    expect(view.unbind).not.toHaveBeenCalled();
    expect(sut.showing).toBe(false);
  });

  it('should create the view when provided value is truthy and has no view', () => {
    sut.view = null;

    sut.conditionChanged(true);

    expect(sut.view).toEqual(jasmine.any(ViewMock));
  });

  it('should create the view', () => {
    sut.condition = true;
    sut.view = null;
    let newView = new ViewMock();
    spyOn(viewFactory, 'create').and.callFake(() => {
      return newView;
    });
    spyOn(newView, 'bind');
    let bindingContext = 42;
    let overrideContext = 24;

    sut.bind(bindingContext, overrideContext);

    expect(viewFactory.create).toHaveBeenCalled();
    expect(newView.bind).toHaveBeenCalledWith(42, 24);
  });

  it('should rebind child-view if needed when being bound itself and condition is truthy', () => {
    sut.condition = true;
    sut.showing = true;
    sut.view = {isBound: false, bind: jasmine.createSpy('bind')};
    let bindingContext = 42;
    let overrideContext = 24;

    spyOn(sut, '_show').and.callThrough();

    sut.bind(bindingContext, overrideContext);

    expect(sut._show).toHaveBeenCalled();
    expect(sut.view.bind).toHaveBeenCalledWith(42, 24);
  });

  it('should unbind the child-view when being bound itself and condition is falsy', () => {
    sut.condition = false;
    sut.showing = true;
    sut.view = {isBound: false, unbind: jasmine.createSpy('unbind')};
    let bindingContext = 42;
    let overrideContext = 24;

    spyOn(sut, '_hide').and.callThrough();

    sut.bind(bindingContext, overrideContext);

    expect(sut._hide).toHaveBeenCalled();
    expect(sut.view.unbind).toHaveBeenCalled();
  });

  it('should set the view instance to null after correctly unbound when caching is turned off', () => {
    sut.condition = false;
    sut.showing = true;
    const view = {isBound: false, unbind: jasmine.createSpy('unbind')};
    sut.view = view;
    sut.cache = false;
    let bindingContext = 42;
    let overrideContext = 24;

    spyOn(sut, '_hide').and.callThrough();

    sut.bind(bindingContext, overrideContext);

    expect(sut._hide).toHaveBeenCalled();
    expect(view.unbind).toHaveBeenCalled();
    expect(sut.view).toBeNull();
  });

  it('should set the view instance to null after correctly unbound when caching is turned off by string "false"', () => {
    sut.condition = false;
    sut.showing = true;
    const view = {isBound: false, unbind: jasmine.createSpy('unbind')};
    sut.view = view;
    sut.cache = 'false';
    let bindingContext = 42;
    let overrideContext = 24;

    spyOn(sut, '_hide').and.callThrough();

    sut.bind(bindingContext, overrideContext);

    expect(sut._hide).toHaveBeenCalled();
    expect(view.unbind).toHaveBeenCalled();
    expect(sut.view).toBeNull();
  });

  it('should show the view when provided value is truthy and currently not showing', () => {
    sut.showing = false;
    sut.view = new ViewMock();
    spyOn(viewSlot, 'add');

    sut.conditionChanged(true);

    expect(sut.showing).toBe(true);
    expect(viewSlot.add).toHaveBeenCalledWith(sut.view);
  });

  it('should bind the view if not bound', () => {
    sut.showing = false;
    let view = new ViewMock();
    sut.view = view;
    spyOn(view, 'bind');

    sut.conditionChanged(true);

    expect(view.bind).toHaveBeenCalled();
  });

  describe('during animation', () => {
    let delay = ms => new Promise(resolve => setTimeout(resolve, ms));

    let removeWithAnimation = animationDuration => {
      return function() {
        return delay(animationDuration).then(() => {
          this.children = [];
        });
      };
    };

    let addWithAnimation = animationDuration => {
      return function(view) {
        return delay(animationDuration).then(() => {
          this.children.push(view);
        });
      };
    };

    beforeEach(() => {
      spyOn(viewSlot, 'remove').and.callFake(removeWithAnimation(600));
      spyOn(viewSlot, 'add').and.callFake(addWithAnimation(0));
    });

    it('should correctly handle value changes during remove animation', done => {
      sut.showing = false;
      sut.view = new ViewMock();
      sut.view.isBound = true;
      sut.viewSlot.children = [];

      sut.condition = true;
      sut.conditionChanged(true);

      delay(200).then(() => {
        sut.condition = false;
        sut.conditionChanged(false);
        return delay(400);
      }).then(() => {
        sut.condition = true;
        sut.conditionChanged(true);
        return delay(600);
      }).then(() => {
        expect(viewSlot.children.length).toEqual(1);
      })
      .then(() => done());
    });
  });

  xdescribe('in a nested situation', () => {
    let component;
    let model;

    beforeEach(() => {
      model = { a: true, b: true, clicked() { } };
      component = new ComponentTester();
      component.bootstrap(aurelia => {
        aurelia.use.standardConfiguration();
        taskQueue = aurelia.container.get(TaskQueue);
      });
      component
        .withResources('test/if-test')
        .inView(`<div ift.bind="a" id="a">
                  <div ift.bind="b" id="b" click.delegate="clicked()">
                  </div>
                </div>`)
        .boundTo(model);
    });

    afterEach(() => component.dispose());

    it('should rebind even if the view is visible; issue #317', done => {
      let spy;
      component.create(bootstrap)
        .then(() => {
          spy = spyOn(model, 'clicked');
          model.a = false;
          taskQueue.flushMicroTaskQueue();

          // This is horrible, but the only way I found to get things working
          return new Promise(r => setTimeout(r, 1));
        }).then(() => {
          model.a = true;
          taskQueue.flushMicroTaskQueue();
          return new Promise(r => setTimeout(r, 1));
        }).then(() => {
          document.getElementById('b').click();

          expect(spy).toHaveBeenCalled();
          done();
        })
        .catch(e => {
          fail(e);
          done();
        });
    });

    it('should update view when rebound; issue #328', done => {
      component.create(bootstrap)
        .then(() => {
          model.a = false;
          taskQueue.flushMicroTaskQueue();
          return new Promise(r => setTimeout(r, 1));
        }).then(() => {
          model.b = false;
          model.a = true;
          taskQueue.flushMicroTaskQueue();
          return new Promise(r => setTimeout(r, 1));
        }).then(() => {
          expect(document.getElementById('a')).not.toBeNull();
          expect(document.getElementById('b')).toBeNull();
          done();
        })
        .catch(e => {
          fail(e);
          done();
        });
    });
  });
});

class ViewSlotMock {
  remove() {}
  add() {}
}

class ViewMock {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bind(...args: unknown[]) {}
  unbind() {}
  returnToCache() {}
}

class BoundViewFactoryMock {
  create() {
    return new ViewMock();
  }
}


text:
from django.conf import settings

from openstack_dashboard.usage import quotas

def _has_permission(request, policy):
    has_permission = True
    policy_check = getattr(settings, "POLICY_CHECK_FUNCTION", None)

    if policy_check:
        has_permission = policy_check(policy, request)

    return has_permission

def _quota_exceeded(request, quota):
    usages = quotas.tenant_quota_usages(request)
    available = usages.get(quota, {}).get('available', 1)
    return available <= 0

def get_context(request, context=None):
    """Returns common context data for network topology views."""
    if context is None:
        context = {}

    network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})

    context['launch_instance_allowed'] = _has_permission(
        request, (("compute", "compute:create"),))
    context['instance_quota_exceeded'] = _quota_exceeded(request, 'instances')
    context['create_network_allowed'] = _has_permission(
        request, (("network", "create_network"),))
    context['network_quota_exceeded'] = _quota_exceeded(request, 'networks')
    context['create_router_allowed'] = (
        network_config.get('enable_router', True) and
        _has_permission(request, (("network", "create_router"),)))
    context['router_quota_exceeded'] = _quota_exceeded(request, 'routers')
    context['console_type'] = getattr(settings, 'CONSOLE_TYPE', 'AUTO')
    context['show_ng_launch'] = getattr(
        settings, 'LAUNCH_INSTANCE_NG_ENABLED', True)
    context['show_legacy_launch'] = getattr(
        settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False)
    return context


text:
/* Custom Stylesheet */
/**
 * Use this file to override Materialize files so you can update
 * the core Materialize files in the future
 *
 * Made By MaterializeCSS.com
 */

html {
    font-family: anonymous_pro, Calibri, Trebuchet, sans-serif;
  }

header, main, footer {
      padding-left: 300px;
    }

    @media only screen and (max-width : 992px) {
      header, main, footer {
        padding-left: 0;
      }
    }

.title{
    font-family: 'Merriweather', serif;
    font-size: 12px;

}
strong{
    font-weight: bold;
}
.header{
    font-family: 'Merriweather', serif;
}

.keybuttons{
    margin-right: 10px;
    margin-bottom: 10px;
    color: dodgerblue;
    text-transform: lowercase;
    font-weight: lighter;
    -moz-border-radius: 30px 30px 30px 0;

}

.keybuttons:hover{
    background-color: dodgerblue!important;
    color: white;
}

.tab:hover{
    color: white;
}

.keybuttons:active{
    background-color: white !important;
    color: dodgerblue !important;
}

nav ul a,
nav .brand-logo {
  color: #737373;
  font-size: 1rem;

}

p {
  line-height: 2rem;
}

.button-collapse {
  color: #26a69a;
}

.parallax-container {
  min-height: 200px;
  line-height: 0;
  height: auto;
  color: rgba(255,255,255,.9);
}
  .parallax-container .section {
    width: 100%;
  }

@media only screen and (max-width : 992px) {
  .parallax-container .section {
    position: absolute;
    top: 40%;
  }
  #index-banner .section {
    top: 10%;
  }
}

@media only screen and (max-width : 600px) {
  #index-banner .section {
    top: 0;
  }
}

.icon-block {
  padding: 0 15px;
}
.icon-block .material-icons {
  font-size: inherit;
}

footer.page-footer {
  margin: 0;
}