text:
import re
import string
import time
from functools import wraps
from subprocess import check_output
from os.path import basename, expanduser
from abc import ABCMeta, abstractmethod

import yaml
from proxy_tools import Proxy
from googleapiclient.errors import HttpError

from cloudify import ctx
from cloudify.context import CloudifyContext
from cloudify.exceptions import NonRecoverableError

from . import constants
from .gcp import (
    GCPError,
    GoogleCloudPlatform,
    check_response,
    is_missing_resource_error,
    is_resource_used_error,
    )

def camel_farm(identifier):
    """
    Convert from underscored to camelCase.
    """
    words = identifier.split('_')
    return ''.join([words[0]] + map(string.capitalize, words[1:]))

def get_item_from_gcp_response(key_field, key_name, items):
    """
    Get item from GCP REST response JSON list by name.
    items = [{ 'key_field': 'key_name', 'key_field_value': 'value'}]
    :param key_field: item dictionary key
    :param key_value: item dictionary value
    :param items: list of items(dictionaries)
    :return: item if found in collection, None otherwise
    """
    for item in items.get('items', []):
        if item.get(key_field) == key_name:
            return item
    return None

def get_gcp_resource_name(name):
    """
    Create GCP accepted name of resource. From GCP specification:
    "Specifically, the name must be 1-63 characters long and match the regular
    expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must
    be a lowercase letter, and all following characters must be a dash,
    lowercase letter, or digit, except the last character,
    which cannot be a dash."
    :param name: name of resource to be given
    :return: GCP accepted instance name
    """
    # replace underscores with hyphens
    final_name = name.replace('_', '-')
    # remove all non-alphanumeric characters except hyphens
    final_name = re.sub(r'[^a-zA-Z0-9-]+', '', final_name)
    # assure the first character is alpha
    if not final_name[0].isalpha():
        final_name = '{0}{1}'.format('a', final_name)
    # trim to the length limit
    if len(final_name) > constants.MAX_GCP_NAME:
        remain_len = constants.MAX_GCP_NAME - len(final_name)
        final_name = '{0}{1}'.format(
            final_name[:remain_len - constants.ID_HASH_CONST],
            final_name[-constants.ID_HASH_CONST:])
    # convert string to lowercase
    return final_name.lower()

def should_use_external_resource():
    return ctx.node.properties.get(constants.USE_EXTERNAL_RESOURCE, False)

def assure_resource_id_correct():
    resource_id = ctx.node.properties.get(constants.RESOURCE_ID)
    if not resource_id:
        raise NonRecoverableError('Resource id is missing.')

    if resource_id != get_gcp_resource_name(resource_id):
        raise NonRecoverableError('{} cannot be used as resource id.'
                                  .format(resource_id))
    return resource_id

def get_final_resource_name(name):
    return name or get_gcp_resource_name(ctx.instance.id)

def create_resource(func):
    def _decorator(resource, *args, **kwargs):
        if should_use_external_resource():
            try:
                resource.body = resource.get()
            except HttpError as error:
                if is_missing_resource_error(error):
                    name = ctx.node.properties.get(constants.RESOURCE_ID)
                    raise NonRecoverableError(
                        'Resource {0} defined as external, '
                        'but does not exist. Error: {1}'.
                        format(name, str(error)))
                else:
                    raise error
            ctx.instance.runtime_properties.update(resource.body)
        else:
            return func(resource, *args, **kwargs)

    return wraps(func)(_decorator)

@create_resource
def create(resource):
    return resource.create()

def delete_if_not_external(resource):
    if not should_use_external_resource():
        return resource.delete()

def sync_operation(func):
    def _decorator(resource, *args, **kwargs):
        response = func(resource, *args, **kwargs)
        operation = response_to_operation(
            response, resource.config, resource.logger)
        while not operation.has_finished():
            time.sleep(1)
        return operation.last_response

    return wraps(func)(_decorator)

def async_operation(get=False):
    """
    Decorator for node methods which return an Operation
    Handles the operation if it exists
    """
    def decorator(func):
        def wrapper(self, *args, **kwargs):
            props = ctx.instance.runtime_properties
            response = props.get('_operation', None)

            if response:
                operation = response_to_operation(
                        response,
                        get_gcp_config(),
                        ctx.logger)
                response = operation.get()

                if response['status'] in ('PENDING', 'RUNNING'):
                    ctx.operation.retry(
                        'Operation not completed yet: {}'.format(
                            response['status']),
                        constants.RETRY_DEFAULT_DELAY)
                elif response['status'] == 'DONE':
                    for key in '_operation', 'name', 'selfLink':
                        props.pop(key, None)
                    if get:
                        props.update(self.get())
                else:
                    raise NonRecoverableError(
                            'Unknown status response from operation')

            else:
                # Actually run the method
                response = func(self, *args, **kwargs)
                ctx.instance.runtime_properties['_operation'] = response
                ctx.operation.retry('Operation started')

        return wraps(func)(wrapper)
    return decorator

def retry_on_failure(msg, delay=constants.RETRY_DEFAULT_DELAY):
    def _retry_on_failure(func):
        def _decorator(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except HttpError as error:
                if is_resource_used_error(error):
                    ctx.operation.retry(msg, delay)
                else:
                    raise error

        return wraps(func)(_decorator)

    return _retry_on_failure

def throw_cloudify_exceptions(func):
    def _decorator(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except GCPError as e:
            raise NonRecoverableError(e.message)

    return wraps(func)(_decorator)

def get_gcp_config():
    def _get_gcp_config_from_properties():
        try:
            return ctx.node.properties[constants.GCP_CONFIG]
        except NonRecoverableError:
            return ctx.source.node.properties[constants.GCP_CONFIG]

    gcp_config_from_properties = _get_gcp_config_from_properties()
    if gcp_config_from_properties:
        gcp_config = gcp_config_from_properties
    else:
        try:
            with open(expanduser(constants.GCP_DEFAULT_CONFIG_PATH)) as f:
                gcp_config = yaml.load(f)
        except (IOError, OSError) as e:
            raise NonRecoverableError(
                '{} not provided as a property and the config file ({}) '
                'does not exist either: {}'.format(
                    constants.GCP_CONFIG,
                    constants.GCP_DEFAULT_CONFIG_PATH,
                    e,
                    ))

    # Validate the config contains what it should
    try:
        for key in 'project', 'auth', 'zone':
            gcp_config[key]
    except Exception as e:
        raise NonRecoverableError("invalid gcp_config provided: {}".format(e))

    # If no network is specified, assume the GCP default network, 'default'
    gcp_config.setdefault('network', 'default')

    return update_zone(gcp_config)

def update_zone(gcp_config):
    def _get_zone_from_runtime_properties():
        try:
            return ctx.instance.runtime_properties.get(constants.GCP_ZONE)
        except NonRecoverableError:
            src = ctx.source.instance.runtime_properties
            tar = ctx.target.instance.runtime_properties
            return src.get(constants.GCP_ZONE) or tar.get(constants.GCP_ZONE)

    non_default_zone = _get_zone_from_runtime_properties()
    if non_default_zone:
        gcp_config['zone'] = non_default_zone

    return gcp_config

def is_object_deleted(obj):
    try:
        obj.get()
    except HttpError as error:
        if is_missing_resource_error(error):
            return True
    return False

def get_key_user_string(user, public_key):
    cleaned_user = re.sub(r'\s+', ' ', user).strip()
    cleaned_public_key = re.sub(r'\s+', ' ', public_key).strip()

    if cleaned_public_key.count(' ') >= 1:
        keytype, key_blob = cleaned_public_key.split(' ')[:2]
    else:
        raise NonRecoverableError('Incorrect format of public key')
    protocol = '{0}:{1}'.format(cleaned_user, keytype)

    return '{0} {1} {2}'.format(protocol, key_blob, cleaned_user)

def get_agent_ssh_key_string():
    cloudify_agent = {}

    try:
        cloudify_agent.update(
                ctx.provider_context['cloudify']['cloudify_agent'])
    except KeyError:
        pass

    # node-specific overrides should take precendence
    # cloudify_agent is deprecated but may still be used.
    for key in 'cloudify_agent', 'agent_config':
        cloudify_agent.update(ctx.node.properties.get(key, {}))

    if 'agent_key_path' not in cloudify_agent:
        ctx.logger.debug('agent to be installed but key file info not found')
        return ''

    public_key = check_output([
        'ssh-keygen', '-y',  # generate public key from private key
        '-P', '',  # don't prompt for passphrase (would hang forever)
        '-f', expanduser(cloudify_agent['agent_key_path'])])
    # add the agent user to the key. GCP uses this to create user accounts on
    # the instance.
    full_key = '{user}:{key} {user}@cloudify'.format(
            key=public_key.strip(),
            user=cloudify_agent['user'])

    return full_key

def response_to_operation(response, config, logger):
    if 'zone' in response:
        return ZoneOperation(config, logger, response)
    elif 'region' in response:
        return RegionOperation(config, logger, response)
    else:
        return GlobalOperation(config, logger, response)

class Operation(GoogleCloudPlatform):
    __metaclass__ = ABCMeta

    def __init__(self, config, logger, response):
        super(Operation, self).__init__(config, logger, response['name'])
        for item in ('zone', 'region'):
            if item in response:
                setattr(self, item, response[item])
        self.last_response = None
        self.last_status = None

    def has_finished(self):
        if self.last_status != constants.GCP_OP_DONE:
            self.get()

        return self.last_status == constants.GCP_OP_DONE

    @check_response
    def get(self):
        self.last_response = self._get()
        self.last_status = self.last_response['status']
        return self.last_response

    @abstractmethod
    def _get(self): pass

class GlobalOperation(Operation):
    def _get(self):
        return self.discovery.globalOperations().get(
            project=self.project,
            operation=self.name).execute()

class RegionOperation(Operation):
    def _get(self):
        return self.discovery.regionOperations().get(
            project=self.project,
            region=basename(self.region),
            operation=self.name).execute()

class ZoneOperation(Operation):
    def _get(self):
        return self.discovery.zoneOperations().get(
            project=self.project,
            zone=basename(self.zone),
            operation=self.name).execute()

def get_relationships(
        relationships,
        filter_relationships=None,
        filter_nodes=None):
    """
    Get all relationships of a particular node or the current context.

    Optionally filter based on relationship type, node type.
    """
    if isinstance(relationships, (CloudifyContext, Proxy)):
        # Shortcut to support supplying ctx directly
        relationships = relationships.instance.relationships
    # And coerce the other inputs to lists if they are strings:
    if isinstance(filter_relationships, basestring):
        filter_relationships = [filter_relationships]
    if isinstance(filter_nodes, basestring):
        filter_nodes = [filter_nodes]
    results = []
    for rel in relationships:
        if filter_relationships and rel.type not in filter_relationships:
            rel = None
        if filter_nodes and rel.target.node.type not in filter_nodes:
            rel = None
        if rel:
            results.append(rel)
    return results

def get_network_node(ctx):
    network_list = get_relationships(
            ctx,
            filter_relationships='cloudify.gcp.relationships.'
                                 'contained_in_network',
            )
    if len(network_list) > 0:
        return network_list[0].target

def get_net_and_subnet(ctx):
    """
    Returns a tuple of the ctx node's
    (Network, Subnetwork)
    """
    net_node = get_network_node(ctx)

    subnetwork = None
    if net_node:
        if net_node.node.type == 'cloudify.gcp.nodes.Network':
            network = net_node.instance.runtime_properties['selfLink']
        elif net_node.node.type == 'cloudify.gcp.nodes.SubNetwork':
            network = net_node.instance.runtime_properties['network']
            subnetwork = net_node.instance.runtime_properties['selfLink']
        else:
            raise NonRecoverableError(
                'Unsupported target type for '
                "'cloudify.gcp.relationships.instance_contained_in_network")
    else:
        network = get_gcp_config()['network']

    if network == 'default':
        network = 'global/networks/default'

    return network, subnetwork

def get_network(ctx):
    return get_net_and_subnet(ctx)[0]


text:
TEST_CLASS(NGSDImportORPHA_Test)
{
Q_OBJECT
private slots:

	void default_parameters()
	{
		if (!NGSD::isAvailable(true)) SKIP("Test needs access to the NGSD test database!");

		//init
		NGSD db(true);
		db.init();
		db.executeQueriesFromFile(TESTDATA("data_in/NGSDImportORPHA_init.sql"));

		//test
		EXECUTE("NGSDImportORPHA", "-test -terms " + TESTDATA("data_in/NGSDImportORPHA_terms.xml") + " -genes " + TESTDATA("data_in/NGSDImportORPHA_genes.xml"));

		//check
		I_EQUAL(db.getValue("SELECT count(*) FROM disease_term").toInt(), 3)
		I_EQUAL(db.getValue("SELECT count(*) FROM disease_gene").toInt(), 4)
	}
};

redpajama_set_name: RedPajamaGithub


text:
package org.optaplanner.core.impl.score.director.drools.testgen.operation;

import org.kie.api.runtime.KieSession;
import org.optaplanner.core.impl.score.director.drools.testgen.fact.TestGenFact;

public class TestGenKieSessionDelete implements TestGenKieSessionOperation {

    private final int id;
    private final TestGenFact fact;

    public TestGenKieSessionDelete(int id, TestGenFact fact) {
        this.id = id;
        this.fact = fact;
    }

    @Override
    public void invoke(KieSession kieSession) {
        kieSession.delete(kieSession.getFactHandle(fact.getInstance()));
    }

    @Override
    public void print(StringBuilder sb) {
        sb.append(String.format("        //%s\n", this));
        sb.append(String.format("        kieSession.delete(kieSession.getFactHandle(%s));\n", fact));
    }

    @Override
    public String toString() {
        return "operation D #" + id;
    }

}


text:
  Velennes est
       un village
       situé dans le département de l'Oise en Picardie. Elle comptait 261 habitants en 2008.

Le parc de logements, à Velennes, était réparti en 2011 en deux appartements et 95 maisons soit
 un marché plutôt équilibré.

À coté de Velennes sont positionnées géographiquement les villes de
Bergicourt localisée à 5 km, 150 habitants,
Conty à 4 km, 1 708 habitants,
Loeuilly localisée à 5 km, 840 habitants,
Tilloy-lès-Conty située à 5 km, 245 habitants,
Fleury à 2 km, 213 habitants,
Contre localisée à 1 km, 115 habitants,
 entre autres. De plus, Velennes est située à seulement 20 km de Amiens.

Si vous envisagez de demenager à Velennes, vous pourrez facilement trouver une maison à acheter.


text:
package com.vladsch.MissingInActions.actions.character;

import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler;
import com.intellij.openapi.editor.actions.EditorActionUtil;
import com.intellij.openapi.ide.CopyPasteManager;
import com.vladsch.MissingInActions.util.EditHelpers;

public class DeleteToWordEndNotEolActionHandler extends EditorWriteActionHandler {
    final private boolean myNegateCamelMode;

    public DeleteToWordEndNotEolActionHandler(boolean negateCamelMode) {
        super(true);
        myNegateCamelMode = negateCamelMode;
    }

    @Override
    public void executeWriteAction(Editor editor, Caret caret, DataContext dataContext) {
        CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP);
        CopyPasteManager.getInstance().stopKillRings();

        boolean camelMode = editor.getSettings().isCamelWords();
        if (myNegateCamelMode) {
            camelMode = !camelMode;
        }

        if (editor.getSelectionModel().hasSelection()) {
            EditHelpers.deleteSelectedText(editor);
            return;
        }

        deleteToWordEnd(editor, camelMode);
    }

    static void deleteToWordEnd(Editor editor, boolean camelMode) {
        int startOffset = editor.getCaretModel().getOffset();
        int endOffset = getWordEndOffset(editor, startOffset, camelMode);
        if (endOffset > startOffset) {
            Document document = editor.getDocument();
            document.deleteString(startOffset, endOffset);
        }
    }

    private static int getWordEndOffset(Editor editor, int offset, boolean camelMode) {
        Document document = editor.getDocument();
        CharSequence text = document.getCharsSequence();
        if (offset >= document.getTextLength() - 1)
            return offset;
        int newOffset = offset + 1;
        int lineNumber = editor.getCaretModel().getLogicalPosition().line;
        int maxOffset = document.getLineEndOffset(lineNumber);
        if (newOffset > maxOffset) {
            return offset;
        }
        for (; newOffset < maxOffset; newOffset++) {
            if (EditorActionUtil.isWordEnd(text, newOffset, camelMode) || EditorActionUtil.isWordStart(text, newOffset, camelMode)) {
                break;
            }
        }
        return newOffset;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<dimension_table dim_name="sample_dim2" table_name="dim_table2" weight="0.0" xmlns="uri:lens:cube:0.1"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <columns>
    <columns comment="ID" name="id" type="int"/>
    <columns comment="name" name="name" type="string"/>
    <columns comment="more details for dim2" name="detail2" type="string"/>
  </columns>
  <dimension_references/>
  <storage_dump_periods>
    <update_period_element storage_name="local">
    <update_periods>hourly</update_periods>
    </update_period_element>
  </storage_dump_periods>
  <properties>
    <properties name="dim2.prop" value="d2"/>
  </properties>
</dimension_table>


text:
package derpibooru.derpy.ui.fragments.imageactivity;

import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;

import butterknife.Bind;
import butterknife.ButterKnife;
import derpibooru.derpy.R;
import derpibooru.derpy.data.server.DerpibooruFilter;
import derpibooru.derpy.data.server.DerpibooruImageDetailed;
import derpibooru.derpy.ui.animators.ImageDetailedViewAnimator;
import derpibooru.derpy.ui.views.imagedetailedview.ImageDetailedView;
import derpibooru.derpy.ui.views.imagedetailedview.ImageTagView;
import uk.co.senab.photoview.PhotoViewAttacher;

public class ImageActivityMainFragment extends Fragment {
    public static final String EXTRAS_IS_USER_LOGGED_IN = "derpibooru.derpy.IsLoggedIn";
    public static final String EXTRAS_USER_FILTER = "derpibooru.derpy.UserFilter";

    private static final int REQUEST_WRITE_STORAGE = 142;

    @Bind(R.id.imageView) ImageView imageView;
    @Bind(R.id.imageDetailedView) ImageDetailedView imageDetailedView;

    private ImageActivityMainFragmentHandler mActivityCallbacks;

    private int mImageId;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.activity_image_fragment_main, container, false);
        ButterKnife.bind(this, v);
        setHasOptionsMenu(true);
        setImageId(mImageId);
        imageDetailedView.displayToolbar(mImageId, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                getActivity().onBackPressed();
            }
        });
        if (mActivityCallbacks.getImage() != null) {
            v.post(new Runnable() {
                @Override
                public void run() {
                    displayImageInRootView(savedInstanceState);
                }
            });
        }
        return v;
    }

    public void setActivityCallbacks(ImageActivityMainFragmentHandler handler) {
        mActivityCallbacks = handler;
    }

    public void setImageId(int imageId) {
        mImageId = imageId;
    }

    public void onDetailedImageFetched() {
        if (getView() != null) {
            displayImageInRootView(null);
        }
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (imageDetailedView != null) {
            imageDetailedView.saveInstanceState(outState);
        }
    }

    private void displayImageInRootView(@Nullable Bundle savedInstanceState) {
        showDetailedView(savedInstanceState);
        loadImage();
    }

    private void showDetailedView(@Nullable Bundle savedInstanceState) {
        imageDetailedView.displayDetailedView(
                getChildFragmentManager(),
                getArguments().getBoolean(EXTRAS_IS_USER_LOGGED_IN),
                new ImageTagView.OnTagClickListener() {
                    @Override
                    public void onTagClicked(int tagId) {
                        mActivityCallbacks.openTagInformation(tagId);
                    }
                }, new ImageDetailedView.ImageDetailedViewHandler() {
                    @Override
                    public DerpibooruFilter getUserFilter() {
                        return getArguments().getParcelable(EXTRAS_USER_FILTER);
                    }

                    @Override
                    public DerpibooruImageDetailed getImage() {
                        return mActivityCallbacks.getImage();
                    }

                    @Override
                    public void requestImageDownloadPermissions() {
                        requestPermissions(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, REQUEST_WRITE_STORAGE);
                    }

                    @Override
                    public void onBottomBarExtensionStateChanged(ImageDetailedViewAnimator.BottomBarExtensionState newState) {
                        if (imageView.getDrawable() != null) {
                            GlideDrawable glideWrapper = (GlideDrawable) imageView.getDrawable();
                            if (newState != ImageDetailedViewAnimator.BottomBarExtensionState.None) {
                                glideWrapper.stop();
                            } else {
                                glideWrapper.start();
                            }
                        }
                    }
                },
                savedInstanceState);
    }

    private void loadImage() {
        String url = mActivityCallbacks.getImage().getThumb().getLargeImageUrl();
        if (url.endsWith(".gif")) {
            Glide.with(this).load(url).diskCacheStrategy(DiskCacheStrategy.SOURCE)
                    .listener(new GlideRequestListener(imageView))
                    .into(imageView);
        } else {
            Glide.with(this).load(url).diskCacheStrategy(DiskCacheStrategy.SOURCE)
                    .listener(new GlideRequestListener(imageView))
                    .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
                    .into(imageView);
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if ((requestCode == REQUEST_WRITE_STORAGE)
                && (grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
            if (imageDetailedView != null) {
                imageDetailedView.onImageDownloadPermissionsGranted();
            }
        }
    }

    private class GlideRequestListener implements RequestListener<String, GlideDrawable> {
        private ImageView mImageView;

        GlideRequestListener(ImageView glideTarget) {
            mImageView = glideTarget;
        }

        @Override
        public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
            Log.e("ImageActivity", "Failed to load the image with Glide", e);
            return false;
        }

        @Override
        public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target,
                                       boolean isFromMemoryCache, boolean isFirstResource) {
            if (getView() != null) getView().findViewById(R.id.progressImage).setVisibility(View.GONE);
            attachPhotoView(mImageView);
            if (imageDetailedView != null) {
                imageDetailedView.onImageLoaded(resource);
                if (imageDetailedView.getBottomBarExtensionState() != ImageDetailedViewAnimator.BottomBarExtensionState.None) {
                    mImageView.post(new Runnable() {
                        @Override
                        public void run() {
                            ((GlideDrawable) imageView.getDrawable()).stop();
                        }
                    });
                }
            }
            return false;
        }

        private void attachPhotoView(ImageView target) {
            new PhotoViewAttacher(target).setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
                @Override
                public void onViewTap(View view, float x, float y) {
                    imageDetailedView.toggleView();
                }
            });
        }
    }

    public interface ImageActivityMainFragmentHandler {
        DerpibooruImageDetailed getImage();
        void openTagInformation(int tagId);
    }
}


text:
PayPal iOS SDK
==============

The PayPal iOS SDK makes it easy to add PayPal and credit card payments to mobile apps.

![SDK screenshots](docs/sdk-screens.png)

*This documentation is available in Japanese: [日本語のドキュメント](docs/ja/README.md).*

>### Note
> The current version of the PayPal iOS SDK was built using Xcode 7.0+.
>
> If you are still using Xcode 6.2, you may experience link errors (duplicate symbols). If you can't upgrade from Xcode 6.2, please use version **2.10.2** of this SDK.

## Contents

- [Use Cases](#use-cases)
- [Requirements](#requirements)
- [Add the SDK to Your Project](#add-the-sdk-to-your-project)
- [Credentials](#credentials)
- [International Support](#international-support)
- [Testing](#testing)
- [Documentation](#documentation)
- [Usability](#usability)
- [Moving to PayPal iOS SDK 2.0](#moving-to-paypal-ios-sdk-20)
- [Next Steps](#next-steps)

## Use Cases

The SDK supports two use cases for making payments - **Single Payment** and **Future Payments** - and a third use case for obtaining information about the customer - **Profile Sharing**.

### Single Payment

Receive a one-time payment from a customer's PayPal account or payment card (scanned with [card.io](https://www.card.io/)). This can be either (1) an **immediate** payment which your servers should subsequently **verify**, or (2) an **authorization** for a payment which your servers must subsequently **capture**, or (3) a payment for an **order** which your servers must subsequently **authorize** and **capture**:

1. [Accept a Single Payment](docs/single_payment.md) and receive back a proof of payment.
2. On your server, [Verify the Payment](https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/), [Capture the Payment](https://developer.paypal.com/webapps/developer/docs/integration/direct/capture-payment/#capture-the-payment), or [Process the Order](https://developer.paypal.com/webapps/developer/docs/integration/direct/create-process-order/) (PayPal Developer site) using PayPal's API.

*Note:* Direct Credit Card Payments is only available in a [select few countries](https://developer.paypal.com/webapps/developer/docs/integration/direct/rest_api_payment_country_currency_support/#direct-credit-card-payments).  Also, see the [International Support](#international-support) section for details on the specific currencies supported.

### Future Payments

Your customer logs in to PayPal just one time and consents to future payments:

1. [Obtain Customer Consent](docs/future_payments_mobile.md#obtain-customer-consent) to receive an authorization code.
2. On your server, use this authorization code to [Obtain OAuth2 Tokens](docs/future_payments_server.md#obtain-oauth2-tokens).

Later, when that customer initiates a payment:

1. [Obtain a Client Metadata ID](docs/future_payments_mobile.md#obtain-an-application-correlation-id) that you'll pass to your server.
2. On your server, [Create a Payment](docs/future_payments_server.md#create-a-payment) using your OAuth2 tokens, the Client Metadata ID, and PayPal's API.

### Profile Sharing

Your customer logs in to PayPal and consents to PayPal sharing information with you:

1. [Obtain Customer Consent](docs/profile_sharing_mobile.md#obtain-customer-consent) to receive an authorization code.
2. On your server, use this authorization code to [Obtain OAuth2 Tokens](docs/profile_sharing_server.md#obtain-oauth2-tokens).
3. On your server, [Retrieve Customer Information](docs/profile_sharing_server.md#retrieve-customer-information) using your OAuth2 tokens and PayPal's API.

## Requirements

* Xcode 6 and iOS SDK 8
* iOS 6.0+ target deployment
* armv7, armv7s, and arm64 devices, and the simulator (not armv6)
* iPhone and iPad of all sizes and resolutions

## Add the SDK to Your Project

### If you use [CocoaPods](http://cocoapods.org), then add these lines to your podfile:

```ruby
platform :ios, '6.0'
pod 'PayPal-iOS-SDK'
```

### If you don't use CocoaPods, then:

1. Clone or download the SDK, which consists of header files, license acknowledgements, release notes, and a static library. It also includes a sample app.
    * **As of version 2.4.0, the SDK requires Xcode 6 and iOS 8 SDK. If you are still using Xcode 5, please use [version 2.3.2](https://github.com/paypal/PayPal-iOS-SDK/releases) of this SDK.**
2. Add the `PayPalMobile` directory (containing several .h files and libPayPalMobile.a) to your Xcode project. We recommend checking "Copy items..." and selecting "Create groups...".
3. In your project's **Build Settings** (in the `TARGETS` section, not the `PROJECTS` section):
  * add `-lc++ -ObjC` to `Other Linker Flags`
  * enable `Enable Modules (C and Objective-C)`
  * enable `Link Frameworks Automatically`
4. In your project's **Build Phases**, link your project with these libraries. Weak linking for iOS versions back to 6.0 is supported.
  * `Accelerate.framework`
  * `AudioToolbox.framework`
  * `AVFoundation.framework`
  * `CoreLocation.framework`
  * `CoreMedia.framework`
  * `MessageUI.framework`
  * `MobileCoreServices.framework`
  * `SystemConfiguration.framework`
  * `SafariServices.framework`

### With or without CocoaPods:

1. Add the open source license acknowledgments from acknowledgments.md to [your app's acknowledgments](http://stackoverflow.com/questions/3966116/where-to-put-open-source-credit-information-for-an-iphone-app).
2. In your app's Info.plist, add the following URL schemes to `LSApplicationQueriesSchemes`:
  * `com.paypal.ppclient.touch.v1`
  * `com.paypal.ppclient.touch.v2`
  * `org-appextension-feature-password-management`

## Credentials

Your mobile integration requires different `client_id` values for each environment: Live and Test (Sandbox).

Your server integrations for verifying or creating payments will also require the corresponding `client_secret` for each `client_id`.

You can obtain these PayPal API credentials by visiting the [Applications page on the PayPal Developer site](https://developer.paypal.com/webapps/developer/applications) and logging in with your PayPal account.

### Sandbox

Once logged in on this Applications page, you will be assigned **test credentials**, including Client ID, which will let you test your iOS integration against the PayPal Sandbox.

While testing your app, when logging in to PayPal in the SDK's UI you should use a *personal* Sandbox account email and password. I.e., not your Sandbox *business* credentials.

You can create both business and personal Sandbox accounts on the [Sandbox accounts](https://developer.paypal.com/webapps/developer/applications/accounts) page.

### Live

To obtain your **live** credentials, you will need to have a business account. If you don't yet have a business account, there is a link at the bottom of that same Applications page that will get you started.

## International Support

### Localizations

The SDK has built-in translations for many languages and locales. See the header files for a complete list.

### Currencies

The SDK supports multiple currencies. See [the REST API country and currency documentation](https://developer.paypal.com/webapps/developer/docs/integration/direct/rest_api_payment_country_currency_support/) for a complete, up-to-date list.

Note that currency support differs for payment card versus PayPal payments. Unless you disable payment card acceptance (via the `PayPalConfiguration.acceptCreditCards` property), **we recommend limiting transactions to currencies supported by both payment types.** Currently these are: USD, GBP, CAD, EUR, JPY.

If your app initiates a transaction with a currency that turns out to be unsupported for the user's selected payment type, then the SDK will display an error to the user and write a message to the console log.

## Testing

During development and testing, set the environment to Sandbox or NoNetwork/Mock mode, to avoid moving real money around. See the header files for more information.

## Documentation

* These docs in the SDK, which include an overview of usage, step-by-step integration instructions, and sample code.
* The sample app included in this SDK.
* Header files are thoroughly documented; refer to them as needed for extra details about any given property or parameter.
* The [PayPal Developer Docs](https://developer.paypal.com/docs), which cover error codes and server-side integration instructions.

## Usability

User interface appearance and behavior is set within the library itself. For the sake of usability and user experience consistency, apps should not adjust appearance properties or attempt to modify the SDK's behavior beyond the documented methods in the provided headers.

Specifically, if you are using `UIAppearance` to modify the appearance of any UI elements in your app, you should reverse those changes prior to presenting our viewcontroller, and set them again after dismissing the viewcontroller.

## Moving to PayPal iOS SDK 2.0

### Upgrade from 1.x

As a major version change, the API introduced in 2.0 is not backward compatible with 1.x integrations. However, the SDK still supports all previous single payment functionality. Upgrading is straightforward.

* Initialization of the SDK is performed via methods of a new `PayPalMobile` class.
* Most of the properties of `PayPalPaymentViewController` have been moved to `PayPalConfiguration`, and the `PayPalPaymentViewController` initializer has changed to take such a configuration object.
* The `PayPalPaymentDelegate` protocol methods have also been altered to include a `PayPalPaymentViewController` as a parameter.

### Older Libraries

PayPal is in the process of replacing the older "Mobile Payments Libraries" (MPL) with the new PayPal Android and iOS SDKs.
The new Mobile SDKs are based on the PayPal REST API, while the older MPL uses the Adaptive Payments API.

Until features such as third-party, parallel, and chained payments are available, if needed, you can use MPL:

 - [MPL on GitHub](https://github.com/paypal/sdk-packages/tree/gh-pages/MPL)
 - [MPL Documentation](https://developer.paypal.com/webapps/developer/docs/classic/mobile/gs_MPL/)

Issues related to MPL should be filed in the [sdk-packages repo](https://github.com/paypal/sdk-packages/).

Developers with existing Express Checkout integrations or who want additional features may wish to use [Mobile Express Checkout](https://developer.paypal.com/webapps/developer/docs/classic/mobile/gs_MEC/)
in a webview.

## Next Steps

Depending on your use case, you can now:

* [Accept a single payment](docs/single_payment.md)
* [Obtain user consent](docs/future_payments_mobile.md) to [create future payments](docs/future_payments_server.md).
* [Obtain user consent](docs/profile_sharing_mobile.md) to [retrieve customer information](docs/profile_sharing_server.md).


text:
<?php

namespace MamuzBlogTest\View\Helper;

use MamuzBlog\View\Helper\Anchor;

class AnchorTest extends \PHPUnit_Framework_TestCase
{
    /** @var Anchor */
    protected $fixture;

    /** @var \Zend\View\Renderer\RendererInterface | \Mockery\MockInterface */
    protected $renderer;

    protected function setUp()
    {
        $this->renderer = \Mockery::mock('Zend\View\Renderer\RendererInterface');
        $this->renderer->shouldReceive('translate')->with('title')->andReturn('_title_');
        $this->renderer->shouldReceive('escapeHtmlAttr')->with('_title_')->andReturn('title');

        $this->fixture = new Anchor('%4$s');
        $this->fixture->setView($this->renderer);
    }

    public function testExtendingAbstractHelper()
    {
        $this->assertInstanceOf('MamuzBlog\View\Helper\AbstractHelper', $this->fixture);
        $this->assertInstanceOf('Zend\View\Helper\AbstractHelper', $this->fixture);
    }

    public function testRender()
    {
        $html = $this->fixture->render('url', 'title', 'content');

        $this->assertSame(
            'content',
            $html
        );

        $invoke = $this->fixture;
        $html = $invoke('url', 'title', 'content');

        $this->assertSame(
            'content',
            $html
        );
    }

    public function testRenderWithClass()
    {
        $html = $this->fixture->render('url', 'title', 'content', 'class');

        $this->assertSame(
            'content',
            $html
        );

        $invoke = $this->fixture;
        $html = $invoke('url', 'title', 'content', 'class');

        $this->assertSame(
            'content',
            $html
        );
    }
}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Adding field 'HelpTopic.priority'
        db.add_column('help_helptopic', 'priority', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

    def backwards(self, orm):

        # Deleting field 'HelpTopic.priority'
        db.delete_column('help_helptopic', 'priority')

    models = {
        'help.helptopic': {
            'Meta': {'object_name': 'HelpTopic'},
            'category': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'contents': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'parent_topic': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'sub_topics'", 'null': 'True', 'to': "orm['help.HelpTopic']"}),
            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        }
    }

    complete_apps = ['help']


text:
export class BTCTxProvder {
  lib = require('bitcore-lib');

  create({ recipients, utxos, change, fee }) {
    let tx = new this.lib.Transaction().from(utxos).fee(Number(fee));
    for (const recipient of recipients) {
      tx.to(recipient.address, recipient.amount);
    }
    if (change) {
      tx.change(change);
    }
    return tx;
  }

  sign({ tx, keys, utxos }) {
    let bitcoreTx = new this.lib.Transaction(tx);
    let applicableUtxos = this.getRelatedUtxos({
      outputs: bitcoreTx.inputs,
      utxos
    });

    let newTx = new this.lib.Transaction()
      .from(applicableUtxos)
      .to(this.getOutputsFromTx({ tx: bitcoreTx }));
    const privKeys = keys.map(key => key.privKey.toString('hex'));
    return newTx.sign(privKeys);
  }

  getRelatedUtxos({ outputs, utxos }) {
    let txids = outputs.map(output => output.toObject().prevTxId);
    let applicableUtxos = utxos.filter(utxo => txids.includes(utxo.txid));
    return applicableUtxos;
  }

  getOutputsFromTx({ tx }) {
    return tx.outputs.map(({ script, satoshis }) => {
      let address = script;
      return { address, satoshis };
    });
  }

  getSigningAddresses({ tx, utxos }) {
    let bitcoreTx = new this.lib.Transaction(tx);
    let applicableUtxos = this.getRelatedUtxos({
      outputs: bitcoreTx.inputs,
      utxos
    });
    return applicableUtxos.map(utxo => utxo.address);
  }
}
export default new BTCTxProvder();


text:
/* Map
 *
 * This mainly includes:
 *
 * 1. Pan Buttons
 * 		.fixedPan - including two modes: 1. dark (default) 2. white (needs to add class name "dark" to ".map" container)
 *
 * 2. Tooltip
 *		.tooltip
 */
/* map fixed pan buttons */
.map .container .fixedPan {
  position: absolute;
  width: 15px;
  height: 15px;
  background-image: url("../images/map/fixed-pan-sprite.png");
  overflow: hidden;
  cursor: pointer;
  opacity: 0.35;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=35)";
  filter: alpha(opacity=35);
}
.map .container .fixedPan:hover {
  opacity: 0.8;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
  filter: alpha(opacity=80);
}
.map .container .panUp {
  background-position: -15px 0px;
  top: 4px;
  width: 23px;
}
.map .container .panDown {
  background-position: -15px -38px;
  bottom: 4px;
  width: 23px;
}
.map .container .panLeft {
  background-position: -52px -15px;
  left: 4px;
  height: 23px;
}
.map .container .panRight {
  background-position: -38px -15px;
  right: 4px;
  height: 23px;
}
.map .container .panUpperLeft {
  background-position: 0 0;
  left: 4px;
  top: 4px;
}
.map .container .panUpperRight {
  background-position: -38px 0px;
  right: 4px;
  top: 4px;
}
.map .container .panLowerLeft {
  background-position: 0 -38px;
  left: 4px;
  bottom: 4px;
}
.map .container .panLowerRight {
  background-position: -38px -38px;
  right: 4px;
  bottom: 4px;
}
.map.dark .container .fixedPan {
  background-image: url("../images/map/fixed-pan-sprite-white.png");
}
.map .tooltip {
  min-width: 100px;
  position: absolute;
  border: 0 none;
  background: #2b2e34;
  color: #fff;
  text-shadow: $map-tooltip-text-shadow;
  padding: 4px;
  font-size: 10px;
  z-index: 9999;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  -webkit-box-shadow: $map-tooltip-box-shadow;
  box-shadow: $map-tooltip-box-shadow;
  opacity: 0.8;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
  filter: alpha(opacity=80);
}


text:
'use strict';

var uuid = require('node-uuid'),
    events = require('events'),
    waterline = {},
    sandbox = sinon.sandbox.create(),
    data = {
        config: { command: 'power' },
        uri: 'http://testuri',
        user: 'user',
        password: 'password',
        root: '/',
        workItemId: 'testworkitemid',
        node: 'xyz'
    },
    redfishJob,
    redfishTool = {
        clientRequest: sandbox.stub(),
        settings: data
    },
    listChassisData = {
        body: {
            Members: [
                {'@odata.id':'/redfish/v1/Chassis/abc123'}
            ],
            Power: {'@odata.id': 'data'},
            Thermal: {'@odata.id': 'data'},
            LogServices: {'@odata.id': 'data'},
            Managers: {'@odata.id': 'data'},
            Oem: {
                Emc: {FabricService: {'@odata.id': 'data'}}
            }
        }
    },
    listOemElementThermalData = {
        body: {
            Members: [
                {'@odata.id': '/redfish/v1/Chassis/0/Elements/0'}
            ],
            Oem: {
                Emc: {
                    Elements: {'@odata.id': 'data'},
                    SpineModules: {'@odata.id': 'data'},
                    Aggregators: {'@odata.id': 'data'}
                }
            },
            LogServices: {'@odata.id': 'data'},
            Managers: {'@odata.id': 'data'},
            Thermal:
            {'@odata.id':'/redfish/v1/Chassis/0/Elements/0/Thermal'
            }
        }
    },
    entryDataOemElementThermal = {
        body: {
            "Id": "Thermal",
            "Name": "Mock HCI Module Thermal Info",
            "Temperatures": [
                {
                    "@odata.id": "/redfish/v1/Chassis/0/Elements/0/Thermal#/Temperatures/0",
                    "MemberId": "0",
                    "Name": "Element Temperature Sensor",
                    "Status": {
                        "State": "Enabled"
                    },
                    "ReadingCelsius": 32
                },
                {
                    "@odata.id": "/redfish/v1/Chassis/0/Elements/0/Thermal#/Temperatures/1",
                    "MemberId": "1",
                    "Name": "CPU0 Temperature",
                    "Status": {
                        "State": "Enabled"
                    },
                    "ReadingCelsius": -39
                }
            ]
        }
    },
    chassisData = { body: { chassis: 'data' } },
    logData = { body: { Entries: {'@odata.id': 'data'},
                        Members: [{'@odata.id': 'data' }] }
    },
    entryData = { body: { data: 'data' } };

describe('Job.Redfish', function () {
    var base = require('./base-spec');

    base.before(function (context) {
        helper.setupInjector([
            helper.require('/spec/mocks/logger.js'),
            helper.requireGlob('/lib/services/*.js'),
            helper.require('/lib/jobs/base-job.js'),
            helper.require('/lib/jobs/redfish-job.js'),
            helper.require('/lib/utils/job-utils/redfish-tool.js'),
            helper.di.simpleWrapper(waterline,'Services.Waterline')
        ]);
        context.Jobclass = helper.injector.get('Job.Redfish');
    });

    describe('Base', function () {
        base.examples();
    });

    describe("redfish-job", function() {
        var testEmitter = new events.EventEmitter();

        beforeEach(function() {
            waterline.workitems = {
                update: sandbox.stub().resolves(),
                findOne: sandbox.stub().resolves(),
                setSucceeded: sandbox.stub().resolves()
            };

            waterline.obms = {
                findByNode: sinon.stub().resolves({
                    service: 'redfish-obm-service',
                    config: {}
                })
            };

            var graphId = uuid.v4();
            redfishJob = new this.Jobclass({}, { graphId: graphId }, uuid.v4());
            expect(redfishJob.routingKey).to.equal(graphId);
            redfishJob.initClient = sandbox.stub().returns(redfishTool);
            redfishJob._publishPollerAlert = sinon.stub().resolves();
        });

        afterEach(function() {
            redfishJob.initClient.reset();
            redfishTool.clientRequest.reset();
            redfishJob._publishPollerAlert.reset();
        });

        it("should have a _run() method", function() {
            expect(redfishJob).to.have.property('_run').with.length(0);
        });

        it("should have a subscribe redfish command method", function() {
            expect(redfishJob).to.have.property('_subscribeRedfishCommand').with.length(2);
        });

        it("should initialize client", function() {
            var job = new this.Jobclass({}, { graphId: uuid.v4() }, uuid.v4());
            return expect(job.initClient({config:'data'}))
                .to.have.property('settings');
        });

        it("should listen for redfish command requests", function(done) {
            redfishJob.collectData = sinon.stub().resolves(chassisData.body);
            redfishJob._publishRedfishCommandResult = sinon.stub();
            redfishJob._subscribeRedfishCommand = function(routingKey, callback) {
                testEmitter.on('test-subscribe-redfish-command', function(data) {
                    callback.call(redfishJob, data);
                });
            };

            redfishJob._run()
            .then(function() {
                testEmitter.emit('test-subscribe-redfish-command', data);
                setImmediate(function() {
                    try {
                        expect(redfishJob.collectData).to.be.calledOnce;
                        done();
                    } catch (e) {
                        done(e);
                    }
                });
            });
        });

        it("should run collectData for each Chassis command", function() {
            _.forEach(['power', 'thermal'], function(command) {
                redfishTool.clientRequest.reset();
                redfishTool.clientRequest.onCall(0).resolves(listChassisData);
                redfishTool.clientRequest.onCall(1).resolves(chassisData);
                redfishTool.clientRequest.onCall(2).resolves(chassisData);
                return redfishJob.collectData(data, command)
                .then(function(data) {
                    expect(data).to.equal(chassisData.body);
                });
            });
        });

        it("should run collectData for Systems LogServices", function() {
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).resolves(listChassisData);
            redfishTool.clientRequest.onCall(2).resolves(logData);
            redfishTool.clientRequest.onCall(3).resolves(logData);
            redfishTool.clientRequest.onCall(4).resolves(entryData);
            return redfishJob.collectData(data, 'systems.logservices')
            .map(function(data) {
                expect(data[0]).to.deep.equal(entryData.body);
            });
        });

        it("should run collectData for Emc Oem FabricService", function() {
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).resolves(listChassisData);
            redfishTool.clientRequest.onCall(2).resolves(entryData);
            return redfishJob.collectData(data, 'fabricservice')
            .then(function(data) {
                expect(data).to.deep.equal(entryData.body);
            });
        });

        it("should run collectData for Emc Oem Elements Thermal", function() {
            redfishTool.clientRequest.onCall(0).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(1).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(2).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(3).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(4).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(5).resolves(entryDataOemElementThermal);
            return redfishJob.collectData(data, 'elements.thermal')
            .then(function(data) {
                expect(data[0]).to.deep.equal(entryDataOemElementThermal.body);
            });
        });

        it("should run collectData for Emc Oem Spine Thermal", function() {
            redfishTool.clientRequest.onCall(0).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(1).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(2).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(3).resolves(entryDataOemElementThermal);
            return redfishJob.collectOemSpineData(redfishTool, 'Thermal')
            .then(function(data) {
                expect(data[0]).to.deep.equal(entryDataOemElementThermal.body);
            });
        });

        it("should run collectData for Emc Oem Aggregator Thermal", function() {
            redfishTool.clientRequest.onCall(0).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(1).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(2).resolves(listOemElementThermalData);
            redfishTool.clientRequest.onCall(3).resolves(entryDataOemElementThermal);
            return redfishJob.collectOemAggregatorData(redfishTool, 'Thermal')
            .then(function(data) {
                expect(data[0]).to.deep.equal(entryDataOemElementThermal.body);
            });
        });

        it("should run collectData for Managers LogServices", function() {
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).resolves(listChassisData);
            redfishTool.clientRequest.onCall(2).resolves(listChassisData);
            redfishTool.clientRequest.onCall(3).resolves(listChassisData);
            redfishTool.clientRequest.onCall(4).resolves(logData);
            redfishTool.clientRequest.onCall(5).resolves(logData);
            redfishTool.clientRequest.onCall(6).resolves(logData);
            redfishTool.clientRequest.onCall(7).resolves(entryData);
            return redfishJob.collectData(data, 'managers.logservices')
            .map(function(data) {
                expect(data[0]).to.deep.equal(entryData.body);
            });
        });

        it("should fail collectData for unknown command", function() {
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).resolves(chassisData);
            return expect(redfishJob.collectData(data, 'unknown'))
                .to.be.rejectedWith('Unsupported Redfish Command: unknown');
        });

        it("should fail collectData with no data", function() {
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).resolves(undefined);
            return expect(redfishJob.collectData(data, 'power'))
                .to.be.rejectedWith('No Data Found For Command: power');
        });

        it("should fail collectData with error", function() {
            var error = new Error('error text');
            redfishTool.clientRequest.onCall(0).resolves(listChassisData);
            redfishTool.clientRequest.onCall(1).rejects(error);
            return redfishJob.collectData(data, 'power')
            .then(function(data) {
                expect(data).to.deep.equal({error:error});
            });
        });

        it("should add a concurrent request", function() {
            expect(redfishJob.concurrentRequests('test', 'power')).to.equal(false);
            redfishJob.addConcurrentRequest('test', 'power');
            expect(redfishJob.concurrent).to.have.property('test')
                .with.property('power').that.equals(1);
        });

        it("should return true if there are requests outstanding", function() {
            expect(redfishJob.concurrentRequests('test', 'power')).to.equal(false);
            _.forEach(_.range(redfishJob.maxConcurrent), function() {
                redfishJob.addConcurrentRequest('test', 'power');
            });
            expect(redfishJob.concurrentRequests('test', 'power')).to.equal(true);
        });

        it("should generate ResourceUpdated for FabricService data", function(done) {
            var fabricServData = {
                EndPoints: [{ EndPointName:'epName', Available: true }]
            };
            redfishJob.fabricDataCache = {
                EndPoints: [{ EndPointName:'epName',  Available: false }]
            };
            redfishJob.fabricServiceDataAlert(redfishTool, fabricServData)
            .then(function(data) {
                expect(data).to.deep.equal(fabricServData);
                done();
            })
            .catch(done);
        });

        it("should generate ResourceAdded for FabricService data", function(done) {
            var fabricServData = {
                EndPoints: [
                    { EndPointName:'epName', Available: true },
                    { EndPointName:'newEpName', Available: true }
                ]
            };
            redfishJob.fabricDataCache = {
                EndPoints: [{ EndPointName:'epName', Available: true }]
            };
            redfishJob.fabricServiceDataAlert(redfishTool, fabricServData)
            .then(function(data) {
                expect(data).to.deep.equal(fabricServData);
                done();
            })
            .catch(done);
        });

        it("should generate ResourceRemoved for FabricService data", function(done) {
            var fabricServData = {
                EndPoints: [
                    { EndPointName:'epName1',  Available: true },
                    { EndPointName:'EpName2', Available: true }]
            };
            redfishJob.fabricDataCache = Object.assign({}, fabricServData);
            fabricServData.EndPoints = _.drop(fabricServData.EndPoints);
            redfishJob.fabricServiceDataAlert(redfishTool, fabricServData)
            .then(function(data) {
                expect(data).to.deep.equal(fabricServData);
                done();
            })
            .catch(done);
        });

        it("should format FabricService alert data", function() {
            var fabricServData = {
                EndPoints: [
                    { EndPointName:'epName1',  Available: true },
                    { EndPointName:'EpName2', Available: true }]
            };
            var fabricEventData = {
                type: 'polleralert',
                action: 'fabricservice.updated',
                typeId: undefined,
                nodeId: undefined,
                severity: "information",
                data: {
                    eventType: "ResourceRemoved",
                    resource: [fabricServData.EndPoints[0]]
                }
            };

            redfishJob.fabricDataCache = Object.assign({}, fabricServData);
            fabricServData.EndPoints = _.drop(fabricServData.EndPoints);
            return redfishJob.fabricServiceDataAlert(redfishTool, fabricServData)
            .then(function() {
                expect(redfishJob._publishPollerAlert).to.have.been
                    .calledWith(fabricEventData);
            });
        });
    });
});


text:
namespace _02.Lab_LineNumber
{
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    public class LineNubers
    {
        public static void Main()
        {
            var output = File.ReadAllLines("../../Input.txt");

            var result = new List<string>();

            var count = 1;

            foreach (var line in output)
            {
                result.Add($"{count}. {line}");
                count++;
            }

            File.WriteAllLines("../../Result.txt", result);

            Console.WriteLine(string.Join(Environment.NewLine, result));
        }
    }
}


text:
<component name="ProjectDictionaryState">
  <dictionary name="Chris" />
</component>


text:
@font-face {
    font-family: 'museo_slab';
    src: url('fonts/museo_slab_500-webfont.eot');
    src: url('fonts/museo_slab_500-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/museo_slab_500-webfont.woff') format('woff'),
         url('fonts/museo_slab_500-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
  display: block
}
audio,
canvas,
video {
  display: inline-block;
  *display: inline;
  *zoom: 1;
}
audio:not([controls]) {
    display: none
}
[hidden] { display: none }
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
html,
button,
input,
select,
textarea {
  font-family: sans-serif;
  color: #222;
}
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}
a { color: #00e }
a:visited { color: #551a8b }
a:hover { color: #06e }
a:focus { outline: thin dotted }
a:hover,
a:active { outline: 0 }
abbr[title] { border-bottom: 1px dotted }
b, strong { font-weight: bold }
blockquote { margin: 1em 40px }
dfn { font-style: italic }
hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}
ins {
  background: #ff9;
  color: #000;
  text-decoration: none;
}
mark {
  background: #ff0;
  color: #000;
  font-style: italic;
  font-weight: bold;
}
pre, code, kbd, samp {
  font-family: Monaco, Inconsolata, Consolas, 'DejaVu Sans Mono',monospace;
  font-size: 16px;
}
pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
}
q { quotes: none }
q:before,
q:after {
  content: "";
  content: none;
}
small { font-size: 85% }
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em }
sub { bottom: -0.25em }
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
  list-style-type: none;
}
dd { margin: 0 0 0 40px }
nav ul,
nav ol {
  list-style: none;
  list-style-image: none;
  margin: 0;
  padding: 0;
}
img {
  border: 0;
  -ms-interpolation-mode: bicubic;
  vertical-align: middle;
}
svg:not(:root) { overflow: hidden }
figure { margin: 0 }
form { margin: 0 }
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
label { cursor: pointer }
legend {
  border: 0;
  *margin-left: -7px;
  padding: 0;
  white-space: normal;
}
button,
input,
select,
textarea {
  font-size: 100%;
  margin: 0;
  vertical-align: baseline;
  *vertical-align: middle;
}
button,
input { line-height: normal }
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
  *overflow: visible;
}
button[disabled],
input[disabled] { cursor: default }
input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
  *width: 13px;
  *height: 13px;
}
input[type="search"] {
  -webkit-appearance: textfield;
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none }
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}
textarea {
  overflow: auto;
  vertical-align: top;
  resize: vertical;
}
input:invalid,
textarea:invalid { background-color: #f0dddd }
table {
  border-collapse: collapse;
  border-spacing: 0;
}
td { vertical-align: top }
.chromeframe {
  margin: .2em 0;
  background: #ccc;
  color: black;
  padding: .2em 0;
}
.ir {
  display: block;
  border: 0;
  text-indent: -999em;
  overflow: hidden;
  background-color: transparent;
  background-repeat: no-repeat;
  text-align: left;
  direction: ltr;
  *line-height: 0;
}
.ir br { display: none }
.hidden {
  display: none!important;
  visibility: hidden;
}
.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}
.invisible { visibility: hidden }
.clearfix:before,
.clearfix:after {
  content: "";
  display: table;
}
.clearfix:after { clear: both }
.clearfix { *zoom: 1 }

.docversions {
  padding: 10px 0;
  margin-bottom: 10px;
}
.docversions select {
  width: 100%;
  font-size: 15px;
  color: #999;
  padding: 5px;
}

@media print {
  * {
    background: transparent!important;
    color: black!important;
    box-shadow: none!important;
    text-shadow: none!important;
    filter: none!important;
    -ms-filter: none!important;
  }
  a,
  a:visited { text-decoration: underline }
  a[href]:after { content: " (" attr(href) ")" }
  abbr[title]:after { content: " (" attr(title) ")" }
  .ir a:after,
  a[href^="javascript:"]:after,
  a[href^="#"]:after { content: "" }
  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  thead { display: table-header-group }
  tr,
  img { page-break-inside: avoid }
  img { max-width: 100%!important }
}

body {
  background-color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  min-width: 895px;
}
h1, h2, h3, h4, h5, h6 {
  color: #3a3a3a;
  margin-top: 25px;
  margin-bottom: 20px;
  max-width: 480px;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    font-weight: inherit
}
h1 {
  font-size: 26px;
  font-weight: bold;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 20px;
}
h3 {
  font-size: 18px;
  font-weight: 600;
}
h4 {
  font-size: 17px;
  font-weight: 600;
  color: #555;
}
h5 {
  color: #555;
  font-size: 17px;
}
h6 {
  font-size: 16px;
  font-weight: 600;
  color: #555;
}
p {
  margin-top: 20px;
  margin-bottom: 20px;
  color: #4d4d4d;
  font-weight: 400;
}
p img { margin: 0 }
em { font-style: italic }
strong {
  font-weight: bold;
  color: #333;
}
small { font-size: 80% }
a:link,
a:visited,
a:hover,
a:active { text-decoration: none }

blockquote {
  display: inline-block;
  padding-left: 18px;
  padding-bottom: 0;
  font-size: 15px;
  margin-left: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-left: 10px solid #000;
}
article blockquote code ol { margin-left: 28px }
article blockquote pre code { margin-left: 0 }
article blockquote h1,
article blockquote h2,
article blockquote h3,
article blockquote h4 { margin-top: 15px }
article blockquote p:first-child {
  margin-top: 0;
  padding-top: 0;
}
article blockquote p:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
article blockquote blockquote { border-color: #e6e6e6 }
article blockquote blockquote blockquote { border-color: #ccc }
article.post blockquote p { max-width: 440px }
article.post blockquote blockquote p { max-width: 400px }
article.post blockquote blockquote blockquote p { max-width: 380px }
hr {
  border: solid #f4f3f3;
  border-width: 5px 0 0;
  clear: both;
  margin: 0;
  margin-left: -20px;
  margin-right: -20px;
  height: 0;
  width: auto;
  max-width: 540px;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
}
a,
a:visited {
  color: #3A74D0;
  text-decoration: none;
  outline: 0;
}
a:hover,
a:focus { color: #000 }
p a,
p a:visited { line-height: inherit }
article img,
article iframe,
article object {
  display: block;
  margin: 0;
  padding: 0;
  max-width: 657px;
  float: none;
}
article iframe,
article object {
  min-height: 250px;
  min-width: 0;
}
ul,
ol {
  margin-bottom: 20px;
  padding: 0;
  margin: 0;
  margin-left: 20px;
}
ul {
  display: block;
  list-style-type: none;
}
article.post ul {
  list-style-type: disc;
}
article.post ul li,
article.post ol li {
  font-size: 15px;
  margin: 0;
  color: #4d4d4d;
  display: list-item;
  margin-bottom: 5px;
  margin-top: 5px;
}
article.post ol { max-width: 470px }
ol { list-style: decimal }
ul ul,
ul ol,
ol ol,
ol ul {
  margin: 4px 0 5px 0;
  font-size: 90%;
}
ul ul li,
ul ol li,
ol ol li,
ol ul li { margin-bottom: 6px }
li {
  line-height: 18px;
  margin-bottom: 12px;
}

article.post dl { max-width: 800px }
dl {
  margin: 18p 0 30px;
}
dt {
  font-weight: bold;
}
dd {
  margin: 0 0 20px 16px;
}
.dl-horizontal dt {
  float: left;
  clear: left;
  width: 120px;
  text-align: right;
}
.dl-horizontal dd {
  margin-left: 130px;
}

code {
  border: 1px solid #d2d2d2;
  background-color: #f8f8f8;
  padding-left: 5px;
  padding-right: 5px;
  display: inline;
  padding-right: 5px;
  font-size: 14px;
}
p code,
li code {
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border-radius: 15px;
}
code span.pln {
  padding-left: 0;
  padding-right: 0;
}
pre code span.pln { padding-left: 0 }
code ol li span.pln { padding: none }
code ol {
  padding-right: 0;
  margin: 0;
  padding: 0;
}
code li {
  padding: 0;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-right: 0;
  margin: 0;
}
pre { border: none }
pre code {
  border: none;
  display: block;
  border: 1px solid #d2d2d2;
  background-color: #f8f8f8;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
  margin-left: -50px;
  margin-right: 0;
  width: auto;
  border-left: none;
  border-right: none;
  padding-left: 50px;
}

/* Overwrite the default to keep the scrollbar always visible */
pre::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 7px;
}

pre::-webkit-scrollbar-thumb {
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  -moz-box-shadow: 0 0 1px rgba(255,255,255,0.5);
  -webkit-box-shadow: 0 0 1px rgba(255,255,255,0.5);
  box-shadow: 0 0 1px rgba(255,255,255,0.5);
}

pre code ol li {
  border: none;
  margin: 0;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 10px;
}
article pre code ul li,
article pre code ol li {
  font-family: monospace;
  font-size: 15px;
}
article blockquote code ol { margin-left: 28px }
article blockquote pre code { margin-left: 0 }
header#sidebar {
  padding: 30px 0;
  width: 23%;
  margin: 0 2%;
  position: absolute;
  z-index: 1;
  min-height: 100%;
  min-width: 240px;
  max-width: 360px;
}
header#sidebar img{
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  margin-bottom: 20px;
}

section#river {
  margin-left: 27%;
  min-width: 658px;
  position: relative;
  z-index: 10;
  background-color: #fff;
  border-left: 1px solid #e3e3e3;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  -moz-backface-visibility: visible;
  min-height: 900px;
  z-index: 99999;
}
aside#logo {
  position: relative;
  background-color: #000;
  display: block;
  width: 100%;
  margin-top: 20px;
  margin-bottom: 30px;
}
aside#logo a {
  display: block;
  clear: both;
  background-color: #000;
  background-size: 100% 100%;
}
header#sidebar h1#project_name {
  font-weight: bold;
  margin-top: 2 0px;
  margin-bottom: 10px;
}
header#sidebar h1#project_name a {
  font-family: museo_slab, sans-serif;
  font-size: 66px;
  line-height: 1;
  border: none;
  padding: 0;
  display: block;
  color: #111;
  margin-left: 0;
}
header#sidebar h2#tagline {
  font-weight: 300;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  margin-bottom: 25px;
}

span.link {
  display: block;
  clear: both;
  margin: 0;
  padding: 0;
  margin-bottom: 15px;
}
span.link a{
  display: inline-block;
  font-size: 16px;
  border: 4px solid #f8f8f8;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  z-index: 999;
  padding: 7px 15px;
  color: #999;
  font-weight: 600;
  position: relative;
}
span.link a:hover {
  color: #000;
  border-color: #000;
}

header#begin {
  padding-left: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
}
header#begin time#top_time {
  display: block;
  position: relative;
  text-transform: uppercase;
  color: #000;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 33px;
  font-family: museo_slab,sans-serif;
}
section.preview header#begin h2 {
  color: #000;
  font-weight: 900;
  font-size: 35px;
  margin-bottom: 0;
  line-height: 35px;
  margin-top: 20px;
  font-family: museo_slab,sans-serif;
}
section.preview header#begin a.live_link { border-bottom: 1px solid #ccc }
section.preview header#begin h4 {
  margin-top: 10px;
  font-weight: normal;
  font-size: 16px;
  width: auto;
  min-width: 0;
  max-width: 100%;
}
article.post {
  width: auto;
  display: block;
  position: relative;
  padding-left: 50px;
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid #e2e2e2;
  min-height: 130px;
  overflow-x: hidden;
}
article.post h1 a {
  border-bottom: none;
}
article.post h1,
article.post p {
  max-width: 800px;
}
article h2 { margin-top: 30px }
article h2 { margin-top: 24px }

article h1 a:link,
article h1 a:hover,
article h1 a:visited,
article h1 a:active {
  color: black;
  text-decoration: none;
  border-bottom: 1px solid #CCC;
  font-family: museo_slab,sans-serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  border: none;
}
article h2 a:link,
article h2 a:hover,
article h2 a:visited,
article h2 a:active {
  color: black;
  text-decoration: none;
  border-bottom: 1px solid #CCC;
  font-family: museo_slab,sans-serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
}
article h3 a:link,
article h3 a:hover,
article h3 a:visited,
article h3 a:active {
  color: black;
  text-decoration: none;
  border-bottom: 1px solid #CCC;
  font-family: museo_slab,sans-serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
}

article h2 a.anchor {
  border-bottom: 0;
  margin-left: 10px;
}

article h2 img.scalable {
  width: 16px;
  height: 15px;
  display: inline-block;
  margin: 0;
  padding: 0;
  background: url(https://d1yg14i6wd46hx.cloudfront.net/cargo/icons/anchor_gray-d68fd974113c5cec34f23a3df55340c3.png) center center no-repeat\9;
  height: 18px\9;
  border: 0;
  vertical-align: top;
  padding-top: 7px;
}
article a:link,
article a:visited,
article a:hover,
article a:active {
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  color: #3A74D0;
}

.bleed,
span.bleed,
div.bleed,
p.bleed,
img.bleed {
  margin-left: -50px;
  display: block;
}
div#notice {
  display: block;
  padding: 35px;
  margin-left: -1px;
  color: #fff;
  font-size: 23px;
  line-height: 30px;
  font-weight: 600;
  background-color: #6faf0a;
}
div#notice span {
  font-size: 40px;
  line-height: 40px;
  font-weight: 900;
}
nav.pagination {
  padding: 40px;
  border-top: 1px solid #e2e2e2;
  padding-bottom: 100px;
  text-align: center
}
nav.pagination a {
  padding: 10px;
  padding-left: 20px;
  padding-right: 20px;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  font-weight: 700;
  border: 3px solid;
  font-size: 13px;
}
nav.pagination a:hover {
  color: #000;
  border-color: #000;
}
nav.pagination span.next {
  display: block;
  float: right;
}
nav.pagination span.next a:after {
  content: " →";
  font-size: 20px;
  vertical-align: middle;
}
nav.pagination span.prev {
  display: block;
  float: left;
}
nav.pagination span.prev a:before{
  content: "← ";
  font-size: 20px;
  vertical-align: middle;
}
nav.pagination span.back_to_index a:before{
  content: "⌾ ";
  font-size: 20px;
  vertical-align: baseline;
}
table {
  width: auto;
  display: block;
}
td {
  padding: 10px;
  text-align: left;
}

/******************************************************************************
* maintoc
******************************************************************************/
.maintoc {
  width: 100%;
  margin: 30px 0 30px -50px;
  padding: 20px 0 40px 50px;
  border-bottom: 1px solid #ccc;
  border-top: 1px solid #ccc;
}
article.post .maintoc li {
  color: #3A74D0;
  padding: 5px 0;
}
article.post .maintoc li a {
  font-size: 16px;
}

/******************************************************************************
* color
******************************************************************************/

blockquote {
  border-color: #3A74D0;
}
aside#logo, aside#logo div a {
  background-color: #3A74D0;
  /*background-color: #007020;*/
}
aside#logo {
  background-color: transparent;
  overflow: hidden;
}
aside#logo a {
  display: block;
  margin: 0;
  padding: 0;
  background-color: transparent;
  overflow: hidden;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
}
aside#logo a img {
  width: 100%;
  height: auto;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
}

section.preview header#begin h2,
span.link a:hover,
nav.pagination a {
  color: #3A74D0;
}
span.link a:hover,
nav.pagination a {
  border-color: #3A74D0;
}

/******************************************************************************
* warning, info, note
******************************************************************************/

.warning, .info, .note {
  background-color: #f8f8f8;
  background-position: 0 0;
  background-repeat: no-repeat;
  border: none;
  display: block;
  font-size: 14px;
  margin: 15px 0 15px -50px;
  padding: 1px 0 1px 50px;
  position: relative;
  width: auto;
}
.warning p, .info p, .note p {
font-size: 14px;
margin-top: 10px;
margin-bottom: 10px;
}
.warning {
  background-color: #f9d9d8;
  border-color: #ed9390;
}
.info {
  background-color: #d5e9f6;
  border-color: #91c5e7;
}
.note {
  background-color: #fff9d8;
  border-color: #ffec84;
}
.docversion {
  border-top: 2px solid #ddd;
  border-bottom: 2px solid #ddd;
}
.docversion p {
  text-align: center;
}

/******************************************************************************
* media queries
******************************************************************************/

@media all and (max-width:630px) {
  body,
  html { min-width: 0 }
  article ul,
  article ol {
    margin-left: 50px;
    padding-left: 0;
  }
  article dl {
    margin-left: 20px;
    padding-left: 0;
    padding-right: 20px;
  }
  article ul p,
  article ol p,
  article dl p {
    padding-left: 0;
  }
  article.post ul{
    max-width: auto;
    min-width: 0;
    padding-right: 10px;
  }
  aside#logo {
    margin: 0 auto;
    position: relative;
    left: auto;
    right: auto;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  aside#logo a img {
    width: 332px;
  }
  #links {
    width: auto;
    margin: 20px auto 0 auto;
    padding: 0;
    text-align: center;
    clear: both;
    float: none;
  }
  span.link {
    display: inline-block;
    width: auto;
    margin: 0 5px 5px 0;
  }
  header#sidebar {
    display: block;
    position: relative;
    width: auto;
    height: auto;
    text-align: center;
    margin: 0 auto;
    padding: 0;
  }
  header#sidebar h1#project_name,
  header#sidebar h1#project_name a {
    margin: 0;
    padding: 0;
    text-align: center;
    width: auto;
    display: block;
    position: relative;
    min-width: 0;
  }
  header#sidebar h1#project_name {
    margin-top: 10px;
  }
  header#sidebar h2#tagline {
    margin: 0 auto;
    padding: 0;
    margin-top: 10px;
  }
  header#sidebar img{
    width: 100%;
  }
  section#river {
    margin: 0;
    padding: 0;
    border: none;
    display: block;
    width: auto;
    min-width: 0;
    margin-top: 15px;
    clear: both;
    background-color: #fff;
    position: absolute;
  }
  section#river article {
    width: auto;
    padding-left: 0;
    padding-top: 30px;
    padding-bottom: 30px;
    overflow: hidden;
  }
  article p,
  article h2,
  article h1,
  article h3,
  article h4,
  article h5,
  article h6 {
    padding-right: 15px;
    padding-left: 20px;
  }
  article hr {
    margin-right: 10px;
    margin-left: 10px;
    width: auto;
  }
  header#sidebar { min-height: 0 }
  article blockquote p,
  article blockquote h2,
  article blockquote h1,
  article blockquote h3,
  article blockquote h4,
  article blockquote h5,
  article blockquote h6 { padding-left: 10px }
  article hr,
  article p,
  article h2,
  article h1,
  article h3,
  article h4,
  article h5,
  article h6,
  article blockquote p,
  article blockquote h2,
  article blockquote h1,
  article blockquote h3,
  article blockquote h4,
  article blockquote h5,
  article blockquote h6 { max-width: 100% }
  article blockquote {
    margin-left: 20px;
    max-width: none;
    min-width: 0;
    margin-right: 0;
    padding: 0;
  }
  article blockquote blockquote {
    margin-left: 10px;
    margin-right: 0;
  }
  article blockquote p { padding-left: 10px }
  article blockquote ul,
  article blockquote ol,
  article blockquote dl { margin-left: 50px }
  section#river article h2 { margin-top: 0 }

  section#river article pre code {
    width: auto;
    margin: 0;
    padding-left: 20px;
  }
  section#river article p code { padding-left: 5px }
  article blockquote pre code {
    margin: 0;
    width: 80%;
    padding-left: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-right: 1px solid #ccc;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
  section#river article p img,
  section#river article p iframe,
  section#river article p object {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
    float: none;
  }
  article iframe,
  article object {
    min-height: 250px;
    min-width: 0;
  }
  body section#river,
  body section#river article {
    width: 100%;
    max-width: 100%;
  }
  body section#river article p {
    width: auto;
    max-width: 100%;
    min-width: 0;
    display: block;
  }
  body section#river article p a {
    width: auto;
    min-width: 0;
    max-width: 100%;
    display: inline;
    word-wrap: break-word;
    word-break: hyphenate;
    overflow: ellipsis;
  }
  body section#river article p a img {
    display: inline-block;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
  }
  header#sidebar ul#links li.feed { display: none }

  nav.pagination span.prev,
  nav.pagination span.next {
    float: none;
  }
  nav.pagination a {
    display: block;
    padding: 5px 20px;
    margin-bottom: 10px;
  }
}


text:
<?php

/**
 * MailWizzApi_Endpoint_TransactionalEmails handles all the API calls for transactional emails.
 *
 * @author Serban George Cristian <cristian.serban@mailwizz.com>
 * @package MailWizzApi
 * @subpackage Endpoint
 * @since 1.0
 */
namespace mailwizz\Endpoint;

use mailwizz\MailWizzApiBase;
use mailwizz\Http\Client as MailWizzApi_Http_Client;

class TransactionalEmails extends MailWizzApiBase
{
    /**
     * Get all transactional emails of the current customer
     *
     * Note, the results returned by this endpoint can be cached.
     *
     * @param integer $page
     * @param integer $perPage
     * @return MailWizzApi_Http_Response
     */
    public function getEmails($page = 1, $perPage = 10)
    {
        $client = new MailWizzApi_Http_Client(array(
            'method'        => MailWizzApi_Http_Client::METHOD_GET,
            'url'           => $this->config->getApiUrl('transactional-emails'),
            'paramsGet'     => array(
                'page'      => (int)$page,
                'per_page'  => (int)$perPage
            ),
            'enableCache'   => true,
        ));

        return $response = $client->request();
    }

    /**
     * Get one transactional email
     *
     * Note, the results returned by this endpoint can be cached.
     *
     * @param string $emailUid
     * @return MailWizzApi_Http_Response
     */
    public function getEmail($emailUid)
    {
        $client = new MailWizzApi_Http_Client(array(
            'method'        => MailWizzApi_Http_Client::METHOD_GET,
            'url'           => $this->config->getApiUrl(sprintf('transactional-emails/%s', (string)$emailUid)),
            'paramsGet'     => array(),
            'enableCache'   => true,
        ));

        return $response = $client->request();
    }

    /**
     * Create a new transactional email
     *
     * @param array $data
     * @return MailWizzApi_Http_Response
     */
    public function create(array $data)
    {
        if (!empty($data['body'])) {
            $data['body'] = base64_encode($data['body']);
        }

        if (!empty($data['plain_text'])) {
            $data['plain_text'] = base64_encode($data['plain_text']);
        }

        $client = new MailWizzApi_Http_Client(array(
            'method'        => MailWizzApi_Http_Client::METHOD_POST,
            'url'           => $this->config->getApiUrl('transactional-emails'),
            'paramsPost'    => array(
                'email'  => $data
            ),
        ));

        return $response = $client->request();
    }

    /**
     * Delete existing transactional email
     *
     * @param string $emailUid
     * @return MailWizzApi_Http_Response
     */
    public function delete($emailUid)
    {
        $client = new MailWizzApi_Http_Client(array(
            'method'    => MailWizzApi_Http_Client::METHOD_DELETE,
            'url'       => $this->config->getApiUrl(sprintf('transactional-emails/%s', $emailUid)),
        ));

        return $response = $client->request();
    }
}


text: kill -9 `cat /home/liza/bookworm/log/django.pid`


text:
<?php

namespace Modules\Admin\Models;

use Illuminate\Database\Eloquent\Model as Eloquent;

class DefaultCriteria extends BaseModel {

     /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'default_criteria';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
     /**
     * The primary key used by the model.
     *
     * @var string
     */
    protected $primaryKey = 'id';
}


text:
ACCEPTED

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

#### Published in
Mycotaxon 25(2): 562 (1986)

#### Original name
Odonticium helgae Hjortstam & Ryvarden, 1986

### Remarks
null


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jetbrains.idea</groupId>
    <artifactId>parent.twelve.1200</artifactId>
    <version>12.0.0</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <artifactId>core-api</artifactId>

  <name>Maven Integration of core-api modul</name>
  <description>Maven modul for core-api jar</description>

  <build>
    <sourceDirectory>${idea.home}/platform/core-api/src</sourceDirectory>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>util</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>extensions</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.idea</groupId>
      <artifactId>platform-resources-en</artifactId>
    </dependency>

    <dependency>
      <groupId>org.picocontainer</groupId>
      <artifactId>picocontainer</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
  </dependencies>

</project>


text:
package WebService::Technorati::OutboundApiQuery;
use strict;
use utf8;

use WebService::Technorati::ApiQuery;
use WebService::Technorati::LinkQuerySubject;
use WebService::Technorati::BlogLink;
use WebService::Technorati::Exception;
use base 'WebService::Technorati::ApiQuery';

BEGIN {
    use vars qw ($VERSION $DEBUG);
    $VERSION    = 0.04;
    $DEBUG       = 0;
}

use constant API_URI => '/cosmos';

sub new {
    my ($class, %params) = @_;
    if (! exists $params{'key'}) {
        WebService::Technorati::InstantiationException->throw(
            "WebService::Technorati::OutboundApiQuery must be " .
            "instantiated with at least 'key => theverylongkeystring'");
    }
    my $data = {};
    if (! exists $params{'url'}) {
        $data->{'needs_url'}++;
    }
    for my $k (keys %params) {
        $data->{'args'}{$k} = $params{$k};
    }
    my $self = bless ($data, ref ($class) || $class);
    return $self;
}

sub url {
    my $self = shift;
    my $url = shift;
    if ($url) {
        $self->{'url'} = $url;
        delete($self->{'needs_url'});
    }
    return $self->{'url'};
}

sub execute {
    my $self = shift;
    my $apiUrl = $self->apiHostUrl() . API_URI;
    if (exists $self->{'needs_url'}) {
        WebService::Technorati::StateValidationException->throw(
            "WebService::Technorati::AuthorinfoApiQuery must have a " .
            "'url' attribute set prior to query execution");
    }
    $self->SUPER::execute($apiUrl,$self->{'args'});
}

sub readResults {
    my $self = shift;
    my $result_xp = shift;
    my $error = $result_xp->find('/tapi/document/result/error');
    if ($error) {
        WebService::Technorati::DataException->throw($error);
    }
    my $nodeset = $result_xp->find("/tapi/document/result");
    my $node = $nodeset->shift;
    my $blogSubject = WebService::Technorati::LinkQuerySubject->new_from_node($node);
    $nodeset = $result_xp->find('/tapi/document/item');
    my @links = ();
    for my $node ($nodeset->get_nodelist) {
        my $blogLink = WebService::Technorati::BlogLink->new_from_node($node);
        push(@links, $blogLink);
    }
    $self->{'subject'} = $blogSubject;
    $self->{'links'} = \@links;

}

=head2 getLinkQuerySubject

 Usage     : getLinkQuerySubject();
 Purpose   :
 Returns   : a scalar WebService::Technorati::LinkQuerySubject instance
 Argument  : none
 Throws    : none
 Comments  : the URL subject (blog or not) is returned with what
             Technorati knows about it
See Also   : WebService::Technorati

=cut

sub getLinkQuerySubject {
    my $self = shift;
    return $self->{'subject'};
}

=head2 getOutboundLinks

 Usage     : getOutboundLinks();
 Purpose   :
 Returns   : an array of WebService::Technorati::BlogLink instances
 Argument  : none
 Throws    : none
 Comments  : the list of outbound links are returned with what Technorati knows
             about them
See Also   : WebService::Technorati

=cut

sub getOutboundLinks {
    my $self = shift;
    return (wantarray) ? @{$self->{'links'}} : $self->{'links'};
}

1;


text:
<?php

namespace Drupal\Tests\hal\Functional\block;

use Drupal\Tests\block\Functional\Rest\BlockResourceTestBase;
use Drupal\Tests\rest\Functional\AnonResourceTestTrait;

/**
 * @group hal
 * @group legacy
 */
class BlockHalJsonAnonTest extends BlockResourceTestBase {

  use AnonResourceTestTrait;

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['hal'];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';

  /**
   * {@inheritdoc}
   */
  protected static $format = 'hal_json';

  /**
   * {@inheritdoc}
   */
  protected static $mimeType = 'application/hal+json';

}


text:
package org.pgscala.util
package test

import java.sql.{ Statement, ResultSet }
import org.postgresql.ds.PGSimpleDataSource
import java.util.Properties

object PGTestDb {
  private lazy val dbConfig = {
    val props = new Properties
    props.load(getClass.getResourceAsStream("/db.properties"))
    props
  }

  lazy val host = dbConfig.getProperty("host")
  lazy val port = dbConfig.getProperty("port").toInt
  lazy val dbName = dbConfig.getProperty("dbname")
  lazy val user = dbConfig.getProperty("user")
  lazy val password = dbConfig.getProperty("password")

  private lazy val pgds = {
    val driver = "org.postgresql.Driver"
    Class.forName(driver)

    val pgsds = new PGSimpleDataSource()
    pgsds.setServerName(host)
    pgsds.setPortNumber(port)
    pgsds.setDatabaseName(dbName)
    pgsds.setUser(user)
    pgsds.setPassword(password)
    pgsds
  }

  def testInSchema(schema: String)(f: => Unit): Unit = {
    iud("CREATE SCHEMA %s;" format PGIdent.quote(schema))
    try {
      f
    }
    finally{
      iud("DROP SCHEMA %s CASCADE;" format PGIdent.quote(schema))
    }
  }

  def prepareSchemaQuery(schema: Option[String], st: Statement) =
    schema match {
      case Some(s) =>
        st.execute("SET search_path TO %s;" format PGIdent.quote(s))
      case _ =>
    }

  def qry[T](body: String)(f: ResultSet => T)(implicit schema: Option[String] = None): T = {
    val con = pgds.getConnection();
    try {
      val st = con.createStatement()
      try {
        prepareSchemaQuery(schema, st)
        val rS = st.executeQuery(body)
        try {
          f(rS)
        }
        finally rS.close()
      }
      finally st.close()
    }
    finally con.close()
  }

  def iud(body: String)(implicit schema: Option[String] = None): Unit = {
    val con = pgds.getConnection();
    try {
      val st = con.createStatement()
      try {
        prepareSchemaQuery(schema, st)
        st.execute(body)
      }
      finally st.close()
    }
    finally con.close()
  }
}


text:
// <copyright  file="MessagePrinter.cs" company="Balloons-Pop-5">
// All rights reserved.
// </copyright>
// <author>DimitarSD, alexizvely, fr0wsTyl</author>

namespace BalloonsPop.Console.ConsoleIO.Printer
{
    using System;
    using System.Collections;
    using System.Text;
    using BalloonsPop.Console.ConsoleIO.Printer.Contracts;
    using BalloonsPop.Console.ConsoleUI.Colors;
    using BalloonsPop.Console.ConsoleUI.Playfield;
    using Wintellect.PowerCollections;

    /// <summary>
    /// creates printer for the messages in the game
    /// </summary>
    public class MessagePrinter : IPrinter
    {
        /// <summary>
        /// Prints
        /// </summary>
        /// <param name="text">takes a string and prints it on the same line</param>
        public void PrintText(string text)
        {
            Console.Write(text);
        }

        /// <summary>
        /// Prints
        /// </summary>
        /// <param name="text">takes a string and prints it on a separate line</param>
        public void PrintTextLine(string text)
        {
            Console.WriteLine(text);
        }

        /// <summary>
        /// Prints messages to the console
        /// </summary>
        /// <param name="objs">takes an object array and prints it</param>
        public void Print(params object[] objs)
        {
            string message = objs[0] as string;
            this.PrintTextLine(message);
        }
    }
}


text:
@if "%_echo%" neq "on" echo off
rem
rem This file invokes cmake and generates the build system for windows.

set argC=0
for %%x in (%*) do Set /A argC+=1

if NOT %argC%==3 GOTO :USAGE
if %1=="/?" GOTO :USAGE

setlocal
set __sourceDir=%~dp0
set __ExtraCmakeParams=

:: VS 2015 is the minimum supported toolset
if "%__VSVersion%" == "vs2017" (
  set __VSString=15 2017
) else (
  set __VSString=14 2015
)

:: Set the target architecture to a format cmake understands. ANYCPU defaults to x64
if /i "%3" == "x86"     (set __VSString=%__VSString%)
if /i "%3" == "x64"     (set __VSString=%__VSString% Win64)
if /i "%3" == "arm"     (set __VSString=%__VSString% ARM)
if /i "%3" == "arm64"   (set __ExtraCmakeParams=%__ExtraCmakeParams% -A ARM64)
if /i "%3" == "wasm"    (set __sourceDir=%~dp0..\Unix && goto DoGen)

if defined CMakePath goto DoGen

:: Eval the output from probe-win1.ps1
pushd "%__sourceDir%"
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& .\probe-win.ps1"') do %%a
popd

:DoGen

if "%3" == "wasm" (
    emcmake cmake "-DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1" "-DCMAKE_TOOLCHAIN_FILE=%EMSCRIPTEN%/cmake/Modules/Platform/Emscripten.cmake" "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" -G "NMake Makefiles" %__sourceDir%
) else (
    "%CMakePath%" %__SDKVersion% "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" -G "Visual Studio %__VSString%" -B. -H%1 %__ExtraCmakeParams%
)
endlocal
GOTO :DONE

:USAGE
  echo "Usage..."
  echo "gen-buildsys-win.bat <path to top level CMakeLists.txt> <VSVersion> <Target Architecture>"
  echo "Specify the path to the top level CMake file"
  echo "Specify the VSVersion to be used - VS2015 or VS2017"
  echo "Specify the Target Architecture - AnyCPU, x86, x64, ARM, or ARM64."
  EXIT /B 1

:DONE
  EXIT /B 0