text:
[![Build Status](https://travis-ci.org/IkoroVictor/paystack-ruby.svg?branch=master)](https://travis-ci.org/IkoroVictor/paystack-ruby) [![Gem Version](https://badge.fury.io/rb/paystack.svg)](https://badge.fury.io/rb/paystack)

A ruby gem for easy integration of [Paystack](https://paystack.co/).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'paystack'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install paystack

## Basic Usage

### Instantiate Paystack Object

```ruby

    paystackObj = Paystack.new(public_key, secret_key)

```

A secure way is to set your public and private keys as environmental variables `PAYSTACK_PUBLIC_KEY` and `PAYSTACK_PRIVATE_KEY` respectively. Then you instantiate without parameters

```ruby

	paystackObj =  Paystack.new

```
It throws a `PaystackBadKeyError` when either of the keys are invalid or cannot be found as environment variables.

### Initialize transaction and get Authorization URL

```ruby

	transactions = PaystackTransactions.new(paystackObj)
	result = transactions.initializeTransaction(
		:reference => "blablablabla-YOUR-UNIQUE-REFERENCE-HERE",
		:amount => 300000,
		:email => "xxxxxx@gmail.com",
		)
	auth_url = result['data']['authorization_url']
```
NOTE: Amount is in kobo i.e. `100000 = 100000 kobo = 1000 naira`

### Charge using Authorization code for returning customers

```ruby

	result = transactions.chargeAuthorization(
		"WwdkojpoAJo", 				# Authorization code
		"xxxxxx@gmail.com", 		# Customer email
		2000000, 					# Amount
		:reference => "blablablabla-YOUR-UNIQUE-REFERENCE-HERE"
		)
```

## Transactions

### List transactions

```ruby

	page_number = 1
	transactions = PaystackTransactions.new(paystackObj)
	result = transactions.list(page_number) 	#Optional `page_number` parameter

```

### Get a transaction

```ruby

	transaction_id = "123456778"
	transactions = PaystackTransactions.new(paystackObj)
	result = transactions.get(transaction_id)

```

### Verify a transaction

```ruby

	transaction_reference = "blablablabla-YOUR-VALID-UNIQUE-REFERENCE-HERE"
	transactions = PaystackTransactions.new(paystackObj)
	result = transactions.verify(transaction_reference)

```

### Get transaction totals

```ruby

	transactions = PaystackTransactions.new(paystackObj)
	result = transactions.totals()

```

## Customers

### List Customers

```ruby

	page_number = 1
	customers = PaystackCustomers.new(paystackObj)
	result = customers.list(page_number) 	#Optional `page_number` parameter,  50 items per page
	customers_list = result['data']

```

### Get a customer

```ruby

	customer_id = "123456778"
	customers = PaystackCustomers.new(paystackObj)
	result = customers.get(customer_id)
	customer =  result['data']

```

### Create new customer

```ruby

	customers = PaystackCustomers.new(paystackObj)
	result = customers.create(
		:first_name => "Victor",
		:last_name => "Ikoro",
		:phone => "+234707666669"
		:email => "xxxxx@gmail.com"
	)

```

### Update customer details

```ruby

	customer_id = "123456778"
	customers = PaystackCustomers.new(paystackObj)
	# Updating last name and email of customer
	result = customers.update(
		customer_id,
		:last_name => "Ikorodu",
		:email => "xxxxx-modified@gmail.com"
	)

```

## Plans

### List Plans

```ruby

	page_number = 1
	plans = PaystackPlans.new(paystackObj)
	result = plans.list(page_number) 	#Optional `page_number` parameter,  50 items per page
	plans_list = result['data']

```

### Get plan detail

```ruby

	plan_id = "123456778"
	plans = PaystackPlans.new(paystackObj)
	result = plans.get(plan_id)
	plan =  result['data']

```

### Create new plan

```ruby

	plans = PaystackPlans.new(paystackObj)
	result = plans.create(

				:name => "Test Plan",
				:description => "Dev Test Plan",
				:amount => 30000, #in KOBO
				:interval => "monthly", #monthly, yearly, quarterly, weekly etc
				:currency => "NGN"
			)

```

### Update plan details

```ruby

	plan_id = "123456778"
	plans = PaystackPlans.new(paystackObj)
	result = plans.update(
			plan_id,
			:name => "Test Plan Updated",
			:amount => 500000, #in KOBO
			:interval => "weekly"
			)

```

## Subscriptions

### Create new subscription

```ruby

	subscriptions = PaystackSubscriptions.new(paystackObj)
	result = subscriptions.create(

				:customer => "customer@email.com",
				:plan => "123557", #plan id
				:amount => 30000 #in KOBO
			)

```

### Get subscription detail

```ruby

	subscription_id = "123456778"
	subscriptions = PaystackSubscriptions.new(paystackObj)
	result = subscriptions.get(subscription_id)
	subscription =  result['data']

```

### Enable subscription

```ruby

	subscriptions = PaystackSubscriptions.new(paystackObj)
	result = subscriptions.enable(
				:code => "12328833",
				:token => "EWFWKFJWE" #user email token
			)

```

### Disable subscription

```ruby

	subscriptions = PaystackSubscriptions.new(paystackObj)
	result = subscriptions.disable(
				:code => "12328833",
				:token => "EWFWKFJWE" #user email token
			)

```

## Split Payments

This Gem is also aware of the API calls that allow you to perform split payments on Paystack. The [Paystack documentation on split payments](https://developers.paystack.co/docs/split-payments-overview) can get you started. Below are some sample calls for [subaccounts](https://developers.paystack.co/docs/create-subaccount) and [banks](https://developers.paystack.co/docs/list-banks).

## Banks

### List Banks

```ruby

	page_number = 1
	banks = PaystackBanks.new(paystackObj)
	result = banks.list(page_number) 	#Optional `page_number` parameter,  50 items per page
	banks_list = result['data']

```

## Subaccounts

### List Subaccounts

```ruby

	page_number = 1
	subaccounts = PaystackSubaccounts.new(paystackObj)
	result = subaccounts.list(page_number) 	#Optional `page_number` parameter,  50 items per page
	subaccounts_list = result['data']

```

### Get a subaccount

```ruby

	subaccount_id = "123456778"
	subaccounts = PaystackSubaccounts.new(paystackObj)
	result = subaccounts.get(subaccount_id)
	subaccount =  result['data']

```

### Create new subaccount

```ruby

	subaccounts = PaystackSubaccounts.new(paystackObj)
	result = subaccounts.create(
		:business_name => "Madam Ikoro Holdings",
		:settlement_bank => "Providus Bank",
		:account_number => "1170766666",
		:percentage_charge => 3.2
	)

```

### Update subaccount details

```ruby

	subaccount_id = "123456778"
	subaccounts = PaystackSubaccounts.new(paystackObj)
	# Updating primary contact name and email of subaccount
	result = subaccounts.update(
		subaccount_id,
		:primary_contact_name => "Victoria Ikorodu",
		:primary_contact_email => "xxxxx-modified@gmail.com"
	)

```

## Settlements
Fetch settlements made to your bank accounts and the bank accounts for your subaccounts

### List settlements

```ruby

	settlements = PaystackSettlements.new(paystackObj)
	results = settlements.list
	settlements_list = result['data']

```

## Transfers

The funds transfers feature enables you send money directly from your paystack balance to any Nigerian Bank account. The [Paystack documentation on transfers](https://developers.paystack.co/docs/funds_transfers) can get you started.

## Balance

### Check Paystack Balance

```ruby

	balance = PaystackBalance.new(paystackObj)
	result = balance.get
	account_balance = result['data']

```

## Transfers

### Initialize a transfer

```ruby

	transfer = PaystackTransfers.new(paystackObj)
	results = transfers.initializeTransfer(
		:source => "balance", # Must be balance
		:reason => "Your reason",
		:amount => 30000, # Amount in kobo
		:recipient =>  recipient_code, # Unique recipient code
		)

```

### Bulk transfer

```ruby

	transfer = PaystackTransfers.new(paystackObj)
	results = transfers.initializeBulkTransfer(
		:source => "balance", # Must be balance
		:transfer => [
			{
				:reason => "Your reason",
				:amount => 30000, # Amount in kobo
				:recipient =>  recipient_code, # Unique recipient code
			},
			{
				:reason => "Your reason",
				:amount => 30000, # Amount in kobo
				:recipient =>  recipient_code, # Unique recipient code
			},
		]
	)

```

### List transfers

```ruby

	page_number = 1
	transfers = PaystackTransfers.new(paystackObj)
	result = transfers.list(page_number) 	#Optional `page_number` parameter

```

### Get a transfer

```ruby

	transfer_code = "TRF_uniquecode"
	transfer = PaystackTransfers.new(paystackObj)
	result = transfer.get(transfer_code)

```

### Finalize a transfer

```ruby

	transfer = PaystackTransfers.new(paystackObj)
	results = transfer.authorize(
		:transfer_code => "TRF_blablabla", # Must be balance
		:otp => "12350",
		)

```

## Transfer Recipients

### Create new recipient

```ruby

	recipient = PaystackRecipients.new(paystackObj)
	result = recipient.create(
		:type => "nuban", #Must be nuban
		:name => "Test Plan",
		:description => "Bla-bla-bla",
		:account_number => 0123456789, #10 digit account number
		:bank_code => "044", #monthly, yearly, quarterly, weekly etc
		:currency => "NGN",

	)

```

### List transfer recipients

```ruby
	page_number = 1
	recipients = PaystackRecipients.new(paystackObj)
	result = recipients.list(page_number) #Optional `page_number` parameter,  50 items per page
	recipients_list =  result['data']

```

## Transfer Control

### Resend OTP

```ruby
	transfer_code = "TRF_asdfghjkl"	#A unique Transfer code is generated when transfer is created
	transfer = PaystackTransfers.new(paystackObj)
	result = transfer.resendOtp(transfer_code)

```

### Disable OTP for transfers

```ruby

	transfer = PaystackTransfers.new(paystackObj)
	result = transfer.disableOtp
	#OTP is sent to the registered phone number of the account

```

### Confirm disabling of OTP for transfers

```ruby

	otp = "12345"
	transfer = PaystackTransfers.new(paystackObj)
	# Updating primary contact name and email of subaccount
	result = transfer.confirmDisableOtp(
		:otp => otp, #Must be valid OTP sent to the registered phone number
	)

```

### Enable OTP for transfers

```ruby

	transfer = PaystackTransfers.new(paystackObj)
	result = transfer.enableOtp

```

## Refunds

### Create a refund

```ruby

 refund = PaystackRefunds.new(paystackObj)

 #full refund
 transaction = {transaction: transaction_reference}
 refund.createRefund(transaction) #must be a valid transaction reference or transaction id

 #partial refund
 transaction = {transaction: transaction_reference, amount: 5000} # minimum amount 50 NGN or 5000 kobos
 refund.createRefund(transaction)

```

### List refunds

```ruby

	page_number = 1
 	refund = PaystackRefunds.new(paystackObj)
	refund.list(page_number) # page_number is optional

```

### Fetch refund

```ruby

 	refund = PaystackRefunds.new(paystackObj)
	refund.get(refund_id) # returned at the time of creating a refund

```

## Static methods
`PaystackTransactions`, `PaystackCustomers`, `PaystackPlans`, `PaystackSubaccounts`, `PaystackRefunds`, `PaystackBanks` , `PaystackSubscriptions` , `PaystackSettlements`, `PaystackBalance`, and `PaystackTransfers` methods can be called statically, You just need to pass the paystack object as the first parameter  e.g. `verify` method in `PaystackTransactions` can be called like this

```ruby

	transaction_reference = "blablablabla-YOUR-VALID-UNIQUE-REFERENCE-HERE"
	result = PaystackTransactions.verify(paystackObj, transaction_reference)
	puts result['message']

```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/IkoroVictor/paystack-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
module.exports = function mapper(compileFn, options) {
  if (typeof compileFn !== 'function') {
    throw new Error('URL Mapper - function to compile a route expected as first argument')
  }

  options = options || {}
  var cache = {}

  function getCompiledRoute(route) {
    if (!cache[route]) {
      cache[route] = compileFn(route, options)
    }

    return cache[route]
  }

  function parse(route, url) {
    if (arguments.length < 2) throw new Error('URL Mapper - parse method expects 2 arguments')
    return getCompiledRoute(route).parse(url)
  }

  function stringify(route, values) {
    if (arguments.length < 2) throw new Error('URL Mapper - stringify method expects 2 arguments')
    return getCompiledRoute(route).stringify(values)
  }

  function map(url, routes) {
    if (arguments.length < 2) throw new Error('URL Mapper - map method expects 2 arguments')
    for (var route in routes) {
      var compiled = getCompiledRoute(route)
      var values = compiled.parse(url)
      if (values) {
        var match = routes[route]

        return {
          route: route,
          match: match,
          values: values
        }
      }
    }
  }

  return {
    parse: parse,
    stringify: stringify,
    map: map
  }
}

redpajama_set_name: RedPajamaGithub


text:
@interface ViewController ()

@property (nonatomic, strong) NSArray     *testGCDArrays;
@property (nonatomic, strong) NSArray     *testQueueArrays;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.testGCDArrays = @[@"串行同步", @"并行同步"];
    self.testQueueArrays = @[@"串行同步", @"并行同步", @"并行同步取消其它任务"];
}

- (void)test_multiTask {
    NSLog(@"\n\n 多线程 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [self execTaskA];
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [self execTaskB];
    });
}

#pragma mark - GCD
- (void)test_gcd_serialSyn {
    NSLog(@"\n\n GCD 串行执行,堵塞线程 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeSerial execSyncBlock:^{
            [self execTaskA];
            NSLog(@"A Finish");
        }];
        NSLog(@"A GOON EXEC");
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeSerial execSyncBlock:^{
            [self execTaskB];
            NSLog(@"B Finish");
        }];
        NSLog(@"B GOON EXEC");
    });
}

- (void)test_gcd_concurrentSyn {
    NSLog(@"\n\n GCD 并行执行,不堵塞线程 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeSerial execAsynBlock:^{
            [self execTaskA];
            NSLog(@"A Finish");
        }];
        NSLog(@"A GOON EXEC");
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeSerial execAsynBlock:^{
            [self execTaskB];
            NSLog(@"B Finish");
        }];
        NSLog(@"B GOON EXEC");
    });
}

#pragma mark - Queue
- (void)test_serialSyn {
    NSLog(@"\n\n Queue 串行执行,堵塞线程 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execSyncBlock:^{
            [self execTaskA];
            NSLog(@"A Finish");
        }];
        NSLog(@"A GOON EXEC");
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execSyncBlock:^{
            [self execTaskB];
            NSLog(@"B Finish");
        }];
        NSLog(@"B GOON EXEC");
    });
}

- (void)test_concurrentSyn {
    NSLog(@"\n\n Queue 并行执行,不堵塞线程 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execAsynBlock:^{
            [self execTaskA];
            NSLog(@"A Finish");
        }];
        NSLog(@"A GOON EXEC");
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execAsynBlock:^{
            [self execTaskB];
            NSLog(@"B Finish");
        }];
        NSLog(@"B GOON EXEC");
    });
}

- (void)test_concurrentSynCancel {
    NSLog(@"\n\n Queue 并行执行的时候可以取消其它任务 \n");
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execAsynBlock:^{
            NSLog(@"B Cancel");
            [HJSynchronizeQueue cancelAllOperations];
            [self execTaskA];
            NSLog(@"A Finish");
        }];
    });
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [HJSynchronizeQueue execAsynBlock:^{
            NSLog(@"A Cancel");
            [HJSynchronizeQueue cancelAllOperations];
            [self execTaskB];
            NSLog(@"B Finish");
        }];
    });
}

#pragma mark -
- (void)execTaskA {
    for (u_int8_t i = 0; i < 5; i++) {
        NSLog(@"A %d", i);
    }
}

- (void)execTaskB {
    for (u_int8_t i = 0; i < 5; i++) {
        NSLog(@"B %d", i);
    }
}

#pragma mark -
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (indexPath.section == 0) {
        [self test_multiTask];
        return;
    }
    if (indexPath.section == 0) {
        switch (indexPath.row) {
            case 0:
                [self test_gcd_serialSyn];
                break;
            case 1:
                [self test_gcd_concurrentSyn];
                break;
            default:
                break;
        }
        return;
    }
    switch (indexPath.row) {
        case 0:
            [self test_serialSyn];
            break;
        case 1:
            [self test_concurrentSyn];
            break;
        case 2:
            [self test_concurrentSynCancel];
        default:
            break;
    }
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    switch (section) {
        case 0:return @"";
        case 1:return @"GCD";
        case 2:return @"Queue";
        default:return nil;
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    switch (section) {
        case 0:return 1;
        case 1:return self.testGCDArrays.count;
        case 2:return self.testQueueArrays.count;
        default:return 0;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    switch (indexPath.section) {
        case 0:
            cell.textLabel.text = @"多线程";
            break;
        case 1:
            cell.textLabel.text = self.testGCDArrays[indexPath.row];
            break;
        case 2:
            cell.textLabel.text = self.testQueueArrays[indexPath.row];
            break;
    }

    return cell;
}

@end


text:
import {Host, Directive, Component, View, CORE_DIRECTIVES} from 'angular2/angular2';

@Component({
  selector: 'tabs'
})
@View({
  template: `

{{tab.title}}

      <ng-content></ng-content>

  `,
  directives: [CORE_DIRECTIVES]
})
export class Tabs {
  private selectedIdx:number;
  private tabs:Tab[];
  constructor() {
    this.selectedIdx = 0;
    this.tabs = [];
  }
  select(idx:number) {
    this.selectedIdx = idx;
  }
  addTab(tab:Tab) {
    let idx = this.tabs.length;
    this.tabs.push(tab);
    return idx;
  }
  getSelectedIndex() {
    return this.selectedIdx;
  }
}

@Component({
  selector: 'tab',
  properties: ['title']
})
@View({
  template: `

      <ng-content></ng-content>

  `
})
export class Tab {
  public title:string;
  public index:number;
  constructor(@Host() private parent:Tabs) {
    this.index = parent.addTab(this);
  }
  isActive():boolean {
    console.log(this.title, this.parent.getSelectedIndex() === this.index);
    return this.parent.getSelectedIndex() === this.index;
  }
}


text:
package developers

import (
	"github.com/apigee/apigeecli/apiclient"
	"github.com/apigee/apigeecli/client/developers"
	"github.com/spf13/cobra"
)

//ExpCmd to export developer
var ExpCmd = &cobra.Command{
	Use:   "export",
	Short: "Export Developers to a file",
	Long:  "Export Developers to a file",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		const exportFileName = "developers.json"

		respBody, err := developers.Export()
		if err != nil {
			return err
		}

		return apiclient.WriteByteArrayToFile(exportFileName, false, respBody)
	},
}

func init() {

}


text:
SYNONYM

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

#### Published in
Syll. fung. (Abellini) 8: 544 (1889)

#### Original name
Ascobolus niveus Quél., 1881

### Remarks
null


text:
from .Response import Response

class ExposeResponse(Response):
    def __init__(self, response):

        if self.STATUS_OK == response['status']:
            pass
        else:
            self.setMessage(response['message'])
        self.setStatus(response['status'])


text:
require 'spec_helper'

feature 'Merge Request button' do
  shared_examples 'Merge request button only shown when allowed' do
    let(:user) { create(:user) }
    let(:project) { create(:project, :public) }
    let(:forked_project) { create(:project, :public, forked_from_project: project) }

    context 'not logged in' do
      it 'does not show Create merge request button' do
        visit url

        expect(page).not_to have_link(label)
      end
    end

    context 'logged in as developer' do
      before do
        sign_in(user)
        project.add_developer(user)
      end

      it 'shows Create merge request button' do
        href = project_new_merge_request_path(project,
                                              merge_request: { source_branch: 'feature',
                                                               target_branch: 'master' })

        visit url

        within('#content-body') do
          expect(page).to have_link(label, href: href)
        end
      end

      context 'merge requests are disabled' do
        before do
          project.project_feature.update!(merge_requests_access_level: ProjectFeature::DISABLED)
        end

        it 'does not show Create merge request button' do
          visit url

          within('#content-body') do
            expect(page).not_to have_link(label)
          end
        end
      end
    end

    context 'logged in as non-member' do
      before do
        sign_in(user)
      end

      it 'does not show Create merge request button' do
        visit url

        within('#content-body') do
          expect(page).not_to have_link(label)
        end
      end

      context 'on own fork of project' do
        let(:user) { forked_project.owner }

        it 'shows Create merge request button' do
          href = project_new_merge_request_path(forked_project,
                                                merge_request: { source_branch: 'feature',
                                                                 target_branch: 'master' })

          visit fork_url

          within("#content-body") do
            expect(page).to have_link(label, href: href)
          end
        end
      end
    end
  end

  context 'on branches page' do
    it_behaves_like 'Merge request button only shown when allowed' do
      let(:label) { 'Merge request' }
      let(:url) { project_branches_path(project, search: 'feature') }
      let(:fork_url) { project_branches_path(forked_project, search: 'feature') }
    end
  end

  context 'on compare page' do
    it_behaves_like 'Merge request button only shown when allowed' do
      let(:label) { 'Create merge request' }
      let(:url) { project_compare_path(project, from: 'master', to: 'feature') }
      let(:fork_url) { project_compare_path(forked_project, from: 'master', to: 'feature') }
    end
  end

  context 'on commits page' do
    it_behaves_like 'Merge request button only shown when allowed' do
      let(:label) { 'Create merge request' }
      let(:url) { project_commits_path(project, 'feature') }
      let(:fork_url) { project_commits_path(forked_project, 'feature') }
    end
  end
end


text:
using System;
using Xwt.Backends;

namespace Xwt
{
	[BackendType (typeof(ISpinButtonBackend))]
	public class SpinButton : Widget
	{
		ButtonStyle style;

		static SpinButton()
		{
			MapEvent (SpinButtonEvent.ValueChanged, typeof(SpinButton), "OnValueChanged");
			MapEvent (SpinButtonEvent.ValueInput, typeof(SpinButton), "OnValueInput");
			MapEvent (SpinButtonEvent.ValueOutput, typeof(SpinButton), "OnValueOutput");
		}

		protected new class WidgetBackendHost: Widget.WidgetBackendHost, ISpinButtonEventSink
		{
			public void ValueChanged ()
			{
				((SpinButton)Parent).OnValueChanged (EventArgs.Empty);
			}

			public void ValueInput (SpinButtonInputEventArgs inputArgs)
			{
				((SpinButton)Parent).OnValueInput (inputArgs);
			}

			public void ValueOutput (WidgetEventArgs args)
			{
				((SpinButton)Parent).OnValueOutput (args);
			}
		}

		ISpinButtonBackend Backend {
			get { return (ISpinButtonBackend) BackendHost.Backend; }
		}

		protected override BackendHost CreateBackendHost ()
		{
			return new WidgetBackendHost ();
		}

		public double ClimbRate {
			get { return Backend.ClimbRate; }
			set { Backend.ClimbRate = value; }
		}

		public int Digits {
			get { return Backend.Digits; }
			set { Backend.Digits = value; }
		}

		public double Value {
			get { return Backend.Value; }
			set { Backend.Value = value; }
		}

		public string Text {
			get { return Backend.Text; }
			set { Backend.Text = value; }
		}

		public bool Wrap {
			get { return Backend.Wrap; }
			set { Backend.Wrap = value; }
		}

		public double MinimumValue {
			get { return Backend.MinimumValue; }
			set { Backend.MinimumValue = value; }
		}

		public double MaximumValue {
			get { return Backend.MaximumValue; }
			set { Backend.MaximumValue = value; }
		}

		public double IncrementValue {
			get { return Backend.IncrementValue; }
			set { Backend.IncrementValue = value; }
		}

		public ButtonStyle Style {
			get { return style; }
			set {
				style = value;
				Backend.SetButtonStyle (style);
				OnPreferredSizeChanged ();
			}
		}

		public string IndeterminateMessage {
			get { return Backend.IndeterminateMessage; }
			set { Backend.IndeterminateMessage = value; }
		}

		public bool IsIndeterminate {
			get { return Backend.IsIndeterminate; }
			set { Backend.IsIndeterminate = value; }
		}

		protected virtual void OnValueChanged (EventArgs e)
		{
			if (valueChanged != null)
				valueChanged (this, e);
		}

		EventHandler valueChanged;

		public event EventHandler ValueChanged {
			add {
				BackendHost.OnBeforeEventAdd (SpinButtonEvent.ValueChanged, valueChanged);
				valueChanged += value;
			}
			remove {
				valueChanged -= value;
				BackendHost.OnAfterEventRemove (SpinButtonEvent.ValueChanged, valueChanged);
			}
		}

		protected virtual void OnValueInput (SpinButtonInputEventArgs e)
		{
			if (valueInput != null)
				valueInput (this, e);
		}

		EventHandler<SpinButtonInputEventArgs> valueInput;

		public event EventHandler<SpinButtonInputEventArgs> ValueInput {
			add {
				BackendHost.OnBeforeEventAdd (SpinButtonEvent.ValueInput, valueInput);
				valueInput += value;
			}
			remove {
				valueInput -= value;
				BackendHost.OnAfterEventRemove (SpinButtonEvent.ValueInput, valueInput);
			}
		}

		protected virtual void OnValueOutput (WidgetEventArgs e)
		{
			if (valueOutput != null)
				valueOutput (this, e);
		}

		EventHandler<WidgetEventArgs> valueOutput;

		public event EventHandler<WidgetEventArgs> ValueOutput {
			add {
				BackendHost.OnBeforeEventAdd (SpinButtonEvent.ValueOutput, valueOutput);
				valueOutput += value;
			}
			remove {
				valueOutput -= value;
				BackendHost.OnAfterEventRemove (SpinButtonEvent.ValueOutput, valueOutput);
			}
		}
	}
}


text:
package io.gatling.core.pause

import scala.concurrent.duration.Duration

import io.gatling.core.session.Expression

trait PauseSupport {

  val disabledPauses = Disabled
  val constantPauses = Constant
  val exponentialPauses = Exponential
  def normalPausesWithPercentageDuration(stdDev: Double) = NormalWithPercentageDuration(stdDev)
  def normalPausesWithStdDevDuration(stdDev: Duration) = NormalWithStdDevDuration(stdDev)
  def customPauses(custom: Expression[Long]) = Custom(custom)
  def uniformPausesPlusOrMinusPercentage(plusOrMinus: Double) = UniformPercentage(plusOrMinus)
  def uniformPausesPlusOrMinusDuration(plusOrMinus: Duration) = UniformDuration(plusOrMinus)
}


text:
const Encoder = require('../../../encoder')
const { Fetch: apiKey } = require('../../apiKeys')

/**
 * Fetch Request (Version: 3) => replica_id max_wait_time min_bytes max_bytes [topics]
 *   replica_id => INT32
 *   max_wait_time => INT32
 *   min_bytes => INT32
 *   max_bytes => INT32
 *   topics => topic [partitions]
 *     topic => STRING
 *     partitions => partition fetch_offset max_bytes
 *       partition => INT32
 *       fetch_offset => INT64
 *       max_bytes => INT32
 */

/**
 * @param {number} replicaId Broker id of the follower
 * @param {number} maxWaitTime Maximum time in ms to wait for the response
 * @param {number} minBytes Minimum bytes to accumulate in the response.
 * @param {number} maxBytes Maximum bytes to accumulate in the response. Note that this is not an absolute maximum,
 *                          if the first message in the first non-empty partition of the fetch is larger than this value,
 *                          the message will still be returned to ensure that progress can be made.
 * @param {Array} topics Topics to fetch
 *                        [
 *                          {
 *                            topic: 'topic-name',
 *                            partitions: [
 *                              {
 *                                partition: 0,
 *                                fetchOffset: '4124',
 *                                maxBytes: 2048
 *                              }
 *                            ]
 *                          }
 *                        ]
 */
module.exports = ({ replicaId, maxWaitTime, minBytes, maxBytes, topics }) => ({
  apiKey,
  apiVersion: 3,
  apiName: 'Fetch',
  encode: async () => {
    return new Encoder()
      .writeInt32(replicaId)
      .writeInt32(maxWaitTime)
      .writeInt32(minBytes)
      .writeInt32(maxBytes)
      .writeArray(topics.map(encodeTopic))
  },
})

const encodeTopic = ({ topic, partitions }) => {
  return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))
}

const encodePartition = ({ partition, fetchOffset, maxBytes }) => {
  return new Encoder()
    .writeInt32(partition)
    .writeInt64(fetchOffset)
    .writeInt32(maxBytes)
}


text:
-- #df:entity#

-- !df:pmb!
-- !!AutoDetect!!

select member.MEMBER_ID
     , member.MEMBER_NAME
     , memberStatus.MEMBER_STATUS_NAME
  from MEMBER member
    left outer join MEMBER_STATUS memberStatus
      on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE
 /*BEGIN*/where
   /*IF pmb.memberId != null*/
   member.MEMBER_ID = /*pmb.memberId*/3
   /*END*/
   /*IF pmb.memberName != null*/
   and member.MEMBER_NAME like /*pmb.memberName*/'S%'
   /*END*/
 /*END*/
 order by member.MEMBER_ID asc


text:
require 'ansible/ruby/modules/base'

module Ansible
  module Ruby
    module Modules
      # The BucketAccessControls resource represents the Access Control Lists (ACLs) for buckets within Google Cloud Storage. ACLs let you specify who has access to your data and to what extent.
      # There are three roles that can be assigned to an entity:  READERs can get the bucket, though no acl property will be returned, and list the bucket's objects.  WRITERs are READERs, and they can insert objects into the bucket and delete the bucket's objects.  OWNERs are WRITERs, and they can get the acl property of a bucket, update a bucket, and call all BucketAccessControls methods on the bucket.  For more information, see Access Control, with the caveat that this API uses READER, WRITER, and OWNER instead of READ, WRITE, and FULL_CONTROL.
      class Gcp_storage_bucket_access_control < Base
        # @return [:present, :absent, nil] Whether the given object should exist in GCP
        attribute :state
        validates :state, expression_inclusion: {:in=>[:present, :absent], :message=>"%{value} needs to be :present, :absent"}, allow_nil: true

        # @return [String] The name of the bucket.
        attribute :bucket
        validates :bucket, presence: true, type: String

        # @return [String] The entity holding the permission, in one of the following forms: user-userId user-email group-groupId group-email domain-domain project-team-projectId allUsers allAuthenticatedUsers Examples: The user liz@example.com would be user-liz@example.com.,The group example@googlegroups.com would be   group-example@googlegroups.com.,To refer to all members of the Google Apps for Business domain   example.com, the entity would be domain-example.com.
        attribute :entity
        validates :entity, presence: true, type: String

        # @return [Object, nil] The ID for the entity.
        attribute :entity_id

        # @return [Object, nil] The project team associated with the entity.
        attribute :project_team

        # @return [:OWNER, :READER, :WRITER, nil] The access permission for the entity.
        attribute :role
        validates :role, expression_inclusion: {:in=>[:OWNER, :READER, :WRITER], :message=>"%{value} needs to be :OWNER, :READER, :WRITER"}, allow_nil: true
      end
    end
  end
end


text:
Installing
==========

1.  **The module is not on PyPI yet** but once it is published you can install it with ``pip`` like everything else:

    ::

        pip install django-yaat

2.  Then add the ``'yaat'`` module to the ``INSTALLED_APPS``.

3.  Migrate the models:

    ::

        python manage.py migrate yaat


text:
# Flight - CommonJS Version

[Flight](http://flightjs.github.io/) is a lightweight, component-based,
event-driven JavaScript framework that maps behavior to DOM nodes. It was
created at Twitter, and is used by the [twitter.com](https://twitter.com/) and
[TweetDeck](https://tweetdeck.twitter.com/) web applications.

**Note**: This is a CJS fork of Twitter Flight v 1.5 and is largely adopted from [@necolas](https://github.com/necolas) wip branch in Github.

## Example

A simple example of a Flight component.

```js
/* Component definition */

var Inbox = flight.component(inbox);

function inbox() {
  this.doSomething = function() { /* ... */ }
  this.doSomethingElse = function() { /* ... */ }

  // after initializing the component
  this.after('initialize', function() {
    this.on('click', this.doSomething);
    this.on('mouseover', this.doSomethingElse);
  });
}

/* Attach the component to a DOM node */

Inbox.attachTo('#inbox');
```

## Installation

Using [npm](https://www.npmjs.org/):

```
npm install --save TODO
```

Using [Bower](http://bower.io/):

```
bower install --save TODO
```

You will have to load [jQuery](http://jquery.com) in your application.

## Why Flight?

Flight is only ~5K minified and gzipped. It's built upon jQuery.

Flight components are highly portable and easily testable. This is because a
Flight component (and its API) is entirely decoupled from other components.
Flight components communicate only by triggering and subscribing to events.

Flight also includes a simple and safe
[mixin](https://javascriptweblog.wordpress.com/2011/05/31/a-fresh-look-at-javascript-mixins/)
infrastructure, allowing components to be easily extended with minimal
boilerplate.

## Development tools

Flight has supporting projects that provide everything you need to setup,
write, and test your application.

* [Flight generator](https://github.com/flightjs/generator-flight/)
  Recommended. One-step to setup a Flight-based web app.

* [Flight package generator](https://github.com/flightjs/generator-flight-package/)
  Recommended. One-step to setup everything you need to write and test a
  standalone Flight component.

* [Jasmine Flight](https://github.com/flightjs/jasmine-flight/)
  Extensions for the Jasmine test framework.

* [Mocha Flight](https://github.com/flightjs/mocha-flight/)
  Extensions for the Mocha test framework.

## Finding and writing components

You can browse all the [Flight components](http://flight-components.jit.su)
available at this time. They can also be found by searching the Bower registry:

```
bower search flight
```

The easiest way to write a new Flight component is to use the [Flight
package generator](https://github.com/flightjs/generator-flight-package/):

```
yo flight-package foo
```

## Browser Support

Chrome, Firefox, Safari, Opera, IE 7+ (requires [ES5-shim](https://github.com/kriskowal/es5-shim)).

## Quick Overview

Here's a brief introduction to Flight's key concepts and syntax. Read the [API
documentation](doc) for a comprehensive overview.

### Components ([API](doc/component_api.md))

- A Component is nothing more than a constructor with properties mixed into its prototype.
- Every Component comes with a set of basic functionality such as event handling and component registration.
(see [Base API](doc/base_api.md))
- Additionally, each Component definition mixes in a set of custom properties which describe its behavior.
- When a component is attached to a DOM node, a new instance of that component is created. Each component
instance references the DOM node via its `node` property.
- Component instances cannot be referenced directly; they communicate with other components via events.

### Interacting with the DOM

Once attached, component instances have direct access to their node object via the `node` property. (There's
also a jQuery version of the node available via the `$node` property.)

### Events in Flight

Events are how Flight components interact. The Component prototype supplies methods for triggering events as
well as for subscribing to and unsubscribing from events. These Component event methods are actually just convenient
wrappers around regular event methods on DOM nodes.

### Mixins ([API](doc/mixin_api.md))

- In Flight, a mixin is a function which assigns properties to a target object (represented by the `this`
keyword).
- A typical mixin defines a set of functionality that will be useful to more than one component.
- One mixin can be applied to any number of [Component](#components) definitions.
- One Component definition can have any number of mixins applied to it.
- Each Component defines a [*core*](#core_mixin) mixin within its own module.
- A mixin can itself have mixins applied to it.

### Advice ([API](doc/advice_api.md))

In Flight, advice is a mixin (`'lib/advice.js'`) that defines `before`, `after` and `around` methods.

These can be used to modify existing functions by adding custom code. All Components have advice mixed in to
their prototype so that mixins can augment existing functions without requiring knowledge
of the original implementation. Moreover, since Component's are seeded with an empty `initialize` method,
Component definitions will typically use `after` to define custom `initialize` behavior.

### Debugging ([API](doc/debug_api.md))

Flight ships with a debug module which can help you trace the sequence of event triggering and binding. By default
console logging is turned off, but you can log `trigger`, `on` and `off` events by means of the following console
commands.

## Maintainers

+ [@phuu](http://github.com/phuu)
+ [@ahume](http://github.com/ahume)

## Authors

+ [@angus-c](http://github.com/angus-c)
+ [@danwrong](http://github.com/danwrong)
+ [@kpk](http://github.com/kennethkufluk)

Thanks for assistance and contributions:
[@sayrer](https://github.com/sayrer),
[@shinypb](https://github.com/shinypb),
[@kloots](https://github.com/kloots),
[@marcelduran](https://github.com/marcelduran),
[@tbrd](https://github.com/tbrd),
[@necolas](https://github.com/necolas),
[@fat](https://github.com/fat),
[@mkuklis](https://github.com/mkuklis),
[@jrburke](https://github.com/jrburke),
[@garann](https://github.com/garann),
[@WebReflection](https://github.com/WebReflection),
[@coldhead](https://github.com/coldhead),
[@paulirish](https://github.com/paulirish),
[@nimbupani](https://github.com/nimbupani),
[@mootcycle](https://github.com/mootcycle).

Special thanks to the rest of the Twitter web team for their abundant
contributions and feedback.

## License

Copyright 2013 Twitter, Inc and other contributors.

Licensed under the MIT License


text:
import serverutils.config as config
import re
import sys

from pymongo import MongoClient
from os.path import join
import ssl

# Returns the MongoClient that connects either to the local database or
# to the non-local database, depending on the current configuration
def getMongoClient(silent = False, orMongoMode = None, orDbName = None, orHost = None, orUserName = None, orPassword = None):
	mongoMode = config.getProperty("mongo.connection.mode") if orMongoMode is None else orMongoMode
	if not mongoMode in ['ssl','local']:
		raise AttributeError('mongo.connection.mode must be either ssl or local')

	dbName = config.getProperty("mongo.dbname") if orDbName is None else orDbName

	if mongoMode == 'local':
		if not silent:
			print("Connecting to MongoDB @ localhost without password, DB = " + dbName)
		client = MongoClient()
		return client, client[dbName]
	else:
		user = config.getProperty("mongo.user") if orUserName is None else orUserName
		password = config.getProperty("mongo.pass") if orPassword is None else orPassword
		host = config.getProperty("mongo.url") if orHost is None else orHost
		if host[0:10]=='mongodb://':
			host = host[10:]

		# Deal with connection strings that contain a database name at the end
		matcher = re.search('/([a-zA-Z0-9_\\-]+)$' , host)
		if matcher is not None:
			urlDbName = matcher.group(1)
			if urlDbName != dbName:
				print("WARNING: Mismatch of Mongo DB name in mongo.dbname and mongo.url!", file=sys.stderr)
				print("         Using name from mongo.url: " + urlDbName, file=sys.stderr)
				dbName = urlDbName
			host = host[:-(len(urlDbName)+1)]

		certPath = config.getProperty("dbCertPath")
		if not silent:
			print("Connecting via SSL to MongoDB @ " + host + ", DB = " + dbName)
		client = MongoClient(host,
					ssl=True,
					ssl_certfile=join(certPath, 'Mongodb.pem'),
					ssl_cert_reqs=ssl.CERT_REQUIRED,
					ssl_ca_certs=join(certPath, 'CAChain.pem'))
		client.admin.authenticate(user, password)
		return client, client[dbName]


text:
 Resumes a workflow

**Namespace:** [Microsoft.SharePoint.Client](Microsoft.SharePoint.Client.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public static void ResumeWorkflow(this WorkflowInstance instance)
```
### Parameters
#### instance
  Type: Microsoft.SharePoint.Client.WorkflowServices.WorkflowInstance
  the workflow instance to resume

### Return Value
Type: void

## See also
- [WorkflowExtensions](Microsoft.SharePoint.Client.WorkflowExtensions.md)
- [Microsoft.SharePoint.Client](Microsoft.SharePoint.Client.md)


text:
package surfice.docdb.pouchdb.test

import surf.ServiceRef
import surfice.docdb.DB
import surfice.docdb.pouchdb.{PouchDBService, PouchDBHandle}
import surfice.docdb.test.DBServiceBehaviour

import scala.concurrent.ExecutionContext
import scala.scalajs.js

object PouchDBServiceTest extends DBServiceBehaviour with DBProvider {
  override implicit def executionContext: ExecutionContext = scalajs.concurrent.JSExecutionContext.queue

  override def createDBService(): ServiceRef = surf.ServiceRefFactory.Async.serviceOf(new PouchDBService)

  override def createDoc(id: String, props: (String, Any)*): Any = {
    val o = js.Dictionary[js.Any]("_id"->id)
    props foreach {
      case (k,v:String) =>  o(k) = v
    }
    o
  }

  override def checkDoc(doc: Any, id: String, props: (String, Any)*): Boolean = {
    val d = doc.asInstanceOf[js.Dynamic]
    d._id.asInstanceOf[String] == id
  }

  override def createDB(): DB = new PouchDBHandle(newDB())
}


text:
Textarea count

By showing limits on inputs users are less likely to cause an error.

Character count

Use this micro interaction if you have a limiting input size due to a system constraint

        <textarea class="form-control" data-val-length-max="240" type="text" ></textarea>

        100
         characters remaining

        HTML

                <div class="form-group">
                <textarea class="form-control" data-val-length-max="240" type="text" ></textarea>
                <span class="sfa-form-control-after">
                <span class="maxchar-count">100</span>
                <span class="maxchar-text"> characters remaining</span>
                </span>
                </div>

        SASS

.sfa-form-control-after {
    font-size: 16px;
    line-height: 1.25;
    display: block;
    color: $secondary-text-colour;
    padding-top: 2px;
    padding-bottom: 2px;
    @include media(tablet){
      font-size: 19px;
      line-height: 1.31579;
    }
}

        JS

characterCount = function(n) {
  console.log(n);
  var i = $(n)
    , r = i.attr("data-val-length-max")
    , e = i.val()
    , h = (e.match(/\n/g) || []).length
    , o = e.length + h
    , u = Math.abs(r - o)
    , f = i.closest(".form-group").find(".maxchar-count")
    , t = i.closest(".form-group").find(".maxchar-text")
    , s = i.closest(".form-group").find(".aria-limit");
  if (r)
      f.text(u);
  else {
      t.hide();
      return
  }
  o > r ? (f.parent().addClass("has-error"),
  t.text(" characters over the limit"),
  s.text("Character limit has been reached, you must type fewer than " + r + " characters"),
  u == 1 ? t.text(" character over the limit") : t.text(" characters over the limit")) : (f.parent().removeClass("has-error"),
  t.text(" characters remaining"),
  s.text(""),
  u == 1 ? t.text(" character remaining") : t.text(" characters remaining"))
}
$("textarea").on("keyup", function() {
    console.log(this);
    characterCount(this);
});
$("textarea").each(function() {
    characterCount(this);
});

Word count

Use this micro interaction if you have a soft limit on the content.

            <textarea class="form-control" type="text" id="wordlimit" data-max-length-in-words="5"></textarea>

                5

        HTML

        <div class="word-count">
            <textarea class="form-control" type="text" id="wordlimit" data-max-length-in-words="5"></textarea>
            <span class="sfa-form-control-after" id="#charlimit">
                <span class="words-left">5</span>
            </span>
        </div>

        JS

var wordLen = $("#wordlimit").data("max-length-in-words");
var len;
    $(".words-left").html(wordLen+ ' words left');
    $('#wordlimit').keydown(function(event) {
        len = $('#wordlimit').val().split(/[\s]+/);
        console.log(len.length + " words are typed out of an available " + wordLen);
        wordsLeft = (wordLen) - len.length;
        if (len.length <= wordLen) {
            $('.words-left').html(wordsLeft+ ' words left');
        } else {
            $('.words-left').html((wordsLeft *= -1 ) + ' words too many');
        }
    });


text:
package au.com.fairfax.pickler

import scala.reflect.ClassTag
import scala.reflect.macros.blackbox.Context

package object macros {
  def hasNoAccessor(c: Context)(tpe: c.universe.Type): Boolean =
    getAccessors(c)(tpe).isEmpty

  def getAccessors(c: Context)(tpe: c.universe.Type): List[c.universe.MethodSymbol] = {
    import c.universe._
    tpe.decls.collect {
      case acc: MethodSymbol if tpe.typeSymbol.asClass.isCaseClass && acc.isCaseAccessor || !tpe.typeSymbol.asClass.isCaseClass && acc.isParamAccessor => acc
    }.toList
  }

  def deliasTpeName[T: c.universe.TypeTag](c: Context): String =
    c.universe.typeOf[T].dealias.toString

  def numDealisTpeNms(c: Context) =
    List(deliasTpeName[Double](c), deliasTpeName[Float](c), deliasTpeName[Short](c), deliasTpeName[Int](c), deliasTpeName[Long](c))

  def noAccessor(c: Context)(tpe: c.universe.Type): Boolean =
    getAccessors(c)(tpe).isEmpty

  def tpeClassNm(c: Context): c.universe.Type => String = _.dealias.typeSymbol.asClass.name.toString

  def collTypes(c: Context) = {
    import c.universe._
    List(typeOf[List[_]], typeOf[Vector[_]], typeOf[Seq[_]]) map tpeClassNm(c)
  }

  def isCaseClass(c: Context)(tpe: c.universe.Type): Boolean =
    tpe.typeSymbol.isClass &&
      tpe.typeSymbol.asClass.isCaseClass &&
        !tpe.typeSymbol.isModuleClass

  private val name2SimpleTypeName: String => (String, String) = s => s -> simpleTypeNm(s)
  /**
   * A primitive type, such as classOf[Float].getName != typeOf[Float].getName.  But the type of a
   * data type, i.e. "Float" is used as the key to its corresponding formatter/parser in the JsonRegistry,
   * therefore strConversion is defined to convert a primitive type class name to the corresponding type name
   * to find out the key in the JsonRegistry.
   * strConversion is
   * Map(java.lang.Boolean -> Boolean, java.lang.Float -> Float, float -> Float, short -> Short, java.lang.Integer -> Int, java.lang.Double -> Double, double -> Double,
   * long -> Long, boolean -> Boolean, java.lang.Long -> Long, int -> Int, java.lang.Short -> Short, java.lang.String -> String)
   * A number of java.lang.XXX -> XXX is needed because, e.g. Sample(a: Any), if a is integer,
   * JsonRegistry.internalFormat will find its runtime to be java.lang.Integer
   */
  private lazy val strConversion: String Map String =
    (
      className[java.lang.Integer] -> className[Int].capitalize ::
      List(className[java.lang.Float], className[java.lang.Short], className[java.lang.Double], className[java.lang.Long], className[java.lang.Boolean], className[String]).map{
        name2SimpleTypeName
      } :::
      List(className[Short], className[Int], className[Long], className[Double], className[Float], className[Boolean]).map {
        s => s -> s.capitalize
      }
    ).toMap

  lazy val strReplacement: String Map String =
    List(className[Map[_,_]]).map {
      s => s -> simpleTypeNm(s)
    } .toMap

  def className[T: ClassTag] = implicitly[ClassTag[T]].runtimeClass.getName

  def toMapKey(s: String): String =
    strReplacement.foldLeft(strConversion.getOrElse(s, s).replace('$', '.')) {
      (origStr, tuple) =>
        val (key, value) = tuple
        origStr.replaceAll(key,value)
    }

  def getSealedTraitChildren(c: Context)(traitTpe: c.universe.Type): Set[c.universe.Type] = {
    import c.universe._
    traitTpe.typeSymbol.asInstanceOf[scala.reflect.internal.Symbols#Symbol].sealedDescendants.filterNot {
      des => des.isSealed || tpeClassNm(c)(traitTpe) == tpeClassNm(c)(des.asInstanceOf[Symbol].asType.toType)
    }.map(_.asInstanceOf[Symbol].asType.toType)
  }

}


text:
module AvaTax
  class Client
    module MultiDocument

      # Adjust a MultiDocument transaction
      #
      # Adjusts the current MultiDocument transaction uniquely identified by this URL.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # When you adjust a transaction, that transaction's status is recorded as `Adjusted`.
      #
      # Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service.
      #
      # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param code [String] The transaction code for this MultiDocument transaction
      # @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
      # @param include [String] Specifies objects to include in this fetch call
      # @param model [Object] The adjust request you wish to execute
      # @return [Object]
      def adjust_multi_document_transaction(code, type, model, options={})        path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/adjust"
        post(path, model, options, "22.11.0")      end

      # Get audit information about a MultiDocument transaction
      #
      # Retrieve audit information about a MultiDocument transaction stored in AvaTax.
      #
      # The audit API retrieves audit information related to a specific MultiDocument transaction. This audit
      # information includes the following:
      #
      # * The `code` of the MultiDocument transaction
      # * The `type` of the MultiDocument transaction
      # * The server timestamp representing the exact server time when the transaction was created
      # * The server duration - how long it took to process this transaction
      # * Whether exact API call details were logged
      # * A reconstructed API call showing what the original create call looked like
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param code [String] The transaction code for this MultiDocument transaction
      # @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
      # @return [Object]
      def audit_multi_document_transaction(code, type)        path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/audit"
        get(path, {}, "22.11.0")      end

      # Commit a MultiDocument transaction
      #
      # Marks a list of transactions by changing its status to `Committed`.
      #
      # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # Any changes made to a committed transaction will generate a transaction history.
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param model [Object] The commit request you wish to execute
      # @return [Object]
      def commit_multi_document_transaction(model)        path = "/api/v2/transactions/multidocument/commit"
        post(path, model, {}, "22.11.0")      end

      # Create a new MultiDocument transaction
      #
      # Records a new MultiDocument transaction in AvaTax.
      #
      # A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
      # involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
      # a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
      # document. This separation of documents allows each seller to file their taxes separately.
      #
      # This API will report an error if you attempt to create a transaction when one already exists with the specified `code`.
      # If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust`
      # value to `true`.
      #
      # To generate a refund for a transaction, use the `RefundTransaction` API.
      #
      # The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
      # a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
      #
      # The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
      # provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
      # information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
      # using the best available address location information.
      #
      # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
      #
      # * Lines
      # * Details (implies lines)
      # * Summary (implies details)
      # * Addresses
      # * SummaryOnly (omit lines and details - reduces API response size)
      # * LinesOnly (omit details - reduces API response size)
      # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
      #
      # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param include [String] Specifies objects to include in the response after transaction is created
      # @param model [Object] the multi document transaction model
      # @return [Object]
      def create_multi_document_transaction(model, options={})        path = "/api/v2/transactions/multidocument"
        post(path, model, options, "22.11.0")      end

      # Retrieve a MultiDocument transaction
      #
      # Get the current MultiDocument transaction identified by this URL.
      #
      # If this transaction was adjusted, the return value of this API will be the current transaction with this code.
      #
      # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
      #
      # * Lines
      # * Details (implies lines)
      # * Summary (implies details)
      # * Addresses
      # * SummaryOnly (omit lines and details - reduces API response size)
      # * LinesOnly (omit details - reduces API response size)
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param code [String] The multidocument code to retrieve
      # @param type [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
      # @param include [String] Specifies objects to include in the response after transaction is created
      # @return [Object]
      def get_multi_document_transaction_by_code_and_type(code, type, options={})        path = "/api/v2/transactions/multidocument/#{code}/type/#{type}"
        get(path, options, "22.11.0")      end

      # Retrieve a MultiDocument transaction by ID
      #
      # Get the unique MultiDocument transaction identified by this URL.
      #
      # A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
      # involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
      # a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
      # document. This separation of documents allows each seller to file their taxes separately.
      #
      # This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
      # by using the `AdjustTransaction` endpoint.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
      #
      # * Lines
      # * Details (implies lines)
      # * Summary (implies details)
      # * Addresses
      # * SummaryOnly (omit lines and details - reduces API response size)
      # * LinesOnly (omit details - reduces API response size)
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param id [Integer] The unique ID number of the MultiDocument transaction to retrieve
      # @param include [String] Specifies objects to include in the response after transaction is created
      # @return [Object]
      def get_multi_document_transaction_by_id(id, options={})        path = "/api/v2/transactions/multidocument/#{id}"
        get(path, options, "22.11.0")      end

      # Retrieve all MultiDocument transactions
      #
      # List all MultiDocument transactions within this account.
      #
      # This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument
      # transactions, please use the pagination features of the API.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
      # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
      #
      # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
      #
      # * Lines
      # * Details (implies lines)
      # * Summary (implies details)
      # * Addresses
      # * SummaryOnly (omit lines and details - reduces API response size)
      # * LinesOnly (omit details - reduces API response size)
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* documents
      # @param include [String] Specifies objects to include in the response after transaction is created
      # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
      # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
      # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
      # @return [FetchResult]
      def list_multi_document_transactions(options={})        path = "/api/v2/transactions/multidocument"
        get(path, options, "22.11.0")      end

      # Create a refund for a MultiDocument transaction
      #
      # Create a refund for a MultiDocument transaction.
      #
      # A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
      # involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
      # a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
      # document. This separation of documents allows each seller to file their taxes separately.
      #
      # The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
      # for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
      # specify individual line items from the original sale for refund.
      #
      # The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
      # was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
      # nexus, or any other setting.
      #
      # This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
      # common refund scenarios:
      #
      # * A full refund of a previous sale
      # * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
      # * Refunding one or more items (lines) from a previous sale
      # * Granting a customer a percentage refund of a previous sale
      #
      # For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
      # create a custom refund transaction.
      #
      # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
      #
      # * Lines
      # * Details (implies lines)
      # * Summary (implies details)
      # * Addresses
      # * SummaryOnly (omit lines and details - reduces API response size)
      # * LinesOnly (omit details - reduces API response size)
      #
      # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param code [String] The code of this MultiDocument transaction
      # @param type [String] The type of this MultiDocument transaction (See DocumentType::* for a list of allowable values)
      # @param include [String] Specifies objects to include in the response after transaction is created
      # @param model [Object] Information about the refund to create
      # @return [Object]
      def refund_multi_document_transaction(code, type, model, options={})        path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/refund"
        post(path, model, options, "22.11.0")      end

      # Verify a MultiDocument transaction
      #
      # Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values.
      #
      # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param model [Object] Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax
      # @return [Object]
      def verify_multi_document_transaction(model)        path = "/api/v2/transactions/multidocument/verify"
        post(path, model, {}, "22.11.0")      end

      # Void a MultiDocument transaction
      #
      # Voids the current transaction uniquely identified by this URL.
      #
      # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
      # sales, purchases, inventory transfer, and returns (also called refunds).
      #
      # When you void a transaction, that transaction's status is recorded as `DocVoided`.
      #
      # Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`,
      # and they are no longer available to be voided.
      #
      # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
      # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
      # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
      # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
      # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
      # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
      # * Replace ' ' with '%20' For example: document Code becomes document%20Code
      #
      # ### Security Policies
      #
      # * This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
      # * This API depends on the following active services:*Required* (all): AvaTaxPro.
      # Swagger Name: AvaTaxClient
      # @param code [String] The transaction code for this MultiDocument transaction
      # @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
      # @param model [Object] The void request you wish to execute
      # @return [Object]
      def void_multi_document_transaction(code, type, model)        path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/void"
        post(path, model, {}, "22.11.0")      end
    end
  end
end


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

<title>io.github.privacystreams.core.transformations.limit</title>
<meta name="date" content="2017-08-18">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

io.github.privacystreams.core.transformations.limit

Classes

Limiters


text:
<!doctype html>
<title>RequireJS Plugin for Handlebars semantic templates</title>
<body>
<script data-main="scripts/main.js" src="scripts/libs/require.js"></script>
</body>


text:
$(function(){
  $(document).on('submit', '[data-block-editor-text]', function(){
    var $block = $(this).parents('div.bk-block');
    var blockId = $block.attr('data-bk-block-id');
    var params = {};
    $($(this).serializeArray()).each(function(i, v) {
      params[v.name] = v.value;
    });
    params['block_id'] = blockId;

    baked.post('plugin/block_text/block_text_api/update', {
      data: params,
      ok: function(r){
        $block.find('div.bk-block-text-content').replaceWith($(r.html).find('div.bk-block-text-content'));
        baked.closeAllEditor();
      }
    });
  });
});


text:
package de.vsis.rabbitmqonandroid;

import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.json.simple.parser.ContainerFactory;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

public class JsonHelper {
private String _input;

	public JsonHelper(String input) {
	_input = input;
	parseJson(_input);

	}

	public static JSONObject encodeMessage(String type, JSONObject data){
		JSONObject obj = new JSONObject();

		obj.put("type", type);
		obj.put("data", data);

		return obj;
	}

	public static JSONObject encodeData(Map<String,String> data){
		JSONObject obj = new JSONObject();
		String key = "";
		String value = "";
		for (Map.Entry<String, String> entry : data.entrySet()){
			key = entry.getKey();
			value = entry.getValue();
			obj.put(key, value);
		}

		return obj;
	}

	public static JSONArray parseJson(String input){

		JSONObject obj = (JSONObject)JSONValue.parse(input);

		JSONObject data = (JSONObject)obj.get("data");

		JSONParser parser = new JSONParser();

		for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
			String key = (String) iter.next();
			System.out.println(key + ": "+data.get(key));
		}

		JSONArray array = new JSONArray();
		array.add(obj);
		array.add(data);

		return array;
	}

}


text:
<?php

/**
 * Helper class to validate fluent configuration
 *
 * @todo Unit tests
 */
class FluentValidateTask extends BuildTask
{
    protected $title = "Fluent validation task";

    protected $description = "Validate and report on any Fluent config errors";

    public function run($request) {
        $result = $this->validateConfig();

        if($result->valid()) {
            Debug::message("Fluent config is valid!", false);
        } else {
            Debug::message(sprintf(
                "Fluent config invalid: %d errors found!",
                count($result->messageList())
            ), false);
            foreach($result->messageList() as $message) {
                Debug::message($message, false);
            }
        }
    }

    /**
     * Get validation result for a given config
     *
     * @param Config $config
     * @return ValidationResult
     */
    public function validateConfig(Config $config = null) {
        $result = new ValidationResult();

        // Use current config if omitted
        if(!$config) {
            $config = Config::inst();
        }

        $this->validateLocales($config, $result);
        $this->validateDomains($config, $result);

        return $result;
    }

    /**
     * Validates top level locale list
     *
     * @param Config $config
     * @param ValidationResult $result
     */
    protected function validateLocales(Config $config, ValidationResult $result) {
        $default = $config->get('Fluent', 'default_locale');
        $locales = $config->get('Fluent', 'locales');
        $i8nDefault = $config->get('i18n', 'default_locale');
        $aliases = $config->get('Fluent', 'aliases');

        if(empty($locales)) {
            $result->error("Fluent.locales config is empty!");
            return;
        }

        // Check default
        if($default && !in_array($default, $locales)) {
            $result->error(sprintf(
                'Fluent.default_locale "%s" isn\'t a valid locale in Fluent.locales',
                $default
            ));
        }

        // Check i18n
        if($i8nDefault && !in_array($i8nDefault, $locales)) {
            $result->error(sprintf(
                'i18n.default_locale "%s" isn\'t a valid locale in Fluent.locales',
                $i8nDefault
            ));
        }

        // Check aliases
        if(!empty($aliases)) {
            $seen = array();
            foreach($aliases as $alias => $aliasAs) {
                // Validate alias is a locale
                if(!in_array($alias, $locales)) {
                    $result->error(sprintf(
                        'Fluent.aliases locale "%s" isn\'t a valid locale in Fluent.locales',
                        $alias
                    ));
                }

                // Check duplicates
                if(isset($seen[$aliasAs])) {
                    $result->error(sprintf(
                        'Fluent.aliases has duplicate locales aliased as "%s"',
                        $aliasAs
                    ));
                }
                $seen[$aliasAs] = $aliasAs;
            }
        }
    }

    /**
     * Validates domains config
     *
     * @param Config $config
     * @param ValidationResult $result
     */
    protected function validateDomains(Config $config, ValidationResult $result)
    {
        $domains = $config->get('Fluent', 'domains');
        $locales = $config->get('Fluent', 'locales');
        if(empty($domains)) {
            // Skip sites without domain config
            return;
        }

        // Validate each locale
        $seen = array();
        foreach($domains as $domain => $domainConfig) {
            if(empty($domainConfig['locales'])) {
                $result->error(sprintf('Domain "%s" has no locales configured', $domain));
                continue;
            }

            // Check default locale
            if(!empty($domainConfig['default_locale'])) {
                $domainDefaultLocale = $domainConfig['default_locale'];

                // Check locale is valid in global list
                if(!in_array($domainDefaultLocale, $locales)) {
                    $result->error(sprintf(
                        'Domain "%s" default_locale "%s" isn\'t a valid locale in Fluent.locales',
                        $domain,
                        $domainDefaultLocale
                    ));
                }

                // Check default_locale matches sub locales
                if(!in_array($domainDefaultLocale, $domainConfig['locales'])) {
                    $result->error(sprintf(
                        'Domain "%s" default_locale "%s" isn\'t a valid locale in Fluent.domains.%s.locales',
                        $domain,
                        $domainDefaultLocale,
                        $domain
                    ));
                }
            }

            // Check each locale
            foreach($domainConfig['locales'] as $domainLocale) {
                // Check duplicates
                if(isset($seen[$domainLocale])) {
                    $result->error(sprintf(
                        'Domain "%s" locale "%s" is already assigned to another domain',
                        $domain,
                        $domainLocale
                    ));
                }
                $seen[$domainLocale] = $domainLocale;

                // Check domain is valid
                if(!in_array($domainLocale, $locales)) {
                    $result->error(sprintf(
                        'Domain "%s" has locale "%s" which isn\'t a valid locale in Fluent.locales',
                        $domain,
                        $domainLocale
                    ));
                }
            }

        }

        // Check that all locales are seen
        $unseenLocales = array_diff($locales, $seen);
        if($unseenLocales) {
            foreach($unseenLocales as $unseenLocale) {
                $result->error(sprintf(
                    'Fluent.locales locale "%s" does not appear in any domain.',
                    $unseenLocale
                ));
            }
        }
    }
}


text:
"use strict";

var rayson = require('..'/*'rayson'*/);

var client = rayson.client.mqtt('mqtt://localhost:9999', '$rpc/:sid/localtime');

// client.format('msgpack'); // default is `json`

client.mqtt.on('error', function (err) {
	console.error(err);
});

client.mqtt.on('connect', function () {
	console.log('connected');
});

client.mqtt.on('reconnect', function () {
	console.log('reconnect');
});

client.mqtt.on('offline', function () {
	console.log('offline');
});

client.sid('server1').request('localtime', [], function (err, error, time) {
	console.log('localtime: ', time);
}).timeout(10);


text:
<?php
namespace Game;

use Illuminate\Support\ServiceProvider;

class GameServiceProvider extends ServiceProvider {

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app['game']    = $this->app->share(function($app) { return new \Game\Game; });
    }
}


text:
CONTIKI_PROJECT = telnet-server

APPS = telnetd

PROJECTDIRS = $(CONTIKI)/platform/mbxxx/apps
PROJECT_SOURCEFILES = shell-sensors.c

all: $(CONTIKI_PROJECT)

CONTIKI = ../../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include


text:
import { put, take, fork } from 'redux-saga/effects';
import { storage } from 'services';
import * as actions from 'store/actions';
import bookSaga from './book/controller';

function* watchSignIn() {
  while (true) {
    const { name, password } = yield take(actions.app.SIGN_IN);
    yield put(actions.services.storage.setEncryptionKey({ name, password })); // todo think about it
    yield put(actions.services.sso.getProfile.invoke({ name, password }));
  }
}

function* watchSignOut() {
  while (true) {
    yield take(actions.app.SIGN_OUT);
    yield put(actions.services.storage.clear());
    yield put(actions.services.history.navigate({ path: '/sign-in' }));
  }
}

function* startup() {
  const profile = storage.getProfile();
  if (profile) {
    yield put(actions.app.setContext({ profile }));
    const keyValues = storage.getDictionary();
    yield put(actions.app.book.init.invoke({ keyValues }));
    const attach = storage.getAttach();
    if (attach) {
      yield put(actions.app.book.setAttach(attach));
    }
  }
}

export default function* app() {
  yield fork(bookSaga);
  yield fork(watchSignIn);
  yield fork(watchSignOut);
  yield fork(startup);
}


text:
title:  Aile
date:  03/10/2020
---

### Konuyla İlgili Metinler
Yaratılış 3:1–15, 2.Korintliler 4:6, Luka 1:26–38, Matta 1:18–24, Efesliler 4:15, 1.Yuhanna 3:18, Yasanın Tekrarı 6.

>
Hatırlama Metni

> "Oğlum, babanın uyarılarına kulak ver, Annenin öğrettiklerinden ayrılma" (Süleyman'ın Özdeyişleri 1:8).

İnsanlar olarak biz (tercihen) her zaman öğreniyoruz. Aslında hayatın kendisi bir okul.

"İsrail'deki imanlı kişiler, en eski çağlardan beri gençlerin eğitimine büyük önem vermişlerdi. Allah, bebeklikten itibaren bile çocuklara, O'nun iyiliğinin ve büyüklüğünün, özellikle O'nun yasasında belirtildiği ve İsrail'in tarihinde açıkça görüldüğü gibi öğretilmesini buyurmuştu. Öğrenmeye açık zihinlere, Kutsal Yazılardan ilahiler, dualar ve dersler yerleştirilmeliydi. Anne ve babalar çocuklarına Allah'ın Yasası'nın, O'nun karakteri olduğunu ve onlar yasanın ilkelerini içtenlikle kabul ederlerken, Allah'ın suretinin, ruh ve akıl üzerinde oluşacağını öğretmeliydiler. Öğretimin büyük bir bölümü sözlü olarak yapılıyordu. Fakat buna rağmen gençler, İbrani yazılarını okumayı öğrendiler ve Eski Antlaşma'nın parşömen kağıt ruloları onların çalışmasına açıldı."—Ellen G. White, Sevgi Öğretmeni, s.58.

İnsanlık tarihinin büyük bölümünde, eğitim genellikle evde gerçekleşti, özellikle de erken yaşlarda. Kutsal Kitap ailedeki eğitim hakkında ne diyor ve aile durumumuz ne olursa olsun ondan kendimiz için hangi ilkeyi öğrenebiliriz?

*10 Ekim Sebt Gününe hazırlık için bu haftanın konusunu çalış.


text:
package com.infinityraider.agricraft.api.v1.genetics;

import com.infinityraider.agricraft.api.v1.crop.IAgriCrop;
import net.minecraft.util.Tuple;

import java.util.Random;

/**
 * The IMutator object controls how alleles of a gene mutate through generations
 * @param <A> the type of the gene / mutator
 */
public interface IMutator<A> {
    /**
     * Combines two parent alleles into a new gene pair, possibly mutating one or both of these alleles to be passed on to offspring
     * @param crop the crop on which the cross breed is occurring
     * @param gene the gene for the alleles
     * @param first one of the alleles for the gene of the first parent
     * @param second one of the alleles for the gene of the second parent
     * @param parents a tuple holding the full genomes of both parents
     * @param random pseudo-random generator to take decisions
     * @return a new gene pair for the offspring
     */
    IAgriGenePair<A> pickOrMutate(IAgriCrop crop, IAgriGene<A> gene, IAllele<A> first, IAllele<A> second, Tuple<IAgriGenome, IAgriGenome> parents, Random random);
}


text:
#ifndef LIBPSEC_ENCODE_H
#define LIBPSEC_ENCODE_H

#include <stdio.h>

#include "config.h"

/* Prototypes */
/********************/
/* Base16 Interface */
/********************/
#ifdef COMPILE_WIN32
DLLIMPORT
#endif
unsigned char *encode_buffer_base16(unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len);
#ifdef COMPILE_WIN32
DLLIMPORT
#endif
size_t encode_size_base16(size_t in_len);
/********************/
/* Base64 Interface */
/********************/
#ifdef COMPILE_WIN32
DLLIMPORT
#endif
unsigned char *encode_buffer_base64(unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len);
#ifdef COMPILE_WIN32
DLLIMPORT
#endif
size_t encode_size_base64(size_t in_len);
/********************/
/* Common Interface */
/********************/
#ifdef COMPILE_WIN32
DLLIMPORT
#endif
void encode_destroy(unsigned char *encode);

#endif


text:
import { Injectable } from '@angular/core';

import { PeriodModel } from './period.model';
import { PeriodRequestBody } from './period.request-body';
import { isPresent } from '../../facade/lang';

@Injectable()
export class PeriodModelToPeriodRequestBodyTransformer {

    transform(period: PeriodModel): PeriodRequestBody {
        const body: PeriodRequestBody = {
            startedAt: Math.round(period.startedAt.getTime() / 1000)
        };

        if (isPresent(period.finishedAt)) {
            body.finishedAt = Math.round(period.finishedAt.getTime() / 1000);
        }

        return body;
    }

}


text:
package org.adligo.tests4j.models.shared.association;

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

import org.adligo.tests4j.shared.asserts.reference.ClassAlias;
import org.adligo.tests4j.shared.xml.I_XML_Builder;

public class ClassParentsLocal implements I_ClassParentsLocal {
	private Class<?> initial;
	private List<I_ClassParentsLocal> parents;
	private List<String> parentNames;
	private ClassAlias alias;

	public ClassParentsLocal(Class<?> pInital) {
		initial = pInital;
		alias = new ClassAlias(initial);
		setEmptyLists();
	}

	private void setEmptyLists() {
		parents = Collections.emptyList();
		parentNames = Collections.emptyList();
	}

	public ClassParentsLocal(I_ClassParentsLocal other) {
		initial = other.getTarget();
		alias = new ClassAlias(initial);
		List<I_ClassParentsLocal> ops = other.getParentsLocal();
		if (ops != null) {
			if (ops.size() >= 1) {
				parents = new ArrayList<I_ClassParentsLocal>();
				parentNames = new ArrayList<String>();
				for (I_ClassParentsLocal cp: ops) {
					parents.add(new ClassParentsLocal(cp));
					parentNames.add(cp.getName());
				}
				parents = Collections.unmodifiableList(parents);
				parentNames = Collections.unmodifiableList(parentNames);
			} else {
				setEmptyLists();
			}
		} else {
			setEmptyLists();
		}
	}

	@Override
	public String getName() {
		return initial.getName();
	}

	@Override
	public Class<?> getTarget() {
		return initial;
	}

	@Override
	public List<I_ClassParents> getParents() {
		if (parents.size() == 0) {
			return Collections.emptyList();
		}
		return  Collections.unmodifiableList(new ArrayList<I_ClassParents>(parents));
	}

	@Override
	public List<String> getParentNames() {
		return parentNames;
	}

	@Override
	public int compareTo(Object o) {
		return alias.compareTo(o);
	}

	@Override
	public String toString() {
		return ClassParentsLocalMutant.toString(this) + "]";
	}

	@Override
	public List<I_ClassParentsLocal> getParentsLocal() {
		return parents;
	}

	@Override
	public int hashCode() {
		return alias.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		return alias.equals(obj);
	}
}


text:
class GroupProjectsFinder < ProjectsFinder
  attr_reader :group, :options

  def initialize(group:, params: {}, options: {}, current_user: nil, project_ids_relation: nil)
    super(params: params, current_user: current_user, project_ids_relation: project_ids_relation)
    @group   = group
    @options = options
  end

  private

  def init_collection
    projects = if current_user
                 collection_with_user
               else
                 collection_without_user
               end

    union(projects)
  end

  def collection_with_user
    if group.users.include?(current_user)
      if only_shared?
        [shared_projects]
      elsif only_owned?
        [owned_projects]
      else
        [shared_projects, owned_projects]
      end
    else
      if only_shared?
        [shared_projects.public_or_visible_to_user(current_user)]
      elsif only_owned?
        [owned_projects.public_or_visible_to_user(current_user)]
      else
        [
          owned_projects.public_or_visible_to_user(current_user),
          shared_projects.public_or_visible_to_user(current_user)
        ]
      end
    end
  end

  def collection_without_user
    if only_shared?
      [shared_projects.public_only]
    elsif only_owned?
      [owned_projects.public_only]
    else
      [shared_projects.public_only, owned_projects.public_only]
    end
  end

  def union(items)
    if items.one?
      items.first
    else
      find_union(items, Project)
    end
  end

  def only_owned?
    options.fetch(:only_owned, false)
  end

  def only_shared?
    options.fetch(:only_shared, false)
  end

  def owned_projects
    group.projects
  end

  def shared_projects
    group.shared_projects
  end
end


text:
file(REMOVE_RECURSE
  "CMakeFiles/_easy_handeye_generate_messages_check_deps_RemoveSample"
)

# Per-language clean rules from dependency scanning.
foreach(lang )
  include(CMakeFiles/_easy_handeye_generate_messages_check_deps_RemoveSample.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
SET (xxhash_wrapper_dir_base "xxHash-wrapper")
SET (xxhash_wrapper_dir "${CMAKE_CURRENT_SOURCE_DIR}/xxHash-wrapper")

IF (NOT EXISTS "${xxhash_wrapper_dir}")
    EXECUTE_PROCESS(COMMAND "git" "clone" "https://github.com/shlomif/xxHash-wrapper.git" "${xxhash_wrapper_dir_base}"
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
    )
ENDIF ()

INCLUDE("${xxhash_wrapper_dir}/xxhash_wrapper.cmake")