text:
using System;
using System.IO;
using System.Diagnostics;
using Axiom.Core;

namespace Axiom.Media {

	///
	///    Structure used to define a box in a 3-D integer space.
	///    Note that the left, top, and front edges are included but the right,
	///    bottom and top ones are not.
	///
	public class BasicBox {

        #region Fields

		protected int left;
		protected int top;
		protected int right;
		protected int bottom;
		protected int front;
		protected int back;

		#endregion Fields

		#region Constructors

		///
		///    Parameterless constructor for setting the members manually
		///
        public BasicBox() {
		}

		///
		///    Define a box from left, top, right and bottom coordinates
		///    This box will have depth one (front=0 and back=1).
		///
		///<param name="left">x value of left edge</param>
		///<param name="top">y value of top edge</param>
		///<param name="right">x value of right edge</param>
		///<param name="bottom">y value of bottom edge</param>
		///<remarks>
		///    Note that the left, top, and front edges are included
		///    but the right, bottom and top ones are not.
		///</remarks>
		public BasicBox(int left, int top, int right, int bottom) {
			this.left = left;
			this.top = top;
			this.right = right;
			this.bottom = bottom;
			this.front = 0;
			this.back = 1;
			Debug.Assert(right >= left && bottom >= top && back >= front);
		}

		///
		///    Define a box from left, top, front, right, bottom and back
		///    coordinates.
		///
		///<param name="left">x value of left edge</param>
		///<param name="top">y value of top edge</param>
		///<param name="front">z value of front edge</param>
		///<param name="right">x value of right edge</param>
		///<param name="bottom">y value of bottom edge</param>
		///<param name="back">z value of back edge</param>
		///<remarks>
		///    Note that the left, top, and front edges are included
		///    but the right, bottom and back ones are not.
		///</remarks>
        public BasicBox(int left, int top, int front, int right, int bottom, int back) {
			this.left = left;
			this.top = top;
            this.front = front;
            this.right = right;
			this.bottom = bottom;
            this.back = back;
			Debug.Assert(right >= left && bottom >= top && back >= front);
		}

		#endregion Constructors

		#region Properties

		public int Left {
			get { return left; }
			set { left = value; }
		}

		public int Top {
			get { return top; }
			set { top = value; }
		}

		public int Right {
			get { return right; }
			set { right = value; }
		}

		public int Bottom {
			get { return bottom; }
			set { bottom = value; }
		}

		public int Front {
			get { return front; }
			set { front = value; }
		}

		public int Back {
			get { return back; }
			set { back = value; }
		}

		///
		///    Get the width of this box
		///
		public int Width {
			get { return right-left; }
		}

		///
		///    Get the height of this box
		///
        public int Height {
			get { return bottom-top; }
		}

		///
		///    Get the depth of this box
		///
        public int Depth {
			get { return back-front; }
        }

		#endregion Properties

		#region Methods

		///
		///    Return true if the other box is a part of this one
		///
        public bool Contains(BasicBox def) {
			return (def.Left >= left && def.top >= top && def.front >= front &&
					def.right <= right && def.bottom <= bottom && def.back <= back);
		}

		public void CopyFromBasicBox(BasicBox src) {
			left = src.left;
			top = src.top;
			front = src.front;
			right = src.right;
			bottom = src.bottom;
			back = src.back;
		}

		#endregion Methods

	}

	///
	///    A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
	///    In case of a rectangle, depth must be 1.
	///    Pixels are stored as a succession of "depth" slices, each containing "height" rows of
	///    "width" pixels.
	///
	public class PixelBox : BasicBox {

		#region Fields

        ///
		///    The data pointer.  We do not own this.
        ///
		protected IntPtr data;
        ///
		///    A byte offset into the data
        ///
		protected int offset;
        ///
		///    The pixel format
        ///
		protected PixelFormat format;
        ///
		///    Number of elements between the leftmost pixel of one row and the left
		///    pixel of the next. This value must always be equal to getWidth() (consecutive)
		///    for compressed formats.
        ///
        protected int rowPitch;
        ///
		///    Number of elements between the top left pixel of one (depth) slice and
		///    the top left pixel of the next. This can be a negative value. Must be a multiple of
		///    rowPitch. This value must always be equal to getWidth()*getHeight() (consecutive)
		///    for compressed formats.
        ///
        protected int slicePitch;

		#endregion Fields

		#region Constructors

        ///
		///    Parameter constructor for setting the members manually
        ///
		public PixelBox() {}

        ///
		///    Constructor providing extents in the form of a Box object. This constructor
		///    assumes the pixel data is laid out consecutively in memory. (this
		///    means row after row, slice after slice, with no space in between)
        ///
		///<param name="extents">Extents of the region defined by data</param>
		///<param name="ormat">Format of this buffer</param>
		///<param name="data">Pointer to the actual data</param>
		protected PixelBox(BasicBox extents, PixelFormat format, IntPtr data) {
			CopyFromBasicBox(extents);
			this.format = format;
			this.data = data;
			this.offset = 0;
			SetConsecutive();
		}

		public PixelBox(BasicBox extents, PixelFormat format) {
			CopyFromBasicBox(extents);
			this.format = format;
			this.offset = 0;
			SetConsecutive();
		}

        ///
		///    Constructor providing width, height and depth. This constructor
		///    assumes the pixel data is laid out consecutively in memory. (this
		///    means row after row, slice after slice, with no space in between)
        ///
		///<param name="width">Width of the region</param>
		///<param name="height">Height of the region</param>
		///<param name="depth">Depth of the region</param>
		///<param name="format">Format of this buffer</param>
		///<param name="data">Pointer to the actual data</param>
		public PixelBox(int width, int height, int depth, PixelFormat format, IntPtr data) :
			base(0, 0, 0, width, height, depth) {
    		this.format = format;
			this.data = data;
    		this.offset = 0;
			SetConsecutive();
    	}

		public PixelBox(int width, int height, int depth, PixelFormat format) :
			base(0, 0, 0, width, height, depth) {
    		this.format = format;
    		SetConsecutive();
    	}

		#endregion Constructors

		#region Properties

        ///
		///    Get/set the data array
        ///
        public IntPtr Data {
			get { return data; }
			set { data = value; }
		}

        ///
		///    Get/set the offset into the data array
        ///
        public int Offset {
			get { return offset; }
			set { offset = value; }
		}

        ///
		///    Get/set the pixel format
        ///
        public PixelFormat Format {
			get { return format; }
			set { format = value; }
		}

        ///
        ///
        public int RowPitch {
			get { return rowPitch; }
			set { rowPitch = value; }
		}

        ///
		///    Get the number of elements between one past the rightmost pixel of
		///    one row and the leftmost pixel of the next row. (IE this is zero if rows
		///    are consecutive).
        ///
        public int RowSkip {
			get { return rowPitch - Width; }
		}

        ///
        ///
        public int SlicePitch {
			get { return slicePitch; }
			set { slicePitch = value; }
		}

        ///
		///    Get the number of elements between one past the right bottom pixel of
		///    one slice and the left top pixel of the next slice. (IE this is zero if slices
		///    are consecutive).
        ///
        public int SliceSkip {
			get { return slicePitch - (Height * rowPitch); }
		}

        ///
		///    Return whether this buffer is laid out consecutive in memory (ie the pitches
		///    are equal to the dimensions)
        ///
        public bool Consecutive {
            get { return rowPitch == Width && slicePitch == Width * Height; }
		}

        ///
		///    Return the size (in bytes) this image would take if it was
		///    laid out consecutive in memory
        ///
		public int ConsecutiveSize {
            get { return PixelUtil.GetMemorySize(Width, Height, Depth, format); }
		}

		#endregion Properties

        #region Methods

        ///
		///    Set the rowPitch and slicePitch so that the buffer is laid out consecutive
		///    in memory.
        ///
        public void SetConsecutive() {
            rowPitch = Width;
            slicePitch = Width * Height;
        }

        ///
		///    I don't know how to figure this out.  For now, just deal with the DXT* formats
        ///
		public static bool Compressed(PixelFormat format) {
			return (format == PixelFormat.DXT1 ||
				    format == PixelFormat.DXT2 ||
					format == PixelFormat.DXT3 ||
					format == PixelFormat.DXT4 ||
					format == PixelFormat.DXT5);
		}

#if OLD_CODE // moved to PixelConverter to better match Ogre
		public static int GetMemorySize(int width, int height, int depth, PixelFormat format)
		{
			if(Compressed(format)) {
				switch(format) {
					// DXT formats work by dividing the image into 4x4 blocks, then encoding each
					// 4x4 block with a certain number of bytes. DXT can only be used on 2D images.
					case PixelFormat.DXT1:
						Debug.Assert(depth == 1);
						return ((width + 3) / 4) * ((height + 3) / 4) * 8;
					case PixelFormat.DXT2:
					case PixelFormat.DXT3:
					case PixelFormat.DXT4:
					case PixelFormat.DXT5:
						Debug.Assert(depth == 1);
						return ((width+3)/4)*((height+3)/4)*16;
					default:
						throw new Exception("Invalid compressed pixel format, in PixelBox.GetMemorySize");
				}
			}
			else
				return width * height * depth * PixelConverter.GetNumElemBytes(format);
		}
#endif
      	/** Return a subvolume of this PixelBox.
      		@param def	Defines the bounds of the subregion to return
      		@returns	A pixel box describing the region and the data in it
      		@remarks	This function does not copy any data, it just returns
      			a PixelBox object with a data pointer pointing somewhere inside
      			the data of object.
      		@throws	Exception(ERR_INVALIDPARAMS) if def is not fully contained
      	*/
      	public PixelBox GetSubVolume(BasicBox def) {
			if(Compressed(format)) {
				if(def.Left == left && def.Top == top && def.Front == front &&
				   def.Right == right && def.Bottom == bottom && def.Back == back)
					// Entire buffer is being queried
					return this;
				throw new Exception("Cannot return subvolume of compressed PixelBuffer, in PixelBox.GetSubVolume");
			}
			if(!Contains(def))
				throw new Exception("Bounds out of range, in PixelBox.GetSubVolume");

            int elemSize = PixelUtil.GetNumElemBytes(format);
			// Calculate new data origin
			PixelBox rval = new PixelBox(def, format, data);
			rval.offset =  (((def.Left - left)*elemSize) +
							((def.Top - top)*rowPitch*elemSize) +
							((def.Front - front)*slicePitch*elemSize));
			rval.rowPitch = rowPitch;
			rval.slicePitch = slicePitch;
			rval.format = format;
			return rval;
		}

		#endregion Methods

	}
}


text:
using namespace rc;
using namespace rc::detail;

TEST_CASE("makeDefaultTestListener") {
  std::ostringstream os;

  SECTION(
      "should not print anything on test case finished if verboseProgress == "
      "false") {
    Configuration config;
    config.verboseProgress = false;
    auto listener = makeDefaultTestListener(config, os);
    listener->onTestCaseFinished(CaseDescription());
    listener.reset();
    REQUIRE(os.str().empty());
  }

  SECTION("should print . on test case success if verboseProgress == true") {
    Configuration config;
    config.verboseProgress = true;
    auto listener = makeDefaultTestListener(config, os);
    CaseDescription desc;
    desc.result = CaseResult(CaseResult::Type::Success);
    listener->onTestCaseFinished(desc);
    listener.reset();
    REQUIRE(os.str() == ".");
  }

  SECTION(
      "should not print anything on shrink tried if verboseShrinking == false") {
    Configuration config;
    config.verboseShrinking = false;
    auto listener = makeDefaultTestListener(config, os);
    listener->onShrinkTried(CaseDescription(), false);
    listener.reset();
    REQUIRE(os.str().empty());
  }

  SECTION("should print . on unaccepted shrink if verboseShrinking == true") {
    Configuration config;
    config.verboseShrinking = true;
    auto listener = makeDefaultTestListener(config, os);
    CaseDescription desc;
    desc.result = CaseResult(CaseResult::Type::Success);
    listener->onShrinkTried(desc, false);
    listener.reset();
    REQUIRE(os.str() == ".");
  }

  SECTION("should not have reproduce string if no failure") {
    auto listener = makeDefaultTestListener(Configuration(), os);
    TestMetadata metadata;
    metadata.id = "foobar";
    SuccessResult success;
    listener->onTestFinished(metadata, success);
    listener.reset();
    REQUIRE(os.str().find("reproduce=") == std::string::npos);
  }

  SECTION("should have reproduce string on failure") {
    auto listener = makeDefaultTestListener(Configuration(), os);
    TestMetadata metadata;
    metadata.id = "foobar";
    FailureResult failure;
    listener->onTestFinished(metadata, failure);
    listener.reset();
    REQUIRE(os.str().find("reproduce=") != std::string::npos);
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Catalog uuid="9056d2ef-6366-44fd-807c-846b121a816a">
		<InternalInfo>
			<xr:GeneratedType name="CatalogObject.РолиПартнеровВСделкахИПроектах" category="Object">
				<xr:TypeId>0af72087-e908-4315-b854-44a9fd7ba886</xr:TypeId>
				<xr:ValueId>def7896a-d86a-4dc7-a782-f113a3f17626</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogRef.РолиПартнеровВСделкахИПроектах" category="Ref">
				<xr:TypeId>7f46ef80-2ff2-45f5-8d39-022c26ad8308</xr:TypeId>
				<xr:ValueId>515ba570-de4d-4b3d-b062-4322460fc518</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogSelection.РолиПартнеровВСделкахИПроектах" category="Selection">
				<xr:TypeId>a0b39316-ea48-47a9-9e77-e67b4f56fa03</xr:TypeId>
				<xr:ValueId>0908182e-b154-4041-9f1d-52fef44e1d93</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogList.РолиПартнеровВСделкахИПроектах" category="List">
				<xr:TypeId>ac15c289-dc20-4258-b8b3-499e77431abc</xr:TypeId>
				<xr:ValueId>56da3f90-cb5b-4ffa-9c08-acf34a4f165f</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogManager.РолиПартнеровВСделкахИПроектах" category="Manager">
				<xr:TypeId>78a0668e-1c96-4582-ba95-0faa386c9963</xr:TypeId>
				<xr:ValueId>e1633483-8597-4f73-9ac6-85460c7d8a00</xr:ValueId>
			</xr:GeneratedType>
		</InternalInfo>
		<Properties>
			<Name>РолиПартнеровВСделкахИПроектах</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Роли партнеров в сделках и проектах</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<Hierarchical>false</Hierarchical>
			<HierarchyType>HierarchyFoldersAndItems</HierarchyType>
			<LimitLevelCount>false</LimitLevelCount>
			<LevelCount>2</LevelCount>
			<FoldersOnTop>true</FoldersOnTop>
			<UseStandardCommands>true</UseStandardCommands>
			<Owners/>
			<SubordinationUse>ToItems</SubordinationUse>
			<CodeLength>0</CodeLength>
			<DescriptionLength>50</DescriptionLength>
			<CodeType>String</CodeType>
			<CodeAllowedLength>Fixed</CodeAllowedLength>
			<CodeSeries>WholeCatalog</CodeSeries>
			<CheckUnique>false</CheckUnique>
			<Autonumbering>false</Autonumbering>
			<DefaultPresentation>AsDescription</DefaultPresentation>
			<StandardAttributes>
				<xr:StandardAttribute name="PredefinedDataName">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Predefined">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Ref">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="DeletionMark">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="IsFolder">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Owner">
					<xr:LinkByType/>
					<xr:FillChecking>ShowError</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>true</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Parent">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>true</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Description">
					<xr:LinkByType/>
					<xr:FillChecking>ShowError</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Используется для выбора роли из списка.</v8:content>
						</v8:item>
					</xr:ToolTip>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Наименование</v8:content>
						</v8:item>
					</xr:Synonym>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:type="xs:string"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Code">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:type="xs:string"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
			</StandardAttributes>
			<Characteristics/>
			<PredefinedDataUpdate>Auto</PredefinedDataUpdate>
			<EditType>InDialog</EditType>
			<QuickChoice>true</QuickChoice>
			<ChoiceMode>QuickChoice</ChoiceMode>
			<InputByString>
				<xr:Field>Catalog.РолиПартнеровВСделкахИПроектах.StandardAttribute.Description</xr:Field>
			</InputByString>
			<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
			<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
			<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
			<DefaultObjectForm>Catalog.РолиПартнеровВСделкахИПроектах.Form.ФормаЭлемента</DefaultObjectForm>
			<DefaultFolderForm/>
			<DefaultListForm>Catalog.РолиПартнеровВСделкахИПроектах.Form.ФормаСписка</DefaultListForm>
			<DefaultChoiceForm/>
			<DefaultFolderChoiceForm/>
			<AuxiliaryObjectForm/>
			<AuxiliaryFolderForm/>
			<AuxiliaryListForm/>
			<AuxiliaryChoiceForm/>
			<AuxiliaryFolderChoiceForm/>
			<IncludeHelpInContents>false</IncludeHelpInContents>
			<BasedOn/>
			<DataLockFields/>
			<DataLockControlMode>Automatic</DataLockControlMode>
			<FullTextSearch>Use</FullTextSearch>
			<ObjectPresentation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Роль партнера в сделке или проекте</v8:content>
				</v8:item>
			</ObjectPresentation>
			<ExtendedObjectPresentation/>
			<ListPresentation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Роли партнеров в сделках и проектах</v8:content>
				</v8:item>
			</ListPresentation>
			<ExtendedListPresentation/>
			<Explanation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Используется для определения ролей партнеров в сделках, маркетинговых мероприятиях и проектах.</v8:content>
				</v8:item>
			</Explanation>
			<CreateOnInput>DontUse</CreateOnInput>
			<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
		</Properties>
		<ChildObjects>
			<Attribute uuid="5963dfce-8fcc-47bb-93db-0eb1c7983b43">
				<Properties>
					<Name>Описание</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Описание</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:string</v8:Type>
						<v8:StringQualifiers>
							<v8:Length>0</v8:Length>
							<v8:AllowedLength>Variable</v8:AllowedLength>
						</v8:StringQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Описание предназначения и рекомендации по использованию роли.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>true</MultiLine>
					<ExtendedEdit>true</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:type="xs:string"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Use>ForItem</Use>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Form>ФормаСписка</Form>
			<Form>ФормаЭлемента</Form>
		</ChildObjects>
	</Catalog>
</MetaDataObject>


text:
@interface PodsDummy_Pods_WorkoutMergeTests : NSObject
@end
@implementation PodsDummy_Pods_WorkoutMergeTests
@end


text:
package org.elasticsearch.xpack.ml.action;

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.ml.action.GetCalendarsAction;
import org.elasticsearch.xpack.core.action.util.PageParams;
import org.elasticsearch.xpack.ml.job.persistence.CalendarQueryBuilder;
import org.elasticsearch.xpack.ml.job.persistence.JobResultsProvider;

public class TransportGetCalendarsAction extends HandledTransportAction<GetCalendarsAction.Request, GetCalendarsAction.Response> {

    private final JobResultsProvider jobResultsProvider;

    @Inject
    public TransportGetCalendarsAction(TransportService transportService, ActionFilters actionFilters,
                                       JobResultsProvider jobResultsProvider) {
        super(GetCalendarsAction.NAME, transportService, actionFilters, GetCalendarsAction.Request::new);
        this.jobResultsProvider = jobResultsProvider;
    }

    @Override
    protected void doExecute(Task task, GetCalendarsAction.Request request, ActionListener<GetCalendarsAction.Response> listener) {
        final String[] calendarIds = Strings.splitStringByCommaToArray(request.getCalendarId());
        PageParams pageParams = request.getPageParams();
        if (pageParams == null) {
            pageParams = PageParams.defaultParams();
        }
        getCalendars(calendarIds, pageParams, listener);
    }

    private void getCalendars(String[] idTokens, PageParams pageParams, ActionListener<GetCalendarsAction.Response> listener) {
        CalendarQueryBuilder query = new CalendarQueryBuilder().pageParams(pageParams).calendarIdTokens(idTokens).sort(true);
        jobResultsProvider.calendars(query, ActionListener.wrap(
                calendars -> listener.onResponse(new GetCalendarsAction.Response(calendars)),
                listener::onFailure
        ));
    }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Imad Ali ">
<meta name="description" content="Python decorators are just wrappers&hellip; that return functions Part of my issue with understanding how decorators work was that I was treating them as a function/class that is returning a variable. I should have been thinking of them as a function/class returning a modified (i.e. decorated) function/class. As mentioned succinctly here, &ldquo;Decorators are a form of metaprogramming; they enhance the action of the function or method they decorate.&rdquo; So a decorator is just a wrapper of the function that you want to modify (that returns a function)." />
<meta name="keywords" content=", Python" />
<meta name="robots" content="noodp" />
<meta name="theme-color" content="" />
<link rel="canonical" href="http://imadali.net/posts/python-decorators-are-just-wrappers/" />

    <title>

            Python Decorators are Just Wrappers :: Imad Ali

    </title>

<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.1/css/flag-icon.min.css" rel="stylesheet"
    type="text/css">

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

<meta itemprop="name" content="Python Decorators are Just Wrappers">
<meta itemprop="description" content="Python decorators are just wrappers… that return functions Part of my issue with understanding how decorators work was that I was treating them as a function/class that is returning a variable. I should have been thinking of them as a function/class returning a modified (i.e. decorated) function/class. As mentioned succinctly here, “Decorators are a form of metaprogramming; they enhance the action of the function or method they decorate.” So a decorator is just a wrapper of the function that you want to modify (that returns a function)."><meta itemprop="datePublished" content="2020-05-06T02:21:39-07:00" />
<meta itemprop="dateModified" content="2020-05-06T02:21:39-07:00" />
<meta itemprop="wordCount" content="381">
<meta itemprop="keywords" content="Python," />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Python Decorators are Just Wrappers"/>
<meta name="twitter:description" content="Python decorators are just wrappers… that return functions Part of my issue with understanding how decorators work was that I was treating them as a function/class that is returning a variable. I should have been thinking of them as a function/class returning a modified (i.e. decorated) function/class. As mentioned succinctly here, “Decorators are a form of metaprogramming; they enhance the action of the function or method they decorate.” So a decorator is just a wrapper of the function that you want to modify (that returns a function)."/>

    <meta property="og:title" content="Python Decorators are Just Wrappers" />
<meta property="og:description" content="Python decorators are just wrappers… that return functions Part of my issue with understanding how decorators work was that I was treating them as a function/class that is returning a variable. I should have been thinking of them as a function/class returning a modified (i.e. decorated) function/class. As mentioned succinctly here, “Decorators are a form of metaprogramming; they enhance the action of the function or method they decorate.” So a decorator is just a wrapper of the function that you want to modify (that returns a function)." />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://imadali.net/posts/python-decorators-are-just-wrappers/" /><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2020-05-06T02:21:39-07:00" />
<meta property="article:modified_time" content="2020-05-06T02:21:39-07:00" />

    <meta property="article:published_time" content="2020-05-06 02:21:39 -0700 PDT" />

            imad ali

Projects

                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                        <path d="M0 0h24v24H0z" fill="none"/>
                        <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
                    </svg>

            <svg class="theme-toggler" width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
  3C11.5066 3 3 11.5066 3 22C3 32.4934 11.5066 41 22 41ZM7 22C7
  13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"/>
</svg>

                Python Decorators are Just Wrappers

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>2020-05-06

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>2 minutes

Python decorators are just wrappers… that return functions

Part of my issue with understanding how decorators work was that I was treating
them as a function/class that is returning a variable. I should have been
thinking of them as a function/class returning a modified (i.e. decorated)
function/class. As mentioned succinctly
here,
“Decorators are a form of metaprogramming; they enhance the action of the
function or method they decorate.” So a decorator is just a wrapper of the
function that you want to modify (that returns a function).

So if we want to decorate the function func with the function decor then the
sequence of evaluation would be modified_func = decor(func)(func_args).

Before going into what a decorator is, it’s useful to understand what it isn’t.
Casually wrapping a function in another function may not be sufficient. To
Illustrate this I’ve created a function to_decorate (a function that returns
its input divided by 2) that I want to decorate.

def to_decorate(x):
    return(x/2)
to_decorate(2)

The not_decorator function below does not act as a decorator even though it is
a wrapper for to_decorate. The not_decorator function is modifying the
result of to_decorate instead of modifying the to_decorate function itself.
We have to actually evaluate the function that is the argument to
not_decorator. Because we have to evaluate it, the function that is the
argument to not_decorator must also take in an argument. The result is that
this function ends up returning a variable rather than a function/class.

# modifying the output of func so func has to be evaluated not modified
def not_decorator(func):
    return(abs(func))

The code below will error out since the to_decorate function is looking for an
argument.

not_decorated = not_decorator(to_decorate)

Passing an argument will allow it to run, but it’s still not a decorator since
it’s returning a variable instead of a function.

not_decorated = not_decorator(to_decorate(2))
print(not_decorated)

Let’s define the function decorator which takes a function as an input,
evaluates the absolute value of the result of the function (the modification), a
returns a function as opposed to the result.

We have to wrap the modification in the inner wrapper otherwise we won’t be
able to return a function/class. This was the issue with not_decorator()
above.

…

What about modifying a function with multiple decorators?

…

What about passing arguments to decorators?

…

                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>Python

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>381 Words

            &copy 2020 Imad Ali
            Powered by Hugo and Hello Friend NG

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">


text:
<title>
People.co.uk - Port Vale 1 Luton 2
</title>

<link rel="stylesheet" type="text/css" href="http://images.mirror.co.uk/css/people2/format_master.css">

<form name="ISearch1200409787021" action="javascript:void(0)" style="display: inline;">
<input class="x-nc-invisible">

<input class="x-nc-invisible">

<input class="x-nc-invisible">

<input class="x-nc-invisible">

<input class="x-nc-invisible">

Search

<select name="qcat" style="border: medium none ; font-size: 10px;">
<option value="web">
The Web
</option>
<option value="People.co.uk">
People.co.uk
</option>
</select>

for

<input size="47" value="" class="input01" name="query" xmlns="">

<input value="Search" name="image2" src="http://images.mirror.co.uk/design/mirror/go_green.gif" border="0" hspace="5" type="image">

</form>

Home

|

News

|

Sport

|

People Money

|

Showbiz

|

Play for CASH!

|

Dating

|

Motoring

|

More >

Sport

>

Sport Confidential

|

Revved Up

|

You The Manager

|

Betting and Statistics

|

Dave Kidd

30 December 2007

Port Vale 1 Luton 2

Coca Cola FOOTBALL LEAGUE ONE

Matthew Spring's stoppagetime free-kick ruined Joe Anyon's 21st birthday as Luton left Vale at the foot of the table.

Spring struck his 35-yard shot well, but Vale keeper Anyon looked in control until the ball sped inside his left-hand post.

Luton got off to a terrific start with centre-back Jaroslaw Fojut firing them ahead.

Darren Currie's right-wing free-kick found its way to the far post where the Polish youth international struck an unstoppable half-volley past Anyon.

Luton threatened a second when Anyon saved David Edwards' header from point-blank range, but Vale got the tonic they desperately needed in firsthalf stoppage time, when Callum Willock steered his shot home.

Advertisement

Print article

Email to a friend

Sponsored Links

Search For

YOU THE MANAGER

ARE YOU topping the table, or propping up the pile? Check your score now

Advertisement

Fun & Games

|

Gaming

|

Pets & People

|

Competitions

|

Holidays

|

Ticketmaster

|

Leisure Guide

|

Real Life

|

More >

Home

|

News

|

Sport

|

People Money

|

Showbiz

|

Play for CASH!

|

Dating

|

Motoring

|

Fun & Games

|

Gaming

|

Pets & People

|

Competitions

|

Holidays

|

Ticketmaster

|

Leisure Guide

|

Real Life

|

Contact Us

|

Horoscopes

|

Terms and Conditions

|

Privacy Policy

|

Site Map


text:
*************
API Reference
*************

.. toctree::
   :maxdepth: 2

   Wi-Fi <wifi/index>
   Mesh <mesh/index>
   Bluetooth <bluetooth/index>
   Ethernet <ethernet/index>
   Peripherals <peripherals/index>
   Protocols <protocols/index>
   Storage <storage/index>
   System <system/index>
   Configuration Options <kconfig>
   Error Codes Reference <error-codes>


text:
package bnfc.abs.Absyn; // Java Package generated by the BNF Converter.

public class SinglConstrIdent extends ConstrIdent {
  public final String uident_;
  public SinglConstrIdent(String p1) { uident_ = p1; }

  public <R,A> R accept(bnfc.abs.Absyn.ConstrIdent.Visitor<R,A> v, A arg) { return v.visit(this, arg); }

  public boolean equals(Object o) {
    if (this == o) return true;
    if (o instanceof bnfc.abs.Absyn.SinglConstrIdent) {
      bnfc.abs.Absyn.SinglConstrIdent x = (bnfc.abs.Absyn.SinglConstrIdent)o;
      return this.uident_.equals(x.uident_);
    }
    return false;
  }

  public int hashCode() {
    return this.uident_.hashCode();
  }

}


text:
namespace Yupi.Model.Domain
{
    using System;

    public class ClubBuyLayout : DefaultCatalogLayout
    {
        #region Properties

        [Ignore]
        public override string Name
        {
            get {
                return "club_buy";
            }
        }

        #endregion Properties
    }
}


text:
Motif.Page.include("Motif.Data.ColumnCollection.js");

/**
 * The data column object describes a single data item
 * @extends Motif.Object
 * @requires Motif.Object
 * @requires Motif.Data.ColumnCollection
 * @constructor
 * @author Rayraegah
 */
Motif.Data.Column = function(config) {
    /** @ignore */
    Motif.Utility.extend(this, "Motif.Object");
    this.__class.push("Motif.Data.Column");

    /** Reference to a parent column collection object if any @type Motif.Data.ColumnCollection */
    this.parent = null;
    /** Ordinal position @type Number */
    this.ordinal = -1;
    /** Name of the column @type String */
    this.name = "";
    /** Label of the column, a user friendly name @type String */
    this.label = "";
    /** Column description @type String */
    this.description = "";
    /** Datatype of the column @type String */
    this.datatype = "varchar";
    /** Value of the column @type Object */
    this.value = null;
    /** Default value of the column @type Object */
    this.default = null;

    /** Configure this column object @type Motif.Data.ColumnConfig */
    this.configure = function Column_configure(config) {
        config = this.Motif$Object.configure(config);
        if (config.parent) {
            this.parent = config.parent;
        }
        if (Motif.Type.isNumber(config.ordinal)) {
            this.ordinal = config.ordinal;
        }
        if (config.name) {
            this.name = config.name;
        }
        if (config.label) {
            this.label = config.label;
        }
        if (config.description) {
            this.description = config.description;
        }
        if (config.datatype) {
            this.datatype = config.datatype;
        }
        if (config.value) {
            this.value = config.value;
        }
        if (config.default) {
            this.default = config.default;
        }
        return config;
    };

    /** @ignore */
    this.main = function(config) {
        if (config) {
            this.configure(config);
        }
    };
    this.main(config);
};

/**
 * Data column configuration object
 * @constructor
 * @author Rayraegah
 */
Motif.Data.ColumnConfig = function() {
    /** Reference to a parent column collection object if any @type Motif.Data.ColumnCollection */
    this.parent = null;
    /** Ordinal position @type Number */
    this.ordinal = -1;
    /** Name of the column @type String */
    this.name = "";
    /** Label of the column, a user friendly name @type String */
    this.label = "";
    /** Column description @type String */
    this.description = "";
    /** Datatype of the column @type String */
    this.datatype = "";
    /** Value of the column @type Object */
    this.value = null;
}


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

namespace Menu.API.Models
{
    public class Food
    {
        public Guid Id { get; set; }
        [Required]
        public string Name { get; set; }

        public string Description { get; set; }

        public string Recept { get; set; }

        [Required]
        public decimal Price { get; set; }

        public string Currency { get; set; }

        public Guid CategoryId { get; set; }

        public virtual Category Category { get; set; }

        public virtual ICollection<FoodPicture> Pictures { get; set; }
    }
}


text:
<?php namespace Cyvelnet\Laravel5Fractal\Commands;

use Illuminate\Config\Repository as Config;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem as File;
use Illuminate\View\Factory as View;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

/**
 * Class TransformerGeneratorCommand
 *
 * @package Cyvelnet\Laravel5Fractal\Commands
 */
class TransformerGeneratorCommand extends Command
{

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'make:transformer';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new transformer class';
    /**
     * @var
     */
    private $view;
    /**
     * @var
     */
    private $namespace;
    /**
     * @var
     */
    private $directory;
    /**
     * @var Config
     */
    private $config;
    /**
     * @var File
     */
    private $file;

    /**
     * @param View $view
     */
    function __construct(Config $config, View $view, File $file)
    {
        parent::__construct();
        $this->config = $config;
        $this->view = $view;
        $this->file = $file;
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        try {

            // replace all space after ucwords
            $classname = preg_replace('/\s+/', '', ucwords($this->argument('name')));

            //retrieves store directory configuration
            $directory = $this->option('directory') ? $this->appPath($this->option('directory')) : $this->appPath($this->config->get('fractal.directory'));

            //retrieves namespace configuration
            $namespace = $this->option('namespace') ? $this->option('namespace') : $this->config->get('fractal.namespace');
            is_dir($directory) ?: $this->file->makeDirectory($directory, 0755, true);

            $create = true;

            if ($this->file->exists("{$directory}/{$classname}.php")) {
                if ($usrResponse = strtolower($this->ask("The file ['{$classname}'] already exists, overwrite? [y/n]",
                    null))
                ) {
                    switch ($usrResponse) {
                        case 'y' :
                            $tempFileName = "{$directory}/{$classname}.php";

                            $prefix = '_';
                            while ($this->file->exists($tempFileName)) {
                                $prefix .= '_';
                                $tempFileName = "{$directory}/{$prefix}{$classname}.php";
                            }
                            rename("{$directory}/{$classname}.php", $tempFileName);
                            break;
                        default:
                            $this->info('No file has been created.');
                            $create = false;
                    }
                }

            }

            // loading transformers template from views
            $view = $this->view->make('fractal::transformer',
                ['namespace' => $namespace, 'classname' => $classname]);

            if ($create) {
                $this->file->put("{$directory}/{$classname}.php", $view->render());
                $this->info("The class {$classname} generated successfully.");
            }

        } catch (\Exception $e) {
            $this->error('Transformer creation failed.');
        }

    }

    /**
     * get application path
     *
     * @param $path
     *
     * @return string
     */
    private function appPath($path)
    {
        return base_path('/app/' . $path);
    }

    /**
     * @return array
     */
    protected function getArguments()
    {
        return array(
            array('name', InputArgument::REQUIRED, 'Name of the transformer class'),
        );
    }

    /**
     * @return array
     */
    protected function getOptions()
    {

        return array(
            array(
                'directory',
                null,
                InputOption::VALUE_OPTIONAL,
                'transformer store directory (relative to App\)',
                null
            ),
            array(
                'namespace',
                null,
                InputOption::VALUE_OPTIONAL,
                'transformer namespace',
                null
            ),
        );
    }

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool
//     Changes to this file will be lost if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AVM.META
{
	using AVM;
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	public class BehaviorParameter : Interface
	{
		public virtual String Unit
		{
			get;
			set;
		}

		public virtual String ValidRange
		{
			get;
			set;
		}

		public virtual string Value
		{
			get;
			set;
		}

		public virtual Boolean? IsInitialization
		{
			get;
			set;
		}

		public virtual string VarInitialized
		{
			get;
			set;
		}

		public virtual String Description
		{
			get;
			set;
		}

		public virtual String NativeToolUnit
		{
			get;
			set;
		}

		public virtual String Dimension
		{
			get;
			set;
		}

		public virtual String DefaultValue
		{
			get;
			set;
		}

	}
}


text:
layout: blog
---
<% page.title = "Category: ${page.tag?.capitalize()}" %>


text:
layout: post
title: Crazy young slut takes that vibrating dildo and cant control the feelings
titleinfo: pornvd
desc: Watch Crazy young slut takes that vibrating dildo and cant control the feelings. Pornhub is the ultimate xxx porn and sex site.
---

Crazy young slut takes that vibrating dildo and cant control the feelings

Watch Crazy young slut takes that vibrating dildo and cant control the feelings. Pornhub is the ultimate xxx porn and sex site.


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

<project name="gcccompile">

  <condition property="isMac">
    <os family="mac" />
  </condition>

  <target name="skip-if-necessary">
    <condition property="skip.gcc">
      <istrue value="${gcc.executable}"/>
    </condition>
  </target>

  <target name="get-mac-flags" if="isMac" unless="skip.gcc">
    <property name="mac.config.flags" value="-framework Foundation"/>
  </target>

  <target name="get-gnustep-flags" if="gnustep.config.executable" unless="skip.gcc">
    <exec executable="${gnustep.config.executable}" failonerror="true" errorproperty="gnustep.config.error" outputproperty="gnustep.config.flags">
      <arg value="--objc-flags"/>
    </exec>
  </target>

  <target name="get-gnustep-libs" if="gnustep.config.executable" unless="skip.gcc">
    <exec executable="${gnustep.config.executable}" failonerror="true" errorproperty="gnustep.config.error" outputproperty="gnustep.config.libs">
      <arg value="--base-libs"/>
    </exec>
  </target>

  <target name="get-libxml-flags" if="libxml.config.executable" unless="skip.gcc">
    <exec executable="${libxml.config.executable}" failonerror="true" errorproperty="libxml.config.error" outputproperty="libxml.config.flags">
      <arg value="--cflags"/>
    </exec>
  </target>

  <target name="get-libxml-libs" if="libxml.config.executable" unless="skip.gcc">
    <exec executable="${libxml.config.executable}" failonerror="true" errorproperty="libxml.config.error" outputproperty="libxml.config.libs">
      <arg value="--libs"/>
    </exec>
  </target>

  <target name="-gcc" unless="skip.gcc">
    <property name="mac.config.flags" value=""/>
    <property name="gnustep.config.flags" value=""/>
    <property name="gnustep.config.libs" value=""/>
    <property name="libxml.config.flags" value=""/>
    <property name="libxml.config.libs" value=""/>

    <exec executable="${gcc.executable}" failonerror="true" dir="${project.build.directory}">
      <!--include the mac compile flags-->
      <arg line="${mac.config.flags}"/>
      <!--include the gnustep compile flags-->
      <arg line="${gnustep.config.flags}"/>
      <!--include the libxml compile flags-->
      <arg line="${libxml.config.flags}"/>
      <!--report all warnings...-->
      <arg value="-Wall"/>
      <!--...except the unused variable warnings-->
      <arg value="-Wno-unused-variable"/>
      <!--...and the unused function warnings-->
      <arg value="-Wno-unused-function"/>
      <!--count all warnings as errors -->
      <arg value="-Werror"/>
      <arg value="-D DEBUG_ENUNCIATE=2"/>
      <!--include the source directory-->
      <arg value="-I${project.build.directory}/enunciate/gen/obj-c"/>
      <!--output to the file-->
      <arg line="-o ${project.build.directory}/enunciate/gen/obj-c/processxml"/>
      <!--compile this file-->
      <arg value="${project.build.directory}/enunciate/gen/obj-c/processxml.m"/>
      <arg value="${project.build.directory}/enunciate/gen/obj-c/enunciate.m"/>
      <arg value="${project.build.directory}/enunciate/gen/obj-c/enunciate-common.m"/>
      <!--include the gnustep libraries-->
      <arg line="${gnustep.config.libs}"/>
      <!--include the libxml libraries-->
      <arg line="${libxml.config.libs}"/>
    </exec>
  </target>

  <target name="gcc" depends="skip-if-necessary, get-mac-flags, get-gnustep-flags, get-gnustep-libs, get-libxml-flags, get-libxml-libs, -gcc"/>

</project>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates;

/**
 *
 * @author team3574
 */
public class Constants {
    public static final double FLINGER_POWER_SAVING_MODE = 0.4;
    public static final double FLINGER_PYRIMID_SPEED = 0.55;
    public static final double FLINGER_INFIELD_SPEED = 0.8;
    public static final double FLINGER_MID_COURT_PLUS = 1.0;
    public static final double FLINGER_3QUARTS_SPEED = 0.85;
    public static final double FLINGER_OFF = 0.0;

    public static final int BLING_METEOR = 0;
    public static final int BLING_MARCH_RWB = 2;
    public static final int BLING_FADE_PG = 1;
    public static final int BLING_SHOOT = 3;

    public static final int TILT_SCALE = -1350;
    // private static final int TILT_DEGREE_SCALE = TILT_SCALE/70;

    public static final int TILT_3QUARTS_COURT = -614; // Prod(-472); | // 17-1/2 deg -472 at 85%
    public static final int TILT_MID_COURT = -675;// Prod -495; | // 21 deg -589
    public static final int TILT_PYRIMID_BACK = -678;// Prod -585; | // 25 deg -678
    public static final int TILT_PYRIMID_MIDDLE = -800;// Prod -636; | //30 deg
    public static final int TILT_PYRIMID_SIDE_PRACTICE = -678;// Prod(?)
    public static final int TILT_FULL_COURT_PRACTICE = -586;// Prod(?)

    public static final int TILT_PYRIMID_FRONT = -1238;// Prod -1017; | // 35 deg -1057 back of robot 12 feet from wall
    public static final int TILT_PYRIMID_TOP = -1202;// Prod -1280;
    public static final int TILT_FRISBEE_LOAD = -20;// Prod 0;
    public static final int TILT_DRIVE_SAFELY = -163;

    public static final int TILT_DONT_COLLECT = (-500);

    public static final int DEADBAND_LOW_CLOSE = 293; // Make sure the camera is 1/8 inch outside of the frame (what ever that means)
    public static final int DEADBAND_HIGH_CLOSE = 340;
    public static final int DEADBAND_LOW_3QUARTS = 336;
    public static final int DEADBAND_HIGH_3QUARTS = 376;
    public static final int DEADBAND_LOW_HALF = 316;
    public static final int DEADBAND_HIGH_HALF = 334;
     // Put methods for controlling this subsystem
    // here. Call these from Commands.

}


text:
package org.wildfly.swarm.plugin.process;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.CompositeIndex;
import org.jboss.jandex.DotName;
import org.jboss.jandex.IndexReader;
import org.jboss.jandex.IndexView;
import org.jboss.jandex.Indexer;
import org.wildfly.swarm.plugin.FractionMetadata;
import org.wildfly.swarm.plugin.process.configurable.AnnotationDocumentationGatherer;
import org.wildfly.swarm.plugin.process.configurable.DocumentationRegistry;
import org.wildfly.swarm.plugin.process.configurable.ResourceDocumentationGatherer;

/**
 * @author Bob McWhirter
 */
public class ConfigurableDocumentationGenerator {
    public static final DotName FRACTION_CLASS = DotName.createSimple("org.wildfly.swarm.spi.api.Fraction");

    public static final DotName CONFIGURABLE_ANNOTATION = DotName.createSimple("org.wildfly.swarm.spi.api.annotations.Configurable");

    public static final DotName CONFIGURABLES_ANNOTATION = DotName.createSimple("org.wildfly.swarm.spi.api.annotations.Configurables");

    public static final DotName SINGLETON_RESOURCE_ANNOTATION = DotName.createSimple("org.wildfly.swarm.config.runtime.SingletonResource");

    public static final DotName ATTRIBUTE_DOCUMENTATION_ANNOTATION = DotName.createSimple("org.wildfly.swarm.config.runtime.AttributeDocumentation");

    public static final DotName RESOURCE_DOCUMENTATION_ANNOTATION = DotName.createSimple("org.wildfly.swarm.config.runtime.ResourceDocumentation");

    private final Path classesDir;

    private final MavenProject project;

    private final DocumentationRegistry documentationRegistry;

    private final Log log;

    public ConfigurableDocumentationGenerator(Log log, MavenProject project, File classesDir) {
        this.log = log;
        this.project = project;
        this.classesDir = classesDir.toPath();
        this.documentationRegistry = new DocumentationRegistry();
    }

    public FractionMetadata apply(FractionMetadata meta) throws MojoExecutionException {
        if (!meta.hasJavaCode()) {
            return meta;
        }

        if (!Files.exists(this.classesDir)) {
            return meta;
        }

        final Path idx = this.classesDir.resolve("META-INF").resolve(Jandexer.INDEX_NAME);

        if (!Files.exists(idx)) {
            return meta;
        }

        IndexView ownIndex = null;
        IndexView totalIndex = null;
        try {
            ownIndex = loadOwnIndex();
            totalIndex = buildIndex(ownIndex);
        } catch (IOException e) {
            throw new MojoExecutionException("Failed creating Jandex indexes", e);
        }

        process(ownIndex, totalIndex);

        //this.documentationRegistry.dump();
        Properties props = this.documentationRegistry.asProperties();
        props.setProperty("fraction", meta.getName().toLowerCase());

        Path docs = this.classesDir.resolve("META-INF").resolve("configuration-meta.properties");

        try {
            Files.createDirectories(docs.getParent());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        try (OutputStream out = new FileOutputStream(docs.toFile())) {
            props.store(out, "Created by thorntail-fraction-plugin");
        } catch (IOException e) {
            throw new MojoExecutionException("Failed writing configuration-meta.properties", e);
        }

        return meta;
    }

    protected IndexView buildIndex(IndexView ownIndex) throws IOException {
        IndexView dependentIndexes = loadDependentIndexes();

        return CompositeIndex.create(ownIndex, dependentIndexes);
    }

    protected IndexView loadOwnIndex() throws IOException {
        final Path idx = this.classesDir.resolve("META-INF").resolve(Jandexer.INDEX_NAME);

        IndexView index = null;

        if (Files.exists(idx)) {
            try (InputStream in = new FileInputStream(idx.toFile())) {
                index = loadIndex(in);
            }
        }

        return index;
    }

    protected IndexView loadDependentIndexes() throws IOException {
        List<IndexView> indexes = new ArrayList<>();
        for (Artifact artifact : this.project.getArtifacts()) {
            IndexView index = loadIndex(artifact);
            if (index != null) {
                indexes.add(index);
            }
        }
        return CompositeIndex.create(indexes);
    }

    protected IndexView loadIndex(Artifact dep) throws IOException {
        if (dep.getFile() == null) {
            return null;
        }

        return loadDependentIndexFromArchive(dep.getFile());
    }

    protected IndexView loadDependentIndexFromArchive(File archive) throws IOException {
        try (JarFile jar = new JarFile(archive)) {

            ZipEntry entry = jar.getEntry("META-INF/" + Jandexer.INDEX_NAME);
            if (entry != null) {
                return loadIndex(jar.getInputStream(entry));

            }
            Indexer indexer = new Indexer();

            Enumeration<JarEntry> entries = jar.entries();

            while (entries.hasMoreElements()) {
                JarEntry each = entries.nextElement();
                if (each.getName().endsWith(".class") && !each.getName().equals("module-info.class")) {
                    try (InputStream in = jar.getInputStream(each)) {
                        indexer.index(in);
                    }
                }

            }

            return indexer.complete();
        }
    }

    protected IndexView loadIndex(InputStream in) throws IOException {
        IndexReader reader = new IndexReader(in);
        return reader.read();
    }

    protected void process(IndexView ownIndex, IndexView totalIndex) {
        Collection<ClassInfo> fractions = ownIndex.getAllKnownImplementors(FRACTION_CLASS);

        for (ClassInfo fraction : fractions) {
            new ResourceDocumentationGatherer(this.log, this.documentationRegistry, totalIndex, fraction).gather();
        }

        Collection<AnnotationInstance> annos = ownIndex.getAnnotations(CONFIGURABLE_ANNOTATION);

        for (AnnotationInstance anno : annos) {
            AnnotationTarget annoTarget = anno.target();
            if (annoTarget.kind().equals(AnnotationTarget.Kind.FIELD)) {
                ClassInfo declaringClass = annoTarget.asField().declaringClass();
                if (!fractions.contains(declaringClass)) {
                    new AnnotationDocumentationGatherer(this.log, this.documentationRegistry, totalIndex, anno).gather();
                }
            }
        }
    }
}


text:
const test     = require('tap').test
    , testRoot = require('path').resolve(__dirname, '..')
    , bindings = require('bindings')({ module_root: testRoot, bindings: 'bufferworkerpersistent' })
    , crypto   = require('crypto');

test('bufferworkerpersistent', function (t) {
  var worker = bindings.a
    , called = false
    , buf    = crypto.randomBytes(256)
    , bufHex = buf.toString('hex')

  t.type(worker, 'function')

  setTimeout(function () {
    t.ok(called, 'callback fired')
    t.end()
  }, 500)

  worker(200, buf, function (_buf) {
    called = true
    t.ok(Buffer.isBuffer(_buf), 'is buffer arg')
    t.equal(_buf.toString('hex'), bufHex)
  })

  buf = null // unref
})


text:
namespace mojo {
namespace {

const MojoHandleSignals kSignalReadadableWritable =
    MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE;

const MojoHandleSignals kSignalAll = MOJO_HANDLE_SIGNAL_READABLE |
                                     MOJO_HANDLE_SIGNAL_WRITABLE |
                                     MOJO_HANDLE_SIGNAL_PEER_CLOSED;

TEST(SystemImplTest, GetTimeTicksNow) {
  MojoSystemImpl system = MojoSystemImplCreateImpl();
  const MojoTimeTicks start = MojoSystemImplGetTimeTicksNow(system);
  EXPECT_NE(static_cast<MojoTimeTicks>(0), start)
      << "MojoGetTimeTicksNow should return nonzero value";

  // SystemImpl is leaked...
}

TEST(SystemImplTest, BasicMessagePipe) {
  MojoSystemImpl sys0 = MojoSystemImplCreateImpl();
  MojoSystemImpl sys1 = MojoSystemImplCreateImpl();
  EXPECT_NE(sys0, sys1);

  MojoHandle h0, h1;
  MojoHandleSignals sig;
  char buffer[10] = {0};
  uint32_t buffer_size;

  h0 = MOJO_HANDLE_INVALID;
  h1 = MOJO_HANDLE_INVALID;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplCreateMessagePipe(sys0, nullptr, &h0, &h1));
  EXPECT_NE(h0, MOJO_HANDLE_INVALID);
  EXPECT_NE(h1, MOJO_HANDLE_INVALID);

  // Move the other end of the pipe to a different SystemImpl.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplTransferHandle(sys0, h1, sys1, &h1));
  EXPECT_NE(h1, MOJO_HANDLE_INVALID);

  // Shouldn't be readable, we haven't written anything.
  MojoHandleSignalsState state;
  EXPECT_EQ(
      MOJO_RESULT_DEADLINE_EXCEEDED,
      MojoSystemImplWait(sys0, h0, MOJO_HANDLE_SIGNAL_READABLE, 0, &state));
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, state.satisfied_signals);
  EXPECT_EQ(kSignalAll, state.satisfiable_signals);

  // Should be writable.
  EXPECT_EQ(
      MOJO_RESULT_OK,
      MojoSystemImplWait(sys0, h0, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &state));
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, state.satisfied_signals);
  EXPECT_EQ(kSignalAll, state.satisfiable_signals);

  // Last parameter is optional.
  EXPECT_EQ(
      MOJO_RESULT_OK,
      MojoSystemImplWait(sys0, h0, MOJO_HANDLE_SIGNAL_WRITABLE, 0, nullptr));

  // Try to read.
  buffer_size = static_cast<uint32_t>(sizeof(buffer));
  EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
            MojoSystemImplReadMessage(sys0, h0, buffer, &buffer_size, nullptr,
                                      nullptr, MOJO_READ_MESSAGE_FLAG_NONE));

  // Write to |h1|.
  static const char kHello[] = "hello";
  buffer_size = static_cast<uint32_t>(sizeof(kHello));
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplWriteMessage(sys1, h1, kHello, buffer_size, nullptr,
                                       0, MOJO_WRITE_MESSAGE_FLAG_NONE));

  // |h0| should be readable.
  uint32_t result_index = 1;
  MojoHandleSignalsState states[1];
  sig = MOJO_HANDLE_SIGNAL_READABLE;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplWaitMany(sys0, &h0, &sig, 1, MOJO_DEADLINE_INDEFINITE,
                                   &result_index, states));

  EXPECT_EQ(0u, result_index);
  EXPECT_EQ(kSignalReadadableWritable, states[0].satisfied_signals);
  EXPECT_EQ(kSignalAll, states[0].satisfiable_signals);

  // Read from |h0|.
  buffer_size = static_cast<uint32_t>(sizeof(buffer));
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplReadMessage(sys0, h0, buffer, &buffer_size, nullptr,
                                      nullptr, MOJO_READ_MESSAGE_FLAG_NONE));
  EXPECT_EQ(static_cast<uint32_t>(sizeof(kHello)), buffer_size);
  EXPECT_STREQ(kHello, buffer);

  // |h0| should no longer be readable.
  EXPECT_EQ(
      MOJO_RESULT_DEADLINE_EXCEEDED,
      MojoSystemImplWait(sys0, h0, MOJO_HANDLE_SIGNAL_READABLE, 10, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, state.satisfied_signals);
  EXPECT_EQ(kSignalAll, state.satisfiable_signals);

  // Close |h0|.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys0, h0));

  // |h1| should no longer be readable or writable.
  EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
            MojoSystemImplWait(sys1, h1, MOJO_HANDLE_SIGNAL_READABLE |
                                             MOJO_HANDLE_SIGNAL_WRITABLE,
                               1000, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, state.satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, state.satisfiable_signals);

  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys1, h1));

  // 2 SystemImpls are leaked...
}

TEST(SystemImplTest, BasicDataPipe) {
  MojoSystemImpl sys0 = MojoSystemImplCreateImpl();
  MojoSystemImpl sys1 = MojoSystemImplCreateImpl();
  EXPECT_NE(sys0, sys1);

  MojoHandle hp, hc;
  MojoHandleSignals sig;
  char buffer[20] = {0};
  uint32_t buffer_size;
  void* write_pointer;
  const void* read_pointer;

  hp = MOJO_HANDLE_INVALID;
  hc = MOJO_HANDLE_INVALID;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplCreateDataPipe(sys0, nullptr, &hp, &hc));
  EXPECT_NE(hp, MOJO_HANDLE_INVALID);
  EXPECT_NE(hc, MOJO_HANDLE_INVALID);

  // Move the other end of the pipe to a different SystemImpl.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplTransferHandle(sys0, hc, sys1, &hc));
  EXPECT_NE(hc, MOJO_HANDLE_INVALID);

  // The consumer |hc| shouldn't be readable.
  MojoHandleSignalsState state;
  EXPECT_EQ(
      MOJO_RESULT_DEADLINE_EXCEEDED,
      MojoSystemImplWait(sys1, hc, MOJO_HANDLE_SIGNAL_READABLE, 0, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_NONE, state.satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
            state.satisfiable_signals);

  // The producer |hp| should be writable.
  EXPECT_EQ(
      MOJO_RESULT_OK,
      MojoSystemImplWait(sys0, hp, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, state.satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
            state.satisfiable_signals);

  // Try to read from |hc|.
  buffer_size = static_cast<uint32_t>(sizeof(buffer));
  EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
            MojoSystemImplReadData(sys1, hc, buffer, &buffer_size,
                                   MOJO_READ_DATA_FLAG_NONE));

  // Try to begin a two-phase read from |hc|.
  read_pointer = nullptr;
  EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
            MojoSystemImplBeginReadData(sys1, hc, &read_pointer, &buffer_size,
                                        MOJO_READ_DATA_FLAG_NONE));

  // Write to |hp|.
  static const char kHello[] = "hello ";
  // Don't include terminating null.
  buffer_size = static_cast<uint32_t>(strlen(kHello));
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplWriteData(sys0, hp, kHello, &buffer_size,
                                    MOJO_WRITE_MESSAGE_FLAG_NONE));

  // |hc| should be(come) readable.
  uint32_t result_index = 1;
  MojoHandleSignalsState states[1];
  sig = MOJO_HANDLE_SIGNAL_READABLE;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplWaitMany(sys1, &hc, &sig, 1, MOJO_DEADLINE_INDEFINITE,
                                   &result_index, states));

  EXPECT_EQ(0u, result_index);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, states[0].satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
            states[0].satisfiable_signals);

  // Do a two-phase write to |hp|.
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplBeginWriteData(sys0, hp, &write_pointer, &buffer_size,
                                         MOJO_WRITE_DATA_FLAG_NONE));
  static const char kWorld[] = "world";
  ASSERT_GE(buffer_size, sizeof(kWorld));
  // Include the terminating null.
  memcpy(write_pointer, kWorld, sizeof(kWorld));
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplEndWriteData(sys0, hp,
                                       static_cast<uint32_t>(sizeof(kWorld))));

  // Read one character from |hc|.
  memset(buffer, 0, sizeof(buffer));
  buffer_size = 1;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplReadData(sys1, hc, buffer, &buffer_size,
                                   MOJO_READ_DATA_FLAG_NONE));

  // Close |hp|.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys0, hp));

  // |hc| should still be readable.
  EXPECT_EQ(
      MOJO_RESULT_OK,
      MojoSystemImplWait(sys1, hc, MOJO_HANDLE_SIGNAL_READABLE, 0, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
            state.satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
            state.satisfiable_signals);

  // Do a two-phase read from |hc|.
  read_pointer = nullptr;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplBeginReadData(sys1, hc, &read_pointer, &buffer_size,
                                        MOJO_READ_DATA_FLAG_NONE));
  ASSERT_LE(buffer_size, sizeof(buffer) - 1);
  memcpy(&buffer[1], read_pointer, buffer_size);
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplEndReadData(sys1, hc, buffer_size));
  EXPECT_STREQ("hello world", buffer);

  // |hc| should no longer be readable.
  EXPECT_EQ(
      MOJO_RESULT_FAILED_PRECONDITION,
      MojoSystemImplWait(sys1, hc, MOJO_HANDLE_SIGNAL_READABLE, 1000, &state));

  EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, state.satisfied_signals);
  EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, state.satisfiable_signals);

  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys1, hc));

  // TODO(vtl): Test the other way around -- closing the consumer should make
  // the producer never-writable?

  // 2 SystemImpls are leaked...
}

TEST(SystemImplTest, BasicSharedBuffer) {
  MojoSystemImpl sys0 = MojoSystemImplCreateImpl();
  MojoSystemImpl sys1 = MojoSystemImplCreateImpl();
  EXPECT_NE(sys0, sys1);

  MojoHandle h0, h1;
  void* pointer;

  // Create a shared buffer (|h0|).
  h0 = MOJO_HANDLE_INVALID;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplCreateSharedBuffer(sys0, nullptr, 100, &h0));
  EXPECT_NE(h0, MOJO_HANDLE_INVALID);

  // Map everything.
  pointer = nullptr;
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplMapBuffer(sys0, h0, 0, 100, &pointer,
                                                    MOJO_MAP_BUFFER_FLAG_NONE));
  ASSERT_TRUE(pointer);
  static_cast<char*>(pointer)[50] = 'x';

  // Duplicate |h0| to |h1|.
  h1 = MOJO_HANDLE_INVALID;
  EXPECT_EQ(MOJO_RESULT_OK,
            MojoSystemImplDuplicateBufferHandle(sys0, h0, nullptr, &h1));
  EXPECT_NE(h1, MOJO_HANDLE_INVALID);

  // Move the other end of the pipe to a different SystemImpl.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplTransferHandle(sys0, h1, sys1, &h1));
  EXPECT_NE(h1, MOJO_HANDLE_INVALID);

  // Close |h0|.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys0, h0));

  // The mapping should still be good.
  static_cast<char*>(pointer)[51] = 'y';

  // Unmap it.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplUnmapBuffer(sys0, pointer));

  // Map half of |h1|.
  pointer = nullptr;
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplMapBuffer(sys1, h1, 50, 50, &pointer,
                                                    MOJO_MAP_BUFFER_FLAG_NONE));
  ASSERT_TRUE(pointer);

  // It should have what we wrote.
  EXPECT_EQ('x', static_cast<char*>(pointer)[0]);
  EXPECT_EQ('y', static_cast<char*>(pointer)[1]);

  // Unmap it.
  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplUnmapBuffer(sys1, pointer));

  EXPECT_EQ(MOJO_RESULT_OK, MojoSystemImplClose(sys1, h1));

  // 2 SystemImpls are leaked...
}

}  // namespace
}  // namespace mojo


text:
<?php
// Copyright (c) 2016 Syndicate Plus B.V.

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

namespace Syndy\Api\Contracts\Manufacturer;

require_once dirname(__FILE__)."/../basecontract.class.php";

use Syndy\Api\Contracts;

class ManufacturerSummary extends Contracts\BaseContract {

	protected $id;

	protected $name;

	public function __construct($rawData) {
		$this->parse($rawData);
	}

	protected function parse($rawData) {
		$rawData = parent::parse($rawData);

		$this->id = $rawData->Id;
		$this->name = $rawData->Name;
	}

	public function getId() {
		return $this->id;
	}

	public function getName() {
		return $this->name;
	}
}
?>


text:
<?php
class RecruitVacancy extends Eloquent {
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'recruit_vacancies';

	/**
	 * The attributes that aren't mass assignable.
	 *
	 * @var array
	 */
	protected $guarded = array('_token');
}


text:
#ifndef SMIL_UTILITIES_H
#define SMIL_UTILITIES_H

#include <iostream>

#include "llvm/Transforms/Utils/BuildLibCalls.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"

#include "ObjectType.h"

using namespace std;
using namespace llvm;

void Assert(string err, int line, int col, bool shouldExit = true);

void CreateInvalidBinopAssertion(Module *M, IRBuilder<> &B, int line, int col, bool shouldExit = true);

/* Module *M = [...]; IRBuilder<> B = [...]; Value *CondV = [...];
 * CreateAssert(CondV,
 *              B.CreateGlobalString("this should be true", "SMILTrueAssertMessage"),
 *              M, B, 123, 34);
 */
void CreateAssert(Value *CondV, Value *ErrMsgV, Module *M, IRBuilder<> &B, int line, int col, bool shouldExit = true);

void CreateWarning(Value *WarningMsgV, Module *M, IRBuilder<> &B, int line, int col, bool shouldExit = false);

/*
 * Call "IRBuilder::CreateMemCpy()" but remove the "readonly" attribute
 *   for the second argument (src), clang don't like it when creating a.out (tested on 3.3)
 *   ("error: invalid use of function-only attribute: readonly")
 *                                                    ^
 * The default declaration:
 *   void @llvm.memcpy.xxx(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
 * becomes this one:
 *   void @llvm.memcpy.xxx(i8* nocapture, i8* nocapture , i64, i32, i1)
 */
void MemCpy(Value *DestV, Value *SrcV, Value *Size, Module *M, IRBuilder<> &B, unsigned align = 8);

Value * Strlen(Value *StrV, Module *M, IRBuilder<> &B);

Value * StrToInt64(Value *StrV, Module *M, IRBuilder<> &B);

Value * StrToInt32(Value *StrV, Module *M, IRBuilder<> &B);

Value * Atoi(Value *StrV, Module *M, IRBuilder<> &B);

Value * Strxch(Value *StrV, Value *Occurence, Module *M, IRBuilder<> &B);

Value * CxxStrToVal(string &str, Module *M, IRBuilder<> &B);

Value * ObjToStr(Value *Obj, Module *M, IRBuilder<> &B);

Value * ObjToInt64(Value *Obj, Module *M, IRBuilder<> &B);

Value * ValToObj(Value *Val, Module *M, IRBuilder<> &B);

#endif // SMIL_UTILITIES_H


text:
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CodeFixes.Iterator;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.Iterator
{
    [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.ChangeToYield), Shared]
    internal class CSharpAddYieldCodeFixProvider : AbstractIteratorCodeFixProvider
    {
        /// <summary>
        /// CS0029: Cannot implicitly convert from type 'x' to 'y'
        /// </summary>
        private const string CS0029 = nameof(CS0029);

        /// <summary>
        /// CS0266: Cannot implicitly convert from type 'x' to 'y'. An explicit conversion exists (are you missing a cast?)
        /// </summary>
        private const string CS0266 = nameof(CS0266);

        public override ImmutableArray<string> FixableDiagnosticIds
        {
            get { return ImmutableArray.Create(CS0029, CS0266); }
        }

        protected override async Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
        {
            // Check if node is return statement
            if (!node.IsKind(SyntaxKind.ReturnStatement))
            {
                return null;
            }

            var returnStatement = node as ReturnStatementSyntax;
            var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
            if (!TryGetMethodReturnType(node, model, cancellationToken, out var methodReturnType))
            {
                return null;
            }

            if (!TryGetExpressionType(model, returnStatement.Expression, out var returnExpressionType))
            {
                return null;
            }

            var typeArguments = methodReturnType.GetAllTypeArguments();

            var shouldOfferYieldReturn = typeArguments.Length != 1 ?
                IsCorrectTypeForYieldReturn(returnExpressionType, methodReturnType, model) :
                IsCorrectTypeForYieldReturn(typeArguments.Single(), returnExpressionType, methodReturnType, model);

            if (!shouldOfferYieldReturn)
            {
                return null;
            }

            var yieldStatement = SyntaxFactory.YieldStatement(
                    SyntaxKind.YieldReturnStatement,
                    returnStatement.Expression)
                .WithAdditionalAnnotations(Formatter.Annotation);

            root = root.ReplaceNode(returnStatement, yieldStatement);
            return new MyCodeAction(CSharpFeaturesResources.Replace_return_with_yield_return, document.WithSyntaxRoot(root));
        }

        private bool TryGetExpressionType(SemanticModel model, ExpressionSyntax expression, out ITypeSymbol returnExpressionType)
        {
            var info = model.GetTypeInfo(expression);
            returnExpressionType = info.Type;
            return returnExpressionType != null;
        }

        private bool TryGetMethodReturnType(SyntaxNode node, SemanticModel model, CancellationToken cancellationToken, out ITypeSymbol methodReturnType)
        {
            methodReturnType = null;
            var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
            var method = symbol as IMethodSymbol;
            if (method == null || method.ReturnsVoid)
            {
                return false;
            }

            methodReturnType = method.ReturnType;
            return methodReturnType != null;
        }

        private bool IsCorrectTypeForYieldReturn(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model)
        {
            var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName);
            var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName);
            var ienumerableGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName);
            var ienumeratorGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName);

            if (ienumerableGenericSymbol == null ||
                ienumerableSymbol == null ||
                ienumeratorGenericSymbol == null ||
                ienumeratorSymbol == null)
            {
                return false;
            }

            ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(typeArgument);
            ienumeratorGenericSymbol = ienumeratorGenericSymbol.Construct(typeArgument);

            if (!CanConvertTypes(typeArgument, returnExpressionType, model))
            {
                return false;
            }

            if (!(methodReturnType.Equals(ienumerableGenericSymbol) ||
                  methodReturnType.Equals(ienumerableSymbol) ||
                  methodReturnType.Equals(ienumeratorGenericSymbol) ||
                  methodReturnType.Equals(ienumeratorSymbol)))
            {
                return false;
            }

            return true;
        }

        private bool CanConvertTypes(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, SemanticModel model)
        {
            // return false if there is no conversion for the top level type
            if (!model.Compilation.ClassifyConversion(typeArgument, returnExpressionType).Exists)
            {
                return false;
            }

            // Classify conversion does not consider type parameters on its own so we will have to recurse through them
            var leftArguments = typeArgument.GetTypeArguments();
            var rightArguments = returnExpressionType.GetTypeArguments();

            // If we have a mismatch in the number of type arguments we can immediately return as there is no way the types are convertible
            if ((leftArguments != null && rightArguments != null) &&
                leftArguments.Length != rightArguments.Length)
            {
                return false;
            }

            // If there are no more type arguments we assume they are convertible since the outer generic types are convertible
            if (leftArguments == null || !leftArguments.Any())
            {
                return true;
            }

            // Check if all the type arguments are convertible
            for (int i = 0; i < leftArguments.Length; i++)
            {
                if (!CanConvertTypes(leftArguments[i], rightArguments[i], model))
                {
                    return false;
                }
            }

            // Type argument comparisons have all succeeded, return true
            return true;
        }

        private bool IsCorrectTypeForYieldReturn(ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model)
        {
            var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName);
            var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName);

            if (ienumerableSymbol == null ||
                    ienumeratorSymbol == null)
            {
                return false;
            }

            if (!(methodReturnType.Equals(ienumerableSymbol) ||
                  methodReturnType.Equals(ienumeratorSymbol)))
            {
                return false;
            }

            return true;
        }

        protected override bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode node)
        {
            node = null;
            var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
            if (!ancestors.Any())
            {
                return false;
            }

            node = ancestors.FirstOrDefault((n) => n.Span.Contains(span) && n != root && n.IsKind(SyntaxKind.ReturnStatement));
            return node != null;
        }

        private class MyCodeAction : CodeAction.DocumentChangeAction
        {
            public MyCodeAction(string title, Document newDocument) :
                base(title, c => Task.FromResult(newDocument))
            {
            }
        }
    }
}


text:
  /**
   * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
   * @param {Function} function Function to convert to an asynchronous function.
   * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
   * @param {Mixed} [context] The context for the func parameter to be executed.  If not specified, defaults to undefined.
   * @returns {Function} Asynchronous function.
   */
  var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
    isScheduler(scheduler) || (scheduler = timeoutScheduler);
    return function () {
      var args = arguments,
        subject = new AsyncSubject();

      scheduler.schedule(function () {
        var result;
        try {
          result = func.apply(context, args);
        } catch (e) {
          subject.onError(e);
          return;
        }
        subject.onNext(result);
        subject.onCompleted();
      });
      return subject.asObservable();
    };
  };