text:
#ifndef DALI_TOOLKIT_INTERNAL_GRADIENT_VISUAL_H
#define DALI_TOOLKIT_INTERNAL_GRADIENT_VISUAL_H

// EXTERNAL INCLUDES
#include <dali/public-api/common/intrusive-ptr.h>

// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/gradient/gradient.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>

namespace Dali
{
class Vector2;

namespace Toolkit
{
namespace Internal
{
class Gradient;
class GradientVisual;
typedef IntrusivePtr<GradientVisual> GradientVisualPtr;

/**
 * The visual which renders smooth transition of colors to the control's quad.
 * It supports two types of gradients: linear and radial.
 *
 * The following properties are essential for create a LINEAR GradientRender
 *
 * | %Property Name          | Type             |
 * |-------------------------|------------------|
 * | startPosition           | VECTOR2          |
 * | endPosition             | VECTOR2          |
 * | stopColor               | ARRAY of VECTOR4 |
 *
 * The following properties are essential for create a RADIAL GradientRender
 *
 * | %Property Name          | Type             |
 * |-------------------------|------------------|
 * | center                  | VECTOR2          |
 * | radius                  | FLOAT            |
 * | stopColor               | ARRAY of VECTOR4 |
 *
 * The following properties are optional for both LINEAR and RADIAL GradientRender.
 *
 * | %Property Name          | Type             |
 * |-------------------------|------------------|
 * | stopOffset              | ARRAY of FLOAT   |
 * | units                   | STRING           |
 * | spreadMethod            | STRING           |
 *
 * Valid values for units are 'userSpace' and 'objectBoundingBox'.
 * Valid values for spreadMethod are 'pad', 'repeat' and 'reflect.'
 * If not provided, 'objectBoundingBox' is used as default gradient units, and 'pad' is used as default spread method.
 */
class GradientVisual : public Visual::Base
{
public:
  /**
   * Types of the gradient
   */
  enum Type
  {
    LINEAR,
    RADIAL
  };

  /**
   * @brief Create a new gradient visual.
   *
   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
   * @param[in] properties A Property::Map containing settings for this visual
   * @return A smart-pointer to the newly allocated visual.
   */
  static GradientVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);

public: // from Visual
  /**
   * @copydoc Visual::Base::CreatePropertyMap
   */
  void DoCreatePropertyMap(Property::Map& map) const override;

  /**
   * @copydoc Visual::Base::CreateInstancePropertyMap
   */
  void DoCreateInstancePropertyMap(Property::Map& map) const override;

  /**
   * @copydoc Visual::Base::EnablePreMultipliedAlpha
   */
  void EnablePreMultipliedAlpha(bool preMultiplied) override;

protected:
  /**
   * @brief Constructor.
   *
   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
   */
  GradientVisual(VisualFactoryCache& factoryCache);

  /**
   * @brief A reference counted object may only be deleted by calling Unreference().
   */
  virtual ~GradientVisual();

  /**
   * @copydoc Visual::Base::OnInitialize
   */
  void OnInitialize() override;

  /**
   * @copydoc Visual::Base::DoSetProperties
   */
  void DoSetProperties(const Property::Map& propertyMap) override;

  /**
   * @copydoc Visual::Base::OnSetTransform
   */
  void OnSetTransform() override;

  /**
   * @copydoc Visual::Base::DoSetOnScene
   */
  void DoSetOnScene(Actor& actor) override;

  /**
   * @copydoc Visual::Base::UpdateShader
   */
  void UpdateShader() override;

  /**
   * @copydoc Visual::Base::GenerateShader
   */
  Shader GenerateShader() const override;

private:
  /**
   * New a gradient object with the given property map.
   *
   * @return True if the property map provides valid properties to create a gradient. Otherwise, returns false.
   */
  bool NewGradient(Type gradientType, const Property::Map& propertyMap);

  /**
   * Get the stop-offsets from the property.
   * The valid property type are ARRAY, VECTOR2, VECTOR3, VECTOR4.
   *
   * @param[in] value The property value of stop-offsets
   * @param[out] stopOffsets The vector contains the stop offset values.
   */
  static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);

  // Undefined
  GradientVisual(const GradientVisual& gradientVisual);

  // Undefined
  GradientVisual& operator=(const GradientVisual& gradientVisual);

private:
  Matrix3                mGradientTransform;
  IntrusivePtr<Gradient> mGradient;
  Type                   mGradientType;
  bool                   mIsOpaque; ///< Set to false if any of the stop colors are not opaque
};

} // namespace Internal

} // namespace Toolkit

} // namespace Dali

#endif /* DALI_TOOLKIT_INTERNAL_GRADIENT_VISUAL_H */


text:
from openerp.osv import fields, osv

class company_pad(osv.osv):
    _inherit = 'res.company'
    _columns = {
        'pad_server': fields.char('Pad Server', help="Etherpad lite server. Example: beta.primarypad.com"),
        'pad_key': fields.char('Pad Api Key', help="Etherpad lite api key.", groups="base.group_system"),
    }

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

redpajama_set_name: RedPajamaGithub


text:
## SYNOPSIS

Creates a new Audio Element for Toast Notifications.

## SYNTAX

### StandardSound (Default)

```powershell
New-BTAudio -Source <Uri> [-Loop]
```

### CustomSound

```powershell
New-BTAudio -Path <String> [-Loop]
```

### Silent

```powershell
New-BTAudio -Silent
```

## DESCRIPTION

The New-BTAudioElement function creates a new Audio Element for Toast Notifications.

You can use the parameters of New-BTAudioElement to select an audio file or a standard notification sound (including alarms).
Alternativly you can specify that a Toast Notification should be silent.

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------

```powershell
PS C:\>New-BTAudioElement -Source SMS
```

Creates an Audio Element which will cause a Toast Notification to play the standard Microsoft 'SMS' sound.

### -------------------------- EXAMPLE 2 --------------------------

```powershell
PS C:\>New-BTAudioElement -Path 'C:\Music\FavSong.mp3'
```

Creates an Audio Element which will cause a Toast Notification to play the specified song.

### -------------------------- EXAMPLE 3 --------------------------

```powershell
PS C:\>New-BTAudioElement -Silent
```

Creates an Audio Element which will cause a Toast Notification to be silent.

## PARAMETERS

### -Loop

Specifies that the slected sound should play multiple times if its duration is shorter than that of the toast it accompanies.

```yaml
Type: SwitchParameter
Parameter Sets: CustomSound, StandardSound
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Path

The full path to an audio file. Supported file types include:

*.aac
*.flac
*.m4a
*.mp3
*.wav
*.wma

```yaml
Type: String
Parameter Sets: CustomSound
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Silent

Specifies that the toast should be displayed without sound.

```yaml
Type: SwitchParameter
Parameter Sets: Silent
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Source

Specifies one of the built in Microsoft notification sounds.

This paramater takes the full form of the sounds, in the form of a uri. The New-BurntToastNotification function simplifies this, so be aware of the difference.

```yaml
Type: Uri
Parameter Sets: StandardSound
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

TODO

You cannot pipe input to this cmdlet.

## OUTPUTS

ToastAudio

## NOTES

## RELATED LINKS

[New-BTAudio](https://github.com/Windos/BurntToast/blob/main/Help/New-BTAudio.md)


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd ">

	<!-- 注解扫描包 -->
	<context:component-scan base-package="com.dassmeta.passport" />
	<!-- 开启注解 -->
	<mvc:annotation-driven />

	<mvc:resources location="/js/" mapping="/js/**" />
	<mvc:resources location="/css/" mapping="/css/**" />
	<mvc:resources location="/fonts/" mapping="/fonts/**" />

	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/" />
		<property name="suffix" value=".jsp" />
	</bean>

</beans>


text:
user experience 10%

- 0 : not really intuitive or clear, sloppy

- 1 : usable but it is not intuitive without clear instructions

- 2 : usable and clear

- 3:  very intuitive, flow of app makes sense, clear, easy to use at first glance, professional/fun

increment/innovation  30%

– 0 : there is already an existing project accomplished the same goal/functionality

– 1 : the new code provides a better/faster/clearer way to attack the problem than the old one

– 2 : the new code make something work that the old code failed to

– 3 : the new project tackles a problem that has been overlooked/ignored in the past, or attacks a problem with a new angle / on a bigger scale / on a higher level

– 4 : the new project attacks a new problem and provided a good solution

impact/potential/sustainability  30%

– 0 : Problem is non-relevant to city government

– 1 : App solves a relevant problem for city government, but it is hard to implement  or scale and the team does not have a clear plan to move the project forward

– 2 : App solves a relevant problem for city government, and it is hard to implement or scale, but the team has a clear plan to move the project forward

– 3 : App has a sustainable life-cycle and it is already working

– 4 : App has sustainable life-cycle and it is already working, utilizes a well-established open source community supported framework and has multi-platform support

sharing resource/collaboration  30%

– 0 : The project is isolated, uses a proprietary tool and the team has no interest in working with others

– 1 : The team wants to collaborate but not yet doing it / don't have a working plan

– 2 : The project is open-source, the data-set is open to share, and the team provided a good API support / documentation for others to pick up

– 3 : The project is a merged project from several previous existing projects, and the new project is working well

– 4 : The project is a merged project from several previous existing projects, and the merging happened during the hackathon weekend


text:
interface MyInterface {

}

class MyObject {

}

enum MyEnum {
    Value = 0
}


text:
import { Component, Input, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';

import { CdEnvironment } from './../shared/models/cdenvironment';
import { Website } from './../shared/models/website';

import { EnvironmentService } from './../services/environment.service';
import { WebsiteService } from './../services/website.service';

@Component({
    moduleId: module.id,
    selector: 'env',
    styleUrls: [ 'cdenvironment.component.css'],
    templateUrl: 'cdenvironment.component.html',
    providers: [ WebsiteService, EnvironmentService ]
})

export class CdEnvironmentComponent implements OnInit {
    title = 'CdEnvironment';
    cdid: string;
    websites: Website[];
    @Input('Model')
    model: CdEnvironment;

    constructor(private environmentService: EnvironmentService,
                private websiteService: WebsiteService,
                private router: Router,
                private route: ActivatedRoute) { }

    ngOnInit() {
        this.route.params.forEach((params: Params) => {
             const id = params['id'];
             this.cdid = id;
             this.environmentService.Get(id)
                .subscribe(e => this.model = e);
             this.websiteService.GetByCdEnvironmentId(id)
                .subscribe(e => this.websites = e);
        });
     }
}


text:
<template>
  <require from="./popover"></require>

        ${p.data.title}

</template>


text:
'use strict';

System.register('flarum/subscriptions/addSubscriptionBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export, _context) {
  var extend, Discussion, Badge;
  function addSubscriptionBadge() {
    extend(Discussion.prototype, 'badges', function (badges) {
      var badge = void 0;

      switch (this.subscription()) {
        case 'follow':
          badge = Badge.component({
            label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),
            icon: 'star',
            type: 'following'
          });
          break;

        case 'ignore':
          badge = Badge.component({
            label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),
            icon: 'eye-slash',
            type: 'ignoring'
          });
          break;

        default:
        // no default
      }

      if (badge) {
        badges.add('subscription', badge);
      }
    });
  }

  _export('default', addSubscriptionBadge);

  return {
    setters: [function (_flarumExtend) {
      extend = _flarumExtend.extend;
    }, function (_flarumModelsDiscussion) {
      Discussion = _flarumModelsDiscussion.default;
    }, function (_flarumComponentsBadge) {
      Badge = _flarumComponentsBadge.default;
    }],
    execute: function () {}
  };
});;
'use strict';

System.register('flarum/subscriptions/addSubscriptionControls', ['flarum/extend', 'flarum/components/Button', 'flarum/components/DiscussionPage', 'flarum/utils/DiscussionControls', 'flarum/subscriptions/components/SubscriptionMenu'], function (_export, _context) {
  var extend, Button, DiscussionPage, DiscussionControls, SubscriptionMenu;
  function addSubscriptionControls() {
    extend(DiscussionControls, 'userControls', function (items, discussion, context) {
      if (app.session.user && !(context instanceof DiscussionPage)) {
        var states = {
          none: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'star', save: 'follow' },
          follow: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'star-o', save: false },
          ignore: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'eye', save: false }
        };

        var subscription = discussion.subscription() || 'none';

        items.add('subscription', Button.component({
          children: states[subscription].label,
          icon: states[subscription].icon,
          onclick: discussion.save.bind(discussion, { subscription: states[subscription].save })
        }));
      }
    });

    extend(DiscussionPage.prototype, 'sidebarItems', function (items) {
      if (app.session.user) {
        var discussion = this.discussion;

        items.add('subscription', SubscriptionMenu.component({ discussion: discussion }));
      }
    });
  }

  _export('default', addSubscriptionControls);

  return {
    setters: [function (_flarumExtend) {
      extend = _flarumExtend.extend;
    }, function (_flarumComponentsButton) {
      Button = _flarumComponentsButton.default;
    }, function (_flarumComponentsDiscussionPage) {
      DiscussionPage = _flarumComponentsDiscussionPage.default;
    }, function (_flarumUtilsDiscussionControls) {
      DiscussionControls = _flarumUtilsDiscussionControls.default;
    }, function (_flarumSubscriptionsComponentsSubscriptionMenu) {
      SubscriptionMenu = _flarumSubscriptionsComponentsSubscriptionMenu.default;
    }],
    execute: function () {}
  };
});;
'use strict';

System.register('flarum/subscriptions/addSubscriptionFilter', ['flarum/extend', 'flarum/components/LinkButton', 'flarum/components/IndexPage', 'flarum/components/DiscussionList'], function (_export, _context) {
  var extend, LinkButton, IndexPage, DiscussionList;
  function addSubscriptionFilter() {
    extend(IndexPage.prototype, 'navItems', function (items) {
      if (app.session.user) {
        var params = this.stickyParams();

        params.filter = 'following';

        items.add('following', LinkButton.component({
          href: app.route('index.filter', params),
          children: app.translator.trans('flarum-subscriptions.forum.index.following_link'),
          icon: 'star'
        }), 50);
      }
    });

    extend(DiscussionList.prototype, 'requestParams', function (params) {
      if (this.props.params.filter === 'following') {
        params.filter.q = (params.filter.q || '') + ' is:following';
      }
    });
  }

  _export('default', addSubscriptionFilter);

  return {
    setters: [function (_flarumExtend) {
      extend = _flarumExtend.extend;
    }, function (_flarumComponentsLinkButton) {
      LinkButton = _flarumComponentsLinkButton.default;
    }, function (_flarumComponentsIndexPage) {
      IndexPage = _flarumComponentsIndexPage.default;
    }, function (_flarumComponentsDiscussionList) {
      DiscussionList = _flarumComponentsDiscussionList.default;
    }],
    execute: function () {}
  };
});;
'use strict';

System.register('flarum/subscriptions/addSubscriptionSettings', ['flarum/extend', 'flarum/components/SettingsPage', 'flarum/components/FieldSet', 'flarum/components/Switch', 'flarum/utils/ItemList'], function (_export, _context) {
  var extend, SettingsPage, FieldSet, Switch, ItemList;

  _export('default', function () {
    extend(SettingsPage.prototype, 'notificationsItems', function (items) {
      items.add('followAfterReply', Switch.component({
        children: app.translator.trans('flarum-subscriptions.forum.settings.forum_follow_after_reply_label'),
        state: this.user.preferences().followAfterReply,
        onchange: this.preferenceSaver('followAfterReply')
      }));
    });
  });

  return {
    setters: [function (_flarumExtend) {
      extend = _flarumExtend.extend;
    }, function (_flarumComponentsSettingsPage) {
      SettingsPage = _flarumComponentsSettingsPage.default;
    }, function (_flarumComponentsFieldSet) {
      FieldSet = _flarumComponentsFieldSet.default;
    }, function (_flarumComponentsSwitch) {
      Switch = _flarumComponentsSwitch.default;
    }, function (_flarumUtilsItemList) {
      ItemList = _flarumUtilsItemList.default;
    }],
    execute: function () {}
  };
});;
'use strict';

System.register('flarum/subscriptions/components/NewPostNotification', ['flarum/components/Notification', 'flarum/helpers/username'], function (_export, _context) {
  var Notification, username, NewPostNotification;
  return {
    setters: [function (_flarumComponentsNotification) {
      Notification = _flarumComponentsNotification.default;
    }, function (_flarumHelpersUsername) {
      username = _flarumHelpersUsername.default;
    }],
    execute: function () {
      NewPostNotification = function (_Notification) {
        babelHelpers.inherits(NewPostNotification, _Notification);

        function NewPostNotification() {
          babelHelpers.classCallCheck(this, NewPostNotification);
          return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(NewPostNotification).apply(this, arguments));
        }

        babelHelpers.createClass(NewPostNotification, [{
          key: 'icon',
          value: function icon() {
            return 'star';
          }
        }, {
          key: 'href',
          value: function href() {
            var notification = this.props.notification;
            var discussion = notification.subject();
            var content = notification.content() || {};

            return app.route.discussion(discussion, content.postNumber);
          }
        }, {
          key: 'content',
          value: function content() {
            return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', { user: this.props.notification.sender() });
          }
        }]);
        return NewPostNotification;
      }(Notification);

      _export('default', NewPostNotification);
    }
  };
});;
'use strict';

System.register('flarum/subscriptions/components/SubscriptionMenu', ['flarum/components/Dropdown', 'flarum/components/Button', 'flarum/helpers/icon', 'flarum/subscriptions/components/SubscriptionMenuItem'], function (_export, _context) {
  var Dropdown, Button, icon, SubscriptionMenuItem, SubscriptionMenu;
  return {
    setters: [function (_flarumComponentsDropdown) {
      Dropdown = _flarumComponentsDropdown.default;
    }, function (_flarumComponentsButton) {
      Button = _flarumComponentsButton.default;
    }, function (_flarumHelpersIcon) {
      icon = _flarumHelpersIcon.default;
    }, function (_flarumSubscriptionsComponentsSubscriptionMenuItem) {
      SubscriptionMenuItem = _flarumSubscriptionsComponentsSubscriptionMenuItem.default;
    }],
    execute: function () {
      SubscriptionMenu = function (_Dropdown) {
        babelHelpers.inherits(SubscriptionMenu, _Dropdown);

        function SubscriptionMenu() {
          babelHelpers.classCallCheck(this, SubscriptionMenu);
          return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(SubscriptionMenu).apply(this, arguments));
        }

        babelHelpers.createClass(SubscriptionMenu, [{
          key: 'init',
          value: function init() {
            this.options = [{
              subscription: false,
              icon: 'star-o',
              label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),
              description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')
            }, {
              subscription: 'follow',
              icon: 'star',
              label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),
              description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')
            }, {
              subscription: 'ignore',
              icon: 'eye-slash',
              label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),
              description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text')
            }];
          }
        }, {
          key: 'view',
          value: function view() {
            var _this2 = this;

            var discussion = this.props.discussion;
            var subscription = discussion.subscription();

            var buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button');
            var buttonIcon = 'star-o';
            var buttonClass = 'SubscriptionMenu-button--' + subscription;

            switch (subscription) {
              case 'follow':
                buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');
                buttonIcon = 'star';
                break;

              case 'ignore':
                buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');
                buttonIcon = 'eye-slash';
                break;

              default:
              // no default
            }

            var buttonProps = {
              className: 'Button SubscriptionMenu-button ' + buttonClass,
              icon: buttonIcon,
              children: buttonLabel,
              onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? false : 'follow')
            };

            var preferences = app.session.user.preferences();
            var notifyEmail = preferences['notify_newPost_email'];
            var notifyAlert = preferences['notify_newPost_alert'];

            if ((notifyEmail || notifyAlert) && subscription === false) {
              buttonProps.config = function (element) {
                $(element).tooltip({
                  container: '.SubscriptionMenu',
                  placement: 'bottom',
                  delay: 250,
                  title: app.translator.trans(notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip')
                });
              };
            } else {
              buttonProps.config = function (element) {
                return $(element).tooltip('destroy');
              };
            }

            return m(
              'div',
              { className: 'Dropdown ButtonGroup SubscriptionMenu' },
              Button.component(buttonProps),
              m(
                'button',
                { className: 'Dropdown-toggle Button Button--icon ' + buttonClass, 'data-toggle': 'dropdown' },
                icon('caret-down', { className: 'Button-icon' })
              ),
              m(
                'ul',
                { className: 'Dropdown-menu dropdown-menu Dropdown-menu--right' },
                this.options.map(function (props) {
                  props.onclick = _this2.saveSubscription.bind(_this2, discussion, props.subscription);
                  props.active = subscription === props.subscription;

                  return m(
                    'li',
                    null,
                    SubscriptionMenuItem.component(props)
                  );
                })
              )
            );
          }
        }, {
          key: 'saveSubscription',
          value: function saveSubscription(discussion, subscription) {
            discussion.save({ subscription: subscription });

            this.$('.SubscriptionMenu-button').tooltip('hide');
          }
        }]);
        return SubscriptionMenu;
      }(Dropdown);

      _export('default', SubscriptionMenu);
    }
  };
});;
'use strict';

System.register('flarum/subscriptions/components/SubscriptionMenuItem', ['flarum/Component', 'flarum/helpers/icon'], function (_export, _context) {
  var Component, icon, SubscriptionMenuItem;
  return {
    setters: [function (_flarumComponent) {
      Component = _flarumComponent.default;
    }, function (_flarumHelpersIcon) {
      icon = _flarumHelpersIcon.default;
    }],
    execute: function () {
      SubscriptionMenuItem = function (_Component) {
        babelHelpers.inherits(SubscriptionMenuItem, _Component);

        function SubscriptionMenuItem() {
          babelHelpers.classCallCheck(this, SubscriptionMenuItem);
          return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(SubscriptionMenuItem).apply(this, arguments));
        }

        babelHelpers.createClass(SubscriptionMenuItem, [{
          key: 'view',
          value: function view() {
            return m(
              'button',
              { className: 'SubscriptionMenuItem hasIcon', onclick: this.props.onclick },
              this.props.active ? icon('check', { className: 'Button-icon' }) : '',
              m(
                'span',
                { className: 'SubscriptionMenuItem-label' },
                icon(this.props.icon, { className: 'Button-icon' }),
                m(
                  'strong',
                  null,
                  this.props.label
                ),
                m(
                  'span',
                  { className: 'SubscriptionMenuItem-description' },
                  this.props.description
                )
              )
            );
          }
        }]);
        return SubscriptionMenuItem;
      }(Component);

      _export('default', SubscriptionMenuItem);
    }
  };
});;
'use strict';

System.register('flarum/subscriptions/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/components/NotificationGrid', 'flarum/subscriptions/addSubscriptionBadge', 'flarum/subscriptions/addSubscriptionControls', 'flarum/subscriptions/addSubscriptionFilter', 'flarum/subscriptions/addSubscriptionSettings', 'flarum/subscriptions/components/NewPostNotification'], function (_export, _context) {
  var extend, app, Model, Discussion, NotificationGrid, addSubscriptionBadge, addSubscriptionControls, addSubscriptionFilter, addSubscriptionSettings, NewPostNotification;
  return {
    setters: [function (_flarumExtend) {
      extend = _flarumExtend.extend;
    }, function (_flarumApp) {
      app = _flarumApp.default;
    }, function (_flarumModel) {
      Model = _flarumModel.default;
    }, function (_flarumModelsDiscussion) {
      Discussion = _flarumModelsDiscussion.default;
    }, function (_flarumComponentsNotificationGrid) {
      NotificationGrid = _flarumComponentsNotificationGrid.default;
    }, function (_flarumSubscriptionsAddSubscriptionBadge) {
      addSubscriptionBadge = _flarumSubscriptionsAddSubscriptionBadge.default;
    }, function (_flarumSubscriptionsAddSubscriptionControls) {
      addSubscriptionControls = _flarumSubscriptionsAddSubscriptionControls.default;
    }, function (_flarumSubscriptionsAddSubscriptionFilter) {
      addSubscriptionFilter = _flarumSubscriptionsAddSubscriptionFilter.default;
    }, function (_flarumSubscriptionsAddSubscriptionSettings) {
      addSubscriptionSettings = _flarumSubscriptionsAddSubscriptionSettings.default;
    }, function (_flarumSubscriptionsComponentsNewPostNotification) {
      NewPostNotification = _flarumSubscriptionsComponentsNewPostNotification.default;
    }],
    execute: function () {

      app.initializers.add('subscriptions', function () {
        app.notificationComponents.newPost = NewPostNotification;

        Discussion.prototype.subscription = Model.attribute('subscription');

        addSubscriptionBadge();
        addSubscriptionControls();
        addSubscriptionFilter();
        addSubscriptionSettings();

        extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
          items.add('newPost', {
            name: 'newPost',
            icon: 'star',
            label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')
          });
        });
      });
    }
  };
});


text:
require 'test/unit'

class UnobtrusiveSortHelperTest < Test::Unit::TestCase
  # Replace this with your real tests.
  def test_this_plugin
    true
  end
end


text:
const gulp = require('gulp');
const gutil = require('gulp-util');
const babel = require('gulp-babel');
const del = require('del');
const glob = require('glob');
const Mocha = require('mocha');
const eslint = require('eslint');

const GLOB = {
  bin: './bin/**/*',
  lib: './lib/**/*.js',
  build: './build/**/*.js',
  spec: './test/lib/**/*.spec.js',
  example: './test/example/**/*.spec.js'
};

gulp.task('clean', () => {
  return del([GLOB.build]);
});

gulp.task('build', ['clean'], () => {
  return gulp.src(GLOB.lib)
    .pipe(babel())
    .pipe(gulp.dest('build/'));
});

gulp.task('watch', ['clean'], () => {
  runAndWatch(GLOB.lib, GLOB.lib, path => {
    gutil.log(gutil.colors.cyan('babel:'), path);
    gulp.src(path)
      .pipe(babel())
      .on('error', e => console.log(e.stack))
      .pipe(gulp.dest('build/'));
  });
});

gulp.task('install:example', ['build'], done => {
  const onpm = require('./build');
  onpm.example('install --force --no-package-lock').on('exit', done);
});

gulp.task('test:prepare', () => {
  require('babel-core/register');
});

gulp.task('test', ['test:prepare'], done => {
  runTests(GLOB.spec).then(err => {
    done(err ? new Error('Mocha tests failed.') : undefined);
  }, done);
});

gulp.task('test:watch', ['test:prepare'], () => {
  function test() {
    runTests(GLOB.spec, { reporter: 'dot' })
      .catch(e => console.log(e.stack));
  }
  const sourceFiles = glob.sync(GLOB.lib, { realpath: true });
  gulp.watch(GLOB.lib, () => {
    sourceFiles.forEach(f => clearModuleCache(f));
    test();
  });
  runAndWatch(GLOB.spec, null, () => test());
});

gulp.task('test:example', ['install:example'], done => {
  const onpm = require('./build');
  onpm.example('run test').on('exit', done);
});

gulp.task('lint:lib', () => {
  lintFiles([GLOB.lib], true);
});

gulp.task('lint:test', () => {
  lintFiles([GLOB.spec, GLOB.example], true);
});

gulp.task('lint:bin', () => {
  lintFiles([GLOB.bin], true);
});

gulp.task('lint:gulp', () => {
  lintFiles(['./gulpfile.babel.js'], true, {
    rules: { 'no-console': 0 }
  });
});

gulp.task('lint:watch', () => {
  const linter = new eslint.CLIEngine();
  function lintAndReport(path) {
    const report = linter.executeOnFiles([path]);
    const formatter = linter.getFormatter();
    console.log(formatter(report.results));
  }
  runAndWatch(GLOB.lib, GLOB.lib, lintAndReport);
  runAndWatch(GLOB.spec, GLOB.spec, lintAndReport);
});

gulp.task('lint', [
  'lint:lib',
  'lint:test',
  'lint:bin'
]);

gulp.task('lint:all', [
  'lint',
  'lint:gulp'
]);

gulp.task('check', [
  'lint:all',
  'test',
  'test:example'
]);

gulp.task('default', [
  'lint:watch',
  'test:watch'
]);

/**
 * Clear module cache.
 */
function clearModuleCache(path) {
  delete require.cache[path];
}

/**
 * Run tests in the specified file pattern using Mocha.
 */
function runTests(pattern, options) {
  const mocha = new Mocha(options);
  const files = glob.sync(pattern, { realpath: true });
  files.forEach(file => {
    clearModuleCache(file); // For watching
    mocha.addFile(file);
  });
  return new Promise((resolve, reject) => {
    try {
      mocha.run(resolve);
    } catch(e) {
      reject(e);
    }
  });
}

/**
 * Run a given task. And re-run it whenever the specified files change.
 */
function runAndWatch(watchPattern, initialValue, task) {
  gulp.watch(watchPattern, event => {
    task(event.path, event);
  });
  return task(initialValue);
}

/**
 * Lint the specified files using eslint.
 */
function lintFiles(pattern, strict, configs) {
  const linter = new eslint.CLIEngine(configs);
  const report = linter.executeOnFiles(pattern);
  const formatter = linter.getFormatter();
  console.log(formatter(report.results));
  if (0 < report.errorCount || (strict && 0 < report.warningCount)) {
    throw new Error('eslint reports some problems.');
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace _2.CompanySite.Bulgaria
{
    public partial class ContactsBulgaria : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}


text:
from django.shortcuts import redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt

# allPay setting.
from pyallpay import AllPay

import logging
import json
import hashlib
import datetime

"""
    Example of Django view using allPay.
"""

@csrf_exempt
def create_payment(request):
    """
        I used ajax call to call this method.
    """
    merchant_trade_no = hashlib.sha224(str(datetime.datetime.now())).hexdigest().upper()
    merchant_trade_no = merchant_trade_no[0:19]

    # Initialize the allPay config.
    ap = AllPay({'TotalAmount': 300, 'ChoosePayment': 'ATM', 'MerchantTradeNo': 'merchant_trade_no', 'ItemName': "Default Item Name"})
    dict_url = ap.check_out()
    print(dict_url)

    #if the second parameter is true, send out automatically the allpay form.
    form_html = ap.gen_check_out_form(dict_url, True)

    print form_html
    return HttpResponse(json.dumps({'status': '200', 'form_html': form_html}))

@csrf_exempt
def get_feedback(request):
    """
    Feedback from allpay after the customer paid.
    :param request:
    :return:
    """
    req_post = request.POST

    returns = AllPay.checkout_feedback(req_post)
    logging.info(str(returns))
    if returns:
        if returns['RtnCode'] == '1':
            """
              payment is paid by customer.
            """
            # do your work here.
            return HttpResponse('1|OK')
        else:
            return HttpResponse('0|Bad Request')
    else:
        return HttpResponse('0|Bad Request')


text:
=begin

Copyright 2012-2013 inBloom, Inc. and its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=end

require 'rest-client'
require 'json'
require 'builder'
require 'rexml/document'
include REXML
require File.expand_path("../../../utils/common", __FILE__)

Transform /^\/(<[^"]*>)$/ do |uri_placeholder|
  uri = "/v1.5/" + Transform(uri_placeholder)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/(<[^"]*>)\/(<[^"]*>)$/ do |uri_placeholder1, uri_placeholder2|
  uri = "/v1.5/" + Transform(uri_placeholder1) + "/" + Transform(uri_placeholder2)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/([^"<>]*)\/(<[^"]*>)$/ do |uri_placeholder1, uri_placeholder2|
  uri = "/v1.5/" + uri_placeholder1 + "/" + Transform(uri_placeholder2)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)$/ do |uri_placeholder1, uri_placeholder2, uri_placeholder3|
  uri = "/v1.5/" + Transform(uri_placeholder1) + "/" + Transform(uri_placeholder2) + "/" + Transform(uri_placeholder3)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)$/ do |uri_placeholder1, uri_placeholder2, uri_placeholder3, uri_placeholder4|
  uri = "/v1.5/" + Transform(uri_placeholder1) + "/" + Transform(uri_placeholder2) + "/" + Transform(uri_placeholder3) + "/" + Transform(uri_placeholder4)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)$/ do |uri_placeholder1, uri_placeholder2, uri_placeholder3, uri_placeholder4, uri_placeholder5|
  uri = "/v1.5/" + Transform(uri_placeholder1) + "/" + Transform(uri_placeholder2) + "/" + Transform(uri_placeholder3) + "/" + Transform(uri_placeholder4) + "/" + Transform(uri_placeholder5)
  #puts "URI = #{uri}"
  uri
end

Transform /^\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)\/(<[^"]*>)(\?.*?)$/ do |uri_placeholder1, uri_placeholder2, uri_placeholder3, uri_placeholder4, uri_placeholder5, query_params|
  uri = "/v1.5/" + Transform(uri_placeholder1) + "/" + Transform(uri_placeholder2) + "/" + Transform(uri_placeholder3) + "/" + Transform(uri_placeholder4) + "/" + Transform(uri_placeholder5) + query_params
  puts "URI = #{uri}"
  uri
end

###############################################################################
# GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN GIVEN
###############################################################################

Given /^"([^"]*)" is "([^"]*|<[^"]*>)"$/ do |key, value|
  @fields = {} if !defined? @fields
  @fields[key] = convert(value)
end

Given /^an invalid entity json document for a "([^"]*)"$/ do |arg1|
  @fields = {}
end

###############################################################################
# WHEN WHEN WHEN WHEN WHEN WHEN 2WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN
###############################################################################

When /^I create an empty json object$/ do
  @fields = Hash[]
end

# TODO: Remove these duplicate steps
When /^I navigate to POST "([^"]*)"$/ do |post_uri|
  data = prepareData(@format, @fields)
  restHttpPost(post_uri, data)
  @res.should_not be_nil, 'Response from rest-client POST is nil'
end

When /^I set the "([^"]*)" array to (.*)$/ do |property,value|
  @fields = {} if !defined? @fields
  if (value.is_a?(Array))
    step "\"#{property}\" is \"#{value}\""
  else
    @fields[property] = eval(value)
  end
end

When /^I set the "([^"]*)" to "([^"]*)"$/ do |property,value|
  step "\"#{property}\" is \"#{value}\""
end

When /^I navigate to PUT "([^<>"]*)"$/ do |url|
  @result = @fields if !defined? @result
  @result.update(@fields)
  data = prepareData(@format, @result)
  restHttpPut(url, data)
  assert(@res != nil, "Response from rest-client PUT is nil")
end

When /^I navigate to PUT "([^"]*<[^"]*>)"$/ do |url|
  @result = @fields if !defined? @result
  @result.update(@fields)
  data = prepareData(@format, @result)
  restHttpPut(url, data)
  assert(@res != nil, "Response from rest-client PUT is nil")
end

###############################################################################
# THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN
###############################################################################

Then /^the "([^\"]*)" should be "([^\"]*)"$/ do |arg1, arg2|
  @result = @res if !defined? @result
  if(arg1 == 'birthDate')
    assert(@result['birthData'][arg1] == arg2, "Expected data incorrect: Expected #{arg2} but got #{@result[arg1]}")
  else
    assert(@result[arg1].to_s == arg2, "Expected data incorrect: Expected #{arg2} but got #{@result[arg1]}")
  end
end

 Then /^the "name" should be "([^\"]*)" "([^\"]*)" "([^\"]*)"$/ do |first_name, middle_name, last_name|
  @result = @res if !defined? @result
  assert(@result["name"] != nil, "Name is nil")

  expected_middle_name = ""
  expected_first_name = @result["name"]["firstName"]
  expected_middle_name = @result["name"]["middleName"] unless middle_name == ""
  expected_last_name = @result["name"]["lastSurname"]

  assert(expected_first_name == first_name, "Unexpected first name. Input: #{first_name} Expected: #{expected_first_name}")
  assert(expected_middle_name == middle_name, "Unexpected middle name. Input: #{middle_name} Expected: #{expected_middle_name}")
  assert(expected_last_name == last_name, "Unexpected last name. Input: #{last_name} Expected: #{expected_last_name}")
end

Then /^I should receive a collection with (\d+) elements$/ do |count|
  count = count.to_i
  @result.should_not be_nil, 'Response contains no data'
  @result.should be_a_kind_of(Array), "Expected array of links, got #{@result}"
  @result.length.should == count
end

Then /^occurrence (\d+) of entity "([^"]*)" should be "([^"]*)"$/ do |position, key, value|
  assert(@result != nil, "Response contains no data")
  position = position.to_i - 1
  assert(@result[position].is_a?(Hash), "Response contains #{@result[position].class}, expected Hash")
  assert(@result[position].has_key?(key), "Response does not contain key #{key}")
  if @result[position][key].is_a?(Array)
    if value.is_a?(Array)
      assert(@result[position][key] == value, "Expected (array) #{key} to equal #{value}, received #{@result[position][key]}")
    else
      assert(@result[position][key] == eval(value), "Expected (array2) #{key} to equal #{value}, received #{@result[position][key]}")
    end
  else
    assert(@result[position][key] == convert(value), "Expected #{key} to equal #{value}, received #{@result[position][key]}")
  end
end

Then /^"([^"]*)" should be "([^"]*)"$/ do |key, value|
  assert(@result != nil, "Response contains no data")
  assert(@result.is_a?(Hash), "Response contains #{@result.class}, expected Hash")
  assert(@result.has_key?(key), "Response does not contain key #{key}")
  if @result[key].is_a?(Array)
    if value.is_a?(Array)
      assert(@result[key] == value, "Expected (array) #{key} to equal #{value}, received #{@result[key]}")
    else
      assert(@result[key] == eval(value), "Expected (array2) #{key} to equal #{value}, received #{@result[key]}")
    end
  else
    assert(@result[key] == convert(value), "Expected #{key} to equal #{value}, received #{@result[key]}")
  end
end

Then /^"([^"]*)" should contain "([^"]*)"$/ do |key, value|
  assert(@result != nil, "Response contains no data")
  assert(@result.is_a?(Hash), "Response contains #{@result.class}, expected Hash")
  assert(@result.has_key?(key), "Response does not contain key #{key}")
  assert(@result[key].is_a?(Array), "Response value is not an array for #{key}. Consider \"XXX should be XXX\" step.")
  assert(@result[key].include?(value), "Expected (array2) #{key} to contain #{value}, received #{@result[key]}")
end

Then /^the response should contain the appropriate fields and values$/ do
  EntityProvider.verify_entities_match(@fields.to_hash, @result.to_hash)
end

Then /^the error message should indicate "([^"]*)"$/ do |error_message|
  if(@res.is_a?(String))
    assert(@res =~ /.*#{Regexp.escape(error_message)}.*$/, "Reference error not caught. Check association schema definition.")
  else
    assert(@res.is_a?(Hash), "Response contains #{@res.class}, expected Hash")
    assert(@res.has_key?('message'), "Server response does not contain 'message'")
    assert(@res['message'] =~ /#{Regexp.escape(error_message)}$/, "Reference error not caught. Check association schema definition.")
  end
end

Then /^each entity's "([^"]*)" should be "([^"]*)"$/ do |key, value|
   @result.each do |entity|
    assert(entity.has_key?(key), "Entity does not even contain key #{key}")
    assert(entity[key]==value, "Entity's value for key #{key} is not #{value} (was #{entity[key]})")
  end
end

Then /^each entity's "([^"]*)" should not be "([^"]*)"$/ do |key, value|
   @result.each do |entity|
    assert(entity.has_key?(key), "Entity does not even contain key #{key}")
    assert(entity[key] !=value, "Entity's value for key #{key} is not #{value} (was #{entity[key]})")
  end
end

Then /^each entity's "([^"]*)" should be in the array "([^"]*)"$/ do |key, value|
   @result.each do |entity|
    assert(entity.has_key?(key), "Entity does not even contain key #{key}")
    containsValue = false
    value.each do |valueSegment|
      if (valueSegment == entity[key])
        containsValue = true
      end
    end
    assert(containsValue, "Entity's value for key #{key} is not in array #{value} (was #{entity[key]})")
  end
end

Then /^each entity's "([^"]*)" should contain "([^"]*)"$/ do |key, value|
   @result.each do |entity|
    assert(entity.has_key?(key), "Entity does not even contain key #{key}")
    containsValue = false
    entity[key].each do |resultValue|
      if (resultValue == value)
        containsValue = true
      end
    end
    assert(containsValue, "Entity's value for key #{key} does not contain #{value} (was #{entity[key]})")
  end
end

Then /^in each entity, I should receive a link named "([^"]*)" with URI "([^"]*)"$/ do |rel, href|
  @result.each do |entity|
    foundInEntity = false
    entity["links"].each do |link|
      if link["rel"] == rel && link["href"] =~ /#{Regexp.escape(href)}$/
        foundInEntity = true
      end
    end
    assert(foundInEntity, "A link labeled #{rel} with value #{href} was not present in one or more returned entities")
  end
end

Then /^I should find and store a link named "(.*?)"$/ do |rel|
  foundInEntity = false
  @result["links"].each do |link|
    if link["rel"] == rel
      @link = link["href"]
      foundInEntity = true
    end
  end
  assert(foundInEntity, "A link labeled #{rel} with value #{href} was not present in one or more returned entities")
end

Then /^in occurrence (\d+) I should receive a link named "([^"]*)" with URI "([^"]*)"$/ do |position, rel, href|
  position = position.to_i - 1
  foundInEntity = false
  puts("\n-----\nThe result is #{@result[position].inspect}\n-----\n")
  @result[position]["links"].each do |link|
    if link["rel"] == rel && link["href"] =~ /#{Regexp.escape(href)}$/
      foundInEntity = true
    end
  end
  assert(foundInEntity, "A link labeled #{rel} with value #{href} was not present in one or more returned entities")
end

Then /^in an entity, I should receive a link named "([^"]*)" with URI "([^"]*)"$/ do |rel, href|
  found = false
  @result.each do |entity|
    entity["links"].each do |link|
      if link["rel"] == rel && link["href"] =~ /#{Regexp.escape(href)}$/
        found = true
      end
    end
  end
  assert(found, "A link labeled #{rel} with value #{href} was not present in one or more returned entities")
end

Then /^I should receive a collection of "([^"]*)" entities$/ do |number_of_entities|
  assert(@result != nil, "Response contains no data")
  assert(@result.is_a?(Array), "Response contains #{@result.class}, expected Array")
  assert(@result.length == Integer(number_of_entities), "Expected response of size #{number_of_entities}, received #{@result.length}");
end

Then /^in each entity, I should receive a link named "([^"]*)" for a value from array "([^"]*)" with URI prefix "([^"]*)" and URI suffix "([^"]*)"$/ do |rel, list, prefix, suffix|
  @result.each do | entity|
    assert(entity.has_key?("links"), "Response contains no links")
    assert(list.is_a?(Array), "ID list is a #{list.class}, expected Array")

    found = false

    list.each do | id |
      new_link=prefix + "/" + id + "/" + suffix
      entity["links"].each do |link|
        if link["rel"] == rel && link["href"] =~ /#{Regexp.escape(new_link)}$/
          found = true
        end
      end
    end
    assert(found, "Link not found rel=#{rel}")
  end
end

Then /^in each entity, I should receive a link named "([^"]*)" for a value from array "([^"]*)" with URI prefix "([^"]*)" and URI suffix "([^"]*)" and "([^"]*)"$/ do |rel, list, prefix, suffix1, suffix2|
  @result.each do | entity|
    assert(entity.has_key?("links"), "Response contains no links")
    assert(list.is_a?(Array), "ID list is a #{list.class}, expected Array")

    found = false

    list.each do | id |
      new_link=prefix + "/" + id + "/" + suffix1 + "/" + suffix2
      entity["links"].each do |link|
        if link["rel"] == rel && link["href"] =~ /#{Regexp.escape(new_link)}$/
          found = true
        end
      end
    end
    assert(found, "Link not found rel=#{rel}")
  end
end

# Function data_builder
# Inputs: None
# Output: Data object in json or XML format depending on what the @format variable is set to
# Returns: Nothing, see Output
# Description: Helper function to create json or XML data structures to PUT or POST
#                   to reduce replication of code
def data_builder
  if @format == "application/json"
  formatted_data = @fields.to_json
  else
    assert(false, "Unsupported MIME type: #{@format}")
  end
  formatted_data
end

Then /^the response should contain the "([^"]*)" field$/ do  |school_year|
    jsonresult = JSON.parse(@res.body)
    jsonresult.each do |data|
        assert(data["schoolYear"] == school_year, "School year matches")
    end
end


text:
#region S# License

#endregion S# License
namespace StockSharp.Logging
{
	using System;

	/// <summary>
	/// Logs recipient interface.
	/// </summary>
	public interface ILogReceiver : ILogSource
	{
		/// <summary>
		/// To record a message to the log.
		/// </summary>
		/// <param name="message">A debug message.</param>
		void AddLog(LogMessage message);
	}

	/// <summary>
	/// The base implementation <see cref="ILogReceiver"/>.
	/// </summary>
	public abstract class BaseLogReceiver : BaseLogSource, ILogReceiver
	{
		/// <summary>
		/// Initialize <see cref="BaseLogReceiver"/>.
		/// </summary>
		protected BaseLogReceiver()
		{
		}

		void ILogReceiver.AddLog(LogMessage message)
		{
			RaiseLog(message);
		}
	}

	/// <summary>
	/// Global logs receiver.
	/// </summary>
	public class GlobalLogReceiver : ILogReceiver
	{
		private ILogReceiver App => LogManager.Instance?.Application;

		private GlobalLogReceiver()
		{
		}

		/// <summary>
		/// Instance.
		/// </summary>
		public static GlobalLogReceiver Instance { get; } = new GlobalLogReceiver();

		Guid ILogSource.Id => App?.Id ?? default;

		string ILogSource.Name
		{
			get => App?.Name;
			set { }
		}

		ILogSource ILogSource.Parent
		{
			get => App?.Parent;
			set => throw new NotSupportedException();
		}

		/// <inheritdoc />
		public event Action<ILogSource> ParentRemoved
		{
			add { }
			remove { }
		}

		LogLevels ILogSource.LogLevel
		{
			get => App?.LogLevel ?? default;
			set
			{
				var app = App;

				if (app == null)
					return;

				app.LogLevel = value;
			}
		}

		DateTimeOffset ILogSource.CurrentTime => App?.CurrentTime ?? default;

		bool ILogSource.IsRoot => true;

		event Action<LogMessage> ILogSource.Log
		{
			add
			{
				var app = App;

				if (app == null)
					return;

				app.Log += value;
			}
			remove
			{
				var app = App;

				if (app == null)
					return;

				app.Log -= value;
			}
		}

		void ILogReceiver.AddLog(LogMessage message)
		{
			App?.AddLog(message);
		}

		void IDisposable.Dispose()
		{
		}
	}
}


text:
package wolf;

import java.util.ArrayList;
import wolf.enums.NativeBinOp;
import wolf.interfaces.Arg;
import wolf.interfaces.Visitor;
import wolf.interfaces.WolfFunction;

/**
 * A Native Binary, or binary functions native to WOLF
 * @author Kevin Dittmar
 * @author William Ezekiel
 * @author Joseph Alacqua
 * @version Apr 3, 2016
 */
public class NativeBinary implements WolfFunction {
    NativeBinOp binary_op;
    Arg arg_left;
    Arg arg_right;

    public NativeBinary(NativeBinOp binary_op, Arg arg_left, Arg arg_right) {
        this.binary_op = binary_op;
        this.arg_left = arg_left;
        this.arg_right = arg_right;
    }

    /**
     * Accept a visitor
     * @param v a visitor
     * @return type of the return value of the binary function
     */
    @Override
    public Type accept(Visitor v) {
        Type left_type = (Type) v.visit(arg_left);
        Type right_type = (Type) v.visit(arg_right);
        boolean areSameType = (left_type.equals(right_type) ||
            (left_type.isNumeric() && right_type.isNumeric()));

        switch(binary_op) {
            case PLUS:
            case MINUS:
            if(!areSameType) {
                TypeErrorReporter.mismatchArgTypes(
                    arg_left, left_type,
                    arg_right, right_type
                );
            }
            return left_type;
            case MULT:
            case DIV:
            case MOD:
                if (!left_type.isNumeric() || !right_type.isNumeric()) {
                    ArrayList<Type> types = new ArrayList<>();
                    types.add(new Type(FlatType.INTEGER));
                    types.add(new Type(FlatType.FLOAT));
                    TypeErrorReporter.mismatchErrorBinary(
                        arg_left, left_type,
                        arg_right, right_type,
                        binary_op.toString(), types);
                }
                return left_type;
            case LT:
            case GT:
            case LTE:
            case GTE:
                if (!left_type.isNumeric() || !right_type.isNumeric()) {
                    ArrayList<Type> types = new ArrayList<>();
                    types.add(new Type(FlatType.INTEGER));
                    types.add(new Type(FlatType.FLOAT));
                    TypeErrorReporter.mismatchErrorBinary(
                        arg_left, left_type,
                        arg_right, right_type,
                        binary_op.toString(), types);
                }
                return new Type(FlatType.INTEGER);
            case AND:
            case OR:
            case XOR:
                if (left_type.flat_type != FlatType.INTEGER ||
                    right_type.flat_type != FlatType.INTEGER) {
                    ArrayList<Type> types = new ArrayList<>();
                    types.add(new Type(FlatType.INTEGER));
                    TypeErrorReporter.mismatchErrorBinary(
                        arg_left, left_type,
                        arg_right, right_type,
                        binary_op.toString(), types);
                }
                return new Type(FlatType.INTEGER);
            case EQUAL:
            case NOT_EQUAL:
                return new Type(FlatType.INTEGER);
            default:
                System.err.println("Invalid Binary Operator!");
                return null;
        }
    }

    /**
     * @return string representation of a binary op
     */
    @Override
    public String toString() {
        return binary_op.toString() + "(" +
            arg_left.toString() + ", " + arg_right.toString() + ")";
    }
}


text:
package org.apache.james.protocols.smtp.core;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;

import org.apache.james.protocols.api.Response;
import org.apache.james.protocols.smtp.SMTPResponse;
import org.apache.james.protocols.smtp.SMTPRetCode;
import org.apache.james.protocols.smtp.SMTPSession;
import org.apache.james.protocols.smtp.dsn.DSNStatus;
import org.apache.james.protocols.smtp.hook.HookResult;
import org.apache.james.protocols.smtp.hook.QuitHook;

/**
 * Handles QUIT command
 */
public class QuitCmdHandler extends AbstractHookableCmdHandler<QuitHook> {

    /**
     * The name of the command handled by the command handler
     */
    private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("QUIT"));

    private static final Response SYNTAX_ERROR;
    static {
        SMTPResponse response = new SMTPResponse(
                SMTPRetCode.SYNTAX_ERROR_COMMAND_UNRECOGNIZED, DSNStatus
                .getStatus(DSNStatus.PERMANENT,
                        DSNStatus.DELIVERY_INVALID_ARG)
                + " Unexpected argument provided with QUIT command");
        response.setEndSession(true);
        SYNTAX_ERROR = response.immutable();
    }

    /**
     * Handler method called upon receipt of a QUIT command. This method informs
     * the client that the connection is closing.
     *
     * @param session
     *            SMTP session object
     * @param argument
     *            the argument passed in with the command by the SMTP client
     */
    private Response doQUIT(SMTPSession session, String argument) {
        if ((argument == null) || (argument.length() == 0)) {
            StringBuilder response = new StringBuilder();
            response.append(
                    DSNStatus.getStatus(DSNStatus.SUCCESS,
                            DSNStatus.UNDEFINED_STATUS)).append(" ").append(
                    session.getConfiguration().getHelloName()).append(
                    " Service closing transmission channel");
            SMTPResponse ret = new SMTPResponse(SMTPRetCode.SYSTEM_QUIT, response);
            ret.setEndSession(true);
            return ret;
        } else {
            return SYNTAX_ERROR;
        }
    }

    /**
     * @see org.apache.james.protocols.api.handler.CommandHandler#getImplCommands()
     */
    public Collection<String> getImplCommands() {
    	return COMMANDS;
    }

    /**
     * @see org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler#doCoreCmd(org.apache.james.protocols.smtp.SMTPSession,
     *      java.lang.String, java.lang.String)
     */
    protected Response doCoreCmd(SMTPSession session, String command,
            String parameters) {
        return doQUIT(session, parameters);
    }

    /**
     * @see org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler#doFilterChecks(org.apache.james.protocols.smtp.SMTPSession,
     *      java.lang.String, java.lang.String)
     */
    protected Response doFilterChecks(SMTPSession session, String command,
            String parameters) {
        return null;
    }

    /**
     * @see org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler#getHookInterface()
     */
    protected Class<QuitHook> getHookInterface() {
        return QuitHook.class;
    }

    /**
     * {@inheritDoc}
     */
    protected HookResult callHook(QuitHook rawHook, SMTPSession session, String parameters) {
        return rawHook.doQuit(session);
    }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Security.Permissions;
using System.Collections;
using System.Runtime.Serialization;

namespace System.Security
{
    [Serializable]
    public partial class PermissionSet : ICollection, IEnumerable, IDeserializationCallback, ISecurityEncodable, IStackWalk
    {
        public PermissionSet(PermissionState state) { }
        public PermissionSet(PermissionSet permSet) { }
        public virtual int Count { get { return 0; } }
        public virtual bool IsReadOnly { get { return false; } }
        public virtual bool IsSynchronized { get { return false; } }
        public virtual object SyncRoot { get { return null; } }
        public IPermission AddPermission(IPermission perm) { return default(IPermission); }
        public void Assert() { }
        public bool ContainsNonCodeAccessPermissions() { return false; }
        [Obsolete]
        public static byte[] ConvertPermissionSet(string inFormat, byte[] inData, string outFormat) { return null; }
        public virtual PermissionSet Copy() { return default(PermissionSet); }
        public virtual void CopyTo(Array array, int index) { }
        public void Demand() { }
        [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
        public void Deny() { throw new NotSupportedException(); }
        public override bool Equals(object o) => base.Equals(o);
        public virtual void FromXml(SecurityElement et) { }
        public IEnumerator GetEnumerator() { return Array.Empty<object>().GetEnumerator(); }
        public override int GetHashCode() => base.GetHashCode();
        public IPermission GetPermission(Type permClass) { return default(IPermission); }
        public PermissionSet Intersect(PermissionSet other) { return default(PermissionSet); }
        public bool IsEmpty() { return false; }
        public bool IsSubsetOf(PermissionSet target) { return false; }
        public bool IsUnrestricted() { return false; }
        public void PermitOnly() { throw new PlatformNotSupportedException(); }
        public IPermission RemovePermission(Type permClass) { return default(IPermission); }
        public static void RevertAssert() { }
        public IPermission SetPermission(IPermission perm) { return default(IPermission); }
        void IDeserializationCallback.OnDeserialization(object sender) { }
        public override string ToString() => base.ToString();
        public virtual SecurityElement ToXml() { return default(SecurityElement); }
        public PermissionSet Union(PermissionSet other) { return default(PermissionSet); }
    }
}


text:
<?php
/**
 * Created by Lezas.
 * Date: 2017-04-01
 * Time: 15:55
 */

namespace MessageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use FOS\MessageBundle\Entity\Thread as BaseThread;
use FOS\MessageBundle\Entity\ThreadMetadata;

/**
 * @ORM\Entity
 * @ORM\Table(name="mess__thread")
 */
class MessageThread extends BaseThread
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\ManyToOne(targetEntity="MainBundle\Entity\User")
     * @var \FOS\MessageBundle\Model\ParticipantInterface
     */
    protected $createdBy;

    /**
     * @ORM\OneToMany(
     *   targetEntity="MessageBundle\Entity\Message",
     *   mappedBy="thread"
     * )
     * @var Message[]|Collection
     */
    protected $messages;

    /**
     * @ORM\OneToMany(
     *   targetEntity="MessageBundle\Entity\MessageThreadMetadata",
     *   mappedBy="thread",
     *   cascade={"all"}
     * )
     * @var ThreadMetadata[]|Collection
     */
    protected $metadata;
}


text:
package com.codeabovelab.dm.cluman.cluster.docker.management;

import com.codeabovelab.dm.cluman.model.ContainerBase;
import com.codeabovelab.dm.cluman.model.DockerLogEvent;
import com.codeabovelab.dm.common.cache.CacheInvalidator;
import com.codeabovelab.dm.common.mb.MessageBus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.Cache;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;

/**
 */
@Component
class DockerCacheInvalidator implements CacheInvalidator {

    private final Map<String, Consumer<DockerLogEvent>> listeners = new ConcurrentHashMap<>();

    @Autowired
    @Qualifier(DockerLogEvent.BUS)
    private MessageBus<DockerLogEvent> logEvents;

    @SuppressWarnings("unchecked")
    @Override
    public void init(Cache cache, Map<String, String> args) {
        String name = cache.getName();
        if(!DockerService.CACHE_CONTAINER_DETAILS.equals(name)) {
            return;
        }
        Consumer<DockerLogEvent> listener = this.listeners.computeIfAbsent(name, (n) -> this.makeInvalidator(cache));
        logEvents.subscribe(listener);
    }

    private Consumer<DockerLogEvent> makeInvalidator(Cache cache) {
        return (e) -> {
            ContainerBase container = e.getContainer();
            String name = container.getName();
            String id = container.getId();
            if(name != null && id != null) {
                cache.evict(name);
                cache.evict(id);
                // docker also can return containers by its 12 symbols id
                cache.evict(id.substring(0, 12));
            }
        };
    }

    @PreDestroy
    void preDestroy() {
        listeners.values().forEach((l) -> this.logEvents.asSubscriptions().unsubscribe(l));
    }
}


text:
"""Unit test suite for the models of the application."""

from nose.tools import eq_
from tg import config
from sample_ecommerce.tests import load_app
from sample_ecommerce.tests import setup_db, teardown_db

__all__ = ['ModelTest']

def setup():
    """Setup test fixture for all model tests."""
    load_app()
    setup_db()

def teardown():
    """Tear down test fixture for all model tests."""
    teardown_db()

class ModelTest(object):
    """Base unit test case for the models."""

    klass = None
    attrs = {}

    def setUp(self):
        """Setup test fixture for each model test method."""
        try:
            new_attrs = {}
            new_attrs.update(self.attrs)
            new_attrs.update(self.do_get_dependencies())
            self.obj = self.klass(**new_attrs)
            self.obj.__mongometa__.session.flush()
            self.obj.__mongometa__.session.clear()
            return self.obj
        except:
            config['pylons.app_globals'].ming_datastore.conn.clear_all()
            raise

    def tearDown(self):
        """Tear down test fixture for each model test method."""
        config['pylons.app_globals'].ming_datastore.conn.clear_all()

    def do_get_dependencies(self):
        """Get model test dependencies.

        Use this method to pull in other objects that need to be created
        for this object to be build properly.

        """
        return {}

    def test_create_obj(self):
        """Model objects can be created"""
        pass

    def test_query_obj(self):
        """Model objects can be queried"""
        obj = self.klass.query.find({}).first()
        for key, value in self.attrs.items():
            eq_(getattr(obj, key), value)


text:
module RedTape
  class Error < StandardError; end

  class ValidationError < Error; end
end


text:
namespace Azure.ResourceManager.AppService.Models
{
    /// <summary> The action to take when an unauthenticated client attempts to access the app. </summary>
    public enum UnauthenticatedClientAction
    {
        /// <summary> RedirectToLoginPage. </summary>
        RedirectToLoginPage,
        /// <summary> AllowAnonymous. </summary>
        AllowAnonymous
    }
}


text:
function [mph] = kmph2mph(kmph)
% Convert speed from miles per hour to miles per hour
% Chad A. Greene 2012
mph = kmph*0.6213711922373;


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <version>2.2</version>
    <name>Lembas-backend</name>
    <groupId>com.happyblueduck.lembas</groupId>
    <artifactId>lembas-backend</artifactId>

    <properties>
        <appengine.app.version>1</appengine.app.version>
        <appengine.target.version>1.9.0</appengine.target.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <description>
        Lembas core object library for serialization and object description generator
    </description>
    <scm>
        <url>https://github.com/anlcan/Lembas-core</url>
    </scm>

    <developers>
        <developer>
            <name>Anil Can Baykal</name>
            <email>anilcanbaykal@gmail.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU General Public License (GPL)</name>
            <url>http://www.gnu.org/licenses/gpl.txt</url>
        </license>
    </licenses>

    <url>http://maven.apache.org</url>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>com.happyblueduck.lembas</groupId>
            <artifactId>lembas-core</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
          <groupId>com.google.collections</groupId>
          <artifactId>google-collections</artifactId>
          <version>1.0</version>
        </dependency>

        <dependency>
          <groupId>com.googlecode.json-simple</groupId>
          <artifactId>json-simple</artifactId>
          <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
          <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
          <artifactId>org.apache.commons.codec</artifactId>
          <version>1.3.0</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java/war/</sourceDirectory>
        <!--<testSourceDirectory>src/test/</testSourceDirectory>-->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <version>2.5.1</version>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <!--http://central.sonatype.org/pages/apache-maven.html-->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.2</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>


text:
var axios = require('axios');
var fs = require('fs');
var _ = require('lodash');
var stringify = require('json-stable-stringify');

module.exports = {
  testUpstreamChanges: testUpstreamChanges
};

function toString(x) {
  return stringify(x, { space: '    ' });
}

function defaultRunner(description, callback) {
  return callback();
}

function defaultAssert(actual, expected) {
  var act = toString(actual);
  if (act !== toString(expected)) {
    throw new Error('Fixture mismatch, actual: ' + act);
  }
}

var defaults = {
  urls: [],
  runner: defaultRunner,
  base: '',
  method: 'GET',
  headers: {},
  ignores: [],
  placeholder: null,
  transforms: [],
  learn: false,
  assert: defaultAssert,
  fixtures: '/dev/null/'
};

function testUpstreamChanges(options) {

  return Promise.all((options.urls || []).map(function(url) {

    return opt('runner')(opt('url'), function() {
      return axios({
        url: opt('base') + opt('url'),
        method: opt('method'),
        headers: opt('headers')
      }).then(test, test);
    });

    function opt(name) {
      if (name === 'url' && _.isString(url)) return url;
      if (url[name]) return url[name];
      if (options[name]) return options[name];
      return defaults[name];
    }

    function test(res) {

      if (_.isError(res)) throw res;

      var actual = _.omit(res, 'config');

      opt('ignores').forEach(function(ignore) {
        if (_.has(actual, ignore)) {
          _.set(actual, ignore, opt('placeholder'));
        }
      });

      opt('transforms').forEach(function(transform) {
        try {
          transform(actual);
        } catch (e) {}
      });

      if (opt('learn')) {
        fs.writeFileSync(filename(), toString(actual));
      } else {
        var expected = JSON.parse(fs.readFileSync(filename()));
        opt('assert')(actual, expected);
      }

    }

    function filename() {
      return opt('fixtures')
        + (opt('method') !== defaults.method ? opt('method') + '_' : '')
        + opt('url')
          .replace(/^\//, '')
          .replace(/[^a-zA-Z0-9-]/g, '_')
          .replace(/_+/g, '_')
        + '.json';
    }

  }));

}


text:
set -e

function clean_up(){
  echo "Do you want to clean local clone repo ${LOCAL_CLONE_DIR}? [y|N]"
  read confirmation
  if [[ $confirmation = "y" ]]; then
    cd ~
    rm -rf ${LOCAL_CLONE_DIR}
    echo "Cleaned up local repo."
  fi
}

echo "Enter the release version, e.g. 2.21.0:"
read RELEASE
LOCAL_CLONE_DIR="beam_release_${RELEASE}"
cd ~
if [[ -d ${LOCAL_CLONE_DIR} ]]; then
  echo "Deleting existing local clone repo ${LOCAL_CLONE_DIR}."
  rm -rf ${LOCAL_CLONE_DIR}
fi
mkdir ${LOCAL_CLONE_DIR}
cd ${LOCAL_CLONE_DIR}

virtualenv deploy_pypi_env
source ./deploy_pypi_env/bin/activate
pip install twine

wget -r --no-parent -A zip,whl "https://dist.apache.org/repos/dist/dev/beam/${RELEASE}/python"
cd "dist.apache.org/repos/dist/dev/beam/${RELEASE}/python/"
echo "Will upload the following files to PyPI:"
ls
echo "Are the files listed correct? [y|N]"
read confirmation
if [[ $confirmation != "y" ]]; then
  echo "Exiting without deploying artifacts to PyPI."
  clean_up
  exit
fi
twine upload *

clean_up


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;

namespace Exceptionless.Api.Hubs {
    public class ConnectionMapping {
        private readonly ConcurrentDictionary<string, HashSet<string>> _connections = new ConcurrentDictionary<string, HashSet<string>>();

        public void Add(string key, string connectionId) {
            if (key == null)
                return;

            _connections.AddOrUpdate(key, new HashSet<string>(new[] { connectionId }), (_, hs) => {
                hs.Add(connectionId);
                return hs;
            });
        }

        public ICollection<string> GetConnections(string key) {
            if (key == null)
                return new List<String>();

            return _connections.GetOrAdd(key, new HashSet<string>());
        }

        public void Remove(string key, string connectionId) {
            if (key == null)
                return;

            bool shouldRemove = false;
            _connections.AddOrUpdate(key, new HashSet<string>(), (_, hs) => {
                hs.Remove(connectionId);
                if (hs.Count == 0)
                    shouldRemove = true;

                return hs;
            });

            if (!shouldRemove)
                return;

            HashSet<string> connections;
            if (_connections.TryRemove(key, out connections) && connections.Count > 0)
                _connections.TryAdd(key, connections);
        }
    }
}


text:
module app.importers {
    "use strict";
    export class PackageImporter implements IImporter {
        importObject(data: model.IObjectTree, callback:{ (data: model.IDojoObject): void }):void {
            var result: model.DojoPackage = new model.DojoPackage();
            result.setName(data.fullname);

            callback(result);
            app.Status.markRequestAsFilled();
        }
    }
}


text:
<?php

namespace LandingPageBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class LandingPageBundle extends Bundle
{
}


text:
@echo off
::
:: Prebuild generator for the OpenMetaverse Library
::
:: Command Line Options:
:: (none)            - create solution/project files and create compile.bat file to build solution
:: msbuild           - Create project files, compile solution
:: msbuild runtests  - create project files, compile solution, run unit tests
:: msbuild docs      - create project files, compile solution, build API documentation
:: msbuild docs dist - Create project files, compile solution, run unit tests, build api documentation, create binary zip
::                   - and exe installer
::
:: nant		     - Create project files, run nant to compile solution
:: nant runtests     - Create project files, run nant to compile solution, run unit tests
::

echo ##########################################
echo creating prebuild files for: vs2010
echo Parameters: %1 %2
echo ##########################################

:: run prebuild to generate solution/project files from prebuild.xml configuration file
bin\Prebuild.exe /target vs2010

:: build compile.bat file based on command line parameters
echo @echo off > compile.bat
if(.%1)==(.) echo C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild OpenMetaverse.sln >> compile.bat

if(.%1)==(.msbuild) echo echo ==== COMPILE BEGIN ==== >> compile.bat
if(.%1)==(.msbuild) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe /p:Configuration=Release OpenMetaverse.sln >> compile.bat
if(.%1)==(.msbuild) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%1)==(.nant) echo nant >> compile.bat
if(.%1)==(.nant) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.docs) echo echo ==== GENERATE DOCUMENTATION BEGIN ==== >> compile.bat
if(.%2)==(.docs) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe /p:Configuration=Release docs\OpenMetaverse.shfbproj >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%2)==(.docs) echo 7z.exe a -tzip docs\documentation.zip docs\trunk >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.runtests) echo echo ==== UNIT TESTS BEGIN ==== >> compile.bat
if(.%2)==(.runtests) echo nunit-console bin\OpenMetaverse.Tests.dll /exclude:Network /nodots /labels /xml:testresults.xml >> compile.bat

if(.%2)==(.runtests) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

:: nsis compiler needs to be in path
if(.%3)==(.dist) echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat
if(.%3)==(.dist) echo makensis.exe /DPlatform=test docs\OpenMetaverse-installer.nsi >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%3)==(.dist) echo 7z.exe a -tzip dist\openmetaverse-dist.zip @docs\distfiles.lst >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

echo :SUCCESS >> compile.bat
echo echo Build Successful! >> compile.bat
echo exit /B 0 >> compile.bat
echo :FAIL >> compile.bat
echo echo Build Failed, check log for reason >> compile.bat
echo exit /B 1 >> compile.bat

:: perform the appropriate action
if(.%1)==(.msbuild) compile.bat
if(.%1)==(.nant) compile.bat
if(.%1)==(.dist) compile.bat


text:
namespace arangodb {
class LogicalCollection;

class ClusterIndex : public Index {
 public:
  ClusterIndex(IndexId id, LogicalCollection& collection, ClusterEngineType engineType,
               Index::IndexType type, arangodb::velocypack::Slice const& info);

  ~ClusterIndex();

  void toVelocyPackFigures(velocypack::Builder& builder) const override;

  /// @brief return a VelocyPack representation of the index
  void toVelocyPack(velocypack::Builder& builder,
                    std::underlying_type<Index::Serialize>::type) const override;

  /// @brief if true this index should not be shown externally
  bool isHidden() const override {
    return false;  // do not generally hide indexes
  }

  IndexType type() const override { return _indexType; }

  char const* typeName() const override {
    return Index::oldtypeName(_indexType);
  }

  bool canBeDropped() const override {
    return _indexType != Index::TRI_IDX_TYPE_PRIMARY_INDEX &&
           _indexType != Index::TRI_IDX_TYPE_EDGE_INDEX;
  }

  bool isSorted() const override;

  bool hasSelectivityEstimate() const override;

  double selectivityEstimate(arangodb::velocypack::StringRef const& = arangodb::velocypack::StringRef()) const override;

  /// @brief update the cluster selectivity estimate
  void updateClusterSelectivityEstimate(double estimate) override;

  void load() override {}
  void unload() override {}
  size_t memory() const override { return 0; }

  Result drop() override { return Result(TRI_ERROR_NOT_IMPLEMENTED); }

  bool hasCoveringIterator() const override;

  /// @brief Checks if this index is identical to the given definition
  bool matchesDefinition(arangodb::velocypack::Slice const&) const override;

  Index::FilterCosts supportsFilterCondition(std::vector<std::shared_ptr<arangodb::Index>> const& allIndexes,
                                             arangodb::aql::AstNode const* node,
                                             arangodb::aql::Variable const* reference,
                                             size_t itemsInIndex) const override;

  Index::SortCosts supportsSortCondition(arangodb::aql::SortCondition const* sortCondition,
                                         arangodb::aql::Variable const* reference,
                                         size_t itemsInIndex) const override;

  /// @brief specializes the condition for use with the index
  arangodb::aql::AstNode* specializeCondition(arangodb::aql::AstNode* node,
                                              arangodb::aql::Variable const* reference) const override;

  void updateProperties(velocypack::Slice const&);

  std::vector<std::vector<arangodb::basics::AttributeName>> const& coveredFields() const override;

 protected:
  ClusterEngineType _engineType;
  Index::IndexType _indexType;
  velocypack::Builder _info;
  bool _estimates;
  double _clusterSelectivity;

  // Only used in RocksDB edge index.
  std::vector<std::vector<arangodb::basics::AttributeName>> _coveredFields;
};
}  // namespace arangodb


text:
#include "../../SDL_internal.h"

extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);

/* vi: set ts=4 sw=4 expandtab: */


text:
import React from 'react';

import Appbar from 'muicss/lib/react/appbar';
import Button from 'muicss/lib/react/button';
import Container from 'muicss/lib/react/container';
import Divider from 'muicss/lib/react/divider';
import Row from 'muicss/lib/react/row';
import Col from 'muicss/lib/react/col';
import { Link } from 'react-router';

import styles from '../styles.css';
import homeCover from '../images/home-cover.jpg'
import eventMarch from '../images/event-keep-taiwan-free-march.jpg'
import eventTWMatters from '../images/event-taiwan-matters.jpg'
import eventBubbleTea from '../images/event-bubble-tea.jpg'
import movementVideo from '../videos/keep-tw-free-bg.mp4'
import GoogleMapReact from 'google-map-react';

import LandingData from '../data/LandingData'

export default class Landing extends React.Component {
  render() {
    const viewPortWidth = window.innerWidth;
    const isMobile = viewPortWidth < 600;
    const mapCenter = isMobile ? [39.9518694, -75.602182] : [39.9662578,-75.1395344];
    return (

          <video poster={homeCover} width="100%" autoPlay loop muted className={styles.landingHeroVideo}>
            <source src={movementVideo} type="video/mp4"></source>
            Your browser does not support HTML5 video.
          </video>
          <Container className={styles.landingHeroCopy}>
            <Col md="8" md-offset="2">

2017 United Nations Membership for Taiwan / Keep Taiwan Free March

All members and allies of the Taiwanese community are invited to join this year's UN for Taiwan / Keep Taiwan Free rally!

              GET INVOLVED
            </Col>
          </Container>

        <Container className={styles.landingBody}>
          <Row>
            <Col md="4">

ABOUT THE MOVEMENT

Keep Taiwan Free

              {LandingData.welcomeMessage}
              <Link to="about" className={styles.mainBtn}>LEARN MORE</Link>
            </Col>
            <Col md="8">

            </Col>
          </Row>
        </Container>

          <Container>
            <Row className={styles.flexBox}>
              <Col md="4" className={styles.eventBox}>

EVENTS

2017 United Nations Membership for Taiwan / Keep Taiwan Free March

09/16 (Sat) 3:00-3:30PM

Assembly and Opening Remarks

Consulate General of the People's Republic of China in New York 520 12th Ave (42nd St and 12th Av)

09/16 (Sat) 3:30-5:00PM

March

09/16 (Sat) 5:00-5:30PM

Rally and Closing Remarks

United Nations Plaza

Dag Hammarskjold Plaza (47th St and 1st Av)

                  MAP

This year, we highlight Taiwan's achievements alongside Taiwan's increasing marginalization. We begin this year's rally at the Consulate General of the Peoples Republic of China, where allies from various activist communities will join us in condemning the human rights abuses and silencing of activists by the CCP. Then, we march across Manhattan to the United Nations Plaza, where we call upon United Nations General Assembly to hold themselves accountable to the standards they claim to uphold.

              GET INVOLVED
              </Col>
              <Col md="4" className={styles.eventBox}>

EVENTS

Taiwan Matters

09/16 (Sat) 2PM - 7PM

09/17 (Sun) 10AM - 5PM

Dag Hammarskjold Plaza

833 1st Avenue New York, NY

09/18 (Mon) 10AM - 5PM

09/20 (Wed) 10AM - 5PM

Bowling Greens

09/19 (Tue) 10AM - 5PM

City Hall Park

This year, in order for the world to see Taiwan, a group of Taiwanese architecture designers decided to team up with activists who have long advocated for Taiwan's membership in the UN on an art installation located directly across the UN's office, titled "Taiwan Matters". The installation consists of six parts, all of which imitate the geographical landscape of Taiwan. Visitors will be able to move around the pieces freely, enabling the art installation a new perspective, creating new spaces and functionalities.

              EXPLORE

On September 16th, from 5:30 to 6:30pm, after the Rally for Taiwan in UN, Cafe Philo will also invite Taiwanese speakers from all kinds of communities and backgrounds to share their stories and experiences.

              GET INVOLVED
              </Col>
              <Col md="4" className={styles.eventBox}>

EVENTS

NYC Bubble Tea Festival

Hello Taiwan Bubble Tea Festival is the first celebration of its kind in NYC for the delicious tasting chewy bobbles & bobas in freshly brewed tea with giant straws!

              GET INVOLVED
              </Col>
            </Row>
          </Container>

    );
  }
}


text:
const buffers = [];
let nread = 0;

var readStream;

readStream.on('data', function (chunk) {
    buffers.push(chunk);
    nread += chunk.length;
});

readStream.on('end', function () {
    let buffer = null;
    switch (buffers.length) {
    case 0:
        buffer = new Buffer(0);
        break;
    case 1:
        buffer = buffers[0];
        break;
    default:
        buffer = new Buffer(nread);
        for (let i = 0, pos = 0, l = buffers.length; i < l; i++) {
            const chunk = buffers[i];
            chunk.copy(buffer, pos);
            pos += chunk.length;
        }
        break;
    }
});


text:
/**
 * @file xpath.c
 * @brief xpath utility of libxml2
 * @author Y.Mitsui
 */

#include "libstandard.h"

GSList* query_xpath(htmlDocPtr doc,const char *query){
	int i;
	xmlXPathContextPtr ctx = xmlXPathNewContext(doc);
	if (!ctx) return NULL;

	xmlXPathObjectPtr xpobj = xmlXPathEvalExpression((xmlChar *)query, ctx);
	if (!xpobj) return NULL;

	xmlNodeSetPtr nodes = xpobj->nodesetval;
	int size = (nodes) ? nodes->nodeNr : 0;
	GSList *r=NULL;
	for (i = 0; i < size; ++i) {
		if (!xmlXPathNodeSetIsEmpty(nodes)) {
			xmlNodePtr node = xmlXPathNodeSetItem(nodes, i);
			r=g_slist_append(r,node);
		}
	}

	xmlXPathFreeObject(xpobj);
	xmlXPathFreeContext(ctx);
	return r;
}

char *xpathOneContent(apr_pool_t *pool,htmlDocPtr doc,const char *xpath){
	GSList* links=query_xpath(doc,xpath);
	if(!links) return NULL;
	char *p=(char*)xmlNodeGetContent(links->data);
	if(pool){
		apr_pool_userdata_set(p,"libstandard-xpathOneContent",(apr_status_t (*)(void *))free,pool);
	}
	g_slist_free(links);
	return p;
}


text:
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                            "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>

    <class name="org.mifos.customers.checklist.business.CheckListDetailEntity" table="checklist_detail">
        <id name="detailId" column="detail_id" type="integer" access="field">
            <generator class="native"/>
        </id>

        <property name="detailText" column="detail_text" type="string" />
        <property name="answerType" column="answer_type" type="short"  not-null="true" />
        <property name="supportedLocales" column="locale_id" type="short" not-null="true" />
        <many-to-one name="checkListBO" column="checklist_id"
            class="org.mifos.customers.checklist.business.CheckListBO"
            access="field" cascade="none" insert="true" update="true" />

    </class>

</hibernate-mapping>


text:
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Extra_Sprint extends Controller_Cached
{

	public function action_index()
	{
		$this->view = View::factory('extra/sprint/index');
		$this->view->letters = range('a', 'z');

		$letter = $this->request->param('letter');
		$title_extra = '';

		if ($letter)
		{
			$title_extra = ' - Sprint '.strtoupper($letter);
			$this->view->letter = $letter;
			$config = Kohana::$config->load('sprint/'.$letter);

			if ( ! empty($config->adjectives) && ! empty($config->animals))
			{
				$this->template->head_scripts = 'var sprintAdj = '.json_encode($config->adjectives)
					.'; var sprintAnimals = '.json_encode($config->animals).';';

				$this->view->has_list = TRUE;
			}
			else
			{
				$this->view->has_list = FALSE;
			}
		}

		$this->template->title = 'Sprint Name Generator'.$title_extra;
		$this->template->description = 'Extras - Sprint Name Generator'.$title_extra;
		$this->template->keywords = 'extras, sprint, name, generator';
		$this->template->scripts[] = $this->asset->asset_url('/media/js/sprint.js');
		$this->template->styles[$this->asset->asset_url('/media/css/tools.css')] = 'screen, projection';
		$this->template->show_google_plusone = true;
		$this->template->show_facebook_like = true;
	}
}


text:
/**
 * @fileoverview Externs for soundjs
 * @externs
 */

/**
 * @constructor
 * @extends {createjs.EventDispatcher}
 * @param {string} src
 * @param {Object} owner
 */
createjs.SoundInstance = function(src, owner) {};

/**
 * @type {string}
 */
createjs.SoundInstance.prototype.gainNode;

/**
 * @deprecated Listen to 'complete' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onComplete;

/**
 * @deprecated Listen to 'loop' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onLoop;

/**
 * @deprecated Listen to 'failed' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onPlayFailed;

/**
 * @deprecated Listen to 'interrupted' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onPlayInterrupted;

/**
 * @deprecated Listen to 'succeeded' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onPlaySucceeded;

/**
 * @deprecated Listen to 'ready' event
 * @type {Function}
 */
createjs.SoundInstance.prototype.onReady;

/**
 * @type {number}
 */
createjs.SoundInstance.prototype.pan;

/**
 * @type {Node|Element|null}
 */
createjs.SoundInstance.prototype.panNode;

/**
 * @type {string}
 */
createjs.SoundInstance.prototype.playState;

/**
 * @type {Node|Element|null}
 */
createjs.SoundInstance.prototype.sourceNode;

/**
 * @type {string|number}
 */
createjs.SoundInstance.prototype.uniqueId;

/**
 * @type {number}
 */
createjs.SoundInstance.prototype.volume;

/**
 * @return {number}
 */
createjs.SoundInstance.prototype.getDuration = function() {};

/**
 * @return {boolean}
 */
createjs.SoundInstance.prototype.getMute = function() {};

/**
 * @return {number}
 */
createjs.SoundInstance.prototype.getPan = function() {};

/**
 * @return {number}
 */
createjs.SoundInstance.prototype.getPosition = function() {};

/**
 * @return {number}
 */
createjs.SoundInstance.prototype.getVolume = function() {};

/**
 * @deprecated Use setMute instead.
 * @param {string} value
 * @return {boolean}
 */
createjs.SoundInstance.prototype.mute = function(value) {};

/**
 * @return {boolean}
 */
createjs.SoundInstance.prototype.pause = function() {};

/**
 * @param {string|Object=} interrupt
 * @param {number=} delay
 * @param {number=} offset
 * @param {number=} loop
 * @param {number=} volume
 * @param {number=} pan
 */
createjs.SoundInstance.prototype.play = function(interrupt, delay, offset, loop, volume, pan) {};

/**
 * @return {boolean}
 */
createjs.SoundInstance.prototype.resume = function() {};

/**
 * @param {boolean} value
 * @return {boolean}
 */
createjs.SoundInstance.prototype.setMute = function(value) {};

/**
 * @param {number} value
 * @return {number|boolean}
 */
createjs.SoundInstance.prototype.setPan = function(value) {};

/**
 * @param {number} value
 */
createjs.SoundInstance.prototype.setPosition = function(value) {};

/**
 * @param {number} value
 * @return {boolean}
 */
createjs.SoundInstance.prototype.setVolume = function(value) {};

/**
 * @return {boolean}
 */
createjs.SoundInstance.prototype.stop = function() {};