text:
.class Landroid/hardware/scontext/SContextService$1;
.super Ljava/lang/Object;
.source "SContextService.java"

# interfaces
.implements Landroid/hardware/contextaware/CAListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/hardware/scontext/SContextService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/hardware/scontext/SContextService;

# direct methods
.method constructor <init>(Landroid/hardware/scontext/SContextService;)V
    .locals 0
    .parameter

    .prologue
    .line 510
    iput-object p1, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onContextChanged(Landroid/hardware/contextaware/CAEvent;)V
    .locals 7
    .parameter "event"

    .prologue
    const/4 v6, 0x1

    .line 513
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->GESTURE_APPROACH:I

    if-ne v4, v5, :cond_2

    .line 514
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mIsScreenOn:Z
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$200(Landroid/hardware/scontext/SContextService;)Z

    move-result v4

    if-nez v4, :cond_0

    .line 515
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #calls: Landroid/hardware/scontext/SContextService;->setLEDNotification(Z)V
    invoke-static {v4, v6}, Landroid/hardware/scontext/SContextService;->access$300(Landroid/hardware/scontext/SContextService;Z)V

    .line 517
    :cond_0
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextApproachContext:Landroid/hardware/scontext/SContextContexts$SContextApproachContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$400(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextApproachContext;

    move-result-object v4

    iput v6, v4, Landroid/hardware/scontext/SContextContexts$SContextApproachContext;->mApproach:I

    .line 518
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    iget-object v5, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextApproachContext:Landroid/hardware/scontext/SContextContexts$SContextApproachContext;
    invoke-static {v5}, Landroid/hardware/scontext/SContextService;->access$400(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextApproachContext;

    move-result-object v5

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v6, v5}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    .line 543
    :cond_1
    :goto_0
    return-void

    .line 519
    :cond_2
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->PEDOMETER:I

    if-ne v4, v5, :cond_3

    .line 520
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getPedometerContext()Landroid/hardware/contextaware/CAPedometerContext;

    move-result-object v3

    .line 521
    .local v3, pedometerContext:Landroid/hardware/contextaware/CAPedometerContext;
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v4

    invoke-virtual {v3}, Landroid/hardware/contextaware/CAPedometerContext;->getStepCount()J

    move-result-wide v5

    iput-wide v5, v4, Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;->mStepCount:J

    .line 522
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v4

    invoke-virtual {v3}, Landroid/hardware/contextaware/CAPedometerContext;->getCalorie()D

    move-result-wide v5

    iput-wide v5, v4, Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;->mCalorie:D

    .line 523
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v4

    invoke-virtual {v3}, Landroid/hardware/contextaware/CAPedometerContext;->getDistance()D

    move-result-wide v5

    iput-wide v5, v4, Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;->mDistance:D

    .line 524
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v4

    invoke-virtual {v3}, Landroid/hardware/contextaware/CAPedometerContext;->getSpeed()D

    move-result-wide v5

    iput-wide v5, v4, Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;->mSpeed:D

    .line 525
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v4

    invoke-virtual {v3}, Landroid/hardware/contextaware/CAPedometerContext;->getStepStatus()I

    move-result v5

    iput v5, v4, Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;->mStepStatus:I

    .line 526
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    const/4 v5, 0x2

    iget-object v6, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextPedometerContext:Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;
    invoke-static {v6}, Landroid/hardware/scontext/SContextService;->access$600(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextPedometerContext;

    move-result-object v6

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v5, v6}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    goto :goto_0

    .line 527
    .end local v3           #pedometerContext:Landroid/hardware/contextaware/CAPedometerContext;
    :cond_3
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->STEP_COUNT_ALERT:I

    if-ne v4, v5, :cond_4

    .line 528
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextStepCountAlertContext:Landroid/hardware/scontext/SContextContexts$SContextStepCountAlertContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$700(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextStepCountAlertContext;

    move-result-object v4

    iput v6, v4, Landroid/hardware/scontext/SContextContexts$SContextStepCountAlertContext;->mAlert:I

    .line 529
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    const/4 v5, 0x3

    iget-object v6, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextStepCountAlertContext:Landroid/hardware/scontext/SContextContexts$SContextStepCountAlertContext;
    invoke-static {v6}, Landroid/hardware/scontext/SContextService;->access$700(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextStepCountAlertContext;

    move-result-object v6

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v5, v6}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    goto :goto_0

    .line 530
    :cond_4
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->MOTION:I

    if-ne v4, v5, :cond_5

    .line 531
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getMotionContext()Landroid/hardware/contextaware/CAMotionContext;

    move-result-object v1

    .line 532
    .local v1, motionContext:Landroid/hardware/contextaware/CAMotionContext;
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextMotionContext:Landroid/hardware/scontext/SContextContexts$SContextMotionContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$800(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextMotionContext;

    move-result-object v4

    invoke-virtual {v1}, Landroid/hardware/contextaware/CAMotionContext;->getType()I

    move-result v5

    iput v5, v4, Landroid/hardware/scontext/SContextContexts$SContextMotionContext;->mType:I

    .line 533
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    const/4 v5, 0x4

    iget-object v6, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextMotionContext:Landroid/hardware/scontext/SContextContexts$SContextMotionContext;
    invoke-static {v6}, Landroid/hardware/scontext/SContextService;->access$800(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextMotionContext;

    move-result-object v6

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v5, v6}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    goto/16 :goto_0

    .line 534
    .end local v1           #motionContext:Landroid/hardware/contextaware/CAMotionContext;
    :cond_5
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->MOVEMENT:I

    if-ne v4, v5, :cond_6

    .line 535
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getMovementContext()Landroid/hardware/contextaware/CAMovementContext;

    move-result-object v2

    .line 536
    .local v2, movementContext:Landroid/hardware/contextaware/CAMovementContext;
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextMovementContext:Landroid/hardware/scontext/SContextContexts$SContextMovementContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$900(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextMovementContext;

    move-result-object v4

    invoke-virtual {v2}, Landroid/hardware/contextaware/CAMovementContext;->getAction()I

    move-result v5

    iput v5, v4, Landroid/hardware/scontext/SContextContexts$SContextMovementContext;->mAction:I

    .line 537
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    const/4 v5, 0x5

    iget-object v6, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextMovementContext:Landroid/hardware/scontext/SContextContexts$SContextMovementContext;
    invoke-static {v6}, Landroid/hardware/scontext/SContextService;->access$900(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextMovementContext;

    move-result-object v6

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v5, v6}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    goto/16 :goto_0

    .line 538
    .end local v2           #movementContext:Landroid/hardware/contextaware/CAMovementContext;
    :cond_6
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getEvent()I

    move-result v4

    sget v5, Landroid/hardware/contextaware/CAEvent;->AUTO_ROTATION:I

    if-ne v4, v5, :cond_1

    .line 539
    invoke-virtual {p1}, Landroid/hardware/contextaware/CAEvent;->getAutoRotationContext()Landroid/hardware/contextaware/CAAutoRotationContext;

    move-result-object v0

    .line 540
    .local v0, autoRotationContext:Landroid/hardware/contextaware/CAAutoRotationContext;
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextAutoRotationContext:Landroid/hardware/scontext/SContextContexts$SContextAutoRotationContext;
    invoke-static {v4}, Landroid/hardware/scontext/SContextService;->access$1000(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextAutoRotationContext;

    move-result-object v4

    invoke-virtual {v0}, Landroid/hardware/contextaware/CAAutoRotationContext;->getAngle()I

    move-result v5

    iput v5, v4, Landroid/hardware/scontext/SContextContexts$SContextAutoRotationContext;->mAngle:I

    .line 541
    iget-object v4, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    const/4 v5, 0x6

    iget-object v6, p0, Landroid/hardware/scontext/SContextService$1;->this$0:Landroid/hardware/scontext/SContextService;

    #getter for: Landroid/hardware/scontext/SContextService;->mSContextAutoRotationContext:Landroid/hardware/scontext/SContextContexts$SContextAutoRotationContext;
    invoke-static {v6}, Landroid/hardware/scontext/SContextService;->access$1000(Landroid/hardware/scontext/SContextService;)Landroid/hardware/scontext/SContextContexts$SContextAutoRotationContext;

    move-result-object v6

    #calls: Landroid/hardware/scontext/SContextService;->updateSContext(ILandroid/hardware/scontext/ISContextContexts;)V
    invoke-static {v4, v5, v6}, Landroid/hardware/scontext/SContextService;->access$500(Landroid/hardware/scontext/SContextService;ILandroid/hardware/scontext/ISContextContexts;)V

    goto/16 :goto_0
.end method


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="e6e2f63a-efcd-4e45-94e8-6eb494a2464d">
		<InternalInfo>
			<xr:GeneratedType name="CatalogObject.ФорматыМагазинов" category="Object">
				<xr:TypeId>56604316-c2ed-4015-845e-f877222524e4</xr:TypeId>
				<xr:ValueId>093dfc77-ee54-499f-96e0-0d7fdf8e5b44</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogRef.ФорматыМагазинов" category="Ref">
				<xr:TypeId>b726a797-8990-4213-aeb7-f9a1ceebde16</xr:TypeId>
				<xr:ValueId>34785565-c8a5-41c3-8926-7b178b129cd6</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogSelection.ФорматыМагазинов" category="Selection">
				<xr:TypeId>501a6ceb-188b-4ec0-9b4c-8c91b7d20d61</xr:TypeId>
				<xr:ValueId>1af8490b-5640-4078-8285-ee03ff1b1982</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogList.ФорматыМагазинов" category="List">
				<xr:TypeId>dfd4d7e4-1e17-4821-a1f4-8e426d596ea9</xr:TypeId>
				<xr:ValueId>e79a6abe-e6ff-4e92-bc0b-8dfdf897f44d</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogManager.ФорматыМагазинов" category="Manager">
				<xr:TypeId>e33e7a38-6bf9-4d9b-8058-106b775730f2</xr:TypeId>
				<xr:ValueId>d70eec1c-1316-4299-9610-c75d7f590978</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>true</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>Variable</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>
						<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:Link>
							<xr:Name>Отбор.Владелец</xr:Name>
							<xr:DataPath xsi:type="xs:string">Catalog.ФорматыМагазинов.StandardAttribute.Owner</xr:DataPath>
							<xr:ValueChange>Clear</xr:ValueChange>
						</xr:Link>
					</xr:ChoiceParameterLinks>
					<xr:FillValue xsi:type="xr:DesignTimeRef">02195ea8-8f28-4c00-843e-6a5567871c75.00000000-0000-0000-0000-000000000000</xr:FillValue>
					<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/>
					<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="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:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
			</StandardAttributes>
			<Characteristics/>
			<PredefinedDataUpdate>Auto</PredefinedDataUpdate>
			<EditType>InDialog</EditType>
			<QuickChoice>false</QuickChoice>
			<ChoiceMode>BothWays</ChoiceMode>
			<InputByString>
				<xr:Field>Catalog.ФорматыМагазинов.StandardAttribute.Description</xr:Field>
			</InputByString>
			<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
			<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
			<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
			<DefaultObjectForm>Catalog.ФорматыМагазинов.Form.ФормаЭлемента</DefaultObjectForm>
			<DefaultFolderForm>Catalog.ФорматыМагазинов.Form.ФормаГруппы</DefaultFolderForm>
			<DefaultListForm>Catalog.ФорматыМагазинов.Form.ФормаСписка</DefaultListForm>
			<DefaultChoiceForm>Catalog.ФорматыМагазинов.Form.ФормаВыбора</DefaultChoiceForm>
			<DefaultFolderChoiceForm/>
			<AuxiliaryObjectForm/>
			<AuxiliaryFolderForm/>
			<AuxiliaryListForm/>
			<AuxiliaryChoiceForm/>
			<AuxiliaryFolderChoiceForm/>
			<IncludeHelpInContents>true</IncludeHelpInContents>
			<BasedOn/>
			<DataLockFields/>
			<DataLockControlMode>Automatic</DataLockControlMode>
			<FullTextSearch>Use</FullTextSearch>
			<ObjectPresentation/>
			<ExtendedObjectPresentation/>
			<ListPresentation/>
			<ExtendedListPresentation/>
			<Explanation/>
			<CreateOnInput>Use</CreateOnInput>
			<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
		</Properties>
		<ChildObjects>
			<Attribute uuid="6993d8b1-3eb3-49eb-a450-eb8685ebab59">
				<Properties>
					<Name>ПлощадьТорговогоЗалаМинимальная</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Площадь торгового зала минимальная</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>10</v8:Digits>
							<v8:FractionDigits>0</v8:FractionDigits>
							<v8:AllowedSign>Nonnegative</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<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>
			<Attribute uuid="7ba96c68-45f4-4dbd-9b32-a69176ac0191">
				<Properties>
					<Name>ПлощадьТорговогоЗалаМаксимальная</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Площадь торгового зала максимальная</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>10</v8:Digits>
							<v8:FractionDigits>0</v8:FractionDigits>
							<v8:AllowedSign>Nonnegative</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<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>
			<Attribute uuid="91e40019-9610-4110-bfe5-665a68b596fc">
				<Properties>
					<Name>КоличествоАссортиментныхПозиций</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Количество ассортиментных позиций</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>10</v8:Digits>
							<v8:FractionDigits>0</v8:FractionDigits>
							<v8:AllowedSign>Nonnegative</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<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>
			<Attribute uuid="5c115b67-aebc-4899-9caa-a03e3618a0a0">
				<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>100</v8:Length>
							<v8:AllowedLength>Variable</v8:AllowedLength>
						</v8:StringQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</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>
			<Attribute uuid="39df1095-a848-4bd3-948e-6a4ec548ee7a">
				<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>100</v8:Length>
							<v8:AllowedLength>Variable</v8:AllowedLength>
						</v8:StringQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</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>
			<Attribute uuid="0ad01548-1b0b-4dc9-93a1-c2840ed57924">
				<Properties>
					<Name>РозничныйВидЦены</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Розничный вид цены</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.ВидыЦен</v8:Type>
					</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>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters>
						<app:item name="Отбор.ИспользоватьПриПродаже">
							<app:value xsi:type="xs:boolean">true</app:value>
						</app:item>
					</ChoiceParameters>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Use>ForItem</Use>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="711d11db-9cdb-4ae6-9d5d-697f9b8c1fa1">
				<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/>
					<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>
			<Form>ФормаВыбора</Form>
			<Form>ФормаГруппы</Form>
			<Form>РазблокированиеРеквизитов</Form>
		</ChildObjects>
	</Catalog>
</MetaDataObject>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Magento\Framework\Event\Test\Unit\Config;

class SchemaLocatorTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Framework\App\ResourceConnection\Config\SchemaLocator
     */
    protected $model;

    /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */
    protected $urnResolver;

    /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */
    protected $urnResolverMock;

    protected function setUp()
    {
        $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
        $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false);
        $this->model = new \Magento\Framework\Event\Config\SchemaLocator($this->urnResolverMock);
    }

    public function testGetSchema()
    {
        $this->urnResolverMock->expects($this->once())
            ->method('getRealPath')
            ->with('urn:magento:framework:Event/etc/events.xsd')
            ->willReturn(
                $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd')
            );
        $this->assertEquals(
            $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'),
            $this->model->getSchema()
        );
    }

    public function testGetPerFileSchema()
    {
        $this->urnResolverMock->expects($this->once())
            ->method('getRealPath')
            ->with('urn:magento:framework:Event/etc/events.xsd')
            ->willReturn(
                $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd')
            );
        $this->assertEquals(
            $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'),
            $this->model->getPerFileSchema()
        );
    }
}


text:
namespace base {
class CommandLine;
class FilePath;
}  // namespace base

namespace mojo {
class PlatformChannelEndpoint;
}  // namespace mojo

// Contains the common functionalities between the various POSIX child process
// launcher implementations.

namespace content {

class PosixFileDescriptorInfo;

namespace internal {

std::unique_ptr<PosixFileDescriptorInfo> CreateDefaultPosixFilesToMap(
    int child_process_id,
    const mojo::PlatformChannelEndpoint& mojo_channel_remote_endpoint,
    std::map<std::string, base::FilePath> files_to_preload,
    const std::string& process_type,
    base::CommandLine* command_line);

// Opens the file in read mode at the given path. Note that the path should be
// relative and the way it is resolved is platform specific.
// |region| is set to the region of the file that should be read.
base::File OpenFileToShare(const base::FilePath& path,
                           base::MemoryMappedFile::Region* region);

}  // namespace internal

}  // namespace content

#endif  // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_


text:
class TopicsController < InheritedResources::Base
  include ForumEngine::Controllers::TopicsController
end


text:
set -e

# Include definitions of dataset and tuning related variables.
source "$(dirname $0)/../../lib/setup.sh" "$@"
source_lib "config/common.sh"
source_lib "config/tuning.sh"
source_lib "config/ptb_word.sh"

# Model

num_params=$(million 24)
share_input_and_output_embeddings=true
cap_input_gate=false
shared_mask_dropout=true

# Cell

model="lstm"
num_layers=3
lstm_skip_connection=false
tie_forget_and_input_gates=false

# Objective

drop_state_probability=0.01

# Initialization

forget_bias=0.0

# Schedule

steps_per_turn=100
print_training_stats_every_num_steps=100
turns=600

# Optimizer

# In the loss, the pytorch code (https://github.com/zihangdai/mos) averages all
# log probabilities in the [batch_size, max_time_steps] matrix, while lamb sums
# the log probabilities over time steps and averages only over the examples in
# the batch. To compensate for that, max_grad_norm, learning_rate and l2_penalty
# had to be adjusted.
max_time_steps=70
max_grad_norm=10.0
trigger_averaging_turns=25
trigger_averaging_at_the_latest=400

# Early stopping

early_stopping_turns=30
early_stopping_worst_xe_target=4.4

# Evaluation

max_training_eval_batches=20
eval_softmax_temperature=-0.8

# Misc

swap_memory=true

# Tuning parameters

num_workers=60

# SGD
optimizer_type="sgd"
mos_num_components=0
tuneables="batch_size,learning_rate,l2_penalty,
  token_dropout,input_dropout,inter_layer_dropout,state_dropout,
  output_dropout,downprojected_output_dropout,input_embedding_ratio"
name="$(default_name)_${model}_d${num_layers}_asgd"
source_lib "run.sh" "$@"

# RMSPROP
optimizer_type="rmsprop"
mos_num_components=0
tuneables="batch_size,learning_rate,l2_penalty,
  token_dropout,input_dropout,inter_layer_dropout,state_dropout,
  output_dropout,downprojected_output_dropout,input_embedding_ratio"
name="$(default_name)_${model}_d${num_layers}_arms"
source_lib "run.sh" "$@"

# SGD, MoS
optimizer_type="sgd"
mos_num_components=15
tuneables="batch_size,learning_rate,l2_penalty,
  token_dropout,input_dropout,inter_layer_dropout,state_dropout,
  output_dropout,downprojected_output_dropout,input_embedding_ratio"
name="$(default_name)_${model}_d${num_layers}_asgd_mos${mos_num_components}"
source_lib "run.sh" "$@"

# RMSPROP, MoS
optimizer_type="rmsprop"
mos_num_components=15
tuneables="batch_size,learning_rate,l2_penalty,
  token_dropout,input_dropout,inter_layer_dropout,state_dropout,
  output_dropout,downprojected_output_dropout,input_embedding_ratio"
name="$(default_name)_${model}_d${num_layers}_arms_mos${mos_num_components}"
source_lib "run.sh" "$@"


text:
#include <linux/spinlock.h>
#include <linux/nmi.h>
#include <linux/interrupt.h>
#include <linux/debug_locks.h>
#include <linux/delay.h>
#include <linux/module.h>

void __spin_lock_init(spinlock_t *lock, const char *name,
		      struct lock_class_key *key)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	/*
	 * Make sure we are not reinitializing a held lock:
	 */
	debug_check_no_locks_freed((void *)lock, sizeof(*lock));
	lockdep_init_map(&lock->dep_map, name, key, 0);
#endif
	lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
	lock->magic = SPINLOCK_MAGIC;
	lock->owner = SPINLOCK_OWNER_INIT;
	lock->owner_cpu = -1;
}

EXPORT_SYMBOL(__spin_lock_init);

void __rwlock_init(rwlock_t *lock, const char *name,
		   struct lock_class_key *key)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	/*
	 * Make sure we are not reinitializing a held lock:
	 */
	debug_check_no_locks_freed((void *)lock, sizeof(*lock));
	lockdep_init_map(&lock->dep_map, name, key, 0);
#endif
	lock->raw_lock = (raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED;
	lock->magic = RWLOCK_MAGIC;
	lock->owner = SPINLOCK_OWNER_INIT;
	lock->owner_cpu = -1;
}

EXPORT_SYMBOL(__rwlock_init);

static void spin_bug(spinlock_t *lock, const char *msg)
{
	struct task_struct *owner = NULL;

	if (!debug_locks_off())
		return;

	if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
		owner = lock->owner;
	printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
		msg, raw_smp_processor_id(),
		current->comm, task_pid_nr(current));
	printk(KERN_EMERG " lock: %p, .magic: %08x, .owner: %s/%d, "
			".owner_cpu: %d\n",
		lock, lock->magic,
		owner ? owner->comm : "<none>",
		owner ? task_pid_nr(owner) : -1,
		lock->owner_cpu);
	dump_stack();
}

#define SPIN_BUG_ON(cond, lock, msg) if (unlikely(cond)) spin_bug(lock, msg)

static inline void
debug_spin_lock_before(spinlock_t *lock)
{
	SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic");
	SPIN_BUG_ON(lock->owner == current, lock, "recursion");
	SPIN_BUG_ON(lock->owner_cpu == raw_smp_processor_id(),
							lock, "cpu recursion");
}

static inline void debug_spin_lock_after(spinlock_t *lock)
{
	lock->owner_cpu = raw_smp_processor_id();
	lock->owner = current;
}

static inline void debug_spin_unlock(spinlock_t *lock)
{
	SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic");
	SPIN_BUG_ON(!spin_is_locked(lock), lock, "already unlocked");
	SPIN_BUG_ON(lock->owner != current, lock, "wrong owner");
	SPIN_BUG_ON(lock->owner_cpu != raw_smp_processor_id(),
							lock, "wrong CPU");
	lock->owner = SPINLOCK_OWNER_INIT;
	lock->owner_cpu = -1;
}

static void __spin_lock_debug(spinlock_t *lock)
{
	u64 i;
	u64 loops = loops_per_jiffy * HZ;
	int print_once = 1;

	for (;;) {
		for (i = 0; i < loops; i++) {
			if (__raw_spin_trylock(&lock->raw_lock))
				return;
			__delay(1);
		}
		/* lockup suspected: */
		if (print_once) {
			print_once = 0;
			printk(KERN_EMERG "BUG: spinlock lockup on CPU#%d, "
					"%s/%d, %p\n",
				raw_smp_processor_id(), current->comm,
				task_pid_nr(current), lock);
			dump_stack();
#ifdef CONFIG_SMP
			trigger_all_cpu_backtrace();
#endif
		}
	}
}

void _raw_spin_lock(spinlock_t *lock)
{
	debug_spin_lock_before(lock);
	if (unlikely(!__raw_spin_trylock(&lock->raw_lock)))
		__spin_lock_debug(lock);
	debug_spin_lock_after(lock);
}

int _raw_spin_trylock(spinlock_t *lock)
{
	int ret = __raw_spin_trylock(&lock->raw_lock);

	if (ret)
		debug_spin_lock_after(lock);
#ifndef CONFIG_SMP
	/*
	 * Must not happen on UP:
	 */
	SPIN_BUG_ON(!ret, lock, "trylock failure on UP");
#endif
	return ret;
}

void _raw_spin_unlock(spinlock_t *lock)
{
	debug_spin_unlock(lock);
	__raw_spin_unlock(&lock->raw_lock);
}

static void rwlock_bug(rwlock_t *lock, const char *msg)
{
	if (!debug_locks_off())
		return;

	printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
		msg, raw_smp_processor_id(), current->comm,
		task_pid_nr(current), lock);
	dump_stack();
}

#define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)

#if 0		/* __write_lock_debug() can lock up - maybe this can too? */
static void __read_lock_debug(rwlock_t *lock)
{
	u64 i;
	u64 loops = loops_per_jiffy * HZ;
	int print_once = 1;

	for (;;) {
		for (i = 0; i < loops; i++) {
			if (__raw_read_trylock(&lock->raw_lock))
				return;
			__delay(1);
		}
		/* lockup suspected: */
		if (print_once) {
			print_once = 0;
			printk(KERN_EMERG "BUG: read-lock lockup on CPU#%d, "
					"%s/%d, %p\n",
				raw_smp_processor_id(), current->comm,
				current->pid, lock);
			dump_stack();
		}
	}
}
#endif

void _raw_read_lock(rwlock_t *lock)
{
	RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
	__raw_read_lock(&lock->raw_lock);
}

int _raw_read_trylock(rwlock_t *lock)
{
	int ret = __raw_read_trylock(&lock->raw_lock);

#ifndef CONFIG_SMP
	/*
	 * Must not happen on UP:
	 */
	RWLOCK_BUG_ON(!ret, lock, "trylock failure on UP");
#endif
	return ret;
}

void _raw_read_unlock(rwlock_t *lock)
{
	RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
	__raw_read_unlock(&lock->raw_lock);
}

static inline void debug_write_lock_before(rwlock_t *lock)
{
	RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
	RWLOCK_BUG_ON(lock->owner == current, lock, "recursion");
	RWLOCK_BUG_ON(lock->owner_cpu == raw_smp_processor_id(),
							lock, "cpu recursion");
}

static inline void debug_write_lock_after(rwlock_t *lock)
{
	lock->owner_cpu = raw_smp_processor_id();
	lock->owner = current;
}

static inline void debug_write_unlock(rwlock_t *lock)
{
	RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
	RWLOCK_BUG_ON(lock->owner != current, lock, "wrong owner");
	RWLOCK_BUG_ON(lock->owner_cpu != raw_smp_processor_id(),
							lock, "wrong CPU");
	lock->owner = SPINLOCK_OWNER_INIT;
	lock->owner_cpu = -1;
}

#if 0		/* This can cause lockups */
static void __write_lock_debug(rwlock_t *lock)
{
	u64 i;
	u64 loops = loops_per_jiffy * HZ;
	int print_once = 1;

	for (;;) {
		for (i = 0; i < loops; i++) {
			if (__raw_write_trylock(&lock->raw_lock))
				return;
			__delay(1);
		}
		/* lockup suspected: */
		if (print_once) {
			print_once = 0;
			printk(KERN_EMERG "BUG: write-lock lockup on CPU#%d, "
					"%s/%d, %p\n",
				raw_smp_processor_id(), current->comm,
				current->pid, lock);
			dump_stack();
		}
	}
}
#endif

void _raw_write_lock(rwlock_t *lock)
{
	debug_write_lock_before(lock);
	__raw_write_lock(&lock->raw_lock);
	debug_write_lock_after(lock);
}

int _raw_write_trylock(rwlock_t *lock)
{
	int ret = __raw_write_trylock(&lock->raw_lock);

	if (ret)
		debug_write_lock_after(lock);
#ifndef CONFIG_SMP
	/*
	 * Must not happen on UP:
	 */
	RWLOCK_BUG_ON(!ret, lock, "trylock failure on UP");
#endif
	return ret;
}

void _raw_write_unlock(rwlock_t *lock)
{
	debug_write_unlock(lock);
	__raw_write_unlock(&lock->raw_lock);
}


text:
using System;

class test
{
    private static TestUtil.TestLog testLog;

    static test()
    {
        // Create test writer object to hold expected output
        System.IO.StringWriter expectedOut = new System.IO.StringWriter();

        // Write expected output to string writer object
        expectedOut.WriteLine("In try1");
        expectedOut.WriteLine("In catch1");
        expectedOut.WriteLine("In try2");
        expectedOut.WriteLine("In try3");
        expectedOut.WriteLine("In catch3");
        expectedOut.WriteLine("In finally2");
        expectedOut.WriteLine("In finally1");
        expectedOut.WriteLine("Done");
        // Create and initialize test log object
        testLog = new TestUtil.TestLog(expectedOut);
    }
    public static int Main()
    {
        //Start recording
        testLog.StartRecording();
        try
        {
            Console.WriteLine("In try1");
            throw new Exception();
        }
        catch (Exception)
        {
            Console.WriteLine("In catch1");
            try
            {
                Console.WriteLine("In try2");
                try
                {
                    Console.WriteLine("In try3");
                    throw new Exception();
                }
                catch
                {
                    Console.WriteLine("In catch3");
                    goto L;
                }
            }
            finally
            {
                Console.WriteLine("In finally2");
            }
        }
        finally
        {
            Console.WriteLine("In finally1");
        }

        Console.WriteLine("Never executed");
        L:
        Console.WriteLine("Done");
        // stop recoding
        testLog.StopRecording();

        return testLog.VerifyOutput();
    }
}


text:
/*****
Karma is a popular test runner for JavaScript, it works with many other testing
libraries and frameworks such as Jasmine and Mocha.
*******/

// http://karma-runner.github.io/0.12/config/configuration-file.html

require('proxyquireify')(require);
//accepts one argument: the configuration object
module.exports = function (config) {
    'use strict';
    // Karma configuration
    config.set({

        //List of test frameworks you want to use.  (Typically jasmine/mocha/qunit/...)
        frameworks: ['browserify','jasmine-ajax', 'jasmine' ],

        /*
        The jasmine-ajax plugin overwrites the original XMLHttpRequest object, therefore,
        it's important to initialize the Ajax plugin before starting your test and
        restore the original object once your test is done.*/

        // list of files or patterns to load in the browser. The files array field tells
        //to Karma which files will be tested in the glob format
        files: ['spec/**/*[Ss]pec.js'],

        //  A map of preprocessors to use, Js loaded by the browserify
        // https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'spec/**/*[Ss]pec.js': ['browserify']
        },

        // Cobfigure how to bundle the test files with Browserify
        browserify: {
            debug: true,
            //You should have proxyquireify to replace the original js file to load
            plugin: ['proxyquireify/plugin'],
            transform: ['jstify'],
            extensions: ['.js', '.tpl']
        },

        //A list of reporters to use.
        //the spec reporter and html-detailed-reporter are most used.
        //https://www.npmjs.com/package/karma-spec-reporter
        //https://www.npmjs.com/package/karma-html-detailed-reporter
        reporters: ['spec', 'htmlDetailed'],

        // configure the HTML-Detailed-Reporter to put all results in one file
        htmlDetailed: {
            splitResults: false
        },

        // list of files or patterns to exclude
        exclude: [], //Default

        //The port where the web server will be listening
        port: 9876, //Default

        // enable or disable colors in the output (reporters and logs)
        colors: true,

        // level of logging
        // possible values:
        //LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
        logLevel: config.LOG_INFO, //Default, Type: Constant

        /**
          A plugin can be a string or an inlined plugin - Object.
          By default, Karma loads all sibling NPM modules which have a name starting with
          karma-*. https://www.npmjs.com/browse/keyword/karma-plugin
        **/
        //List of plugins to load.
        plugins: ['karma-*'],

        // Continuous Integration mode. if true, it capture browsers, run tests and exit
        singleRun: false,

        // enable or disable watching file and executing tests whenever any file changes
        autoWatch: true,//Default

        //The configuration setting tells Karma how long to wait (in milliseconds) after
        //any changes have occurred before starting the test process again.
        autoWatchBatchDelay: 250,//Default

        // The root path location that will be used to resolve all relative paths defined in files and exclude.
        basePath: '',//Default

        //How long does Karma wait for a browser to reconnect (in ms)
        browserDisconnectTimeout: 2000, //Default

        //The number of disconnections tolerated.
        browserDisconnectTolerance: 0,//Default

        //How long will Karma wait for a message from a browser before disconnecting from
        //it(in ms)
        browserNoActivityTimeout: 10000, //Default

        // Start these browsers, currently available:
        // - Chrome (launcher requires karma-chrome-launcher plugin)
        // - ChromeCanary (launcher comes installed with Karma)
        // - PhantomJS (launcher requires karma-phantomjs-launcher plugin)
        // - Firefox (launcher requires karma-firefox-launcher plugin)
        // - Opera (launcher requires karma-opera-launcher plugin)
        // - Safari (only Mac)  (launcher requires karma-safari-launcher plugin)
        // - IE (only Windows)  (launcher requires karma-ie-launcher plugin)

        //A list of browsers to launch and capture
        browsers: ['Chrome'/*,'PhantomJS'*/], //Default: []

        //Timeout for capturing a browser (in ms)
        // If any browser does not get captured within the timeout, Karma will kill it
        //and try to launch it again and, after three attempts to capture it, Karma will
        //give up
        captureTimeout: 60000, //Default

        //Hostname to be used when capturing browsers
        hostname: 'localhost', //Default

        // A map of path-proxy pairs
        proxies: {} //default
        /**
        Example:
            proxies: {
            '/static': 'http://gstatic.com',
            '/web': 'http://localhost:9000'
            },
        **/
    });
};


text:
require('../assets/css/style.css')
require('../assets/bootstrap/css/bootstrap.min.css')
export default {
    "layout":require('./layout/module')
    ,"input":require('./input/input')
    ,"input-adv":require('./input/input-adv')
    ,"button":require('./button/button')
    ,"button-group":require('./button-group/group')
    ,"toolbar":require('./button-group/toolbar')

    ,"form":require('./form/module')
    ,"separator":require('./separator/module')

    ,"grid-tree":require('./grid/grid-tree')
    ,"data-table":require('./table/data-table')
    ,"tabs":require('./tabs/tabs')

}


text: Interface for Casting Directors using Casting to The People


text:
package ua.projects.javatests.addressbook.model;

import com.google.gson.annotations.Expose;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.File;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table (name = "addressbook")
@XStreamAlias("contact")
public class ContactData {

    @Id
    @Column (name = "id")
    @XStreamOmitField
    private int id;

    @Column (name = "firstname")
    @Expose
    private String firstName;

    @Column (name = "lastname")
    @Expose
    private String lastName;

    @Expose
    private String nickname;

    @Column (name = "company")
    @Expose
    private String workPlace;

    @Expose
    @Type(type = "text")
    private String address;

    @Column (name = "home")
    @Type(type = "text")
    @Expose
    private String homePhone;

    @Column (name = "mobile")
    @Type(type = "text")
    private String mobilePhone;

    @Column (name = "work")
    @Type(type = "text")
    private String workPhone;

    @Transient
    private String allPhones;

    @Transient
    private String allEmails;

    @Column (name = "email")
    @Type(type = "text")
    @Expose
    private String firstEmail;

    @Column (name = "email2")
    @Type(type = "text")
    private String secondEmail;

    @Column (name = "email3")
    @Type(type = "text")
    private String thirdEmail;

    @Transient
    private String info;

    @Column (name = "photo")
    @Type(type = "text")
    private String photo = "src/test/resources/batman.jpg";

    @ManyToMany (fetch = FetchType.EAGER)
    @JoinTable (name = "address_in_groups", joinColumns = @JoinColumn (name = "id"), inverseJoinColumns = @JoinColumn (name = "group_id"))
    private Set<GroupData> groups = new HashSet<GroupData>();

    public int getId() {
        return id;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String getNickname() {
        return nickname;
    }

    public String getWorkPlace() {
        return workPlace;
    }

    public String getAddress() {
        return address;
    }

    public String getAllPhones() {
        return allPhones;
    }

    public String getHomePhone() {
        return homePhone;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public String getWorkPhone() {
        return workPhone;
    }

    public String getFirstEmail() {
        return firstEmail;
    }

    public String getSecondEmail() {
        return secondEmail;
    }

    public String getThirdEmail() {
        return thirdEmail;
    }

    public String getAllEmais() {
        return allEmails;
    }

    public String getInfo() {
        return info;
    }

    public File getPhoto() {
        return new File(photo);
    }

    public ContactData withId(int id) {
        this.id = id;
        return this;
    }

    public ContactData withFirstName(String firstName) {
        this.firstName = firstName;
        return this;
    }

    public ContactData withLastName(String lastName) {
        this.lastName = lastName;
        return this;
    }

    public ContactData withWorkPlace(String workPlace) {
        this.workPlace = workPlace;
        return this;
    }

    public ContactData withAddress(String address) {
        this.address = address;
        return this;
    }

    public ContactData withNickname(String nickname) {
        this.nickname = nickname;
        return this;
    }

    public ContactData withHomePhone(String homePhone) {
        this.homePhone = homePhone;
        return this;
    }

    public ContactData withMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
        return this;
    }

    public ContactData withWorkPhone(String workPhone) {
        this.workPhone = workPhone;
        return this;
    }

    public ContactData withAllPhones(String allPhones) {
        this.allPhones = allPhones;
        return this;
    }

    public ContactData withFirstEmail(String firstEmail) {
        this.firstEmail = firstEmail;
        return this;
    }

    public ContactData withSecondEmail(String secondEmail) {
        this.secondEmail = secondEmail;
        return this;
    }

    public ContactData withThirdEmail(String thirdEmail) {
        this.thirdEmail = thirdEmail;
        return this;
    }

    public ContactData withAllEmails(String allEmails) {
        this.allEmails = allEmails;
        return this;
    }

    public ContactData withInfo(String info) {
        this.info = info;
        return this;
    }

    public ContactData withPhoto(File photo) {
        this.photo = photo.getPath();
        return this;
    }

    public Groups getGroups() {
        return new Groups(groups);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ContactData that = (ContactData) o;

        if (id != that.id) return false;
        if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return false;
        if (lastName != null ? !lastName.equals(that.lastName) : that.lastName != null) return false;
        if (nickname != null ? !nickname.equals(that.nickname) : that.nickname != null) return false;
        if (workPlace != null ? !workPlace.equals(that.workPlace) : that.workPlace != null) return false;
        if (address != null ? !address.equals(that.address) : that.address != null) return false;
        if (homePhone != null ? !homePhone.equals(that.homePhone) : that.homePhone != null) return false;
        return firstEmail != null ? firstEmail.equals(that.firstEmail) : that.firstEmail == null;

    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
        result = 31 * result + (workPlace != null ? workPlace.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (homePhone != null ? homePhone.hashCode() : 0);
        result = 31 * result + (firstEmail != null ? firstEmail.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "ContactData{" +
                "firstName='" + firstName + '\'' +
                ", id=" + id +
                ", lastName='" + lastName + '\'' +
                ", nickname='" + nickname + '\'' +
                ", workPlace='" + workPlace + '\'' +
                ", address='" + address + '\'' +
                ", homePhone='" + homePhone + '\'' +
                ", firstEmail='" + firstEmail + '\'' +
                '}';
    }

    public ContactData inGroup(GroupData group) {
        groups.add(group);
        return this;
    }
}


text:
module Byebug

  class CatchCommand < Command
    self.allow_in_control = true

    def regexp
      /^\s* cat(?:ch)? (?:\s+(\S+))? (?:\s+(off))? \s*$/x
    end

    def execute
      excn = @match[1]
      return info_catch unless excn

      if not @match[2]
        if 'off' == @match[1]
          Byebug.catchpoints.clear if
            confirm("Delete all catchpoints? (y or n) ")
        else
          print "Warning #{@match[1]} is not known to be a Class\n" unless
            bb_eval "#{@match[1]}.is_a?(Class)", get_binding
          Byebug.add_catchpoint @match[1]
          print "Catching exception #{@match[1]}.\n"
        end
      elsif @match[2] != 'off'
        errmsg "Off expected. Got #{@match[2]}\n"
      elsif Byebug.catchpoints.member?(@match[1])
        Byebug.catchpoints.delete @match[1]
        print "Catch for exception #{match[1]} removed.\n"
      else
        return errmsg "Catch for exception #{@match[1]} not found\n"
      end
    end

    class << self
      def names
        %w(catch)
      end

      def description
        %{cat[ch]\t\t\t\tLists catchpoints
          cat[ch] off\t\t\tDeletes all catchpoints
          cat[ch] <exception> [off]\tEnable/disable handling <exception>.}
      end
    end
  end
end


text:
<?php
/**
 * Created by PhpStorm.
 * User: Vasiliy
 * Date: 21.03.15
 * Time: 21:11
 */

namespace app\models\FileInfo\CarriageInfoExtracter;

use app\models\DictFactory;
use app\models\FileInfo\ExtracterBase;

class BaseDetailExtracter extends ExtracterBase {

    protected $dataForSearch = array();

    protected function collectHeadData(array $row) {
        $headData = array();
        for ($i = 1; $i < self::MAX_USEFUL_COLUMN_ID; $i++) {
            $columnCode = $this->getColumnCode($i);
            $columnValue = $row[$columnCode];
            $relativeHeadCode = $this->findHeadType($columnValue);
            if ($relativeHeadCode) {
                $headData[$relativeHeadCode] = $columnCode;
            }

            if (count($headData) == count($this->dataForSearch)) {
                return $headData;
            }
        }
        return $headData;
    }

    private function isEqualData($columnData, $requiredData) {
        return preg_match("/{$requiredData}/", $columnData);
    }

    private function findHeadType($columnValue) {
        foreach ($this->dataForSearch as $headCode => $headContent) {
            if (!isset($headData[$headCode])) {
                if ($this->isEqualData($columnValue, $headContent)) {
                    return $headCode;
                }
            }
        }
        return null;
    }

    protected function isStartDataInRow($activeTable, $rowId) {
        return is_numeric($activeTable[$rowId]['A']);
    }

    protected function extractFactoryId($factoryContent) {
        $factoryContent = preg_replace('!(?:\xc2\xa0|[\pZ\s]++)++!', ' ', $factoryContent);
        if (strlen(trim($factoryContent)) < 5) {
            return DictFactory::getIdByDictId(preg_replace('~[^0-9]+~', '', $factoryContent));
        }

        return DictFactory::getIdByName($factoryContent);
    }
}


text:
var models = require('../models');
var ArticleContent = models.ArticleContent;

exports.getArticleContentById = function (content_id, callback) {
    ArticleContent.findOne({ _id: content_id }, callback);
}

exports.newAndSave = function (article_id, content, callback) {
    var articleContent = new ArticleContent();
    articleContent.article_id = article_id;
    articleContent.content = content;
    articleContent.save(callback);
};


text:
'use strict';

var Document = require('./document'),
	Operation = require('./op'),
	Ins = require('./ops/ins'),
	Del = require('./ops/del'),
	Move = require('./ops/move'),
	Set = require('./ops/set'),
	Nop = require('./ops/nop');

/**
 * Compresses a set of suquential operations
 * @param ops an array of operations
 * @return an array of compressed operations
 */
function compress(ops){
	var out = [];

	for(var i = 0; i < ops.length; i++){
		var o = ops[i].clone();
		var next = i < ops.length - 1 ? ops[i+1] : null;

		// Skip invalid or non functional operations
		if(!(o instanceof Operation) || (o instanceof Nop))
			continue;

		if(o instanceof Ins){
			// Filter out empty insertions

			if(next){
				// Compress trivial sequential inserts

			}

		}
		else if(o instanceof Del){
			// Filter out empty deletions

			if(next){
				// Compress trivial sequential inserts

			}

		}

		out.push(o);
	}

	return out;
}

/* Try to compress the array of sequential operations using some simple methods and return the result */
function Compose(ops){
	var res = [];

	for(var i = 0; i < ops.length - 1; i++){
		var cur = ops[i].clone();

		if(cur instanceof Ins){
			// Sequential insertions to the same location or to the i+1'th location can be compressed
			for(var j = i+1; j < ops.length - 1; j++){
				var next = ops[j];
				if(next instanceof Ins){
					if(next.i == cur.i){

					}
					else if(next.i == cur.i + cur.value.length){

					}
					else
						break;
				}
				else
					break;
			}

		}

		if(cur instanceof Del){

		}

		res.push(cur);
	}

	return res;
}


text:
// graphing.js
(function() {
    'use strict';

    angular
        .module('app.map')
        .factory('Graphing', Graphing);

    /**
     * Graphing: angular service for the Graph and Dijkstra's algorithm
     * @graph stores a created graph (enables use between controllers)
     * @cache stores the results of the previous call to runDijkstra
     * @createGraph creates a new graph given the url to a json
     * @runDijkstra runs dijkstra's algorithm
     * @getShortestPath finds the shortest path for the previous run of dijkstra's
     * @clearCache clears the cache
     */
    /* @ngInject */
    function Graphing($http, GRAPH_URL) {
        var service = {
            graph: null,
            // the previously run search (for caching)
            cache: {
                cached: false
            },

            createGraph: createGraph,
            runDijkstra: runDijkstra,
            getShortestPath: getShortestPath,
            clearCache: clearCache
        };

        return service;

        //------------------------------------------------//

        /* global Graph, Dijkstra */
        function createGraph() {
            // use http to get the graph json
            return $http.get(GRAPH_URL)
                .success(function(data) {
                    // create the new graph
                    service.graph = new Graph(data);

                    return service.graph;
                })
                .error(function(error) {
                    console.error(error || 'Request failed');
                });
        }

        function runDijkstra(pathType, source, target) {
            // caching should be done by the wrapper
            if (source === service.cache.source && target === service.cache.target) {
                service.cache.cached = true;
                return service.cache;
            } else {
                service.cache.source = source;
                service.cache.target = target;
            }

            var results = Dijkstra.run(service.graph, pathType, source, target);

            // cache results (cache.cached is implicitly false)
            service.cache = results;
            return results;
        }

        function getShortestPath() {
            return Dijkstra.getPath(service.cache.prev, service.cache.target);
        }

        function clearCache() {
            service.cache = {
                cached: false
            };
        }
    }
})();


text:
from singa import autograd
from singa import tensor
from singa import device
from singa import opt

import numpy as np
from tqdm import trange

__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
           'resnet152']

def conv3x3(in_planes, out_planes, stride=1):
    """3x3 convolution with padding"""
    return autograd.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
                           padding=1, bias=False)

class BasicBlock(autograd.Layer):
    expansion = 1

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(BasicBlock, self).__init__()
        self.conv1 = conv3x3(inplanes, planes, stride)
        self.bn1 = autograd.BatchNorm2d(planes)
        self.conv2 = conv3x3(planes, planes)
        self.bn2 = autograd.BatchNorm2d(planes)
        self.downsample = downsample
        self.stride = stride

    def __call__(self, x):
        residual = x

        out = self.conv1(x)
        out = self.bn1(out)
        out = autograd.relu(out)

        out = self.conv2(out)
        out = self.bn2(out)

        if self.downsample is not None:
            residual = self.downsample(x)

        out = autograd.add(out, residual)
        out = autograd.relu(out)

        return out

class Bottleneck(autograd.Layer):
    expansion = 4

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(Bottleneck, self).__init__()
        self.conv1 = autograd.Conv2d(
            inplanes, planes, kernel_size=1, bias=False)
        self.bn1 = autograd.BatchNorm2d(planes)
        self.conv2 = autograd.Conv2d(planes, planes, kernel_size=3,
                                     stride=stride,
                                     padding=1, bias=False)
        self.bn2 = autograd.BatchNorm2d(planes)
        self.conv3 = autograd.Conv2d(
            planes, planes * self.expansion, kernel_size=1, bias=False)
        self.bn3 = autograd.BatchNorm2d(planes * self.expansion)

        self.downsample = downsample
        self.stride = stride

    def __call__(self, x):
        residual = x

        out = self.conv1(x)
        out = self.bn1(out)
        out = autograd.relu(out)

        out = self.conv2(out)
        out = self.bn2(out)
        out = autograd.relu(out)

        out = self.conv3(out)
        out = self.bn3(out)

        if self.downsample is not None:
            residual = self.downsample(x)

        out = autograd.add(out, residual)
        out = autograd.relu(out)

        return out

class ResNet(autograd.Layer):

    def __init__(self, block, layers, num_classes=1000):
        self.inplanes = 64
        super(ResNet, self).__init__()
        self.conv1 = autograd.Conv2d(3, 64, kernel_size=7, stride=2, padding=3,
                                     bias=False)
        self.bn1 = autograd.BatchNorm2d(64)
        self.maxpool = autograd.MaxPool2d(
            kernel_size=3, stride=2, padding=1)
        self.layer1 = self._make_layer(block, 64, layers[0])
        self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
        self.layer3 = self._make_layer(block, 256, layers[2], stride=2)
        self.layer4 = self._make_layer(block, 512, layers[3], stride=2)
        self.avgpool = autograd.AvgPool2d(7, stride=1)
        self.fc = autograd.Linear(512 * block.expansion, num_classes)

    def _make_layer(self, block, planes, blocks, stride=1):
        downsample = None
        if stride != 1 or self.inplanes != planes * block.expansion:
            conv = autograd.Conv2d(self.inplanes, planes * block.expansion,
                                   kernel_size=1, stride=stride, bias=False)
            bn = autograd.BatchNorm2d(planes * block.expansion)

            def downsample(x):
                return bn(conv(x))

        layers = []
        layers.append(block(self.inplanes, planes, stride, downsample))
        self.inplanes = planes * block.expansion
        for i in range(1, blocks):
            layers.append(block(self.inplanes, planes))

        def forward(x):
            for layer in layers:
                x = layer(x)
            return x
        return forward

    def __call__(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = autograd.relu(x)
        x = self.maxpool(x)

        x = self.layer1(x)
        x = self.layer2(x)
        x = self.layer3(x)
        x = self.layer4(x)

        x = self.avgpool(x)
        x = autograd.flatten(x)
        x = self.fc(x)

        return x

def resnet18(pretrained=False, **kwargs):
    """Constructs a ResNet-18 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(BasicBlock, [2, 2, 2, 2], **kwargs)

    return model

def resnet34(pretrained=False, **kwargs):
    """Constructs a ResNet-34 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(BasicBlock, [3, 4, 6, 3], **kwargs)

    return model

def resnet50(pretrained=False, **kwargs):
    """Constructs a ResNet-50 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)

    return model

def resnet101(pretrained=False, **kwargs):
    """Constructs a ResNet-101 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)

    return model

def resnet152(pretrained=False, **kwargs):
    """Constructs a ResNet-152 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(Bottleneck, [3, 8, 36, 3], **kwargs)

    return model

if __name__ == '__main__':
    model = resnet18()
    print('Start intialization............')
    dev = device.create_cuda_gpu_on(0)
    #dev = device.create_cuda_gpu()
    niters = 200
    batch_size = 16
    IMG_SIZE = 224
    sgd = opt.SGD(lr=0.1, momentum=0.9, weight_decay=1e-5)

    tx = tensor.Tensor((batch_size, 3, IMG_SIZE, IMG_SIZE), dev)
    ty = tensor.Tensor((batch_size,), dev, tensor.int32)
    autograd.training = True
    x = np.random.randn(batch_size, 3, IMG_SIZE, IMG_SIZE).astype(np.float32)
    y = np.random.randint(0, 1000, batch_size, dtype=np.int32)
    tx.copy_from_numpy(x)
    ty.copy_from_numpy(y)

    with trange(niters) as t:
        for b in t:
            x = model(tx)
            loss = autograd.softmax_cross_entropy(x, ty)
            for p, g in autograd.backward(loss):
                # print(p.shape, g.shape)
                sgd.update(p, g)
                #pass


text:
define(['avalon', 'text!./td.checkbox.html', 'css!./td.checkbox.css'], function(avalon, template) {
	var _interface = function () {};
	avalon.component("td:checkbox", {
		//外部标签属性
		label: '',
		checked: false,
		disabled: false,
		//外部配置参数
		onchecked: null,
		onchanged: null,
		onready: null,
		//内部接口
		$trigger: _interface,
		//view接口
		_clickCheckbox: _interface,
		//默认配置
		$template: template,
		$construct: function (hooks, vmOpts, elemOpts) {
			return avalon.mix(hooks, vmOpts, elemOpts);
		},
		$dispose: function (vm, elem) {
			elem.innerHTML = elem.textContent = '';
		},
		$init: function(vm, elem) {
			vm.$trigger = function(ev, type) {
				switch (type) {
					case 'checked':
						if(typeof vm.onchecked == 'function') {
							vm.onchecked(ev, vm);
						}
						break;
					case 'changed':
						if(typeof vm.onchanged == 'function') {
							vm.onchanged(ev, vm);
						}
						break;
					case 'ready':
						if(typeof vm.onready == 'function') {
							vm.onready(ev, vm);
						}
						break;
					default: break;
				}
			}
			vm._clickCheckbox = function(ev) {
				if(!vm.disabled) {
					vm.checked = !vm.checked;
					if(vm.checked) {
						vm.$trigger(ev, 'checked');
					}
					vm.$trigger(ev, 'changed');
				}
			}
		},
		$ready: function (vm, elem) {
			vm.$trigger(elem, 'ready');
		}
	});
	var widget = avalon.components["td:checkbox"];
  widget.regionals = {};
})


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>HappyCoding</title>
    <link>https://samuelsjtu.github.io/author/admin/</link>
    <description>Recent content on HappyCoding</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>

	<atom:link href="https://samuelsjtu.github.io/author/admin/index.xml" rel="self" type="application/rss+xml" />

  </channel>
</rss>


text:
require "spec_helper"

describe "web" do
  include Capybara::DSL
  let!(:queue) { Howler::Queue.new }
  let(:message) do
    Howler::Message.new(
      'class' => 'Array',
      'method' => :length,
      'args' => [2345]
    )
  end

  describe "#root" do
    it "when viewing the navigation bar" do
      visit "/"

      within "#navigation" do
        page.should have_content("Howler")
        page.should have_content("Queues")
        page.should have_content("Notifications")
        page.should have_content("Statistics")
        page.should have_content("Settings")
      end
    end

    it "when navigating to Queues#index" do
      visit "/"
      click_link "Queues"

      current_path.should == "/queues"
    end

    it "when navigating to Notifications#index" do
      visit "/"
      click_link "Notifications"

      current_path.should == "/notifications"
    end

    it "when navigating to Statistics#index" do
      visit "/"
      click_link "Statistics"

      current_path.should == "/statistics"
    end

    it "when navigating to Settings#index" do
      visit "/"
      click_link "Settings"

      current_path.should == "/settings"
    end
  end

  describe "Queues#index" do
    it "when navigating to Queues#show" do
      visit "/queues"

      within "#queue_#{queue.id}" do
        click_link "More..."
      end

      current_path.should == "/queues/#{queue.id}"

      within "##{queue.id}" do
        page.should have_content(queue.id)
      end
    end

    it "when viewing queue statistics" do
      6.times { queue.statistics { lambda {}}}
      4.times { queue.statistics { raise "failed" }}

      visit "/queues"

      within "#queue_#{queue.id}" do
        page.should have_content(queue.id)
        page.should have_content(queue.created_at.to_s)
        page.should have_content("6")

        within ".error" do
          page.should have_content("4")
        end
      end
    end
  end

  describe "Queues#show" do
    before do
      Timecop.travel(DateTime.now)
      @time = Time.now.to_f

      queue.statistics(Fiber, :yield, [4567], @time) { raise Howler::Message::Retry }

      Benchmark.stub(:measure).and_return("1.1 1.3 1.5 ( 1.7)", "2.1 2.3 2.5 ( 2.7)")

      [[Hash, :keys, [1234]], [Array, :length, [2345]]].each do |(klass, method, args)|
        queue.statistics(klass, method, args, @time) { lambda {}}
      end

      Howler::Manager.current.push(Logger, :info, [3456])
    end

    it "when viewing processed messages" do
      visit "/queues/#{queue.id}"

      within "#processed_messages" do
        within ".table_title" do
          page.should have_content("Processed Messages")
        end

        within ".table tr" do
          ["Message", "Created At", "System Runtime", "Real Runtime", "Status"].each do |value|
            page.should have_content(value)
          end
        end

        within ".table tbody" do
          page.should have_content(Howler::Util.at(@time))

          %w(Hash.keys(1234) 1.5 1.7 success).each do |value|
            page.should have_content(value)
          end

          %w(Array.length(2345) 2.5 2.7 success).each do |value|
            page.should have_content(value)
          end
        end
      end
    end

    it "when viewing pending messages" do
      visit "/queues/#{queue.id}"

      within "#pending_messages" do
        within ".table_title" do
          page.should have_content("Pending Messages")
        end

        within ".table tr" do
          ["Message", "Created At", "Status"].each do |value|
            page.should have_content(value)
          end
        end

        within ".table tbody" do
          page.should have_content(Howler::Util.at(@time))

          %w(Logger.info(3456) pending).each do |value|
            page.should have_content(value)
          end

          %w(Fiber.yield(4567) retrying).each do |value|
            page.should have_content(value)
          end
        end
      end
    end

    it "when viewing failed messages" do
      Benchmark.unstub(:measure)
      queue.statistics(Array, :length, [2345], @time) { raise Howler::Message::Failed }

      visit "/queues/#{queue.id}"

      within "#failed_messages" do
        within ".table_title" do
          page.should have_content("Failed Messages")
        end

        within ".table tr" do
          ["Message", "Created At", "Failed At", "Cause", "Status"].each do |value|
            page.should have_content(value)
          end
        end

        within ".table tbody" do
          within ".failed_at" do
            page.should have_content(Howler::Util.at(@time))
          end

          %w(Array.length(2345) Howler::Message::Failed failed).each do |value|
            page.should have_content(value)
          end
        end
      end
    end
  end

  describe "Notifications#index" do
    describe "when there are notifications" do
      before do
        @ex = generate_exception
        [:length, :collect, :max].each_with_index do |method, i|
          queue.statistics(Array, method, [i*10]) { raise Howler::Message::Notify.new(@ex, :type => method)}
        end

        visit "/notifications"
      end

      it "when viewing the notifications table" do
        within "#notifications" do
          within ".table tr" do
            %w(Message Notification Occurred).each do |value|
              page.should have_content(value)
            end
          end

          within ".table tbody" do
            page.should have_content(Howler::Util.at(@time))
            page.should have_content(@ex.to_s)

            %w(Array.length(0) Array.collect(10) Array.max(20)).each do |value|
              page.should have_content(value)
            end
          end
        end
      end
    end
  end
end


text:
import mox
import unittest

from quantum.openstack.common import uuidutils
from quantum.plugins.nec.common import ofc_client as ofc
from quantum.plugins.nec.db import models as nmodels
from quantum.plugins.nec import drivers

class TestConfig(object):
    """Configuration for this test"""
    host = '127.0.0.1'
    port = 8888
    use_ssl = False
    key_file = None
    cert_file = None

def _ofc(id):
    """OFC ID converter"""
    return "ofc-%s" % id

class PFCDriverTestBase(unittest.TestCase):

    def setUp(self):
        self.mox = mox.Mox()
        self.driver = drivers.get_driver("pfc")(TestConfig)
        self.mox.StubOutWithMock(ofc.OFCClient, 'do_request')

    def tearDown(self):
        self.mox.UnsetStubs()

    def get_ofc_item_random_params(self):
        """create random parameters for ofc_item test"""
        tenant_id = uuidutils.generate_uuid()
        network_id = uuidutils.generate_uuid()
        port_id = uuidutils.generate_uuid()
        portinfo = nmodels.PortInfo(id=port_id, datapath_id="0x123456789",
                                    port_no=1234, vlan_id=321,
                                    mac="11:22:33:44:55:66")
        return tenant_id, network_id, portinfo

    def testa_create_tenant(self):
        t, n, p = self.get_ofc_item_random_params()
        description = "desc of %s" % t

        path = "/tenants"
        body = {'id': t, 'description': description}
        tenant = {'id': _ofc(t)}
        ofc.OFCClient.do_request("POST", path, body=body).AndReturn(tenant)
        self.mox.ReplayAll()

        ret = self.driver.create_tenant(description, t)
        self.mox.VerifyAll()
        self.assertEqual(ret, _ofc(t))

    def testb_update_tenant(self):
        t, n, p = self.get_ofc_item_random_params()
        description = "new desc of %s" % t

        path = "/tenants/%s" % _ofc(t)
        body = {'description': description}
        ofc.OFCClient.do_request("PUT", path, body=body)
        self.mox.ReplayAll()

        self.driver.update_tenant(_ofc(t), description)
        self.mox.VerifyAll()

    def testc_delete_tenant(self):
        t, n, p = self.get_ofc_item_random_params()

        path = "/tenants/%s" % _ofc(t)
        ofc.OFCClient.do_request("DELETE", path)
        self.mox.ReplayAll()

        self.driver.delete_tenant(_ofc(t))
        self.mox.VerifyAll()

    def testd_create_network(self):
        t, n, p = self.get_ofc_item_random_params()
        description = "desc of %s" % n

        path = "/tenants/%s/networks" % _ofc(t)
        body = {'id': n, 'description': description}
        network = {'id': _ofc(n)}
        ofc.OFCClient.do_request("POST", path, body=body).AndReturn(network)
        self.mox.ReplayAll()

        ret = self.driver.create_network(_ofc(t), description, n)
        self.mox.VerifyAll()
        self.assertEqual(ret, _ofc(n))

    def teste_update_network(self):
        t, n, p = self.get_ofc_item_random_params()
        description = "desc of %s" % n

        path = "/tenants/%s/networks/%s" % (_ofc(t), _ofc(n))
        body = {'description': description}
        ofc.OFCClient.do_request("PUT", path, body=body)
        self.mox.ReplayAll()

        self.driver.update_network(_ofc(t), _ofc(n), description)
        self.mox.VerifyAll()

    def testf_delete_network(self):
        t, n, p = self.get_ofc_item_random_params()

        path = "/tenants/%s/networks/%s" % (_ofc(t), _ofc(n))
        ofc.OFCClient.do_request("DELETE", path)
        self.mox.ReplayAll()

        self.driver.delete_network(_ofc(t), _ofc(n))
        self.mox.VerifyAll()

    def testg_create_port(self):
        t, n, p = self.get_ofc_item_random_params()

        path = "/tenants/%s/networks/%s/ports" % (_ofc(t), _ofc(n))
        body = {'id': p.id,
                'datapath_id': p.datapath_id,
                'port': str(p.port_no),
                'vid': str(p.vlan_id)}
        port = {'id': _ofc(p.id)}
        ofc.OFCClient.do_request("POST", path, body=body).AndReturn(port)
        self.mox.ReplayAll()

        ret = self.driver.create_port(_ofc(t), _ofc(n), p, p.id)
        self.mox.VerifyAll()
        self.assertEqual(ret, _ofc(p.id))

    def testh_delete_port(self):
        t, n, p = self.get_ofc_item_random_params()

        path = "/tenants/%s/networks/%s/ports/%s" % (_ofc(t), _ofc(n),
                                                     _ofc(p.id))
        ofc.OFCClient.do_request("DELETE", path)
        self.mox.ReplayAll()

        self.driver.delete_port(_ofc(t), _ofc(n), _ofc(p.id))
        self.mox.VerifyAll()


text:
import logging

from flask import Flask, render_template, request

# Enable cloud debugger
try:
    import googleclouddebugger
    googleclouddebugger.enable()
except ImportError:
    pass

# Adjust logging level to INFO
logging.basicConfig(level=logging.INFO)

# If `entrypoint` is not defined in app.yaml, App Engine will look for an app
# called `app` in `main.py`.
app = Flask(__name__)

# There is a bug in the code.
class StringProcessor():
    def __init__(self, string):
        self._string = string

    def Reverse(self):
        if self._string == '':
            return ''

        chars = [c for c in self._string]
        left = 0
        right = len(chars) - 1
        while True:
            tmp = chars[left]
            chars[left] = chars[right]
            chars[right] = tmp
            if left >= right:
                break
            left += 1
            right -= 1

        return ''.join(chars)

@app.route('/reverse_string', methods=['GET'])
def ReverseString():
    try:
        s = str(request.args.get('string'))
    except Exception as e:
        print(e)
        return 'Not a valid string!'

    current = StringProcessor(s).Reverse()
    expected = s[::-1]
    return render_template("index.html", current=current, expected=expected)

@app.route('/')
def Hello():
    """Return a friendly HTTP greeting."""
    return '''
        Hello! Enter a string to reverse it.
        <form method="get" action="reverse_string">

<input type=text name=string value="abcd">

<input type=submit>
        </form>
    '''

if __name__ == '__main__':
    # This is used when running locally only. When deploying to Google App
    # Engine, a webserver process such as Gunicorn will serve the app. This
    # can be configured by adding an `entrypoint` to app.yaml.
    app.run(host='127.0.0.1', port=8080, debug=True)
# [END gae_python3_app]
# [END gae_python38_app]