text:
package io.bootique.test.junit4and5;

import io.bootique.test.junit.BQTestFactory;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class JUnit4IT {

    @Rule
    public final BQTestFactory testFactory = new BQTestFactory();

    @Test
    public void test() {
        assertTrue(testFactory.app("-h").run().isSuccess());
    }
}

redpajama_set_name: RedPajamaGithub


text:
from distutils.core import setup

_install_requires = ["Django==1.5.0", "django-gubbins==1.1.2"]

setup(name="prospector-test-2", version="0.0.1", install_requires=_install_requires)


text:
package commands.control;

import commands.basic.CommandList;
import model.TurtleState;

/**
 * The Class If.
 */
public class If extends CommandList{

	@Override
	public double doCommand(TurtleState turtleState) {
		double condition = (Double) getInputs().get(0).doCommand(turtleState);
		double result = -1;
		if(condition!=0){
			for(int i=1; i<getNumInputs(); i++){
				result = getInputs().get(i).doCommand(turtleState);
			}
		}
		return result;
	}
}


text:
/*
 * Do not modify this file. This file is generated from the ec2-2015-04-15.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.EC2.Model
{
    /// <summary>
    ///
    /// </summary>
    public partial class RegisterImageResponse : AmazonWebServiceResponse
    {
        private string _imageId;

        /// <summary>
        /// Gets and sets the property ImageId.
        /// <para>
        /// The ID of the newly registered AMI.
        /// </para>
        /// </summary>
        public string ImageId
        {
            get { return this._imageId; }
            set { this._imageId = value; }
        }

        // Check to see if ImageId property is set
        internal bool IsSetImageId()
        {
            return this._imageId != null;
        }

    }
}


text:
package com.cloud.storage;

import java.util.Map;

import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType;

public class TemplateProfile {
	Long userId;
	String name;
	String displayText;
	Integer bits;
	Boolean passwordEnabled;
	Boolean sshKeyEnbaled;
	Boolean requiresHvm;
	String url;
	Boolean isPublic;
	Boolean featured;
	Boolean isExtractable;
	ImageFormat format;
	Long guestOsId;
	Long zoneId;
	HypervisorType hypervisorType;
	String accountName;
	Long domainId;
	Long accountId;
	String chksum;
	Boolean bootable;
	Long templateId;
	VMTemplateVO template;
	String templateTag;
	Map details;
    Boolean isDynamicallyScalable;
    TemplateType templateType;

	public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits, Boolean passwordEnabled, Boolean requiresHvm,
			String url, Boolean isPublic, Boolean featured, Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId,
			HypervisorType hypervisorType, String accountName, Long domainId, Long accountId, String chksum, Boolean bootable, Map details, Boolean sshKeyEnabled) {
		this.templateId = templateId;
		this.userId = userId;
		this.name = name;
		this.displayText = displayText;
		this.bits = bits;
		this.passwordEnabled = passwordEnabled;
		this.requiresHvm = requiresHvm;
		this.url = url;
		this.isPublic = isPublic;
		this.featured = featured;
		this.isExtractable = isExtractable;
		this.format = format;
		this.guestOsId = guestOsId;
		this.zoneId = zoneId;
		this.hypervisorType = hypervisorType;
		this.accountName = accountName;
		this.domainId = domainId;
		this.accountId = accountId;
		this.chksum = chksum;
		this.bootable = bootable;
		this.details = details;
		this.sshKeyEnbaled = sshKeyEnabled;
	}

	public TemplateProfile(Long userId, VMTemplateVO template, Long zoneId) {
		this.userId = userId;
		this.template = template;
		this.zoneId = zoneId;
	}

    public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits, Boolean passwordEnabled, Boolean requiresHvm,
            String url, Boolean isPublic, Boolean featured, Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId,

            HypervisorType hypervisorType, String accountName, Long domainId, Long accountId, String chksum, Boolean bootable, String templateTag, Map details, Boolean sshKeyEnabled,
            Long imageStoreId, Boolean isDynamicallyScalable, TemplateType templateType) {
        this(templateId, userId, name, displayText, bits, passwordEnabled, requiresHvm, url, isPublic, featured, isExtractable, format, guestOsId, zoneId,
                hypervisorType, accountName, domainId, accountId, chksum, bootable, details, sshKeyEnabled);
        this.templateTag = templateTag;
        this.isDynamicallyScalable = isDynamicallyScalable;
        this.templateType = templateType;
    }

	public Long getTemplateId() {
		return templateId;
	}
	public void setTemplateId(Long id) {
		this.templateId = id;
	}

	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getDisplayText() {
		return displayText;
	}
	public void setDisplayText(String text) {
		this.displayText = text;
	}

	public Integer getBits() {
		return bits;
	}
	public void setBits(Integer bits) {
		this.bits = bits;
	}

	public Boolean getPasswordEnabled() {
		return passwordEnabled;
	}
	public void setPasswordEnabled(Boolean enabled) {
		this.passwordEnabled = enabled;
	}

	public Boolean getRequiresHVM() {
		return requiresHvm;
	}
	public void setRequiresHVM(Boolean hvm) {
		this.requiresHvm = hvm;
	}

	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}

	public Boolean getIsPublic() {
		return isPublic;
	}
	public void setIsPublic(Boolean is) {
		this.isPublic = is;
	}

	public Boolean getFeatured() {
		return featured;
	}
	public void setFeatured(Boolean featured) {
		this.featured = featured;
	}

	public Boolean getIsExtractable() {
		return isExtractable;
	}
	public void setIsExtractable(Boolean is) {
		this.isExtractable = is;
	}

	public ImageFormat getFormat() {
		return format;
	}
	public void setFormat(ImageFormat format) {
		this.format = format;
	}

	public Long getGuestOsId() {
		return guestOsId;
	}
	public void setGuestOsId(Long id) {
		this.guestOsId = id;
	}

	public Long getZoneId() {
		return zoneId;
	}
	public void setZoneId(Long id) {
		this.zoneId = id;
	}

	public HypervisorType getHypervisorType() {
		return hypervisorType;
	}
	public void setHypervisorType(HypervisorType type) {
		this.hypervisorType = type;
	}

	public Long getDomainId() {
		return domainId;
	}
	public void setDomainId(Long id) {
		this.domainId = id;
	}

	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long id) {
		this.accountId = id;
	}

	public String getCheckSum() {
		return chksum;
	}
	public void setCheckSum(String chksum) {
		this.chksum = chksum;
	}

	public Boolean getBootable() {
		return this.bootable;
	}
	public void setBootable(Boolean bootable) {
		this.bootable = bootable;
	}

	public VMTemplateVO getTemplate() {
		return template;
	}
	public void setTemplate(VMTemplateVO template) {
		this.template = template;
	}

    public String getTemplateTag() {
        return templateTag;
    }

    public void setTemplateTag(String templateTag) {
        this.templateTag = templateTag;
    }

    public Map getDetails() {
    	return this.details;
    }

    public void setDetails(Map details) {
    	this.details = details;
    }

    public void setSshKeyEnabled(Boolean enabled) {
    	this.sshKeyEnbaled = enabled;
    }

    public Boolean getSshKeyEnabled() {
    	return this.sshKeyEnbaled;
    }

    public Boolean IsDynamicallyScalable() {
        return this.isDynamicallyScalable;
    }

    public void setScalabe(Boolean isDynamicallyScalabe) {
        this.isDynamicallyScalable = isDynamicallyScalabe;
    }

    public TemplateType getTemplateType() {
        return templateType;
    }

    public void setTemplateType(TemplateType templateType) {
        this.templateType = templateType;
    }
}


text:
title: Node.js Meetups
layout: contribute.hbs
---

# Node.js Meetups

This is a list of Node.js meetups. Please submit a PR if you'd like to add your local group!

## Code of Conduct

If any meetup does not have a CoC and/or is reported as an unsafe place, it will be removed from this list.

## Notes for adding meetups

FORMAT
- [Meetup](https://www.meetup.com/pdxnode/)
- Frequency of meetups
- How to submit a talk? <<list here>>
- Organizer names (if you wish to provide)
- Organizers contact info (if you wish to provide)

REQUIREMENTS
- Please state in your PR if this meetup abides by CoC.
- Link to CoC for verification.
- If you do not currently have a CoC, update the meetup with CoC before submitting.
- Submit your PR in alphabetical order.

## Meetups

### Africa
- [Meetup](https://www.nodejs.africa)
- Frequency of meetups - bi-monthly
- How to submit a talk? [Submit to this form](https://docs.google.com/forms/d/e/1FAIpQLSe3vPkiO8ijtbP7fUhEotKefXU-fWUoDGtUSo1khmtA_7v1WQ/viewform)
- Organizer name - Agiri Abraham
- Organizer contact info -

### Argentina

#### Buenos Aires Province

##### Buenos Aires

- [Meetup](https://www.meetup.com/banodejs/)
- Frequency of meetups - monthly
- How to submit a talk? Write a message in the meetup page
- Organizer name - Alejandro Oviedo
- Organizer contact info -

### Australia

#### Victoria

##### Melbourne

- [Meetup](https://www.meetup.com/NodeMelbourne/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Andrey Sidorov
- Organizer contact info -

##### Sydney

- [Meetup](https://www.meetup.com/node-sydney/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - James Richardson. Co-organizer: Jessica Claire
- Organizer contact info -

### Belgium

#### Brussels

##### Brussels

- [Meetup](https://www.meetup.com/Belgian-node-js-User-Group/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Steven Beeckman
- Organizer contact info -

### Brazil

#### São Paulo

- [Meetup](https://meetup.com/nodebr)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer names - [Erick Wendel](https://github.com/erickwendel), [Alan Hoffmeister](https://github.com/alanhoff), [Igor França](https://github.com/horaddrim), [Icaro Caldeira](https://github.com/icarcal), [Marcus Bergamo](https://github.com/thebergamo), [Igor Halfeld](https://github.com/igorHalfeld).
- Organizer contact info - [@erickwendel_](https://twitter.com/erickwendel_)

##### Campinas

- [Meetup](https://www.meetup.com/Nodeschool-Campinas/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Filipe Oliveira
- Organizer contact info -

#### Chile

- [Meetup](https://www.meetup.com/es-ES/NodersJS/)
- Frequency of meetups - monthly
- How to submit a talk? Issue on Github [here](https://github.com/Noders/Meetups/issues/new)
- Organizer name - Rodrigo Adones and Ender Bonnet
- Organizer contact info - [Rodrigo](https://github.com/L0rdKras), [Ender](https://twitter.com/enbonnet)

#### Minas Gerais

- [Meetup](https://www.meetup.com/nodebr/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Hugo Iuri
- Organizer contact info -

#### Rio Grande do Sul

##### Porto Alegre

- [Meetup](https://www.meetup.com/Node-js-Porto-Alegre-Meetup/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Henrique Schreiner
- Organizer contact info -

### Canada

#### British Columbia

##### Vancouver

- [Meetup](https://www.meetup.com/Node-JS-Community-Hangouts)
- Frequency of meetups - quarterly
- How to submit a talk? DM @keywordnew on twitter
- Organizer name - Manil Chowdhury
- Organizer contact info -

#### Ontario

##### Toronto

- [Toronto JS Meetup](http://torontojs.com/)
- Frequency of meetups - weekly
- How to submit a talk? _Contact Organizers through Slack: http://slack.torontojs.com/_
- Organizers name - Dann T. & Paul D.
- Organizer contact info - _Community Slack_

### Colombia

#### Antioquia

##### Medellín

- [Meetup](https://www.meetup.com/node_co/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Camilo Montoya
- Organizer contact info -

### Finland

#### Uusimaa

##### Helsinski

- [Meetup](https://www.meetup.com/Helsinki-Node-js/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page
- Organizer name - Juha Lehtomaki
- Organizer contact info -

### France

#### Île-de-France

##### Paris

- [Meetup](https://www.meetup.com/Nodejs-Paris/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page or submit your talk on [nodejs.paris wbesite](http://nodejs.paris/meetups)
- Organizer name - [Etienne Folio](https://twitter.com/Ornthalas), [Stanislas Ormières](https://twitter.com/laruiss), [Nicolas KOKLA](https://twitter.com/nkokla), Quentin Raynaud
- Organizer contact info -

### Germany

#### Bavaria

##### Passau

- [Meetup](https://www.meetup.com/de-DE/Nodeschool-Passau/)
- Frequency of meetups - quarterly
- How to submit a talk? Email [Valentin](mailto:valentin.huber@msg.group)
- Organizer name - Valentin Huber
- Organizer contact info - [Email](mailto:valentin.huber@msg.group)

##### Hamburg

- [Meetup](https://www.meetup.com/node-HH/)
- Frequency of meetups - monthly and on demand
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Gregor Elke, Oliver Lorenz
- Organizer contact info - via Meetup, via [Slack](http://bit.ly/web-hh)

### Greece

##### Athens

- [Meetup](https://www.meetup.com/nodejsathens/)
- Frequency of meetups - every two months
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - [Ioannis Nikolaou](https://www.linkedin.com/in/ioannis-nikolaou/) Co-organizers - Stratoula Kalafateli, [Kostas Siabanis](https://github.com/ksiabani), Megaklis Vasilakis
- Organizer contact info -

### Hungary

##### Budapest

- [Meetup](https://www.meetup.com/nodebp/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Oroszi Róbert
- Organizer contact info -

### India

##### Delhi

- [Meetup](https://www.meetup.com/nodeJS-Devs/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Gaurav Gandhi.
- Organizer contact info -

#### Gujarat

##### Ahmedabad

- [Meetup](https://www.meetup.com/meetup-group-iAIoTVuS/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page or write to dipesh@rapidops.com
- Organizer name - Dipesh Patel
- Organizer contact info -

### Indonesia

##### Jakarta

- [Meetup](https://www.meetup.com/Node-js-Workshop/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Lukluk Luhuring Santoso
- Organizer contact info -

### Ireland

##### Dublin

- [Meetup](https://www.meetup.com/Dublin-Node-js-Meetup/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Sean Walsh. Co-organizer: Leanne Vaughey
- Organizer contact info -

- [Meetup](https://www.meetup.com/Nodeschool-Dublin-Meetup/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Anton Whalley
- Organizer contact info -

### Israel

##### Tel Aviv

- [Meetup](https://www.meetup.com/NodeJS-Israel/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page or submit your talk on [Node.js-IL website](http://www.nodejsil.com/).
- Organizer name - [Idan Dagan](https://github.com/idandagan1), [Guy Segev](https://github.com/guyguyon), [Tomer Omri](https://github.com/TomerOmri)
- Organizer contact info - [Email](mailto:nodejsisrael8@gmail.com
)

### Mexico

##### Mexico City

- [Meetup](https://www.meetup.com/NodeBotsMX/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Saúl Buentello
- Organizer contact info -

### New Zealand

##### Auckland

- [Meetup](https://www.meetup.com/AucklandNodeJs/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - George Czabania
- Organizer contact info -

### South Africa

##### Cape Town

- [Meetup](https://www.meetup.com/nodecpt/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Guy Bedford
- Organizer contact info -

### Spain

##### Madrid

- [Meetup](https://www.meetup.com/Node-js-Madrid/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Alex Fernández
- Organizer contact info -

### Thailand

##### Bangkok

- [Meetup](https://www.meetup.com/Bangkok-Node-js/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Dylan Jay
- Organizer contact info -

### Turkey

##### Istanbul

- [Meetup](https://www.meetup.com/nodeschool-istanbul/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Arif Çakıroğlu
- Organizer contact info -

### United States

#### Arizona

##### Mesa

- [Meetup](https://www.meetup.com/NodeAZ/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Chris Matthieu
- Organizer contact info -

#### California

##### Los Angeles

- [js.la](https://js.la)
- Frequency of meetups - monthly
- How to submit a talk? [contribute.js.la](https://contribute.js.la)
- Organizer name - David Guttman
- Organizer contact info - @dguttman on [slack.js.la](https://slack.js.la)

##### Irvine

- [Meetup](https://www.meetup.com/Node-JS-OC/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Farsheed Atef
- Organizer contact info -

##### San Francisco

- [Meetup](https://www.meetup.com/sfnode/)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Dan Shaw
- Organizer contact info -

- [Meetup](https://www.meetup.com/Node-js-Serverside-Javascripters-Club-SF/)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Matt Pardee
- Organizer contact info -

#### Colorado

##### Denver

- [Meetup](https://www.meetup.com/Node-js-Denver-Boulder/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page
- Organizer name - Brooks Patton
- Organizer contact info -

#### Florida

##### Jacksonville

- [Meetup](https://www.meetup.com/Jax-Node-js-UG/)
- [Website](https://www.jaxnode.com)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - David Fekke
- Organizer contact info - David Fekke at gmail dot com

#### Georgia

##### Atlanta

- [Meetup](https://www.meetup.com/Atlanta-Nodejs-Developers/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Ryan Connelly
- Organizer contact info -

#### Illinois

##### Chicago

- [Meetup](https://www.meetup.com/Chicago-Nodejs/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page or (https://airtable.com/shrTDwmMH3zsnsWOE)
- Organizer name - Mike Hostetler, Zeke Nierenberg, & Ben Neiswander
- Organizer contact info -

#### Indiana

##### Indianapolis

- [Meetup](https://www.meetup.com/Node-indy/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Mike Seidle
- Organizer contact info -

#### Massachusetts

##### Boston

- [Meetup](https://www.meetup.com/Boston-Node/)
- Frequency of meetups - ~monthly
- How to submit a talk? Contact organizers in the meetup page or post in slack workspace #\_node\_meetup (see below).
- Organizer name - [Brian Sodano](https://github.com/codemouse)
- Organizer contact info - [briansodano@gmail.com](mailto:briansodano@gmail.com) or [Boston JS slack workspace](https://bostonjavascript.slack.com)

#### Michigan

##### Detroit

- [Meetup](https://www.meetup.com/DetNode/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Steve Marsh, Norman Witte and Israel V

#### Minnesota

##### Minneapolis

- [Meetup](https://www.meetup.com/NodeMN/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Mike Frey
- Organizer contact info -

#### New York

##### New York

- [Meetup](https://www.meetup.com/nodejs/)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Patrick Scott Co-organizer: Matt Walters.
- Organizer contact info -

#### North Carolina

##### Raleigh Durham

- [Meetup](https://www.meetup.com/triangle-nodejs/)
- Frequency of meetups - quarterly
- How to submit a talk? Email ladyleet@nodejs.org
- Organizer name - Tracy Lee
- Organizer contact info - ladyleet@nodejs.org

#### Oregon

##### Portland

- [Meetup](http://pdxnode.org/)
- Frequency of meetups - Biweekly (presentation night 2nd Thursdays, hack night last Thursdays)
- How to submit a talk? [Submit a talk proposal](https://github.com/PDXNode/pdxnode/issues/new), or DM [@obensource](https://twitter.com/obensource) or [@MichelleJLevine](https://twitter.com/MichelleJLevine) on twitter
- Organizer names - Ben Michel, Michelle Levine
- Organizer contact info - Ben: benpmichel@gmail.com, Michelle: michelle@michellejl.com

#### Pennsylvania

##### Philadelphia

- [Meetup](https://www.meetup.com/nodejs-philly/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page: https://www.meetup.com/nodejs-philly/members/14283814/
- Organizer name - Leomar Durán
- Organizer contact info -

#### Texas

##### Austin

- [Meetup](https://www.meetup.com/ATXNodeSchool/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Stefan von Ellenrieder
- Organizer contact info -

- [Meetup](https://www.meetup.com/austinnodejs/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Matt Walters
- Organizer contact info -

##### Dallas

- [Meetup](https://www.meetup.com/DallasNode/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - [Cameron Steele](https://github.com/ATechAdventurer)
- Organizer contact info - [Cam.steeleis@gmail.com](mailto:Cam.steeleis@gmail.com)

#### Utah

##### Salt Lake City

- [Meetup](https://www.meetup.com/utahnodejs/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page.
- Organizer name - Aaron Seth Madsen
- Organizer contact info -

#### Washington

##### Seattle

- [Meetup](https://www.meetup.com/Seattle-Node-js/)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Ryan Roemer
- Organizer contact info -

- [Meetup](https://www.meetup.com/Seattle-NodeSchool/)
- Frequency of meetups - monthly
- How to submit a talk? Contact organizers in the meetup page
- Organizer name - Wil Alvarez
- Organizer contact info -

#### Washington, DC.

- [Meetup](https://www.meetup.com/node-dc/)
- Frequency of meetups - monthly
- How to submit a talk? Write to Andrew Dunkman adunkman@gmail.com
- Organizer name - Andrew Dunkman
- Organizer contact info -

### UK

##### London
###### LNUG
- [Meetup](https://www.meetup.com/london-nodejs/)
- [GitHub/lnug](https://github.com/lnug/)
- Frequency of meetups - monthly
- How to submit a talk? Visit our [speakers repos](https://github.com/lnug/speakers), read the guidelines, and [submit a talk proposal as a new issue](https://github.com/lnug/speakers/issues).
- Organizer name - Adam Davis
- Organizer contact info - contact@lnug.org, [@lnugOrg](https://twitter.com/lnugorg)

###### Node Workshops
- [Meetup](https://www.meetup.com/NodeWorkshops//)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Daryn Holmes
- Organizer contact info -

##### Cambridge

- [Meetup](https://www.meetup.com/JavaScript-Cambridge/)
- Frequency of meetups - monthly
- How to submit a talk?
- Organizer name - Joe Parry, co-organizer Rob Moran
- Organizer contact info -

##### Oxford

- [JSOxford](https://www.meetup.com/jsoxford/)
- Frequency of meetups - every 2 months
- How to submit a talk? [Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSflx7LU44PuwlyCJj-WwlP_SlrUvxAd8uaXlY7_O65c7RLpGQ/viewform?usp=sf_link)
- Organizer names - Marcus Noble, Seren Davies
- Organizers contact info - organisers@jsoxford.com

### Ukraine

##### Kiev

- [Meetup](https://www.meetup.com/NodeUA/), [Old group](https://www.meetup.com/KievNodeJS/)
- Frequency of meetups - 1-8 times a month
- How to submit a talk? Contact organizer by email.
- Organizer name - Timur Shemsedinov
- Organizer contact info - [Email](mailto:timur.shemsedinov@gmail.com)


text:
Services

				Posted on

				by

    	No Services yet, why don't you create one?


text:
using System;

public static class Program {
    public static void Main (string[] args) {
        (new A()).Method(1);
    }
}

public class A {
    public void Method (int @this) {
        Console.WriteLine("this={0}, @this={1}", this, @this);
    }
}


text:
package message;

import protocol.ACKType;

import java.util.List;
import java.util.Objects;

/**
 * Created by tanjingru on 3/23/16.
 */
public class ACK {

    ACKType type;
    ChatContent chatContent;
    LoginContent loginContent;
    GroupContent groupContent;
    List<ChatContent> missingChatContents;
    List<String> accounts;
    String groupId;

    public ACK(ACKType type) {
        this.type = type;
    }

    public ACK(ChatContent chatContent, ACKType type) {
        this.chatContent = chatContent;
        this.type = type;
    }

    public ACK() {
    }

    public GroupContent getGroupContent() {
        return groupContent;
    }

    public void setGroupContent(GroupContent groupContent) {
        this.groupContent = groupContent;
    }

    public ChatContent getChatContent() {
        return chatContent;
    }

    public void setChatContent(ChatContent chatContent) {
        this.chatContent = chatContent;
    }

    public LoginContent getLoginContent() {
        return loginContent;
    }

    public void setLoginContent(LoginContent loginContent) {
        this.loginContent = loginContent;
    }

    public ACKType getType() {
        return type;
    }

    public void setType(ACKType type) {
        this.type = type;
    }

    public List<ChatContent> getMissingChatContents() {
        return missingChatContents;
    }

    public void setMissingChatContents(List<ChatContent> missingChatContents) {
        this.missingChatContents = missingChatContents;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public List<String> getAccounts() {
        return accounts;
    }

    public void setAccounts(List<String> sameGroupOnlineAccounts) {
        this.accounts = sameGroupOnlineAccounts;
    }

}


text:
namespace paddle {
namespace imperative {

void Engine::RunOp(paddle::imperative::OpBase* op,
                   const paddle::imperative::NameVarBaseMap& ins,
                   const paddle::imperative::NameVarBaseMap& outs,
                   const paddle::platform::Place& place) {
  platform::RecordEvent event(op->Type());

  op->Run(ins, outs);
}

void BasicEngine::Init(VarBase* var, const detail::BackwardStrategy& strategy) {
  backward_strategy_ = strategy;
  const std::vector<OpBase*> ops = var->GradVarBase()->GradOps();
  var->ClearGradOps();

  if (ops.empty() || var->OverridedStopGradient()) {
    VLOG(3) << "Skip auto grad since there is no grad op for var or loss is "
               "stop_gradient=True: "
            << var->Name();
    return;
  } else {
    bool valid = false;
    for (const auto& op : ops) {
      if (op) {
        valid = true;
      }
    }
    if (!valid) {
      VLOG(3) << "Skip auto grad since all grad op of start VarBase is nullptr";
      return;
    }
  }
  init_ops_ = ops;
  platform::RecordEvent record_event("Imperative Backward");
  VLOG(3) << "start backward";

  PADDLE_ENFORCE_EQ(var->HasGradVar(), true,
                    "Grad variable not exist for variable %s", var->Name());

  auto& fwd_var = var->Var().Get<framework::LoDTensor>();
  auto* grad_var =
      var->GradVarBase()->MutableVar()->GetMutable<framework::LoDTensor>();
  VLOG(6) << "init loss grad:" << var->GradVarBase()->Name()
          << " as stop_gradient false";
  var->GradVarBase()->InnerSetOverridedStopGradient(false);
  var->GradVarBase()->SetGradGenerated(true);
  auto* dev_ctx = platform::DeviceContextPool::Instance().Get(fwd_var.place());
  grad_var->Resize(fwd_var.dims());
  grad_var->mutable_data(fwd_var.place(), fwd_var.type());
  operators::math::set_constant(*dev_ctx, grad_var, 1.0);
}

void BasicEngine::CheckBackwardInputs(OpBase* op) {
  for (auto& pair : op->GetInsMap()) {
    for (auto& var : pair.second) {
      if (var && IsGrad(var.get())) {
        // if grad var has OverridedStopGradient skip this Op
        if (!var->GradGenerated()) {
          VLOG(6) << "Set ungenerated Grad: " << var->Name() << " as zero";
          auto* dev_ctx =
              platform::DeviceContextPool::Instance().Get(op->place());
          auto* tensor = var->MutableVar()->GetMutable<framework::LoDTensor>();
          tensor->mutable_data(op->place(), var->DataType());
          operators::math::set_constant(*dev_ctx, tensor, 0.0);
        } else {
          continue;
        }
      }
    }
  }
}

void BasicEngine::SetBackwardOutputs(paddle::imperative::OpBase* op) {
  for (auto& pair : op->GetOutsMap()) {
    for (auto& var : pair.second) {
      if (var) {
        // Set Backward outputs's generate_grad as true
        var->SetGradGenerated(true);
        VLOG(6) << "Set backward output: " << var->Name()
                << "'s SetGeneratedGrad as True";
      }
    }
  }
}
void BasicEngine::PrepareGradAccumulators(OpBase* op) {
  for (const auto& pair : op->GetOutsMap()) {
    for (const auto& var : pair.second) {
      if (!var) continue;

      auto& accumulator = accumulators_[var.get()];
      if (!accumulator) {
        if (backward_strategy_.sorted_sum_gradient_) {
          accumulator.reset(new SortedGradientAccumulator(var.get()));
        } else {
          accumulator.reset(new EagerGradientAccumulator(var.get()));
        }
      }

      accumulator->IncreaseRefCnt();

      VLOG(3) << "Prepare to acccumulate variable grad " << var->Name()
              << "with reference count " << accumulator->RefCnt();
    }
  }
}

void BasicEngine::PrepareDeps() {
  PADDLE_ENFORCE_EQ(op_deps_.empty(), true, "Op deps must be initialized here");
  PADDLE_ENFORCE_EQ(accumulators_.empty(), true,
                    "Accumulators must be initialized here");

  std::queue<OpBase*> q;
  std::unordered_set<OpBase*> visited;
  for (const auto& init_op : init_ops_) {
    q.push(init_op);
    visited.insert(init_op);
  }

  while (!q.empty()) {
    auto* cur_op = q.front();
    q.pop();
    VLOG(3) << "Checking grads of op " << cur_op->Type();

    CheckBackwardInputs(cur_op);

    SetBackwardOutputs(cur_op);

    PrepareGradAccumulators(cur_op);

    auto& grad_pending_ops = cur_op->GradPendingOps();
    for (auto* grad_pending_op : grad_pending_ops) {
      PADDLE_ENFORCE_NOT_NULL(grad_pending_op);
      ++op_deps_[grad_pending_op];
      if (visited.count(grad_pending_op) == 0) {
        visited.insert(grad_pending_op);
        q.push(grad_pending_op);
      }
    }
  }
}

void BasicEngine::SumGradient(OpBase* op, std::shared_ptr<VarBase> src,
                              VarBase* dst) {
  auto iter = accumulators_.find(dst);
  PADDLE_ENFORCE_EQ(iter != accumulators_.end(), true,
                    "Cannot find gradient of variable %s", dst->Name());
  iter->second->Add(std::move(src), op->id());
}
void BasicEngine::Execute() {
  PrepareDeps();
  // Start execute Computation graph
  std::queue<OpBase*> q;
  for (const auto& init_op : init_ops_) {
    q.push(init_op);
  }
  while (!q.empty()) {
    OpBase* cur_op = q.front();
    q.pop();

    // Step 1: Run Backward
    auto& bwd_ins = cur_op->GetInsMap();
    auto& bwd_outs = cur_op->GetOutsMap();

    NameVarBaseMap tmp_outs;
    // A var may be coresponding to several grad var in one op
    std::unordered_map<VarBase*, std::vector<std::shared_ptr<VarBase>>> var_map;
    size_t counter = 0;
    for (auto& bwd_out : bwd_outs) {
      auto& tmp_var_list = tmp_outs[bwd_out.first];
      tmp_var_list.reserve(bwd_out.second.size());
      for (auto& var : bwd_out.second) {
        auto tmp_var = std::make_shared<VarBase>(
            false, "Gtmp@" + std::to_string(counter++));  // Do not need grad
        tmp_var_list.emplace_back(tmp_var);
        if (var) {
          var_map[var.get()].emplace_back(std::move(tmp_var));
          var->ClearGradOps();
        }
      }
    }

    VLOG(3) << "Start to execute grad op " << cur_op->Type();
    RunOp(cur_op, bwd_ins, tmp_outs, cur_op->place());
    // Step 2: Sum Gradient
    {
      platform::RecordEvent record_event("merge_grads");
      for (auto& var_pair : var_map) {
        auto* dst_var = var_pair.first;
        if (dst_var == nullptr) continue;
        for (auto& src_var : var_pair.second) {
          VLOG(3) << "Sum gradient of variable " << dst_var->Name()
                  << " after op " << cur_op->Type();
          SumGradient(cur_op, std::move(src_var), dst_var);
        }
      }
    }

    // Step 3: Collect ready ops
    for (auto* grad_pending_op : cur_op->GradPendingOps()) {
      PADDLE_ENFORCE_NOT_NULL(grad_pending_op);
      auto iter = op_deps_.find(grad_pending_op);
      if (iter == op_deps_.end()) {
        continue;
      }

      VLOG(3) << "Found grad_pending op of " << cur_op->Type();
      // An Op is ready to go while its deps comes to zero

      if (--(iter->second) == 0) {
        q.push(grad_pending_op);
        VLOG(3) << "Push grad_pending op " << grad_pending_op->Type()
                << " into queue";
      }
    }

    // Step 4: Delete op to collect unused variables
    VLOG(3) << "Remove op after op " << cur_op->Type() << " runs";
    RemoveOp(cur_op);
  }
  VLOG(3) << "Clean properties of BasicEngine";
  CleanEngine();
}
}  // namespace imperative
}  // namespace paddle


text:
class Foo {
  constructor() {
    _bar.set(this, {
      writable: true,
      value: "bar"
    });
  }

  static test() {
    return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _foo);
  }

  test() {
    return babelHelpers.classPrivateFieldGet(this, _bar);
  }

}

var _bar = new WeakMap();

var _foo = {
  writable: true,
  value: "foo"
};


text:
//  * **************************************************************************
//  * Copyright (c) McCreary, Veselka, Bragg & Allen, P.C.
//  * This source code is subject to terms and conditions of the MIT License.
//  * A copy of the license can be found in the License.txt file
//  * at the root of this distribution.
//  * By using this source code in any fashion, you are agreeing to be bound by
//  * the terms of the MIT License.
//  * You must not remove this notice from this software.
//  * **************************************************************************

using System.Collections.Generic;

namespace FluentWebControls
{
	public class HtmlList
	{
		public static ListData<TReturn> For<TReturn>(IEnumerable<TReturn> list)
		{
			return new ListData<TReturn>(list);
		}
	}
}


text:
""" Testing suite for the PyTorch ViLT model. """

import unittest

from datasets import load_dataset
from packaging import version

from transformers import ViltConfig, is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask

if is_torch_available():
    import torch

    from transformers import (
        MODEL_MAPPING,
        ViltForImageAndTextRetrieval,
        ViltForImagesAndTextClassification,
        ViltForMaskedLM,
        ViltForQuestionAnswering,
        ViltForTokenClassification,
        ViltModel,
    )
    from transformers.models.vilt.modeling_vilt import VILT_PRETRAINED_MODEL_ARCHIVE_LIST
    from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_10
else:
    is_torch_greater_or_equal_than_1_10 = False

if is_vision_available():
    import PIL
    from PIL import Image

    from transformers import ViltProcessor

class ViltModelTester:
    def __init__(
        self,
        parent,
        batch_size=13,
        seq_length=7,
        image_size=30,
        patch_size=2,
        num_channels=3,
        is_training=True,
        use_input_mask=True,
        use_token_type_ids=True,
        use_labels=True,
        vocab_size=99,
        hidden_size=32,
        num_hidden_layers=5,
        num_attention_heads=4,
        intermediate_size=37,
        hidden_act="gelu",
        hidden_dropout_prob=0.1,
        attention_probs_dropout_prob=0.1,
        max_position_embeddings=512,
        type_vocab_size=16,
        type_sequence_label_size=2,
        initializer_range=0.02,
        num_labels=3,
        scope=None,
        modality_type_vocab_size=2,
        add_multiple_images=False,
        num_images=-1,
    ):
        self.parent = parent
        self.batch_size = batch_size
        self.seq_length = seq_length
        self.image_size = image_size
        self.patch_size = patch_size
        self.num_channels = num_channels
        self.is_training = is_training
        self.use_input_mask = use_input_mask
        self.use_token_type_ids = use_token_type_ids
        self.use_labels = use_labels
        self.vocab_size = vocab_size
        self.hidden_size = hidden_size
        self.num_hidden_layers = num_hidden_layers
        self.num_attention_heads = num_attention_heads
        self.intermediate_size = intermediate_size
        self.hidden_act = hidden_act
        self.hidden_dropout_prob = hidden_dropout_prob
        self.attention_probs_dropout_prob = attention_probs_dropout_prob
        self.max_position_embeddings = max_position_embeddings
        self.type_vocab_size = type_vocab_size
        self.type_sequence_label_size = type_sequence_label_size
        self.initializer_range = initializer_range
        self.num_labels = num_labels
        self.scope = scope
        self.modality_type_vocab_size = modality_type_vocab_size
        self.add_multiple_images = add_multiple_images
        self.num_images = num_images
        # we set the expected sequence length (which is used in several tests)
        # this is equal to the seq length of the text tokens + number of image patches + 1 for the CLS token
        self.expected_seq_len = self.seq_length + (self.image_size // self.patch_size) ** 2 + 1

    def prepare_config_and_inputs(self):
        input_ids = ids_tensor([self.batch_size, self.seq_length], self.vocab_size)
        if self.add_multiple_images:
            pixel_values = floats_tensor([self.batch_size, 2, self.num_channels, self.image_size, self.image_size])
        else:
            pixel_values = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

        input_mask = None
        if self.use_input_mask:
            input_mask = random_attention_mask([self.batch_size, self.seq_length])

        token_type_ids = None
        if self.use_token_type_ids:
            token_type_ids = ids_tensor([self.batch_size, self.seq_length], self.type_vocab_size)

        if self.use_labels:
            token_labels = ids_tensor([self.batch_size, self.seq_length], self.num_labels)

        config = self.get_config()

        return (config, input_ids, token_type_ids, input_mask, pixel_values, token_labels)

    def get_config(self):
        return ViltConfig(
            image_size=self.image_size,
            patch_size=self.patch_size,
            num_channels=self.num_channels,
            vocab_size=self.vocab_size,
            hidden_size=self.hidden_size,
            num_hidden_layers=self.num_hidden_layers,
            num_attention_heads=self.num_attention_heads,
            intermediate_size=self.intermediate_size,
            hidden_act=self.hidden_act,
            hidden_dropout_prob=self.hidden_dropout_prob,
            attention_probs_dropout_prob=self.attention_probs_dropout_prob,
            max_position_embeddings=self.max_position_embeddings,
            type_vocab_size=self.type_vocab_size,
            is_decoder=False,
            initializer_range=self.initializer_range,
            num_labels=self.num_labels,
            modality_type_vocab_size=self.modality_type_vocab_size,
            num_images=self.num_images,
        )

    def create_and_check_model(
        self,
        config,
        input_ids,
        token_type_ids,
        input_mask,
        pixel_values,
        token_labels,
    ):
        model = ViltModel(config=config)
        model.to(torch_device)
        model.eval()
        result = model(input_ids, attention_mask=input_mask, token_type_ids=token_type_ids, pixel_values=pixel_values)
        result = model(input_ids, token_type_ids=token_type_ids, pixel_values=pixel_values)
        result = model(input_ids, pixel_values=pixel_values)
        self.parent.assertEqual(
            result.last_hidden_state.shape, (self.batch_size, self.expected_seq_len, self.hidden_size)
        )

    def create_and_check_for_token_classification(
        self,
        config,
        input_ids,
        token_type_ids,
        input_mask,
        pixel_values,
        token_labels,
    ):
        model = ViltForTokenClassification(config=config)
        model.to(torch_device)
        model.eval()
        result = model(input_ids, attention_mask=input_mask, token_type_ids=token_type_ids, pixel_values=pixel_values)
        result = model(input_ids, token_type_ids=token_type_ids, pixel_values=pixel_values)
        result = model(input_ids, pixel_values=pixel_values)
        self.parent.assertEqual(result.logits.shape, (self.batch_size, self.seq_length, self.num_labels))

    def prepare_config_and_inputs_for_common(self):
        config_and_inputs = self.prepare_config_and_inputs()
        (
            config,
            input_ids,
            token_type_ids,
            input_mask,
            pixel_values,
            token_labels,
        ) = config_and_inputs
        inputs_dict = {
            "input_ids": input_ids,
            "token_type_ids": token_type_ids,
            "attention_mask": input_mask,
            "pixel_values": pixel_values,
        }
        return config, inputs_dict

    def prepare_pixel_values(self):
        return floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

@require_torch
@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+")
class ViltModelTest(ModelTesterMixin, unittest.TestCase):
    all_model_classes = (
        (
            ViltModel,
            ViltForQuestionAnswering,
            ViltForImageAndTextRetrieval,
            ViltForMaskedLM,
            ViltForTokenClassification,
        )
        if is_torch_available()
        else ()
    )
    test_pruning = False
    test_headmasking = False
    test_torchscript = False

    # ViltForMaskedLM, ViltForQuestionAnswering and ViltForImagesAndTextClassification require special treatment
    def _prepare_for_class(self, inputs_dict, model_class, return_labels=False):
        inputs_dict = super()._prepare_for_class(inputs_dict, model_class, return_labels=return_labels)

        if return_labels:
            if model_class.__name__ == "ViltForQuestionAnswering":
                inputs_dict["labels"] = torch.zeros(
                    self.model_tester.batch_size, self.model_tester.num_labels, device=torch_device
                )
            elif model_class.__name__ in ["ViltForMaskedLM", "ViltForTokenClassification"]:
                inputs_dict["labels"] = torch.zeros(
                    (self.model_tester.batch_size, self.model_tester.seq_length), dtype=torch.long, device=torch_device
                )
            elif model_class.__name__ == "ViltForImagesAndTextClassification":
                inputs_dict["labels"] = torch.zeros(
                    self.model_tester.batch_size, dtype=torch.long, device=torch_device
                )

        return inputs_dict

    def setUp(self):
        self.model_tester = ViltModelTester(self)
        self.config_tester = ConfigTester(self, config_class=ViltConfig, hidden_size=37)

    def test_config(self):
        self.config_tester.run_common_tests()

    def test_model(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*config_and_inputs)

    def test_for_token_classification(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_token_classification(*config_and_inputs)

    def test_training(self):
        if not self.model_tester.is_training:
            return

        for model_class in self.all_model_classes:
            config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
            config.return_dict = True

            if model_class.__name__ == "ViltForImagesAndTextClassification":
                config.modality_type_vocab_size = 3

            # ViltForImageAndTextRetrieval doesn't support training for now
            if model_class in [*get_values(MODEL_MAPPING), ViltForImageAndTextRetrieval]:
                continue

            model = model_class(config)
            model.to(torch_device)
            model.train()
            inputs = self._prepare_for_class(inputs_dict, model_class, return_labels=True)
            for k, v in inputs.items():
                print(k, v.shape)
            loss = model(**inputs).loss
            loss.backward()

    def test_training_gradient_checkpointing(self):
        if not self.model_tester.is_training:
            return

        for model_class in self.all_model_classes:
            config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
            config.use_cache = False
            config.return_dict = True

            # ViltForImageAndTextRetrieval doesn't support training for now
            if (
                model_class in [*get_values(MODEL_MAPPING), ViltForImageAndTextRetrieval]
                or not model_class.supports_gradient_checkpointing
            ):
                continue

            model = model_class(config)
            model.to(torch_device)
            model.gradient_checkpointing_enable()
            model.train()
            inputs = self._prepare_for_class(inputs_dict, model_class, return_labels=True)
            loss = model(**inputs).loss
            loss.backward()

    @unittest.skip(
        reason="""VilT samples image tokens from a multinomial distribution, resulting in not deterministic
                            hidden states"""
    )
    def test_save_load(self):
        pass

    @unittest.skip(
        reason="""VilT samples image tokens from a multinomial distribution, resulting in not deterministic
                            hidden states"""
    )
    def test_determinism(self):
        pass

    @unittest.skip(
        reason="""VilT samples image tokens from a multinomial distribution, resulting in not deterministic
                            hidden states"""
    )
    def test_model_outputs_equivalence(self):
        pass

    def test_attention_outputs(self):
        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
        config.return_dict = True

        seq_len = getattr(self.model_tester, "expected_seq_len", None)

        for model_class in self.all_model_classes:
            inputs_dict["output_attentions"] = True
            inputs_dict["output_hidden_states"] = False
            config.return_dict = True
            model = model_class(config)
            model.to(torch_device)
            model.eval()
            with torch.no_grad():
                outputs = model(**self._prepare_for_class(inputs_dict, model_class))
            attentions = outputs.attentions
            if model_class.__name__ == "ViltForImagesAndTextClassification":
                # attentions are a list of length num_images
                # each element contains the attentions of a particular image index
                self.assertEqual(len(attentions), self.model_tester.num_images)
                self.assertEqual(len(attentions[0]), self.model_tester.num_hidden_layers)
            else:
                self.assertEqual(len(attentions), self.model_tester.num_hidden_layers)

            # check that output_attentions also work using config
            del inputs_dict["output_attentions"]
            config.output_attentions = True
            model = model_class(config)
            model.to(torch_device)
            model.eval()
            with torch.no_grad():
                outputs = model(**self._prepare_for_class(inputs_dict, model_class))
            attentions = outputs.attentions
            if model_class.__name__ == "ViltForImagesAndTextClassification":
                # attentions are a list of length num_images
                # each element contains the attentions of a particular image index
                self.assertEqual(len(attentions), self.model_tester.num_images)
                self.assertEqual(len(attentions[0]), self.model_tester.num_hidden_layers)
            else:
                self.assertEqual(len(attentions), self.model_tester.num_hidden_layers)

            if model_class.__name__ == "ViltForImagesAndTextClassification":
                self.assertListEqual(
                    list(attentions[0][0].shape[-3:]),
                    [self.model_tester.num_attention_heads, seq_len, seq_len],
                )
            else:
                self.assertListEqual(
                    list(attentions[0].shape[-3:]),
                    [self.model_tester.num_attention_heads, seq_len, seq_len],
                )
            out_len = len(outputs)

            # Check attention is always last and order is fine
            inputs_dict["output_attentions"] = True
            inputs_dict["output_hidden_states"] = True
            model = model_class(config)
            model.to(torch_device)
            model.eval()
            with torch.no_grad():
                outputs = model(**self._prepare_for_class(inputs_dict, model_class))

            self.assertEqual(out_len + 1, len(outputs))

            self_attentions = outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions

            if model_class.__name__ == "ViltForImagesAndTextClassification":
                self.assertEqual(len(self_attentions), self.model_tester.num_images)
                self.assertEqual(len(self_attentions[0]), self.model_tester.num_hidden_layers)
                self.assertListEqual(
                    list(self_attentions[0][0].shape[-3:]),
                    [self.model_tester.num_attention_heads, seq_len, seq_len],
                )
            else:
                self.assertEqual(len(self_attentions), self.model_tester.num_hidden_layers)
                self.assertListEqual(
                    list(self_attentions[0].shape[-3:]),
                    [self.model_tester.num_attention_heads, seq_len, seq_len],
                )

    def test_hidden_states_output(self):
        def check_hidden_states_output(inputs_dict, config, model_class):
            model = model_class(config)
            model.to(torch_device)
            model.eval()

            with torch.no_grad():
                outputs = model(**self._prepare_for_class(inputs_dict, model_class))

            hidden_states = outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

            expected_num_layers = getattr(
                self.model_tester, "expected_num_hidden_layers", self.model_tester.num_hidden_layers + 1
            )
            if model_class.__name__ == "ViltForImagesAndTextClassification":
                # hidden_states are a list of length num_images
                # each element contains the hidden states of a particular image index
                self.assertEqual(len(hidden_states), self.model_tester.num_images)
                self.assertEqual(len(hidden_states[0]), expected_num_layers)
            else:
                self.assertEqual(len(hidden_states), expected_num_layers)

            seq_length = self.model_tester.expected_seq_len

            if model_class.__name__ == "ViltForImagesAndTextClassification":
                self.assertListEqual(
                    list(hidden_states[0][0].shape[-2:]),
                    [seq_length, self.model_tester.hidden_size],
                )
            else:
                self.assertListEqual(
                    list(hidden_states[0].shape[-2:]),
                    [seq_length, self.model_tester.hidden_size],
                )

        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
            print("Model class:", model_class)
            inputs_dict["output_hidden_states"] = True
            check_hidden_states_output(inputs_dict, config, model_class)

            # check that output_hidden_states also work using config
            del inputs_dict["output_hidden_states"]
            config.output_hidden_states = True

            check_hidden_states_output(inputs_dict, config, model_class)

    def test_retain_grad_hidden_states_attentions(self):
        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
        config.output_hidden_states = True
        config.output_attentions = True

        # no need to test all models as different heads yield the same functionality
        model_class = self.all_model_classes[0]
        model = model_class(config)
        model.to(torch_device)

        inputs = self._prepare_for_class(inputs_dict, model_class)

        outputs = model(**inputs)

        output = outputs[0]

        # Encoder-/Decoder-only models
        hidden_states = outputs.hidden_states[0]
        attentions = outputs.attentions[0]

        if model_class.__name__ == "ViltForImagesAndTextClassification":
            # hidden_states are a list of length num_images
            # each element contains the hidden states of a particular image index
            hidden_states[0].retain_grad()
            attentions[0].retain_grad()
        else:
            hidden_states.retain_grad()
            attentions.retain_grad()

        output.flatten()[0].backward(retain_graph=True)

        if model_class.__name__ == "ViltForImagesAndTextClassification":
            # hidden_states are a list of length num_images
            # each element contains the hidden states of a particular image index
            self.assertIsNotNone(hidden_states[0].grad)
            self.assertIsNotNone(attentions[0].grad)
        else:
            self.assertIsNotNone(hidden_states.grad)
            self.assertIsNotNone(attentions.grad)

    @slow
    def test_model_from_pretrained(self):
        for model_name in VILT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
            model = ViltModel.from_pretrained(model_name)
            self.assertIsNotNone(model)

@require_torch
@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+")
class ViltForImagesAndTextClassificationModelTest(ViltModelTest, unittest.TestCase):
    all_model_classes = (ViltForImagesAndTextClassification,) if is_torch_available() else ()

    def setUp(self):
        self.model_tester = ViltModelTester(self, modality_type_vocab_size=3, add_multiple_images=True, num_images=2)
        self.config_tester = ConfigTester(self, config_class=ViltConfig, hidden_size=37)

    @unittest.skip("We only test the model that takes in multiple images")
    def test_model(self):
        pass

    @unittest.skip("We only test the model that takes in multiple images")
    def test_for_token_classification(self):
        pass

# We will verify our results on an image of cute cats
def prepare_img():
    image = Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png")
    return image

@require_torch
@require_vision
@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+")
class ViltModelIntegrationTest(unittest.TestCase):
    @cached_property
    def default_processor(self):
        return ViltProcessor.from_pretrained("dandelin/vilt-b32-finetuned-vqa") if is_vision_available() else None

    @slow
    def test_inference_masked_lm(self):
        model = ViltForMaskedLM.from_pretrained("dandelin/vilt-b32-mlm").to(torch_device)

        processor = self.default_processor
        image = prepare_img()
        text = "a bunch of [MASK] laying on a [MASK]."
        inputs = processor(image, text, return_tensors="pt").to(torch_device)

        # forward pass
        with torch.no_grad():
            outputs = model(**inputs)

        # verify the logits
        expected_shape = torch.Size([1, 11, 30522])
        self.assertEqual(outputs.logits.shape, expected_shape)

        expected_slice = torch.tensor([-12.5061, -12.5123, -12.5174]).to(torch_device)
        self.assertTrue(torch.allclose(outputs.logits[0, 0, :3], expected_slice, atol=1e-4))

        # verify masked token prediction equals "cats"
        predicted_id = outputs.logits[0, 4, :].argmax(-1).item()
        assert processor.decode([predicted_id]) == "cats"

    @slow
    def test_inference_visual_question_answering(self):
        model = ViltForQuestionAnswering.from_pretrained("dandelin/vilt-b32-finetuned-vqa").to(torch_device)

        processor = self.default_processor
        image = prepare_img()
        text = "How many cats are there?"
        inputs = processor(image, text, return_tensors="pt").to(torch_device)

        # forward pass
        with torch.no_grad():
            outputs = model(**inputs)

        # verify the logits
        expected_shape = torch.Size((1, 3129))
        self.assertEqual(outputs.logits.shape, expected_shape)

        expected_slice = torch.tensor([-15.9495, -18.1472, -10.3041]).to(torch_device)

        self.assertTrue(torch.allclose(outputs.logits[0, :3], expected_slice, atol=1e-4))

        # compute loss
        vqa_labels = [[2, 3, 155, 800]]
        vqa_scores = [[1.0, 0.3, 0.3, 0.3]]
        labels = torch.zeros(1, model.config.num_labels).to(torch_device)

        for i, (labels_example, scores_example) in enumerate(zip(vqa_labels, vqa_scores)):
            for l, s in zip(labels_example, scores_example):
                labels[i, l] = s

        # forward pass
        outputs = model(**inputs, labels=labels)

        # verify we have a positive loss
        self.assertTrue(outputs.loss > 0)

    @slow
    def test_inference_natural_language_visual_reasoning(self):
        model = ViltForImagesAndTextClassification.from_pretrained("dandelin/vilt-b32-finetuned-nlvr2").to(
            torch_device
        )

        processor = self.default_processor

        dataset = load_dataset("hf-internal-testing/fixtures_nlvr2", split="test")
        image1 = Image.open(dataset[0]["file"]).convert("RGB")
        image2 = Image.open(dataset[1]["file"]).convert("RGB")

        text = (
            "The left image contains twice the number of dogs as the right image, and at least two dogs in total are"
            " standing."
        )
        encoding_1 = processor(image1, text, return_tensors="pt")
        encoding_2 = processor(image2, text, return_tensors="pt")

        pixel_values = torch.stack([encoding_1.pixel_values, encoding_2.pixel_values], dim=1)

        # forward pass
        outputs = model(
            input_ids=encoding_1.input_ids.to(torch_device),
            pixel_values=pixel_values.to(torch_device),
        )

        # verify the logits
        expected_shape = torch.Size([1, 2])
        self.assertEqual(outputs.logits.shape, expected_shape)

        is_pillow_less_than_9 = version.parse(PIL.__version__) < version.parse("9.0.0")

        if is_pillow_less_than_9:
            expected_slice = torch.tensor(
                [-2.4013, 2.9342],
                device=torch_device,
            )
        else:
            expected_slice = torch.tensor(
                [-2.3713, 2.9168],
                device=torch_device,
            )

        self.assertTrue(torch.allclose(outputs.logits[0, :3], expected_slice, atol=1e-4))


text:
      Event: {{event.title}}

  <input ng-show="false" ng-model="event.id" ng-init="$scope.event.id=bEvent._id">

  <form name="eventForm">

          Title
          <input class="form-control" type="text" id="title" placeholder="Enter the title"
                 ng-model="event.title" ng-init="$scope.event.title=bEvent.title" required/>

          Category

          <select class="form-control" ng-model="event.category" id='category'
                  ng-init="$scope.event.category.name=bEvent.category" ng-model="event.category"
                  ng-options="category.name for category in allCategories" required>
          </select>

          Start Date
          <input class="form-control" type="date" id="startDate"
                 placeholder="YYYY-MM-DD" ng-model="event.startDate" required/>

          Start Time
          <input class="form-control" type="time" id="startTime" ng-model="event.startTime"
                 placeholder="HH:MM:ss" required>

          End Date
          <input class="form-control" type="date" id="endDate"
                 placeholder="YYYY-MM-DD" ng-model="event.endDate" required/>

          End Time
          <input class="form-control" type="time" id="endTime" ng-model="event.endTime"
                 placeholder="HH:MM:ss" required>

          Location
          <input class="form-control" type="text" id="location" placeholder="Enter the location"
                 ng-model="event.location" ng-init="$scope.event.location=bEvent.location"/>

          Notes
          <textarea class="form-control" rows="4" id="notes" placeholder="Enter your notes"
                    ng-model="event.notes" ng-init="$scope.event.notes=bEvent.notes"></textarea>

      <button ng-disabled="eventForm.$invalid" class="btn btn-default col-md-2 col-sm-4 col-xs-12"
              ng-click="createOrUpdate()">
        Submit
      </button>

  </form>


text:
#region license

#endregion

using System;
using System.Runtime.InteropServices;

using MediaFoundation.Misc;

namespace MediaFoundation
{

    #region Interfaces

#if ALLOW_UNTESTED_INTERFACES

    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    Guid("3DE21209-8BA6-4f2a-A577-2819B56FF14D"),
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IAdvancedMediaCaptureInitializationSettings
    {
        [PreserveSig]
        int SetDirectxDeviceManager(
            IMFDXGIDeviceManager value
            );
    }

    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    Guid("24E0485F-A33E-4aa1-B564-6019B1D14F65"),
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IAdvancedMediaCaptureSettings
    {
        [PreserveSig]
        int GetDirectxDeviceManager(
            out IMFDXGIDeviceManager value
            );

        [PreserveSig]
        int SetDirectCompositionVisual(
            [MarshalAs(UnmanagedType.IUnknown)] object value
            );

        [PreserveSig]
        int UpdateVideo(
             [In] MfFloat pSrcNormalizedTop,
             [In] MfFloat pSrcNormalizedBottom,
             [In] MfFloat pSrcNormalizedRight,
             [In] MfFloat pSrcNormalizedLeft,
             [In] MFRect pDstSize,
             [In] MFInt pBorderClr
            );
    }

    [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
    Guid("D0751585-D216-4344-B5BF-463B68F977BB"),
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IAdvancedMediaCapture
    {
        [PreserveSig]
        int GetAdvancedMediaCaptureSettings(
            out IAdvancedMediaCaptureSettings value
            );
    }

#endif

    #endregion

}


text:
import React, { Component } from 'react';

import ReactNative from 'react-native';
const {
  StyleSheet,
  Text,
  View,
  TextInput
} = ReactNative;

/**
 * InputText component
 */
class InputText extends Component {

  constructor(props){
    super(props);
    this.state = {
      textValue:""
    }
  }

  onChange(text) {
    this.setState({
      textValue: text
    })
    this.props.handleChangeText(text);
  }

  componentWillReceiveProps(nextProps) {
    if( nextProps.clear == true )
    {
      this.setState({
        textValue: ""
      })
      this.props.cClear();
    }
  }

  /**
   * Render InputText
   * @return {jsxresult} result in jsx format
   */
	render() {

		return (
			<View style={styles.button}>
          {
            this.props.floattext !="" &&
            (
              <Text style={styles.floatText}>{this.props.floattext}</Text>
            )
          }

          <TextInput
            style={styles.whiteFont}
            underlineColorAndroid="transparent"
            placeholder={this.props.placeholder}
            onChangeText={this.onChange.bind(this)}
            value={this.state.textValue}
          />
			</View>
		);
	}
}

const styles = StyleSheet.create({
  button: {
    padding: 15,
    paddingLeft: 0,
    borderWidth: 0,
    marginLeft:20
  },
  whiteFont: {
    borderColor: '#01743D',
    borderWidth: 1,
    color: 'black',
    fontSize: 18,
    height:40,
    paddingLeft:10
  },
  floatText: {
    fontFamily: 'Roboto-Regular',
    color: '#01743D',
    fontSize: 20
  }
});

export default InputText;


text:
 Order Entry

            Order Number:

            Order Date:

{{OrderDate | date:'MM/dd/yyyy'}}

            Required Ship Date:

                                <input ng-class="{'validation-error': RequiredDateInputError}" type="text" style="width:100px"
                                       datepicker-popup="MM/dd/yyyy"
                                       ng-model="RequiredDate"
                                       is-open="opened"
                                       datepicker-options="dateOptions"
                                       date-disabled="disabled(date, mode)"
                                       ng-required="true"
                                       close-text="Close" />
                                    <button type="button" ng-click="open($event)"></button>

            Ship Via:

{{selectedShipperName}}

                    <select style="width: 300px" ng-model="ShipVia" ng-options="shipper.ShipperName for shipper in Shippers" ng-class="{'validation-error': ShipViaInputError}">
                        <option value="">-- select a shipper --</option>
                    </select>

 Bill-To Information

                        Customer Code:

                        Customer Name:

                        Bill To Address:

                        Bill To City:

                        Bill To Region:

                        Bill To Postal Code:

                        Bill To Country:

 Ship-To Information

                        Ship To Name:

<input ng-model="ShipName" type="text" style="width: 300px" ng-class="{'validation-error': ShipNameInputError}" />

                        Ship To Address:

<input ng-model="ShipAddress" type="text" style="width: 300px" ng-class="{'validation-error': ShipAddressInputError}" />

                        Ship To City:

<input ng-model="ShipCity" type="text" style="width: 300px" ng-class="{'validation-error': ShipCityInputError}" />

                        Ship To Region:

<input ng-model="ShipRegion" type="text" style="width: 300px" ng-class="{'validation-error': ShipRegionInputError}" />

                        Ship To Postal Code:

<input ng-model="ShipPostalCode" type="text" style="width: 300px" ng-class="{'validation-error': ShipPostalCodeInputError}" />

                        Ship To Country:

<input ng-model="ShipCountry" type="text" style="width: 300px" ng-class="{'validation-error': ShipCountryInputError}" />

            Order Total:

{{OrderTotal | currency}}

    <button class="btn btn-primary btn-large" ng-click="createOrder()">Create</button>
    <button class="btn btn-primary btn-large" ng-click="editOrder()">Edit</button>
    <button class="btn btn-primary btn-large" ng-click="updateOrder()">Update</button>
    <button class="btn btn-primary btn-large" ng-click="cancelChanges()">Cancel</button>
    <button class="btn btn-primary btn-large" ng-click="orderDetails()">Order Details</button>

        <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">

</alert>


text:
function addReturns(sequence) {
    sequence = sequence.replace(/(.{60})/g,
        function (str, p1, offset, s) {
	        return p1 + "\n";
	    });
	return sequence.replace(/\n$/, "");
}

function checkFormElement(formElement)	{
    	if (formElement.value.search(/\S/) == -1)	{
		alert("Please enter some text.");
 		return false;
    	}
    	return true;
}

function checkSequenceLength(text, maxInput) {
	if ( ((getSequenceFromFasta(text)).replace(/[^A-Za-z]/g, "")).length > maxInput) {
		alert("Please enter a sequence consisting of less than or equal to " + maxInput + " characters.");
		return false;
	}
	else {
		return true;
	}
}

function complement(dnaSequence) {
	//there is no tr operator
	//should write a tr method to replace this
	dnaSequence = dnaSequence.replace(/g/g,"1");
	dnaSequence = dnaSequence.replace(/c/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"c");
	dnaSequence = dnaSequence.replace(/2/g,"g");
	dnaSequence = dnaSequence.replace(/G/g,"1");
	dnaSequence = dnaSequence.replace(/C/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"C");
	dnaSequence = dnaSequence.replace(/2/g,"G");

	dnaSequence = dnaSequence.replace(/a/g,"1");
	dnaSequence = dnaSequence.replace(/t/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"t");
	dnaSequence = dnaSequence.replace(/2/g,"a");
	dnaSequence = dnaSequence.replace(/A/g,"1");
	dnaSequence = dnaSequence.replace(/T/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"T");
	dnaSequence = dnaSequence.replace(/2/g,"A");

	dnaSequence = dnaSequence.replace(/u/g,"a");
	dnaSequence = dnaSequence.replace(/U/g,"A");

	dnaSequence = dnaSequence.replace(/r/g,"1");
	dnaSequence = dnaSequence.replace(/y/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"y");
	dnaSequence = dnaSequence.replace(/2/g,"r");
	dnaSequence = dnaSequence.replace(/R/g,"1");
	dnaSequence = dnaSequence.replace(/Y/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"Y");
	dnaSequence = dnaSequence.replace(/2/g,"R");

	dnaSequence = dnaSequence.replace(/k/g,"1");
	dnaSequence = dnaSequence.replace(/m/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"m");
	dnaSequence = dnaSequence.replace(/2/g,"k");
	dnaSequence = dnaSequence.replace(/K/g,"1");
	dnaSequence = dnaSequence.replace(/M/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"M");
	dnaSequence = dnaSequence.replace(/2/g,"K");

	dnaSequence = dnaSequence.replace(/b/g,"1");
	dnaSequence = dnaSequence.replace(/v/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"v");
	dnaSequence = dnaSequence.replace(/2/g,"b");
	dnaSequence = dnaSequence.replace(/B/g,"1");
	dnaSequence = dnaSequence.replace(/V/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"V");
	dnaSequence = dnaSequence.replace(/2/g,"B");

	dnaSequence = dnaSequence.replace(/d/g,"1");
	dnaSequence = dnaSequence.replace(/h/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"h");
	dnaSequence = dnaSequence.replace(/2/g,"d");
	dnaSequence = dnaSequence.replace(/D/g,"1");
	dnaSequence = dnaSequence.replace(/H/g,"2");
	dnaSequence = dnaSequence.replace(/1/g,"H");
	dnaSequence = dnaSequence.replace(/2/g,"D");

	return dnaSequence;
}

function getArrayOfFasta(sequenceData) {
	let arrayOfFasta = new Array();
	let matchArray;
	let re = /\>[^\>]+/g;
	if (sequenceData.search(/\>[^\f\n\r]+[\f\n\r]/) != -1) {
		while (matchArray = re.exec(sequenceData)) {
			arrayOfFasta.push(matchArray[0]);
		}
	}
	else {
		arrayOfFasta[0] = sequenceData;
	}
	return arrayOfFasta;
}

function getSequenceFromFasta(sequenceRecord) {
	if (sequenceRecord.search(/\>[^\f\n\r]+[\f\n\r]/) != -1)	{
		sequenceRecord = sequenceRecord.replace(/\>[^\f\n\r]+[\f\n\r]/, "");
	}
	return sequenceRecord;
}

function getInfoFromTitleAndSequence(fastaSequenceTitle, sequence) {
	let stringToReturn = 'Results for ' + sequence.length + ' residue sequence ';
	if (fastaSequenceTitle.search(/[^\s]/) != -1)	{
		stringToReturn = stringToReturn + '"' + fastaSequenceTitle + '"';
	}
	stringToReturn = stringToReturn + ' starting "' + sequence.substring(0,10) + '"';
	return '
' + stringToReturn + '
\n';
}

function getTitleFromFasta(sequenceRecord) {
	let fastaTitle = "Untitled";
	if (sequenceRecord.search(/\>[^\f\n\r]+[\f\n\r]/) != -1)	{
		fastaTitle = (sequenceRecord.match(/\>[^\f\n\r]+[\f\n\r]/,"")).toString();
		fastaTitle = fastaTitle.replace(/\>|[\f\n\r]/g, "");
		fastaTitle = fastaTitle.replace(/\s{2,}/g, " ");
		fastaTitle = fastaTitle.replace(/[\<\>]/gi, "");
	}
	return fastaTitle;
}

function removeNonDna(sequence) {
	return sequence.replace(/[^gatucryswkmbdhvnxGATUCRYSWKMBDHVNX]/g, "");
}

function reverse(dnaSequence) {
	let tempDnaArray = new Array();
	if (dnaSequence.search(/./) != -1)	{
		tempDnaArray = dnaSequence.match(/./g);
		tempDnaArray = tempDnaArray.reverse();
		dnaSequence = tempDnaArray.join("");
	}
	return dnaSequence;
}

function testScript() {
	// test some javascript functions to see how the browser performs.
	// want to prevent non Javascript 1.5 browsers from attempting to run.
	// first test Array.push()

	let testArray = new Array();
	let testString = "1234567890";

	testArray.push(testString);
	if (testArray[0] != testString) {
		alert("Array object push method not supported. See browser compatibility page.");
		return false;
	}

	//now test the 'm' flag in a regular expression
	testString = "1\n2\n3";
	let re = /^2$/m;
	if (testString.search(re) == -1) {
		alert("Regular expression 'm' flag not supported. See browser compatibility page.");
		return false;
	}

	let caughtException = false;
	//now test exception handling
	try {
		re = eval("Exception handling not supported. Check browser compatibility page.");
	}
	catch(e) {
		caughtException = true;
	}

	if (!(caughtException)) {
		alert("Exception handling not supported. See browser compatibility page.");
	}

	//now test replace lambda function
	testString = "123";
	testString = testString.replace(/(\d)/g,
                    function (str, p1, offset, s) {
                      	return p1 + "X";
                   }
        );
	if (testString != "1X2X3X") {
		alert ("Nested function in String replace method not supported. See browser compatibility page.");
		return false;
	}

	//test number methods toFixed() and toPrecision()
	let testNum = 2489.8237;
	if (testNum.toFixed(3) != 2489.824) {
		alert("Number toFixed() method not supported. See browser compatibility page.");
		return false;
	}

	if (testNum.toPrecision(5) != 2489.8) {
		alert("Number toPrecision() method not supported. See browser compatibility page.");
		return false;
	}

	return true;
}


text:
__author__ = "Mathieu Fenniak"

import datetime
import decimal
import struct
import math
from errors import (NotSupportedError, ArrayDataParseError, InternalError,
        ArrayContentEmptyError, ArrayContentNotHomogenousError,
        ArrayContentNotSupportedError, ArrayDimensionsNotConsistentError)

try:
    from pytz import utc
except ImportError:
    ZERO = datetime.timedelta(0)
    class UTC(datetime.tzinfo):
        def utcoffset(self, dt):
            return ZERO
        def tzname(self, dt):
            return "UTC"
        def dst(self, dt):
            return ZERO
    utc = UTC()

class Bytea(str):
    pass

class Interval(object):
    def __init__(self, microseconds=0, days=0, months=0):
        self.microseconds = microseconds
        self.days = days
        self.months = months

    def _setMicroseconds(self, value):
        if not isinstance(value, int) and not isinstance(value, long):
            raise TypeError("microseconds must be an int or long")
        elif not (min_int8 < value < max_int8):
            raise OverflowError("microseconds must be representable as a 64-bit integer")
        else:
            self._microseconds = value

    def _setDays(self, value):
        if not isinstance(value, int) and not isinstance(value, long):
            raise TypeError("days must be an int or long")
        elif not (min_int4 < value < max_int4):
            raise OverflowError("days must be representable as a 32-bit integer")
        else:
            self._days = value

    def _setMonths(self, value):
        if not isinstance(value, int) and not isinstance(value, long):
            raise TypeError("months must be an int or long")
        elif not (min_int4 < value < max_int4):
            raise OverflowError("months must be representable as a 32-bit integer")
        else:
            self._months = value

    microseconds = property(lambda self: self._microseconds, _setMicroseconds)
    days = property(lambda self: self._days, _setDays)
    months = property(lambda self: self._months, _setMonths)

    def __repr__(self):
        return "<Interval %s months %s days %s microseconds>" % (self.months, self.days, self.microseconds)

    def __cmp__(self, other):
        if other == None: return -1
        c = cmp(self.months, other.months)
        if c != 0: return c
        c = cmp(self.days, other.days)
        if c != 0: return c
        return cmp(self.microseconds, other.microseconds)

def pg_type_info(typ):
    value = None
    if isinstance(typ, dict):
        value = typ["value"]
        typ = typ["type"]

    data = py_types.get(typ)
    if data == None:
        raise NotSupportedError("type %r not mapped to pg type" % typ)

    # permit the type data to be determined by the value, if provided
    inspect_func = data.get("inspect")
    if value != None and inspect_func != None:
        data = inspect_func(value)

    type_oid = data.get("typeoid")
    if type_oid == None:
        raise InternalError("type %r has no type_oid" % typ)
    elif type_oid == -1:
        # special case: NULL values
        return type_oid, 0

    # prefer bin, but go with whatever exists
    if data.get("bin_out"):
        format = 1
    elif data.get("txt_out"):
        format = 0
    else:
        raise InternalError("no conversion fuction for type %r" % typ)

    return type_oid, format

def pg_value(value, fc, **kwargs):
    typ = type(value)
    data = py_types.get(typ)
    if data == None:
        raise NotSupportedError("type %r not mapped to pg type" % typ)

    # permit the type conversion to be determined by the value, if provided
    inspect_func = data.get("inspect")
    if value != None and inspect_func != None:
        data = inspect_func(value)

    # special case: NULL values
    if data.get("typeoid") == -1:
        return None

    if fc == 0:
        func = data.get("txt_out")
    elif fc == 1:
        func = data.get("bin_out")
    else:
        raise InternalError("unrecognized format code %r" % fc)
    if func == None:
        raise NotSupportedError("type %r, format code %r not supported" % (typ, fc))
    return func(value, **kwargs)

def py_type_info(description):
    type_oid = description['type_oid']
    data = pg_types.get(type_oid)
    if data == None:
        raise NotSupportedError("type oid %r not mapped to py type" % type_oid)
    # prefer bin, but go with whatever exists
    if data.get("bin_in"):
        format = 1
    elif data.get("txt_in"):
        format = 0
    else:
        raise InternalError("no conversion fuction for type oid %r" % type_oid)
    return format

def py_value(v, description, **kwargs):
    if v == None:
        # special case - NULL value
        return None
    type_oid = description['type_oid']
    format = description['format']
    data = pg_types.get(type_oid)
    if data == None:
        raise NotSupportedError("type oid %r not supported" % type_oid)
    if format == 0:
        func = data.get("txt_in")
    elif format == 1:
        func = data.get("bin_in")
    else:
        raise NotSupportedError("format code %r not supported" % format)
    if func == None:
        raise NotSupportedError("data response format %r, type %r not supported" % (format, type_oid))
    return func(v, **kwargs)

def boolrecv(data, **kwargs):
    return data == "\x01"

def boolsend(v, **kwargs):
    if v:
        return "\x01"
    else:
        return "\x00"

min_int2, max_int2 = -2 ** 15, 2 ** 15
min_int4, max_int4 = -2 ** 31, 2 ** 31
min_int8, max_int8 = -2 ** 63, 2 ** 63

def int_inspect(value):
    if min_int2 < value < max_int2:
        return {"typeoid": 21, "bin_out": int2send}
    elif min_int4 < value < max_int4:
        return {"typeoid": 23, "bin_out": int4send}
    elif min_int8 < value < max_int8:
        return {"typeoid": 20, "bin_out": int8send}
    else:
        return {"typeoid": 1700, "bin_out": numeric_send}

def int2recv(data, **kwargs):
    return struct.unpack("!h", data)[0]

def int2send(v, **kwargs):
    return struct.pack("!h", v)

def int4recv(data, **kwargs):
    return struct.unpack("!i", data)[0]

def int4send(v, **kwargs):
    return struct.pack("!i", v)

def int8recv(data, **kwargs):
    return struct.unpack("!q", data)[0]

def int8send(v, **kwargs):
    return struct.pack("!q", v)

def float4recv(data, **kwargs):
    return struct.unpack("!f", data)[0]

def float8recv(data, **kwargs):
    return struct.unpack("!d", data)[0]

def float8send(v, **kwargs):
    return struct.pack("!d", v)

def datetime_inspect(value):
    if value.tzinfo != None:
        # send as timestamptz if timezone is provided
        return {"typeoid": 1184, "bin_out": timestamptz_send}
    else:
        # otherwise send as timestamp
        return {"typeoid": 1114, "bin_out": timestamp_send}

def timestamp_recv(data, integer_datetimes, **kwargs):
    if integer_datetimes:
        # data is 64-bit integer representing milliseconds since 2000-01-01
        val = struct.unpack("!q", data)[0]
        return datetime.datetime(2000, 1, 1) + datetime.timedelta(microseconds = val)
    else:
        # data is double-precision float representing seconds since 2000-01-01
        val = struct.unpack("!d", data)[0]
        return datetime.datetime(2000, 1, 1) + datetime.timedelta(seconds = val)

# return a timezone-aware datetime instance if we're reading from a
# "timestamp with timezone" type.  The timezone returned will always be UTC,
# but providing that additional information can permit conversion to local.
def timestamptz_recv(data, **kwargs):
    return timestamp_recv(data, **kwargs).replace(tzinfo=utc)

def timestamp_send(v, integer_datetimes, **kwargs):
    delta = v - datetime.datetime(2000, 1, 1)
    val = delta.microseconds + (delta.seconds * 1000000) + (delta.days * 86400000000)
    if integer_datetimes:
        # data is 64-bit integer representing milliseconds since 2000-01-01
        return struct.pack("!q", val)
    else:
        # data is double-precision float representing seconds since 2000-01-01
        return struct.pack("!d", val / 1000.0 / 1000.0)

def timestamptz_send(v, **kwargs):
    # timestamps should be sent as UTC.  If they have zone info,
    # convert them.
    return timestamp_send(v.astimezone(utc).replace(tzinfo=None), **kwargs)

def date_in(data, **kwargs):
    year = int(data[0:4])
    month = int(data[5:7])
    day = int(data[8:10])
    return datetime.date(year, month, day)

def date_out(v, **kwargs):
    return v.isoformat()

def time_in(data, **kwargs):
    hour = int(data[0:2])
    minute = int(data[3:5])
    sec = decimal.Decimal(data[6:])
    return datetime.time(hour, minute, int(sec), int((sec - int(sec)) * 1000000))

def time_out(v, **kwargs):
    return v.isoformat()

def numeric_in(data, **kwargs):
    if data.find(".") == -1:
        return int(data)
    else:
        return decimal.Decimal(data)

def numeric_recv(data, **kwargs):
    num_digits, weight, sign, scale = struct.unpack("!hhhh", data[:8])
    data = data[8:]
    digits = struct.unpack("!" + ("h" * num_digits), data)
    weight = decimal.Decimal(weight)
    retval = 0
    for d in digits:
        d = decimal.Decimal(d)
        retval += d * (10000 ** weight)
        weight -= 1
    if sign:
        retval *= -1
    return retval

DEC_DIGITS = 4
def numeric_send(d, **kwargs):
    # This is a very straight port of src/backend/utils/adt/numeric.c set_var_from_str()
    s = str(d)
    pos = 0
    sign = 0
    if s[0] == '-':
        sign = 0x4000 # NEG
        pos=1
    elif s[0] == '+':
        sign = 0 # POS
        pos=1
    have_dp = False
    decdigits = [0, 0, 0, 0]
    dweight = -1
    dscale = 0
    for char in s[pos:]:
        if char.isdigit():
            decdigits.append(int(char))
            if not have_dp:
                dweight += 1
            else:
                dscale += 1
            pos+=1
        elif char == '.':
            have_dp = True
            pos+=1
        else:
            break

    if len(s) > pos:
        char = s[pos]
        if char == 'e' or char == 'E':
            pos+=1
            exponent = int(s[pos:])
            dweight += exponent
            dscale -= exponent
            if dscale < 0: dscale = 0

    if dweight >= 0:
        weight = (dweight + 1 + DEC_DIGITS - 1) / DEC_DIGITS - 1
    else:
        weight = -((-dweight - 1) / DEC_DIGITS + 1)
    offset = (weight + 1) * DEC_DIGITS - (dweight + 1)
    ndigits = (len(decdigits)-DEC_DIGITS + offset + DEC_DIGITS - 1) / DEC_DIGITS

    i = DEC_DIGITS - offset
    decdigits.extend([0, 0, 0])
    ndigits_ = ndigits
    digits = ''
    while ndigits_ > 0:
        # ifdef DEC_DIGITS == 4
        digits += struct.pack("!h", ((decdigits[i] * 10 + decdigits[i + 1]) * 10 + decdigits[i + 2]) * 10 + decdigits[i + 3])
        ndigits_ -= 1
        i += DEC_DIGITS

    # strip_var()
    if ndigits == 0:
        sign = 0x4000 # pos
        weight = 0
    # ----------

    retval = struct.pack("!hhhh", ndigits, weight, sign, dscale) + digits
    return retval

def numeric_out(v, **kwargs):
    return str(v)

# PostgreSQL encodings:
#   http://www.postgresql.org/docs/8.3/interactive/multibyte.html
# Python encodings:
#   http://www.python.org/doc/2.4/lib/standard-encodings.html
#
# Commented out encodings don't require a name change between PostgreSQL and
# Python.  If the py side is None, then the encoding isn't supported.
pg_to_py_encodings = {
    # Not supported:
    "mule_internal": None,
    "euc_tw": None,

    # Name fine as-is:
    #"euc_jp",
    #"euc_jis_2004",
    #"euc_kr",
    #"gb18030",
    #"gbk",
    #"johab",
    #"sjis",
    #"shift_jis_2004",
    #"uhc",
    #"utf8",

    # Different name:
    "euc_cn": "gb2312",
    "iso_8859_5": "is8859_5",
    "iso_8859_6": "is8859_6",
    "iso_8859_7": "is8859_7",
    "iso_8859_8": "is8859_8",
    "koi8": "koi8_r",
    "latin1": "iso8859-1",
    "latin2": "iso8859_2",
    "latin3": "iso8859_3",
    "latin4": "iso8859_4",
    "latin5": "iso8859_9",
    "latin6": "iso8859_10",
    "latin7": "iso8859_13",
    "latin8": "iso8859_14",
    "latin9": "iso8859_15",
    "sql_ascii": "ascii",
    "win866": "cp886",
    "win874": "cp874",
    "win1250": "cp1250",
    "win1251": "cp1251",
    "win1252": "cp1252",
    "win1253": "cp1253",
    "win1254": "cp1254",
    "win1255": "cp1255",
    "win1256": "cp1256",
    "win1257": "cp1257",
    "win1258": "cp1258",
}

def encoding_convert(encoding):
    return pg_to_py_encodings.get(encoding.lower(), encoding)

def varcharin(data, client_encoding, **kwargs):
    return unicode(data, encoding_convert(client_encoding))

def textout(v, client_encoding, **kwargs):
    if isinstance(v, unicode):
        return v.encode(encoding_convert(client_encoding))
    else:
        return v

def byteasend(v, **kwargs):
    return str(v)

def bytearecv(data, **kwargs):
    return Bytea(data)

# interval support does not provide a Python-usable interval object yet
def interval_recv(data, integer_datetimes, **kwargs):
    if integer_datetimes:
        microseconds, days, months = struct.unpack("!qii", data)
    else:
        seconds, days, months = struct.unpack("!dii", data)
        microseconds = int(seconds * 1000 * 1000)
    return Interval(microseconds, days, months)

def interval_send(data, integer_datetimes, **kwargs):
    if integer_datetimes:
        return struct.pack("!qii", data.microseconds, data.days, data.months)
    else:
        return struct.pack("!dii", data.microseconds / 1000.0 / 1000.0, data.days, data.months)

def array_recv(data, **kwargs):
    dim, hasnull, typeoid = struct.unpack("!iii", data[:12])
    data = data[12:]

    # get type conversion method for typeoid
    conversion = pg_types[typeoid]["bin_in"]

    # Read dimension info
    dim_lengths = []
    element_count = 1
    for idim in range(dim):
        dim_len, dim_lbound = struct.unpack("!ii", data[:8])
        data = data[8:]
        dim_lengths.append(dim_len)
        element_count *= dim_len

    # Read all array values
    array_values = []
    for i in range(element_count):
        if len(data):
            element_len, = struct.unpack("!i", data[:4])
            data = data[4:]
            if element_len == -1:
                array_values.append(None)
            else:
                array_values.append(conversion(data[:element_len], **kwargs))
                data = data[element_len:]
    if data != "":
        raise ArrayDataParseError("unexpected data left over after array read")

    # at this point, {{1,2,3},{4,5,6}}::int[][] looks like [1,2,3,4,5,6].
    # go through the dimensions and fix up the array contents to match
    # expected dimensions
    for dim_length in reversed(dim_lengths[1:]):
        val = []
        while array_values:
            val.append(array_values[:dim_length])
            array_values = array_values[dim_length:]
        array_values = val

    return array_values

def array_inspect(value):
    # Check if array has any values.  If not, we can't determine the proper
    # array typeoid.
    first_element = array_find_first_element(value)
    if first_element == None:
        raise ArrayContentEmptyError("array has no values")

    # supported array output
    typ = type(first_element)
    if issubclass(typ, int) or issubclass(typ, long):
        # special int array support -- send as smallest possible array type
        special_int_support = True
        int2_ok, int4_ok, int8_ok = True, True, True
        for v in array_flatten(value):
            if v == None:
                continue
            if min_int2 < v < max_int2:
                continue
            int2_ok = False
            if min_int4 < v < max_int4:
                continue
            int4_ok = False
            if min_int8 < v < max_int8:
                continue
            int8_ok = False
        if int2_ok:
            array_typeoid = 1005 # INT2[]
        elif int4_ok:
            array_typeoid = 1007 # INT4[]
        elif int8_ok:
            array_typeoid = 1016 # INT8[]
        else:
            raise ArrayContentNotSupportedError("numeric not supported as array contents")
    else:
        special_int_support = False
        array_typeoid = py_array_types.get(typ)
        if array_typeoid == None:
            raise ArrayContentNotSupportedError("type %r not supported as array contents" % typ)

    # check for homogenous array
    for v in array_flatten(value):
        if v != None and not (isinstance(v, typ) or (typ == long and isinstance(v, int)) or (typ == int and isinstance(v, long))):
            raise ArrayContentNotHomogenousError("not all array elements are of type %r" % typ)

    # check that all array dimensions are consistent
    array_check_dimensions(value)

    type_data = py_types[typ]
    if special_int_support:
        if array_typeoid == 1005:
            type_data = {"typeoid": 21, "bin_out": int2send}
        elif array_typeoid == 1007:
            type_data = {"typeoid": 23, "bin_out": int4send}
        elif array_typeoid == 1016:
            type_data = {"typeoid": 20, "bin_out": int8send}
    else:
        type_data = py_types[typ]
    return {
        "typeoid": array_typeoid,
        "bin_out": array_send(type_data["typeoid"], type_data["bin_out"])
    }

def array_find_first_element(arr):
    for v in array_flatten(arr):
        if v != None:
            return v
    return None

def array_flatten(arr):
    for v in arr:
        if isinstance(v, list):
            for v2 in array_flatten(v):
                yield v2
        else:
            yield v

def array_check_dimensions(arr):
    v0 = arr[0]
    if isinstance(v0, list):
        req_len = len(v0)
        req_inner_lengths = array_check_dimensions(v0)
        for v in arr:
            inner_lengths = array_check_dimensions(v)
            if len(v) != req_len or inner_lengths != req_inner_lengths:
                raise ArrayDimensionsNotConsistentError("array dimensions not consistent")
        retval = [req_len]
        retval.extend(req_inner_lengths)
        return retval
    else:
        # make sure nothing else at this level is a list
        for v in arr:
            if isinstance(v, list):
                raise ArrayDimensionsNotConsistentError("array dimensions not consistent")
        return []

def array_has_null(arr):
    for v in array_flatten(arr):
        if v == None:
            return True
    return False

def array_dim_lengths(arr):
    v0 = arr[0]
    if isinstance(v0, list):
        retval = [len(v0)]
        retval.extend(array_dim_lengths(v0))
    else:
        return [len(arr)]
    return retval

class array_send(object):
    def __init__(self, typeoid, bin_out_func):
        self.typeoid = typeoid
        self.bin_out_func = bin_out_func

    def __call__(self, arr, **kwargs):
        has_null = array_has_null(arr)
        dim_lengths = array_dim_lengths(arr)
        data = struct.pack("!iii", len(dim_lengths), has_null, self.typeoid)
        for i in dim_lengths:
            data += struct.pack("!ii", i, 1)
        for v in array_flatten(arr):
            if v == None:
                data += struct.pack("!i", -1)
            else:
                inner_data = self.bin_out_func(v, **kwargs)
                data += struct.pack("!i", len(inner_data))
                data += inner_data
        return data

py_types = {
    bool: {"typeoid": 16, "bin_out": boolsend},
    int: {"inspect": int_inspect},
    long: {"inspect": int_inspect},
    str: {"typeoid": 25, "bin_out": textout},
    unicode: {"typeoid": 25, "bin_out": textout},
    float: {"typeoid": 701, "bin_out": float8send},
    decimal.Decimal: {"typeoid": 1700, "bin_out": numeric_send},
    Bytea: {"typeoid": 17, "bin_out": byteasend},
    datetime.datetime: {"typeoid": 1114, "bin_out": timestamp_send, "inspect": datetime_inspect},
    datetime.date: {"typeoid": 1082, "txt_out": date_out},
    datetime.time: {"typeoid": 1083, "txt_out": time_out},
    Interval: {"typeoid": 1186, "bin_out": interval_send},
    type(None): {"typeoid": -1},
    list: {"inspect": array_inspect},
}

# py type -> pg array typeoid
py_array_types = {
    float: 1022,
    bool: 1000,
    str: 1009,      # TEXT[]
    unicode: 1009,  # TEXT[]
    decimal.Decimal: 1231, # NUMERIC[]
}

pg_types = {
    16: {"bin_in": boolrecv},
    17: {"bin_in": bytearecv},
    19: {"bin_in": varcharin}, # name type
    20: {"bin_in": int8recv},
    21: {"bin_in": int2recv},
    23: {"bin_in": int4recv, "txt_in": numeric_in},
    25: {"bin_in": varcharin, "txt_in": varcharin}, # TEXT type
    26: {"txt_in": numeric_in}, # oid type
    142: {"bin_in": varcharin, "txt_in": varcharin}, # XML
    194: {"bin_in": varcharin}, # "string representing an internal node tree"
    700: {"bin_in": float4recv},
    701: {"bin_in": float8recv},
    705: {"txt_in": varcharin}, # UNKNOWN
    829: {"txt_in": varcharin}, # MACADDR type
    1000: {"bin_in": array_recv}, # BOOL[]
    1003: {"bin_in": array_recv}, # NAME[]
    1005: {"bin_in": array_recv}, # INT2[]
    1007: {"bin_in": array_recv, "txt_in": varcharin}, # INT4[]
    1009: {"bin_in": array_recv}, # TEXT[]
    1014: {"bin_in": array_recv}, # CHAR[]
    1015: {"bin_in": array_recv}, # VARCHAR[]
    1016: {"bin_in": array_recv}, # INT8[]
    1021: {"bin_in": array_recv}, # FLOAT4[]
    1022: {"bin_in": array_recv}, # FLOAT8[]
    1042: {"bin_in": varcharin}, # CHAR type
    1043: {"bin_in": varcharin}, # VARCHAR type
    1082: {"txt_in": date_in},
    1083: {"txt_in": time_in},
    1114: {"bin_in": timestamp_recv},
    1184: {"bin_in": timestamptz_recv}, # timestamp w/ tz
    1186: {"bin_in": interval_recv},
    1231: {"bin_in": array_recv}, # NUMERIC[]
    1263: {"bin_in": array_recv}, # cstring[]
    1700: {"bin_in": numeric_recv},
    2275: {"bin_in": varcharin}, # cstring
}