text:
package com.siyangexpress.domain.repository.impl;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.stereotype.Repository;

import com.siyangexpress.domain.Product;
import com.siyangexpress.repository.ProductRepository;

@Repository
public class InMemoryProductRepository implements ProductRepository {

	private List<Product> listOfProducts = new ArrayList<Product>();

	public InMemoryProductRepository() {
		Product iphone = new Product("P1234", "iPhone 5s", new BigDecimal(500));
		iphone.setDescription("Apple iPhone 5s smartphone with 4.00-inch 640x1136 display and 8-megapixel rear camera");
		iphone.setCategory("Smart Phone");
		iphone.setManufacturer("Apple");
		iphone.setUnitsInStock(1000);

		Product laptop_dell = new Product("P1235", "Dell Inspiron",
				new BigDecimal(700));
		laptop_dell
				.setDescription("Dell Inspiron 14-inch Laptop (Black) with 3rd Generation Intel Core processors");
		laptop_dell.setCategory("Laptop");
		laptop_dell.setManufacturer("Dell");
		laptop_dell.setUnitsInStock(1000);

		Product tablet_Nexus = new Product("P1236", "Nexus 7", new BigDecimal(
				300));
		tablet_Nexus
				.setDescription("Google Nexus 7 is the lightest 7 inch tablet With a quad-core Qualcomm Snapdragon™ S4 Pro processor");
		tablet_Nexus.setCategory("Tablet");
		tablet_Nexus.setManufacturer("Google");
		tablet_Nexus.setUnitsInStock(1000);

		listOfProducts.add(iphone);
		listOfProducts.add(laptop_dell);
		listOfProducts.add(tablet_Nexus);

	}

	public List<Product> getAllProducts() {
		return listOfProducts;
	}

	public Product getProductById(String productId) {
		Product productById = null;

		for (Product product : listOfProducts) {
			if (product != null && product.getProductId() != null
					&& product.getProductId().equals(productId)) {
				productById = product;
				break;
			}
		}

		if (productById == null) {
			throw new IllegalArgumentException(
					"No products found with the product id: " + productId);
		}

		return productById;
	}

	@Override
	public List<Product> getProductsByCategory(String category) {
		List<Product> productsByCategory = new ArrayList<Product>();

		for (Product product : listOfProducts) {
			if (category.equalsIgnoreCase(product.getCategory())) {
				productsByCategory.add(product);
			}
		}

		return productsByCategory;
	}

	@Override
	public Set<Product> getProductsByFilter(Map<String, List<String>> filterParams) {
		Set<Product> productsByBrand = new HashSet<Product>();
		Set<Product> productsByCategory = new HashSet<Product>();

		Set<String> criterias = filterParams.keySet();

		if (criterias.contains("brand")) {
			for (String brandName : filterParams.get("brand")) {
				for (Product product : listOfProducts) {
					if (brandName.equalsIgnoreCase(product.getManufacturer())) {
						productsByBrand.add(product);
					}
				}
			}
		}

		if (criterias.contains("category")) {
			for (String category : filterParams.get("category")) {
				productsByCategory.addAll(this.getProductsByCategory(category));
			}
		}

		productsByCategory.retainAll(productsByBrand);

		return productsByCategory;
	}
}


text:
namespace base {
class Time;
}

namespace copresence {

class AudioPlayer;
class AudioRecorder;
class WhispernetClient;

// The AudioManagerImpl class manages the playback and recording of tokens. Once
// playback or recording is started, it is up to the audio manager to handle
// the specifics of how this is done. In the future, for example, this class
// may pause recording and playback to implement carrier sense.
class AudioManagerImpl final : public AudioManager {
 public:
  AudioManagerImpl();
  ~AudioManagerImpl() override;

  // AudioManager overrides:
  void Initialize(WhispernetClient* whispernet_client,
                  const TokensCallback& tokens_cb) override;
  void StartPlaying(AudioType type) override;
  void StopPlaying(AudioType type) override;
  void StartRecording(AudioType type) override;
  void StopRecording(AudioType type) override;
  void SetToken(AudioType type, const std::string& url_safe_token) override;
  const std::string GetToken(AudioType type) override;
  bool IsPlayingTokenHeard(AudioType type) override;
  void SetTokenLength(AudioType type, size_t token_length) override;

  void set_player_for_testing(AudioType type, AudioPlayer* player) {
    player_[type] = player;
  }
  void set_recorder_for_testing(AudioRecorder* recorder) {
    recorder_ = recorder;
  }

 private:
  using SamplesMap = TimedMap<std::string,
                              scoped_refptr<media::AudioBusRefCounted>>;

  // Receives the audio samples from encoding a token.
  void OnTokenEncoded(AudioType type,
                      const std::string& token,
                      const scoped_refptr<media::AudioBusRefCounted>& samples);

  // Receives any tokens found by decoding audio samples.
  void OnTokensFound(const std::vector<AudioToken>& tokens);

  // Update our currently playing token with the new token. Change the playing
  // samples if needed. Prerequisite: Samples corresponding to this token
  // should already be in the samples cache.
  void UpdateToken(AudioType type, const std::string& token);

  void RestartPlaying(AudioType type);

  void DecodeSamplesConnector(const std::string& samples);

  WhispernetClient* whispernet_client_;

  // Callbacks to send tokens back to the CopresenceManager.
  TokensCallback tokens_cb_;

  // This cancelable callback is passed to the recorder. The recorder's
  // destruction will happen on the audio thread, so it can outlive us.
  base::CancelableCallback<void(const std::string&)> decode_cancelable_cb_;

  // We use the AudioType enum to index into all our data structures that work
  // on values for both audible and inaudible.
  static_assert(AUDIBLE == 0, "AudioType::AUDIBLE should be 0.");
  static_assert(INAUDIBLE == 1, "AudioType::INAUDIBLE should be 1.");

  // Indexed using enum AudioType.
  bool should_be_playing_[2];
  bool should_be_recording_[2];

  // AudioPlayer and AudioRecorder objects are self-deleting. When we call
  // Finalize on them, they clean themselves up on the Audio thread.
  // Indexed using enum AudioType.
  AudioPlayer* player_[2];
  AudioRecorder* recorder_;

  // Indexed using enum AudioType.
  std::string playing_token_[2];
  base::Time started_playing_[2];
  base::Time heard_own_token_[2];

  // Cache that holds the encoded samples. After reaching its limit, the cache
  // expires the oldest samples first.
  // Indexed using enum AudioType.
  ScopedVector<SamplesMap> samples_cache_;

  size_t token_length_[2];

  DISALLOW_COPY_AND_ASSIGN(AudioManagerImpl);
};

}  // namespace copresence

#endif  // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_IMPL_H_

redpajama_set_name: RedPajamaGithub


text:
/**
* Package for set tasks.
*
* @author Alexander Eremeev (mailto:eremeev@gmail.com)
* @version 1
* @since 28.09.2017
*/
package ru.job4j.set;


text:
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="author" content="Manfred Kaul <manfred.kaul@h-brs.de> 2017">
<meta name="license" content="The MIT License (MIT)">
<script src="ccm.solutions_view.js"></script>
<ccm-solutions_view></ccm-solutions_view>


text:
namespace boost
{

/////////////////////////////////////////////////////////////////////////////
// Graph reader exceptions
/////////////////////////////////////////////////////////////////////////////
struct BOOST_SYMBOL_VISIBLE parse_error : public graph_exception
{
    parse_error(const std::string& err)
    {
        error = err;
        statement = "parse error: " + error;
    }
    virtual ~parse_error() throw() {}
    virtual const char* what() const throw() { return statement.c_str(); }
    std::string statement;
    std::string error;
};

class mutate_graph
{
public:
    virtual ~mutate_graph() {}
    virtual bool is_directed() const = 0;

    virtual boost::any do_add_vertex() = 0;
    virtual std::pair< boost::any, bool > do_add_edge(
        boost::any source, boost::any target)
        = 0;

    virtual void set_graph_property(const std::string& name,
        const std::string& value, const std::string& value_type)
        = 0;

    virtual void set_vertex_property(const std::string& name, boost::any vertex,
        const std::string& value, const std::string& value_type)
        = 0;

    virtual void set_edge_property(const std::string& name, boost::any edge,
        const std::string& value, const std::string& value_type)
        = 0;
};

template < typename MutableGraph > class mutate_graph_impl : public mutate_graph
{
    typedef typename graph_traits< MutableGraph >::vertex_descriptor
        vertex_descriptor;
    typedef
        typename graph_traits< MutableGraph >::edge_descriptor edge_descriptor;

public:
    mutate_graph_impl(MutableGraph& g, dynamic_properties& dp)
    : m_g(g), m_dp(dp)
    {
    }

    bool is_directed() const
    {
        return is_convertible<
            typename graph_traits< MutableGraph >::directed_category,
            directed_tag >::value;
    }

    virtual any do_add_vertex() { return any(add_vertex(m_g)); }

    virtual std::pair< any, bool > do_add_edge(any source, any target)
    {
        std::pair< edge_descriptor, bool > retval
            = add_edge(any_cast< vertex_descriptor >(source),
                any_cast< vertex_descriptor >(target), m_g);
        return std::make_pair(any(retval.first), retval.second);
    }

    virtual void set_graph_property(const std::string& name,
        const std::string& value, const std::string& value_type)
    {
        bool type_found = false;
        try
        {
            mpl::for_each< value_types >(
                put_property< MutableGraph*, value_types >(name, m_dp, &m_g,
                    value, value_type, m_type_names, type_found));
        }
        catch (const bad_lexical_cast&)
        {
            BOOST_THROW_EXCEPTION(parse_error("invalid value \"" + value
                + "\" for key " + name + " of type " + value_type));
        }
        if (!type_found)
        {
            BOOST_THROW_EXCEPTION(parse_error(
                "unrecognized type \"" + value_type + "\" for key " + name));
        }
    }

    virtual void set_vertex_property(const std::string& name, any vertex,
        const std::string& value, const std::string& value_type)
    {
        bool type_found = false;
        try
        {
            mpl::for_each< value_types >(
                put_property< vertex_descriptor, value_types >(name, m_dp,
                    any_cast< vertex_descriptor >(vertex), value, value_type,
                    m_type_names, type_found));
        }
        catch (const bad_lexical_cast&)
        {
            BOOST_THROW_EXCEPTION(parse_error("invalid value \"" + value
                + "\" for key " + name + " of type " + value_type));
        }
        if (!type_found)
        {
            BOOST_THROW_EXCEPTION(parse_error(
                "unrecognized type \"" + value_type + "\" for key " + name));
        }
    }

    virtual void set_edge_property(const std::string& name, any edge,
        const std::string& value, const std::string& value_type)
    {
        bool type_found = false;
        try
        {
            mpl::for_each< value_types >(
                put_property< edge_descriptor, value_types >(name, m_dp,
                    any_cast< edge_descriptor >(edge), value, value_type,
                    m_type_names, type_found));
        }
        catch (const bad_lexical_cast&)
        {
            BOOST_THROW_EXCEPTION(parse_error("invalid value \"" + value
                + "\" for key " + name + " of type " + value_type));
        }
        if (!type_found)
        {
            BOOST_THROW_EXCEPTION(parse_error(
                "unrecognized type \"" + value_type + "\" for key " + name));
        }
    }

    template < typename Key, typename ValueVector > class put_property
    {
    public:
        put_property(const std::string& name, dynamic_properties& dp,
            const Key& key, const std::string& value,
            const std::string& value_type, const char** type_names,
            bool& type_found)
        : m_name(name)
        , m_dp(dp)
        , m_key(key)
        , m_value(value)
        , m_value_type(value_type)
        , m_type_names(type_names)
        , m_type_found(type_found)
        {
        }
        template < class Value > void operator()(Value)
        {
            if (m_value_type
                == m_type_names[mpl::find< ValueVector,
                    Value >::type::pos::value])
            {
                put(m_name, m_dp, m_key, lexical_cast< Value >(m_value));
                m_type_found = true;
            }
        }

    private:
        const std::string& m_name;
        dynamic_properties& m_dp;
        const Key& m_key;
        const std::string& m_value;
        const std::string& m_value_type;
        const char** m_type_names;
        bool& m_type_found;
    };

protected:
    MutableGraph& m_g;
    dynamic_properties& m_dp;
    typedef mpl::vector< bool, int, long, float, double, std::string >
        value_types;
    static const char* m_type_names[];
};

template < typename MutableGraph >
const char* mutate_graph_impl< MutableGraph >::m_type_names[]
    = { "boolean", "int", "long", "float", "double", "string" };

void BOOST_GRAPH_DECL read_graphml(
    std::istream& in, mutate_graph& g, size_t desired_idx);

template < typename MutableGraph >
void read_graphml(std::istream& in, MutableGraph& g, dynamic_properties& dp,
    size_t desired_idx = 0)
{
    mutate_graph_impl< MutableGraph > mg(g, dp);
    read_graphml(in, mg, desired_idx);
}

template < typename Types > class get_type_name
{
public:
    get_type_name(const std::type_info& type, const char** type_names,
        std::string& type_name)
    : m_type(type), m_type_names(type_names), m_type_name(type_name)
    {
    }
    template < typename Type > void operator()(Type)
    {
        if (typeid(Type) == m_type)
            m_type_name
                = m_type_names[mpl::find< Types, Type >::type::pos::value];
    }

private:
    const std::type_info& m_type;
    const char** m_type_names;
    std::string& m_type_name;
};

template < typename Graph, typename VertexIndexMap >
void write_graphml(std::ostream& out, const Graph& g,
    VertexIndexMap vertex_index, const dynamic_properties& dp,
    bool ordered_vertices = false)
{
    typedef typename graph_traits< Graph >::directed_category directed_category;
    typedef typename graph_traits< Graph >::edge_descriptor edge_descriptor;
    typedef typename graph_traits< Graph >::vertex_descriptor vertex_descriptor;

    using boost::property_tree::xml_parser::encode_char_entities;

    BOOST_STATIC_CONSTANT(bool,
        graph_is_directed
        = (is_convertible< directed_category*, directed_tag* >::value));

    out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
        << "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" "
           "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
           "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns "
           "http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">\n";

    typedef mpl::vector< bool, short, unsigned short, int, unsigned int, long,
        unsigned long, long long, unsigned long long, float, double,
        long double, std::string >
        value_types;
    const char* type_names[] = { "boolean", "int", "int", "int", "int", "long",
        "long", "long", "long", "float", "double", "double", "string" };
    std::map< std::string, std::string > graph_key_ids;
    std::map< std::string, std::string > vertex_key_ids;
    std::map< std::string, std::string > edge_key_ids;
    int key_count = 0;

    // Output keys
    for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i)
    {
        std::string key_id = "key" + lexical_cast< std::string >(key_count++);
        if (i->second->key() == typeid(Graph*))
            graph_key_ids[i->first] = key_id;
        else if (i->second->key() == typeid(vertex_descriptor))
            vertex_key_ids[i->first] = key_id;
        else if (i->second->key() == typeid(edge_descriptor))
            edge_key_ids[i->first] = key_id;
        else
            continue;
        std::string type_name = "string";
        mpl::for_each< value_types >(get_type_name< value_types >(
            i->second->value(), type_names, type_name));
        out << "  <key id=\"" << encode_char_entities(key_id) << "\" for=\""
            << (i->second->key() == typeid(Graph*)
                       ? "graph"
                       : (i->second->key() == typeid(vertex_descriptor)
                               ? "node"
                               : "edge"))
            << "\""
            << " attr.name=\"" << i->first << "\""
            << " attr.type=\"" << type_name << "\""
            << " />\n";
    }

    out << "  <graph id=\"G\" edgedefault=\""
        << (graph_is_directed ? "directed" : "undirected") << "\""
        << " parse.nodeids=\"" << (ordered_vertices ? "canonical" : "free")
        << "\""
        << " parse.edgeids=\"canonical\" parse.order=\"nodesfirst\">\n";

    // Output graph data
    for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i)
    {
        if (i->second->key() == typeid(Graph*))
        {
            // The const_cast here is just to get typeid correct for property
            // map key; the graph should not be mutated using it.
            out << "   <data key=\"" << graph_key_ids[i->first] << "\">"
                << encode_char_entities(
                       i->second->get_string(const_cast< Graph* >(&g)))
                << "</data>\n";
        }
    }

    typedef typename graph_traits< Graph >::vertex_iterator vertex_iterator;
    vertex_iterator v, v_end;
    for (boost::tie(v, v_end) = vertices(g); v != v_end; ++v)
    {
        out << "    <node id=\"n" << get(vertex_index, *v) << "\">\n";
        // Output data
        for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end();
             ++i)
        {
            if (i->second->key() == typeid(vertex_descriptor))
            {
                out << "      <data key=\"" << vertex_key_ids[i->first] << "\">"
                    << encode_char_entities(i->second->get_string(*v))
                    << "</data>\n";
            }
        }
        out << "    </node>\n";
    }

    typedef typename graph_traits< Graph >::edge_iterator edge_iterator;
    edge_iterator e, e_end;
    typename graph_traits< Graph >::edges_size_type edge_count = 0;
    for (boost::tie(e, e_end) = edges(g); e != e_end; ++e)
    {
        out << "    <edge id=\"e" << edge_count++ << "\" source=\"n"
            << get(vertex_index, source(*e, g)) << "\" target=\"n"
            << get(vertex_index, target(*e, g)) << "\">\n";

        // Output data
        for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end();
             ++i)
        {
            if (i->second->key() == typeid(edge_descriptor))
            {
                out << "      <data key=\"" << edge_key_ids[i->first] << "\">"
                    << encode_char_entities(i->second->get_string(*e))
                    << "</data>\n";
            }
        }
        out << "    </edge>\n";
    }

    out << "  </graph>\n"
        << "</graphml>\n";
}

template < typename Graph >
void write_graphml(std::ostream& out, const Graph& g,
    const dynamic_properties& dp, bool ordered_vertices = false)
{
    write_graphml(out, g, get(vertex_index, g), dp, ordered_vertices);
}

} // boost namespace

#endif // BOOST_GRAPH_GRAPHML_HPP


text:
.. _firstbot:

Writing your First Bot
======================

This tutorial assumes several things:

 - You have installed curious successfully

 - You have created a bot account successfully

This tutorial will go over writing a bot that echos all messages to your
console when they are received by the bot.

The Project
-----------

As your bot is incredibly simple, it probably will not need more than a
single file currently. Your basic bot skeleton layout should look something
like:

.. code-block:: bash

    $ ls --tree

    └── bot.py

The ``bot.py`` file will contain all of the code for the bot.

Writing the Bot
---------------

Open up ``bot.py`` and add the essential imports:

.. code-block:: python3

    import multio
    from curious.core.client import Client

This will import the :class:`.Client`, which is used to communicate with
Discord, and :mod:`multio` which is used to pick your backend.

Before anything else, you need to choose an async library to run your bot with:

.. code-block:: python3

    multio.init('curio')  # lean mean killing machine
    multio.init('trio')  # lean mean maiming machine

Next, you want to define your new bot object, passing your bot token to it:

.. code-block:: python3

    botto = Client("MjYwOTUwODE2NTM2NTI2ODQ5.Cz2mGQ.SKl78a6NT6SBpwYQrIDnR1olPqo")

This object will be used to receive events from Discord, such as the messages.

Event Handling
--------------

To process events from Discord, you need to **subscribe to an event**. This
will call a function automatically every single time an event is received
by the websocket connection to process the event.

To receive new messages automatically, we have to subscribe to the
``message_create`` event, using :meth:`.Client.event`.

.. code-block:: python3

    @botto.event("message_create")
    async def my_handler(ctx, message):
        pass

The handler function is decorated with the event decorator, which takes the
event name to process as an argument.

All event handlers take one argument, the :class:`.EventContext` which
contains a small amount of context about the event. Right now, this is not
needed for our purposes.

The second argument to the ``message_create`` event is a :class:`.Message`
object, which represents a message sent by Discord. We are interested in
:attr:`.Message.content`, to print to the console.

Modify the body of the function so that it prints to the console the
message content:

.. code-block:: python3

    print("Content:", message.content)

Running the Bot
---------------

The final stage to this basic tutorial is to **run the bot**.

The simplest method is to call :meth:`.Client.run`, like so:

.. code-block:: python3

    botto.run()

When you type in a server that you and the bot account share, you will then
see your messages pop up in the log for the bot.


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

namespace Agiil.Domain.Labels
{
  public abstract class LabelProviderBase : IGetsLabels
  {
    readonly IParsesLabelNames labelNameParser;

    public virtual IReadOnlyCollection<Label> GetLabels(string commaSeparatedLabelNames)
    {
      var names = labelNameParser.GetLabelNames(commaSeparatedLabelNames);
      return GetLabels(names);
    }

    public abstract IReadOnlyCollection<Label> GetLabels(IReadOnlyCollection<string> labelNames);

    protected LabelProviderBase(IParsesLabelNames labelNameParser)
    {
      if(labelNameParser == null)
        throw new ArgumentNullException(nameof(labelNameParser));

      this.labelNameParser = labelNameParser;
    }
  }
}


text:
package it.unibz.krdb.obda.owlapi3;

import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassAssertionAxiom;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLDataProperty;
import org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom;
import org.semanticweb.owlapi.model.OWLDataPropertyExpression;
import org.semanticweb.owlapi.model.OWLIndividual;
import org.semanticweb.owlapi.model.OWLLiteral;
import org.semanticweb.owlapi.model.OWLObjectInverseOf;
import org.semanticweb.owlapi.model.OWLObjectProperty;
import org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;

import it.unibz.krdb.obda.model.OBDADataFactory;
import it.unibz.krdb.obda.model.Predicate;
import it.unibz.krdb.obda.model.URIConstant;
import it.unibz.krdb.obda.model.ValueConstant;
import it.unibz.krdb.obda.model.impl.OBDADataFactoryImpl;
import it.unibz.krdb.obda.ontology.ClassAssertion;
import it.unibz.krdb.obda.ontology.DataPropertyAssertion;
import it.unibz.krdb.obda.ontology.DataPropertyExpression;
import it.unibz.krdb.obda.ontology.ImmutableOntologyVocabulary;
import it.unibz.krdb.obda.ontology.InconsistentOntologyException;
import it.unibz.krdb.obda.ontology.OClass;
import it.unibz.krdb.obda.ontology.ObjectPropertyAssertion;
import it.unibz.krdb.obda.ontology.ObjectPropertyExpression;
import it.unibz.krdb.obda.ontology.OntologyFactory;
import it.unibz.krdb.obda.ontology.impl.OntologyFactoryImpl;
import it.unibz.krdb.obda.owlapi3.OWLAPI3TranslatorOWL2QL.TranslationException;

public class OWLAPI3TranslatorHelper {

	private final ImmutableOntologyVocabulary voc;

	private static final OntologyFactory ofac = OntologyFactoryImpl.getInstance();
	private static final OBDADataFactory dfac = OBDADataFactoryImpl.getInstance();

	OWLAPI3TranslatorHelper(ImmutableOntologyVocabulary voc) {
		this.voc = voc;
	}

	public ClassAssertion translate(OWLClassAssertionAxiom ax) throws TranslationException, InconsistentOntologyException {
		OWLClassExpression classExpression = ax.getClassExpression();
		if (!(classExpression instanceof OWLClass))
			throw new TranslationException("complex class expressions are not supported");

		OWLClass namedclass = (OWLClass) classExpression;
		OClass concept = voc.getClass(namedclass.getIRI().toString());

		URIConstant c = getIndividual(ax.getIndividual());

		return ofac.createClassAssertion(concept, c);
	}

	public ObjectPropertyAssertion translate(OWLObjectPropertyAssertionAxiom ax) throws InconsistentOntologyException {
		URIConstant c1 = getIndividual(ax.getSubject());
		URIConstant c2 = getIndividual(ax.getObject());

		ObjectPropertyExpression ope = getPropertyExpression(ax.getProperty());

		return ofac.createObjectPropertyAssertion(ope, c1, c2);
	}

	public DataPropertyAssertion translate(OWLDataPropertyAssertionAxiom ax) throws TranslationException, InconsistentOntologyException {
		OWLLiteral object = ax.getObject();
		Predicate.COL_TYPE type = OWLTypeMapper.getType(object.getDatatype());
		ValueConstant c2 = dfac.getConstantLiteral(object.getLiteral(), type);

		URIConstant c1 = getIndividual(ax.getSubject());

		DataPropertyExpression dpe = getPropertyExpression(ax.getProperty());

		return ofac.createDataPropertyAssertion(dpe, c1, c2);
	}

	/**
	 *
	 * @param clExpression
	 * @return
	 */

	public OClass getOClass(OWLClass clExpression) {
		String uri = clExpression.getIRI().toString();
		return voc.getClass(uri);
	}

	/**
	 * ObjectPropertyExpression := ObjectProperty | InverseObjectProperty
	 * InverseObjectProperty := 'ObjectInverseOf' '(' ObjectProperty ')'
	 *
	 * @param opeExpression
	 * @return
	 */

	public ObjectPropertyExpression getPropertyExpression(OWLObjectPropertyExpression opeExpression) {

		if (opeExpression instanceof OWLObjectProperty)
			return voc.getObjectProperty(opeExpression.asOWLObjectProperty().getIRI().toString());

		else {
			assert(opeExpression instanceof OWLObjectInverseOf);

			OWLObjectInverseOf aux = (OWLObjectInverseOf) opeExpression;
			return voc.getObjectProperty(aux.getInverse().asOWLObjectProperty().getIRI().toString()).getInverse();
		}
	}

	/**
	 * DataPropertyExpression := DataProperty
	 *
	 * @param rolExpression
	 * @return
	 */

	public DataPropertyExpression getPropertyExpression(OWLDataPropertyExpression dpeExpression)  {
		assert (dpeExpression instanceof OWLDataProperty);
		return voc.getDataProperty(dpeExpression.asOWLDataProperty().getIRI().toString());
	}

	public static URIConstant getIndividual(OWLIndividual ind) {
		if (ind.isAnonymous())
			throw new RuntimeException("Found anonymous individual, this feature is not supported:" + ind);

		 return dfac.getConstantURI(ind.asOWLNamedIndividual().getIRI().toString());
	}

}


text:
package pytorch

import (
	"strconv"
	"sync"

	corev1 "k8s.io/api/core/v1"

	kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
)

var (
	masterGenerator EnvVarGenerator
	onceMaster      sync.Once
	EnvMasterPort   = "MASTER_PORT"
	EnvMasterAddr   = "MASTER_ADDR"
)

// MasterEnvVarGenerator is the environment variable generator for Master related arguments.
type MasterEnvVarGenerator struct {
}

func GetMasterEnvVarGenerator() EnvVarGenerator {
	onceMaster.Do(func() {
		masterGenerator = &MasterEnvVarGenerator{}
	})
	return masterGenerator
}

func (e MasterEnvVarGenerator) Generate(
	job *kubeflowv1.PyTorchJob) ([]corev1.EnvVar, error) {
	envVars := []corev1.EnvVar{}
	if job.Spec.PyTorchReplicaSpecs[kubeflowv1.PyTorchJobReplicaTypeMaster] != nil {
		masterPort, err := getPortFromPyTorchJob(job, kubeflowv1.PyTorchJobReplicaTypeMaster)
		if err != nil {
			return nil, err
		}

		masterAddr := replicaName(job.Name, kubeflowv1.PyTorchJobReplicaTypeMaster, 0)

		envVars = append(envVars, corev1.EnvVar{
			Name:  EnvMasterPort,
			Value: strconv.Itoa(int(masterPort)),
		})
		envVars = append(envVars, corev1.EnvVar{
			Name:  EnvMasterAddr,
			Value: masterAddr,
		})
	}
	return envVars, nil
}


text:
package com.raizlabs.android.dbflow.test.sql;

import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ConflictAction;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.structure.BaseModel;
import com.raizlabs.android.dbflow.test.TestDatabase;

/**
 * Description:
 */
@Table(database = TestDatabase.class, insertConflict = ConflictAction.ABORT)
public class InsertConflictModel extends BaseModel {

    @PrimaryKey
    long id;

    @Column
    String name;
}


text:
<?php

namespace Symfony\Component\Finder\Tests\Iterator;

use Symfony\Component\Finder\Iterator\FileTypeFilterIterator;

class FileTypeFilterIteratorTest extends RealIteratorTestCase
{
    /**
     * @dataProvider getAcceptData
     */
    public function testAccept($mode, $expected)
    {
        $inner = new InnerTypeIterator(self::$files);

        $iterator = new FileTypeFilterIterator($inner, $mode);

        $this->assertIterator($expected, $iterator);
    }

    public function getAcceptData()
    {
        $onlyFiles = array(
            'test.py',
            'foo/bar.tmp',
            'test.php',
            '.bar',
            '.foo/.bar',
            '.foo/bar',
            'foo bar',
            'qux/baz_100_1.py',
            'qux/baz_1_2.py',
            'qux_0_1.php',
            'qux_1000_1.php',
            'qux_1002_0.php',
            'qux_10_2.php',
            'qux_12_0.php',
            'qux_2_0.php',
        );

        $onlyDirectories = array(
            '.git',
            'foo',
            'qux',
            'toto',
            'toto/.git',
            '.foo',
        );

        return array(
            array(FileTypeFilterIterator::ONLY_FILES, $this->toAbsolute($onlyFiles)),
            array(FileTypeFilterIterator::ONLY_DIRECTORIES, $this->toAbsolute($onlyDirectories)),
        );
    }
}

class InnerTypeIterator extends \ArrayIterator
{
    public function current()
    {
        return new \SplFileInfo(parent::current());
    }

    public function isFile()
    {
        return $this->current()->isFile();
    }

    public function isDir()
    {
        return $this->current()->isDir();
    }
}


text: google-site-verification: google67f33a81133cd7eb.html


text:
import tweepy
import json

''' Authenticate to twitter, use the Twitter REST API to
    execute a search.'''

APIkey = "" #API key
APIsecret = "" #API scret
atoken = "" # access token
asecret = "" #access secret

# instantiate OAuthHandler and initialize it with your credentials
auth = tweepy.OAuthHandler(APIkey,APIsecret)
auth.set_access_token(atoken,asecret)

# instantiate the tweepy object, invoke the constructor with the just-created
# OAuthHandler object
api = tweepy.API(auth)

for tweet in tweepy.Cursor(api.search,
                            q="Montréal",
                            # q="Denis AND Coderre",
                            rpp=10,
                            delay = 10,
                            result_type="recent",
                            include_entities=True,
                            lang="en").items():
    #print("Tweet: {0}.".format(tweet.text.encode("ascii",errors="replace")))
    print("Tweet Status: {0}.".format(tweet['statuses']))


text:
class ChangeLikesToRates < ActiveRecord::Migration
  def up
  	create_table :relationshiprates do |t|
    t.integer :rater_id
    t.integer :rated_id
    t.integer :rate_value
    t.timestamps
  end

    add_index :relationshiprates, :rater_id
    add_index :relationshiprates,:rated_id
    add_index :relationshiprates,[:rater_id, :rated_id], :unique=>true
    add_index :relationshiprates,[:rated_id,:rater_id], :unique=>true
  end

  def down
  	drop_table :relationshiprs
  end
end


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Manutenzione */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'mtz_data_interv')->textInput(['value' => date( 'd/m/Y', strtotime( $model->mtz_data_interv ))]) ?>

    <?= $form->field($model, 'mtz_descrizione')->textInput(['maxlength' => 100]) ?>

    <?php
    /*dm9 inizio*/
    echo $form->field($model, 'mtz_componente_id')
		     ->dropDownList($modelComponenti, ['prompt'=>'-Seleziona il componente-']);		/*dm9-160223*/
    /*dm9 fine*/
    ?>

    <?= $form->field($model, 'mtz_data_inizio_tracking')->textInput(['value' => date( 'd/m/Y', strtotime( $model->mtz_data_inizio_tracking ))]) ?>

    <?= $form->field($model, 'mtz_data_fine_tracking')->textInput(['value' => date_format(  date_create($model->mtz_data_fine_tracking ) , 'd/m/Y')]) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
package com.github.havarunner.example.enclosed;

import com.github.havarunner.HavaRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(HavaRunner.class)
public class EnclosedExampleTest {

    static class enclosed_example {

        @Test
        void using_static_classes_within_the_test_class_is_a_way_to_group_tests() {
        }
    }

    static class parent {
        @Test
        void you_can_use_inner_classes_recursively() {
            System.out.println("hello recursive example @ " + getClass().getSimpleName());
        }
        static class child {
            @Test
            void you_can_use_inner_classes_recursively() {
                System.out.println("hello recursive example @ " + getClass().getSimpleName());
            }
            static class grandchild {
                @Test
                void you_can_use_inner_classes_recursively() {
                    System.out.println("hello recursive example @ " + getClass().getSimpleName());
                }
                static class grandgrandchild {
                    @Test
                    void you_can_use_inner_classes_recursively() {
                        System.out.println("hello recursive example @ " + getClass().getSimpleName());
                    }
                }
            }

        }
    }
}


text:
import ZephyrNotification from '../models/ZephyrNotification';
import IStoreState, { ConnectionStatus } from '../store/IStoreState';

const DefaultState: IStoreState = {
  navigationTarget: 0,
  connectionStatus: ConnectionStatus.DISCONNECTED,
  toast: null,
  notifications: new Map<string, ZephyrNotification>()
};

export default DefaultState;


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Social Network Template</title>

    <link href="css/default.min.css" rel="stylesheet">

                                5 min

Adrian D.

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

                                2 days

Jane B.

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

                                3 days

Andrew M.

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

                         Bill

Profile

Messages

Logout

                    <input type="text" class="form-control" placeholder="Search a friend">

                    New message from
                    Jonathan

                        New message

        Social Admin Template

                         Themes

Navigation

                     Timeline

                             Blocks

                             Listing

                     Profile

                     Users

                     Messages

                     Login

                    UI Components

                             Buttons

                             Icons

                             Progress

                             Grid

                             Forms

                             Tables

                         Collapse

                             Submenu

Regular Link

 Regular Link

News Feeds

                                Adrian just logged in
                                2 min ago

                                Adrian just added mosaicpro as their office
                                2 min ago

                                Adrian just logged in
                                2 min ago

                                Adrian just logged in
                                2 min ago

                                Adrian just logged in
                                2 min ago

Filter

 Work Related

 Very Important

 Friends & Family

            <input type="text" class="form-control" placeholder="Search" />

All

Online

Offline

Jonathan S.

                            "Free Today"

Mary A.

                            "Feeling Groovy"

Adrian D.

                            Busy

Michelle S.

                            Offline

Blank Page

Social Network Template © Copyright Notice


text:
// NOTE: put deprecated methods here that throw a useful error
Polymer.register = function(context) {
  if (context != window) {
    // context is the <element> here, with a name attribute
    var name = context.getAttribute('name');
    throw new Error('Polymer.register is deprecated in declaration of ' + name + '. Please see http://www.polymer-project.org/getting-started.html');
  }
};


text:
module Selenium
  module WebDriver
    module Error
      class ServerError < StandardError

        def initialize(response)
          if response.kind_of? String
            super(response)
          else
            super("status code #{response.code}")
          end
        end
      end

    end # Error
  end # WebDriver
end # Selenium