text:
class HTTPMessage;

// Implements the "Content-Type: multipart/form-data" type of HTTP messages
// or the default "Content-Type: application/x-www-form-urlencoded"

enum class FormDataType
{
  FD_UNKNOWN
 ,FD_URLENCODED
 ,FD_MULTIPART
 ,FD_MIXED
};

// The MultiPartBuffer consists of various MultiPart's
// Normally you should only use the MultiPart on incoming messages
// For outgoing messages normally use the next interface
class MultiPart
{
public:
  MultiPart();
  MultiPart(XString p_name,XString p_contentType);

  // SETTERS
  void    SetName(XString p_name)             { m_name             = p_name;    }
  void    SetData(XString p_data)             { m_data             = p_data;    }
  void    SetContentType(XString p_type)      { m_contentType      = p_type;    }
  void    SetCharset(XString p_charset)       { m_charset          = p_charset; }
  void    SetBoundary(XString p_boundary)     { m_boundary         = p_boundary;}
  void    SetFileName(XString p_file)         { m_shortFilename    = p_file;    }
  void    SetDateCreation(XString p_date)     { m_creationDate     = p_date;    }
  void    SetDateModification(XString p_date) { m_modificationDate = p_date;    }
  void    SetDateRead(XString p_date)         { m_readDate         = p_date;    }
  void    SetSize(size_t p_size)              { m_size             = p_size;    }
  // Setting filename and reading the new access times
  bool    SetFile(XString p_filename);

  // GETTERS
  XString GetName()             { return m_name;              }
  XString GetData()             { return m_data;              }
  XString GetContentType()      { return m_contentType;       }
  XString GetCharset()          { return m_charset;           }
  XString GetBoundary()         { return m_boundary;          }
  XString GetShortFileName()    { return m_shortFilename;     }
  XString GetLongFileName()     { return m_longFilename;      }
  XString GetDateCreation()     { return m_creationDate;      }
  XString GetDateModification() { return m_modificationDate;  }
  XString GetDateRead()         { return m_readDate;          }
  size_t  GetSize()             { return m_size;              }
  FileBuffer* GetBuffer()       { return &m_file;             }

  // Functions
  bool    WriteFile();
  bool    CheckBoundaryExists(XString p_boundary);
  XString CreateHeader(XString p_boundary,bool p_extensions = false);
  void    TrySettingFiletimes();
  void    AddHeader(XString p_header,XString p_value);
  XString GetHeader(XString p_header);
  void    DelHeader(XString p_header);

private:
  XString   FileTimeToString  (PFILETIME p_filetime);
  PFILETIME FileTimeFromString(PFILETIME p_filetime,XString& p_time);

  // Content-Type: field
  XString m_contentType;
  XString m_charset;
  XString m_boundary;
  // Content-disposition: fields
  XString m_name;
  XString m_shortFilename;
  XString m_longFilename;
  XString m_creationDate;
  XString m_modificationDate;
  XString m_readDate;
  // Non file part
  XString m_data;
  // File part
  FileBuffer m_file;        // File contents
  size_t     m_size { 0 };  // Indicative!!
  // Additional headers
  HeaderMap  m_headers;
};

using MultiPartMap = std::vector<MultiPart*>;
using uchar        = unsigned char;

// The MultiPartBuffer implements the RFC 7578 form-data multiparts
// So that you can add a Content-Disposition part in a HTTP message
//
// Normally you only use AddPart/AddFile to create it, and
// you use AddToHTTPMessage before you send one through the HTTPClient

class MultiPartBuffer
{
public:
  MultiPartBuffer(FormDataType p_type);
 ~MultiPartBuffer();

  void         Reset();
  bool         SetFormDataType(FormDataType p_type);
  // Creating a MultiPartBuffer
  MultiPart*   AddPart(XString p_name,XString p_contentType,XString p_data,XString p_charset = "",bool p_conversion = false);
  MultiPart*   AddFile(XString p_name,XString p_contentType,XString p_filename);
  // Delete a designated part
  bool         DeletePart(XString p_name);
  bool         DeletePart(MultiPart* p_part);
  // Getting a part of the MultiPartBuffer
  MultiPart*   GetPart(XString p_name);
  MultiPart*   GetPart(int p_index);
  size_t       GetParts();
  FormDataType GetFormDataType();
  XString      GetContentType();
  XString      GetBoundary();

  // Functions for HTTPMessage
  XString      CalculateBoundary(XString p_special = "#");
  XString      CalculateAcceptHeader();
  bool         SetBoundary(XString p_boundary);
  // Re-create from an existing (incoming!) buffer
  bool         ParseBuffer(XString p_contentType,FileBuffer* p_buffer,bool p_conversion = false);

  // File times & size extensions used in the Content-Disposition header
  // BEWARE: Some servers do not respect the file-times attributes
  //         or will even crash on it (WCF .NET returns HTTP status 500)
  void         SetFileExtensions(bool p_extens)    { m_extensions = p_extens; };
  bool         GetFileExtensions()                 { return m_extensions;     };
  // Use "charset" attribute in a non file buffer part
  // BEWARE: Some servers do not respect the "charset" attribute in the Content-Type
  //         or will even crash on it (WCF .NET returns HTTP status 500 on the NEXT buffer part
  void         SetUseCharset(bool p_useCharset)    { m_useCharset = p_useCharset; };
  bool         GetUseCharset()                     { return m_useCharset;         };

private:
  // Find which type of formdata we are receiving
  FormDataType FindBufferType(XString p_contentType);
  // Find the boundary in the content-type header
  XString      FindBoundaryInContentType(XString p_contentType);
  // Parsing different types
  bool         ParseBufferFormData(XString p_contentType,FileBuffer* p_buffer,bool p_conversion);
  bool         ParseBufferUrlEncoded(FileBuffer* p_buffer);
  // Finding a new partial message
  void*        FindPartBuffer(uchar*& p_vinding,size_t& p_remaining,XString& p_boundary);
  XString      GetLineFromBuffer(uchar*& p_begin,uchar* p_end);
  bool         GetHeaderFromLine(XString& p_line,XString& p_header,XString& p_value);
  XString      GetAttributeFromLine(XString& p_line,XString p_name);
  // Adding a part from a raw buffer
  void         AddRawBufferPart(uchar* p_partialBegin,uchar* p_partialEnd,bool p_conversion);
  // Check that name is in the ASCII range for a data part
  bool         CheckName(XString p_name);

  FormDataType m_type;                  // URL-encoded or form-data
  XString      m_boundary;              // Form-Data boundary string
  XString      m_incomingCharset;       // Character set from "_charset_" part
  MultiPartMap m_parts;                 // All parts
  bool         m_extensions { false };  // Show file times & size in the header
  bool         m_useCharset { false };  // Use 'charset' in the 'Content-Type' header
};

inline size_t
MultiPartBuffer::GetParts()
{
  return m_parts.size();
};

inline FormDataType
MultiPartBuffer::GetFormDataType()
{
  return m_type;
}


text:
'use strict';

var mergeSort = require('./merge-sort'),
    assert = require('assert');

describe('Merge Sort', function () {

    describe('when sorting an empty array', function () {

        it('should return empty array', function () {
            var input = [];
            mergeSort.sort(input);
            assert.deepEqual(input, []);
        });

    });

    describe('when sorting an array of one element', function () {

        it('should return the same array', function () {
            var input = [1];
            mergeSort.sort(input);
            assert.deepEqual(input, [1]);
        });

    });

    describe('when sorting an array of two elements', function () {

        it('should return the sorted array', function () {
            var input = [2,1];
            mergeSort.sort(input);
            assert.deepEqual(input, [1,2]);
        });

    });

    describe('when sorting an array or random numbers', function () {

        it('should return and fully sorted array', function () {
            var input = [7,12,54,6,7,3,2,1];
            mergeSort.sort(input);
            assert.deepEqual(input, [1,2,3,6,7,7,12,54]);
        });

    });

    describe('when sorting an array or letters', function () {

        it('should return and fully sorted array', function () {
            var input = ['m','e','r','g','e','s','o','r','t','e','x','a','m','p','l','e'];
            mergeSort.sort(input);
            assert.deepEqual(input, ['a','e','e','e','e','g','l','m','m','o','p','r','r','s','t','x']);
        });

    });
});

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace NilPortugues\Tests\SchemaOrg\Classes;

use NilPortugues\SchemaOrg\Classes\TherapeuticProcedure;
use NilPortugues\SchemaOrg\Mapping;

/**
 * Classes TherapeuticProcedureTest
 * @package NilPortugues\Tests\SchemaOrg\Classes
 */
class TherapeuticProcedureTest extends \PHPUnit_Framework_TestCase
{
    public function testSchemaUrlReturnsExpectedUrl()
    {
        $this->assertEquals(TherapeuticProcedure::schemaUrl(), "http://schema.org/TherapeuticProcedure");
    }

    public function testAdditionalTypeWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::additionalType());
    }

    public function testAdverseOutcomeWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::adverseOutcome());
    }

    public function testAlternateNameWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::alternateName());
    }

    public function testCodeWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::code());
    }

    public function testContraindicationWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::contraindication());
    }

    public function testDescriptionWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::description());
    }

    public function testDuplicateTherapyWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::duplicateTherapy());
    }

    public function testFollowupWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::followup());
    }

    public function testGuidelineWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::guideline());
    }

    public function testHowPerformedWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::howPerformed());
    }

    public function testImageWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::image());
    }

    public function testIndicationWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::indication());
    }

    public function testMainEntityOfPageWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::mainEntityOfPage());
    }

    public function testMedicineSystemWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::medicineSystem());
    }

    public function testNameWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::name());
    }

    public function testPotentialActionWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::potentialAction());
    }

    public function testPreparationWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::preparation());
    }

    public function testProcedureTypeWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::procedureType());
    }

    public function testRecognizingAuthorityWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::recognizingAuthority());
    }

    public function testRelevantSpecialtyWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::relevantSpecialty());
    }

    public function testSameAsWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::sameAs());
    }

    public function testSeriousAdverseOutcomeWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::seriousAdverseOutcome());
    }

    public function testStudyWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::study());
    }

    public function testUrlWillReturnMappingObject()
    {
        $this->assertInstanceOf(Mapping::class, TherapeuticProcedure::url());
    }
}


text:
package io.ray.runtime.metric;

import com.google.common.base.Preconditions;
import java.util.Map;
import java.util.stream.Collectors;

/** Gauge measurement is mapped to gauge object in stats and is recording the last value. */
public class Gauge extends Metric {

  @Deprecated
  public Gauge(String name, String description, String unit, Map<TagKey, String> tags) {
    super(name, tags);
    metricNativePointer =
        NativeMetric.registerGaugeNative(
            name,
            description,
            unit,
            tags.keySet().stream().map(TagKey::getTagKey).collect(Collectors.toList()));
    Preconditions.checkState(metricNativePointer != 0, "Gauge native pointer must not be 0.");
  }

  public Gauge(String name, String description, Map<String, String> tags) {
    this(name, description, "", TagKey.tagsFromMap(tags));
  }

  public double getValue() {
    return value.doubleValue();
  }

  @Override
  protected double getAndReset() {
    return value.doubleValue();
  }

  @Override
  public void update(double value) {
    this.value.set(value);
  }
}


text:
using System;

namespace BundleTransformer.NUglify
{
	/// <summary>
	/// The exception that is thrown when a parsing of asset code by NUglify Minifier is failed
	/// </summary>
	internal sealed class NUglifyParsingException : Exception
	{
		/// <summary>
		/// Initializes a new instance of the BundleTransformer.NUglify.NUglifyParsingException class
		/// with a specified error message
		/// </summary>
		/// <param name="message">The message that describes the error</param>
		public NUglifyParsingException(string message)
			: base(message)
		{ }

		/// <summary>
		/// Initializes a new instance of the BundleTransformer.NUglify.NUglifyParsingException class
		/// with a specified error message and a reference to the inner exception that is the cause of this exception
		/// </summary>
		/// <param name="message">The error message that explains the reason for the exception</param>
		/// <param name="innerException">The exception that is the cause of the current exception</param>
		public NUglifyParsingException(string message, Exception innerException)
			: base(message, innerException)
		{ }
	}
}


text:
promote_lost_carry/datawidth.cpp
promote_lost_carry/stimgen.cpp
promote_lost_carry/main.cpp


text:
(function(factory) {
  if (typeof require === 'function' && typeof module !== 'undefined') {
    require('chai').use(require('chai-spies'));
    factory(require('chai'), this);
  } else if (typeof window === 'object') {
    window.global = window;
    factory(window.chai, window);
  }
})(function(chai, global) {
  global.expect = chai.expect;
  global.spy = chai.spy;

  if (global.beforeAll) {
    global.before = global.beforeAll;
  }

  if (global.afterAll) {
    global.after = global.afterAll;
  }
});


text:
package org.drools.benchmarks.model;

import java.util.Currency;
import java.util.Date;

public class Transaction {
    public enum Status {
        PENDING, DONE
    }

    private Account accountFrom;
    private Account accountTo;
    private Status status;
    private double amount;
    private String description;
    private Currency currency;
    private Date date;
    private String uuid;

    public Transaction() {}

    public Transaction(String uuid) {
        this.uuid = uuid;
    }

    public Account getAccountFrom() {
        return accountFrom;
    }

    public void setAccountFrom(Account accountFrom) {
        this.accountFrom = accountFrom;
    }

    public Account getAccountTo() {
        return accountTo;
    }

    public void setAccountTo(Account accountTo) {
        this.accountTo = accountTo;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setCurrency(Currency currency) {
        this.currency = currency;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Override
    public String toString() {
        return "Transaction [accountFrom=" + accountFrom + ", accountTo=" + accountTo + ", status=" + status +
                ", amount=" + amount + ", description=" + description + ", currency=" + currency + ", date=" +
                date + ", uuid=" + uuid + "]";
    }
}


text:
Fabricator(:uuid_article) do
  title { Forgery::LoremIpsum.word }
  body { Forgery::LoremIpsum.sentence }
end


text:
include(CMakeParseArguments)

set(ABSL_INTERNAL_DLL_FILES
  "algorithm/algorithm.h"
  "algorithm/container.h"
  "base/attributes.h"
  "base/call_once.h"
  "base/casts.h"
  "base/config.h"
  "base/const_init.h"
  "base/dynamic_annotations.cc"
  "base/dynamic_annotations.h"
  "base/internal/atomic_hook.h"
  "base/internal/bits.h"
  "base/internal/cycleclock.cc"
  "base/internal/cycleclock.h"
  "base/internal/direct_mmap.h"
  "base/internal/endian.h"
  "base/internal/errno_saver.h"
  "base/internal/exponential_biased.cc"
  "base/internal/exponential_biased.h"
  "base/internal/fast_type_id.h"
  "base/internal/hide_ptr.h"
  "base/internal/identity.h"
  "base/internal/invoke.h"
  "base/internal/inline_variable.h"
  "base/internal/low_level_alloc.cc"
  "base/internal/low_level_alloc.h"
  "base/internal/low_level_scheduling.h"
  "base/internal/per_thread_tls.h"
  "base/internal/periodic_sampler.cc"
  "base/internal/periodic_sampler.h"
  "base/internal/pretty_function.h"
  "base/internal/raw_logging.cc"
  "base/internal/raw_logging.h"
  "base/internal/scheduling_mode.h"
  "base/internal/scoped_set_env.cc"
  "base/internal/scoped_set_env.h"
  "base/internal/strerror.h"
  "base/internal/strerror.cc"
  "base/internal/spinlock.cc"
  "base/internal/spinlock.h"
  "base/internal/spinlock_wait.cc"
  "base/internal/spinlock_wait.h"
  "base/internal/sysinfo.cc"
  "base/internal/sysinfo.h"
  "base/internal/thread_annotations.h"
  "base/internal/thread_identity.cc"
  "base/internal/thread_identity.h"
  "base/internal/throw_delegate.cc"
  "base/internal/throw_delegate.h"
  "base/internal/tsan_mutex_interface.h"
  "base/internal/unaligned_access.h"
  "base/internal/unscaledcycleclock.cc"
  "base/internal/unscaledcycleclock.h"
  "base/log_severity.cc"
  "base/log_severity.h"
  "base/macros.h"
  "base/optimization.h"
  "base/options.h"
  "base/policy_checks.h"
  "base/port.h"
  "base/thread_annotations.h"
  "container/btree_map.h"
  "container/btree_set.h"
  "container/fixed_array.h"
  "container/flat_hash_map.h"
  "container/flat_hash_set.h"
  "container/inlined_vector.h"
  "container/internal/btree.h"
  "container/internal/btree_container.h"
  "container/internal/common.h"
  "container/internal/compressed_tuple.h"
  "container/internal/container_memory.h"
  "container/internal/counting_allocator.h"
  "container/internal/hash_function_defaults.h"
  "container/internal/hash_policy_traits.h"
  "container/internal/hashtable_debug.h"
  "container/internal/hashtable_debug_hooks.h"
  "container/internal/hashtablez_sampler.cc"
  "container/internal/hashtablez_sampler.h"
  "container/internal/hashtablez_sampler_force_weak_definition.cc"
  "container/internal/have_sse.h"
  "container/internal/inlined_vector.h"
  "container/internal/layout.h"
  "container/internal/node_hash_policy.h"
  "container/internal/raw_hash_map.h"
  "container/internal/raw_hash_set.cc"
  "container/internal/raw_hash_set.h"
  "container/internal/tracked.h"
  "container/node_hash_map.h"
  "container/node_hash_set.h"
  "debugging/failure_signal_handler.cc"
  "debugging/failure_signal_handler.h"
  "debugging/leak_check.h"
  "debugging/leak_check_disable.cc"
  "debugging/stacktrace.cc"
  "debugging/stacktrace.h"
  "debugging/symbolize.cc"
  "debugging/symbolize.h"
  "debugging/internal/address_is_readable.cc"
  "debugging/internal/address_is_readable.h"
  "debugging/internal/demangle.cc"
  "debugging/internal/demangle.h"
  "debugging/internal/elf_mem_image.cc"
  "debugging/internal/elf_mem_image.h"
  "debugging/internal/examine_stack.cc"
  "debugging/internal/examine_stack.h"
  "debugging/internal/stack_consumption.cc"
  "debugging/internal/stack_consumption.h"
  "debugging/internal/stacktrace_config.h"
  "debugging/internal/symbolize.h"
  "debugging/internal/vdso_support.cc"
  "debugging/internal/vdso_support.h"
  "functional/internal/front_binder.h"
  "functional/bind_front.h"
  "functional/function_ref.h"
  "functional/internal/function_ref.h"
  "hash/hash.h"
  "hash/internal/city.h"
  "hash/internal/city.cc"
  "hash/internal/hash.h"
  "hash/internal/hash.cc"
  "hash/internal/spy_hash_state.h"
  "memory/memory.h"
  "meta/type_traits.h"
  "numeric/int128.cc"
  "numeric/int128.h"
  "random/bernoulli_distribution.h"
  "random/beta_distribution.h"
  "random/bit_gen_ref.h"
  "random/discrete_distribution.cc"
  "random/discrete_distribution.h"
  "random/distributions.h"
  "random/exponential_distribution.h"
  "random/gaussian_distribution.cc"
  "random/gaussian_distribution.h"
  "random/internal/distributions.h"
  "random/internal/distribution_caller.h"
  "random/internal/fast_uniform_bits.h"
  "random/internal/fastmath.h"
  "random/internal/gaussian_distribution_gentables.cc"
  "random/internal/generate_real.h"
  "random/internal/iostream_state_saver.h"
  "random/internal/nonsecure_base.h"
  "random/internal/pcg_engine.h"
  "random/internal/platform.h"
  "random/internal/pool_urbg.cc"
  "random/internal/pool_urbg.h"
  "random/internal/randen.cc"
  "random/internal/randen.h"
  "random/internal/randen_detect.cc"
  "random/internal/randen_detect.h"
  "random/internal/randen_engine.h"
  "random/internal/randen_hwaes.cc"
  "random/internal/randen_hwaes.h"
  "random/internal/randen_slow.cc"
  "random/internal/randen_slow.h"
  "random/internal/randen_traits.h"
  "random/internal/salted_seed_seq.h"
  "random/internal/seed_material.cc"
  "random/internal/seed_material.h"
  "random/internal/sequence_urbg.h"
  "random/internal/traits.h"
  "random/internal/uniform_helper.h"
  "random/internal/wide_multiply.h"
  "random/log_uniform_int_distribution.h"
  "random/poisson_distribution.h"
  "random/random.h"
  "random/seed_gen_exception.cc"
  "random/seed_gen_exception.h"
  "random/seed_sequences.cc"
  "random/seed_sequences.h"
  "random/uniform_int_distribution.h"
  "random/uniform_real_distribution.h"
  "random/zipf_distribution.h"
  "status/status.h"
  "status/status.cc"
  "status/status_payload_printer.h"
  "status/status_payload_printer.cc"
  "strings/ascii.cc"
  "strings/ascii.h"
  "strings/charconv.cc"
  "strings/charconv.h"
  "strings/cord.cc"
  "strings/cord.h"
  "strings/escaping.cc"
  "strings/escaping.h"
  "strings/internal/cord_internal.h"
  "strings/internal/charconv_bigint.cc"
  "strings/internal/charconv_bigint.h"
  "strings/internal/charconv_parse.cc"
  "strings/internal/charconv_parse.h"
  "strings/internal/stl_type_traits.h"
  "strings/match.cc"
  "strings/match.h"
  "strings/numbers.cc"
  "strings/numbers.h"
  "strings/str_format.h"
  "strings/str_cat.cc"
  "strings/str_cat.h"
  "strings/str_join.h"
  "strings/str_replace.cc"
  "strings/str_replace.h"
  "strings/str_split.cc"
  "strings/str_split.h"
  "strings/string_view.cc"
  "strings/string_view.h"
  "strings/strip.h"
  "strings/substitute.cc"
  "strings/substitute.h"
  "strings/internal/char_map.h"
  "strings/internal/escaping.h"
  "strings/internal/escaping.cc"
  "strings/internal/memutil.cc"
  "strings/internal/memutil.h"
  "strings/internal/ostringstream.cc"
  "strings/internal/ostringstream.h"
  "strings/internal/pow10_helper.cc"
  "strings/internal/pow10_helper.h"
  "strings/internal/resize_uninitialized.h"
  "strings/internal/str_format/arg.cc"
  "strings/internal/str_format/arg.h"
  "strings/internal/str_format/bind.cc"
  "strings/internal/str_format/bind.h"
  "strings/internal/str_format/checker.h"
  "strings/internal/str_format/extension.cc"
  "strings/internal/str_format/extension.h"
  "strings/internal/str_format/float_conversion.cc"
  "strings/internal/str_format/float_conversion.h"
  "strings/internal/str_format/output.cc"
  "strings/internal/str_format/output.h"
  "strings/internal/str_format/parser.cc"
  "strings/internal/str_format/parser.h"
  "strings/internal/str_join_internal.h"
  "strings/internal/str_split_internal.h"
  "strings/internal/utf8.cc"
  "strings/internal/utf8.h"
  "synchronization/barrier.cc"
  "synchronization/barrier.h"
  "synchronization/blocking_counter.cc"
  "synchronization/blocking_counter.h"
  "synchronization/mutex.cc"
  "synchronization/mutex.h"
  "synchronization/notification.cc"
  "synchronization/notification.h"
  "synchronization/internal/create_thread_identity.cc"
  "synchronization/internal/create_thread_identity.h"
  "synchronization/internal/graphcycles.cc"
  "synchronization/internal/graphcycles.h"
  "synchronization/internal/kernel_timeout.h"
  "synchronization/internal/per_thread_sem.cc"
  "synchronization/internal/per_thread_sem.h"
  "synchronization/internal/thread_pool.h"
  "synchronization/internal/waiter.cc"
  "synchronization/internal/waiter.h"
  "time/civil_time.cc"
  "time/civil_time.h"
  "time/clock.cc"
  "time/clock.h"
  "time/duration.cc"
  "time/format.cc"
  "time/time.cc"
  "time/time.h"
  "time/internal/cctz/include/cctz/civil_time.h"
  "time/internal/cctz/include/cctz/civil_time_detail.h"
  "time/internal/cctz/include/cctz/time_zone.h"
  "time/internal/cctz/include/cctz/zone_info_source.h"
  "time/internal/cctz/src/civil_time_detail.cc"
  "time/internal/cctz/src/time_zone_fixed.cc"
  "time/internal/cctz/src/time_zone_fixed.h"
  "time/internal/cctz/src/time_zone_format.cc"
  "time/internal/cctz/src/time_zone_if.cc"
  "time/internal/cctz/src/time_zone_if.h"
  "time/internal/cctz/src/time_zone_impl.cc"
  "time/internal/cctz/src/time_zone_impl.h"
  "time/internal/cctz/src/time_zone_info.cc"
  "time/internal/cctz/src/time_zone_info.h"
  "time/internal/cctz/src/time_zone_libc.cc"
  "time/internal/cctz/src/time_zone_libc.h"
  "time/internal/cctz/src/time_zone_lookup.cc"
  "time/internal/cctz/src/time_zone_posix.cc"
  "time/internal/cctz/src/time_zone_posix.h"
  "time/internal/cctz/src/tzfile.h"
  "time/internal/cctz/src/zone_info_source.cc"
  "types/any.h"
  "types/bad_any_cast.cc"
  "types/bad_any_cast.h"
  "types/bad_optional_access.cc"
  "types/bad_optional_access.h"
  "types/bad_variant_access.cc"
  "types/bad_variant_access.h"
  "types/compare.h"
  "types/internal/conformance_aliases.h"
  "types/internal/conformance_archetype.h"
  "types/internal/conformance_profile.h"
  "types/internal/parentheses.h"
  "types/internal/transform_args.h"
  "types/internal/variant.h"
  "types/optional.h"
  "types/internal/optional.h"
  "types/span.h"
  "types/internal/span.h"
  "types/variant.h"
  "utility/utility.h"
)

set(ABSL_INTERNAL_DLL_TARGETS
  "stacktrace"
  "symbolize"
  "examine_stack"
  "failure_signal_handler"
  "debugging_internal"
  "demangle_internal"
  "leak_check"
  "leak_check_disable"
  "stack_consumption"
  "debugging"
  "hash"
  "spy_hash_state"
  "city"
  "memory"
  "strings"
  "strings_internal"
  "cord"
  "str_format"
  "str_format_internal"
  "pow10_helper"
  "int128"
  "numeric"
  "utility"
  "any"
  "bad_any_cast"
  "bad_any_cast_impl"
  "span"
  "optional"
  "bad_optional_access"
  "bad_variant_access"
  "variant"
  "compare"
  "algorithm"
  "algorithm_container"
  "graphcycles_internal"
  "kernel_timeout_internal"
  "synchronization"
  "thread_pool"
  "bind_front"
  "function_ref"
  "atomic_hook"
  "log_severity"
  "raw_logging_internal"
  "spinlock_wait"
  "config"
  "dynamic_annotations"
  "core_headers"
  "malloc_internal"
  "base_internal"
  "base"
  "throw_delegate"
  "pretty_function"
  "endian"
  "bits"
  "exponential_biased"
  "periodic_sampler"
  "scoped_set_env"
  "type_traits"
  "meta"
  "random_random"
  "random_bit_gen_ref"
  "random_distributions"
  "random_seed_gen_exception"
  "random_seed_sequences"
  "random_internal_traits"
  "random_internal_distribution_caller"
  "random_internal_distributions"
  "random_internal_fast_uniform_bits"
  "random_internal_seed_material"
  "random_internal_pool_urbg"
  "random_internal_explicit_seed_seq"
  "random_internal_sequence_urbg"
  "random_internal_salted_seed_seq"
  "random_internal_iostream_state_saver"
  "random_internal_generate_real"
  "random_internal_wide_multiply"
  "random_internal_fastmath"
  "random_internal_nonsecure_base"
  "random_internal_pcg_engine"
  "random_internal_randen_engine"
  "random_internal_platform"
  "random_internal_randen"
  "random_internal_randen_slow"
  "random_internal_randen_hwaes"
  "random_internal_randen_hwaes_impl"
  "random_internal_uniform_helper"
  "status"
  "time"
  "civil_time"
  "time_zone"
  "container"
  "btree"
  "compressed_tuple"
  "fixed_array"
  "inlined_vector_internal"
  "inlined_vector"
  "counting_allocator"
  "flat_hash_map"
  "flat_hash_set"
  "node_hash_map"
  "node_hash_set"
  "container_memory"
  "hash_function_defaults"
  "hash_policy_traits"
  "hashtablez_sampler"
  "hashtable_debug"
  "hashtable_debug_hooks"
  "have_sse"
  "node_hash_policy"
  "raw_hash_map"
  "container_common"
  "raw_hash_set"
  "layout"
  "tracked"
)

function(absl_internal_dll_contains)
  cmake_parse_arguments(ABSL_INTERNAL_DLL
    ""
    "OUTPUT;TARGET"
    ""
    ${ARGN}
  )

  STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET})

  list(FIND
    ABSL_INTERNAL_DLL_TARGETS
    "${_target}"
    _index)

  if (${_index} GREATER -1)
    set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE)
  else()
    set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE)
  endif()
endfunction()

function(absl_internal_dll_targets)
  cmake_parse_arguments(ABSL_INTERNAL_DLL
  ""
  "OUTPUT"
  "DEPS"
  ${ARGN}
  )

  set(_deps "")
  foreach(dep IN LISTS ABSL_INTERNAL_DLL_DEPS)
    absl_internal_dll_contains(TARGET ${dep} OUTPUT _contains)
    if (_contains)
      list(APPEND _deps abseil_dll)
    else()
      list(APPEND _deps ${dep})
    endif()
  endforeach()

  # Because we may have added the DLL multiple times
  list(REMOVE_DUPLICATES _deps)
  set(${ABSL_INTERNAL_DLL_OUTPUT} "${_deps}" PARENT_SCOPE)
endfunction()

function(absl_make_dll)
  add_library(
    abseil_dll
    SHARED
      "${ABSL_INTERNAL_DLL_FILES}"
  )
  target_link_libraries(
    abseil_dll
    PRIVATE
      ${ABSL_DEFAULT_LINKOPTS}
  )
  set_property(TARGET abseil_dll PROPERTY LINKER_LANGUAGE "CXX")
  target_include_directories(
    abseil_dll
    PUBLIC
      "$<BUILD_INTERFACE:${ABSL_COMMON_INCLUDE_DIRS}>"
      $<INSTALL_INTERFACE:${ABSL_INSTALL_INCLUDEDIR}>
  )

  target_compile_options(
    abseil_dll
    PRIVATE
      ${ABSL_DEFAULT_COPTS}
  )

  target_compile_definitions(
    abseil_dll
    PRIVATE
      ABSL_BUILD_DLL
      NOMINMAX
    INTERFACE
      ${ABSL_CC_LIB_DEFINES}
  )
  install(TARGETS abseil_dll EXPORT ${PROJECT_NAME}Targets
        RUNTIME DESTINATION ${ABSL_INSTALL_BINDIR}
        LIBRARY DESTINATION ${ABSL_INSTALL_LIBDIR}
        ARCHIVE DESTINATION ${ABSL_INSTALL_LIBDIR}
  )
endfunction()


text:
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

/**
 * @fileoverview Provides the AsyncSliceGroup class.
 */
base.require('base.range');
base.require('tracing.trace_model.async_slice');

base.exportTo('tracing.trace_model', function() {
  /**
   * A group of AsyncSlices.
   * @constructor
   */
  function AsyncSliceGroup() {
    this.slices = [];
    this.bounds = new base.Range();
  }

  AsyncSliceGroup.prototype = {
    __proto__: Object.prototype,

    /**
     * Helper function that pushes the provided slice onto the slices array.
     */
    push: function(slice) {
      this.slices.push(slice);
    },

    /**
     * @return {Number} The number of slices in this group.
     */
    get length() {
      return this.slices.length;
    },

    /**
     * Shifts all the timestamps inside this group forward by the amount
     * specified.
     */
    shiftTimestampsForward: function(amount) {
      for (var sI = 0; sI < this.slices.length; sI++) {
        var slice = this.slices[sI];
        slice.start = (slice.start + amount);
        for (var sJ = 0; sJ < slice.subSlices.length; sJ++)
          slice.subSlices[sJ].start += amount;
      }
    },

    /**
     * Updates the bounds for this group based on the slices it contains.
     */
    updateBounds: function() {
      this.bounds.reset();
      for (var i = 0; i < this.slices.length; i++) {
        this.bounds.addValue(this.slices[i].start);
        this.bounds.addValue(this.slices[i].end);
      }
    },

    /**
     * Breaks up this group into slices based on start thread.
     *
     * @return {Array} An array of AsyncSliceGroups where each group has
     * slices that started on the same thread.
     */
    computeSubGroups: function() {
      var subGroupsByGUID = {};
      for (var i = 0; i < this.slices.length; ++i) {
        var slice = this.slices[i];
        var sliceGUID = slice.startThread.guid;
        if (!subGroupsByGUID[sliceGUID])
          subGroupsByGUID[sliceGUID] = new AsyncSliceGroup();
        subGroupsByGUID[sliceGUID].slices.push(slice);
      }
      var groups = [];
      for (var guid in subGroupsByGUID) {
        var group = subGroupsByGUID[guid];
        group.updateBounds();
        groups.push(group);
      }
      return groups;
    }
  };

  return {
    AsyncSliceGroup: AsyncSliceGroup
  };
});


text:
fys::utils::TokenGenerator *fys::utils::TokenGenerator::instance = nullptr;

const std::string fys::utils::TokenGenerator::generate() const {
    return boost::lexical_cast<std::string>((const_cast<TokenGenerator *>(this))->_generator());
}

const std::vector<char> fys::utils::TokenGenerator::generateByte() {
    boost::uuids::uuid u = _generator();
    std::vector<char> v(u.size());
    std::copy(u.begin(), u.end(), v.begin());
    return v;
}


text:
@interface UIImage (DLExtension)

-(UIImage*)safeResizableImageWithCapInsets:(UIEdgeInsets)capInsets;

@end


text:
@interface BSUser ()<YYModel>

@end

@implementation BSUser

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper
{
    return @{
             @"profileImage" : @"profile_image"
             };
}

@end


text:
package org.apache.druid.segment.column;

import org.junit.Assert;
import org.junit.Test;

public class ColumnCapabilitiesTest
{
  @Test
  public void testCapableAnd()
  {
    Assert.assertTrue(ColumnCapabilities.Capable.TRUE.and(ColumnCapabilities.Capable.TRUE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.TRUE.and(ColumnCapabilities.Capable.FALSE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.TRUE.and(ColumnCapabilities.Capable.UNKNOWN).isTrue());

    Assert.assertFalse(ColumnCapabilities.Capable.FALSE.and(ColumnCapabilities.Capable.TRUE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.FALSE.and(ColumnCapabilities.Capable.FALSE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.FALSE.and(ColumnCapabilities.Capable.UNKNOWN).isTrue());

    Assert.assertFalse(ColumnCapabilities.Capable.UNKNOWN.and(ColumnCapabilities.Capable.TRUE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.UNKNOWN.and(ColumnCapabilities.Capable.FALSE).isTrue());
    Assert.assertFalse(ColumnCapabilities.Capable.UNKNOWN.and(ColumnCapabilities.Capable.UNKNOWN).isTrue());
  }

  @Test
  public void testCapableOfBoolean()
  {
    Assert.assertEquals(ColumnCapabilities.Capable.TRUE, ColumnCapabilities.Capable.of(true));
    Assert.assertEquals(ColumnCapabilities.Capable.FALSE, ColumnCapabilities.Capable.of(false));
  }
}


text:
import * as React from "react";
import { Cell, Icon } from "@dcos/ui-kit";
import { SystemIcons } from "@dcos/ui-kit/dist/packages/icons/dist/system-icons-enum";
import {
  greyDark,
  iconSizeXs,
} from "@dcos/ui-kit/dist/packages/design-tokens/build/js/designTokens";

import { ServiceGroup } from "#PLUGINS/services/src/js/types/ServiceGroup";

export function actionsRenderer(_group: ServiceGroup) {
  return (
    <Cell>
      <span className="icon-margin-right">
        <Icon
          color={greyDark}
          shape={SystemIcons.EllipsisVertical}
          size={iconSizeXs}
        />
      </span>
    </Cell>
  );
}


text:
package net.kleinhaneveld.fn.enumerable;

import net.kleinhaneveld.fn.Enumerable;
import net.kleinhaneveld.fn.Enumeration;
import net.kleinhaneveld.fn.enumerations.UniqueEnumeration;

import javax.annotation.Nonnull;

public class UniqueEnumerable<T> implements Enumerable<T> {
    private final Enumerable<T> stream;

    public UniqueEnumerable(Enumerable<T> stream) {
        this.stream = stream;
    }

    @Nonnull
    @Override
    public Enumeration<T> enumerate() {
        return new UniqueEnumeration<>(stream.enumerate());
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Monogr. Discom. Bohem. (Prague) 404 (1934)

#### Original name
Belonidium caricincola var. holci Velen.

### Remarks
null


text:
package commands

import (
	"bytes"
	"fmt"
	"os"
	"strings"

	"github.com/Sirupsen/logrus"
	"github.com/moul/anonuuid"
	"github.com/scaleway/scaleway-cli/pkg/api"
	"github.com/scaleway/scaleway-cli/pkg/config"
	"github.com/scaleway/scaleway-cli/pkg/scwversion"
)

func shouldBeAnUUID(actual interface{}, expected ...interface{}) string {
	input := actual.(string)
	input = strings.TrimSpace(input)
	if err := anonuuid.IsUUID(input); err != nil {
		return fmt.Sprintf("%q should be an UUID", actual)
	}
	return ""
}

func getScopedCtx(sessionCtx *CommandContext) (*CommandContext, *bytes.Buffer, *bytes.Buffer) {
	stdout := bytes.Buffer{}
	stderr := bytes.Buffer{}

	var newCtx CommandContext
	newCtx = *sessionCtx
	newCtx.Stdout = &stdout
	newCtx.Stderr = &stderr

	return &newCtx, &stdout, &stderr
}

// RealAPIContext returns a CommandContext with a configured API
func RealAPIContext() *CommandContext {
	if os.Getenv("TEST_WITH_REAL_API") == "0" {
		return nil
	}
	config, err := config.GetConfig()
	if err != nil {
		logrus.Warnf("RealAPIContext: failed to call config.GetConfig(): %v", err)
		return nil
	}

	apiClient, err := api.NewScalewayAPI(config.Organization, config.Token, scwversion.UserAgent(), "par1")
	if err != nil {
		logrus.Warnf("RealAPIContext: failed to call api.NewScalewayAPI(): %v", err)
		return nil
	}

	stdout := bytes.Buffer{}
	stderr := bytes.Buffer{}

	ctx := CommandContext{
		Streams: Streams{
			Stdin:  os.Stdin,
			Stdout: &stdout,
			Stderr: &stderr,
		},
		Env: []string{
			"HOME" + os.Getenv("HOME"),
		},
		RawArgs: []string{},
		API:     apiClient,
	}
	return &ctx
}


text:
"cassandra" is a storage backend to the following services
* [zipkin-collector-service](https://github.com/openzipkin/zipkin/blob/master/zipkin-collector-service/README.md)
* [zipkin-query-service](https://github.com/openzipkin/zipkin/blob/master/zipkin-query-service/README.md)

These services apply configuration through environment variables:

   * `CASSANDRA_ENSURE_SCHEMA`: Ensuring that schema exists, if enabled tries to execute script /zipkin-cassandra-core/resources/cassandra-schema-cql3.txt
   * `CASSANDRA_USERNAME` and `CASSANDRA_PASSWORD`: Cassandra authentication. Will throw an exception on startup if authentication fails
   * `CASSANDRA_CONTACT_POINTS`: Comma separated list of hosts / ip addresses part of Cassandra cluster
   * `COLLECTOR_SAMPLE_RATE`: Sample rate. Double value between 0.0 (nothing ends up in back-end store) and 1.0 (everything ends up in back-end store)
   * `COLLECTOR_QUEUE_NUM_WORKERS`: Number of worker threads that pick spans from internal bounded queue and write to back-end store
   * `COLLECTOR_QUEUE_MAX_SIZE`: Internal queue size. If queue runs full offered spans are dropped.
   * `COLLECTOR_PORT`: Collector port
   * `COLLECTOR_ADMIN_PORT`: Collector admin port. Port for admin http service. Admin service provides operational metrics for zipkin-collector-service.
   * `COLLECTOR_LOG_LEVEL`: Collector log level. Valid values: OFF, FATAL, CRITICAL, ERROR, WARNING, INFO, DEBUG, TRACE, ALL

For default values see:
* [zipkin-collector-service/config/collector-cassandra.scala](https://github.com/openzipkin/zipkin/blob/master/zipkin-collector-service/config/collector-cassandra.scala).
* [zipkin-query-service/config/query-cassandra.scala](https://github.com/openzipkin/zipkin/blob/master/zipkin-query-service/config/query-cassandra.scala).

Example usage:

```bash
$ CASSANDRA_USERNAME=user CASSANDRA_PASSWORD=pass QUERY_LOG_LEVEL=ERROR ./bin/query cassandra
```


text:
In the paper, we performed a dataset ablation using a subset of the YFCC100M dataset and showed that the performance remained largely similar.

The subset contains 14,829,396 images, about 15% of the full dataset, which have been filtered to only keep those with natural languag titles and/or descriptions in English.

We provide the list of (line number, photo identifier, photo hash) of each image contained in this subset. These correspond to the first three columns in the dataset's metadata TSV file.

```bash
wget https://openaipublic.azureedge.net/clip/data/yfcc100m_subset_data.tsv.bz2
bunzip2 yfcc100m_subset_data.tsv.bz2
```

Use of the underlying media files is subject to the Creative Commons licenses chosen by their creators/uploaders. For more information about the YFCC100M dataset, visit [the official website](https://multimediacommons.wordpress.com/yfcc100m-core-dataset/).


text:
! { dg-do run }
! From PR 33881
  call create_watch_ss(" ")
contains
  subroutine create_watch_actual(name)
    character(len=1) :: name(1)
  end subroutine create_watch_actual

  subroutine create_watch_ss(name,clock)
    character(len=*) :: name
    integer, optional :: clock
    if (present(clock)) then
      call create_watch_actual((/name/))
    else
      call create_watch_actual((/name/))
    end if
  end subroutine create_watch_ss
end


text:
import {connect} from 'react-redux';
import {submitResource} from '../modules/MyResourceActions';
import {getConfigsForResource, submitConfig, validateConfig, runConfig, updateConfig} from 'store/configs';
import {getAnalyticsForResource} from 'store/analytics';
import {getVisibleConfigs} from 'selectors/configsSelector';
import _ from 'lodash';
/*  This is a container component. Notice it does not contain any JSX,
    nor does it import React. This component is **only** responsible for
    wiring in the actions and state necessary to render a presentational
    component - in this case, the counter:   */

import MyResource from '../components/MyResource';

/*  Object of action creators (can also be function that returns object).
    Keys will be passed as props to presentational components. Here we are
    implementing our wrapper around increment; the component doesn't care   */

const mapDispatchToProps = {
  submitResource,
  submitConfig,
  validateConfig,
  getConfigsForResource,
  updateConfig,
  runConfig,
  getAnalyticsForResource
};

const mapStateToProps = (state) => {
  return {
    analytics: state.analytics,
    view: state.createAccount,
    session: state.authentication,
    membership: state.memberships[0],
    configs: {
      items: getVisibleConfigs(state),
      ui: _.get(state, 'configs.ui')
    },
    configValidation: state.myResource.configValidation
  }
};

/*  Note: mapStateToProps is where you should use `reselect` to create selectors, ie:

    import { createSelector } from 'reselect'
    const counter = (state) => state.counter
    const tripleCount = createSelector(counter, (count) => count * 3)
    const mapStateToProps = (state) => ({
      counter: tripleCount(state)
    })

    Selectors can compute derived data, allowing Redux to store the minimal possible state.
    Selectors are efficient. A selector is not recomputed unless one of its arguments change.
    Selectors are composable. They can be used as input to other selectors.
    https://github.com/reactjs/reselect    */

export default connect(mapStateToProps, mapDispatchToProps)(MyResource);


text:
<?php

namespace PW\ItemBundle\Tests\Document;

use PW\ApplicationBundle\Tests\AbstractTest,
    PW\ItemBundle\Document\Alias;

/**
 * AliasTest
 */
class AliasTest extends AbstractTest
{
    /**
     * Test creating a new Alias
     */
    public function testDefaults()
    {
        $doc = new Alias();
        $this->assertTrue($doc->getIsActive());
    }
}


text:
using System;
using System.Linq;

namespace ThirdDigitIs7
{
    class Program
    {
        static void Main()
        {
            while (true)
            {
                Console.Write("Please enter a number: ");
                string number = Console.ReadLine();
                bool isThirdASeven = false;

                for (int i = 0; i < number.Length; i++)
                {
                    char currentNumber = number[number.Length - 1 - i];
                    if (currentNumber == '7' && i == 2)
                    {
                        isThirdASeven = true;
                    }
                }

                Console.WriteLine("Is the third number from the right a \"7\"? {0}", isThirdASeven);

                Console.Write("Do you want to check another number?(Y/N) ");
                char answer = Console.ReadLine().ToUpperInvariant()[0];

                if (answer == 'Y')
                {
                    continue;
                }
                else if (answer == 'N')
                {
                    break;
                }
                else
                {
                    Console.WriteLine("Invalid answer!");
                    break;
                }
            }
        }
    }
}


text:
"""
    This is the code to accompany the Lesson 2 (SVM) mini-project.

    Use a SVM to identify emails from the Enron corpus by their authors:
    Sara has label 0
    Chris has label 1
"""

import sys
from time import time
sys.path.append("../tools/")
from email_preprocess import preprocess

### features_train and features_test are the features for the training
### and testing datasets, respectively
### labels_train and labels_test are the corresponding item labels
features_train, features_test, labels_train, labels_test = preprocess()

#########################################################
### your code goes here ###

#########################################################


text:
Get Involved with Sac2050

 Individuals

We're building a community of change agents who want to volunteer their skills for good.

        SIGN UP

 Organizations

We're connecting an network of civic organizations who want to use data to share their stories of success.

        SIGN UP


text:
<?php
namespace Gwa\Wordpress\Template\Zero\Controller;

use Gwa\Wordpress\Template\Zero\Library\AbstractController;

/**
 * Page.
 *
 * @author  GWA
 *
 */
final class Page extends AbstractController
{
    /**
     * {@inheritdoc}
     */
    public function getContext()
    {
        return ['post' => $this->getPost()];
    }

    /**
     * {@inheritdoc}
     */
    public function getTemplates()
    {
        return ['page-'.$this->getPost()->post_name.'.twig', 'page.twig'];
    }
}


text:
<?php

namespace USF\IdM\CLients;

class ImageServiceClient {

    public static function getImageURL($imageServiceScheme, $imageServiceHost, $imageServicePort, $imageServicePath, $identifier, $keyName, $keyData, $separator = '|'){
        // Create the plaintext containing the current time and the Unumber requested
        $plaintext = time() . $separator . $identifier;
        //Encrypt the token
        $encryptedToken = UsfEncryption::encrypt($plaintext, $keyData);
        return $imageServiceScheme.'://'.$imageServiceHost.':'.$imageServicePort.$imageServicePath.'/view/'.$keyName.'/'.urlencode($encryptedToken).'.jpg';
    }

    public static function getResizedImageURL($imageServiceScheme, $imageServiceHost, $imageServicePort, $imageServicePath, $identifier, $keyName, $keyData, $width, $height, $separator = '|'){
        // Create the plaintext containing the current time and the Unumber requested
        $plaintext = time() . $separator . $identifier;
        //Encrypt the token
        $encryptedToken = UsfEncryption::encrypt($plaintext, $keyData);
        return $imageServiceScheme.'://'.$imageServiceHost.':'.$imageServicePort.$imageServicePath.'/view/'.$keyName.'/'.$width.'/'.$height.'/'.urlencode($encryptedToken).'.jpg';
    }

}


text:
layout: page
title: "Jeffrey Thayer"
comments: true
description: "blanks"
keywords: "Jeffrey Thayer,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Engineering and Applied Science

**Classes taught**: ASEN 2002, ASEN 3113, ASEN 5245, ASEN 5335

#### ASEN 2002: Aerospace 2: Introduction to Thermodynamics and Aerodynamics

**Terms taught**: Fall 2006, Fall 2007, Fall 2008, Fall 2010

**Instructor rating**: 4.62

**Standard deviation in instructor rating**: 0.41

**Average grade** (4.0 scale): 2.89

**Standard deviation in grades** (4.0 scale): 0.25

**Average workload** (raw): 4.97

**Standard deviation in workload** (raw): 0.41

#### ASEN 3113: Thermodynamics and Heat Transfer

**Terms taught**: Fall 2010

**Instructor rating**: 5.26

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.36

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 4.19

**Standard deviation in workload** (raw): 0.0

#### ASEN 5245: Radar and Remote Sensing

**Terms taught**: Spring 2007, Spring 2010, Spring 2013, Spring 2015

**Instructor rating**: 5.56

**Standard deviation in instructor rating**: 0.32

**Average grade** (4.0 scale): 3.58

**Standard deviation in grades** (4.0 scale): 0.11

**Average workload** (raw): 3.63

**Standard deviation in workload** (raw): 0.32

#### ASEN 5335: AEROSPACE ENVIRONMENT

**Terms taught**: Spring 2009

**Instructor rating**: 4.75

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.0

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.33

**Standard deviation in workload** (raw): 0.0


text:
package org.semanticweb.drew.rl.sparql;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.semanticweb.drew.dlprogram.model.CacheManager;
import org.semanticweb.drew.dlprogram.model.Clause;
import org.semanticweb.drew.dlprogram.model.Literal;
import org.semanticweb.drew.dlprogram.model.NormalPredicate;
import org.semanticweb.drew.dlprogram.model.Term;
import org.semanticweb.owlapi.vocab.OWLRDFVocabulary;

import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.sparql.core.TriplePath;
import com.hp.hpl.jena.sparql.core.Var;
import com.hp.hpl.jena.sparql.syntax.Element;
import com.hp.hpl.jena.sparql.syntax.ElementGroup;
import com.hp.hpl.jena.sparql.syntax.ElementPathBlock;

public class SparqlCompiler {

	public SparqlCompiler() {

	}

	/**
	 * @param query
	 */
	public Clause compileQuery(Query query) {

		List<Literal> body = new ArrayList<>();
		List<Term> ansVars = new ArrayList<>();
		List<Var> projectVars = query.getProjectVars();
		for (Var var : projectVars) {
			ansVars.add(compileTerm(var));
		}

		NormalPredicate ans = CacheManager.getInstance().getPredicate("ans",
				ansVars.size());

		Literal head = new Literal(ans, ansVars);

		Element queryPattern = query.getQueryPattern();

		if (queryPattern instanceof ElementGroup) {
			ElementGroup group = (ElementGroup) queryPattern;
			List<Element> elements = group.getElements();
			for (Element ele : elements) {
				// System.out.println(ele.getClass());
				if (ele instanceof ElementPathBlock) {
					ElementPathBlock block = (ElementPathBlock) ele;
					Iterator<TriplePath> patternElts = block.patternElts();
					while (patternElts.hasNext()) {
						TriplePath triplePath = patternElts.next();
						Triple triple = triplePath.asTriple();
						final Literal lit = compileTriple(triple);
						//System.out.println(triple + " ==> " + lit);
						body.add(lit);
					}
					return new Clause(head, body);
				} else {
					throw new UnsupportedOperationException();
				}

			}

		} else {
			throw new UnsupportedOperationException();
		}
		return null;
	}

	private Literal compileTriple(Triple triple) {

		if (triple.getPredicate().getURI()
				.equals(OWLRDFVocabulary.RDF_TYPE.toString())) {
			return new Literal(compilePredicate(triple.getObject(), 1), //
					compileTerm(triple.getSubject()));
		} else {
			return new Literal(compilePredicate(triple.getPredicate(), 2), //
					compileTerm(triple.getSubject()), //
					compileTerm(triple.getObject()));
		}

	}

	/**
	 * @param predicate
	 * @return
	 */
	private NormalPredicate compilePredicate(Node predicate, int arity) {

		if (predicate.isURI()) {
			String uri = predicate.getURI();
			return CacheManager.getInstance().getPredicate(quote(uri), arity);
		} else {
			throw new IllegalArgumentException();
		}
	}

	private Term compileTerm(Node node) {
		if (node.isURI()) {
			String uri = node.getURI();
			return CacheManager.getInstance().getConstant(quote(uri));
		} else if (node.isLiteral()) {
			String uri = node.getLiteralDatatypeURI();
			if (uri != null)
				return CacheManager.getInstance().getConstant(quote(uri));
			else
				return CacheManager.getInstance().getConstant(node.toString());
		} else if (node.isVariable()) {
			String name = node.getName();
			return CacheManager.getInstance().getVariable(name);
		} else {
			throw new IllegalArgumentException(node.toString());
		}
	}

	/**
	 * @param uri
	 * @return
	 */
	private String quote(String uri) {
		final String quotedIRI = "<" + uri + ">";
		return quotedIRI;
	}

}