text:
{% comment %}
Determines whether article header should display category or project title
{% endcomment %}

{% if page.project %}
  {% assign project = site.projects | where_exp: "project", "project.title contains page.project" | first %}
  {{ project.title }}
{% elsif page.categories.size > 0 %}
  {% assign category = page.categories | first %}

    {{ category }}

{% endif %}


text:
package com.microsoft.azure.management.containerinstance.v2018_10_01;

import rx.Completable;

/**
 * Type representing ServiceAssociationLinks.
 */
public interface ServiceAssociationLinks {
    /**
     * Delete the container instance service association link for the subnet.
     * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkName The name of the virtual network.
     * @param subnetName The name of the subnet.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName);

}

redpajama_set_name: RedPajamaGithub


text:
#

import threading
import cPickle as pickle
import zlib
import logging

from gmetad_element import Element
from gmetad_config import getConfig, GmetadConfig
from gmetad_plugin import load_plugins, start_plugins, stop_plugins, notify_plugins

_decode = lambda x: (pickle.loads(zlib.decompress(x)))
_encode = lambda x: buffer(zlib.compress(pickle.dumps(x, pickle.HIGHEST_PROTOCOL)))

class GmetadNotifier(threading.Thread):
    ''' This class implements a notifier thread.  This create receives transactions from the data store
        that represent cluster data updates.  It then notifies each of the plugins that a cluster transaction
        is ready to be processed. '''
    def __init__(self):
        threading.Thread.__init__(self)

        # Load and start all of the plugins that are found in the plugin directory
        gmetadConfig = getConfig()
        load_plugins(gmetadConfig[GmetadConfig.PLUGINS_DIR])
        start_plugins()

        # Intialize the thread
        self._cond = threading.Condition()
        self._running = False
        self._shuttingDown = False
        self._transQueue = []

    def insertTransaction(self, node):
        ''' This method is called by the data store when a new transaction needs to be
            inserted into the transaction queue.'''
        if node is not None:
            # Pickle and insert the node so that we are dealing with a complete copy of the cluster node
            #  and all of it's children rather than risking that data will change while the
            #  plugins are processing the cluster data.
            transNode = _encode(node)
            self._transQueue.append( transNode)
            logging.debug('Inserted transaction %s in to the queue' % str(node))

    def run(self):
        # Make sure that this thread is only run once.
        if self._running:
            return
        self._running = True
        while not self._shuttingDown:
            # Wait for 1 second before checking the queue for new transactions.
            self._cond.acquire()
            self._cond.wait(1)
            # If there is a transaction in the queue, then pop it off, unpickle it and
            #  notify the plugins.
            if len(self._transQueue) > 0:
                transNode = self._transQueue.pop(0)
                node = _decode(transNode)
                logging.debug('Processing transaction %s' % str(node))
                notify_plugins(node)
            self._cond.release()

    def shutdown(self):
        # Release all of the locks and shut down the thread.
        self._shuttingDown = True
        self._cond.acquire()
        self._cond.notifyAll()
        self._cond.release()
        self.join()
        stop_plugins()


text:
python-alexa-skills-kit
=======================

Alexa Skills Kit API for Python. Designed to be used with AWS Lambda.


text:
package org.projectfloodlight.openflow.protocol;

import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import io.netty.buffer.ByteBuf;

public interface OFExperimenterStatsRequest<T extends OFExperimenterStatsReply> extends OFObject, OFStatsRequest<T> {
    OFVersion getVersion();
    OFType getType();
    long getXid();
    OFStatsType getStatsType();
    Set<OFStatsRequestFlags> getFlags();
    long getExperimenter();

    void writeTo(ByteBuf channelBuffer);

    Builder<T> createBuilder();
    public interface Builder<T extends OFExperimenterStatsReply> extends OFStatsRequest.Builder<T> {
        OFExperimenterStatsRequest<T> build();
        OFVersion getVersion();
        OFType getType();
        long getXid();
        Builder<T> setXid(long xid);
        OFStatsType getStatsType();
        Set<OFStatsRequestFlags> getFlags();
        Builder<T> setFlags(Set<OFStatsRequestFlags> flags);
        long getExperimenter();
    }
}


text:
using UnityEditor;
using UnityEngine;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using ParticlePlayground;
using ParticlePlaygroundLanguage;

public class PlaygroundPresetCategoryWindowC : EditorWindow {

	public static EditorWindow window;
	Vector2 scrollPosition;
	string createCategoryName = "New Category";
	string[] categoryNames;
	char[] invalidChars;

	public static PlaygroundSettingsC playgroundSettings;
	public static PlaygroundLanguageC playgroundLanguage;

	public static void ShowWindow ()
	{
		playgroundSettings = PlaygroundSettingsC.GetReference();
		playgroundLanguage = PlaygroundSettingsC.GetLanguage();
		window = EditorWindow.GetWindow<PlaygroundPresetCategoryWindowC>(true, playgroundLanguage.presetManager);
		window.Show();
	}

	void OnEnable ()
	{
		Initialize();
	}

	public void Initialize ()
	{
		if (PlaygroundParticleWindowC.presetCategories == null)
			return;
		invalidChars = Path.GetInvalidPathChars();
	}

	bool requestFocusControl = false;
	string focusControlName = "";

	void OnGUI ()
	{
		if (window == null)
		{
			this.Close();
			return;
		}

		EditorGUILayout.BeginVertical();

		scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false);
		EditorGUILayout.Separator();
		EditorGUILayout.LabelField(playgroundLanguage.presetManager, EditorStyles.largeLabel, GUILayout.Height(20));
		EditorGUILayout.Separator();

		GUILayout.BeginVertical("box");
		EditorGUILayout.HelpBox(playgroundLanguage.categoriesInfo, MessageType.Info);
		EditorGUILayout.Separator();

		for (int i = 0; i<PlaygroundParticleWindowC.presetCategories.Count; i++)
		{
			GUILayout.BeginVertical("box");

			GUILayout.BeginHorizontal();

			PresetCategory thisCategory = PlaygroundParticleWindowC.presetCategories[i];

			bool isProtectedFolder = thisCategory.categoryName == "Uncategorized" || thisCategory.categoryName == "Resources";

			// Category unfold
			thisCategory.foldout = GUILayout.Toggle(thisCategory.foldout, "", EditorStyles.foldout, GUILayout.MaxWidth(16f));

			// Category name
			GUI.enabled = !isProtectedFolder;
			GUI.SetNextControlName (thisCategory.categoryName);
			thisCategory.tmpNewName = EditorGUILayout.TextField(thisCategory.tmpNewName, EditorStyles.toolbarTextField);
			GUI.enabled = true;
			if (!isProtectedFolder && thisCategory.tmpNewName != thisCategory.categoryName)
			{
				if (GUILayout.Button (playgroundLanguage.rename, GUILayout.ExpandWidth(false)))
				{
					bool isValidFolderName = IsValidFolderName(thisCategory.tmpNewName);
					if (isValidFolderName)
					{
						if (AssetDatabase.RenameAsset("Assets/"+thisCategory.categoryLocation, thisCategory.tmpNewName).Length == 0)
						{
							AssetDatabase.Refresh();

							// Succesfully renamed
							thisCategory.categoryName = thisCategory.tmpNewName;
							requestFocusControl = true;
							focusControlName = thisCategory.categoryName;
							return;
						}
						else
						{
							thisCategory.tmpNewName = thisCategory.categoryName;
						}
					}
					else
					{
						thisCategory.tmpNewName = thisCategory.categoryName;
					}
				}
			}

			// Show amount of selected presets
			int selectedPresetsInCategory = 0;
			for (int x = 0; x<thisCategory.presetObjects.Count; x++)
			{
				if (thisCategory.presetObjects[x].selected)
					selectedPresetsInCategory++;
			}
			GUI.enabled = selectedPresetsInCategory > 0;
			GUILayout.Label("("+selectedPresetsInCategory.ToString()+"/"+thisCategory.presetObjects.Count.ToString()+")");
			GUI.enabled = true;

			EditorGUILayout.Separator();

			// Remove category
			GUI.enabled = !isProtectedFolder;
			if(GUILayout.Button("-", EditorStyles.toolbarButton, new GUILayoutOption[]{GUILayout.Width(18), GUILayout.Height(16)}) && !isProtectedFolder){
				if (EditorUtility.DisplayDialog(playgroundLanguage.removeCategory,
				                                thisCategory.categoryName+" "+playgroundLanguage.removeCategoryText,
				                                playgroundLanguage.yes,
				                                playgroundLanguage.no))
				{
					// Move all presets contained to "Uncategorized" (parent folder) before removing the category folder
					string[] presetsInCategory = Directory.GetFiles (Application.dataPath+"/"+thisCategory.categoryLocation);
					foreach (string presetLoc in presetsInCategory)
					{
						string convertedPresetPath = presetLoc.Substring(Application.dataPath.Length-6);
						Object presetPathObject = (Object)AssetDatabase.LoadAssetAtPath(convertedPresetPath, typeof(Object));
						if (presetPathObject!=null && (presetPathObject.GetType().Name)=="GameObject")
						{
							AssetDatabase.MoveAsset(convertedPresetPath, "Assets/"+playgroundSettings.playgroundPath+playgroundSettings.examplePresetPath+presetPathObject.name);
						}
					}
					AssetDatabase.MoveAssetToTrash("Assets/"+thisCategory.categoryLocation);
					AssetDatabase.Refresh();
					GUI.FocusControl(null);
					return;
				}
			}
			GUI.enabled = true;

			GUILayout.EndHorizontal();

			// List of presets
			if (thisCategory.foldout)
			{
				EditorGUILayout.Separator();

				// Mixed selection
				if (thisCategory.presetObjects.Count>0)
				{
					EditorGUI.showMixedValue = selectedPresetsInCategory > 0 && selectedPresetsInCategory < thisCategory.presetObjects.Count;
					bool multiSelect = selectedPresetsInCategory > 0;
					EditorGUI.BeginChangeCheck();
					EditorGUILayout.BeginHorizontal();
					GUILayout.Space (4f);
					multiSelect = EditorGUILayout.Toggle (multiSelect);
					EditorGUILayout.EndHorizontal();
					if (EditorGUI.EndChangeCheck())
					{
						for (int x = 0; x<thisCategory.presetObjects.Count; x++)
						{
							thisCategory.presetObjects[x].selected = multiSelect;
						}
					}
					EditorGUI.showMixedValue = false;
				}

				EditorGUI.indentLevel++;

				if (thisCategory.presetObjects.Count>0)
				{
					for (int x = 0; x<thisCategory.presetObjects.Count; x++)
					{
						GUILayout.BeginHorizontal("box");
						PresetObjectC thisPreset = thisCategory.presetObjects[x];
						thisPreset.selected = GUILayout.Toggle (thisPreset.selected, "", GUILayout.MaxWidth(24f));
						if (GUILayout.Button (thisPreset.presetImage, EditorStyles.label, new GUILayoutOption[]{GUILayout.Width(24), GUILayout.Height(24)}) ||
						    GUILayout.Button (thisPreset.presetObject.name, EditorStyles.label))
						{
							EditorGUIUtility.PingObject(thisPreset.presetObject);
						}
						GUILayout.EndHorizontal();
					}
				}
				else
				{
					GUI.enabled = false;
					GUILayout.Label (playgroundLanguage.empty);
					GUI.enabled = true;
				}
				EditorGUI.indentLevel--;
			}

			GUILayout.EndVertical();
		}

		// New category creation
		EditorGUILayout.Separator();
		GUILayout.BeginHorizontal();
		if (GUILayout.Button(playgroundLanguage.create, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
		{
			if (IsValidFolderName(createCategoryName))
			{
				createCategoryName = createCategoryName.Trim();
				string createdFolder = AssetDatabase.CreateFolder("Assets/"+playgroundSettings.playgroundPath+(playgroundSettings.examplePresetPath).Substring(0, playgroundSettings.examplePresetPath.Length-1), createCategoryName);
				if (createdFolder != null && createdFolder.Length > 0)
				{
					AssetDatabase.Refresh();
					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
					{
						if (AssetDatabase.AssetPathToGUID("Assets/"+cat.categoryLocation) == createdFolder)
						{
							cat.foldout = true;
							requestFocusControl = true;
							focusControlName = cat.categoryName;
							break;
						}
					}
					createCategoryName = "New Category";
					return;
				}
			}
		}
		createCategoryName = EditorGUILayout.TextField(createCategoryName, EditorStyles.toolbarTextField);
		GUILayout.EndHorizontal();

		GUILayout.EndVertical();

		GUILayout.EndScrollView();

		int selectedPresets = 0;
		bool isResourcesPresetsOnly = true;
		for (int i = 0; i<PlaygroundParticleWindowC.presetCategories.Count; i++)
		{
			for (int x = 0; x<PlaygroundParticleWindowC.presetCategories[i].presetObjects.Count; x++)
			{

				if (PlaygroundParticleWindowC.presetCategories[i].presetObjects[x].selected)
				{
					if (PlaygroundParticleWindowC.presetCategories[i].presetObjects[x].example)
						isResourcesPresetsOnly = false;
					selectedPresets++;
				}
			}
		}

		// Bottom toolbar for selected presets
		if (selectedPresets > 0)
		{
			EditorGUILayout.BeginHorizontal("box");
			EditorGUILayout.LabelField(playgroundLanguage.selected+": "+selectedPresets.ToString(), GUILayout.MaxWidth(90));

			// Move selected presets
			if (categoryNames == null || categoryNames.Length != PlaygroundParticleWindowC.presetCategories.Count+1)
			{
				categoryNames = new string[PlaygroundParticleWindowC.presetCategories.Count+1];
				categoryNames[0] = playgroundLanguage.move+"...";
				for (int i = 0; i<PlaygroundParticleWindowC.presetCategories.Count; i++)
					categoryNames[i+1] = PlaygroundParticleWindowC.presetCategories[i].categoryName;
			}
			int selectedMoveCategory = 0;
			EditorGUI.BeginChangeCheck();
			selectedMoveCategory = EditorGUILayout.Popup(selectedMoveCategory, categoryNames, EditorStyles.toolbarPopup);
			if (EditorGUI.EndChangeCheck())
			{
				if (selectedMoveCategory > 0)
				{
					List<Object> movedObjects = new List<Object>();
					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
					{
						foreach (PresetObjectC obj in cat.presetObjects)
						{
							if (obj.selected)
							{
								movedObjects.Add(obj.presetObject);
								AssetDatabase.MoveAsset(AssetDatabase.GetAssetPath(obj.presetObject), "Assets/"+PlaygroundParticleWindowC.presetCategories[selectedMoveCategory-1].categoryLocation+"/"+obj.presetObject.name);
							}
						}
					}
					AssetDatabase.Refresh();

					// Select the moved objects once again for less confusion
					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
						foreach (PresetObjectC obj in cat.presetObjects)
							if (movedObjects.Contains(obj.presetObject))
								obj.selected = true;

					// Open the index, correct if 'Uncategorized' got removed in the process
					int openIndex = selectedMoveCategory-1 < PlaygroundParticleWindowC.presetCategories.Count? selectedMoveCategory-1 : selectedMoveCategory-2;
					PlaygroundParticleWindowC.presetCategories[openIndex].foldout = true;
				}
			}

			GUILayout.Space (4f);

			// Convert selected presets to Resources
			GUI.enabled = !isResourcesPresetsOnly;
			if (GUILayout.Button (playgroundLanguage.convertTo+" "+playgroundLanguage.resources, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
			{
				if (EditorUtility.DisplayDialog(playgroundLanguage.convertPresetsIntoResources,
				                                playgroundLanguage.convertPresetsIntoResourcesText,
				                                playgroundLanguage.yes,
				                                playgroundLanguage.no))
				{
					List<Object> convertedObjects = new List<Object>();

					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
					{
						foreach (PresetObjectC obj in cat.presetObjects)
						{
							if (obj.selected)
							{
								if (!Directory.Exists (Application.dataPath+"/"+playgroundSettings.playgroundPath+playgroundSettings.presetPath))
								{
									Directory.CreateDirectory(Application.dataPath+"/"+playgroundSettings.playgroundPath+playgroundSettings.presetPath);
									AssetDatabase.Refresh();
								}
								convertedObjects.Add (obj.presetObject);
								AssetDatabase.MoveAsset (AssetDatabase.GetAssetPath(obj.presetObject), "Assets/"+playgroundSettings.playgroundPath+playgroundSettings.presetPath + obj.presetObject.name);
							}
						}
					}

					// Select the converted objects once again for less confusion
					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
						foreach (PresetObjectC obj in cat.presetObjects)
							if (convertedObjects.Contains(obj.presetObject))
								obj.selected = true;

					PlaygroundParticleWindowC.presetCategories[PlaygroundParticleWindowC.presetCategories.Count-1].foldout = true;
				}
			}
			GUI.enabled = true;

			GUILayout.Space (4f);

			// Remove selected presets
			if (GUILayout.Button (playgroundLanguage.remove, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
			{
				if (EditorUtility.DisplayDialog(playgroundLanguage.removeSelectedPresets,
				                                playgroundLanguage.removeSelectedPresetsText,
				                                playgroundLanguage.yes,
				                                playgroundLanguage.no))
				{
					foreach (PresetCategory cat in PlaygroundParticleWindowC.presetCategories)
					{
						foreach (PresetObjectC obj in cat.presetObjects)
						{
							if (obj.selected)
							{
								AssetDatabase.MoveAssetToTrash(AssetDatabase.GetAssetPath(obj.presetObject));
							}
						}
					}
				}
			}

			GUILayout.Space (4f);

			// Publish selected presets
			if (GUILayout.Button (playgroundLanguage.publish, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
			{
				PlaygroundCreatePresetWindowC.ShowWindowPublish();
			}

			EditorGUILayout.Separator();

			// Deselect selected presets
			if (GUILayout.Button (playgroundLanguage.deselectAll, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
			{
				for (int i = 0; i<PlaygroundParticleWindowC.presetCategories.Count; i++)
					for (int x = 0; x<PlaygroundParticleWindowC.presetCategories[i].presetObjects.Count; x++)
						PlaygroundParticleWindowC.presetCategories[i].presetObjects[x].selected = false;
			}
			EditorGUILayout.EndHorizontal();
		}

		EditorGUILayout.EndVertical();

		if (requestFocusControl)
		{
			EditorGUI.FocusTextInControl (focusControlName);
			requestFocusControl = false;
		}
	}

	bool IsValidFolderName (string folderName)
	{
		folderName = folderName.Trim();
		return (!string.IsNullOrEmpty(folderName) && folderName.IndexOfAny(invalidChars) < 0);
	}
}


text:
#include "control_node.h"
#include <boost/assign.hpp>
#include "base/task.h"

std::string ControlNode::hostname_;
std::string ControlNode::prog_name_;
std::string ControlNode::self_ip_;
DiscoveryServiceClient* ControlNode::ds_client_;
bool ControlNode::test_mode_;

//
// Default scheduler policy for control-node daemon and test processes
//
void ControlNode::SetDefaultSchedulingPolicy() {
    static bool policy_set_;

    if (policy_set_) return;

    policy_set_ = true;
    TaskScheduler *scheduler = TaskScheduler::GetInstance();
    TaskPolicy exclude_all;
    const char *task_ids[] = {
        "bgp::Config",
        "bgp::RTFilter",
        "bgp::SendTask",
        "bgp::ServiceChain",
        "bgp::StateMachine",
        "bgp::PeerMembership",
        "db::DBTable",
        "io::ReaderTask",
        "ifmap::StateMachine",
        "xmpp::StateMachine",
        "timer::TimerTask",
        "bgp::ShowCommand",
        "bgp::SendReadyTask",
        "bgp::StaticRoute",
    };
    int arraysize = sizeof(task_ids) / sizeof(char *);
    for (int i = 0; i < arraysize; ++i) {
        int task_id = scheduler->GetTaskId(task_ids[i]);
        exclude_all.push_back(TaskExclusion(task_id));
    }
    scheduler->SetPolicy(scheduler->GetTaskId("bgp::Config"), exclude_all);

    // Both ServiceChain and StaticRoute task have same mutual exclusion
    // task policy
    TaskPolicy mutual_exc_service_chain;
    const char *svc_chain_exclusion_task_ids[] = {
        "bgp::Config",
        "bgp::ServiceChain",
        "bgp::StaticRoute",
        "db::DBTable",
    };
    arraysize = sizeof(svc_chain_exclusion_task_ids) / sizeof(char *);
    for (int i = 0; i < arraysize; ++i) {
        int task_id = scheduler->GetTaskId(svc_chain_exclusion_task_ids[i]);
        mutual_exc_service_chain.push_back(TaskExclusion(task_id));
    }
    scheduler->SetPolicy(scheduler->GetTaskId("bgp::ServiceChain"),
                            mutual_exc_service_chain);

    scheduler->SetPolicy(scheduler->GetTaskId("bgp::StaticRoute"),
                            mutual_exc_service_chain);

    // TODO: There should be exclusion between Reader and StateMachine
    // tasks with the same index only (vs all indices).
    TaskPolicy sm_task_policy = boost::assign::list_of
        (TaskExclusion(scheduler->GetTaskId("io::ReaderTask")));
    scheduler->SetPolicy(scheduler->GetTaskId("bgp::StateMachine"),
                            sm_task_policy);
    scheduler->SetPolicy(scheduler->GetTaskId("xmpp::StateMachine"),
                            sm_task_policy);

    TaskPolicy peer_membership_policy =
        boost::assign::list_of
        (TaskExclusion(scheduler->GetTaskId("db::DBTable")))
        (TaskExclusion(scheduler->GetTaskId("bgp::SendTask")))
        (TaskExclusion(scheduler->GetTaskId("bgp::ShowCommand")))
        (TaskExclusion(scheduler->GetTaskId("bgp::StateMachine")))
        (TaskExclusion(scheduler->GetTaskId("xmpp::StateMachine")));

    scheduler->SetPolicy(scheduler->GetTaskId("bgp::PeerMembership"),
                            peer_membership_policy);

    TaskPolicy exclude_send_ready =
        boost::assign::list_of
        (TaskExclusion(scheduler->GetTaskId("bgp::SendTask")))
        (TaskExclusion(scheduler->GetTaskId("bgp::PeerMembership")));
    scheduler->SetPolicy(scheduler->GetTaskId("bgp::SendReadyTask"), exclude_send_ready);

    TaskPolicy rtfilter_task_policy =
        boost::assign::list_of
        (TaskExclusion(scheduler->GetTaskId("db::DBTable")))
        (TaskExclusion(scheduler->GetTaskId("bgp::StateMachine")))
        (TaskExclusion(scheduler->GetTaskId("bgp::RTFilter")))
        (TaskExclusion(scheduler->GetTaskId("bgp::Config")));

    scheduler->SetPolicy(scheduler->GetTaskId("bgp::RTFilter"),
                            rtfilter_task_policy);
}


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
import { PipMediaService, PipSidenavService, PipRightnavService } from 'pip-webui2-layouts';
import { PipThemesService } from 'pip-webui2-themes';

import { NavpartsExampleModule } from './navparts-example.module';
import { NavpartsExampleComponent } from './navparts-example.component';

describe('NavpartsExampleComponent', () => {
  let component: NavpartsExampleComponent;
  let fixture: ComponentFixture<NavpartsExampleComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        NoopAnimationsModule,
        NavpartsExampleModule,
        TranslateModule.forRoot()
      ],
      providers: [
        PipMediaService,
        PipSidenavService,
        PipRightnavService,
        PipThemesService
      ]
    })
      .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(NavpartsExampleComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


text:
/**
* Season.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs        :: http://sailsjs.org/#!documentation/models
*/

module.exports = {
  attributes: {
    // Primitives
    id: {
   type: 'integer',
   autoIncrement: true,
   primaryKey: true,
   unique: true
    },
    season: {
      type: 'string'
    },
    // Methods
  }
};


text:
#include "SbetWriter.hpp"

#include <pdal/PointView.hpp>
#include <pdal/pdal_macros.hpp>

namespace pdal
{

static PluginInfo const s_info = PluginInfo(
    "writers.sbet",
    "SBET Writer",
    "http://pdal.io/stages/writers.sbet.html" );

CREATE_STATIC_PLUGIN(1, 0, SbetWriter, Writer, s_info)

std::string SbetWriter::getName() const { return s_info.name; }

void SbetWriter::processOptions(const Options& options)
{
    m_filename = options.getOption("filename").getValue<std::string>();
}

void SbetWriter::ready(PointTableRef)
{
    m_stream.reset(new OLeStream(m_filename));
}

void SbetWriter::write(const PointViewPtr view)
{
    Dimension::IdList dims = getDefaultDimensions();
    for (PointId idx = 0; idx < view->size(); ++idx)
    {
        for (auto di = dims.begin(); di != dims.end(); ++di)
        {
            // If a dimension doesn't exist, write 0.
            Dimension::Id::Enum dim = *di;
            *m_stream << (view->hasDim(dim) ?
                view->getFieldAs<double>(dim, idx) : 0.0);
        }
    }
}

} // namespace pdal


text:
package org.apache.commons.crypto.examples;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Properties;

import org.apache.commons.crypto.random.CryptoRandom;
import org.apache.commons.crypto.random.CryptoRandomFactory;

/**
 * Example showing use of the CryptoRandom API
 */
public class RandomExample {

    public static void main(String []args) throws GeneralSecurityException, IOException {
        // Constructs a byte array to store random data.
        byte[] key = new byte[16];
        byte[] iv = new byte[32];

        Properties properties = new Properties();
        properties.put(CryptoRandomFactory.CLASSES_KEY,
            CryptoRandomFactory.RandomProvider.OPENSSL.getClassName());

        // Gets the 'CryptoRandom' instance.
        try (CryptoRandom random = CryptoRandomFactory.getCryptoRandom(properties)) {

            // Show the actual class (may be different from the one requested)
            System.out.println(random.getClass().getCanonicalName());

            // Generate random bytes and places them into the byte arrays.
            random.nextBytes(key);
            random.nextBytes(iv);

        }

        // Show the generated output
        System.out.println(Arrays.toString(key));
        System.out.println(Arrays.toString(iv));
    }
}


text:
import datetime

from django import test

from trader.core.models import User, BillingAccount, BTCOrder

class BTCOrderTestCase(test.TestCase):
    def setUp(self):
        u = User.objects.create(username='username')
        ba = BillingAccount.objects.create(user=u)
        self.order = BTCOrder.objects.create(billing_account=ba, amount_brl=10., amount_btc=.5)

    def test_order_created(self):
        """Order should be created."""
        self.assertTrue(BTCOrder.objects.exists())

    def test_order_btc_amount_type(self):
        """Order BTC amount should be a decimal."""
        self.assertIsInstance(self.order.amount_btc, float)

    def test_order_brl_amount_type(self):
        """Order BRL amount should be a decimal."""
        self.assertIsInstance(self.order.amount_brl, float)

    def test_order_btc_amount_value(self):
        """Order BTC amount should be near 0.5."""
        self.assertAlmostEqual(self.order.amount_btc, 0.5)

    def test_order_brl_amount_value(self):
        """Order BRL amount should be near 10."""
        self.assertAlmostEqual(self.order.amount_brl, 10.)

    def test_order_state_default_value(self):
        """Order default state should be PENDING."""
        self.assertEqual(self.order.order_state, 'PENDING')

    def test_order_has_type(self):
        """Order should contain str type."""
        self.assertIsInstance(self.order.type, str)

    def test_order_default_type(self):
        """Default type of order should be BUYBTC."""
        self.assertEqual(self.order.type, "BUYBTC")

    def test_has_created_at_field(self):
        """Order should have datetime created_at field."""
        self.assertIsInstance(self.order.created_at, datetime.datetime)

    def test_has_modified_at_field(self):
        """Order should have datetime modified_at field."""
        self.assertIsInstance(self.order.modified_at, datetime.datetime)

    def test_exchange_rate(self):
        """Exchange rate should be BRL / BTC."""
        self.assertEqual(self.order.exchange_rate, 20)

    def test_str_method(self):
        """__str__() method should display username, amount and currency."""
        expected = ['username', 'BRL', '10.0', '0.5', 'PENDING']
        with self.subTest():
            for e in expected:
                self.assertIn(e, str(self.order))


text:
MathJax.Localization.addTranslation("it","HTML-CSS",{
        version: "2.7.2-beta.0",
        isLoaded: true,
        strings: {
          LoadWebFont: "Caricamento web-font %1",
          CantLoadWebFont: "Impossibile caricare il web font %1",
          FirefoxCantLoadWebFont: "Firefox non pu\u00F2 scaricare i web font dal server remoto",
          CantFindFontUsing: "Impossibile trovare un font valido tra %1",
          WebFontsNotAvailable: "Web font non disponibili -- font immagini in uso"
        }
});

MathJax.Ajax.loadComplete("[MathJax]/localization/it/HTML-CSS.js");


text:
from molecule.command import verify

def test_execute(mocker, patched_logger_info, patched_testinfra,
                 config_instance):
    v = verify.Verify(config_instance)
    v.execute()

    x = [
        mocker.call("Scenario: 'default'"),
        mocker.call("Action: 'verify'"),
    ]

    assert x == patched_logger_info.mock_calls

    patched_testinfra.assert_called_once_with()


text:
{% load staticfiles %}
{% load i18n %}
<!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="Chamber of commerce, Chambre de Commerce, Canada, Madagascar, Quebec">
    <meta name="author" content="lerina : J-Y RAZAFY">

    {% block title %}<title>Chamber of Commerce</title>{% endblock title %}

    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">

    <link href="{% static 'css/one-page-wonder.css' %}" rel="stylesheet">

    {% block content %}{% endblock content %}

Copyright © Canadian Malagasy Chamber of Commerce 2015

{% include "footer.html" %}

{% block extra_js %}{% endblock extra_js %}


text:
package cmd

import (
	"bytes"
	"errors"
	"fmt"
	"strings"

	// Should only be imported here to avoid leaking use of goflags through project
	goflags "github.com/jessevdk/go-flags"
)

type Factory struct {
	deps BasicDeps
}

func NewFactory(deps BasicDeps) Factory {
	return Factory{deps: deps}
}

func (f Factory) New(args []string) (Cmd, error) {
	var cmdOpts interface{}

	boshOpts := &BoshOpts{}

	boshOpts.VersionOpt = func() error {
		return &goflags.Error{
			Type:    goflags.ErrHelp,
			Message: fmt.Sprintf("version %s\n", VersionLabel),
		}
	}

	parser := goflags.NewParser(boshOpts, goflags.HelpFlag|goflags.PassDoubleDash)

	for _, c := range parser.Commands() {
		docsURL := "https://bosh.io/docs/cli-v2#" + c.Name

		c.LongDescription = c.ShortDescription + "\n\n" + docsURL

		fillerLen := 50 - len(c.ShortDescription)
		if fillerLen < 0 {
			fillerLen = 0
		}

		c.ShortDescription += strings.Repeat(" ", fillerLen+1) + docsURL
	}

	parser.CommandHandler = func(command goflags.Commander, extraArgs []string) error {
		if opts, ok := command.(*SSHOpts); ok {
			if len(opts.Command) == 0 {
				opts.Command = extraArgs
				extraArgs = []string{}
			}
		}

		if opts, ok := command.(*AliasEnvOpts); ok {
			opts.URL = boshOpts.EnvironmentOpt
			opts.CACert = boshOpts.CACertOpt
		}

		if opts, ok := command.(*EventsOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if opts, ok := command.(*VMsOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if opts, ok := command.(*InstancesOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if opts, ok := command.(*TasksOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if opts, ok := command.(*TaskOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if opts, ok := command.(*CancelTasksOpts); ok {
			opts.Deployment = boshOpts.DeploymentOpt
		}

		if len(extraArgs) > 0 {
			errMsg := "Command '%T' does not support extra arguments: %s"
			return fmt.Errorf(errMsg, command, strings.Join(extraArgs, ", "))
		}

		cmdOpts = command

		return nil
	}

	boshOpts.SSH.GatewayFlags.UUIDGen = f.deps.UUIDGen
	boshOpts.SCP.GatewayFlags.UUIDGen = f.deps.UUIDGen
	boshOpts.Logs.GatewayFlags.UUIDGen = f.deps.UUIDGen

	helpText := bytes.NewBufferString("")
	parser.WriteHelp(helpText)

	_, err := parser.ParseArgs(args)

	if boshOpts.UsernameOpt != "" {
		return Cmd{}, errors.New("BOSH_USER is deprecated use BOSH_CLIENT instead")
	}

	// --help and --version result in errors; turn them into successful output cmds
	if typedErr, ok := err.(*goflags.Error); ok {
		if typedErr.Type == goflags.ErrHelp {
			cmdOpts = &MessageOpts{Message: typedErr.Message}
			err = nil
		}
	}

	if _, ok := cmdOpts.(*HelpOpts); ok {
		cmdOpts = &MessageOpts{Message: helpText.String()}
	}

	return NewCmd(*boshOpts, cmdOpts, f.deps), err
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" >

        <ImageView
            android:id="@+id/launcher_vehicle_image"
            android:src="@drawable/ic_vehicle_unknown"
            android:padding="20dp"
            android:layout_width="300dp"
            android:layout_height="210dp"
            android:layout_centerHorizontal="true" />

        <com.platypus.android.server.gui.SwipeOnlySwitch
            android:id="@+id/launcher_launch_switch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/launcher_vehicle_image"
            android:layout_centerHorizontal="true"
            android:thumb="@drawable/fragment_launcher_launch_switch_thumb"
            android:track="@drawable/fragment_launcher_launch_switch_track"
            android:switchMinWidth="280dip"/>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true">

        <Button
            android:id="@+id/launcher_home_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text="@string/launcher_home_button_title" />

        <TextView
            android:id="@+id/launcher_home_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/launcher_home_button"
            android:layout_centerHorizontal="true"
            android:text="@string/launcher_home_text_content" />

        <TextView
            android:id="@+id/ip_address_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/launcher_home_text"
            android:layout_centerHorizontal="true"
            android:textStyle="bold"
            android:textSize="24sp"
            android:text="@string/launcher_ip_text_content" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:rotation="90">

        <TextView
            android:id="@+id/launcher_swipe_left_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:singleLine="true"
            android:text="@string/launcher_swipe_left_text_content" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:rotation="-90">

        <TextView
            android:id="@+id/launcher_swipe_right_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:singleLine="true"
            android:text="@string/launcher_swipe_right_text_content" />
    </RelativeLayout>
</RelativeLayout>


text:
package com.ibm.mqlight.api.impl;

import java.nio.ByteBuffer;
import java.util.Map;

import com.ibm.mqlight.api.BytesDelivery;
import com.ibm.mqlight.api.QOS;
import com.ibm.mqlight.api.impl.engine.DeliveryRequest;

class BytesDeliveryImpl extends DeliveryImpl implements BytesDelivery {

    private final ByteBuffer data;

    protected BytesDeliveryImpl(NonBlockingClientImpl client, QOS qos, String shareName, String topic,
                                String topicPattern, long ttl, ByteBuffer data, Map<String, Object> properties, DeliveryRequest req) {
        super(client, qos, shareName, topic, topicPattern, ttl, properties, req);
        this.data = data;
    }

    @Override
    public Type getType() {
        return Type.BYTES;
    }

    @Override
    public ByteBuffer getData() {
        return data;
    }

}


text:
package mockstorage

import (
	"go.etcd.io/etcd/pkg/testutil"
	"go.etcd.io/etcd/raft"
	"go.etcd.io/etcd/raft/raftpb"
)

type storageRecorder struct {
	testutil.Recorder
	dbPath string // must have '/' suffix if set
}

func NewStorageRecorder(db string) *storageRecorder {
	return &storageRecorder{&testutil.RecorderBuffered{}, db}
}

func NewStorageRecorderStream(db string) *storageRecorder {
	return &storageRecorder{testutil.NewRecorderStream(), db}
}

func (p *storageRecorder) Save(st raftpb.HardState, ents []raftpb.Entry) error {
	p.Record(testutil.Action{Name: "Save"})
	return nil
}

func (p *storageRecorder) SaveSnap(st raftpb.Snapshot) error {
	if !raft.IsEmptySnap(st) {
		p.Record(testutil.Action{Name: "SaveSnap"})
	}
	return nil
}

func (p *storageRecorder) Close() error { return nil }


text:
package org.jetbrains.plugins.scala.lang.psi.impl.expr

import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScConstrExpr
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
/**
* @author Alexander Podkhalyuzin
* Date: 22.02.2008
*/

class ScConstrExprImpl(node: ASTNode) extends ScalaPsiElementImpl(node) with ScConstrExpr {
  override def createMirror(text: String): PsiElement = {
    ScalaPsiElementFactory.createConstructorBodyWithContextFromText(text, getContext, this)
  }

  override def toString: String = "ConstructorExpression"
}


text:
import Option from './option'

export default class Configuration {
  constructor(options=[]) {
    this.options = options;
  }

  addTo(command) {
    if (this.options == null) {
      return;
    }
    this.options.forEach(o => {
      command.option(o.command, o.description, o.value);
    })
  }

  merge(other, fromCommander=false) {
    if (other == null) {
      return this;
    }
    let result = other;
    if (fromCommander) {
      result = {};
      for (let option of this.options) {
        let name = option.name;
        if (other.hasOwnProperty(name)) {
          result[name] = other[name]
        }
      }
    }
    Object.keys(other).forEach(key => {
      this[key] = other[key];
    });
    return this;
  }

  static create(raw) {
    let options = raw.map(Option.create);
    let config = new Configuration(options);
    options.forEach(o => {
      config[o.name] = o.value;
    });
    return config;
  }
}


text:
require 'rack/test'

# Always use local Rulers first
this_dir = File.join(File.dirname(__FILE__), "..")
$LOAD_PATH.unshift File.expand_path(this_dir)

require 'ruby_on_wheels'


text:
package cumulative

import (
	"context"

	"github.com/go-graphite/carbonapi/expr/consolidations"
	"github.com/go-graphite/carbonapi/expr/helper"
	"github.com/go-graphite/carbonapi/expr/interfaces"
	"github.com/go-graphite/carbonapi/expr/types"
	"github.com/go-graphite/carbonapi/pkg/parser"
)

type cumulative struct {
	interfaces.FunctionBase
}

func GetOrder() interfaces.Order {
	return interfaces.Any
}

func New(configFile string) []interfaces.FunctionMetadata {
	res := make([]interfaces.FunctionMetadata, 0)
	f := &cumulative{}
	functions := []string{"cumulative"}
	for _, n := range functions {
		res = append(res, interfaces.FunctionMetadata{Name: n, F: f})
	}
	return res
}

// cumulative(seriesList)
func (f *cumulative) Do(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error) {
	arg, err := helper.GetSeriesArg(e.Args()[0], from, until, values)
	if err != nil {
		return nil, err
	}
	var results []*types.MetricData

	for _, a := range arg {
		r := *a
		r.AggregateFunction = consolidations.AggSum
		results = append(results, &r)
	}
	return results, nil
}

// Description is auto-generated description, based on output of https://github.com/graphite-project/graphite-web
func (f *cumulative) Description() map[string]types.FunctionDescription {
	return map[string]types.FunctionDescription{
		"cumulative": {
			Description: "Takes one metric or a wildcard seriesList.\n\nWhen a graph is drawn where width of the graph size in pixels is smaller than\nthe number of datapoints to be graphed, Graphite consolidates the values to\nto prevent line overlap. The cumulative() function changes the consolidation\nfunction from the default of 'average' to 'sum'. This is especially useful in\nsales graphs, where fractional values make no sense and a 'sum' of consolidated\nvalues is appropriate.\n\nAlias for :func:`consolidateBy(series, 'sum') <graphite.render.functions.consolidateBy>`\n\n.. code-block:: none\n\n  &target=cumulative(Sales.widgets.largeBlue)",
			Function:    "cumulative(seriesList)",
			Group:       "Special",
			Module:      "graphite.render.functions",
			Name:        "cumulative",
			Params: []types.FunctionParam{
				{
					Name:     "seriesList",
					Required: true,
					Type:     types.SeriesList,
				},
			},
		},
	}
}


text:
//
//  NSURLSessionTask+RubickSwizzled.m
//  Rubick
//
//  Created by cloay on 2017/1/17.
//  Copyright © 2017年 Cloay. All rights reserved.
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.

#import "NSURLSessionTask+RubickSwizzled.h"
#import <objc/runtime.h>
#import "Rubick.h"

@implementation NSURLSessionTask (RubickSwizzled)

- (NSTimeInterval)startTime {
    id object = objc_getAssociatedObject(self, @"startTime");
    return [object doubleValue];
}

- (void)setStartTime:(NSTimeInterval)startTime {
    [self willChangeValueForKey:@"startTime"];
    objc_setAssociatedObject(self, @"startTime", [NSNumber numberWithDouble:startTime], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
    [self didChangeValueForKey:@"startTime"];
}

+ (void)rubickSwizzled {
    //For detail goto https://github.com/Alamofire/Alamofire
    if (NSClassFromString(@"NSURLSessionTask")) {
        /**
         iOS 7 and iOS 8 differ in NSURLSessionTask implementation, which makes the next bit of code a bit tricky.
         Many Unit Tests have been built to validate as much of this behavior has possible.
         Here is what we know:
         - NSURLSessionTasks are implemented with class clusters, meaning the class you request from the API isn't actually the type of class you will get back.
         - Simply referencing `[NSURLSessionTask class]` will not work. You need to ask an `NSURLSession` to actually create an object, and grab the class from there.
         - On iOS 7, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `__NSCFURLSessionTask`.
         - On iOS 8, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `NSURLSessionTask`.
         - On iOS 7, `__NSCFLocalSessionTask` and `__NSCFURLSessionTask` are the only two classes that have their own implementations of `resume` and `suspend`, and `__NSCFLocalSessionTask` DOES NOT CALL SUPER. This means both classes need to be swizzled.
         - On iOS 8, `NSURLSessionTask` is the only class that implements `resume` and `suspend`. This means this is the only class that needs to be swizzled.
         - Because `NSURLSessionTask` is not involved in the class hierarchy for every version of iOS, its easier to add the swizzled methods to a dummy class and manage them there.

         Some Assumptions:
         - No implementations of `resume` or `suspend` call super. If this were to change in a future version of iOS, we'd need to handle it.
         - No background task classes override `resume` or `suspend`

         The current solution:
         1) Grab an instance of `__NSCFLocalDataTask` by asking an instance of `NSURLSession` for a data task.
         2) Grab a pointer to the original implementation of `af_resume`
         3) Check to see if the current class has an implementation of resume. If so, continue to step 4.
         4) Grab the super class of the current class.
         5) Grab a pointer for the current class to the current implementation of `resume`.
         6) Grab a pointer for the super class to the current implementation of `resume`.
         7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods
         8) Set the current class to the super class, and repeat steps 3-8
         */
        NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
        NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnonnull"
        NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil];
#pragma clang diagnostic pop
        IMP rkResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(rk_resume)));
        Class currentClass = [localDataTask class];

        while (class_getInstanceMethod(currentClass, @selector(resume))) {
            Class superClass = [currentClass superclass];
            IMP classResumeIMP = method_getImplementation(class_getInstanceMethod(currentClass, @selector(resume)));
            IMP superclassResumeIMP = method_getImplementation(class_getInstanceMethod(superClass, @selector(resume)));
            if (classResumeIMP != superclassResumeIMP &&
                rkResumeIMP != classResumeIMP) {
                [self swizzleMethod:currentClass originalSelector:@selector(resume) swizzledClass:self swizzledSelector:@selector(rk_resume)];
            }
            currentClass = [currentClass superclass];
        }

        [localDataTask cancel];
        [session finishTasksAndInvalidate];
    }
}

- (void)rk_resume {
    [self rk_resume];
    self.startTime = [[NSDate date] timeIntervalSince1970]*1000;
    RKLog(@"startTime = %.3f ms", self.startTime);
}

+ (void)swizzleMethod:(Class)originCls originalSelector:(SEL)originalSelector swizzledClass:(Class)swizzledCls swizzledSelector:(SEL)swizzledSelector {
    Method originalMethod = class_getInstanceMethod(originCls, originalSelector);
    Method swizzledMethod = class_getInstanceMethod(swizzledCls, swizzledSelector);

    // class_addMethod will fail if original method already exists, the method doesn't exist and we just added one
    BOOL didAddMethod = class_addMethod(originCls, swizzledSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));

    if (didAddMethod) {
        swizzledMethod = class_getInstanceMethod(originCls, swizzledSelector);
        method_exchangeImplementations(originalMethod, swizzledMethod);
    }
}

@end


text:
<?php

/**
 * Returns a value from a superglobal array corresponding to the
 * given key.
 *
 * Option: the key to look up within the superglobal array
 *
 * Also, it is possible that a superglobal variable is not populated by PHP
 * because of the settings in the variables-order ini directive. In this case
 * the converter will return an empty value.
 *
 * @see http://php.net/manual/en/language.variables.superglobals.php
 * @see http://www.php.net/manual/en/ini.core.php#ini.variables-order
 *
 * @package log4php
 * @subpackage pattern
 * @version $Revision$
 * @since 2.3
 */
abstract class LoggerPatternConverterSuperglobal extends LoggerPatternConverter {

	/**
	 * Name of the superglobal variable, to be defined by subclasses.
	 * For example: "_SERVER" or "_ENV".
	 */
	protected $name;

	protected $value = '';

	public function activateOptions() {
		// Read the key from options array
		if (isset($this->option) && $this->option !== '') {
			$key = $this->option;
		}

		/*
		 * There is a bug in PHP which doesn't allow superglobals to be
		 * accessed when their name is stored in a variable, e.g.:
		 *
		 * $name = '_SERVER';
		 * $array = $$name;
		 *
		 * This code does not work when run from within a method (only when run
		 * in global scope). But the following code does work:
		 *
		 * $name = '_SERVER';
		 * global $$name;
		 * $array = $$name;
		 *
		 * That's why global is used here.
		 */
		global ${$this->name};

		// Check the given superglobal exists. It is possible that it is not initialized.
		if (!isset(${$this->name})) {
			$class = get_class($this);
			trigger_error("log4php: $class: Cannot find superglobal variable \${$this->name}.", E_USER_WARNING);
			return;
		}

		$source = ${$this->name};

		// When the key is set, display the matching value
		if (isset($key)) {
			if (isset($source[$key])) {
				$this->value = $source[$key];
			}
		}

		// When the key is not set, display all values
		else {
			$values = array();
			foreach($source as $key => $value) {
				$values[] = "$key=$value";
			}
			$this->value = implode(', ', $values);
		}
	}

	public function convert(LoggerLoggingEvent $event) {
		return $this->value;
	}
}


text:
module Fastlane
  module Appicon
    VERSION = "0.8.0"
  end
end


text:
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.ImmutableTable;

class BuilderSingularGuavaListsSets<T> {
	private ImmutableList<T> cards;
	private ImmutableCollection<? extends Number> frogs;
	@SuppressWarnings("all")
	private ImmutableSet rawSet;
	private ImmutableSortedSet<String> passes;
	private ImmutableTable<? extends Number, ? extends Number, String> users;

	@java.lang.SuppressWarnings("all")
	BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) {
		this.cards = cards;
		this.frogs = frogs;
		this.rawSet = rawSet;
		this.passes = passes;
		this.users = users;
	}

	@java.lang.SuppressWarnings("all")
	public static class BuilderSingularGuavaListsSetsBuilder<T> {
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableList.Builder<T> cards;
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableList.Builder<Number> frogs;
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet;
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableSortedSet.Builder<String> passes;
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users;

		@java.lang.SuppressWarnings("all")
		BuilderSingularGuavaListsSetsBuilder() {
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> card(final T card) {
			if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder();
			this.cards.add(card);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) {
			if (cards == null) {
				throw new java.lang.NullPointerException("cards cannot be null");
			}
			if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder();
			this.cards.addAll(cards);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> clearCards() {
			this.cards = null;
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) {
			if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder();
			this.frogs.add(frog);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) {
			if (frogs == null) {
				throw new java.lang.NullPointerException("frogs cannot be null");
			}
			if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder();
			this.frogs.addAll(frogs);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() {
			this.frogs = null;
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) {
			if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder();
			this.rawSet.add(rawSet);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) {
			if (rawSet == null) {
				throw new java.lang.NullPointerException("rawSet cannot be null");
			}
			if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder();
			this.rawSet.addAll(rawSet);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() {
			this.rawSet = null;
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) {
			if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
			this.passes.add(pass);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) {
			if (passes == null) {
				throw new java.lang.NullPointerException("passes cannot be null");
			}
			if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
			this.passes.addAll(passes);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> clearPasses() {
			this.passes = null;
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> user(final Number rowKey, final Number columnKey, final String value) {
			if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder();
			this.users.put(rowKey, columnKey, value);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) {
			if (users == null) {
				throw new java.lang.NullPointerException("users cannot be null");
			}
			if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder();
			this.users.putAll(users);
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> clearUsers() {
			this.users = null;
			return this;
		}

		@java.lang.SuppressWarnings("all")
		public BuilderSingularGuavaListsSets<T> build() {
			com.google.common.collect.ImmutableList<T> cards = this.cards == null ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build();
			com.google.common.collect.ImmutableCollection<Number> frogs = this.frogs == null ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build();
			com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = this.rawSet == null ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build();
			com.google.common.collect.ImmutableSortedSet<String> passes = this.passes == null ? com.google.common.collect.ImmutableSortedSet.<String>of() : this.passes.build();
			com.google.common.collect.ImmutableTable<Number, Number, String> users = this.users == null ? com.google.common.collect.ImmutableTable.<Number, Number, String>of() : this.users.build();
			return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes, users);
		}

		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		public java.lang.String toString() {
			return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ", users=" + this.users + ")";
		}
	}

	@java.lang.SuppressWarnings("all")
	public static <T> BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> builder() {
		return new BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T>();
	}
}


text:
namespace {

// From "man 2 intro", the largest errno is |EOPNOTSUPP|, which is
// |102|.  Since the histogram memory usage is proportional to this
// number, using the |102| directly rather than the macro.
const int kMaxErrno = 102;

}  // namespace

// This class is used to funnel messages to a single instance of the browser
// process. This is needed for several reasons on other platforms.
//
// On Windows, when the user re-opens the application from the shell (e.g. an
// explicit double-click, a shortcut that opens a webpage, etc.) we need to send
// the message to the currently-existing copy of the browser.
//
// On Linux, opening a URL is done by creating an instance of the web browser
// process and passing it the URL to go to on its commandline.
//
// Neither of those cases apply on the Mac. Launch Services ensures that there
// is only one instance of the process, and we get URLs to open via AppleEvents
// and, once again, the Launch Services system. We have no need to manage this
// ourselves.  An exclusive lock is used to flush out anyone making incorrect
// assumptions.

ProcessSingleton::ProcessSingleton(const FilePath& user_data_dir)
    : locked_(false),
      foreground_window_(NULL),
      lock_path_(user_data_dir.Append(chrome::kSingletonLockFilename)),
      lock_fd_(-1) {
}

ProcessSingleton::~ProcessSingleton() {
  // Make sure the lock is released.  Process death will also release
  // it, even if this is not called.
  Cleanup();
}

ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
  // This space intentionally left blank.
  return PROCESS_NONE;
}

ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
  // Windows tries NotifyOtherProcess() first.
  return Create() ? PROCESS_NONE : PROFILE_IN_USE;
}

// Attempt to acquire an exclusive lock on an empty file in the
// profile directory.  Returns |true| if it gets the lock.  Returns
// |false| if the lock is held, or if there is an error.
// TODO(shess): Rather than logging failures, popup an alert.  Punting
// that for now because it would require confidence that this code is
// never called in a situation where an alert wouldn't work.
// http://crbug.com/59061
bool ProcessSingleton::Create() {
  DCHECK_EQ(-1, lock_fd_) << "lock_path_ is already open.";

  lock_fd_ = HANDLE_EINTR(open(lock_path_.value().c_str(),
                               O_RDONLY | O_CREAT, 0644));
  if (lock_fd_ == -1) {
    const int capture_errno = errno;
    DPCHECK(lock_fd_ != -1) << "Unexpected failure opening profile lockfile";
    UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.OpenError",
                              capture_errno, kMaxErrno);
    return false;
  }

  // Acquire an exclusive lock in non-blocking fashion.  If the lock
  // is already held, this will return |EWOULDBLOCK|.
  int rc = HANDLE_EINTR(flock(lock_fd_, LOCK_EX|LOCK_NB));
  if (rc == -1) {
    const int capture_errno = errno;
    DPCHECK(errno == EWOULDBLOCK)
        << "Unexpected failure locking profile lockfile";

    Cleanup();

    // Other errors indicate something crazy is happening.
    if (capture_errno != EWOULDBLOCK) {
      UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.LockError",
                                capture_errno, kMaxErrno);
      return false;
    }

    // The file is open by another process and locked.
    LOG(ERROR) << "Unable to obtain profile lock.";
    return false;
  }

  return true;
}

void ProcessSingleton::Cleanup() {
  // Closing the file also releases the lock.
  if (lock_fd_ != -1) {
    int rc = HANDLE_EINTR(close(lock_fd_));
    DPCHECK(!rc) << "Closing lock_fd_:";
  }
  lock_fd_ = -1;
}


text:
"""
<Program>
  log.py

<Started>
  6 July 2009

<Author>
  Justin Samuel

<Purpose>
  This module provides logging functionality to be used within seattlegeni.
  All seattlegeni code should log through this module rather than using
  print() or directly using the repy logging module. This ensures that only
  one module (this one) determines where log messages actually go for all
  of seattlegeni. (This module may in turn use the repy logging module, but
  client code should be unaware of that.)

  Logging output done by this module will try to include a request_id with
  each log message so that it is possible to differentiate multiple requests
  or threads running at the same time.

  Currently, our custom django middleware at website/middleware/logrequest.py
  calls log_start_request() when a new request comes in.

  Using this module from outside of a django website means that client code
  should first call log_start_request() or set_request_id() if it wants
  log messages from a thread to be logged with an identifier.
"""

import random
import sys
import threading
from datetime import datetime

# We use a thread-local data store for tracking the request identifier
# so that we can log the associated request id even when the request
# object isn't among a function's arguments.
request_context = threading.local()

LOG_LEVEL_DEBUG = 1
LOG_LEVEL_INFO = 2
LOG_LEVEL_ERROR = 3
LOG_LEVEL_CRITICAL = 4
LOG_LEVEL_NONE = 5

# Default log level of DEBUG.
loglevel = LOG_LEVEL_DEBUG

def set_log_level(level):
  global loglevel
  loglevel = level

def debug(message):
  if loglevel <= LOG_LEVEL_DEBUG:
    print >> sys.stderr, _get_time() + " DEBUG " + _get_request_id() + " " + str(message)
    sys.stderr.flush()

def info(message):
  if loglevel <= LOG_LEVEL_INFO:
    print >> sys.stderr, _get_time() + " INFO " + _get_request_id() + " " + str(message)
    sys.stderr.flush()

def error(message):
  if loglevel <= LOG_LEVEL_ERROR:
    print >> sys.stderr, _get_time() + " ERROR " + _get_request_id() + " " + str(message)
    sys.stderr.flush()

def critical(message):
  if loglevel <= LOG_LEVEL_CRITICAL:
    print >> sys.stderr, _get_time() + " CRITICAL " + _get_request_id() + " " + str(message)
    sys.stderr.flush()

def _get_request_id():
  if not hasattr(request_context, 'request_id'):
    set_request_id()
  return request_context.request_id

def _get_time():
  return "[" + datetime.now().isoformat(' ') + "]"

def log_start_request(request):
  """
  Create a unique request id and store it in request_context if it isn't
  already set there. This way it will be available to future log calls.
  """
  request_id = _generate_request_id_from_request(request)
  set_request_id(request_id)

  messagelist = []

  messagelist.append("Request started.")

  # See http://docs.djangoproject.com/en/dev/ref/request-response/ for a list
  # of attributes of the HttpRequest object that we could potentially log.
  messagelist.append(request.method)
  messagelist.append(request.path)

  # Log the request variables.
  # We ignore the fact that there could be query string variables in a POST request.
  if request.method == "GET":
    messagelist.append(str(request.GET))
  else:
    clean_post_querydict = request.POST.copy()
    for key in request.POST:
      # TODO: need to prevent logging password/apikey in xmlrpc requests
      if "password" in key:
        clean_post_querydict[key] = "[REMOVED]"
    messagelist.append(str(clean_post_querydict))

  if request.user.is_authenticated():
    messagelist.append("logged_in_user:" + str(request.user.username))
  else:
    messagelist.append("logged_in_user:-")

  info(' '.join(messagelist))

def set_request_id(request_id=None):
  """
  Sets the request id. This will be used in all future log messages performed
  by the current thread.
  """
  if request_id is None:
    request_id = _generate_request_id()

  request_context.request_id = str(request_id)

def _generate_request_id():
  RANDMIN = 100000000
  RANDMAX = 999999999
  return str(random.randint(RANDMIN, RANDMAX))

def _generate_request_id_from_request(request):
  """
  Create a unique tag for the request, to make it easier to follow its log
  entries.

  Based on the idea from:
  http://www.fairviewcomputing.com/blog/2008/03/05/django-request-logging/
  """
  # If Apache's mod_unique_id is in use, use that. Otherwise, create one.
  if request.META.has_key('UNIQUE_ID'):
    return str(request.META['UNIQUE_ID'])
  else:
    return _generate_request_id()


text:
Proguard
===============

This file describes which proguard rules **should** be used to preserve *proper working* of the
source code of this library when a proguard process is applied to a project that depends on this library.

> **Note, that proguard rules provided here are not guarantied to ensure obfuscation that will not
affect the proper working of your Android application. Each Android application has its specific
structure, so it is hard to find rules that will fit needs of all of them. New general rules may be
added in the future.**

### Proguard-Rules ###

> Use below rules to **not obfuscate sensitive parts** of source code of this library.

    # No special rules required. Library can be fully obfuscated.

> Use below rules to **not obfuscate** any source code of this library.

    # Keep all classes within library package.
    -keep class com.albedinsky.android.imageloader.** { *; }


text:
/*
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Twilio - Chat
 * This is the public Twilio REST API.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

using System;
using System.Collections.Generic;
using Twilio.Base;
using Twilio.Converters;
using System.Linq;

namespace Twilio.Rest.Chat.V2.Service
{

    /// <summary> create </summary>
    public class CreateChannelOptions : IOptions<ChannelResource>
    {

        ///<summary> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Channel resource under. </summary>
        public string PathServiceSid { get; }

        ///<summary> The X-Twilio-Webhook-Enabled HTTP request header </summary>
        public ChannelResource.WebhookEnabledTypeEnum XTwilioWebhookEnabled { get; set; }

        ///<summary> A descriptive string that you create to describe the new resource. It can be up to 64 characters long. </summary>
        public string FriendlyName { get; set; }

        ///<summary> An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. </summary>
        public string UniqueName { get; set; }

        ///<summary> A valid JSON string that contains application-specific data. </summary>
        public string Attributes { get; set; }

        public ChannelResource.ChannelTypeEnum Type { get; set; }

        ///<summary> The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service.  Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. </summary>
        public DateTime? DateCreated { get; set; }

        ///<summary> The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source  and where a Message was previously updated. </summary>
        public DateTime? DateUpdated { get; set; }

        ///<summary> The `identity` of the User that created the channel. Default is: `system`. </summary>
        public string CreatedBy { get; set; }

        /// <summary> Construct a new CreateChannelOptions </summary>
        /// <param name="pathServiceSid"> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Channel resource under. </param>
        public CreateChannelOptions(string pathServiceSid)
        {
            PathServiceSid = pathServiceSid;
        }

        /// <summary> Generate the necessary parameters </summary>
        public  List<KeyValuePair<string, string>> GetParams()
        {
            var p = new List<KeyValuePair<string, string>>();

            if (FriendlyName != null)
            {
                p.Add(new KeyValuePair<string, string>("FriendlyName", FriendlyName));
            }
            if (UniqueName != null)
            {
                p.Add(new KeyValuePair<string, string>("UniqueName", UniqueName));
            }
            if (Attributes != null)
            {
                p.Add(new KeyValuePair<string, string>("Attributes", Attributes));
            }
            if (Type != null)
            {
                p.Add(new KeyValuePair<string, string>("Type", Type.ToString()));
            }
            if (DateCreated != null)
            {
                p.Add(new KeyValuePair<string, string>("DateCreated", Serializers.DateTimeIso8601(DateCreated)));
            }
            if (DateUpdated != null)
            {
                p.Add(new KeyValuePair<string, string>("DateUpdated", Serializers.DateTimeIso8601(DateUpdated)));
            }
            if (CreatedBy != null)
            {
                p.Add(new KeyValuePair<string, string>("CreatedBy", CreatedBy));
            }
            return p;
        }

    /// <summary> Generate the necessary header parameters </summary>
    public List<KeyValuePair<string, string>> GetHeaderParams()
    {
        var p = new List<KeyValuePair<string, string>>();
        if (XTwilioWebhookEnabled != null)
        {
            p.Add(new KeyValuePair<string, string>("X-Twilio-Webhook-Enabled", XTwilioWebhookEnabled.ToString()));
        }
        return p;
    }

    }
    /// <summary> delete </summary>
    public class DeleteChannelOptions : IOptions<ChannelResource>
    {

        ///<summary> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the resource from. </summary>
        public string PathServiceSid { get; }

        ///<summary> The SID of the Channel resource to delete.  This value can be either the `sid` or the `unique_name` of the Channel resource to delete. </summary>
        public string PathSid { get; }

        ///<summary> The X-Twilio-Webhook-Enabled HTTP request header </summary>
        public ChannelResource.WebhookEnabledTypeEnum XTwilioWebhookEnabled { get; set; }

        /// <summary> Construct a new DeleteChannelOptions </summary>
        /// <param name="pathServiceSid"> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the resource from. </param>
        /// <param name="pathSid"> The SID of the Channel resource to delete.  This value can be either the `sid` or the `unique_name` of the Channel resource to delete. </param>
        public DeleteChannelOptions(string pathServiceSid, string pathSid)
        {
            PathServiceSid = pathServiceSid;
            PathSid = pathSid;
        }

        /// <summary> Generate the necessary parameters </summary>
        public  List<KeyValuePair<string, string>> GetParams()
        {
            var p = new List<KeyValuePair<string, string>>();

            return p;
        }

    /// <summary> Generate the necessary header parameters </summary>
    public List<KeyValuePair<string, string>> GetHeaderParams()
    {
        var p = new List<KeyValuePair<string, string>>();
        if (XTwilioWebhookEnabled != null)
        {
            p.Add(new KeyValuePair<string, string>("X-Twilio-Webhook-Enabled", XTwilioWebhookEnabled.ToString()));
        }
        return p;
    }

    }

    /// <summary> fetch </summary>
    public class FetchChannelOptions : IOptions<ChannelResource>
    {

        ///<summary> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the Channel resource from. </summary>
        public string PathServiceSid { get; }

        ///<summary> The SID of the Channel resource to fetch. This value can be either the `sid` or the `unique_name` of the Channel resource to fetch. </summary>
        public string PathSid { get; }

        /// <summary> Construct a new FetchChannelOptions </summary>
        /// <param name="pathServiceSid"> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the Channel resource from. </param>
        /// <param name="pathSid"> The SID of the Channel resource to fetch. This value can be either the `sid` or the `unique_name` of the Channel resource to fetch. </param>
        public FetchChannelOptions(string pathServiceSid, string pathSid)
        {
            PathServiceSid = pathServiceSid;
            PathSid = pathSid;
        }

        /// <summary> Generate the necessary parameters </summary>
        public  List<KeyValuePair<string, string>> GetParams()
        {
            var p = new List<KeyValuePair<string, string>>();

            return p;
        }

    }

    /// <summary> read </summary>
    public class ReadChannelOptions : ReadOptions<ChannelResource>
    {

        ///<summary> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the Channel resources from. </summary>
        public string PathServiceSid { get; }

        ///<summary> The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. </summary>
        public List<ChannelResource.ChannelTypeEnum> Type { get; set; }

        /// <summary> Construct a new ListChannelOptions </summary>
        /// <param name="pathServiceSid"> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the Channel resources from. </param>
        public ReadChannelOptions(string pathServiceSid)
        {
            PathServiceSid = pathServiceSid;
            Type = new List<ChannelResource.ChannelTypeEnum>();
        }

        /// <summary> Generate the necessary parameters </summary>
        public  override List<KeyValuePair<string, string>> GetParams()
        {
            var p = new List<KeyValuePair<string, string>>();

            if (Type != null)
            {
                p.AddRange(Type.Select(Type => new KeyValuePair<string, string>("Type", Type.ToString())));
            }
            if (PageSize != null)
            {
                p.Add(new KeyValuePair<string, string>("PageSize", PageSize.ToString()));
            }
            return p;
        }

    }

    /// <summary> update </summary>
    public class UpdateChannelOptions : IOptions<ChannelResource>
    {

        ///<summary> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to update the Channel resource in. </summary>
        public string PathServiceSid { get; }

        ///<summary> The SID of the Channel resource to update. This value can be either the `sid` or the `unique_name` of the Channel resource to update. </summary>
        public string PathSid { get; }

        ///<summary> The X-Twilio-Webhook-Enabled HTTP request header </summary>
        public ChannelResource.WebhookEnabledTypeEnum XTwilioWebhookEnabled { get; set; }

        ///<summary> A descriptive string that you create to describe the resource. It can be up to 256 characters long. </summary>
        public string FriendlyName { get; set; }

        ///<summary> An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. </summary>
        public string UniqueName { get; set; }

        ///<summary> A valid JSON string that contains application-specific data. </summary>
        public string Attributes { get; set; }

        ///<summary> The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service.  Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. </summary>
        public DateTime? DateCreated { get; set; }

        ///<summary> The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. </summary>
        public DateTime? DateUpdated { get; set; }

        ///<summary> The `identity` of the User that created the channel. Default is: `system`. </summary>
        public string CreatedBy { get; set; }

        /// <summary> Construct a new UpdateChannelOptions </summary>
        /// <param name="pathServiceSid"> The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to update the Channel resource in. </param>
        /// <param name="pathSid"> The SID of the Channel resource to update. This value can be either the `sid` or the `unique_name` of the Channel resource to update. </param>
        public UpdateChannelOptions(string pathServiceSid, string pathSid)
        {
            PathServiceSid = pathServiceSid;
            PathSid = pathSid;
        }

        /// <summary> Generate the necessary parameters </summary>
        public  List<KeyValuePair<string, string>> GetParams()
        {
            var p = new List<KeyValuePair<string, string>>();

            if (FriendlyName != null)
            {
                p.Add(new KeyValuePair<string, string>("FriendlyName", FriendlyName));
            }
            if (UniqueName != null)
            {
                p.Add(new KeyValuePair<string, string>("UniqueName", UniqueName));
            }
            if (Attributes != null)
            {
                p.Add(new KeyValuePair<string, string>("Attributes", Attributes));
            }
            if (DateCreated != null)
            {
                p.Add(new KeyValuePair<string, string>("DateCreated", Serializers.DateTimeIso8601(DateCreated)));
            }
            if (DateUpdated != null)
            {
                p.Add(new KeyValuePair<string, string>("DateUpdated", Serializers.DateTimeIso8601(DateUpdated)));
            }
            if (CreatedBy != null)
            {
                p.Add(new KeyValuePair<string, string>("CreatedBy", CreatedBy));
            }
            return p;
        }

    /// <summary> Generate the necessary header parameters </summary>
    public List<KeyValuePair<string, string>> GetHeaderParams()
    {
        var p = new List<KeyValuePair<string, string>>();
        if (XTwilioWebhookEnabled != null)
        {
            p.Add(new KeyValuePair<string, string>("X-Twilio-Webhook-Enabled", XTwilioWebhookEnabled.ToString()));
        }
        return p;
    }

    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ProductManager.ViewData.Entity;

namespace ProductManager.Views.PlanManager
{
    public partial class PlanSetRemindDayWindow : ChildWindow
    {
        //private ProjectEntity ProjectEntity;

        public PlanSetRemindDayWindow(ProjectEntity aProjectEntity)
        {
            InitializeComponent();

            //ProjectEntity = aProjectEntity;
            aProjectEntity.StartRemindEdit();
            this.DataContext = aProjectEntity;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: khaled
 * Date: 5/9/16
 * Time: 7:29 PM
 */

namespace ResponseCompressor\Exception;

class InvalidFileTypeException extends \InvalidArgumentException
{}


text:
import { Registry } from 'vs/platform/registry/common/platform';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { IExtensionHostProfileService } from 'vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor';
import { ExtensionHostProfileService } from 'vs/workbench/contrib/extensions/electron-browser/extensionProfileService';
import { ExtensionsAutoProfiler } from 'vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler';

// Singletons
registerSingleton(IExtensionHostProfileService, ExtensionHostProfileService, true);

const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, LifecyclePhase.Eventually);


text:
namespace inet {

Define_Module(PriorityScheduler);

bool PriorityScheduler::schedulePacket()
{
    for (std::vector<IPassiveQueue *>::iterator it = inputQueues.begin(); it != inputQueues.end(); ++it) {
        IPassiveQueue *inputQueue = *it;
        if (!inputQueue->isEmpty()) {
            inputQueue->requestPacket();
            return true;
        }
    }
    return false;
}

} // namespace inet


text:
package solidbase.test.util;

import solidbase.util.Counter;
import solidbase.util.ProgressiveCounter;

public class CounterTest
{
	static public void main( String[] args )
	{
		Counter counter = new ProgressiveCounter( 10, 1000, 100000 );
//		Counter counter = new FixedCounter( 100000 );
//		Counter counter = new SilentCounter();
		for( int i = 0; i < 1000000; i++ )
		{
			if( counter.next() )
				System.out.println( "Done " + counter.total() );
		}
		System.out.println( "Done " + counter.total() );
	}
}


text:
RSpec.shared_examples 'unauthorized' do
  it 'request is rejected' do
    expect(response).not_to be_successful
  end

  it 'redirects to login page' do
    expect(response).to redirect_to(%i[new user session])
  end
end


text:
DAMapping Sample project : Maven single module
==============================================

## Project description

The point of this project is to showcase two things:

1. integration of DAMapping into a single module Maven project
2. use of DAMapping with handwritten integration to map a (small) type hierarchy starting with type ```Foo``` to type hierarchy starting with type ```Bar```

![Class diagram of Foo and Bar bean trees](readme_resources/Foo_Bar_class_diagram.png)

### How to build this project

This project requires Maven and Java installed to be compiled and built using the following command line:

```sh
mvn clean install
```

It is best to be run in your favorite IDE:

* import the project from pom.xml file
* run class Demo or unit tests
* read code

### version warning

This project only work with DAMapping 0.4.0+.

## Maven configuration

### With Java 7+

To use DAMapping annotation processing, declaring DAMapping annotation-processor artifact as a direct dependency is enough.
Since Java 7, javac compiler is capable of discovering annotation processor in the class path automatically (aka. here as autodiscovery).

```xml
<dependency>
  <groupId>fr.javatronic.damapping</groupId>
  <artifactId>annotation-processor</artifactId>
  <version>0.3.0</version>
  <!-- note that the compile scope is the default scope so following tag is optionnal -->
  <scope>compile</scope>
</dependency>
```

### With Java 6 or when autodiscovery is disabled

For the following reasons, it might be necessary to explicitly declare DAMApping annotation processor:
* module is compiled with Java 6
* another annotation processor is already declared explicitly in the maven-compiler-plugin
    - declaring explictly annotation processor disables auto discovery
    - so, DAMApping annotation processor has to be declared explicitly as well

```xml
<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
          <annotationProcessors>
            <annotationProcessor>fr.javatronic.damapping.processor.DAAnnotationProcessor</annotationProcessor>
          </annotationProcessors>
        </configuration>
      </plugin>
    </plugins>
  </pluginManagement>
</build>
```

## Mapping of type hierarchies

### Mapping specifications in this project

Particularities of this mapping are:

* ```Bar``` type is immutable, when ```Foo``` type is not
* ```Foo``` objects are assumed to be produced from an unreliable source that returns a list of ```Foo```:
    * which may contain ```null``` values,
    * ```Foo``` objects with null or invalid field values
    * use ```String``` to represent a restricted set of values
* in consequence, mapping to ```Bar`` type
    * defines several default values
    * rules on how to handle null/empty fields
    * correctly uses an ```Enum``` to represent restricted set of values
* in addition, some imaginary business rule is
    * for each value (```null``` included) of the list returned by the service, there must be a ```Bar``` instance.

### Package structure

```
fr.javatronic.damapping.demo
                          \__ bean : Foo and Bar type hierarchies
                          |
                          \__ mapper : classes annotated with @Mapper
                          |
                          Demo : entry point of this program
```

The ```Demo``` class which simply demonstrate the use of the classes generated by DAMapping to tranform an instance of
```Foo``` into a ```Bar``` object.

### source code highlights

Mapping ot the two-depth hierachies is implemented with two dedicated classes annotated with ```@Mapper```:

* class ```FootiToBarti``` implements the mapping from type ```Footi``` to type ```Barti```
* class ```FooToBar``` implements the mapping from type ```Foo``` to type ```Bar```

Note that class ```FooToBar``` uses ```FootiToBartiMapper`` interface as a dependency, instead of class ```FootiToBarti```

This allows having class ```FooToBar``` to be dependent of an interface instead of a class (which can later be mocked in unit tests, see below).

### Unit tests

Note that the right way to write unit tests in such case of mapping bean hierarchies is to write on unit test for each
class annotated with ```@Mapper```.

As showcased in unit test [FooToBarTest](src/test/java/fr/javatronic/damapping/demo/mapper/FooToBarTest.java), only the
logic specific to the ``FooToBar``` class is tested.

Interface ```FootiToBartiMapper``` is mocked and details of the mapping from ```Footi``` to ```Barti``` are only tested
in the unit test of class ```FootiToBarti``` ([FootiToBartiTest](src/test/java/fr/javatronic/damapping/demo/mapper/FootiToBartiTest.java)).


text:
package org.drools.core.runtime.help.impl;

import org.kie.internal.runtime.helper.BatchExecutionHelperProvider;

import com.thoughtworks.xstream.XStream;

import static org.kie.soup.commons.xstream.XStreamUtils.createTrustingXStream;

public class BatchExecutionHelperProviderImpl
    implements
    BatchExecutionHelperProvider {

    public XStream newXStreamMarshaller() {
        XStream xstream = createTrustingXStream();
        return newXStreamMarshaller(xstream);
    }

    public XStream newJSonMarshaller() {
        return XStreamJSon.newJSonMarshaller();
    }

    public XStream newXStreamMarshaller(XStream xstream) {
        return XStreamXML.newXStreamMarshaller(xstream);
    }

}


text:
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\InteractsWithMedia;

class Recommendation extends Model
{
    use SoftDeletes;
    use InteractsWithMedia;

    /**
     * Attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'recommendation',
        'resolved',
        'rec_add_ts',
        'rec_resolve_ts',
        'resolved_by',
        'rec_status',
        'wo_number',
    ];

    /**
     * Attributes that should be mutated to dates.
     *
     * @var array
     */
    protected $dates = [
        'rec_add_ts',
        'rec_resolve_ts',
        'deleted_at',
        'created_at',
        'updated_at',
    ];

    public function registerMediaCollection(): void
    {
        $this->addMediaCollection('service_reports')
            ->useDisk('ServiceReports');
    }

    /*
     * Relationships
     */
    public function survey()
    {
        return $this->belongsTo(TestDate::class);
    }

    /*
     * Scopes
     */

    /**
     * Scope function to return unresolved recommendations (resolved=0).
     *
     * @param \Illuminate\Database\Eloquent\Builder $query
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function scopeUnresolved($query)
    {
        return $query->where('resolved', 0);
    }

    /**
     * Scope function to return unresolved recommendations (resolved=1).
     *
     * @param \Illuminate\Database\Eloquent\Builder $query
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function scopeResolved($query)
    {
        return $query->where('resolved', 1);
    }

    /**
     * Scope function to return recommendations for a given $surveyID.
     *
     * @param \Illuminate\Database\Eloquent\Builder $query
     * @param int                                   $surveyID
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function scopeSurveyId($query, $surveyId)
    {
        return $query->where('survey_id', $surveyId);
    }
}


text:
layout: default
first_name: Nadine
last_name: Berenst
key: berenst
permalink: /persons/berenst/
role: msstudent
email:
image:
organization: Leiden University Medical Center
position: student
website:
interests:
graduated: BSc, 2018
---


text:
A rational number is defined as the quotient of two integers `a` and `b`, called the numerator and denominator, respectively, where `b != 0`.

The absolute value `|r|` of the rational number `r = a/b` is equal to `|a|/|b|`.

The sum of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 + r2 = a1/b1 + a2/b2 = (a1 * b2 + a2 * b1) / (b1 * b2)`.

The difference of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 - r2 = a1/b1 - a2/b2 = (a1 * b2 - a2 * b1) / (b1 * b2)`.

The product (multiplication) of two rational numbers `r1 = a1/b1` and `r2 = a2/b2` is `r1 * r2 = (a1 * a2) / (b1 * b2)`.

Dividing a rational number `r1 = a1/b1` by another `r2 = a2/b2` is `r1 / r2 = (a1 * b2) / (a2 * b1)` if `a2 * b1` is not zero.

Exponentiation of a rational number `r = a/b` to a non-negative integer power `n` is `r^n = (a^n)/(b^n)`.

Exponentiation of a rational number `r = a/b` to a negative integer power `n` is `r^n = (b^m)/(a^m)`, where `m = |n|`.

Exponentiation of a rational number `r = a/b` to a real (floating-point) number `x` is the quotient `(a^x)/(b^x)`, which is a real number.

Exponentiation of a real number `x` to a rational number `r = a/b` is `x^(a/b) = root(x^a, b)`, where `root(p, q)` is the `q`th root of `p`.

Implement the following operations:
 - addition, subtraction, multiplication and division of two rational numbers,
 - absolute value, exponentiation of a given rational number to an integer power, exponentiation of a given rational number to a real (floating-point) power, exponentiation of a real number to a rational number.

Your implementation of rational numbers should always be reduced to lowest terms. For example, `4/4` should reduce to `1/1`, `30/60` should reduce to `1/2`, `12/8` should reduce to `3/2`, etc. To reduce a rational number `r = a/b`, divide `a` and `b` by the greatest common divisor (gcd) of `a` and `b`. So, for example, `gcd(12, 8) = 4`, so `r = 12/8` can be reduced to `(12/4)/(8/4) = 3/2`.

Assume that the programming language you are using does not have an implementation of rational numbers.

## Exception messages

Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
a message.

To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
`raise Exception`, you should write:

```python
raise Exception("Meaningful message indicating the source of the error")
```

## Running the tests

To run the tests, run the appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test rational_numbers_test.py`
- Python 3.4+: `pytest rational_numbers_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest rational_numbers_test.py`

### Common `pytest` options

- `-v` : enable verbose output
- `-x` : stop running tests on first failure
- `--ff` : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/rational-numbers` directory.

You can find your Exercism workspace by running `exercism debug` and looking for the line that starts with `Workspace`.

For more detailed information about running tests, code style and linting,
please see [Running the Tests](http://exercism.io/tracks/python/tests).

## Source

Wikipedia [https://en.wikipedia.org/wiki/Rational_number](https://en.wikipedia.org/wiki/Rational_number)

## Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.