text:
/**
 */
package org.tud.inf.st.mbt.ocm.util;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;

import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;

import org.eclipse.emf.ecore.EObject;

import org.tud.inf.st.mbt.core.AbstractModelElement;
import org.tud.inf.st.mbt.ocm.*;
import org.tud.inf.st.mbt.rules.ITimeConsumer;

/**
 *
 * The Adapter Factory for the model.
 * It provides an adapter createXXX method for each class of the model.
 *
 * @see org.tud.inf.st.mbt.ocm.OcmPackage
 * @generated
 */
public class OcmAdapterFactory extends AdapterFactoryImpl {
	/**
	 * The cached model package.
	 *
	 *
	 * @generated
	 */
	protected static OcmPackage modelPackage;

	/**
	 * Creates an instance of the adapter factory.
	 *
	 *
	 * @generated
	 */
	public OcmAdapterFactory() {
		if (modelPackage == null) {
			modelPackage = OcmPackage.eINSTANCE;
		}
	}

	/**
	 * Returns whether this factory is applicable for the type of the object.
	 *
	 * This implementation returns true if the object is either the model's package or is an instance object of the model.
	 *
	 * @return whether this factory is applicable for the type of the object.
	 * @generated
	 */
	@Override
	public boolean isFactoryForType(Object object) {
		if (object == modelPackage) {
			return true;
		}
		if (object instanceof EObject) {
			return ((EObject)object).eClass().getEPackage() == modelPackage;
		}
		return false;
	}

	/**
	 * The switch that delegates to the createXXX methods.
	 *
	 *
	 * @generated
	 */
	protected OcmSwitch<Adapter> modelSwitch =
		new OcmSwitch<Adapter>() {
			@Override
			public Adapter caseOperationalConfigurationModel(OperationalConfigurationModel object) {
				return createOperationalConfigurationModelAdapter();
			}
			@Override
			public Adapter caseConfigurationNode(ConfigurationNode object) {
				return createConfigurationNodeAdapter();
			}
			@Override
			public Adapter caseOperationalEdge(OperationalEdge object) {
				return createOperationalEdgeAdapter();
			}
			@Override
			public Adapter caseStandardConfigurationNode(StandardConfigurationNode object) {
				return createStandardConfigurationNodeAdapter();
			}
			@Override
			public Adapter caseReconfigurationActionNode(ReconfigurationActionNode object) {
				return createReconfigurationActionNodeAdapter();
			}
			@Override
			public Adapter caseEdge(Edge object) {
				return createEdgeAdapter();
			}
			@Override
			public Adapter caseTimedEdge(TimedEdge object) {
				return createTimedEdgeAdapter();
			}
			@Override
			public Adapter caseEventGuardedEdge(EventGuardedEdge object) {
				return createEventGuardedEdgeAdapter();
			}
			@Override
			public Adapter caseAbstractModelElement(AbstractModelElement object) {
				return createAbstractModelElementAdapter();
			}
			@Override
			public Adapter caseITimeConsumer(ITimeConsumer object) {
				return createITimeConsumerAdapter();
			}
			@Override
			public Adapter defaultCase(EObject object) {
				return createEObjectAdapter();
			}
		};

	/**
	 * Creates an adapter for the target.
	 *
	 *
	 * @param target the object to adapt.
	 * @return the adapter for the target.
	 * @generated
	 */
	@Override
	public Adapter createAdapter(Notifier target) {
		return modelSwitch.doSwitch((EObject)target);
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.OperationalConfigurationModel Operational Configuration Model}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.OperationalConfigurationModel
	 * @generated
	 */
	public Adapter createOperationalConfigurationModelAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.ConfigurationNode Configuration Node}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.ConfigurationNode
	 * @generated
	 */
	public Adapter createConfigurationNodeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.OperationalEdge Operational Edge}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.OperationalEdge
	 * @generated
	 */
	public Adapter createOperationalEdgeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.StandardConfigurationNode Standard Configuration Node}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.StandardConfigurationNode
	 * @generated
	 */
	public Adapter createStandardConfigurationNodeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.ReconfigurationActionNode Reconfiguration Action Node}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.ReconfigurationActionNode
	 * @generated
	 */
	public Adapter createReconfigurationActionNodeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.Edge Edge}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.Edge
	 * @generated
	 */
	public Adapter createEdgeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.TimedEdge Timed Edge}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.TimedEdge
	 * @generated
	 */
	public Adapter createTimedEdgeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.ocm.EventGuardedEdge Event Guarded Edge}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.ocm.EventGuardedEdge
	 * @generated
	 */
	public Adapter createEventGuardedEdgeAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.core.AbstractModelElement Abstract Model Element}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.core.AbstractModelElement
	 * @generated
	 */
	public Adapter createAbstractModelElementAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for an object of class '{@link org.tud.inf.st.mbt.rules.ITimeConsumer ITime Consumer}'.
	 *
	 * This default implementation returns null so that we can easily ignore cases;
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
	 *
	 * @return the new adapter.
	 * @see org.tud.inf.st.mbt.rules.ITimeConsumer
	 * @generated
	 */
	public Adapter createITimeConsumerAdapter() {
		return null;
	}

	/**
	 * Creates a new adapter for the default case.
	 *
	 * This default implementation returns null.
	 *
	 * @return the new adapter.
	 * @generated
	 */
	public Adapter createEObjectAdapter() {
		return null;
	}

} //OcmAdapterFactory


text:
class NetworkController(object):
  """Control network settings and servers to simulate the Web.

  Network changes include forwarding device ports to host platform ports.
  Web Page Replay is used to record and replay HTTP/HTTPS responses.
  """

  def __init__(self, network_controller_backend):
    self._network_controller_backend = network_controller_backend

  def Open(self, wpr_mode, netsim, extra_wpr_args):
    self._network_controller_backend.Open(wpr_mode, netsim, extra_wpr_args)

  def Close(self):
    self._network_controller_backend.Close()

  def StartReplay(self, archive_path, make_javascript_deterministic=False):
    self._network_controller_backend.StartReplay(
        archive_path, make_javascript_deterministic)

  def StopReplay(self):
    self._network_controller_backend.StopReplay()

redpajama_set_name: RedPajamaGithub


text:
[![Build Status](https://travis-ci.org/kottenator/settings-overrider.svg?branch=master)](https://travis-ci.org/kottenator/settings-overrider)

Override Python dict contents with YAML file and/or environment variables.

Originally created for Django settings but may be useful in other cases.

## Install

```sh
pip install settings-overrider
```

## Use

```py
# settings.py

from settings_overrider import override

...

# at the end of the file
override(globals(), ...)
```

Use YAML file path:

```py
override(globals(), yaml='/etc/project-settings.yaml')
```

Use YAML file:

```py
with open('/etc/project-settings.yaml') as f:
    override(globals(), yaml=f)
```

Use all environment variables with specified prefix:

```py
override(globals(), env='PRJ_')
```

Prefix will be omitted, i.e. `PRJ_DEBUG` variable will become `DEBUG` setting.

Variable content will be parsed as YAML so you can use:

- `True` / `False`: bool
- `Text` / `"Text"`: string
- `123`: number
- `{ default: { ENGINE: django.db.backends.sqlite3, NAME: /tmp/prj.sqlite3 }}` -
  nested dicts

You can combine YAML file and environment variables.

## Contribute and test

```sh
git clone https://github.com/kottenator/settings-overrider.git
cd settings-overrider
pip install -e '.[test]'
py.test
```


text:
declare interface RegisteredApp
{
    readonly id: string;
    readonly name: string;
    readonly websiteUrl: string;
    readonly downloadUrl: string;
}

declare interface SystemApp
{
    readonly name: string;
    readonly installedVersion: string;
}

// States
declare interface AppState
{
    registeredApps: RegisteredAppsState;
    systemApps: SystemAppsState;
    installedApps: InstalledAppsState;
}

declare interface AppListState<T>
{
    isFetching: boolean;
    apps: T[];
}

type RegisteredAppsState = AppListState<RegisteredApp>;
type SystemAppsState = AppListState<SytemApp>;
type InstalledAppsState = AppListState<InstalledApp>;

declare interface LatestVersionState
{
    readonly isFetchingVersion: boolean;
    readonly latestVersion: string | null;
    readonly isOutdated: boolean;
}

declare interface InstalledApp extends RegisteredApp, SystemApp, LatestVersionState
{
}

// Actions
declare interface AppAction
{
    type: string;
    scope?: "local";
}

// Registered Apps
declare interface RequestRegisteredAppsAction extends AppAction
{
    type: "REQUEST_REGISTERED_APPS";
}

declare interface ReceiveRegisteredAppsAction extends AppAction
{
    type: "RECEIVE_REGISTERED_APPS";
    payload: {
        apps: RegisteredApp[];
    };
}

// System Apps
declare interface RequestSystemAppsAction extends AppAction
{
    type: "REQUEST_SYSTEM_APPS";
}

declare interface ReceiveSystemAppsAction extends AppAction
{
    type: "RECEIVE_SYSTEM_APPS";
    payload: {
        apps: SystemApp[];
    };
}

// Installed Apps
declare interface RequestInstalledAppsAction extends AppAction
{
    type: "REQUEST_INSTALLED_APPS";
}

declare interface ReceiveInstalledAppsAction extends AppAction
{
    type: "RECEIVE_INSTALLED_APPS";
    payload: {
        apps: (RegisteredApp & SystemApp)[];
    };
}

// Latest Version
declare interface RequestLatestVersionAction extends AppAction
{
    type: "REQUEST_LATEST_VERSION";
    payload: {
        appId: string;
    };
}

declare interface ReceiveLatestVersionAction extends AppAction
{
    type: "RECEIVE_LATEST_VERSION";
    payload: {
        appId: string;
        latestVersion: string;
        isOutdated: boolean;
    };
}


text:
package com.amazonaws.services.simpleworkflow.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.simpleworkflow.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * StartTimerDecisionAttributesMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class StartTimerDecisionAttributesMarshaller {

    private static final MarshallingInfo<String> TIMERID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("timerId").build();
    private static final MarshallingInfo<String> CONTROL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("control").build();
    private static final MarshallingInfo<String> STARTTOFIRETIMEOUT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("startToFireTimeout").build();

    private static final StartTimerDecisionAttributesMarshaller instance = new StartTimerDecisionAttributesMarshaller();

    public static StartTimerDecisionAttributesMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(StartTimerDecisionAttributes startTimerDecisionAttributes, ProtocolMarshaller protocolMarshaller) {

        if (startTimerDecisionAttributes == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(startTimerDecisionAttributes.getTimerId(), TIMERID_BINDING);
            protocolMarshaller.marshall(startTimerDecisionAttributes.getControl(), CONTROL_BINDING);
            protocolMarshaller.marshall(startTimerDecisionAttributes.getStartToFireTimeout(), STARTTOFIRETIMEOUT_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
'''
Test the 408 reponse header.
'''
#  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.

import os
import subprocess

Test.Summary = '''
Check 408 response header for protocol stack data.
'''

Test.SkipUnless(
)
Test.ContinueOnFail = True

# Define default ATS
ts = Test.MakeATSProcess("ts")
server = Test.MakeOriginServer("server")

testName = "408 test"

request_header = {"headers": "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
server.addResponse("sessionlog.json", request_header, response_header)

ts.Disk.remap_config.AddLine(
    'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
    )

ts.Disk.records_config.update({
    'proxy.config.http.transaction_no_activity_timeout_in' : 2,
    })

Test.Setup.Copy(os.path.join(os.pardir, os.pardir, 'tools', 'tcp_408_client.py'))

tr = Test.AddTestRun()
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.StartBefore(Test.Processes.ts)
tr.Processes.Default.Command = 'python tcp_408_client.py 127.0.0.1 {0} 4'.format(
    ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.TimeOut = 10
tr.Processes.Default.Streams.stdout = "http408.gold"


text:
package org.elasticsearch.search.aggregations.metrics;

import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.aggregations.Aggregator;
import org.elasticsearch.search.aggregations.AggregatorFactories;
import org.elasticsearch.search.aggregations.AggregatorFactory;
import org.elasticsearch.search.aggregations.CardinalityUpperBound;
import org.elasticsearch.search.aggregations.support.CoreValuesSourceType;
import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory;
import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;
import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry;
import org.elasticsearch.search.internal.SearchContext;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * This factory is used to generate both TDigest and HDRHisto aggregators, depending
 * on the selected method
 */
class PercentilesAggregatorFactory extends ValuesSourceAggregatorFactory {

    private final double[] percents;
    private final PercentilesConfig percentilesConfig;
    private final boolean keyed;

    static void registerAggregators(ValuesSourceRegistry.Builder builder) {
        builder.register(
            PercentilesAggregationBuilder.REGISTRY_KEY,
            List.of(CoreValuesSourceType.NUMERIC, CoreValuesSourceType.DATE, CoreValuesSourceType.BOOLEAN),
            (name, valuesSource, context, parent, percents, percentilesConfig, keyed, formatter, metadata) -> percentilesConfig
                .createPercentilesAggregator(name, valuesSource, context, parent, percents, keyed, formatter, metadata),
                true);
    }

    PercentilesAggregatorFactory(String name, ValuesSourceConfig config, double[] percents,
                                 PercentilesConfig percentilesConfig, boolean keyed, QueryShardContext queryShardContext,
                                 AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
                                 Map<String, Object> metadata) throws IOException {
        super(name, config, queryShardContext, parent, subFactoriesBuilder, metadata);
        this.percents = percents;
        this.percentilesConfig = percentilesConfig;
        this.keyed = keyed;
    }

    @Override
    protected Aggregator createUnmapped(SearchContext searchContext,
                                        Aggregator parent,
                                        Map<String, Object> metadata) throws IOException {

        return percentilesConfig.createPercentilesAggregator(name, null, searchContext, parent, percents, keyed,
            config.format(), metadata);
    }

    @Override
    protected Aggregator doCreateInternal(
        SearchContext searchContext,
        Aggregator parent,
        CardinalityUpperBound bucketCardinality,
        Map<String, Object> metadata
    ) throws IOException {
        return queryShardContext.getValuesSourceRegistry()
            .getAggregator(PercentilesAggregationBuilder.REGISTRY_KEY, config)
            .build(name, config.getValuesSource(), searchContext, parent, percents, percentilesConfig, keyed, config.format(), metadata);
    }
}


text:
BaseAsset::BaseAsset()
{
	CALL_CONSTRUCTOR();
}

BaseAsset::~BaseAsset()
{}

void BaseAsset::LoadAsset(const std::string& SourceFile)
{
	PathToSource = SourceFile;
	AssetPath = SourceFile;
	StringUtils::RemoveChar(AssetPath, AssetManager::GetContentPath());
	name = GetFilename(AssetPath.c_str());
	//#Asset Load the GUID from the Meta data!
	Archive* A = new Archive(NeedsMetaFile ? GetMetaFileName(GetPathToSource()) : GetPathToSource());
	A->HandleArchiveBody("Asset data");
	ProcessAsset(A);
	SafeDelete(A);
}

void BaseAsset::GenerateNewAsset(const std::string& AssetSourcePath)
{
	//#Asset GUID size_t type?
	GUID = PlatformMisc::GenerateGUID();
	PathToSource = AssetSourcePath;
	AssetPath = AssetSourcePath;
	StringUtils::RemoveChar(AssetPath, AssetManager::GetContentPath());
}

void BaseAsset::CreateNew(const std::string& aAssetPath)
{
	GUID = PlatformMisc::GenerateGUID();
	AssetPath = aAssetPath;
	PathToSource = AssetManager::GetContentPath() + aAssetPath;
}

void BaseAsset::SaveAsset()
{
	//#Asset Meta files for editor
	Archive* A = new Archive(NeedsMetaFile ? GetMetaFileName(GetPathToSource()) : GetPathToSource(), true);
	A->HandleArchiveBody("Asset data");
	ProcessAsset(A);
	A->EndHeaderWrite("Asset data");
	A->Write();
	SafeDelete(A);
}

void BaseAsset::ProcessAsset(Archive* A)
{
	ArchiveProp(GUID);
	//#Asset save the Hash of the asset type
	ProcessArchive(A);
}

int BaseAsset::GetGUID() const
{
	return GUID;
}

EAssetStatus::Type BaseAsset::GetState() const
{
	return CurrentState;
}

bool BaseAsset::IsValid() const
{
	return GUID != 0;
}

std::string BaseAsset::GetMetaFileName(const std::string& path)
{
	return path + ".Meta";
}

void BaseAsset::OnPropertyUpdate(ClassReflectionNode* Node)
{
	SetDirty();
}

void BaseAsset::ProcessArchive(Archive * a)
{}


text:
describe RuboCop::Cop::Rails::DelegateAllowBlank do
  subject(:cop) { described_class.new }

  it 'registers an offense when using allow_blank' do
    inspect_source(cop, 'delegate :foo, to: :bar, allow_blank: true')

    msg = '`allow_blank` is not a valid option, use `allow_nil`.'
    expect(cop.messages).to eq([msg])
  end

  it 'does not register an offense when using allow_nil' do
    inspect_source(cop, 'delegate :foo, to: :bar, allow_nil: true')

    expect(cop.messages).to be_empty
  end

  it 'does not register an offense when no extra options given' do
    inspect_source(cop, 'delegate :foo, to: :bar')

    expect(cop.messages).to be_empty
  end

  it 'autocorrects allow_blank to allow_nil' do
    source = 'delegate :foo, to: :bar, allow_blank: true'
    new_source = autocorrect_source(cop, source)

    expect(new_source).to eq('delegate :foo, to: :bar, allow_nil: true')
  end
end


text:
module.exports = {

    template: '

',

    props: {
        page: {
            default: 0
        },

        pages: {
            default: 1
        },

        replaceState: {
            type: Boolean,
            default: true
        }
    },

    created: function () {

        this.key = this.$parent.$options.name + '.pagination';

        if (this.page === null && this.$session.get(this.key)) {
            this.$set('page', this.$session.get(this.key));
        }

        if (this.replaceState) {
            this.$state('page', this.page);
        }

    },

    ready: function () {

        var vm = this;

        this.pagination = UIkit.pagination(this.$el, {pages: this.pages, currentPage: this.page || 0});
        this.pagination.on('select.uk.pagination', function (e, page) {
            vm.$set('page', page);
        });

    },

    watch: {

        page: function (page) {
            this.pagination.selectPage(page || 0);
            this.$session.set(this.key, page || 0);
        },

        pages: function (pages) {
            this.pagination.render(pages);
        }

    }

};


text:
package org.elasticsearch.common.xcontent.support;

import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;
import java.util.Map;

/**
 *
 */
public abstract class AbstractXContentParser implements XContentParser {

    @Override
    public boolean booleanValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_NUMBER) {
            return intValue() != 0;
        } else if (token == Token.VALUE_STRING) {
            return Booleans.parseBoolean(textCharacters(), textOffset(), textLength(), false /* irrelevant */);
        }
        return doBooleanValue();
    }

    protected abstract boolean doBooleanValue() throws IOException;

    @Override
    public short shortValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_STRING) {
            return Short.parseShort(text());
        }
        return doShortValue();
    }

    protected abstract short doShortValue() throws IOException;

    @Override
    public int intValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_STRING) {
            return Integer.parseInt(text());
        }
        return doIntValue();
    }

    protected abstract int doIntValue() throws IOException;

    @Override
    public long longValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_STRING) {
            return Long.parseLong(text());
        }
        return doLongValue();
    }

    protected abstract long doLongValue() throws IOException;

    @Override
    public float floatValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_STRING) {
            return Float.parseFloat(text());
        }
        return doFloatValue();
    }

    protected abstract float doFloatValue() throws IOException;

    @Override
    public double doubleValue() throws IOException {
        Token token = currentToken();
        if (token == Token.VALUE_STRING) {
            return Double.parseDouble(text());
        }
        return doDoubleValue();
    }

    protected abstract double doDoubleValue() throws IOException;

    @Override
    public String textOrNull() throws IOException {
        if (currentToken() == Token.VALUE_NULL) {
            return null;
        }
        return text();
    }

    @Override
    public Map<String, Object> map() throws IOException {
        return XContentMapConverter.readMap(this);
    }

    @Override
    public Map<String, Object> mapOrdered() throws IOException {
        return XContentMapConverter.readOrderedMap(this);
    }

    @Override
    public Map<String, Object> mapAndClose() throws IOException {
        try {
            return map();
        } finally {
            close();
        }
    }

    @Override
    public Map<String, Object> mapOrderedAndClose() throws IOException {
        try {
            return mapOrdered();
        } finally {
            close();
        }
    }
}


text:
import Ember from 'ember';
import checkCurrentRoute from "ember-inspector/utils/check-current-route";
const { Component, computed } = Ember;

export default Component.extend({
  // passed as an attribute to the component
  currentRoute: null,

  classNames: ['list-tree__item', 'row'],
  classNameBindings: ['isCurrent:row_highlight'],
  attributeBindings: ['label:data-label'],

  label: 'route-node',

  labelStyle: computed('model.parentCount', function() {
    return 'padding-left: ' + ((+this.get('model.parentCount') * 20) + 5) + "px";
  }),

  isCurrent: computed('currentRoute', 'model.value.name', function() {
    let currentRoute = this.get('currentRoute');
    if (!currentRoute) {
      return false;
    }

    return checkCurrentRoute( currentRoute, this.get('model.value.name') );
  })
});


text:
{{#markdown}}
```scss
$include-html-button-classes: $include-html-classes;

// We use these to build padding for buttons.
$button-med: rem-calc(12);
$button-tny: rem-calc(7);
$button-sml: rem-calc(9);
$button-lrg: rem-calc(16);

// We use this to control the display property.
$button-display: inline-block;
$button-margin-bottom: rem-calc(20);

// We use these to control button text styles.
$button-font-family: inherit;
$button-font-color: #fff;
$button-font-color-alt: #333;
$button-font-med: rem-calc(16);
$button-font-tny: rem-calc(11);
$button-font-sml: rem-calc(13);
$button-font-lrg: rem-calc(20);
$button-font-weight: bold;
$button-font-align: center;

// We use these to control various hover effects.
$button-function-factor: 10%;

// We use these to control button border styles.
$button-border-width: 1px;
$button-border-style: solid;

// We use this to set the default radius used throughout the core.
$button-radius: $global-radius;
$button-round: $global-rounded;

// We use this to set default opacity for disabled buttons.
$button-disabled-opacity: 0.6;
```
{{/markdown}}


text:
package android.security.cts;

import android.os.cts.FileUtils;

import junit.framework.TestCase;

import java.io.File;

public class BannedFilesTest extends TestCase {

    /**
     * Detect devices vulnerable to the cmdclient privilege escalation bug.
     *
     * References:
     *
     * http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/
     * http://forum.xda-developers.com/showthread.php?t=1213014
     */
    public void testNoCmdClient() {
        assertNotSetugid("/system/bin/cmdclient");
    }

    public void testNoSyncAgent() {
        assertNotSetugid("/system/bin/sync_agent");
    }

    public void testNoSu() {
        assertFalse("/sbin/su",        new File("/sbin/su").exists());
        assertFalse("/system/bin/su",  new File("/system/bin/su").exists());
        assertFalse("/system/sbin/su", new File("/system/sbin/su").exists());
        assertFalse("/system/xbin/su", new File("/system/xbin/su").exists());
        assertFalse("/vendor/bin/su",  new File("/vendor/bin/su").exists());
    }

    public void testNoSuInPath() {
        String path = System.getenv("PATH");
        if (path == null) {
            return;
        }
        String[] elems = path.split(":");
        for (String i : elems) {
            File f = new File(i, "su");
            assertFalse(f.getAbsolutePath() + " exists", f.exists());
        }
    }

    /**
     * setuid or setgid "ip" command can be used to modify the
     * routing tables of a device, potentially allowing a malicious
     * program to intercept all network traffic to and from
     * the device.
     */
    public void testNoSetuidIp() {
        assertNotSetugid("/system/bin/ip");
        assertNotSetugid("/system/xbin/ip");
        assertNotSetugid("/vendor/bin/ip");
    }

    /**
     * setuid or setgid tcpdump can be used maliciously to monitor
     * all traffic in and out of the device.
     */
    public void testNoSetuidTcpdump() {
        assertNotSetugid("/system/bin/tcpdump");
        assertNotSetugid("/system/bin/tcpdump-arm");
        assertNotSetugid("/system/xbin/tcpdump");
        assertNotSetugid("/system/xbin/tcpdump-arm");
        assertNotSetugid("/vendor/bin/tcpdump");
        assertNotSetugid("/vendor/bin/tcpdump-arm");
    }

    private static void assertNotSetugid(String file) {
        FileUtils.FileStatus fs = new FileUtils.FileStatus();
        if (!FileUtils.getFileStatus(file, fs, false)) {
            return;
        }
        assertTrue("File \"" + file + "\" is setUID", (fs.mode & FileUtils.S_ISUID) == 0);
        assertTrue("File \"" + file + "\" is setGID", (fs.mode & FileUtils.S_ISGID) == 0);
    }
}


text:
using namespace Halley;

AssetPreviewGenerator::AssetPreviewGenerator(const HalleyAPI& api, Resources& resources)
	: api(api)
	, resources(resources)
	, renderExecutor(renderQueue)
{
	worldRenderTarget = api.video->createTextureRenderTarget();

	auto& system = *api.system;
	previewExecutor = std::make_unique<SingleThreadExecutor>("Preview", [&system] (const String& name, std::function<void()> f)
	{
		return system.createThread(name, ThreadPriority::Normal, std::move(f));
	});
}

Future<AssetPreviewData> AssetPreviewGenerator::getAssetPreviewData(AssetType assetType, const String& id, Vector2i size)
{
	if (assetType == AssetType::Prefab || assetType == AssetType::Scene) {
		return getPrefabPreviewData(assetType, id, size);
	} else if (assetType == AssetType::Sprite || assetType == AssetType::Animation) {
		return getSpritePreviewData(assetType, id, size);
	}

	return Future<AssetPreviewData>::makeImmediate({});
}

void AssetPreviewGenerator::render(RenderContext& rc)
{
	curRC = &rc;
	renderExecutor.runPending();
	curRC = nullptr;
}

AssetPreviewData AssetPreviewGenerator::makeSpritePreviewData(AssetType assetType, const String& id, Vector2i size, RenderContext& curRC)
{
	RenderSurface surface(*(api.video), RenderSurfaceOptions());
	surface.setSize(size);

	auto image = std::make_shared<Image>(Image::Format::RGBA, size);

	Sprite sprite;
	if (assetType == AssetType::Sprite) {
		sprite = Sprite().setImage(resources, id);
	} else if (assetType == AssetType::Animation) {
		auto player = AnimationPlayer(resources.get<Animation>(id));
		player.update(0);
		player.updateSprite(sprite);
	}

	auto spriteSize = sprite.getAABB().getSize().round();
	const int maxDimension = std::max(8, nextPowerOf2<int>(lroundl(std::max(spriteSize.x, spriteSize.y))));
	const float zoom = std::min(128.0f / maxDimension, 3.0f);

	Camera camera;
	camera.setPosition(sprite.getAABB().getCenter());
	camera.setZoom(zoom);

	auto rc = curRC.with(surface.getRenderTarget()).with(camera);
	rc.bind([&] (Painter& painter)
	{
		painter.clear(Colour4f(0, 0, 0, 0));
		sprite.draw(painter);
	});
	curRC.bind([&] (Painter& painter)
	{
		surface.getRenderTarget().getTexture(0)->copyToImage(painter, *image);
	});

	AssetPreviewData data;
	data.image = std::move(image);
	return data;
}

Future<AssetPreviewData> AssetPreviewGenerator::getSpritePreviewData(AssetType assetType, const String& id, Vector2i size)
{
	return Concurrent::execute(renderQueue, [=] () -> AssetPreviewData
	{
		return makeSpritePreviewData(assetType, id, size, *curRC);
	});
}

Future<AssetPreviewData> AssetPreviewGenerator::getPrefabPreviewData(AssetType assetType, const String& id, Vector2i size)
{
	return Concurrent::execute(previewExecutor->getQueue(), [this, id, size] () -> AssetPreviewInfo {
		// Create world
		auto world = std::shared_ptr<World>(World::make(api, resources, "stages/prefab_preview", true));
		setupPrefabPreviewWorld(*world, size);

		// Add prefab
		const auto prefab = resources.get<Prefab>(id);
		auto entityFactory = std::make_shared<EntityFactory>(*world, resources);
		auto sceneCreated = entityFactory->createScene(prefab, true);

		// Run a simulation step
		world->step(TimeLine::VariableUpdate, 0.1);

		// Get main entity info
		Rect4f spriteBounds;
		String name;
		for (auto id: sceneCreated.getEntities()) {
			auto e = world->getEntity(id);
			if (!e.hasParent()) {
				spriteBounds = getSpriteTreeBounds(e);
				name = e.getName();
				break;
			}
		}
		if (name.isEmpty()) {
			name = Path(prefab->getAssetId()).getFilename().toString();
		}

		// Compute bounds
		const int maxDimension = std::max(8, nextPowerOf2<int>(lroundl(std::max(spriteBounds.getWidth(), spriteBounds.getHeight()))));
		const Vector2i screenCentre = Vector2i(spriteBounds.getCenter());
		const float zoom = std::min(128.0f / maxDimension, 3.0f);
		const Vector2i diag = Vector2i(maxDimension, maxDimension) / 2;
		auto rect = Rect4i(screenCentre - diag, screenCentre + diag);

		// Setup camera
		createPrefabPreviewCamera(*entityFactory, *world, spriteBounds, zoom);

		// Simulate again
		world->step(TimeLine::VariableUpdate, 0.1);

		return AssetPreviewInfo{ world, rect, zoom, name };
	}).then(renderQueue, [this] (AssetPreviewInfo info) -> AssetPreviewData
	{
		auto rc2 = curRC->with(*worldRenderTarget);
		return renderAssetPreview(info, rc2);
	});
}

void AssetPreviewGenerator::setupPrefabPreviewWorld(World& world, Vector2i canvasSize)
{
}

void AssetPreviewGenerator::createPrefabPreviewCamera(EntityFactory& entityFactory, World& world, Rect4f spriteBounds, float zoom)
{
}

AssetPreviewData AssetPreviewGenerator::renderAssetPreview(const AssetPreviewInfo& info, RenderContext& rc)
{
	return AssetPreviewData{};
}

Rect4f AssetPreviewGenerator::getSpriteTreeBounds(const EntityRef& e) const
{
	std::optional<Rect4f> rect;
	doGetSpriteTreeBounds(e, rect);
	return rect.value_or(Rect4f());
}

void AssetPreviewGenerator::doGetSpriteTreeBounds(const EntityRef& e, std::optional<Rect4f>& rect) const
{
	auto cur = getSpriteBounds(e);
	if (!rect) {
		rect = cur;
	}
	if (cur) {
		rect = rect->merge(*cur);
	}

	for (auto& c: e.getRawChildren()) {
		auto child = EntityRef(*c, e.getWorld());
		doGetSpriteTreeBounds(child, rect);
	}
}

std::optional<Rect4f> AssetPreviewGenerator::getSpriteBounds(const EntityRef& e) const
{
	const auto transform2d = e.tryGetComponent<Transform2DComponent>();

	if (transform2d) {
		const auto sprite = e.tryGetComponent<SpriteComponent>();

		if (sprite) {
			const int mask = sprite->mask.value_or(sprite->sprite.hasMaterial() ? sprite->sprite.getMaterial().getDefinition().getDefaultMask() : 0);
			if (isSpriteVisibleOnCamera(sprite->sprite, mask)) {
				return transform2d->getSpriteAABB(sprite->sprite);
			}
		} else {
			auto pos = transform2d->getGlobalPosition();
			return Rect4f(pos, pos);
		}
	}
	return {};
}

bool AssetPreviewGenerator::isSpriteVisibleOnCamera(const Sprite& sprite, int mask) const
{
	return true;
}

Vector<AssetCategoryFilter> AssetPreviewGenerator::getPrefabCategoryFilters() const
{
	return {};
}


text:
/* Authors: Gregory P. Smith & Jeffrey Yasskin */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#if defined(__linux__) && !defined(HAVE_PIPE2)
//# define HAVE_PIPE2 1  /* From 3.2's configure script, undef if you don't. */
#endif
#if defined(HAVE_PIPE2) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE
#endif
#include <unistd.h>
#include <fcntl.h>
#ifdef __linux__
# define HAVE_SYS_TYPES_H 1  /* From 3.2's configure script, undef if reqd. */
# define HAVE_SYS_SYSCALL_H 1  /* From 3.2's configure script, undef if reqd. */
# define HAVE_SYS_DIRENT_H 1  /* From 3.2's configure script, undef if reqd. */
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if defined(HAVE_SYS_STAT_H) && defined(__FreeBSD__)
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif

#if defined(__ANDROID__) && !defined(SYS_getdents64)
/* Android doesn't expose syscalls, add the definition manually. */
# include <sys/linux-syscalls.h>
# define SYS_getdents64  __NR_getdents64
#endif

#include "_posixsubprocess_helpers.c"

#if (PY_VERSION_HEX < 0x02060300)
/* These are not public API fuctions until 2.6.3. */
static void _PyImport_AcquireLock(void);
static int _PyImport_ReleaseLock(void);
#endif

#if defined(sun)
/* readdir64 is used to work around Solaris 9 bug 6395699. */
# define readdir readdir64
# define dirent dirent64
# if !defined(HAVE_DIRFD)
/* Some versions of Solaris lack dirfd(). */
#  define dirfd(dirp) ((dirp)->dd_fd)
#  define HAVE_DIRFD
# endif
#endif

#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__))
# define FD_DIR "/dev/fd"
#else
# define FD_DIR "/proc/self/fd"
#endif

#define POSIX_CALL(call)   if ((call) == -1) goto error

/* Maximum file descriptor, initialized on module load. */
static long max_fd;

/* Given the gc module call gc.enable() and return 0 on success. */
static int
_enable_gc(PyObject *gc_module)
{
    PyObject *result;
    result = PyObject_CallMethod(gc_module, "enable", NULL);
    if (result == NULL)
        return 1;
    Py_DECREF(result);
    return 0;
}

/* Convert ASCII to a positive int, no libc call. no overflow. -1 on error. */
static int
_pos_int_from_ascii(char *name)
{
    int num = 0;
    while (*name >= '0' && *name <= '9') {
        num = num * 10 + (*name - '0');
        ++name;
    }
    if (*name)
        return -1;  /* Non digit found, not a number. */
    return num;
}

#if defined(__FreeBSD__)
/* When /dev/fd isn't mounted it is often a static directory populated
 * with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD and OpenBSD.
 * NetBSD and OpenBSD have a /proc fs available (though not necessarily
 * mounted) and do not have fdescfs for /dev/fd.  MacOS X has a devfs
 * that properly supports /dev/fd.
 */
static int
_is_fdescfs_mounted_on_dev_fd()
{
    struct stat dev_stat;
    struct stat dev_fd_stat;
    if (stat("/dev", &dev_stat) != 0)
        return 0;
    if (stat(FD_DIR, &dev_fd_stat) != 0)
        return 0;
    if (dev_stat.st_dev == dev_fd_stat.st_dev)
        return 0;  /* / == /dev == /dev/fd means it is static. #fail */
    return 1;
}
#endif

/* Returns 1 if there is a problem with fd_sequence, 0 otherwise. */
static int
_sanity_check_python_fd_sequence(PyObject *fd_sequence)
{
    Py_ssize_t seq_idx, seq_len = PySequence_Length(fd_sequence);
    long prev_fd = -1;
    for (seq_idx = 0; seq_idx < seq_len; ++seq_idx) {
        PyObject* py_fd = PySequence_Fast_GET_ITEM(fd_sequence, seq_idx);
        long iter_fd = PyLong_AsLong(py_fd);
        if (iter_fd < 0 || iter_fd < prev_fd || iter_fd > INT_MAX) {
            /* Negative, overflow, not a Long, unsorted, too big for a fd. */
            return 1;
        }
    }
    return 0;
}

/* Is fd found in the sorted Python Sequence? */
static int
_is_fd_in_sorted_fd_sequence(int fd, PyObject *fd_sequence)
{
    /* Binary search. */
    Py_ssize_t search_min = 0;
    Py_ssize_t search_max = PySequence_Length(fd_sequence) - 1;
    if (search_max < 0)
        return 0;
    do {
        long middle = (search_min + search_max) / 2;
        long middle_fd = PyLong_AsLong(
                PySequence_Fast_GET_ITEM(fd_sequence, middle));
        if (fd == middle_fd)
            return 1;
        if (fd > middle_fd)
            search_min = middle + 1;
        else
            search_max = middle - 1;
    } while (search_min <= search_max);
    return 0;
}

/* Close all file descriptors in the range start_fd inclusive to
 * end_fd exclusive except for those in py_fds_to_keep.  If the
 * range defined by [start_fd, end_fd) is large this will take a
 * long time as it calls close() on EVERY possible fd.
 */
static void
_close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep)
{
    Py_ssize_t num_fds_to_keep = PySequence_Length(py_fds_to_keep);
    Py_ssize_t keep_seq_idx;
    int fd_num;
    /* As py_fds_to_keep is sorted we can loop through the list closing
     * fds inbetween any in the keep list falling within our range. */
    for (keep_seq_idx = 0; keep_seq_idx < num_fds_to_keep; ++keep_seq_idx) {
        PyObject* py_keep_fd = PySequence_Fast_GET_ITEM(py_fds_to_keep,
                                                        keep_seq_idx);
        int keep_fd = PyLong_AsLong(py_keep_fd);
        if (keep_fd < start_fd)
            continue;
        for (fd_num = start_fd; fd_num < keep_fd; ++fd_num) {
            while (close(fd_num) < 0 && errno == EINTR);
        }
        start_fd = keep_fd + 1;
    }
    if (start_fd <= end_fd) {
        for (fd_num = start_fd; fd_num < end_fd; ++fd_num) {
            while (close(fd_num) < 0 && errno == EINTR);
        }
    }
}

#if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)
/* It doesn't matter if d_name has room for NAME_MAX chars; we're using this
 * only to read a directory of short file descriptor number names.  The kernel
 * will return an error if we didn't give it enough space.  Highly Unlikely.
 * This structure is very old and stable: It will not change unless the kernel
 * chooses to break compatibility with all existing binaries.  Highly Unlikely.
 */
struct linux_dirent64 {
   unsigned long long d_ino;
   long long d_off;
   unsigned short d_reclen;     /* Length of this linux_dirent */
   unsigned char  d_type;
   char           d_name[256];  /* Filename (null-terminated) */
};

/* Close all open file descriptors in the range start_fd inclusive to end_fd
 * exclusive. Do not close any in the sorted py_fds_to_keep list.
 *
 * This version is async signal safe as it does not make any unsafe C library
 * calls, malloc calls or handle any locks.  It is _unfortunate_ to be forced
 * to resort to making a kernel system call directly but this is the ONLY api
 * available that does no harm.  opendir/readdir/closedir perform memory
 * allocation and locking so while they usually work they are not guaranteed
 * to (especially if you have replaced your malloc implementation).  A version
 * of this function that uses those can be found in the _maybe_unsafe variant.
 *
 * This is Linux specific because that is all I am ready to test it on.  It
 * should be easy to add OS specific dirent or dirent64 structures and modify
 * it with some cpp #define magic to work on other OSes as well if you want.
 */
static void
_close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
{
    int fd_dir_fd;
    if (start_fd >= end_fd)
        return;
#ifdef O_CLOEXEC
    fd_dir_fd = open(FD_DIR, O_RDONLY | O_CLOEXEC, 0);
#else
    fd_dir_fd = open(FD_DIR, O_RDONLY, 0);
#ifdef FD_CLOEXEC
    {
        int old = fcntl(fd_dir_fd, F_GETFD);
        if (old != -1)
            fcntl(fd_dir_fd, F_SETFD, old | FD_CLOEXEC);
    }
#endif
#endif
    if (fd_dir_fd == -1) {
        /* No way to get a list of open fds. */
        _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
        return;
    } else {
        char buffer[sizeof(struct linux_dirent64)];
        int bytes;
        while ((bytes = syscall(SYS_getdents64, fd_dir_fd,
                                (struct linux_dirent64 *)buffer,
                                sizeof(buffer))) > 0) {
            struct linux_dirent64 *entry;
            int offset;
            for (offset = 0; offset < bytes; offset += entry->d_reclen) {
                int fd;
                entry = (struct linux_dirent64 *)(buffer + offset);
                if ((fd = _pos_int_from_ascii(entry->d_name)) < 0)
                    continue;  /* Not a number. */
                if (fd != fd_dir_fd && fd >= start_fd && fd < end_fd &&
                    !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) {
                    while (close(fd) < 0 && errno == EINTR);
                }
            }
        }
        close(fd_dir_fd);
    }
}

#define _close_open_fd_range _close_open_fd_range_safe

#else  /* NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */

/* Close all open file descriptors in the range start_fd inclusive to end_fd
 * exclusive. Do not close any in the sorted py_fds_to_keep list.
 *
 * This function violates the strict use of async signal safe functions. :(
 * It calls opendir(), readdir() and closedir().  Of these, the one most
 * likely to ever cause a problem is opendir() as it performs an internal
 * malloc().  Practically this should not be a problem.  The Java VM makes the
 * same calls between fork and exec in its own UNIXProcess_md.c implementation.
 *
 * readdir_r() is not used because it provides no benefit.  It is typically
 * implemented as readdir() followed by memcpy().  See also:
 *   http://womble.decadent.org.uk/readdir_r-advisory.html
 */
static void
_close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
                                  PyObject* py_fds_to_keep)
{
    DIR *proc_fd_dir;
#ifndef HAVE_DIRFD
    while (_is_fd_in_sorted_fd_sequence(start_fd, py_fds_to_keep) &&
           (start_fd < end_fd)) {
        ++start_fd;
    }
    if (start_fd >= end_fd)
        return;
    /* Close our lowest fd before we call opendir so that it is likely to
     * reuse that fd otherwise we might close opendir's file descriptor in
     * our loop.  This trick assumes that fd's are allocated on a lowest
     * available basis. */
    while (close(start_fd) < 0 && errno == EINTR);
    ++start_fd;
#endif
    if (start_fd >= end_fd)
        return;

#if defined(__FreeBSD__)
    if (!_is_fdescfs_mounted_on_dev_fd())
        proc_fd_dir = NULL;
    else
#endif
        proc_fd_dir = opendir(FD_DIR);
    if (!proc_fd_dir) {
        /* No way to get a list of open fds. */
        _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
    } else {
        struct dirent *dir_entry;
#ifdef HAVE_DIRFD
        int fd_used_by_opendir = dirfd(proc_fd_dir);
#else
        int fd_used_by_opendir = start_fd - 1;
#endif
        errno = 0;
        while ((dir_entry = readdir(proc_fd_dir))) {
            int fd;
            if ((fd = _pos_int_from_ascii(dir_entry->d_name)) < 0)
                continue;  /* Not a number. */
            if (fd != fd_used_by_opendir && fd >= start_fd && fd < end_fd &&
                !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) {
                while (close(fd) < 0 && errno == EINTR);
            }
            errno = 0;
        }
        if (errno) {
            /* readdir error, revert behavior. Highly Unlikely. */
            _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
        }
        closedir(proc_fd_dir);
    }
}

#define _close_open_fd_range _close_open_fd_range_maybe_unsafe

#endif  /* else NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */

/*
 * This function is code executed in the child process immediately after fork
 * to set things up and call exec().
 *
 * All of the code in this function must only use async-signal-safe functions,
 * listed at `man 7 signal` or
 * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
 *
 * This restriction is documented at
 * http://www.opengroup.org/onlinepubs/009695399/functions/fork.html.
 */
static void
child_exec(char *const exec_array[],
           char *const argv[],
           char *const envp[],
           const char *cwd,
           int p2cread, int p2cwrite,
           int c2pread, int c2pwrite,
           int errread, int errwrite,
           int errpipe_read, int errpipe_write,
           int close_fds, int restore_signals,
           int call_setsid,
           PyObject *py_fds_to_keep,
           PyObject *preexec_fn,
           PyObject *preexec_fn_args_tuple)
{
    int i, saved_errno, unused, reached_preexec = 0;
    PyObject *result;
    const char* err_msg = "";
    /* Buffer large enough to hold a hex integer.  We can't malloc. */
    char hex_errno[sizeof(saved_errno)*2+1];

    /* Close parent's pipe ends. */
    if (p2cwrite != -1) {
        POSIX_CALL(close(p2cwrite));
    }
    if (c2pread != -1) {
        POSIX_CALL(close(c2pread));
    }
    if (errread != -1) {
        POSIX_CALL(close(errread));
    }
    POSIX_CALL(close(errpipe_read));

    /* When duping fds, if there arises a situation where one of the fds is
       either 0, 1 or 2, it is possible that it is overwritten (#12607). */
    if (c2pwrite == 0)
        POSIX_CALL(c2pwrite = dup(c2pwrite));
    if (errwrite == 0 || errwrite == 1)
        POSIX_CALL(errwrite = dup(errwrite));

    /* Dup fds for child.
       dup2() removes the CLOEXEC flag but we must do it ourselves if dup2()
       would be a no-op (issue #10806). */
    if (p2cread == 0) {
        int old = fcntl(p2cread, F_GETFD);
        if (old != -1)
            fcntl(p2cread, F_SETFD, old & ~FD_CLOEXEC);
    } else if (p2cread != -1) {
        POSIX_CALL(dup2(p2cread, 0));  /* stdin */
    }
    if (c2pwrite == 1) {
        int old = fcntl(c2pwrite, F_GETFD);
        if (old != -1)
            fcntl(c2pwrite, F_SETFD, old & ~FD_CLOEXEC);
    } else if (c2pwrite != -1) {
        POSIX_CALL(dup2(c2pwrite, 1));  /* stdout */
    }
    if (errwrite == 2) {
        int old = fcntl(errwrite, F_GETFD);
        if (old != -1)
            fcntl(errwrite, F_SETFD, old & ~FD_CLOEXEC);
    } else if (errwrite != -1) {
        POSIX_CALL(dup2(errwrite, 2));  /* stderr */
    }

    /* Close pipe fds.  Make sure we don't close the same fd more than */
    /* once, or standard fds. */
    if (p2cread > 2) {
        POSIX_CALL(close(p2cread));
    }
    if (c2pwrite > 2 && c2pwrite != p2cread) {
        POSIX_CALL(close(c2pwrite));
    }
    if (errwrite != c2pwrite && errwrite != p2cread && errwrite > 2) {
        POSIX_CALL(close(errwrite));
    }

    if (cwd)
        POSIX_CALL(chdir(cwd));

    if (restore_signals)
        _Py_RestoreSignals();

#ifdef HAVE_SETSID
    if (call_setsid)
        POSIX_CALL(setsid());
#endif

    reached_preexec = 1;
    if (preexec_fn != Py_None && preexec_fn_args_tuple) {
        /* This is where the user has asked us to deadlock their program. */
        result = PyObject_Call(preexec_fn, preexec_fn_args_tuple, NULL);
        if (result == NULL) {
            /* Stringifying the exception or traceback would involve
             * memory allocation and thus potential for deadlock.
             * We've already faced potential deadlock by calling back
             * into Python in the first place, so it probably doesn't
             * matter but we avoid it to minimize the possibility. */
            err_msg = "Exception occurred in preexec_fn.";
            errno = 0;  /* We don't want to report an OSError. */
            goto error;
        }
        /* Py_DECREF(result); - We're about to exec so why bother? */
    }

    if (close_fds) {
        int local_max_fd = max_fd;
#if defined(__NetBSD__)
        local_max_fd = fcntl(0, F_MAXFD);
        if (local_max_fd < 0)
            local_max_fd = max_fd;
#endif
        /* TODO HP-UX could use pstat_getproc() if anyone cares about it. */
        _close_open_fd_range(3, local_max_fd, py_fds_to_keep);
    }

    /* This loop matches the Lib/os.py _execvpe()'s PATH search when */
    /* given the executable_list generated by Lib/subprocess.py.     */
    saved_errno = 0;
    for (i = 0; exec_array[i] != NULL; ++i) {
        const char *executable = exec_array[i];
        if (envp) {
            execve(executable, argv, envp);
        } else {
            execv(executable, argv);
        }
        if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
            saved_errno = errno;
        }
    }
    /* Report the first exec error, not the last. */
    if (saved_errno)
        errno = saved_errno;

error:
    saved_errno = errno;
    /* Report the posix error to our parent process. */
    /* We ignore all write() return values as the total size of our writes is
     * less than PIPEBUF and we cannot do anything about an error anyways. */
    if (saved_errno) {
        char *cur;
        unused = write(errpipe_write, "OSError:", 8);
        cur = hex_errno + sizeof(hex_errno);
        while (saved_errno != 0 && cur > hex_errno) {
            *--cur = "0123456789ABCDEF"[saved_errno % 16];
            saved_errno /= 16;
        }
        unused = write(errpipe_write, cur, hex_errno + sizeof(hex_errno) - cur);
        unused = write(errpipe_write, ":", 1);
        if (!reached_preexec) {
            /* Indicate to the parent that the error happened before exec(). */
            unused = write(errpipe_write, "noexec", 6);
        }
        /* We can't call strerror(saved_errno).  It is not async signal safe.
         * The parent process will look the error message up. */
    } else {
        unused = write(errpipe_write, "RuntimeError:0:", 15);
        unused = write(errpipe_write, err_msg, strlen(err_msg));
    }
    if (unused) return;  /* silly? yes! avoids gcc compiler warning. */
}

static PyObject *
subprocess_fork_exec(PyObject* self, PyObject *args)
{
    PyObject *gc_module = NULL;
    PyObject *executable_list, *py_close_fds, *py_fds_to_keep;
    PyObject *env_list, *preexec_fn;
    PyObject *process_args, *converted_args = NULL, *fast_args = NULL;
    PyObject *preexec_fn_args_tuple = NULL;
    int p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite;
    int errpipe_read, errpipe_write, close_fds, restore_signals;
    int call_setsid;
    PyObject *cwd_obj, *cwd_obj2;
    const char *cwd;
    pid_t pid;
    int need_to_reenable_gc = 0;
    char *const *exec_array, *const *argv = NULL, *const *envp = NULL;
    Py_ssize_t arg_num;

    if (!PyArg_ParseTuple(
            args, "OOOOOOiiiiiiiiiiO:fork_exec",
            &process_args, &executable_list, &py_close_fds, &py_fds_to_keep,
            &cwd_obj, &env_list,
            &p2cread, &p2cwrite, &c2pread, &c2pwrite,
            &errread, &errwrite, &errpipe_read, &errpipe_write,
            &restore_signals, &call_setsid, &preexec_fn))
        return NULL;

    close_fds = PyObject_IsTrue(py_close_fds);
    if (close_fds < 0)
        return NULL;
    if (close_fds && errpipe_write < 3) {  /* precondition */
        PyErr_SetString(PyExc_ValueError, "errpipe_write must be >= 3");
        return NULL;
    }
    if (PySequence_Length(py_fds_to_keep) < 0) {
        PyErr_SetString(PyExc_ValueError, "cannot get length of fds_to_keep");
        return NULL;
    }
    if (_sanity_check_python_fd_sequence(py_fds_to_keep)) {
        PyErr_SetString(PyExc_ValueError, "bad value(s) in fds_to_keep");
        return NULL;
    }

    /* We need to call gc.disable() when we'll be calling preexec_fn */
    if (preexec_fn != Py_None) {
        PyObject *result;
        gc_module = PyImport_ImportModule("gc");
        if (gc_module == NULL)
            return NULL;
        result = PyObject_CallMethod(gc_module, "isenabled", NULL);
        if (result == NULL) {
            Py_DECREF(gc_module);
            return NULL;
        }
        need_to_reenable_gc = PyObject_IsTrue(result);
        Py_DECREF(result);
        if (need_to_reenable_gc == -1) {
            Py_DECREF(gc_module);
            return NULL;
        }
        result = PyObject_CallMethod(gc_module, "disable", NULL);
        if (result == NULL) {
            Py_DECREF(gc_module);
            return NULL;
        }
        Py_DECREF(result);
    }

    exec_array = _PySequence_BytesToCharpArray(executable_list);
    if (!exec_array) {
        Py_XDECREF(gc_module);
        return NULL;
    }

    /* Convert args and env into appropriate arguments for exec() */
    /* These conversions are done in the parent process to avoid allocating
       or freeing memory in the child process. */
    if (process_args != Py_None) {
        Py_ssize_t num_args;
        /* Equivalent to:  */
        /*  tuple(PyUnicode_FSConverter(arg) for arg in process_args)  */
        fast_args = PySequence_Fast(process_args, "argv must be a tuple");
        if (fast_args == NULL)
            goto cleanup;
        num_args = PySequence_Fast_GET_SIZE(fast_args);
        converted_args = PyTuple_New(num_args);
        if (converted_args == NULL)
            goto cleanup;
        for (arg_num = 0; arg_num < num_args; ++arg_num) {
            PyObject *borrowed_arg, *converted_arg;
            borrowed_arg = PySequence_Fast_GET_ITEM(fast_args, arg_num);
            if (PyUnicode_FSConverter(borrowed_arg, &converted_arg) == 0)
                goto cleanup;
            PyTuple_SET_ITEM(converted_args, arg_num, converted_arg);
        }

        argv = _PySequence_BytesToCharpArray(converted_args);
        Py_CLEAR(converted_args);
        Py_CLEAR(fast_args);
        if (!argv)
            goto cleanup;
    }

    if (env_list != Py_None) {
        envp = _PySequence_BytesToCharpArray(env_list);
        if (!envp)
            goto cleanup;
    }

    if (preexec_fn != Py_None) {
        preexec_fn_args_tuple = PyTuple_New(0);
        if (!preexec_fn_args_tuple)
            goto cleanup;
        _PyImport_AcquireLock();
    }

    if (cwd_obj != Py_None) {
        if (PyUnicode_FSConverter(cwd_obj, &cwd_obj2) == 0)
            goto cleanup;
        cwd = PyString_AsString(cwd_obj2);
    } else {
        cwd = NULL;
        cwd_obj2 = NULL;
    }

    pid = vfork();
    if (pid == 0) {
        /* Child process */
        /*
         * Code from here to _exit() must only use async-signal-safe functions,
         * listed at `man 7 signal` or
         * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
         */

        if (preexec_fn != Py_None) {
            /* We'll be calling back into Python later so we need to do this.
             * This call may not be async-signal-safe but neither is calling
             * back into Python.  The user asked us to use hope as a strategy
             * to avoid deadlock... */
            PyOS_AfterFork();
        }

        child_exec(exec_array, argv, envp, cwd,
                   p2cread, p2cwrite, c2pread, c2pwrite,
                   errread, errwrite, errpipe_read, errpipe_write,
                   close_fds, restore_signals, call_setsid,
                   py_fds_to_keep, preexec_fn, preexec_fn_args_tuple);
        _exit(255);
        return NULL;  /* Dead code to avoid a potential compiler warning. */
    }
    Py_XDECREF(cwd_obj2);

    if (pid == -1) {
        /* Capture the errno exception before errno can be clobbered. */
        PyErr_SetFromErrno(PyExc_OSError);
    }
    if (preexec_fn != Py_None &&
        _PyImport_ReleaseLock() < 0 && !PyErr_Occurred()) {
        PyErr_SetString(PyExc_RuntimeError,
                        "not holding the import lock");
    }

    /* Parent process */
    if (envp)
        _Py_FreeCharPArray(envp);
    if (argv)
        _Py_FreeCharPArray(argv);
    _Py_FreeCharPArray(exec_array);

    /* Reenable gc in the parent process (or if fork failed). */
    if (need_to_reenable_gc && _enable_gc(gc_module)) {
        Py_XDECREF(gc_module);
        return NULL;
    }
    Py_XDECREF(preexec_fn_args_tuple);
    Py_XDECREF(gc_module);

    if (pid == -1)
        return NULL;  /* fork() failed.  Exception set earlier. */

    return PyLong_FromPid(pid);

cleanup:
    if (envp)
        _Py_FreeCharPArray(envp);
    if (argv)
        _Py_FreeCharPArray(argv);
    _Py_FreeCharPArray(exec_array);
    Py_XDECREF(converted_args);
    Py_XDECREF(fast_args);
    Py_XDECREF(preexec_fn_args_tuple);

    /* Reenable gc if it was disabled. */
    if (need_to_reenable_gc)
        _enable_gc(gc_module);
    Py_XDECREF(gc_module);
    return NULL;
}

PyDoc_STRVAR(subprocess_fork_exec_doc,
"fork_exec(args, executable_list, close_fds, cwd, env,\n\
          p2cread, p2cwrite, c2pread, c2pwrite,\n\
          errread, errwrite, errpipe_read, errpipe_write,\n\
          restore_signals, call_setsid, preexec_fn)\n\
\n\
Forks a child process, closes parent file descriptors as appropriate in the\n\
child and dups the few that are needed before calling exec() in the child\n\
process.\n\
\n\
The preexec_fn, if supplied, will be called immediately before exec.\n\
WARNING: preexec_fn is NOT SAFE if your application uses threads.\n\
         It may trigger infrequent, difficult to debug deadlocks.\n\
\n\
If an error occurs in the child process before the exec, it is\n\
serialized and written to the errpipe_write fd per subprocess.py.\n\
\n\
Returns: the child process's PID.\n\
\n\
Raises: Only on an error in the parent process.\n\
");

PyDoc_STRVAR(subprocess_cloexec_pipe_doc,
"cloexec_pipe() -> (read_end, write_end)\n\n\
Create a pipe whose ends have the cloexec flag set; write_end will be >= 3.");

static PyObject *
subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
{
    int fds[2];
    int res, saved_errno;
    long oldflags;
#ifdef HAVE_PIPE2
    Py_BEGIN_ALLOW_THREADS
    res = pipe2(fds, O_CLOEXEC);
    Py_END_ALLOW_THREADS
    if (res != 0 && errno == ENOSYS)
    {
#endif
        /* We hold the GIL which offers some protection from other code calling
         * fork() before the CLOEXEC flags have been set but we can't guarantee
         * anything without pipe2(). */
        res = pipe(fds);

        if (res == 0) {
            oldflags = fcntl(fds[0], F_GETFD, 0);
            if (oldflags < 0) res = oldflags;
        }
        if (res == 0)
            res = fcntl(fds[0], F_SETFD, oldflags | FD_CLOEXEC);

        if (res == 0) {
            oldflags = fcntl(fds[1], F_GETFD, 0);
            if (oldflags < 0) res = oldflags;
        }
        if (res == 0)
            res = fcntl(fds[1], F_SETFD, oldflags | FD_CLOEXEC);
#ifdef HAVE_PIPE2
    }
#endif
    if (res == 0 && fds[1] < 3) {
        /* We always want the write end of the pipe to avoid fds 0, 1 and 2
         * as our child may claim those for stdio connections. */
        int write_fd = fds[1];
        int fds_to_close[3] = {-1, -1, -1};
        int fds_to_close_idx = 0;
#ifdef F_DUPFD_CLOEXEC
        fds_to_close[fds_to_close_idx++] = write_fd;
        write_fd = fcntl(write_fd, F_DUPFD_CLOEXEC, 3);
        if (write_fd < 0)  /* We don't support F_DUPFD_CLOEXEC / other error */
#endif
        {
            /* Use dup a few times until we get a desirable fd. */
            for (; fds_to_close_idx < 3; ++fds_to_close_idx) {
                fds_to_close[fds_to_close_idx] = write_fd;
                write_fd = dup(write_fd);
                if (write_fd >= 3)
                    break;
                /* We may dup a few extra times if it returns an error but
                 * that is okay.  Repeat calls should return the same error. */
            }
            if (write_fd < 0) res = write_fd;
            if (res == 0) {
                oldflags = fcntl(write_fd, F_GETFD, 0);
                if (oldflags < 0) res = oldflags;
                if (res == 0)
                    res = fcntl(write_fd, F_SETFD, oldflags | FD_CLOEXEC);
            }
        }
        saved_errno = errno;
        /* Close fds we tried for the write end that were too low. */
        for (fds_to_close_idx=0; fds_to_close_idx < 3; ++fds_to_close_idx) {
            int temp_fd = fds_to_close[fds_to_close_idx];
            while (temp_fd >= 0 && close(temp_fd) < 0 && errno == EINTR);
        }
        errno = saved_errno;  /* report dup or fcntl errors, not close. */
        fds[1] = write_fd;
    }  /* end if write fd was too small */

    if (res != 0)
        return PyErr_SetFromErrno(PyExc_OSError);
    return Py_BuildValue("(ii)", fds[0], fds[1]);
}

/* module level code ********************************************************/

#define MIN_PY_VERSION_WITH_PYIMPORT_ACQUIRELOCK 0x02060300
#if (PY_VERSION_HEX < MIN_PY_VERSION_WITH_PYIMPORT_ACQUIRELOCK)
static PyObject* imp_module;

static void
_PyImport_AcquireLock(void)
{
    PyObject *result;
    result = PyObject_CallMethod(imp_module, "acquire_lock", NULL);
    if (result == NULL) {
        fprintf(stderr, "imp.acquire_lock() failed.\n");
        return;
    }
    Py_DECREF(result);
}

static int
_PyImport_ReleaseLock(void)
{
    PyObject *result;
    result = PyObject_CallMethod(imp_module, "release_lock", NULL);
    if (result == NULL) {
        fprintf(stderr, "imp.release_lock() failed.\n");
        return -1;
    }
    Py_DECREF(result);
    return 0;
}
#endif /* Python <= 2.5 */

PyDoc_STRVAR(module_doc,
"A POSIX helper for the subprocess module.");

static PyMethodDef module_methods[] = {
    {"fork_exec", subprocess_fork_exec, METH_VARARGS, subprocess_fork_exec_doc},
    {"cloexec_pipe", subprocess_cloexec_pipe, METH_NOARGS, subprocess_cloexec_pipe_doc},
    {NULL, NULL}  /* sentinel */
};

PyMODINIT_FUNC
init_posixsubprocess(void)
{
    PyObject *m;

#ifdef _SC_OPEN_MAX
    max_fd = sysconf(_SC_OPEN_MAX);
    if (max_fd == -1)
#endif
        max_fd = 256;  /* Matches Lib/subprocess.py */

#if (PY_VERSION_HEX < MIN_PY_VERSION_WITH_PYIMPORT_ACQUIRELOCK)
    imp_module = PyImport_ImportModule("imp");
    if (imp_module == NULL)
        return;
#endif

    m = Py_InitModule3("_posixsubprocess", module_methods, module_doc);
    if (m == NULL)
        return;
}


text:
package de.clashofdynasties.repository;

import de.clashofdynasties.models.City;
import de.clashofdynasties.models.Event;
import de.clashofdynasties.models.Player;
import de.clashofdynasties.service.MailService;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.stream.Collectors;

@Component
public class EventRepository extends Repository<Event> {
    private static EventRepository instance;

    @Autowired
    private MailService mailService;

    @PostConstruct
    public void initialize() {
        load(Event.class);
        instance = this;
    }

    public static EventRepository get() {
        return instance;
    }

    @Override
    public synchronized void add(Event item) {
        super.add(item);
        if(item.getPlayer().hasNotification(item.getType()))
            mailService.sendMail(item.getPlayer(), item.getTitle(), item.getDescription());
    }

    public synchronized Event findById(ObjectId id) {
        return items.stream().filter(e -> e.getId().equals(id)).findFirst().orElse(null);
    }

    public synchronized List<Event> findByPlayer(Player player) {
        return items.stream().filter(e -> e.getPlayer().equals(player)).collect(Collectors.toList());
    }
}


text:
var apiRoute = '/api/v1/';

var getEndpointListing = function(req, res, next){
  res.send({root: 'error', error: 'Not implemented'});
};

var Router = module.exports = function(server, config, restify){
  server.get(apiRoute+'endpoints', getEndpointListing);
};


text:
package vulkan

// binary: cpp = vulkan

// The following are the imports that generated source files pull in when present
// Having these here helps out tools that can't cope with missing dependancies
import (
	_ "github.com/google/gapid/core/data/id"
	_ "github.com/google/gapid/core/math/u64"
	_ "github.com/google/gapid/framework/binary/schema"
	_ "github.com/google/gapid/gapis/atom/atom_pb"
	_ "github.com/google/gapid/gapis/gfxapi/vulkan/vulkan_pb"
	_ "github.com/google/gapid/gapis/memory/memory_pb"
)


text:
<?php

defined('_JEXEC') or die('Restricted access');
$url = rtrim( JURI::base() , '/' );
?>

<a href="<?php echo $url . EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$blog->id); ?>"><?php echo $blog->title; ?>

<?php
$date		= EasyBlogDateHelper::dateWithOffSet($blog->created);
$postdate 	= EasyBlogDateHelper::toFormat($date, $config->get('layout_shortdateformat', '%b %d'));
?>

<?php echo JText::_('COM_EASYBLOG_POSTED_ON'); ?> <?php echo $postdate; ?>,
<?php echo JText::sprintf('COM_EASYBLOG_POSTED_BY_AUTHOR', $url . $blogger->getProfileLink(), $blogger->displayName); ?>
<?php echo JText::_('COM_EASYBLOG_CATEGORY'); ?> <a href="<?php echo $url . EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id='.$blog->category_id); ?>"><?php echo $this->escape($blog->getCategoryName()); ?>

<?php echo $blog->event->afterDisplayTitle; ?>
<?php echo $blog->event->beforeDisplayContent; ?>
<?php if(!empty($blog->toc)){ echo $blog->toc; }?>
<?php echo $blog->intro; ?>
<?php echo $blog->content; ?>
<?php echo $blog->event->afterDisplayContent; ?>

<?php echo $blog->copyrights; ?>

<?php echo JText::_('COM_EASYBLOG_TAGS'); ?>: <?php echo $tags; ?>


text:
<?php

namespace MessageBird\Resources\PartnerAccount;

use MessageBird\Common\HttpClient;
use MessageBird\Objects\Balance;
use MessageBird\Objects\Conversation\Conversation;
use MessageBird\Objects\Hlr;
use MessageBird\Objects\Lookup;
use MessageBird\Objects\Message;
use MessageBird\Objects\PartnerAccount\Account;
use MessageBird\Objects\Verify;
use MessageBird\Objects\VoiceMessage;
use MessageBird\Resources\Base;
use MessageBird\Exceptions;

class Accounts extends Base
{
    public const RESOURCE_NAME = 'child-accounts';

    public function __construct(HttpClient $httpClient)
    {
        parent::__construct($httpClient);

        $this->setObject(new Account());
        $this->setResourceName(self::RESOURCE_NAME);
    }

    /**
     * @param $object
     * @param array|null $query
     * @return Balance|Conversation|Hlr|Lookup|Message|Verify|VoiceMessage|null
     * @throws Exceptions\AuthenticateException
     * @throws Exceptions\BalanceException
     * @throws Exceptions\HttpException
     * @throws Exceptions\RequestException
     * @throws Exceptions\ServerException
     */
    public function create($object, ?array $query = null)
    {
        [, , $body] = $this->httpClient->performHttpRequest(
            HttpClient::REQUEST_POST,
            self::RESOURCE_NAME,
            null,
            $object->loadToJson()
        );

        return $this->processRequest($body);
    }

    /**
     * @return array|Balance|\MessageBird\Objects\BaseList|Conversation|Hlr|Lookup|Message|\MessageBird\Objects\MessageResponse|Verify|VoiceMessage|null
     * @throws Exceptions\AuthenticateException
     * @throws Exceptions\BalanceException
     * @throws Exceptions\HttpException
     * @throws Exceptions\RequestException
     * @throws Exceptions\ServerException
     * @throws \JsonException
     */
    public function getList(?array $parameters = [])
    {
        [$status, , $body] = $this->httpClient->performHttpRequest(
            HttpClient::REQUEST_GET,
            self::RESOURCE_NAME,
            $parameters
        );

        if ($status !== 200) {
            return $this->processRequest($body);
        }

        $response = json_decode($body, true, 512, \JSON_THROW_ON_ERROR);

        $return = [];
        foreach ($response as &$singleResponse) {
            $return[] = $this->getObject()->loadFromArray($singleResponse);
        }

        return $return;
    }

    /**
     * @param $object
     * @param $id
     * @return Balance|Conversation|Hlr|Lookup|Message|Verify|VoiceMessage|null
     * @throws Exceptions\AuthenticateException
     * @throws Exceptions\BalanceException
     * @throws Exceptions\HttpException
     * @throws Exceptions\RequestException
     * @throws Exceptions\ServerException
     */
    public function update($object, $id)
    {
        [, , $body] = $this->httpClient->performHttpRequest(
            HttpClient::REQUEST_PATCH,
            sprintf('%s/%s', self::RESOURCE_NAME, $id),
            null,
            $object->loadToJson()
        );

        return $this->processRequest($body);
    }
}


text:
story %q(project: addon to import/sync with github issues) do
  status queued
  points 1
  created_by :unixsuperhero
  assigned_to :unassigned
  tags *%w(project github importers integration)

  description <<-DESCRIPTION
    One of the many 3rd party site integrators

    Tools like this, that can import and sync with an existing site/service
    will make adopting clitasks easier and less farfetched.
  DESCRIPTION
end


text:
"""Hello world Lambda function for mu testing.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import json
import sys

def main(event, context):
    from c7n.utils import parse_cidr
    parse_cidr('10.0.0.0/24')  # while we're here, ensure ipaddress availability
    json.dump(event, sys.stdout)

def get_function(session_factory, name, role, events):
    from c7n.mu import (LambdaFunction, custodian_archive)

    config = dict(
        name=name,
        handler='helloworld.main',
        runtime='python2.7',
        memory_size=512,
        timeout=15,
        role=role,
        description='Hello World',
        events=events)

    archive = custodian_archive()
    archive.add_py_file(__file__)
    archive.close()

    return LambdaFunction(config, archive)


text:
namespace Gu.Wpf.DataGrid2D.UiTests
{
    using Gu.Wpf.UiAutomation;
    using NUnit.Framework;

    public class AddRemoveTest
    {
        [Test]
        public void RemoveFirstColumn()
        {
            using (var app = Application.Launch(Info.ExeFileName, "AddRemoveWindow"))
            {
                var window = app.MainWindow;
                var dataGrid = window.FindDataGrid("DataGridData");

                var addRowBtn = window.FindButton("Row++");
                addRowBtn.Click();
                addRowBtn.Click();
                addRowBtn.Click();

                var addColBtn = window.FindButton("Column++");
                addColBtn.Click();

                // hack around framework bug.
                _ = dataGrid.FindAllChildren();
                Assert.AreEqual("0", dataGrid[0, 0].Value);
                Assert.AreEqual("0", dataGrid[1, 0].Value);
                Assert.AreEqual("0", dataGrid[2, 0].Value);

                addColBtn.Click();
                Assert.AreEqual("1", dataGrid[0, 1].Value);
                Assert.AreEqual("1", dataGrid[1, 1].Value);
                Assert.AreEqual("1", dataGrid[2, 1].Value);

                addColBtn.Click();
                Assert.AreEqual("2", dataGrid[0, 2].Value);
                Assert.AreEqual("2", dataGrid[1, 2].Value);
                Assert.AreEqual("2", dataGrid[2, 2].Value);

                Assert.AreEqual(3, dataGrid.RowCount);
                Assert.AreEqual(3, dataGrid.ColumnCount);

                var remColBtn = window.FindButton("Column--");
                remColBtn.Click();
                Assert.AreEqual("1", dataGrid[0, 1].Value);
                Assert.AreEqual("1", dataGrid[1, 1].Value);
                Assert.AreEqual("1", dataGrid[2, 1].Value);

                remColBtn.Click();
                Assert.AreEqual("0", dataGrid[0, 0].Value);
                Assert.AreEqual("0", dataGrid[1, 0].Value);
                Assert.AreEqual("0", dataGrid[2, 0].Value);

                remColBtn.Click();
            }
        }
    }
}


text: console.log("second entry");


text:
require 'spec_helper'

describe "default feed csv parser" do
  describe "csv" do
    it "should convert Pachube CSV v2 into attributes hash" do
      csv = feed_as_(:csv, :version => 'v2')
      feed = PachubeDataFormats::Feed.new(csv)
      feed.should fully_represent_feed(:csv_v2, csv)
    end

    it "should convert Pachube CSV v1 into attributes hash" do
      csv = feed_as_(:csv, :version => 'v1')
      feed = PachubeDataFormats::Feed.new(csv)
      feed.should fully_represent_feed(:csv_v1, csv)
    end

    it "should raise an exception if Pachube CSV cannot be detected" do
      csv = feed_as_(:csv, :version => 'unknown')
      lambda {PachubeDataFormats::Feed.new(csv)}.should raise_exception(PachubeDataFormats::Parsers::CSV::UnknownVersionError)
    end

    it "should accept manually determining csv version to be v2" do
      csv = feed_as_(:csv, :version => 'unknown')
      feed = PachubeDataFormats::Feed.new(csv, :v2)
      feed.should fully_represent_feed(:csv_v2, csv)
    end

    it "should accept manually determining csv version to be v1" do
      csv = feed_as_(:csv, :version => 'unknown')
      feed = PachubeDataFormats::Feed.new(csv, :v1)
      feed.should fully_represent_feed(:csv_v1, csv)
    end
  end
end


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using Snowplow.Tracker.Queues;
using Snowplow.Tracker.Storage;
using Snowplow.Tracker.Models;
using Snowplow.Tracker.Models.Events;
using Snowplow.Tracker.Models.Adapters;
using Snowplow.Tracker.Endpoints;
using Snowplow.Tracker.Emitters;

namespace Snowplow.Tracker.Tests
{
    [TestClass]
    public class LoadTest
    {

        private Tracker tracker = Tracker.Instance;
        private LiteDBStorage storage = null;

        private const string _collectorHostUri = @"snowplow-snowplow-pmz0wkw27skf-1566534576.eu-west-1.elb.amazonaws.com";

        private const string _testDbFilename = @"load_test.db";
        private const string _testDbLogFilename = @"load_test-log.db";
        private const string _testClientSessionFilename = @"load_test-session.xml";

        // --- Tests

        [TestMethod]
        [Ignore]
        public void testLoadPost()
        {
            storage = new LiteDBStorage(_testDbFilename);

            Assert.AreEqual(0, storage.TotalItems);

            var queue = new PersistentBlockingQueue(storage, new PayloadToJsonString());
            var endpoint = new SnowplowHttpCollectorEndpoint(host: _collectorHostUri, port: 8080, protocol: HttpProtocol.HTTP, method: HttpMethod.POST, byteLimitPost: 100000);
            var emitter = new AsyncEmitter(endpoint: endpoint, queue: queue, sendLimit: 1000);

            var clientSession = new ClientSession(_testClientSessionFilename);

            Assert.IsFalse(tracker.Started);
            tracker.Start(emitter: emitter, clientSession: clientSession, trackerNamespace: "testNamespace", appId: "testAppId", encodeBase64: false, synchronous: false);
            Assert.IsTrue(tracker.Started);

            for (int i = 0; i < 100; i++)
            {
                tracker.Track(new Structured()
                    .SetCategory("exampleCategory")
                    .SetAction("exampleAction")
                    .SetLabel("exampleLabel")
                    .SetProperty("exampleProperty")
                    .SetValue(17)
                    .Build()
                );
            }

            tracker.Flush();
            tracker.Stop();
            Assert.IsFalse(tracker.Started);
        }

        [TestMethod]
        [Ignore]
        public void testLoadGet()
        {
            storage = new LiteDBStorage(_testDbFilename);

            Assert.AreEqual(0, storage.TotalItems);

            var queue = new PersistentBlockingQueue(storage, new PayloadToJsonString());
            var endpoint = new SnowplowHttpCollectorEndpoint(host: _collectorHostUri, port: 8080, protocol: HttpProtocol.HTTP, method: HttpMethod.GET, byteLimitGet: 50000);
            var emitter = new AsyncEmitter(endpoint: endpoint, queue: queue, sendLimit: 25);

            var clientSession = new ClientSession(_testClientSessionFilename);

            Assert.IsFalse(tracker.Started);
            tracker.Start(emitter: emitter, clientSession: clientSession, trackerNamespace: "testNamespace", appId: "testAppId", encodeBase64: false, synchronous: false);
            Assert.IsTrue(tracker.Started);

            for (int i = 0; i < 100; i++)
            {
                tracker.Track(new Structured()
                    .SetCategory("exampleCategory")
                    .SetAction("exampleAction")
                    .SetLabel("exampleLabel")
                    .SetProperty("exampleProperty")
                    .SetValue(17)
                    .Build()
                );
            }

            tracker.Flush();
            tracker.Stop();
            Assert.IsFalse(tracker.Started);
        }

        [TestInitialize]
        public void cleanupDb()
        {
            if (File.Exists(_testDbFilename))
            {
                File.Delete(_testDbFilename);
            }

            if (File.Exists(_testDbLogFilename))
            {
                File.Delete(_testDbLogFilename);
            }

            if (File.Exists(_testClientSessionFilename))
            {
                File.Delete(_testClientSessionFilename);
            }
        }

        [TestCleanup]
        public void stopTracker()
        {
            storage.Dispose();
            storage = null;

            tracker.Stop();
            tracker = null;
        }
    }
}


text:
namespace Microsoft.Azure.ContainerRegistry.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// A list of unstructured historical data for v1 compatibility
    /// </summary>
    public partial class History
    {
        /// <summary>
        /// Initializes a new instance of the History class.
        /// </summary>
        public History()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the History class.
        /// </summary>
        /// <param name="v1Compatibility">The raw v1 compatibility
        /// information</param>
        public History(string v1Compatibility = default(string))
        {
            V1Compatibility = v1Compatibility;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the raw v1 compatibility information
        /// </summary>
        [JsonProperty(PropertyName = "v1Compatibility")]
        public string V1Compatibility { get; set; }

    }
}


text:
package com.avsystem.commons
package redis.exception

import com.avsystem.commons.redis.protocol.ErrorMsg
import com.avsystem.commons.redis.{NodeAddress, RawCommand, Redirection, RedisCommand}

class RedisException(msg: String = null, cause: Throwable = null)
  extends RuntimeException(msg, cause)

/**
  * Throw when response sent back by Redis server is corrupt according to Redis protocol.
  */
class InvalidDataException(msg: String)
  extends RedisException(msg)

/**
  * Thrown when transactions fails due to one of watched keys having been modified by another client,
  * i.e. when `EXEC` command in a `WATCH`-`MULTI`-`EXEC` transaction returns null bulk response.
  */
class OptimisticLockException
  extends RedisException("One of the watched keys has been modified by another client")

/**
  * Thrown when Redis server returns a reply unexpected by a decoder of a particular command.
  */
class UnexpectedReplyException(msg: String = null)
  extends RedisException(msg)

/**
  * Thrown when Redis server replies with an error.
  */
class ErrorReplyException(val reply: ErrorMsg, val command: RedisCommand[_])
  extends RedisException(s"Redis replied with error: ${reply.errorString.utf8String}, command: $command") {
  def errorStr: String = reply.errorString.utf8String
}

class RedisIOException(msg: String = null, cause: Throwable = null)
  extends RedisException(msg, cause)

class ConnectionFailedException(val address: NodeAddress)
  extends RedisIOException(s"Failed to connect to Redis instance at $address")

/**
  * Thrown when an I/O error occ
  */
class WriteFailedException(val address: NodeAddress)
  extends RedisIOException(s"Failed to send data through Redis connection to $address")

/**
  * Command or operation is failed with this exception when it has been already sent through network but the
  * connection was closed before receiving a response. Even though connections are automatically restarted,
  * such command cannot be resent because we don't know whether it was actually executed on the Redis instance or not.
  * In a Redis Cluster deployment, this is likely to happen when a node fails.
  */
class ConnectionClosedException(val address: NodeAddress, val cause: Opt[Throwable])
  extends RedisIOException(s"Redis connection to $address was closed", cause.orNull)

class ConnectionBusyException(val address: NodeAddress)
  extends RedisIOException(s"Redis connection to $address is currently busy writing other request")

class ClientStoppedException(val address: Opt[NodeAddress])
  extends RedisException(s"Redis client for ${address.fold("cluster")(_.toString)} was stopped")

/**
  * Thrown when some command was queued for execution on a [[com.avsystem.commons.redis.RedisNodeClient RedisNodeClient]]
  * connected to one of the master nodes in Redis Cluster and [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]]
  * detected that this node is no longer a master before the command could be sent to it.
  */
class NodeRemovedException(val address: NodeAddress)
  extends RedisException(s"Node $address is no longer a master in Redis Cluster or Redis Master/Slave")

class ConnectionInitializationFailure(cause: Throwable)
  extends RedisException(s"Failed to initialize Redis connection", cause)

class NodeInitializationFailure(cause: Throwable)
  extends RedisException(s"Failed to initialize node client", cause)

/**
  * Thrown when trying to execute command unsupported by particular client type. For example, it's impossible
  * to execute connection state changing commands like `CLIENT SETNAME` using a
  * [[com.avsystem.commons.redis.RedisNodeClient RedisNodeClient]].
  */
class ForbiddenCommandException(cmd: RawCommand, client: String)
  extends RedisException(s"This command cannot be executed on $client: $cmd")

/**
  * Thrown when there is too many concurrent blocking commands being executed on a node
  * client and blocking connection pool is exhausted.
  */
class TooManyConnectionsException(maxPoolSize: Int)
  extends RedisException(s"Maximum number of blocking connections ($maxPoolSize) was reached")

/**
  * Thrown when [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]] is unable to fetch initial
  * cluster state from any of the seed nodes. This happens e.g. when none of the seed nodes can be contacted or when
  * they aren't Redis Cluster members.
  *
  * @param seedNodes seed node addresses passed to [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]]
  */
class ClusterInitializationException(val seedNodes: Seq[NodeAddress])
  extends RedisException(s"Failed to read cluster state from all of the seed nodes ${seedNodes.mkString(",")}")

/**
  * Thrown when [[com.avsystem.commons.redis.RedisMasterSlaveClient RedisMasterSlaveClient]] is unable
  * to fetch current master address from any of the sentinel seed nodes.
  *
  * @param masterName   name of the master monitored by sentinels
  * @param seedSentiels seed sentinel addresses passed to [[com.avsystem.commons.redis.RedisMasterSlaveClient RedisMasterSlaveClient]]
  */
class MasterSlaveInitializationException(val masterName: String, val seedSentiels: Seq[NodeAddress])
  extends RedisException(s"Failed to fetch master node for $masterName from all of the seed sentinels: ${seedSentiels.mkString(", ")}")

/**
  * Thrown when some multi-keyed command or `MULTI`-`EXEC` block executed by
  * [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]] contains keys that hash to different slots.
  */
class CrossSlotException
  extends RedisException("Keys don't hash to the same slot")

/**
  * Throw when (according to current cluster state) some slot is not served by any master. This most likely
  * indicates problem with setup of the Redis Cluster deployment itself.
  */
class UnmappedSlotException(val slot: Int)
  extends RedisException(s"Slot $slot is not served by any node")

/**
  * Thrown when trying to execute command or `MULTI`-`EXEC` block that does not contain any keys using
  * [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]].
  */
class NoKeysException
  extends RedisException(s"Cannot execute commands with no keys using cluster client")

/**
  * Thrown when too many consecutive cluster redirections occurred during execution of some command by
  * [[com.avsystem.commons.redis.RedisClusterClient RedisClusterClient]]. This might indicate a problem
  * with configuration of Redis Cluster deployment itself.
  *
  * Maximum number of consecutive redirections is configured by
  * [[com.avsystem.commons.redis.config.ClusterConfig ClusterConfig]]
  */
class TooManyRedirectionsException(val lastRedirection: Redirection)
  extends RedisException(s"Too many Redis cluster redirections, last one to: " +
    s"${lastRedirection.address} (slot ${lastRedirection.slot}${if (lastRedirection.ask) ", ASK" else ""})")

/**
  * Thrown by [[com.avsystem.commons.redis.RedisMasterSlaveClient RedisMasterSlaveClient]] when - despite multiple
  * retries - the master responds with a `READONLY` error code indicating that it is no longer a master. This happens
  * when for some reason failover cannot be performed by Redis Sentinel or it takes too long.
  */
class NoMasterException(val err: ErrorMsg)
  extends RedisException(s"No master available - READONLY error is being received consistently")


text:
{% load url from future %}
{% load static %}

        <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap-tweaks.css"/>
        <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}rest_framework/css/default.css'/>

Django REST framework

                    <form action="{% url 'rest_framework:login' %}" class=" form-inline" method="post">
                        {% csrf_token %}

                                Username:
                                <input style="height: 25px" type="text" name="username" maxlength="100" autocapitalize="off" autocorrect="off" class="textinput textInput" id="id_username">

                                Password:
                                <input style="height: 25px" type="password" name="password" maxlength="100" autocapitalize="off" autocorrect="off" class="textinput textInput" id="id_password">

                        <input type="hidden" name="next" value="{{ next }}" />

                            <input type="submit" name="submit" value="Log in" class="btn btn-primary" id="submit-id-submit">

                    </form>


text:
.. _tutorials__getting_started_v3_api__create_your_first_expectations:

Create your first Expectations
======================================

:ref:`Expectations` are the key concept in Great Expectations.

Each Expectation is a declarative, machine-verifiable assertion about the expected format, content, or behavior of your data. Great Expectations comes with :ref:`dozens of built-in Expectations <expectation_glossary>`, and it's possible to :ref:`develop your own custom Expectations <how_to_guides__creating_and_editing_expectations__how_to_create_custom_expectations>`, too.

.. admonition:: Admonition from Mr. Dickens.

    "Take nothing on its looks; take everything on evidence. There's no better rule."

The CLI will help you create your first Expectation Suite. Suites are simply collections of Expectations.
In order to create a new suite, we will use the built-in profiler to automatically create an Expectation Suite called ``taxi.demo``. Type the following into your terminal:

.. code-block:: bash

    great_expectations --v3-api suite new

You will see the following output:

.. code-block:: bash

    Using v3 (Batch Request) API
    How would you like to create your Expectation Suite?
        1. Manually, without interacting with a sample Batch of data (default)
        2. Interactively, with a sample Batch of data
        3. Automatically, using a Data Assistant
    : 3

    A batch of data is required to edit the suite - let's help you to specify it.

    Which data asset (accessible by data connector "taxi_data_example_data_connector") would you like to use?
        1. yellow_tripdata_sample_2019-01.csv
        2. yellow_tripdata_sample_2019-02.csv
    : 1

    Name the new Expectation Suite [yellow_tripdata_sample_2019-01.csv.warning]: taxi.demo

    When you run this notebook, Great Expectations will store these expectations in a new Expectation Suite "taxi.demo" here:

      <path_to_project>/great_expectations/expectations/taxi/demo.json

    Would you like to proceed? [Y/n]: <press Enter>

This will open up a **Jupyter notebook** that helps you create the new suite. Before diving into the notebook, let's first
explain what we just did.

**What just happened?**

You may now wonder why we chose the first file in this step. Here's an explanation: Recall that our data directory
contains two CSV files: `yellow_tripdata_sample_2019-01` and `yellow_tripdata_sample_2019-02`.

* `yellow_tripdata_sample_2019-01` contains the January 2019 taxi data. Since we want to build an Expectation Suite based on what we know about our taxi data from the January 2019 data set, we want to use it for profiling.
* `yellow_tripdata_sample_2019-02` contains the February 2019 data, which we consider the "new" data set that we want to validate before using it in production. We'll use it *later* when showing you how to validate data.

Makes sense, right?

After selecting the table, Great Expectations will open a Jupyter notebook which will take you through the next part of this workflow.

.. warning::

   Don't execute the Jupyter notebook cells just yet!

Creating Expectations in Jupyter notebooks
---------------------------------------------------------

Notebooks are a simple way of interacting with the Great Expectations Python API. You could also just write all this in plain Python code, but for convenience, Great Expectations provides you some boilerplate code in notebooks.

Since notebooks are often less permanent, creating Expectations in a notebook also helps reinforce that the source of truth about Expectations is the Expectation Suite, **not** the code that generates the Expectations.

**Let's take a look through the notebook and see what's happening in each cell:**

.. figure:: /images/suite_edit_notebook.png

#. The first cell does several things: It imports all the relevant libraries, loads a Data Context, and creates a ``Validator``, which combines a Batch Request to define your batch of data, and an Expectation Suite.

#. The second cell allows you to specify which columns you want to **ignore** when creating Expectations. Remember how we want to add some tests on the ``passenger_count`` column to ensure that its values range between 1 and 6? **Let's comment just this one line to include it:**

    .. code-block:: python

        ignored_columns = [
            'vendor_id',
            'pickup_datetime',
            'dropoff_datetime',
            # 'passenger_count',
            ...
        ]

#. The next cell is where you configure a ``UserConfigurableProfiler`` and instantiate it, which will then profile the data and create the relevant Expectations to add to your ``taxi.demo`` suite. You can leave these defaults as-is for now  - :ref:`learn more about the available parameters here. <how_to_guides__creating_and_editing_expectations__how_to_create_an_expectation_suite_with_the_user_configurable_profiler>`

#. The last cell does several things again: It saves the Expectation Suite to disk, runs the validation against the loaded data batch, and then builds and opens Data Docs, so you can look at the validation results. *We will explain the validation step later in the "Validate your data" section.*

**Let's execute all the cells** and wait for Great Expectations to open a browser window with Data Docs. **Go to the next step in the tutorial** for an explanation of what you see in Data Docs!