text:
package kubernetes

import (
	"context"
	"errors"
	"fmt"
	"net"
	"strings"

	"github.com/coredns/coredns/plugin"
	"github.com/coredns/coredns/plugin/etcd/msg"
	"github.com/coredns/coredns/plugin/kubernetes/object"
	"github.com/coredns/coredns/plugin/pkg/dnsutil"
	"github.com/coredns/coredns/plugin/pkg/fall"
	"github.com/coredns/coredns/plugin/pkg/upstream"
	"github.com/coredns/coredns/request"

	"github.com/miekg/dns"
	api "k8s.io/api/core/v1"
	meta "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)

// Kubernetes implements a plugin that connects to a Kubernetes cluster.
type Kubernetes struct {
	Next             plugin.Handler
	Zones            []string
	Upstream         *upstream.Upstream
	APIServerList    []string
	APICertAuth      string
	APIClientCert    string
	APIClientKey     string
	ClientConfig     clientcmd.ClientConfig
	APIConn          dnsController
	Namespaces       map[string]struct{}
	podMode          string
	endpointNameMode bool
	Fall             fall.F
	ttl              uint32
	opts             dnsControlOpts
	primaryZoneIndex int
	localIPs         []net.IP
	autoPathSearch   []string // Local search path from /etc/resolv.conf. Needed for autopath.
}

// New returns a initialized Kubernetes. It default interfaceAddrFunc to return 127.0.0.1. All other
// values default to their zero value, primaryZoneIndex will thus point to the first zone.
func New(zones []string) *Kubernetes {
	k := new(Kubernetes)
	k.Zones = zones
	k.Namespaces = make(map[string]struct{})
	k.podMode = podModeDisabled
	k.ttl = defaultTTL

	return k
}

const (
	// podModeDisabled is the default value where pod requests are ignored
	podModeDisabled = "disabled"
	// podModeVerified is where Pod requests are answered only if they exist
	podModeVerified = "verified"
	// podModeInsecure is where pod requests are answered without verifying they exist
	podModeInsecure = "insecure"
	// DNSSchemaVersion is the schema version: https://github.com/kubernetes/dns/blob/master/docs/specification.md
	DNSSchemaVersion = "1.1.0"
	// Svc is the DNS schema for kubernetes services
	Svc = "svc"
	// Pod is the DNS schema for kubernetes pods
	Pod = "pod"
	// defaultTTL to apply to all answers.
	defaultTTL = 5
)

var (
	errNoItems        = errors.New("no items found")
	errNsNotExposed   = errors.New("namespace is not exposed")
	errInvalidRequest = errors.New("invalid query name")
)

// Services implements the ServiceBackend interface.
func (k *Kubernetes) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (svcs []msg.Service, err error) {
	// We're looking again at types, which we've already done in ServeDNS, but there are some types k8s just can't answer.
	switch state.QType() {

	case dns.TypeTXT:
		// 1 label + zone, label must be "dns-version".
		t, _ := dnsutil.TrimZone(state.Name(), state.Zone)

		segs := dns.SplitDomainName(t)
		if len(segs) != 1 {
			return nil, nil
		}
		if segs[0] != "dns-version" {
			return nil, nil
		}
		svc := msg.Service{Text: DNSSchemaVersion, TTL: 28800, Key: msg.Path(state.QName(), coredns)}
		return []msg.Service{svc}, nil

	case dns.TypeNS:
		// We can only get here if the qname equals the zone, see ServeDNS in handler.go.
		nss := k.nsAddrs(false, state.Zone)
		var svcs []msg.Service
		for _, ns := range nss {
			if ns.Header().Rrtype == dns.TypeA {
				svcs = append(svcs, msg.Service{Host: ns.(*dns.A).A.String(), Key: msg.Path(ns.Header().Name, coredns), TTL: k.ttl})
				continue
			}
			if ns.Header().Rrtype == dns.TypeAAAA {
				svcs = append(svcs, msg.Service{Host: ns.(*dns.AAAA).AAAA.String(), Key: msg.Path(ns.Header().Name, coredns), TTL: k.ttl})
			}
		}
		return svcs, nil
	}

	if isDefaultNS(state.Name(), state.Zone) {
		nss := k.nsAddrs(false, state.Zone)
		var svcs []msg.Service
		for _, ns := range nss {
			if ns.Header().Rrtype == dns.TypeA && state.QType() == dns.TypeA {
				svcs = append(svcs, msg.Service{Host: ns.(*dns.A).A.String(), Key: msg.Path(state.QName(), coredns), TTL: k.ttl})
				continue
			}
			if ns.Header().Rrtype == dns.TypeAAAA && state.QType() == dns.TypeAAAA {
				svcs = append(svcs, msg.Service{Host: ns.(*dns.AAAA).AAAA.String(), Key: msg.Path(state.QName(), coredns), TTL: k.ttl})
			}
		}
		return svcs, nil
	}

	s, e := k.Records(ctx, state, false)

	// SRV for external services is not yet implemented, so remove those records.

	if state.QType() != dns.TypeSRV {
		return s, e
	}

	internal := []msg.Service{}
	for _, svc := range s {
		if t, _ := svc.HostType(); t != dns.TypeCNAME {
			internal = append(internal, svc)
		}
	}

	return internal, e
}

// primaryZone will return the first non-reverse zone being handled by this plugin
func (k *Kubernetes) primaryZone() string { return k.Zones[k.primaryZoneIndex] }

// Lookup implements the ServiceBackend interface.
func (k *Kubernetes) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error) {
	return k.Upstream.Lookup(ctx, state, name, typ)
}

// IsNameError implements the ServiceBackend interface.
func (k *Kubernetes) IsNameError(err error) bool {
	return err == errNoItems || err == errNsNotExposed || err == errInvalidRequest
}

func (k *Kubernetes) getClientConfig() (*rest.Config, error) {
	if k.ClientConfig != nil {
		return k.ClientConfig.ClientConfig()
	}
	loadingRules := &clientcmd.ClientConfigLoadingRules{}
	overrides := &clientcmd.ConfigOverrides{}
	clusterinfo := clientcmdapi.Cluster{}
	authinfo := clientcmdapi.AuthInfo{}

	// Connect to API from in cluster
	if len(k.APIServerList) == 0 {
		cc, err := rest.InClusterConfig()
		if err != nil {
			return nil, err
		}
		cc.ContentType = "application/vnd.kubernetes.protobuf"
		return cc, err
	}

	// Connect to API from out of cluster
	// Only the first one is used. We will deprecate multiple endpoints later.
	clusterinfo.Server = k.APIServerList[0]

	if len(k.APICertAuth) > 0 {
		clusterinfo.CertificateAuthority = k.APICertAuth
	}
	if len(k.APIClientCert) > 0 {
		authinfo.ClientCertificate = k.APIClientCert
	}
	if len(k.APIClientKey) > 0 {
		authinfo.ClientKey = k.APIClientKey
	}

	overrides.ClusterInfo = clusterinfo
	overrides.AuthInfo = authinfo
	clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, overrides)

	cc, err := clientConfig.ClientConfig()
	if err != nil {
		return nil, err
	}
	cc.ContentType = "application/vnd.kubernetes.protobuf"
	return cc, err

}

// InitKubeCache initializes a new Kubernetes cache.
func (k *Kubernetes) InitKubeCache(ctx context.Context) (err error) {
	config, err := k.getClientConfig()
	if err != nil {
		return err
	}

	kubeClient, err := kubernetes.NewForConfig(config)
	if err != nil {
		return fmt.Errorf("failed to create kubernetes notification controller: %q", err)
	}

	if k.opts.labelSelector != nil {
		var selector labels.Selector
		selector, err = meta.LabelSelectorAsSelector(k.opts.labelSelector)
		if err != nil {
			return fmt.Errorf("unable to create Selector for LabelSelector '%s': %q", k.opts.labelSelector, err)
		}
		k.opts.selector = selector
	}

	if k.opts.namespaceLabelSelector != nil {
		var selector labels.Selector
		selector, err = meta.LabelSelectorAsSelector(k.opts.namespaceLabelSelector)
		if err != nil {
			return fmt.Errorf("unable to create Selector for LabelSelector '%s': %q", k.opts.namespaceLabelSelector, err)
		}
		k.opts.namespaceSelector = selector
	}

	k.opts.initPodCache = k.podMode == podModeVerified

	k.opts.zones = k.Zones
	k.opts.endpointNameMode = k.endpointNameMode
	k.APIConn = newdnsController(ctx, kubeClient, k.opts)

	return err
}

// Records looks up services in kubernetes.
func (k *Kubernetes) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error) {
	r, e := parseRequest(state.Name(), state.Zone)
	if e != nil {
		return nil, e
	}
	if r.podOrSvc == "" {
		return nil, nil
	}

	if dnsutil.IsReverse(state.Name()) > 0 {
		return nil, errNoItems
	}

	if !wildcard(r.namespace) && !k.namespaceExposed(r.namespace) {
		return nil, errNsNotExposed
	}

	if r.podOrSvc == Pod {
		pods, err := k.findPods(r, state.Zone)
		return pods, err
	}

	services, err := k.findServices(r, state.Zone)
	return services, err
}

func endpointHostname(addr object.EndpointAddress, endpointNameMode bool) string {
	if addr.Hostname != "" {
		return addr.Hostname
	}
	if endpointNameMode && addr.TargetRefName != "" {
		return addr.TargetRefName
	}
	if strings.Contains(addr.IP, ".") {
		return strings.Replace(addr.IP, ".", "-", -1)
	}
	if strings.Contains(addr.IP, ":") {
		return strings.Replace(addr.IP, ":", "-", -1)
	}
	return ""
}

func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, err error) {
	if k.podMode == podModeDisabled {
		return nil, errNoItems
	}

	namespace := r.namespace
	if !wildcard(namespace) && !k.namespaceExposed(namespace) {
		return nil, errNoItems
	}

	podname := r.service

	// handle empty pod name
	if podname == "" {
		if k.namespaceExposed(namespace) || wildcard(namespace) {
			// NODATA
			return nil, nil
		}
		// NXDOMAIN
		return nil, errNoItems
	}

	zonePath := msg.Path(zone, coredns)
	ip := ""
	if strings.Count(podname, "-") == 3 && !strings.Contains(podname, "--") {
		ip = strings.Replace(podname, "-", ".", -1)
	} else {
		ip = strings.Replace(podname, "-", ":", -1)
	}

	if k.podMode == podModeInsecure {
		if !wildcard(namespace) && !k.namespaceExposed(namespace) { // no wildcard, but namespace does not exist
			return nil, errNoItems
		}

		// If ip does not parse as an IP address, we return an error, otherwise we assume a CNAME and will try to resolve it in backend_lookup.go
		if net.ParseIP(ip) == nil {
			return nil, errNoItems
		}

		return []msg.Service{{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl}}, err
	}

	// PodModeVerified
	err = errNoItems
	if wildcard(podname) && !wildcard(namespace) {
		// If namespace exists, err should be nil, so that we return NODATA instead of NXDOMAIN
		if k.namespaceExposed(namespace) {
			err = nil
		}
	}

	for _, p := range k.APIConn.PodIndex(ip) {
		// If namespace has a wildcard, filter results against Corefile namespace list.
		if wildcard(namespace) && !k.namespaceExposed(p.Namespace) {
			continue
		}

		// check for matching ip and namespace
		if ip == p.PodIP && match(namespace, p.Namespace) {
			s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl}
			pods = append(pods, s)

			err = nil
		}
	}
	return pods, err
}

// findServices returns the services matching r from the cache.
func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.Service, err error) {
	if !wildcard(r.namespace) && !k.namespaceExposed(r.namespace) {
		return nil, errNoItems
	}

	// handle empty service name
	if r.service == "" {
		if k.namespaceExposed(r.namespace) || wildcard(r.namespace) {
			// NODATA
			return nil, nil
		}
		// NXDOMAIN
		return nil, errNoItems
	}

	err = errNoItems
	if wildcard(r.service) && !wildcard(r.namespace) {
		// If namespace exists, err should be nil, so that we return NODATA instead of NXDOMAIN
		if k.namespaceExposed(r.namespace) {
			err = nil
		}
	}

	var (
		endpointsListFunc func() []*object.Endpoints
		endpointsList     []*object.Endpoints
		serviceList       []*object.Service
	)

	if wildcard(r.service) || wildcard(r.namespace) {
		serviceList = k.APIConn.ServiceList()
		endpointsListFunc = func() []*object.Endpoints { return k.APIConn.EndpointsList() }
	} else {
		idx := object.ServiceKey(r.service, r.namespace)
		serviceList = k.APIConn.SvcIndex(idx)
		endpointsListFunc = func() []*object.Endpoints { return k.APIConn.EpIndex(idx) }
	}

	zonePath := msg.Path(zone, coredns)
	for _, svc := range serviceList {
		if !(match(r.namespace, svc.Namespace) && match(r.service, svc.Name)) {
			continue
		}

		// If request namespace is a wildcard, filter results against Corefile namespace list.
		// (Namespaces without a wildcard were filtered before the call to this function.)
		if wildcard(r.namespace) && !k.namespaceExposed(svc.Namespace) {
			continue
		}

		// If "ignore empty_service" option is set and no endpoints exist, return NXDOMAIN unless
		// it's a headless or externalName service (covered below).
		if k.opts.ignoreEmptyService && svc.ClusterIP != api.ClusterIPNone && svc.Type != api.ServiceTypeExternalName {
			// serve NXDOMAIN if no endpoint is able to answer
			podsCount := 0
			for _, ep := range endpointsListFunc() {
				for _, eps := range ep.Subsets {
					podsCount = podsCount + len(eps.Addresses)
				}
			}

			if podsCount == 0 {
				continue
			}
		}

		// Endpoint query or headless service
		if svc.ClusterIP == api.ClusterIPNone || r.endpoint != "" {
			if endpointsList == nil {
				endpointsList = endpointsListFunc()
			}
			for _, ep := range endpointsList {
				if ep.Name != svc.Name || ep.Namespace != svc.Namespace {
					continue
				}

				for _, eps := range ep.Subsets {
					for _, addr := range eps.Addresses {

						// See comments in parse.go parseRequest about the endpoint handling.
						if r.endpoint != "" {
							if !match(r.endpoint, endpointHostname(addr, k.endpointNameMode)) {
								continue
							}
						}

						for _, p := range eps.Ports {
							if !(match(r.port, p.Name) && match(r.protocol, string(p.Protocol))) {
								continue
							}
							s := msg.Service{Host: addr.IP, Port: int(p.Port), TTL: k.ttl}
							s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name, endpointHostname(addr, k.endpointNameMode)}, "/")

							err = nil

							services = append(services, s)
						}
					}
				}
			}
			continue
		}

		// External service
		if svc.Type == api.ServiceTypeExternalName {
			s := msg.Service{Key: strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/"), Host: svc.ExternalName, TTL: k.ttl}
			if t, _ := s.HostType(); t == dns.TypeCNAME {
				s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/")
				services = append(services, s)

				err = nil
			}
			continue
		}

		// ClusterIP service
		for _, p := range svc.Ports {
			if !(match(r.port, p.Name) && match(r.protocol, string(p.Protocol))) {
				continue
			}

			err = nil

			s := msg.Service{Host: svc.ClusterIP, Port: int(p.Port), TTL: k.ttl}
			s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/")

			services = append(services, s)
		}
	}
	return services, err
}

// Serial return the SOA serial.
func (k *Kubernetes) Serial(state request.Request) uint32 { return uint32(k.APIConn.Modified()) }

// MinTTL returns the minimal TTL.
func (k *Kubernetes) MinTTL(state request.Request) uint32 { return k.ttl }

// match checks if a and b are equal taking wildcards into account.
func match(a, b string) bool {
	if wildcard(a) {
		return true
	}
	if wildcard(b) {
		return true
	}
	return strings.EqualFold(a, b)
}

// wildcard checks whether s contains a wildcard value defined as "*" or "any".
func wildcard(s string) bool {
	return s == "*" || s == "any"
}

const coredns = "c" // used as a fake key prefix in msg.Service


text:
<?php

namespace Flowcode\NewsBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Flowcode\MediaBundle\Form\MediaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;

class PostType extends AbstractType {

    private $categoryService;

    public function __construct($categoryService)
    {
        $this->categoryService = $categoryService;
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options) {

        $builder
                ->add('title')
                ->add('image')
                ->add('video')
                ->add('abstract')
                ->add('category', EntityType::class, array(
                    'class' => "Amulen\ClassificationBundle\Entity\Category",
                    'choices' => $this->categoryService->findByRoot("post"),
                    'choice_label' => function($category, $key, $index) {
                        $prefix = "";
                        for($i = 0; $i < $category->getLvl(); $i++){
                            $prefix .= "-";
                        }
                        return strtolower($prefix.$category->getName());
                    },
                    'multiple' => false,
                ))
                ->add('content', 'ckeditor')
                ->add('enabled', null, array('required' => false))
                ->add('tags')
                ->add('type', null, array('required' => false))
                ->add('published')
                ->add('position')
        ;
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Amulen\NewsBundle\Entity\Post'
        ));
    }

    /**
     * @return string
     */
    public function getName() {
        return 'flowcode_newsbundle_post';
    }

}

redpajama_set_name: RedPajamaGithub


text:
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8"/>
<TITLE>Software License</TITLE>

TERMS AND CONDITIONS FOR SEPARATELY LICENSED CODE

IBM WebSphere Application Server V9.0.5.7

The IBM license agreement and any applicable information on
the web

download page for IBM products refers Licensee to this file
for details

concerning terms and conditions applicable to code
identified as

Separately Licensed Code below and included in the products
listed

above ("the Program").

The Separately Licensed Code is provided to Licensee under
terms

and conditions that are different from the IBM license
agreement.

Licensee's use of such components or portions thereof is
subject to the

terms of the associated license agreement provided or
referenced in this

section and not the terms of the IBM license agreement.

Please note: This NON_IBM_LICENSE file may identify
Separately Licensed

Code and its related agreements that are not used by, or
that were not

shipped with, the Program as Licensee installed it.

The following are Separately Licensed Code:

JCIP-ANNOTATIONS

Bootstrap Docs

JSON Webservices

neighboursJSON

uas

Zillow - US Neighborhoods

AdoptOpenJDK binaries for Eclipse OpenJ9 8.0.*

FactoryFinderCache.java

j2seproject/copylibstask/antlib.xml

Syntax Highlighter

Font Awesome

Ubuntu (main) 16.0.4

----------------------------------------------------------------------------------------

TABLE OF CONTENTS

THE REMAINDER OF THIS IBM NOTICES FILE CONSISTS OF THE
FOLLOWING

SECTIONS:

CC-BY-2.5

CC-BY-3.0

CC-BY-SA-4.0

GPL V2

GPL V3

RedHat UBI

SIL OPEN FONT LICENSE 1.1

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CREATIVE COMMONS ATTRIBUTION 2.5 GENERIC

The Program includes some or all of the following works
licensed under

the Creative Commons.

The url to the license is https://creativecommons.
org/licenses/by/2.5/legalcode

JCIP-ANNOTATIONS [HttpComponents HttpCore] (http://search.
maven.org/#artifactdetails|org.apache.httpcomponents|httpcore|4.
3|jar)

END OF CREATIVE COMMONS ATTRIBUTION 2.5 GENERIC NOTICES AND
INFORMATION

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CREATIVE COMMONS ATTRIBUTION 3.0 GENERIC

The Program includes some or all of the following works
licensed under

the Creative Commons.

The url to the license is https://creativecommons.
org/licenses/by/3.0/legalcode

UAS [uadetector] (https://github.
com/arouel/uadetector/tree/2013.09)

JSON WEBSERVICES [Dojo Toolkit](https://download.
dojotoolkit.org/release-1.7.12/)

BOOTSTRAP DOCS [Bootstrap] (https://github.
com/twbs/bootstrap/archive/v3.3.7.zip)

NEIGHBOURSJSON [Dojo Toolkit] (https://download.dojotoolkit.
org/release-1.7.12/)

END OF CREATIVE COMMONS ATTRIBUTION 3.0 GENERIC NOTICES AND
INFORMATION

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 4.0 GENERIC

The Program includes some or all of the following works
licensed under

the Creative Commons.

The url to the license is https://creativecommons.
org/licenses/by-sa/4.0/legalcode

ZILLOW - US NEIGHBORHOODS [Dojo Toolkit]

(https://download.dojotoolkit.org/release-1.7.12/)

END OF CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 4.0 GENERIC
NOTICES AND INFORMATION

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

GNU GENERAL PUBLIC LICENSE, VERSION 2

The Program includes some or all of the following licensed
to you as

Separately Licensed Code under the GNU General Public
License. For copies

of the source code for this software, send an email to
gpicher@us.ibm.com

identifying the IBM product and the GPL-licensed program
for which you

are requesting the source code

ADOPTOPENJDK BINARIES FOR ECLIPSE OPENJ9,

J2SEPROJECT/COPYLIBSTASK/ANTLIB.XML [jnr-netdb],
FACTORYFINDERCACHE.JAVA

[weld]

END OF GNU GENERAL PUBLIC LICENSE, VERSION 2 NOTICES AND
INFORMATION

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

GNU GENERAL PUBLIC LICENSE, VERSION 3

The Program includes some or all of the following licensed
to you as

Separately Licensed Code under the GNU General Public
License. For copies

of the source code for this software, send an email to
gpicher@us.ibm.com

identifying the IBM product and the GPL-licensed program
for which you

are requesting the source code

SYNTAX HIGHLIGHTER [weld]

Ubuntu (main) 16.04

END OF GNU GENERAL PUBLIC LICENSE, VERSION 3 NOTICES AND
INFORMATION

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The following software is licensed under the terms and
conditions of the Red Hat End User License Agreement:

REDHAT UNIVERSAL BASE IMAGE v 7.6 (Maipo)

--------------------------------------------------------------------------------

END USER LICENSE AGREEMENT

RED HAT UNIVERSAL BASE IMAGE

PLEASE READ THIS END USER LICENSE AGREEMENT CAREFULLY
BEFORE USING SOFTWARE FROM RED HAT. BY USING RED HAT SOFTWARE, YOU
SIGNIFY YOUR ASSENT TO AND ACCEPTANCE OF THIS END USER LICENSE
AGREEMENT AND ACKNOWLEDGE YOU HAVE READ AND UNDERSTAND THE TERMS. AN
INDIVIDUAL ACTING ON BEHALF OF AN ENTITY REPRESENTS THAT HE OR SHE HAS
THE AUTHORITY TO ENTER INTO THIS END USER LICENSE AGREEMENT ON
BEHALF OF THAT ENTITY. IF YOU DO NOT ACCEPT THE TERMS OF THIS
AGREEMENT, THEN YOU MUST NOT USE THE RED HAT SOFTWARE. THIS END USER
LICENSE AGREEMENT DOES NOT PROVIDE ANY RIGHTS TO RED HAT SERVICES
SUCH AS SOFTWARE MAINTENANCE, UPGRADES OR SUPPORT. PLEASE REVIEW
YOUR SERVICE OR SUBSCRIPTION AGREEMENT(S) THAT YOU MAY HAVE WITH
RED HAT OR OTHER AUTHORIZED RED HAT SERVICE PROVIDERS REGARDING
SERVICES AND ASSOCIATED PAYMENTS.

This end user license agreement ("EULA") governs the use of
Red Hat Universal Base Image and associated software supporting
such container(s) and any related updates, source code,
including the appearance, structure and organization (the
"Programs"), regardless of the delivery mechanism. If a Red Hat
Universal Base Image is included in another Red Hat product, the EULA
terms of such other Red Hat product will apply and supersede this
EULA. If a Red Hat Universal Base Image is included in a third
party work, the terms of this EULA will continue to govern the
Red Hat Universal Base Image.

1. License Grant. Subject to the terms of this EULA, Red
Hat, Inc. ("Red Hat") grants to you a perpetual, worldwide
license to the Programs (each of which may include multiple
software components). With the exception of the Red Hat trademark
identified in Section 2 below, each software component is governed by
a license that permits you to run, copy, modify, and
redistribute (subject to certain obligations in some cases) the software
components. This EULA pertains solely to the Programs and does not
limit your rights under, or grant you rights that supersede, the
license terms applicable to any particular component. The license
terms applicable to each software component are provided in the
source code of that component.

2. Intellectual Property Rights. The Programs and each of
their components are owned by Red Hat and other licensors and are
protected under copyright law and other laws as applicable. Title to
the Programs and any component shall remain with Red Hat and
other licensors, subject to the applicable license, excluding any
independently developed and licensed work. The "Red Hat" trademark is a
registered trademark of Red Hat and its affiliates in the U.S. and
other countries. Subject to Red Hat's trademark usage guidelines
(set forth at http://www.redhat.com/about/corporate/trademark/),
this EULA permits you to distribute the Programs that include
the Red Hat trademark, provided you do not make any statements
on behalf of Red Hat, including but not limited to, stating or
in any way suggesting (in any public, private and/or
confidential statement (whether written or verbal)) that Red Hat
supports or endorses software built and delivered with a Red Hat
Universal Base Image(s) (such derivative works referred to as a "Red
Hat Based Container Images"); provided if a Red Hat Based
Container Image is Red Hat Certified and deployed on a Red Hat
supported configuration as set forth at https://access.redhat.
com/articles/2726611 then you may state that the Red Hat Universal Base Image is
supported by Red Hat. You agree to include this unmodified EULA in
all distributions of container images sourced, built or
otherwise derived from the Programs. If you modify the Red Hat
Universal Base Image(s), you must remove any Red Hat trademark(s)
prior to any subsequent distribution. Any breach of this Section
2 is a material breach of the EULA and you may no longer use
and/or distribute the Red Hat trademark(s). Modifications to the
software may corrupt the Programs.

3. Limited Warranty. Except as specifically stated in this
Section 3, a separate agreement with Red Hat, or a license for a
particular component, to the maximum extent permitted under applicable
law, the Programs and the components are provided and licensed
"as is" without warranty of any kind, expressed or implied,
including the implied warranties of merchantability, non-infringement
or fitness for a particular purpose. Neither Red Hat nor its
affiliates warrant that the functions contained in the Programs will
meet your requirements or that the operation of the Programs
will be entirely error free, appear or perform precisely as
described in the accompanying documentation, or comply with
regulatory requirements. Red Hat warrants that the media on which the
Programs and the components are provided will be free from defects
in materials and manufacture under normal use for a period of
30 days from the date of delivery to you. This warranty
extends only to the party that purchases subscription services for
the supported configurations from Red Hat and/or its affiliates
or a Red Hat authorized distributor.

4. Limitation of Remedies and Liability. To the maximum
extent permitted by applicable law, your exclusive remedy under
this EULA is to return any defective media within 30 days of
delivery along with a copy of your payment receipt and Red Hat, at
its option, will replace it or refund the money you paid for
the media. To the maximum extent permitted under applicable
law, under no circumstances will Red Hat, its affiliates, any
Red Hat authorized distributor, or the licensor of any
component provided to you under this EULA be liable to you for any
incidental or consequential damages, including lost profits or lost
savings arising out of the use or inability to use the Programs or
any component, even if Red Hat, its affiliates, an authorized
distributor, and/or licensor has been advised of the possibility of such
damages. In no event shall Red Hat's or its affiliates' liability,
an authorized distributor's liability or the liability of the
licensor of a component provided to you under this EULA exceed the
amount that you paid to Red Hat for the media under this EULA.

5. Export Control. As required by the laws of the United
States and other countries, you represent and warrant that you:
(a) understand that the Programs and their components may be
subject to export controls under the U.S. Commerce Department's
Export Administration Regulations ("EAR"); (b) are not located in
a prohibited destination country under the EAR or U.S.
sanctions regulations (currently Cuba, Iran, North Korea, Sudan,
Syria, and the Crimea Region of Ukraine, subject to change as
posted by the United States government); (c) will not export, re-
export, or transfer the Programs to any prohibited destination,
persons or entities on the U.S. Bureau of Industry and Security
Denied Parties List or Entity List, or the U.S. Office of Foreign
Assets Control list of Specially Designated Nationals and Blocked
Persons, or any similar lists maintained by other countries, without
the necessary export license(s) or authorizations(s); (d) will
not use or transfer the Programs for use in connection with any
nuclear, chemical or biological weapons, missile technology, or
military end-uses where prohibited by an applicable arms embargo,
unless authorized by the relevant government agency by regulation
or specific license; (e) understand and agree that if you are
in the United States and export or transfer the Programs to
eligible end users, you will, to the extent required by EAR Section
740.17(e), submit semi-annual reports to Red Hat Universal Base
Image End User License Agreement Page 2 of 2 April, 2019 the
Commerce Department's Bureau of Industry and Security, which include
the name and address (including country) of each transferee;
and (f) understand that countries including the United States
may restrict the import, use, or export of encryption products
(which may include the Programs and the components) and agree that
you shall be solely responsible for compliance with any such
import, use, or export restrictions.

6. Third Party Software. The Program may be provided with
third party software programs subject to their own license terms.
The license terms either accompany the third party software
programs or, in some instances, may be viewed at registry.access.
redhat.com. If you do not agree to abide by the applicable license
terms for the third party software programs, then you may not
install, distribute or use them.

7. General. If any provision of this EULA is held to be
unenforceable, the enforceability of the remaining provisions shall not be
affected. Any claim, controversy or dispute arising under or relating
to this EULA shall be governed by the laws of the State of New
York and of the United States, without regard to any conflict of
laws provisions. The rights and obligations of the parties to
this EULA shall not be governed by the United Nations Convention
on the International Sale of Goods.

Copyright (C) 2019 Red Hat, Inc. All rights reserved. "Red
Hat," is a registered trademark of Red Hat, Inc. All other
trademarks are the property of their respective owners.

==============================================================================================================================================

SIL OPEN FONT LICENSE 1.1

The Program includes some or all of the following works
licensed under

the SIL OPEN FONT LICENSE 1.1

FONT AWESOME [weld]

Permission is hereby granted, free of charge, to any person
obtaining a copy of the font software, to use, study, copy, merge,
embed,

modify, redistribute, and sell modified and unmodified
copies of the font software, subject to the following conditions:

1) Neither the font software nor any of its individual
components, in original or modified versions, may be sold by itself.

2) Original or modified versions of the font software may
be bundled, redistributed and/or sold with any software,
provided that each

copy contains the above copyright notice and this license.
These can be included either as stand-alone text files, human-
readable headers

or in the appropriate machine-readable metadata fields
within text or binary files as long as those fields can be easily
viewed by the user.

3) No modified version of the font software may use the
Reserved Name(s) or combinations of Reserved Names with other words
unless explicit

written permission is granted by the ParaType. This
restriction only applies to the primary font name as presented to the
users.

4) The name of ParaType or the author(s) of the font
software shall not be used to promote, endorse or advertise any
modified version, except

to acknowledge the contribution(s) of ParaType and the
author(s) or with explicit written permission of ParaType.

5) The font software, modified or unmodified, in part or in
whole, must be distributed entirely under this license, and must
not be distributed

under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION & TERRITORY

This license has no limits on time and territory, but it
becomes null and void if any of the above conditions are not met.

DISCLAIMER

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTIES OF

MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO
EVENT SHALL

PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES,

WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE
OR FROM OTHER DEALINGS

IN THE FONT SOFTWARE.

END OF SIL OPEN FONT LICENSE 1.1 LICENSE NOTICES AND
INFORMATION

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

END OF IBM WEBSPHERE APPLICATION SERVER NOTICES AND
INFORMATION FOR EXCLUDED COMPONENTS

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

END OF NOTICE FILE

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

L/N:  L-CTUR-BWXMYR

D/N:  L-CTUR-BWXMYR

P/N:  L-CTUR-BWXMYR


text:
"""
Demonstrates how to implement a custom transformation of the data.
"""
import os

import FlowCytometryTools
from FlowCytometryTools import FCMeasurement
from pylab import *

# Locate sample data included with this package
datadir = os.path.join(FlowCytometryTools.__path__[0], 'tests', 'data', 'Plate01')
datafile = os.path.join(datadir, 'RFP_Well_A3.fcs')

# datafile = '[insert path to your own fcs file]'

def custom_compensate(original_sample):
    # Copy the original sample
    new_sample = original_sample.copy()
    new_data = new_sample.data
    original_data = original_sample.data

    # Our transformation goes here
    new_data['Y2-A'] = original_data['Y2-A'] - 0.15 * original_data['FSC-A']
    new_data['FSC-A'] = original_data['FSC-A'] - 0.32 * original_data['Y2-A']
    new_data = new_data.dropna()  # Removes all NaN entries
    new_sample.data = new_data
    return new_sample

# Load data
sample = FCMeasurement(ID='Test Sample', datafile=datafile)
sample = sample.transform('hlog')

compensated_sample = sample.apply(custom_compensate)

###
# To do this with a collection (a plate):
# compensated_plate = plate.apply(compensate, output_format='collection')
#

# Plot
sample.plot(['Y2-A', 'FSC-A'], kind='scatter', color='gray', alpha=0.6, label='Original');
compensated_sample.plot(['Y2-A', 'FSC-A'], kind='scatter', color='green', alpha=0.6,
                        label='Compensated');

legend(loc='best')
grid(True)

# show() # <-- Uncomment when running as a script.


text:
set -e

echo "linting..."

eslint . --fix --cache

echo "lint complete!"


text:
[Apache Kafka](https://kafka.apache.org/) is an open-source stream-processing software platform.

##### Install Kafka

Use this [instruction](https://github.com/wurstmeister/kafka-docker) for installing Kafka in Docker container.


text:
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { SharedModule } from 'app/shared';
import { PinpointUserComponent } from './pinpoint-user.component';
import { PinpointUserCreateAndUpdateComponent } from './pinpoint-user-create-and-update.component';
import { PinpointUserContainerComponent } from './pinpoint-user-container.component';
import { PinpointUserInteractionService } from './pinpoint-user-interaction.service';
import { PinpointUserDataService } from './pinpoint-user-data.service';

@NgModule({
    declarations: [
        PinpointUserComponent,
        PinpointUserCreateAndUpdateComponent,
        PinpointUserContainerComponent
    ],
    imports: [
        FormsModule,
        ReactiveFormsModule,
        InfiniteScrollModule,
        SharedModule
    ],
    exports: [
        PinpointUserContainerComponent
    ],
    entryComponents: [
        PinpointUserComponent,
        PinpointUserContainerComponent
    ],
    providers: [
        PinpointUserInteractionService,
        PinpointUserDataService
    ]
})
export class PinpointUserModule { }


text:
class CirclePresenter < Presenter

  delegate :admins, to: :object

  include ActionView::Helpers::UrlHelper

  let(:admins_with_email_links) do
    admins.active.map { |a| mail_to(a.email, a.name) }
  end

  let(:active_circle_links) do
    current_user.active_circles.map do |circle|
      link_to(circle.name, account_switch_circle_path(current_user, circle_id: circle.id))
    end
  end

  def current_user
    @context
  end

end


text:
require 'spec_helper'

RSpec.describe Clarification::Objectifier do

  it "should be tested"

end


text:
namespace DynThings.Data.Models
{

using System;
    using System.Collections.Generic;

public partial class EndPointTypeCategory
{

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
    public EndPointTypeCategory()
    {

        this.EndPointTypes = new HashSet<EndPointType>();

    }

    public long ID { get; set; }

    public string Title { get; set; }

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]

    public virtual ICollection<EndPointType> EndPointTypes { get; set; }

}

}


text:
package org.apach3.http.cookie;

import java.util.Date;

/**
 * This interface represents a Set-Cookie response header sent by the
 * origin server to the HTTP agent in order to maintain a conversational state.
 *
 * @since 4.0
 */
public interface SetCookie extends Cookie {

    void setValue(String value);

    /**
     * If a user agent (web browser) presents this cookie to a user, the
     * cookie's purpose will be described using this comment.
     *
     * @param comment
     *
     * @see #getComment()
     */
    void setComment(String comment);

    /**
     * Sets expiration date.
     *
Note: the object returned by this method is considered
     * immutable. Changing it (e.g. using setTime()) could result in undefined
     * behaviour. Do so at your peril.

     *
     * @param expiryDate the {@link Date} after which this cookie is no longer valid.
     *
     * @see Cookie#getExpiryDate
     *
     */
    void setExpiryDate (Date expiryDate);

    /**
     * Sets the domain attribute.
     *
     * @param domain The value of the domain attribute
     *
     * @see Cookie#getDomain
     */
    void setDomain(String domain);

    /**
     * Sets the path attribute.
     *
     * @param path The value of the path attribute
     *
     * @see Cookie#getPath
     *
     */
    void setPath(String path);

    /**
     * Sets the secure attribute of the cookie.
     *

     * When <tt>true</tt> the cookie should only be sent
     * using a secure protocol (https).  This should only be set when
     * the cookie's originating server used a secure protocol to set the
     * cookie's value.
     *
     * @param secure The value of the secure attribute
     *
     * @see #isSecure()
     */
    void setSecure (boolean secure);

    /**
     * Sets the version of the cookie specification to which this
     * cookie conforms.
     *
     * @param version the version of the cookie.
     *
     * @see Cookie#getVersion
     */
    void setVersion(int version);

}


text:
package com.bumptech.glide.load.engine.prefill;

import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.VisibleForTesting;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.engine.cache.MemoryCache;
import com.bumptech.glide.util.Util;
import java.util.HashMap;
import java.util.Map;

/**
 * A class for pre-filling {@link android.graphics.Bitmap Bitmaps} in a
 * {@link com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool}.
 */
public final class BitmapPreFiller {

  private final MemoryCache memoryCache;
  private final BitmapPool bitmapPool;
  private final DecodeFormat defaultFormat;
  private final Handler handler = new Handler(Looper.getMainLooper());

  private BitmapPreFillRunner current;

  public BitmapPreFiller(MemoryCache memoryCache, BitmapPool bitmapPool,
      DecodeFormat defaultFormat) {
    this.memoryCache = memoryCache;
    this.bitmapPool = bitmapPool;
    this.defaultFormat = defaultFormat;
  }

  @SuppressWarnings("deprecation")
  public void preFill(PreFillType.Builder... bitmapAttributeBuilders) {
    if (current != null) {
      current.cancel();
    }

    PreFillType[] bitmapAttributes = new PreFillType[bitmapAttributeBuilders.length];
    for (int i = 0; i < bitmapAttributeBuilders.length; i++) {
      PreFillType.Builder builder = bitmapAttributeBuilders[i];
      if (builder.getConfig() == null) {
        builder.setConfig(
            defaultFormat == DecodeFormat.PREFER_ARGB_8888
                || defaultFormat == DecodeFormat.PREFER_ARGB_8888_DISALLOW_HARDWARE
            ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
      }
      bitmapAttributes[i] = builder.build();
    }

    PreFillQueue allocationOrder = generateAllocationOrder(bitmapAttributes);
    current = new BitmapPreFillRunner(bitmapPool, memoryCache, allocationOrder);
    handler.post(current);
  }

  @VisibleForTesting
  PreFillQueue generateAllocationOrder(PreFillType... preFillSizes) {
    final long maxSize =
        memoryCache.getMaxSize() - memoryCache.getCurrentSize() + bitmapPool.getMaxSize();

    int totalWeight = 0;
    for (PreFillType size : preFillSizes) {
      totalWeight += size.getWeight();
    }

    final float bytesPerWeight = maxSize / (float) totalWeight;

    Map<PreFillType, Integer> attributeToCount = new HashMap<>();
    for (PreFillType size : preFillSizes) {
      int bytesForSize = Math.round(bytesPerWeight * size.getWeight());
      int bytesPerBitmap = getSizeInBytes(size);
      int bitmapsForSize = bytesForSize / bytesPerBitmap;
      attributeToCount.put(size, bitmapsForSize);
    }

    return new PreFillQueue(attributeToCount);
  }

  private static int getSizeInBytes(PreFillType size) {
    return Util.getBitmapByteSize(size.getWidth(), size.getHeight(), size.getConfig());
  }
}


text:
"""
__M2IfClauseComplete_MDL.py_____________________________________________________

Automatically generated AToM3 Model File (Do not modify directly)
Author: gehan
Modified: Wed Oct 23 10:50:50 2013
________________________________________________________________________________
"""
from stickylink import *
from widthXfillXdecoration import *
from LHS import *
from MT_pre__SoftwareComposition import *
from graph_MT_pre__SoftwareComposition import *
from graph_LHS import *
from ATOM3Enum import *
from ATOM3String import *
from ATOM3BottomType import *
from ATOM3Constraint import *
from ATOM3Attribute import *
from ATOM3Float import *
from ATOM3List import *
from ATOM3Link import *
from ATOM3Connection import *
from ATOM3Boolean import *
from ATOM3Appearance import *
from ATOM3Text import *
from ATOM3Action import *
from ATOM3Integer import *
from ATOM3Port import *
from ATOM3MSEnum import *

def M2IfClauseComplete_MDL(self, rootNode, MT_pre__GM2AUTOSAR_MMRootNode=None, MoTifRuleRootNode=None):

    # --- Generating attributes code for ASG MT_pre__GM2AUTOSAR_MM ---
    if( MT_pre__GM2AUTOSAR_MMRootNode ):
        # author
        MT_pre__GM2AUTOSAR_MMRootNode.author.setValue('Annonymous')

        # description
        MT_pre__GM2AUTOSAR_MMRootNode.description.setValue('\n')
        MT_pre__GM2AUTOSAR_MMRootNode.description.setHeight(15)

        # name
        MT_pre__GM2AUTOSAR_MMRootNode.name.setValue('')
        MT_pre__GM2AUTOSAR_MMRootNode.name.setNone()
    # --- ASG attributes over ---

    # --- Generating attributes code for ASG MoTifRule ---
    if( MoTifRuleRootNode ):
        # author
        MoTifRuleRootNode.author.setValue('Annonymous')

        # description
        MoTifRuleRootNode.description.setValue('\n')
        MoTifRuleRootNode.description.setHeight(15)

        # name
        MoTifRuleRootNode.name.setValue('M2IfClauseComplete')
    # --- ASG attributes over ---

    self.obj7559=LHS(self)
    self.obj7559.isGraphObjectVisual = True

    if(hasattr(self.obj7559, '_setHierarchicalLink')):
      self.obj7559._setHierarchicalLink(False)

    # constraint
    self.obj7559.constraint.setValue('#===============================================================================\n# This code is executed after the nodes in the LHS have been matched.\n# You can access a matched node labelled n by: PreNode(\'n\').\n# To access attribute x of node n, use: PreNode(\'n\')[\'x\'].\n# The given constraint must evaluate to a boolean expression:\n#    returning True enables the rule to be applied,\n#    returning False forbids the rule from being applied.\n#===============================================================================\n\nreturn True\n')
    self.obj7559.constraint.setHeight(15)

    self.obj7559.graphClass_= graph_LHS
    if self.genGraphics:
       new_obj = graph_LHS(80.0,60.0,self.obj7559)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("LHS", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj7559.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj7559)
    self.globalAndLocalPostcondition(self.obj7559, rootNode)
    self.obj7559.postAction( rootNode.CREATE )

    self.obj7560=MT_pre__SoftwareComposition(self)
    self.obj7560.isGraphObjectVisual = True

    if(hasattr(self.obj7560, '_setHierarchicalLink')):
      self.obj7560._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj7560.MT_pivotOut__.setValue('element1')

    # MT_subtypeMatching__
    self.obj7560.MT_subtypeMatching__.setValue(('True', 0))
    self.obj7560.MT_subtypeMatching__.config = 0

    # MT_pre__classtype
    self.obj7560.MT_pre__classtype.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj7560.MT_pre__classtype.setHeight(15)

    # MT_pivotIn__
    self.obj7560.MT_pivotIn__.setValue('')
    self.obj7560.MT_pivotIn__.setNone()

    # MT_label__
    self.obj7560.MT_label__.setValue('1')

    # MT_pre__cardinality
    self.obj7560.MT_pre__cardinality.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj7560.MT_pre__cardinality.setHeight(15)

    # MT_pre__name
    self.obj7560.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj7560.MT_pre__name.setHeight(15)

    self.obj7560.graphClass_= graph_MT_pre__SoftwareComposition
    if self.genGraphics:
       new_obj = graph_MT_pre__SoftwareComposition(140.0,120.0,self.obj7560)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__SoftwareComposition", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj7560.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj7560)
    self.globalAndLocalPostcondition(self.obj7560, rootNode)
    self.obj7560.postAction( rootNode.CREATE )

    # Connections for obj7559 (graphObject_: Obj23) of type LHS
    self.drawConnections(
 )
    # Connections for obj7560 (graphObject_: Obj24) of type MT_pre__SoftwareComposition
    self.drawConnections(
 )

newfunction = M2IfClauseComplete_MDL

loadedMMName = ['MT_pre__GM2AUTOSAR_MM_META', 'MoTifRule_META']

atom3version = '0.3'


text:
function addTwitterDelayed() {
	// setTimeout(function() {
	// 	addTwitter(document, 'script', 'twitter-wjs');
	// }, 100)
}


text:
//============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
//============================================================================
package org.talend.components.api.properties;

import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;

import org.talend.daikon.crypto.CipherSources;
import org.talend.daikon.crypto.Encryption;

/*
 * Created by bhe on Sep 27, 2019
 */
public class ComponentEncryption {

    private static final String ENCRYPTION_PREFIX = "enc:";

    private static final Pattern REG_ENCRYPTED_DATA = Pattern.compile("^enc\\:system\\.encryption\\.key\\.v\\d\\:\\p{Print}+");

    private static final Logger LOGGER = Logger.getLogger(ComponentEncryption.class.getCanonicalName());

    private static final ThreadLocal<Properties> LOCALCACHEDALLKEYS = ThreadLocal.withInitial(() -> {
        return ComponentKeySource.loadAllKeys();
    });

    private static ComponentKeySource getKeySource(String keyName, boolean isEncrypt) {
        Properties allKeys = LOCALCACHEDALLKEYS.get();
        ComponentKeySource ks = ComponentKeySource.key(allKeys, keyName, isEncrypt);
        try {
            if (ks.getKey() != null) {
                return ks;
            }
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Can not load key: " + keyName);
        }

        RuntimeException e = new IllegalArgumentException("Can not load encryption key data: " + keyName);
        LOGGER.log(Level.SEVERE, e.getMessage(), e);
        throw e;
    }

    /**
     * Encrypt input data
     */
    public static String encrypt(String src) {
        if (src == null || isEncrypted(src)) {
            return src;
        }
        try {
            ComponentKeySource ks = getKeySource(ComponentKeySource.KEY_SYSTEM_PREFIX, true);
            StringBuilder sb = new StringBuilder();
            sb.append(ENCRYPTION_PREFIX);
            sb.append(ks.getKeyName());
            sb.append(":");
            sb.append(new Encryption(ks, CipherSources.getDefault()).encrypt(src));
            return sb.toString();
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
        }
        return null;
    }

    /**
     * Decrypt input data
     */
    public static String decrypt(String src) {
        if (!isEncrypted(src)) {
            return src;
        }

        try {
            String[] encryptedData = src.split("\\:");
            ComponentKeySource ks = getKeySource(encryptedData[1], false);
            return new Encryption(ks, CipherSources.getDefault()).decrypt(encryptedData[2]);
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
        }
        return null;
    }

    /**
     * Test whether input data is encrypted
     */
    public static boolean isEncrypted(String src) {
        return src != null && REG_ENCRYPTED_DATA.matcher(src).matches();
    }

    private ComponentEncryption() {

    }
}


text:
'use strict'

exports.seed = function(knex, Promise) {
  // Deletes ALL existing entries
  return knex('broset').del()
    .then(function () {
      return Promise.all([
        // Inserts seed entries
        knex('broset').insert({
          admission_id: 1,
          user_id: 1,
          confused: true,
          irritable: true,
          boisterous: false,
          verbal_threats: false,
          physical_threats: false,
          attacking_furniture: false
        }),
      ]);
    });
};


text:
<phpunit bootstrap="src/Test/bootstrap.php" colors="true" verbose="true">
    <logging>
        <log type="coverage-clover" target="dist/coverage/clover.xml"/>
        <log type="coverage-html" target="dist/coverage"/>
    </logging>
    <testsuites>
        <testsuite name="RingCentral">
            <directory>src</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">src</directory>
            <exclude>
                <directory suffix="Test.php">src</directory>
                <directory>src/Test</directory>
            </exclude>
        </whitelist>
    </filter>
</phpunit>


text:
from .models import Employee, Dept, ClassRoom, Word

import floppyforms as forms
from select2light.widgets import Select2Widget, Select2MultipleWidget, AjaxSelect2Widget, AjaxSelect2MultipleWidget
from select2light.models import Select2ModelChoiceField, Select2ModelMultipleChoiceField, AjaxSelect2ModelChoiceField, AjaxSelect2ModelMultipleChoiceField

class EmployeeForm(forms.ModelForm):

    class Meta:
        model = Employee
        widgets = {
            'dept': Select2Widget,  # Simple Select2 widget
            'manager': AjaxSelect2Widget(resource_name='employee', api_name='v1')  # Ajax Select2 widget
        }

class DeptForm(forms.ModelForm):

    class Meta:
        model = Dept
        widgets = {
            'allotted_rooms': Select2MultipleWidget,
            'allotted_labs': AjaxSelect2MultipleWidget(resource_name='lab', api_name='v1')
        }

class MixedForm(forms.Form):
    emp1 = Select2ModelChoiceField(queryset=Employee.objects.all())
    rooms1 = AjaxSelect2ModelChoiceField(queryset=ClassRoom.objects.all(), resource_name='classroom', api_name='v1', label_key='number')
    emp2 = AjaxSelect2ModelChoiceField(queryset=Employee.objects.all(), resource_name='employee', api_name='v1')
    rooms2 = AjaxSelect2ModelChoiceField(queryset=ClassRoom.objects.all(), resource_name='classroom', api_name='v1', label_key='number')
    rooms3 = AjaxSelect2ModelChoiceField(queryset=ClassRoom.objects.all(), resource_name='classroom', api_name='v1', label_key='number')
    any_word = AjaxSelect2ModelMultipleChoiceField(queryset=Word.objects.all(), resource_name='word', api_name='v1', label_key='word')


text:
package org.jetbrains.idea.maven.server;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.maven.model.*;
import org.jetbrains.idea.maven.project.MavenConsole;
import org.jetbrains.idea.maven.server.RemotePathTransformerFactory.Transformer;
import org.jetbrains.idea.maven.utils.MavenLog;
import org.jetbrains.idea.maven.utils.MavenProcessCanceledException;
import org.jetbrains.idea.maven.utils.MavenProgressIndicator;

import java.io.File;
import java.rmi.NoSuchObjectException;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.*;

public abstract class MavenEmbedderWrapper extends MavenRemoteObjectWrapper<MavenServerEmbedder> {
  private Customization myCustomization;
  private Project myProject;

  public MavenEmbedderWrapper(@NotNull Project project, @Nullable RemoteObjectWrapper<?> parent) {
    super(parent);
    myProject = project;
  }

  @Override
  protected synchronized void onWrappeeCreated() throws RemoteException {
    super.onWrappeeCreated();
    if (myCustomization != null) {
      doCustomize();
    }
  }

  public void customizeForResolve(MavenConsole console, MavenProgressIndicator indicator) {
    setCustomization(console, indicator, null, false, false, null);
    perform(() -> {
      doCustomize();
      return null;
    });
  }

  public void customizeForResolve(MavenWorkspaceMap workspaceMap, MavenConsole console, MavenProgressIndicator indicator, boolean alwaysUpdateSnapshot) {
    customizeForResolve(workspaceMap, console, indicator, alwaysUpdateSnapshot, null);
  }

  public void customizeForResolve(MavenWorkspaceMap workspaceMap, MavenConsole console, MavenProgressIndicator indicator,
                                  boolean alwaysUpdateSnapshot, @Nullable Properties userProperties) {
    setCustomization(console, indicator, workspaceMap, false, alwaysUpdateSnapshot, userProperties);
    perform(() -> {
      doCustomize();
      return null;
    });
  }

  public void customizeForStrictResolve(MavenWorkspaceMap workspaceMap,
                                        MavenConsole console,
                                        MavenProgressIndicator indicator) {
    setCustomization(console, indicator, workspaceMap, true, false, null);
    perform(() -> {
      doCustomize();
      return null;
    });
  }

  public void customizeForGetVersions() {
    perform(() -> {
      doCustomizeComponents();
      return null;
    });
  }

  private synchronized void doCustomizeComponents() throws RemoteException {
    getOrCreateWrappee().customizeComponents(ourToken);
  }

  private synchronized void doCustomize() throws RemoteException {
    getOrCreateWrappee().customize(myCustomization.workspaceMap,
                                   myCustomization.failOnUnresolvedDependency,
                                   myCustomization.console,
                                   myCustomization.indicator,
                                   myCustomization.alwaysUpdateSnapshot || ApplicationManager.getApplication().isUnitTestMode(),
                                   myCustomization.userProperties,
                                   ourToken);
  }

  public MavenServerExecutionResult resolveProject(@NotNull final VirtualFile file,
                                                               @NotNull final Collection<String> activeProfiles,
                                                               @NotNull final Collection<String> inactiveProfiles)
    throws MavenProcessCanceledException {
    return resolveProject(Collections.singleton(file), activeProfiles, inactiveProfiles).iterator().next();
  }

  @NotNull
  public Collection<MavenServerExecutionResult> resolveProject(@NotNull final Collection<VirtualFile> files,
                                                   @NotNull final Collection<String> activeProfiles,
                                                   @NotNull final Collection<String> inactiveProfiles)
    throws MavenProcessCanceledException {
    return performCancelable(() -> {
      Transformer transformer = files.isEmpty() ?
                                Transformer.ID :
                                RemotePathTransformerFactory.createForProject(myProject);
      final List<File> ioFiles = ContainerUtil.map(files, file -> new File(transformer.toRemotePath(file.getPath())));
      Collection<MavenServerExecutionResult> results =
        getOrCreateWrappee().resolveProject(ioFiles, activeProfiles, inactiveProfiles, ourToken);
      if (transformer != Transformer.ID) {
        for (MavenServerExecutionResult result : results) {
          MavenServerExecutionResult.ProjectData data = result.projectData;
          if (data == null) continue;
          new MavenBuildPathsChange((String s) -> transformer.toIdePath(s)).perform(data.mavenModel);
        }
      }
      return results;
    });
  }

  @Nullable
  public String evaluateEffectivePom(@NotNull final VirtualFile file,
                                     @NotNull final Collection<String> activeProfiles,
                                     @NotNull final Collection<String> inactiveProfiles) throws MavenProcessCanceledException {
    return evaluateEffectivePom(new File(file.getPath()), activeProfiles, inactiveProfiles);
  }

  @Nullable
  public String evaluateEffectivePom(@NotNull final File file,
                                     @NotNull final Collection<String> activeProfiles,
                                     @NotNull final Collection<String> inactiveProfiles) throws MavenProcessCanceledException {
    return performCancelable(() -> getOrCreateWrappee()
      .evaluateEffectivePom(file, new ArrayList<>(activeProfiles), new ArrayList<>(inactiveProfiles), ourToken));
  }

  @NotNull
  public MavenArtifact resolve(@NotNull final MavenArtifactInfo info,
                               @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {
    return performCancelable(() -> getOrCreateWrappee().resolve(info, remoteRepositories, ourToken));
  }

  @NotNull
  public List<MavenArtifact> resolveTransitively(
    @NotNull final List<MavenArtifactInfo> artifacts,
    @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {

    return performCancelable(() -> getOrCreateWrappee().resolveTransitively(artifacts, remoteRepositories, ourToken));
  }

  @NotNull
  public List<String> retrieveVersions(@NotNull final String groupId,
                                       @NotNull final String artifactId,
                                       @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {

    return performCancelable(() -> getOrCreateWrappee().retrieveAvailableVersions(groupId, artifactId, remoteRepositories, ourToken));
  }

  public Collection<MavenArtifact> resolvePlugin(@NotNull final MavenPlugin plugin,
                                                 @NotNull final List<MavenRemoteRepository> repositories,
                                                 @NotNull final NativeMavenProjectHolder nativeMavenProject,
                                                 final boolean transitive) throws MavenProcessCanceledException {
    int id;
    try {
      id = nativeMavenProject.getId();
    }
    catch (RemoteException e) {
      // do not call handleRemoteError here since this error occurred because of previous remote error
      return Collections.emptyList();
    }

    try {
      return getOrCreateWrappee().resolvePlugin(plugin, repositories, id, transitive, ourToken);
    }
    catch (RemoteException e) {
      // do not try to reconnect here since we have lost NativeMavenProjectHolder anyway.
      handleRemoteError(e);
      return Collections.emptyList();
    }
    catch (MavenServerProcessCanceledException e) {
      throw new MavenProcessCanceledException();
    }
  }

  public MavenModel readModel(final File file) throws MavenProcessCanceledException {
    return performCancelable(() -> getOrCreateWrappee().readModel(file, ourToken));
  }

  @NotNull
  public MavenServerExecutionResult execute(@NotNull final VirtualFile file,
                                            @NotNull final Collection<String> activeProfiles,
                                            @NotNull final Collection<String> inactiveProfiles,
                                            @NotNull final List<String> goals) throws MavenProcessCanceledException {
    return performCancelable(() -> getOrCreateWrappee()
      .execute(new File(file.getPath()), activeProfiles, inactiveProfiles, goals, Collections.emptyList(), false, false, ourToken));
  }

  @NotNull
  public MavenServerExecutionResult execute(@NotNull final VirtualFile file,
                                            @NotNull final Collection<String> activeProfiles,
                                            @NotNull final Collection<String> inactiveProfiles,
                                            @NotNull final List<String> goals,
                                            @NotNull final List<String> selectedProjects,
                                            final boolean alsoMake,
                                            final boolean alsoMakeDependents) throws MavenProcessCanceledException {
    return performCancelable(() -> getOrCreateWrappee()
      .execute(new File(file.getPath()), activeProfiles, inactiveProfiles, goals, selectedProjects, alsoMake, alsoMakeDependents, ourToken));
  }

  public void reset() {
    MavenServerEmbedder w = getWrappee();
    if (w == null) return;
    try {
      w.reset(ourToken);
    }
    catch (RemoteException e) {
      handleRemoteError(e);
    }
    resetCustomization();
  }

  public void release() {
    MavenServerEmbedder w = getWrappee();
    if (w == null) return;
    try {
      w.release(ourToken);
    }
    catch (RemoteException e) {
      handleRemoteError(e);
    }
    resetCustomization();
  }

  public void clearCaches() {
    MavenServerEmbedder w = getWrappee();
    if (w == null) return;
    try {
      w.clearCaches(ourToken);
    }
    catch (RemoteException e) {
      handleRemoteError(e);
    }
  }

  public void clearCachesFor(MavenId projectId) {
    MavenServerEmbedder w = getWrappee();
    if (w == null) return;
    try {
      w.clearCachesFor(projectId, ourToken);
    }
    catch (RemoteException e) {
      handleRemoteError(e);
    }
  }

  private synchronized void setCustomization(MavenConsole console,
                                             MavenProgressIndicator indicator,
                                             MavenWorkspaceMap workspaceMap,
                                             boolean failOnUnresolvedDependency,
                                             boolean alwaysUpdateSnapshot,
                                             @Nullable Properties userProperties) {
    resetCustomization();
    myCustomization = new Customization(wrapAndExport(console),
                                        wrapAndExport(indicator),
                                        workspaceMap,
                                        failOnUnresolvedDependency,
                                        alwaysUpdateSnapshot,
                                        userProperties);
  }

  private synchronized void resetCustomization() {
    if (myCustomization == null) return;

    try {
      UnicastRemoteObject.unexportObject(myCustomization.console, true);
    }
    catch (NoSuchObjectException e) {
      MavenLog.LOG.warn(e);
    }
    try {
      UnicastRemoteObject.unexportObject(myCustomization.indicator, true);
    }
    catch (NoSuchObjectException e) {
      MavenLog.LOG.warn(e);
    }

    myCustomization = null;
  }

  private static final class Customization {
    private final MavenServerConsole console;
    private final MavenServerProgressIndicator indicator;

    private final MavenWorkspaceMap workspaceMap;
    private final boolean failOnUnresolvedDependency;
    private final boolean alwaysUpdateSnapshot;
    private final Properties userProperties;

    private Customization(MavenServerConsole console,
                          MavenServerProgressIndicator indicator,
                          MavenWorkspaceMap workspaceMap,
                          boolean failOnUnresolvedDependency,
                          boolean alwaysUpdateSnapshot,
                          @Nullable Properties userProperties) {
      this.console = console;
      this.indicator = indicator;
      this.workspaceMap = workspaceMap;
      this.failOnUnresolvedDependency = failOnUnresolvedDependency;
      this.alwaysUpdateSnapshot = alwaysUpdateSnapshot;
      this.userProperties = userProperties;
    }
  }

  protected MavenServerConsole wrapAndExport(final MavenConsole console) {
    return doWrapAndExport(new RemoteMavenServerConsole(console));
  }

  private static class RemoteMavenServerConsole extends MavenRemoteObject implements MavenServerConsole {
    private final MavenConsole myConsole;

    RemoteMavenServerConsole(MavenConsole console) {
      myConsole = console;
    }

    @Override
    public void printMessage(int level, String message, Throwable throwable) {
      myConsole.printMessage(level, message, throwable);
    }
  }

}


text:
## ipfs-mini

A super tiny module for querying an IPFS node, that works in the browser and in Node. Only **2.76 kB** compressed!

This module was inspired by [`browser-ipfs`](https://github.com/pelle/browser-ipfs).

## Install

```
npm install --save ipfs-mini
```

## Usage

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.add('hello world!').then(console.log).catch(console.log);

// result null 'QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j'

ipfs.cat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
  console.log(err, result);
});

// result null 'hello world!'

ipfs.addJSON({ somevalue: 2, name: 'Nick' }, (err, result) => {
  console.log(err, result);
});

// result null 'QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j'

ipfs.catJSON('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j').then(console.log).catch(console.log);

// result null { somevalue: 2, name: 'Nick' }
```

## About

A very simple module for querying an IPFS node. This module works for both `nodejs` and in the browser. It's extremly light, `<3 kB` when compressed.

This module uses the `js-ipfs-api` module for the adding operations on nodejs. However, in the browser, it uses a very light `FormData` `Blob` handling proceedure which was designed by Pelle Braendgaard, in his `browser-ipfs` module.

## Examples

An example of the module in use for the browser, can be found in [./example](./examples).

Inside is a single, no configuration required, HTML file using the `ipfs-mini` module.

## Browser Usage

`ipfs-mini` is completely browserifiable and webpack ready. The main export found in our distributions [dist](./dist) folder is `IPFS`. There you will find two builds of `ipfs-mini`, one compressed and minified `ipfs-mini.min.js` and one uncompressed `ipfs-mini.js`.

```
<html>
  <body>
    <script type="text/javascript" src="ipfs-mini.min.js">
    <script type="text/javascript">
      var ipfs = new IPFS({ provider: 'ipfs.infura.io', protocol: 'https' });

      // ...
    </script>
  </body>
</html>
```

## Webpack Figures

**2.76 kB** compressed (not gzipped)

```
Hash: 55d261679ea2edac14af
Version: webpack 2.1.0-beta.15
Time: 612ms
        Asset     Size  Chunks             Chunk Names
    ipfs-mini.js  9.55 kB       0  [emitted]  main
ipfs-mini.js.map    11 kB       0  [emitted]  main
    + 3 hidden modules

Hash: 20584eb8548f596cd97d
Version: webpack 2.1.0-beta.15
Time: 737ms
        Asset     Size  Chunks             Chunk Names
ipfs-mini.min.js  2.76 kB       0  [emitted]  main
    + 3 hidden modules
```

## API Design

### constructor

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Intakes a single provider object, outputs an `ipfs` instance.

**Parameters**

-   `provider` **Object** a single provider object, see `setProvider` for more details

Result output `ipfs` **Object** instance.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.cat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
  console.log(err, result);
});
```

### setProvider

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Sets the IPFS instance provider.

**Parameters**

-   `provider` **Object** a single provider object.

    default: `{ host: 'localhost', port: 5001, protocol: 'http', base: '/api/v0' }`

No result output.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS();

ipfs.setProvider({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.cat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', cb);
```

### add

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Queries `/add` and adds a single String or Buffer data to IPFS, returns an IPFS hash.

**Parameters**

-   `input` **String|Buffer** the input data to be added to IPFS.

Result output `ipfsHash` **String**.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.add('hello world!', (err, result) => {
  console.log(err, result);
});

// result null 'QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j'
```

### addJSON

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Queries `/add` and adds stringified JSON to IPFS, returns a single ipfs hash.

**Parameters**

-   `input` **Object** the input data to be added to IPFS.

Result output `ipfsHash` **String**.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.addJSON({ somevalue: 2, name: 'Nick' }, (err, result) => {
  console.log(err, result);
});

// result null 'QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j'
```

### cat

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Queries a `/cat` request, returns data as a String.

**Parameters**

-   `ipfsHash` **String** the ipfs hash string.

Result output `data` **String**.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.cat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
  console.log(err, result);
});

// result null 'Hello world!'
```

### catJSON

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Queries a `/cat` request, returns data as a parsed JSON object.

**Parameters**

-   `ipfsHash` **String** the ipfs hash string.

Result output `data` **Object**.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.catJSON('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
  console.log(err, result);
});

// result null { somevalue: 2, name: 'Nick' ...}
```

### stat

[index.js:ipfs-mini](../../../blob/master/src/index.js "Source code on GitHub")

Queries a `/object/stat` request, returns data stats object.

**Parameters**

-   `ipfsHash` **String** the ipfs hash string.

Result output stats `data` **Object**.

```js
const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.stat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
  console.log(err, result);
});

/* result null {
  BlockSize: 14595
  CumulativeSize: 14595
  DataSize: 14592
  Hash: "QmbhrsdhbvQy3RyNiDdStgF4YRVc4arteS3wL5ES5M6cVd"
  LinksSize: 3
  NumLinks: 0
}
*/
```

## Contributing

Please help better the ecosystem by submitting issues and pull requests to default. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard and the unix philosophy.

## Help out

There is always a lot of work to do, and will have many rules to maintain. So please help out in any way that you can:

- Create, enhance, and debug silentcicero rules (see our guide to ["Working on rules"](./github/CONTRIBUTING.md)).
- Improve documentation.
- Chime in on any open issue or pull request.
- Open new issues about your ideas for making `ipfs-mini` better, and pull requests to show us how your idea works.
- Add new tests to *absolutely anything*.
- Create or contribute to ecosystem tools, like modules for encoding or contracts.
- Spread the word.

Please consult our [Code of Conduct](CODE_OF_CONDUCT.md) docs before helping out.

We communicate via [issues](https://github.com/silentcicero/ipfs-mini/issues) and [pull requests](https://github.com/silentcicero/ipfs-mini/pulls).

## Important documents

- [Changelog](CHANGELOG.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [License](https://raw.githubusercontent.com/silentcicero/ipfs-mini/master/LICENSE)

## Licence

This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.

```
The MIT License

Copyright (c) 2016 Nick Dodson. nickdodson.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```


text:
using System;
using System.Net;

namespace ServiceStack.ServiceHost
{
    public interface ICookies
    {
        void DeleteCookie(string cookieName);
        void AddCookie(Cookie cookie);
        void AddPermanentCookie(string cookieName, string cookieValue, bool? secureOnly = null);
        void AddSessionCookie(string cookieName, string cookieValue, bool? secureOnly = null);
    }
}


text:
<?php

namespace Titon\Db\Exception;

/**
 * Exception thrown when a predicate conjunction is already in use.
 *
 * @package Titon\Db\Exception
 */
class ExistingPredicateException extends \RuntimeException {

}


text:
$(function() {

	$('.confirm').mouseenter(function(){
		$('.confirm-text').addClass('tt-warning');
	}).mouseleave(function(){
		$('.confirm-text').removeClass('tt-warning');
	});

	var $progress = $('.progressbar');
	$('#goals').accordion();
	$progress.progressbar();

	$progress.each( function(){
		$(this).progressbar( 'option', 'value', $(this).data('progress'));
	});

	$('.chkbox-container').each( function(){
		 $(this).mouseenter(function() {
			 $(this).addClass('highlight');
		 }).mouseleave(function() {
			 $(this).removeClass('highlight');
		 });
		$(this).tooltip({
				placement: "right"
		});
	});

});

// As the coments box is modified send the values to the database
$(document).on('click', '.chkbox', TrainingTracker.checkboxToggle);

$(document).on('click', '.chkbox', TrainingTracker.recaculateProgress);


text:
import { PluginFunction } from "vue";

declare namespace VueScrollTo {
    interface Options {
        // The element you want to scroll to.
        el?: string;
        element?: string;
        // The container that has to be scrolled. Default: body
        container?: string;
        // The duration (in milliseconds) of the scrolling animation. Default: 500
        duration?: number;
        // The easing to be used when animating. Default: ease
        easing?: string;
        // The offset that should be applied when scrolling. Default: 0
        offset?: number;
        // Indicates if user can cancel the scroll or not. Default: true
        cancelable?: boolean;
        // A callback function that should be called when scrolling has ended. Default: noop
        onDone?: (() => void) | false;
        // A callback function that should be called when scrolling has been aborted by the user (user scrolled, clicked
        // etc.). Default: noop
        onCancel?: (() => void) | false;
        // Whether or not we want scrolling on the x axis. Default: true
        x?: boolean;
        // Whether or not we want scrolling on the y axis. Default: true
        y?: boolean;
    }
}

declare class VueScrollTo {
    static install: PluginFunction<never>;

    scrollTo(element: string | HTMLElement, options?: VueScrollTo.Options): void;
}

declare module "vue/types/vue" {
    interface Vue {
        $scrollTo: typeof VueScrollTo.prototype.scrollTo;
    }
}

export = VueScrollTo;