text:
import {async, TestBed} from '@angular/core/testing';
import {Component, QueryList, ViewChildren} from '@angular/core';
import {By} from '@angular/platform-browser';
import {MatListItem, MatListModule} from './index';

describe('MatList', () => {

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [MatListModule],
      declarations: [
        ListWithOneAnchorItem,
        ListWithOneItem,
        ListWithTwoLineItem,
        ListWithThreeLineItem,
        ListWithAvatar,
        ListWithItemWithCssClass,
        ListWithDynamicNumberOfLines,
        ListWithMultipleItems,
        ListWithManyLines,
        NavListWithOneAnchorItem,
      ],
    });

    TestBed.compileComponents();
  }));

  it('should add and remove focus class on focus/blur', () => {
    let fixture = TestBed.createComponent(ListWithOneAnchorItem);
    fixture.detectChanges();
    let listItem = fixture.debugElement.query(By.directive(MatListItem));
    let listItemEl = fixture.debugElement.query(By.css('.mat-list-item'));

    expect(listItemEl.nativeElement.classList).not.toContain('mat-list-item-focus');

    listItem.componentInstance._handleFocus();
    fixture.detectChanges();
    expect(listItemEl.nativeElement.classList).toContain('mat-list-item-focus');

    listItem.componentInstance._handleBlur();
    fixture.detectChanges();
    expect(listItemEl.nativeElement.classList).not.toContain('mat-list-item-focus');
  });

  it('should not apply any additional class to a list without lines', () => {
    let fixture = TestBed.createComponent(ListWithOneItem);
    let listItem = fixture.debugElement.query(By.css('mat-list-item'));
    fixture.detectChanges();
    expect(listItem.nativeElement.className).toBe('mat-list-item');
  });

  it('should apply mat-2-line class to lists with two lines', () => {
    let fixture = TestBed.createComponent(ListWithTwoLineItem);
    fixture.detectChanges();

    let listItems = fixture.debugElement.children[0].queryAll(By.css('mat-list-item'));
    expect(listItems[0].nativeElement.className).toContain('mat-2-line');
    expect(listItems[1].nativeElement.className).toContain('mat-2-line');
  });

  it('should apply mat-3-line class to lists with three lines', () => {
    let fixture = TestBed.createComponent(ListWithThreeLineItem);
    fixture.detectChanges();

    let listItems = fixture.debugElement.children[0].queryAll(By.css('mat-list-item'));
    expect(listItems[0].nativeElement.className).toContain('mat-3-line');
    expect(listItems[1].nativeElement.className).toContain('mat-3-line');
  });

  it('should apply mat-multi-line class to lists with more than 3 lines', () => {
    let fixture = TestBed.createComponent(ListWithManyLines);
    fixture.detectChanges();

    let listItems = fixture.debugElement.children[0].queryAll(By.css('mat-list-item'));
    expect(listItems[0].nativeElement.className).toContain('mat-multi-line');
    expect(listItems[1].nativeElement.className).toContain('mat-multi-line');
  });

  it('should apply a class to list items with avatars', () => {
    let fixture = TestBed.createComponent(ListWithAvatar);
    fixture.detectChanges();

    let listItems = fixture.debugElement.children[0].queryAll(By.css('mat-list-item'));
    expect(listItems[0].nativeElement.className).toContain('mat-list-item-with-avatar');
    expect(listItems[1].nativeElement.className).not.toContain('mat-list-item-with-avatar');
  });

  it('should not clear custom classes provided by user', () => {
    let fixture = TestBed.createComponent(ListWithItemWithCssClass);
    fixture.detectChanges();

    let listItems = fixture.debugElement.children[0].queryAll(By.css('mat-list-item'));
    expect(listItems[0].nativeElement.classList.contains('test-class')).toBe(true);
  });

  it('should update classes if number of lines change', () => {
    let fixture = TestBed.createComponent(ListWithDynamicNumberOfLines);
    fixture.debugElement.componentInstance.showThirdLine = false;
    fixture.detectChanges();

    let listItem = fixture.debugElement.children[0].query(By.css('mat-list-item'));
    expect(listItem.nativeElement.classList.length).toBe(2);
    expect(listItem.nativeElement.classList).toContain('mat-2-line');
    expect(listItem.nativeElement.classList).toContain('mat-list-item');

    fixture.debugElement.componentInstance.showThirdLine = true;
    fixture.detectChanges();
    expect(listItem.nativeElement.className).toContain('mat-3-line');
  });

  it('should add aria roles properly', () => {
    let fixture = TestBed.createComponent(ListWithMultipleItems);
    fixture.detectChanges();

    let list = fixture.debugElement.children[0];
    let listItem = fixture.debugElement.children[0].query(By.css('mat-list-item'));
    expect(list.nativeElement.getAttribute('role')).toBeNull('Expect mat-list no role');
    expect(listItem.nativeElement.getAttribute('role')).toBeNull('Expect mat-list-item no role');
  });

  it('should not show ripples for non-nav lists', () => {
    let fixture = TestBed.createComponent(ListWithOneAnchorItem);
    fixture.detectChanges();

    const items: QueryList<MatListItem> = fixture.debugElement.componentInstance.listItems;
    expect(items.length).toBeGreaterThan(0);
    items.forEach(item => expect(item._isRippleDisabled()).toBe(true));
  });

  it('should allow disabling ripples for specific nav-list items', () => {
    let fixture = TestBed.createComponent(NavListWithOneAnchorItem);
    fixture.detectChanges();

    const items = fixture.componentInstance.listItems;
    expect(items.length).toBeGreaterThan(0);

    // Ripples should be enabled by default, and can be disabled with a binding.
    items.forEach(item => expect(item._isRippleDisabled()).toBe(false));

    fixture.componentInstance.disableItemRipple = true;
    fixture.detectChanges();

    items.forEach(item => expect(item._isRippleDisabled()).toBe(true));
  });

  it('should allow disabling ripples for the whole nav-list', () => {
    let fixture = TestBed.createComponent(NavListWithOneAnchorItem);
    fixture.detectChanges();

    const items = fixture.componentInstance.listItems;
    expect(items.length).toBeGreaterThan(0);

    // Ripples should be enabled by default, and can be disabled with a binding.
    items.forEach(item => expect(item._isRippleDisabled()).toBe(false));

    fixture.componentInstance.disableListRipple = true;
    fixture.detectChanges();

    items.forEach(item => expect(item._isRippleDisabled()).toBe(true));
  });
});

class BaseTestList {
  items: any[] = [
    {'name': 'Paprika', 'description': 'A seasoning'},
    {'name': 'Pepper', 'description': 'Another seasoning'}
  ];

  showThirdLine: boolean = false;
}

@Component({template: `
  <mat-list>

      Paprika

  </mat-list>`})
class ListWithOneAnchorItem extends BaseTestList {
  // This needs to be declared directly on the class; if declared on the BaseTestList superclass,
  // it doesn't get populated.
  @ViewChildren(MatListItem) listItems: QueryList<MatListItem>;
}

@Component({template: `
  <mat-nav-list [disableRipple]="disableListRipple">

      Paprika

  </mat-nav-list>`})
class NavListWithOneAnchorItem extends BaseTestList {
  @ViewChildren(MatListItem) listItems: QueryList<MatListItem>;
  disableItemRipple: boolean = false;
  disableListRipple: boolean = false;
}

@Component({template: `
  <mat-list>
    <mat-list-item>
      Paprika
    </mat-list-item>
  </mat-list>`})
class ListWithOneItem extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item *ngFor="let item of items">

{{item.name}}

{{item.description}}

    </mat-list-item>
  </mat-list>`})
class ListWithTwoLineItem extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item *ngFor="let item of items">

{{item.name}}

{{item.description}}

Some other text

    </mat-list-item>
  </mat-list>`})
class ListWithThreeLineItem extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item *ngFor="let item of items">

Line 1

Line 2

Line 3

Line 4

    </mat-list-item>
  </mat-list>`})
class ListWithManyLines extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item>

      Paprika
    </mat-list-item>
    <mat-list-item>
      Pepper
    </mat-list-item>
  </mat-list>`})
class ListWithAvatar extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item class="test-class" *ngFor="let item of items">

{{item.name}}

{{item.description}}

    </mat-list-item>
  </mat-list>`})
class ListWithItemWithCssClass extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item *ngFor="let item of items">

{{item.name}}

{{item.description}}

Some other text

    </mat-list-item>
  </mat-list>`})
class ListWithDynamicNumberOfLines extends BaseTestList { }

@Component({template: `
  <mat-list>
    <mat-list-item *ngFor="let item of items">
      {{item.name}}
    </mat-list-item>
  </mat-list>`})
class ListWithMultipleItems extends BaseTestList { }


text:
package integration

import (
	context "context"
	"errors"
	"fmt"
	"testing"

	"github.com/google/kf/v2/pkg/kf/testutil"
)

func TestAppCache(t *testing.T) {
	t.Parallel()

	ac := newAppCache()
	t.Cleanup(func() {
		testutil.AssertErrorsEqual(t, nil, ac.Close())
	})

	ctx, cancel := context.WithCancel(context.Background())

	// Initial storage.
	v, ok, err := ac.Load(ctx, "a")
	testutil.AssertFalse(t, "loaded", ok)
	testutil.AssertErrorsEqual(t, nil, ac.Store(ctx, "a", "1"))
	testutil.AssertErrorsEqual(t, nil, err)

	// Store it again and load.
	testutil.AssertErrorsEqual(t, nil, ac.Store(ctx, "a", "2"))
	v, ok, err = ac.Load(ctx, "a")
	testutil.AssertTrue(t, "loaded", ok)
	testutil.AssertErrorsEqual(t, nil, err)
	testutil.AssertEqual(t, "value", v, "1")

	// Store new.
	testutil.AssertErrorsEqual(t, nil, ac.Store(ctx, "b", "3"))
	v, ok, err = ac.Load(ctx, "b")
	testutil.AssertTrue(t, "loaded", ok)
	testutil.AssertErrorsEqual(t, nil, err)
	testutil.AssertEqual(t, "value", v, "3")

	// Cancelled context returns error.
	cancel()
	_, _, err = ac.Load(ctx, "b")
	testutil.AssertErrorsEqual(t, errors.New("context canceled"), err)
}

func TestAppCache_race(t *testing.T) {
	t.Parallel()

	ac := newAppCache()
	t.Cleanup(func() {
		testutil.AssertErrorsEqual(t, nil, ac.Close())
	})

	go func() {
		for i := 0; i < 100; i++ {
			ac.Load(context.Background(), fmt.Sprintf("%d", i))
		}
	}()

	for i := 0; i < 100; i++ {
		ac.Store(context.Background(), fmt.Sprintf("%d", i), "1")
	}
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Created on Mar 15, 2005 1:22:52 PM
 */
package net.jforum.cache;

import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
import org.jboss.cache.TreeCacheListener;
import org.jgroups.View;

/**
 * @author Rafael Steil
 * @version $Id: JBossCacheListener.java,v 1.4 2007/08/01 22:30:06 rafaelsteil Exp $
 */
public class JBossCacheListener implements TreeCacheListener
{
	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeCreated(org.jboss.cache.Fqn)
	 */
	public void nodeCreated(Fqn fqn) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeRemoved(org.jboss.cache.Fqn)
	 */
	public void nodeRemoved(Fqn fqn) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeLoaded(org.jboss.cache.Fqn)
	 */
	public void nodeLoaded(Fqn fqn) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeEvicted(org.jboss.cache.Fqn)
	 */
	public void nodeEvicted(Fqn fqn) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeModified(org.jboss.cache.Fqn)
	 */
	public void nodeModified(Fqn fqn)
	{
		if (CacheEngine.NOTIFICATION.startsWith((String)fqn.get(0))) {
		}
	}

	/**
	 * @see org.jboss.cache.TreeCacheListener#nodeVisited(org.jboss.cache.Fqn)
	 */
	public void nodeVisited(Fqn fqn) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#cacheStarted(org.jboss.cache.TreeCache)
	 */
	public void cacheStarted(TreeCache cache) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#cacheStopped(org.jboss.cache.TreeCache)
	 */
	public void cacheStopped(TreeCache cache) {}

	/**
	 * @see org.jboss.cache.TreeCacheListener#viewChange(org.jgroups.View)
	 */
	public void viewChange(View view) {}
}


text:
<?php

// MENUS Wp extend ///////////////////////////////////////////// WP EXTEND

/*//**//**//**//*//**//**//**//*//**//**//**//*//**//**//**/

////// POSITIONS /////////////////////////////////////////////
////// Ajout de deux positions au thème
register_nav_menu( 'primary', __( 'Menu principal (primary)', 'bodyrock' ) );
register_nav_menu( 'secondary', __( 'Menu secondaire (secondary)', 'bodyrock' ) );
register_nav_menu( 'sidebar', __( 'Menu latéral (sidebar)', 'bodyrock' ) );
register_nav_menu( 'footer', __( 'Menu de bas de page (footer)', 'bodyrock' ) );

/*

register_nav_menu( 'identifiant_du_menu', 'Titre du menu' );
:: Ajoute une position pour les menus personnalisés via Wordpress.
:: Utilisation dans une template :
wp_nav_menu( array(
	'menu'       => 'identifiant_du_menu',
	'theme_location' => 'identifiant_du_menu',
	'depth'      => 1,
	'container'  => false,
	'menu_class' => 'nav navbar-nav',
	'fallback_cb' => 'br_menu_default',
	'walker' => new walker_de_votre_choix())
)
:: wp_nav_menu() affiche le menu enregistré à la position 'identifiant_du_menu' via Wordpress.
:: Si aucun menu n'est enregistré à cette position, la fonction br_menu_default() est lancée.
:: Le rendu des éléments peut être personnalisé via une fonction 'walker'.

*/

////// WALKERS /////////////////////////////////////////////
////// Chargement des différents walkers personnalisés
/*

Un 'walker' parcoure les éléments du menu et permet de personnaliser la sortie Html.
Les différents walkers ci-dessous servent à reproduire les composants Bootstrap.

*/
require_once('walkers/navbar_walker.php');
require_once('walkers/listgroup_walker.php');
require_once('walkers/navpills_walker.php');
require_once('walkers/tabs_walker.php');

////// WP_NAV_MENU /////////////////////////////////////////////
////// Fonction fallback_cb pour un menu si il est vide.
// Fonction appellée en paramètre de wp_nav_menu(array('fallback_cb'=>'default_menu'))
// Ci-desso
function default_menu($args) {
      echo '

Home

      ';
      return true;
}


text:
require_relative '../automated_init'

context "Schema" do
  context "Hash Code" do
    schema_class = Class.new do
      include Schema

      attribute :some_attribute
    end

    attribute_value = "some-value"

    context "Same Class" do
      context "Same Attribute Values" do
        schema = schema_class.new
        schema.some_attribute = attribute_value

        other_schema = schema_class.new
        other_schema.some_attribute = attribute_value

        test "Equivalent" do
          assert(schema.hash == other_schema.hash)
        end

        test "Schemas instances are equal when hash codes are equal" do
          assert(schema.eql?(other_schema))
        end
      end

      context "Different Attribute Values" do
        schema = schema_class.new
        schema.some_attribute = attribute_value

        other_schema = schema_class.new
        other_schema.some_attribute = SecureRandom.hex

        test "Not Equivalent" do
          refute(schema.hash == other_schema.hash)
        end

        test "Schemas instances are not equal when hash codes are not equal" do
          refute(schema.eql?(other_schema))
        end
      end
    end

    context "Different Class" do
      other_schema_class = Class.new do
        include Schema

        attribute :some_attribute, String
      end

      context "Same Attribute Values" do
        schema = schema_class.new
        schema.some_attribute = attribute_value

        other_schema = other_schema_class.new
        other_schema.some_attribute = attribute_value

        test "Not Equivalent" do
          refute(schema.hash == other_schema.hash)
        end

        test "Schemas instances are not equal when hash codes are not equal" do
          refute(schema.eql?(other_schema))
        end
      end

      context "Different Attribute Values" do
        schema = schema_class.new
        schema.some_attribute = attribute_value

        other_schema = other_schema_class.new
        other_schema.some_attribute = SecureRandom.hex

        test "Not Equivalent" do
          refute(schema.hash == other_schema.hash)
        end

        test "Schemas instances are not equal when hash codes are not equal" do
          refute(schema.eql?(other_schema))
        end
      end
    end
  end
end


text:
"""
This module cleans up conda CRAN skeletons to make it compliant with
conda-forge requirements.
"""

import os
import re
from itertools import zip_longest
import argparse
import logging

from conda_build.api import skeletonize

from .utils import run, setup_logger

logger = logging.getLogger(__name__)

# Some dependencies are listed in CRAN that are actually in Bioconductor. Use
# this dict to map these to bioconductor package names.
INVALID_NAME_MAP = {
    'r-edger': 'bioconductor-edger',
}

# Raw strings needed to support the awkward backslashes needed when adding the
# command to yaml
gpl2_short = r"  license_family: GPL2"
gpl2_long = r"""
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\\R\\share\\licenses\\GPL-2'  # [win]
""".strip('\n')

gpl3_short = r"  license_family: GPL3"
gpl3_long = r"""
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\\R\\share\\licenses\\GPL-3'  # [win]
""".strip('\n')

win32_string = 'number: 0\n  skip: true  # [win32]'

def write_recipe(package, recipe_dir='.', recursive=False, force=False,
                 no_windows=False, **kwargs):
        """
        Call out to to ``conda skeleton cran``.

        Kwargs are accepted for uniformity with
        `bioconductor_skeleton.write_recipe`; the only one handled here is
        ``recursive``.

        Parameters
        ----------

        package : str
            Package name. Can be case-sensitive CRAN name, or sanitized
            "r-pkgname" conda package name.

        recipe_dir : str
            Recipe will be created as a subdirectory in ``recipe_dir``

        recursive : bool
            Add the ``--recursive`` argument to ``conda skeleton cran`` to
            recursively build CRAN recipes.

        force : bool
            If True, then remove the directory ``<recipe_dir>/<pkgname>``, where
            ``<pkgname>`` the sanitized conda version of the package name,
            regardless of which format was provided as ``package``.

        no_windows : bool
            If True, then after creating the skeleton the files are then
            cleaned of any Windows-related lines and the bld.bat file is
            removed from the recipe.
        """
        logger.debug('Building skeleton for %s', package)
        conda_version = package.startswith('r-')
        if not conda_version:
            outdir = os.path.join(
                recipe_dir, 'r-' + package.lower())
        else:
            outdir = os.path.join(
                recipe_dir, package)
        if os.path.exists(outdir):
            if force:
                logger.warning('Removing %s', outdir)
                run(['rm', '-r', outdir], mask=False)
            else:
                logger.warning('%s exists, skipping', outdir)
                return

        try:
            skeletonize(
                package, repo='cran', output_dir=recipe_dir, version=None, recursive=recursive)
            clean_skeleton_files(
                package=os.path.join(recipe_dir, 'r-' + package.lower()),
                no_windows=no_windows)
        except NotImplementedError as e:
            logger.error('%s had dependencies that specified versions: skipping.', package)

def clean_skeleton_files(package, no_windows=True):
    """
    Cleans output files created by ``conda skeleton cran`` to make them
    conda-forge compatible.

    Parameters
    ----------
    package : str
        Package name. Can be case-sensitive CRAN name, or sanitized
        "r-pkgname" conda package name.

    no_windows : bool
        If True, no bld.bat will be created and no ``[win]`` preprocess selectors
        will be added to the yaml
    """
    clean_yaml_file(package, no_windows)
    clean_build_file(package, no_windows)
    clean_bld_file(package, no_windows)

def clean_yaml_file(package, no_windows):
    """
    Cleans the YAML file output by ``conda skeleton cran`` to make it conda-forge
    compatible.

    Parameters
    ----------
    package : str
        Must be sanitized "r-pkgname" package name.

    no_windows : bool
        If True, then adds a "build: skip: True # [win32]" line to skip Windows
        builds.
    """
    path = os.path.join(package, 'meta.yaml')
    with open(path, 'r') as yaml:
        lines = list(yaml.readlines())

        # Remove lines consisting only of comments
        lines = filter_lines_regex(lines, r'^\s*#.*$', '')
        lines = remove_empty_lines(lines)

        # Remove file license
        lines = filter_lines_regex(lines, r' [+|] file LICEN[SC]E', '')

        # Remove file name lines, which aren't needed as of conda-build3
        lines = filter_lines_regex(lines, r'^\s+fn:\s*.*$', '')

        # Replace GPL2 or GPL3 string created by conda skeleton cran with long
        # format
        lines = filter_lines_regex(lines, gpl2_short, gpl2_long)
        lines = filter_lines_regex(lines, gpl3_short, gpl3_long)

        if no_windows:
            # Inserts `skip: true # [win32]` after `number: 0` to skip windows
            # builds
            lines = filter_lines_regex(lines, r'number: 0', win32_string)

        # Add contents of maintainers file to the end of the recipe
        add_maintainers(lines)

    with open(path, 'w') as yaml:
        out = "".join(lines)
        out = out.replace('{indent}', '\n    - ')

        # Edit INVALID_NAME_MAP if additional fixes needed
        for wrong, correct in INVALID_NAME_MAP.items():
            out = out.replace(wrong, correct)
        yaml.write(out)

def clean_build_file(package, no_windows=False):
    """
    Cleans build.sh file created by ``conda skeleton cran`` to be compatible with
    conda-forge.

    Parameters
    ----------
    package : str
        Must be sanitized "r-pkgname" package name.

    no_windows : bool
        Included for consistency with other ``clean_*`` functions; does not have
        any effect for this function.
    """

    path = os.path.join(package, 'build.sh')
    with open(path, 'r') as build:
        lines = list(build.readlines())

        # Remove lines with mv commands
        lines = filter_lines_regex(lines, r'^mv\s.*$', '')

        # Remove lines with grep commands
        lines = filter_lines_regex(lines, r'^grep\s.*$', '')

        # Removes the lines consisting of only comments
        lines = filter_lines_regex(lines, r'^\s*#.*$', '')

        lines = remove_empty_lines(lines)

    with open(path, 'w') as build:
        build.write("".join(lines))

def clean_bld_file(package, no_windows):
    """
    Cleans bld.bat file created by ``conda skeleton cran`` to be compatible with
    conda-forge.

    Parameters
    ----------
    package : str
        Must be sanitized "r-pkgname" package name.

    no_windows : bool
        If True, then the bld.bat file will be removed.
    """
    path = os.path.join(package, 'bld.bat')
    if not os.path.exists(path):
        return
    if no_windows:
        os.unlink(path)
        return
    with open(path, 'r') as bld:
        lines = list(bld.readlines())

        # Removes the lines that start with @
        lines = filter_lines_regex(lines, r'^@.*$', '')
        lines = remove_empty_lines(lines)

    with open(path, 'w') as bld:
        bld.write("".join(lines))

def filter_lines_regex(lines, regex, substitute):
    """
    Substitutes **substitute** for every match to **regex** in each line of
    **lines**.

    Parameters
    ----------

    lines : iterable of strings

    regex, substitute : str
    """
    return [re.sub(regex, substitute, line) for line in lines]

def remove_empty_lines(lines):
    """
    Removes consecutive empty lines in **lines**.

    Parameters
    ----------

    lines: iterable of strings
    """
    cleaned_lines = []
    for line, next_line in zip_longest(lines, lines[1:]):
        if (
            (line.isspace() and next_line is None) or
            (line.isspace() and next_line.isspace())
        ):
            pass
        else:
            cleaned_lines.append(line)

    if cleaned_lines[0].isspace():
        cleaned_lines = cleaned_lines[1:]
    return cleaned_lines

def add_maintainers(lines):
    """
    Append the contents of "maintainers.yaml" to the end of a YAML file.
    """
    HERE = os.path.abspath(os.path.dirname(__file__))
    maintainers_yaml = os.path.join(HERE, 'maintainers.yaml')
    with open(maintainers_yaml, 'r') as yaml:
        extra_lines = list(yaml.readlines())
        lines.extend(extra_lines)

def main():
    """ Adding support for arguments here """
    setup_logger()
    parser = argparse.ArgumentParser()
    parser.add_argument('package', help='name of the cran package')
    parser.add_argument('output_dir', help='output directory for the recipe')
    parser.add_argument('--no-win', action="store_true",
                        help='runs the skeleton and removes windows specific information')
    parser.add_argument('--force', action='store_true',
                        help='If a directory exists for any recipe, overwrite it')

    args = parser.parse_args()
    write_recipe(args.package, args.output_dir, no_windows=args.no_win,
                 force=args.force)

if __name__ == '__main__':
    main()


text:
/*
 * * Author: Priyanka & Ravi
 */

package com.iit.globals;

import java.io.IOException;

import java.io.InputStream;
import java.util.Properties;

public class ReadPropertyFile {
	/**
	 * Method to get the values from property file by passing the property value..
	 * @param PropValue
	 * @return String.
	 * * Author: Sravan Kumar
	 */
	public String getCaption(String PropValue){
		try{
			InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("com/iit/globals/Globals.properties");
    		Properties properties = new Properties();

    		properties.load(inputStream);
    		PropValue = properties.getProperty(PropValue);

		}catch(IOException e){
			System.out.println("Error on getting Properties Value :: "+e);
		}
		return PropValue;
	}

}


text:
import {Given, When, Then} from 'cucumber';
import {TestAutomationInfrastructure} from "../../../../../../testClasses/TestAutomationInfrastructure";
import {IDataEntity} from "../../../../../../../../src/infrastructure/logic/entities";

Given(/^I work with the property field parameter: ((?:.+=.*, ?)*(?:.+=.*))$/i, async function(matchFields) {
    const infra = this.facades.infra as TestAutomationInfrastructure;

    const entity: IDataEntity = {
        type: infra.logic.entities.getEntityType('propertyFieldsParameter'),
        entity: matchFields,
        history: [],
        getterInfo: {fromEntity: undefined, matchFields: undefined}
    };

    infra.data.storeScenarioEntity(entity);
});

Given(/^I work with the entity parameter: ((?:this|the latest|the last)? *.+? *(?:#\d+)?)$/i, async function(entityData) {
    const infra = this.facades.infra as TestAutomationInfrastructure;

    const entity: IDataEntity = {
        type: infra.logic.entities.getEntityType('entityParameter'),
        entity: entityData.entity,
        history: [],
        getterInfo: {fromEntity: undefined, matchFields: undefined}
    };

    infra.data.storeScenarioEntity(entity);
});


text:
package me.doubledutch.lazyjson;

/**
 * Exception used to indicate a parse or access error for LazyObject and LazyArray
 */
public final class LazyException extends RuntimeException{
	private int position=-1;
	private String message;

	public LazyException(String str){
		super(str);
		this.message=str;
	}

	public LazyException(String str,int position){
		super(str);
		this.position=position;
		this.message=str;
	}

	public LazyException(String str,LazyNode node){
		super(str);
		this.position=node.startIndex;
		this.message=str;
	}

	public String toString(){
		if(position>-1){
			return "@"+position+":"+message;
		}
		return message;
	}
}


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.projectRoots;

import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * The way to modify the {@link Sdk} roots, home path etc.

 * First you call {@link Sdk#getSdkModificator()}

 * Then you modify things via SdkModificator setters, e.g. {@link #setHomePath(String)}

 * Last, you must call {@link #commitChanges()}
 */
public interface SdkModificator {
  String getName();

  void setName(String name);

  String getHomePath();

  void setHomePath(String path);

  @Nullable
  String getVersionString();

  void setVersionString(String versionString);

  SdkAdditionalData getSdkAdditionalData();

  void setSdkAdditionalData(SdkAdditionalData data);

  @NotNull
  VirtualFile[] getRoots(@NotNull OrderRootType rootType);

  @NotNull
  default String[] getUrls(@NotNull OrderRootType rootType) {
    return ContainerUtil.map(getRoots(rootType), file -> file.getUrl(), ArrayUtil.EMPTY_STRING_ARRAY);
  }

  void addRoot(@NotNull VirtualFile root, @NotNull OrderRootType rootType);

  default void addRoot(@NotNull String url, @NotNull OrderRootType rootType) {
    VirtualFile rootFile = VirtualFileManager.getInstance().findFileByUrl(url);
    if (rootFile != null) {
      addRoot(rootFile, rootType);
    }
  }

  void removeRoot(@NotNull VirtualFile root, @NotNull OrderRootType rootType);

  default void removeRoot(@NotNull String url, @NotNull OrderRootType rootType) {
    for (VirtualFile file : getRoots(rootType)) {
      if (file.getUrl().equals(url)) {
        removeRoot(file, rootType);
        break;
      }
    }
  }

  void removeRoots(@NotNull OrderRootType rootType);

  void removeAllRoots();

  void commitChanges();

  boolean isWritable();
}


text:
package co.cask.cdap.cli.command.artifact;

import co.cask.cdap.api.artifact.ArtifactScope;
import co.cask.cdap.cli.ArgumentName;
import co.cask.cdap.cli.CLIConfig;
import co.cask.cdap.cli.ElementType;
import co.cask.cdap.cli.util.AbstractAuthCommand;
import co.cask.cdap.cli.util.RowMaker;
import co.cask.cdap.cli.util.table.Table;
import co.cask.cdap.client.ArtifactClient;
import co.cask.cdap.proto.artifact.PluginSummary;
import co.cask.cdap.proto.id.ArtifactId;
import co.cask.common.cli.Arguments;
import com.google.common.collect.Lists;
import com.google.inject.Inject;

import java.io.PrintStream;
import java.util.List;

/**
 * Lists all plugins of a specific type available to an artifact.
 */
public class ListArtifactPluginsCommand extends AbstractAuthCommand {

  private final ArtifactClient artifactClient;

  @Inject
  public ListArtifactPluginsCommand(ArtifactClient artifactClient, CLIConfig cliConfig) {
    super(cliConfig);
    this.artifactClient = artifactClient;
  }

  @Override
  public void perform(Arguments arguments, PrintStream output) throws Exception {

    String artifactName = arguments.get(ArgumentName.ARTIFACT_NAME.toString());
    String artifactVersion = arguments.get(ArgumentName.ARTIFACT_VERSION.toString());
    ArtifactId artifactId = cliConfig.getCurrentNamespace().artifact(artifactName, artifactVersion);
    String pluginType = arguments.get(ArgumentName.PLUGIN_TYPE.toString());

    final List<PluginSummary> pluginSummaries;
    String scopeStr = arguments.getOptional(ArgumentName.SCOPE.toString());
    if (scopeStr == null) {
      pluginSummaries = artifactClient.getPluginSummaries(artifactId.toId(), pluginType);
    } else {
      pluginSummaries = artifactClient.getPluginSummaries(artifactId.toId(), pluginType,
        ArtifactScope.valueOf(scopeStr.toUpperCase()));
    }
    Table table = Table.builder()
      .setHeader("type", "name", "classname", "description", "artifact")
      .setRows(pluginSummaries, new RowMaker<PluginSummary>() {
        @Override
        public List<?> makeRow(PluginSummary object) {
          return Lists.newArrayList(
            object.getType(), object.getName(), object.getClassName(), object.getDescription(),
            object.getArtifact().toString());
        }
      }).build();
    cliConfig.getTableRenderer().render(cliConfig, output, table);
  }

  @Override
  public String getPattern() {
    return String.format("list artifact plugins <%s> <%s> <%s> [<%s>]", ArgumentName.ARTIFACT_NAME,
      ArgumentName.ARTIFACT_VERSION, ArgumentName.PLUGIN_TYPE, ArgumentName.SCOPE);
  }

  @Override
  public String getDescription() {
    return String.format("Lists all plugins of a specific type available to a specific %s. " +
      "Returns the type, name, classname, and description of the plugin, as well as the %s the plugin came from. " +
      "If no scope is provided, %s are looked for first in the SYSTEM and then in the USER scope.",
      ElementType.ARTIFACT.getName(), ElementType.ARTIFACT.getName(), ElementType.ARTIFACT.getNamePlural());
  }
}


text:
package com.snowplowanalytics.snowplow.storage.kinesis.elasticsearch.sinks

// Java
import java.nio.ByteBuffer

// Scala
import scala.util.Random

// Amazon
import com.amazonaws.services.kinesis.model.ResourceNotFoundException
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.services.kinesis.AmazonKinesisClient
import com.amazonaws.services.kinesis.AmazonKinesis
import com.amazonaws.regions._

// Scalazon (for Kinesis interaction)
import io.github.cloudify.scala.aws.kinesis.Client
import io.github.cloudify.scala.aws.kinesis.Client.ImplicitExecution._
import io.github.cloudify.scala.aws.kinesis.Definitions.{
  Stream,
  PutResult,
  Record
}
import io.github.cloudify.scala.aws.kinesis.KinesisDsl._

// Concurrent libraries
import scala.concurrent.{Future,Await,TimeoutException}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.util.{Success, Failure}

// Logging
import org.slf4j.LoggerFactory

/**
 * Kinesis Sink
 *
 * @param provider AWSCredentialsProvider
 * @param endpoint Kinesis stream endpoint
 * @param name Kinesis stream name
 * @param shards Number of shards with which to initialize the stream
 * @param config Configuration for the Kinesis stream
 */
class KinesisSink(provider: AWSCredentialsProvider, endpoint: String, name: String, shards: Int)
  extends ISink {

  private lazy val log = LoggerFactory.getLogger(getClass())
  import log.{error, debug, info, trace}

  // Explicitly create a client so we can configure the end point
  val client = new AmazonKinesisClient(provider)
  client.setEndpoint(endpoint)

  // Create a Kinesis client for stream interactions.
  private implicit val kinesis = Client.fromClient(client)

  // The output stream for failed events.
  private val enrichedStream = createAndLoadStream()

  /**
   * Checks if a stream exists.
   *
   * @param name Name of the stream to look for
   * @param timeout How long to wait for a description of the stream
   * @return Whether the stream both exists and is active
   */
  // TODO move out into a kinesis helpers library
  def streamExists(name: String, timeout: Int = 60): Boolean = {

    val exists: Boolean = try {
      val streamDescribeFuture = for {
        s <- Kinesis.stream(name).describe
      } yield s

      val description = Await.result(streamDescribeFuture, Duration(timeout, SECONDS))
      description.isActive

    } catch {
      case rnfe: ResourceNotFoundException => false
    }

    if (exists) {
      info(s"Stream $name exists and is active")
    } else {
      info(s"Stream $name doesn't exist or is not active")
    }

    exists
  }

  /**
   * Creates a new stream if one doesn't exist
   *
   * @param How long to wait for the stream to be created
   * @return The new stream
   */
  // TODO move out into a kinesis helpers library
  def createAndLoadStream(timeout: Int = 60): Stream = {

    if (streamExists(name)) {
      Kinesis.stream(name)
    } else {
      throw new RuntimeException(s"Cannot write because stream $name doesn't exist or is not active")
    }
  }

  /**
   * Write a record to the Kinesis stream
   *
   * @param output The string record to write
   * @param key A hash of the key determines to which shard the
   *            record is assigned. Defaults to a random string.
   * @param good Unused parameter which exists to extend ISink
   */
  def store(output: String, key: Option[String], good: Boolean) {
    val putData = for {
      p <- enrichedStream.put(
        ByteBuffer.wrap(output.getBytes),
        key.getOrElse(Random.nextInt.toString)
      )
    } yield p

    putData onComplete {
      case Success(result) => {
        info(s"Writing successful")
        info(s"  + ShardId: ${result.shardId}")
        info(s"  + SequenceNumber: ${result.sequenceNumber}")
      }
      case Failure(f) => {
        error(s"Writing failed.")
        error(s"  + " + f.getMessage)
      }
    }
  }
}


text:
Fplib is is a library for calculating fingerprint and measuring similarites of materials (e.g. crystals, clusters, and molecules). The library is written in C, with python interface.

The detailed algorithm of fplib is describted the following paper:

- "[A fingerprint based metric for measuring similarities of crystaline structures](http://scitation.aip.org/content/aip/journal/jcp/144/3/10.1063/1.4940026)",
  Li Zhu, Maximilian Amsler, Tobias Fuhrer, Bastian Schaefer, Somayeh Fareji, Alireza Ghasemi, Migle Grauzinyte, Chris Wolverton, and Stefan Goedecker
  **J. Chem. Phys. 144**, 034203 (2016)

# Installation

To install python-fplib using `setup.py`, python header files (python-dev), C-compiler (e.g., gcc, clang), numpy, and lapack (openblas, atlas, Intel-MKL) are required before the build. The installation steps are shown as follows:

1. Go to the fppy directory

2. Type the command:

   `% python setup.py install --user`

# Example

Examples are found in `examples` directory.


text:
package cmd

import (
	"fmt"
	"io"

	"github.com/spf13/cobra"

	cmdutil "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"

	"github.com/projectatomic/atomic-enterprise/pkg/cmd/cli/describe"
	"github.com/projectatomic/atomic-enterprise/pkg/cmd/util/clientcmd"
)

const (
	statusLong = `Show a high level overview of the current project. Links components by their relationships.
For more information about individual items, use the describe command (e.g. oc describe buildConfig,
oc describe deploymentConfig, oc describe service).`

	statusExample = `  // Show an overview of the current project
  $ %[1]s status`
)

// NewCmdStatus implements the OpenShift cli status command
func NewCmdStatus(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:     "status",
		Short:   "Show an overview of the current project",
		Long:    statusLong,
		Example: fmt.Sprintf(statusExample, fullName),
		Run: func(cmd *cobra.Command, args []string) {
			err := RunStatus(f, out)
			cmdutil.CheckErr(err)
		},
	}
	return cmd
}

// RunStatus contains all the necessary functionality for the OpenShift cli status command
func RunStatus(f *clientcmd.Factory, out io.Writer) error {
	client, kclient, err := f.Clients()
	if err != nil {
		return err
	}

	namespace, err := f.DefaultNamespace()
	if err != nil {
		return err
	}

	describer := &describe.ProjectStatusDescriber{kclient, client}
	s, err := describer.Describe(namespace, "")
	if err != nil {
		return err
	}

	fmt.Fprintf(out, s)
	return nil
}


text:
require 'monitor'

require 'active_support/concern'
require 'active_support/core_ext/object/blank'
require 'active_support/inflector'
require 'active_model'

require 'zermelo/associations/class_methods'

require 'zermelo/records/instance_methods'
require 'zermelo/records/class_methods'
require 'zermelo/records/type_validator'

module Zermelo
  module Record
    extend ActiveSupport::Concern

    include Zermelo::Records::InstMethods

    included do
      include ActiveModel::AttributeMethods
      extend ActiveModel::Callbacks
      extend ActiveModel::Naming
      include ActiveModel::Dirty
      include ActiveModel::Validations
      include ActiveModel::Validations::Callbacks

      extend Zermelo::Records::Attributes

      # include ActiveModel::MassAssignmentSecurity

      extend Zermelo::Records::ClassMethods
      extend Zermelo::Associations::ClassMethods

      @lock = Monitor.new

      attr_accessor :attributes

      define_model_callbacks :create, :update, :destroy

      attribute_method_suffix  "="  # attr_writers
      # attribute_method_suffix  ""   # attr_readers # DEPRECATED

      validates_with Zermelo::Records::TypeValidator

      define_attributes :id => :string
    end
  end
end


text:
    @foreach ($championship->competitions as $competition)
        @if (! $competition->present()->isSingleRegistration())

id}}">

                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

{{ $competition->game->name }}

                            @include('join/partials/competition_players')

                            <button type="button" class="btn btn-success" data-dismiss="modal">Salvar</button>

        @endif
    @endforeach


text:
import cloudinary from 'cloudinary-core';

const cloudName = 'inscriptum';
const unsignedUploadPreset = 'cz5pibn5';

// *********** Upload file to Cloudinary ******************** //
export function uploadFileService(file, onProgress): Promise<any> {
  return new Promise(
    (resolve, reject) => {
      var url = `https://api.cloudinary.com/v1_1/${cloudName}/upload`;
      var xhr = new XMLHttpRequest();
      var fd = new FormData();
      xhr.open('POST', url, true);
      xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

      // Reset the upload progress bar
      //  document.getElementById('progress').style.width = 0;

      // Update progress (can be used to show progress indicator)
      xhr.upload.addEventListener('progress', function (event) {
        if (event.lengthComputable) {
          onProgress && onProgress(event.loaded, event.total);
        }
      });

      onProgress && onProgress(0, 1);

      fd.append('upload_preset', unsignedUploadPreset);
      fd.append('tags', 'browser_upload'); // Optional - add tag for image admin in Cloudinary
      fd.append('file', file);
      xhr.send(fd);

      xhr.onreadystatechange = (e) => {
        if (xhr.readyState == 4 && xhr.status == 200) {
          // File uploaded successfully

          var response = JSON.parse(xhr.responseText);
          // https://res.cloudinary.com/cloudName/image/upload/v1483481128/public_id.jpg
          // var url = response.secure_url;
          // Create a thumbnail of the uploaded image, with 150px width
          // var tokens = url.split('/');
          // tokens.splice(-2, 0, 'w_150,c_scale');
          // var img = new Image(); // HTML5 Constructor
          // img.src = url;//tokens.join('/');
          // img.alt = response.public_id;

          console.log(1111, response);

          response.src = response.secure_url;

          resolve(response);

          // document.getElementById('gallery').appendChild(img);
        }
      };

      xhr.onerror = function() {
        reject(new Error('Network Error'));
      };

    });
}

export function uploadDataToBlob(file_data) {
  var binary = atob(file_data.base64_data);
  var array: any[] = [];
  for (var i = 0; i < binary.length; i++) {
    array.push(binary.charCodeAt(i));
  }
  return new Blob([new Uint8Array(array)], { type: file_data.type });
}

export function showError(error) {
  let $error_msg = document.querySelector('#_error_msg') as HTMLElement;
  $error_msg.textContent = error;
  clearTimeout($error_msg['to']);
  $error_msg.classList.add('shown');
  $error_msg['to'] = setTimeout(
    () => {
      $error_msg.classList.remove('shown');
    },
    3000
  );
}

// var cl = cloudinary.Cloudinary.new( { cloud_name: 'inscriptum'});

// export class EditorImage extends Image {
//   static create(value) {
//     // let node = super.create(value);
//     // if (typeof value === 'string') {
//     //   node.setAttribute('src', this.sanitize(value));
//     // }

//     // console.log(value);

//     // const reader = new FileReader();
//     // reader.readAsDataURL(value);
//     // const img = new Image();
//     // img.src = value; //event.target.result;

//     return Image.create(value);
//   }

//   format(name, value) {
//     console.log(name, value);

//   }
// }


text:
require 'test_helper'

class SendgridNotification::Test < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, SendgridNotification
  end
end


text:
package main

import (
	"os"
	"path/filepath"
	"runtime"

	"github.com/btcsuite/btcd/blockchain"
	"github.com/btcsuite/btcd/blockchain/indexers"
	"github.com/btcsuite/btcd/database"
	"github.com/btcsuite/btcd/limits"
	"github.com/btcsuite/btclog"
)

const (
	// blockDbNamePrefix is the prefix for the btcd block database.
	blockDbNamePrefix = "blocks"
)

var (
	cfg *config
	log btclog.Logger
)

// loadBlockDB opens the block database and returns a handle to it.
func loadBlockDB() (database.DB, error) {
	// The database name is based on the database type.
	dbName := blockDbNamePrefix + "_" + cfg.DbType
	dbPath := filepath.Join(cfg.DataDir, dbName)

	log.Infof("Loading block database from '%s'", dbPath)
	db, err := database.Open(cfg.DbType, dbPath, activeNetParams.Net)
	if err != nil {
		// Return the error if it's not because the database doesn't
		// exist.
		if dbErr, ok := err.(database.Error); !ok || dbErr.ErrorCode !=
			database.ErrDbDoesNotExist {

			return nil, err
		}

		// Create the db if it does not exist.
		err = os.MkdirAll(cfg.DataDir, 0700)
		if err != nil {
			return nil, err
		}
		db, err = database.Create(cfg.DbType, dbPath, activeNetParams.Net)
		if err != nil {
			return nil, err
		}
	}

	log.Info("Block database loaded")
	return db, nil
}

// realMain is the real main function for the utility.  It is necessary to work
// around the fact that deferred functions do not run when os.Exit() is called.
func realMain() error {
	// Load configuration and parse command line.
	tcfg, _, err := loadConfig()
	if err != nil {
		return err
	}
	cfg = tcfg

	// Setup logging.
	backendLogger := btclog.NewDefaultBackendLogger()
	defer backendLogger.Flush()
	log = btclog.NewSubsystemLogger(backendLogger, "")
	database.UseLogger(btclog.NewSubsystemLogger(backendLogger, "BCDB: "))
	blockchain.UseLogger(btclog.NewSubsystemLogger(backendLogger, "CHAN: "))
	indexers.UseLogger(btclog.NewSubsystemLogger(backendLogger, "INDX: "))

	// Load the block database.
	db, err := loadBlockDB()
	if err != nil {
		log.Errorf("Failed to load database: %v", err)
		return err
	}
	defer db.Close()

	fi, err := os.Open(cfg.InFile)
	if err != nil {
		log.Errorf("Failed to open file %v: %v", cfg.InFile, err)
		return err
	}
	defer fi.Close()

	// Create a block importer for the database and input file and start it.
	// The done channel returned from start will contain an error if
	// anything went wrong.
	importer, err := newBlockImporter(db, fi)
	if err != nil {
		log.Errorf("Failed create block importer: %v", err)
		return err
	}

	// Perform the import asynchronously.  This allows blocks to be
	// processed and read in parallel.  The results channel returned from
	// Import contains the statistics about the import including an error
	// if something went wrong.
	log.Info("Starting import")
	resultsChan := importer.Import()
	results := <-resultsChan
	if results.err != nil {
		log.Errorf("%v", results.err)
		return results.err
	}

	log.Infof("Processed a total of %d blocks (%d imported, %d already "+
		"known)", results.blocksProcessed, results.blocksImported,
		results.blocksProcessed-results.blocksImported)
	return nil
}

func main() {
	// Use all processor cores and up some limits.
	runtime.GOMAXPROCS(runtime.NumCPU())
	if err := limits.SetLimits(); err != nil {
		os.Exit(1)
	}

	// Work around defer not working after os.Exit()
	if err := realMain(); err != nil {
		os.Exit(1)
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using ImageMagickSharp.InteropMarshaler;

namespace ImageMagickSharp
{
    internal static class ImageWandInterop
    {
        #region [Image Wand]

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickStripImage(IntPtr wand);

        internal static bool MagickThumbnailImage(IntPtr wand, int columns, int rows, bool bestFit, bool fill)
        {
            return MagickThumbnailImage(wand, (IntPtr)columns, (IntPtr)rows, bestFit, fill);
        }

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickThumbnailImage(IntPtr wand, IntPtr columns, IntPtr rows, bool bestFit, bool fill);

        internal static bool MagickScaleImage(IntPtr wand, int columns, int rows)
        {
            return MagickScaleImage(wand, (IntPtr)columns, (IntPtr)rows);
        }

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickScaleImage(IntPtr wand, IntPtr columns, IntPtr rows);

        ///  Magick resize image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="columns"> The columns. </param>
        /// <param name="rows"> The rows. </param>
        /// <param name="filterType"> Type of the filter. </param>
        /// <param name="blur"> The blur. </param>
        /// <returns> An int. </returns>
        internal static bool MagickResizeImage(IntPtr wand, int columns, int rows, int filterType, double blur)
        {
            return MagickResizeImage(wand, (IntPtr) columns, (IntPtr) rows, filterType, blur);
        }

        /// WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
        /// const size_t columns,const size_t rows,const FilterTypes filter,
        /// const double blur)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickResizeImage(IntPtr wand, IntPtr columns, IntPtr rows, int filterType, double blur);

        ///  Magick crop image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> An int. </returns>
        internal static bool MagickCropImage(IntPtr wand, int width, int height, int x, int y)
        {
            return MagickCropImage(wand, (IntPtr)width, (IntPtr)height, (IntPtr)x, (IntPtr)y);
        }

        /// WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
        /// const size_t width,const size_t height,const ssize_t x,const ssize_t y)

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickCropImage(IntPtr wand, IntPtr width, IntPtr height, IntPtr x, IntPtr y);

        ///  Magick get image compression quality.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An int. </returns>
        internal static int MagickGetImageCompressionQuality(IntPtr wand)
        {
            return (int) MagickGetImageCompressionQualityInternal(wand);
        }

        /// WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention, EntryPoint = "MagickGetImageCompressionQuality")]
        private static extern IntPtr MagickGetImageCompressionQualityInternal(IntPtr wand);

        ///  Magick set image compression quality.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="quality"> The quality. </param>
        /// <returns> An int. </returns>
        ///
        internal static int MagickSetImageCompressionQuality(IntPtr wand, int quality)
        {
            return MagickSetImageCompressionQualityInternal(wand, (IntPtr)quality);
        }

        /// WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, const size_t quality)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention, EntryPoint = "MagickSetImageCompressionQuality")]
        private static extern int MagickSetImageCompressionQualityInternal(IntPtr wand, IntPtr quality);

        ///  Magick gaussian blur image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="radius"> The radius. </param>
        /// <param name="sigma"> The sigma. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickGaussianBlurImage(IntPtr wand, double radius, double sigma);

		///  Magick adaptive blur image.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="radius"> The radius. </param>
		/// <param name="sigma"> The sigma. </param>
		/// <returns> An int. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern int MagickAdaptiveBlurImage(IntPtr wand, double radius, double sigma);

        ///  Magick unsharp mask image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="radius"> The radius. </param>
        /// <param name="sigma"> The sigma. </param>
        /// <param name="amount"> The amount. </param>
        /// <param name="threshold"> The threshold. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickUnsharpMaskImage(IntPtr wand, double radius, double sigma, double amount, double threshold);

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickSetImageFilename(IntPtr wand, string filename);

        ///  Magick get image filename.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An IntPtr. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern IntPtr MagickGetImageFilename(IntPtr wand);

        ///  Magick get image format.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An IntPtr. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern IntPtr MagickGetImageFormat(IntPtr wand);

        ///  Magick set image format.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="format"> Describes the format to use. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickSetImageFormat(IntPtr wand, IntPtr format);

        ///  Magick get image BLOB.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="length"> The length. </param>
        /// <returns> An IntPtr. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern IntPtr MagickGetImageBlob(IntPtr wand, out int length);

        ///  Magick read image BLOB.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="blob"> The BLOB. </param>
        /// <param name="length"> The length. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickReadImageBlob(IntPtr wand, IntPtr blob, int length);

        ///  Magick reset image page.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="page"> The page. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickResetImagePage(IntPtr wand, IntPtr page);

        ///  Magick composite image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="sourcePtr"> Source pointer. </param>
        /// <param name="compositeOperator"> The composite operator. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> An int. </returns>
        internal static bool MagickCompositeImage(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator,
            int x, int y)
        {
            return MagickCompositeImageInternal(wand, sourcePtr, compositeOperator, (IntPtr)x, (IntPtr)y);
        }

        /// WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,const MagickWand *source_wand,
        /// const CompositeOperator compose,const ssize_t x,const ssize_t y)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention, EntryPoint = "MagickCompositeImage")]
        private static extern bool MagickCompositeImageInternal(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator, IntPtr x, IntPtr y);

        ///  Magick rotate image.
        ///
        /// WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,const PixelWand *background,const double degrees)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="background"> The background. </param>
        /// <param name="degrees"> The degrees. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickRotateImage(IntPtr wand, IntPtr background, double degrees);

        ///  Magick transparent paint image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="target"> Target for the. </param>
        /// <param name="alpha"> The alpha. </param>
        /// <param name="fuzz"> The fuzz. </param>
        /// <param name="invert"> The invert. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickTransparentPaintImage(IntPtr wand, IntPtr target, double alpha, double fuzz, int invert);

        ///  Magick opaque paint image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="target"> Target for the. </param>
        /// <param name="fill"> The fill. </param>
        /// <param name="fuzz"> The fuzz. </param>
        /// <param name="invert"> The invert. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickOpaquePaintImage(IntPtr wand, IntPtr target, IntPtr fill, double fuzz, int invert);

        ///  Magick threshold image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="threshold"> The threshold. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickThresholdImage(IntPtr wand, double threshold);

        ///  Magick adaptive threshold image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="bias"> The bias. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickAdaptiveThresholdImage(IntPtr wand, int width, int height, double bias);

        ///  Magick transform image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="crop"> A crop geometry string. This geometry defines a subregion of the image to crop. </param>
        /// <param name="geomety"> An image geometry string. This geometry defines the final size of the image. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern IntPtr MagickTransformImage(IntPtr wand, string crop, string geomety);

		///  Magick color matrix image.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="color_matrix"> The color matrix. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern bool MagickColorMatrixImage(IntPtr wand,  double[,] color_matrix);

        ///  Magick transform image colorspace.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="colorspace"> The colorspace. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickTransformImageColorspace(IntPtr wand, ImageColorspaceType colorspace);

        ///  Magick transpose image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickTransposeImage(IntPtr wand);

        ///  Magick transverse image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickTransverseImage(IntPtr wand);

        ///  Magick quantize image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="number_colors"> Number of colors. </param>
        /// <param name="colorsapceType"> Type of the colorsapce. </param>
        /// <param name="treedepth"> The treedepth. </param>
        /// <param name="dither_method"> The dither method. </param>
        /// <param name="measure_error"> The measure error. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickQuantizeImage(IntPtr wand, int number_colors, int colorsapceType, int treedepth, int dither_method, int measure_error);

        ///  Magick normalize image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An int. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern int MagickNormalizeImage(IntPtr wand);

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickAutoOrientImage(IntPtr wand);

        ///  Magick get image width.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An int. </returns>
        internal static int MagickGetImageWidth(IntPtr wand)
        {
            return (int)MagickGetImageWidthInternal(wand);
        }

        /// WandExport size_t MagickGetImageWidth(MagickWand *wand)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention, EntryPoint = "MagickGetImageWidth")]
        private static extern IntPtr MagickGetImageWidthInternal(IntPtr wand);

        ///  Magick get image height.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> An int. </returns>
        internal static int MagickGetImageHeight(IntPtr wand)
        {
            return (int)MagickGetImageHeightInternal(wand);
        }

        /// WandExport size_t MagickGetImageHeight(MagickWand *wand)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention, EntryPoint = "MagickGetImageHeight")]
        private static extern IntPtr MagickGetImageHeightInternal(IntPtr wand);

        ///  Magick set image matte.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="matte"> true to matte. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickSetImageMatte(IntPtr wand, bool matte);

        ///  Magick set image matte color.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="matteColor"> The matte color. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickSetImageMatteColor(IntPtr wand, IntPtr matteColor);

        ///  Magick get image matte color.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="matteColor"> The matte color. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickGetImageMatteColor(IntPtr wand, out IntPtr matteColor);

        ///  Magick get image background color.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="backgroundcolor"> The backgroundcolor. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickGetImageBackgroundColor(IntPtr wand, out IntPtr backgroundcolor);

        ///  Magick set image background color.
        ///
        /// WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,const PixelWand *background)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="backgroundcolor"> The backgroundcolor. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickSetImageBackgroundColor(IntPtr wand, IntPtr backgroundcolor);

        ///  Magick flip image.
        ///
        /// WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickFlipImage(IntPtr wand);

        ///  Magick flop image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickFlopImage(IntPtr wand);

        ///  Magick border image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="bordercolor"> The bordercolor. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        internal static bool MagickBorderImage(IntPtr wand, IntPtr bordercolor, int width, int height)
        {
            return MagickBorderImage(wand, bordercolor, (IntPtr) width, (IntPtr) height);
        }

        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickBorderImage(IntPtr wand, IntPtr bordercolor, IntPtr width, IntPtr height);

        ///  Magick extent image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        internal static bool MagickExtentImage(IntPtr wand, int width, int height, int x, int y)
        {
            return MagickExtentImage(wand, (IntPtr) width, (IntPtr) height, (IntPtr) x, (IntPtr) y);
        }

        /// WandExport MagickBooleanType MagickExtentImage(MagickWand *wand, const size_t width,
        /// const size_t height,const ssize_t x,const ssize_t y)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickExtentImage(IntPtr wand, IntPtr width, IntPtr height, IntPtr x, IntPtr y);

        ///  Magick get image region.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> An IntPtr. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern IntPtr MagickGetImageRegion(IntPtr wand, int width, int height, int x, int y);

        ///  Magick set image extent.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="columns"> The columns. </param>
        /// <param name="rows"> The rows. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickSetImageExtent(IntPtr wand, int columns, int rows);

		///  Magick set image extent.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="columns"> The columns. </param>
		/// <param name="rows"> The rows. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern bool MagickSetImageExtent(IntPtr wand, double columns, double rows);

        ///  Magick trim image.
        ///
        /// WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="fuzz"> The fuzz. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickTrimImage(IntPtr wand, double fuzz);

        ///  Magick label image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="label"> The label. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickLabelImage(IntPtr wand, string label);

        ///  Magick get image border color.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="border_color"> The border color. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickGetImageBorderColor(IntPtr wand, out IntPtr border_color);

        ///  Magick set image border color.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="border_color"> The border color. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickSetImageBorderColor(IntPtr wand, IntPtr border_color);

        ///  Magick raise image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <param name="raise"> true to raise. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickRaiseImage(IntPtr wand, int width, int height, int x, int y, bool raise);

        ///  Magick shadow image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="opacity"> The opacity. </param>
        /// <param name="sigma"> The sigma. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        internal static bool MagickShadowImage(IntPtr wand, double opacity, double sigma, int x, int y)
        {
            return MagickShadowImage(wand, opacity, sigma, (IntPtr)x, (IntPtr)y);
        }

        /// WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,const double opacity,
        /// const double sigma,const ssize_t x,const ssize_t y)
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickShadowImage(IntPtr wand, double opacity, double sigma, IntPtr x, IntPtr y);

        ///  Magick shade image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="gray"> true to gray. </param>
        /// <param name="azimuth"> The azimuth. </param>
        /// <param name="elevation"> The elevation. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        private static extern bool MagickShadeImage(IntPtr wand, bool gray, double azimuth, double elevation);

        ///  Magick shear image.
        ///
        /// WandExport MagickBooleanType MagickShearImage(MagickWand *wand,const PixelWand *background,
        /// const double x_shear,const double y_shear)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="background"> The background. </param>
        /// <param name="x_shear"> The shear. </param>
        /// <param name="y_shear"> The shear. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern bool MagickShearImage(IntPtr wand, IntPtr background, double x_shear, double y_shear);

		///  Magick get image gravity.
		///
        /// WandExport GravityType MagickGetImageGravity(MagickWand *wand)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <returns> A GravityType. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern GravityType MagickGetImageGravity(IntPtr wand);

		///  Magick set image gravity.
		///
		/// WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,const GravityType gravity)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="gravity"> The gravity. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickSetImageGravity(IntPtr wand, GravityType gravity);

		///  Magick get image compose.
		/// <param name="wand"> Handle of the wand. </param>
		/// <returns> A CompositeOperator. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern CompositeOperator MagickGetImageCompose(IntPtr wand);

		///  Magick set image compose.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="compose"> The compose. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern bool MagickSetImageCompose(IntPtr wand, CompositeOperator compose);

		///  Magick get image clip mask.
		/// <param name="wand"> Handle of the wand. </param>
		/// <returns> An IntPtr. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern IntPtr MagickGetImageClipMask(IntPtr wand);

		///  Magick set image clip mask.
		///
		/// WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,const MagickWand *clip_mask)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="clip_mask"> The clip mask. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickSetImageClipMask(IntPtr wand, IntPtr clip_mask);

		///  Magick negate image.
		///
		/// WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,const MagickBooleanType gray)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="gray"> true to gray. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickNegateImage(IntPtr wand, bool gray);

		///  Magick get image alpha channel.
		///
        /// WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
		/// Note: The enum here as return is okay as bool=int on all platforms. This is
		/// a bug in imagemagick
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <returns> An AlphaChannelType. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern AlphaChannelType MagickGetImageAlphaChannel(IntPtr wand);

		///  Magick set image alpha channel.
		///
		/// WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,const AlphaChannelType alpha_type)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="alpha_type"> Type of the alpha. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickSetImageAlphaChannel(IntPtr wand, AlphaChannelType alpha_type);

        ///  Magick distort image.
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="method"> The method. </param>
        /// <param name="number_arguments"> Number of arguments. </param>
        /// <param name="arguments"> The arguments. </param>
        /// <param name="bestfit"> true to bestfit. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        internal static bool MagickDistortImage(IntPtr wand, DistortImageMethodType method, int number_arguments,
            double[] arguments, bool bestfit)
        {
            return MagickDistortImage(wand, method, (IntPtr) number_arguments, arguments, bestfit);
        }

        /// WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,const DistortImageMethod method,
        /// const size_t number_arguments,const double *arguments,const MagickBooleanType bestfit)
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickDistortImage(IntPtr wand, DistortImageMethodType method, IntPtr number_arguments, double[] arguments, bool bestfit);

		///  Magick brightness contrast image.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="brightness"> The brightness. </param>
		/// <param name="contrast"> The contrast. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern bool MagickBrightnessContrastImage(IntPtr wand, double brightness, double contrast);

		///  Magick colorize image.
		///
		/// WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,const PixelWand *colorize,const PixelWand *opacity)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="colorize"> The colorize. </param>
		/// <param name="blend"> The blend. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickColorizeImage(IntPtr wand, IntPtr colorize, IntPtr blend);

        #endregion

		#region [Image Wand Methods - Pixel]

		///  Magick get image pixel color.
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="x"> The x coordinate. </param>
		/// <param name="y"> The y coordinate. </param>
		/// <param name="color"> The color. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		private static extern bool MagickGetImagePixelColor(IntPtr wand, int x, int y, ref IntPtr color);

        ///  Magick get image virtual pixel method.
        ///
        /// WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <returns> A PixelType. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern VirtualPixelType MagickGetImageVirtualPixelMethod(IntPtr wand);

        ///  Magick set image virtual pixel method.
        ///
        /// WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,const VirtualPixelMethod method)
        ///
        ///
        /// <param name="wand"> Handle of the wand. </param>
        /// <param name="method"> The method. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        [DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
        internal static extern VirtualPixelType MagickSetImageVirtualPixelMethod(IntPtr wand, VirtualPixelType method);

		///  Magick annotate image.
		///
		/// WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,const DrawingWand *drawing_wand,
		/// const double x,const double y,const double angle,const char *text)
		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="drawing_wand"> The drawing wand. </param>
		/// <param name="x"> The x coordinate. </param>
		/// <param name="y"> The y coordinate. </param>
		/// <param name="angle"> The angle. </param>
		/// <param name="text"> The text. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickAnnotateImage(IntPtr wand, IntPtr drawing_wand, double x, double y, double angle,
            [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] string text);

		#endregion

		#region [Image Wand Methods - Drawing]

		///  Magick draw image.
		///
		/// WandExport MagickBooleanType MagickDrawImage(MagickWand *wand, const DrawingWand *drawing_wand)

		///
		///
		/// <param name="wand"> Handle of the wand. </param>
		/// <param name="drawing_wand"> The drawing wand. </param>
		/// <returns> true if it succeeds, false if it fails. </returns>
		[DllImport(Constants.WandLibrary, CallingConvention = Constants.WandCallingConvention)]
		internal static extern bool MagickDrawImage(IntPtr wand, IntPtr drawing_wand);

		#endregion
	}
}


text:
$(function () {
    $('.alert').toggle(false);
});

$("#profileForm").submit(function (event) {
    // Stop form from submitting normally
    event.preventDefault();

    // Get some values from elements on the page:
    var formData = $(this).serializeArray();
    var url = $(this).attr("action");

    var sendData = {};
    $(formData).each(function (index, obj) {
        sendData[obj.name] = xssFilters.inHTMLData(obj.value);
    });

    // Send the data using post
    var posting = $.post(url, sendData);

    // Put the results in a div
    posting.done(function (data) {
        $('.alert').toggle(false);
        $('.alert').slideToggle();
        $('#alert-msg').text(data);
    });
    posting.fail(function (data) {
        alert("Sorry, some error occured. Please try again later");
    });
});


text:
require 'scrapescrobbler'
require 'spec_helper'
require 'lastfm'

module Scrapescrobbler
  describe Listener do
    include HelperMethods

    describe "with an instance" do
      before :each do
        mockit
        ::Lastfm::MethodCategory::Auth.any_instance.stubs(
            :get_session).returns("A session")
        ::Lastfm::MethodCategory::Auth.any_instance.stubs(
            :get_token).returns("a token")
        @scrobble_stub = ::Lastfm::MethodCategory::Track.any_instance.stubs(
            :scrobble).returns("Good job!")
        @station = "wyep"
        @listener = Listener.new @station
        @song = Song.new(:time => Time.now, :station => @station,
            :title => "The Best Song Ever", :artist => 'Price')
      end

      it "should have a station" do
        @listener.station.should eq(Stations::Wyep)
      end

      it "should have a last.fm instance" do
        @listener.lastfm.should be_an_instance_of(::Lastfm)
      end

      describe "that is inactive" do
        it "should not have a start time" do
          @listener.started.should eq(nil)
        end

        it "should not have a last.fm session" do
          @listener.lastfm.auth.should_not respond_to(:session)
        end
      end

      describe "that is active" do
        before :each do
          @listener.listen
          Stations::Wyep.stubs(:playlist).returns([@song])
        end

        it "should have a start time" do
          @listener.should respond_to(:started)
          @listener.started.should be_an_instance_of(DateTime)
        end

        it "should have a last.fm session" do
          @listener.lastfm.should respond_to(:auth)
          @listener.lastfm.should respond_to(:session)
        end

        it "should have a current song" do
          @listener.should respond_to(:now_playing)
          @listener.now_playing.should be_an_instance_of(Song)
        end

        describe "and when updated" do
          it "should check the station's playlist" do
            @listener.station.expects(:playlist)
            @listener.update
          end

          describe "and there is a new song to scrobble" do

            it "should create a new Song" do
              proc { @listener.update }.should change(Song, :count)
              song = Song.first :time => @song.time, :station => @song.station
              song.title.should eq(@song.title)
            end

            it "should scrobble the song" do
              @scrobble_stub.expects(:scrobble).with(@song.artist, @song.title)
              @listener.update
            end

            it "should have a current song that matches the new song" do
              @listener.update
              @listener.now_playing.should eq(@song)
            end
          end

          describe "and there is not a new song to scrobble" do
            before do
              @song.save
            end

            it "should not create a new Song" do
              @listener.update
              proc { @listener.update }.should_not change(Song, :count)
            end

            it "should not scrobble the song" do
              @scrobble_stub.expects(:scrobble).with(@song.artist,
                  @song.title).never
              @listener.update
            end

            it "should not update the current song" do
              @listener.update
              proc { @listener.update }.should_not change(@listener,
                  :now_playing)
            end
          end
        end
      end
    end
  end
end


text:
<?php
class Kwc_Menu_Mobile_Events extends Kwc_Abstract_Events
{
    public function getListeners()
    {
        $ret = parent::getListeners();
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_Added',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_Removed',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_PositionChanged',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_ShowInMenuChanged',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_ParentChanged',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_NameChanged',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Page_UrlChanged',
            'callback' => 'onPageChanged'
        );
        $ret[] = array(
            'class' => null,
            'event' => 'Kwf_Component_Event_Component_RecursiveRemoved',
            'callback' => 'onPageChangedRecursive'
        );
        return $ret;
    }

    public function onPageChanged(Kwf_Component_Event_Abstract $event)
    {
        $this->_deleteCache($event);
    }

    public function onPageChangedRecursive(Kwf_Component_Event_Component_RecursiveAbstract $event)
    {
        $this->_deleteCache($event);
    }

    private function _deleteCache($event)
    {
        $components = Kwf_Component_Data_Root::getInstance()
            ->getComponentsByClass('Kwc_Menu_Mobile_Component', array('subroot' => $event->component->getSubroot()));
        foreach($components as $component) {
            $cacheId = 'kwcMenuMobile-' . $component->componentId;
            Kwf_Cache_Simple::delete($cacheId);
        }
    }
}


text:
/**
* Original shader by TriggerHLM (https://www.shadertoy.com/view/MdXGDH)
* Tweaked, uniforms added and converted to Phaser/PIXI by Richard Davey
*/
Phaser.Filter.Plasma = function (game) {

    Phaser.Filter.call(this, game);

    this.uniforms.alpha = { type: '1f', value: 1.0 };
    this.uniforms.size = { type: '1f', value: 0.03 };
    this.uniforms.redShift = { type: '1f', value: 0.5 };
    this.uniforms.greenShift = { type: '1f', value: 0.5 };
    this.uniforms.blueShift = { type: '1f', value: 0.9 };

    this.fragmentSrc = [

        "precision mediump float;",
        "uniform float     time;",
        "uniform float     alpha;",
        "uniform float     size;",
        "uniform float     redShift;",
        "uniform float     greenShift;",
        "uniform float     blueShift;",

        "const float PI = 3.14159265;",

        "float ptime = time * 0.1;",

        "void main(void) {",

            "float color1, color2, color;",

            "color1 = (sin(dot(gl_FragCoord.xy, vec2(sin(ptime * 3.0), cos(ptime * 3.0))) * 0.02 + ptime * 3.0) + 1.0) / 2.0;",
            "vec2 center = vec2(640.0 / 2.0, 360.0 / 2.0) + vec2(640.0 / 2.0 * sin(-ptime * 3.0), 360.0 / 2.0 * cos(-ptime * 3.0));",
            "color2 = (cos(length(gl_FragCoord.xy - center) * size) + 1.0) / 2.0;",
            "color = (color1 + color2) / 2.0;",

            "float red = (cos(PI * color / redShift + ptime * 3.0) + 1.0) / 2.0;",
            "float green = (sin(PI * color / greenShift + ptime * 3.0) + 1.0) / 2.0;",
            "float blue = (sin(PI * color / blueShift + ptime * 3.0) + 1.0) / 2.0;",

            "gl_FragColor = vec4(red, green, blue, alpha);",
        "}"
    ];

};

Phaser.Filter.Plasma.prototype = Object.create(Phaser.Filter.prototype);
Phaser.Filter.Plasma.prototype.constructor = Phaser.Filter.Plasma;

Phaser.Filter.Plasma.prototype.init = function (width, height, alpha, size) {

    this.setResolution(width, height);

    if (typeof alpha !== 'undefined') {
        this.uniforms.alpha.value = alpha;
    }

    if (typeof size !== 'undefined') {
        this.uniforms.size.value = size;
    }

};

Object.defineProperty(Phaser.Filter.Plasma.prototype, 'alpha', {

    get: function() {
        return this.uniforms.alpha.value;
    },

    set: function(value) {
        this.uniforms.alpha.value = value;
    }

});

Object.defineProperty(Phaser.Filter.Plasma.prototype, 'size', {

    get: function() {
        return this.uniforms.size.value;
    },

    set: function(value) {
        this.uniforms.size.value = value;
    }

});

Object.defineProperty(Phaser.Filter.Plasma.prototype, 'redShift', {

    get: function() {
        return this.uniforms.redShift.value;
    },

    set: function(value) {
        this.uniforms.redShift.value = value;
    }

});

Object.defineProperty(Phaser.Filter.Plasma.prototype, 'greenShift', {

    get: function() {
        return this.uniforms.greenShift.value;
    },

    set: function(value) {
        this.uniforms.greenShift.value = value;
    }

});

Object.defineProperty(Phaser.Filter.Plasma.prototype, 'blueShift', {

    get: function() {
        return this.uniforms.blueShift.value;
    },

    set: function(value) {
        this.uniforms.blueShift.value = value;
    }

});


text:
  angular.module('starter.controllers', ['firebase'])

  .factory("FirebaseClient", function() {
    var ref = new Firebase("https://greenbit.firebaseio.com/");
    return ref;
  })

  .controller('HomeCtrl', function($scope, FirebaseClient, $firebaseArray, $firebaseObject, $ionicModal) {

    $scope.tweet =  function(){
      var firebaseObject = FirebaseClient.child('Tweet');
      var message = document.querySelector('textarea').value;
      FirebaseClient.update({Tweet : message});
      $scope.closeModal();
    };

    var settings = $firebaseObject(FirebaseClient.child('currentSettings'));
    settings.$loaded(function(){

        $scope.reading = settings;
        $scope.tweetMessage = '#IntelMaker #GreenBit Temperature: '+ $scope.reading.temperature + ' DEG | Light: '+ $scope.reading.light + ' LUX | Moisture: '+ $scope.reading.moisture + ' ppm';

    });

  // .fromTemplateUrl() method
  $ionicModal.fromTemplateUrl('templates/tweet.html', {
    scope: $scope,
    animation: 'slide-in-up'
  }).then(function(modal) {
    $scope.modal = modal;
  });

  $scope.openModal = function() {
    $scope.modal.show();
  };
  $scope.closeModal = function() {
    $scope.modal.hide();
  };
  //Cleanup the modal when we're done with it!
  $scope.$on('$destroy', function() {
    $scope.modal.remove();
  });
  // Execute action on hide modal
  $scope.$on('modal.hidden', function() {
    // Execute action
  });
  // Execute action on remove modal
  $scope.$on('modal.removed', function() {
    // Execute action
  });

  })

  .controller('SnapsCtrl', function($scope, FirebaseClient, $firebaseArray) {

    $scope.images = $firebaseArray(FirebaseClient.child('snaps'));
    $scope.takePicture = function(){
      FirebaseClient.update({snap:true});
    }

  })

  .controller('AnalyticsCtrl', function($scope, $firebaseArray, FirebaseClient) {
    var logs = $firebaseArray(FirebaseClient.child('logs'))
    logs.$loaded()
    .then(function(x) {
        var key = logs.$keyAt(0);
        $scope.reading = logs.$getRecord(key);
        $scope.labels = ["0", "5", "10", "15", "20"];
        $scope.data = [[28, 48, 40, 19, 86, 27, 90] ];
    })
    .catch(function(error) {
      console.log("Error:", error);
    });

  })

  .controller('ExperimentCtrl', function($scope, FirebaseClient, $firebaseArray, $firebaseObject) {

    $scope.currentSettings = $firebaseObject(FirebaseClient.child('currentSettings'));
    $scope.plants = $firebaseArray(FirebaseClient.child('plants'));

    $scope.changePlant = function(plant){
      $scope.currentSettings = $scope.plants.$getRecord(plant);
      $scope.currentSettings.plant = plant;
    };

    $scope.reset =  function(){
      var plant = $scope.currentSettings.plant;
      plant.lightState =true;
      var list = $firebaseArray(FirebaseClient.child('plants'));
      list.$loaded().then(function(data) {
        $scope.currentSettings = list.$getRecord(plant);
        $scope.currentSettings.plant = plant;
      })
      .catch(function(error) {
        console.error("Error:", error);
      });
    };

    $scope.apply = function(){
      var currentSettings = {
        temperature: parseInt($scope.currentSettings.temperature),
        light: parseInt($scope.currentSettings.light),
        moisture: parseInt($scope.currentSettings.moisture),
        plant: $scope.currentSettings.plant,
        lightOn: parseInt($scope.currentSettings.lightOn),
        lightOff:parseInt( $scope.currentSettings.lightOff),
        lightState: $scope.currentSettings.lightState
      };
      FirebaseClient.child('currentSettings').set(currentSettings);
    };

  });


text:
GVTPATH=${GVTPATH}
DOXYCOTON_PATH=${DOXYCOTON_PATH}
doxygen $1