text:
import re
import scrapy
import logging
from ptt_crawler.items import PttCrawlerItem, PTTGroupItem, PttBoardItem, PttArticleItem,PTTCommentItem
from datetime import datetime

class PTTArticle(scrapy.Spider):

    name = 'article'
    domain = 'https://www.ptt.cc'
    allowed_domains = ['ptt.cc']
    start_urls = ['https://www.ptt.cc/bbs/movie/index.html']
    _retries = 0
    MAX_RETRY = 1
    MAX_PAGE = 1000
    _page = 0
    def parse(self, response):
        page = 0
        if len(response.css('div#main-container div.r-list-container> div.r-ent')) > 0:
            for ent in response.css('div#main-container div.r-list-container> div.r-ent'):
                href = ent.css("div.title>a::attr(href)")
                if href:
                    url = self.domain + href.extract()[0]
                    yield scrapy.Request(url, callback=self.parse_article)

            if self._page <= self.MAX_PAGE:
                next_page = response.xpath(
                    u'//div[@id="action-bar-container"]//a[contains(text(), "上頁")]/@href')
                if next_page:
                    url = response.urljoin(next_page[0].extract())
                    yield scrapy.Request(url, callback=self.parse)
                else:
                    logging.warning('no next page')
                self._page += 1
                print '============= Now Page is : %d ================' % self._page

    def parse_movie_page(self, response):
        page = 0
        if len(response.css('div#main-container div.r-list-container> div.r-ent')) > 0:
            for ent in response.css('div#main-container div.r-list-container> div.r-ent'):
                url = self.domain + \
                    ent.css("div.title>a::attr(href)").extract()[0]
                yield scrapy.Request(url, callback=self.parse_article)
        else:
            logging.warning('no articles in page.')

    def parse_article(self, response):
        author = response.css(
            '#main-content > div:nth-child(1) > span.article-meta-value::text').extract()[0]

        date = datetime.strptime(
            response.css('#main-content > div:nth-child(4) > span.article-meta-value::text')
                .extract()[0],
            '%a %b %d %H:%M:%S %Y')

        article = PttArticleItem()
        article['name'] = response.url.split('/')[-1].replace('.html', '')
        article['title'] = response.css(
            '#main-content > div:nth-child(3) > span.article-meta-value::text').extract()[0]
        article['url'] = response.url

        article['author'] = re.search('^[^\(]+(?=\()', author).group(0)
        article['authorName'] = re.search('[^\(]*(?=\))', author).group(0)
        article['date'] = date.strftime('%d/%m')
        article['fullDate'] = response.css('#main-content > div:nth-child(4) > span.article-meta-value::text').extract()[0]

        article['content'] = response.css('div#main-content::text').extract()[0]

        article_comments = response.css('#main-content > div.push')
        article['comments'] = []
        if article_comments:
            for comment in article_comments:
                comment_item = PTTCommentItem()
                comment_item['name'] = response.url.split('/')[-1].replace('.html', '')
                comment_item['url'] = response.url
                comment_item['kind'] = comment.css('span.push-tag::text').extract()[0]
                comment_item['content'] = comment.css('span.push-content::text').extract()[0]
                comment_item['author'] = comment.css('span.push-userid::text').extract()[0]
                comment_item['date'] = comment.css('span.push-ipdatetime::text').extract()[0]
                article['comments'].append(comment_item)
        ipMatch = re.search('[0-9]{2,3}.[0-9]{2,3}.[0-9]{2,3}.[0-9]{2,3}',
            response.css(u'div#main-content > span.f2:contains("發信站")::text').extract()[0])

        if ipMatch:
            article['ip'] = ipMatch.group(0)

        yield article


text:
import os
import sys

import requests

# helper functions
def check_url(path, version):
    """Check for valid URL"""
    print 'Checking URL: https://{0}/docker-{1}'.format(path, version)
    return 'https://{0}/docker-{1}'.format(path, version)

def get_txt(path, version):
    """Custom Docker install text"""
    txt = 'curl -sSL https://get.docker.com/ | sh\n'.format(path) + \
          'mv /usr/bin/docker /usr/bin/docker.org\n' + \
          'wget https://{0}/docker-{1} -O /usr/bin/docker\n'.format(path, version) + \
          'chmod +x /usr/bin/docker\n'
    return txt

def get_custom(prompt):
    """Prompt for custom Docker version"""

    version = raw_input(prompt)
    if 'rc' in version:
        path = 'test.docker.com/builds/Linux/x86_64'
    elif 'dev' in version:
        path = 'master.dockerproject.org/linux/amd64'
    else:
        path = 'get.docker.com/builds/Linux/x86_64'

    r = requests.head(check_url(path, version))
    if r.status_code != 200:
        print 'Unable to locate specified version.'
        txt = get_custom('\nEnter a different version: ')
    else:
        txt = get_txt(path, version)

    return txt

# prompts
os.system('clear')
docker = raw_input("""
Which version of Docker do you want to install?

  - latest (default)
  - cs
  - rc
  - experimental (nightly)
  - master (github master branch)
  - custom

Enter version (Press enter for default): """)

# example urls
#https://get.docker.com/builds/Linux/x86_64/docker-latest
#https://test.docker.com/builds/Linux/x86_64/docker-1.6.0-rc6
#https://master.dockerproject.com/linux/amd64/docker-1.5.0-dev

docker = docker.lower()
if docker == '' or docker =='latest':
    txt = 'curl -sSL https://get.docker.com/ | sh'
elif docker == 'cs':
    txt = "wget -qO- 'https://pgp.mit.edu/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | sudo apt-key add --import\n" + \
          'sudo apt-get update && sudo apt-get install apt-transport-https\n' + \
          'echo "deb https://packages.docker.com/1.10/apt/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list\n' + \
          'sudo apt-get update && sudo apt-get -y install docker-engine\n'
elif docker == 'rc':
    txt = 'curl -faSL https://test.docker.com/ | sh'
elif docker == 'experimental':
    txt = 'curl -fsSL https://experimental.docker.com/ | sh'
elif docker == 'master':
    r = requests.get('https://master.dockerproject.org/version')
    txt = get_txt('master.dockerproject.org/linux/amd64', r.text)
elif docker == 'custom':
    txt = get_custom('Enter version: ')
else:
    print "ERROR: Not a valid option."
    sys.exit()

# instance configs
PRIMARY_OS = 'Ubuntu-14.04'
PRIMARY = '''#!/bin/sh

FQDN="{{fqdn}}"

export DEBIAN_FRONTEND=noninteractive

# locale
sudo locale-gen en_US.UTF-8

# /etc/hostname - /etc/hosts
sed -i "1 c\\127.0.0.1 $FQDN localhost" /etc/hosts
echo $FQDN > /etc/hostname
service hostname restart
sleep 5

# docker
{0}

sudo usermod -aG docker ubuntu

# updates
apt-get update
apt-get -y upgrade
apt-get install -y git tree jq linux-image-extra-4.2.0-23-generic linux-image-4.2.0.23-generic

{{dinfo}}
reboot
'''.format(txt)

# Script to use if launching from a custom lab AMI image
AMIBUILD = '''#!/bin/sh
#
FQDN="{{fqdn}}"

# /etc/hostname - /etc/hosts
sed -i "1 c\\127.0.0.1 $FQDN localhost" /etc/hosts
echo $FQDN > /etc/hostname
service hostname restart
sleep 5

{{dinfo}}
reboot
'''.format()

def pre_process():
    """Executed before launching instances in AWS"""
    pass

def post_process():
    """Executed after launching instances in AWS"""
    pass

redpajama_set_name: RedPajamaGithub


text:
namespace ui {

namespace {

uint32_t TranslateAnchor(OwnedWindowAnchorPosition anchor) {
  switch (anchor) {
    case OwnedWindowAnchorPosition::kNone:
      return ZXDG_POSITIONER_V6_ANCHOR_NONE;
    case OwnedWindowAnchorPosition::kTop:
      return ZXDG_POSITIONER_V6_ANCHOR_TOP;
    case OwnedWindowAnchorPosition::kBottom:
      return ZXDG_POSITIONER_V6_ANCHOR_BOTTOM;
    case OwnedWindowAnchorPosition::kLeft:
      return ZXDG_POSITIONER_V6_ANCHOR_LEFT;
    case OwnedWindowAnchorPosition::kRight:
      return ZXDG_POSITIONER_V6_ANCHOR_RIGHT;
    case OwnedWindowAnchorPosition::kTopLeft:
      return ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_LEFT;
    case OwnedWindowAnchorPosition::kBottomLeft:
      return ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | ZXDG_POSITIONER_V6_ANCHOR_LEFT;
    case OwnedWindowAnchorPosition::kTopRight:
      return ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_RIGHT;
    case OwnedWindowAnchorPosition::kBottomRight:
      return ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | ZXDG_POSITIONER_V6_ANCHOR_RIGHT;
  }
}

uint32_t TranslateGravity(OwnedWindowAnchorGravity gravity) {
  switch (gravity) {
    case OwnedWindowAnchorGravity::kNone:
      return ZXDG_POSITIONER_V6_GRAVITY_NONE;
    case OwnedWindowAnchorGravity::kTop:
      return ZXDG_POSITIONER_V6_GRAVITY_TOP;
    case OwnedWindowAnchorGravity::kBottom:
      return ZXDG_POSITIONER_V6_GRAVITY_BOTTOM;
    case OwnedWindowAnchorGravity::kLeft:
      return ZXDG_POSITIONER_V6_GRAVITY_LEFT;
    case OwnedWindowAnchorGravity::kRight:
      return ZXDG_POSITIONER_V6_GRAVITY_RIGHT;
    case OwnedWindowAnchorGravity::kTopLeft:
      return ZXDG_POSITIONER_V6_GRAVITY_TOP | ZXDG_POSITIONER_V6_GRAVITY_LEFT;
    case OwnedWindowAnchorGravity::kBottomLeft:
      return ZXDG_POSITIONER_V6_GRAVITY_BOTTOM |
             ZXDG_POSITIONER_V6_GRAVITY_LEFT;
    case OwnedWindowAnchorGravity::kTopRight:
      return ZXDG_POSITIONER_V6_GRAVITY_TOP | ZXDG_POSITIONER_V6_GRAVITY_RIGHT;
    case OwnedWindowAnchorGravity::kBottomRight:
      return ZXDG_POSITIONER_V6_GRAVITY_BOTTOM |
             ZXDG_POSITIONER_V6_GRAVITY_RIGHT;
  }
}

uint32_t TranslateConstraintAdjustment(
    OwnedWindowConstraintAdjustment constraint_adjustment) {
  uint32_t res = 0;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentSlideX) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentSlideY) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentFlipX) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentFlipY) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentResizeX) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X;
  if ((constraint_adjustment &
       OwnedWindowConstraintAdjustment::kAdjustmentRezizeY) !=
      OwnedWindowConstraintAdjustment::kAdjustmentNone)
    res |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y;
  return res;
}

}  // namespace

ZXDGPopupV6WrapperImpl::ZXDGPopupV6WrapperImpl(
    std::unique_ptr<ZXDGSurfaceV6WrapperImpl> surface,
    WaylandWindow* wayland_window,
    WaylandConnection* connection)
    : wayland_window_(wayland_window),
      connection_(connection),
      zxdg_surface_v6_wrapper_(std::move(surface)) {
  DCHECK(zxdg_surface_v6_wrapper_);
  DCHECK(wayland_window_ && wayland_window_->parent_window());
}

ZXDGPopupV6WrapperImpl::~ZXDGPopupV6WrapperImpl() = default;

bool ZXDGPopupV6WrapperImpl::Initialize(const ShellPopupParams& params) {
  if (!connection_->shell_v6()) {
    NOTREACHED() << "Wrong shell protocol";
    return false;
  }

  ZXDGSurfaceV6WrapperImpl* parent_xdg_surface = nullptr;
  // If the parent window is a popup, the surface of that popup must be used as
  // a parent.
  if (auto* parent_popup = wayland_window_->parent_window()->AsWaylandPopup()) {
    ZXDGPopupV6WrapperImpl* popup =
        static_cast<ZXDGPopupV6WrapperImpl*>(parent_popup->shell_popup());
    parent_xdg_surface = popup->zxdg_surface_v6_wrapper();
  } else {
    WaylandToplevelWindow* wayland_surface =
        static_cast<WaylandToplevelWindow*>(wayland_window_->parent_window());
    parent_xdg_surface = static_cast<ZXDGToplevelV6WrapperImpl*>(
                             wayland_surface->shell_toplevel())
                             ->zxdg_surface_v6_wrapper();
  }

  if (!zxdg_surface_v6_wrapper_ || !parent_xdg_surface)
    return false;

  params_ = params;
  // Wayland doesn't allow empty bounds. If a zero or negative size is set, the
  // invalid_input error is raised. Thus, use the least possible one.
  // WaylandPopup will update its bounds upon the following configure event.
  if (params_.bounds.IsEmpty())
    params_.bounds.set_size({1, 1});

  static constexpr zxdg_popup_v6_listener zxdg_popup_v6_listener = {
      &ZXDGPopupV6WrapperImpl::Configure,
      &ZXDGPopupV6WrapperImpl::PopupDone,
  };

  auto positioner = CreatePositioner();
  if (!positioner)
    return false;

  zxdg_popup_v6_.reset(zxdg_surface_v6_get_popup(
      zxdg_surface_v6_wrapper_->zxdg_surface(),
      parent_xdg_surface->zxdg_surface(), positioner.get()));
  if (!zxdg_popup_v6_)
    return false;
  connection_->wayland_window_manager()->NotifyWindowRoleAssigned(
      wayland_window_);

  GrabIfPossible(connection_, wayland_window_->parent_window());

  zxdg_popup_v6_add_listener(zxdg_popup_v6_.get(), &zxdg_popup_v6_listener,
                             this);

  wayland_window_->root_surface()->Commit();
  return true;
}

void ZXDGPopupV6WrapperImpl::AckConfigure(uint32_t serial) {
  DCHECK(zxdg_surface_v6_wrapper_);
  zxdg_surface_v6_wrapper_->AckConfigure(serial);
}

bool ZXDGPopupV6WrapperImpl::IsConfigured() {
  DCHECK(zxdg_surface_v6_wrapper_);
  return zxdg_surface_v6_wrapper_->IsConfigured();
}

bool ZXDGPopupV6WrapperImpl::SetBounds(const gfx::Rect& new_bounds) {
  // zxdg_popup_v6 doesn't support repositioning. The client must recreate the
  // objects instead.
  return false;
}

void ZXDGPopupV6WrapperImpl::SetWindowGeometry(const gfx::Rect& bounds) {
  zxdg_surface_v6_set_window_geometry(zxdg_surface_v6_wrapper_->zxdg_surface(),
                                      bounds.x(), bounds.y(), bounds.width(),
                                      bounds.height());
}

void ZXDGPopupV6WrapperImpl::Grab(uint32_t serial) {
  DCHECK(connection_->seat());

  zxdg_popup_v6_grab(zxdg_popup_v6_.get(), connection_->seat()->wl_object(),
                     serial);
}

bool ZXDGPopupV6WrapperImpl::SupportsDecoration() {
  // zxdg_popup_v6 doesn't support frame configuration.
  return false;
}

void ZXDGPopupV6WrapperImpl::Decorate() {
  NOTREACHED();
}

wl::Object<zxdg_positioner_v6> ZXDGPopupV6WrapperImpl::CreatePositioner() {
  wl::Object<zxdg_positioner_v6> positioner(
      zxdg_shell_v6_create_positioner(connection_->shell_v6()));
  if (!positioner)
    return {};

  gfx::Rect anchor_rect;
  OwnedWindowAnchorPosition anchor_position;
  OwnedWindowAnchorGravity anchor_gravity;
  OwnedWindowConstraintAdjustment constraint_adjustment;
  FillAnchorData(params_, &anchor_rect, &anchor_position, &anchor_gravity,
                 &constraint_adjustment);

  zxdg_positioner_v6_set_anchor_rect(positioner.get(), anchor_rect.x(),
                                     anchor_rect.y(), anchor_rect.width(),
                                     anchor_rect.height());
  zxdg_positioner_v6_set_size(positioner.get(), params_.bounds.width(),
                              params_.bounds.height());
  zxdg_positioner_v6_set_anchor(positioner.get(),
                                TranslateAnchor(anchor_position));
  zxdg_positioner_v6_set_gravity(positioner.get(),
                                 TranslateGravity(anchor_gravity));
  zxdg_positioner_v6_set_constraint_adjustment(
      positioner.get(), TranslateConstraintAdjustment(constraint_adjustment));
  return positioner;
}

// static
void ZXDGPopupV6WrapperImpl::Configure(void* data,
                                       struct zxdg_popup_v6* zxdg_popup_v6,
                                       int32_t x,
                                       int32_t y,
                                       int32_t width,
                                       int32_t height) {
  // As long as the Wayland compositor repositions/requires to position windows
  // relative to their parents, do not propagate final bounds information to
  // Chromium. The browser places windows in respect to screen origin, but
  // Wayland requires doing so in respect to parent window's origin. To properly
  // place windows, the bounds are translated and adjusted according to the
  // Wayland compositor needs during WaylandWindow::CreateXdgPopup call.
  WaylandWindow* window =
      static_cast<ZXDGPopupV6WrapperImpl*>(data)->wayland_window_;
  DCHECK(window);
  window->HandlePopupConfigure({x, y, width, height});
}

// static
void ZXDGPopupV6WrapperImpl::PopupDone(void* data,
                                       struct zxdg_popup_v6* zxdg_popup_v6) {
  WaylandWindow* window =
      static_cast<ZXDGPopupV6WrapperImpl*>(data)->wayland_window_;
  DCHECK(window);
  window->Hide();
  window->OnCloseRequest();
}

ZXDGSurfaceV6WrapperImpl* ZXDGPopupV6WrapperImpl::zxdg_surface_v6_wrapper()
    const {
  DCHECK(zxdg_surface_v6_wrapper_.get());
  return zxdg_surface_v6_wrapper_.get();
}

}  // namespace ui


text:
namespace policy {

namespace path_parser {

// This function is used to expand the variables in policy strings that
// represent paths. The set of supported variables differs between platforms
// but generally covers most standard locations that might be needed in the
// existing used cases.
// All platforms:
//   ${user_name}       - The user that is running Chrome (respects suids).
//                        (example : "johndoe")
//   ${machine_name}    - The machine name possibly with domain (example :
//                        "johnny.cg1.cooldomain.org")
// Windows only:
//   ${documents}       - The "Documents" folder for the current user.
//                        (example : "C:\Users\Administrator\Documents")
//   ${local_app_data}  - The Application Data folder for the current user.
//                        (example : "C:\Users\Administrator\AppData\Local")
//   ${roaming_app_data}- The Roamed AppData folder for the current user.
//                        (example : "C:\Users\Administrator\AppData\Roaming")
//   ${profile}         - The home folder for the current user.
//                        (example : "C:\Users\Administrator")
//   ${global_app_data} - The system-wide Application Data folder.
//                        (example : "C:\Users\All Users\AppData")
//   ${program_files}   - The "Program Files" folder for the current process.
//                        Depends on whether it is 32 or 64 bit process.
//                        (example : "C:\Program Files (x86)")
//   ${windows}         - The Windows folder
//                        (example : "C:\WINNT" or "C:\Windows")
// MacOS only:
//   ${users}           - The folder where users profiles are stored
//                        (example : "/Users")
//   ${documents}       - The "Documents" folder of the current user.
//                        (example : "/Users/johndoe/Documents")
// Any non recognized variable is not being translated at all. Variables are
// translated only once in every string because for most of these there is no
// sense in concatenating them more than once in a single path.
base::FilePath::StringType ExpandPathVariables(
    const base::FilePath::StringType& untranslated_string);

// A helper function used to read the UserDataDir path policy without relying on
// any policy infrastructure. This is required because this policy is needed
// much earlier before the PrefService is initialized.
// The function will fill |user_data_dir| if the policy "UserDataDir" is set and
// leave it intact if the policy is missing. If the policy is set it should
// override any manual changes to the profile path the user might have made so
// this function should be used to verify no policy is specified whenever the
// profile path is not read from the PathService which already takes this into
// account.
void CheckUserDataDirPolicy(base::FilePath* user_data_dir);

}  // namespace path_parser

}  // namespace policy

#endif  // CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_


text:
'use strong';

const {EOL} = require('os');

const compassVersionCallback = require('./');
const pify = require('pify');
const test = require('tape');

const execPromise = pify(require('child_process').exec, require('pinkie-promise'));

const COMPASS_VERSION = '1.0.3';

test('compassVersionCallback()', t => {
  t.strictEqual(compassVersionCallback.name, 'compassVersionCallback', 'should have a function name.');

  t.throws(
    () => compassVersionCallback('mkdir', t.fail),
    /TypeError.*mkdir is not a valid option object\. Expected an object\./,
    'should throw a type error when it takes two argument but the first is not an object.'
  );

  t.throws(
    () => compassVersionCallback(null, t.fail),
    /TypeError.*null is not a valid option object\. Expected an object\./,
    'should throw a type error when the first argument is a falsy value.'
  );

  t.throws(
    () => compassVersionCallback(1),
    /TypeError.*1 is not a function\. .*called after version check of `compass` command\./,
    'should throw a type error when the first argument is neither a function nor an object.'
  );

  t.throws(
    () => compassVersionCallback({bundleExec: true}, null),
    /TypeError.*null is not a function\. .*called after version check of `bundle exec compass` command\./,
    'should throw a type error when the last argument is not a function.'
  );

  t.throws(
    () => compassVersionCallback({stdio: 123}, t.fail),
    /TypeError.*stdio/,
    'should pass the option object to childProcess#spawn.'
  );

  t.end();
});

test('compassVersionCallback() with `bundleExec` option before running `bundle install`', t => {
  t.plan(1);

  compassVersionCallback({bundleExec: true}, err => {
    t.equal(
      err.message,
      [
        'bundler: command not found: compass',
        'Install missing gem executables with `bundle install`',
        ''
      ].join(EOL),
      'should pass an error to the callback.'
    );
  });
});

test('compassVersionCallback() with `bundleExec` option after running `bundle install`', t => {
  t.plan(2);

  execPromise('bundle install --path=vendor').then(() => {
    compassVersionCallback({bundleExec: true}, (err, version) => {
      t.strictEqual(err, null, 'should not pass any errors to the callback.');
      t.equal(version, COMPASS_VERSION, 'should detect proper compass version.');
    });
  }).catch(t.fail);
});

test('compassVersionCallback() before `compass` installed', t => {
  t.plan(1);

  compassVersionCallback(err => {
    t.equal(err.code, 'ENOENT', 'should pass an error to the callback.');
  });
});

test('compassVersionCallback() after `compass` installed', t => {
  t.plan(2);

  execPromise(`gem install compass --version ${COMPASS_VERSION} --no-document`).then(() => {
    compassVersionCallback((err, version) => {
      t.strictEqual(err, null, 'should not pass any errors to the callback.');
      t.equal(version, COMPASS_VERSION, 'should detect proper compass version.');
    });
  }).catch(t.fail);
});


text:
#ifndef NRF_SOC_H__
#define NRF_SOC_H__

#include <stdint.h>
#include "nrf.h"

#ifdef __cplusplus
extern "C" {
#endif

/**@brief Enable External Interrupt.
 * @note Corresponds to NVIC_EnableIRQ in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in] IRQn See the NVIC_EnableIRQ documentation in CMSIS.
 *
 * @retval ::NRF_SUCCESS The interrupt was enabled.
 */
uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn);

/**@brief  Disable External Interrupt.
 * @note Corresponds to NVIC_DisableIRQ in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in] IRQn See the NVIC_DisableIRQ documentation in CMSIS
 *
 * @retval ::NRF_SUCCESS The interrupt was disabled.
 */
uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn);

/**@brief  Get Pending Interrupt.
 * @note Corresponds to NVIC_GetPendingIRQ in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in]   IRQn          See the NVIC_GetPendingIRQ documentation in CMSIS.
 * @param[out]  p_pending_irq Return value from NVIC_GetPendingIRQ.
 *
 * @retval ::NRF_SUCCESS The interrupt is available for the application.
 */
uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq);

/**@brief  Set Pending Interrupt.
 * @note Corresponds to NVIC_SetPendingIRQ in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in] IRQn See the NVIC_SetPendingIRQ documentation in CMSIS.
 *
 * @retval ::NRF_SUCCESS The interrupt is set pending.
 */
uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn);

/**@brief  Clear Pending Interrupt.
 * @note Corresponds to NVIC_ClearPendingIRQ in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in] IRQn See the NVIC_ClearPendingIRQ documentation in CMSIS.
 *
 * @retval ::NRF_SUCCESS The interrupt pending flag is cleared.
 */
uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn);

/**@brief Set Interrupt Priority.
 * @note Corresponds to NVIC_SetPriority in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 * @pre{priority is valid and not reserved by the stack}
 *
 * @param[in] IRQn      See the NVIC_SetPriority documentation in CMSIS.
 * @param[in] priority  A valid IRQ priority for use by the application.
 *
 * @retval ::NRF_SUCCESS The interrupt and priority level is available for the application.
 */
uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority);

/**@brief Get Interrupt Priority.
 * @note Corresponds to NVIC_GetPriority in CMSIS.
 *
 * @pre{IRQn is valid and not reserved by the stack}
 *
 * @param[in]  IRQn         See the NVIC_GetPriority documentation in CMSIS.
 * @param[out] p_priority   Return value from NVIC_GetPriority.
 *
 * @retval ::NRF_SUCCESS The interrupt priority is returned in p_priority.
 */
uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority);

/**@brief System Reset.
 * @note Corresponds to NVIC_SystemReset in CMSIS.
 *
 * @retval ::NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN
 */
uint32_t sd_nvic_SystemReset(void);

/**@brief Enters critical region.
 *
 * @post Application interrupts will be disabled.
 * @sa sd_nvic_critical_region_exit
 *
 * @param[out]  p_is_nested_critical_region  1: If in a nested critical region.
 *                                           0: Otherwise.
 *
 * @retval ::NRF_SUCCESS
 */
uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region);

/**@brief Exit critical region.
 *
 * @pre Application has entered a critical region using ::sd_nvic_critical_region_enter.
 * @post If not in a nested critical region, the application interrupts will restored to the state before ::sd_nvic_critical_region_enter was called.
 *
 * @param[in] is_nested_critical_region If this is set to 1, the critical region won't be exited. @sa sd_nvic_critical_region_enter.
 *
 * @retval ::NRF_SUCCESS
 */
uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region);

#ifdef __cplusplus
}
#endif

#endif /* NRF_SOC_H__ */


text:
package org.apache.syncope.core.logic;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.NotificationTO;
import org.apache.syncope.common.lib.types.JobAction;
import org.apache.syncope.common.lib.types.JobType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.core.logic.notification.NotificationJob;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
import org.apache.syncope.core.persistence.api.dao.NotificationDAO;
import org.apache.syncope.core.persistence.api.entity.Notification;
import org.apache.syncope.core.provisioning.api.data.NotificationDataBinder;
import org.apache.syncope.core.provisioning.api.job.JobManager;
import org.quartz.JobKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;

@Component
public class NotificationLogic extends AbstractJobLogic<NotificationTO> {

    @Autowired
    private NotificationDAO notificationDAO;

    @Autowired
    private NotificationDataBinder binder;

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_READ + "')")
    public NotificationTO read(final String key) {
        Notification notification = notificationDAO.find(key);
        if (notification == null) {
            LOG.error("Could not find notification '" + key + "'");

            throw new NotFoundException(String.valueOf(key));
        }

        return binder.getNotificationTO(notification);
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_LIST + "')")
    public List<NotificationTO> list() {
        return CollectionUtils.collect(notificationDAO.findAll(), new Transformer<Notification, NotificationTO>() {

            @Override
            public NotificationTO transform(final Notification input) {
                return binder.getNotificationTO(input);
            }
        }, new ArrayList<NotificationTO>());
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_CREATE + "')")
    public NotificationTO create(final NotificationTO notificationTO) {
        return binder.getNotificationTO(notificationDAO.save(binder.create(notificationTO)));
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_UPDATE + "')")
    public NotificationTO update(final NotificationTO notificationTO) {
        Notification notification = notificationDAO.find(notificationTO.getKey());
        if (notification == null) {
            LOG.error("Could not find notification '" + notificationTO.getKey() + "'");
            throw new NotFoundException(String.valueOf(notificationTO.getKey()));
        }

        binder.update(notification, notificationTO);
        notification = notificationDAO.save(notification);

        return binder.getNotificationTO(notification);
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_DELETE + "')")
    public NotificationTO delete(final String key) {
        Notification notification = notificationDAO.find(key);
        if (notification == null) {
            LOG.error("Could not find notification '" + key + "'");

            throw new NotFoundException(String.valueOf(key));
        }

        NotificationTO deleted = binder.getNotificationTO(notification);
        notificationDAO.delete(key);
        return deleted;
    }

    @Override
    protected Triple<JobType, String, String> getReference(final JobKey jobKey) {
        return JobManager.NOTIFICATION_JOB.equals(jobKey)
                ? Triple.of(JobType.NOTIFICATION, (String) null, NotificationJob.class.getSimpleName())
                : null;
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_LIST + "')")
    public JobTO getJob() {
        List<JobTO> jobs = super.doListJobs();
        return jobs.isEmpty() ? null : jobs.get(0);
    }

    @PreAuthorize("hasRole('" + StandardEntitlement.NOTIFICATION_EXECUTE + "')")
    public void actionJob(final JobAction action) {
        super.doActionJob(JobManager.NOTIFICATION_JOB, action);
    }

    @Override
    protected NotificationTO resolveReference(final Method method, final Object... args)
            throws UnresolvedReferenceException {

        String key = null;

        if (ArrayUtils.isNotEmpty(args)) {
            for (int i = 0; key == null && i < args.length; i++) {
                if (args[i] instanceof String) {
                    key = (String) args[i];
                } else if (args[i] instanceof NotificationTO) {
                    key = ((NotificationTO) args[i]).getKey();
                }
            }
        }

        if (key != null) {
            try {
                return binder.getNotificationTO(notificationDAO.find(key));
            } catch (Throwable ignore) {
                LOG.debug("Unresolved reference", ignore);
                throw new UnresolvedReferenceException(ignore);
            }
        }

        throw new UnresolvedReferenceException();
    }
}


text:
package org.gradle.api.internal.file;

import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.file.RelativePath;
import org.gradle.internal.file.Chmod;
import org.gradle.internal.file.Stat;

import java.io.File;
import java.util.concurrent.atomic.AtomicBoolean;

public class DefaultFileVisitDetails extends DefaultFileTreeElement implements FileVisitDetails {
    private final AtomicBoolean stop;

    public DefaultFileVisitDetails(File file, RelativePath relativePath, AtomicBoolean stop, Chmod chmod, Stat stat) {
        super(file, relativePath, chmod, stat);
        this.stop = stop;
    }

    public DefaultFileVisitDetails(File file, Chmod chmod, Stat stat) {
        this(file, new RelativePath(!file.isDirectory(), file.getName()), new AtomicBoolean(), chmod, stat);
    }

    @Override
    public void stopVisiting() {
        stop.set(true);
    }
}


text:
import { Pipe, PipeTransform } from '@angular/core';

import { Observable } from 'rxjs/Rx';

import { AuthService } from '../auth/auth.service';

@Pipe({
    name: 'loggedInPipe',
    pure: false
})
export class LoggedInPipe implements PipeTransform {

    constructor(
        private authService: AuthService
    ) {
    }

  transform(value: any): Observable<boolean> {
    return this.authService.isLoggedInCached();
  }
}


text:
<!DOCTYPE html>

		<title>Black Butler: Book of Murder - Série (2014) - Yana Toboso</title>

				<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
							<meta name="description" content="Peu de temps après le dénouement de l'affaire du Cirque, les majordomes de la Reine font intrusion dans le manoir de Phantomhive.... Anime (OAV) (2014). Shounen." />
									<meta property="og:image" content="http://static.senscritique.com/img/layout/misc/default-fb-cover.jpg" />

		<link rel="publisher" href="https://plus.google.com/+senscritique">

		<link rel="apple-touch-icon" sizes="57x57" href="http://static.senscritique.com/img/favicon/apple-touch-icon-57x57.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="60x60" href="http://static.senscritique.com/img/favicon/apple-touch-icon-60x60.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="72x72" href="http://static.senscritique.com/img/favicon/apple-touch-icon-72x72.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="76x76" href="http://static.senscritique.com/img/favicon/apple-touch-icon-76x76.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="114x114" href="http://static.senscritique.com/img/favicon/apple-touch-icon-114x114.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="120x120" href="http://static.senscritique.com/img/favicon/apple-touch-icon-120x120.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="144x144" href="http://static.senscritique.com/img/favicon/apple-touch-icon-144x144.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="152x152" href="http://static.senscritique.com/img/favicon/apple-touch-icon-152x152.png?v=eELP384vde">
		<link rel="apple-touch-icon" sizes="180x180" href="http://static.senscritique.com/img/favicon/apple-touch-icon-180x180.png?v=eELP384vde">
		<link rel="icon" type="image/png" href="http://static.senscritique.com/img/favicon/favicon-32x32.png?v=eELP384vde" sizes="32x32">
		<link rel="icon" type="image/png" href="http://static.senscritique.com/img/favicon/favicon-194x194.png?v=eELP384vde" sizes="194x194">
		<link rel="icon" type="image/png" href="http://static.senscritique.com/img/favicon/favicon-96x96.png?v=eELP384vde" sizes="96x96">
		<link rel="icon" type="image/png" href="http://static.senscritique.com/img/favicon/android-chrome-192x192.png?v=eELP384vde" sizes="192x192">
		<link rel="icon" type="image/png" href="http://static.senscritique.com/img/favicon/favicon-16x16.png?v=eELP384vde" sizes="16x16">
		<link rel="manifest" href="http://static.senscritique.com/img/favicon/manifest.json?v=eELP384vde">
		<link rel="shortcut icon" href="http://static.senscritique.com/img/favicon/favicon.ico?v=eELP384vde">

						<link rel="stylesheet" type="text/css" href="http://static.senscritique.com/lib/optimized_ln/7ab3b18d6080a19c9bbe308986fbd666.css"/>

	<link rel="stylesheet" type="text/css" href="http://static.senscritique.com/lib/optimized_ln/871bcf0a1f894e62c4471e1ada024b59.css"/>

		<link rel="apple-touch-icon" href="/img/favicon/57.png">
		<link rel="apple-touch-icon" sizes="72x72" href="/img/favicon/72.png">
		<link rel="apple-touch-icon" sizes="114x114" href="/img/favicon/114.png">
		<link rel="publisher" href="https://plus.google.com/+senscritique">

							<button type="button" data-rel="btn-register" data-scmodal-type="login" class="d-link-alt">Déjà inscrit</button> ?
							<form action="/" method="POST" class="lahe-userSubmenu lahe-signin" data-rel="sc-headerSignin">

Connectez-vous avec

								Facebook
								Twitter

ou

								<input type="text" class="lahe-signin-field" name="email" placeholder="Adresse email" data-rel="sc-headerSignin-email" />
								<input type="password" class="lahe-signin-field" name="password" placeholder="Mot de passe" data-rel="sc-headerSignin-password" />
								Mot de passe oublié ?
								<fieldset class="lahe-signin-clear">

									<input type="submit" class="d-button lahe-signin-confirm" value="Connexion" />
								</fieldset>
							</form>

						<button type="button" data-rel="btn-register" data-scmodal-type="register" class="lahe-userMenu-connect">Créer mon compte</button>

					SensCritique

							Films

Au cinéma

																																														Sorties de la semaine
															À l'affiche
															Mes cinémas
															Meilleurs films 2015

TV / VOD

																																														EveryMovie
															A la télé
															En VOD

Guide

																																														Vos films préférés
															Top 111 films
															Sondages

							Séries

Actualité

																																														Séries du moment
															Meilleures séries 2015

Guide

																																														Vos séries préférées
															Top 111 séries
															Sondages

							Jeux

Actualité

																																														Jeux du moment
															Agenda
															Jeux les plus attendus
															Meilleurs jeux 2015

Guide

																																														Vos jeux préférés
															Top 111 jeux
															Sondages

							Livres

Actualité

																																														Livres du moment
															Meilleures ventes
															Meilleurs livres 2015
															Prix littéraires 2014

Guide

																																														Vos livres préférés
															Top 111 livres
															Sondages

							BD

Actualité

																																														Franco-belge
															Comics
															Mangas
															Meilleures BD 2015

Guide

																																														Vos BD préférées
															Top 111 BD
															Sondages

							Musique

Actualité

																																														Albums du moment
															Prochaines sorties
															Meilleurs albums 2015

Guide

																																														Vos albums préférés
															Top 111 albums
															Sondages

						Posts

			<form action="/recherche?" method="GET" class="lahe-searchBar-content" data-rel="sc-headerSearch">

					 Chercher une œuvre, un artiste, une liste, un cinéma ou un membre

						Tout

Tout

Films

Séries

Livres

BD

Jeux vidéo

Albums de musique

Morceaux de musique

Listes d'oeuvres

Sondages

Sagas

Artistes et sociétés

Membres

Cinémas

					<input type="text" name="query" value="" class="unfocus lahe-searchBar-query" data-rel="sc-headerSearch-query" />
					<button type="button" class="lahe-searchBar-close" data-rel="sc-headerSearch-close">

					</button>

			</form>

SensCritique

Séries

Shounen

Black Butler: Book of Murder

							Black Butler: Book of Murder

																								(2014)

12345678910

																															<button type="button" data-sc-action="current"
									data-sc-product-id="11462145"
									data-sc-tooltip="true"
									title="Je suis cette série"
									class="d-button pvi-product-scaction ">

								En cours
							</button>

												<button type="button" data-sc-action="recommend"
								data-sc-product-id="11462145"
								class="d-button pvi-product-scaction "
								style="display:none;">
							 Coup de coeur
						</button>
																			<button type="button" data-rel="bt-review sc-button-modal-sc"
									data-sc-product-id="11462145"
									data-scmodal-type="review"
									class="d-button pvi-product-scaction"
									style="display:none;">
								 Critiquer
							</button>

												<button type="button" data-sc-action="wish-list"
								data-sc-product-id="11462145"
								class="d-button pvi-product-scaction "
								>

								Envie de la voir

						</button>

												<button type="button" data-rel="sc-button"
								data-sc-product-id="11462145"
								class="d-button pvi-product-contextmenu">

						</button>

															6.5

							10
							1
							17
							0

1

0

0

1

2

2

6

4

1

0

					1

1

					1

					0

0

					2

					0

0

					3

					1

1

					4

					2

2

					5

					2

2

					6

					6

6

					7

					4

4

					8

					1

1

					9

					0

0

					10

									17

									0

									25

										3

					<button type="button" class="pco-social-action" data-rel="sc-share-tooltip" data-sc-product-id="11462145">Partager</button>

					<button type="button" class="pco-social-action" data-rel="sc-buy-tooltip" data-sc-product-id="11462145">Acheter</button>

					Accueil

					Listes

				Casting

					Photos

Anime (OAV)

					 de   Yana Toboso

							Shounen et

							fantastique

2014

Peu de temps après le dénouement de l'affaire du Cirque, les majordomes de la Reine font intrusion dans le manoir de Phantomhive. Un drame se produit pendant le banquet organisé un soir de tempête. Le rideau écarlate retombe sur la silhouette du majordome, qui ferme les yeux, pressentant le sort...					<button type="button" class="d-link" data-rel="sc-btn-more-storyline" data-sc-product-id="11462145">Lire la suite</button>

					<button type="button" class="d-link" data-rel="sc-btn-close-storyline" data-sc-product-id="11462145">Fermer</button>

					PostsBlack Butler: Book of Murder

				Vous avez une anecdote, une vidéo/photo ou une simple question sur cette série ?

				<button type="button" data-rel="js-link" data-sc-link="/post/11462145" class="d-button-success-xl d-more pvi-emptyTopic-btn">
					Créer un post
				</button>
				<button type="button" data-rel="js-link" data-sc-link="/posts" class="d-button-xl d-more pvi-emptyTopic-btn">
					Tous les posts
				</button>

				Sélection de listesBlack Butler: Book of Murder

			Japanimation - Séries vues & en cours

				Avec :
															Death Note,
																				Paranoia Agent,
																				Serial Experiments Lain,
																				Mirai Nikki,
																				Deadman Wonderland

				 4

			Pourquoi est-ce qu'il y a autant de cartoons chinois dans le...

Petite liste de mes envies de la japanimation.
(Mémo perso, moyen de donner des idées à d'autres gens, toussa toussa)

Autres...

				 4

			Anime/Japanimation (séries)

				Avec :
															Cowboy Bebop,
																				Planetes,
																				Neon Genesis Evangelion,
																				Ghost in the Shell : Stand Alone Complex,
																				Gurren Lagann

				 4

			- MANGAS VUS -

				Avec :
															FullMetal Alchemist : Brotherhood,
																				Fullmetal Alchemist,
																				Death Note,
																				Samurai Champloo,
																				Afro Samurai

				 2

			Animés

				Avec :
															Sword Art Online,
																				Date a Live,
																				Date A Live II,
																				Baka to Test to Shoukanjuu,
																				Baka to Test to Shoukanju Ni

				 1

			 Toutes les listes

				InfosBlack Butler: Book of Murder

				Les fiches SensCritique sont en wiki. Cette fiche semble bien vide, voulez-vous l'éditer ?

				Dernières actions sur cet anime

			Black Butler: Book of Murder

		 Plus d'actualité

				Le bouche à oreille

L'avis de vos amis en 1 clic

				S'inscrire avec FB

										Du même groupe

					Black Butler

						Black Butler

			Toshiya Shinohara

						Black Butler

			Yana Toboso

						Black Butler: Book of Circus

			Yana Toboso

						Black Butler

			Kentarô Ohtani et Kei'ichi Sato

				Lab

				Changelog

				À propos

				Aide

				Blog

				Publicité

				Emploi

				Conditions d'utilisation

Séances de cinéma

Programme TV ce soir

Programme TV aujourd'hui

Programme TV demain

Programme TV cette semaine

					Avis films

					Avis séries

					Avis livres

					Avis BD

					Avis jeux vidéo

					Avis musique

		© 2015 SensCritique


text:
package Paws::ELB::SetLoadBalancerListenerSSLCertificateOutput;
  use Moose;

  has _request_id => (is => 'ro', isa => 'Str');
1;

### main pod documentation begin ###

=head1 NAME

Paws::ELB::SetLoadBalancerListenerSSLCertificateOutput

=head1 ATTRIBUTES

=head2 _request_id => Str

=cut


text:
import { Collision } from './collision.js'
import { CollisionPoint } from './collisionpoint.js'
import { Vector } from './vector.js'

/**
 * Fixed arc at given origin and radius. Start angle and end angle define
 * the two points where the arg starts and ends on the unit circle. The
 * right most point of the circle is 0. The top is PI/2. The left most point
 * is PI. Width denotes the "thickness" of the arc.
 *
 * @author Martin Hentschel
 */
export class FixedArc {
  constructor (id, origin, radius, width, startAngle, endAngle) {
    this.id = id
    this.origin = origin
    this.velocity = new Vector(0, 0)
    this.angularVelocity = 0
    this.radius = radius
    this.width = width
    this.startAngle = startAngle
    this.endAngle = endAngle
  }

  collide (collidingBody, timestep, restitution) {
    let collision = null
    for (let corner = 0; corner < 4; corner++) {
      // Vector vertex = body.vertex(i);
      const vertexX = collidingBody.cornerX[corner]
      const vertexY = collidingBody.cornerY[corner]
      const diffX = vertexX - this.origin.x
      const diffY = vertexY - this.origin.y
      const distance = Vector.length(diffX, diffY)
      const angle = Vector.angle(diffX, diffY)
      if (
        distance >= this.radius &&
        distance < this.radius + this.width &&
        angle > this.startAngle &&
        angle < this.endAngle
      ) {
        if (collision === null) {
          collision = new Collision(restitution)
        }
        const separation = distance - this.radius

        // Vector normal = Vector.unitVector(vertex, origin);
        let normalX = this.origin.x - vertexX
        let normalY = this.origin.y - vertexY
        const normalLen = Vector.length(normalX, normalY)
        normalX /= normalLen
        normalY /= normalLen

        const collisionPoint = new CollisionPoint(
          collidingBody,
          this,
          normalX,
          normalY,
          vertexX,
          vertexY,
          separation
        )
        collision.collisionPoints.push(collisionPoint)
      }
    }
    return collision
  }

  // this is a fixed entity
  invertedMass () {
    return 0
  }

  // this is a fixed entity
  invertedInertia () {
    return 0
  }

  // fixed entity has no velocity
  addVelocity (velocity) {}

  // fixed entity has no angular velocity
  addAngularVelocity (angularVelocity) {}
}


text:
rm -rf autom4te.cache
rm -f aclocal.m4
#case `uname` in Darwin*) glibtoolize --force --copy ;;
#  *) libtoolize --force --copy ;; esac
autoreconf --install
#autoheader
#automake --add-missing --foreign --copy --force-missing
#autoconf --force
rm -rf autom4te.cache


text:
package br.com.dgimenes.smashbrostwitteranalytics.util;

import java.io.IOException;

import javax.faces.application.ResourceHandler;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebFilter("/*")
public class NoCacheFilter implements Filter {

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
			ServletException {
		HttpServletRequest httpReq = (HttpServletRequest) request;
		HttpServletResponse httpRes = (HttpServletResponse) response;

		// Skip JSF resources (CSS/JS/Images/etc of JSF or PrimeFaces)
		if (!httpReq.getRequestURI().startsWith(httpReq.getContextPath() + ResourceHandler.RESOURCE_IDENTIFIER)) {
			// HTTP 1.1.
			httpRes.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
			// HTTP 1.0.
			httpRes.setHeader("Pragma", "no-cache");
			// Proxies.
			httpRes.setDateHeader("Expires", 0);
		}
		chain.doFilter(request, response);
	}

	@Override
	public void destroy() {
	}

	@Override
	public void init(FilterConfig arg0) throws ServletException {
	}
}


text:
// CHECKSTYLE IGNORE Javadoc

package com.netflix.simianarmy.aws.chaos;

import org.testng.annotations.Test;
import org.testng.Assert;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.LinkedList;

import com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup;
import com.netflix.simianarmy.aws.AWSClient;
import com.amazonaws.services.autoscaling.model.AutoScalingGroup;
import com.amazonaws.services.autoscaling.model.Instance;

public class TestASGChaosCrawler {
    private ASGChaosCrawler crawler;

    private AutoScalingGroup mkAsg(String asgName, String instanceId) {
        AutoScalingGroup asg = new AutoScalingGroup();
        asg.setAutoScalingGroupName(asgName);
        Instance inst = new Instance();
        inst.setInstanceId(instanceId);
        asg.setInstances(Arrays.asList(inst));
        return asg;
    }

    private AWSClient awsMock;

    public TestASGChaosCrawler() {
        awsMock = mock(AWSClient.class);
        crawler = new ASGChaosCrawler(awsMock);
    }

    @Test
    public void testGroupTypes() {
        EnumSet<?> types = crawler.groupTypes();
        Assert.assertEquals(types.size(), 1);
        Assert.assertEquals(types.iterator().next().name(), "ASG");
    }

    @Test
    public void testGroups() {
        List<AutoScalingGroup> asgList = new LinkedList<AutoScalingGroup>();
        asgList.add(mkAsg("asg1", "i-123456780"));
        asgList.add(mkAsg("asg2", "i-123456781"));

        when(awsMock.describeAutoScalingGroups()).thenReturn(asgList);

        List<InstanceGroup> groups = crawler.groups();

        verify(awsMock, times(1)).describeAutoScalingGroups();

        Assert.assertEquals(groups.size(), 2);

        Assert.assertEquals(groups.get(0).type(), ASGChaosCrawler.Types.ASG);
        Assert.assertEquals(groups.get(0).name(), "asg1");
        Assert.assertEquals(groups.get(0).instances().size(), 1);
        Assert.assertEquals(groups.get(0).instances().get(0), "i-123456780");

        Assert.assertEquals(groups.get(1).type(), ASGChaosCrawler.Types.ASG);
        Assert.assertEquals(groups.get(1).name(), "asg2");
        Assert.assertEquals(groups.get(1).instances().size(), 1);
        Assert.assertEquals(groups.get(1).instances().get(0), "i-123456781");
    }
}


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>

  <parent>
    <groupId>org.gbif.crawler</groupId>
    <artifactId>crawler-motherpom</artifactId>
    <version>1.15-SNAPSHOT</version>
  </parent>

  <artifactId>crawler-metasync</artifactId>

  <name>Crawler :: Metadata Synchronizer</name>

  <distributionManagement>
    <site>
      <id>gh-pages</id>
      <url>https://gbif.github.io/crawler/${project.artifactId}/</url>
    </site>
  </distributionManagement>

  <properties>
    <main.basedir>${project.parent.basedir}</main.basedir>
    <joda-time.version>2.8.1</joda-time.version>
    <velocity.version>1.7</velocity.version>

    <sonar.coverage.jacoco.xmlReportPaths>
      ${project.basedir}/../registry-integration-tests/target/site/jacoco-aggregate/jacoco.xml
    </sonar.coverage.jacoco.xmlReportPaths>
  </properties>

  <repositories>
    <repository>
      <id>gbif-all</id>
      <url>https://repository.gbif.org/content/groups/gbif</url>
    </repository>
  </repositories>

  <dependencies>
    <!-- GBIF dependencies -->
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-parsers</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gbif.registry</groupId>
      <artifactId>registry-ws-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-common-ws</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Third party dependencies -->
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-digester3</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>${velocity.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>${joda-time.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>


text:
from __future__ import annotations

from io import BytesIO
from textwrap import dedent
from zipfile import ZipFile

import pytest

from pants.backend.google_cloud_function.python.rules import PythonGoogleCloudFunctionFieldSet
from pants.backend.google_cloud_function.python.rules import (
    rules as python_google_cloud_function_rules,
)
from pants.backend.google_cloud_function.python.target_types import PythonGoogleCloudFunction
from pants.backend.google_cloud_function.python.target_types import rules as target_rules
from pants.backend.python.subsystems.lambdex import Lambdex
from pants.backend.python.subsystems.lambdex import (
    rules as python_google_cloud_function_subsystem_rules,
)
from pants.backend.python.target_types import PythonSourcesGeneratorTarget
from pants.backend.python.target_types_rules import rules as python_target_types_rules
from pants.core.goals.package import BuiltPackage
from pants.core.target_types import FilesGeneratorTarget, RelocatedFiles, ResourcesGeneratorTarget
from pants.core.target_types import rules as core_target_types_rules
from pants.engine.addresses import Address
from pants.engine.fs import DigestContents
from pants.testutil.python_interpreter_selection import all_major_minor_python_versions
from pants.testutil.rule_runner import QueryRule, RuleRunner

@pytest.fixture
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=[
            *python_google_cloud_function_rules(),
            *python_google_cloud_function_subsystem_rules(),
            *target_rules(),
            *python_target_types_rules(),
            *core_target_types_rules(),
            QueryRule(BuiltPackage, (PythonGoogleCloudFunctionFieldSet,)),
        ],
        target_types=[
            PythonGoogleCloudFunction,
            PythonSourcesGeneratorTarget,
            FilesGeneratorTarget,
            RelocatedFiles,
            ResourcesGeneratorTarget,
        ],
    )

def create_python_google_cloud_function(
    rule_runner: RuleRunner, addr: Address, *, extra_args: list[str] | None = None
) -> tuple[str, bytes]:
    rule_runner.set_options(
        [
            "--source-root-patterns=src/python",
            *(extra_args or ()),
        ],
        env_inherit={"PATH", "PYENV_ROOT", "HOME"},
    )
    target = rule_runner.get_target(addr)
    built_asset = rule_runner.request(
        BuiltPackage, [PythonGoogleCloudFunctionFieldSet.create(target)]
    )
    assert (
        "    Runtime: python37",
        "    Handler: main.handler",
    ) == built_asset.artifacts[0].extra_log_lines
    digest_contents = rule_runner.request(DigestContents, [built_asset.digest])
    assert len(digest_contents) == 1
    relpath = built_asset.artifacts[0].relpath
    assert relpath is not None
    return relpath, digest_contents[0].content

@pytest.mark.platform_specific_behavior
@pytest.mark.parametrize(
    "major_minor_interpreter",
    all_major_minor_python_versions(Lambdex.default_interpreter_constraints),
)
def test_create_hello_world_lambda(rule_runner: RuleRunner, major_minor_interpreter: str) -> None:
    rule_runner.write_files(
        {
            "src/python/foo/bar/hello_world.py": dedent(
                """
                def handler(event, context):
                    print('Hello, World!')
                """
            ),
            "src/python/foo/bar/BUILD": dedent(
                """
                python_sources(name='lib')

                python_google_cloud_function(
                    name='lambda',
                    dependencies=[':lib'],
                    handler='foo.bar.hello_world:handler',
                    runtime='python37',
                    type='event',
                )
                """
            ),
        }
    )
    zip_file_relpath, content = create_python_google_cloud_function(
        rule_runner,
        Address("src/python/foo/bar", target_name="lambda"),
        extra_args=[f"--lambdex-interpreter-constraints=['=={major_minor_interpreter}.*']"],
    )
    assert "src.python.foo.bar/lambda.zip" == zip_file_relpath
    zipfile = ZipFile(BytesIO(content))
    names = set(zipfile.namelist())
    assert "main.py" in names
    assert "foo/bar/hello_world.py" in names

def test_warn_files_targets(rule_runner: RuleRunner, caplog) -> None:
    rule_runner.write_files(
        {
            "assets/f.txt": "",
            "assets/BUILD": dedent(
                """\
                files(name='files', sources=['f.txt'])
                relocated_files(
                    name='relocated',
                    files_targets=[':files'],
                    src='assets',
                    dest='new_assets',
                )

                # Resources are fine.
                resources(name='resources', sources=['f.txt'])
                """
            ),
            "src/py/project/__init__.py": "",
            "src/py/project/app.py": dedent(
                """\
                def handler(event, context):
                    print('Hello, World!')
                """
            ),
            "src/py/project/BUILD": dedent(
                """\
                python_sources(
                    name='lib',
                    dependencies=['assets:files', 'assets:relocated', 'assets:resources'],
                )

                python_google_cloud_function(
                    name='lambda',
                    dependencies=[':lib'],
                    handler='foo.bar.hello_world:handler',
                    runtime='python37',
                    type='event',
                )
                """
            ),
        }
    )

    assert not caplog.records
    zip_file_relpath, _ = create_python_google_cloud_function(
        rule_runner, Address("src/py/project", target_name="lambda")
    )
    assert caplog.records
    assert "src.py.project/lambda.zip" == zip_file_relpath
    assert (
        "The `python_google_cloud_function` target src/py/project:lambda transitively depends on"
        in caplog.text
    )
    assert "assets/f.txt:files" in caplog.text
    assert "assets:relocated" in caplog.text
    assert "assets:resources" not in caplog.text


text:
<TITLE>Review for My Giant (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

My Giant (1998)

reviewed by
Jon Popick

PLANET SICK-BOY: http://www.sick-boy.com

Apparently, while Billy Crystal spends all of his free time tying to
figure out how to work the names of all five `Best Picture' nominees
into an irritating song and dance number, he has his mongoloid nephew
read scripts and recommend projects for him.  Note to Billy – IT'S OVER!

In his latest big screen blunder, Crystal (Father's Day) stars as an
unsuccessful New York talent agent named Sammy.  He currently has but
one client, an annoying pre-pubescent douche bag that is currently
filming a `Crusades' picture in Romania.  After travelling around the
world to the location, Sammy in unceremoniously dumped by the little
brat.  Why he had to go there at all, I will never know.

Thankfully, Sammy gets into a car wreck, but he doesn't die.  In fact,
he is saved by a seven-and-a-half foot glandular case named Max (NBA
star Gheorge Muresan).  The giant lives with a bunch of monks because
the townsfolk call him mean names.  These monks are the kind that don't
talk.  Or maybe they're the kind of monks who just don't talk in front
of Billy Crystal because they were raised to not say anything if they
can't say anything nice.  I do think there was one in the background
giggling about Mr. Saturday Night.

Anyway, Max drags Sammy back to his lair (which oddly resembles
Crystal's home in The Princess Bride) and prattles on and on about his
long lost love who moved to Gallop, New Mexico.  He even has stacks and
stacks of letters that he has written to her.  Why they are still in his
possession, I will never know.

Not the type of guy to pass up the exploitation of a big stupid freak,
Sammy talks Max into becoming a movie star as well as an opportunity to
reunite with his beloved.  This Max is some actor.  His dopey grin and
cross-eyed blank stare make Andrew Shue look like an acting great.
Although he is a better screen presence than Shaq and Michael Jordan,
Muresan still makes my want to bash something apart with some type of
power tool.

Here's an idea – when you make a movie about a big tall guy, how about
showing him in places that normal people find cramped.  Max gets to go
on an airplane and in a cab, but we don't get to see either.  I would
have loved to have seen him crushing his Frankenstein head into the
overhead compartment or try to use the bathroom.  Something…anything.
Instead, My Giant's script is loosely held together by one of the
greatest vomiting scenes in history.

Or here is an even better story – instead of helping Sammy, Max eats
him.  He still becomes a big movie star and even gets to present an
award at the Oscars.  Instead of reading the names of the nominees, Max
pulls down his pants and craps out Sammy, who burst into a song and
dance number.  Jesus, I've got to write a script.  All I need is the
address for Billy's nephew.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
"""
Initialize Flask app

"""
from flask import Flask
import os
from flask_debugtoolbar import DebugToolbarExtension
from werkzeug.debug import DebuggedApplication

app = Flask('application')

#development settings
app.config.from_object('application.settings.Development')

#test settings
#app.config.from_object('application.settings.Testing')

#production settings
#app.config.from_object('application.settings.Production')

# Enable jinja2 loop controls extension
app.jinja_env.add_extension('jinja2.ext.loopcontrols')

# Pull in URL dispatch routes
import urls


text:
import json
import logging
import time
from future.backports.urllib.parse import parse_qs

from Cryptodome.PublicKey import RSA
from jwkest.ecc import P256
from jwkest.jwk import RSAKey
from jwkest.jwk import ECKey
from jwkest.jwk import SYMKey

from oic.extension import provider
from oic.extension.client import RegistrationRequest
from oic.oauth2.message import AccessTokenRequest
from oic.oauth2.message import ASConfigurationResponse
from oic.utils.keyio import keyjar_init

from otest.events import EV_FAULT
from otest.events import EV_PROTOCOL_REQUEST

from oauth2test.rp.server import Server

__author__ = 'roland'

logger = logging.getLogger(__name__)

class TestError(Exception):
    pass

def sort_string(string):
    if string is None:
        return ""

    _l = list(string)
    _l.sort()
    return "".join(_l)

class Provider(provider.Provider):
    def __init__(self, name, sdb, cdb, authn_broker, userinfo, authz,
                 client_authn, symkey, urlmap=None, ca_certs="", keyjar=None,
                 hostname="", template_lookup=None, template=None,
                 verify_ssl=True, capabilities=None, event_db=None,
                 config=None, **kwargs):

        provider.Provider.__init__(
            self, name, sdb, cdb, authn_broker, authz=authz,
            client_authn=client_authn, symkey=symkey, urlmap=urlmap,
            ca_bundle=ca_certs, keyjar=keyjar, hostname=hostname,
            verify_ssl=verify_ssl, capabilities=capabilities, config=config,
            server_cls=Server, **kwargs)

        self.claims_type = ["normal"]
        self.behavior_type = []
        self.server.behavior_type = self.behavior_type
        self.claim_access_token = {}
        self.init_keys = []
        self.update_key_use = ""
        self.events = event_db
        self.userinfo = userinfo
        self.template_lookup = template_lookup
        self.template = template
        self.strict = False
        self.jwx_def = {}
        self.build_jwx_def()

    def build_jwx_def(self):
        self.jwx_def = {}

        for _typ in ["signing_alg", "encryption_alg", "encryption_enc"]:
            self.jwx_def[_typ] = {}
            for item in ["id_token", "userinfo"]:
                cap_param = '{}_{}_values_supported'.format(item, _typ)
                try:
                    self.jwx_def[_typ][item] = self.capabilities[cap_param][0]
                except KeyError:
                    self.jwx_def[_typ][item] = ""

    def create_providerinfo(self, pcr_class=ASConfigurationResponse,
                            setup=None):
        _response = provider.Provider.create_providerinfo(self, pcr_class,
                                                          setup)

        if "isso" in self.behavior_type:
            _response["issuer"] = "https://example.com"

        return _response

    def check_scheme(self, reg_req):
        # Do initial verification that all endpoints from the client uses https
        for endp in ["redirect_uris", "jwks_uri", "initiate_login_uri"]:
            try:
                uris = reg_req[endp]
            except KeyError:
                continue

            if not isinstance(uris, list):
                uris = [uris]
            for uri in uris:
                if not uri.startswith("https://"):
                    return self._error(
                        error="invalid_configuration_parameter",
                        descr="Non-HTTPS endpoint in '{}'".format(endp))

    def registration_endpoint(self, request, authn=None, **kwargs):
        try:
            reg_req = RegistrationRequest().deserialize(request, "json")
        except ValueError:
            reg_req = RegistrationRequest().deserialize(request)

        logger.debug("@registration_endpoint: {}".format(reg_req))
        self.events.store(EV_PROTOCOL_REQUEST, reg_req)

        if self.strict:
            resp = self.check_scheme(reg_req)
            if resp:
                return resp

        _response = provider.Provider.registration_endpoint(
            self, request=request, authn=authn, **kwargs)

        logger.debug('registration response: {}'.format(_response.message))
        self.init_keys = []
        if "jwks_uri" in reg_req:
            if _response.status == "200 OK":
                # find the client id
                req_resp = ASConfigurationResponse().from_json(
                    _response.message)
                # for kb in self.keyjar[req_resp["client_id"]]:
                #     if kb.imp_jwks:
                #         self.trace.info("Client JWKS: {}".format(kb.imp_jwks))

        return _response

    def authorization_endpoint(self, request="", cookie=None, **kwargs):
        _req = parse_qs(request)

        _response = provider.Provider.authorization_endpoint(self, request,
                                                             cookie, **kwargs)

        # This is just for logging purposes
        try:
            _resp = self.server.http_request(_req["request_uri"][0])
        except KeyError:
            pass
        else:
            if _resp.status_code == 200:
                self.events.store("Request_uri content",_resp.text)

        return _response

    def token_endpoint(self, request="", authn=None, **kwargs):

        try:
            req = AccessTokenRequest().deserialize(request, 'urlencoded')
            client_id = self.client_authn(self, req, authn)
        except Exception as err:
            self.events.store(EV_FAULT, err)
            return self._error(error="incorrect_behavior",
                               descr="Failed to verify client")

        if self.events:
            self.events.store(EV_PROTOCOL_REQUEST, req)

        try:
            self._update_client_keys(client_id)
        except TestError:
            return self._error(error="incorrect_behavior",
                               descr="No change in client keys")

        _response = provider.Provider.token_endpoint(
            self, authn=authn, request=request, **kwargs)

        return _response

    def generate_jwks(self, mode):
        if "rotenc" in self.behavior_type:  # Rollover encryption keys
            rsa_key = RSAKey(kid="rotated_rsa_{}".format(time.time()),
                             use="enc").load_key(RSA.generate(2048))
            ec_key = ECKey(kid="rotated_ec_{}".format(time.time()),
                           use="enc").load_key(P256)

            keys = [rsa_key.serialize(private=True),
                    ec_key.serialize(private=True)]
            new_keys = {"keys": keys}
            #self.do_key_rollover(new_keys, "%d")

            signing_keys = [k.to_dict() for k in self.keyjar.get_signing_key()]
            new_keys["keys"].extend(signing_keys)
            return json.dumps(new_keys)
        elif "nokid1jwk" in self.behavior_type:
            alg = mode["sign_alg"]
            if not alg:
                alg = "RS256"
            keys = [k.to_dict() for kb in self.keyjar[""] for k in
                    list(kb.keys())]
            for key in keys:
                if key["use"] == "sig" and key["kty"].startswith(alg[:2]):
                    key.pop("kid", None)
                    jwk = dict(keys=[key])
                    return json.dumps(jwk)
            raise Exception(
                "Did not find sig {} key for nokid1jwk test ".format(alg))
        else:  # Return all keys
            keys = [k.to_dict() for kb in self.keyjar[""] for k in
                    list(kb.keys())]
            jwks = dict(keys=keys)
            return json.dumps(jwks)

    def _update_client_keys(self, client_id):
        if "updkeys" in self.behavior_type:
            if not self.init_keys:
                if "rp_enc_key" in self.baseurl:
                    self.update_key_use = "enc"
                else:
                    self.update_key_use = "sig"
                self.init_keys = []
                for kb in self.keyjar[client_id]:
                    for key in kb.available_keys():
                        if isinstance(key, SYMKey):
                            pass
                        elif key.use == self.update_key_use:
                            self.init_keys.append(key)
            else:
                for kb in self.keyjar[client_id]:
                    kb.update()
                    if kb.imp_jwks:
                        self.events.store("Client JWKS", kb.imp_jwks)
                same = 0
                # Verify that the new keys are not the same
                for kb in self.keyjar[client_id]:
                    for key in kb.available_keys():
                        if isinstance(key, SYMKey):
                            pass
                        elif key.use == self.update_key_use:
                            if key in self.init_keys:
                                same += 1
                            else:
                                self.events.store("New key", key)
                if same == len(self.init_keys):  # no change
                    raise TestError("Keys unchanged")
                else:
                    self.events.store('Key change',
                                      "{} changed, {} the same".format(
                                          len(self.init_keys) - same, same))

    def __setattr__(self, key, value):
        if key == "keys":
            # Update the keyjar instead of just storing the keys description
            keyjar_init(self, value)
        else:
            super(provider.Provider, self).__setattr__(key, value)

    def _get_keyjar(self):
        return self.server.keyjar

    def _set_keyjar(self, item):
        self.server.keyjar = item

    keyjar = property(_get_keyjar, _set_keyjar)


text:
package io.cucumber.jakarta.cdi.example;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class Belly {

    private int cukes;

    public int getCukes() {
        return cukes;
    }

    public void setCukes(int cukes) {
        this.cukes = cukes;
    }

}


text:
package com.whatdoyouwanttodo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.whatdoyouwanttodo.utils.ActivityUtils;

public class LongOperationActivity extends ActionBarActivity {
	private static LongOperationModel modelParam = null;

	public static Intent getStartIntent(Activity caller, LongOperationModel model) {
		Intent intent = new Intent(caller, LongOperationActivity.class);
		LongOperationActivity.modelParam  = model;
		return intent;
	}

	public static interface LongOperationModel {
		String getTitle();
		String getSubtitle();
		void doOperation(LongOperationStep callback);
	}

	public static interface LongOperationStep {
		void onStep(int progress, String detail1, String detail2);
		void onEnd();
	}

	private LongOperationModel model = null;
	private ProgressBar progressBar;
	private TextView details1Text;
	private TextView details2Text;

	private Thread thread = null;

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

		model = modelParam;
		modelParam = null;

		ActivityUtils.disableKeyguard(this);
		ActivityUtils.disableWakeLock(this);

		ActivityUtils.changeActionBarTitle(this, model.getTitle());
		TextView subtitle = (TextView) findViewById(R.id.subtitle);
		subtitle.setText(model.getSubtitle());

		progressBar = (ProgressBar) findViewById(R.id.progress);
		details1Text = (TextView) findViewById(R.id.details1);
		details2Text = (TextView) findViewById(R.id.details2);

		thread = new Thread(runnable);
		thread.start();
	}

	private Runnable runnable = new Runnable() {
		@Override
		public void run() {
			model.doOperation(longOperationStep);
		}
	};

	private LongOperationStep longOperationStep = new LongOperationStep() {
		@Override
		public void onStep(int progress, String details1, String details2) {
			LongOperationActivity.this.runOnUiThread(new UpdateRunnable(progress, details1, details2));
		}

		@Override
		public void onEnd() {
			LongOperationActivity.this.runOnUiThread(new Runnable() {
				@Override
				public void run() {
					LongOperationActivity.this.finish();
				}
			});
		}
	};

	private class UpdateRunnable implements Runnable {
		private int progress;
		private String details1;
		private String details2;

		public UpdateRunnable(int progress, String details1, String details2) {
			this.progress = progress;
			this.details1 = details1;
			this.details2 = details2;
		}

		@Override
		public void run() {
			if (LongOperationActivity.this != null) {
				if (progressBar != null) {
					progressBar.setProgress(progress);
					details1Text.setText(details1);
					details2Text.setText(details2);
				}
			}
		}
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();

		model = null;
		progressBar = null;
		details1Text = null;
		details2Text = null;

		ActivityUtils.clearKeyguard();
		ActivityUtils.clearWakeLock();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.long_operation, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}


text:
package com.primalpond.hunt.agent.prey;

import java.nio.FloatBuffer;

import d3kod.graphics.extra.Utilities;

public abstract class BodyPartGraphic {
	protected float mSize;
	protected D3Prey mGraphic;
	protected float mDetailsStep;
	protected float[] mVerticesData;
	protected FloatBuffer mVertexBuffer;
	protected BodyPart mBodyPart;
	private static final String TAG = "BodyPartGraphic";

	public BodyPartGraphic(D3Prey graphic, BodyPart bodyPart, float size) {
		mSize = size;
		mGraphic = graphic;
		mBodyPart = bodyPart;
		mDetailsStep = graphic.getDetailsStep();
		mVerticesData = calcVerticesData();
		mVertexBuffer = Utilities.newFloatBuffer(mVerticesData);
	}

	protected abstract float[] calcVerticesData();

	public void draw(float[] modelMatrix, float[] mVMatrix, float[] mProjMatrix) {
		mGraphic.setDrawVMatrix(mVMatrix);
		mGraphic.setDrawProjMatrix(mProjMatrix);
        mGraphic.drawBuffer(mVertexBuffer, modelMatrix);
	}

	public abstract void update(float interpolation);

	public float getEndAnglePredicted() {
		return 0;
	}

	public float getStartAnglePredicted() {
		// TODO Auto-generated method stub
		return 0;
	}
}


text:
require 'spec_helper'

RSpec.describe 'Plugin example' do
  subject { Plugin }
  let(:plugins) { {} }

  it 'should return correctly' do
    expect(subject.registry.keys).to eq(%i[my_plugin another_plugin])
    expect(subject.registry[:my_plugin]).to eq(MyPlugin)
    expect(subject.registry[:another_plugin]).to eq(AnotherPlugin)
  end
end


text:
This patch cleans up the code of
`imgaug.augmenters.blur.blur_gaussian_()`. A very small
performance improvement (factor ~1.03x) is expected.


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
    <url>https://translate.zanata.org/</url>
    <project>nucleus-plugin</project>
    <project-version>Plugin</project-version>
    <project-type>properties</project-type>
    <src-dir>src/main/resources/assets/nucleus</src-dir>
    <trans-dir>src/main/resources/assets/nucleus</trans-dir>
    <includes>*.properties</includes>
    <excludes>*_*.properties</excludes>
    <rules/>
</config>


text:
package org.apache.spark.sql.v2.avro

import org.apache.hadoop.mapreduce.Job

import org.apache.spark.sql.avro.AvroUtils
import org.apache.spark.sql.connector.write.LogicalWriteInfo
import org.apache.spark.sql.execution.datasources.OutputWriterFactory
import org.apache.spark.sql.execution.datasources.v2.FileWrite
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types._

case class AvroWrite(
    paths: Seq[String],
    formatName: String,
    supportsDataType: DataType => Boolean,
    info: LogicalWriteInfo) extends FileWrite {
  override def prepareWrite(
      sqlConf: SQLConf,
      job: Job,
      options: Map[String, String],
      dataSchema: StructType): OutputWriterFactory = {
    AvroUtils.prepareWrite(sqlConf, job, options, dataSchema)
  }
}


text:
import React from 'react-native';
import Root from './src/root';

const {
  AppRegistry,
} = React;

AppRegistry.registerComponent('Quilt', () => Root);


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Particles" inherits="GeometryInstance" category="Core" version="3.1">
	<brief_description>
		3D particle emitter.
	</brief_description>
	<description>
		3D particle node used to create a variety of particle systems and effects. [code]Particles[/code] features an emitter that generates some number of particles at a given rate.
		Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="capture_aabb" qualifiers="const">
			<return type="AABB">
			</return>
			<description>
			</description>
		</method>
		<method name="restart">
			<return type="void">
			</return>
			<description>
				Restarts the particle emmission, clearing existing particles.
			</description>
		</method>
	</methods>
	<members>
		<member name="amount" type="int" setter="set_amount" getter="get_amount">
			Number of particles to emit.
		</member>
		<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles.DrawOrder">
			Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [code]DRAW_ORDER_INDEX[/code].
		</member>
		<member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
			[Mesh] that is drawn for the first draw pass.
		</member>
		<member name="draw_pass_2" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
			[Mesh] that is drawn for the second draw pass.
		</member>
		<member name="draw_pass_3" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
			[Mesh] that is drawn for the third draw pass.
		</member>
		<member name="draw_pass_4" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
			[Mesh] that is drawn for the fourth draw pass.
		</member>
		<member name="draw_passes" type="int" setter="set_draw_passes" getter="get_draw_passes">
			The number of draw passes when rendering particles.
		</member>
		<member name="emitting" type="bool" setter="set_emitting" getter="is_emitting">
			If [code]true[/code] particles are being emitted. Default value: [code]true[/code].
		</member>
		<member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio">
			Time ratio between each emission. If [code]0[/code] particles are emitted continuously. If [code]1[/code] all particles are emitted simultaneously. Default value: [code]0[/code].
		</member>
		<member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps">
		</member>
		<member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta">
		</member>
		<member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime">
			Amount of time each particle will exist. Default value: [code]1[/code].
		</member>
		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates">
			If [code]true[/code] particles use the parent node's coordinate space. If [code]false[/code] they use global coordinates. Default value: [code]true[/code].
		</member>
		<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot">
			If [code]true[/code] only [code]amount[/code] particles will be emitted. Default value: [code]false[/code].
		</member>
		<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time">
			Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting.
		</member>
		<member name="process_material" type="Material" setter="set_process_material" getter="get_process_material">
			[Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial].
		</member>
		<member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio">
			Emission randomness ratio. Default value: [code]0[/code].
		</member>
		<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale">
			Speed scaling ratio. Default value: [code]1[/code].
		</member>
		<member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb">
			The [AABB] that determines the area of the world part of which needs to be visible on screen for the particle system to be active.
		</member>
	</members>
	<constants>
		<constant name="DRAW_ORDER_INDEX" value="0" enum="DrawOrder">
			Particles are drawn in the order emitted.
		</constant>
		<constant name="DRAW_ORDER_LIFETIME" value="1" enum="DrawOrder">
			Particles are drawn in order of remaining lifetime.
		</constant>
		<constant name="DRAW_ORDER_VIEW_DEPTH" value="2" enum="DrawOrder">
			Particles are drawn in order of depth.
		</constant>
		<constant name="MAX_DRAW_PASSES" value="4">
			Maximum number of draw passes supported.
		</constant>
	</constants>
</class>