text:
/* @override
  http://localhost:4000/assets/css/styles.css */

#variant_summary_table tr td:nth-child(2), #variant_summary_table tr td:nth-child(3) {
  text-align: right;
}

.bold {
    font-weight: bold;
}

.col-list {
    display: block;
    width: 25%;
    float: left;
 }

#feedback {
  position: fixed;
  right: 15%;
  bottom: 0;
  z-index: 50000;
  margin-left: -3px;
  margin-bottom: -3px;
}

#feedback-form {
  float: left;
  width: 300px;
  height: 100%;
  z-index: 50000;
  padding-left: 5px;
  padding-right: 10px;
  background-clip: 'padding-box';
  border: 1px solid rgba(0,0,0,.2);
  -moz-border-radius: 0px;
  -webkit-border-radius: 0px;
  border-radius: 0px;
  -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
  -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
  box-shadow: 0 5px 10px rgba(0,0,0,.2);
}

.form-error {
  text-size: 12px;
  color: red;
  font-weight: 600;
}

#feedback-tab {
  float: right;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  text-align: center;
  width: 120px;
  height: 42px;
  background-color: rgba(0,0,0,0.5);
  margin-top: 60px;
  margin-left: -42px;
  padding-top: 5px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
}

.progress {
  margin-top: 20px;
}

#feedback-tab:hover {
  background-color: rgba(0,0,0,0.4);
}

#feedback-form textarea {
  resize: none;
}

.tooltip-item {
    border-bottom: 1px dotted #777;
}

body {
  text-align:left;
}

p {
  text-align: justify;
  padding: 5px 15px;
}

.content ul {
  margin-bottom: 10px !important;
}

#report-container img {
  max-width: 100%;
}

.legend {
    padding: 0px 0px;
    font: 10px sans-serif;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}
.key path {
  display: none;
}

.pub-img, .lab-member-photo {
  width:150px;
  float:left;
  margin-right:20px;
}
.pub-img-small, .lab-member-photo-small {
  width:120px;
  float:left;
  margin-right:20px;
}

.container-fluid {
  height: 100%;
}

/* Loading Spinner */

.fa-spin-custom, .glyphicon-spin {
    -webkit-animation: spin 1000ms infinite linear;
    animation: spin 1000ms infinite linear;
}
@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
@keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}

.spinner {
  margin: 0px auto 0;
  width: 70px;
  text-align: center;
}

.spinner > div {
  width: 18px;
  height: 18px;
  background-color: #333;

  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0) }
  40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
  0%, 80%, 100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  } 40% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}
/* End loading spinner */

/* Browser */

tr.isotype-select {
  width: 100%;
  display: block;
}

td.isotype-item {
  margin: 0px !important;
  padding: 0px !important;
}

td.isotype-item label {
  margin: 0px;
  padding: 10px;
}

#browser_strain_list {
  border: 1px solid #999999;
  display: block;
  width: 100%;
}

#browser_strain_list thead, #browser_strain_list tbody { display: block; }

#browser_strain_list tbody {
    height: 240px;       /* Just for the demo          */
    overflow-y: auto;    /* Trigger vertical scroll    */
    overflow-x: hidden;  /* Hide the horizontal scroll */
}

#browser_strain_list td {
  width: 100%;
  white-space: nowrap;
}

#browser_strain_list label {
  display: block;
}

#search-table {
  max-height: 500px;
  width: 100%;
  display: block;
  overflow-y: scroll;
}

#search-table td, th {
  width: 25%;
  width: 1px solid #999999;
}

#search-table a {
  cursor: pointer;
}

#ftable tr td:nth-child(3), #ftable tr td:nth-child(4),
#ftable tr th:nth-child(3), #ftable tr th:nth-child(4)   {
    text-align:right;
}

#ftable tr td:nth-child(5), #ftable tr th:nth-child(5)  {
    text-align:center;
}

.legend-box {
  border: 1px solid black;
  width: 12px;
  height: 12px;
  display: inline-block;
}

.scroll {
    height:400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-menu .sub-menu {
    left: 100%;
    position: absolute;
    top: 0;
    visibility: hidden;
    margin-top: -1px;
}

.dropdown-menu li:hover .sub-menu {
    visibility: visible;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.nav-tabs .dropdown-menu, .nav-pills .dropdown-menu, .navbar .dropdown-menu {
    margin-top: 0;
}

.navbar .sub-menu:before {
    border-bottom: 7px solid transparent;
    border-left: none;
    border-right: 7px solid rgba(0, 0, 0, 0.2);
    border-top: 7px solid transparent;
    left: -7px;
    top: 10px;
}
.navbar .sub-menu:after {
    border-top: 6px solid transparent;
    border-left: none;
    border-right: 6px solid #fff;
    border-bottom: 6px solid transparent;
    left: 10px;
    top: 11px;
    left: -6px;
}

.thumbnail {
  text-align: left;
}

.member, .member p, .member > blockquote {
    text-align:left;
}

article {
    min-height: 300 px;
}

.list-group-item-heading {
    text-align:left;
}

.jumbotron {
  background: url(/static/img/main/worms6.png) right bottom no-repeat #eeeeee;
    text-align:left;
}

.img-resize {
    width: 50vmin;
}

.funding {
  max-height: 150px;
  margin:auto;
  margin-bottom:20px;
}

.internal-table {
  margin: 0px;
}
.internal-td {
  padding: 0px;
}

.track-isotype-td {
  width: 50%;
}

.track-isotype-select label {
  display: block;
}

#checkout.affix {
    position: fixed;
    top: 20px;
    width: 228px;
}

.price {
    text-align: right;
}

.log {
    font-family: monospace;
    display: none;
}

.highlight  { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */

/* Leaflet search */

.leaflet-container .leaflet-control-search {
  position:relative;
  float:left;
  background:#fff;
  color:#1978cf;
  border: 2px solid rgba(0,0,0,0.2);
  background-clip: padding-box;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.8);
  z-index:1000;
  margin-left: 10px;
  margin-top: 10px;
}
.leaflet-control-search.search-exp {/*expanded*/
  background: #fff;
  border: 2px solid rgba(0,0,0,0.2);
  background-clip: padding-box;
}
.leaflet-control-search .search-input {
  display:block;
  float:left;
  background: #fff;
  border:1px solid #666;
  border-radius:2px;
  height:22px;
  padding:0 20px 0 2px;
  margin:4px 0 4px 4px;
}
.leaflet-control-search.search-load .search-input {
  background: url('../images/loader.gif') no-repeat center right #fff;
}
.leaflet-control-search.search-load .search-cancel {
  visibility:hidden;
}
.leaflet-control-search .search-cancel {
  display:block;
  width:22px;
  height:22px;
  position:absolute;
  right:28px;
  margin:6px 0;
  background: url('../images/search-icon.png') no-repeat 0 -46px;
  text-decoration:none;
  filter: alpha(opacity=80);
  opacity: 0.8;
}
.leaflet-control-search .search-cancel:hover {
  filter: alpha(opacity=100);
  opacity: 1;
}
.leaflet-control-search .search-cancel span {
  display:none;/* comment for cancel button imageless */
  font-size:18px;
  line-height:20px;
  color:#ccc;
  font-weight:bold;
}
.leaflet-control-search .search-cancel:hover span {
  color:#aaa;
}
.leaflet-control-search .search-button {
  display:block;
  float:left;
  width:30px;
  height:30px;
  background: url('../images/search-icon.png') no-repeat 4px 4px #fff;
  border-radius:4px;
}
.leaflet-control-search .search-button:hover {
  background: url('../images/search-icon.png') no-repeat 4px -20px #fafafa;
}
.leaflet-control-search .search-tooltip {
  position:absolute;
  top:100%;
  left:0;
  float:left;
  list-style: none;
  padding-left: 0;
  min-width:120px;
  max-height:122px;
  box-shadow: 1px 1px 6px rgba(0,0,0,0.4);
  background-color: rgba(0, 0, 0, 0.25);
  z-index:1010;
  overflow-y:auto;
  overflow-x:hidden;
  cursor: pointer;
}
.leaflet-control-search .search-tip {
  margin:2px;
  padding:2px 4px;
  display:block;
  color:black;
  background: #eee;
  border-radius:.25em;
  text-decoration:none;
  white-space:nowrap;
  vertical-align:center;
}
.leaflet-control-search .search-button:hover {
  background-color: #f4f4f4;
}
.leaflet-control-search .search-tip-select,
.leaflet-control-search .search-tip:hover {
  background-color: #fff;
}
.leaflet-control-search .search-alert {
  cursor:pointer;
  clear:both;
  font-size:.75em;
  margin-bottom:5px;
  padding:0 .25em;
  color:#e00;
  font-weight:bold;
  border-radius:.25em;
}

/* STRAIN Table */
#download td {
  border: none;
}

#download .strain {
  border-bottom: 1px dashed #ccc;
  color: #9c9c9c;
}

#download .ref_strain {
  border-top: 2px solid #C0CEBE;
  padding-top: 5px;
  font-weight: 600;
}

/* Tools */
#glyph {
  width: 850px;
  height: 300px;
}

.btn-link {
    cursor: pointer;
}


text:
{% if page.author %}
  {% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.owner %}
{% endif %}

{{ site.data.messages.locales[site.locale].written_by }} {% if author.web %}{{ author.name }}{% else %}{{ author.name }}{% endif %}

{{ author.bio }}

    <meta itemprop="url" content="{{ site.url }}/assets/image-fullsize/logo.jpg">
    <meta itemprop="width" content="600">
    <meta itemprop="height" content="60">

  <meta itemprop="name" content="matthewgraybosch.com">

redpajama_set_name: RedPajamaGithub


text:
require "spec_helper"

describe Discobolo::Logger do
  before do
    Discobolo::Config.setup do |config|
      config.client = ["127.0.0.1:7711"]
      config.queues = ["default"]
      config.fetch_options = {count: 10, timeout: 2000}
    end

  end

  it "extends Logger" do
    expect(Discobolo::Config.logger.class.ancestors).to include(Logger)
  end
end


text:
module.exports = {
  description: 'Generates a drf-adapter for you to customize.'

  // locals: function(options) {
  //   // Return custom template variables here.
  //   return {
  //     foo: options.entity.options.foo
  //   };
  // }

  // afterInstall: function(options) {
  //   // Perform extra work here.
  // }
};


text:
package org.ovirt.engine.extensions.aaa.builtin.kerberosldap;

import java.util.Properties;

import javax.naming.directory.SearchControls;

import org.apache.commons.lang.StringUtils;
import org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ldap.LdapProviderType;
import org.springframework.ldap.core.NameClassPairCallbackHandler;
import org.springframework.ldap.core.support.DirContextAuthenticationStrategy;
import org.springframework.ldap.core.support.LdapContextSource;
import org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy;

public class SimpleLdapTemplateWrapper extends LDAPTemplateWrapper {

    /**
     * @param contextSource
     */
    public SimpleLdapTemplateWrapper(Properties configuration, LdapContextSource contextSource, String userName, String password, String path) {
        super(configuration, contextSource, userName, password, path);
    }

    @Override
    public void search(String baseDN, String filter, String displayFilter, SearchControls searchControls, NameClassPairCallbackHandler handler) {
        searchControls.setCountLimit(1000); //SIMPLE mode will limit have a limitation of 1000 results - as this is used
        //only by development, this is a reasonable limitation
        pagedSearch(baseDN, filter, displayFilter, searchControls, handler);

    }

    @Override
    protected DirContextAuthenticationStrategy buildContextAuthenticationStategy() {
        return new SimpleDirContextAuthenticationStrategy();
    }

    @Override
    public void adjustUserName(LdapProviderType ldapProviderType) {
        StringBuilder userDNSb = new StringBuilder();

        if ( ldapProviderType.equals(LdapProviderType.activeDirectory) ) {
            userDNSb.append("CN=").append(userName).append(",CN=Users");
        } else if (ldapProviderType.equals(LdapProviderType.rhds) || ldapProviderType.equals(LdapProviderType.openLdap)) {
            userDNSb.append("uid=").append(userName).append(",ou=People");
        } else {
            userDNSb.append("uid=").append(userName).append(",cn=Users").append(",cn=Accounts");
        }

        if (StringUtils.isNotEmpty(baseDN)) {
            String dcDN = getDcDN(baseDN);
            if (!dcDN.isEmpty()) {
                userDNSb.append(",").append(dcDN);
            }
        }

        userName = userDNSb.toString();
    }

    @Override
    protected void setCredentialsOnContext() {
        contextSource.setUserDn(userName);
        contextSource.setPassword(password);

    }

    private String getDcDN(String baseDN) {
        if (!baseDN.isEmpty()) {
            int dcIndex = baseDN.toLowerCase().indexOf("dc=");

            if ( dcIndex == -1 ) {
                dcIndex = 0;
            }

            return baseDN.substring(dcIndex);
        } else {
            return "";
        }
    }

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Mem. Acad. Roy. Sci. Hist. (Berlin) 1798:102. 1798

#### Original name
null

### Remarks
null


text:
package rest

import (
	"crypto/tls"
	"crypto/x509"
	"net/http"
	"net/url"

	restful "github.com/emicklei/go-restful"
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/ghttp"
	authorizationclient "k8s.io/client-go/kubernetes/typed/authorization/v1"
	"k8s.io/client-go/tools/clientcmd"
)

var _ = Describe("Authorizer", func() {

	Describe("VirtualMachineInstance Subresources", func() {
		var server *ghttp.Server
		var req *restful.Request

		fakecert := &x509.Certificate{}

		app := authorizor{}
		BeforeEach(func() {
			req = &restful.Request{}
			req.Request = &http.Request{}
			req.Request.URL = &url.URL{}
			req.Request.Header = make(map[string][]string)
			req.Request.Header[userHeader] = []string{"user"}
			req.Request.Header[groupHeader] = []string{"userGroup"}
			req.Request.Header[userExtraHeaderPrefix+"test"] = []string{"userExtraValue"}

			server = ghttp.NewServer()
			config, err := clientcmd.BuildConfigFromFlags(server.URL(), "")
			Expect(err).ToNot(HaveOccurred())

			client, err := authorizationclient.NewForConfig(config)
			Expect(err).ToNot(HaveOccurred())

			app.subjectAccessReview = client.SubjectAccessReviews()
			app.userHeaders = append(app.userHeaders, userHeader)
			app.groupHeaders = append(app.groupHeaders, groupHeader)
			app.userExtraHeaderPrefixes = append(app.userExtraHeaderPrefixes, userExtraHeaderPrefix)
		})

		Context("Subresource api with namespaced resource", func() {
			Context("with namespaced resource", func() {
				BeforeEach(func() {
					req.Request.Method = http.MethodGet
					req.Request.URL.Path = "/apis/subresources.kubevirt.io/v1alpha3/namespaces/default/virtualmachineinstances/testvmi/console"
				})

				It("should reject unauthenticated user", func() {
					allowed, reason, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeFalse())
					Expect(reason).To(Equal("request is not authenticated"))
				})

				It("should reject unauthorized user", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					result, err := app.generateAccessReview(req)
					Expect(err).ToNot(HaveOccurred())
					result.Status.Allowed = false
					result.Status.Reason = "just because"

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusOK, result),
						),
					)

					allowed, reason, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeFalse())
					Expect(reason).To(Equal("just because"))
				})

				It("should allow authorized user", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					result, err := app.generateAccessReview(req)
					Expect(err).ToNot(HaveOccurred())
					result.Status.Allowed = true

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusOK, result),
						),
					)

					allowed, _, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeTrue())
				})

				It("should not allow user if auth check fails", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusInternalServerError, nil),
						),
					)

					allowed, _, err := app.Authorize(req)
					Expect(err).To(HaveOccurred())
					Expect(allowed).To(BeFalse())
				})
			})

			Context("with namespaced base resource", func() {
				BeforeEach(func() {
					req.Request.Method = http.MethodPut
					req.Request.URL.Path = "/apis/subresources.kubevirt.io/v1alpha3/namespaces/default/expand-vm-spec"
				})

				It("should reject unauthenticated user", func() {
					allowed, reason, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeFalse())
					Expect(reason).To(Equal("request is not authenticated"))
				})

				It("should reject unauthorized user", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					result, err := app.generateAccessReview(req)
					Expect(err).ToNot(HaveOccurred())
					result.Status.Allowed = false
					result.Status.Reason = "just because"

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusOK, result),
						),
					)

					allowed, reason, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeFalse())
					Expect(reason).To(Equal("just because"))
				})

				It("should allow authorized user", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					result, err := app.generateAccessReview(req)
					Expect(err).ToNot(HaveOccurred())
					result.Status.Allowed = true

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusOK, result),
						),
					)

					allowed, _, err := app.Authorize(req)
					Expect(err).ToNot(HaveOccurred())
					Expect(allowed).To(BeTrue())
				})

				It("should not allow user if auth check fails", func() {

					req.Request.TLS = &tls.ConnectionState{}
					req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)

					server.AppendHandlers(
						ghttp.CombineHandlers(
							ghttp.VerifyRequest("POST", "/apis/authorization.k8s.io/v1/subjectaccessreviews"),
							ghttp.RespondWithJSONEncoded(http.StatusInternalServerError, nil),
						),
					)

					allowed, _, err := app.Authorize(req)
					Expect(err).To(HaveOccurred())
					Expect(allowed).To(BeFalse())
				})
			})

			DescribeTable("should allow all users for info endpoints", func(path string) {
				req.Request.URL.Path = path
				allowed, _, err := app.Authorize(req)
				Expect(err).ToNot(HaveOccurred())
				Expect(allowed).To(BeTrue())
			},
				Entry("root", "/"),
				Entry("apis", "/apis"),
				Entry("group", "/apis/subresources.kubevirt.io"),
				Entry("version", "/apis/subresources.kubevirt.io/version"),
				Entry("healthz", "/apis/subresources.kubevirt.io/healthz"),
				Entry("start profiler", "/apis/subresources.kubevirt.io/start-cluster-profiler"),
				Entry("stop profiler", "/apis/subresources.kubevirt.io/stop-cluster-profiler"),
				Entry("dump profiler", "/apis/subresources.kubevirt.io/dump-cluster-profiler"),
			)

			DescribeTable("should reject all users for unknown endpoint paths", func(path string) {
				req.Request.TLS = &tls.ConnectionState{}
				req.Request.TLS.PeerCertificates = append(req.Request.TLS.PeerCertificates, fakecert)
				req.Request.URL.Path = path
				allowed, _, err := app.Authorize(req)
				Expect(err).ToNot(HaveOccurred())
				Expect(allowed).To(BeFalse())

			},
				Entry("random1", "/apis/subresources.kubevirt.io/v1alpha3/madethisup"),
				Entry("random2", "/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9"),
				Entry("no subresource provided", "/apis/subresources.kubevirt.io/v1alpha3/namespaces/default/virtualmachineinstances/testvmi"),
				Entry("invalid resource type", "/apis/subresources.kubevirt.io/v1alpha3/namespaces/default/madeupresource/testvmi/console"),
				Entry("unknown namespaced resource endpoint", "/apis/subresources.kubevirt.io/v1/namespaces/default/madethisup/testvmi/console"),
				Entry("unknown namespaced base resource endpoint", "/apis/subresources.kubevirt.io/v1/namespaces/default/madethisup"),
			)
		})

		AfterEach(func() {
			server.Close()
		})

	})

	DescribeTable("should map verbs", func(httpVerb string, resourceName string, expectedRbacVerb string) {
		Expect(mapHttpVerbToRbacVerb(httpVerb, resourceName)).To(Equal(expectedRbacVerb))
	},
		Entry("http post to create", http.MethodPost, "", "create"),
		Entry("http get with resource to get", http.MethodGet, "foo", "get"),
		Entry("http get without resource to list", http.MethodGet, "", "list"),
		Entry("http put to update", http.MethodPut, "", "update"),
		Entry("http patch to patch", http.MethodPatch, "", "patch"),
		Entry("http delete with reource to delete", http.MethodDelete, "foo", "delete"),
		Entry("http delete without resource to deletecollection", http.MethodDelete, "", "deletecollection"),
	)

})


text:
<?php
/*
	This class has the responsability of getting the unit monitors registered
*/

require_once('UnitMonitor.php');

class UnitMonitorListing {

	public $mCrudInterface;

	function __construct(iCrudMonitor $iCrud) {
		$this->mCrudInterface = $iCrud;
	}

	/*
		an array if the proccess is success, null in otherwise
	*/
	public function getUnitMonitors() {
		$unitMonitorsArray = $this->mCrudInterface->getMonitors();
		return $unitMonitorsArray;
	}

	/*
		return an array with the unit monitor information if success, or null in otherwise
	*/
	public function getUnitMonitorById($idUnitMonitor) {
		$unitMonitorArray = $this->mCrudInterface->getMonitorById($idUnitMonitor);
		return $unitMonitorArray;
	}

	/*
		return an object with the unit monitor information if success, or null in otherwise
	*/
	public function getUnitMonitorObjectByKeyword($keyword) {
		$unitMonitorArray = $this->mCrudInterface->getMonitorByKeyword($keyword);
		if($unitMonitorArray != null) {
			$value = $unitMonitorArray;
			$unitMonitor = new UnitMonitor();
			$unitMonitor->_id = $value['_id'];
			$unitMonitor->keyword = $value['keyword'];
			$unitMonitor->assertType = $value['assertType'];
			$unitMonitor->expectValue = $value['expectValue'];
			$unitMonitor->description = $value['description'];
			$unitMonitor->status = $value['status'];
			$unitMonitor->domainProject = $value['domainProject'];
			$unitMonitor->isShared = $value['isShared'];
			$unitMonitor->createAt = $value['createAt'];
			$unitMonitor->pathFile = $value['pathFile'];
			$unitMonitor->implementingType = $value['implementingType'];
			$unitMonitor->typeValueExpected = $value['typeValueExpected'];

			return $unitMonitor;
		}else {
			return null;
		}
	}
}
?>


text:
package io.yawp.testing.appengine;

import com.google.appengine.api.taskqueue.dev.QueueStateInfo;
import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig;

import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class AsyncHelper {

    private static CountDownLatch latch = null;

    private AsyncHelper() {}

    public synchronized static void awaitAsync(long timeout, TimeUnit unit) {
        if (latch != null) {
            throw new IllegalStateException("more than one wait is not allowed");
        }

        latch = new CountDownLatch(1);
        try {
            latch.await(timeout, unit);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }

    public static void release() {
        int countTasks = getCountTasks();

        // only me == 1
        if (countTasks == 1) {
            latch.countDown();
            latch = null;
        }
    }

    private static int getCountTasks() {
        Map<String, QueueStateInfo> queueStateInfo = LocalTaskQueueTestConfig.getLocalTaskQueue().getQueueStateInfo();

        int count = 0;

        for (String key : queueStateInfo.keySet()) {
            count += queueStateInfo.get(key).getCountTasks();
        }

        return count;
    }
}


text:
Uses python cherrypy and flask to create a simple Hello World webserver which prints Hello World

The server is launched on port 80 and can be accessed by url /py/helloworld

To deploy on k8 cluster:
1. kubectl apply -f jarvis-kube/modules/python/hello-world/deployment/hello-world-deployment.yaml
2. kubectl apply -f jarvis-kube/modules/python/hello-world/deployment/hello-world-service.yaml
3. kubectl apply -f jarvis-kube/modules/python/hello-world/deployment/hello-world-ingress.yaml


text:
package com.exxeta.iss.sonar.esql.api.tree.statement;

import com.exxeta.iss.sonar.esql.api.tree.FieldReferenceTree;
import com.exxeta.iss.sonar.esql.api.tree.lexical.SyntaxToken;

public interface ForStatementTree extends StatementTree{

	SyntaxToken forKeyword();
	SyntaxToken correlationName();
	SyntaxToken asKeyword();
	FieldReferenceTree fieldReference();
	SyntaxToken doKeyword();
	StatementsTree statements();
	SyntaxToken forKeyword2();
	SyntaxToken endKeyword();
	SyntaxToken semi();

}


text:
class B2Tools < Formula
  include Language::Python::Virtualenv

  desc "B2 Cloud Storage Command-Line Tools"
  homepage "https://github.com/Backblaze/B2_Command_Line_Tool"
  url "https://github.com/Backblaze/B2_Command_Line_Tool/archive/v0.7.2.tar.gz"
  sha256 "7e284cbf0ddc3ae102df03ada91bd4fcfa28e1452a26fe19b136f681e9321e8c"

  bottle do
    cellar :any_skip_relocation
    sha256 "c1b069f9fc793f05571eb1d4c073a9cc47593057b9949856dd7216fa48e20e8e" => :sierra
    sha256 "b529efc7f330e93f271e24dea4e98f88173f6a80d632bd7e9283398aebb23a0a" => :el_capitan
    sha256 "00200d38eb87bd8fb91b5c2133791254493d48675b8970f4ff865770cf800225" => :yosemite
  end

  depends_on :python if MacOS.version <= :snow_leopard

  conflicts_with "boost-build", :because => "both install `b2` binaries"

  def install
    venv = virtualenv_create(libexec)
    system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
                              "--ignore-installed", buildpath
    system libexec/"bin/pip", "uninstall", "-y", "b2"
    venv.pip_install_and_link buildpath

    bash_completion.install "contrib/bash_completion/b2" => "b2-tools-completion.bash"
    pkgshare.install (buildpath/"contrib").children
  end

  test do
    cmd = "#{bin}/b2 authorize_account BOGUSACCTID BOGUSAPPKEY 2>&1"
    assert_match "bad_auth_token", shell_output(cmd, 1)
  end
end


text:
package com.facebook.buck.query;

import com.facebook.buck.query.QueryEnvironment.Argument;
import com.facebook.buck.query.QueryEnvironment.ArgumentType;
import com.facebook.buck.query.QueryEnvironment.QueryFunction;
import com.facebook.buck.util.string.StringMatcher;
import com.google.common.base.CaseFormat;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;

/**
 * A attrfilter(attribute, value, argument) filter expression, which computes the subset of nodes in
 * 'argument' whose 'attribute' contains the given value.
 *
 *
expr ::= ATTRFILTER '(' WORD ',' WORD ',' expr ')'

 */
public class AttrFilterFunction implements QueryFunction<QueryBuildTarget, QueryBuildTarget> {

  private static final ImmutableList<ArgumentType> ARGUMENT_TYPES =
      ImmutableList.of(ArgumentType.WORD, ArgumentType.WORD, ArgumentType.EXPRESSION);

  public AttrFilterFunction() {}

  @Override
  public String getName() {
    return "attrfilter";
  }

  @Override
  public int getMandatoryArguments() {
    return 3;
  }

  @Override
  public ImmutableList<ArgumentType> getArgumentTypes() {
    return ARGUMENT_TYPES;
  }

  @Override
  public Set<QueryBuildTarget> eval(
      QueryEvaluator<QueryBuildTarget> evaluator,
      QueryEnvironment<QueryBuildTarget> env,
      ImmutableList<Argument<QueryBuildTarget>> args)
      throws QueryException {
    QueryExpression<QueryBuildTarget> argument = args.get(args.size() - 1).getExpression();
    String attr = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, args.get(0).getWord());

    String attrValue = args.get(1).getWord();
    Predicate<Object> predicate =
        input -> {
          if (input instanceof Collection) {
            Collection<?> collection = (Collection<?>) input;
            for (Object item : collection) {
              if (matches(item, attrValue)) {
                return true;
              }
            }
          }

          return matches(input, attrValue);
        };

    Set<QueryBuildTarget> targets = evaluator.eval(argument, env);
    HashSet<QueryBuildTarget> result = new HashSet<>(targets.size());
    for (QueryBuildTarget target : targets) {
      Set<Object> matchingObjects = env.filterAttributeContents(target, attr, predicate);
      if (!matchingObjects.isEmpty()) {
        result.add(target);
      }
    }
    return result;
  }

  private boolean matches(Object value, String expectedValue) {
    if (value instanceof StringMatcher) {
      return ((StringMatcher) value).matches(expectedValue);
    }
    if (value instanceof Collection || value instanceof Map) {
      return false;
    }
    return expectedValue.equals(value.toString());
  }
}


text:
package com.google.schemaorg.core;

import com.google.common.collect.ImmutableList;
import com.google.schemaorg.JsonLdContext;
import com.google.schemaorg.SchemaOrgType;
import com.google.schemaorg.core.datatype.Date;
import com.google.schemaorg.core.datatype.Text;
import com.google.schemaorg.core.datatype.URL;
import com.google.schemaorg.goog.PopularityScoreSpecification;
import javax.annotation.Nullable;

/** Interface of http://schema.org/Person}. */
public interface Person extends Thing {

  /** Builder interface of http://schema.org/Person}. */
  public interface Builder extends Thing.Builder {

    @Override
    Builder addJsonLdContext(@Nullable JsonLdContext context);

    @Override
    Builder addJsonLdContext(@Nullable JsonLdContext.Builder context);

    @Override
    Builder setJsonLdId(@Nullable String value);

    @Override
    Builder setJsonLdReverse(String property, Thing obj);

    @Override
    Builder setJsonLdReverse(String property, Thing.Builder builder);

    /** Add a value to property additionalName. */
    Builder addAdditionalName(Text value);

    /** Add a value to property additionalName. */
    Builder addAdditionalName(String value);

    /** Add a value to property additionalType. */
    Builder addAdditionalType(URL value);

    /** Add a value to property additionalType. */
    Builder addAdditionalType(String value);

    /** Add a value to property address. */
    Builder addAddress(PostalAddress value);

    /** Add a value to property address. */
    Builder addAddress(PostalAddress.Builder value);

    /** Add a value to property address. */
    Builder addAddress(Text value);

    /** Add a value to property address. */
    Builder addAddress(String value);

    /** Add a value to property affiliation. */
    Builder addAffiliation(Organization value);

    /** Add a value to property affiliation. */
    Builder addAffiliation(Organization.Builder value);

    /** Add a value to property affiliation. */
    Builder addAffiliation(String value);

    /** Add a value to property alternateName. */
    Builder addAlternateName(Text value);

    /** Add a value to property alternateName. */
    Builder addAlternateName(String value);

    /** Add a value to property alumniOf. */
    Builder addAlumniOf(EducationalOrganization value);

    /** Add a value to property alumniOf. */
    Builder addAlumniOf(EducationalOrganization.Builder value);

    /** Add a value to property alumniOf. */
    Builder addAlumniOf(Organization value);

    /** Add a value to property alumniOf. */
    Builder addAlumniOf(Organization.Builder value);

    /** Add a value to property alumniOf. */
    Builder addAlumniOf(String value);

    /** Add a value to property award. */
    Builder addAward(Text value);

    /** Add a value to property award. */
    Builder addAward(String value);

    /** Add a value to property awards. */
    Builder addAwards(Text value);

    /** Add a value to property awards. */
    Builder addAwards(String value);

    /** Add a value to property birthDate. */
    Builder addBirthDate(Date value);

    /** Add a value to property birthDate. */
    Builder addBirthDate(String value);

    /** Add a value to property birthPlace. */
    Builder addBirthPlace(Place value);

    /** Add a value to property birthPlace. */
    Builder addBirthPlace(Place.Builder value);

    /** Add a value to property birthPlace. */
    Builder addBirthPlace(String value);

    /** Add a value to property brand. */
    Builder addBrand(Brand value);

    /** Add a value to property brand. */
    Builder addBrand(Brand.Builder value);

    /** Add a value to property brand. */
    Builder addBrand(Organization value);

    /** Add a value to property brand. */
    Builder addBrand(Organization.Builder value);

    /** Add a value to property brand. */
    Builder addBrand(String value);

    /** Add a value to property children. */
    Builder addChildren(Person value);

    /** Add a value to property children. */
    Builder addChildren(Person.Builder value);

    /** Add a value to property children. */
    Builder addChildren(String value);

    /** Add a value to property colleague. */
    Builder addColleague(Person value);

    /** Add a value to property colleague. */
    Builder addColleague(Person.Builder value);

    /** Add a value to property colleague. */
    Builder addColleague(String value);

    /** Add a value to property colleagues. */
    Builder addColleagues(Person value);

    /** Add a value to property colleagues. */
    Builder addColleagues(Person.Builder value);

    /** Add a value to property colleagues. */
    Builder addColleagues(String value);

    /** Add a value to property contactPoint. */
    Builder addContactPoint(ContactPoint value);

    /** Add a value to property contactPoint. */
    Builder addContactPoint(ContactPoint.Builder value);

    /** Add a value to property contactPoint. */
    Builder addContactPoint(String value);

    /** Add a value to property contactPoints. */
    Builder addContactPoints(ContactPoint value);

    /** Add a value to property contactPoints. */
    Builder addContactPoints(ContactPoint.Builder value);

    /** Add a value to property contactPoints. */
    Builder addContactPoints(String value);

    /** Add a value to property deathDate. */
    Builder addDeathDate(Date value);

    /** Add a value to property deathDate. */
    Builder addDeathDate(String value);

    /** Add a value to property deathPlace. */
    Builder addDeathPlace(Place value);

    /** Add a value to property deathPlace. */
    Builder addDeathPlace(Place.Builder value);

    /** Add a value to property deathPlace. */
    Builder addDeathPlace(String value);

    /** Add a value to property description. */
    Builder addDescription(Text value);

    /** Add a value to property description. */
    Builder addDescription(String value);

    /** Add a value to property duns. */
    Builder addDuns(Text value);

    /** Add a value to property duns. */
    Builder addDuns(String value);

    /** Add a value to property email. */
    Builder addEmail(Text value);

    /** Add a value to property email. */
    Builder addEmail(String value);

    /** Add a value to property familyName. */
    Builder addFamilyName(Text value);

    /** Add a value to property familyName. */
    Builder addFamilyName(String value);

    /** Add a value to property faxNumber. */
    Builder addFaxNumber(Text value);

    /** Add a value to property faxNumber. */
    Builder addFaxNumber(String value);

    /** Add a value to property follows. */
    Builder addFollows(Person value);

    /** Add a value to property follows. */
    Builder addFollows(Person.Builder value);

    /** Add a value to property follows. */
    Builder addFollows(String value);

    /** Add a value to property gender. */
    Builder addGender(Text value);

    /** Add a value to property gender. */
    Builder addGender(String value);

    /** Add a value to property givenName. */
    Builder addGivenName(Text value);

    /** Add a value to property givenName. */
    Builder addGivenName(String value);

    /** Add a value to property globalLocationNumber. */
    Builder addGlobalLocationNumber(Text value);

    /** Add a value to property globalLocationNumber. */
    Builder addGlobalLocationNumber(String value);

    /** Add a value to property hasOfferCatalog. */
    Builder addHasOfferCatalog(OfferCatalog value);

    /** Add a value to property hasOfferCatalog. */
    Builder addHasOfferCatalog(OfferCatalog.Builder value);

    /** Add a value to property hasOfferCatalog. */
    Builder addHasOfferCatalog(String value);

    /** Add a value to property hasPOS. */
    Builder addHasPOS(Place value);

    /** Add a value to property hasPOS. */
    Builder addHasPOS(Place.Builder value);

    /** Add a value to property hasPOS. */
    Builder addHasPOS(String value);

    /** Add a value to property height. */
    Builder addHeight(Distance value);

    /** Add a value to property height. */
    Builder addHeight(Distance.Builder value);

    /** Add a value to property height. */
    Builder addHeight(QuantitativeValue value);

    /** Add a value to property height. */
    Builder addHeight(QuantitativeValue.Builder value);

    /** Add a value to property height. */
    Builder addHeight(String value);

    /** Add a value to property homeLocation. */
    Builder addHomeLocation(ContactPoint value);

    /** Add a value to property homeLocation. */
    Builder addHomeLocation(ContactPoint.Builder value);

    /** Add a value to property homeLocation. */
    Builder addHomeLocation(Place value);

    /** Add a value to property homeLocation. */
    Builder addHomeLocation(Place.Builder value);

    /** Add a value to property homeLocation. */
    Builder addHomeLocation(String value);

    /** Add a value to property honorificPrefix. */
    Builder addHonorificPrefix(Text value);

    /** Add a value to property honorificPrefix. */
    Builder addHonorificPrefix(String value);

    /** Add a value to property honorificSuffix. */
    Builder addHonorificSuffix(Text value);

    /** Add a value to property honorificSuffix. */
    Builder addHonorificSuffix(String value);

    /** Add a value to property image. */
    Builder addImage(ImageObject value);

    /** Add a value to property image. */
    Builder addImage(ImageObject.Builder value);

    /** Add a value to property image. */
    Builder addImage(URL value);

    /** Add a value to property image. */
    Builder addImage(String value);

    /** Add a value to property isicV4. */
    Builder addIsicV4(Text value);

    /** Add a value to property isicV4. */
    Builder addIsicV4(String value);

    /** Add a value to property jobTitle. */
    Builder addJobTitle(Text value);

    /** Add a value to property jobTitle. */
    Builder addJobTitle(String value);

    /** Add a value to property knows. */
    Builder addKnows(Person value);

    /** Add a value to property knows. */
    Builder addKnows(Person.Builder value);

    /** Add a value to property knows. */
    Builder addKnows(String value);

    /** Add a value to property mainEntityOfPage. */
    Builder addMainEntityOfPage(CreativeWork value);

    /** Add a value to property mainEntityOfPage. */
    Builder addMainEntityOfPage(CreativeWork.Builder value);

    /** Add a value to property mainEntityOfPage. */
    Builder addMainEntityOfPage(URL value);

    /** Add a value to property mainEntityOfPage. */
    Builder addMainEntityOfPage(String value);

    /** Add a value to property makesOffer. */
    Builder addMakesOffer(Offer value);

    /** Add a value to property makesOffer. */
    Builder addMakesOffer(Offer.Builder value);

    /** Add a value to property makesOffer. */
    Builder addMakesOffer(String value);

    /** Add a value to property memberOf. */
    Builder addMemberOf(Organization value);

    /** Add a value to property memberOf. */
    Builder addMemberOf(Organization.Builder value);

    /** Add a value to property memberOf. */
    Builder addMemberOf(ProgramMembership value);

    /** Add a value to property memberOf. */
    Builder addMemberOf(ProgramMembership.Builder value);

    /** Add a value to property memberOf. */
    Builder addMemberOf(String value);

    /** Add a value to property naics. */
    Builder addNaics(Text value);

    /** Add a value to property naics. */
    Builder addNaics(String value);

    /** Add a value to property name. */
    Builder addName(Text value);

    /** Add a value to property name. */
    Builder addName(String value);

    /** Add a value to property nationality. */
    Builder addNationality(Country value);

    /** Add a value to property nationality. */
    Builder addNationality(Country.Builder value);

    /** Add a value to property nationality. */
    Builder addNationality(String value);

    /** Add a value to property netWorth. */
    Builder addNetWorth(PriceSpecification value);

    /** Add a value to property netWorth. */
    Builder addNetWorth(PriceSpecification.Builder value);

    /** Add a value to property netWorth. */
    Builder addNetWorth(String value);

    /** Add a value to property owns. */
    Builder addOwns(OwnershipInfo value);

    /** Add a value to property owns. */
    Builder addOwns(OwnershipInfo.Builder value);

    /** Add a value to property owns. */
    Builder addOwns(Product value);

    /** Add a value to property owns. */
    Builder addOwns(Product.Builder value);

    /** Add a value to property owns. */
    Builder addOwns(String value);

    /** Add a value to property parent. */
    Builder addParent(Person value);

    /** Add a value to property parent. */
    Builder addParent(Person.Builder value);

    /** Add a value to property parent. */
    Builder addParent(String value);

    /** Add a value to property parents. */
    Builder addParents(Person value);

    /** Add a value to property parents. */
    Builder addParents(Person.Builder value);

    /** Add a value to property parents. */
    Builder addParents(String value);

    /** Add a value to property performerIn. */
    Builder addPerformerIn(Event value);

    /** Add a value to property performerIn. */
    Builder addPerformerIn(Event.Builder value);

    /** Add a value to property performerIn. */
    Builder addPerformerIn(String value);

    /** Add a value to property potentialAction. */
    Builder addPotentialAction(Action value);

    /** Add a value to property potentialAction. */
    Builder addPotentialAction(Action.Builder value);

    /** Add a value to property potentialAction. */
    Builder addPotentialAction(String value);

    /** Add a value to property relatedTo. */
    Builder addRelatedTo(Person value);

    /** Add a value to property relatedTo. */
    Builder addRelatedTo(Person.Builder value);

    /** Add a value to property relatedTo. */
    Builder addRelatedTo(String value);

    /** Add a value to property sameAs. */
    Builder addSameAs(URL value);

    /** Add a value to property sameAs. */
    Builder addSameAs(String value);

    /** Add a value to property seeks. */
    Builder addSeeks(Demand value);

    /** Add a value to property seeks. */
    Builder addSeeks(Demand.Builder value);

    /** Add a value to property seeks. */
    Builder addSeeks(String value);

    /** Add a value to property sibling. */
    Builder addSibling(Person value);

    /** Add a value to property sibling. */
    Builder addSibling(Person.Builder value);

    /** Add a value to property sibling. */
    Builder addSibling(String value);

    /** Add a value to property siblings. */
    Builder addSiblings(Person value);

    /** Add a value to property siblings. */
    Builder addSiblings(Person.Builder value);

    /** Add a value to property siblings. */
    Builder addSiblings(String value);

    /** Add a value to property spouse. */
    Builder addSpouse(Person value);

    /** Add a value to property spouse. */
    Builder addSpouse(Person.Builder value);

    /** Add a value to property spouse. */
    Builder addSpouse(String value);

    /** Add a value to property taxID. */
    Builder addTaxID(Text value);

    /** Add a value to property taxID. */
    Builder addTaxID(String value);

    /** Add a value to property telephone. */
    Builder addTelephone(Text value);

    /** Add a value to property telephone. */
    Builder addTelephone(String value);

    /** Add a value to property url. */
    Builder addUrl(URL value);

    /** Add a value to property url. */
    Builder addUrl(String value);

    /** Add a value to property vatID. */
    Builder addVatID(Text value);

    /** Add a value to property vatID. */
    Builder addVatID(String value);

    /** Add a value to property weight. */
    Builder addWeight(QuantitativeValue value);

    /** Add a value to property weight. */
    Builder addWeight(QuantitativeValue.Builder value);

    /** Add a value to property weight. */
    Builder addWeight(String value);

    /** Add a value to property workLocation. */
    Builder addWorkLocation(ContactPoint value);

    /** Add a value to property workLocation. */
    Builder addWorkLocation(ContactPoint.Builder value);

    /** Add a value to property workLocation. */
    Builder addWorkLocation(Place value);

    /** Add a value to property workLocation. */
    Builder addWorkLocation(Place.Builder value);

    /** Add a value to property workLocation. */
    Builder addWorkLocation(String value);

    /** Add a value to property worksFor. */
    Builder addWorksFor(Organization value);

    /** Add a value to property worksFor. */
    Builder addWorksFor(Organization.Builder value);

    /** Add a value to property worksFor. */
    Builder addWorksFor(String value);

    /** Add a value to property detailedDescription. */
    Builder addDetailedDescription(Article value);

    /** Add a value to property detailedDescription. */
    Builder addDetailedDescription(Article.Builder value);

    /** Add a value to property detailedDescription. */
    Builder addDetailedDescription(String value);

    /** Add a value to property popularityScore. */
    Builder addPopularityScore(PopularityScoreSpecification value);

    /** Add a value to property popularityScore. */
    Builder addPopularityScore(PopularityScoreSpecification.Builder value);

    /** Add a value to property popularityScore. */
    Builder addPopularityScore(String value);

    /**
     * Add a value to property.
     *
     * @param name The property name.
     * @param value The value of the property.
     */
    Builder addProperty(String name, SchemaOrgType value);

    /**
     * Add a value to property.
     *
     * @param name The property name.
     * @param builder The schema.org object builder for the property value.
     */
    Builder addProperty(String name, Thing.Builder builder);

    /**
     * Add a value to property.
     *
     * @param name The property name.
     * @param value The string value of the property.
     */
    Builder addProperty(String name, String value);

    /** Build a {@link Person} object. */
    Person build();
  }

  /**
   * Returns the value list of property additionalName. Empty list is returned if the property not
   * set in current object.
   */
  ImmutableList<SchemaOrgType> getAdditionalNameList();

  /**
   * Returns the value list of property address. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getAddressList();

  /**
   * Returns the value list of property affiliation. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getAffiliationList();

  /**
   * Returns the value list of property alumniOf. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getAlumniOfList();

  /**
   * Returns the value list of property award. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getAwardList();

  /**
   * Returns the value list of property awards. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getAwardsList();

  /**
   * Returns the value list of property birthDate. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getBirthDateList();

  /**
   * Returns the value list of property birthPlace. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getBirthPlaceList();

  /**
   * Returns the value list of property brand. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getBrandList();

  /**
   * Returns the value list of property children. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getChildrenList();

  /**
   * Returns the value list of property colleague. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getColleagueList();

  /**
   * Returns the value list of property colleagues. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getColleaguesList();

  /**
   * Returns the value list of property contactPoint. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getContactPointList();

  /**
   * Returns the value list of property contactPoints. Empty list is returned if the property not
   * set in current object.
   */
  ImmutableList<SchemaOrgType> getContactPointsList();

  /**
   * Returns the value list of property deathDate. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getDeathDateList();

  /**
   * Returns the value list of property deathPlace. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getDeathPlaceList();

  /**
   * Returns the value list of property duns. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getDunsList();

  /**
   * Returns the value list of property email. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getEmailList();

  /**
   * Returns the value list of property familyName. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getFamilyNameList();

  /**
   * Returns the value list of property faxNumber. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getFaxNumberList();

  /**
   * Returns the value list of property follows. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getFollowsList();

  /**
   * Returns the value list of property gender. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getGenderList();

  /**
   * Returns the value list of property givenName. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getGivenNameList();

  /**
   * Returns the value list of property globalLocationNumber. Empty list is returned if the property
   * not set in current object.
   */
  ImmutableList<SchemaOrgType> getGlobalLocationNumberList();

  /**
   * Returns the value list of property hasOfferCatalog. Empty list is returned if the property not
   * set in current object.
   */
  ImmutableList<SchemaOrgType> getHasOfferCatalogList();

  /**
   * Returns the value list of property hasPOS. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getHasPOSList();

  /**
   * Returns the value list of property height. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getHeightList();

  /**
   * Returns the value list of property homeLocation. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getHomeLocationList();

  /**
   * Returns the value list of property honorificPrefix. Empty list is returned if the property not
   * set in current object.
   */
  ImmutableList<SchemaOrgType> getHonorificPrefixList();

  /**
   * Returns the value list of property honorificSuffix. Empty list is returned if the property not
   * set in current object.
   */
  ImmutableList<SchemaOrgType> getHonorificSuffixList();

  /**
   * Returns the value list of property isicV4. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getIsicV4List();

  /**
   * Returns the value list of property jobTitle. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getJobTitleList();

  /**
   * Returns the value list of property knows. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getKnowsList();

  /**
   * Returns the value list of property makesOffer. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getMakesOfferList();

  /**
   * Returns the value list of property memberOf. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getMemberOfList();

  /**
   * Returns the value list of property naics. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getNaicsList();

  /**
   * Returns the value list of property nationality. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getNationalityList();

  /**
   * Returns the value list of property netWorth. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getNetWorthList();

  /**
   * Returns the value list of property owns. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getOwnsList();

  /**
   * Returns the value list of property parent. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getParentList();

  /**
   * Returns the value list of property parents. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getParentsList();

  /**
   * Returns the value list of property performerIn. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getPerformerInList();

  /**
   * Returns the value list of property relatedTo. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getRelatedToList();

  /**
   * Returns the value list of property seeks. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getSeeksList();

  /**
   * Returns the value list of property sibling. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getSiblingList();

  /**
   * Returns the value list of property siblings. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getSiblingsList();

  /**
   * Returns the value list of property spouse. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getSpouseList();

  /**
   * Returns the value list of property taxID. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getTaxIDList();

  /**
   * Returns the value list of property telephone. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getTelephoneList();

  /**
   * Returns the value list of property vatID. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getVatIDList();

  /**
   * Returns the value list of property weight. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getWeightList();

  /**
   * Returns the value list of property workLocation. Empty list is returned if the property not set
   * in current object.
   */
  ImmutableList<SchemaOrgType> getWorkLocationList();

  /**
   * Returns the value list of property worksFor. Empty list is returned if the property not set in
   * current object.
   */
  ImmutableList<SchemaOrgType> getWorksForList();
}


text:
module RiotLolApi
  module Model
    class Match
      include RiotLolApi::Concern::Init

      def which_team_win
        teams.first.win? ? teams.first.team_id : teams.last.team_id
      end
    end
  end
end


text:
layout: default
---

![FEREST TERLET](http://i.imgur.com/BK2ZebTl.jpg)


text:
/* Temperament.cpp from Stand http://github.com/qtau-devgroup/stand by HAL@ShurabaP, BSD license */
#include <cmath>

#include "Temperament.h"

EqualTemperament::EqualTemperament(double concertPitch, int keyNumber)
{
    _frequencies.resize(HighestKey);
    for(int k = 0; k < HighestKey; k++)
    {
        _frequencies[k] = generate(k, concertPitch, keyNumber);
    }
}

double EqualTemperament::generate(int keyNumber, double concertPitch, int concertKeyNumber)
{
    return concertPitch * pow(2.0, (keyNumber - concertKeyNumber) / 12.0);
}

double EqualTemperament::frequency(int keyNumber) const
{
    return _frequencies[keyNumber];
}


text:
using EntityComponent.Engine;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;

namespace EntityComponent.Components {
  public class Renderable : Component {

    public Texture2D Texture;
    public Vector2 Size;
    public Nullable<Rectangle> Mask;
    public float Rotation;

    public Renderable(Texture2D texture, Vector2 size, Nullable<Rectangle> mask, float rotation)
      : base() {
        Texture = texture;
        Size = size;
        Mask = mask;
        Rotation = rotation;
    }
  }
}


text:
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

    <title>PHPXRef 0.7.1 : Unnamed Project : Class Reference: admin_controller</title>
    <link rel="stylesheet" href="../sample.css" type="text/css">
    <link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">

    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

            [ Index ]

PHP Cross Reference of Unnamed Project

[ Show Explorer ]
[ Hide Navbar ]

[Top level directory]

title

Body

[close]

Class Cross Reference

admin_controller

Defined at:

/application/core/Admin_Controller.php  ->  line 3

Referenced 21 times:

/bonfire/modules/activities/controllers/reports.php  ->  line 30

/bonfire/modules/settings/controllers/settings.php  ->  line 30

/bonfire/modules/roles/controllers/settings.php  ->  line 30

/bonfire/docs/contexts.md  ->  line 20

/bonfire/modules/translate/controllers/developer.php  ->  line 32

/bonfire/modules/sysinfo/controllers/developer.php  ->  line 30

/bonfire/modules/users/controllers/settings.php  ->  line 30

/bonfire/modules/emailer/controllers/settings.php  ->  line 31

/application/controllers/admin/content.php  ->  line 30

/application/controllers/admin/reports.php  ->  line 30

/application/controllers/admin/home.php  ->  line 30

/bonfire/modules/activities/controllers/activities.php  ->  line 30

/bonfire/modules/database/controllers/developer.php  ->  line 30

/bonfire/docs/tut_blog.md  ->  line 135

/bonfire/modules/permissions/controllers/settings.php  ->  line 30

/bonfire/modules/logs/controllers/developer.php  ->  line 30

/bonfire/modules/ui/controllers/settings.php  ->  line 30

/bonfire/modules/migrations/controllers/developer.php  ->  line 30

/bonfire/modules/builder/controllers/developer.php  ->  line 33

/bonfire/docs/layouts_and_views.md  ->  line 68

/bonfire/docs/layouts_and_views.md  ->  line 83

Generated: Thu Oct 23 19:15:14 2014
	Cross-referenced by PHPXref 0.7.1


text:
// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/renderer/media/android/stream_texture_factory.h"
#include "content/renderer/stream_texture_host_android.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/ipc/client/gpu_channel_host.h"
#include "gpu/ipc/common/gpu_messages.h"
#include "gpu/ipc/common/surface_handle.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {

// GpuChannelHost is expected to be created on the IO thread, and posts tasks to
// setup its IPC listener, so it must be created after the thread task runner
// handle is set.
class TestGpuChannelHost : public gpu::GpuChannelHost {
 public:
  TestGpuChannelHost()
      : gpu::GpuChannelHost(
            0 /* channel_id */,
            gpu::GPUInfo(),
            gpu::GpuFeatureInfo(),
            mojo::ScopedMessagePipeHandle(
                mojo::MessagePipeHandle(mojo::kInvalidHandleValue))) {}

 protected:
  ~TestGpuChannelHost() override {}
};

class StreamTextureProxyTest : public testing::Test {
 public:
  StreamTextureProxyTest()
      : task_runner_(base::MakeRefCounted<base::TestSimpleTaskRunner>()),
        thread_task_runner_handle_override_(
            base::ThreadTaskRunnerHandle::OverrideForTesting(task_runner_)),
        channel_(base::MakeRefCounted<TestGpuChannelHost>()) {}

  ~StreamTextureProxyTest() override { channel_ = nullptr; }

  std::unique_ptr<StreamTextureProxy> CreateProxyWithNullGpuChannelHost() {
    // Create the StreamTextureHost with a valid |channel_|. Note that route_id
    // does not matter here for the test we are writing.
    auto host = std::make_unique<StreamTextureHost>(channel_, 1 /* route_id */);

    // Force the StreamTextureHost's |channel_| to be null by calling
    // OnChannelError.
    host->OnChannelError();
    auto proxy = base::WrapUnique(new StreamTextureProxy(std::move(host)));
    return proxy;
  }

 protected:
  scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
  base::ScopedClosureRunner thread_task_runner_handle_override_;
  scoped_refptr<TestGpuChannelHost> channel_;
};

// This test is to make sure UpdateRotatedVisibleSize() do not crash even if
// StreamTextureHost's |channel_| is null.
TEST_F(StreamTextureProxyTest,
       UpdateRotatedVisibleSizeDoesNotCrashWithNullGpuChannelHost) {
  auto proxy = CreateProxyWithNullGpuChannelHost();
  gpu::Mailbox mailbox;
  gpu::SyncToken texture_mailbox_sync_token;

  // This method should not crash even if the StreamTextureHost's |channel_| is
  // null.
  proxy->UpdateRotatedVisibleSize(gfx::Size(1, 1));
}

}  // namespace content


text:
package edu.berkeley.ground.plugins.hive;

import edu.berkeley.ground.api.models.Edge;
import edu.berkeley.ground.api.models.Node;
import edu.berkeley.ground.api.models.NodeVersion;
import edu.berkeley.ground.api.models.Structure;
import edu.berkeley.ground.api.models.StructureVersion;
import edu.berkeley.ground.api.models.Tag;
import edu.berkeley.ground.api.versions.GroundType;
import edu.berkeley.ground.exceptions.GroundException;

import com.google.gson.Gson;

import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.InvalidInputException;
import org.apache.hadoop.hive.metastore.api.InvalidObjectException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.Table;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class GroundDatabase {
    static final private Logger LOG = LoggerFactory.getLogger(GroundDatabase.class.getName());

    static final String DATABASE_NODE = "_DATABASE";

    static final String DATABASE_TABLE_EDGE = "_DATABASE_TABLE";

    private static final List<String> EMPTY_PARENT_LIST = new ArrayList<String>();

    private GroundReadWrite ground = null;
    private GroundTable table = null;

    GroundDatabase(GroundReadWrite ground) {
        this.ground = ground;
        this.table = new GroundTable(ground);
    }

    Node getNode(String dbName) throws GroundException {
        try {
            LOG.debug("Fetching database node: " + dbName);
            return ground.getNodeFactory().retrieveFromDatabase(dbName);
        } catch (GroundException ge1) {
            LOG.debug("Not found - Creating databsae node: {}", dbName);

            Node node = ground.getNodeFactory().create(dbName);
            Structure nodeStruct = ground.getStructureFactory().create(node.getName());
            LOG.debug("node structure created {}", nodeStruct);
            return node;
        }
    }

    public Structure getNodeStructure(String dbName) throws GroundException {
        try {
            Node node = this.getNode(dbName);
            return ground.getStructureFactory().retrieveFromDatabase(dbName);
        } catch (GroundException e) {
            LOG.error("Unable to fetch database node structure");
            throw e;
        }
    }

    public Edge getEdge(NodeVersion nodeVersion) throws GroundException {
        String edgeId = nodeVersion.getNodeId();
        try {
            LOG.debug("Fetching database table edge: " + edgeId);
            return ground.getEdgeFactory().retrieveFromDatabase(edgeId);
        } catch (GroundException e) {
            LOG.debug("Not found - Creating database table edge: " + edgeId);
            Edge edge = ground.getEdgeFactory().create(edgeId);
            Structure edgeStruct = ground.getStructureFactory().create(edge.getName());
            return edge;
        }
    }

    Structure getEdgeStructure(NodeVersion nodeVersion) throws GroundException {
        try {
            LOG.debug("Fetching database table edge structure: " + nodeVersion.getNodeId());
            Edge edge = this.getEdge(nodeVersion);
            return ground.getStructureFactory().retrieveFromDatabase(edge.getName());
        } catch (GroundException e) {
            LOG.debug("Not found - database table edge structure: " + nodeVersion.getNodeId());
            throw e;
        }
    }

    Database fromJSON(String json) {
        Gson gson = new Gson();
        return (Database) gson.fromJson(json, Database.class);
    }

    String toJSON(Database db) {
        Gson gson = new Gson();
        return gson.toJson(db);
    }

    Database getDatabase(String dbName) throws NoSuchObjectException {
        try {
            List<String> versions = ground.getNodeFactory().getLeaves(dbName);
            if (versions.isEmpty()) {
                throw new GroundException("Database node not found: " + dbName);
            }

            NodeVersion latestVersion = ground.getNodeVersionFactory().retrieveFromDatabase(versions.get(0));
            Map<String, Tag> dbTag = latestVersion.getTags();

            return this.fromJSON((String) dbTag.get(dbName).getValue());
        } catch (GroundException e) {
            throw new NoSuchObjectException(e.getMessage());
        }
    }

    NodeVersion createDatabase(Database db) throws InvalidObjectException, MetaException {
        if (db == null) {
            throw new InvalidObjectException("Database object passed is null");
        }
        try {
            String dbName = db.getName();
            Node dbNode = this.getNode(dbName);
            Structure dbStruct = this.getNodeStructure(dbName);

            Tag dbTag = new Tag("1.0.0", dbName, toJSON(db), GroundType.STRING);

            Map<String, GroundType> structVersionAttribs = new HashMap<>();
            structVersionAttribs.put(dbName, GroundType.STRING);

            StructureVersion sv = ground.getStructureVersionFactory().create(dbStruct.getId(), structVersionAttribs,
                    EMPTY_PARENT_LIST);

            String reference = db.getLocationUri();
            HashMap<String, Tag> tags = new HashMap<>();
            tags.put(dbName, dbTag);

            Map<String, String> dbParamMap = db.getParameters();
            if (dbParamMap == null) {
                dbParamMap = new HashMap<String, String>();
            }
            Map<String, String> parameters = dbParamMap;

            List<String> parent = new ArrayList<String>();
            List<String> versions = ground.getNodeFactory().getLeaves(dbName);
            if (!versions.isEmpty()) {
                parent.add(versions.get(0));
            }

            NodeVersion dbNodeVersion = ground.getNodeVersionFactory().create(tags, sv.getId(), reference, parameters,
                    dbNode.getId(), parent);

            return dbNodeVersion;
        } catch (GroundException e) {
            LOG.error("Failure to create a database node: " + db.getName());
            throw new MetaException(e.getMessage());
        }
    }

    // Table related functions
    NodeVersion createTable(Table table) throws InvalidObjectException, MetaException {
        try {
            String dbName = table.getDbName();
            NodeVersion tableNodeVersion = this.table.createTable(table);
            Database prevDb = this.getDatabase(dbName);

            List<String> versions = ground.getNodeFactory().getLeaves(dbName);

            NodeVersion dbNodeVersion = this.createDatabase(prevDb);
            String dbNodeVersionId = dbNodeVersion.getId();

            Edge edge = this.getEdge(tableNodeVersion);
            Structure structure = this.getEdgeStructure(tableNodeVersion);
            Map<String, GroundType> structVersionAttribs = new HashMap<>();
            for (String key : tableNodeVersion.getTags().keySet()) {
                structVersionAttribs.put(key, GroundType.STRING);
            }
            StructureVersion sv = ground.getStructureVersionFactory().create(structure.getId(), structVersionAttribs,
                    new ArrayList<>());

            ground.getEdgeVersionFactory().create(tableNodeVersion.getTags(), sv.getId(),
                    tableNodeVersion.getReference(), tableNodeVersion.getParameters(), edge.getId(), dbNodeVersionId,
                    tableNodeVersion.getId(), EMPTY_PARENT_LIST);

            if (!versions.isEmpty() && versions.size() != 0) {
                String prevVersionId = versions.get(0);
                List<String> nodeIds = ground.getNodeVersionFactory().getAdjacentNodes(prevVersionId, "");
                for (String nodeId : nodeIds) {
                    NodeVersion oldNV = ground.getNodeVersionFactory().retrieveFromDatabase(nodeId);
                    edge = this.getEdge(oldNV);

                    structVersionAttribs = new HashMap<>();
                    for (String key : oldNV.getTags().keySet()) {
                        structVersionAttribs.put(key, GroundType.STRING);
                    }

                    // create an edge version for a dbname
                    sv = ground.getStructureVersionFactory().create(structure.getId(), structVersionAttribs,
                            new ArrayList<>());
                    ground.getEdgeVersionFactory().create(oldNV.getTags(), sv.getId(), oldNV.getReference(),
                            oldNV.getParameters(), edge.getId(), dbNodeVersionId, oldNV.getId(),
                            new ArrayList<String>());
                }
            }

            return dbNodeVersion;
        } catch (GroundException ex) {
            throw new MetaException(ex.getMessage());
        } catch (NoSuchObjectException ex) {
            throw new MetaException(ex.getMessage());
        }
    }

    NodeVersion dropTable(String dbName, String tableName)
            throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException {
        try {
            boolean found = false;
            List<String> versions = ground.getNodeFactory().getLeaves(dbName);

            if (versions.isEmpty()) {
                LOG.error("Could not find table to drop named {}", tableName);
                return null;
            } else {
                String prevVersionId = versions.get(0);
                List<String> nodeIds = ground.getNodeVersionFactory().getAdjacentNodes(prevVersionId, "");

                if (nodeIds.size() == 0) {
                    LOG.error("Failed to drop table {}", dbName);
                    return null;
                }
                Database db = this.getDatabase(dbName);
                NodeVersion dbNodeVersion = this.createDatabase(db);
                String dbVersionId = dbNodeVersion.getId();
                String tableNodeId = "Nodes." + tableName;

                for (String nodeId : nodeIds) {
                    NodeVersion oldNV = ground.getNodeVersionFactory().retrieveFromDatabase(nodeId);

                    if (!oldNV.getNodeId().equals(tableNodeId)) {
                        Edge edge = this.getEdge(oldNV);
                        Structure structure = this.getEdgeStructure(oldNV);

                        LOG.error("Found edge with name {}", oldNV.getNodeId());

                        Map<String, GroundType> structVersionAttribs = new HashMap<>();
                        for (String key : oldNV.getTags().keySet()) {
                            structVersionAttribs.put(key, GroundType.STRING);
                        }
                        // create an edge for each table other than the one
                        // being deleted
                        StructureVersion sv = ground.getStructureVersionFactory().create(structure.getId(),
                                structVersionAttribs, new ArrayList<>());
                        ground.getEdgeVersionFactory().create(oldNV.getTags(), sv.getId(), oldNV.getReference(),
                                oldNV.getParameters(), edge.getId(), dbVersionId, oldNV.getId(),
                                new ArrayList<String>());
                    }
                }
                return dbNodeVersion;
            }
        } catch (GroundException ex) {
            LOG.error("Failed to drop table {}", tableName);
            throw new MetaException("Failed to drop table: " + ex.getMessage());
        }
    }

    Table getTable(String dbName, String tableName) throws MetaException {
        return this.table.getTable(dbName, tableName);
    }

    List<String> getTables(String dbName, String pattern) throws MetaException {
        return this.table.getTables(dbName, pattern);
    }

    NodeVersion addPartitions(String dbName, String tableName, List<Partition> parts)
            throws InvalidObjectException, MetaException {
        try {
            NodeVersion tableNodeVersion = this.table.addPartitions(dbName, tableName, parts);
            Database prevDb = this.getDatabase(dbName);

            List<String> versions = ground.getNodeFactory().getLeaves(dbName);

            NodeVersion dbNodeVersion = this.createDatabase(prevDb);
            String dbNodeVersionId = dbNodeVersion.getId();

            Edge edge = this.getEdge(tableNodeVersion);
            Structure structure = this.getEdgeStructure(tableNodeVersion);
            Map<String, GroundType> structVersionAttribs = new HashMap<>();
            for (String key : tableNodeVersion.getTags().keySet()) {
                structVersionAttribs.put(key, GroundType.STRING);
            }
            StructureVersion sv = ground.getStructureVersionFactory().create(structure.getId(), structVersionAttribs,
                    new ArrayList<>());

            ground.getEdgeVersionFactory().create(tableNodeVersion.getTags(), sv.getId(),
                    tableNodeVersion.getReference(), tableNodeVersion.getParameters(), edge.getId(), dbNodeVersionId,
                    tableNodeVersion.getId(), EMPTY_PARENT_LIST);

            if (!versions.isEmpty() && versions.size() > 0) {
                String prevVersionId = versions.get(0);
                List<String> nodeIds = ground.getNodeVersionFactory().getAdjacentNodes(prevVersionId, "");
                for (String nodeId : nodeIds) {
                    NodeVersion oldNV = ground.getNodeVersionFactory().retrieveFromDatabase(nodeId);
                    edge = this.getEdge(oldNV);

                    structVersionAttribs = new HashMap<>();
                    for (String key : oldNV.getTags().keySet()) {
                        structVersionAttribs.put(key, GroundType.STRING);
                    }

                    // create an edge version for a dbname
                    sv = ground.getStructureVersionFactory().create(structure.getId(), structVersionAttribs,
                            new ArrayList<>());
                    ground.getEdgeVersionFactory().create(oldNV.getTags(), sv.getId(), oldNV.getReference(),
                            oldNV.getParameters(), edge.getId(), dbNodeVersionId, oldNV.getId(),
                            new ArrayList<String>());
                }
            }

            return dbNodeVersion;
        } catch (GroundException ex) {
            LOG.error("Unable to add partition to table {} database {}", tableName, dbName);
            throw new MetaException(ex.getMessage());
        } catch (NoSuchObjectException ex) {
            LOG.error("Database {} not found", dbName);
            throw new MetaException(ex.getMessage());
        } catch (InvalidObjectException | MetaException ex) {
            LOG.error("Unable to add partition to table {} database {}", tableName, dbName);
            throw ex;
        }
    }

    Partition getPartition(String dbName, String tableName, String partName)
            throws NoSuchObjectException, MetaException {
        try {
            return this.table.getPartition(dbName, tableName, partName);
        } catch (MetaException | NoSuchObjectException ex) {
            LOG.error("Unable to ger partition {} fro table {} database {}", partName, tableName, dbName);
            throw ex;
        }
    }

    List<Partition> getPartitions(String dbName, String tableName, int max)
            throws MetaException, NoSuchObjectException {
        try {
            return this.table.getPartitions(dbName, tableName, max);
        } catch (MetaException | NoSuchObjectException ex) {
            throw ex;
        }
    }
}