text:
<!DOCTYPE HTML>

<title>Uses of Class com.trendyol.jdempotent.core.model.IdempotentRequestWrapper (Jdempotent-core 1.0.2 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-12-19">
<meta name="description" content="use: package: com.trendyol.jdempotent.core.model, class: IdempotentRequestWrapper">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

Uses of Class
com.trendyol.jdempotent.core.model.IdempotentRequestWrapper

Packages that use IdempotentRequestWrapper

Package
Description

com.trendyol.jdempotent.core.datasource

com.trendyol.jdempotent.core.generator

com.trendyol.jdempotent.core.model

Uses of IdempotentRequestWrapper in com.trendyol.jdempotent.core.datasource

Methods in com.trendyol.jdempotent.core.datasource with parameters of type IdempotentRequestWrapper

Modifier and Type
Method
Description

void
AbstractIdempotentRepository.setResponse(IdempotencyKey key,
IdempotentRequestWrapper request,
IdempotentResponseWrapper idempotentResponse)

void
IdempotentRepository.setResponse(IdempotencyKey key,
IdempotentRequestWrapper request,
IdempotentResponseWrapper idempotentResponse)

void
AbstractIdempotentRepository.store(IdempotencyKey key,
IdempotentRequestWrapper request)

void
IdempotentRepository.store(IdempotencyKey key,
IdempotentRequestWrapper requestObject)

Uses of IdempotentRequestWrapper in com.trendyol.jdempotent.core.generator

Methods in com.trendyol.jdempotent.core.generator with parameters of type IdempotentRequestWrapper

Modifier and Type
Method
Description

IdempotencyKey
DefaultKeyGenerator.generateIdempotentKey(IdempotentRequestWrapper requestObject,
String listenerName,
StringBuilder builder,
MessageDigest messageDigest)

Generates a idempotent key for incoming event

IdempotencyKey
KeyGenerator.generateIdempotentKey(IdempotentRequestWrapper requestObject,
String listenerName,
StringBuilder builder,
MessageDigest messageDigest)

Uses of IdempotentRequestWrapper in com.trendyol.jdempotent.core.model

Methods in com.trendyol.jdempotent.core.model that return IdempotentRequestWrapper

Modifier and Type
Method
Description

IdempotentRequestWrapper
IdempotentRequestResponseWrapper.getRequest()

Constructors in com.trendyol.jdempotent.core.model with parameters of type IdempotentRequestWrapper

Constructor
Description

IdempotentRequestResponseWrapper(IdempotentRequestWrapper request)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Copyright © 2020. All rights reserved.


text:
<?php

use Symfony\Component\Translation\MessageCatalogue;

$catalogue = new MessageCatalogue('rs', array (
  'messages' =>
  array (
    'Domov' => 'Dom',
    'O nas' => 'O nama',
    'Novice' => 'Vesti',
    'Izleti' => 'Izleti',
    'Povpraševanje' => 'potražnja',
    'Galerija' => 'Galerija',
    'Galerija slik' => 'Galerija slika',
    'Video Galerija' => 'Video galerija',
    'Kontakt' => 'Kontaktirajte nas',
    'Telefon' => 'Telefon',
    'Elektronska pošta' => 'E-mail',
    'Shrani' => 'Sačuvati',
    'Naročilo' => 'Naruđba',
    'Naročilo transporta' => 'Naruđba transporta',
    'Pošlji' => 'Pošalji',
    'Naroči' => 'Naručiti',
    'Nazaj' => 'Nazad',
    'Več' => 'More',
    'Ponujamo izlet na naslednjo destinacijo' => 'Nudimo izlet na sledeće destinaciju',
    'V izdelavi' => 'U izgradnji',
    'Ime' => 'Ime',
    'Podjetje' => 'Kompanija',
    'Email' => 'E-mail',
    'Vnos besedila' => 'Umetnite text',
    'Dobrodošli na naši spletni strani' => 'Dobro došli na našu web stranicu.',
    'Smo podjetje, ki je specializirano za opravljanje prevozov v Sloveniji in v tujini. Vedno urejeni vozniki z urejenimi vozili Vam nudijo kvaliteto storitev. Prevozi, ki jih opravljamo so lahko na določene destinacije ali kamorkoli na Vašo željo.' => 'Mi smo firma koja je specijalizovana za pružanje usluga u Sloveniji i inostranstvu . Naši pouzdani vozači nude Vam kvalitetne usluge u uređenim vozilima. Usluge koje pružamo mogu biti na određenom mestu ili bilo gde na Vaš zahtev.',
    'Zagotavljamo hitro odzivnost glede na Vaše potrebe.' => 'Garantujemo Vam brzo vreme odziva prema Vašim potrebama.',
    'Z našimi vozili bo vožnja vedno udobna in varna, saj vozila spadajo v višji cenovni razred, prav tako pa tudi v najvišji razred varnosti.' => 'Vožnja našim vozilima će Vam biti udobna i sigurna,  jer vozila pripadaju višem cenovnom rangu, kao i najvišem razredu sigurnosti.',
    'Galerijo vozil si lahko ogledate na naši spletni strani. Nudimo tudi enodnevne ali večdnevne najeme vozil z urejenimi vozniki, kateri Vas popeljejo po raznih opravkih ali  sestankih, Vas tam počakajo in na koncu dneva poskrbijo, da prispete varno domov ali v hotel.' => 'Galeriju naših vozila možete pogledati na našoj web stranici. Takođe nudimo jednodnevni ili višednevni najam vozila sa uređenim vozačima, koji Vas mogu odvesti na različite krajeve ili sastanke. Vozači će Vas sačekati, da sredite sve što morate, te Vas nakon toga sigurno odvesti do boravka ili hotela.',
    'Organiziramo tudi izlete po raznih krajih v Sloveniji. Naš voznik Vas na kraju počaka in Vas varno pripelje tudi nazaj. Kraje in zanimive destinacije si lahko ogledate na naši spletni strani.' => 'Takođe organizujemo  izlete po različitim mestima u Sloveniji . Naš vozač će Vas sačekati i odvesti nazad. Sva mesta i zanimljive destinacije možete naći na našoj web stranici.',
    'Za vse informacije nas lahko kontaktirate preko telefona ali elektronske pošte. V najkrajšem možnem času Vas bomo kontaktirali in Vam posredovali željene informacije.' => 'Za sve informacije možete nas kontaktirati putem telefona ili e-pošte,  a mi ćemo Vas pokušati kontaktirati u najkraćem mogućem vremenu i pružiti Vam potrebne informacije.',
    'Zahvaljujemo se Vam za obisk naše spletne strani.' => 'Hvala Vam na poseti naše stranice.',
  ),
));

$catalogueSl = new MessageCatalogue('sl', array (
  'validators' =>
  array (
    'This value should be false.' => 'Vrednost bi morala biti nepravilna (false).',
    'This value should be true.' => 'Vrednost bi morala biti pravilna (true).',
    'This value should be of type {{ type }}.' => 'Vrednost mora biti naslednjega tipa {{ type }}.',
    'This value should be blank.' => 'Vrednost mora biti prazna.',
    'The value you selected is not a valid choice.' => 'Vrednost, ki ste jo izbrali, ni veljavna možnost.',
    'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.' => 'Izbrati morate vsaj {{ limit }} možnost.|Izbrati morate vsaj {{ limit }} možnosti.|Izbrati morate vsaj {{ limit }} možnosti.|Izbrati morate vsaj {{ limit }} možnosti.',
    'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.' => 'Izberete lahko največ {{ limit }} možnost.|Izberete lahko največ {{ limit }} možnosti.|Izberete lahko največ {{ limit }} možnosti.|Izberete lahko največ {{ limit }} možnosti.',
    'One or more of the given values is invalid.' => 'Ena ali več podanih vrednosti ni veljavnih.',
    'The fields {{ fields }} were not expected.' => 'Polja {{ fields }} niso bila pričakovana.',
    'The fields {{ fields }} are missing.' => 'Polja {{ fields }} manjkajo.',
    'This value is not a valid date.' => 'Ta vrednost ni veljaven datum.',
    'This value is not a valid datetime.' => 'Ta vrednost ni veljaven datum in čas.',
    'This value is not a valid email address.' => 'Ta vrednost ni veljaven e-poštni naslov.',
    'The file could not be found.' => 'Datoteke ni mogoče najti.',
    'The file is not readable.' => 'Datoteke ni mogoče prebrati.',
    'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.' => 'Datoteka je prevelika ({{ size }} {{ suffix }}). Največja dovoljena velikost je {{ limit }} {{ suffix }}.',
    'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.' => 'Mime tip datoteke je neveljaven ({{ type }}). Dovoljeni mime tipi so {{ types }}.',
    'This value should be {{ limit }} or less.' => 'Ta vrednost bi morala biti {{ limit }} ali manj.',
    'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.' => 'Ta vrednost je predolga. Morala bi imeti {{ limit }} znak ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znaka ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znake ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znakov ali manj.',
    'This value should be {{ limit }} or more.' => 'Ta vrednost bi morala biti {{ limit }} ali več.',
    'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.' => 'Ta vrednost je prekratka. Morala bi imeti {{ limit }} znak ali več.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znaka ali več.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znake ali več.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znakov ali več.',
    'This value should not be blank.' => 'Ta vrednost ne bi smela biti prazna.',
    'This value should not be null.' => 'Ta vrednost ne bi smela biti nedefinirana (null).',
    'This value should be null.' => 'Ta vrednost bi morala biti nedefinirana (null).',
    'This value is not valid.' => 'Ta vrednost ni veljavna.',
    'This value is not a valid time.' => 'Ta vrednost ni veljaven čas.',
    'This value is not a valid URL.' => 'Ta vrednost ni veljaven URL.',
    'The two values should be equal.' => 'Ti dve vrednosti bi morali biti enaki.',
    'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.' => 'Datoteka je prevelika. Največja dovoljena velikost je {{ limit }} {{ suffix }}.',
    'The file is too large.' => 'Datoteka je prevelika.',
    'The file could not be uploaded.' => 'Datoteke ni bilo mogoče naložiti.',
    'This value should be a valid number.' => 'Ta vrednost bi morala biti veljavna številka.',
    'This file is not a valid image.' => 'Ta datoteka ni veljavna slika.',
    'This is not a valid IP address.' => 'To ni veljaven IP naslov.',
    'This value is not a valid language.' => 'Ta vrednost ni veljaven jezik.',
    'This value is not a valid locale.' => 'Ta vrednost ni veljavna lokalnost.',
    'This value is not a valid country.' => 'Ta vrednost ni veljavna država.',
    'This value is already used.' => 'Ta vrednost je že uporabljena.',
    'The size of the image could not be detected.' => 'Velikosti slike ni bilo mogoče zaznati.',
    'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.' => 'Širina slike je preširoka ({{ width }}px). Največja dovoljena širina je {{ max_width }}px.',
    'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.' => 'Širina slike je premajhna ({{ width }}px). Najmanjša predvidena širina je {{ min_width }}px.',
    'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.' => 'Višina slike je prevelika ({{ height }}px). Največja dovoljena višina je {{ max_height }}px.',
    'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.' => 'Višina slike je premajhna ({{ height }}px). Najmanjša predvidena višina je {{ min_height }}px.',
    'This value should be the user current password.' => 'Ta vrednost bi morala biti trenutno uporabnikovo geslo.',
    'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.' => 'Ta vrednost bi morala imeti točno {{ limit }} znak.|Ta vrednost bi morala imeti točno {{ limit }} znaka.|Ta vrednost bi morala imeti točno {{ limit }} znake.|Ta vrednost bi morala imeti točno {{ limit }} znakov.',
    'The file was only partially uploaded.' => 'Datoteka je bila le delno naložena.',
    'No file was uploaded.' => 'Nobena datoteka ni bila naložena.',
    'No temporary folder was configured in php.ini.' => 'Začasna mapa ni nastavljena v php.ini.',
    'Cannot write temporary file to disk.' => 'Začasne datoteke ni bilo mogoče zapisati na disk.',
    'A PHP extension caused the upload to fail.' => 'PHP razširitev je vzrok, da nalaganje ni uspelo.',
    'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.' => 'Ta zbirka bi morala vsebovati {{ limit }} element ali več.|Ta zbirka bi morala vsebovati {{ limit }} elementa ali več.|Ta zbirka bi morala vsebovati {{ limit }} elemente ali več.|Ta zbirka bi morala vsebovati {{ limit }} elementov ali več.',
    'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.' => 'Ta zbirka bi morala vsebovati {{ limit }} element ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elementa ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elemente ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elementov ali manj.',
    'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.' => 'Ta zbirka bi morala vsebovati točno {{ limit }} element.|Ta zbirka bi morala vsebovati točno {{ limit }} elementa.|Ta zbirka bi morala vsebovati točno {{ limit }} elemente.|Ta zbirka bi morala vsebovati točno {{ limit }} elementov.',
    'Invalid card number.' => 'Neveljavna številka kartice.',
    'Unsupported card type or invalid card number.' => 'Nepodprti tip kartice ali neveljavna številka kartice.',
    'This is not a valid International Bank Account Number (IBAN).' => 'To ni veljavna mednarodna številka bančnega računa (IBAN).',
    'This value is not a valid ISBN-10.' => 'Neveljavna vrednost po ISBN-10.',
    'This value is not a valid ISBN-13.' => 'Neveljavna vrednost po ISBN-13.',
    'This value is neither a valid ISBN-10 nor a valid ISBN-13.' => 'Neveljavna vrednost po ISBN-10 ali po ISBN-13.',
    'This value is not a valid ISSN.' => 'Neveljavna vrednost ISSN.',
    'This value is not a valid currency.' => 'Ta vrednost ni veljavna valuta.',
    'This value should be equal to {{ compared_value }}.' => 'Ta vrednost bi morala biti enaka {{ compared_value }}.',
    'This value should be greater than {{ compared_value }}.' => 'Ta vrednost bi morala biti večja od {{ compared_value }}.',
    'This value should be greater than or equal to {{ compared_value }}.' => 'Ta vrednost bi morala biti večja ali enaka {{ compared_value }}.',
    'This value should be identical to {{ compared_value_type }} {{ compared_value }}.' => 'Ta vrednost bi morala biti identična {{ compared_value_type }} {{ compared_value }}.',
    'This value should be less than {{ compared_value }}.' => 'Ta vrednost bi morala biti manjša od {{ compared_value }}.',
    'This value should be less than or equal to {{ compared_value }}.' => 'Ta vrednost bi morala biti manjša ali enaka {{ compared_value }}.',
    'This value should not be equal to {{ compared_value }}.' => 'Ta vrednost ne bi smela biti enaka {{ compared_value }}.',
    'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.' => 'Ta vrednost ne bi smela biti identična {{ compared_value_type }} {{ compared_value }}.',
    'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.' => 'Razmerje slike je preveliko ({{ ratio }}). Največje dovoljeno razmerje je {{ max_ratio }}.',
    'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.' => 'Razmerje slike je premajhno ({{ ratio }}). Najmanjše pričakovano razmerje je {{ min_ratio }}.',
    'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.' => 'Slika je kvadrat ({{ width }}x{{ height }}px). Kvadratne slike niso dovoljene.',
    'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.' => 'Slika je ležeče usmerjena ({{ width }}x{{ height }}px). Ležeče usmerjene slike niso dovoljene.',
    'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.' => 'Slika je pokončno usmerjena ({{ width }}x{{ height }}px). Pokončno usmerjene slike niso dovoljene.',
    'This form should not contain extra fields.' => 'Ta obrazec ne sme vsebovati dodatnih polj.',
    'The uploaded file was too large. Please try to upload a smaller file.' => 'Naložena datoteka je prevelika. Prosimo, poizkusite naložiti manjšo.',
    'The CSRF token is invalid. Please try to resubmit the form.' => 'CSRF vrednost je napačna. Prosimo, ponovno pošljite obrazec.',
    'fos_user.username.already_used' => 'Uporabniško ime že obstaja',
    'fos_user.username.blank' => 'Prosimo, vnesite uporabniško ime',
    'fos_user.username.short' => '[-Inf,Inf]Uporabniško ime je prekratko',
    'fos_user.username.long' => '[-Inf,Inf]Uporabniško ime je predolgo',
    'fos_user.email.already_used' => 'Email že obstaja',
    'fos_user.email.blank' => 'Prosimo, vnesite email',
    'fos_user.email.short' => '[-Inf,Inf]Email je prekratek',
    'fos_user.email.long' => '[-Inf,Inf]Email je predolg',
    'fos_user.email.invalid' => 'Email je napačen',
    'fos_user.password.blank' => 'Prosimo, vnesite geslo',
    'fos_user.password.short' => '[-Inf,Inf]Geslo je prekratko',
    'fos_user.password.mismatch' => 'Vpisani gesli se ne ujemata',
    'fos_user.new_password.blank' => 'Prosimo, vnesite novo geslo',
    'fos_user.new_password.short' => '[-Inf,Inf]Novo geslo je prekratko',
    'fos_user.current_password.invalid' => 'Geslo je napačno',
    'fos_user.group.blank' => 'Prosimo, vnesite ime',
    'fos_user.group.short' => '[-Inf,Inf]Ime je prekratko',
    'fos_user.group.long' => '[-Inf,Inf]Ime je predolgo',
  ),
  'security' =>
  array (
    'An authentication exception occurred.' => 'Prišlo je do izjeme pri preverjanju avtentikacije.',
    'Authentication credentials could not be found.' => 'Poverilnic za avtentikacijo ni bilo mogoče najti.',
    'Authentication request could not be processed due to a system problem.' => 'Zahteve za avtentikacijo ni bilo mogoče izvesti zaradi sistemske težave.',
    'Invalid credentials.' => 'Neveljavne pravice.',
    'Cookie has already been used by someone else.' => 'Piškotek je uporabil že nekdo drug.',
    'Not privileged to request the resource.' => 'Nimate privilegijev za zahtevani vir.',
    'Invalid CSRF token.' => 'Neveljaven CSRF žeton.',
    'Digest nonce has expired.' => 'Začasni žeton je potekel.',
    'No authentication provider found to support the authentication token.' => 'Ponudnika avtentikacije za podporo prijavnega žetona ni bilo mogoče najti.',
    'No session available, it either timed out or cookies are not enabled.' => 'Seja ni na voljo, ali je potekla ali pa piškotki niso omogočeni.',
    'No token could be found.' => 'Žetona ni bilo mogoče najti.',
    'Username could not be found.' => 'Uporabniškega imena ni bilo mogoče najti.',
    'Account has expired.' => 'Račun je potekel.',
    'Credentials have expired.' => 'Poverilnice so potekle.',
    'Account is disabled.' => 'Račun je onemogočen.',
    'Account is locked.' => 'Račun je zaklenjen.',
  ),
  'FOSUserBundle' =>
  array (
    'Bad credentials' => 'Napačno uporabniško ime ali geslo',
    'group.edit.submit' => 'Shrani',
    'group.show.name' => 'Ime skupine',
    'group.new.submit' => 'Shrani',
    'group.flash.updated' => 'Skupina je bila uspešno shranjena',
    'group.flash.created' => 'Skupina je bila uspešno ustvarjena',
    'group.flash.deleted' => 'Skupina je bila uspešno izbrisana',
    'security.login.username' => 'Uporabniško ime:',
    'security.login.password' => 'Geslo:',
    'security.login.remember_me' => 'Zapomni si me',
    'security.login.submit' => 'Prijava',
    'profile.show.username' => 'Uporabniško ime',
    'profile.show.email' => 'Email',
    'profile.edit.submit' => 'Shrani',
    'profile.flash.updated' => 'Profil je bil uspešno shranjen',
    'change_password.submit' => 'Spremeni geslo',
    'change_password.flash.success' => 'Geslo je bilo uspešno spremenjeno',
    'registration.check_email' => 'Na %email% smo vam poslali sporočilo s kodo za aktivacijo. Račun aktivirate s klikom na to povezavo.',
    'registration.confirmed' => 'Pozdravljeni %username%, vaš račun je sedaj aktiviran.',
    'registration.back' => 'Nazaj na prvotno stran.',
    'registration.submit' => 'Registracija',
    'registration.flash.user_created' => 'Uporabnik je bil uspešno ustvarjen',
    'registration.email.subject' => 'Dobrodošli %username%!',
    'registration.email.message' => 'Pozdravljeni %username%!

Za aktivacijo računa prosimo, obiščite %confirmationUrl%

Lep pozdrav,
ekipa.
',
    'resetting.password_already_requested' => 'V zadnjih 24h ste že zahtevali spremembo gesla.',
    'resetting.check_email' => 'Na %email% smo vam poslali sporočilo s kodo za spremembo gesla. Geslo boste spremenili po kliku na to povezavo.',
    'resetting.request.invalid_username' => 'Uporabnik "%username%" ne obstaja.',
    'resetting.request.username' => 'Uporabniško ime:',
    'resetting.request.submit' => 'Spremeni geslo',
    'resetting.reset.submit' => 'Spremeni geslo',
    'resetting.flash.success' => 'Geslo je bilo uspešno spremenjeno',
    'resetting.email.subject' => 'Sprememba gesla',
    'resetting.email.message' => 'Pozdravljeni %username%!

Za spremembo gesla prosimo, obiščite %confirmationUrl%

Lep pozdrav,
ekipa.
',
    'layout.logout' => 'Odjava',
    'layout.login' => 'Prijava',
    'layout.register' => 'Registracija',
    'layout.logged_in_as' => 'Prijavljen kot %username%',
    'form.group_name' => 'Ime skupine:',
    'form.username' => 'Uporabniško ime:',
    'form.email' => 'Email:',
    'form.current_password' => 'Trenutno geslo:',
    'form.password' => 'Geslo:',
    'form.password_confirmation' => 'Preverjanje gesla:',
    'form.new_password' => 'Novo geslo:',
    'form.new_password_confirmation' => 'Preverjanje gesla:',
  ),
));
$catalogue->addFallbackCatalogue($catalogueSl);

return $catalogue;

redpajama_set_name: RedPajamaGithub


text:
This project aims to design and build an interactive website for an NGO in order to provide college applicants, primarily minority, low-income, at-risk students, a responsive portfolio of schools which would best serve their needs: a high-quality, low-cost education.

This repository contains the material for Project 3 of the Fall 2016 edition of Statistics 159 at UC Berkeley by Liang Hao, Bret Hart, Andrew Shibata and Gary Nguyen.

## File Structure

In this repository, you'll find directories which contain different pieces that ultimately come together to make a ShinyApp, a report, and a presentation.

The *code*/ directory contains:

* *functions*/ for self-defined functions and executable python code;

* *scripts*/ for major R scripts used in the project, including Exploratory Data Analysis, Premodeling, and Data Processing;

* *tests*/ for unit tests verifying the validity the self-defined functions.

* and *shinyApp*/ for the code of the shinyApp.

More information about the code in the project can be found in the respective *README.md* file.

The *data*/ directory theoretically contains the major data set used for this project, which can be installed locally using the makefile. You'll also find the intermediary RData objects created to perform analysis and write the report. More information about the data can be found in the *README.md* file.

The *images*/ directory contains all the images produced and used for exploratory purposes, analysis, the ShinyApp, and the report.

The *report*/ directory contains the *sections* of the report, which can be read, compiled together, in the final report.pdf.

The *slides*/ directory contains all code used to produce the slides, as well as the slides themselves.

The file structure is listed as following.

```
stat159-fall2016-project3/
   README.md
   Makefile
   LICENSE
   session-info.txt
   .gitignore
   code/
      README.md
      test-that.R
      functions/
         ...
      scripts/
         ...
      tests/
         ...
      shinyApp/
         README.md
         ...
         www/
   data/
      rawData/
         ...
      reducedData/
         ...
      rData/
         ...
   images/
      README.md
      ...
   report/
      README.md
      report.pdf
      report.Rnw
      sections/
         00-abstract.Rnw
         01-introduction.Rnw
         02-data.Rnw
         03-methods.Rnw
         04-analysis.Rnw
         05-results.Rnw
         06-conclusions.Rnw
   slides/
      README.md
      ...
```

## Instructions for Reproduction:

This is a fully open and reproducible project - and to generate the entire thing, only the skeleton of repository is necessary due to automation. All the materials and contents can be generated by executing the *Makefile* macros in a user's local terminal.

### *Makefile* Commands:

The *Makefile* for this project provides multiple phony targets to streamline the reproduction process, including:

* ```all```: produces the entire project from scratch

* ```data```: downloads the *CollegeScorecard_Raw_Data.zip* file, unzips it to the folder *data*, and cleans it up to produce the five datasets for the past five years as raw data that we use for the project. It will also download the *Most-Recent-Cohorts-Treasury-Elements.csv* dataset and clean it to the *salaryRaw.csv*. Ultimately, it merges the datasets into the *combinedData.csv* which is the primary dataset used for the remainder of the project.

* ```tests```: runs the unit tests for the self-defined functions

* ```eda```: performs exploratory data analysis

* ```report```: generates the *report.pdf* file from the various *sections*

* ```slides```: generates the *slides.html*

* ```shinyApp```: generates the shiny App for this project

* ```session```:  generates the *session-info.txt* file

* ```clean```: delete various generated objects, such as the compiled final report

This work is licensed under a Creative Commons Attribution 4.0 International License.

Author: Liang Hao, Bret Hart, Andrew Shibata and Gary Nguyen


text:
package org.kuali.kpme.core.api.role;

/**
 *
PositionRoleMemberBoContract interface.

 *
 */
public interface PositionRoleMemberBoContract extends KPMERoleMemberBoContract {

	/**
	 * Number for the PositionRole
	 *
	 *

	 * positionNumber of PositionRoleMemberBo
	 *

	 *
	 * @return positionNumber for PositionRoleMemberBo
	 */
	public String getPositionNumber();
}


text:
package org.gora.avro.query;

import org.gora.avro.store.AvroStore;
import org.gora.persistency.Persistent;
import org.gora.query.impl.QueryBase;

/**
 * A simple Query implementation for Avro. Due to the data model,
 * most of the operations for Query, like setting start,end keys is not
 * supported. Setting query limit is supported.
 */
public class AvroQuery<K, T extends Persistent> extends QueryBase<K,T> {

  public AvroQuery() {
    super(null);
  }

  public AvroQuery(AvroStore<K,T> dataStore) {
    super(dataStore);
  }

}


text:
def odd_even_list(head)
    odd = ListNode.new(-1)
    even = ListNode.new(-1)
    oddLast = odd
    evenLast = even
    it = head
    while !it.nil?
        oddLast.next, evenLast.next = it, it.next
        oddLast, evenLast = oddLast.next, evenLast.next
        it = it.next.nil? ? nil : it.next.next
    end
    oddLast.next = even.next
    return odd.next
end


text:
import os
import unittest
import time
import re

from google.appengine.api import apiproxy_stub
from google.appengine.ext import ndb
from mapreduce.lib import pipeline
from mapreduce import test_support
from testlib import testutil
from lakshmi import pipelines
from lakshmi.datum import CrawlDbDatum
from lakshmi.datum import FetchedDbDatum
from lakshmi.datum import LinkDbDatum
from lakshmi.datum import ContentDbDatum

def createMockCrawlDbDatum(url):
    """Create CrawlDbDatum mock data."""
    CrawlDbDatum.get_or_insert(url,
        url=url, last_status=pipelines.UNFETCHED)

class URLFetchServiceMockForUrl(apiproxy_stub.APIProxyStub):
  """Mock for google.appengine.api.urlfetch."""
  def __init__(self, service_name="urlfetch"):
    super(URLFetchServiceMockForUrl, self).__init__(service_name)
    self._return_values_dict = {}

  def set_return_values(self, return_value):
    url = return_value.get("url")
    print("specifiedURL" + url)
    self._return_values_dict[url] = return_value
    self._redirect_url = return_value.get("final_url")

  def _Dynamic_Fetch(self, request, response):
    return_value_key = request.url()
    return_values = self._return_values_dict.get(return_value_key, "")
    response.set_content(return_values.get("content", ""))
    response.set_statuscode(return_values.get("status_code", 200))
    #Test for Accept-Language.
    language_contents = return_values.get("language_content")
    if language_contents:
      for header in request.header_list():
        if header.key().title().lower() == "accept-language":
          accept_language = header.value()
      for lang in language_contents.keys():
        if accept_language.find(lang) >= 0:
          response.set_content(language_contents[lang])

    for header_key, header_value in return_values.get("headers", {}).items():
      new_header = response.add_header()
      new_header.set_key(header_key)
      new_header.set_value(header_value)
    #Simulation of the redirect, if set final_url.
    if request.followredirects() and self._redirect_url is not None:
      response.set_finalurl(self._redirect_url)
    else:
      response.set_finalurl(request.url())
    response.set_contentwastruncated(return_values.get("content_was_truncated", False))
    if return_values.get("duration"):
      time.sleep(long(return_values.get("duration")))
    self.request = request
    self.response = response

def htmlParser(key, content):
  outlinks = re.findall(r'href=[\'"]?([^\'" >]+)', content)
  link_datums = []
  for link in outlinks:
    link_datum = LinkDbDatum(parent=key, link_url=link)
    link_datums.append(link_datum)
  ndb.put_multi_async(link_datums)
  content_links = re.findall(r'src=[\'"]?([^\'" >]+)', content)
  return content_links

class FetchPipelineEndtoEndTest(testutil.HandlerTestBase):
  """Test for FetchPipeline"""

  def setUp(self):
    testutil.HandlerTestBase.setUp(self, urlfetch_mock=URLFetchServiceMockForUrl())
    pipeline.Pipeline._send_mail = self._send_mail
    self.emails = []

  def _send_mail(self, sender, subject, body, html=None):
    """Callback function for sending mail."""
    self.emails.append((sender, subject, body, html))

  def getResource(self, file_name):
    """ to get contents from resource"""
    path = os.path.join(os.path.dirname(__file__), "resource", file_name)
    return open(path)

  def testFetchEndToEnd(self):
    """Test for through of fetcher job"""
    createMockCrawlDbDatum("http://foo.com/bar.html")
    static_robots = "User-agent: test\nDisallow: /content_0\nDisallow: /content_1\nDisallow: /content_3"
    self.setReturnValue(url="http://foo.com/robots.txt",
        content=static_robots,
        headers={"Content-Length": len(static_robots)})
    #static resource is read from resource
    resource = self.getResource("sample_content.html")
    static_content = resource.read()
    static_content_length = len(static_content)
    self.setReturnValue(url="http://foo.com/bar.html",
        content=static_content,
        headers={"Content-Length": static_content_length,
            "Content-Type": "text/html"})
    resource_image = self.getResource("slide1.png")
    static_content_image = resource_image.read()
    static_content_length = len(static_content_image)
    self.setReturnValue(url="http://foo.com/images/slide1.png",
        content=static_content_image,
        headers={"Content-Length": static_content_length,
            "Content-Type": "image/png"})
    p = pipelines.FetcherPipeline("FetcherPipeline",
        params={
          "entity_kind": "lakshmi.datum.CrawlDbDatum"
        },
        parser_params={
          "text/html": __name__ + ".htmlParser"
        },
        shards=2)
    p.start()
    test_support.execute_until_empty(self.taskqueue)

    crawl_db_datums = CrawlDbDatum.query(CrawlDbDatum.url=="http://foo.com/bar.html").fetch()
    crawl_db_datum = crawl_db_datums[0]
    self.assertTrue(pipelines.FETCHED, crawl_db_datum.last_status)
    fetched_db_datums = FetchedDbDatum.query(ancestor=crawl_db_datum.key).fetch()
    fetched_db_datum = fetched_db_datums[0]
    self.assertTrue(fetched_db_datum is not None)
    self.assertTrue("http://foo.com/bar.html", fetched_db_datum.fetched_url)
    link_db_datums = LinkDbDatum.query(ancestor=crawl_db_datum.key).fetch()
    self.assertTrue(len(link_db_datums)>0)
    contents_db_datums = ContentDbDatum.query(ancestor=crawl_db_datum.key).fetch()
    self.assertTrue(len(contents_db_datums)>0)

def _parserNotOutlinks(url, cotent):
  return None

class FetchPipelineWithSpecifiedParserTest(testutil.HandlerTestBase):
  """Test for FetchPipeline"""
  def setUp(self):
    testutil.HandlerTestBase.setUp(self, urlfetch_mock=URLFetchServiceMockForUrl())
    pipeline.Pipeline._send_mail = self._send_mail
    self.emails = []

  def _send_mail(self, sender, subject, body, html=None):
    """Callback function for sending mail."""
    self.emails.append((sender, subject, body, html))

  def getResource(self, file_name):
    """ to get contents from resource"""
    path = os.path.join(os.path.dirname(__file__), "resource", file_name)
    return open(path)

  def testFetchEndToEnd(self):
    """Test for through of fetcher job"""
    createMockCrawlDbDatum("http://foo.com/bar.txt")
    static_robots = "User-agent: test\nDisallow: /content_0\nDisallow: /content_1\nDisallow: /content_3"
    self.setReturnValue(url="http://foo.com/robots.txt",
        content=static_robots,
        headers={"Content-Length": len(static_robots),
          "content-type": "text/plain"})

    static_content = "test"
    static_content_length = len(static_content)
    self.setReturnValue(url="http://foo.com/bar.txt",
        content=static_content,
        headers={"Content-Length": static_content_length,
            "Content-Type": "text/plain"})
    p = pipelines.FetcherPipeline("FetcherPipeline",
        params={
          "entity_kind": "lakshmi.datum.CrawlDbDatum"
        },
        parser_params={
          "text/plain": __name__ + "._parserNotOutlinks"
        },
        shards=2)
    p.start()
    test_support.execute_until_empty(self.taskqueue)

if __name__ == "__main__":
  unittest.main()


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insecure Login</title>
<link rel="stylesheet" type="text/css" href="formate.css">

Lesson Plan Title:Insecure Login

Concept / Topic To Teach:

Sensitive data should never sent in plaintext!
Often applications switch to a secure connection after the authorization.
An attacker could just sniff the login and use the gathered information
to break into an account. A good webapplication always takes care of
encrypting sensitive data.

General Goal(s):

See how easy it is to sniff a password in plaintext.

Understand the advantages of encrypting the login data!

Solution:

This lesson has two stages. In the first stage you try to sniff a password
which is sent in plaintext. In the second stage you try the same
but on a secure connection.

You need a client server setup for this lesson. Please refer
to the Tomcat Setup in the Introduction section.

Stage 1

Start a sniffer. If you do not have one we recommend wireshark, which
is free:  Wireshark. Make sure
you are capturing on the right interface. Click on
the submit button ans stop the capturing. Now analyze the captured data.

 Figure 1: Sniffed Traffic

As you can see we are interested in the HTTP Post request as
the password is transmitted there. The field for the password has
the name clear_pass and has as value sniffy. Of course
this is also the correct answer and you are done with stage 1.

Stage 2

Now you have to switch to a secure connection. You archive this
by changing the URL from http://... to https://... Sniff again the traffic
as you have done in stage 1. As you will see there is not sent the password
in plaintext. The server communicates with the application over a secure layer
the so called Transport Layer Security (TLS) also called Secure Socket Layer (SSL).
TLS is a hybrid encrypting protocol. A master secret is built to communicate.
This master secret is built by using SHA-1 and MD5. All traffic between
the Server and the Cleint is encrypted.


text:
using SignalGo.Server.Models;
using SignalGo.Server.ServiceManager;
using SignalGo.Shared.DataTypes;
using SignalGo.Shared.Helpers;
using SignalGo.Shared.Models;
using SignalGo.Shared.Models.ServiceReference;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SignalGo.Server.Helpers
{
    /// <summary>
    /// when client side want ot add service reference of signalgo
    /// </summary>
    public class ServiceReferenceHelper
    {
        public static Func<Type, MethodInfo, string> GetCustomClientSideMethodNameFunction { get; set; }
        public bool IsRenameDuplicateMethodNames { get; set; }
        public ClientServiceReferenceConfigInfo ClientServiceReferenceConfigInfo { get; set; }
        /// <summary>
        ///
        /// </summary>
        public ServiceReferenceHelper()
        {
            GenerateBase();
        }

        private NamespaceReferenceInfo NamespaceReferenceInfo { get; set; } = new NamespaceReferenceInfo();

        private List<Assembly> ModellingReferencesAssemblies { get; set; }

        /// <summary>
        /// Type adds to this list after generated so a duplicate generate is not needed
        /// </summary>
        private List<Type> ModelsCodeGenerated { get; set; } = new List<Type>();

        /// <summary>
        /// This types must be generated. After generate this will remove from list
        /// </summary>
        private List<Type> TypeToGenerate { get; set; } = new List<Type>();

        private string BaseAssemblyPath { get; set; }

        private void GenerateBase()
        {
            BaseAssemblyPath = Environment.GetEnvironmentVariable("SystemRoot");
            if (string.IsNullOrEmpty(BaseAssemblyPath))
            {
#if (NETSTANDARD1_6 || NETCOREAPP1_1)
                var assm = typeof(string).GetTypeInfo().Assembly;
#else
                Assembly assm = typeof(string).Assembly;
#endif
                string codeBase = assm.CodeBase;
                if (codeBase.Length < 32)
                    BaseAssemblyPath = codeBase;
                else
                    BaseAssemblyPath = codeBase.Substring(0, 32);
            }
            else
            {
                BaseAssemblyPath = "file:///" + System.IO.Path.Combine(BaseAssemblyPath, "Microsoft.Net").Replace("\\", "/").ToLower();
            }
        }

        internal bool CannotGenerateAssemblyTypes(Type type)
        {
            if (type == typeof(Task))
            {
                return false;
            }
            else if (type.GetBaseType() == typeof(Task))
            {
                type = type.GetGenericArguments()[0];
            }

#if (NETSTANDARD1_6 || NETCOREAPP1_1)
            var assm = type.GetTypeInfo().Assembly;
#else
            Assembly assm = type.Assembly;
#endif
            var fileName = System.IO.Path.GetFileName(assm.Location);
            if (ClientServiceReferenceConfigInfo != null && ClientServiceReferenceConfigInfo.SkipAssemblies != null)
            {
                if (ClientServiceReferenceConfigInfo.SkipAssemblies.Any(x => x.ToLower() == fileName.ToLower()))
                    return true;
            }
            if (ModellingReferencesAssemblies.Contains(type.GetAssembly()) || assm.CodeBase.ToLower() == BaseAssemblyPath || assm.CodeBase.ToLower().StartsWith(BaseAssemblyPath))
                return true;
            return false;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="nameSpace"></param>
        /// <param name="serverBase"></param>
        /// <returns></returns>
        public NamespaceReferenceInfo GetServiceReferenceCSharpCode(string nameSpace, ServerBase serverBase, string httpServiceName, string serviceMethodName)
        {
            serviceMethodName = serviceMethodName.ToLower().Trim();
            NamespaceReferenceInfo.Name = nameSpace;
            ModellingReferencesAssemblies = serverBase.ModellingReferencesAssemblies;
            AddUsingIfNotExist(typeof(ServiceContractAttribute));
            AddUsingIfNotExist(typeof(System.Threading.Tasks.Task));
            AddUsingIfNotExist(typeof(NotifyPropertyChangedBase));
            ModellingReferencesAssemblies.Add(typeof(NotifyPropertyChangedBase).GetAssembly());
            ModellingReferencesAssemblies.Add(typeof(ServerBase).GetAssembly());
            List<string> generatedServices = new List<string>();

            //if the generation password is true and service methodname is password,then it will full generate everything
            bool getFull = false;
            bool wrongPassword = false;
            if (!string.IsNullOrEmpty(serverBase.CodeGeneratorPassword))
            {
                if (!serverBase.CodeGeneratorPassword.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase))
                {
                    //when the user is gust that will not generate anything
                    if (!serverBase.RegisteredServiceTypes.Any(x =>
                    x.Value.GetCustomAttributes<GenerationServiceAttribute>(true).ToList().Any(g => g.Urls.Any(url => url.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase)))
                    || x.Value.GetListOfMethods().Any(m => m.GetCustomAttributes<GenerationServiceAttribute>(true).Any(at => at.Urls.Any(url => url.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase))))))
                    {
                        wrongPassword = true;
                    }
                }
                else
                {
                    getFull = true;
                }
            }
            if (!wrongPassword)
            {
                foreach (KeyValuePair<string, Type> serviceInfo in serverBase.RegisteredServiceTypes)
                {
                    if (!getFull)
                    {
                        //generate a service if that has service generation attribute
                        //if serviceMethodName != any urls of GenerationServiceAttribute that service will ignore to generate in service generation
                        var serviceServiceGenerationAttributes = serviceInfo.Value.GetCustomAttributes<GenerationServiceAttribute>(true).ToList();

                        var hasMethodServiceGenerationAttribute = serviceInfo.Value.GetListOfMethods().Any(m => m.GetCustomAttributes<GenerationServiceAttribute>(true).Length == 0 || m.GetCustomAttributes<GenerationServiceAttribute>(true).Any(x => x.Urls.Any(url => url.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase))));

                        if (serviceServiceGenerationAttributes.Count > 0 && !serviceServiceGenerationAttributes.Any(x => x.Urls.Any(url => url.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase))) || !hasMethodServiceGenerationAttribute)
                        {
                            continue;
                        }
                    }

                    ServiceContractAttribute[] attributes = null;
                    if (serviceInfo.Value.HasServiceAttribute())
                        attributes = serviceInfo.Value.GetServiceContractAttributes();
                    else
                        attributes = new ServiceContractAttribute[0];

                    if (!generatedServices.Contains(serviceInfo.Key) && attributes.Any(x => x.ServiceType == ServiceType.ServerService && x.GetServiceName(false) == serviceInfo.Key))
                    {
                        generatedServices.Add(serviceInfo.Key);
                        GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.ServiceLevel, ServiceType.ServerService, httpServiceName, serviceMethodName, getFull);
                    }

                    if (!generatedServices.Contains(serviceInfo.Key) && attributes.Any(x => x.ServiceType == ServiceType.ClientService && ServiceContractExtensions.GetServiceNameWithGeneric(serviceInfo.Value, x.GetServiceName(false)) == serviceInfo.Key))
                    {
                        generatedServices.Add(serviceInfo.Key);
                        GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.CallbackLevel, ServiceType.ClientService, httpServiceName, serviceMethodName, getFull);
                    }

                    if (!generatedServices.Contains(serviceInfo.Key) && attributes.Any(x => x.ServiceType == ServiceType.StreamService && x.GetServiceName(false) == serviceInfo.Key))
                    {
                        generatedServices.Add(serviceInfo.Key);
                        GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.StreamLevel, ServiceType.StreamService, httpServiceName, serviceMethodName, getFull);
                    }

                    if (!generatedServices.Contains(serviceInfo.Key) && attributes.Any(x => x.ServiceType == ServiceType.OneWayService && x.GetServiceName(false) == serviceInfo.Key))
                    {
                        generatedServices.Add(serviceInfo.Key);
                        GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.OneWayLevel, ServiceType.OneWayService, httpServiceName, serviceMethodName, getFull);
                    }

                    if (!generatedServices.Contains(serviceInfo.Key) && (attributes.Any(x => x.ServiceType == ServiceType.HttpService && x.GetServiceName(false) == serviceInfo.Key) || attributes.Length == 0))
                    {
                        generatedServices.Add(serviceInfo.Key);
                        GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.HttpServiceLevel, ServiceType.HttpService, httpServiceName, serviceMethodName, getFull);
                    }
                }
            }
            //foreach (var serviceInfo in serverBase.RegisteredServiceTypes)
            //{
            //    GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.ServiceLevel, ServiceType.ServerService);
            //}

            //foreach (var serviceInfo in serverBase.RegisteredServiceTypes.Where(x=>x.Value))
            //{
            //    GenerateServiceClass(serviceInfo.Key, serviceInfo.Value, ClassReferenceType.CallbackLevel, ServiceType.ClientService);
            //}

            //foreach (var serviceInfo in serverBase.StreamServices)
            //{
            //    GenerateServiceClass(serviceInfo.Key, serviceInfo.Value.GetType(), ClassReferenceType.StreamLevel, ServiceType.StreamService);
            //}

            //foreach (var serviceInfo in serverBase.RegisteredHttpServiceTypes)
            //{
            //    GenerateHttpServiceClass(serviceInfo.Key, serviceInfo.Value);
            //}

            //foreach (var serviceInfo in serverBase.OneWayServices)
            //{
            //    GenerateServiceClass(serviceInfo.Key, serviceInfo.Value.GetType(), ClassReferenceType.OneWayLevel, ServiceType.OneWayService);
            //}

            Type find = null;
            while ((find = TypeToGenerate.FirstOrDefault()) != null)
            {
                if (find.GetIsClass())
                    GenerateModelClass(find);
                else if (find.GetIsInterface())
                    GenerateModelInterface(find);
                else if (find.GetIsEnum())
                    GenerateModelEnum(find);

                TypeToGenerate.Remove(find);
            }

            return NamespaceReferenceInfo;
        }

        private void AddToGenerate(Type type)
        {
            if (!TypeToGenerate.Contains(type) && !CannotGenerateAssemblyTypes(type) && !type.IsGenericParameter)
                TypeToGenerate.Add(type);
        }

        private List<Type> typeGenerated = new List<Type>();
        private List<MethodInfo> methodGenerated = new List<MethodInfo>();

        private void GenerateServiceClass(string serviceName, Type type, ClassReferenceType classReferenceType, ServiceType serviceTypeEnum, string httpServiceName, string serviceMethodName, bool getFull)
        {
            string typeName = type.Name.Split('`')[0];
            if (classReferenceType == ClassReferenceType.CallbackLevel && type.GetIsGenericType())
            {
                typeName += string.Join("", type.GetListOfGenericArguments().Select(x => x.Name).ToArray());
            }
            ClassReferenceInfo classReferenceInfo = new ClassReferenceInfo
            {
                ServiceName = serviceName,
                Name = typeName,
                Type = classReferenceType,
                NameSpace = type.GetNamesapce()
            };
            List<Type> services = type.GetTypesByAttribute<ServiceContractAttribute>(x => x.ServiceType == serviceTypeEnum).ToList();
            bool justDeclared = false;
            if (serviceTypeEnum == ServiceType.HttpService && services.Count == 0)
            {
                services = new List<Type>() { type };
                justDeclared = true;
            }

            foreach (Type serviceType in services)
            {
                typeGenerated.Add(serviceType);
                List<MethodInfo> methods = null;
                if (justDeclared)
                    methods = serviceType.GetListOfDeclaredMethods().Distinct().ToList();
                else
                    methods = serviceType.GetListOfMethodsWithAllOfBases().Distinct().Where(x => x.IsPublic && !x.IsStatic).ToList();
                methods = methods.GroupBy(x => x.Name).Select(x => x.First()).ToList();
                foreach (MethodInfo methodInfo in methods.Where(x => !(x.IsSpecialName && (x.Name.StartsWith("set_") || x.Name.StartsWith("get_"))) && !x.IsStatic))
                {
                    if (!getFull)
                    {
                        //generate a method if that has service generation attribute
                        //if serviceMethodName != any urls of GenerationServiceAttribute that method will ignore to generate in service generation
                        var methodServiceGenerationAttributeshas = methodInfo.GetCustomAttributes<GenerationServiceAttribute>(true).ToList();
                        if (methodServiceGenerationAttributeshas.Count > 0 && !methodServiceGenerationAttributeshas.Any(x => x.Urls.Any(url => url.Equals(httpServiceName, StringComparison.OrdinalIgnoreCase))))
                        {
                            continue;
                        }
                    }

                    GenerateMethod(methodInfo, classReferenceInfo);
                    methodGenerated.Add(methodInfo);
                }
            }
            if (classReferenceInfo.Methods.Count > 0)
                NamespaceReferenceInfo.Classes.Add(classReferenceInfo);
        }

        private void GenerateHttpServiceClass(string serviceName, Type type)
        {
            ClassReferenceInfo classReferenceInfo = new ClassReferenceInfo
            {
                ServiceName = serviceName,
                Name = type.Name,
                Type = ClassReferenceType.HttpServiceLevel,
                NameSpace = type.GetNamesapce()
            };
            List<Type> services = type.GetTypesByAttribute<ServiceContractAttribute>(x => x.ServiceType == ServiceType.HttpService).ToList();
            if (services.Count == 0)
                services = new List<Type>() { type };

            foreach (Type serviceType in services)
            {
                typeGenerated.Add(serviceType);
                foreach (MethodInfo methodInfo in serviceType.GetListOfDeclaredMethods().Distinct().Where(x => !(x.IsSpecialName && (x.Name.StartsWith("set_") || x.Name.StartsWith("get_"))) && !x.IsStatic))
                {
                    GenerateMethod(methodInfo, classReferenceInfo);
                    methodGenerated.Add(methodInfo);
                }
            }
            if (classReferenceInfo.Methods.Count > 0)
                NamespaceReferenceInfo.Classes.Add(classReferenceInfo);
        }

        private void GenerateModelEnum(Type type)
        {
            if (ModelsCodeGenerated.Contains(type) || CannotGenerateAssemblyTypes(type))
                return;
            ModelsCodeGenerated.Add(type);
            EnumReferenceInfo enumReferenceInfo = new EnumReferenceInfo
            {
                Name = type.Name,
                NameSpace = type.GetNamesapce()
            };
            Type baseEumType = Enum.GetUnderlyingType(type);
            int startIndexAt = 0;
            enumReferenceInfo.TypeName = GetFullNameOfType(baseEumType, true, null, null, ref startIndexAt, out _);
            foreach (object name in Enum.GetValues(type))
            {
                object res = Convert.ChangeType(name, baseEumType);
                string value = "";
                if (res != null)
                    value = res.ToString();
                if (!enumReferenceInfo.KeyValues.Any(x => x.Key == name.ToString()))
                    enumReferenceInfo.KeyValues.Add(new KeyValue<string, string>(name.ToString(), value));
            }
            NamespaceReferenceInfo.Enums.Add(enumReferenceInfo);
        }

        private void GenerateModelClass(Type type)
        {
            if (type == null)
                return;

            if (type == typeof(Task))
            {
                return;
            }
            else if (type.GetBaseType() == typeof(Task))
            {
                type = type.GetGenericArguments()[0];
            }
            if (type.IsArray)
            {
                type = type.GetElementType();
            }
            if (ModelsCodeGenerated.Contains(type) || CannotGenerateAssemblyTypes(type))
                return;
            if (type == typeof(object) || type.GetAssembly() == typeof(string).GetAssembly())
                return;
            bool isGeneric = type.GetIsGenericType();
            if (isGeneric && type.GetGenericTypeDefinition() != type)
            {
                GenerateModelClass(type.GetGenericTypeDefinition());
                return;
            }
            ClassReferenceInfo classReferenceInfo = new ClassReferenceInfo
            {
                Type = ClassReferenceType.ModelLevel,
                NameSpace = type.GetNamesapce()
            };

            Type baseType = type.GetBaseType();
            string genericParameterConstraints = null;
            int startIndexAt = 0;
            if (baseType != typeof(object) && baseType != null)
            {
                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, ref startIndexAt, out _);
            }
            else
                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, ref startIndexAt, out _);

            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, ref startIndexAt, out genericParameterConstraints);
            classReferenceInfo.GenericParameterConstraints = genericParameterConstraints;

            ModelsCodeGenerated.Add(type);

            foreach (PropertyInfo propertyInfo in type.GetListOfDeclaredProperties())
            {
                GenerateProperty(propertyInfo, classReferenceInfo);
            }
            GenerateModelClass(type.GetBaseType());
            NamespaceReferenceInfo.Classes.Add(classReferenceInfo);
        }

        private void GenerateModelInterface(Type type)
        {
            if (type == null)
                return;

            if (type == typeof(Task))
            {
                return;
            }
            else if (type.GetBaseType() == typeof(Task))
            {
                type = type.GetGenericArguments()[0];
            }
            if (type.IsArray)
            {
                type = type.GetElementType();
            }
            if (ModelsCodeGenerated.Contains(type) || CannotGenerateAssemblyTypes(type))
                return;
            if (type == typeof(object) || type.GetAssembly() == typeof(string).GetAssembly())
                return;
            bool isGeneric = type.GetIsGenericType();
            if (isGeneric && type.GetGenericTypeDefinition() != type)
            {
                GenerateModelClass(type.GetGenericTypeDefinition());
                return;
            }
            ClassReferenceInfo classReferenceInfo = new ClassReferenceInfo
            {
                Type = ClassReferenceType.InterfaceLevel,
                NameSpace = type.GetNamesapce()
            };

            Type baseType = type.GetBaseType();
            int startIndexAt = 0;
            if (baseType != typeof(object) && baseType != null)
            {
                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, ref startIndexAt, out _);
            }
            else
                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, ref startIndexAt, out _);

            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, ref startIndexAt, out _);

            ModelsCodeGenerated.Add(type);

            foreach (PropertyInfo propertyInfo in type.GetListOfDeclaredProperties())
            {
                GenerateProperty(propertyInfo, classReferenceInfo);
            }
            GenerateModelInterface(type.GetBaseType());
            NamespaceReferenceInfo.Classes.Add(classReferenceInfo);
        }

        private Dictionary<string, List<string>> ServiceMethods = new Dictionary<string, List<string>>();

        private void GenerateMethod(MethodInfo methodInfo, ClassReferenceInfo classReferenceInfo)
        {
            if (methodInfo.GetParameters().Any(x => x.IsOut || x.IsRetval) || methodInfo.DeclaringType == typeof(object))
                return;
            if (IsRenameDuplicateMethodNames)
            {
                if (!ServiceMethods.ContainsKey(classReferenceInfo.ServiceName))
                    ServiceMethods[classReferenceInfo.ServiceName] = new List<string>();
            }
            MethodReferenceInfo methodReferenceInfo = new MethodReferenceInfo();

            AddToGenerate(methodInfo.ReturnType);
            string returnType = "void";
            if (methodInfo.ReturnType != typeof(void))
            {
                int startIndexAt = 0;
                returnType = GetFullNameOfType(methodInfo.ReturnType, true, methodInfo, null, ref startIndexAt, out _);
            }
            string methodName = methodInfo.Name;

            if (IsRenameDuplicateMethodNames)
            {
                int i = 1;
                while (ServiceMethods[classReferenceInfo.ServiceName].Contains(methodName))
                {
                    methodName = methodInfo.Name + i;
                    i++;
                }
            }
            var protocolAttribute = methodInfo.GetCustomAttribute<ProtocolAttribute>(true);
            if (protocolAttribute != null)
                methodReferenceInfo.ProtocolType = protocolAttribute.Type;
            methodReferenceInfo.ReturnTypeName = returnType;
            if (GetCustomClientSideMethodNameFunction == null)
                methodReferenceInfo.Name = methodInfo.Name;
            else
                methodReferenceInfo.Name = GetCustomClientSideMethodNameFunction(methodInfo.DeclaringType, methodInfo);
            methodReferenceInfo.RealName = methodInfo.Name;
            methodReferenceInfo.DuplicateName = methodName;

            if (IsRenameDuplicateMethodNames)
                ServiceMethods[classReferenceInfo.ServiceName].Add(methodName);
            GenerateMethodParameters(methodInfo, methodReferenceInfo);
            classReferenceInfo.Methods.Add(methodReferenceInfo);
        }

        private void GenerateProperty(PropertyInfo propertyInfo, ClassReferenceInfo classReferenceInfo)
        {
            if (!propertyInfo.CanWrite || !propertyInfo.CanRead)
                return;
            AddToGenerate(propertyInfo.PropertyType);
            int startIndexAt = 0;
            PropertyReferenceInfo propertyReferenceInfo = new PropertyReferenceInfo
            {
                Name = propertyInfo.Name,
                ReturnTypeName = GetFullNameOfType(propertyInfo.PropertyType, true, null, propertyInfo, ref startIndexAt, out _)
            };

            classReferenceInfo.Properties.Add(propertyReferenceInfo);
        }

        private void GenerateMethodParameters(MethodInfo methodInfo, MethodReferenceInfo methodReferenceInfo)
        {
            foreach (System.Reflection.ParameterInfo item in methodInfo.GetParameters())
            {
                ParameterReferenceInfo parameterReferenceInfo = new ParameterReferenceInfo();
                AddToGenerate(item.ParameterType);
                parameterReferenceInfo.Name = item.Name;
                int startIndexAt = 0;
                parameterReferenceInfo.TypeName = GetFullNameOfType(item.ParameterType, true, methodInfo, null, ref startIndexAt, out _);
                methodReferenceInfo.Parameters.Add(parameterReferenceInfo);
            }
        }

        private void AddUsingIfNotExist(Type type)
        {
            if (!NamespaceReferenceInfo.Usings.Contains(type.GetNamesapce()))
                NamespaceReferenceInfo.Usings.Add(type.GetNamesapce());
        }

        private string GetFullNameOfType(Type type, bool withNameSpace, MethodInfo method, PropertyInfo property, ref int startIndexAt, out string genericParameterConstraints)
        {
            genericParameterConstraints = null;
            if (method != null)
            {
                var result = GetTupleParameterNames(type, method, ref startIndexAt);
                if (result != "()" && result != ")")
                    return result;
            }
            if (property != null)
            {
                var result = GetTupleParameterNames(type, property, ref startIndexAt);
                if (result != "()" && result != ")")
                    return result;
            }
            if (type == typeof(bool))
                return "bool";
            else if (type == typeof(short))
                return "short";
            else if (type == typeof(ushort))
                return "ushort";
            else if (type == typeof(byte))
                return "byte";
            else if (type == typeof(sbyte))
                return "sbyte";
            else if (type == typeof(int))
                return "int";
            else if (type == typeof(uint))
                return "uint";
            else if (type == typeof(long))
                return "long";
            else if (type == typeof(ulong))
                return "ulong";
            else if (type == typeof(string))
                return "string";
            else if (type == typeof(double))
                return "double";
            else if (type == typeof(float))
                return "float";
            else if (type == typeof(decimal))
                return "decimal";
            else if (type == typeof(object))
                return "object";
            else if (type == typeof(Task))
            {
                return "void";
            }
            else if (type.GetBaseType() == typeof(Task))
            {
                return GetFullNameOfType(type.GetGenericArguments()[0], withNameSpace, method, property, ref startIndexAt, out _);
            }
            if (type.GetBaseType() == typeof(Array))
            {
                return GetFullNameOfType(type.GetElementType(), withNameSpace, method, property, ref startIndexAt, out _) + "[]";
            }
            if (CannotGenerateAssemblyTypes(type))
                AddUsingIfNotExist(type);
            if (type.GetIsGenericType())
            {

                string generics = "";
                StringBuilder genericParameterConstraintsBuilder = new StringBuilder();
#if (NETSTANDARD2_0 || NET45 || NET6_0)
                Type[] defparams = type.GetGenericTypeDefinition().GetGenericArguments();
                foreach (Type tp in defparams)
                {
                    Type[] tpConstraints = tp.GetGenericParameterConstraints();
                    foreach (Type tpc in tpConstraints)
                    {
                        if (tpc == typeof(ValueType))
                        {
                            genericParameterConstraintsBuilder.AppendLine($"where {tp.Name} : struct");
                        }
                    }
                }
#endif
                foreach (Type item in type.GetListOfGenericArguments())
                {
                    AddToGenerate(item);
                    if (CannotGenerateAssemblyTypes(item))
                        AddUsingIfNotExist(item);
                    if (!string.IsNullOrEmpty(generics))
                    {
                        generics += ", ";
                    }
                    generics += GetFullNameOfType(item, true, method, property, ref startIndexAt, out _);
                }
                string name = "";
                if (type.Name.IndexOf("`") != -1)
                {
                    if (type.GetGenericTypeDefinition() == typeof(Nullable<>))
                    {
                        return generics + "?";
                    }
                    else
                    {
                        name = type.Name.Substring(0, type.Name.IndexOf("`"));
                        if (withNameSpace)
                            name = type.GetNamesapce() + "." + name;
                    }
                }
                genericParameterConstraints = genericParameterConstraintsBuilder.ToString();
                //add type.GetNamesapce() to name spaces
                return $"{name}<{generics}>";
            }
            else if (type.IsGenericParameter)
                return type.Name;
            else
            {
                if (withNameSpace)
                    return type.GetNamesapce() + "." + type.Name;
                else
                    return type.Name;
            }
        }

        string GetTupleParameterNames(Type type, MethodInfo method, ref int startIndexAt)
        {
            StringBuilder result = new StringBuilder();
            result.Append("(");
#if (!NETSTANDARD1_6 && !NET45)
            if (type.GetBaseType() == typeof(ValueType))
            {
                var tupleGenerics = type.GetGenericArguments();
                if (tupleGenerics.Length > 0)
                {
                    var attribs = method.ReturnTypeCustomAttributes;
                    if (attribs.GetCustomAttributes(true) != null)
                    {
                        foreach (var at in attribs.GetCustomAttributes(true))
                        {
                            if (at is System.Runtime.CompilerServices.TupleElementNamesAttribute)
                            {
                                var ng = ((System.Runtime.CompilerServices.TupleElementNamesAttribute)at).TransformNames;
                                int index = 0;
                                var items = ng.Skip(startIndexAt).Take(tupleGenerics.Length).ToArray();
                                foreach (var ca in items)
                                {
                                    int myStartIndexAt = tupleGenerics.Length;
                                    result.Append($"{GetFullNameOfType(tupleGenerics[index], true, method, null, ref myStartIndexAt, out _)} ");
                                    result.Append($"{ca}");
                                    result.Append(", ");
                                    index++;
                                    startIndexAt++;
                                }
                                if (result.Length > 2)
                                    result = result[result.Length - 1] == ',' ? result.Remove(result.Length - 1, 1) : result.Remove(result.Length - 2, 2);
                                result.Append(")");
                            }
                        }
                    }
                }
            }
#endif
            if (result.Length > 2)
                result = result[result.Length - 1] == ')' ? result.Remove(result.Length - 1, 1) : result.Remove(result.Length - 2, 2);
            result.Append(")");
            return result.ToString();
        }

        string GetTupleParameterNames(Type type, PropertyInfo property, ref int startIndexAt)
        {
            StringBuilder result = new StringBuilder();
            result.Append("(");
            if (type.GetBaseType() == typeof(ValueType))
            {
                var tupleGenerics = type.GetGenericArguments();
                if (tupleGenerics.Length > 0)
                {
                    if (property.CustomAttributes != null)
                    {
                        foreach (var at in property.CustomAttributes)
                        {
                            if (at is System.Reflection.CustomAttributeData)
                            {
                                var ng = ((System.Reflection.CustomAttributeData)at).ConstructorArguments;
                                int index = 0;
                                foreach (var ca in ng)
                                {
                                    try
                                    {
                                        foreach (var val in (IEnumerable<System.Reflection.CustomAttributeTypedArgument>)ca.Value)
                                        {
                                            result.Append($"{GetFullNameOfType(tupleGenerics[index], true, null, property, ref startIndexAt, out _)} ");
                                            result.Append($"{val.Value}");
                                            result.Append(", ");
                                            index++;
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (result.Length > 2)
                result = result.Remove(result.Length - 2, 2);
            result.Append(")");
            return result.ToString();
        }
    }
}


text:
FactoryGirl.define do
  factory :user do
    first_name  'John'
    last_name   'Doe'
    sequence(:email)      { |n| "person#{n}@example.com" }
    password              'pasword'
    password_confirmation "pasword"
    after(:build) {|user| user.send(:initialize_state_machines, :dynamic => :force)}
  end

  factory :admin_user, :parent => :user do
    before(:create) do |u|
      u.roles = [Role.find_by_name(Role::ADMIN)]
    end
  end

  factory :merchant, :parent => :user do
    before(:create) do |u|
      u.roles = [Role.find_by_name(Role::ADMIN), Role.find_by_name(Role::MERCHANT)]
    end
  end

  factory :super_admin_user, :parent => :user do
    #roles     {
    #  [Role.find_by_name(Role::SUPER_ADMIN)]
    #}
    before(:create) do |u|
      u.roles = [Role.find_by_name(Role::SUPER_ADMIN)]
    end
  end
end


text:
'use strict';

const path = require('path');

const should = require('should');

const Nconfetti = require('./../../index.js');

/* only to check the _getDirectory function */
/* eslint no-underscore-dangle: "allow" */

describe('Nconfetti#_getDirectory', () => {

  it('should getDirectory include directory and expanded env', (done) => {
    const nconfetti = new Nconfetti({path: path.join(__dirname, '..', 'configs', 'env'), env: 'development'});

    should(nconfetti._getDirectory()).be.equal(path.join(__dirname, '..', 'configs', 'env', 'development'));

    done();
  });

  it('should raise an Error for getDirectory if dir didn\' exist', (done) => {
    const nconfetti = new Nconfetti({path: path.join(__dirname, '..', 'configs', 'without_env'), env: 'development'});

    (() => {
      nconfetti._getDirectory();
    }).should.throw(Error);

    done();
  });

  it('should getDirectory include path as directory without env', (done) => {
    const nconfetti = new Nconfetti({path: path.join(__dirname, '..', 'configs', 'env')});

    should(nconfetti._getDirectory()).be.equal(path.join(__dirname, '..', 'configs', 'env'));

    done();
  });

  it('should raise an Error for getDirectory if directory and env didn\' exist', (done) => {
    const nconfetti = new Nconfetti({path: path.join(__dirname, '..', 'configs', 'did_exist')});

    (() => {
      nconfetti._getDirectory();
    }).should.throw(Error);

    done();
  });

});


text:
{% extends 'base.html' %}

{% block jst %}
    {% include "jst.html" %}
{% endblock jst %}

{% block content %}

Yellow Juice welcome page!

{% endblock content %}


text:
package org.onosproject.ospf.controller;

/**
 * Representation of different OSPF packet types.
 */
public enum OspfPacketType {

    /**
     * OSPF hello packet.
     */
    HELLO(1),
    /**
     * OSPF device description packet.
     */
    DD(2),
    /**
     * OSPF link state request packet.
     */
    LSREQUEST(3),
    /**
     * OSPF link state update packet.
     */
    LSUPDATE(4),
    /**
     * OSPF link state acknowledge packet.
     */
    LSAACK(5);

    private int value;

    /**
     * Creates instance of OSPF packet types.
     *
     * @param value OSPF packet types
     */
    OspfPacketType(int value) {
        this.value = value;
    }

    /**
     * Gets the value.
     *
     * @return value
     */
    public int value() {
        return value;
    }
}


text:
"""
Parsers for netlist files of various formats (only KiCad, at present).
"""

from __future__ import absolute_import, division, print_function, unicode_literals

import re
import string
import sys
from builtins import open
from random import choice, randint

from future import standard_library

standard_library.install_aliases()

THIS_MODULE = locals()

def gen_random_part_csv():
    def random_name(len=20):
        chars = string.printable[:94]
        chars = re.sub('"', "", chars)
        chars = re.sub("'", "", chars)
        chars = re.sub(",", "", chars)
        chars = re.sub("\|", "", chars)
        return "".join(choice(chars) for _ in range(randint(1, len)))

    def zero_pad_nums(s):
        # Pad all numbers in the string with leading 0's.
        # Thus, 'A10' and 'A2' will become 'A00010' and 'A00002' and A2 will
        # appear before A10 in a list.
        try:
            return re.sub(
                r"\d+", lambda mtch: "0" * (8 - len(mtch.group(0))) + mtch.group(0), s
            )
        except TypeError:
            return s  # The input is probably not a string, so just return it unchanged.

    def pin_key(unit_pinnum_tuple):
        return zero_pad_nums(unit_pinnum_tuple[0]) + zero_pad_nums(unit_pinnum_tuple[1])

    part_name = random_name()
    ref_prefix = random_name(2)
    part_csv = "{part_name},{ref_prefix},,,,,".format(**locals())
    part_csv = "\n".join([part_csv, "Pin,Name,Type,Side,Unit,Style,Hidden"])

    num_units = randint(1, 10)
    pins = {}
    for unit in range(1, num_units + 1):
        unit_name = str(unit)
        for _ in range(randint(num_units, 256) // num_units):
            pin_num = (
                choice(string.ascii_uppercase + "           ") + str(randint(1, 256))
            ).strip()
            pin_name = random_name()
            pin_side = choice(["left", "right", "top", "bottom"])
            pin_type = choice(
                [
                    "in",
                    "out",
                    "bidir",
                    "tri",
                    "passive",
                    "pwr",
                    "pwr_out",
                    "open_collector",
                    "open_emitter",
                    "unspecified",
                    "NC",
                ]
            )
            pin_style = choice(
                [
                    "",
                    "inv",
                    "clk",
                    "inv_clk",
                    "input_low",
                    "clk_low",
                    "output_low",
                    "falling_clk",
                    "non_logic",
                ]
            )
            pin_hidden = choice(["Y", ""])
            pin_csv = "{pin_num},{pin_name},{pin_type},{pin_side},{unit_name},{pin_style},{pin_hidden}".format(
                **locals()
            )
            pins[(unit_name, pin_num)] = pin_csv
    for p in sorted(pins.keys(), key=pin_key):
        part_csv = "\n".join([part_csv, pins[p]])

    part_csv = "\n".join([part_csv, ",,,,,,"])
    return part_csv

def gen_random_lib_csv(num_lines=1000):
    lib_csv = gen_random_part_csv()
    while lib_csv.count("\n") < num_lines:
        lib_csv = "\n".join([lib_csv, gen_random_part_csv()])
    lib_csv += "\n"
    return lib_csv

if __name__ == "__main__":
    print(gen_random_lib_csv())


text:
class MethodCallRecorder

  def _play(object, &blk)
    i = 0
    _method_chain.inject(object) do |obj, method_call|
      i += 1
      yield(obj, method_call, _method_chain[i]) if block_given?
      method_call.call_on(obj)
    end
  end

  def _on_method_call(&blk)
    @on_method_call = blk
  end

  def _first_method
    _method_chain.first
  end

  def _last_method
    _method_chain.last
  end

  def _empty?
    _method_chain.empty?
  end

  def _to_s
    'obj' + _method_chain.map{|mc| mc.args_string }.join
  end

  def _method_chain
    @_method_chain ||= []
  end

  def _to_setter(value)
    new_rec = self.dup
    new_rec._method_chain = self._method_chain.dup
    new_rec._method_chain[-1] = self._method_chain[-1].to_setter(value)
    new_rec
  end

  def _reset!
    self._method_chain = []
  end

  def _select(meth, args=nil)
    _method_chain.select do |method_call|
      selected = (method_call.method == meth)
      selected &&= (method_call.args == args) if args
      selected
    end
  end

  attr_accessor :_owner

  def _eql?(other_rec)
    _method_chain == other_rec._method_chain
  end

  protected

  attr_writer :_method_chain

  private

  def method_missing(meth, *args, &blk)
    _method_chain << MethodCall.new(meth, *args, &blk)
    @on_method_call.call(self) if @on_method_call
    self
  end

end


text:
class CreateComments < ActiveRecord::Migration
  def change
    create_table :comments do |t|
      t.integer :user_id
      t.integer :article_id
      t.text :text

      t.timestamps null: false
    end
  end
end


text:
package org.elasticsearch.index.engine;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.RestStatus;

import java.io.IOException;

public class VersionConflictEngineException extends EngineException {

    public VersionConflictEngineException(ShardId shardId, Engine.Operation op, long currentVersion, boolean deleted) {
        this(shardId, op.type(), op.id(), op.versionType().explainConflictForWrites(currentVersion, op.version(), deleted));
    }

    public VersionConflictEngineException(ShardId shardId, String type, String id, String explanation) {
        this(shardId, null, type, id, explanation);
    }

    public VersionConflictEngineException(ShardId shardId, Throwable cause, String type, String id, String explanation) {
        this(shardId, "[{}][{}]: version conflict, {}", cause, type, id, explanation);
    }

    public VersionConflictEngineException(ShardId shardId, String msg, Throwable cause, Object... params) {
        super(shardId, msg, cause, params);
    }

    @Override
    public RestStatus status() {
        return RestStatus.CONFLICT;
    }

    public VersionConflictEngineException(StreamInput in) throws IOException {
        super(in);
    }
}


text:
#ifndef WTF_HashSet_h
#define WTF_HashSet_h

#include <wtf/FastMalloc.h>
#include <wtf/HashTable.h>

namespace WTF {

    struct IdentityExtractor;

    template<typename Value, typename HashFunctions, typename Traits> class HashSet;
    template<typename Value, typename HashFunctions, typename Traits>
    void deleteAllValues(const HashSet<Value, HashFunctions, Traits>&);

    template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash,
        typename TraitsArg = HashTraits<ValueArg> > class HashSet {
        WTF_MAKE_FAST_ALLOCATED;
    private:
        typedef HashArg HashFunctions;
        typedef TraitsArg ValueTraits;

    public:
        typedef typename ValueTraits::TraitType ValueType;

    private:
        typedef HashTable<ValueType, ValueType, IdentityExtractor,
            HashFunctions, ValueTraits, ValueTraits> HashTableType;

    public:
        typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;
        typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
        typedef typename HashTableType::AddResult AddResult;

        void swap(HashSet&);

        int size() const;
        int capacity() const;
        bool isEmpty() const;

        iterator begin() const;
        iterator end() const;

        iterator find(const ValueType&) const;
        bool contains(const ValueType&) const;

        // An alternate version of find() that finds the object by hashing and comparing
        // with some other type, to avoid the cost of type conversion. HashTranslator
        // must have the following function members:
        //   static unsigned hash(const T&);
        //   static bool equal(const ValueType&, const T&);
        template<typename HashTranslator, typename T> iterator find(const T&) const;
        template<typename HashTranslator, typename T> bool contains(const T&) const;

        // The return value is a pair of an interator to the new value's location,
        // and a bool that is true if an new entry was added.
        AddResult add(const ValueType&);
        AddResult add(ValueType&&);

        // An alternate version of add() that finds the object by hashing and comparing
        // with some other type, to avoid the cost of type conversion if the object is already
        // in the table. HashTranslator must have the following function members:
        //   static unsigned hash(const T&);
        //   static bool equal(const ValueType&, const T&);
        //   static translate(ValueType&, const T&, unsigned hashCode);
        template<typename HashTranslator, typename T> AddResult add(const T&);

        // Attempts to add a list of things to the set. Returns true if any of
        // them are new to the set. Returns false if the set is unchanged.
        template<typename IteratorType>
        bool add(IteratorType begin, IteratorType end);

        bool remove(const ValueType&);
        bool remove(iterator);
        void clear();

        ValueType take(const ValueType&);

        static bool isValidValue(const ValueType&);

        bool operator==(const HashSet&) const;

    private:
        friend void deleteAllValues<>(const HashSet&);

        HashTableType m_impl;
    };

    struct IdentityExtractor {
        template<typename T> static const T& extract(const T& t) { return t; }
    };

    template<typename Translator>
    struct HashSetTranslatorAdapter {
        template<typename T> static unsigned hash(const T& key) { return Translator::hash(key); }
        template<typename T, typename U> static bool equal(const T& a, const U& b) { return Translator::equal(a, b); }
        template<typename T, typename U> static void translate(T& location, const U& key, const U&, unsigned hashCode)
        {
            Translator::translate(location, key, hashCode);
        }
    };

    template<typename T, typename U, typename V>
    inline void HashSet<T, U, V>::swap(HashSet& other)
    {
        m_impl.swap(other.m_impl);
    }

    template<typename T, typename U, typename V>
    inline int HashSet<T, U, V>::size() const
    {
        return m_impl.size();
    }

    template<typename T, typename U, typename V>
    inline int HashSet<T, U, V>::capacity() const
    {
        return m_impl.capacity();
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::isEmpty() const
    {
        return m_impl.isEmpty();
    }

    template<typename T, typename U, typename V>
    inline auto HashSet<T, U, V>::begin() const -> iterator
    {
        return m_impl.begin();
    }

    template<typename T, typename U, typename V>
    inline auto HashSet<T, U, V>::end() const -> iterator
    {
        return m_impl.end();
    }

    template<typename T, typename U, typename V>
    inline auto HashSet<T, U, V>::find(const ValueType& value) const -> iterator
    {
        return m_impl.find(value);
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::contains(const ValueType& value) const
    {
        return m_impl.contains(value);
    }

    template<typename Value, typename HashFunctions, typename Traits>
    template<typename HashTranslator, typename T>
    inline auto HashSet<Value, HashFunctions, Traits>::find(const T& value) const -> iterator
    {
        return m_impl.template find<HashSetTranslatorAdapter<HashTranslator> >(value);
    }

    template<typename Value, typename HashFunctions, typename Traits>
    template<typename HashTranslator, typename T>
    inline bool HashSet<Value, HashFunctions, Traits>::contains(const T& value) const
    {
        return m_impl.template contains<HashSetTranslatorAdapter<HashTranslator> >(value);
    }

    template<typename T, typename U, typename V>
    inline auto HashSet<T, U, V>::add(const ValueType& value) -> AddResult
    {
        return m_impl.add(value);
    }

    template<typename T, typename U, typename V>
    inline auto HashSet<T, U, V>::add(ValueType&& value) -> AddResult
    {
        return m_impl.add(std::move(value));
    }

    template<typename Value, typename HashFunctions, typename Traits>
    template<typename HashTranslator, typename T>
    inline auto HashSet<Value, HashFunctions, Traits>::add(const T& value) -> AddResult
    {
        return m_impl.template addPassingHashCode<HashSetTranslatorAdapter<HashTranslator> >(value, value);
    }

    template<typename T, typename U, typename V>
    template<typename IteratorType>
    inline bool HashSet<T, U, V>::add(IteratorType begin, IteratorType end)
    {
        bool changed = false;
        for (IteratorType iter = begin; iter != end; ++iter)
            changed |= add(*iter).isNewEntry;
        return changed;
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::remove(iterator it)
    {
        if (it.m_impl == m_impl.end())
            return false;
        m_impl.internalCheckTableConsistency();
        m_impl.removeWithoutEntryConsistencyCheck(it.m_impl);
        return true;
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::remove(const ValueType& value)
    {
        return remove(find(value));
    }

    template<typename T, typename U, typename V>
    inline void HashSet<T, U, V>::clear()
    {
        m_impl.clear();
    }

    template<typename T, typename U, typename V>
    auto HashSet<T, U, V>::take(const ValueType& value) -> ValueType
    {
        auto it = find(value);
        if (it == end())
            return ValueTraits::emptyValue();

        ValueType result = std::move(const_cast<ValueType&>(*it));
        remove(it);
        return result;
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::isValidValue(const ValueType& value)
    {
        if (ValueTraits::isDeletedValue(value))
            return false;

        if (HashFunctions::safeToCompareToEmptyOrDeleted) {
            if (value == ValueTraits::emptyValue())
                return false;
        } else {
            if (isHashTraitsEmptyValue<ValueTraits>(value))
                return false;
        }

        return true;
    }

    template<typename ValueType, typename HashTableType>
    void deleteAllValues(HashTableType& collection)
    {
        typedef typename HashTableType::const_iterator iterator;
        iterator end = collection.end();
        for (iterator it = collection.begin(); it != end; ++it)
            delete *it;
    }

    template<typename T, typename U, typename V>
    inline void deleteAllValues(const HashSet<T, U, V>& collection)
    {
        deleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);
    }

    template<typename C, typename W>
    inline void copyToVector(const C& collection, W& vector)
    {
        typedef typename C::const_iterator iterator;

        vector.resize(collection.size());

        iterator it = collection.begin();
        iterator end = collection.end();
        for (unsigned i = 0; it != end; ++it, ++i)
            vector[i] = *it;
    }

    template<typename T, typename U, typename V>
    inline bool HashSet<T, U, V>::operator==(const HashSet& other) const
    {
        if (size() != other.size())
            return false;
        for (const_iterator iter = begin(); iter != end(); ++iter) {
            if (!other.contains(*iter))
                return false;
        }
        return true;
    }

} // namespace WTF

using WTF::HashSet;

#endif /* WTF_HashSet_h */


text:
package com.taobao.android.tpatch.model;

import com.taobao.android.object.SoFileDef;
import com.taobao.android.tpatch.utils.MD5Util;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * PatchFile
 *
 * @author zhayu.ll
 * @date 18/5/10
 */
public class PatchFile {

    private File patchFile;

    private List<String>patchInfo = new ArrayList<>();

    public PatchFile(File patchFile) {
        assert patchFile!= null;
        this.patchFile = patchFile;

    }

    public void append(SoFileDef soFileDef){
        String newSoMd5 = null;
        try {
            newSoMd5 = MD5Util.getFileMD5String(soFileDef.newSoFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
        patchInfo.add(soFileDef.relativePath+":"+ newSoMd5);
    }

    public void close(){
        try {
            FileUtils.writeLines(patchFile,patchInfo);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}