COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) Geoworks 1995 -- All Rights Reserved

PROJECT:	Tiramisu
MODULE:		Preferences
FILE:		preffax2.def

AUTHOR:		Peter Trinh, Jan 16, 1995

MACROS:
	Name			Description
	----			-----------

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	PT	1/16/95   	Initial revision

DESCRIPTION:
	Contains definitions of data-structure for the Fax Preferences
	module.

	$Id: preffax2.def,v 1.1 97/04/05 01:43:20 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

;-----------------------------------------------------------------------------
;	Data types
;-----------------------------------------------------------------------------

ELEMENT_NOT_IN_ARRAY		enum FatalErrors
; Trying to index into the given array specified by ds:si with a bad
; index value, ax.

CHUNK_ARRAY_ENUM_PREMATURE_TERMINATION		enum	FatalErrors
; Not expecting the enumeration to terminate prematurely (without
; having gone through all the items in the chunk arrays), ie. the
; callback routine terminated with the CARRY flag set.

PREF_DIALING_CODE_LIST_ENUM_PREMATURE_TERMINATION	enum	FatalErrors
; Not expecting the enumeration to terminate prematurely, ie. the
; callback routine terminated with the CARRY flag set.

PREF_ITEM_GROUP_SPECIAL_CATEGORY_ERROR		enum	FatalErrors
; The category string in the instance data field doesn't match that of
; the assertions.  Make sure to have
;		categoryOne = FAX_INI_FAXIN_CATEGORY
;		categoryTwo = FAX_INI_FAXOUT_CATEGORY
; if you want to write the class information.

;-----------------------------------------------------------------------------
;	CONSTANTS
;-----------------------------------------------------------------------------

;-----------------------------------------------------------------------------
;	STRUCTURES
;-----------------------------------------------------------------------------
PrefFaxMesgStruct	struct
	PFMS_msgNumber	word		; will be stored in reg ax
	PFMS_cx_data	word		; passed in cx
	PFMS_dx_data	word		; 	    dx
	PFMS_bp_data	word		;    	    bp
PrefFaxMesgStruct	ends

;-----------------------------------------------------------------------------
;	CLASSES
;-----------------------------------------------------------------------------

PrefFaxDialogClass	class	PrefDialogClass

MSG_PREF_FAX_DIALOG_SEND_MSG_TO_SELECTED_LIST	message
;
; Will send the "encapsulated" message and parameters (given on the
; stack) to the list selected by the list selector.  Eg. if the Access
; list is chosen, then the message and parameters on the passed
; structure will be sent to the Access list.
;
; For now, the list selector is hard-coded to be DialingCodeSelector,
; but can be expanded later on to support any various selectors.
;
; Context:	Forwarding message mechanism.
; Source:	Global
; Destination:  PrefDialogClass
; Interception: not usually
;
; Pass:		PrefFaxMesgStruct - on the stack
;
; Return:	nothing
;		nothing - destroyed
;

MSG_PREF_FAX_DIALOG_SELECT_DIALING_CODE_LIST	message
;
; Sent when the user clicks on one of the items of the
; DialingCodeSelector.  Will determine which list is selected, and
; "ACTIVATE" that list while "DEACTIVATING" the other list(s)
; NOT_USABLE.
;
; Context:	Mechanism to visually select PrefDialingCodeLists
; Source:	PrefItemGroupClass
; Destination:  PrefDialogClass
; Interception: not usually
;
; Pass:		cx	= current selection
;		bp	= number of selections
;		dl	= GenItemGroupStateFlags
;
; Return:	nothing
;		nothing - destroyed
;

;-----------------------------------------------------------------------------
;	Instance data
;-----------------------------------------------------------------------------

PrefFaxDialogClass	endc

PrefInteractionSpecialClass	class	PrefInteractionClass
;-----------------------------------------------------------------------------
;	Instance data
;-----------------------------------------------------------------------------

PrefInteractionSpecialClass	endc

PrefItemGroupSpecialClass	class	PrefItemGroupClass
;
; Allows saving the same option information to two different category.
;
; To do this, we're intercepting the MSG_GEN_SAVE_OPTION message and
; copying our own key string into the buffer and then call the super
; class to actually write it out.
;
; Note: Will ignore the category that is given in the vardata
; ATTR_GEN_INIT_FILE_CATEGORY when saving; however, you will still
; need to indicate the category and key using
; ATTR_GEN_INIT_FILE_CATEGORY/KEY for proper loading behavior.
;

MSG_PREF_ITEM_GROUP_SPECIAL_CHECK_PORT	message
;
; Checks the selected port to see if a viable faxmodem is connected.
; If not, then display a warning dialog box.
;
; Context:	sent out when user selects a port number item
; Source:	GenItemGroupClass object
; Destination:  Any PrefItemGroupSpecialClass object
; Interception: not usually
;
; Pass:	cx 	= current selection, or first selection in item group,
; 		  if more than one selection, or GIGS_NONE if no
; 		  selection (selection interpreted as port numbers)
;	bp 	= number of selections
;	dl	= GenItemGroupStateFlags
;		  GIGSF_MODIFIED will be set if a user activation has
;		  just changed the status of the group.  Will be clear
;		  if a redundant user activation has occurred, such as
;		  the re-selection of the singly selected exclusive
;		  item.  If message is a result of
;		  MSG_GEN_ITEM_GROUP_SEND_STATUS_MSG being sent, then
;		  this bit will hold the value passed in that message.
;
; Return:	nothing
;		nothing - destroyed
;

;-----------------------------------------------------------------------------
;	Data types
;-----------------------------------------------------------------------------
PrefItemGroupSpecialFlags	record
	PIGSF_FAX_CLASS:1	; It's a fax class item selector, so
				; need to write out the driver name
				; and capabilities as well.
	:7
PrefItemGroupSpecialFlags	end

;-----------------------------------------------------------------------------
;	Instance data
;-----------------------------------------------------------------------------
PIGSI_categoryOne		lptr.char
	; First category string

PIGSI_categoryTwo		lptr.char
	; Second category string where saved information should be
	; written to.

PIGSI_itemGroupSpecialflags	PrefItemGroupSpecialFlags
	; To mark other things that needs to be written out to the ini
	; file.

PrefItemGroupSpecialClass	endc

PrefDialingCodeListClass	class	PrefDynamicListClass
;
; Adds on to the functionality of the PrefDynamicListClass by allowing
; the management of not only one "list" of items, but three "lists" of
; items that have their values stored in the ini file.  It also sends
; the outputs of the selected list items to the "attached" text
; objects.
;
; Upon receiving MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY, it will build out
; 1-3 chunk arrays depending on the number of ini keys that are
; initialized.
;
; Then upon receiving MSG_PREF_ITEM_GROUP_GET_ITEM_MONIKER, it will
; search the "notes" chunk array and return the appropriate text item.
; (THUS: the notesKey should be initialized or else the object will
; not be initialized at all.)
;
; Upon receiving MSG_PREF_DYNAMIC_LIST_FIND_ITEM, it will find the
; item in the "notes" chunk array given the item moniker.
;

MSG_PREF_DIALING_CODE_LIST_SELECT_ITEM	message
;
; When an item in the list is selected, this message will be sent to
; the PrefDialingCodeListClass.  When this message is received, it
; will output the corresponding information in it's arrays to the
; attached text object.
;
; Context:	When item in the list is selected
; Source:	PrefDialingCodeListClass object
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		cx -- current selection, or first selection in item
;		      group, if more than one selection, or GIGS_NONE
;		      of no selection
;		bp -- number of selections
;		dl -- GenItemGroupStateFlags
; Return:	nothing
;		ax, cx, dx, bp -- destroyed

MSG_PREF_DIALING_CODE_LIST_DELETE_SELECTED_ITEM		message
;
; Will delete the currently selected item.  This is done by removing
; all the corresponding elements in the chunk arrays as well as
; removing the item from the list itself.  When removing the elements
; from the arrays, we will free the allocated lptr.
;
; Side effect: will clear out all attached text objects.
;
; Context:	Mechanism to change the list.
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

MSG_PREF_DIALING_CODE_LIST_INSERT_ITEM	message
;
; Will insert an item into the list.  The item will be sorted by it's
; notes data string and will be inserted accordingly.  The data
; strings will be grabbed from the attached text objects.
;
; Context:	Mechanism to change the list.
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

MSG_PREF_DIALING_CODE_LIST_MODIFY_SELECTED_ITEM	message
;
; Will allow the modification of the selected item's information, ie.
; note string, dialing code, billing code, etc.
;
; Context:	Mechanism to change the list.
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

MSG_PREF_DIALING_CODE_LIST_DESTROY_ARRAYS	message
;
; Will "destroy" the arrays, by freeing up memory that is associated
; to the chunk arrays and the arrays themselves.
;
; Context:	Mechanism to clean up.
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

MSG_PREF_DIALING_CODE_LIST_ACTIVATE	message
;
; Make the list USABLE and all the linked text objects USABLE as well.
;
; Context:	Mechanism to select between lists
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

MSG_PREF_DIALING_CODE_LIST_DEACTIVATE	message
;
; Make the list NOT_USABLE and all the linked text objects NOT_USABLE as
; well.
;
; Context:	Mechanism to select between lists
; Source:	Global
; Destination:  PrefDialingCodeListClass object
; Interception: not usually
;
; Pass:		nothing
; Return:	nothing
;		nothing	- destroyed
;

;-----------------------------------------------------------------------------
;	Data types
;-----------------------------------------------------------------------------

;
; Identifiers for the various ini keys
;
PrefDialingCodeKey	etype	word
PDCK_NOTE		enum	PrefDialingCodeKey	; Note ini-key
PDCK_CODE1		enum	PrefDialingCodeKey	; Code1 ini-key
PDCK_CODE2		enum	PrefDialingCodeKey	; Code2 ini-key

;
; Data-structure of the info stored in the array
;
PrefDCLArrayInfo	struct
	PDCLAI_length	word	; Length of the stored string
	PDCLAI_strLptr	lptr.char	; lptr to str chunk
PrefDCLArrayInfo	ends

PrefDialingCodeListFlags	record
	PDCLIF_ABORT:1		; a transaction was aborted so don't
				; commit to the ini file
	PDCLIF_INITIALIZED:1	; the list has already been initialized
	PDCLIF_DIRTIED:1	; the list has been modified so needs
				; saving
	:5
PrefDialingCodeListFlags	end

;-----------------------------------------------------------------------------
;	Instance data
;-----------------------------------------------------------------------------

PDCLI_category		lptr.char
	; Ini category where all of the following keys are located.
	;
PDCLI_notesKey		lptr.char
	; The ini key indicating where the "notes" are stored.  (NOTE:
	; these "notes" will also serve as the moniker of the items in
	; the list.)
	;
PDCLI_codeOneKey	lptr.char
	; The ini key indicating where the first set of "code" are
	; stored.
	;
PDCLI_codeTwoKey	lptr.char
	; The ini key indicating where the second set of "code" are
	; stored.
	;
PDCLI_notesArray	lptr.char
	; Pointer to the chunk array that will store all the "notes"
	; while the Dialing Code dialog box in on screen.
	;
PDCLI_codeOneArray	lptr.char
	; Pointer to the chunk array that will store all of the first
	; set of "code" while the Dialing Code dialog box in on
	; screen.
	;
PDCLI_codeTwoArray	lptr.char
	; Pointer to the chunk array that will store all of the second
	; set of "code" while the Dialing Code dialog box in on
	; screen.
	;
PDCLI_notesTextObj	optr
	; This text object will receive the output of the selected
	; item from the "notes" list.
	;
PDCLI_codeOneTextObj	optr
	; This text object will receive the output of the selected
	; item from the "codeOne" list.
	;
PDCLI_codeTwoTextObj	optr
	; This text object will receive the output of the selected
	; item from the "codeTwo" list.
	;
PDCLI_statusFlags	PrefDialingCodeListFlags
	; Indicates errors and other warnings.
	;

PrefItemGroupSpecialClass	endc

COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DerefInstanceDataDSDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS:	Gets the instance data from the given object by
		dereferencing the object and adding the appropriate
		offset.

PASS:		*ds:si	- ObjectClass
		classOffset - eg. CwordBoard_offset

RETURN:		ds:di	- ptr to intance data

DESTROYED:	Nothing

PSEUDO CODE/STRATEGY:

KNOWN BUGS/SIDE EFFECTS/IDEAS:	none

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	PT	6/24/94   	Initial version

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefInstanceDataDSDI		macro	classOffset
ifb <classOffset>
	ErrMessage	< DerefInstanceDataDSDI expects the class offset as an argument. >
endif
	mov	di, ds:[si]
	add	di, ds:[di].&classOffset
		endm

COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DerefInstanceDataDSBX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS:	Gets the instance data from the given object by
		dereferencing the object and adding the appropriate
		offset.

PASS:		*ds:si	- ObjectClass
		classOffset - eg. CwordBoard_offset

RETURN:		ds:bx	- ptr to intance data

DESTROYED:	Nothing

PSEUDO CODE/STRATEGY:

KNOWN BUGS/SIDE EFFECTS/IDEAS:	none

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	PT	7/25/94   	Initial version

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefInstanceDataDSBX		macro	classOffset
ifb <classOffset>
	ErrMessage	< DerefInstanceDataDSBX expects the class offset as an argument. >
endif
	mov	bx, ds:[si]
	add	bx, ds:[bx].&classOffset
		endm

{'repo_name': 'bluewaysw/pcgeos', 'stars': '316', 'repo_language': 'Assembly', 'file_name': 'marble.goh', 'mime_type': 'text/plain', 'hash': 2506610026707613675, 'source_dataset': 'data'}


/*
 * Licensed 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.
 */
package com.facebook.presto.operator.aggregation;

import com.facebook.airlift.stats.QuantileDigest;
import com.facebook.presto.common.Page;
import com.facebook.presto.common.block.Block;
import com.facebook.presto.common.type.SqlVarbinary;
import com.facebook.presto.common.type.StandardTypes;
import com.facebook.presto.common.type.Type;
import com.facebook.presto.metadata.FunctionManager;
import com.google.common.primitives.Doubles;
import com.google.common.primitives.Floats;
import org.testng.annotations.Test;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;

import static com.facebook.presto.block.BlockAssertions.createBlockOfReals;
import static com.facebook.presto.block.BlockAssertions.createLongSequenceBlock;
import static com.facebook.presto.block.BlockAssertions.createLongsBlock;
import static com.facebook.presto.block.BlockAssertions.createRLEBlock;
import static com.facebook.presto.block.BlockAssertions.createSequenceBlockOfReal;
import static com.facebook.presto.common.type.BigintType.BIGINT;
import static com.facebook.presto.common.type.DoubleType.DOUBLE;
import static com.facebook.presto.common.type.RealType.REAL;
import static com.facebook.presto.common.type.StandardTypes.QDIGEST;
import static com.facebook.presto.operator.aggregation.AggregationTestUtils.assertAggregation;
import static com.facebook.presto.operator.aggregation.FloatingPointBitsConverterUtil.doubleToSortableLong;
import static com.facebook.presto.operator.aggregation.FloatingPointBitsConverterUtil.floatToSortableInt;
import static com.facebook.presto.operator.aggregation.TestMergeQuantileDigestFunction.QDIGEST_EQUALITY;
import static com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static java.lang.Double.NaN;

public class TestQuantileDigestAggregationFunction
        extends TestStatisticalDigestAggregationFunction
{
    private static final double STANDARD_ERROR = 0.01;

    protected double getParameter()
    {
        return STANDARD_ERROR;
    }

    @Test
    public void testRealsWithWeights()
    {
        testAggregationReal(
                createBlockOfReals(1.0F, null, 2.0F, null, 3.0F, null, 4.0F, null, 5.0F, null),
                createRLEBlock(1, 10),
                0.01, 1.0F, 2.0F, 3.0F, 4.0F, 5.0F);
        testAggregationReal(
                createBlockOfReals(null, null, null, null, null),
                createRLEBlock(1, 5),
                NaN);
        testAggregationReal(
                createBlockOfReals(-1.0F, -2.0F, -3.0F, -4.0F, -5.0F, -6.0F, -7.0F, -8.0F, -9.0F, -10.0F),
                createRLEBlock(1, 10),
                0.01, -1.0F, -2.0F, -3.0F, -4.0F, -5.0F, -6.0F, -7.0F, -8.0F, -9.0F, -10.0F);
        testAggregationReal(
                createBlockOfReals(1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F, 8.0F, 9.0F, 10.0F),
                createRLEBlock(1, 10),
                0.01, 1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F, 8.0F, 9.0F, 10.0F);
        testAggregationReal(
                createBlockOfReals(),
                createRLEBlock(1, 0),
                NaN);
        testAggregationReal(
                createBlockOfReals(1.0F),
                createRLEBlock(1, 1),
                0.01, 1.0F);
        testAggregationReal(
                createSequenceBlockOfReal(-1000, 1000),
                createRLEBlock(1, 2000),
                0.01,
                Floats.toArray(LongStream.range(-1000, 1000).mapToObj(Float::new).collect(toImmutableList())));
    }

    @Test
    public void testBigintsWithWeight()
    {
        testAggregationBigint(
                createLongsBlock(1L, null, 2L, null, 3L, null, 4L, null, 5L, null),
                createRLEBlock(1, 10),
                0.01, 1, 2, 3, 4, 5);
        testAggregationBigint(
                createLongsBlock(null, null, null, null, null),
                createRLEBlock(1, 5),
                NaN);
        testAggregationBigint(
                createLongsBlock(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10),
                createRLEBlock(1, 10),
                0.01, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
        testAggregationBigint(
                createLongsBlock(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
                createRLEBlock(1, 10),
                0.01, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        testAggregationBigint(
                createLongsBlock(new int[] {}),
                createRLEBlock(1, 0),
                NaN);
        testAggregationBigint(
                createLongsBlock(1),
                createRLEBlock(1, 1),
                0.01, 1);
        testAggregationBigint(
                createLongSequenceBlock(-1000, 1000),
                createRLEBlock(1, 2000),
                0.01,
                LongStream.range(-1000, 1000).toArray());
    }

    @Override
    protected InternalAggregationFunction getAggregationFunction(Type... type)
    {
        FunctionManager functionManager = METADATA.getFunctionManager();
        return functionManager.getAggregateFunctionImplementation(
                functionManager.lookupFunction("qdigest_agg", fromTypes(type)));
    }

    private void testAggregationBigint(Block inputBlock, Block weightsBlock, double maxError, long... inputs)
    {
        // Test without weights and accuracy
        testAggregationBigints(
                getAggregationFunction(BIGINT),
                new Page(inputBlock),
                maxError,
                inputs);

        // Test with weights and without accuracy
        testAggregationBigints(
                getAggregationFunction(BIGINT, BIGINT),
                new Page(inputBlock, weightsBlock),
                maxError,
                inputs);
        // Test with weights and accuracy
        testAggregationBigints(
                getAggregationFunction(BIGINT, BIGINT, DOUBLE),
                new Page(inputBlock, weightsBlock, createRLEBlock(maxError, inputBlock.getPositionCount())),
                maxError,
                inputs);
    }

    private void testAggregationReal(Block longsBlock, Block weightsBlock, double maxError, float... inputs)
    {
        // Test without weights and accuracy
        testAggregationReal(
                getAggregationFunction(REAL),
                new Page(longsBlock),
                maxError,
                inputs);
        // Test with weights and without accuracy
        testAggregationReal(
                getAggregationFunction(REAL, BIGINT),
                new Page(longsBlock, weightsBlock),
                maxError,
                inputs);
        // Test with weights and accuracy
        testAggregationReal(
                getAggregationFunction(REAL, BIGINT, DOUBLE),
                new Page(longsBlock, weightsBlock, createRLEBlock(maxError, longsBlock.getPositionCount())),
                maxError,
                inputs);
    }

    private void testAggregationBigints(InternalAggregationFunction function, Page page, double maxError, long... inputs)
    {
        // aggregate level
        assertAggregation(function,
                QDIGEST_EQUALITY,
                "test multiple positions",
                page,
                getExpectedValueLongs(maxError, inputs));

        // test scalars
        List<Long> rows = Arrays.stream(inputs).sorted().boxed().collect(Collectors.toList());

        SqlVarbinary returned = (SqlVarbinary) AggregationTestUtils.aggregation(function, page);
        assertPercentileWithinError(QDIGEST, StandardTypes.BIGINT, returned, maxError, rows, 0.1, 0.5, 0.9, 0.99);
    }

    private void testAggregationReal(InternalAggregationFunction function, Page page, double maxError, float... inputs)
    {
        assertAggregation(function,
                QDIGEST_EQUALITY,
                "test multiple positions",
                page,
                getExpectedValuesFloats(maxError, inputs));

        // test scalars
        List<Double> rows = Floats.asList(inputs).stream().sorted().map(Float::doubleValue).collect(Collectors.toList());

        SqlVarbinary returned = (SqlVarbinary) AggregationTestUtils.aggregation(function, page);
        assertPercentileWithinError(QDIGEST, StandardTypes.REAL, returned, maxError, rows, 0.1, 0.5, 0.9, 0.99);
    }

    @Override
    protected void testAggregationDoubles(InternalAggregationFunction function, Page page, double maxError, double... inputs)
    {
        assertAggregation(function,
                QDIGEST_EQUALITY,
                "test multiple positions",
                page,
                getExpectedValueDoubles(maxError, inputs));

        // test scalars
        List<Double> rows = Doubles.asList(inputs).stream().sorted().collect(Collectors.toList());

        SqlVarbinary returned = (SqlVarbinary) AggregationTestUtils.aggregation(function, page);
        assertPercentileWithinError(QDIGEST, StandardTypes.DOUBLE, returned, maxError, rows, 0.1, 0.5, 0.9, 0.99);
    }

    private Object getExpectedValueLongs(double maxError, long... values)
    {
        if (values.length == 0) {
            return null;
        }
        QuantileDigest qdigest = new QuantileDigest(maxError);
        Arrays.stream(values).forEach(qdigest::add);
        return new SqlVarbinary(qdigest.serialize().getBytes());
    }

    @Override
    protected Object getExpectedValueDoubles(double maxError, double... values)
    {
        if (values.length == 0) {
            return null;
        }
        QuantileDigest qdigest = new QuantileDigest(maxError);
        Arrays.stream(values).forEach(value -> qdigest.add(doubleToSortableLong(value)));
        return new SqlVarbinary(qdigest.serialize().getBytes());
    }

    private Object getExpectedValuesFloats(double maxError, float... values)
    {
        if (values.length == 0) {
            return null;
        }
        QuantileDigest qdigest = new QuantileDigest(maxError);
        Floats.asList(values).forEach(value -> qdigest.add(floatToSortableInt(value)));
        return new SqlVarbinary(qdigest.serialize().getBytes());
    }
}

{'repo_name': 'prestodb/presto', 'stars': '10854', 'repo_language': 'Java', 'file_name': 'TestAlluxioCachingFileSystem.java', 'mime_type': 'text/x-java', 'hash': -6783834814836409007, 'source_dataset': 'data'}


require "pakyow/support/configurable"
require "pakyow/support/deep_freeze"

RSpec.shared_examples "configurable" do
  it "provides access to a setting defined without a default value" do
    object.setting :foo
    object.configure!
    expect(object.config.foo).to be_nil
  end

  it "provides access to a setting defined with a default value" do
    object.setting :foo, :bar
    object.configure!
    expect(object.config.foo).to be(:bar)
  end

  it "provides access to a setting defined with a block" do
    object.setting :foo do
      :bar
    end

    object.configure!
    expect(object.config.foo).to be(:bar)
  end

  it "provides access to the object being configured" do
    object.setting :name do
      self.name
    end

    object.configure!
    expect(object.config.name).to eq(:configurable)
  end

  it "fails when accessing an unknown setting" do
    object.configure!
    expect { object.config.foo }.to raise_error(NoMethodError)
  end

  it "converts to a hash" do
    object.setting :foo do
      :bar
    end

    object.configure!
    expect(object.config.to_h).to eq({:foo => :bar})
  end

  it "responds to missing" do
    object.configurable :foo do
      setting :bar, :baz
    end

    object.configure!
    expect(object.config.respond_to?(:foo)).to be(true)
    expect(object.config.respond_to?(:bar)).to be(false)
    expect(object.config.foo.respond_to?(:bar)).to be(true)
    expect(object.config.foo.respond_to?(:baz)).to be(false)
  end

  describe "configuring for an environment" do
    before do
      object.setting :foo
      object.setting :bar
      object.setting :baz

      object.configure do
        config.foo = :global_foo
        config.baz = :global_baz
      end

      object.configure :specific do
        config.bar = :bar
        config.baz = :baz
      end

      object.configure :other do
        config.foo = :other_foo
        config.bar = :other_bar
        config.baz = :other_baz
      end

      object.configure!(environment)
    end

    let(:environment) {
      :specific
    }

    it "configures globally" do
      expect(object.config.foo).to eq(:global_foo)
    end

    it "configures for the environment" do
      expect(object.config.bar).to eq(:bar)
    end

    it "gives precedence to the environment" do
      expect(object.config.baz).to eq(:baz)
    end

    context "environment is not a symbol" do
      let(:environment) {
        "specific"
      }

      it "still configures" do
        expect(object.config.foo).to eq(:global_foo)
        expect(object.config.bar).to eq(:bar)
        expect(object.config.baz).to eq(:baz)
      end
    end
  end

  describe "memoization" do
    it "memoizes default values" do
      object.setting :foo, []
      object.configure!

      object.config.foo << :bar
      object.config.foo << :baz

      expect(object.config.foo).to eq([:bar, :baz])
    end

    it "memoizes values provided by blocks" do
      object.setting :foo do
        []
      end

      object.configure!

      object.config.foo << :bar
      object.config.foo << :baz

      expect(object.config.foo).to eq([:bar, :baz])
    end
  end

  describe "freezing" do
    using Pakyow::Support::DeepFreeze

    it "builds each value" do
      object.setting :foo, :bar
      object.configure!
      object.deep_freeze

      expect(object.config.foo).to eq(:bar)
    end
  end
end

RSpec.describe "configuring a class" do
  let :object do
    Class.new do
      include Pakyow::Support::Configurable

      def self.name
        :configurable
      end
    end
  end

  include_examples "configurable"
end

RSpec.describe "configuring a module" do
  let :object do
    Module.new do
      include Pakyow::Support::Configurable

      def self.name
        :configurable
      end
    end
  end

  include_examples "configurable"
end

{'repo_name': 'pakyow/pakyow', 'stars': '831', 'repo_language': 'Ruby', 'file_name': 'xhr.js', 'mime_type': 'text/plain', 'hash': -8866362820176408699, 'source_dataset': 'data'}


# GENERATED FROM XML -- DO NOT EDIT

URI: core.html.de
Content-Language: de
Content-type: text/html; charset=ISO-8859-1

URI: core.html.en.utf8
Content-Language: en
Content-type: text/html; charset=UTF-8

URI: core.html.es.utf8
Content-Language: es
Content-type: text/html; charset=UTF-8

URI: core.html.fr.utf8
Content-Language: fr
Content-type: text/html; charset=UTF-8

URI: core.html.ja.utf8
Content-Language: ja
Content-type: text/html; charset=UTF-8

URI: core.html.tr.utf8
Content-Language: tr
Content-type: text/html; charset=UTF-8

{'repo_name': 'apache/httpd', 'stars': '2466', 'repo_language': 'C', 'file_name': 'worker.c', 'mime_type': 'text/x-c', 'hash': 6639933238604143509, 'source_dataset': 'data'}


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
		version="1.0"
                exclude-result-prefixes="exsl">

<!-- ********************************************************************
     $Id: profile-chunk.xsl 6910 2007-06-28 23:23:30Z xmldoc $
     ********************************************************************

     This file is part of the XSL DocBook Stylesheet distribution.
     See ../README or http://docbook.sf.net/release/xsl/current/ for
     copyright and other information.

     ******************************************************************** -->

<!-- ==================================================================== -->

<!-- First import the non-chunking templates that format elements
     within each chunk file. In a customization, you should
     create a separate non-chunking customization layer such
     as mydocbook.xsl that imports the original docbook.xsl and
     customizes any presentation templates. Then your chunking
     customization should import mydocbook.xsl instead of
     docbook.xsl.  -->
<xsl:import href="docbook.xsl"/>

<!-- chunk-common.xsl contains all the named templates for chunking.
     In a customization file, you import chunk-common.xsl, then
     add any customized chunking templates of the same name.
     They will have import precedence over the original
     chunking templates in chunk-common.xsl. -->
<xsl:import href="chunk-common.xsl"/>

<!-- The manifest.xsl module is no longer imported because its
     templates were moved into chunk-common and chunk-code -->

<!-- chunk-code.xsl contains all the chunking templates that use
     a match attribute.  In a customization it should be referenced
     using <xsl:include> instead of <xsl:import>, and then add
     any customized chunking templates with match attributes. But be sure
     to add a priority="1" to such customized templates to resolve
     its conflict with the original, since they have the
     same import precedence.

     Using xsl:include prevents adding another layer
     of import precedence, which would cause any
     customizations that use xsl:apply-imports to wrongly
     apply the chunking version instead of the original
     non-chunking version to format an element.  -->
<xsl:include href="profile-chunk-code.xsl"/>

</xsl:stylesheet>

{'repo_name': 'LCTT/LFS-BOOK', 'stars': '482', 'repo_language': 'XSLT', 'file_name': 'changelog.xml', 'mime_type': 'text/xml', 'hash': 3613756542293839963, 'source_dataset': 'data'}


// Copyright 2019 Yunion
//
// Licensed 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.

package shellutils // import "yunion.io/x/onecloud/pkg/util/shellutils"

{'repo_name': 'yunionio/onecloud', 'stars': '224', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 7862836919974429563, 'source_dataset': 'data'}


/*
 * Copyright 2020 the original author or authors.
 *
 * Licensed 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.
 */

package org.gradle.api.internal.changedetection.state

import com.google.common.collect.ImmutableSet
import org.gradle.api.internal.file.archive.ZipEntry
import spock.lang.Specification

class PropertiesFileZipEntryHasherTest extends Specification {
    ResourceEntryFilter propertyResourceFilter = new IgnoringResourceEntryFilter(ImmutableSet.copyOf("created-by", "पशुपतिरपि"))
    ZipEntryHasher filteredHasher = new PropertiesFileZipEntryHasher(propertyResourceFilter)
    ZipEntryHasher unfilteredHasher = new PropertiesFileZipEntryHasher(ResourceEntryFilter.FILTER_NOTHING)

    def "properties are case sensitive"() {
        given:
        def propertiesEntry1 = zipEntry(["Created-By": "1.8.0_232-b18 (Azul Systems, Inc.)"])
        def propertiesEntry2 = zipEntry(["created-by": "1.8.0_232-b18 (Azul Systems, Inc.)"])

        def hash1 = unfilteredHasher.hash(propertiesEntry1)
        def hash2 = unfilteredHasher.hash(propertiesEntry2)
        def hash3 = filteredHasher.hash(propertiesEntry1)
        def hash4 = filteredHasher.hash(propertiesEntry2)

        expect:
        hash1 != hash2
        hash2 != hash4
        hash3 != hash4

        and:
        hash1 == hash3
    }

    def "properties are normalized and filtered out"() {
        given:
        def propertiesEntry1 = zipEntry(["created-by": "1.8.0_232-b18 (Azul Systems, Inc.)", "foo": "true"])
        def propertiesEntry2 = zipEntry(["created-by": "1.8.0_232-b15 (Azul Systems, Inc.)", "foo": "true"])

        def hash1 = unfilteredHasher.hash(propertiesEntry1)
        def hash2 = unfilteredHasher.hash(propertiesEntry2)
        def hash3 = filteredHasher.hash(propertiesEntry1)
        def hash4 = filteredHasher.hash(propertiesEntry2)

        expect:
        hash1 != hash2
        hash1 != hash3
        hash2 != hash4

        and:
        hash3 == hash4
    }

    def "properties can have UTF-8 encoding"() {
        def propertiesEntry1 = zipEntry(["Created-By": "1.8.0_232-b18 (Azul Systems, Inc.)", "पशुपतिरपि": "some sanskrit", "तान्यहानि": "more sanskrit"])
        def propertiesEntry2 = zipEntry(["Created-By": "1.8.0_232-b18 (Azul Systems, Inc.)", "पशुपतिरपि": "changed sanskrit", "तान्यहानि": "more sanskrit"])

        def hash1 = unfilteredHasher.hash(propertiesEntry1)
        def hash2 = unfilteredHasher.hash(propertiesEntry2)
        def hash3 = filteredHasher.hash(propertiesEntry1)
        def hash4 = filteredHasher.hash(propertiesEntry2)

        expect:
        hash1 != hash2
        hash1 != hash3
        hash2 != hash4

        and:
        hash3 == hash4
    }

    def "properties are order insensitive"() {
        given:
        def propertiesEntry1 = zipEntry(["created-by": "1.8.0_232-b18 (Azul Systems, Inc.)", "foo": "true"])
        def propertiesEntry2 = zipEntry(["foo": "true", "created-by": "1.8.0_232-b15 (Azul Systems, Inc.)"])

        def hash1 = unfilteredHasher.hash(propertiesEntry1)
        def hash2 = unfilteredHasher.hash(propertiesEntry2)
        def hash3 = filteredHasher.hash(propertiesEntry1)
        def hash4 = filteredHasher.hash(propertiesEntry2)

        expect:
        hash1 != hash2
        hash1 != hash3
        hash2 != hash4

        and:
        hash3 == hash4
    }

    def "comments are always filtered out"() {
        def propertiesEntry1 = zipEntry(["foo": "true"], "Build information 1.0")
        def propertiesEntry2 = zipEntry(["foo": "true"], "Build information 1.1")

        def hash1 = unfilteredHasher.hash(propertiesEntry1)
        def hash2 = unfilteredHasher.hash(propertiesEntry2)
        def hash3 = filteredHasher.hash(propertiesEntry1)
        def hash4 = filteredHasher.hash(propertiesEntry2)

        expect:
        hash1 == hash2
        hash1 == hash3
        hash3 == hash4
    }

    ZipEntryContext zipEntry(Map<String, String> attributes, String comments = "") {
        Properties properties = new Properties()
        properties.putAll(attributes)
        ByteArrayOutputStream bos = new ByteArrayOutputStream()
        properties.store(bos, comments)
        def zipEntry = new ZipEntry() {
            @Override
            boolean isDirectory() {
                return false
            }

            @Override
            String getName() {
                return "META-INF/build-info.properties"
            }

            @Override
            byte[] getContent() throws IOException {
                return bos.toByteArray()
            }

            @Override
            InputStream getInputStream() {
                return new ByteArrayInputStream(bos.toByteArray())
            }

            @Override
            int size() {
                return bos.size()
            }
        }
        return new ZipEntryContext(zipEntry, "META-INF/build-info.properties", "foo.zip")
    }
}

{'repo_name': 'gradle/gradle', 'stars': '10712', 'repo_language': 'Groovy', 'file_name': 'DefaultRuleActionAdapterTest.groovy', 'mime_type': 'text/plain', 'hash': -156827121724274425, 'source_dataset': 'data'}


export default function (babel) {
  const {types: t} = babel;

  /**
   * t.isFunctionExpression() || t.isArrowFunctionExpression()
   */
  function isAnyFunctionExpression() {
    return t.isFunctionExpression.apply(t, arguments) || t.isArrowFunctionExpression.apply(t, arguments);
  }

  function isAction(node, actionIdentifier, mobxNamespaceIdentifier) {
    return (actionIdentifier && t.isIdentifier(node, {name: actionIdentifier})) ||
      (
        t.isMemberExpression(node) &&
        t.isIdentifier(node.object, {name: 'action'}) &&
        t.isIdentifier(node.property, {name: "bound"})
      ) ||
      (
        mobxNamespaceIdentifier &&
        t.isMemberExpression(node) &&
        t.isIdentifier(node.object, {name: mobxNamespaceIdentifier}) &&
        t.isIdentifier(node.property, {name: "action"})
      )
  }

  const traverseActionBody = {
    ["FunctionExpression|ArrowFunctionExpression"](path) {
      const actionIdentifier = this.actionIdentifier;
      const mobxNamespaceIdentifier = this.mobxNamespaceIdentifier;
      path.traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
      path.skip()
      // if current node parent is call expression and this call is action call, skip wrapping
      if (t.isCallExpression(path.parentPath.node) && isAction(path.parentPath.node.callee, actionIdentifier, mobxNamespaceIdentifier)) {
        return;
      }
      path.replaceWith(t.CallExpression(
        this.actionIdentifier
          ? t.Identifier(this.actionIdentifier)
          : t.MemberExpression(t.Identifier(this.mobxNamespaceIdentifier), t.Identifier("action"))
        ,
        [path.node]
      ));
    }
  };

  const traverseSibling = {
    CallExpression(path) {
      const node = path.node;
      const actionIdentifier = this.actionIdentifier;
      const mobxNamespaceIdentifier = this.mobxNamespaceIdentifier;
      if (isAction(node.callee, actionIdentifier, mobxNamespaceIdentifier)) {
        if (node.arguments.length === 1) {
          path.get('arguments.0').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
          path.skip();
        } else if (node.arguments.length === 2) {
          path.get('arguments.1').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
          path.skip();
        }
      }
    },

    ["ClassMethod|ClassProperty"](path) {
      const actionIdentifier = this.actionIdentifier;
      const mobxNamespaceIdentifier = this.mobxNamespaceIdentifier;
      const explicitClasses = this.classes;
      const classDeclaration = path.findParent(p => p.isClassDeclaration())
      // If there is an explicit classes with actions, handle them separately
      if (
        explicitClasses &&
        t.isIdentifier(classDeclaration.node.id) &&
        void 0 !== explicitClasses[classDeclaration.node.id.name] &&
        t.isClassMethod(path.node) &&
        t.isIdentifier(path.node.key) &&
        (
          // all code inside constructor should be handled as action too, because it could contain other action creations
          path.node.key.name === "constructor" ||
          void 0 !== explicitClasses[classDeclaration.node.id.name][path.node.key.name]
        )
      ) {
        if (path.node.key.name === "constructor") {
          path.get('body').get('body').forEach(cPath => {
            if (cPath.isExpressionStatement()) {
              const exprPath = cPath.get('expression')
              if (exprPath.isAssignmentExpression() && exprPath.get('operator').node === '=') {
                const leftPath = exprPath.get('left')
                const rightPath = exprPath.get('right')
                if (
                  leftPath.isMemberExpression() &&
                  leftPath.get('object').isThisExpression() &&
                  leftPath.get('property').isIdentifier() &&
                  leftPath.get('property').node.name in explicitClasses[classDeclaration.node.id.name] &&
                  (rightPath.isArrowFunctionExpression() || rightPath.isFunctionExpression())
                ) {
                  rightPath.get('body').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
                }
              }
            }
          })
        } else {
          path.get('body').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
        }
        path.skip();
      } else if (path.node.decorators) {
        for (const {expression} of path.node.decorators) {
          if (
            isAction(expression, actionIdentifier, mobxNamespaceIdentifier) ||
            (t.isCallExpression(expression) && isAction(expression.callee, actionIdentifier, mobxNamespaceIdentifier))
          ) {
            if (t.isClassMethod(path.node)) {
              path.get('body').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
              path.skip();
            } else if (t.isClassProperty(path.node)) {
              path.get('value').traverse(traverseActionBody, {actionIdentifier, mobxNamespaceIdentifier})
              path.skip();
            }
          }
        }
      }
    },
  };

  return {
    name: "mobx-deep-action-transform",
    visitor: {
      Program(path, state) {
        let actionIdentifier;
        let mobxNamespaceIdentifier;
        let tslibNamespaceIdentifier;
        const mobxPackage = state.opts && state.opts["mobx-package"] || "mobx"
        path.traverse({
          ImportDeclaration(path) {
            if (path.node.source.value === mobxPackage) {
              for (const specifier of path.node.specifiers) {
                if (t.isImportNamespaceSpecifier(specifier) || (specifier.imported.name === "action")) {
                  if (t.isImportNamespaceSpecifier(specifier)) {
                    mobxNamespaceIdentifier = specifier.local.name;
                  } else if (specifier.imported.name === "action") {
                    actionIdentifier = specifier.local.name;
                  }
                }
              }
            }
            if (path.node.source.value === "tslib") {
              for (const specifier of path.node.specifiers) {
                if (t.isImportNamespaceSpecifier(specifier)) {
                  tslibNamespaceIdentifier = specifier.local.name
                }
              }
            }
          }
        })
        const context = {actionIdentifier, mobxNamespaceIdentifier}
        path.traverse(traverseSibling, context)
        const toTraverse = [];
        /**
         * Lookup for typescript decorators, and handle them separately
         */
        path.traverse({
          CallExpression(path) {
            const node = path.node
            if (
              t.isMemberExpression(node.callee) &&
              t.isIdentifier(node.callee.object, {name: tslibNamespaceIdentifier}) &&
              t.isIdentifier(node.callee.property, {name: "__decorate"}) &&
              node.arguments.length === 4 &&
              t.isArrayExpression(node.arguments[0]) &&
              (
                node.arguments[0].elements.some(e =>
                  (
                    t.isIdentifier(e, {name: actionIdentifier})
                  ) ||
                  (
                    t.isMemberExpression(e) &&
                    t.isIdentifier(e.object, {name: mobxNamespaceIdentifier}) &&
                    t.isIdentifier(e.property, {name: "action"})
                  ) || (
                    t.isCallExpression(e) &&
                    t.isIdentifier(e.callee, {name: actionIdentifier})
                  ) || (
                    t.isCallExpression(e) &&
                    t.isMemberExpression(e.callee) &&
                    t.isIdentifier(e.callee.object, {name: mobxNamespaceIdentifier}) &&
                    t.isIdentifier(e.callee.property, {name: "action"})
                  )
                )
              ) &&
              t.isMemberExpression(node.arguments[1]) &&
              t.isIdentifier(node.arguments[1].property, {name: "prototype"}) &&
              t.isStringLiteral(node.arguments[2])
            ) {
              const className = node.arguments[1].object.name
              const methodName = node.arguments[2].value
              const traversePath = path.getStatementParent().parentPath
              const existsTraverseRequest = toTraverse.find(e => e.path === traversePath)
              if (!existsTraverseRequest) {
                toTraverse.push({
                  path: traversePath,
                  classes: {
                    [className]: {[methodName]: methodName}
                  }
                })
              } else {
                const existsClassRequest = existsTraverseRequest.classes[className]
                if (!existsClassRequest) {
                  existsTraverseRequest.classes[className] = {[methodName]: methodName}
                } else {
                  existsTraverseRequest.classes[className][methodName] = methodName
                }
              }
            }
          }
        })
        toTraverse.forEach(({path, classes}) => path.traverse(traverseSibling, {...context, classes}))
      },
    }
  };
}

{'repo_name': 'mobxjs/babel-plugin-mobx-deep-action', 'stars': '108', 'repo_language': 'JavaScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': -602949387617636694, 'source_dataset': 'data'}


<?xml version='1.0' encoding='utf-8'?>

  <num>29-202.05</num>
  <heading>Statement of merger; effective date.</heading>
  <para>
    <num>(a)</num>
    <text>A statement of merger shall be signed on behalf of each merging entity and delivered to the Mayor for filing.</text>
  </para>
  <para>
    <num>(b)</num>
    <text>A statement of merger shall contain:</text>
    <para>
      <num>(1)</num>
      <text>The name, jurisdiction of formation, and type of entity of each merging entity that is not the surviving entity;</text>
    </para>
    <para>
      <num>(2)</num>
      <text>The name, jurisdiction of formation, and type of entity of the surviving entity;</text>
    </para>
    <para>
      <num>(3)</num>
      <text>If the statement of merger is not to be effective upon filing, the later date and time on which it will become effective, which may not be more than 90 days after the date of filing;</text>
    </para>
    <para>
      <num>(4)</num>
      <text>A statement that the merger was approved by each domestic merging entity, if any, in accordance with this subchapter and by each foreign merging entity, if any, in accordance with the law of its jurisdiction of formation;</text>
    </para>
    <para>
      <num>(5)</num>
      <text>If the surviving entity exists before the merger and is a domestic filing entity, any amendment to its public organic record approved as part of the plan of merger;</text>
    </para>
    <para>
      <num>(6)</num>
      <text>If the surviving entity is created by the merger and is a domestic filing entity, its public organic document as an attachment;</text>
    </para>
    <para>
      <num>(7)</num>
      <text>If the surviving entity is created by the merger and is a domestic limited liability partnership, its statement of qualification as an attachment; and</text>
    </para>
    <para>
      <num>(8)</num>
      <text>If the surviving entity is a foreign entity that is not a registered foreign entity, a mailing address to which process may be served pursuant to § 29-202.06(e).</text>
    </para>
  </para>
  <para>
    <num>(c)</num>
    <text>In addition to the requirements of subsection (b) of this section, a statement of merger may contain any other provision not prohibited by law.</text>
  </para>
  <para>
    <num>(d)</num>
    <text>If the surviving entity is a domestic entity, its public organic record, if any, shall satisfy the requirements of the law of the District, except that it does not need to be signed and may omit any provision that is not required to be included in a restatement of the public organic record.</text>
  </para>
  <para>
    <num>(e)</num>
    <text>A plan of merger that is signed on behalf of all of the merging entities and meets all of the requirements of subsection (b) of this section may be delivered to the Mayor for filing instead of a statement of merger and, upon filing by the Mayor, shall have the same effect. If a plan of merger is filed as provided in this subsection, references in this chapter to a statement of merger refer to the plan of merger filed under this subsection.</text>
  </para>
  <para>
    <num>(f)</num>
    <text>A statement of merger shall be effective upon the date and time of filing or the later date and time specified in the statement of merger.</text>
  </para>
  <annotations>
    <annotation doc="D.C. Law 18-378" type="History">July 2, 2011, D.C. Law 18-378, § 2, 58 DCR 1720</annotation>
    <annotation doc="D.C. Law 19-210" type="History">Mar. 5, 2013, D.C. Law 19-210, § 2(b)(9), 59 DCR 13171</annotation>
    <annotation type="Editor's Notes">Application of Law 19-210: Section 7 of D.C. Law 19-210 provided that the act shall apply as of January 1, 2012.</annotation>
    <annotation type="Effect of Amendments">The 2013 amendment by D.C. Law 19-210 substituted “delivered to the Mayor for filing” for “filed with the Mayor” in (a) and (e); substituted “formation” for “organization” and “and type of entity” for “type” throughout (b); substituted “record” for “document” in (b)(5) and throughout (d); substituted “registered” for “qualified” in (b)(8); and added “by the Mayor” after “filing” in (e).</annotation>
    <annotation type="Section References">This section is referenced in § 29-201.02.</annotation>
  </annotations>

{'repo_name': 'DCCouncil/dc-law-xml', 'stars': '270', 'repo_language': 'None', 'file_name': 'codify_street_designation_anno.xml', 'mime_type': 'text/plain', 'hash': 799065248438417393, 'source_dataset': 'data'}


HtmlFile:test.html
  PsiElement(HTML_DOCUMENT)
    PsiElement(XML_PROLOG)
      <empty list>
    HtmlTag:a
      XmlToken:XML_START_TAG_START('<')
      XmlToken:XML_NAME('a')
      XmlToken:XML_EMPTY_ELEMENT_END('/>')

{'repo_name': 'JetBrains/intellij-plugins', 'stars': '1534', 'repo_language': 'Java', 'file_name': 'index.js', 'mime_type': 'text/plain', 'hash': 788382345716830821, 'source_dataset': 'data'}


<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Finder;

use Symfony\Component\Finder\Comparator\DateComparator;
use Symfony\Component\Finder\Comparator\NumberComparator;
use Symfony\Component\Finder\Iterator\CustomFilterIterator;
use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
use Symfony\Component\Finder\Iterator\SortableIterator;

/**
 * Finder allows to build rules to find files and directories.
 *
 * It is a thin wrapper around several specialized iterator classes.
 *
 * All rules may be invoked several times.
 *
 * All methods return the current Finder object to allow easy chaining:
 *
 *     $finder = Finder::create()->files()->name('*.php')->in(__DIR__);
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class Finder implements \IteratorAggregate, \Countable
{
    const IGNORE_VCS_FILES = 1;
    const IGNORE_DOT_FILES = 2;

    private $mode = 0;
    private $names = array();
    private $notNames = array();
    private $exclude = array();
    private $filters = array();
    private $depths = array();
    private $sizes = array();
    private $followLinks = false;
    private $reverseSorting = false;
    private $sort = false;
    private $ignore = 0;
    private $dirs = array();
    private $dates = array();
    private $iterators = array();
    private $contains = array();
    private $notContains = array();
    private $paths = array();
    private $notPaths = array();
    private $ignoreUnreadableDirs = false;

    private static $vcsPatterns = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg');

    public function __construct()
    {
        $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES;
    }

    /**
     * Creates a new Finder.
     *
     * @return static
     */
    public static function create()
    {
        return new static();
    }

    /**
     * Restricts the matching to directories only.
     *
     * @return $this
     */
    public function directories()
    {
        $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES;

        return $this;
    }

    /**
     * Restricts the matching to files only.
     *
     * @return $this
     */
    public function files()
    {
        $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES;

        return $this;
    }

    /**
     * Adds tests for the directory depth.
     *
     * Usage:
     *
     *     $finder->depth('> 1') // the Finder will start matching at level 1.
     *     $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
     *     $finder->depth(['>= 1', '< 3'])
     *
     * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels
     *
     * @return $this
     *
     * @see DepthRangeFilterIterator
     * @see NumberComparator
     */
    public function depth($levels)
    {
        foreach ((array) $levels as $level) {
            $this->depths[] = new Comparator\NumberComparator($level);
        }

        return $this;
    }

    /**
     * Adds tests for file dates (last modified).
     *
     * The date must be something that strtotime() is able to parse:
     *
     *     $finder->date('since yesterday');
     *     $finder->date('until 2 days ago');
     *     $finder->date('> now - 2 hours');
     *     $finder->date('>= 2005-10-15');
     *     $finder->date(['>= 2005-10-15', '<= 2006-05-27']);
     *
     * @param string|string[] $dates A date range string or an array of date ranges
     *
     * @return $this
     *
     * @see strtotime
     * @see DateRangeFilterIterator
     * @see DateComparator
     */
    public function date($dates)
    {
        foreach ((array) $dates as $date) {
            $this->dates[] = new Comparator\DateComparator($date);
        }

        return $this;
    }

    /**
     * Adds rules that files must match.
     *
     * You can use patterns (delimited with / sign), globs or simple strings.
     *
     *     $finder->name('*.php')
     *     $finder->name('/\.php$/') // same as above
     *     $finder->name('test.php')
     *     $finder->name(['test.py', 'test.php'])
     *
     * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
     *
     * @return $this
     *
     * @see FilenameFilterIterator
     */
    public function name($patterns)
    {
        $this->names = \array_merge($this->names, (array) $patterns);

        return $this;
    }

    /**
     * Adds rules that files must not match.
     *
     * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
     *
     * @return $this
     *
     * @see FilenameFilterIterator
     */
    public function notName($patterns)
    {
        $this->notNames = \array_merge($this->notNames, (array) $patterns);

        return $this;
    }

    /**
     * Adds tests that file contents must match.
     *
     * Strings or PCRE patterns can be used:
     *
     *     $finder->contains('Lorem ipsum')
     *     $finder->contains('/Lorem ipsum/i')
     *     $finder->contains(['dolor', '/ipsum/i'])
     *
     * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
     *
     * @return $this
     *
     * @see FilecontentFilterIterator
     */
    public function contains($patterns)
    {
        $this->contains = \array_merge($this->contains, (array) $patterns);

        return $this;
    }

    /**
     * Adds tests that file contents must not match.
     *
     * Strings or PCRE patterns can be used:
     *
     *     $finder->notContains('Lorem ipsum')
     *     $finder->notContains('/Lorem ipsum/i')
     *     $finder->notContains(['lorem', '/dolor/i'])
     *
     * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
     *
     * @return $this
     *
     * @see FilecontentFilterIterator
     */
    public function notContains($patterns)
    {
        $this->notContains = \array_merge($this->notContains, (array) $patterns);

        return $this;
    }

    /**
     * Adds rules that filenames must match.
     *
     * You can use patterns (delimited with / sign) or simple strings.
     *
     *     $finder->path('some/special/dir')
     *     $finder->path('/some\/special\/dir/') // same as above
     *     $finder->path(['some dir', 'another/dir'])
     *
     * Use only / as dirname separator.
     *
     * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
     *
     * @return $this
     *
     * @see FilenameFilterIterator
     */
    public function path($patterns)
    {
        $this->paths = \array_merge($this->paths, (array) $patterns);

        return $this;
    }

    /**
     * Adds rules that filenames must not match.
     *
     * You can use patterns (delimited with / sign) or simple strings.
     *
     *     $finder->notPath('some/special/dir')
     *     $finder->notPath('/some\/special\/dir/') // same as above
     *     $finder->notPath(['some/file.txt', 'another/file.log'])
     *
     * Use only / as dirname separator.
     *
     * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
     *
     * @return $this
     *
     * @see FilenameFilterIterator
     */
    public function notPath($patterns)
    {
        $this->notPaths = \array_merge($this->notPaths, (array) $patterns);

        return $this;
    }

    /**
     * Adds tests for file sizes.
     *
     *     $finder->size('> 10K');
     *     $finder->size('<= 1Ki');
     *     $finder->size(4);
     *     $finder->size(['> 10K', '< 20K'])
     *
     * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges
     *
     * @return $this
     *
     * @see SizeRangeFilterIterator
     * @see NumberComparator
     */
    public function size($sizes)
    {
        foreach ((array) $sizes as $size) {
            $this->sizes[] = new Comparator\NumberComparator($size);
        }

        return $this;
    }

    /**
     * Excludes directories.
     *
     * Directories passed as argument must be relative to the ones defined with the `in()` method. For example:
     *
     *     $finder->in(__DIR__)->exclude('ruby');
     *
     * @param string|array $dirs A directory path or an array of directories
     *
     * @return $this
     *
     * @see ExcludeDirectoryFilterIterator
     */
    public function exclude($dirs)
    {
        $this->exclude = array_merge($this->exclude, (array) $dirs);

        return $this;
    }

    /**
     * Excludes "hidden" directories and files (starting with a dot).
     *
     * This option is enabled by default.
     *
     * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
     *
     * @return $this
     *
     * @see ExcludeDirectoryFilterIterator
     */
    public function ignoreDotFiles($ignoreDotFiles)
    {
        if ($ignoreDotFiles) {
            $this->ignore |= static::IGNORE_DOT_FILES;
        } else {
            $this->ignore &= ~static::IGNORE_DOT_FILES;
        }

        return $this;
    }

    /**
     * Forces the finder to ignore version control directories.
     *
     * This option is enabled by default.
     *
     * @param bool $ignoreVCS Whether to exclude VCS files or not
     *
     * @return $this
     *
     * @see ExcludeDirectoryFilterIterator
     */
    public function ignoreVCS($ignoreVCS)
    {
        if ($ignoreVCS) {
            $this->ignore |= static::IGNORE_VCS_FILES;
        } else {
            $this->ignore &= ~static::IGNORE_VCS_FILES;
        }

        return $this;
    }

    /**
     * Adds VCS patterns.
     *
     * @see ignoreVCS()
     *
     * @param string|string[] $pattern VCS patterns to ignore
     */
    public static function addVCSPattern($pattern)
    {
        foreach ((array) $pattern as $p) {
            self::$vcsPatterns[] = $p;
        }

        self::$vcsPatterns = array_unique(self::$vcsPatterns);
    }

    /**
     * Sorts files and directories by an anonymous function.
     *
     * The anonymous function receives two \SplFileInfo instances to compare.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sort(\Closure $closure)
    {
        $this->sort = $closure;

        return $this;
    }

    /**
     * Sorts files and directories by name.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @param bool $useNaturalSort Whether to use natural sort or not, disabled by default
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sortByName(/* bool $useNaturalSort = false */)
    {
        if (\func_num_args() < 1 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
            @trigger_error(sprintf('The "%s()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
        }
        $useNaturalSort = 0 < \func_num_args() && func_get_arg(0);

        $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME;

        return $this;
    }

    /**
     * Sorts files and directories by type (directories before files), then by name.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sortByType()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_TYPE;

        return $this;
    }

    /**
     * Sorts files and directories by the last accessed time.
     *
     * This is the time that the file was last accessed, read or written to.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sortByAccessedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME;

        return $this;
    }

    /**
     * Reverses the sorting.
     *
     * @return $this
     */
    public function reverseSorting()
    {
        $this->reverseSorting = true;

        return $this;
    }

    /**
     * Sorts files and directories by the last inode changed time.
     *
     * This is the time that the inode information was last modified (permissions, owner, group or other metadata).
     *
     * On Windows, since inode is not available, changed time is actually the file creation time.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sortByChangedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME;

        return $this;
    }

    /**
     * Sorts files and directories by the last modified time.
     *
     * This is the last time the actual contents of the file were last modified.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return $this
     *
     * @see SortableIterator
     */
    public function sortByModifiedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME;

        return $this;
    }

    /**
     * Filters the iterator with an anonymous function.
     *
     * The anonymous function receives a \SplFileInfo and must return false
     * to remove files.
     *
     * @return $this
     *
     * @see CustomFilterIterator
     */
    public function filter(\Closure $closure)
    {
        $this->filters[] = $closure;

        return $this;
    }

    /**
     * Forces the following of symlinks.
     *
     * @return $this
     */
    public function followLinks()
    {
        $this->followLinks = true;

        return $this;
    }

    /**
     * Tells finder to ignore unreadable directories.
     *
     * By default, scanning unreadable directories content throws an AccessDeniedException.
     *
     * @param bool $ignore
     *
     * @return $this
     */
    public function ignoreUnreadableDirs($ignore = true)
    {
        $this->ignoreUnreadableDirs = (bool) $ignore;

        return $this;
    }

    /**
     * Searches files and directories which match defined rules.
     *
     * @param string|array $dirs A directory path or an array of directories
     *
     * @return $this
     *
     * @throws \InvalidArgumentException if one of the directories does not exist
     */
    public function in($dirs)
    {
        $resolvedDirs = array();

        foreach ((array) $dirs as $dir) {
            if (is_dir($dir)) {
                $resolvedDirs[] = $this->normalizeDir($dir);
            } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
                $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob));
            } else {
                throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
            }
        }

        $this->dirs = array_merge($this->dirs, $resolvedDirs);

        return $this;
    }

    /**
     * Returns an Iterator for the current Finder configuration.
     *
     * This method implements the IteratorAggregate interface.
     *
     * @return \Iterator|SplFileInfo[] An iterator
     *
     * @throws \LogicException if the in() method has not been called
     */
    public function getIterator()
    {
        if (0 === \count($this->dirs) && 0 === \count($this->iterators)) {
            throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.');
        }

        if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
            return $this->searchInDirectory($this->dirs[0]);
        }

        $iterator = new \AppendIterator();
        foreach ($this->dirs as $dir) {
            $iterator->append($this->searchInDirectory($dir));
        }

        foreach ($this->iterators as $it) {
            $iterator->append($it);
        }

        return $iterator;
    }

    /**
     * Appends an existing set of files/directories to the finder.
     *
     * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
     *
     * @param iterable $iterator
     *
     * @return $this
     *
     * @throws \InvalidArgumentException when the given argument is not iterable
     */
    public function append($iterator)
    {
        if ($iterator instanceof \IteratorAggregate) {
            $this->iterators[] = $iterator->getIterator();
        } elseif ($iterator instanceof \Iterator) {
            $this->iterators[] = $iterator;
        } elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
            $it = new \ArrayIterator();
            foreach ($iterator as $file) {
                $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
            }
            $this->iterators[] = $it;
        } else {
            throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
        }

        return $this;
    }

    /**
     * Check if the any results were found.
     *
     * @return bool
     */
    public function hasResults()
    {
        foreach ($this->getIterator() as $_) {
            return true;
        }

        return false;
    }

    /**
     * Counts all the results collected by the iterators.
     *
     * @return int
     */
    public function count()
    {
        return iterator_count($this->getIterator());
    }

    private function searchInDirectory(string $dir): \Iterator
    {
        if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) {
            $this->exclude = array_merge($this->exclude, self::$vcsPatterns);
        }

        if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) {
            $this->notPaths[] = '#(^|/)\..+(/|$)#';
        }

        $minDepth = 0;
        $maxDepth = PHP_INT_MAX;

        foreach ($this->depths as $comparator) {
            switch ($comparator->getOperator()) {
                case '>':
                    $minDepth = $comparator->getTarget() + 1;
                    break;
                case '>=':
                    $minDepth = $comparator->getTarget();
                    break;
                case '<':
                    $maxDepth = $comparator->getTarget() - 1;
                    break;
                case '<=':
                    $maxDepth = $comparator->getTarget();
                    break;
                default:
                    $minDepth = $maxDepth = $comparator->getTarget();
            }
        }

        $flags = \RecursiveDirectoryIterator::SKIP_DOTS;

        if ($this->followLinks) {
            $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
        }

        $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);

        if ($this->exclude) {
            $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude);
        }

        $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);

        if ($minDepth > 0 || $maxDepth < PHP_INT_MAX) {
            $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
        }

        if ($this->mode) {
            $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
        }

        if ($this->names || $this->notNames) {
            $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
        }

        if ($this->contains || $this->notContains) {
            $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
        }

        if ($this->sizes) {
            $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
        }

        if ($this->dates) {
            $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
        }

        if ($this->filters) {
            $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
        }

        if ($this->paths || $this->notPaths) {
            $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths);
        }

        if ($this->sort || $this->reverseSorting) {
            $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting);
            $iterator = $iteratorAggregate->getIterator();
        }

        return $iterator;
    }

    /**
     * Normalizes given directory names by removing trailing slashes.
     *
     * Excluding: (s)ftp:// wrapper
     *
     * @param string $dir
     *
     * @return string
     */
    private function normalizeDir($dir)
    {
        $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);

        if (preg_match('#^s?ftp://#', $dir)) {
            $dir .= '/';
        }

        return $dir;
    }
}

{'repo_name': 'woann/chat', 'stars': '208', 'repo_language': 'PHP', 'file_name': 'demo-1.js', 'mime_type': 'text/plain', 'hash': 8988814944044646015, 'source_dataset': 'data'}


{ stdenv, fetchurl, nixosTests }:

stdenv.mkDerivation rec {
  pname = "wordpress";
  version = "5.4.2";

  src = fetchurl {
    url = "https://wordpress.org/${pname}-${version}.tar.gz";
    sha256 = "1pnl11yws2r2d5dfq0z85zcy5ilvm298bfs7h9z1sjakkwkh5sph";
  };

  installPhase = ''
    mkdir -p $out/share/wordpress
    cp -r . $out/share/wordpress
  '';

  passthru.tests = {
    inherit (nixosTests) wordpress;
  };

  meta = with stdenv.lib; {
    homepage = "https://wordpress.org";
    description = "WordPress is open source software you can use to create a beautiful website, blog, or app";
    license = [ licenses.gpl2 ];
    maintainers = [ maintainers.basvandijk ];
    platforms = platforms.all;
  };
}

{'repo_name': 'NixOS/nixpkgs', 'stars': '5317', 'repo_language': 'Nix', 'file_name': 'default.nix', 'mime_type': 'text/plain', 'hash': -8440326741828802564, 'source_dataset': 'data'}


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  ~ 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.
  -->

<configuration>

  <version>2</version>

  <managedRepositories>
    <managedRepository>
      <id>internal</id>
      <name>Archiva Managed Internal Repository</name>
      <location>${appserver.base}/repositories/internal</location>
      <indexDir>${appserver.base}/repositories/internal/.indexer</indexDir>
      <layout>default</layout>
      <releases>true</releases>
      <snapshots>false</snapshots>
      <blockRedeployments>false</blockRedeployments>
      <scanned>true</scanned>
      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
      <daysOlder>30</daysOlder>
    </managedRepository>
    <managedRepository>
      <id>snapshots</id>
      <name>Archiva Managed Snapshot Repository</name>
      <location>${appserver.base}/repositories/snapshots</location>
      <indexDir>${appserver.base}/repositories/snapshots/.indexer</indexDir>
      <layout>default</layout>
      <releases>false</releases>
      <snapshots>true</snapshots>
      <blockRedeployments>false</blockRedeployments>
      <scanned>true</scanned>
      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
      <daysOlder>30</daysOlder>
    </managedRepository>
  </managedRepositories>

  <repositoryScanning>
    <fileTypes>
      <fileType>
        <id>artifacts</id>
        <patterns>
          <pattern>**/*.pom</pattern>
          <pattern>**/*.jar</pattern>
          <pattern>**/*.ear</pattern>
          <pattern>**/*.war</pattern>
          <pattern>**/*.car</pattern>
          <pattern>**/*.sar</pattern>
          <pattern>**/*.mar</pattern>
          <pattern>**/*.rar</pattern>
          <pattern>**/*.dtd</pattern>
          <pattern>**/*.tld</pattern>
          <pattern>**/*.tar.gz</pattern>
          <pattern>**/*.tar.bz2</pattern>
          <pattern>**/*.zip</pattern>
        </patterns>
      </fileType>
      <fileType>
        <id>indexable-content</id>
        <patterns>
          <pattern>**/*.txt</pattern>
          <pattern>**/*.TXT</pattern>
          <pattern>**/*.block</pattern>
          <pattern>**/*.config</pattern>
          <pattern>**/*.pom</pattern>
          <pattern>**/*.xml</pattern>
          <pattern>**/*.xsd</pattern>
          <pattern>**/*.dtd</pattern>
          <pattern>**/*.tld</pattern>
        </patterns>
      </fileType>
      <fileType>
        <id>auto-remove</id>
        <patterns>
          <pattern>**/*.bak</pattern>
          <pattern>**/*~</pattern>
          <pattern>**/*-</pattern>
        </patterns>
      </fileType>
      <fileType>
        <id>ignored</id>
        <patterns>
          <pattern>**/.htaccess</pattern>
          <pattern>**/KEYS</pattern>
          <pattern>**/*.rb</pattern>
          <pattern>**/*.sh</pattern>
          <pattern>**/.svn/**</pattern>
          <pattern>**/.DAV/**</pattern>
        </patterns>
      </fileType>
    </fileTypes>
    <knownContentConsumers>
      <knownContentConsumer>update-db-artifact</knownContentConsumer>
      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
      <knownContentConsumer>validate-checksum</knownContentConsumer>
      <knownContentConsumer>validate-signature</knownContentConsumer>
      <knownContentConsumer>index-content</knownContentConsumer>
      <knownContentConsumer>auto-remove</knownContentConsumer>
      <knownContentConsumer>auto-rename</knownContentConsumer>
    </knownContentConsumers>
    <invalidContentConsumers>
      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
    </invalidContentConsumers>
  </repositoryScanning>

  <databaseScanning>
    <cronExpression>0 0 * * * ?</cronExpression>
    <unprocessedConsumers>
      <unprocessedConsumer>index-artifact</unprocessedConsumer>
      <unprocessedConsumer>update-db-project</unprocessedConsumer>
      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
    </unprocessedConsumers>
    <cleanupConsumers>
      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
    </cleanupConsumers>
  </databaseScanning>

</configuration>

{'repo_name': 'apache/archiva', 'stars': '262', 'repo_language': 'Java', 'file_name': 'index.xml', 'mime_type': 'text/xml', 'hash': -8440921332888815305, 'source_dataset': 'data'}


commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Nov 22 18:44:23 2017 +0000

    Avoid use of strlen in getlogin_r (bug 22447).

    Building glibc with current mainline GCC fails, among other reasons,
    because of an error for use of strlen on the nonstring ut_user field.
    This patch changes the problem code in getlogin_r to use __strnlen
    instead.  It also needs to set the trailing NUL byte of the result
    explicitly, because of the case where ut_user does not have such a
    trailing NUL byte (but the result should always have one).

    Tested for x86_64.  Also tested that, in conjunction with
    <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
    the build for arm with mainline GCC.

            [BZ #22447]
            * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
            strlen to compute length of ut_user and set trailing NUL byte of
            result explicitly.

---
 sysdeps/unix/getlogin_r.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/sysdeps/unix/getlogin_r.c
+++ b/sysdeps/unix/getlogin_r.c
@@ -82,7 +82,7 @@

   if (result == 0)
     {
-      size_t needed = strlen (ut->ut_user) + 1;
+      size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;

       if (needed > name_len)
 	{
@@ -91,7 +91,8 @@
 	}
       else
 	{
-	  memcpy (name, ut->ut_user, needed);
+	  memcpy (name, ut->ut_user, needed - 1);
+	  name[needed - 1] = 0;
 	  result = 0;
 	}
     }

{'repo_name': 'hanwckf/rt-n56u', 'stars': '1587', 'repo_language': 'C', 'file_name': 'ak4396.h', 'mime_type': 'text/x-c', 'hash': -8847686544809907383, 'source_dataset': 'data'}


{'repo_name': '3tinkers/TKImageView', 'stars': '341', 'repo_language': 'Objective-C', 'file_name': 'contents.xcworkspacedata', 'mime_type': 'text/xml', 'hash': 3672061855928708392, 'source_dataset': 'data'}


package com.vogella.android.firebaseexample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

public class MainActivity extends Activity {
    // Firebase instance variables
    private FirebaseAuth firebaseAuthentication;
    private FirebaseUser firebaseUser;
    private String username;
    private String photoUrl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        firebaseAuthentication = FirebaseAuth.getInstance();
        firebaseUser = firebaseAuthentication.getCurrentUser();
        if (firebaseUser == null) {
            // Not signed in, launch the Sign In activity
            startActivity(new Intent(this, SignInActivity.class));
            finish();
            return;
        } else {
            username = firebaseUser.getDisplayName();
            if (firebaseUser.getPhotoUrl() != null) {
                photoUrl = firebaseUser.getPhotoUrl().toString();
            }
        }
    }
}

{'repo_name': 'vogellacompany/codeexamples-android', 'stars': '486', 'repo_language': 'Java', 'file_name': 'org.eclipse.jdt.core.prefs', 'mime_type': 'text/plain', 'hash': 181425419506976138, 'source_dataset': 'data'}


Το Go είναι ένα πρωτοποριακό θέμα για το WordPress με προτεραιότητα στο Gutenberg, με ιδιαίτερη έμφαση στο να δίνει τη δυνατότητα στους σχεδιαστές να κατασκευάζουν πανέμορφες και πλούσιες σελίδες με το WordPress.

Your installation of the Go theme is incomplete. If you installed the Go theme from GitHub, please refer to this document to set up your development environment: %1$s

Your installation of the Go theme is incomplete. If you installed the Go theme from GitHub, please refer to this document to set up your development environment.

Μενού υποσέλιδου αρ. 1

Μενού υποσέλιδου αρ. 2

Μενού υποσέλιδου αρ. 3

Μια σκέψη για το “%s”

%1$s σκέψη για το “%2$s”

Πλοήγηση στα σχόλια

← Παλιότερα σχόλια

Νεότερα σχόλια →

Τα σχόλια είναι απενεργοποιημένα.

Μετάβαση απευθείας στο περιεχόμενο

Εγκατάσταση απαιτούμενων προσθέτων

Εγκατάσταση προσθέτων

Γίνεται εγκατάσταση προσθέτου: %s

Γίνεται ενημέρωση προσθέτου: %s

Κάτι πήγε στραβά με το API του προσθέτου.

Για αυτό το θέμα απαιτείται το παρακάτω πρόσθετο: %1$s.

Για αυτό το θέμα προτείνεται το παρακάτω πρόσθετο: %1$s.

Το παρακάτω πρόσθετο πρέπει να ενημερωθεί στην τελευταία του έκδοση ώστε να εξασφαλιστεί μέγιστη συμβατότητα με αυτό το θέμα: %1$s.

Υπάρχει μια διαθέσιμη ενημέρωση για το: %1$s.

Το παρακάτω απαιτούμενο πρόσθετο είναι προς το παρόν ανενεργό: %1$s.

Το παρακάτω προτεινόμενο πρόσθετο είναι προς το παρόν ανενεργό: %1$s.

Έναρξη εγκατάστασης προσθέτου

Έναρξη ενημέρωσης προσθέτου

Έναρξη ενεργοποίησης προσθέτου

Επιστροφή στον εγκαταστάτη απαιτούμενων προσθέτων

Επιστροφή στη διαχείριση

Το πρόσθετο ενεργοποιήθηκε με επιτυχία.

Το παρακάτω πρόσθετο ενεργοποιήθηκε με επιτυχία:

Δεν έγινε καμία ενέργεια. Το πρόσθετο %1$s ήταν ήδη ενεργό.

Το πρόσθετο δεν ενεργοποιήθηκε. Χρειάζεται νεότερη έκδοση του προσθέτου %s για αυτό το θέμα. Ενημερώστε το πρόσθετο.

Όλα τα πρόσθετα εγκαταστάθηκαν και ενεργοποιήθηκαν με επιτυχία. %1$s

Κλείσιμο αυτού του μηνύματος

Υπάρχουν ένα ή περισσότερα απαιτούμενα ή προτεινόμενα πρόσθετα για εγκατάσταση, ενημέρωση ή ενεργοποίηση.

Επικοινωνήστε με τον διαχειριστή αυτού του ιστότοπου για βοήθεια.

Αυτό το πρόσθετο πρέπει να ενημερωθεί για να είναι συμβατό με το θέμα σας.

Απαιτείται ενημέρωση

Το πακέτο του απομακρυσμένου προσθέτου δεν περιέχει φάκελο με το επιθυμητό σύντομο όνομα και η μετονομασία δεν είχε αποτέλεσμα.

Επικοινωνήστε με τον πάροχο του προσθέτου και ζητήστε του να δημιουργήσει πακέτο του προσθέτου σύμφωνα με τις κατευθυντήριες γραμμές του WordPress.

Το πακέτο του απομακρυσμένου προσθέτου αποτελείται από περισσότερα από ένα αρχεία, αλλά τα αρχεία δεν είναι συσκευασμένα μέσα σε φάκελο.

Αποθετήριο WordPress

Εξωτερική πηγή

Προ-συσκευασμένο

Μη εγκατεστημένο

Εγκατεστημένο αλλά όχι ενεργοποιημένο

Απαιτείται μη διαθέσιμη ενημέρωση

Απαιτεί ενημέρωση

Προτείνεται ενημέρωση

Προς εγκατάσταση (%s)

Διαθέσιμη ενημέρωση (%s)

Προς ενεργοποίηση (%s)

Εγκατεστημένη έκδοση:

Ελάχιστη απαιτούμενη έκδοση:

Διαθέσιμη έκδοση:

Δεν υπάρχουν πρόσθετα για εγκατάσταση, ενημέρωση ή ενεργοποίηση.

Ενημερώσεις προσθέτων

Εγκατάσταση του %2$s

Ενημέρωση του %2$s

Ενεργοποίηση του %2$s

Μήνυμα αναβάθμισης από τον συντάκτη του προσθέτου:

Ενεργοποίηση

Δεν έχουν επιλεγεί πρόσθετα για εγκατάσταση. Δεν έγινε καμία ενέργεια.

Δεν έχουν επιλεγεί πρόσθετα για ενημέρωση. Δεν έγινε καμία ενέργεια.

Δεν υπάρχουν διαθέσιμα πρόσθετα για εγκατάσταση προς το παρόν.

Δεν υπάρχουν διαθέσιμα πρόσθετα για ενημέρωση προς το παρόν.

Δεν έχουν επιλεγεί πρόσθετα για ενεργοποίηση. Δεν έγινε καμία ενέργεια.

Δεν υπάρχουν διαθέσιμα πρόσθετα για ενεργοποίηση προς το παρόν.

Η ενεργοποίηση του προσθέτου απέτυχε.

Γίνεται ενημέρωση του προσθέτου %1$s (%2$d/%3$d)

Προέκυψε σφάλμα κατά την εγκατάσταση του προσθέτου %1$s: <strong>%2$s</strong>.

Η εγκατάσταση του προσθέτου %1$s απέτυχε.

Η διαδικασία εγκατάστασης και ενεργοποίησης ξεκινά. Σε ορισμένες περιπτώσεις, αυτή η διαδικασία ίσως διαρκέσει αρκετά, για αυτό κάντε λίγο υπομονή.

Το πρόσθετο %1$s εγκαταστάθηκε και ενεργοποιήθηκε με επιτυχία.

Προβολή λεπτομερειών

Απόκρυψη λεπτομερειών

Όλες οι εγκαταστάσεις και ενεργοποιήσεις ολοκληρώθηκαν.

Γίνεται εγκατάσταση και ενεργοποίηση του προσθέτου %1$s (%2$d/%3$d)

Η διαδικασία εγκατάστασης ξεκινά. Σε ορισμένες περιπτώσεις, αυτή η διαδικασία ίσως διαρκέσει αρκετά, για αυτό κάντε λίγο υπομονή.

Το πρόσθετο %1$s εγκαταστάθηκε με επιτυχία.

Όλες οι εγκαταστάσεις ολοκληρώθηκαν.

Γίνεται εγκατάσταση του προσθέτου %1$s: (%2$d/%3$d)

Δεύτερου επιπέδου

Τρίτου επιπέδου

Τετάρτου επιπέδου

Παιχνιδιάρικο

Δεν είναι δυνατή η εύρεση αυτής της σελίδας

Αναζήτηση για: %s

Δεν βρέθηκε τίποτα

Αντιστοιχίστε ένα μενού στη θέση μενού %s

Πλάτος για κινητά

Ρυθμίσεις ιστότοπου

Τίτλοι σελίδας

Display page titles on individual pages that are not individually opted-out.

Στυλ σχεδίασης

Επιλέξτε ένα στυλ, επιλέξτε έναν συνδυασμό χρωμάτων και προσαρμόστε τα χρώματα για να εξατομικεύσετε τον ιστότοπό σας.

Customize colors within the site header.

Customize colors within the site footer.

Επιλέξτε μια κεφαλίδα για κάθε σελίδα στον ιστότοπό σας και προσαρμόστε το στυλ της με τις παρακάτω διαθέσιμες επιλογές.

Επιλέξτε ένα υποσέλιδο για κάθε σελίδα στον ιστότοπό σας και προσαρμόστε το στυλ του με τις παρακάτω διαθέσιμες επιλογές.

Κοινωνικά δίκτυα

Add social media account links to apply social icons on the site footer.

Σχεδίαση ιστότοπου

(Τροποποίηση)

Συντάκτης άρθρου

Το σχόλιό σας πρόκειται να υποβληθεί σε έλεγχο.

Συντάκτης: %s

Ημερομηνία άρθρου

Προβεβλημένα

Εναλλαγή αναζήτησης

Προβολή καλαθιού αγορών

Κλείσιμο πλευρικής στήλης

Καλάθι αγορών

%s προϊόν στο καλάθι αγορών σας

Το καλάθι αγορών σας είναι προς το παρόν άδειο.

Προηγούμενο άρθρο:

Επόμενο άρθρο:

Επαναφορά επιλογών

Είστε έτοιμοι για να δημοσιεύσετε το πρώτο σας άρθρο; Ξεκινήστε εδώ.

Λυπούμαστε, αλλά τίποτα δεν ταιριάζει με τους όρους αναζήτησης. Δοκιμάστε ξανά την αναζήτηση με διαφορετικές λέξεις-κλειδιά.

Μάλλον δεν μπορούμε να βρούμε αυτό που ψάχνετε. Ίσως μπορεί να σας βοηθήσει η αναζήτηση.

Μενού υποσέλιδου

Μενού κύριου υποσέλιδου

Μενού υποσέλιδου δευτέρου επιπέδου

Μενού υποσέλιδου τρίτου επιπέδου

A tenacious, loving and energetic photographer who enjoys grabbing her camera and running out to take some photos.

I am so fascinated by photography and it’s capability to bring your imagination to amazing places. Early on, I fell in love with the idea of filming my own productions, so I set out to learn everything I could.

I have been teaching myself filmmaking for the past four and a half years and I’m still learning every day. I am building my business as a freelance filmmaker, as well as working on my own photo shoots.

Miller & Cole is tremendously proud of the impact that we have made in helping our clients by providing quality legal services and exceptional service.

Our goal is to create assets from our clients’ innovations through patent, trademark and copyright law.  We take great pride in providing quality trademark legal services and exceptional customer service every single day.

The attorneys at Miller & Cole work as a team to exceed each of our clients’ expectations. We have 30+ years of high-level experience helping businesses protecting the time, money and resources spent developing ideas and inventions.

Office => (555) 555-5555<br>email@example.com

Well hello there, wonderful, fabulous you! If you’d like to get in touch with me, please feel free to give me a call at (555) 555-5555, or send a message with the form down below. Either way, I'll be in touch shortly!

"I appreciate Everett's ability to compose visually stunning photos, brining my memories to live every time I look at them."

"Everett should be nominated for photographer of the year. I am so pleased with her photography at my wedding."

"Everett knew exactly how to pull the best of me out, and into a beautiful portrait. I'm so glad I met Everett!"

Studio Gym
123 Example Rd, Scottsdale, AZ 85260
(555) 555-5555

Where the hustle slows, the rhythm is heard, and the beans are fantastic

Enjoy Live Music + the Best Coffee You've Ever Had

Connecting audience + artist in our lush, speakeasy-style listening room. Only 50 seats available for this sought-after scene.

With our guides' experience, we will not only get you to where the fish are - but we'll get you hooked on them too. Our crew is knowledgeable and friendly - ready to take you on the trip of your dreams.

Folks have fought some monster bluefin tuna on standup gear with our offshore fishing packager, which is an incredible challenge for sure! Stick to the shoreline and test your strength pulling in some biggies!

Our approach reflects the people we serve. We are diverse, yet the same.

When we set up shop with an espresso machine up front and a roaster in the back, we hoped to some day be a part of New York's rich tradition of service and culinary achievement. Everyday this aspiration drives us.

The city's energy binds us together. It drives us to be the best.

This fairly new coffee shop, conveniently located in downtown Scottsdale, is one of the best coffee shops I've ever been to, and trust me when I say, I've been to many. The owners and the staff will make you feel like an old friend or even family.

Bringing the finest culinary food from the heart of Asia directly to you

Sushi Nakazawa serves the omakase of Chef Daisuke Nakazawa. Within the twenty-course meal lies Chef Nakazawa’s passion for sushi. With ingredients sourced both domestically and internationally, the chef crafts a very special tasting menu within the style of Edomae sushi. Chef Nakazawa is a strong believer in the food he serves representing the waters he is surrounded by, so only the best and freshest find its way to your plate.

The relaxed dining experience at Sushi Nakazawa is chic nonetheless. High back leather chairs at the sushi bar coddle you while each course is explained in detail, and every nuance is revealed. Whether an Edomae novice or self-proclaimed sushi foodie, you will leave with a feeling of euphoria.

The relaxed dining experience at Bento is chic and airy. High back chairs at the sushi bar coddle you for each course.

Housed in the original Yami House, the history behind Bento is amazing. Learn more as you dine in our historical dining room.

Bento is one of the best-rated restaurants in the region. With glamourous food and delicious drinks - you won't want to miss out!

Branding & Digital Design<br>Studio in Tokyo

We Create Brands and Inspire Experiences

For over forty years Salt has been known for its luxury lobster, steamed clams, barbecued chicken and homemade clam chowder. Stop on by and grab some of the most incredible seafood you'll ever taste.

Cajun & creole seafood cuisine, never frozen - delish

Mon - Thurs => 5pm - 11pm<br> Fri-Sat => 5pm - Midnight

We cater all events from family reunions, to weddings

Νεότερα άρθρα

Παλαιότερα άρθρα

Αναζήτηση για:

{'repo_name': 'godaddy-wordpress/go', 'stars': '152', 'repo_language': 'PHP', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 8446653701511556066, 'source_dataset': 'data'}