text:
package org.elasticsearch.test.hamcrest;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.RandomObjects;

import java.io.IOException;

import static java.util.Collections.emptyList;
import static org.elasticsearch.test.VersionUtils.randomVersion;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertVersionSerializable;
import static org.hamcrest.Matchers.containsString;

public class ElasticsearchAssertionsTests extends ESTestCase {
    public void testAssertVersionSerializableIsOkWithIllegalArgumentException() {
        Version version = randomVersion(random());
        NamedWriteableRegistry registry = new NamedWriteableRegistry(emptyList());
        Streamable testStreamable = new TestStreamable();

        // Should catch the exception and do nothing.
        assertVersionSerializable(version, testStreamable, registry);
    }

    public static class TestStreamable implements Streamable {
        @Override
        public void readFrom(StreamInput in) throws IOException {
        }

        @Override
        public void writeTo(StreamOutput out) throws IOException {
            throw new IllegalArgumentException("Not supported.");
        }
    }

    public void testAssertXContentEquivalent() throws IOException {
        try (XContentBuilder original = JsonXContent.contentBuilder()) {
            original.startObject();
            for (Object value : RandomObjects.randomStoredFieldValues(random(), original.contentType()).v1()) {
                original.field(randomAlphaOfLength(10), value);
            }
            {
                original.startObject(randomAlphaOfLength(10));
                for (Object value : RandomObjects.randomStoredFieldValues(random(), original.contentType()).v1()) {
                    original.field(randomAlphaOfLength(10), value);
                }
                original.endObject();
            }
            {
                original.startArray(randomAlphaOfLength(10));
                for (Object value : RandomObjects.randomStoredFieldValues(random(), original.contentType()).v1()) {
                    original.value(value);
                }
                original.endArray();
            }
            original.endObject();

            try (XContentBuilder copy = JsonXContent.contentBuilder();
                    XContentParser parser = createParser(original.contentType().xContent(), original.bytes())) {
                parser.nextToken();
                XContentHelper.copyCurrentStructure(copy.generator(), parser);
                try (XContentBuilder copyShuffled = shuffleXContent(copy) ) {
                    assertToXContentEquivalent(original.bytes(), copyShuffled.bytes(), original.contentType());
                }
            }
        }
    }

    public void testAssertXContentEquivalentErrors() throws IOException {
        {
            XContentBuilder builder = JsonXContent.contentBuilder();
            builder.startObject();
            {
                builder.startObject("foo");
                {
                    builder.field("f1", "value1");
                    builder.field("f2", "value2");
                }
                builder.endObject();
            }
            builder.endObject();

            XContentBuilder otherBuilder = JsonXContent.contentBuilder();
            otherBuilder.startObject();
            {
                otherBuilder.startObject("foo");
                {
                    otherBuilder.field("f1", "value1");
                }
                otherBuilder.endObject();
            }
            otherBuilder.endObject();
            AssertionError error = expectThrows(AssertionError.class,
                    () -> assertToXContentEquivalent(builder.bytes(), otherBuilder.bytes(), builder.contentType()));
            assertThat(error.getMessage(), containsString("f2: expected [value2] but not found"));
        }
        {
            XContentBuilder builder = JsonXContent.contentBuilder();
            builder.startObject();
            {
                builder.startObject("foo");
                {
                    builder.field("f1", "value1");
                    builder.field("f2", "value2");
                }
                builder.endObject();
            }
            builder.endObject();

            XContentBuilder otherBuilder = JsonXContent.contentBuilder();
            otherBuilder.startObject();
            {
                otherBuilder.startObject("foo");
                {
                    otherBuilder.field("f1", "value1");
                    otherBuilder.field("f2", "differentValue2");
                }
                otherBuilder.endObject();
            }
            otherBuilder.endObject();
            AssertionError error = expectThrows(AssertionError.class,
                    () -> assertToXContentEquivalent(builder.bytes(), otherBuilder.bytes(), builder.contentType()));
            assertThat(error.getMessage(), containsString("f2: expected [value2] but was [differentValue2]"));
        }
        {
            XContentBuilder builder = JsonXContent.contentBuilder();
            builder.startObject();
            {
                builder.startArray("foo");
                {
                    builder.value("one");
                    builder.value("two");
                    builder.value("three");
                }
                builder.endArray();
            }
            builder.field("f1", "value");
            builder.endObject();

            XContentBuilder otherBuilder = JsonXContent.contentBuilder();
            otherBuilder.startObject();
            {
                otherBuilder.startArray("foo");
                {
                    otherBuilder.value("one");
                    otherBuilder.value("two");
                    otherBuilder.value("four");
                }
                otherBuilder.endArray();
            }
            otherBuilder.field("f1", "value");
            otherBuilder.endObject();
            AssertionError error = expectThrows(AssertionError.class,
                    () -> assertToXContentEquivalent(builder.bytes(), otherBuilder.bytes(), builder.contentType()));
            assertThat(error.getMessage(), containsString("2: expected [three] but was [four]"));
        }
        {
            XContentBuilder builder = JsonXContent.contentBuilder();
            builder.startObject();
            {
                builder.startArray("foo");
                {
                    builder.value("one");
                    builder.value("two");
                    builder.value("three");
                }
                builder.endArray();
            }
            builder.endObject();

            XContentBuilder otherBuilder = JsonXContent.contentBuilder();
            otherBuilder.startObject();
            {
                otherBuilder.startArray("foo");
                {
                    otherBuilder.value("one");
                    otherBuilder.value("two");
                }
                otherBuilder.endArray();
            }
            otherBuilder.endObject();
            AssertionError error = expectThrows(AssertionError.class,
                    () -> assertToXContentEquivalent(builder.bytes(), otherBuilder.bytes(), builder.contentType()));
            assertThat(error.getMessage(), containsString("expected [1] more entries"));
        }
    }
}


text:
import os
from setuptools import setup, find_packages
import roadmap

def read(fname):
    try:
        return open(os.path.join(os.path.dirname(__file__), fname)).read()
    except IOError:
        return ''

setup(
    name="django-roadmap",
    version=roadmap.__version__,
    description=read('DESCRIPTION'),
    long_description=read('README.rst'),
    license='The MIT License',
    platforms=['OS Independent'],
    keywords='django, event, milestone, roadmap',
    author='Martin Brochhaus',
    author_email='mbrochh@gmail.com',
    url="https://github.com/bitmazk/django-roadmap",
    packages=find_packages(),
    include_package_data=True,
    installl_requires=[
        'django',
        'django-hvad',
    ],
    tests_require=[
        'fabric',
        'factory_boy',
        'django-nose',
        'coverage',
        'django-coverage',
        'mock',
    ],
    test_suite='roadmap.tests.runtests.runtests',
)

redpajama_set_name: RedPajamaGithub


text:
(function () {
    function solve(){
        return function(){
            $.fn.listview = function(data){
                var that = this,
                    dataTemplateValue = that.attr('data-template'),
                    predefinedTemplate = document.getElementById(dataTemplateValue).innerHTML,
                    result = '{{#each this}}' + predefinedTemplate + '{{/each}}',
                    compiled;

                compiled = Handlebars.compile(result);
                that.append(compiled(data));
                return that;
            };
        };
    }

// module.exports = solve;
}());

//var books = [
//        {id: 1, title: 'First title'},
//        {id: 2, title: 'Second title'}
//    ];
//
//$('#books-list').listview(books);


text:
ACCEPTED

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

#### Published in
Annls Sci. Nat. , Bot. , sér. 3 8: 172, 182 (1847)

#### Original name
Sporonema Desmazières, 1847

### Remarks
null


text:
<?php

final class LegalpadDocumentSignController extends LegalpadController {

  private $isSessionGate;

  public function shouldAllowPublic() {
    return true;
  }

  public function shouldAllowLegallyNonCompliantUsers() {
    return true;
  }

  public function setIsSessionGate($is_session_gate) {
    $this->isSessionGate = $is_session_gate;
    return $this;
  }

  public function getIsSessionGate() {
    return $this->isSessionGate;
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $request->getUser();

    $document = id(new LegalpadDocumentQuery())
      ->setViewer($viewer)
      ->withIDs(array($request->getURIData('id')))
      ->needDocumentBodies(true)
      ->executeOne();
    if (!$document) {
      return new Aphront404Response();
    }

    $information = $this->readSignerInformation(
      $document,
      $request);
    if ($information instanceof AphrontResponse) {
      return $information;
    }
    list($signer_phid, $signature_data) = $information;

    $signature = null;

    $type_individual = LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL;
    $is_individual = ($document->getSignatureType() == $type_individual);
    switch ($document->getSignatureType()) {
      case LegalpadDocument::SIGNATURE_TYPE_NONE:
        // nothing to sign means this should be true
        $has_signed = true;
        // this is a status UI element
        $signed_status = null;
        break;
      case LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL:
        if ($signer_phid) {
          // TODO: This is odd and should probably be adjusted after
          // grey/external accounts work better, but use the omnipotent
          // viewer to check for a signature so we can pick up
          // anonymous/grey signatures.

          $signature = id(new LegalpadDocumentSignatureQuery())
            ->setViewer(PhabricatorUser::getOmnipotentUser())
            ->withDocumentPHIDs(array($document->getPHID()))
            ->withSignerPHIDs(array($signer_phid))
            ->executeOne();

          if ($signature && !$viewer->isLoggedIn()) {
          return $this->newDialog()
            ->setTitle(pht('Already Signed'))
            ->appendParagraph(pht('You have already signed this document!'))
            ->addCancelButton('/'.$document->getMonogram(), pht('Okay'));
          }
        }

        $signed_status = null;
        if (!$signature) {
          $has_signed = false;
          $signature = id(new LegalpadDocumentSignature())
            ->setSignerPHID($signer_phid)
            ->setDocumentPHID($document->getPHID())
            ->setDocumentVersion($document->getVersions());

          // If the user is logged in, show a notice that they haven't signed.
          // If they aren't logged in, we can't be as sure, so don't show
          // anything.
          if ($viewer->isLoggedIn()) {
            $signed_status = id(new PHUIInfoView())
              ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
              ->setErrors(
                array(
                  pht('You have not signed this document yet.'),
                ));
          }
        } else {
          $has_signed = true;
          $signature_data = $signature->getSignatureData();

          // In this case, we know they've signed.
          $signed_at = $signature->getDateCreated();

          if ($signature->getIsExemption()) {
            $exemption_phid = $signature->getExemptionPHID();
            $handles = $this->loadViewerHandles(array($exemption_phid));
            $exemption_handle = $handles[$exemption_phid];

            $signed_text = pht(
              'You do not need to sign this document. '.
              '%s added a signature exemption for you on %s.',
              $exemption_handle->renderLink(),
              phabricator_datetime($signed_at, $viewer));
          } else {
            $signed_text = pht(
              'You signed this document on %s.',
              phabricator_datetime($signed_at, $viewer));
          }

          $signed_status = id(new PHUIInfoView())
            ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
            ->setErrors(array($signed_text));
        }

        $field_errors = array(
          'name' => true,
          'email' => true,
          'agree' => true,
        );
        $signature->setSignatureData($signature_data);
        break;

      case LegalpadDocument::SIGNATURE_TYPE_CORPORATION:
        $signature = id(new LegalpadDocumentSignature())
          ->setDocumentPHID($document->getPHID())
          ->setDocumentVersion($document->getVersions());

        if ($viewer->isLoggedIn()) {
          $has_signed = false;

          $signed_status = null;
        } else {
          // This just hides the form.
          $has_signed = true;

          $login_text = pht(
            'This document requires a corporate signatory. You must log in to '.
            'accept this document on behalf of a company you represent.');
          $signed_status = id(new PHUIInfoView())
            ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
            ->setErrors(array($login_text));
        }

        $field_errors = array(
          'name' => true,
          'address' => true,
          'contact.name' => true,
          'email' => true,
        );
        $signature->setSignatureData($signature_data);
        break;
    }

    $errors = array();
    $hisec_token = null;
    if ($request->isFormOrHisecPost() && !$has_signed) {
      list($form_data, $errors, $field_errors) = $this->readSignatureForm(
        $document,
        $request);

      $signature_data = $form_data + $signature_data;

      $signature->setSignatureData($signature_data);
      $signature->setSignatureType($document->getSignatureType());
      $signature->setSignerName((string)idx($signature_data, 'name'));
      $signature->setSignerEmail((string)idx($signature_data, 'email'));

      $agree = $request->getExists('agree');
      if (!$agree) {
        $errors[] = pht(
          'You must check "I agree to the terms laid forth above."');
        $field_errors['agree'] = pht('Required');
      }

      if ($viewer->isLoggedIn() && $is_individual) {
        $verified = LegalpadDocumentSignature::VERIFIED;
      } else {
        $verified = LegalpadDocumentSignature::UNVERIFIED;
      }
      $signature->setVerified($verified);

      if (!$errors) {
        // Require MFA to sign legal documents.
        if ($viewer->isLoggedIn()) {
          $workflow_key = sprintf(
            'legalpad.sign(%s)',
            $document->getPHID());

          $hisec_token = id(new PhabricatorAuthSessionEngine())
            ->setWorkflowKey($workflow_key)
            ->requireHighSecurityToken(
              $viewer,
              $request,
              $document->getURI());
        }

        $signature->save();

        // If the viewer is logged in, signing for themselves, send them to
        // the document page, which will show that they have signed the
        // document. Unless of course they were required to sign the
        // document to use Phabricator; in that case try really hard to
        // re-direct them to where they wanted to go.
        //
        // Otherwise, send them to a completion page.
        if ($viewer->isLoggedIn() && $is_individual) {
          $next_uri = '/'.$document->getMonogram();
          if ($document->getRequireSignature()) {
            $request_uri = $request->getRequestURI();
            $next_uri = (string)$request_uri;
          }
        } else {
          $this->sendVerifySignatureEmail(
            $document,
            $signature);

          $next_uri = $this->getApplicationURI('done/');
        }

        return id(new AphrontRedirectResponse())->setURI($next_uri);
      }
    }

    $document_body = $document->getDocumentBody();
    $engine = id(new PhabricatorMarkupEngine())
      ->setViewer($viewer);
    $engine->addObject(
      $document_body,
      LegalpadDocumentBody::MARKUP_FIELD_TEXT);
    $engine->process();

    $document_markup = $engine->getOutput(
      $document_body,
      LegalpadDocumentBody::MARKUP_FIELD_TEXT);

    $title = $document_body->getTitle();

    $manage_uri = $this->getApplicationURI('view/'.$document->getID().'/');

    $can_edit = PhabricatorPolicyFilter::hasCapability(
      $viewer,
      $document,
      PhabricatorPolicyCapability::CAN_EDIT);

    // Use the last content update as the modified date. We don't want to
    // show that a document like a TOS was "updated" by an incidental change
    // to a field like the preamble or privacy settings which does not actually
    // affect the content of the agreement.
    $content_updated = $document_body->getDateCreated();

    // NOTE: We're avoiding `setPolicyObject()` here so we don't pick up
    // extra UI elements that are unnecessary and clutter the signature page.
    // These details are available on the "Manage" page.
    $header = id(new PHUIHeaderView())
      ->setHeader($title)
      ->setUser($viewer)
      ->setEpoch($content_updated);

    // If we're showing the user this document because it's required to use
    // Phabricator and they haven't signed it, don't show the "Manage" button,
    // since it won't work.
    $is_gate = $this->getIsSessionGate();
    if (!$is_gate) {
      $header->addActionLink(
        id(new PHUIButtonView())
          ->setTag('a')
          ->setIcon('fa-pencil')
          ->setText(pht('Manage'))
          ->setHref($manage_uri)
          ->setDisabled(!$can_edit)
          ->setWorkflow(!$can_edit));
    }

    $preamble_box = null;
    if (strlen($document->getPreamble())) {
      $preamble_text = new PHUIRemarkupView($viewer, $document->getPreamble());

      // NOTE: We're avoiding `setObject()` here so we don't pick up extra UI
      // elements like "Subscribers". This information is available on the
      // "Manage" page, but just clutters up the "Signature" page.
      $preamble = id(new PHUIPropertyListView())
        ->setUser($viewer)
        ->addSectionHeader(pht('Preamble'))
        ->addTextContent($preamble_text);

      $preamble_box = new PHUIPropertyGroupView();
      $preamble_box->addPropertyList($preamble);
    }

    $content = id(new PHUIDocumentView())
      ->addClass('legalpad')
      ->setHeader($header)
      ->appendChild(
        array(
          $signed_status,
          $preamble_box,
          $document_markup,
        ));

    $signature_box = null;
    if (!$has_signed) {
      $error_view = null;
      if ($errors) {
        $error_view = id(new PHUIInfoView())
          ->setErrors($errors);
      }

      $signature_form = $this->buildSignatureForm(
        $document,
        $signature,
        $field_errors);

      switch ($document->getSignatureType()) {
        default:
          break;
        case LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL:
        case LegalpadDocument::SIGNATURE_TYPE_CORPORATION:
          $box = id(new PHUIObjectBoxView())
            ->addClass('document-sign-box')
            ->setHeaderText(pht('Agree and Sign Document'))
            ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
            ->setForm($signature_form);
          if ($error_view) {
            $box->setInfoView($error_view);
          }
          $signature_box = phutil_tag_div(
            'phui-document-view-pro-box plt', $box);
          break;
      }

    }

    $crumbs = $this->buildApplicationCrumbs();
    $crumbs->setBorder(true);
    $crumbs->addTextCrumb($document->getMonogram());

    $box = id(new PHUITwoColumnView())
      ->setFooter($signature_box);

    return $this->newPage()
      ->setTitle($title)
      ->setCrumbs($crumbs)
      ->setPageObjectPHIDs(array($document->getPHID()))
      ->appendChild(array(
        $content,
        $box,
      ));
  }

  private function readSignerInformation(
    LegalpadDocument $document,
    AphrontRequest $request) {

    $viewer = $request->getUser();
    $signer_phid = null;
    $signature_data = array();

    switch ($document->getSignatureType()) {
      case LegalpadDocument::SIGNATURE_TYPE_NONE:
        break;
      case LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL:
        if ($viewer->isLoggedIn()) {
          $signer_phid = $viewer->getPHID();
          $signature_data = array(
            'name' => $viewer->getRealName(),
            'email' => $viewer->loadPrimaryEmailAddress(),
          );
        } else if ($request->isFormPost()) {
          $email = new PhutilEmailAddress($request->getStr('email'));
          if (strlen($email->getDomainName())) {
            $email_obj = id(new PhabricatorUserEmail())
              ->loadOneWhere('address = %s', $email->getAddress());
            if ($email_obj) {
              return $this->signInResponse();
            }
          }
        }
        break;
      case LegalpadDocument::SIGNATURE_TYPE_CORPORATION:
        $signer_phid = $viewer->getPHID();
        if ($signer_phid) {
          $signature_data = array(
            'contact.name' => $viewer->getRealName(),
            'email' => $viewer->loadPrimaryEmailAddress(),
            'actorPHID' => $viewer->getPHID(),
          );
        }
        break;
    }

    return array($signer_phid, $signature_data);
  }

  private function buildSignatureForm(
    LegalpadDocument $document,
    LegalpadDocumentSignature $signature,
    array $errors) {

    $viewer = $this->getRequest()->getUser();
    $data = $signature->getSignatureData();

    $form = id(new AphrontFormView())
      ->setUser($viewer);

    $signature_type = $document->getSignatureType();
    switch ($signature_type) {
      case LegalpadDocument::SIGNATURE_TYPE_NONE:
        // bail out of here quick
        return;
      case LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL:
        $this->buildIndividualSignatureForm(
          $form,
          $document,
          $signature,
          $errors);
        break;
      case LegalpadDocument::SIGNATURE_TYPE_CORPORATION:
        $this->buildCorporateSignatureForm(
          $form,
          $document,
          $signature,
          $errors);
        break;
      default:
        throw new Exception(
          pht(
            'This document has an unknown signature type ("%s").',
            $signature_type));
    }

    $form
      ->appendChild(
        id(new AphrontFormCheckboxControl())
          ->setError(idx($errors, 'agree', null))
          ->addCheckbox(
            'agree',
            'agree',
            pht('I agree to the terms laid forth above.'),
            false));
    if ($document->getRequireSignature()) {
      $cancel_uri = '/logout/';
      $cancel_text = pht('Log Out');
    } else {
      $cancel_uri = $this->getApplicationURI();
      $cancel_text = pht('Cancel');
    }
    $form
      ->appendChild(
        id(new AphrontFormSubmitControl())
          ->setValue(pht('Sign Document'))
          ->addCancelButton($cancel_uri, $cancel_text));

    return $form;
  }

  private function buildIndividualSignatureForm(
    AphrontFormView $form,
    LegalpadDocument $document,
    LegalpadDocumentSignature $signature,
    array $errors) {

    $data = $signature->getSignatureData();

    $form
      ->appendChild(
        id(new AphrontFormTextControl())
        ->setLabel(pht('Name'))
        ->setValue(idx($data, 'name', ''))
        ->setName('name')
        ->setError(idx($errors, 'name', null)));

    $viewer = $this->getRequest()->getUser();
    if (!$viewer->isLoggedIn()) {
      $form->appendChild(
        id(new AphrontFormTextControl())
          ->setLabel(pht('Email'))
          ->setValue(idx($data, 'email', ''))
          ->setName('email')
          ->setError(idx($errors, 'email', null)));
    }

    return $form;
  }

  private function buildCorporateSignatureForm(
    AphrontFormView $form,
    LegalpadDocument $document,
    LegalpadDocumentSignature $signature,
    array $errors) {

    $data = $signature->getSignatureData();

    $form
      ->appendChild(
        id(new AphrontFormTextControl())
        ->setLabel(pht('Company Name'))
        ->setValue(idx($data, 'name', ''))
        ->setName('name')
        ->setError(idx($errors, 'name', null)))
      ->appendChild(
        id(new AphrontFormTextAreaControl())
        ->setLabel(pht('Company Address'))
        ->setValue(idx($data, 'address', ''))
        ->setName('address')
        ->setError(idx($errors, 'address', null)))
      ->appendChild(
        id(new AphrontFormTextControl())
        ->setLabel(pht('Contact Name'))
        ->setValue(idx($data, 'contact.name', ''))
        ->setName('contact.name')
        ->setError(idx($errors, 'contact.name', null)))
      ->appendChild(
        id(new AphrontFormTextControl())
        ->setLabel(pht('Contact Email'))
        ->setValue(idx($data, 'email', ''))
        ->setName('email')
        ->setError(idx($errors, 'email', null)));

    return $form;
  }

  private function readSignatureForm(
    LegalpadDocument $document,
    AphrontRequest $request) {

    $signature_type = $document->getSignatureType();
    switch ($signature_type) {
      case LegalpadDocument::SIGNATURE_TYPE_INDIVIDUAL:
        $result = $this->readIndividualSignatureForm(
          $document,
          $request);
        break;
      case LegalpadDocument::SIGNATURE_TYPE_CORPORATION:
        $result = $this->readCorporateSignatureForm(
          $document,
          $request);
        break;
      default:
        throw new Exception(
          pht(
            'This document has an unknown signature type ("%s").',
            $signature_type));
    }

    return $result;
  }

  private function readIndividualSignatureForm(
    LegalpadDocument $document,
    AphrontRequest $request) {

    $signature_data = array();
    $errors = array();
    $field_errors = array();

    $name = $request->getStr('name');

    if (!strlen($name)) {
      $field_errors['name'] = pht('Required');
      $errors[] = pht('Name field is required.');
    } else {
      $field_errors['name'] = null;
    }
    $signature_data['name'] = $name;

    $viewer = $request->getUser();
    if ($viewer->isLoggedIn()) {
      $email = $viewer->loadPrimaryEmailAddress();
    } else {
      $email = $request->getStr('email');

      $addr_obj = null;
      if (!strlen($email)) {
        $field_errors['email'] = pht('Required');
        $errors[] = pht('Email field is required.');
      } else {
        $addr_obj = new PhutilEmailAddress($email);
        $domain = $addr_obj->getDomainName();
        if (!$domain) {
          $field_errors['email'] = pht('Invalid');
          $errors[] = pht('A valid email is required.');
        } else {
          $field_errors['email'] = null;
        }
      }
    }
    $signature_data['email'] = $email;

    return array($signature_data, $errors, $field_errors);
  }

  private function readCorporateSignatureForm(
    LegalpadDocument $document,
    AphrontRequest $request) {

    $viewer = $request->getUser();
    if (!$viewer->isLoggedIn()) {
      throw new Exception(
        pht(
          'You can not sign a document on behalf of a corporation unless '.
          'you are logged in.'));
    }

    $signature_data = array();
    $errors = array();
    $field_errors = array();

    $name = $request->getStr('name');

    if (!strlen($name)) {
      $field_errors['name'] = pht('Required');
      $errors[] = pht('Company name is required.');
    } else {
      $field_errors['name'] = null;
    }
    $signature_data['name'] = $name;

    $address = $request->getStr('address');
    if (!strlen($address)) {
      $field_errors['address'] = pht('Required');
      $errors[] = pht('Company address is required.');
    } else {
      $field_errors['address'] = null;
    }
    $signature_data['address'] = $address;

    $contact_name = $request->getStr('contact.name');
    if (!strlen($contact_name)) {
      $field_errors['contact.name'] = pht('Required');
      $errors[] = pht('Contact name is required.');
    } else {
      $field_errors['contact.name'] = null;
    }
    $signature_data['contact.name'] = $contact_name;

    $email = $request->getStr('email');
    $addr_obj = null;
    if (!strlen($email)) {
      $field_errors['email'] = pht('Required');
      $errors[] = pht('Contact email is required.');
    } else {
      $addr_obj = new PhutilEmailAddress($email);
      $domain = $addr_obj->getDomainName();
      if (!$domain) {
        $field_errors['email'] = pht('Invalid');
        $errors[] = pht('A valid email is required.');
      } else {
        $field_errors['email'] = null;
      }
    }
    $signature_data['email'] = $email;

    return array($signature_data, $errors, $field_errors);
  }

  private function sendVerifySignatureEmail(
    LegalpadDocument $doc,
    LegalpadDocumentSignature $signature) {

    $signature_data = $signature->getSignatureData();
    $email = new PhutilEmailAddress($signature_data['email']);
    $doc_name = $doc->getTitle();
    $doc_link = PhabricatorEnv::getProductionURI('/'.$doc->getMonogram());
    $path = $this->getApplicationURI(sprintf(
      '/verify/%s/',
      $signature->getSecretKey()));
    $link = PhabricatorEnv::getProductionURI($path);

    $name = idx($signature_data, 'name');

    $body = pht(
      "%s:\n\n".
      "This email address was used to sign a Legalpad document ".
      "in %s:\n\n".
      "  %s\n\n".
      "Please verify you own this email address and accept the ".
      "agreement by clicking this link:\n\n".
      "  %s\n\n".
      "Your signature is not valid until you complete this ".
      "verification step.\n\nYou can review the document here:\n\n".
      "  %s\n",
      $name,
      PlatformSymbols::getPlatformServerName(),
      $doc_name,
      $link,
      $doc_link);

    id(new PhabricatorMetaMTAMail())
      ->addRawTos(array($email->getAddress()))
      ->setSubject(pht('[Legalpad] Signature Verification'))
      ->setForceDelivery(true)
      ->setBody($body)
      ->setRelatedPHID($signature->getDocumentPHID())
      ->saveAndSend();
  }

  private function signInResponse() {
    return id(new Aphront403Response())
      ->setForbiddenText(
        pht(
          'The email address specified is associated with an account. '.
          'Please login to that account and sign this document again.'));
  }

}


text:
from input_file_node import InputFileNode

class ConcatNode(InputFileNode):
    def __init__(self):
        self._children = []

    def accept(self, v):
        for child in self._children:
            child.accept(v)

        v.visit_concat_node(self)


text:
require "dry/configurable"
require "dry/core/class_attributes"
require "dry/core/deprecations"
require_relative "source_dsl"

module Dry
  module System
    class Provider
      # A provider's source provides the specific behavior for a given provider to serve
      # its purpose.
      #
      # Sources should be subclasses of `Dry::System::Source::Provider`, with instance
      # methods for each lifecycle step providing their behavior: {#prepare}, {#start},
      # and {#stop}.
      #
      # Inside each of these methods, you should create and configure your provider's
      # objects as required, and then {#register} them with the {#provider_container}.
      # When the provider's lifecycle steps are run (via {Dry::System::Provider}), these
      # registered components will be merged into the target container.
      #
      # You can prepare a provider's source in two ways:
      #
      # 1. Passing a bock when registering the provider, which is then evaluated via
      #    {Dry::System::Provider::SourceDSL} to prepare the provider subclass. This
      #    approach is easiest for simple providers.
      # 2. Manually creare your own subclass of {Dry::System::Provider} and implement your
      #    own instance methods for the lifecycle steps (you should not implement your own
      #    `#initialize`). This approach may be useful for more complex providers.
      #
      # @see Dry::System::Container.register_provider
      # @see Dry::System.register_provider_source
      # @see Dry::System::Source::ProviderDSL
      #
      # @api public
      class Source
        class << self
          # Returns a new Dry::System::Provider::Source subclass with its behavior supplied by the
          # given block, which is evaluated using Dry::System::Provider::SourceDSL.
          #
          # @see Dry::System::Provider::SourceDSL
          #
          # @api private
          def for(name:, group: nil, target_container:, &block) # rubocop:disable Style/KeywordParametersOrder
            Class.new(self) { |klass|
              klass.source_name name
              klass.source_group group
              SourceDSL.evaluate(klass, target_container, &block) if block
            }
          end

          def inherited(subclass)
            super

            # FIXME: This shouldn't _need_ to be in an inherited hook but right now it's
            # the only way to prevent individual Source instances from sharing settings
            subclass.include Dry::Configurable
          end

          # @api private
          def name
            source_str = source_name
            source_str = "#{source_group}->#{source_str}" if source_group

            "Dry::System::Provider::Source[#{source_str}]"
          end

          # @api private
          def to_s
            "#<#{name}>"
          end

          # @api private
          def inspect
            to_s
          end
        end

        CALLBACK_MAP = Hash.new { |h, k| h[k] = [] }.freeze

        extend Dry::Core::ClassAttributes

        defines :source_name, :source_group

        # @api private
        attr_reader :callbacks

        # Returns the provider's own container for the provider.
        #
        # This container is namespaced based on the provider's `namespace:` configuration.
        #
        # Registered components in this container will be merged into the target container
        # after the `prepare` and `start` lifecycle steps.
        #
        # @return [Dry::Container]
        #
        # @see #target_container
        # @see Dry::System::Provider
        #
        # @api public
        attr_reader :provider_container
        alias_method :container, :provider_container

        # Returns the target container for the provider.
        #
        # This is the container with which the provider is registered (via
        # {Dry::System::Container.register_provider}).
        #
        # Registered components from the provider's container will be merged into this
        # container after the `prepare` and `start` lifecycle steps.
        #
        # @return [Dry::System::Container]
        #
        # @see #provider_container
        # @see Dry::System::Provider
        #
        # @api public
        attr_reader :target_container
        alias_method :target, :target_container

        # @api private
        def initialize(provider_container:, target_container:, &block)
          super()
          @callbacks = {before: CALLBACK_MAP.dup, after: CALLBACK_MAP.dup}
          @provider_container = provider_container
          @target_container = target_container
          instance_exec(&block) if block
        end

        # Returns a string containing a human-readable representation of the provider.
        #
        # @return [String]
        #
        # @api private
        def inspect
          ivars = instance_variables.map { |ivar|
            "#{ivar}=#{instance_variable_get(ivar).inspect}"
          }.join(" ")

          "#<#{self.class.name} #{ivars}>"
        end

        # Runs the behavior for the "prepare" lifecycle step.
        #
        # This should be implemented by your source subclass or specified by
        # `SourceDSL#prepare` when registering a provider using a block.
        #
        # @return [void]
        #
        # @see SourceDSL#prepare
        #
        # @api public
        def prepare; end

        # Runs the behavior for the "start" lifecycle step.
        #
        # This should be implemented by your source subclass or specified by
        # `SourceDSL#start` when registering a provider using a block.
        #
        # You can presume that {#prepare} has already run by the time this method is
        # called.
        #
        # @return [void]
        #
        # @see SourceDSL#start
        #
        # @api public
        def start; end

        # Runs the behavior for the "stop" lifecycle step.
        #
        # This should be implemented by your source subclass or specified by
        # `SourceDSL#stop` when registering a provider using a block.
        #
        # You can presume that {#prepare} and {#start} have already run by the time this
        # method is called.
        #
        # @return [void]
        #
        # @see SourceDSL#stop
        #
        # @api public
        def stop; end

        def use(*provider_names)
          Dry::Core::Deprecations.announce(
            "Dry::System::Provider#use",
            "Use `target_container.start` instead, e.g. `target_container.start(:another_provider)`", # rubocop:disable Layout/LineLength
            tag: "dry-system",
            uplevel: 1
          )

          provider_names.each do |name|
            target_container.start(name)
          end

          self
        end

        # Registers a "before" callback for the given lifecycle step.
        #
        # The given block will be run before the lifecycle step method is run. The block
        # will be evaluated in the context of the instance of this source.
        #
        # @param step_name [Symbol]
        # @param block [Proc] the callback block
        #
        # @return [self]
        #
        # @see #after
        #
        # @api public
        def before(step_name, &block)
          if step_name.to_sym == :init
            Dry::Core::Deprecations.announce(
              "Dry::System::Provider before(:init) callback",
              "Use `before(:prepare)` callback instead",
              tag: "dry-system",
              uplevel: 1
            )

            step_name = :prepare
          end

          callbacks[:before][step_name] << block
          self
        end

        # Registers an "after" callback for the given lifecycle step.
        #
        # The given block will be run after the lifecycle step method is run. The block
        # will be evaluated in the context of the instance of this source.
        #
        # @param step_name [Symbol]
        # @param block [Proc] the callback block
        #
        # @return [self]
        #
        # @see #before
        #
        # @api public
        def after(step_name, &block)
          if step_name.to_sym == :init
            Dry::Core::Deprecations.announce(
              "Dry::System::Provider after(:init) callback",
              "Use `after(:prepare)` callback instead",
              tag: "dry-system",
              uplevel: 1
            )

            step_name = :prepare
          end

          callbacks[:after][step_name] << block
          self
        end

        # @api private
        def run_callback(hook, step)
          callbacks[hook][step].each do |callback|
            if callback.parameters.any?
              Dry::Core::Deprecations.announce(
                "Dry::System::Provider::Source.before and .after callbacks with single block parameter", # rubocop:disable Layout/LineLength
                "Use `provider_container` (or `container` for short) inside your block instead",
                tag: "dry-system",
                uplevel: 1
              )

              instance_exec(provider_container, &callback)
            else
              instance_eval(&callback)
            end
          end
        end

        private

        # Registers a component in the provider container.
        #
        # When the provider's lifecycle steps are run (via {Dry::System::Provider}), these
        # registered components will be merged into the target container.
        #
        # @return [Dry::Container] the provider container
        #
        # @api public
        def register(...)
          provider_container.register(...)
        end

        # Resolves a previously registered component from the provider container.
        #
        # @param key [String] the key for the component to resolve
        #
        # @return [Object] the previously registered component
        #
        # @api public
        def resolve(key)
          provider_container.resolve(key)
        end

        # @api private
        def run_step_block(step_name)
          step_block = self.class.step_blocks[step_name]
          instance_eval(&step_block) if step_block
        end

        # @api private
        def method_missing(name, *args, &block)
          if container.key?(name)
            container[name]
          else
            super
          end
        end

        # @api private
        def respond_to_missing?(name, include_all = false)
          container.key?(name) || super
        end
      end
    end
  end
end


text:
// |jit-test| debug
setDebug(true);
function main() {
  return "failure";
}
/* JSOP_RETURN in main. */
trap(main, 5, "'success'");
assertEq(main(), "success");


text:
package de.iritgo.aktera.authentication;

import org.apache.avalon.framework.service.ServiceManager;
import javax.security.auth.callback.Callback;
import java.io.Serializable;

/**
 * @author Michael Nash
 *
 */
public class ServiceManagerCallback implements Callback, Serializable
{
	private ServiceManager myManager;

	public void setServiceManager(ServiceManager newManager)
	{
		myManager = newManager;
	}

	public ServiceManager getServiceManager()
	{
		return myManager;
	}
}


text:
/**
 * @license  Highcharts JS v6.1.1 (2018-06-27)
 * Highcharts variwide module
 *
 * (c) 2010-2017 Torstein Honsi
 *
 * License: www.highcharts.com/license
 */
'use strict';
(function (factory) {
	if (typeof module === 'object' && module.exports) {
		module.exports = factory;
	} else {
		factory(Highcharts);
	}
}(function (Highcharts) {
	(function (H) {
		/**
		 * Highcharts variwide module
		 *
		 * (c) 2010-2017 Torstein Honsi
		 *
		 * License: www.highcharts.com/license
		 */

		/**
		 * To do:
		 * - When X axis is not categorized, the scale should reflect how the z values
		 *   increase, like a horizontal stack. But then the actual X values aren't
		 *   reflected the the axis.. Should we introduce a Z axis too?
		 */

		var addEvent = H.addEvent,
		    seriesType = H.seriesType,
		    seriesTypes = H.seriesTypes,
		    each = H.each,
		    pick = H.pick;

		/**
		 * A variwide chart (related to marimekko chart) is a column chart with a
		 * variable width expressing a third dimension.
		 *
		 * @extends {plotOptions.column}
		 * @excluding boostThreshold,crisp,depth,edgeColor,edgeWidth,groupZPadding
		 * @product highcharts
		 * @sample {highcharts} highcharts/demo/variwide/
		 *         Variwide chart
		 * @sample {highcharts} highcharts/series-variwide/inverted/
		 *         Inverted variwide chart
		 * @since 6.0.0
		 * @optionparent plotOptions.variwide
		 */
		seriesType('variwide', 'column', {
		    /**
		     * In a variwide chart, the point padding is 0 in order to express the
		     * horizontal stacking of items.
		     */
		    pointPadding: 0,
		    /**
		     * In a variwide chart, the group padding is 0 in order to express the
		     * horizontal stacking of items.
		     */
		    groupPadding: 0
		}, {
		    pointArrayMap: ['y', 'z'],
		    parallelArrays: ['x', 'y', 'z'],
		    processData: function () {
		        this.totalZ = 0;
		        this.relZ = [];
		        seriesTypes.column.prototype.processData.call(this);

		        each(
		            this.xAxis.reversed ?
		                this.zData.slice().reverse() :
		                this.zData,
		            function (z, i) {
		                this.relZ[i] = this.totalZ;
		                this.totalZ += z;
		            },
		            this
		        );

		        if (this.xAxis.categories) {
		            this.xAxis.variwide = true;
		            this.xAxis.zData = this.zData; // Used for label rank
		        }
		    },

		    /**
		     * Translate an x value inside a given category index into the distorted
		     * axis translation.
		     * @param  {Number} index The category index
		     * @param  {Number} x The X pixel position in undistorted axis pixels
		     * @return {Number}   Distorted X position
		     */
		    postTranslate: function (index, x, point) {

		        var axis = this.xAxis,
		            relZ = this.relZ,
		            i = axis.reversed ? relZ.length - index : index,
		            goRight = axis.reversed ? -1 : 1,
		            len = axis.len,
		            totalZ = this.totalZ,
		            linearSlotLeft = i / relZ.length * len,
		            linearSlotRight = (i + goRight) / relZ.length * len,
		            slotLeft = (pick(relZ[i], totalZ) / totalZ) * len,
		            slotRight = (pick(relZ[i + goRight], totalZ) / totalZ) * len,
		            xInsideLinearSlot = x - linearSlotLeft,
		            ret;

		        // Set crosshairWidth for every point (#8173)
		        if (point) {
		            point.crosshairWidth = slotRight - slotLeft;
		        }

		        ret = slotLeft +
		            xInsideLinearSlot * (slotRight - slotLeft) /
		            (linearSlotRight - linearSlotLeft);

		        return ret;
		    },

		    /**
		     * Extend translation by distoring X position based on Z.
		     */
		    translate: function () {

		        // Temporarily disable crisping when computing original shapeArgs
		        var crispOption = this.options.crisp;
		        this.options.crisp = false;

		        seriesTypes.column.prototype.translate.call(this);

		        // Reset option
		        this.options.crisp = crispOption;

		        var inverted = this.chart.inverted,
		            crisp = this.borderWidth % 2 / 2;

		        // Distort the points to reflect z dimension
		        each(this.points, function (point, i) {
		            var left = this.postTranslate(
		                    i,
		                    point.shapeArgs.x,
		                    point
		                ),
		                right = this.postTranslate(
		                    i,
		                    point.shapeArgs.x + point.shapeArgs.width
		                );

		            if (this.options.crisp) {
		                left = Math.round(left) - crisp;
		                right = Math.round(right) - crisp;
		            }

		            point.shapeArgs.x = left;
		            point.shapeArgs.width = right - left;

		            // Crosshair position (#8083)
		            point.plotX = (left + right) / 2;

		            if (!inverted) {
		                point.tooltipPos[0] = this.postTranslate(
		                    i,
		                    point.tooltipPos[0]
		                );
		            } else {
		                point.tooltipPos[1] = this.xAxis.len - this.postTranslate(
		                    i,
		                    this.xAxis.len - point.tooltipPos[1]
		                );
		            }
		        }, this);
		    }

		// Point functions
		}, {
		    isValid: function () {
		        return H.isNumber(this.y, true) && H.isNumber(this.z, true);
		    }
		});

		H.Tick.prototype.postTranslate = function (xy, xOrY, index) {
		    var axis = this.axis,
		        pos = xy[xOrY] - axis.pos;

		    if (!axis.horiz) {
		        pos = axis.len - pos;
		    }
		    pos = axis.series[0].postTranslate(index, pos);

		    if (!axis.horiz) {
		        pos = axis.len - pos;
		    }
		    xy[xOrY] = axis.pos + pos;
		};

		// Same width as the category (#8083)
		addEvent(H.Axis, 'afterDrawCrosshair', function (e) {
		    if (this.variwide && this.cross) {
		        this.cross.attr('stroke-width', e.point && e.point.crosshairWidth);
		    }
		});

		// On a vertical axis, apply anti-collision logic to the labels.
		addEvent(H.Axis, 'afterRender', function () {
		    var axis = this;
		    if (!this.horiz && this.variwide) {
		        this.chart.labelCollectors.push(function () {
		            return H.map(axis.tickPositions, function (pos, i) {
		                var label = axis.ticks[pos].label;
		                label.labelrank = axis.zData[i];
		                return label;
		            });
		        });
		    }
		});

		addEvent(H.Tick, 'afterGetPosition', function (e) {
		    var axis = this.axis,
		        xOrY = axis.horiz ? 'x' : 'y';

		    if (axis.categories && axis.variwide) {
		        this[xOrY + 'Orig'] = e.pos[xOrY];
		        this.postTranslate(e.pos, xOrY, this.pos);
		    }
		});

		H.wrap(H.Tick.prototype, 'getLabelPosition', function (
		    proceed,
		    x,
		    y,
		    label,
		    horiz,
		    labelOptions,
		    tickmarkOffset,
		    index
		) {
		    var args = Array.prototype.slice.call(arguments, 1),
		        xy,
		        xOrY = horiz ? 'x' : 'y';

		    // Replace the x with the original x
		    if (this.axis.variwide && typeof this[xOrY + 'Orig'] === 'number') {
		        args[horiz ? 0 : 1] = this[xOrY + 'Orig'];
		    }

		    xy = proceed.apply(this, args);

		    // Post-translate
		    if (this.axis.variwide && this.axis.categories) {
		        this.postTranslate(xy, xOrY, index);
		    }
		    return xy;
		});

		/**
		 * A `variwide` series. If the [type](#series.variwide.type) option is
		 * not specified, it is inherited from [chart.type](#chart.type).
		 *
		 * @type {Object}
		 * @extends series,plotOptions.variwide
		 * @product highcharts
		 * @apioption series.variwide
		 */

		/**
		 * An array of data points for the series. For the `variwide` series type,
		 * points can be given in the following ways:
		 *
		 * 1.  An array of arrays with 3 or 2 values. In this case, the values
		 * correspond to `x,y,z`. If the first value is a string, it is applied
		 * as the name of the point, and the `x` value is inferred. The `x`
		 * value can also be omitted, in which case the inner arrays should
		 * be of length 2\. Then the `x` value is automatically calculated,
		 * either starting at 0 and incremented by 1, or from `pointStart` and
		 * `pointInterval` given in the series options.
		 *
		 *  ```js
		 *     data: [
		 *         [0, 1, 2],
		 *         [1, 5, 5],
		 *         [2, 0, 2]
		 *     ]
		 *  ```
		 *
		 * 2.  An array of objects with named values. The objects are point
		 * configuration objects as seen below. If the total number of data
		 * points exceeds the series' [turboThreshold](#series.variwide.turboThreshold),
		 * this option is not available.
		 *
		 *  ```js
		 *     data: [{
		 *         x: 1,
		 *         y: 1,
		 *         z: 1,
		 *         name: "Point2",
		 *         color: "#00FF00"
		 *     }, {
		 *         x: 1,
		 *         y: 5,
		 *         z: 4,
		 *         name: "Point1",
		 *         color: "#FF00FF"
		 *     }]
		 *  ```
		 *
		 * @type {Array<Object|Array>}
		 * @extends series.line.data
		 * @excluding marker
		 * @sample {highcharts} highcharts/chart/reflow-true/
		 *         Numerical values
		 * @sample {highcharts} highcharts/series/data-array-of-arrays/
		 *         Arrays of numeric x and y
		 * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
		 *         Arrays of datetime x and y
		 * @sample {highcharts} highcharts/series/data-array-of-name-value/
		 *         Arrays of point.name and y
		 * @sample {highcharts} highcharts/series/data-array-of-objects/
		 *         Config objects
		 * @product highcharts
		 * @apioption series.variwide.data
		 */

		/**
		 * The relative width for each column. The widths are distributed so they sum
		 * up to the X axis length.
		 *
		 * @type {Number}
		 * @product highcharts
		 * @apioption series.variwide.data.z
		 */

	}(Highcharts));
	return (function () {

	}());
}));


text:
require File.expand_path('../spec_helper', __FILE__)
require File.expand_path('../fixtures/class', __FILE__)

load_extension("class")

autoload :ClassUnderAutoload, "#{object_path}/class_under_autoload_spec"

describe :rb_path_to_class, shared: true do
  it "returns a class or module from a scoped String" do
    @s.send(@method, "CApiClassSpecs::A::B").should equal(CApiClassSpecs::A::B)
  end

  it "resolves autoload constants" do
    @s.send(@method, "CApiClassSpecs::A::D").name.should == "CApiClassSpecs::A::D"
  end

  it "raises an ArgumentError if a constant in the path does not exist" do
    lambda { @s.send(@method, "CApiClassSpecs::NotDefined::B") }.should raise_error(ArgumentError)
  end

  it "raises an ArgumentError if the final constant does not exist" do
    lambda { @s.send(@method, "CApiClassSpecs::NotDefined") }.should raise_error(ArgumentError)
  end

  it "raises a TypeError if the constant is not a class or module" do
    lambda { @s.send(@method, "CApiClassSpecs::A::C") }.should raise_error(TypeError)
  end

  it "raises an ArgumentError even if a constant in the path exists on toplevel" do
    lambda { @s.send(@method, "CApiClassSpecs::Object") }.should raise_error(ArgumentError)
  end
end

describe "C-API Class function" do
  before :each do
    @s = CApiClassSpecs.new
  end

  describe "rb_class_new_instance" do
    it "allocates and initializes a new object" do
      o = @s.rb_class_new_instance(0, nil, CApiClassSpecs::Alloc)
      o.class.should == CApiClassSpecs::Alloc
      o.initialized.should be_true
    end

    it "passes arguments to the #initialize method" do
      o = @s.rb_class_new_instance(2, [:one, :two], CApiClassSpecs::Alloc)
      o.arguments.should == [:one, :two]
    end
  end

  describe "rb_include_module" do
    it "includes a module into a class" do
      o = CApiClassSpecs::IncludesM.new
      lambda { o.included? }.should raise_error(NameError)
      @s.rb_include_module(CApiClassSpecs::IncludesM, CApiClassSpecs::M)
      o.included?.should be_true
    end
  end

  describe "rb_define_attr" do
    before :each do
      @a = CApiClassSpecs::Attr.new
    end

    it "defines an attr_reader when passed true, false" do
      @s.rb_define_attr(CApiClassSpecs::Attr, :foo, true, false)
      @a.foo.should == 1
      lambda { @a.foo = 5 }.should raise_error(NameError)
    end

    it "defines an attr_writer when passed false, true" do
      @s.rb_define_attr(CApiClassSpecs::Attr, :bar, false, true)
      lambda { @a.bar }.should raise_error(NameError)
      @a.bar = 5
      @a.instance_variable_get(:@bar).should == 5
    end

    it "defines an attr_accessor when passed true, true" do
      @s.rb_define_attr(CApiClassSpecs::Attr, :baz, true, true)
      @a.baz.should == 3
      @a.baz = 6
      @a.baz.should == 6
    end
  end

  describe "rb_call_super" do
    it "calls the method in the superclass" do
      @s.define_call_super_method CApiClassSpecs::Sub, "call_super_method"
      obj = CApiClassSpecs::Sub.new
      obj.call_super_method.should == :super_method
    end

    it "calls the method in the superclass through two native levels" do
      @s.define_call_super_method CApiClassSpecs::Sub, "call_super_method"
      @s.define_call_super_method CApiClassSpecs::SubSub, "call_super_method"
      obj = CApiClassSpecs::SubSub.new
      obj.call_super_method.should == :super_method
    end
  end

  describe "rb_class2name" do
    it "returns the class name" do
      @s.rb_class2name(CApiClassSpecs).should == "CApiClassSpecs"
    end

    it "returns a string for an anonymous class" do
      @s.rb_class2name(Class.new).should be_kind_of(String)
    end
  end

  describe "rb_class_path" do
    it "returns a String of a class path with no scope modifiers" do
      @s.rb_class_path(Array).should == "Array"
    end

    it "returns a String of a class path with scope modifiers" do
      @s.rb_class_path(File::Stat).should == "File::Stat"
    end
  end

  describe "rb_class_name" do
    it "returns the class name" do
      @s.rb_class_name(CApiClassSpecs).should == "CApiClassSpecs"
    end

    it "returns a string for an anonymous class" do
      @s.rb_class_name(Class.new).should be_kind_of(String)
    end
  end

  describe "rb_path2class" do
    it_behaves_like :rb_path_to_class, :rb_path2class
  end

  describe "rb_path_to_class" do
    it_behaves_like :rb_path_to_class, :rb_path_to_class
  end

  describe "rb_cvar_defined" do
    it "returns false when the class variable is not defined" do
      @s.rb_cvar_defined(CApiClassSpecs::CVars, "@@nocvar").should be_false
    end

    it "returns true when the class variable is defined" do
      @s.rb_cvar_defined(CApiClassSpecs::CVars, "@@cvar").should be_true
    end

    it "returns true if the class instance variable is defined" do
      @s.rb_cvar_defined(CApiClassSpecs::CVars, "@c_ivar").should be_true
    end
  end

  describe "rb_cv_set" do
    it "sets a class variable" do
      o = CApiClassSpecs::CVars.new
      o.new_cv.should be_nil
      @s.rb_cv_set(CApiClassSpecs::CVars, "@@new_cv", 1)
      o.new_cv.should == 1
    end
  end

  describe "rb_cv_get" do
    it "returns the value of the class variable" do
      @s.rb_cvar_get(CApiClassSpecs::CVars, "@@cvar").should == :cvar
    end

    it "raises a NameError if the class variable is not defined" do
      lambda {
        @s.rb_cv_get(CApiClassSpecs::CVars, "@@no_cvar")
      }.should raise_error(NameError)
    end
  end

  describe "rb_cvar_set" do
    it "sets a class variable" do
      o = CApiClassSpecs::CVars.new
      o.new_cvar.should be_nil
      @s.rb_cvar_set(CApiClassSpecs::CVars, "@@new_cvar", 1)
      o.new_cvar.should == 1
    end

  end

  describe "rb_define_class_under" do
    it "creates a subclass of the superclass contained in a module" do
      cls = @s.rb_define_class_under(CApiClassSpecs,
                                     "ClassUnder1",
                                     CApiClassSpecs::Super)
      cls.should be_kind_of(Class)
      CApiClassSpecs::Super.should be_ancestor_of(CApiClassSpecs::ClassUnder1)
    end

    it "uses Object as the superclass if NULL is passed" do
      @s.rb_define_class_under(CApiClassSpecs, "ClassUnder2", nil)
      Object.should be_ancestor_of(CApiClassSpecs::ClassUnder2)
    end

    it "sets the class name" do
      cls = @s.rb_define_class_under(CApiClassSpecs, "ClassUnder3", nil)
      cls.name.should == "CApiClassSpecs::ClassUnder3"
    end

    it "calls #inherited on the superclass" do
      CApiClassSpecs::Super.should_receive(:inherited)
      cls = @s.rb_define_class_under(CApiClassSpecs,
                                     "ClassUnder4", CApiClassSpecs::Super)
    end

    it "raises a TypeError when given a non class object to superclass" do
      lambda { @s.rb_define_class_under(CApiClassSpecs,
                                        "ClassUnder5",
                                        Module.new)
      }.should raise_error(TypeError)
    end

    ruby_version_is "2.3" do
      it "raises a TypeError when given a mismatched class to superclass" do
        CApiClassSpecs::ClassUnder6 = Class.new(CApiClassSpecs::Super)
        lambda { @s.rb_define_class_under(CApiClassSpecs,
                                          "ClassUnder6",
                                          Class.new)
        }.should raise_error(TypeError)
      end
    end

    ruby_version_is ""..."2.3" do
      it "raises a NameError when given a mismatched class to superclass" do
        CApiClassSpecs::ClassUnder6 = Class.new(CApiClassSpecs::Super)
        lambda { @s.rb_define_class_under(CApiClassSpecs,
                                          "ClassUnder6",
                                          Class.new)
        }.should raise_error(NameError)
      end
    end

    it "defines a class for an existing Autoload" do
      compile_extension("class_under_autoload")

      ClassUnderAutoload.name.should == "ClassUnderAutoload"
    end
  end

  describe "rb_define_class_variable" do
    it "sets a class variable" do
      o = CApiClassSpecs::CVars.new
      o.rbdcv_cvar.should be_nil
      @s.rb_define_class_variable(CApiClassSpecs::CVars, "@@rbdcv_cvar", 1)
      o.rbdcv_cvar.should == 1
    end
  end

  describe "rb_cvar_get" do
    it "returns the value of the class variable" do
      @s.rb_cvar_get(CApiClassSpecs::CVars, "@@cvar").should == :cvar
    end

    it "raises a NameError if the class variable is not defined" do
      lambda {
        @s.rb_cvar_get(CApiClassSpecs::CVars, "@@no_cvar")
      }.should raise_error(NameError)
    end
  end

  describe "rb_class_inherited" do
    before :each do
      @subclass = Class.new
    end

    it "calls superclass.inherited(subclass)" do
      @s.rb_class_inherited(CApiClassSpecs::Inherited, @subclass).should equal(@subclass)
    end

    it "calls Object.inherited(subclass) if superclass is C NULL" do
      Object.should_receive(:inherited).with(@subclass)

      # Pass false to have the specs helper C function pass NULL
      @s.rb_class_inherited(false, @subclass)
    end
  end

  describe "rb_class_new" do
    it "returns an new subclass of the superclass" do
      subclass = @s.rb_class_new(CApiClassSpecs::NewClass)
      CApiClassSpecs::NewClass.should be_ancestor_of(subclass)
    end

    it "raises a TypeError if passed Class as the superclass" do
      lambda { @s.rb_class_new(Class) }.should raise_error(TypeError)
    end

    it "raises a TypeError if passed a singleton class as the superclass" do
      metaclass = Object.new.singleton_class
      lambda { @s.rb_class_new(metaclass) }.should raise_error(TypeError)
    end
  end

  describe "rb_class_superclass" do
    it "returns the superclass of a class" do
      cls = @s.rb_class_superclass(CApiClassSpecs::Sub)
      cls.should == CApiClassSpecs::Super
    end

    it "returns nil if the class has no superclass" do
      @s.rb_class_superclass(BasicObject).should be_nil
    end
  end

  describe "rb_class_real" do
    it "returns the class of an object ignoring the singleton class" do
      obj = CApiClassSpecs::Sub.new
      def obj.some_method() end

      @s.rb_class_real(obj).should == CApiClassSpecs::Sub
    end

    it "returns the class of an object ignoring included modules" do
      obj = CApiClassSpecs::SubM.new
      @s.rb_class_real(obj).should == CApiClassSpecs::SubM
    end

    it "returns 0 if passed 0" do
      @s.rb_class_real(0).should == 0
    end
  end
end


text:
autocommit on;

create procedure test_int7(i number)
as language java name 'SpTest.testInt_1(int) return int';

drop procedure test_int7;

create  procedure test_int7(i number)
as language java name 'SpTest.testInt_1(int) ';

drop procedure test_int7;

$integer,$5;
call test_int7(?) ;
$integer,$8;
call test_int7(?) ;
$integer,$100;
call test_int7(?, '1') ;

drop procedure test_int7;

create  procedure test_int7(i  in out number)
as language java name 'SpTest.testInt_3(int []) ';

$integer,$5;
call test_int7(?) ;
$integer,$8;
call test_int7(?) ;
$integer,$100;
call test_int7(?, '1') ;

drop procedure test_int7;

rollback;

autocommit on;


text:
<!DOCTYPE html>

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">

Today Stats

All time Stats


text: apt-get install vlc openshot x264 gimp


text:
/* Written by Stephen henson (steve@openssl.org) for the OpenSSL
 * project 2011.
 */
/* ====================================================================
 * Copyright (c) 2011 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@openssl.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

#include "cryptlib.h"
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#include <openssl/fips_rand.h>
#include <openssl/rand.h>
#endif

int FIPS_mode(void)
	{
	OPENSSL_init();
#ifdef OPENSSL_FIPS
	return FIPS_module_mode();
#else
	return 0;
#endif
	}

int FIPS_mode_set(int r)
	{
	OPENSSL_init();
#ifdef OPENSSL_FIPS
#ifndef FIPS_AUTH_USER_PASS
#define FIPS_AUTH_USER_PASS	"Default FIPS Crypto User Password"
#endif
	if (!FIPS_module_mode_set(r, FIPS_AUTH_USER_PASS))
		return 0;
	if (r)
		RAND_set_rand_method(FIPS_rand_get_method());
	else
		RAND_set_rand_method(NULL);
	return 1;
#else
	if (r == 0)
		return 1;
	CRYPTOerr(CRYPTO_F_FIPS_MODE_SET, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED);
	return 0;
#endif
	}


text:
title: Akış
inshort: Video portalı [YouTube]
translator: Microsoft Cognitive Services
---

Office 365'ın video portal akışıdır. Akış bir iç YouTube gibi düşün. Birden çok video dosyası türlerini destekler ve gelmek ile kanalları, yorum, takip, izlemek listeleri, izinleri denetimleri, Kapalı açıklamalı alt yazı ve bazı temel ölçümleri raporlama. Sigorta primi düzeyi abonelikler da yüz tanıma ve otomatik konuşma metni transkripsiyon içerir.

Akış yüklemek ve eşit derecede büyük ve küçük organizasyonlar için yararlı olabilir, paylaşımını kurumsal video mükemmel bir merkezi konum çok uluslu olanlar görevi görür. Akışı [SharePoint Online sayfaları] entegre (https://docs.microsoft.com/en-us/stream/embed-video-sharepoint), [ağlamak konuşmaları](https://stream.microsoft.com/en-us/blog/share-on-yammer/), [Microsoft Teams sekmeleri](https://docs.microsoft.com/en-us/stream/embed-video-microsoft-teams), ve her [Office 365 Grup](http://icsh.pt/O365groups) bir izin kontrollü akış portalı olsun.

Bir kaç şey akışı değil henüz destek dış access (dışında kuruluşunuzun), video çalma (paylaşılan veya kişisel), ve akarsu adı ne olursa olsun, yaşamak. Akışı Ayrıca değil yanlış olabilir için bir öğrenme yönetim sistemi; onun özellik kümesi genellikle LMS ihtiyaçlarınızı karşılamak değil.

Akışı olacak yakında tamamen [Office 365 videoyu değiştirmek](https://docs.microsoft.com/en-us/stream/migrate-from-office-365), bu yüzden bu Infographic Video göremiyorum. Bu nedenle, yalnızca ileri hareket akışı kullanmak için tavsiye edilir. Hayır yayımlanmış zaman çizelgesi'ne de nasıl yinelenen içerik veya portalları aynı adları ile başa çıkmak planlar hakkında ayrıntılı bilgi olsa Microsoft bu videolar göç Office 365 Video akışı için arka planda sahne alacak Devletler.

Kaynaklar
---------

-[Microsoft Stream giriş](https://www.linkedin.com/pulse/stream-video-portal-now-available-matt-wade/)
    \[Matt Wade\]

-[Microsoft Stream belgelerine](https://docs.microsoft.com/en-us/stream/)
    \[Microsoft\]

-[Office 365 Video akışı geçiş](https://docs.microsoft.com/en-us/stream/migrate-from-office-365)
    \[Microsoft\]

Benzer uygulamalar
--------------------

-YouTube

-Vimeo

-Office 365 Video

Geri bildirim
---------

-[Akışı Kullanıcı fikirleri](https://techcommunity.microsoft.com/t5/Microsoft-Stream-Ideas/idb-p/StreamIdeas)
    \[Microsoft\]

-[TechCommunity akışta](https://techcommunity.microsoft.com/t5/Microsoft-Stream-Ideas/idb-p/StreamIdeas)
    \[Microsoft\]

Yazar
---------

-[Matt Wade](https://www.linkedin.com/in/thatmattwade/), ofis hizmetleri MVP


text:
import unittest
import arff

class TestEncodeAttribute(unittest.TestCase):
    def get_encoder(self):
        decoder = arff.ArffEncoder()
        return decoder

    def test_attribute_name(self):
        encoder = self.get_encoder()

        fixture = ('attribute name', 'REAL')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE "attribute name" REAL'

        self.assertEqual(result, expected)

    def test_attribute_name_special(self):
        encoder = self.get_encoder()

        fixture = ('%attributename', 'REAL')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE "%attributename" REAL'
        self.assertEqual(result, expected)

        fixture = ('attribute,name', 'REAL')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE "attribute,name" REAL'
        self.assertEqual(result, expected)

    def test_attribute_real(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', 'REAL')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name REAL'

        self.assertEqual(result, expected)

    def test_attribute_numeric(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', 'NUMERIC')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name NUMERIC'

        self.assertEqual(result, expected)

    def test_attribute_integer(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', 'INTEGER')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name INTEGER'

        self.assertEqual(result, expected)

    def test_attribute_string(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', 'STRING')
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name STRING'

        self.assertEqual(result, expected)

    def test_attribute_nominal(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', ['a', 'b', 'c'])
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name {a, b, c}'

        self.assertEqual(result, expected)

    def test_attribute_nominal_spaced(self):
        encoder = self.get_encoder()

        fixture = ('attribute-name', ['with space', 'b', 'c'])
        result = encoder._encode_attribute(*fixture)
        expected = '@ATTRIBUTE attribute-name {\'with space\', b, c}'

        self.assertEqual(result, expected)


text:
using Abp.TestBase;

namespace Verno.Reports.Core.Tests
{
    public abstract class ReportsCoreTestBase : AbpIntegratedTestBase<ReportsCoreTestModule>
    {

    }
}


text:
namespace ui {

// Whether a force-click event on the touchpad should invoke Quick Look.
UI_BASE_EXPORT bool ForceClickInvokesQuickLook();

// Returns true if both CGFloat values are equal.
UI_BASE_EXPORT bool IsCGFloatEqual(CGFloat a, CGFloat b);

}  // namespace ui

#endif  // UI_BASE_COCOA_APPKIT_UTILS_H


text:
import { createStore } from 'isomorphic-dispatcher';

export default createStore({ title: 'Todo List' });


text:
==================================
Tuners for the Dask-based Commands
==================================

Downsampling
------------
.. autofunction:: py_entitymatching.tuner.tuner_down_sample.tuner_down_sample

Overlap Blocker
---------------
.. autofunction:: py_entitymatching.tuner.tuner_overlap_blocker.tuner_overlap_blocker


text:
package Net::Braintree::CreditCard::Healthcare;
use strict;

use constant Yes => "Yes";
use constant No => "No";
use constant Unknown => "Unknown";

1;


text:
module Yesod.Platform
    ( module Yesod
    ) where

import Yesod


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Verkley, Mel'nik, Shin & Crous, Sydowia 57(2): 260 (2005)

#### Original name
Camarographium koreanum Verkley, Melnik & Crous

### Remarks
null


text:
class CreateWelcomes < ActiveRecord::Migration
  def change
    create_table :welcomes do |t|
      t.string :index

      t.timestamps
    end
  end
end


text:
Shortener
=========

A small wrapper around the [bit.ly](http://bit.ly/) JSONP API. The paradigmatic
use case for URI shorteners these days is creating short URIs for posting to
Twitter, so the Shortener wrapper focuses on shortening URIs rather than any of
the other functionality that the bit.ly API provides.

Add the following to your Helium setup for deployment:

    /**
     * Loads the bit.ly API. Requires `Helium.BITLY_API_LOGIN`
     * and `Helium.BITLY_API_KEY` to be set beforehand.
     **/
    loader(function(cb) {
        var url = 'http://bit.ly/javascript-api.js' +
                  '?version=latest' +
                  '&login='  + Helium.BITLY_API_LOGIN +
                  '&apiKey=' + Helium.BITLY_API_KEY;
        load(url, cb);
    })  .provides('BitlyApiClient', 'BitlyClient', 'BitlyCB');

Usage
-----

The bit.ly JavaScript API file must be included _before_ the Shortener library
file. Here's the URI, together with an example query string. More details can
be found in the [bit.ly JavaScript Client API][1].

    <script type="text/javascript" src="http://bit.ly/javascript-api.js?version=latest&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07"></script>

A full example implementation can be found in the test directory.

Hitting the bit.ly servers with a request on every page load is obviously not
ideal, so any implementation should defer that request until the user interacts
with whatever functionality is using the URI shortener.

If no URI is provided to the Shortener.shorten method, it will default to the
current page URI, i.e. `window.location.href`.

    Shortener.shorten(function(result) {
        // No URI, just a callback function
    });

    Shortener.shorten('http://twitter.com/home', function(result) {
        // Using the URI provided as an argument
    });

The first argument to the provided callback function will be a result object
with the following form:

    {
        "hash":            "GqA2Q",
        "shortKeywordUrl": "",
        "shortUrl":        "http://bit.ly/3RGYGa",
        "userHash":        "3RGYGa"
    }

However, an API call can also result in an error object being returned. This
may be due to, for example, too many API calls being made in a short period of
time. The error object will be of the following form:

    {
        "errorCode":    208,
        "errorMessage": "You have exceeded your hourly rate limit for this method.",
        "statusCode":   "ERROR"
    }

The result object is provided for convenience's sake, as it will tend to be of
the most direct interest. The full result object from the server is provided as
a second argument.

    Shortener.shorten(function(result, data) {
        // The `data` object is the full response from the bit.ly API
    });

[1]: http://code.google.com/p/bitly-api/wiki/JavascriptClientApiDocumentation


text:
#ifndef JSON_CONFIGURATION_BUILDER_H
#define JSON_CONFIGURATION_BUILDER_H

#include <memory>
#include <istream>
#include <string>
#include "ConfigurationBuilder.h"

namespace adef {

/**
@brief JsonConfigurationBuilder creates the configuration data
in JSON format.
*/
class JsonConfigurationBuilder : public ConfigurationBuilder
{
public:

/**
@brief Clone the current class.
@sa clone_impl()
*/
    std::shared_ptr<JsonConfigurationBuilder> clone() const
    {
        return std::dynamic_pointer_cast<JsonConfigurationBuilder>(clone_impl());
    }

    bool load_config(
         std::istream& is,
         std::shared_ptr<ConfigurationData> config_data) const override;

/*
    inspection
*/

    bool is_object(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_array(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_null(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_boolean(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_string(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_number(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_number_integer(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    bool is_number_floating_point(
        std::shared_ptr<const ConfigurationData> config_data) const override;

/*
    Object
*/
    std::shared_ptr<ConfigurationData> get_config_data(
        const std::string& member_name,
        std::shared_ptr<const ConfigurationData> config_data) const override;

/*
    array
*/
    unsigned int get_array_size(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    std::shared_ptr<ConfigurationData> get_config_data(
        unsigned int index,
        std::shared_ptr<const ConfigurationData> config_data) const override;

/*
    value
*/
    bool get_bool_value(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    std::string get_string_value(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    int get_int_value(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    unsigned int get_uint_value(
        std::shared_ptr<const ConfigurationData> config_data) const override;
    double get_double_value(
        std::shared_ptr<const ConfigurationData> config_data) const override;

private:

    std::shared_ptr<ConfigurationBuilder> clone_impl() const override
    {
        return std::make_shared<JsonConfigurationBuilder>(*this);
    }
};

}

#endif // JSON_CONFIGURATION_BUILDER_H


text:
function param = em_std(x, K, init)

str_start.mu = init.mu;
str_start.Sigma = init.C;
str_start.PComponents = init.pp;

res_obj = gmdistribution.fit(x, K, 'Start', str_start);

param.pp = res_obj.PComponents;
param.mu = res_obj.mu;
param.C = res_obj.Sigma;


text:
import os
import unittest
import cbs

class TestEnv(unittest.TestCase):

    def setUp(self):
        os.environ.clear()
        cbs.DEFAULT_ENV_PREFIX = ''

    def test_retrieve_from_method(self):
        class Settings:
            @cbs.env
            def SETTING(self):
                return 'bar'

        self.assertEqual(Settings().SETTING, 'bar')

    def test_retrieve_from_env(self):
        class Settings:
            @cbs.env
            def SETTING(self):
                return 'bar'

        os.environ['SETTING'] = 'foo'
        self.assertEqual(Settings().SETTING, 'foo')

    def test_retrieve_from_env_specifying_key(self):
        class Settings:
            @cbs.env(key='DJANGO_SETTING')
            def SETTING(self):
                return 'bar'

        os.environ['DJANGO_SETTING'] = 'foo'
        self.assertEqual(Settings().SETTING, 'foo')

    def test_retrieve_from_env_specifying_prefix(self):
        class Settings:
            @cbs.env(prefix='DJANGO_')
            def SETTING(self):
                return 'bar'

        os.environ['DJANGO_SETTING'] = 'foo'
        self.assertEqual(Settings().SETTING, 'foo')

    def test_default_env_prefix(self):
        cbs.DEFAULT_ENV_PREFIX = 'DJANGO_'

        class Settings:
            @cbs.env
            def SETTING(self):
                return 'bar'

        os.environ['DJANGO_SETTING'] = 'foo'
        self.assertEqual(Settings().SETTING, 'foo')


text:
goog-gestures
=============

Simple demo here: [example1](http://benvanik.github.com/goog-gestures/examples/example1.html) (run on iOS or enable touch emulation in Chrome dev tools)

A simple Closure touch gesture library. This will hopefully be merged into the
Closure Library at some point, but is here to play with until I can get it good
enough to justify getting it included :)

The library is written in Closurized javascript and is easily usable from code
that is using the Closure Library and Closure Compiler. It's also provided as
a standalone JS file for use in any environment (naked DOM/jQuery/whatever).
The code using the library is identical in both cases.

Using the library is fairly simple: attach one or more gestures to a DOM element
and respond to their state changes. Gesture recognizers are created and attached
with the `goog.events.gestures.attach*Gesture()` methods. The passed callback
(with an optional scope) will be called each time the gesture changes state.
Once you are done with an element, be sure to call `goog.events.gestures.unattachAllGestures()`
to clean up event handlers.

Gestures are either discrete (like tap), or continuous (like pinch), and by
default cannot recognize together without using `goog.events.gestures.allowSimultaneousRecognition()`.
The `attach*Gesture()` methods return the gesture objects to be passed to
such routines, as well as to change their parameters before recognition begins.
For example, tap gestures can have the number of taps required to recognize
changed with `setTapCount()`.

## Recognizers

All recognizers have the following properties:

* `getTarget()`: target DOM element
* `isEnabled()`/`setEnabled(value)`: whether or not the gesture is allowed to recognize
* `getState()`: current recognizer state, one of `goog.events.gestures.State`
    * `POSSIBLE`: the recognizer could recognize, but hasn't yet
    * `BEGAN`: (continuous only) gesture has started recognizing
    * `CHANGED`: (continuous only) gesture has changed and there are new values
    * `ENDED`: (continuous only) gesture has ended recognizing
    * `RECOGNIZED`: (discrete only) gesture recognized
    * `FAILED`: gesture failed to recognize (too many fingers/etc)
    * `CANCELLED`: gesture was cancelled (browser stole touches)
* `getOffsetX|Y()`, `getClientX|Y()`, `getPageX|Y()`: gesture location (centroid of touches/etc)

### Tap (attachTapGesture)

`gesture = goog.events.gestures.attachTapGesture(element, callback, opt_scope)`

Properties:

* `setMovementThreshold(px)`: the maximum distance a touch can move before the gesture fails
* `setTapCount(n)`: number of taps required to recognize
* `setTouchCount(n)`: number of touches required to recognize

### Swipe (attachSwipeGesture)

`gesture = goog.events.gestures.attachSwipeGesture(element, callback, opt_scope)`

Properties:

* `setMovementThreshold(px)`: the minimum distance a touch must move before the gesture recognizes
* `setTouchCount(n)`: number of touches required to recognize
* `getDirection()`: the direction the swipe moved, from `goog.events.gestures.Direction`
    * `LEFT`/`RIGHT`/`UP`/`DOWN`

### Pan (attachPanGesture)

`gesture = goog.events.gestures.attachPanGesture(element, callback, opt_scope)`

Properties:

* `setMovementThreshold(px)`: the minimum distance a touch must move before the gesture recognizes
* `setMinimumTouchCount(n)`: minimum number of touches required to recognize
* `setMaximumTouchCount(n)`: maximum number of touches required to recognize
* `getTranslationX|Y()`: total translation in px since the gesture began recognizing
* `getTranslationDeltaX|Y()`: translation in px since the last CHANGED state callback

### Pinch (attachPinchGesture)

`gesture = goog.events.gestures.attachPinchGesture(element, callback, opt_scope)`

Properties:

* `setMovementThreshold(px)`: the minimum distance a touch must move before the gesture recognizes
* `setMinimumTouchCount(n)`: minimum number of touches required to recognize
* `setMaximumTouchCount(n)`: maximum number of touches required to recognize
* `getScaling()`: total scaling factor (starting at 1) since the gesture began recognizing
* `getScalingDelta()`: scaling factor change since the last CHANGED state callback

### Rotate (attachRotateGesture)

`gesture = goog.events.gestures.attachRotateGesture(element, callback, opt_scope)`

Properties:

* `setMovementThreshold(px)`: the minimum distance a touch must move before the gesture recognizes
* `getRotation()`: total rotation in radians since the gesture began recognizing
* `getRotationDelta()`: rotation change in radians since the last CHANGED state callback

## Examples

### Taps

```javascript
// Attach a simple tap gesture to a box
var boxElement = document.getElementById('box');
goog.events.gestures.attachTapGesture(boxElement, function(gesture) {
  // Check to see if the gesture was recognized
  if (gesture.getState() == goog.events.gestures.State.RECOGNIZED) {
    alert('tapped!');
  }
});

// Sometime later...
// If you remove the a DOM element with gestures attached, cleanup:
goog.events.gestures.unattachAllGestures(boxElement);
```

### Tap/swipe

```javascript
var boxElement = document.getElementById('box');
goog.events.gestures.attachTapGesture(boxElement, function(gesture) {
  // Check to see if the gesture was recognized
  if (gesture.getState() == goog.events.gestures.State.RECOGNIZED) {
    alert('tapped!');
  }
});
goog.events.gestures.attachSwipeGesture(boxElement, function(gesture) {
  // Check to see if the gesture was recognized
  if (gesture.getState() == goog.events.gestures.State.RECOGNIZED) {
    if (gesture.getDirection() == goog.events.gestures.Direction.RIGHT) {
      alert('swiped right!');
    }
  }
});
```

### Complex Movable Box

A more complex example showing a robust translate/scale/rotate box. Touch events are ignored (the page can
scroll/etc) unless two fingers are down, in which case it should behave well even with many fingers at play.
Single taps are also recognized on the box, showing a discrete gesture mixed in with all of the continuous ones.

```javascript
// Support for display
var boxElement = document.getElementById('box');
var tx = 0, ty = 0;
var scale = 1;
var angle = 0;
function updateTransform() {
  boxElement.style.webkitTransform =
      'translateZ(0) ' +
      'translate(' + tx + 'px,' + ty + 'px) ' +
      'scale(' + scale + ') ' +
      'rotate(' + angle + 'rad)';
};

goog.events.gestures.attachTapGesture(boxElement, function(gesture) {
  if (gesture.getState() == goog.events.gestures.State.RECOGNIZED) {
    alert('tapped!');
  }
});

var panGesture = goog.events.gestures.attachPanGesture(boxElement, function(gesture) {
  switch (gesture.getState()) {
    case goog.events.gestures.State.CHANGED:
      // It's often better to use getTranslationX|Y() and a start
      // offset to prevent some precision errors
      tx += gesture.getTranslationDeltaX();
      ty += gesture.getTranslationDeltaY();
      updateTransform();
      break;
  }
});
// Require two touches to pan
panGesture.setMinimumTouchCount(2);

var pinchGesture = goog.events.gestures.attachPinchGesture(boxElement, function(gesture) {
  switch (gesture.getState()) {
    case goog.events.gestures.State.CHANGED:
      scale *= gesture.getScalingDelta();
      updateTransform();
      break;
  }
});

var rotateGesture = goog.events.gestures.attachRotateGesture(boxElement, function(gesture) {
  switch (gesture.getState()) {
    case goog.events.gestures.State.CHANGED:
      angle += gesture.getRotationDelta();
      updateTransform();
      break;
  }
});

// Allow all gestures to recognize at the same time
goog.events.gestures.allowSimultaneousRecognition(panGesture, pinchGesture, rotateGesture);
```

## Setup

Wanna play around?

```
# ensure you have python and easy_install!
# clone the repo
git clone https://github.com/benvanik/goog-gestures.git
cd goog-gestures/
# run the setup script to initialize the repo and dependencies
sudo ./tools/setup.sh
# start a local webserver on :8080
anvil serve
# build debug, open http://localhost:8080/examples/example1.html?uncompiled
anvil build :debug
# build release, open http://localhost:8080/examples/example1.html
anvil build :release
# deploy a release build
anvil deploy -o /tmp/goog-gestures-release/ :release
```

## Contributing

Have a fix or feature? Submit a pull request - I love them!
Note that I do keep to the [style_guide](https://github.com/benvanik/games-framework/blob/master/docs/style_guide.md),
so please check it out first!

As this is a Google project, you *must* first e-sign the
[Google Contributor License Agreement](http://code.google.com/legal/individual-cla-v1.0.html) before I can accept any
code. It takes only a second and basically just says you won't sue us or claim copyright of your submitted code.

## License

All code except dependencies under third_party/ is licensed under the permissive Apache 2.0 license.
Feel free to fork/rip/etc and use as you wish!

## Credits

Code by [Ben Vanik](http://noxa.org). See [AUTHORS](https://github.com/benvanik/goog-gestures/blob/master/AUTHORS) for additional contributors.


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.security.keyvault.keys.implementation.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * A condition to be satisfied for an action to be executed.
 */
@Fluent
public final class LifetimeActionTrigger {
    @JsonProperty(value = "timeAfterCreate")
    private String timeAfterCreate;

    @JsonProperty(value = "timeBeforeExpiry")
    private String timeBeforeExpiry;

    /**
     * Get the time after creation to attempt to rotate in ISO 8601 duration format. For example, 90 days would be
     * "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See
     * Wikipedia for more information on ISO 8601 durations.
     *
     * @return The time after creation to attempt to rotate in ISO duration format.
     */
    public String getTimeAfterCreate() {
        return this.timeAfterCreate;
    }

    /**
     * Set the time after creation to attempt to rotate in ISO 8601 duration format. For example, 90 days would be
     * "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See
     * Wikipedia for more information on ISO 8601 durations..
     *
     * @param timeAfterCreate The time after creation to attempt to rotate in ISO duration format.
     *
     * @return The updated {@link LifetimeActionTrigger} object.
     */
    public LifetimeActionTrigger setTimeAfterCreate(String timeAfterCreate) {
        this.timeAfterCreate = timeAfterCreate;

        return this;
    }

    /**
     * Get the time before expiry to attempt to rotate or notify in ISO 8601 duration format. For example, 90 days would
     * be "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See
     * Wikipedia for more information on ISO 8601 durations.
     *
     * @return The time before expiry to attempt to rotate or notify in ISO duration format.
     */
    public String getTimeBeforeExpiry() {
        return this.timeBeforeExpiry;
    }

    /**
     * Set the time before expiry to attempt to rotate or notify in ISO 8601 duration format. For example, 90 days would
     * "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See
     * Wikipedia for more information on ISO 8601 durations.
     *
     * @param timeBeforeExpiry The time before expiry to attempt to rotate or notify in ISO duration format.
     *
     * @return The updated {@link LifetimeActionTrigger} object.
     */
    public LifetimeActionTrigger setTimeBeforeExpiry(String timeBeforeExpiry) {
        this.timeBeforeExpiry = timeBeforeExpiry;

        return this;
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import SocialConnect from '../SocialConnect';
import Spacer from '../Spacer';
import Typography from '../Typography';
import Wrapper from '../Wrapper';
import styles from './styles.css';

function SocialConnectComposit2(props) {
  return (
    <div
      className={classNames(styles.wrapper, {
        [props.className]: props.className
      })}
      >
      <Wrapper
        className={styles.importSocialWrapper}
        size="short"
        >
        <Typography
          className={styles.importContactsText}
          type="caption2Normal"
          >
          Importer dine kontakter for å finne personer å følge på Ducky. Vi lagrer ikke din data, og poster aldri noe uten din tilatelse.
        </Typography>
      </Wrapper>
      <Wrapper
        className={styles.socialWrapper}
        size="side-bottom"
        >
        <SocialConnect
          className={styles.socialbtn}
          connected={props.connectedFacebook}
          onClick={props.onClick}
          socialMedia={'facebook'}
          />
        <SocialConnect
          className={styles.socialbtn}
          connected={props.connectedGoogle}
          onClick={props.onClick}
          socialMedia={'google+'}
          />
        <SocialConnect
          className={styles.socialbtn}
          connected={props.connectedTwitter}
          onClick={props.onClick}
          socialMedia={'twitter'}
          />
      </Wrapper>
      <Spacer
        className={styles.socialSpacer}
        size="double"
        />
    </div>
  );
}

SocialConnectComposit2.propTypes = {
  className: PropTypes.string,
  connectedFacebook: PropTypes.bool,
  connectedGoogle: PropTypes.bool,
  connectedTwitter: PropTypes.bool,
  onClick: PropTypes.func,
  social: PropTypes.oneOf(['facebook', 'twitter', 'google+']),
  social2: PropTypes.oneOf(['facebook', 'twitter', 'google+']),
  social3: PropTypes.oneOf(['facebook', 'twitter', 'google+'])
};

export default SocialConnectComposit2;


text:
package com.intel.analytics.zoo.pipeline.api.keras.layers

import com.intel.analytics.bigdl.nn.{SoftShrink => BSoftShrink}
import com.intel.analytics.zoo.pipeline.api.keras.layers.{SoftShrink => ZSoftShrink}
import com.intel.analytics.bigdl.tensor.Tensor
import com.intel.analytics.bigdl.utils.Shape
import com.intel.analytics.zoo.pipeline.api.keras.ZooSpecHelper
import com.intel.analytics.zoo.pipeline.api.keras.serializer.ModuleSerializationTest

class SoftShrinkSpec extends ZooSpecHelper {

  "SoftShrink 3D Zoo" should "be the same as BigDL" in {
    val blayer = BSoftShrink[Float]()
    val zlayer = ZSoftShrink[Float](inputShape = Shape(3, 4))
    zlayer.build(Shape(-1, 3, 4))
    zlayer.getOutputShape().toSingle().toArray should be (Array(-1, 3, 4))
    val input = Tensor[Float](Array(2, 3, 4)).rand()
    compareOutputAndGradInput(blayer, zlayer, input)
  }

  "SoftShrink 4D Zoo" should "be the same as BigDL" in {
    val blayer = BSoftShrink[Float](0.8)
    val zlayer = ZSoftShrink[Float](0.8, inputShape = Shape(4, 8, 8))
    zlayer.build(Shape(-1, 4, 8, 8))
    zlayer.getOutputShape().toSingle().toArray should be (Array(-1, 4, 8, 8))
    val input = Tensor[Float](Array(3, 4, 8, 8)).rand()
    compareOutputAndGradInput(blayer, zlayer, input)
  }

}

class SoftShrinkSerialTest extends ModuleSerializationTest {
  override def test(): Unit = {
    val layer = SoftShrink[Float](inputShape = Shape(6, 8))
    layer.build(Shape(2, 6, 8))
    val input = Tensor[Float](2, 6, 8).rand()
    runSerializationTest(layer, input)
  }
}