text:
using System;
using System.Data.Entity.Migrations;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;
using DataService.Context;
using DataService.Entities;
using DataService.Entities.Security;
using DataService.Enum;

namespace DataService.Migrations
{

    internal sealed class Configuration : DbMigrationsConfiguration<Ef>
    {
        public Configuration()
        {
            AutomaticMigrationDataLossAllowed = true;
            AutomaticMigrationsEnabled = true;
        }

        protected override void Seed(Ef ef)
        {
            ef.Database.CreateIfNotExists ();

            ProfileSeed(ef);
            Student_SeedFromSql (ef);
            Staff_SeedFromSql (ef);

            MessageBox.Show ("Seed Done");
        }

        private static void ProfileSeed(Ef ef)
        {
            var adminUserprofiles = new UserProfile
            {
                UserProfileGuid = MatrixConstants.SystemGuid(),
                UserSpace = UserSpace.AdminSpace
            };

            var adminUserRoles = new UserRoles
            {
                UserProfileGuid = MatrixConstants.SystemGuid(),
                CanAddStudent = true, CanDeleteStudent = true
            };

            var adminSettings = new UserSetting
            {
                UserProfileGuid = MatrixConstants.SystemGuid()
            };

            ef.UserProfile.AddOrUpdate(adminUserprofiles);

            ef.UserRole.AddOrUpdate(adminUserRoles);

            ef.UserSetting.AddOrUpdate(adminSettings);

        }

        private static void Staff_SeedFromSql ( Ef ef )
        {
            const string filePath = @"C:\Users\CISSE\Documents\Net\Matrix\DataService\Initializer\Staffs.sql";

            var sqlFile = new FileInfo (filePath);
            var sqlString = sqlFile.OpenText ().ReadToEnd();

            ef.Database.ExecuteSqlCommand ("DELETE FROM Staffs");
            ef.Database.ExecuteSqlCommand (sqlString);

            var admin = new Staff
            {
                StaffGuid = MatrixConstants.SystemGuid(),
                StaffId = "Dl-I11-00",
                Position = "Chef de Departement Info",
                Departement = "Informatique",
                HiredDate = DateTime.Today.AddDays(-500),
                Statut = "Regulier",
                Title = "Mr",
                FirstName = "Halid",
                LastName = "cisse",
                Nationality = "",
                IdentityNumber = "",
                BirthDate = DateTime.Today.AddDays(-5000),
                BirthPlace = "Tayba",
                PhoneNumber = "0012547874",
                EmailAdress = "hali@gmail.com",
                HomeAdress = "Mabella",
                RegistrationDate = DateTime.Today.AddDays(-100)
            };

            ef.Staff.AddOrUpdate(admin);

            var x = ef.Staff.ToList();
            x.ForEach (s => s.PhotoIdentity = GetRandomImg());
            //x.ForEach (S => S.STAFF_ID = "ST-" + GenID(6));
        }

        private static void Student_SeedFromSql ( Ef ef )
        {

            //const string FilePath = @"C:\Users\Halid\Documents\Visual Studio 2013\Projects\Matrix\DataService\DataService\Initializer\Students.sql";
            const string filePath = @"C:\Users\CISSE\Documents\Net\Matrix\DataService\Initializer\Students.sql";

            var sqlFile = new FileInfo (filePath);
            var sqlString = sqlFile.OpenText ().ReadToEnd ();

            ef.Database.ExecuteSqlCommand ("DELETE FROM Students");
            ef.Database.ExecuteSqlCommand (sqlString);

            var x = ef.Student.ToList ();

            x.ForEach (s => s.PhotoIdentity = GetRandomImg ());
            //x.ForEach (S => S.STUDENT_ID = "M-" + GenID (6));

        }

        #region Helpers

        public static string GenId ( int lengthOfTheId )
        {
            var x = new Random ();
            var idOut = string.Empty;

            for(var i = 0; i < lengthOfTheId; i++)
            {
                idOut = idOut + x.Next (1, 9);
            }
            return idOut;
        }

        private static byte[] GetRandomImg()
        {
            Thread.Sleep(1000);
            var x = new Random ().Next (1, 9);

            var img = BitmapArrayFromFile("portrait" + x + ".jpg");

            return img;
        }

        private static byte[] BitmapArrayFromFile ( string filePath )
        {
            filePath = @"C:\Users\CISSE\Documents\Net\Matrix\Matrix\Portrait\" + filePath;
            if(!File.Exists (filePath)) return null;

            var fs = new FileStream (filePath, FileMode.Open, FileAccess.Read);
            var imgByteArr = new byte[fs.Length];
            fs.Read (imgByteArr, 0, Convert.ToInt32 (fs.Length));
            fs.Close ();
            return imgByteArr;
        }

        //public static Byte[] ByteFromBitmap ( string PathInApp )
        //{
        //    var bitmapImage = new BitmapImage(new Uri(GetRes(PathInApp)));

        //    byte[] data;
        //    var encoder = new JpegBitmapEncoder ();
        //    encoder.Frames.Add (BitmapFrame.Create (bitmapImage));
        //    using(var ms = new MemoryStream ())
        //    {
        //        encoder.Save (ms);
        //        data = ms.ToArray ();
        //    }
        //    return data;
        //}

        //private static string GetRes ( string pathInApplication, Assembly assembly = null )
        //{
        //    if(assembly == null)
        //    {
        //        assembly = Assembly.GetExecutingAssembly ( );
        //    }

        //    if(pathInApplication[0] == '/')
        //    {
        //        pathInApplication = pathInApplication.Substring (1);
        //    }
        //    return (new Uri (@"pack://application:,,,/" + assembly.GetName ().Name + ";component/" + pathInApplication, UriKind.Absolute).ToString ());
        //}

        #endregion

    }
}

//private static void SettingsSeed(Ef ef)
//{
//    const string sqlString = "INSERT INTO Settings (SettingId, UserProfileId, SettingNum)" +
//                             "VALUES ('C07D6D28-2B82-46E7-A6DF-39E2DF821509', '00000000-0000-0000-0000-000000000000', 1)";

//    ef.Database.ExecuteSqlCommand("DELETE FROM Settings");
//    ef.Database.ExecuteSqlCommand(sqlString);
//}

//private static void AddPersonSeed ( EF EF )
//{
//    ImageBuff = BitmapArrayFromFile ("defaultStudent.png");

//    MessageBox.Show("adding person");

//    var MyPersons = new List<Person> {
//        //new Person {PERSON_ID = "DI100", FIRSTNAME = "Halid", LASTNAME = "Cisse", PHONE_NUMBER = "00122445545"},
//        //new Person {PERSON_ID = "DI102", FIRSTNAME = "Mat", LASTNAME = "Pearson", PHONE_NUMBER = "0012244545545"},
//        //new Person {PERSON_ID = "DI103", FIRSTNAME = "Dave" , LASTNAME = "Wood", PHONE_NUMBER = "001544545578"},
//        //new Person {PERSON_ID = "DI104", FIRSTNAME = "Adam", LASTNAME = "Nolan", PHONE_NUMBER = "0012445454545"}
//    };

//    //MyPersons.ForEach (Person => EF.PERSON.AddOrUpdate (Person));
//}

//private static void AddStudentSeed ( EF EF )
//       {

//           var MyStudents = new List<Student>{

//               new Student
//               {
//                   STUDENT_ID = "DI100", TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "Cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "00122445545", EMAIL_ADRESS = "Halid@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI101", TITLE = "Mr", FIRSTNAME = "Mat", LASTNAME = "Pearson", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Pearson@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI102", TITLE = "Mr", FIRSTNAME = "Dave", LASTNAME = "Wood", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Senegal", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "+78122445545", EMAIL_ADRESS = "Dave@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI103", TITLE = "Mr", FIRSTNAME = "Adam", LASTNAME = "Nolan", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Nolan@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI104", TITLE = "Mr", FIRSTNAME = "Oumar", LASTNAME = "Cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "00122445545", EMAIL_ADRESS = "Oumar@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI105", TITLE = "Mr", FIRSTNAME = "Amadou", LASTNAME = "Pearson", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Amadou@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI106", TITLE = "Mr", FIRSTNAME = "Saif", LASTNAME = "Wood", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Senegal", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "+78122445545", EMAIL_ADRESS = "Saif@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI107", TITLE = "Mr", FIRSTNAME = "Youssouf", LASTNAME = "Nolan", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Youssouf@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI108", TITLE = "Mr", FIRSTNAME = "Katherine", LASTNAME = "Wright", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "00122445545", EMAIL_ADRESS = "Wright@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI109", TITLE = "Mr", FIRSTNAME = "Oumou", LASTNAME = "Keita", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Keita@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI110", TITLE = "Mr", FIRSTNAME = "Toto", LASTNAME = "Wood", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Senegal", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "+78122445545", EMAIL_ADRESS = "Toto@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI111", TITLE = "Mr", FIRSTNAME = "Tom", LASTNAME = "Nolan", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Tom@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI112", TITLE = "Mr", FIRSTNAME = "Jerry", LASTNAME = "Cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "00122445545", EMAIL_ADRESS = "Jerry@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI113", TITLE = "Mr", FIRSTNAME = "Ousou", LASTNAME = "Pearson", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Ousou@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI114", TITLE = "Mr", FIRSTNAME = "Braa", LASTNAME = "Wood", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Senegal", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-500), BIRTH_PLACE = "Tayba",
//                   PHONE_NUMBER = "+78122445545", EMAIL_ADRESS = "Braa@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//               new Student
//               {
//                   STUDENT_ID = "DI115", TITLE = "Mr", FIRSTNAME = "Idrissa", LASTNAME = "Nolan", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "Mali", IDENTITY_NUMBER = "PL785445", BIRTH_DATE = DateTime.Today.AddDays(-1200), BIRTH_PLACE = "Tripoli",
//                   PHONE_NUMBER = "+124578784545", EMAIL_ADRESS = "Idrissa@gmail.com", HOME_ADRESS ="Mabella, Rabat", REGISTRATION_DATE = DateTime.Today.AddDays(-100), STATUT = "Regulier"
//               },

//           };

//           MyStudents.ForEach (Student => EF.STUDENT.AddOrUpdate (Student));

//           MessageBox.Show ("Finish student");
//       }

//       private static void AddStaffSeed ( EF EF )
//       {

//           var MyStaffs = new List<Staff> {
//               new Staff
//               {
//                   STAFF_ID = "DI100", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI101", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI102", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI103", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI104", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI105", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI106", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI107", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI108", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI109", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI110", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI111", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI112", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI113", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },
//               new Staff
//               {
//                   STAFF_ID = "DI114", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//               new Staff
//               {
//                   STAFF_ID = "DI115", POSITION = "Chef de Departement Info", DEPARTEMENT = "Informatique", HIRED_DATE = DateTime.Today.AddDays(-500), STATUT = "Regulier",
//                   TITLE = "Mr", FIRSTNAME = "Halid", LASTNAME = "cisse", PHOTO_IDENTITY = GetRandomImg(),
//                   NATIONALITY = "", IDENTITY_NUMBER= "", BIRTH_DATE= DateTime.Today.AddDays(-5000),BIRTH_PLACE= "",PHONE_NUMBER= "",EMAIL_ADRESS= "",HOME_ADRESS= "",REGISTRATION_DATE= DateTime.Today.AddDays(-100)
//               },

//           };

//           MyStaffs.ForEach (Staff => EF.STAFF.AddOrUpdate(Staff));
//           MessageBox.Show ("Finish staff");
//       }


text:
package com.arellomobile.mvp.compiler.viewstateprovider;

import com.arellomobile.mvp.MvpProcessor;
import com.arellomobile.mvp.MvpView;
import com.arellomobile.mvp.ViewStateProvider;
import com.arellomobile.mvp.compiler.JavaFilesGenerator;
import com.arellomobile.mvp.viewstate.MvpViewState;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.WildcardTypeName;

import java.util.Collections;
import java.util.List;

import javax.lang.model.element.Modifier;

/**
 * Date: 19-Jan-16
 * Time: 19:51
 *
 * @author Alexander Blinov
 */
public final class ViewStateProviderClassGenerator extends JavaFilesGenerator<PresenterInfo> {

	@Override
	public List<JavaFile> generate(PresenterInfo presenterInfo) {
		TypeSpec typeSpec = TypeSpec.classBuilder(presenterInfo.getName().simpleName() + MvpProcessor.VIEW_STATE_PROVIDER_SUFFIX)
				.addModifiers(Modifier.PUBLIC)
				.superclass(ViewStateProvider.class)
				.addMethod(generateGetViewStateMethod(presenterInfo.getName(), presenterInfo.getViewStateName()))
				.build();

		JavaFile javaFile = JavaFile.builder(presenterInfo.getName().packageName(), typeSpec)
				.indent("\t")
				.build();

		return Collections.singletonList(javaFile);
	}

	private MethodSpec generateGetViewStateMethod(ClassName presenter, ClassName viewState) {
		MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getViewState")
				.addAnnotation(Override.class)
				.addModifiers(Modifier.PUBLIC)
				.returns(ParameterizedTypeName.get(ClassName.get(MvpViewState.class), WildcardTypeName.subtypeOf(MvpView.class)));

		if (viewState == null) {
			methodBuilder.addStatement("throw new RuntimeException($S)", presenter.reflectionName() + " should has view");
		} else {
			methodBuilder.addStatement("return new $T()", viewState);
		}

		return methodBuilder.build();
	}
}

redpajama_set_name: RedPajamaGithub


text:
package io.appium.java_client.pagefactory;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Used to mark a field on a Page/Screen Object to indicate that lookup should use a series of {@link iOSFindBy} tags
 * It will then search for all elements that match any criteria. Note that elements
 * are not guaranteed to be in document order.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface iOSFindAll {
	iOSFindBy[] value();
}


text:
{% load highlight %}
{% load thread_tags %}

{{ result.object.title }}
	Incumbent: {% if result.object.incumbent %}
		{{ result.object.incumbent|display_user:user }}
		{% else %}none{% endif %}

{% if result.object.email %}

E-mail: {{ result.object.email }}

{% elif result.object.incumbent.email_visible and result.object.incumbent.user.email %}

	Personal E-mail:
	{{ result.object.incumbent.user.email }}

{% endif %}
{% if result.object.incumbent.phone_visible and result.object.incumbent.phone_number %}

Personal Phone: {{ result.object.incumbent.phone_number }}

{% endif %}

{% highlight result.text with query %}


text:
Movie Trailer Web Project for Udacity's Full Stack Developer Nanodegree Program.

# Installation
_Make sure you have Python 2.7 downloaded_
```
Download ZIP from GitHub
Extract all the contents to a folder
Run **entertainment_center.py**
```


text:
require 'securerandom'

module Ketra
  # This module is used to execute specific Ketra API commands
  module Commands

    # Activates a keypad button at a specific brightness level
    #
    # @param [String] keypad the GUID or Name of the keypad containing the button you want to activate
    # @param [String] button the GUID or Name of the keypad button you want to activate
    # @param [Integer] level (65535) the brightness level from 0 to 65535
    # @return [Hash] deserialized response hash
    def self.activate_button(keypad, button, level=65535)
      Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/Activate",
                        :Level => level)
    end

    # Deactivates a keypad button
    #
    # @param [String] keypad the GUID or Name of the keypad containing the button you want to deactivate
    # @param [String] button the GUID or Name of the keypad button you want to deactivate
    # @return [Hash] deserialized response hash
    def self.deactivate_button(keypad, button)
      Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/Deactivate",
                        :Level => 0)
    end

    # Pushes a keypad button which will either activate or deactivate based on its current state
    # and the configuration of the keypad settings
    #
    # @param [String] keypad the GUID or Name of the keypad containing the button you want to deactivate
    # @param [String] button the GUID or Name of the keypad button you want to deactivate
    # @return [Hash] deserailized response hash
    def self.push_button(keypad, button)
      Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/PushButton",
                        :query_params => { :idempotency_key => SecureRandom.hex })
    end

    # Queries for the available Ketra Keypads
    #
    # @return [Hash] deserialized response hash containing the keypad info, see Ketra API documentation for details
    def self.keypads
      Ketra.client.get("Keypads")
    end

    # Queries for the available Ketra Groups
    #
    # @return [Hash] deserialized response hash containing the group info, see Ketra API documentation for details
    def self.groups
      Ketra.client.get("Groups")
    end
  end
end


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Neoxythece tomentosa Aubrev.

### Remarks
null


text:
<!DOCTYPE html>

    <link rel="stylesheet" type="text/css" href="stylesheets/my-berkshire-stylesheet.css">
    <title>BERKSHIRE HATHAWAY INC.
    </title>

BERKSHIRE HATHAWAY INC.

3555 Farnam Street

Omaha, NE 68131

Official Home Page

A Message From Warren E. Buffet

Annual & Interim Reports
Updated August 7, 2015

Special Letters From Warren & Charlie RE:Past, Present and Future

Link to SEC Filings

Links to Berkshire Subsidiary Companies

Corporate Governance

Owner's Manual

Letters from Warren E. Buffett Regarding Pledges to Make Gifts of Berkshire Stock

News Releases
Updated August 10, 2015

Warren Buffett's Letters to Berkshire Shareholders

Updated February 28, 2015

Charlie Munger's Letters to Wesco Shareholders

Annual Meeting Information

Celebrating 50 Years of a Profitable Partnership
(A commemorative book first sold at the 2015 Annual Meeting and now for sale on eBay.)

Comparative Rights and Relative Prices of Class A and B Stock

Berkshire Activewear

FOR A FREE CAR INSURANCE RATE QUOTE THAT COULD SAVE YOU SUBSTANTIAL MONEY
WWW.GEICO.COM OR CALL 1-888-395-6349, 24 HOURS A DAY

If you have any comments about our WEB page, you can either write us at the address shown above or e-mail us at berkshire@berkshirehathaway.com. However, due to the limited number of personnel in our corporate office, we are unable to provide a direct response.

Legal Disclaimer

    Copyright © 1978-2015 Berkshire Hathaway Inc.


text:
```bash
curl https://api.lob.com/v1/addresses/adr_fa85158b26c3eb7c \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = AddressesApi(api_client)

try:
  address = api.get("adr_fa85158b26c3eb7c")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/addresses/adr_43769b47aed248c2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = AddressesApi(api_client)

try:
  deleted_resource = api.delete("adr_43769b47aed248c2")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/addresses \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
address_editable = AddressEditable(
  description = "Harry - Office",
  name = "Harry Zhang",
  company = "Lob",
  email = "harry@lob.com",
  phone = "5555555555",
  address_line1 = "210 King St",
  address_line2 = "# 6100",
  address_city = "San Francisco",
  address_state = "CA",
  address_zip = "94107",
  address_country = CountryExtended("US"),
)

with ApiClient(configuration) as api_client:
  api = AddressesApi(api_client)

try:
  created_address = api.create(address_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/addresses?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = AddressesApi(api_client)

try:
  addresses = api.list(limit=2)
except ApiException as e:
  print(e)
```

## Postcards Api

### Retrieve
```bash
curl https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = PostcardsApi(api_client)

try:
  postcard = api.get("psc_5c002b86ce47537a")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/postcards/psc_5c002b86ce47537a" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = PostcardsApi(api_client)

try:
  deleted_resource = api.cancel("psc_5c002b86ce47537a")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/postcards \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
postcard_editable = PostcardEditable(
  description = "Demo Postcard job",
  _from = "adr_210a8d4b0b76d77b",
  front = "<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>",
  back = "<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>",
  to = AddressEditable(
    name = "Harry Zhang",
    address_line1 = "210 King St",
    address_line2 = "# 6100",
    address_city = "San Francisco",
    address_state = "CA",
    address_zip = "94107",
  ),
  merge_variables = MergeVariables(
    name = "Harry",
  ),
)

with ApiClient(configuration) as api_client:
  api = PostcardsApi(api_client)

try:
  created_postcard = api.create(postcard_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/postcards?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = PostcardsApi(api_client)

try:
  postcards = api.list(limit=2)
except ApiException as e:
  print(e)
```

## SelfMailers Api

### Retrieve
```bash
curl https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = SelfMailersApi(api_client)

try:
  self_mailer = api.get("sfm_8ffbe811dea49dcf")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = SelfMailersApi(api_client)

try:
  deleted_resource = api.delete("sfm_8ffbe811dea49dcf")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/self_mailers \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
self_mailer_editable = SelfMailerEditable(
  description = "Demo Self Mailer job",
  _from = "adr_210a8d4b0b76d77b",
  inside = "<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>",
  outside = "<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>",
  to = AddressEditable(
    name = "Harry Zhang",
    address_line1 = "210 King St",
    address_line2 = "# 6100",
    address_city = "San Francisco",
    address_state = "CA",
    address_zip = "94107",
  ),
  merge_variables = MergeVariables(
    name = "Harry",
  ),
)

with ApiClient(configuration) as api_client:
  api = SelfMailersApi(api_client)

try:
  created_self_mailer = api.create(self_mailer_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/self_mailers?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = SelfMailersApi(api_client)

try:
  self_mailers = api.list(limit=2)
except ApiException as e:
  print(e)
```

## Letters Api

### Retrieve
```bash
curl https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = LettersApi(api_client)

try:
  letter = api.get("ltr_4868c3b754655f90")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/letters/ltr_4868c3b754655f90" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = LettersApi(api_client)

try:
  deleted_resource = api.cancel("ltr_4868c3b754655f90")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/letters \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
letter_editable = LetterEditable(
  description = "Demo Letter",
  _from = "adr_210a8d4b0b76d77b",
  file = "<html style='padding-top: 3in; margin: .5in;'>HTML Letter for {{name}}</html>",
  color = True,
  to = AddressEditable(
    name = "Harry Zhang",
    address_line1 = "210 King St",
    address_line2 = "# 6100",
    address_city = "San Francisco",
    address_state = "CA",
    address_zip = "94107",
  ),
  merge_variables = MergeVariables(
    name = "Harry",
  ),
  cards = [
    "card_c51ae96f5cebf3e",
  ],
)

with ApiClient(configuration) as api_client:
  api = LettersApi(api_client)

try:
  created_letter = api.create(letter_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/letters?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = LettersApi(api_client)

try:
  letters = api.list(limit=2)
except ApiException as e:
  print(e)
```

## Checks Api

### Retrieve
```bash
curl https://api.lob.com/v1/checks/chk_534f10783683daa0 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = ChecksApi(api_client)

try:
  check = api.get("chk_534f10783683daa0")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/checks/chk_534f10783683daa0" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = ChecksApi(api_client)

try:
  deleted_resource = api.cancel("chk_534f10783683daa0")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/checks \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
check_editable = CheckEditable(
  description = "Demo Check",
  bank_account = "bank_8cad8df5354d33f",
  amount = 22.5,
  memo = "rent",
  logo = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png",
  check_bottom = "<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>",
  _from = "adr_210a8d4b0b76d77b",
  to = AddressDomestic(
    name = "Harry Zhang",
    address_line1 = "210 King St",
    address_line2 = "# 6100",
    address_city = "San Francisco",
    address_state = "CA",
    address_zip = "94107",
  ),
  merge_variables = MergeVariables(
    name = "Harry",
  ),
)

with ApiClient(configuration) as api_client:
  api = ChecksApi(api_client)

try:
  created_check = api.create(check_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/checks?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = ChecksApi(api_client)

try:
  checks = api.list(limit=2)
except ApiException as e:
  print(e)
```

## BankAccounts Api

### Retrieve
```bash
curl https://api.lob.com/v1/bank_accounts/bank_8cad8df5354d33f \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = BankAccountsApi(api_client)

try:
  bank_account = api.get("bank_8cad8df5354d33f")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/bank_accounts/bank_3e64d9904356b20" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = BankAccountsApi(api_client)

try:
  deleted_resource = api.delete("bank_3e64d9904356b20")
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/bank_accounts?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = BankAccountsApi(api_client)

try:
  bank_accounts = api.list(limit=2)
except ApiException as e:
  print(e)
```

### Verify
```bash
curl https://api.lob.com/v1/bank_accounts/bank_dfceb4a2a05b57e/verify \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "amounts[]=25" \
  -d "amounts[]=63" \
```

```python
verification_data = BankAccountVerify(
  amounts = [
    25,
    63,
  ],
)

with ApiClient(configuration) as api_client:
  api = BankAccountsApi(api_client)

try:
  verified_account = api.verify("bank_dfceb4a2a05b57e", verification_data)
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/bank_accounts \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
bank_account_writable = BankAccountWritable(
  description = "Test Bank Account",
  routing_number = "322271627",
  account_number = "123456789",
  signatory = "John Doe",
  account_type = BankTypeEnum("company"),
)

with ApiClient(configuration) as api_client:
  api = BankAccountsApi(api_client)

try:
  created_bank_account = api.create(bank_account_writable)
except ApiException as e:
  print(e)
```

## Templates Api

### Retrieve
```bash
curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplatesApi(api_client)

try:
  template = api.get("tmpl_c94e83ca2cd5121")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/templates/tmpl_df934eeda694203" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplatesApi(api_client)

try:
  deleted_resource = api.delete("tmpl_df934eeda694203")
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/templates?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplatesApi(api_client)

try:
  templates = api.list(limit=2)
except ApiException as e:
  print(e)
```

### Update
```bash
curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Updated description" \
  -d "published_version=vrsn_362184d96d9b0c9"
```

```python
with ApiClient(configuration) as api_client:
  api = TemplatesApi(api_client)

update_data = TemplateUpdate(
  description = "updated template",
  published_version = "vrsn_362184d96d9b0c9"
)

try:
  update_template = api.update("tmpl_c94e83ca2cd5121", update_data)
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/templates \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
template_writable = TemplateWritable(
  description = "Test Template",
  html = "<html>HTML for {{name}}</html>",
)

with ApiClient(configuration) as api_client:
  api = TemplatesApi(api_client)

try:
  created_template = api.create(template_writable)
except ApiException as e:
  print(e)
```

## TemplateVersions Api

### Retrieve
```bash
curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplateVersionsApi(api_client)

try:
  template_version = api.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions/vrsn_534e339882d2282" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplateVersionsApi(api_client)

try:
  deleted_resource = api.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282")
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/templates/tmpl_dadaaf7b76c9f25/versions?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = TemplateVersionsApi(api_client)

try:
  template_versions = api.list("tmpl_dadaaf7b76c9f25", limit=2)
except ApiException as e:
  print(e)
```

### Update
```bash
curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Updated description"
```

```python
with ApiClient(configuration) as api_client:
  api = TemplateVersionsApi(api_client)

update_data = TemplateVersionUpdatable(
  description = "updated template"
)

try:
  update_template_version = api.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", update_data)
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
template_version_writable = TemplateVersionWritable(
  description = "Second Version",
  html = "<html>Second HTML for {{name}}</html>",
)

with ApiClient(configuration) as api_client:
  api = TemplateVersionsApi(api_client)

try:
  created_template_version = api.create("tmpl_4aa14648113e45b", template_version_writable)
except ApiException as e:
  print(e)
```

## BillingGroups Api

### Retrieve
```bash
curl https://api.lob.com/v1/billing_groups/bg_4bb02b527a72667d0 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = BillingGroupsApi(api_client)

try:
  billing_group = api.get("bg_4bb02b527a72667d0")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/billing_groups \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
billing_group_editable = BillingGroupEditable(
  description = "Usage group used for the Marketing Department's resource sends",
  name = "Marketing Department",
)

with ApiClient(configuration) as api_client:
  api = BillingGroupsApi(api_client)

try:
  created_bg = api.create(billing_group_editable)
except ApiException as e:
  print(e)
```

### Update
```bash
curl -X PATCH https://api.lob.com/v1/bg_759954f540a1bfdb5 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=demo replacement" \
```

```python
billing_group_editable = BillingGroupEditable(
  description = "demo replacement",
)

with ApiClient(configuration) as api_client:
  api = BillingGroupsApi(api_client)

try:
  updated_bg = api.update("bg_759954f540a1bfdb5", billing_group_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/billing_groups?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = BillingGroupsApi(api_client)

try:
  billing_groups = api.list(limit=2)
except ApiException as e:
  print(e)
```

## Cards Api

### Retrieve
```bash
curl https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CardsApi(api_client)

try:
  card = api.get("card_7a6d73c5c8457fc")
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/cards/card_6afffd19045076c" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CardsApi(api_client)

try:
  deleted_resource = api.delete("card_6afffd19045076c")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/cards \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
card_editable = CardEditable(
  front = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf",
  back = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf",
  size = "2.125x3.375",
  description = "Test Card",
)

with ApiClient(configuration) as api_client:
  api = CardsApi(api_client)

try:
  created_card = api.create(card_editable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/cards?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CardsApi(api_client)

try:
  cards = api.list(limit=2)
except ApiException as e:
  print(e)
```

### Update
```bash
curl -X PATCH https://api.lob.com/v1/card_6afffd19045076c \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Awesome card" \
  -d "auto_reorder=true" \
  -d "reorder_quantity=10000" \
```

```python
card_updatable = CardUpdatable(
  description = "Awesome card",
  auto_reorder = True,
  reorder_quantity = 10000,
)

with ApiClient(configuration) as api_client:
  api = CardsApi(api_client)

try:
  updated_card = api.update("card_6afffd19045076c", card_updatable)
except ApiException as e:
  print(e)
```

## CardOrders Api

### Retrieve
```bash
curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders/ \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CardOrdersApi(api_client)

try:
  card_order = api.get("card_6afffd19045076c", limit = 2, offset = 1)
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
card_order_editable = CardOrderEditable(
  quantity = 10000,
)

with ApiClient(configuration) as api_client:
  api = CardOrdersApi(api_client)

try:
  created_card_order = api.create("card_6afffd19045076c", card_order_editable)
except ApiException as e:
  print(e)
```

## Campaigns Api

### Retrieve
```bash
curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CampaignsApi(api_client)

try:
  campaign = api.get("cmp_e05ee61ff80764b")
except ApiException as e:
  print(e)
```

### Update
```bash
curl -X PATCH https://api.lob.com/v1/cmp_e05ee61ff80764b \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Awesome campaign" \
```

```python
campaign_updatable = CampaignUpdatable(
  description = "Awesome campaign",
)

with ApiClient(configuration) as api_client:
  api = CampaignsApi(api_client)

try:
  updated_campaign = api.update("cmp_e05ee61ff80764b", campaign_updatable)
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/campaigns \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
campaign_writable = CampaignWritable(
  name = "My First Campaign",
  schedule_type = CmpScheduleType("immediate"),
)

with ApiClient(configuration) as api_client:
  api = CampaignsApi(api_client)

try:
  created_campaign = api.create(campaign_writable)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/campaigns?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CampaignsApi(api_client)

try:
  campaigns = api.list(limit=2)
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CampaignsApi(api_client)

try:
  deleted_resource = api.delete("cmp_e05ee61ff80764b")
except ApiException as e:
  print(e)
```

## Creatives Api

### Update
```bash
curl -X PATCH https://api.lob.com/v1/crv_2a3b096c409b32c \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Our updated 4x6 postcard creative" \
```

```python
creative_patch = CreativePatch(
  description = "Our updated 4x6 postcard creative",
)

with ApiClient(configuration) as api_client:
  api = CreativesApi(api_client)

try:
  updated_creative = api.update("crv_2a3b096c409b32c", creative_patch)
except ApiException as e:
  print(e)
```

### Retrieve
```bash
curl https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = CreativesApi(api_client)

try:
  creative = api.get("crv_2a3b096c409b32c")
except ApiException as e:
  print(e)
```

### Create
```bash
curl https://api.lob.com/v1/creatives \

  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
creative_writable = CreativeWritable(
  campaign_id = "cmp_e05ee61ff80764b",
  resource_type = "postcard",
  description = "Our 4x6 postcard creative",
  _from = "adr_210a8d4b0b76d77b",
  front = "tmpl_4aa14648113e45b",
  back = "tmpl_4aa14648113e45b",
  details = PostcardDetailsWritable(
    mail_type = MailType("usps_first_class"),
  ),
)

with ApiClient(configuration) as api_client:
  api = CreativesApi(api_client)

try:
  created_creative = api.create(creative_writable)
except ApiException as e:
  print(e)
```

## Uploads Api

### Retrieve Export
```bash
curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports/ex_6a94fe68fd151e0f8 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "type=failures"
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  retrieved_export = api.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8")
except ApiException as e:
  print(e)
```

### Upload File

```bash
curl -X POST https://api.lob.com/v1/uploads/upl_71be866e430b11e9/file \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -F file=@<YOUR_FILE_NAME_HERE>
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  res = api.upload_file("upl_71be866e430b11e9", open("<PATH_TO_CSV>", "rb"))
except ApiException as e:
  print(e)
```

### Retrieve
```bash
curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  upload = api.get_upload("upl_71be866e430b11e9")
except ApiException as e:
  print(e)
```

### Create Export
```bash
curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "type=failures"
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

export_model = ExportModel(
  type = "all"
)

try:
  created_export = api.create_export("upl_71be866e430b11e9", export_model)
except ApiException as e:
  print(e)
```

### List
```bash
curl -X GET "https://api.lob.com/v1/uploads?limit=2" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  uploads = api.list_upload()
except ApiException as e:
  print(e)
```

### Update
```bash
curl -X PATCH https://api.lob.com/v1/upl_71be866e430b11e9 \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "state=Ready for Validation" \
```

```python
upload_updatable = UploadUpdatable(
  state = UploadState("Ready for Validation"),
)

with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  updated_upload = api.update_upload("upl_71be866e430b11e9", upload_updatable)
except ApiException as e:
  print(e)
```

### Create
```bash
curl --location --request POST https://api.lob.com/v1/uploads \
  --header 'Content-Type: application/json' \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
```

```python
upload_writable = UploadWritable(
  campaign_id = "cmp_e05ee61ff80764b",
  column_mapping = { "firstName": "first name" },
)

with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  created_upload = api.create_upload(upload_writable)
except ApiException as e:
  print(e)
```

### Delete
```bash
curl -X DELETE "https://api.lob.com/v1/uploads/upl_71be866e430b11e9" \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
```

```python
with ApiClient(configuration) as api_client:
  api = UploadsApi(api_client)

try:
  deleted_resource = api.delete_upload("upl_71be866e430b11e9")
except ApiException as e:
  print(e)
```

## ZipLookups Api

### ZipLookup
```bash
curl https://api.lob.com/v1/us_zip_lookups \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "zip_code=94107"
```

```python
with ApiClient(configuration) as api_client:
  api = ZipLookupsApi(api_client)

zip_request = ZipEditable(
  zip_code = "94107"
)

try:
  zip_lookup = api.lookup(zip_request)
except ApiException as e:
  print(e)
```

## Reverse Geocode Lookups Api

### Reverse Geocode Lookup
```bash
curl https://api.lob.com/v1/us_reverse_geocode_lookups \
  -u <YOUR_LIVE_API_KEY>: \
```

```python
with ApiClient(configuration) as api_client:
  api = ReverseGeocodeLookupsApi(api_client)

coordinates = Location(
  latitude = 37.777456,
  longitude = -122.393039,
)

try:
  geocode = api.lookup(coordinates)
except ApiException as e:
  print(e)
```

## USAutoCompletions Api

### Autocomplete
```bash
curl https://api.lob.com/v1/us_autocompletions \
  -u <YOUR_LIVE_API_KEY>: \
  -d "address_prefix=185 B" \
  -d "city=San Francisco" \
  -d "state=CA" \
  -d "zip_code=94017" \
```

```python
with ApiClient(configuration) as api_client:
  api = UsAutocompletionsApi(api_client)

autocompletion_data = UsAutocompletionsWritable(
  address_prefix = "185 B",
  city = "San Francisco",
  state = "CA",
  zip_code = "94017",
)

try:
  autocompleted_addresses = api.autocomplete(autocompletion_data)
except ApiException as e:
  print(e)
```

## UsVerifications Api

### Bulk Verify
```bash
curl https://api.lob.com/v1/bulk/us_verifications \
  -u <YOUR LIVE API KEY>: \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "addresses[0][primary_line]=210 King Street" \
  --data-urlencode "addresses[0][city]=San Francisco" \
  --data-urlencode "addresses[0][state]=CA" \
  --data-urlencode "addresses[0][zip_code]=94017" \
  --data-urlencode "addresses[1][primary_line]=185 BERRY ST STE 6600" \
  --data-urlencode "addresses[1][city]=SAN FRANCISCO" \
  --data-urlencode "addresses[1][state]=CA" \
  --data-urlencode "addresses[1][zip_code]=94017" \
```

```python
with ApiClient(configuration) as api_client:
  api = UsVerificationsApi(api_client)

verification_data_0 = MultipleComponents(
  primary_line = "210 King Street",
  city = "San Francisco",
  state = "CA",
  zip_code = "94017",
)

verification_data_1 = MultipleComponents(
  primary_line = "185 BERRY ST STE 6600",
  city = "SAN FRANCISCO",
  state = "CA",
  zip_code = "94017",
)

address_list = MultipleComponentsList(
  addresses = [
    verification_data_0,
    verification_data_1,
  ],
)

try:
  bulk_verified = api.verifyBulk(address_list)
except ApiException as e:
  print(e)
```

### Single Verify
```bash
curl https://api.lob.com/v1/us_verifications \
  -u <YOUR_LIVE_API_KEY>: \
  -d "primary_line=210 King Street" \
  -d "city=San Francisco" \
  -d "state=CA" \
  -d "zip_code=94017" \
```

```python
with ApiClient(configuration) as api_client:
  api = UsVerificationsApi(api_client)
verification_data_1 = UsVerificationsWritable(
  primary_line = "210 King Street",
  city = "San Francisco",
  state = "CA",
  zip_code = "94017",
)

try:
  single_verified = api.verifySingle(verification_data_1)
except ApiException as e:
  print(e)
```

## IntlAutocompletion Api

### IntlAutocompletion
```bash
curl https://api.lob.com/v1/intl_autocompletions \
  -u <YOUR_LIVE_API_KEY>: \
  -d "address_prefix=340 Wat" \
  -d "city=Summerside" \
  -d "state=Prince Edward Island" \
  -d "zip_code=C1N 1C4" \
  -d "country=CA" \
```

```python
with ApiClient(configuration) as api_client:
  api = IntlAutocompletionsApi(api_client)

autocompletion_data = IntlAutocompletionsWritable(
    address_prefix = "340 Wat",
    city = "Summerside",
    state = "Prince Edward Island",
    zip_code = "C1N 1C4",
    country = CountryExtended("CA"),
)

try:
  autocompleted_addresses = api.autocomplete(autocompletion_data)
except ApiException as e:
  print(e)
```

## IntlVerifications Api

### Single Verify
```bash
curl https://api.lob.com/v1/intl_verifications \
  -u <YOUR_LIVE_API_KEY>: \
  -d "primary_line=370 Water St" \
  -d "city=Summerside" \
  -d "state=Prince Edward Island" \
  -d "postal_code=C1N 1C4" \
  -d "country=CA" \
```

```python
with ApiClient(configuration) as api_client:
  api = IntlVerificationsApi(api_client)
verification_data_1 = IntlVerificationWritable(
  primary_line = "370 Water St",
  city = "Summerside",
  state = "Prince Edward Island",
  postal_code = "C1N 1C4",
  country = CountryExtended("CA"),
)

try:
  single_verified = api.verifySingle(verification_data_1)
except ApiException as e:
  print(e)
```

### Bulk Verify
```bash
curl https://api.lob.com/v1/bulk/intl_verifications \
  -u <YOUR LIVE API KEY>: \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'addresses[0][primary_line]=35 Tower Hill' \
  --data-urlencode 'addresses[0][city]=London' \
  --data-urlencode 'addresses[0][postal_code]=EC3N 4DR' \
  --data-urlencode 'addresses[0][country]=GB' \
  --data-urlencode 'addresses[1][primary_line]=370 Water St' \
  --data-urlencode 'addresses[1][city]=Summerside' \
  --data-urlencode 'addresses[1][state]=Prince Edward Island' \
  --data-urlencode 'addresses[1][postal_code]=C1N 1C4' \
  --data-urlencode 'addresses[1][country]=CA' \
```

```python
with ApiClient(configuration) as api_client:
  api = IntlVerificationsApi(api_client)

verification_data_0 = MultipleComponentsIntl(
  primary_line = "35 Tower Hill",
  city = "London",
  postal_code = "EC3N 4DR",
  country = CountryExtended("GB"),
)

verification_data_1 = MultipleComponentsIntl(
  primary_line = "370 Water St",
  city = "Summerside",
  state = "Prince Edward Island",
  postal_code = "C1N 1C4",
  country = CountryExtended("CA"),
)

address_list = IntlVerificationsPayload(
  addresses = [
    verification_data_0,
    verification_data_1,
  ],
)

try:
  bulk_verified = api.verifyBulk(address_list)
except ApiException as e:
  print(e)
```


text:
package com.nucleus.vulkan.lwjgl3;

import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
import java.util.ArrayList;

import org.lwjgl.PointerBuffer;
import org.lwjgl.glfw.GLFWVulkan;
import org.lwjgl.system.MemoryUtil;
import org.lwjgl.vulkan.KHRSurface;
import org.lwjgl.vulkan.KHRSwapchain;
import org.lwjgl.vulkan.VK10;
import org.lwjgl.vulkan.VkApplicationInfo;
import org.lwjgl.vulkan.VkDevice;
import org.lwjgl.vulkan.VkDeviceCreateInfo;
import org.lwjgl.vulkan.VkDeviceQueueCreateInfo;
import org.lwjgl.vulkan.VkExtensionProperties;
import org.lwjgl.vulkan.VkExtent2D;
import org.lwjgl.vulkan.VkImageViewCreateInfo;
import org.lwjgl.vulkan.VkInstance;
import org.lwjgl.vulkan.VkInstanceCreateInfo;
import org.lwjgl.vulkan.VkPhysicalDevice;
import org.lwjgl.vulkan.VkPhysicalDeviceFeatures;
import org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties;
import org.lwjgl.vulkan.VkPhysicalDeviceProperties;
import org.lwjgl.vulkan.VkPipelineShaderStageCreateInfo;
import org.lwjgl.vulkan.VkQueue;
import org.lwjgl.vulkan.VkShaderModuleCreateInfo;
import org.lwjgl.vulkan.VkSurfaceCapabilitiesKHR;
import org.lwjgl.vulkan.VkSurfaceFormatKHR;
import org.lwjgl.vulkan.VkSwapchainCreateInfoKHR;

import com.nucleus.SimpleLogger;
import com.nucleus.common.BufferUtils;
import com.nucleus.renderer.NucleusRenderer.Renderers;
import com.nucleus.vulkan.LWJGLPhysicalDeviceMemoryProperties;
import com.nucleus.vulkan.LWJGLQueue;
import com.nucleus.vulkan.LWJGLVkQueueFamilyProperties;
import com.nucleus.vulkan.LWJGLVulkanDeviceFeatures;
import com.nucleus.vulkan.LWJGLVulkanLimits;
import com.nucleus.vulkan.PhysicalDevice;
import com.nucleus.vulkan.Queue;
import com.nucleus.vulkan.Vulkan10;
import com.nucleus.vulkan.Vulkan10.ColorSpaceKHR;
import com.nucleus.vulkan.Vulkan10.ComponentMapping;
import com.nucleus.vulkan.Vulkan10.Extensions;
import com.nucleus.vulkan.Vulkan10.Format;
import com.nucleus.vulkan.Vulkan10.ImageSubresourceRange;
import com.nucleus.vulkan.Vulkan10.ImageViewType;
import com.nucleus.vulkan.Vulkan10.PipelineCreateFlagBits;
import com.nucleus.vulkan.Vulkan10.PresentModeKHR;
import com.nucleus.vulkan.Vulkan10.ShaderStageFlagBits;
import com.nucleus.vulkan.Vulkan10.SurfaceFormat;
import com.nucleus.vulkan.Vulkan11Wrapper;
import com.nucleus.vulkan.shader.VulkanShaderBinary;
import com.nucleus.vulkan.structs.DeviceLimits;
import com.nucleus.vulkan.structs.ExtensionProperties;
import com.nucleus.vulkan.structs.Extent2D;
import com.nucleus.vulkan.structs.GraphicsPipelineCreateInfo;
import com.nucleus.vulkan.structs.GraphicsPipelines;
import com.nucleus.vulkan.structs.Image;
import com.nucleus.vulkan.structs.ImageView;
import com.nucleus.vulkan.structs.ImageViewCreateInfo;
import com.nucleus.vulkan.structs.PhysicalDeviceFeatures;
import com.nucleus.vulkan.structs.PhysicalDeviceMemoryProperties;
import com.nucleus.vulkan.structs.PhysicalDeviceProperties;
import com.nucleus.vulkan.structs.PipelineShaderStageCreateInfo;
import com.nucleus.vulkan.structs.PipelineShaderStageCreateInfo.SpecializationInfo;
import com.nucleus.vulkan.structs.QueueFamilyProperties;
import com.nucleus.vulkan.structs.ShaderModule;
import com.nucleus.vulkan.structs.ShaderModuleCreateInfo;
import com.nucleus.vulkan.structs.SwapChain;

public class LWJGL3Vulkan11Wrapper extends Vulkan11Wrapper {

    private static final ByteBuffer KHR_swapchain = MemoryUtil.memASCII(Vulkan10.Extensions.VK_KHR_swapchain.name());
    private static final ByteBuffer EXT_debug_report = MemoryUtil
            .memASCII(Vulkan10.Extensions.VK_EXT_debug_report.name());

    private final PointerBuffer logicalDeviceExtensions = MemoryUtil.memAllocPointer(8);
    private final PointerBuffer pointer = MemoryUtil.memAllocPointer(1);
    private final PointerBuffer instanceExtensions = MemoryUtil.memAllocPointer(64);

    IntBuffer ib = BufferUtils.createIntBuffer(1);
    LongBuffer lb = BufferUtils.createLongBuffer(1);

    public class Device implements PhysicalDevice {

        private Device(long deviceAdress, long surface) {
            device = new VkPhysicalDevice(deviceAdress, instance);
            readExtensions(device);
            deviceProperties = new DeviceProperties(device);
            deviceFeatures = new LWJGLVulkanDeviceFeatures(device, surface);
            readQueueProperties(device, surface);
        }

        protected void readQueueProperties(VkPhysicalDevice device, long surface) {
            int[] queueCount = new int[1];
            VK10.vkGetPhysicalDeviceQueueFamilyProperties(device, queueCount, null);
            org.lwjgl.vulkan.VkQueueFamilyProperties.Buffer queueProperties = org.lwjgl.vulkan.VkQueueFamilyProperties
                    .malloc(queueCount[0]);
            queueFamilyProperties = new QueueFamilyProperties[queueCount[0]];
            VK10.vkGetPhysicalDeviceQueueFamilyProperties(device, queueCount, queueProperties);
            queueProperties.rewind();
            for (int i = 0; i < queueFamilyProperties.length; i++) {
                queueFamilyProperties[i] = new LWJGLVkQueueFamilyProperties(queueProperties.get(), i,
                        device, surface);
            }
        }

        protected void readExtensions(VkPhysicalDevice device) {
            VK10.vkEnumerateDeviceExtensionProperties(device, (String) null, ib, null);
            if (ib.get(0) > 0) {
                int count = ib.get(0);
                extensionProperties = new ExtensionProperties[count];
                VkExtensionProperties.Buffer extensions = VkExtensionProperties.mallocStack(count);
                VK10.vkEnumerateDeviceExtensionProperties(device, (String) null, ib, extensions);
                for (int i = 0; i < count; i++) {
                    extensions.position(i);
                    extensionProperties[i] = new ExtensionProperties(extensions.extensionNameString(),
                            extensions.specVersion());
                }
            }
        }

        private VkPhysicalDevice device;
        private DeviceProperties deviceProperties;
        private com.nucleus.vulkan.LWJGLVulkanDeviceFeatures deviceFeatures;
        private QueueFamilyProperties[] queueFamilyProperties;
        private ExtensionProperties[] extensionProperties;

        protected VkPhysicalDevice getVkPhysicalDevice() {
            return device;
        }

        @Override
        public String toString() {
            String result = deviceProperties.toString() + "\n";
            result += deviceFeatures.toString();
            result += "Queue support: \n";
            for (int i = 0; i < queueFamilyProperties.length; i++) {
                result += queueFamilyProperties[i].toString();
            }
            ExtensionProperties[] extensions = getExtensions();
            if (extensions != null) {
                result += "Extension support: \n";
                for (ExtensionProperties ep : extensions) {
                    result += ep.getName() + "\n";
                }
            }
            return result;
        }

        @Override
        public PhysicalDeviceProperties getProperties() {
            return deviceProperties;
        }

        @Override
        public PhysicalDeviceFeatures getFeatures() {
            return deviceFeatures;
        }

        @Override
        public QueueFamilyProperties[] getQueueFamilyProperties() {
            return queueFamilyProperties;
        }

        @Override
        public ExtensionProperties[] getExtensions() {
            return extensionProperties;
        }

        @Override
        public ExtensionProperties getExtension(String extensionName) {
            if (extensionProperties != null) {
                for (ExtensionProperties ep : extensionProperties) {
                    if (extensionName.equalsIgnoreCase(ep.getName())) {
                        return ep;
                    }
                }
            }
            return null;
        }
    }

    public class DeviceProperties implements PhysicalDeviceProperties {

        private VkPhysicalDeviceProperties deviceProperties;
        private APIVersion apiVersion;
        private LWJGLVulkanLimits limits;

        public DeviceProperties(VkPhysicalDevice device) {
            deviceProperties = VkPhysicalDeviceProperties.malloc();
            VK10.vkGetPhysicalDeviceProperties(device, deviceProperties);
            apiVersion = new APIVersion(deviceProperties.apiVersion());
            limits = new LWJGLVulkanLimits(deviceProperties.limits());
        }

        @Override
        public PhysicalDeviceType getDeviceType() {
            return PhysicalDeviceType.get(deviceProperties.deviceType());
        }

        @Override
        public String getDeviceName() {
            return deviceProperties.deviceNameString();
        }

        @Override
        public APIVersion getAPIVersion() {
            return apiVersion;
        }

        @Override
        public DeviceLimits getLimits() {
            return limits;
        }

        @Override
        public String toString() {
            String result = getDeviceName() + ", " + getAPIVersion() + ", "
                    + getDeviceType() + "\n" + "Device limits:\n" +
                    getLimits().toString();
            return result;

        }

    }

    private VkInstance instance;
    private long surface;
    private VkDevice deviceInstance;

    /**
     * Internal constructor - DO NOT USE
     *
     * @param version
     * @param window
     */
    public LWJGL3Vulkan11Wrapper(Renderers version, long window) {
        super(version);
        init(window);
        init();
    }

    protected void init(long window) {
        if (!GLFWVulkan.glfwVulkanSupported()) {
            // throw new AssertionError("GLFW failed to find the Vulkan loader");
        }

        /* Look for instance extensions */
        PointerBuffer requiredExtensions = GLFWVulkan.glfwGetRequiredInstanceExtensions();
        if (requiredExtensions == null) {
            throw new AssertionError("Failed to find list of required Vulkan extensions");
        }

        addExtensions(instanceExtensions, requiredExtensions);
        instanceExtensions.put(EXT_debug_report);

        instanceExtensions.flip();
        instance = createInstance(instanceExtensions);
        SimpleLogger.d(getClass(), "Created Vulkan");
        MemoryUtil.memFree(instanceExtensions);

        long[] s = new long[1];
        if (GLFWVulkan.glfwCreateWindowSurface(instance, window, null, s) != VK10.VK_SUCCESS) {
            throw new IllegalArgumentException("Could not create GLFW window surface");
        }
        surface = s[0];
    }

    protected void addExtensions(PointerBuffer extensionNames, PointerBuffer requiredExtensions) {
        for (int i = 0; i < requiredExtensions.capacity(); i++) {
            extensionNames.put(requiredExtensions.get(i));
        }
    }

    @Override
    protected PhysicalDevice[] fetchDevices() {
        int[] deviceCount = new int[1];
        if (VK10.vkEnumeratePhysicalDevices(instance, deviceCount, null) == VK10.VK_SUCCESS) {
            Device[] devices = new Device[deviceCount[0]];
            PointerBuffer pb = null;
            try {
                pb = MemoryUtil.memAllocPointer(deviceCount[0]);
                if (VK10.vkEnumeratePhysicalDevices(instance, deviceCount, pb) == VK10.VK_SUCCESS) {
                    fetchDevices(pb, devices);
                } else {
                    throw new IllegalArgumentException("Failed to enumerate physical devices");
                }
                return devices;
            } finally {
                MemoryUtil.memFree(pb);
            }
        } else {
            throw new IllegalArgumentException("Failed to enumerate number of physical devices in system.");
        }
    }

    private void fetchDevices(PointerBuffer pb, Device[] devices) {
        pb.rewind();
        int index = 0;
        while (pb.remaining() > 0) {
            devices[index] = new Device(pb.get(), surface);
            index++;
        }
    }

    private VkInstance createInstance(PointerBuffer extensions) {
        VkApplicationInfo appInfo = VkApplicationInfo.calloc()
                .sType(VK10.VK_STRUCTURE_TYPE_APPLICATION_INFO)
                .pApplicationName(MemoryUtil.memUTF8("LWJGL Vulkan Demo"))
                .pEngineName(MemoryUtil.memUTF8("graphics-by-vulkan"))
                .apiVersion(VK10.VK_MAKE_VERSION(1, 0, 2));

        VkInstanceCreateInfo pCreateInfo = VkInstanceCreateInfo.calloc()
                .sType(VK10.VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO) // <- identifies what kind of struct this is (this
                                                                    // is
                // useful for extending the struct type later)
                .pNext(MemoryUtil.NULL) // <- must always be NULL until any next Vulkan version tells otherwise
                .pApplicationInfo(appInfo) // <- the application info we created above
                .ppEnabledExtensionNames(extensions); // <- and the extension names themselves
        // created VkInstance
        int err = VK10.vkCreateInstance(pCreateInfo, null, pointer);
        long instance = pointer.get(0); // <- get the VkInstance handle
        // Check whether we succeeded in creating the VkInstance
        if (err != VK10.VK_SUCCESS) {
            throw new AssertionError("Failed to create VkInstance: " + err);
        }
        // Create an object-oriented wrapper around the simple VkInstance long handle
        // This is needed by LWJGL to later "dispatch" (i.e. direct calls to) the right Vukan functions.
        VkInstance ret = new VkInstance(instance, pCreateInfo);

        // Now we can free/deallocate everything
        pCreateInfo.free();
        MemoryUtil.memFree(appInfo.pApplicationName());
        MemoryUtil.memFree(appInfo.pEngineName());
        appInfo.free();
        return ret;
    }

    @Override
    public void destroy() {
        if (instance != null) {
            VK10.vkDestroyInstance(instance, null);
            instance = null;
        }
    }

    @Override
    protected void createLogicalDevice(PhysicalDevice device, QueueFamilyProperties selectedQueue) {

        VkPhysicalDeviceFeatures features = VkPhysicalDeviceFeatures.calloc();
        device.getFeatures().copy(features);

        FloatBuffer prios = BufferUtils.createFloatBuffer(selectedQueue.getQueueCount());
        prios.rewind();
        VkDeviceQueueCreateInfo.Buffer queue = VkDeviceQueueCreateInfo.mallocStack(1)
                .sType(VK10.VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO)
                .pNext(MemoryUtil.NULL)
                .flags(0)
                .queueFamilyIndex(selectedQueue.getQueueIndex())
                .pQueuePriorities(prios);

        logicalDeviceExtensions.put(KHR_swapchain);
        logicalDeviceExtensions.flip();
        VkDeviceCreateInfo deviceInfo = VkDeviceCreateInfo.malloc();
        deviceInfo.sType(VK10.VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
                .pNext(MemoryUtil.NULL)
                .flags(0)
                .pQueueCreateInfos(queue)
                .ppEnabledLayerNames(null)
                .ppEnabledExtensionNames(logicalDeviceExtensions)
                .pEnabledFeatures(features);

        VkPhysicalDevice physicalDevice = ((Device) device).getVkPhysicalDevice();

        assertResult(VK10.vkCreateDevice(physicalDevice, deviceInfo, null, pointer));

        deviceInstance = new VkDevice(pointer.get(0), physicalDevice, deviceInfo);
        SimpleLogger.d(getClass(), "Created Vulkan instance");
    }

    @Override
    protected Queue createQueue(QueueFamilyProperties selectedQueue) {
        VK10.vkGetDeviceQueue(deviceInstance, selectedQueue.getQueueIndex(), 0, pointer);
        VkQueue queue = new VkQueue(pointer.get(0), deviceInstance);
        return new LWJGLQueue(queue);
    }

    @Override
    protected ArrayList<SurfaceFormat> getSurfaceFormats(PhysicalDevice device) {
        VkPhysicalDevice vkDevice = ((Device) device).getVkPhysicalDevice();
        assertResult(KHRSurface.vkGetPhysicalDeviceSurfaceFormatsKHR(vkDevice, surface, ib, null));
        VkSurfaceFormatKHR.Buffer surfaceFormats = VkSurfaceFormatKHR.malloc(ib.get(0));
        assertResult(KHRSurface.vkGetPhysicalDeviceSurfaceFormatsKHR(vkDevice, surface, ib, surfaceFormats));

        ArrayList<SurfaceFormat> result = new ArrayList<SurfaceFormat>();

        surfaceFormats.rewind();
        while (surfaceFormats.hasRemaining()) {
            VkSurfaceFormatKHR vkSF = surfaceFormats.get();
            Format format = Format.get(vkSF.format());
            ColorSpaceKHR space = ColorSpaceKHR.get(vkSF.colorSpace());
            if (format != null && space != null) {
                SurfaceFormat sf = new SurfaceFormat(format, space);
                result.add(sf);
                SimpleLogger.d(getClass(), "Added surfaceformat: " + sf);
            } else {
                SimpleLogger.d(getClass(), "Error - could not find surfaceformat or colorspace");
            }
        }
        return result;
    }

    @Override
    protected ArrayList<PresentModeKHR> getPresentModes(PhysicalDevice device) {
        ArrayList<PresentModeKHR> result = new ArrayList<>();
        VkPhysicalDevice vkDevice = ((Device) device).getVkPhysicalDevice();
        assertResult(KHRSurface.vkGetPhysicalDeviceSurfacePresentModesKHR(vkDevice, surface, ib, null));
        IntBuffer presentModes = BufferUtils.createIntBuffer(ib.get(0));
        assertResult(KHRSurface.vkGetPhysicalDeviceSurfacePresentModesKHR(vkDevice, surface, ib, presentModes));

        presentModes.rewind();
        while (presentModes.hasRemaining()) {
            int v = presentModes.get();
            PresentModeKHR mode = PresentModeKHR.get(v);
            if (mode != null) {
                SimpleLogger.d(getClass(), "Added presentmode " + mode);
                result.add(mode);
            } else {
                SimpleLogger.d(getClass(), "Error - no presentmode for: " + v);
            }
        }
        return result;
    }

    @Override
    protected Extent2D selectSwapExtent(PhysicalDevice device) {
        VkPhysicalDevice vkDevice = ((Device) device).getVkPhysicalDevice();
        VkSurfaceCapabilitiesKHR surfaceCaps = VkSurfaceCapabilitiesKHR.malloc();
        assertResult(KHRSurface.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vkDevice, surface, surfaceCaps));

        Extent2D result = new Extent2D(surfaceCaps.currentExtent().width(), surfaceCaps.currentExtent().height());

        if (surfaceCaps.currentExtent().width() == 0xFFFFFFFF) {
            // If the surface size is undefined, the size is set to the size
            // of the images requested, which must fit within the minimum and
            // maximum values.
            if (result.getWidth() < surfaceCaps.minImageExtent().width()) {
                result.setWidth(surfaceCaps.minImageExtent().width());
            } else if (result.getWidth() > surfaceCaps.maxImageExtent().width()) {
                result.setWidth(surfaceCaps.maxImageExtent().width());
            }

            if (result.getHeight() < surfaceCaps.minImageExtent().height()) {
                result.setHeight(surfaceCaps.minImageExtent().height());
            } else if (result.getHeight() > surfaceCaps.maxImageExtent().height()) {
                result.setHeight(surfaceCaps.maxImageExtent().height());
            }
        }
        return result;
    }

    @Override
    protected SwapChain createSwapChain(PhysicalDevice device, SurfaceFormat surfaceFormat, Extent2D swapChainExtent,
            PresentModeKHR presentMode) {

        if (device.getExtension(Extensions.VK_KHR_swapchain.name()) == null) {
            throw new IllegalArgumentException("Device has no support for " + Extensions.VK_KHR_swapchain);
        }

        VkExtent2D scExtent = VkExtent2D.malloc();
        scExtent.set(swapChainExtent.getWidth(), swapChainExtent.getHeight());
        VkSwapchainCreateInfoKHR swapchainInfo = VkSwapchainCreateInfoKHR.calloc()
                .sType(KHRSwapchain.VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
                .surface(surface)
                .minImageCount(1)
                .imageFormat(surfaceFormat.getFormat().value)
                .imageColorSpace(surfaceFormat.getColorSpace().value)
                .imageExtent(scExtent)
                .imageArrayLayers(1)
                .imageUsage(VK10.VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
                .imageSharingMode(VK10.VK_SHARING_MODE_EXCLUSIVE)
                .compositeAlpha(KHRSurface.VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
                .presentMode(presentMode.value)
                .clipped(true);

        assertResult(KHRSwapchain.vkCreateSwapchainKHR(deviceInstance, swapchainInfo, null, lb));

        // If we just re-created an existing swapchain, we should destroy the old
        // swapchain at this point.

        assertResult(KHRSwapchain.vkGetSwapchainImagesKHR(deviceInstance, lb.get(0), ib, null));
        return new SwapChain(lb.get(0), ib.get(0));
    }

    @Override
    protected ImageView[] createImageViews(SwapChain swapChain, SurfaceFormat surfaceFormat) {
        int bufferCount = swapChain.imageCount;
        ib.rewind();
        ib.put(bufferCount);
        ib.rewind();
        LongBuffer swapchainImages = BufferUtils.createLongBuffer(bufferCount);
        assertResult(KHRSwapchain.vkGetSwapchainImagesKHR(deviceInstance, swapChain.swapChain, ib, swapchainImages));

        ImageView[] result = new ImageView[bufferCount];

        ImageViewType type = ImageViewType.VK_IMAGE_VIEW_TYPE_2D;
        Format format = surfaceFormat.getFormat();
        ComponentMapping components = new ComponentMapping();
        ImageSubresourceRange range = new ImageSubresourceRange(VK10.VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1);
        for (int i = 0; i < bufferCount; i++) {
            Image image = new Image(swapchainImages.get(i));
            ImageViewCreateInfo createInfo = new ImageViewCreateInfo(image, type, format, components, range);
            result[i] = createImageView(createInfo);
        }
        return result;
    }

    @Override
    protected PhysicalDeviceMemoryProperties getMemoryProperties(PhysicalDevice device) {
        VkPhysicalDevice vkDevice = ((Device) device).getVkPhysicalDevice();

        VkPhysicalDeviceMemoryProperties p = VkPhysicalDeviceMemoryProperties.malloc();
        VK10.vkGetPhysicalDeviceMemoryProperties(vkDevice, p);
        PhysicalDeviceMemoryProperties memoryProperties = new LWJGLPhysicalDeviceMemoryProperties(p);

        return memoryProperties;

    }

    @Override
    protected ImageView createImageView(ImageViewCreateInfo createInfo) {

        VkImageViewCreateInfo color_attachment_view = VkImageViewCreateInfo.malloc()
                .sType(VK10.VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
                .pNext(MemoryUtil.NULL)
                .flags(0)
                .image(createInfo.image.image)
                .viewType(VK10.VK_IMAGE_VIEW_TYPE_2D)
                .format(createInfo.format.value)
                .components(it -> it
                        .r(createInfo.components.r.value)
                        .g(createInfo.components.g.value)
                        .b(createInfo.components.r.value)
                        .a(createInfo.components.r.value))
                .subresourceRange(it -> it
                        .aspectMask(createInfo.subresourceRange.aspectMask)
                        .baseMipLevel(createInfo.subresourceRange.baseMipLevel)
                        .levelCount(createInfo.subresourceRange.layerCount)
                        .baseArrayLayer(createInfo.subresourceRange.baseArrayLayer)
                        .layerCount(createInfo.subresourceRange.layerCount));

        assertResult(VK10.vkCreateImageView(deviceInstance, color_attachment_view, null, lb));
        long view = lb.get(0);
        return new ImageView(createInfo.image, view);
    }

    @Override
    protected ShaderModule createShaderModule(VulkanShaderBinary binary) {
        binary.getBuffer().rewind();
        VkShaderModuleCreateInfo info = VkShaderModuleCreateInfo.calloc()
                .sType(VK10.VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
                .pNext(MemoryUtil.NULL)
                .pCode(binary.getBuffer())
                .flags(0);
        long codesize = info.codeSize();
        SimpleLogger.d(getClass(), "Codesize=" + codesize);
        assertResult(VK10.vkCreateShaderModule(deviceInstance, info, null, lb));
        return new ShaderModule(new ShaderModuleCreateInfo(binary), lb.get(0));
    }

    @Override
    protected PipelineShaderStageCreateInfo createShaderStageInfo(PipelineCreateFlagBits[] flags,
            ShaderStageFlagBits stage, ShaderModule module, String name, SpecializationInfo specializationInfo) {
        ByteBuffer pName = BufferUtils.createByteBuffer(name.length());
        pName.put(name.getBytes());
        pName.rewind();
        VkPipelineShaderStageCreateInfo info = VkPipelineShaderStageCreateInfo.calloc()
                .sType(VK10.VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO)
                .pNext(MemoryUtil.NULL)
                .stage(stage.value)
                .flags(PipelineCreateFlagBits.getMask(flags))
                .pName(pName);

        return null;
    }

    @Override
    protected GraphicsPipelines createGraphicsPipelines(GraphicsPipelineCreateInfo info) {
        // TODO Auto-generated method stub
        return null;
    }

}


text:
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()

# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np

import moldesign as mdt
from .. import units as u
from ..utils import exports
from .base import EnergyModelBase

@exports
class Spring(EnergyModelBase):
    """Two atoms attached by a spring"""

    DEFAULT_PROPERTIES = ['potential_energy',
                          'force']
    ALL_PROPERTIES = DEFAULT_PROPERTIES

    PARAMETERS = [
        mdt.parameters.Parameter(
            'k', 'Spring constant',
            type=u.eV/u.angstrom**2),
        mdt.parameters.Parameter(
            'd0', 'Equilibrium distance',
            type=u.angstrom)]

    def prep(self):
        assert self.mol.natoms == 2
        self._prepped = True

    def calculate(self, requests):
        dvec = self.mol.atoms[1].position - self.mol.atoms[0].position
        dist = np.sqrt(dvec.dot(dvec))
        pe = 0.5 * self.params.k * (dist - self.params.d0)**2
        f = self.params.k * dvec * (dist - self.params.d0) / dist
        forcearray = u.array([f, -f])
        return {'potential_energy': pe,
                'forces': forcearray}

@exports
class HarmonicOscillator(EnergyModelBase):
    """ Applies a harmonic potential (centered at 0) to the x-component of every atom
    """
    PARAMETERS = [
        mdt.parameters.Parameter(
            'k', 'Spring constant',
            type=u.eV/u.angstrom**2)]

    def prep(self):
        if self.params.k.dimensionality != (u.eV/u.angstrom**2).dimensionality:
            raise u.DimensionalityError("Spring constant must have dimensions of energy/length^2")
        return True

    def calculate(self, requests):
        self.prep()
        energy = 0.5 * self.params.k * np.sum(self.mol.positions[:, 0]**2)
        forces = np.zeros((self.mol.num_atoms, 3)) * u.default.force
        forces[:, 0] = - self.params.k * self.mol.positions[:, 0]
        return dict(potential_energy=energy, forces=forces)


text:
#pragma once
#include <aws/appflow/Appflow_EXPORTS.h>
#include <aws/appflow/AppflowRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/appflow/model/ConnectorType.h>
#include <utility>

namespace Aws
{
namespace Appflow
{
namespace Model
{

  /**
   */
  class AWS_APPFLOW_API DescribeConnectorsRequest : public AppflowRequest
  {
  public:
    DescribeConnectorsRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DescribeConnectors"; }

    Aws::String SerializePayload() const override;

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline const Aws::Vector<ConnectorType>& GetConnectorTypes() const{ return m_connectorTypes; }

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline bool ConnectorTypesHasBeenSet() const { return m_connectorTypesHasBeenSet; }

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline void SetConnectorTypes(const Aws::Vector<ConnectorType>& value) { m_connectorTypesHasBeenSet = true; m_connectorTypes = value; }

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline void SetConnectorTypes(Aws::Vector<ConnectorType>&& value) { m_connectorTypesHasBeenSet = true; m_connectorTypes = std::move(value); }

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline DescribeConnectorsRequest& WithConnectorTypes(const Aws::Vector<ConnectorType>& value) { SetConnectorTypes(value); return *this;}

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline DescribeConnectorsRequest& WithConnectorTypes(Aws::Vector<ConnectorType>&& value) { SetConnectorTypes(std::move(value)); return *this;}

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline DescribeConnectorsRequest& AddConnectorTypes(const ConnectorType& value) { m_connectorTypesHasBeenSet = true; m_connectorTypes.push_back(value); return *this; }

    /**
     *
 The type of connector, such as Salesforce, Amplitude, and so on.

     */
    inline DescribeConnectorsRequest& AddConnectorTypes(ConnectorType&& value) { m_connectorTypesHasBeenSet = true; m_connectorTypes.push_back(std::move(value)); return *this; }

    /**
     *
The maximum number of items that should be returned in the result set. The
     * default is 20.

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
The maximum number of items that should be returned in the result set. The
     * default is 20.

     */
    inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }

    /**
     *
The maximum number of items that should be returned in the result set. The
     * default is 20.

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
The maximum number of items that should be returned in the result set. The
     * default is 20.

     */
    inline DescribeConnectorsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
 The pagination token for the next page of data.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
 The pagination token for the next page of data.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
 The pagination token for the next page of data.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
 The pagination token for the next page of data.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
 The pagination token for the next page of data.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
 The pagination token for the next page of data.

     */
    inline DescribeConnectorsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
 The pagination token for the next page of data.

     */
    inline DescribeConnectorsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
 The pagination token for the next page of data.

     */
    inline DescribeConnectorsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    Aws::Vector<ConnectorType> m_connectorTypes;
    bool m_connectorTypesHasBeenSet;

    int m_maxResults;
    bool m_maxResultsHasBeenSet;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet;
  };

} // namespace Model
} // namespace Appflow
} // namespace Aws


text:
name             "sensu"
maintainer       "Heavy Water Operations"
maintainer_email "support@sensuapp.com"
license          "Apache 2.0"
description      "Installs/Configures Sensu"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "3.2.0"

# available @ https://supermarket.chef.io/cookbooks/apt
depends "apt", ">= 2.0"

# available @ https://supermarket.chef.io/cookbooks/yum
depends "yum", ">= 3.0"

# available @ https://supermarket.chef.io/cookbooks/windows
depends "windows", ">= 1.36"

# available @ https://supermarket.chef.io/cookbooks/ms_dotnet
depends "ms_dotnet", ">= 2.6.1"

# available @ https://supermarket.chef.io/cookbooks/rabbitmq
depends "rabbitmq", ">= 2.0.0"

# available @ https://supermarket.chef.io/cookbooks/redisio
depends "redisio", ">= 1.7.0"

# available @ https://supermarket.chef.io/cookbooks/chef-vault
suggests "chef-vault", ">= 1.3.1"

%w[
  aix
  ubuntu
  debian
  centos
  redhat
  fedora
  scientific
  oracle
  amazon
  windows
].each do |os|
  supports os
end

source_url 'https://github.com/sensu/sensu-chef'
issues_url 'https://github.com/sensu/sensu-chef/issues'
chef_version '>= 12.0'