text:
<?php

class Ess_M2ePro_Block_Adminhtml_Walmart_Listing_Other_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
{
    //########################################

    public function __construct()
    {
        parent::__construct();

        // Initialization block
        // ---------------------------------------
        $this->setId('walmartListingOtherLog');
        $this->_blockGroup = 'M2ePro';
        $this->_controller = 'adminhtml_walmart_listing_other_log';
        // ---------------------------------------

        // Set header text
        // ---------------------------------------
        $otherListingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');

        if (isset($otherListingData['id'])) {
            $tempTitle = Mage::helper('M2ePro/Component_'.ucfirst($otherListingData['component_mode']))
                ->getObject('Listing_Other', $otherListingData['id'])
                ->getChildObject()->getTitle();

            $this->_headerText = Mage::helper('M2ePro')->__("Log For ");
            $this->_headerText .= ' "' . $this->escapeHtml($tempTitle) . '"';
        } else {
            $this->_headerText = '';
        }

        // ---------------------------------------

        // Set buttons actions
        // ---------------------------------------
        $this->removeButton('back');
        $this->removeButton('reset');
        $this->removeButton('delete');
        $this->removeButton('add');
        $this->removeButton('save');
        $this->removeButton('edit');
        // ---------------------------------------

        $this->addButton(
            'show_general_log', array(
            'label'     => Mage::helper('M2ePro')->__('Show General Log'),
            'onclick'   => 'setLocation(\'' .$this->getUrl('*/adminhtml_walmart_log/listingOther').'\')',
            'class'     => 'button_link'
            )
        );
    }

    //########################################
}


text:
// MIT License
//
// Copyright (c) 2017 Maarten van Sambeek.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

namespace ConnectQl.Parser.Ast.Expressions
{
    using System;
    using System.Collections.Generic;

    using JetBrains.Annotations;

    using Visitors;

    /// <summary>
    /// The aliased expression.
    /// </summary>
    internal class AliasedConnectQlExpression : ConnectQlExpressionBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AliasedConnectQlExpression"/> class.
        /// </summary>
        /// <param name="expression">
        /// The expression.
        /// </param>
        /// <param name="alias">
        /// The alias.
        /// </param>
        public AliasedConnectQlExpression(ConnectQlExpressionBase expression, string alias)
        {
            this.Expression = expression;
            this.Alias = alias;
        }

        /// <summary>
        /// Gets the alias.
        /// </summary>
        public string Alias { get; }

        /// <summary>
        /// Gets the children of this node.
        /// </summary>
        public override IEnumerable<Node> Children
        {
            get
            {
                yield return this.Expression;
            }
        }

        /// <summary>
        /// Gets the expression.
        /// </summary>
        public ConnectQlExpressionBase Expression { get; }

        /// <summary>
        /// Determines whether the specified object is equal to the current object.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the specified object is equal to the current object; otherwise, <c>false</c>.
        /// </returns>
        /// <param name="obj">
        /// The object to compare with the current object.
        /// </param>
        public override bool Equals(object obj)
        {
            var other = obj as AliasedConnectQlExpression;

            return other != null && string.Equals(this.Alias, other.Alias, StringComparison.OrdinalIgnoreCase) && object.Equals(this.Expression, other.Expression);
        }

        /// <summary>
        /// Serves as the default hash function.
        /// </summary>
        /// <returns>
        /// A hash code for the current object.
        /// </returns>
        public override int GetHashCode()
        {
            unchecked
            {
                return ((this.Alias != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(this.Alias) : 0) * 397) ^ (this.Expression?.GetHashCode() ?? 0);
            }
        }

        /// <summary>
        /// The to string.
        /// </summary>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        [NotNull]
        public override string ToString() => $"{this.Expression} AS {this.Alias}";

        /// <summary>
        /// Dispatches the visitor to the correct visit-method.
        /// </summary>
        /// <param name="visitor">
        /// The visitor.
        /// </param>
        /// <returns>
        /// The <see cref="Node"/>.
        /// </returns>
        protected internal override Node Accept([NotNull] NodeVisitor visitor)
        {
            return visitor.VisitAliasedSqlExpression(this);
        }

        /// <summary>
        /// Visits the children of this node.
        /// </summary>
        /// <param name="visitor">
        /// The visitor.
        /// </param>
        /// <returns>
        /// The <see cref="Node"/>.
        /// </returns>
        [NotNull]
        protected internal override Node VisitChildren([NotNull] NodeVisitor visitor)
        {
            var expression = visitor.Visit(this.Expression);

            return expression != this.Expression ? new AliasedConnectQlExpression(expression, this.Alias) : this;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package parser

import (
	"github.com/yuin/goldmark/ast"
	"github.com/yuin/goldmark/text"
	"github.com/yuin/goldmark/util"
)

type listItemParser struct {
}

var defaultListItemParser = &listItemParser{}

// NewListItemParser returns a new BlockParser that
// parses list items.
func NewListItemParser() BlockParser {
	return defaultListItemParser
}

var skipListParser = NewContextKey()
var skipListParserValue interface{} = true

func (b *listItemParser) Trigger() []byte {
	return []byte{'-', '+', '*', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
}

func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) {
	list, lok := parent.(*ast.List)
	if !lok { // list item must be a child of a list
		return nil, NoChildren
	}
	offset := lastOffset(list)
	line, _ := reader.PeekLine()
	match, typ := matchesListItem(line, false)
	if typ == notList {
		return nil, NoChildren
	}
	if match[1]-offset > 3 {
		return nil, NoChildren
	}
	itemOffset := calcListOffset(line, match)
	node := ast.NewListItem(match[3] + itemOffset)
	if match[4] < 0 || match[5]-match[4] == 1 {
		return node, NoChildren
	}

	pos, padding := util.IndentPosition(line[match[4]:], match[4], itemOffset)
	child := match[3] + pos
	reader.AdvanceAndSetPadding(child, padding)
	return node, HasChildren
}

func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State {
	line, _ := reader.PeekLine()
	if util.IsBlank(line) {
		reader.Advance(len(line)-1)

		return Continue | HasChildren
	}

	indent, _ := util.IndentWidth(line, reader.LineOffset())
	offset := lastOffset(node.Parent())
	if indent < offset && indent < 4 {
		_, typ := matchesListItem(line, true)
		// new list item found
		if typ != notList {
			pc.Set(skipListParser, skipListParserValue)
		}
		return Close
	}
	pos, padding := util.IndentPosition(line, reader.LineOffset(), offset)
	reader.AdvanceAndSetPadding(pos, padding)

	return Continue | HasChildren
}

func (b *listItemParser) Close(node ast.Node, reader text.Reader, pc Context) {
	// nothing to do
}

func (b *listItemParser) CanInterruptParagraph() bool {
	return true
}

func (b *listItemParser) CanAcceptIndentedLine() bool {
	return false
}


text:
module MobileCenterApi
  module Models
    #
    # Model object.
    #
    #
    class Permission
      # @return [String]
      attr_accessor :name

      # @return [String]
      attr_accessor :level

      #
      # Mapper for Permission class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          required: false,
          serialized_name: 'Permission',
          type: {
            name: 'Composite',
            class_name: 'Permission',
            model_properties: {
              name: {
                required: false,
                serialized_name: 'Name',
                type: {
                  name: 'String'
                }
              },
              level: {
                required: false,
                serialized_name: 'Level',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "userInfo".
 *
 * @property integer $user_id
 * @property string $user_name
 * @property string $user_surname
 * @property string $user_birthdate
 * @property string $user_education
 * @property string $user_city
 * @property string $user_about
 *
 * @property User $user
 */
class UserInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'userInfo';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id'], 'required'],
            [['user_id'], 'integer'],
            [['user_name', 'user_surname'], 'string', 'max' => 255],
            [['user_birthdate'], 'string', 'max' => 10],
            [['user_education', 'user_city'], 'string', 'max' => 256],
            [['user_about'], 'string', 'max' => 1024]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_id' => 'User ID',
            'user_name' => 'User Name',
            'user_surname' => 'User Surname',
            'user_birthdate' => 'User Birthdate',
            'user_education' => 'User Education',
            'user_city' => 'User City',
            'user_about' => 'User About',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }

    /**
     * @inheritdoc
     * @return UserInfoQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new UserInfoQuery(get_called_class());
    }
}


text:
package ru.otus.kushchenko.ms.message_system.message;

import ru.otus.kushchenko.ms.message_system.Address;
import ru.otus.kushchenko.ms.message_system.Message;
import ru.otus.kushchenko.ms.message_system.addressee.AddressedFrontendService;
import ru.otus.kushchenko.ms.message_system.addressee.Addressee;

public abstract class MsgToFrontend extends Message {

    public MsgToFrontend(Address from, Address to) {
        super(from, to);
    }

    @Override
    public void exec(Addressee addressee) {
        if (addressee instanceof AddressedFrontendService) {
            exec((AddressedFrontendService) addressee);
        } else {
            throw new RuntimeException("Incorrect Addressee");
        }
    }

    public abstract void exec(AddressedFrontendService frontendService);
}


text:
title: Em Rule
alias: Emily Rule
headshot: dR9qSmd
gender: female
submitted: false

---


text:
<?php include('header.php') ?>
<main class="main main--page">
    <section class="content">
        <?php include('content-page.php') ?>
    </section>

    <aside class="sidebar">
    </aside>
</main>
<?php include('footer.php') ?>


text:
{%- do adapter.get_relation(database=target.database, schema=target.schema, identifier='materialized') -%}

select * from {{ ref('materialized') }}


text:
package com.ayoview.sample.indicator;

import android.os.Bundle;
import android.view.View;

import com.cowthan.sample.BaseActivity;
import com.cowthan.sample.R;

import org.ayo.app.tmpl.indicator.flyco.RoundCornerIndicaor;

import java.util.ArrayList;

public class RoundCornerIndicaorActivity extends BaseActivity {
    private int[] resIds = {R.mipmap.item1, R.mipmap.item2,
            R.mipmap.item3, R.mipmap.item4};
    private ArrayList<Integer> resList;
    private View decorView;
    private SimpleImageBanner banner;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.indic_flyco_activity_rci);

        resList = new ArrayList<>();
        for (int i = 0; i < resIds.length; i++) {
            resList.add(resIds[i]);
        }

        decorView = getActivity().getWindow().getDecorView();
        banner = ViewFindUtils.find(decorView, R.id.banner_circle);
        banner.setSource(resList).startScroll();

        indicator(R.id.indicator_circle);
        indicator(R.id.indicator_square);
        indicator(R.id.indicator_round_rectangle);
        indicator(R.id.indicator_circle_stroke);
        indicator(R.id.indicator_square_stroke);
        indicator(R.id.indicator_round_rectangle_stroke);
    }

    private void indicator(int indicatorId) {
        final RoundCornerIndicaor indicator = ViewFindUtils.find(decorView, indicatorId);
        indicator.setViewPager(banner.getViewPager(), resList.size());
    }
}


text:
Is it up?
=========

A simple PHP script that checks if a website is up or down.

Inspired by http://downforeveryoneorjustme.com

To Install:
-----------

1. Copy the files to your webserver.

2. Edit settings.php.

3. Review the other files, and change to your preference.


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.Text;
using System;
using System.Collections.Generic;
using System.Text;

namespace Roslyn.Test.Utilities.Syntax
{
    internal sealed class RandomizedSourceText: SourceText
    {
        private char[] buffer = new char[2048];

        public RandomizedSourceText()
        {
            var random = new Random(12345);
            for (var i = 0; i < buffer.Length; i++)
            {
                buffer[i] = (char)random.Next();
            }
        }

        public override char this[int position] => buffer[position % buffer.Length];

        public override Encoding Encoding => Encoding.UTF8;

        public override int Length
        {
            get
            {
                return 40 * 1000 * 1000;
            }
        }

        public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
        {
            for (var i = 0; i < count; i++)
            {
                destination[destinationIndex + i] = this[sourceIndex + i];
            }
        }
    }
}


text:
package org.lwjgl.opengl;

public interface ARB_query_buffer_object {

	/**
	 * Accepted by the <pname> parameter of GetQueryObjectiv, GetQueryObjectuiv,
	 * GetQueryObjecti64v and GetQueryObjectui64v:
	 */
	int GL_QUERY_RESULT_NO_WAIT = 0x9194;

	/**
	 * Accepted by the <target> parameter of BindBuffer, BufferData,
	 * BufferSubData, MapBuffer, UnmapBuffer, MapBufferRange, GetBufferSubData,
	 * GetBufferParameteriv, GetBufferParameteri64v, GetBufferPointerv,
	 * ClearBufferSubData, and the <readtarget> and <writetarget> parameters of
	 * CopyBufferSubData:
	 */
	int GL_QUERY_BUFFER = 0x9192;

	/**
	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
	 * and GetDoublev:
	 */
	int GL_QUERY_BUFFER_BINDING = 0x9193;

	/** Accepted in the <barriers> bitfield in MemoryBarrier: */
	int GL_QUERY_BUFFER_BARRIER_BIT = 0x00008000;

}


text:
> Automatic desktop notifications for Grunt errors and warnings using Growl for OS X or Windows, Mountain Lion and Mavericks Notification Center, and Notify-Send.

### Getting Started

This plugin recommends Grunt `0.4.1` or newer.

### Installing

```bash
npm install grunt-notify --save-dev
```

Once that's done, add this line to your project's `Gruntfile.js`:

```js
grunt.loadNpmTasks('grunt-notify');
```

**That's all you need for automatic notifications.**

### Screenshots

##### OS X

| ![notification-center-jshint](https://f.cloud.github.com/assets/51505/982681/4e63bf88-0814-11e3-8b57-e2f5f4c2e1c1.png) ![notification-center-sidebar-jshint](https://f.cloud.github.com/assets/51505/982683/519b3bc2-0814-11e3-9b2b-1b07b4cf0466.png) |
|:-------------:|
| OS X Notification Center |

| ![growl-jshint](https://f.cloud.github.com/assets/51505/982676/43c372da-0814-11e3-89e5-0cb0f45f50e1.png) |
|:-------------:|
| Growl for Mac |

##### Windows

| ![growl-nodeunit](https://f.cloud.github.com/assets/51505/982679/4a199542-0814-11e3-93d9-5c46e2aed2d3.png) |
|:-------------:|
| Growl for Windows |

| ![snarl-nodeunit](https://f.cloud.github.com/assets/51505/982685/5419c058-0814-11e3-8976-54a811f21c92.png) |
|:-------------:|
| Snarl |

##### Linux

| ![notify-send - jshint](https://f.cloud.github.com/assets/51505/1030946/056631f4-0ecb-11e3-97cb-46e12c484f8b.png) |
|:-------------:|
| Notify-Send |

### Notify_Hooks Options

If you want change the automatic messaging configure a task called `notify_hooks`.

```js
grunt.initConfig({
  // This is optional!
  notify_hooks: {
    options: {
      enabled: true,
      max_jshint_notifications: 5, // maximum number of notifications from jshint output
      title: "Project Name" // defaults to the name in package.json, or will use project directory's name
    }
  }
});

// Load the task
grunt.loadNpmTasks('grunt-notify');

// This is required if you use any options.
grunt.task.run('notify_hooks');
```

### Showing Specific Notifications

Sometimes you want to show messages like "Uglify complete" or "Project Deployed" - that's easy to do too.

![growl-deploy](https://f.cloud.github.com/assets/51505/982678/48b6fa82-0814-11e3-890e-82518408084a.png)
![notification-center-deploy](https://f.cloud.github.com/assets/51505/982680/4b9df1ba-0814-11e3-88a4-0736f22dedf6.png)
![notify-send custom](https://f.cloud.github.com/assets/51505/1030945/038e46dc-0ecb-11e3-9915-80c1838624a8.png)

```js
grunt.initConfig({
  notify: {
    task_name: {
      options: {
        // Task-specific options go here.
      }
    },
    watch: {
      options: {
        title: 'Task Complete',  // optional
        message: 'SASS and Uglify finished running', //required
      }
    },
    server: {
      options: {
        message: 'Server is ready!'
      }
    }
  }
});

grunt.loadNpmTasks('grunt-notify');

// simplified example
grunt.registerTask('server', [
  'uglify',
  'sass',
  'server',
  'notify:server'
  ]);
```

#### Options
* `title` _optional_ Notification title
* `message` _required_ Notification message

### Tests

Run `grunt` to lint and run the tests.

### Notification Systems

#### Mac

#####  OS X Notification System

*Support Included.*

If you are using OS X 10.8 Mountain Lion or newer a notification system is built in, but Apple does not provide a
notification API that Node can access. Only code written in Objective C and signed in XCode can access it.
This is not very friendly for Node users so we are using the tiny signed MIT-licensed native application
[Terminal Notifier](https://github.com/alloy/terminal-notifier) from [Eloy Durán](https://github.com/alloy).
I've changed the default icon which is owned by Apple to the Grunt logo.

##### Growl for OS X

*Requires growlnotify for OS X.*

Install **growlnotify** from the [Growl Downloads Page](http://growl.info/downloads). This will install in `/usr/local/bin/growlnotify`.

#### Windows

##### Snarl

*Included with Snarl.*

If you have downloaded and installed Snarl from [Snarl's web site](http://snarl.fullphat.net/) you'll have the commandline tool heysnarl as well.

##### Growl for Windows

*Requires growlnotify for Windows.*

Install **growlnotify** from the [growlnotify Page](http://www.growlforwindows.com/gfw/help/growlnotify.aspx).

##### Windows 8.1 Notifications

*Not supported yet.*

Create a pull request!

#### Linux

##### Notify-Send

*No install needed in Ubuntu.*

I created an Ubuntu virutal machine and it had `notify-send` in the path.

I don't use Linux frequently so I don't know if this utility is available for other distros.

[notify-send man page](http://manpages.ubuntu.com/manpages/gutsy/man1/notify-send.1.html).

#### Chrome

*Not supported yet.*

Chrome has a notification system but I'm not sure if it's possible to use from a command-line Node app. Somebody could
probably create a Chrome Plugin helper for this.

#### Notifications aren't showing

Run `grunt -v` (for `verbose` mode) to show `grunt-notify` debug messages. It will tell you what notification system
 it thinks it can use. Create an issue and I'll look into it asap.

### About the Author

Dylan is a senior JavaScript developer and tech lead at [Opower](http://opower.com), co-creator of [Doodle or Die](http://doodleordie.com), and father of two awesome kids.

Here are some other Node modules Dylan has created:

| Name | Description | Github Stars | Npm Installs |
|---|---|--:|--:|
| [grunt-prompt]() | Add interactive console prompts to your Gruntfile such as lists, checkboxes, text input with filtering, and password fields. | 117 | 4,832 |
| [rss]() | RSS feed generator. A really simple API to add RSS feeds to any project. | 171 | 88,235 |
| [anthology]() | Module information and stats for any @npmjs user | _New!_ | _TBD_ |
| [shortid]() | Amazingly short non-sequential url-friendly unique id generator. | 123 | 20,441 |
| [xml]() | Fast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples. | 32 | 168,752 |
| [observatory]() | Beautiful UI for showing tasks running on the command line. | _New!_ | 74 |
| [grunt-attention]() | Display attention-grabbing messages in the terminal | _New!_ | 214 |
| [changelog]() | Command line tool (and Node module) that generates a changelog in color output, markdown, or json for modules in npmjs.org's registry as well as any public github.com repo. | 46 | 2,040 |
| [logging]() | Super sexy color console logging with cluster support. | 21 | 8,626 |
| [grunt-cat]() | Echo a file to the terminal. Works with text, figlets, ascii art, and full-color ansi. | _New!_ | 384 |

_Data collected on Sunday, January 5, 2014 using [anthology](https://github.com/dylang/anthology)._

### License
Copyright (c) 2014 Dylan Greene, contributors.
Released under the MIT license

***
_Generated by [grunt-readme](https://github.com/assemble/grunt-readme) using [grunt-templates-dylang](https://github.com/dylang/grunt-templates-dylang) on Sunday, January 5, 2014._

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dylang/grunt-notify/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![Google Analytics](https://ga-beacon.appspot.com/UA-4820261-3/dylang/grunt-notify)](https://github.com/igrigorik/ga-beacon)

[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html


text:
NCM\::Component\::FreeIPA\::Client
##################################

****
NAME
****

NCM::Component::FreeIPA::Client is a perl FreeIPA JSON API client
class for Quattor

Private methods
===============

- _initialize

 Handle the actual initializtion of new. Return 1 on success, undef otherwise.

 - log

  An ``CAF::Reporter`` instance that can be used for logging
  (it is converted in a logger appropriate for ``Net::FreeIPA``).

 All other arguments and options are passed to `Net::FreeIPA <http://search.cpan.org/search?query=Net%3a%3aFreeIPA&mode=module>`_
 during initialisation.


text:
module Honeybadger
  class ReadClient
    def initialize options={}
      unless @auth_token = options[:auth_token]
        raise ":auth_token required"
      end
    end

    def deploys project_id
      response = conn.get("/v1/projects/#{Integer(project_id)}/deploys", auth_token: @auth_token)
      response.body['results']
    end

    def conn
      Faraday.new(:url => 'https://api.honeybadger.io') do |conn|
        conn.response :mashify
        conn.response :json
        conn.adapter Faraday.default_adapter
      end
    end
  end
end


text:
package nl.igorski.mmg.definitions;

/**
 * Created with IntelliJ IDEA.
 * User: igorzinken
 * Date: 06-01-15
 * Time: 21:20
 * To change this template use File | Settings | File Templates.
 */
public final class MIDI
{
    // "tick" sizes translated to musical values

    public static long WHOLE_NOTE         = 1920;
    public static long HALF_NOTE          = WHOLE_NOTE / 2;
    public static long QUARTER_NOTE       = HALF_NOTE / 2;
    public static long EIGHT_NOTE         = QUARTER_NOTE / 2;
    public static long SIXTEENTH_NOTE     = EIGHT_NOTE / 2;
    public static long THIRTY_SECOND_NOTE = SIXTEENTH_NOTE / 2;
    public static long SIXTY_FOURTH_NOTE  = THIRTY_SECOND_NOTE / 2;
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package designpatterns.visitorpattern;

/**
 *
 * @author mars
 */
public interface Node {
    boolean accept(Visitor v);
    String getName();
}


text:
"""
  clim.py

  ROMS climatology utilities

  Written by Brian Powell on 08/15/15
  Copyright (c)2017 University of Hawaii under the MIT-License.
"""

import seapy
import numpy as np
import netCDF4

def gen_bry_clim(clim_file, grid, bry, clobber=False, cdl=None):
    """
    Taking the results of gen_ncks and interpolation, stitch together
    climatology files that were interpolated using only the boundary regions
    into a single climatology (with no data where interpolation wasn't
    performed).

    Parameters
    ----------
    clim_file: str,
        The name of the output climate file
    grid: seapy.model.grid or str,
        The output ROMS grid
    bry: dict,
        A dictionary prescribing the climatology file interpolated for each
        boundary side.
        {"west":filename, "south":filename}, ...}
    clobber: bool, optional
        If True, clobber any existing files and recreate. If False, use
        the existing file definition
    cdl: string, optional,
        Use the specified CDL file as the definition for the new
        netCDF file.

    Returns
    -------
        None
    """
    grid = seapy.model.asgrid(grid)

    # Grab the first dictionary record and use it to determine the number
    # of times in the new climatology file
    nc = netCDF4.Dataset(bry[list(bry.keys())[0]])
    reftime, time = seapy.roms.get_reftime(nc)
    times = nc.variables[time][:]
    nc.close()

    # Create the new climatology file
    ncout = seapy.roms.ncgen.create_clim(clim_file,
                                         eta_rho=grid.ln, xi_rho=grid.lm, s_rho=grid.n,
                                         reftime=reftime, clobber=clobber, cdl=cdl,
                                         title="stitched from boundary interpolation")
    ncout.variables["clim_time"][:] = times

    for side in bry:
        if bry[side] is None:
            continue
        ncin = netCDF4.Dataset(bry[side])
        for fld in seapy.roms.fields:
            idx = [np.s_[:] for i in range(seapy.roms.fields[fld]["dims"] + 1)]
            dat = ncin.variables[fld][:]
            shp = dat.shape
            if side == "west":
                idx[-1] = np.s_[:shp[-1]]
                pass
            elif side == "east":
                idx[-1] = np.s_[-shp[-1]:]
                pass
            elif side == "north":
                idx[-2] = np.s_[-shp[-2]:]
                pass
            elif side == "south":
                idx[-2] = np.s_[:shp[-2]]
                pass
            ncout.variables[fld][idx] = dat
            ncout.sync()
        ncin.close()
    ncout.close()


text:
{% extends "home/base.html" %}
{% load staticfiles %}

{% block content %}

        Single structure

        Single set of structures

        Two sets of structures

                        <input type="hidden" class="interactions-input" value="[]" />

                        <input class="crystal-pdb" type="hidden" value="["2RH1"]">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#single-crystal-pdb-modal-table">Select Structure</button> No structure selected.

Go

Controls

Select plot

Select plot

Select plot

Matrix

Flareplot

Hiveplot

2D Schematic (Con)

2D Schematic (Non)

Interactions

                                <svg class="heatmap" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin" id="heatmap_single"></svg>

Flareplot

Hiveplot

2D schematic

2D schematic Non

3D view (NGL)

Contact position pairs

Contact position-AA pairs

Residue helix types, bulges, and constrictions

Residue backbone & sidechain movement

Contact position pairs

Contact position-AA pairs

Residue helix types, bulges, and constrictions

Residue backbone & sidechain movement

                        <input class="crystal-pdb" type="hidden" value="["5XRA","5WB1","5G53","3SN6","5T04","6G79","5C1M","5XSZ","4MQT","5UNG","5ZKP","5TUD","6B73","6AK3","5DYS","6D9H","4XT1","6H7N","4ZWJ"]">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#single-crystal-group-pdbs-modal-table">Select Structures</button>
                        No structure(s) selected.

Go

                        <input type="hidden" class="interactions-input" value="[]" />
                        Interactions Types:

                            <button type="button" class="btn btn-primary all-button">All</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="ionic">Ionic</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="polar">Polar</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="aromatic">Arom.</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="hydrophobic">Hydro.</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="van-der-waals">VDW</button>

Select plot

Select plot

Select plot

Matrix

Flareplot

2D Schematic (Con)

2D Schematic (Non)

Interactions

                                <svg class="heatmap" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin" id="heatmap_single_group"></svg>

Flareplot

2D schematic

2D schematic Non

3D view (NGL)

Contact position pairs

Contact position-AA pairs

Contact hub positions

Residue helix types, bulges, and constrictions

Residue backbone & sidechain movement

Contact position pairs

Contact position-AA pairs

Residue helix types, bulges, and constrictions

Residue backbone & sidechain movement

                        <input class="crystal-group-1-pdbs" type="hidden" value="["5XRA","5WB1","5G53","3SN6","5T04","6G79","5C1M","5XSZ","4MQT","5UNG","5TUD","6B73","6AK3","5DYS","6D9H","4XT1","6H7N","4ZWJ"]">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#two-crystal-group-pdbs-modal-1-table">Select (Set 1)</button> None selected.

                        <input class="crystal-group-2-pdbs" type="hidden" value="["4N6H","5CXV","5DSG","5TGZ","5X93","5WS3","5JQH","5X33","6BQH","5ZBH","6HLP","6CM4","6IIV","4DJH","3RZE","5DHG","5ZKC","5T1A","4U15","2Z73","5YWY","5UEN","4Z35","3ODU","5O9H","5LWE","3PBL","5VBL","5WIV","1GZM","4ZUD","4ZJ8","4BUO","4EJ4","5UIW","3V2Y","3VG9","4DKL","4AMJ"]">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#two-crystal-group-pdbs-modal-2-table">Select (Set 2)</button> None selected.

Go

                        <input type="hidden" class="interactions-input" value="[]" />
                        Interactions Types:

                            <button type="button" class="btn btn-primary all-button">All</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="ionic">Ionic</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="polar">Polar</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="aromatic">Arom.</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="hydrophobic">Hydro.</button>
                            <button type="button" class="btn btn-primary" data-interaction-type="van-der-waals">VDW</button>

Select plot

Select plot

Select plot

Matrix

Flareplot

2D Schematic (Con)

2D Schematic (Non)

Interactions

                                <svg class="heatmap" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin" id="heatmap_groups"></svg>

Flareplot

2D schematic

2D schematic Non

3D view (NGL)

Contact position pairs

Contact position-AA pairs

Contact residue micro-switches

Residue backbone & sidechain movement

Residue helix types, bulges, and constrictions

Contact position pairs

Contact position-AA pairs

Contact residue micro-switches

Residue helix types, bulges, and constrictions

Residue backbone & sidechain movement

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

Select a structure

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

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

Select a set of structures

                        0 structure(s) selected
                        <button type="button" onclick="resetselection(false, true);" class="btn btn-xs btn-primary reset-selection">Reset selection</button>

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

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

Select a set of structures

                    0 structure(s) selected
                    <button type="button" onclick="resetselection(false, true);" class="btn btn-xs btn-primary reset-selection">Reset selection</button>

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

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

Select a set of structures

                    0 structure(s) selected
                    <button type="button" onclick="resetselection(false, true);" class="btn btn-xs btn-primary reset-selection">Reset selection</button>

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

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

Modal Header

Some text in the modal.

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

{% endblock %}
{% block addon_js %}

{% endblock %}
{% block addon_css %}
    <link rel="stylesheet" href="{% static 'home/css/jquery.dataTables.min.css' %}" type="text/css" />
    <link rel="stylesheet" href="{% static 'home/css/yadcf_bootstrap_version.css' %}" type="text/css" />
    <link rel="stylesheet" href="{% static 'home/css/select2.css' %}" type="text/css" />

    <link href="{% static 'home/css/flareplot-contactbrowser.css' %}" rel="stylesheet">
    <link href="{% static 'home/css/flareplot-selectors.css' %}" rel="stylesheet">
    <link href="{% static 'home/css/flareplot-rangeslider.css' %}" rel="stylesheet">

{% endblock %}


text:
try:
    from django.conf.urls.defaults import patterns, url, include
except ImportError:  # django 1.6 and above
    from django.conf.urls import patterns, url, include
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^exports/', include('data_exports.urls', namespace='data_exports')),
)


text:
Import-Module -Name $CI_MODULE_MANIFEST_PATH -Force

$systemUnderTest = ( Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '\.Tests\.', '.'

$function = $systemUnderTest.Split( '.' )[0]
$describe = $Global:FORM_FUNCTION_PUBLIC -f $function
Describe -Name $describe -Tag 'Function', 'Public', $function -Fixture {
    #region init
    $help = Get-Help -Name $function -Full

    $Global:ArmorSession = [ArmorSession]::New()
    $Global:ArmorSession.Accounts += [ArmorAccount] @{
        ID       = 1
        Name     = 'Armor Defense, Inc.'
        Currency = 'USD'
        Status   = 'Claimed'
        Parent   = -1
        Products = @()
    }
    $Global:ArmorSession.Accounts += [ArmorAccount] @{
        ID       = 2
        Name     = 'Old Armor QA Account, Ltd'
        Currency = 'GBP'
        Status   = 'Cancelled'
        Parent   = 1
        Products = @()
    }
    #endregion

    $splat = @{
        ExpectedFunctionName = $function
        FoundFunctionName    = $help.Name
    }
    Test-AdvancedFunctionName @splat

    Test-AdvancedFunctionHelpMain -Help $help

    Test-AdvancedFunctionHelpInput -Help $help

    $splat = @{
        ExpectedOutputTypeNames = 'ArmorAccount'
        Help                    = $help
    }
    Test-AdvancedFunctionHelpOutput @splat

    $splat = @{
        ExpectedParameterNames = @()
        Help                   = $help
    }
    Test-AdvancedFunctionHelpParameter @splat

    $splat = @{
        ExpectedNotes = $Global:FORM_FUNCTION_HELP_NOTES
        Help          = $help
    }
    Test-AdvancedFunctionHelpNote @splat

    Context -Name $Global:EXECUTION -Fixture {
        #region init
        $invalidID = 0
        #endregion

        $testCases = @(
            @{ ID = $invalidID }
        )
        $testName = 'should fail when set to: ID: <ID>'
        It -Name $testName -TestCases $testCases -Test {
            param ( [String] $ID )
            { Get-ArmorAccountContext -ID $ID } |
                Should -Throw
        }

        $testCases = @(
            @{ ID = $Global:ArmorSession.Accounts[0].ID },
            @{ ID = $Global:ArmorSession.Accounts[1].ID }
        )
        $testName = 'should not fail when set to: ID: <ID>'
        It -Name $testName -TestCases $testCases -Test {
            param ( [String] $ID )
            $Global:ArmorSession.SetAccountContext( $ID )
            ( Get-ArmorAccountContext ).ID |
                Should -Be $ID
        }
    }

    Context -Name $Global:RETURN_TYPE_CONTEXT -Fixture {
        $testCases = @(
            @{
                FoundReturnType    = ( Get-ArmorAccountContext -ErrorAction 'Stop' ).GetType().FullName
                ExpectedReturnType = 'ArmorAccount'
            }
        )
        $testName = $Global:FORM_RETURN_TYPE
        It -Name $testName -TestCases $testCases -Test {
            param ( [String] $FoundReturnType, [String] $ExpectedReturnType )
            $FoundReturnType |
                Should -Be $ExpectedReturnType
        }

        $testName = "has an 'OutputType' entry for <FoundReturnType>"
        It -Name $testName -TestCases $testCases -Test {
            param ( [String] $FoundReturnType, [String] $ExpectedReturnType )
            $FoundReturnType |
                Should -BeIn ( Get-Help -Name 'Get-ArmorAccountContext' -Full ).ReturnValues.ReturnValue.Type.Name
        }
    }
}


text:
Can be used inside your own `@mixin button();` and other elements that should behave like a button. No styling is provided.

#### Arguments

| Name | Type | Default |
| ---- | ---- | ------- |
| `appearance` | `string` | `none` |
| `display` | `string` | `inline-block` |
| `vertical-align` | `string` |
| `cursor` | `string` | `pointer` |

#### SCSS

{% highlight css %}
.foo {
  @include button-structure;
}
{% endhighlight %}

#### CSS

{% highlight css %}
.foo {
  -webkit-appearance: none;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
}
{% endhighlight %}


text:
package org.camunda.bpm.engine.impl.cmd;

import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull;

import java.util.Map;

import org.camunda.bpm.engine.impl.cfg.CommandChecker;
import org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.PropertyChange;
import org.camunda.bpm.engine.impl.persistence.entity.TaskEntity;

/**
 * @author Tom Baeyens
 * @author Joram Barrez
 */
public class SetTaskVariablesCmd extends AbstractSetVariableCmd {

  private static final long serialVersionUID = 1L;

  public SetTaskVariablesCmd(String taskId, Map<String, ? extends Object> variables, boolean isLocal) {
    super(taskId, variables, isLocal);
  }

  protected TaskEntity getEntity() {
    ensureNotNull("taskId", entityId);

    TaskEntity task =  commandContext
      .getTaskManager()
      .findTaskById(entityId);

    ensureNotNull("task " + entityId + " doesn't exist", "task", task);

    checkSetTaskVariables(task);

    return task;
  }

  @Override
  protected ExecutionEntity getContextExecution() {
    return getEntity().getExecution();
  }

  protected void logVariableOperation(AbstractVariableScope scope) {
    TaskEntity task = (TaskEntity) scope;
    commandContext.getOperationLogManager().logVariableOperation(getLogEntryOperation(), null, task.getId(),
      PropertyChange.EMPTY_CHANGE);
  }

  protected void checkSetTaskVariables(TaskEntity task) {
    for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
      checker.checkUpdateTaskVariable(task);
    }
  }
}


text:
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;

namespace System.Linq
{
    public static class EnumerableExtensions
    {
        public static bool SafeSequenceEqual<T>(this IEnumerable<T> first, IEnumerable<T> second)
        {
            return SafeSequenceEqual(first, second, null);
        }

        public static bool SafeSequenceEqual<T>(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer)
        {
            var isEqual = false;

            if (first == null && second == null)
            {
                isEqual = true;
            }
            else if (first != null && second != null)
            {
                if (first.SequenceEqual(second, comparer))
                {
                    isEqual = true;
                }
            }

            return isEqual;
        }

        /// <summary>
        /// Determines whether two sequences contain the same items. Null-safe comparison.
        /// </summary>
        /// <param name="first">An IEnumerable<T> to compare to second</param>
        /// <param name="second">An IEnumerable<T> to compare to the first sequence.</param>
        /// <typeparam name="T">The type of the elements of the input sequences.</typeparam>
        /// <returns>true if the two source sequences are of equal length and contain equal elements, default equality comparer for their type; otherwise, false.</returns>
        public static bool SequenceEqualUnordered<T>(this IEnumerable<T> first, IEnumerable<T> second)
        {
            return SequenceEqualUnordered(first, second, null);
        }

        /// <summary>
        /// Determines whether two sequences contain the same items. Null-safe comparison.
        /// </summary>
        /// <param name="first">An IEnumerable<T> to compare to second</param>
        /// <param name="second">An IEnumerable<T> to compare to the first sequence.</param>
        /// <typeparam name="T">The type of the elements of the input sequences.</typeparam>
        /// <returns>true if the two source sequences are of equal length and contain equal elements, default equality comparer for their type; otherwise, false.</returns>
        public static bool SequenceEqualUnordered<T>(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer)
        {
            if (first == null) return second == null;
            if (second == null) return false;

            return first.Count() == second.Count()
                && (!first.Except(second, comparer).Any() || !second.Except(first, comparer).Any());
        }

        /// <summary>
        /// Adds an item to a list if it doesn't already contain the item.
        /// </summary>
        /// <typeparam name="T">The type of the items in the list</typeparam>
        /// <param name="list">The list to modify</param>
        /// <param name="value">The item to be added to the list.</param>
        public static void Fill<T>(this IList<T> list, T value)
        {
            if (list.Contains(value)) return;

            list.Add(value);
        }

        /// <summary>
        /// Adds items to a list if the list doesn't already contain the item.
        /// </summary>
        /// <typeparam name="T">The type of the items in the list</typeparam>
        /// <param name="list">The list to modify</param>
        /// <param name="values">The items to be added to the list.</param>
        public static void Fill<T>(this IList<T> list, IEnumerable<T> values)
        {
            list.AddRange(values.Except(list));
        }

        /// <summary>
        /// Removes all of the items that match the provided condition
        /// </summary>
        /// <typeparam name="T">The type of the items in the list</typeparam>
        /// <param name="list">The list to modify</param>
        /// <param name="whereEvaluator">The test to determine if an item should be removed</param>
        public static void RemoveAll<T>(this IList<T> list, Func<T, bool> whereEvaluator)
        {
            for (int i = list.Count - 1; i >= 0; i--)
            {
                if (whereEvaluator(list[i]))
                {
                    list.RemoveAt(i);
                }
            }
        }

        /// <summary>
        /// Concatenates a string between each item in a list of strings
        /// </summary>
        /// <param name="values">The array of strings to join</param>
        /// <param name="separator">The value to concatenate between items</param>
        /// <returns></returns>
        public static string Join(this string[] values, string separator)
        {
            return string.Join(separator, values);
        }

        /// <summary>
        /// Concatenates a string between each item in a sequence of strings
        /// </summary>
        /// <param name="values"></param>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static string Join(this IEnumerable<string> values, string separator)
        {
            return Join(values.ToArray(), separator);
        }

        /// <summary>
        /// Performs an action with a counter for each item in a sequence and provides
        /// </summary>
        /// <typeparam name="T">The type of the items in the sequence</typeparam>
        /// <param name="values">The sequence to iterate</param>
        /// <param name="eachAction">The action to performa on each item</param>
        /// <returns></returns>
        public static IEnumerable<T> Each<T>(this IEnumerable<T> values, Action<T, int> eachAction)
        {
            int index = 0;
            foreach (T item in values)
            {
                eachAction(item, index++);
            }

            return values;
        }

        public static IEnumerable<T> Each<T>(this IEnumerable<T> values, Action<T> eachAction)
        {
            foreach (T item in values)
            {
                eachAction(item);
            }

            return values;
        }

        public static IEnumerable Each(this IEnumerable values, Action<object> eachAction)
        {
            foreach (object item in values)
            {
                eachAction(item);
            }

            return values;
        }

        public static bool IsEqualTo<T>(this IEnumerable<T> actual, IEnumerable<T> expected)
        {
            var actualList = actual.ToArray();
            var expectedList = expected.ToArray();

            if (actualList.Length != expectedList.Length)
            {
                return false;
            }

            for (int i = 0; i < actualList.Length; ++i)
            {
                if (!actualList[i].Equals(expectedList[i]))
                {
                    return false;
                }
            }

            return true;
        }

        public static IList<T> AddMany<T>(this IList<T> list, params T[] items)
        {
            return list.AddRange(items);
        }

        /// <summary>
        /// Appends a sequence of items to an existing list
        /// </summary>
        /// <typeparam name="T">The type of the items in the list</typeparam>
        /// <param name="list">The list to modify</param>
        /// <param name="items">The sequence of items to add to the list</param>
        /// <returns></returns>
        public static IList<T> AddRange<T>(this IList<T> list, IEnumerable<T> items)
        {
            items.Each(list.Add);
            return list;
        }

        public static IEnumerable<T> UnionWith<T>(this IEnumerable<T> first, params T[] second)
        {
            return first.Union(second);
        }

        public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> enumerable)
        {
            return enumerable ?? Enumerable.Empty<T>();
        }

        public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
        {
            return enumerable == null || !enumerable.Any();
        }

        /// <summary>
        /// Converts a sequence of items to a dictionary without regard to duplicates.
        /// </summary>
        /// <param name="enumerable">The sequence of items.</param>
        /// <param name="keySelector">Function to select the key</param>
        /// <returns>The Dictionary</returns>
        public static Dictionary<TKey, T> SafeToDictionary<TKey, T>(this IEnumerable<T> items, Func<T, TKey> keySelector)
        {
            var dict = new Dictionary<TKey, T>();

            if (items == null)
            {
                return dict;
            }

            foreach (var itm in items)
            {
                dict[keySelector(itm)] = itm;
            }

            return dict;
        }

        /// <summary>
        /// Converts a sequence of items to a dictionary without regard to duplicates.
        /// </summary>
        /// <param name="enumerable">The sequence of items.</param>
        /// <param name="keySelector">Function to select the key</param>
        /// <param name="valueSelector">Function to select the value</param>
        /// <returns>The Dictionary</returns>
        public static Dictionary<TKey, TValue> SafeToDictionary<TKey, TValue, T>(this IEnumerable<T> items, Func<T, TKey> keySelector, Func<T, TValue> valueSelector)
        {
            var dict = new Dictionary<TKey, TValue>();

            if (items == null)
            {
                return dict;
            }

            foreach (var itm in items)
            {
                dict[keySelector(itm)] = valueSelector(itm);
            }

            return dict;
        }

        public static IEnumerable<string> Trim(this IList<string> list)
        {
            int start = 0, end = list.Count - 1;
            while (start < end && string.IsNullOrWhiteSpace(list[start])) start++;
            while (end >= start && string.IsNullOrWhiteSpace(list[end])) end--;
            return list.Skip(start).Take(end - start + 1);
        }

        public static void Shuffle<T>(this IList<T> list)
        {
            var provider = RandomNumberGenerator.Create();
            var n = list.Count;

            while (n > 1)
            {
                var box = new byte[1];
                do provider.GetBytes(box);
                while (!(box[0] < n * (Byte.MaxValue / n)));
                var k = (box[0] % n);
                n--;
                T value = list[k];
                list[k] = list[n];
                list[n] = value;
            }
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Zephir\Console\Command;

use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Zephir\Compiler;
use Zephir\Config;

use function in_array;

/**
 * Generates an HTML API based on the classes exposed in the extension.
 */
final class ApiCommand extends AbstractCommand
{
    use ZflagsAwareTrait;

    private Compiler $compiler;
    private Config $config;

    public function __construct(Compiler $compiler, Config $config)
    {
        $this->compiler = $compiler;
        $this->config = $config;

        parent::__construct();
    }

    protected function configure()
    {
        $this
            ->setName('api')
            ->setDescription('Generates a HTML API based on the classes exposed in the extension')
            ->setDefinition($this->createDefinition())
            ->setHelp(sprintf('%s.', $this->getDescription()).PHP_EOL.PHP_EOL.$this->getZflagsHelp());
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $options = array_merge(
            $this->getDefaultOptions(),
            $this->sanitizeOptionsFromInput($input)
        );

        // TODO: Move all the stuff from the compiler
        $this->compiler->api($options);

        return 0;
    }

    protected function getDefaultOptions(): array
    {
        return [
            'path' => null,
            'output' => $this->config->get('path', 'api'),
            'options' => null,
            'url' => $this->config->get('base-url', 'api'),
        ];
    }

    protected function sanitizeOptionsFromInput(InputInterface $input): array
    {
        $defaults = $this->getDefaultOptions();

        $options = array_filter($input->getOptions(), function ($v, $k) use ($defaults) {
            $allowedOpts = array_keys($defaults);

            return in_array($k, $allowedOpts, true) && null !== $v;
        }, ARRAY_FILTER_USE_BOTH);

        foreach ($options as $option => $value) {
            // Prevent "" values
            if (empty($value) || !preg_match('/.+/', $value)) {
                throw new InvalidArgumentException(
                    sprintf('The "--%s" option requires a value.', $option)
                );
            }
        }

        return $options;
    }

    protected function createDefinition(): InputDefinition
    {
        return new InputDefinition(
            [
                new InputOption(
                    'backend',
                    null,
                    InputOption::VALUE_REQUIRED,
                    'Used backend to generate HTML API for the extension',
                    'ZendEngine3'
                ),
                new InputOption(
                    'path',
                    'p',
                    InputOption::VALUE_REQUIRED,
                    'The API theme to be used'
                ),
                new InputOption(
                    'output',
                    'o',
                    InputOption::VALUE_REQUIRED,
                    'Output directory to generate theme'
                ),
                new InputOption(
                    'options',
                    null,
                    InputOption::VALUE_REQUIRED,
                    'Theme options'
                ),
                new InputOption(
                    'url',
                    null,
                    InputOption::VALUE_REQUIRED,
                    'The base URL to be used when generating links'
                ),
            ]
        );
    }
}


text:
<!doctype html>

    <meta charset="UTF-8">

    <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

    <title>Recommendation Engine</title>


text:
package jsky.image.gui;

import java.awt.*;
import javax.swing.*;

import jsky.util.Preferences;

/**
 * Provides a top level window for an ImageProperties panel.
 *
 * @version $Revision: 4414 $
 * @author Allan Brighton
 */
public class ImagePropertiesInternalFrame extends JInternalFrame {

    private ImageProperties imageProperties;

    /**
     * Create a top level window containing an ImageProperties panel.
     */
    public ImagePropertiesInternalFrame(MainImageDisplay imageDisplay) {
        super("Image Properties", true, false, true, true);
        imageProperties = new ImageProperties(this, imageDisplay);
        getContentPane().add(imageProperties, BorderLayout.CENTER);
        pack();
        setClosable(true);
        setIconifiable(false);
        setMaximizable(false);
        setDefaultCloseOperation(HIDE_ON_CLOSE);
        Preferences.manageSize(imageProperties, new Dimension(400, 400));
        Preferences.manageLocation(this);
        setVisible(true);
    }

    /**
     * Update the display from the current image
     */
    public void updateDisplay() {
        imageProperties.updateDisplay();
    }

    /** Return the internal panel object */
    public ImageProperties getImageProperties() {
        return imageProperties;
    }
}


text:
package mql

import (
	"encoding/json"
	"fmt"
	"sort"

	"golang.org/x/net/context"

	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/graph/iterator"
	"github.com/cayleygraph/cayley/query"
)

const Name = "mql"

func init() {
	query.RegisterLanguage(query.Language{
		Name: Name,
		Session: func(qs graph.QuadStore) query.Session {
			return NewSession(qs)
		},
		HTTP: func(qs graph.QuadStore) query.HTTP {
			return NewSession(qs)
		},
		REPL: func(qs graph.QuadStore) query.REPLSession {
			return NewSession(qs)
		},
	})
}

type Session struct {
	qs    graph.QuadStore
	query *Query
}

func NewSession(qs graph.QuadStore) *Session {
	return &Session{qs: qs}
}

func (s *Session) ShapeOf(query string) (interface{}, error) {
	var mqlQuery interface{}
	err := json.Unmarshal([]byte(query), &mqlQuery)
	if err != nil {
		return nil, err
	}
	s.query = NewQuery(s)
	s.query.BuildIteratorTree(mqlQuery)
	output := make(map[string]interface{})
	iterator.OutputQueryShapeForIterator(s.query.it, s.qs, output)
	nodes := make([]iterator.Node, 0)
	for _, n := range output["nodes"].([]iterator.Node) {
		n.Tags = nil
		nodes = append(nodes, n)
	}
	output["nodes"] = nodes
	return output, nil
}

func (s *Session) Execute(ctx context.Context, input string, c chan query.Result, limit int) {
	defer close(c)
	var mqlQuery interface{}
	if err := json.Unmarshal([]byte(input), &mqlQuery); err != nil {
		select {
		case c <- query.ErrorResult(err):
		case <-ctx.Done():
		}
		return
	}
	s.query = NewQuery(s)
	s.query.BuildIteratorTree(mqlQuery)
	if s.query.isError() {
		select {
		case c <- query.ErrorResult(s.query.err):
		case <-ctx.Done():
		}
		return
	}

	it := s.query.it
	err := graph.Iterate(ctx, it).Limit(limit).TagEach(func(tags map[string]graph.Value) {
		select {
		case c <- query.TagMapResult(tags):
		case <-ctx.Done():
		}
	})
	if err != nil {
		select {
		case c <- query.ErrorResult(err):
		case <-ctx.Done():
		}
	}
}

func (s *Session) FormatREPL(result query.Result) string {
	tags, ok := result.Result().(map[string]graph.Value)
	if !ok {
		return ""
	}
	out := fmt.Sprintln("****")
	tagKeys := make([]string, len(tags))
	s.query.treeifyResult(tags)
	s.query.buildResults()
	r, _ := json.MarshalIndent(s.query.results, "", " ")
	fmt.Println(string(r))
	i := 0
	for k := range tags {
		tagKeys[i] = string(k)
		i++
	}
	sort.Strings(tagKeys)
	for _, k := range tagKeys {
		if k == "$_" {
			continue
		}
		out += fmt.Sprintf("%s : %s\n", k, s.qs.NameOf(tags[k]))
	}
	return out
}

func (s *Session) Collate(result query.Result) {
	res, ok := result.Result().(map[string]graph.Value)
	if !ok {
		return
	}
	s.query.treeifyResult(res)
}

func (s *Session) Results() (interface{}, error) {
	s.query.buildResults()
	if s.query.isError() {
		return nil, s.query.err
	}
	return s.query.results, nil
}

func (s *Session) Clear() {
	// Since we create a new Query underneath every query, clearing isn't necessary.
	return
}


text:
import {
  OperationNotPermittedError,
  ApplicationError,
  PermissionError,
} from "../";
import shouldInheritFromErrors from "./util/shouldInheritFromErrors";

describe(
  "OperationNotPermittedError",
  () => shouldInheritFromErrors({
    error: new OperationNotPermittedError(),
    errorClasses: [
      ApplicationError,
      PermissionError,
    ],
  }),
);


text:
#ifndef OM_HGUARD_INMEMORY_POSITIONLIST_H
#define OM_HGUARD_INMEMORY_POSITIONLIST_H

#include <xapian/types.h>
#include <xapian/error.h>

#include <vector>
#include "positionlist.h"
#include "documentterm.h"

using namespace std;

/** A position list in a inmemory database. */
class InMemoryPositionList : public PositionList
{
    private:
	/// The list of positions.
	vector<Xapian::termpos> positions;

	/// Position of iteration through positions
	vector<Xapian::termpos>::const_iterator mypos;

	/// True if we have started iterating
	bool iterating_in_progress;

	/// Copying is not allowed.
	InMemoryPositionList(const InMemoryPositionList &);

	/// Assignment is not allowed.
	void operator=(const InMemoryPositionList &);

    public:
	/// Default constructor.
	InMemoryPositionList() : iterating_in_progress(false) { }

	/// Construct an empty InMemoryPositionList.
	InMemoryPositionList(bool)
	    : mypos(positions.begin()), iterating_in_progress(false) { }

	/// Construct, fill list with data, and move the position to the start.
	InMemoryPositionList(const OmDocumentTerm::term_positions & positions_);

	/// Fill list with data, and move the position to the start.
	void set_data(const OmDocumentTerm::term_positions & positions_);

	/// Gets size of position list.
	Xapian::termcount get_size() const;

	/// Gets current position.
	Xapian::termpos get_position() const;

	/** Move to the next item in the list.
	 *  Either next() or skip_to() must be called before any other
	 *  methods.
	 */
	void next();

	/** Move to the next item in the list.
	 *  Either next() or skip_to() must be called before any other
	 *  methods.
	 */
	void skip_to(Xapian::termpos termpos);

	/// True if we're off the end of the list
	bool at_end() const;
};

#endif /* OM_HGUARD_INMEMORY_POSITIONLIST_H */


text:
namespace Mighty
{
	class Card;

	class LIBMIGHTY_API AbstractRole
	{
	protected:
		AbstractRole();

	public:
		virtual ~AbstractRole();

		void SetCard(std::shared_ptr<Card> card);

		CardRole GetRoleType() const;

	protected:
		CardRole roleType;
		std::shared_ptr<Card> card;

		void SetRole(CardRole roleType);
	};

	template <class ChildClass>
	class CRTPRole : public AbstractRole
	{
	protected:
		CRTPRole()
		{
			SetRole(Mighty::GetRoleType<ChildClass>());
		}

		virtual ~CRTPRole()
		{
		}
	};
}


text:
/**
 *
 * This llow traversal logger from procesous-threads
 * 	 * this allow to create a thread a logger for a thread. Also allow the logger to be shared beteen child
 * treads, By Ex. creationg a thread pool to acompliseh the task, the logger can be used by the child threads.
 *   * see also AbstractManager.setThreadlocal.
 *
 * @since
 */
package eu.ginere.base.util.log;


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.IoT.TimeSeriesInsights
{
    /// <summary>
    /// This class definition overrides serialization implementation in order to turn a raw response
    /// from Time Series Insights into a TypesBatchResponse object.
    /// </summary>
    [CodeGenModel("TypesBatchResponse")]
    public partial class TypesBatchResponse
    {
        // The purpose of overriding this method is to protect against an InvalidOperationException
        // that is being thrown by the generated code. More specifically, the exception is being thrown
        // when trying to deserialize the "delete" property. A coversation has started with the Time Series
        // Insights team on take a closer look on the thrown exception.

        internal static TypesBatchResponse DeserializeTypesBatchResponse(JsonElement element)
        {
            Optional<IReadOnlyList<TimeSeriesTypeOperationResult>> @get = default;
            Optional<IReadOnlyList<TimeSeriesTypeOperationResult>> put = default;
            Optional<IReadOnlyList<TimeSeriesOperationError>> delete = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("get"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<TimeSeriesTypeOperationResult> array = new List<TimeSeriesTypeOperationResult>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TimeSeriesTypeOperationResult.DeserializeTimeSeriesTypeOperationResult(item));
                    }
                    @get = array;
                    continue;
                }
                if (property.NameEquals("put"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<TimeSeriesTypeOperationResult> array = new List<TimeSeriesTypeOperationResult>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TimeSeriesTypeOperationResult.DeserializeTimeSeriesTypeOperationResult(item));
                    }
                    put = array;
                    continue;
                }
                if (property.NameEquals("delete"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<TimeSeriesOperationError> array = new List<TimeSeriesOperationError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.ValueKind != JsonValueKind.Null ? TimeSeriesOperationError.DeserializeTimeSeriesOperationError(item) : null);
                    }
                    delete = array;
                    continue;
                }
            }
            return new TypesBatchResponse(Optional.ToList(@get), Optional.ToList(put), Optional.ToList(delete));
        }
    }
}


text:
<?php

/**
 * AssetHelper.
 *
 * @package    symfony
 * @subpackage helper
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @author     David Heinemeier Hansson
 * @version    SVN: $Id$
 */

/**
 * Returns a <link> tag that browsers and news readers
 * can use to auto-detect a RSS or ATOM feed for the current page,
 * to be included in the  section of a HTML document.
 *
 * Options:
 * - rel - defaults to 'alternate'
 * - type - defaults to 'application/rss+xml'
 * - title - defaults to the feed type in upper case
 *
 * Examples:
 *
 *  echo auto_discovery_link_tag('rss', 'module/feed');
 *    => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/module/feed" />
 *  echo auto_discovery_link_tag('rss', 'module/feed', array('title' => 'My RSS'));
 *    => <link rel="alternate" type="application/rss+xml" title="My RSS" href="http://www.curenthost.com/module/feed" />
 *
 *
 * @param  string feed type ('rss', 'atom')
 * @param  string 'module/action' or '@rule' of the feed
 * @param  array additional HTML compliant <link> tag parameters
 * @return string XHTML compliant <link> tag
 */
function auto_discovery_link_tag($type = 'rss', $url_options = array(), $tag_options = array())
{
  return tag('link', array(
    'rel'   => isset($tag_options['rel']) ? $tag_options['rel'] : 'alternate',
    'type'  => isset($tag_options['type']) ? $tag_options['type'] : 'application/'.$type.'+xml',
    'title' => isset($tag_options['title']) ? $tag_options['title'] : ucfirst($type),
    'href'  => url_for($url_options, true)
  ));
}

/**
 * Returns the path to a JavaScript asset.
 *
 * Example:
 *
 *  echo javascript_path('myscript');
 *    => /js/myscript.js
 *
 *
 * Note: The asset name can be supplied as a...
 * - full path, like "/my_js/myscript.css"
 * - file name, like "myscript.js", that gets expanded to "/js/myscript.js"
 * - file name without extension, like "myscript", that gets expanded to "/js/myscript.js"
 *
 * @param  string asset name
 * @param  bool return absolute path ?
 * @return string file path to the JavaScript file
 * @see    javascript_include_tag
 */
function javascript_path($source, $absolute = false)
{
  return _compute_public_path($source, 'js', 'js', $absolute);
}

/**
 * Returns a
 *  echo javascript_include_tag('common.javascript', '/elsewhere/cools');
 *    =>
 *
 *
 *
 * @param  string asset names
 * @return string XHTML compliant


text:
package v1

import (
	"k8s.io/kubernetes/pkg/api/unversioned"
	kapi "k8s.io/kubernetes/pkg/api/v1"
	"k8s.io/kubernetes/pkg/runtime"
)

// Template contains the inputs needed to produce a Config.
type Template struct {
	unversioned.TypeMeta `json:",inline"`
	// Standard object's metadata.
	kapi.ObjectMeta `json:"metadata,omitempty"`

	// Objects is an array of objects to include in this template. Required.
	Objects []runtime.RawExtension `json:"objects" description:"list of objects to include in the template"`

	// Optional: Parameters is an array of Parameters used during the
	// Template to Config transformation.
	Parameters []Parameter `json:"parameters,omitempty" description:"optional: list of parameters used during template to config transformation"`

	// Labels is a set of labels that are applied to every
	// object during the Template to Config transformation. Optional
	Labels map[string]string `json:"labels,omitempty" description:"optional: list of lables that are applied to every object during the template to config transformation"`
}

// TemplateList is a list of Template objects.
type TemplateList struct {
	unversioned.TypeMeta `json:",inline"`
	// Standard object's metadata.
	unversioned.ListMeta `json:"metadata,omitempty"`

	// Items is a list of templates
	Items []Template `json:"items" description:"list of templates"`
}

// Parameter defines a name/value variable that is to be processed during
// the Template to Config transformation.
type Parameter struct {
	// Name must be set and it can be referenced in Template
	// Items using ${PARAMETER_NAME}. Required.
	Name string `json:"name" description:"name of the parameter"`

	// Optional: The name that will show in UI instead of parameter 'Name'
	DisplayName string `json:"displayName,omitempty" description:"optional: provides human readable name for the parameter"`

	// Description of a parameter. Optional.
	Description string `json:"description,omitempty" description:"optional: describes the parameter"`

	// Value holds the Parameter data. If specified, the generator will be
	// ignored. The value replaces all occurrences of the Parameter ${Name}
	// expression during the Template to Config transformation. Optional.
	Value string `json:"value,omitempty" description:"optional: holds the parameter data.  if specified, the generator is ignored.  the value replaces all occurrences of the parameter ${Name} expression during template to config transformation"`

	// Generate specifies the generator to be used to generate random string
	// from an input value specified by From field. The result string is
	// stored into Value field. If empty, no generator is being used, leaving
	// the result Value untouched. Optional.
	Generate string `json:"generate,omitempty" description:"optional: generate specifies the generator to be used to generate random string from an input value specified by the from field.  the result string is stored in the value field. if not specified, the value field is untouched"`

	// From is an input value for the generator. Optional.
	From string `json:"from,omitempty" description:"input value for the generator"`

	// Optional: Indicates the parameter must have a value.  Defaults to false.
	Required bool `json:"required,omitempty" description:"indicates the parameter must have a non-empty value or be generated"`
}


text:
class Solution:
    # @param {TreeNode} root
    # @return {integer}
    def maxDepth(self, root):

        if not root:
            return 0

        return 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))


text:
var button = document.getElementById("clickable");

$("#clickable").click(function() {
  $(".fade").fadeToggle("slow", "linear");
});

$(document).keyup(function(event) {
  if(event.keyCode == 68 || event.keyCode == 117) //Play around with your keys to see what keys activate the slide
    $(".slide").slideUp("slow");
  if(event.keyCode == 85 || event.keyCode == 100)
    $(".slide").slideDown("slow");
});

$(document).keypress(function(event) {
  document.getElementById("play").innerHTML += "<BR>You have pressed key "+ event.key;
});

//Recommended way
$(".clickable2").on( "click" ,function() {
  $(".fade").fadeToggle("slow", "linear");
});

$( "div.test" ).on({
  click: function() {
    $( this ).toggleClass( "active" );
  }, mouseenter: function() {
    $( this ).addClass( "inside" );
  }, mouseleave: function() {
    $( this ).removeClass( "inside" );
  }
});


text:
package com.example.simplecommunicationapp.activity;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

import com.example.simplecommunicationapp.R;
import com.example.simplecommunicationapp.R.id;
import com.example.simplecommunicationapp.R.layout;
import com.example.simplecommunicationapp.model.Msg;
import com.example.simplecommunicationapp.model.MsgAdapter;
import com.example.simplecommunicationapp.thread.ClientThread;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

	public static Charset charset = Charset.forName("UTF-8");

	private Handler uiHandler;

	private EditText editText;
	private Button sendButton;
	private ListView msgView;

	private List<Msg> msgList = new ArrayList<Msg>();

	private MsgAdapter adapter;

	private ClientThread clientThread;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		msgView = (ListView) findViewById(R.id.msg_view);
		adapter = new MsgAdapter(this, R.layout.msg_item, msgList);
		msgView.setAdapter(adapter);

		editText = (EditText) findViewById(R.id.input_text);

		sendButton = (Button) findViewById(R.id.send_button);
		sendButton.setOnClickListener(this);

		uiHandler = new Handler() {
			@Override
			public void handleMessage(Message msg) {
				switch (msg.what) {
				case ClientThread.UPDATE_MSG:
					Msg newMsg = (Msg) msg.obj;
					updateMsgView(newMsg);
					break;
				default:
					break;
				}
			}
		};

		clientThread = new ClientThread(uiHandler);
		clientThread.start();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.send_button:
			if (TextUtils.isEmpty(editText.getText())) {
				Toast.makeText(this, "Message cannot be empty!", Toast.LENGTH_SHORT).show();
			} else {
				Handler netHandler = clientThread.getNetHandler();
				if (netHandler != null) {
					final String content = editText.getText().toString();
					updateMsgView(new Msg(ClientThread.getUserName(), content));
					editText.setText("");

					Message message = new Message();
					message.what = ClientThread.SEND_MSG;
					message.obj = new Msg(ClientThread.getUserName(), content);
					netHandler.sendMessage(message);
				} else {
					Toast.makeText(this, "The network is not working", Toast.LENGTH_SHORT).show();
				}
			}
			break;
		default:
			break;
		}
	}

	private void updateMsgView(Msg msg) {
		msgList.add(msg);
		adapter.notifyDataSetChanged();
		msgView.setSelection(msgList.size());
	}

}


text:
require "spec_helper"

describe Chef::Resource::ChocolateySource do

  let(:resource) { Chef::Resource::ChocolateySource.new("fakey_fakerton") }
  let(:config) do
    <<-CONFIG
  <?xml version="1.0" encoding="utf-8"?>
  <chocolatey xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <config>
      <add key="containsLegacyPackageInstalls" value="true" description="Install has packages installed prior to 0.9.9 series." />
    </config>
    <sources>
      <source id="chocolatey" value="https://chocolatey.org/api/v2/" disabled="false" bypassProxy="false" selfService="false" adminOnly="false" priority="0" />
    </sources>
    <features>
      <feature name="checksumFiles" enabled="true" setExplicitly="false" description="Checksum files when pulled in from internet (based on package)." />
    </features>
    <apiKeys />
  </chocolatey>
    CONFIG
  end

  # we save off the ENV and set ALLUSERSPROFILE so these specs will work on *nix and non-C drive Windows installs
  before(:each) do
    @original_env = ENV.to_hash
    ENV["ALLUSERSPROFILE"] = 'C:\ProgramData'
  end

  after(:each) do
    ENV.clear
    ENV.update(@original_env)
  end

  it "has a resource name of :chocolatey_source" do
    expect(resource.resource_name).to eql(:chocolatey_source)
  end

  it "has a name property of source_name" do
    expect(resource.source_name).to eql("fakey_fakerton")
  end

  it "sets the default action as :add" do
    expect(resource.action).to eql([:add])
  end

  it "supports :add and :remove actions" do
    expect { resource.action :add }.not_to raise_error
    expect { resource.action :remove }.not_to raise_error
  end

  it "bypass_proxy property defaults to false" do
    expect { resource.bypass_proxy.to be_false }
  end

  it "priority property defaults to 0" do
    expect { resource.priority.to eq(0) }
  end

  describe "#fetch_source_element" do
    it "raises and error if the config file cannot be found" do
      allow(::File).to receive(:exist?).with('C:\ProgramData\chocolatey\config\chocolatey.config').and_return(false)
      expect { resource.fetch_source_element("foo") }.to raise_error(RuntimeError)
    end

    it "returns the value if present in the config file" do
      allow(::File).to receive(:exist?).with('C:\ProgramData\chocolatey\config\chocolatey.config').and_return(true)
      allow(::File).to receive(:read).with('C:\ProgramData\chocolatey\config\chocolatey.config').and_return(config)
      expect(resource.fetch_source_element("chocolatey")["value"]).to eq("https://chocolatey.org/api/v2/")
      expect { resource.fetch_source_element("foo") }.not_to raise_error
    end

    it "returns nil if the element is not present in the config file" do
      allow(::File).to receive(:exist?).with('C:\ProgramData\chocolatey\config\chocolatey.config').and_return(true)
      allow(::File).to receive(:read).with('C:\ProgramData\chocolatey\config\chocolatey.config').and_return(config)
      expect(resource.fetch_source_element("foo")).to be_nil
      expect { resource.fetch_source_element("foo") }.not_to raise_error
    end
  end
end


text:
/*
* ofxCvTrackedBlob.h
* openFrameworks
*
* This class represents a blob with inter-frame information.
* This includes a persistent id to assume a persistent identity over
* time.
*
*/

#ifndef OF_CV_TRACKEDBLOB_H
#define OF_CV_TRACKEDBLOB_H

#include "ofxCvBlob.h"

class ofxCvTrackedBlob : public ofxCvBlob {
  public:

    int id;

    ofPoint deltaLoc;
    ofPoint deltaLocTotal;
    ofPoint predictedPos;
    float deltaArea;

	float orientation, velocity;

    // Used only by BlobTracker
    //
    bool markedForDeletion;
    int framesLeft;
    vector<float> error;
    vector<int> closest;  // ids of the closest points, sorted

    ofxCvTrackedBlob() {
        id = -1;
        area = 0.0f;
        length = 0.0f;
        deltaArea = 0.0f;
        markedForDeletion = false;
        framesLeft = 0;

		orientation = 0;
		velocity = 0;
    }

    ofxCvTrackedBlob( const ofxCvBlob& b ) {
        area = b.area;
        length = b.length;
        boundingRect = b.boundingRect;
        centroid = b.centroid;
        hole = b.hole;
        pts = b.pts;

		orientation = 0;
		velocity = 0;

        id = -1;
        deltaArea = 0.0f;
        markedForDeletion = false;
        framesLeft = 0;
    }

    int getLowestError() {
        int best=-1;
        float best_v=99999.0f;
        for( unsigned int i=0; i<error.size(); i++ ) {
            if( error[i] < best_v ) {
                best = i;
                best_v = error[i];
            }
        }
        return best;
    }

};

#endif


text:
package za.org.grassroot.services.user;

import za.org.grassroot.core.domain.VerificationTokenCode;
import za.org.grassroot.core.enums.VerificationCodeType;

/**
 * @author Lesetse Kimwaga
 */
public interface PasswordTokenService {

    VerificationTokenCode generateShortLivedOTP(String phoneNumber);

    VerificationTokenCode generateLongLivedAuthCode(String userUid);

    VerificationTokenCode fetchLongLivedAuthCode(String phoneNumber);

    boolean extendAuthCodeIfExpiring(String phoneNumber, String code);

    boolean isShortLivedOtpValid(String phoneNumber, String code);

    boolean isLongLiveAuthValid(String phoneNumber, String code);

    boolean isExpired(VerificationTokenCode verificationTokenCode);

    void expireVerificationCode(String userUid, VerificationCodeType type);

}


text:
The `version` command shows the current version of Turbo.

```
Usage: turbo version

<options> available:
     --format=VALUE         Use json format for output
```

#### JSON output

When `--format=json` option was passed this command will provide output in JSON format. It will contain `version` string with current version number.


text:
package zapdriver

import (
	"go.uber.org/zap"
)

// NewProduction builds a sensible production Logger that writes InfoLevel and
// above logs to standard error as JSON.
//
// It's a shortcut for NewProductionConfig().Build(...Option).
func NewProduction(options ...zap.Option) (*zap.Logger, error) {
	options = append(options, WrapCore())

	return NewProductionConfig().Build(options...)
}

// NewProductionWithCore is same as NewProduction but accepts a custom configured core
func NewProductionWithCore(core zap.Option, options ...zap.Option) (*zap.Logger, error) {
	options = append(options, core)

	return NewProductionConfig().Build(options...)
}

// NewDevelopment builds a development Logger that writes DebugLevel and above
// logs to standard error in a human-friendly format.
//
// It's a shortcut for NewDevelopmentConfig().Build(...Option).
func NewDevelopment(options ...zap.Option) (*zap.Logger, error) {
	options = append(options, WrapCore())

	return NewDevelopmentConfig().Build(options...)
}

// NewDevelopmentWithCore is same as NewDevelopment but accepts a custom configured core
func NewDevelopmentWithCore(core zap.Option, options ...zap.Option) (*zap.Logger, error) {
	options = append(options, core)

	return NewDevelopmentConfig().Build(options...)
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/AWSS3Object.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/AWSS3Object</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setETag:</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *ETag</Declaration>

			<Anchor>//api/name/ETag</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/ETag</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *ETag</Declaration>

			<Anchor>//api/name/ETag</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/ETag</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *ETag</Declaration>

			<Anchor>//api/name/ETag</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setKey:</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *key</Declaration>

			<Anchor>//api/name/key</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/key</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *key</Declaration>

			<Anchor>//api/name/key</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/key</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *key</Declaration>

			<Anchor>//api/name/key</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setLastModified:</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSDate *lastModified</Declaration>

			<Anchor>//api/name/lastModified</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/lastModified</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSDate *lastModified</Declaration>

			<Anchor>//api/name/lastModified</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/lastModified</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSDate *lastModified</Declaration>

			<Anchor>//api/name/lastModified</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setOwner:</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) AWSS3Owner *owner</Declaration>

			<Anchor>//api/name/owner</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/owner</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) AWSS3Owner *owner</Declaration>

			<Anchor>//api/name/owner</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/owner</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) AWSS3Owner *owner</Declaration>

			<Anchor>//api/name/owner</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setSize:</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSNumber *size</Declaration>

			<Anchor>//api/name/size</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/size</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSNumber *size</Declaration>

			<Anchor>//api/name/size</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/size</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSNumber *size</Declaration>

			<Anchor>//api/name/size</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/setStorageClass:</TokenIdentifier>
			<Abstract type="html">The class of storage used to store the object.</Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) AWSS3ObjectStorageClass storageClass</Declaration>

			<Anchor>//api/name/storageClass</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AWSS3Object/storageClass</TokenIdentifier>
			<Abstract type="html">The class of storage used to store the object.</Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) AWSS3ObjectStorageClass storageClass</Declaration>

			<Anchor>//api/name/storageClass</Anchor>
            <NodeRef refid="1147"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AWSS3Object/storageClass</TokenIdentifier>
			<Abstract type="html">The class of storage used to store the object.</Abstract>
			<DeclaredIn>AWSS3Model.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) AWSS3ObjectStorageClass storageClass</Declaration>

			<Anchor>//api/name/storageClass</Anchor>
            <NodeRef refid="1147"/>
		</Token>

	</File>
</Tokens>


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Iframe_1 - Link</title>

    <button id="2">Test</button>


text:
import { Bounds, EMPTY_BOUNDS, EMPTY_DIMENSION, Dimension, isBounds, ORIGIN_POINT, Point } from "../../utils/geometry";
import { SModelElement, SModelElementSchema, SParentElement, SChildElement, SModelRoot } from "../../base/model/smodel";
import { SModelExtension } from "../../base/model/smodel-extension";
import { findParentByFeature } from '../../base/model/smodel-utils';
import { Locateable } from '../move/model';

export const boundsFeature = Symbol('boundsFeature');
export const layoutContainerFeature = Symbol('layoutContainerFeature');
export const layoutableChildFeature = Symbol('layoutableChildFeature');
export const alignFeature = Symbol('alignFeature');

/**
 * Model elements that implement this interface have a position and a size.
 */
export interface BoundsAware extends SModelExtension {
    bounds: Bounds
}

/**
 * Used to identify model elements that specify a layout to apply to their children.
 */
export interface LayoutContainer extends LayoutableChild {
    layout: string
}

export type ModelLayoutOptions = {[key: string]: string | number | boolean};

export interface LayoutableChild extends SModelExtension, BoundsAware {
    layoutOptions?: ModelLayoutOptions
}

/**
 * Used to adjust elements whose bounding box is not at the origin, e.g.
 * labels, or pre-rendered SVG figures.
 */
export interface Alignable extends SModelExtension {
    alignment: Point
}

export function isBoundsAware(element: SModelElement): element is SModelElement & BoundsAware {
    return 'bounds' in element;
}

export function isLayoutContainer(element: SModelElement): element is SParentElement & LayoutContainer {
    return isBoundsAware(element)
        && element.hasFeature(layoutContainerFeature)
        && 'layout' in element;
}

export function isLayoutableChild(element: SModelElement): element is SParentElement & LayoutableChild {
    return isBoundsAware(element)
        && element.hasFeature(layoutableChildFeature);
}

export function isSizeable(element: SModelElement): element is SModelElement & BoundsAware {
    return element.hasFeature(boundsFeature) && isBoundsAware(element);
}

export function isAlignable(element: SModelElement): element is SModelElement & Alignable {
    return element.hasFeature(alignFeature)
        && 'alignment' in element;
}

export function getAbsoluteBounds(element: SModelElement): Bounds {
    const boundsAware = findParentByFeature(element, isBoundsAware);
    if (boundsAware !== undefined) {
        let bounds = boundsAware.bounds;
        let current: SModelElement = boundsAware;
        while (current instanceof SChildElement) {
            const parent = current.parent;
            bounds = parent.localToParent(bounds);
            current = parent;
        }
        return bounds;
    } else if (element instanceof SModelRoot) {
        const canvasBounds = element.canvasBounds;
        return { x: 0, y: 0, width: canvasBounds.width, height: canvasBounds.height };
    } else {
        return EMPTY_BOUNDS;
    }
}

/**
 * Serializable schema for SShapeElement.
 */
export interface SShapeElementSchema extends SModelElementSchema {
    position?: Point
    size?: Dimension
    children?: SModelElementSchema[]
    layoutOptions?: ModelLayoutOptions
}

/**
 * Abstract class for elements with a position and a size.
 */
export abstract class SShapeElement extends SChildElement implements BoundsAware, Locateable, LayoutableChild {
    position: Point = ORIGIN_POINT;
    size: Dimension = EMPTY_DIMENSION;
    layoutOptions?: ModelLayoutOptions;

    get bounds(): Bounds {
        return {
            x: this.position.x,
            y: this.position.y,
            width: this.size.width,
            height: this.size.height
        };
    }

    set bounds(newBounds: Bounds) {
        this.position = {
            x: newBounds.x,
            y: newBounds.y
        };
        this.size = {
            width: newBounds.width,
            height: newBounds.height
        };
    }

    localToParent(point: Point | Bounds): Bounds {
        const result = {
            x: point.x + this.position.x,
            y: point.y + this.position.y,
            width: -1,
            height: -1
        };
        if (isBounds(point)) {
            result.width = point.width;
            result.height = point.height;
        }
        return result;
    }

    parentToLocal(point: Point | Bounds): Bounds {
        const result = {
            x: point.x - this.position.x,
            y: point.y - this.position.y,
            width: -1,
            height: -1
        };
        if (isBounds(point)) {
            result.width = point.width;
            result.height = point.height;
        }
        return result;
    }
}


text:
class CodeRunner
	class Cubecalc
		class Empty < Cubecalc

			@defaults_file_name = "empty_defaults.rb"
		end
	end
end


text:
package com.googlecode.objectify.impl.translate;

import com.googlecode.objectify.impl.Property;
import com.googlecode.objectify.repackaged.gentyref.GenericTypeReflector;
import lombok.Data;
import lombok.RequiredArgsConstructor;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

/**
 *
Unique identifier for a translator instance. Important so we can re-use translators
 * as we navigate the tree, allowing us to store recursive structures.

 *
 * @author Jeff Schnitzer <jeff@infohazard.org>
 */
@Data
@RequiredArgsConstructor
public class TypeKey<T>
{
	/** */
	private static final Annotation[] NO_ANNOTATIONS = {};

	/** */
	private final Type type;

	/** */
	private final Annotation[] annotations;

	/** */
	public TypeKey(Type type) {
		this(type, NO_ANNOTATIONS);
	}

	/**
	 * Create a new typekey for a new type but which preserves characteristics of the old typekey (ie annotations).
	 * This is used when creating a new typekey for component types.
	 */
	public TypeKey(Type type, TypeKey previous) {
		this(type, previous.getAnnotations());
	}

	/**
	 * Create a typekey from a property
	 */
	public TypeKey(Property prop) {
		this(prop.getType(), prop.getAnnotations());
	}

	/**
	 * Get the basic class through erasure.
	 */
	@SuppressWarnings("unchecked")
	public Class<T> getTypeAsClass() {
		return (Class<T>)GenericTypeReflector.erase(type);
	}

	/** Gets the annotation that has the specified type, or null if there isn't one */
	@SuppressWarnings("unchecked")
	public  A getAnnotation(Class annotationType) {
		for (Annotation anno: annotations)
			if (annotationType.isAssignableFrom(anno.getClass()))
				return (A)anno;

		return null;
	}

	/** @return true if the annotation is present */
	public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
		return getAnnotation(annotationType) != null;
	}

	/**
	 * Checks not only the listed annotations but also annotations on the class.
	 */
	public  A getAnnotationAnywhere(Class annotationType) {
		A anno = getAnnotation(annotationType);
		if (anno == null) {
			Class<?> clazz = (Class<?>) GenericTypeReflector.erase(type);
			return clazz.getAnnotation(annotationType);
		} else {
			return anno;
		}
	}

	/**
	 * Can this type be assigned to a variable with the specified type?
	 * This is the inverse of isAssignableFrom().
	 */
	public boolean isAssignableTo(final Class<?> superclass) {
		return superclass.isAssignableFrom(getTypeAsClass());
	}
}


text:
export * from './constants';
export * from './createLogger';
export * as formats from './formats';
export * from './Logger';
export * from './Transport';
export * from './transports/ConsoleTransport';
export * from './transports/FileTransport';
export * from './transports/RotatingFileTransport';
export * from './transports/StreamTransport';
export * from './types';