text:
class PingsController < ApplicationController
  def show
    whoami = {
      'visitor' =>  "#{visitor.first_name} #{visitor.name}",
      'site' => current_site.name,
      'format' => request.format.to_s
      }
    whoami_xml = Builder::XmlMarkup.new.ping do |p|
      p.visitor(whoami['visitor'])
      p.site(whoami['site'])
      p.format(whoami['format'])
    end
    respond_to do |wants|
      wants.html { render :text => whoami.inspect  }
      wants.xml { render :xml => whoami_xml }
    end
  end

end


text:
These are my recipes for [AutoPkg](https://github.com/autopkg/autopkg).

# Installation

Just run:

    $ autopkg repo-add https://github.com/autopkg/hjuutilainen-recipes.git

Which of course requires that you have [AutoPkg installed](https://github.com/autopkg/autopkg/wiki/Getting-Started).

# Updating your configuration

These recipes were previously in [https://github.com/hjuutilainen/autopkg-recipes](https://github.com/hjuutilainen/autopkg-recipes). These commands will delete the old repo from your configuration and add a new repo with the updated URL:

    $ autopkg repo-delete https://github.com/hjuutilainen/autopkg-recipes.git
    $ autopkg repo-add https://github.com/autopkg/hjuutilainen-recipes.git

redpajama_set_name: RedPajamaGithub


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

namespace DequeNet
{
    /// <summary>
    /// Represents a double-ended queue, also known as deque (pronounced "deck").
    /// Items can be appended to/removed from both ends of the deque.
    /// </summary>
    /// <typeparam name="T">Specifies the type of the elements in the deque.</typeparam>
    public interface IDeque<T> : ICollection<T>, ICollection
    {
        /// <summary>
        /// Gets the number of elements contained in the <see cref="IDeque{T}"/>.
        /// </summary>
        new int Count { get; }

        /// <summary>
        /// Gets a value that indicates whether the <see cref="IDeque{T}"/> is empty.
        /// </summary>
        bool IsEmpty { get; }

        /// <summary>
        /// Adds an item to the right end of the <see cref="IDeque{T}"/>.
        /// </summary>
        /// <param name="item">The item to be added to the <see cref="IDeque{T}"/>.</param>
        void PushRight(T item);

        /// <summary>
        /// Adds an item to the left end of the <see cref="IDeque{T}"/>.
        /// </summary>
        /// <param name="item">The item to be added to the <see cref="IDeque{T}"/>.</param>
        void PushLeft(T item);

        /// <summary>
        /// Attempts to remove and return an item from the right end of the <see cref="IDeque{T}"/>.
        /// </summary>
        /// <returns>The rightmost item.</returns>
        /// <exception cref="InvalidOperationException">The deque is empty.</exception>
        T PopRight();

        /// <summary>
        /// Attempts to remove and return an item from the left end of the <see cref="IDeque{T}"/>.
        /// </summary>
        /// <returns>The leftmost item.</returns>
        /// <exception cref="InvalidOperationException">The deque is empty.</exception>
        T PopLeft();

        /// <summary>
        /// Attempts to return the rightmost item of the <see cref="IDeque{T}"/>
        /// without removing it.
        /// </summary>
        /// <returns>The rightmost item.</returns>
        /// <exception cref="InvalidOperationException">The deque is empty.</exception>
        T PeekRight();

        /// <summary>
        /// Attempts to return the leftmost item of the <see cref="IDeque{T}"/>
        /// without removing it.
        /// </summary>
        /// <returns>The leftmost item.</returns>
        /// <exception cref="InvalidOperationException">The deque is empty.</exception>
        T PeekLeft();

        /// <summary>
        /// Gets or sets the item at the specified index.
        /// </summary>
        /// <param name="index">The zero-based index of the element to get or set.</param>
        /// <returns>The element at the specified index.</returns>
        /// <exception cref="ArgumentOutOfRangeException">Index was out of range. Must be non-negative and less than <see cref="ICollection{T}.Count"/>.</exception>
        T this[int index] { get; set; }
    }
}


text:
**Photometric redshift via Gaussian processes with physical kernels.**

Read the documentation here: [http://delight.readthedocs.io](http://delight.readthedocs.io)

*Warning: this code is still in active development and is not quite ready to be blindly applied to arbitrary photometric galaxy surveys. But this day will come.*

[![alt tag](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/ixkael/Delight/blob/master/LICENSE)
[![alt tag](https://travis-ci.org/ixkael/Delight.svg?branch=master)](https://travis-ci.org/ixkael/Delight)
[![Documentation Status](https://readthedocs.org/projects/delight/badge/?version=latest&style=flat)](http://delight.readthedocs.io/en/latest/?badge=latest)
[![Latest PDF](https://img.shields.io/badge/PDF-latest-orange.svg)](https://github.com/ixkael/Delight/blob/master/paper/PhotoZviaGP_paper.pdf)
[![Coverage Status](https://coveralls.io/repos/github/ixkael/Delight/badge.svg?branch=master)](https://coveralls.io/github/ixkael/Delight?branch=master)

**Tests**: pytest for unit tests, PEP8 for code style, coveralls for test coverage.

## Content

**./paper/**: journal paper describing the method </br>
**./delight/**: main code (Python/Cython) </br>
**./tests/**: test suite for the main code </br>
**./notebooks/**: demo notebooks using delight </br>
**./data/**: some useful inputs for tests/demos </br>
**./docs/**: documentation </br>
**./other/**: useful mathematica notebooks, etc </br>

## Requirements

Python 3.5, cython, numpy, scipy, pytest, pylint, coveralls, matplotlib, astropy, mpi4py </br>

## Authors

Boris Leistedt (NYU) </br>
David W. Hogg (NYU) (Flatiron)

Please cite [Leistedt and Hogg (2016)]
(https://arxiv.org/abs/1612.00847) if you use this code your
research. The BibTeX entry is:

    @article{delight,
        author  = "Boris Leistedt and David W. Hogg",
        title   = "Data-driven, Interpretable Photometric Redshifts Trained on Heterogeneous and Unrepresentative Data",
        journal = "The Astrophysical Journal",
        volume  = "838",
        number  = "1",
        pages   = "5",
        url     = "http://stacks.iop.org/0004-637X/838/i=1/a=5",
        year    = "2017",
        eprint         = "1612.00847",
        archivePrefix  = "arXiv",
        primaryClass   = "astro-ph.CO",
        SLACcitation   = "%%CITATION = ARXIV:1612.00847;%%"
    }

## License

Copyright 2016-2017 the authors. The code in this repository is released under the open-source MIT License. See the file LICENSE for more details.


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main() {
  // [START dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The kind of filter to use.
   */
  // const filter = {}
  /**
   *  The project which owns the jobs.
   */
  // const projectId = 'abc123'
  /**
   *  If there are many jobs, limit response to at most this many.
   *  The actual number of jobs returned will be the lesser of max_responses
   *  and an unspecified server-defined limit.
   */
  // const pageSize = 1234
  /**
   *  Set this to the 'next_page_token' field of a previous response
   *  to request additional results in a long list.
   */
  // const pageToken = 'abc123'
  /**
   *  The regional endpoint
   *  (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
   *  contains this job.
   */
  // const location = 'abc123'

  // Imports the Dataflow library
  const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3;

  // Instantiates a client
  const dataflowClient = new JobsV1Beta3Client();

  async function callAggregatedListJobs() {
    // Construct request
    const request = {
    };

    // Run request
    const iterable = await dataflowClient.aggregatedListJobsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callAggregatedListJobs();
  // [END dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
<!DOCTYPE html>

<title>NFCPeerDetectCallback_ondetach</title>


text:
$(document).ready(function () {

    //add new engines here when releasing a new version
    var versionCxs = {
        "xap97":"005646302152591029507:p5g7vbsasb8",
        "xap97net":"005646302152591029507:_7aj0mx_vzi",
        "sbp":"005646302152591029507:qjv3z0hsori"
    }
    var cxEntireSite = "005646302152591029507:5jyranabgec";

    var config = {
        apiURL:'https://www.googleapis.com/customsearch/v1',
        apiKey:'AIzaSyCR79snpFgr45ear_SBoqkjQaGa7FHYg4I',
        cx: function() {
            href = window.location.href;
            var re = /http:\/\/.*\/(.*)\/.*/;
            var regexArray = re.exec(href);
            if (regexArray && regexArray.length > 1) {
                return versionCxs[regexArray[1]] || cxEntireSite;
            }
            return cxEntireSite;
        }(),
        perPage:10, // A maximum of 10 is allowed by Google
        page:0, // The start page
        pageTitle:"Search Results"
    }

    $('#go-search').click(function () {
        googleSearch();
        return false;
    });

    function displaySearch(settings, data) {
        var resultsDiv = $('#content');
        var results = data.items;
        if (results) {
            //handle back / forward event
            //currentContent = resultsDiv.html();
            resultsDiv.text('');
            var paginationButtons = "
" +
                                    "
← Previous
" +
                                    "
Next →

"
            resultsDiv.append("
Search Results
");
            resultsDiv.append(paginationButtons);

            // If results were returned, add them to a content div
            resultsDiv.append("
");
            var ul = $("#results-ul");
            for (var i = 0; i < results.length; i++) {
                ul.append(new result(results[i]) + '');
            }

            ul.hide().appendTo(resultsDiv).fadeIn('slow');
            resultsDiv.append(paginationButtons);

            if (settings.page > 0) {
                $("[rel='prev']").attr("class", "previous enabled");
                $("[rel='prev']").click(function () {
                    googleSearch({append:false, page:settings.page - 1});
                });
            } else {
                $("[rel='prev']").attr("class", "previous disabled");
                $("[rel='prev']").bind('click', false);
            }

            if (data.queries.request[0].totalResults > (settings.page + 1) * settings.perPage) {
                $("[rel='next']").attr("class", "next enabled");
                $("[rel='next']").click(function () {
                    googleSearch({append:false, page:settings.page + 1});
                });
            } else {
                $("[rel='next']").attr("class", "next disabled");
                $("[rel='next']").bind('click', false);
            }
        }
        else {
            // No results were found for this search.
            resultsDiv.empty();
            $('
', {html:"

Oops, we couldn't find what you were looking for. Try rephrasing your search

"}).hide().appendTo(resultsDiv).fadeIn();
        }
    }

    function googleSearch(settings) {

        var query = $('#q').val() || "";
        if (query.trim() == "") return;

        // If no parameters are supplied to the function,
        // it takes its defaults from the config object above:
        settings = $.extend({}, config, settings);

        settings.term = query;

        //todo: tmp
        /*
        try {
            $.ajax({
                type:'GET',
                url:'/sampleData.json',
                success: function(data) {
                    displaySearch(settings, data);
                },
                error: function(e) {
                    console.log(e +"");
                }
            });
        }
        catch (e) {
            console.log(e + '');
        }
        */

        try {
            var pageNum = (settings.page * settings.perPage) + 1;
            $.ajax({
                type:'GET',
                url:settings.apiURL,
                dataType:'jsonp',
                data:{q:settings.term,
                    key:settings.apiKey,
                    num:settings.perPage,
                    start:((settings.page * settings.perPage) + 1),
                    cx:settings.cx,
                    alt:'json'},
                success: function(data) {
                    displaySearch(settings, data);
                    /* //history handling, disabled for now
                    var origLocation = document.location;
                    history.pushState({"settings":settings, "data":data}, "Search results for " + settings.term,
                                      origLocation + "#search?q=" + settings.term + pageNum);

                    window.addEventListener("popstate", function(e) {
                        // URL location
                        var location = document.location;

                        // state
                        var state = e.state;

                        // return to last state
                        if (state != null && location.href.indexOf("#search?") != -1) {
                            displaySearch(state["settings"], state["data"]);
                        } else if (location.href == origLocation.href) {
                            $('#content').html(currentContent);
                        }

                    });
                    */
                },
                error: function(e) {
                    console.log(e +"");
                }
            });
        }
        catch (e) {
            console.log(e + '');
        }

    }

    function result(r) {

        // This is class definition. Object of this class are created for
        // each result. The markup is generated by the .toString() method.

        /* results format: s

Cloudify - Quick Start Guide

            The goal of this quick start guide is to familiarize you with Cloudify in a few simple   steps. For this purpose, we will use a Hello World application Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod (an example ...  Read More... »

        */
        this.re = /http:\/\/.*\/(.*)\/.*/;

        this.endsWith = function(str, suffix) {
            return str.indexOf(suffix, str.length - suffix.length) !== -1;
        }

        this.startsWith = function(str, prefix) {
            return str.indexOf(prefix) == 0;
        }

        this.getCategory = function(link) {
            var regexArray = this.re.exec(link);
            if (regexArray && regexArray.length > 1) {
                var path = regexArray[1];
                if (this.endsWith(path,"net")) return "[XAP.NET] ";
                else if (this.startsWith(path,"xap")) return "[XAP/Java] ";
                else if (path == "sbp") return "[Solution & Best Practices] ";
            }
            return "";
        }

        var arr = [
            '
',
            '
',this.getCategory(r.link),r.title,'
',
            '
',
            r.snippet,'  ',
            'Read More »',
            '
',
            '
'
        ];

        // The toString method.
        this.toString = function () {
            return arr.join('');
        }

    }

});


text:
@implementation BRRequestError

@synthesize errorCode;

//-----
//
//				errorCodeWithError
//
// synopsis:	retval = [BRRequestError errorCodeWithError:error];
//					BRErrorCodes retval	-
//					NSError *error     	-
//
// description:	errorCodeWithError is designed to
//
// errors:		none
//
// returns:		Variable of type BRErrorCodes
//

+(BRErrorCodes) errorCodeWithError: (NSError *) error
{
    //----- As suggested by RMaddy
    NSDictionary *userInfo = error.userInfo;
    NSNumber *code = [userInfo objectForKey:(id)kCFFTPStatusCodeKey];

    if (code)
    {
        return [code intValue];
    }

    return 0;
}

//-----
//
//				message
//
// synopsis:	retval = [self message];
//					NSString *retval	-
//
// description:	message is designed to
//
// errors:		none
//
// returns:		Variable of type NSString *
//

- (NSString *)message
{
    NSString * errorMessage;
    switch (self.errorCode)
    {
        //----- Client errors
        case kBRFTPClientSentDataIsNil:
            errorMessage = @"Data is nil.";
            break;

        case kBRFTPClientCantOpenStream:
            errorMessage = @"Unable to open stream.";
            break;

        case kBRFTPClientCantWriteStream:
            errorMessage = @"Unable to write to open stream.";
            break;

        case kBRFTPClientCantReadStream:
            errorMessage = @"Unable to read from open stream.";
            break;

        case kBRFTPClientHostnameIsNil:
            errorMessage = @"Hostname is nil.";
            break;

        case kBRFTPClientFileAlreadyExists:
            errorMessage = @"File already exists!";
            break;

        case kBRFTPClientCantOverwriteDirectory:
            errorMessage = @"Can't overwrite directory!";
            break;

        case kBRFTPClientStreamTimedOut:
            errorMessage = @"Stream timed out with no response from server.";
            break;

        case kBRFTPClientCantDeleteFileOrDirectory:
            errorMessage = @"Can't delete file or directory.";
            break;

        case kBRFTPClientMissingRequestDataAvailable:
            errorMessage = @"Delegate missing requestDataAvailable:";
            break;

        //----- Server errors
        case kBRFTPServerAbortedTransfer:
            errorMessage = @"Server aborted transfer.";
            break;

        case kBRFTPServerResourceBusy:
            errorMessage = @"Resource is busy.";
            break;

        case kBRFTPServerCantOpenDataConnection:
            errorMessage = @"Server can't open data connection.";
            break;

        case kBRFTPServerUserNotLoggedIn:
            errorMessage = @"Not logged in.";
            break;

        case kBRFTPServerStorageAllocationExceeded:
            errorMessage = @"Server allocation exceeded!";
            break;

        case kBRFTPServerIllegalFileName:
            errorMessage = @"Illegal file name.";
            break;

        case kBRFTPServerFileNotAvailable:
            errorMessage = @"File or directory not available or directory already exists.";
            break;

        case kBRFTPServerUnknownError:
            errorMessage = @"Unknown FTP error!";
            break;

        default:
            errorMessage = @"Unknown error!";
            break;
    }

    return errorMessage;
}

@end


text:
std::vector<WordID> Characterize(const std::vector<WordID>& reference);
std::vector<std::vector<WordID> > Characterize(const std::vector<std::vector<WordID> >& references);

class SufficientStats {
 public:
  SufficientStats() : id_() {}
  explicit SufficientStats(const std::string& encoded);
  SufficientStats(const std::string& mid, const std::vector<float>& f) :
    id_(mid), fields(f) {}

  SufficientStats& operator+=(const SufficientStats& delta) {
    if (id_.empty() && delta.id_.size()) id_ = delta.id_;
    if (fields.size() != delta.fields.size())
      fields.resize(std::max(fields.size(), delta.fields.size()));
    for (unsigned i = 0; i < delta.fields.size(); ++i)
      fields[i] += delta.fields[i];
    return *this;
  }
  SufficientStats& operator-=(const SufficientStats& delta) {
    if (id_.empty() && delta.id_.size()) id_ = delta.id_;
    if (fields.size() != delta.fields.size())
      fields.resize(std::max(fields.size(), delta.fields.size()));
    for (unsigned i = 0; i < delta.fields.size(); ++i)
      fields[i] -= delta.fields[i];
    return *this;
  }
  SufficientStats& operator*=(const double& scalar) {
    for (unsigned i = 0; i < fields.size(); ++i)
      fields[i] *= scalar;
    return *this;
  }
  SufficientStats& operator/=(const double& scalar) {
    for (unsigned i = 0; i < fields.size(); ++i)
      fields[i] /= scalar;
    return *this;
  }
  bool operator==(const SufficientStats& other) const {
    return other.fields == fields;
  }
  bool IsAdditiveIdentity() const {
    for (unsigned i = 0; i < fields.size(); ++i)
      if (fields[i]) return false;
    return true;
  }
  size_t size() const { return fields.size(); }
  float operator[](size_t i) const {
    if (i < fields.size()) return fields[i];
    return 0;
  }
  void Encode(std::string* out) const;

  void swap(SufficientStats& other) {
    id_.swap(other.id_);
    fields.swap(other.fields);
  }

  std::string id_;
  std::vector<float> fields;
};

inline const SufficientStats operator+(const SufficientStats& a, const SufficientStats& b) {
  SufficientStats res(a);
  return res += b;
}

inline const SufficientStats operator-(const SufficientStats& a, const SufficientStats& b) {
  SufficientStats res(a);
  return res -= b;
}

struct SegmentEvaluator {
  virtual ~SegmentEvaluator();
  virtual void Evaluate(const std::vector<WordID>& hyp, SufficientStats* out) const = 0;
  std::string src; // this may not always be available
};

// Instructions for implementing a new metric
//   To Instance(), add something that creates the metric
//   Implement ComputeScore(const SufficientStats& stats) const;
//   Implement ONE of the following:
//      1) void ComputeSufficientStatistics(const std::vector<std::vector<WordID> >& refs, SufficientStats* out) const;
//      2) a new SegmentEvaluator class AND CreateSegmentEvaluator(const std::vector<std::vector<WordID> >& refs) const;
//    [The later (#2) is only used when it is necessary to precompute per-segment data from a set of refs]
//   OPTIONAL: Override SufficientStatisticsVectorSize() if it is easy to do so
class EvaluationMetric {
 public:
  static EvaluationMetric* Instance(const std::string& metric_id = "IBM_BLEU");

 protected:
  EvaluationMetric(const std::string& id) : name_(id) {}
  virtual ~EvaluationMetric();

 public:
  const std::string& MetricId() const { return name_; }

  // returns true for metrics like WER and TER where lower scores are better
  // false for metrics like BLEU and METEOR where higher scores are better
  virtual bool IsErrorMetric() const;

  virtual unsigned SufficientStatisticsVectorSize() const;
  virtual float ComputeScore(const SufficientStats& stats) const = 0;
  virtual std::string DetailedScore(const SufficientStats& stats) const;
  virtual boost::shared_ptr<SegmentEvaluator> CreateSegmentEvaluator(const std::vector<std::vector<WordID> >& refs) const;
  virtual void ComputeSufficientStatistics(const std::vector<WordID>& hyp,
                                           const std::vector<std::vector<WordID> >& refs,
                                           SufficientStats* out) const;

 private:
  static std::map<std::string, EvaluationMetric*> instances_;
  const std::string name_;
};

#endif


text:
export const UPDATE_SCROLL_TOP = 'UPDATE_SCROLL_TOP';
export const FETCH_WORKS = 'FETCH_WORKS';


text:
var ReflectionScopeAbstract = require('../lib/ReflectionScopeAbstract');
var Reflection = require('../lib/Reflection');

describe('ReflectionScopeAbstract', function () {

  var reflectedScope;

  beforeEach(function () {
    reflectedScope = new ReflectionScopeAbstract({});
  });

  describe('Constructor', function () {

    it('should inherit from the Reflection prototype', function () {
      expect(reflectedScope instanceof Reflection).toBe(true);
    });

    it('should initialize the functions and variables properties', function () {
      expect(reflectedScope._functions).toBeNull();
      expect(reflectedScope._variables).toBeNull();
    });

  });

  describe('Methods', function () {

    it('should throw an error if the method _getBody is not overridden', function () {
      expect(reflectedScope._getBody).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "_getBody"');
    });

    it('should throw an error if the method getFunctionsByType is not overridden', function () {
      expect(reflectedScope.getFunctionsByType).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getFunctionsByType"');
    });

    it('should throw an error if the method getFunctionsByName is not overridden', function () {
      expect(reflectedScope.getFunctionsByName).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getFunctionsByName"');
    });

    it('should throw an error if the method getAnonymousFunctions is not overridden', function () {
      expect(reflectedScope.getAnonymousFunctions).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getAnonymousFunctions"');
    });

    it('should throw an error if the method getFunctionDeclarations is not overridden', function () {
      expect(reflectedScope.getFunctionDeclarations).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getFunctionDeclarations"');
    });

    it('should throw an error if the method getFunctionExpressions is not overridden', function () {
      expect(reflectedScope.getFunctionExpressions).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getFunctionExpressions"');
    });

    it('should throw an error if the method getVariables is not overridden', function () {
      expect(reflectedScope.getVariables).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getVariables"');
    });

    it('should throw an error if the method getStartLine is not overridden', function () {
      expect(reflectedScope.getStartLine).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getStartLine"');
    });

    it('should throw an error if the method getEndLine is not overridden', function () {
      expect(reflectedScope.getEndLine).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getEndLine"');
    });

    it('should throw an error if the method getStartColumn is not overridden', function () {
      expect(reflectedScope.getStartColumn).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getStartColumn"');
    });

    it('should throw an error if the method getEndColumn is not overridden', function () {
      expect(reflectedScope.getEndColumn).toThrowError('Implementing interface "ReflectionScopeAbstract" should override the method "getEndColumn"');
    });

  });
});


text:
module QA
  context 'Create' do
    describe 'Merge request rebasing' do
      it 'user rebases source branch of merge request'  do
        Runtime::Browser.visit(:gitlab, Page::Main::Login)
        Page::Main::Login.act { sign_in_using_credentials }

        project = Resource::Project.fabricate! do |project|
          project.name = "only-fast-forward"
        end
        project.visit!

        Page::Project::Menu.act { go_to_settings }
        Page::Project::Settings::MergeRequest.act { enable_ff_only }

        merge_request = Resource::MergeRequest.fabricate! do |merge_request|
          merge_request.project = project
          merge_request.title = 'Needs rebasing'
        end

        Resource::Repository::ProjectPush.fabricate! do |push|
          push.project = project
          push.file_name = "other.txt"
          push.file_content = "New file added!"
          push.branch_name = "master"
          push.new_branch = false
        end

        merge_request.visit!

        Page::MergeRequest::Show.perform do |merge_request|
          expect(merge_request).to have_content('Needs rebasing')
          expect(merge_request).not_to be_fast_forward_possible
          expect(merge_request).not_to have_merge_button

          merge_request.rebase!

          expect(merge_request).to have_merge_button
          expect(merge_request.fast_forward_possible?).to be_truthy
        end
      end
    end
  end
end


text:
package org.springframework.cloud.netflix.eureka;

import com.netflix.discovery.shared.transport.EurekaTransportConfig;

import java.util.Objects;

/**
 * @author Spencer Gibb
 * @author Gregor Zurowski
 */
public class CloudEurekaTransportConfig implements EurekaTransportConfig {

	private int sessionedClientReconnectIntervalSeconds = 20 * 60;

	private double retryableClientQuarantineRefreshPercentage = 0.66;

	private int bootstrapResolverRefreshIntervalSeconds = 5 * 60;

	private int applicationsResolverDataStalenessThresholdSeconds = 5 * 60;

	private int asyncResolverRefreshIntervalMs = 5 * 60 * 1000;

	private int asyncResolverWarmUpTimeoutMs = 5000;

	private int asyncExecutorThreadPoolSize = 5;

	private String readClusterVip;

	private String writeClusterVip;

	private boolean bootstrapResolverForQuery = true;

	private String bootstrapResolverStrategy;

	private boolean applicationsResolverUseIp = false;

	@Override
	public boolean useBootstrapResolverForQuery() {
		return this.bootstrapResolverForQuery;
	}

	@Override
	public boolean applicationsResolverUseIp() {
		return this.applicationsResolverUseIp;
	}

	public int getSessionedClientReconnectIntervalSeconds() {
		return sessionedClientReconnectIntervalSeconds;
	}

	public void setSessionedClientReconnectIntervalSeconds(
			int sessionedClientReconnectIntervalSeconds) {
		this.sessionedClientReconnectIntervalSeconds = sessionedClientReconnectIntervalSeconds;
	}

	public double getRetryableClientQuarantineRefreshPercentage() {
		return retryableClientQuarantineRefreshPercentage;
	}

	public void setRetryableClientQuarantineRefreshPercentage(
			double retryableClientQuarantineRefreshPercentage) {
		this.retryableClientQuarantineRefreshPercentage = retryableClientQuarantineRefreshPercentage;
	}

	public int getBootstrapResolverRefreshIntervalSeconds() {
		return bootstrapResolverRefreshIntervalSeconds;
	}

	public void setBootstrapResolverRefreshIntervalSeconds(
			int bootstrapResolverRefreshIntervalSeconds) {
		this.bootstrapResolverRefreshIntervalSeconds = bootstrapResolverRefreshIntervalSeconds;
	}

	public int getApplicationsResolverDataStalenessThresholdSeconds() {
		return applicationsResolverDataStalenessThresholdSeconds;
	}

	public void setApplicationsResolverDataStalenessThresholdSeconds(
			int applicationsResolverDataStalenessThresholdSeconds) {
		this.applicationsResolverDataStalenessThresholdSeconds = applicationsResolverDataStalenessThresholdSeconds;
	}

	public int getAsyncResolverRefreshIntervalMs() {
		return asyncResolverRefreshIntervalMs;
	}

	public void setAsyncResolverRefreshIntervalMs(int asyncResolverRefreshIntervalMs) {
		this.asyncResolverRefreshIntervalMs = asyncResolverRefreshIntervalMs;
	}

	public int getAsyncResolverWarmUpTimeoutMs() {
		return asyncResolverWarmUpTimeoutMs;
	}

	public void setAsyncResolverWarmUpTimeoutMs(int asyncResolverWarmUpTimeoutMs) {
		this.asyncResolverWarmUpTimeoutMs = asyncResolverWarmUpTimeoutMs;
	}

	public int getAsyncExecutorThreadPoolSize() {
		return asyncExecutorThreadPoolSize;
	}

	public void setAsyncExecutorThreadPoolSize(int asyncExecutorThreadPoolSize) {
		this.asyncExecutorThreadPoolSize = asyncExecutorThreadPoolSize;
	}

	public String getReadClusterVip() {
		return readClusterVip;
	}

	public void setReadClusterVip(String readClusterVip) {
		this.readClusterVip = readClusterVip;
	}

	public String getWriteClusterVip() {
		return writeClusterVip;
	}

	public void setWriteClusterVip(String writeClusterVip) {
		this.writeClusterVip = writeClusterVip;
	}

	public boolean isBootstrapResolverForQuery() {
		return bootstrapResolverForQuery;
	}

	public void setBootstrapResolverForQuery(boolean bootstrapResolverForQuery) {
		this.bootstrapResolverForQuery = bootstrapResolverForQuery;
	}

	public String getBootstrapResolverStrategy() {
		return bootstrapResolverStrategy;
	}

	public void setBootstrapResolverStrategy(String bootstrapResolverStrategy) {
		this.bootstrapResolverStrategy = bootstrapResolverStrategy;
	}

	public boolean isApplicationsResolverUseIp() {
		return applicationsResolverUseIp;
	}

	public void setApplicationsResolverUseIp(boolean applicationsResolverUseIp) {
		this.applicationsResolverUseIp = applicationsResolverUseIp;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		CloudEurekaTransportConfig that = (CloudEurekaTransportConfig) o;
		return sessionedClientReconnectIntervalSeconds == that.sessionedClientReconnectIntervalSeconds &&
				Double.compare(retryableClientQuarantineRefreshPercentage, that.retryableClientQuarantineRefreshPercentage) == 0 &&
				bootstrapResolverRefreshIntervalSeconds == that.bootstrapResolverRefreshIntervalSeconds &&
				applicationsResolverDataStalenessThresholdSeconds == that.applicationsResolverDataStalenessThresholdSeconds &&
				asyncResolverRefreshIntervalMs == that.asyncResolverRefreshIntervalMs &&
				asyncResolverWarmUpTimeoutMs == that.asyncResolverWarmUpTimeoutMs &&
				asyncExecutorThreadPoolSize == that.asyncExecutorThreadPoolSize &&
				Objects.equals(readClusterVip, that.readClusterVip) &&
				Objects.equals(writeClusterVip, that.writeClusterVip) &&
				bootstrapResolverForQuery == that.bootstrapResolverForQuery &&
				Objects.equals(bootstrapResolverStrategy, that.bootstrapResolverStrategy) &&
				applicationsResolverUseIp == that.applicationsResolverUseIp;
	}

	@Override
	public int hashCode() {
		return Objects.hash(sessionedClientReconnectIntervalSeconds,
				retryableClientQuarantineRefreshPercentage,
				bootstrapResolverRefreshIntervalSeconds,
				applicationsResolverDataStalenessThresholdSeconds,
				asyncResolverRefreshIntervalMs, asyncResolverWarmUpTimeoutMs,
				asyncExecutorThreadPoolSize, readClusterVip, writeClusterVip,
				bootstrapResolverForQuery, bootstrapResolverStrategy,
				applicationsResolverUseIp);
	}

	@Override
	public String toString() {
		return new StringBuilder("CloudEurekaTransportConfig{")
				.append("sessionedClientReconnectIntervalSeconds=").append(sessionedClientReconnectIntervalSeconds).append(", ")
				.append("retryableClientQuarantineRefreshPercentage=").append(retryableClientQuarantineRefreshPercentage).append(", ")
				.append("bootstrapResolverRefreshIntervalSeconds=").append(bootstrapResolverRefreshIntervalSeconds).append(", ")
				.append("applicationsResolverDataStalenessThresholdSeconds=").append(applicationsResolverDataStalenessThresholdSeconds).append(", ")
				.append("asyncResolverRefreshIntervalMs=").append(asyncResolverRefreshIntervalMs).append(", ")
				.append("asyncResolverWarmUpTimeoutMs=").append(asyncResolverWarmUpTimeoutMs).append(", ")
				.append("asyncExecutorThreadPoolSize=").append(asyncExecutorThreadPoolSize).append(", ")
				.append("readClusterVip='").append(readClusterVip).append("', ")
				.append("writeClusterVip='").append(writeClusterVip).append("', ")
				.append("bootstrapResolverForQuery=").append(bootstrapResolverForQuery).append(", ")
				.append("bootstrapResolverStrategy='").append(bootstrapResolverStrategy).append("', ")
				.append("applicationsResolverUseIp=").append(applicationsResolverUseIp).append(", ").append("}")
				.toString();
	}
}


text:
BETA RELEASE
========================

Please note that EarthTab is still in Beta. Although this published version should be bug-free, there may still be a few issues that persist. As well, there are a few features that have been requested, some of which will be added before the official 1.0 release.

========================

EarthTab pulls images from Reddit's SFW nature porn to transform your new tabs into beautiful windows into Earth's natural beauty.

Reddit has a treasure trove of beautiful images of Earth, submitted tirelessly around the clock. EarthTab uses these images as backgrounds for your new tabs, offering you a pleasant look at images the Reddit community has declared spectacular.

You can set which specific nature subreddits you would like to pull images from, as well as the frequency that new images are looked for.

========================
RELEASE NOTES:

- v0.2.0 (Beta): now pulls images from different domains (not just i.imgur) (May 20th/2015)
- v0.3.0 (Beta): images no longer show up more than once (June 4th/2015)

========================

This is an open-source project, the source for which is available on GitHub here: https://github.com/himynameisdave/EarthTab

Built by Dave Lunny in the beautiful year 2015. http://himynameisdave.com

Licensed under the MIT licence.


text:
std::allocator<char> String::alloc;

std::ostream& operator<<(std::ostream& os, const String& str) {
	os << str.elements;
	return os;
}

std::pair<char*, char*> String::alloc_n_copy(const char *a, const char *b) {
	auto newdata = alloc.allocate(b - a + 1);
	alloc.construct(newdata + (b - a + 1), '\0');
	return{ newdata, std::uninitialized_copy(a, b, newdata) };
}

void String::free() {
	if (elements) {
		std::for_each(elements, end, [](char& c) { alloc.destroy(&c); });
		alloc.deallocate(elements, end - elements);
	}
}

String::String(const char *c) {
	const char *ce = c;
	while (*ce)
		++ce;
	auto newdata = alloc_n_copy(c, ce);
	elements = newdata.first;
	end = newdata.second;
}

String::String(const String& s) {
	auto newdata = alloc_n_copy(s.elements, s.end);
	elements = newdata.first;
	end = newdata.second;
}

String& String::operator=(const String &s) {
	auto newdata = alloc_n_copy(s.elements, s.end);
	free();
	elements = newdata.first;
	end = newdata.second;
	return *this;
}

String::~String() {
	free();
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.firebaseappcheck.v1.model;

/**
 * The enforcement configuration for a Firebase service supported by App Check.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Firebase App Check API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleFirebaseAppcheckV1Service extends com.google.api.client.json.GenericJson {

  /**
   * Required. The App Check enforcement mode for this service.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String enforcementMode;

  /**
   * Required. The relative resource name of the service configuration object, in the format: ```
   * projects/{project_number}/services/{service_id} ``` Note that the `service_id` element must be
   * a supported service ID. Currently, the following service IDs are supported: *
   * `firebasestorage.googleapis.com` (Cloud Storage for Firebase) *
   * `firebasedatabase.googleapis.com` (Firebase Realtime Database) * `firestore.googleapis.com`
   * (Cloud Firestore)
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Required. The App Check enforcement mode for this service.
   * @return value or {@code null} for none
   */
  public java.lang.String getEnforcementMode() {
    return enforcementMode;
  }

  /**
   * Required. The App Check enforcement mode for this service.
   * @param enforcementMode enforcementMode or {@code null} for none
   */
  public GoogleFirebaseAppcheckV1Service setEnforcementMode(java.lang.String enforcementMode) {
    this.enforcementMode = enforcementMode;
    return this;
  }

  /**
   * Required. The relative resource name of the service configuration object, in the format: ```
   * projects/{project_number}/services/{service_id} ``` Note that the `service_id` element must be
   * a supported service ID. Currently, the following service IDs are supported: *
   * `firebasestorage.googleapis.com` (Cloud Storage for Firebase) *
   * `firebasedatabase.googleapis.com` (Firebase Realtime Database) * `firestore.googleapis.com`
   * (Cloud Firestore)
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Required. The relative resource name of the service configuration object, in the format: ```
   * projects/{project_number}/services/{service_id} ``` Note that the `service_id` element must be
   * a supported service ID. Currently, the following service IDs are supported: *
   * `firebasestorage.googleapis.com` (Cloud Storage for Firebase) *
   * `firebasedatabase.googleapis.com` (Firebase Realtime Database) * `firestore.googleapis.com`
   * (Cloud Firestore)
   * @param name name or {@code null} for none
   */
  public GoogleFirebaseAppcheckV1Service setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  @Override
  public GoogleFirebaseAppcheckV1Service set(String fieldName, Object value) {
    return (GoogleFirebaseAppcheckV1Service) super.set(fieldName, value);
  }

  @Override
  public GoogleFirebaseAppcheckV1Service clone() {
    return (GoogleFirebaseAppcheckV1Service) super.clone();
  }

}


text:
#import "IGTestDiffingSectionController.h"

#import "IGTestCell.h"
#import "IGTestDiffingObject.h"
#import "IGTestNumberBindableCell.h"
#import "IGTestObject.h"
#import "IGTestStringBindableCell.h"

@implementation IGTestDiffingSectionController

- (instancetype)init {
    if (self = [super init]) {
        self.dataSource = self;
        self.selectionDelegate = self;
    }
    return self;
}

#pragma mark - IGListBindingSectionControllerDataSource

- (NSArray<id<IGListDiffable>> *)sectionController:(IGListBindingSectionController *)sectionController viewModelsForObject:(id)object {
    return [(IGTestDiffingObject *)object objects];
}

- (UICollectionViewCell<IGListBindable> *)sectionController:(IGListBindingSectionController *)sectionController cellForViewModel:(id)viewModel atIndex:(NSInteger)index {
    Class cellClass;
    if ([viewModel isKindOfClass:[NSString class]]) {
        cellClass = [IGTestStringBindableCell class];
    } else if ([viewModel isKindOfClass:[NSNumber class]]) {
        cellClass = [IGTestNumberBindableCell class];
    } else {
        cellClass = [IGTestCell class];
    }
    id cell = [self.collectionContext dequeueReusableCellOfClass:cellClass forSectionController:self atIndex:index];
    return cell;
}

- (CGSize)sectionController:(IGListBindingSectionController *)sectionController sizeForViewModel:(id)viewModel atIndex:(NSInteger)index {
    const BOOL isString = [viewModel isKindOfClass:[NSString class]];
    return CGSizeMake([self.collectionContext containerSize].width, isString ? 55 : 30);
}

#pragma mark - IGListBindingSectionControllerSelectionDelegate

- (void)sectionController:(IGListBindingSectionController *)sectionController didSelectItemAtIndex:(NSInteger)index viewModel:(id)viewModel {
    self.selectedViewModel = viewModel;
}

- (void)sectionController:(IGListBindingSectionController *)sectionController didDeselectItemAtIndex:(NSInteger)index viewModel:(id)viewModel {
    self.deselectedViewModel = viewModel;
}

- (void)sectionController:(IGListBindingSectionController *)sectionController didHighlightItemAtIndex:(NSInteger)index viewModel:(id)viewModel {
    self.highlightedViewModel = viewModel;
}

- (void)sectionController:(IGListBindingSectionController *)sectionController didUnhighlightItemAtIndex:(NSInteger)index viewModel:(id)viewModel {
    self.unhighlightedViewModel = viewModel;
}

@end


text:
FROM (
  FROM pv_users
  MAP pv_users.userid, pv_users.date1
  USING 'map_script'
  CLUSTER BY key) map_output
INSERT OVERWRITE TABLE pv_users_reduced
  REDUCE map_output.key, map_output.value
  USING 'reduce_script'
  AS date1, count


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<base href="../../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

		[page:Curve] →

[name]

			Create a smooth 3d
			quadratic bezier curve,
			defined by a startpoint, endpoint and a single control point.

Code Example

		var curve = new THREE.QuadraticBezierCurve3(
			new THREE.Vector3( -10, 0, 0 ),
			new THREE.Vector3( 20, 15, 0 ),
			new THREE.Vector3( 10, 0, 0 )
		);

		var points = curve.getPoints( 50 );
		var geometry = new THREE.BufferGeometry().setFromPoints( points );

		var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );

		// Create the final object to add to the scene
		var curveObject = new THREE.Line( geometry, material );

Constructor

[name]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2] )

			[page:Vector3 v0] – The starting point

			[page:Vector3 v1] – The middle control point

			[page:Vector3 v2] – The ending point

Properties

See the base [page:Curve] class for common properties.

[property:Vector3 v0]

The startpoint.

[property:Vector3 v1]

The control point.

[property:Vector3 v2]

The endpoint.

Methods

See the base [page:Curve] class for common methods.

Source

			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]


text: all: text2data nsf2data read_nsf_header ft2p chr-rom-to-bmp


text:
package com.spotify.flo;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Test;

public class TaskInfoTest {

  @Test
  public void testTaskInfo() throws Exception {
    Task<String> task = first();
    TaskInfo taskInfo = TaskInfo.ofTask(task);

    assertThat(taskInfo.id(), is(task.id()));
    assertThat(taskInfo.isReference(), is(false));
    assertThat(taskInfo.inputs().size(), is(1));

    TaskInfo input1 = taskInfo.inputs().get(0);
    assertThat(input1.id(), is(second(1).id()));
    assertThat(input1.isReference(), is(false));
    assertThat(input1.inputs().size(), is(1));

    TaskInfo input2 = input1.inputs().get(0);
    assertThat(input2.id(), is(second(1).id()));
    assertThat(input2.isReference(), is(true));
    assertThat(input2.inputs().size(), is(0));
  }

  private static Task<String> first() {
    return Task.named("First").ofType(String.class)
        .input(() -> second(1))
        .process((s) -> "foo");
  }

  private static Task<String> second(int i) {
    return Task.named("Second", i).ofType(String.class)
        .input(() -> second(i))
        .process((self) -> "bar");
  }
}


text:
using namespace clang;
using namespace clang::index;
using namespace clang::index::store;
using namespace llvm;

static void appendSubDir(StringRef subdir, SmallVectorImpl<char> &StorePathBuf) {
  SmallString<10> VersionPath;
  raw_svector_ostream(VersionPath) << 'v' << STORE_FORMAT_VERSION;

  sys::path::append(StorePathBuf, VersionPath);
  sys::path::append(StorePathBuf, subdir);
}

void store::appendInteriorUnitPath(StringRef UnitName,
                                   SmallVectorImpl<char> &PathBuf) {
  sys::path::append(PathBuf, UnitName);
}

void store::appendUnitSubDir(SmallVectorImpl<char> &StorePathBuf) {
  return appendSubDir("units", StorePathBuf);
}

void store::appendRecordSubDir(SmallVectorImpl<char> &StorePathBuf) {
  return appendSubDir("records", StorePathBuf);
}

void store::appendInteriorRecordPath(StringRef RecordName,
                                     SmallVectorImpl<char> &PathBuf) {
  // To avoid putting a huge number of files into the records directory, create
  // subdirectories based on the last 2 characters from the hash.
  StringRef hash2chars = RecordName.substr(RecordName.size()-2);
  sys::path::append(PathBuf, hash2chars);
  sys::path::append(PathBuf, RecordName);
}

void store::emitBlockID(unsigned ID, const char *Name,
                        BitstreamWriter &Stream, RecordDataImpl &Record) {
  Record.clear();
  Record.push_back(ID);
  Stream.EmitRecord(bitc::BLOCKINFO_CODE_SETBID, Record);

  // Emit the block name if present.
  if (!Name || Name[0] == 0)
    return;
  Record.clear();
  while (*Name)
    Record.push_back(*Name++);
  Stream.EmitRecord(bitc::BLOCKINFO_CODE_BLOCKNAME, Record);
}

void store::emitRecordID(unsigned ID, const char *Name,
                         BitstreamWriter &Stream,
                         RecordDataImpl &Record) {
  Record.clear();
  Record.push_back(ID);
  while (*Name)
    Record.push_back(*Name++);
  Stream.EmitRecord(bitc::BLOCKINFO_CODE_SETRECORDNAME, Record);
}

/// Map an indexstore_symbol_kind_t to a SymbolKind, handling unknown values.
SymbolKind index::getSymbolKind(indexstore_symbol_kind_t K) {
  switch ((uint64_t)K) {
  default:
  case INDEXSTORE_SYMBOL_KIND_UNKNOWN:
    return SymbolKind::Unknown;
  case INDEXSTORE_SYMBOL_KIND_MODULE:
    return SymbolKind::Module;
  case INDEXSTORE_SYMBOL_KIND_NAMESPACE:
    return SymbolKind::Namespace;
  case INDEXSTORE_SYMBOL_KIND_NAMESPACEALIAS:
    return SymbolKind::NamespaceAlias;
  case INDEXSTORE_SYMBOL_KIND_MACRO:
    return SymbolKind::Macro;
  case INDEXSTORE_SYMBOL_KIND_ENUM:
    return SymbolKind::Enum;
  case INDEXSTORE_SYMBOL_KIND_STRUCT:
    return SymbolKind::Struct;
  case INDEXSTORE_SYMBOL_KIND_CLASS:
    return SymbolKind::Class;
  case INDEXSTORE_SYMBOL_KIND_PROTOCOL:
    return SymbolKind::Protocol;
  case INDEXSTORE_SYMBOL_KIND_EXTENSION:
    return SymbolKind::Extension;
  case INDEXSTORE_SYMBOL_KIND_UNION:
    return SymbolKind::Union;
  case INDEXSTORE_SYMBOL_KIND_TYPEALIAS:
    return SymbolKind::TypeAlias;
  case INDEXSTORE_SYMBOL_KIND_FUNCTION:
    return SymbolKind::Function;
  case INDEXSTORE_SYMBOL_KIND_VARIABLE:
    return SymbolKind::Variable;
  case INDEXSTORE_SYMBOL_KIND_FIELD:
    return SymbolKind::Field;
  case INDEXSTORE_SYMBOL_KIND_ENUMCONSTANT:
    return SymbolKind::EnumConstant;
  case INDEXSTORE_SYMBOL_KIND_INSTANCEMETHOD:
    return SymbolKind::InstanceMethod;
  case INDEXSTORE_SYMBOL_KIND_CLASSMETHOD:
    return SymbolKind::ClassMethod;
  case INDEXSTORE_SYMBOL_KIND_STATICMETHOD:
    return SymbolKind::StaticMethod;
  case INDEXSTORE_SYMBOL_KIND_INSTANCEPROPERTY:
    return SymbolKind::InstanceProperty;
  case INDEXSTORE_SYMBOL_KIND_CLASSPROPERTY:
    return SymbolKind::ClassProperty;
  case INDEXSTORE_SYMBOL_KIND_STATICPROPERTY:
    return SymbolKind::StaticProperty;
  case INDEXSTORE_SYMBOL_KIND_CONSTRUCTOR:
    return SymbolKind::Constructor;
  case INDEXSTORE_SYMBOL_KIND_DESTRUCTOR:
    return SymbolKind::Destructor;
  case INDEXSTORE_SYMBOL_KIND_CONVERSIONFUNCTION:
    return SymbolKind::ConversionFunction;
  case INDEXSTORE_SYMBOL_KIND_PARAMETER:
    return SymbolKind::Parameter;
  case INDEXSTORE_SYMBOL_KIND_USING:
    return SymbolKind::Using;
  case INDEXSTORE_SYMBOL_KIND_COMMENTTAG:
    return SymbolKind::CommentTag;
  }
}

SymbolSubKind index::getSymbolSubKind(indexstore_symbol_subkind_t K) {
  switch ((uint64_t)K) {
  default:
  case INDEXSTORE_SYMBOL_SUBKIND_NONE:
    return SymbolSubKind::None;
  case INDEXSTORE_SYMBOL_SUBKIND_CXXCOPYCONSTRUCTOR:
    return SymbolSubKind::CXXCopyConstructor;
  case INDEXSTORE_SYMBOL_SUBKIND_CXXMOVECONSTRUCTOR:
    return SymbolSubKind::CXXMoveConstructor;
  case INDEXSTORE_SYMBOL_SUBKIND_ACCESSORGETTER:
      return SymbolSubKind::AccessorGetter;
  case INDEXSTORE_SYMBOL_SUBKIND_ACCESSORSETTER:
      return SymbolSubKind::AccessorSetter;
  case INDEXSTORE_SYMBOL_SUBKIND_USINGTYPENAME:
      return SymbolSubKind::UsingTypename;
  case INDEXSTORE_SYMBOL_SUBKIND_USINGVALUE:
      return SymbolSubKind::UsingValue;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORWILLSET:
    return SymbolSubKind::SwiftAccessorWillSet;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORDIDSET:
    return SymbolSubKind::SwiftAccessorDidSet;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORADDRESSOR:
    return SymbolSubKind::SwiftAccessorAddressor;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMUTABLEADDRESSOR:
    return SymbolSubKind::SwiftAccessorMutableAddressor;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD:
    return SymbolSubKind::SwiftAccessorRead;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY:
    return SymbolSubKind::SwiftAccessorModify;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFSTRUCT:
    return SymbolSubKind::SwiftExtensionOfStruct;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFCLASS:
    return SymbolSubKind::SwiftExtensionOfClass;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFENUM:
    return SymbolSubKind::SwiftExtensionOfEnum;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFPROTOCOL:
    return SymbolSubKind::SwiftExtensionOfProtocol;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTPREFIXOPERATOR:
    return SymbolSubKind::SwiftPrefixOperator;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTPOSTFIXOPERATOR:
    return SymbolSubKind::SwiftPostfixOperator;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTINFIXOPERATOR:
    return SymbolSubKind::SwiftInfixOperator;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTSUBSCRIPT:
    return SymbolSubKind::SwiftSubscript;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTASSOCIATEDTYPE:
    return SymbolSubKind::SwiftAssociatedType;
  case INDEXSTORE_SYMBOL_SUBKIND_SWIFTGENERICTYPEPARAM:
    return SymbolSubKind::SwiftGenericTypeParam;
  }
}

/// Map an indexstore_symbol_language_t to a SymbolLanguage, handling unknown
/// values.
SymbolLanguage index::getSymbolLanguage(indexstore_symbol_language_t L) {
  switch ((uint64_t)L) {
  default: // FIXME: add an unknown language?
  case INDEXSTORE_SYMBOL_LANG_C:
    return SymbolLanguage::C;
  case INDEXSTORE_SYMBOL_LANG_OBJC:
    return SymbolLanguage::ObjC;
  case INDEXSTORE_SYMBOL_LANG_CXX:
    return SymbolLanguage::CXX;
  case INDEXSTORE_SYMBOL_LANG_SWIFT:
    return SymbolLanguage::Swift;
  }
}

/// Map an indexstore representation to a SymbolPropertySet, handling
/// unknown values.
SymbolPropertySet index::getSymbolProperties(uint64_t Props) {
  SymbolPropertySet SymbolProperties = 0;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_GENERIC)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::Generic;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_PARTIAL_SPECIALIZATION)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::TemplatePartialSpecialization;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_SPECIALIZATION)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::TemplateSpecialization;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_UNITTEST)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::UnitTest;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_IBANNOTATED)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::IBAnnotated;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_IBOUTLETCOLLECTION)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::IBOutletCollection;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_GKINSPECTABLE)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::GKInspectable;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_LOCAL)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::Local;
  if (Props & INDEXSTORE_SYMBOL_PROPERTY_PROTOCOL_INTERFACE)
    SymbolProperties |= (SymbolPropertySet)SymbolProperty::ProtocolInterface;

  return SymbolProperties;
}

/// Map an indexstore representation to a SymbolRoleSet, handling unknown
/// values.
SymbolRoleSet index::getSymbolRoles(uint64_t Roles) {
  SymbolRoleSet SymbolRoles = 0;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_DECLARATION)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Declaration;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_DEFINITION)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Definition;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REFERENCE)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Reference;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_READ)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Read;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_WRITE)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Write;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_CALL)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Call;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_DYNAMIC)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Dynamic;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_ADDRESSOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::AddressOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_IMPLICIT)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Implicit;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_UNDEFINITION)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::Undefinition;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_CHILDOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationChildOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_BASEOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationBaseOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_OVERRIDEOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationOverrideOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_RECEIVEDBY)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationReceivedBy;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_CALLEDBY)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationCalledBy;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_EXTENDEDBY)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationExtendedBy;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_ACCESSOROF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationAccessorOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_CONTAINEDBY)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationContainedBy;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_IBTYPEOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationIBTypeOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_REL_SPECIALIZATIONOF)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::RelationSpecializationOf;
  if (Roles & INDEXSTORE_SYMBOL_ROLE_NAMEREFERENCE)
    SymbolRoles |= (SymbolRoleSet)SymbolRole::NameReference;

  return SymbolRoles;
}

/// Map a SymbolLanguage to a indexstore_symbol_language_t.
indexstore_symbol_kind_t index::getIndexStoreKind(SymbolKind K) {
  switch (K) {
  case SymbolKind::Unknown:
    return INDEXSTORE_SYMBOL_KIND_UNKNOWN;
  case SymbolKind::Module:
    return INDEXSTORE_SYMBOL_KIND_MODULE;
  case SymbolKind::Namespace:
    return INDEXSTORE_SYMBOL_KIND_NAMESPACE;
  case SymbolKind::NamespaceAlias:
    return INDEXSTORE_SYMBOL_KIND_NAMESPACEALIAS;
  case SymbolKind::Macro:
    return INDEXSTORE_SYMBOL_KIND_MACRO;
  case SymbolKind::Enum:
    return INDEXSTORE_SYMBOL_KIND_ENUM;
  case SymbolKind::Struct:
    return INDEXSTORE_SYMBOL_KIND_STRUCT;
  case SymbolKind::Class:
    return INDEXSTORE_SYMBOL_KIND_CLASS;
  case SymbolKind::Protocol:
    return INDEXSTORE_SYMBOL_KIND_PROTOCOL;
  case SymbolKind::Extension:
    return INDEXSTORE_SYMBOL_KIND_EXTENSION;
  case SymbolKind::Union:
    return INDEXSTORE_SYMBOL_KIND_UNION;
  case SymbolKind::TypeAlias:
    return INDEXSTORE_SYMBOL_KIND_TYPEALIAS;
  case SymbolKind::Function:
    return INDEXSTORE_SYMBOL_KIND_FUNCTION;
  case SymbolKind::Variable:
    return INDEXSTORE_SYMBOL_KIND_VARIABLE;
  case SymbolKind::Field:
    return INDEXSTORE_SYMBOL_KIND_FIELD;
  case SymbolKind::EnumConstant:
    return INDEXSTORE_SYMBOL_KIND_ENUMCONSTANT;
  case SymbolKind::InstanceMethod:
    return INDEXSTORE_SYMBOL_KIND_INSTANCEMETHOD;
  case SymbolKind::ClassMethod:
    return INDEXSTORE_SYMBOL_KIND_CLASSMETHOD;
  case SymbolKind::StaticMethod:
    return INDEXSTORE_SYMBOL_KIND_STATICMETHOD;
  case SymbolKind::InstanceProperty:
    return INDEXSTORE_SYMBOL_KIND_INSTANCEPROPERTY;
  case SymbolKind::ClassProperty:
    return INDEXSTORE_SYMBOL_KIND_CLASSPROPERTY;
  case SymbolKind::StaticProperty:
    return INDEXSTORE_SYMBOL_KIND_STATICPROPERTY;
  case SymbolKind::Constructor:
    return INDEXSTORE_SYMBOL_KIND_CONSTRUCTOR;
  case SymbolKind::Destructor:
    return INDEXSTORE_SYMBOL_KIND_DESTRUCTOR;
  case SymbolKind::ConversionFunction:
    return INDEXSTORE_SYMBOL_KIND_CONVERSIONFUNCTION;
  case SymbolKind::Parameter:
    return INDEXSTORE_SYMBOL_KIND_PARAMETER;
  case SymbolKind::Using:
    return INDEXSTORE_SYMBOL_KIND_USING;
  case SymbolKind::CommentTag:
    return INDEXSTORE_SYMBOL_KIND_COMMENTTAG;
  }
  llvm_unreachable("unexpected symbol kind");
}

indexstore_symbol_subkind_t index::getIndexStoreSubKind(SymbolSubKind K) {
  switch (K) {
  case SymbolSubKind::None:
    return INDEXSTORE_SYMBOL_SUBKIND_NONE;
  case SymbolSubKind::CXXCopyConstructor:
    return INDEXSTORE_SYMBOL_SUBKIND_CXXCOPYCONSTRUCTOR;
  case SymbolSubKind::CXXMoveConstructor:
    return INDEXSTORE_SYMBOL_SUBKIND_CXXMOVECONSTRUCTOR;
  case SymbolSubKind::AccessorGetter:
    return INDEXSTORE_SYMBOL_SUBKIND_ACCESSORGETTER;
  case SymbolSubKind::AccessorSetter:
    return INDEXSTORE_SYMBOL_SUBKIND_ACCESSORSETTER;
  case SymbolSubKind::UsingTypename:
    return INDEXSTORE_SYMBOL_SUBKIND_USINGTYPENAME;
  case SymbolSubKind::UsingValue:
    return INDEXSTORE_SYMBOL_SUBKIND_USINGVALUE;
  case SymbolSubKind::SwiftAccessorWillSet:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORWILLSET;
  case SymbolSubKind::SwiftAccessorDidSet:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORDIDSET;
  case SymbolSubKind::SwiftAccessorAddressor:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORADDRESSOR;
  case SymbolSubKind::SwiftAccessorMutableAddressor:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMUTABLEADDRESSOR;
  case SymbolSubKind::SwiftAccessorRead:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD;
  case SymbolSubKind::SwiftAccessorModify:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY;
  case SymbolSubKind::SwiftExtensionOfStruct:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFSTRUCT;
  case SymbolSubKind::SwiftExtensionOfClass:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFCLASS;
  case SymbolSubKind::SwiftExtensionOfEnum:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFENUM;
  case SymbolSubKind::SwiftExtensionOfProtocol:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFPROTOCOL;
  case SymbolSubKind::SwiftPrefixOperator:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTPREFIXOPERATOR;
  case SymbolSubKind::SwiftPostfixOperator:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTPOSTFIXOPERATOR;
  case SymbolSubKind::SwiftInfixOperator:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTINFIXOPERATOR;
  case SymbolSubKind::SwiftSubscript:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTSUBSCRIPT;
  case SymbolSubKind::SwiftAssociatedType:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTASSOCIATEDTYPE;
  case SymbolSubKind::SwiftGenericTypeParam:
    return INDEXSTORE_SYMBOL_SUBKIND_SWIFTGENERICTYPEPARAM;
  }
  llvm_unreachable("unexpected symbol subkind");
}

/// Map a SymbolLanguage to a indexstore_symbol_language_t.
indexstore_symbol_language_t index::getIndexStoreLang(SymbolLanguage L) {
  switch (L) {
  case SymbolLanguage::C:
    return INDEXSTORE_SYMBOL_LANG_C;
  case SymbolLanguage::ObjC:
    return INDEXSTORE_SYMBOL_LANG_OBJC;
  case SymbolLanguage::CXX:
    return INDEXSTORE_SYMBOL_LANG_CXX;
  case SymbolLanguage::Swift:
    return INDEXSTORE_SYMBOL_LANG_SWIFT;
  }
  llvm_unreachable("unexpected symbol language");
}

/// Map a SymbolPropertySet to its indexstore representation.
indexstore_symbol_property_t index::getIndexStoreProperties(SymbolPropertySet Props) {
  uint64_t storeProp = 0;
  applyForEachSymbolProperty(Props, [&](SymbolProperty prop) {
    switch (prop) {
    case SymbolProperty::Generic:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_GENERIC;
      break;
    case SymbolProperty::TemplatePartialSpecialization:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_PARTIAL_SPECIALIZATION;
      break;
    case SymbolProperty::TemplateSpecialization:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_SPECIALIZATION;
      break;
    case SymbolProperty::UnitTest:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_UNITTEST;
      break;
    case SymbolProperty::IBAnnotated:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_IBANNOTATED;
      break;
    case SymbolProperty::IBOutletCollection:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_IBOUTLETCOLLECTION;
      break;
    case SymbolProperty::GKInspectable:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_GKINSPECTABLE;
      break;
    case SymbolProperty::Local:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_LOCAL;
      break;
    case SymbolProperty::ProtocolInterface:
      storeProp |= INDEXSTORE_SYMBOL_PROPERTY_PROTOCOL_INTERFACE;
      break;
    }
  });
  return static_cast<indexstore_symbol_property_t>(storeProp);
}

/// Map a SymbolRoleSet to its indexstore representation.
indexstore_symbol_role_t index::getIndexStoreRoles(SymbolRoleSet Roles) {
  uint64_t storeRoles = 0;
  applyForEachSymbolRole(Roles, [&](SymbolRole role) {
    switch (role) {
    case SymbolRole::Declaration:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_DECLARATION;
      break;
    case SymbolRole::Definition:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_DEFINITION;
      break;
    case SymbolRole::Reference:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REFERENCE;
      break;
    case SymbolRole::Read:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_READ;
      break;
    case SymbolRole::Write:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_WRITE;
      break;
    case SymbolRole::Call:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_CALL;
      break;
    case SymbolRole::Dynamic:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_DYNAMIC;
      break;
    case SymbolRole::AddressOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_ADDRESSOF;
      break;
    case SymbolRole::Implicit:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_IMPLICIT;
      break;
    case SymbolRole::Undefinition:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_UNDEFINITION;
      break;
    case SymbolRole::RelationChildOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_CHILDOF;
      break;
    case SymbolRole::RelationBaseOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_BASEOF;
      break;
    case SymbolRole::RelationOverrideOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_OVERRIDEOF;
      break;
    case SymbolRole::RelationReceivedBy:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_RECEIVEDBY;
      break;
    case SymbolRole::RelationCalledBy:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_CALLEDBY;
      break;
    case SymbolRole::RelationExtendedBy:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_EXTENDEDBY;
      break;
    case SymbolRole::RelationAccessorOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_ACCESSOROF;
      break;
    case SymbolRole::RelationContainedBy:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_CONTAINEDBY;
      break;
    case SymbolRole::RelationIBTypeOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_IBTYPEOF;
      break;
    case SymbolRole::RelationSpecializationOf:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_REL_SPECIALIZATIONOF;
      break;
    case SymbolRole::NameReference:
      storeRoles |= INDEXSTORE_SYMBOL_ROLE_NAMEREFERENCE;
      break;
    }
  });
  return static_cast<indexstore_symbol_role_t>(storeRoles);
}


text:
package com.trifork.hotruby.util.collection;

/**
 * @author Kresten Krab Thorup (krab@trifork.com)
 */
public interface ObjectToLongMap {
    public interface EntryIter {
    	void each(Object key, long value);
	}

	long get(Object key);
    long remove(Object key);
    long put(Object key, long value);
    int size();

    interface Entry {
        Object getKey();
        long getValue();
    }

    interface EntryIterator {
        boolean hasNext();
        Entry next();
    }

    EntryIterator entryIterator();
    void toEntriesArray(Entry[] entries);

	void forEach(EntryIter iter);
}


text:
import notification from '..';

describe('Notification.placement', () => {
  afterEach(() => notification.destroy());

  function $$(className) {
    return document.body.querySelectorAll(className);
  }

  function getStyle(el, prop, getComputedStyle, style) {
    getComputedStyle = getComputedStyle || window.getComputedStyle;
    style = getComputedStyle ? getComputedStyle(el) : el.currentStyle;

    // If a css property's value is `auto`, it will return an empty string.
    return prop ? style[prop] : style;
  }

  function open(args) {
    notification.open({
      message: 'Notification Title',
      description: 'This is the content of the notification.',
      ...args,
    });
  }

  function config(args) {
    notification.config({
      ...args,
    });
    open();
  }

  it('change notification placement by `open` method', () => {
    const defaultTop = '24px';
    const defaultBottom = '24px';
    let style;

    // topLeft
    open({
      placement: 'topLeft',
    });
    style = getStyle($$('.ant-notification-topLeft')[0]);
    expect(style.top).toBe(defaultTop);
    expect(style.left).toBe('0px');
    expect(style.bottom).toBe('');

    open({
      placement: 'topLeft',
    });
    expect($$('.ant-notification-topLeft').length).toBe(1);

    // topRight
    open({
      placement: 'topRight',
    });
    style = getStyle($$('.ant-notification-topRight')[0]);
    expect(style.top).toBe(defaultTop);
    expect(style.right).toBe('0px');
    expect(style.bottom).toBe('');

    open({
      placement: 'topRight',
    });
    expect($$('.ant-notification-topRight').length).toBe(1);

    // bottomRight
    open({
      placement: 'bottomRight',
    });
    style = getStyle($$('.ant-notification-bottomRight')[0]);
    expect(style.top).toBe('');
    expect(style.right).toBe('0px');
    expect(style.bottom).toBe(defaultBottom);

    open({
      placement: 'bottomRight',
    });
    expect($$('.ant-notification-bottomRight').length).toBe(1);

    // bottomLeft
    open({
      placement: 'bottomLeft',
    });
    style = getStyle($$('.ant-notification-bottomLeft')[0]);
    expect(style.top).toBe('');
    expect(style.left).toBe('0px');
    expect(style.bottom).toBe(defaultBottom);

    open({
      placement: 'bottomLeft',
    });
    expect($$('.ant-notification-bottomLeft').length).toBe(1);
  });

  it('change notification placement by `config` method', () => {
    let style;

    // topLeft
    config({
      placement: 'topLeft',
      top: 50,
      bottom: 50,
    });
    style = getStyle($$('.ant-notification-topLeft')[0]);
    expect(style.top).toBe('50px');
    expect(style.left).toBe('0px');
    expect(style.bottom).toBe('');

    // topRight
    config({
      placement: 'topRight',
      top: 100,
      bottom: 50,
    });
    style = getStyle($$('.ant-notification-topRight')[0]);
    expect(style.top).toBe('100px');
    expect(style.right).toBe('0px');
    expect(style.bottom).toBe('');

    // bottomRight
    config({
      placement: 'bottomRight',
      top: 50,
      bottom: 100,
    });
    style = getStyle($$('.ant-notification-bottomRight')[0]);
    expect(style.top).toBe('');
    expect(style.right).toBe('0px');
    expect(style.bottom).toBe('100px');

    // bottomLeft
    config({
      placement: 'bottomLeft',
      top: 100,
      bottom: 50,
    });
    style = getStyle($$('.ant-notification-bottomLeft')[0]);
    expect(style.top).toBe('');
    expect(style.left).toBe('0px');
    expect(style.bottom).toBe('50px');
  });
  it('change notification mountNode by `config` method', () => {
    const $container = document.createElement('div');
    document.body.appendChild($container);
    config({
      top: 50,
      bottom: 100,
      getContainer() {
        return $container;
      },
    });
    expect($container.querySelector('.ant-notification')).not.toBe(null);
    $container.remove();
  });
});


text:
<?php

namespace Broadway\Bundle\BroadwayBundle\DependencyInjection;

use Broadway\Bundle\BroadwayBundle\TestCase;
use Symfony\Component\DependencyInjection\Reference;

class RegisterBusSubscribersCompilerPassTest extends TestCase
{
    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    private $builder;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    private $commandBus;

    public function setUp()
    {
        $this->builder    = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
            ->setMethods(array('getParameterBag', 'getDefinition', 'hasDefinition', 'findDefinition', 'findTaggedServiceIds'))
            ->getMock();
        $this->commandBus = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
    }

    /**
     * @test
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage Service "my_fake_command_handler" must implement interface "Broadway\Bundle\BroadwayBundle\DependencyInjection\BusSubscriberInterface"
     */
    public function command_handler_must_have_proper_interface()
    {
        // one service, not implementing any interface
        $services = array(
            'my_fake_command_handler' => array(),
        );

        $this->expects_bus_definition();
        $this->expects_tagged_services_and_returns($services);
        $this->expects_class_from_definition_and_returns('stdClass');

        $registerListenersPass = new RegisterBusSubscribersCompilerPass('bus_service', 'tag', 'Broadway\Bundle\BroadwayBundle\DependencyInjection\BusSubscriberInterface');
        $registerListenersPass->process($this->builder);
    }

    /**
     * @test
     */
    public function it_subscribes_command_handler()
    {
        $commandHandlerId = 'my_command_handler';
        $services         = array(
            $commandHandlerId => array(),
        );

        $this->expects_bus_definition();
        $this->expects_tagged_services_and_returns($services);
        $this->expects_class_from_definition_and_returns('Broadway\Bundle\BroadwayBundle\DependencyInjection\BusSubscriber');
        $this->expects_subscribe_call_on_bus($commandHandlerId);

        $registerListenersPass = new RegisterBusSubscribersCompilerPass('bus_service', 'tag', 'Broadway\Bundle\BroadwayBundle\DependencyInjection\BusSubscriberInterface');
        $registerListenersPass->process($this->builder);
    }

    /**
     * @param $taggedServiceClass
     */
    private function expects_class_from_definition_and_returns($taggedServiceClass)
    {
        $parameterBag = $this->getMockBuilder('Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface')->getMock();
        $this->builder->expects($this->atLeastOnce())
            ->method('getParameterBag')
            ->will($this->returnValue($parameterBag));

        $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
        $definition->expects($this->atLeastOnce())
            ->method('getClass')
            ->will($this->returnValue($taggedServiceClass));

        $this->builder->expects($this->atLeastOnce())
            ->method('getDefinition')
            ->will($this->returnValue($definition));

        $parameterBag->expects($this->atLeastOnce())
            ->method('resolveValue')
            ->will($this->returnValue($taggedServiceClass));
    }

    private function expects_bus_definition()
    {
        $this->builder->expects($this->any())
            ->method('hasDefinition')
            ->will($this->returnValue(true));

        $this->builder->expects($this->atLeastOnce())
            ->method('findDefinition')
            ->will($this->returnValue($this->commandBus));
    }

    private function expects_tagged_services_and_returns($services)
    {
        $this->builder->expects($this->atLeastOnce())
            ->method('findTaggedServiceIds')
            ->will($this->returnValue($services));
    }

    private function expects_subscribe_call_on_bus($commandHandlerId)
    {
        $this->commandBus->expects($this->once())
            ->method('addMethodCall')
            ->with('subscribe', array(new Reference($commandHandlerId)));
    }
}

interface BusSubscriberInterface
{
}

class BusSubscriber implements BusSubscriberInterface
{
}


text:
import { Trampoline } from "./AsyncBuilder";
import { protectedCont } from "./AsyncBuilder";
import { protectedBind } from "./AsyncBuilder";
import { protectedReturn } from "./AsyncBuilder";
import { choice1Of2 } from "./Choice";
import { choice2Of2 } from "./Choice";
import { map } from "./Seq";
var Async = (function () {
    function Async() {
    }
    return Async;
}());
export default Async;
function emptyContinuation(x) {
}
export function awaitPromise(p) {
    return fromContinuations(function (conts) {
        return p.then(conts[0]).catch(function (err) {
            return (err == "cancelled" ? conts[2] : conts[1])(err);
        });
    });
}
export function cancellationToken() {
    return protectedCont(function (ctx) { return ctx.onSuccess(ctx.cancelToken); });
}
export var defaultCancellationToken = { isCancelled: false };
export function catchAsync(work) {
    return protectedCont(function (ctx) {
        work({
            onSuccess: function (x) { return ctx.onSuccess(choice1Of2(x)); },
            onError: function (ex) { return ctx.onSuccess(choice2Of2(ex)); },
            onCancel: ctx.onCancel,
            cancelToken: ctx.cancelToken,
            trampoline: ctx.trampoline
        });
    });
}
export function fromContinuations(f) {
    return protectedCont(function (ctx) { return f([ctx.onSuccess, ctx.onError, ctx.onCancel]); });
}
export function ignore(computation) {
    return protectedBind(computation, function (x) { return protectedReturn(void 0); });
}
export function parallel(computations) {
    return awaitPromise(Promise.all(map(function (w) { return startAsPromise(w); }, computations)));
}
export function sleep(millisecondsDueTime) {
    return protectedCont(function (ctx) {
        setTimeout(function () { return ctx.cancelToken.isCancelled ? ctx.onCancel("cancelled") : ctx.onSuccess(void 0); }, millisecondsDueTime);
    });
}
export function start(computation, cancellationToken) {
    return startWithContinuations(computation, cancellationToken);
}
export function startImmediate(computation, cancellationToken) {
    return start(computation, cancellationToken);
}
export function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {
    if (typeof continuation !== "function") {
        cancelToken = continuation;
        continuation = null;
    }
    var trampoline = new Trampoline();
    computation({
        onSuccess: continuation ? continuation : emptyContinuation,
        onError: exceptionContinuation ? exceptionContinuation : emptyContinuation,
        onCancel: cancellationContinuation ? cancellationContinuation : emptyContinuation,
        cancelToken: cancelToken ? cancelToken : defaultCancellationToken,
        trampoline: trampoline
    });
}
export function startAsPromise(computation, cancellationToken) {
    return new Promise(function (resolve, reject) {
        return startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken);
    });
}


text:
package com.ivona.services.tts.model;

/**
 * Class representing the speech marks requested for a synthesis.
 *

 * Please check the service documentation for more details.
 *
 * @see Speech Cloud Developer Guide
 */
public class SpeechMarks {
    private boolean sentence;
    private boolean ssml;
    private boolean viseme;
    private boolean word;

    /**
     * Returns true if sentence speech marks are .
     */
    public boolean isSentence() {
        return sentence;
    }

    /**
     * Enable or disable sentence speech marks.
     */
    public void setSentence(boolean sentence) {
        this.sentence = sentence;
    }

    /**
     * Enable or disable sentence speech marks.
     *

     * Returns a reference to this object so that method calls can be chained together.
     */
    public SpeechMarks withSentence(boolean sentence) {
        this.sentence = sentence;
        return this;
    }

    /**
     * Returns true if SSML speech marks are .
     */
    public boolean isSsml() {
        return ssml;
    }

    /**
     * Enable or disable SSML speech marks.
     */
    public void setSsml(boolean ssml) {
        this.ssml = ssml;
    }

    /**
     * Enable or disable SSML speech marks.
     *

     * Returns a reference to this object so that method calls can be chained together.
     */
    public SpeechMarks withSsml(boolean ssml) {
        this.ssml = ssml;
        return this;
    }

    /**
     * Returns true if viseme speech marks are .
     */
    public boolean isViseme() {
        return viseme;
    }

    /**
     * Enable or disable viseme speech marks.
     */
    public void setViseme(boolean viseme) {
        this.viseme = viseme;
    }

    /**
     * Enable or disable viseme speech marks.
     *

     * Returns a reference to this object so that method calls can be chained together.
     */
    public SpeechMarks withViseme(boolean viseme) {
        this.viseme = viseme;
        return this;
    }

    /**
     * Returns true if word speech marks are .
     */
    public boolean isWord() {
        return word;
    }

    /**
     * Enable or disable word speech marks.
     */
    public void setWord(boolean word) {
        this.word = word;
    }

    /**
     * Enable or disable word speech marks.
     *

     * Returns a reference to this object so that method calls can be chained together.
     */
    public SpeechMarks withWord(boolean word) {
        this.word = word;
        return this;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("SpeechMarks [sentence=");
        builder.append(sentence);
        builder.append(", ssml=");
        builder.append(ssml);
        builder.append(", viseme=");
        builder.append(viseme);
        builder.append(", word=");
        builder.append(word);
        builder.append("]");
        return builder.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (sentence ? 1 : 0);
        result = prime * result + (ssml ? 1 : 0);
        result = prime * result + (viseme ? 1 : 0);
        result = prime * result + (word ? 1 : 0);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        SpeechMarks other = (SpeechMarks) obj;
        if (sentence != other.sentence) {
            return false;
        }
        if (ssml != other.ssml) {
            return false;
        }
        if (viseme != other.viseme) {
            return false;
        }
        if (word != other.word) {
            return false;
        }
        return true;
    }
}


text:
/********************************************************/
/*                                                      */
/*  Copley Motion Libraries                             */
/*                                                      */
/*  Copyright (c) 2002 Copley Controls Corp.            */
/*                     http://www.copleycontrols.com    */
/*                                                      */
/********************************************************/

/**
\file
This file holds the code needed to implement CANopen Process Data Objects (PDOs).
*/

#include "CML.h"

CML_NAMESPACE_USE();

/**************************************************
* PDO Error objects
**************************************************/
CML_NEW_ERROR( PDO_Error, MapFull,       "The PDO Map is already full" );
CML_NEW_ERROR( PDO_Error, BitOverflow,   "Variable too long to add to map" );
CML_NEW_ERROR( PDO_Error, BitSizeError,  "The specified variable bit size is not supported" );

/***************************************************************************/
/**
Add the passed variable to the end of the variable map associated with this
PDO.
@param var The variable to be added.
@return An error object.
*/
/***************************************************************************/
const Error *PDO::AddVar( Pmap &var )
{
   // Make sure I'm not already full
   if( mapCt == PDO_MAP_LEN )
      return &PDO_Error::MapFull;

   byte bits = var.GetBits();

   // Keep the variable size <= 64 bits
   // NOTE - we no longer make this check.  EtherCAT and CAN-FD
   // both allow the possibility of PDOs longer then 8 bytes.
//   if( bitCt + bits > 64 )
//      return &PDO_Error::BitOverflow;

   // For now, my variables must be a multiple
   // of 8 bits long.
   if( bits & 0x07 )
      return &PDO_Error::BitSizeError;

   // Looks good, map it.
   map[mapCt++] = &var;
   bitCt += bits;
   return 0;
}

/***************************************************************************/
/**
Process data received from the network.  This function is called by the network
object when new data is received for this PDO.  It updates the values of the
variables mapped to the PDO and calls the virtual Received() function.
@param data Pointer to the newly received PDO data.
@param ct Size of the PDO data in bytes.
@param time System time stamp indicating the time of reception
*/
/***************************************************************************/
void TPDO::ProcessData( uint8 *data, int ct, uint32 time )
{
   timestamp = time;
   for( int i=0; i<mapCt; i++ )
   {
      int len = (map[i]->GetBits()>>3);
      if( len > ct ) break;
      map[i]->Set( data );
      data += len;
      ct -= len;
   }

   Received();
}

/***************************************************************************/
/**
Load the data from this PDO into the passed buffer.
@param buff Buffer where data will be loaded
@param max  The maximum number of bytes to load.
@return The actual number of bytes loaded.
*/
/***************************************************************************/
int RPDO::LoadData( uint8 *buff, int max )
{
   int tot = 0;

   // Load the data from the mapping objects
   for( int i=0; i<mapCt; i++ )
   {
      int ct = (map[i]->GetBits()>>3);
      if( ct > max ) break;

      map[i]->Get( &buff[tot] );
      tot += ct;
      max -= ct;
   }

   return tot;
}


text:
require 'spec_helper'

describe 'notify/pipeline_success_email.text.erb' do
  let(:user) { create(:user, developer_projects: [project]) }
  let(:project) { create(:project, :repository) }
  let(:merge_request) { create(:merge_request, :simple, source_project: project) }

  let(:pipeline) do
    create(:ci_pipeline,
           :success,
           project: project,
           user: user,
           ref: project.default_branch,
           sha: project.commit.sha)
  end

  before do
    assign(:project, project)
    assign(:pipeline, pipeline)
    assign(:merge_request, merge_request)
  end

  it_behaves_like 'correct pipeline information for pipelines for merge requests'
end