text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>src/config/langues/de.js - FAKE DOCUMENTATION</title>
    <meta name="description" content="Fake documentation, intended to be used as demo">
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="stylesheet" href="../assets/css/custom.css">
    <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="../assets/vendor/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../assets/css/theme.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700' rel='stylesheet' type='text/css'>

            FAKE DOCUMENTATION

                        Search

                                <input type="search" id="api-filter" placeholder="Search...">

                                  Tag: 1.0.0

                      Modules

                                            Base

                                            Config

                                            domListenerCallback

                                            Template

                                            Utils

                        Classes

                                        __

                                        Base

                                        Cache

                                        Config

                                        diffDays

                                        domListenerCallback

                                        ifEqual

                                        momentify

                                        Renders

                                        Ternary

                                        undoTraduction

                                        UtilisClass

 src/config/langues/de.js File

/**
 * Created by iris-mac on 08/11/2016.
 *
 * Fichier utilisé pour la traduction de contenu vers de l'anglais
 *
 */

const de = {
    translation: {
        error: {
            form: "HOPPLA! Es scheint, dass die eingegebenen Daten nicht korrekt sind ...",
            nodata: 'Ihre Suchkriterien passen zu keinem Ergebnis.'
        },
        template: {
            post: {
                knowmore : 'Mehr Details',
                nonContractualVisuals: 'Nichtvertragliche Visuals',
                description: "Beschreibung",
                discover: "Entdecken",
                from: 'von',
                to: 'nach',
                book: 'Buchen',
                night: 'Nacht',
                counter: 'Einige Unterkünfte sind nicht auf gewünschten Daten zur Verfügung. <br> Überprüfen Sie die Unterkunft für ang Daten <span style="cursor:pointer" onclick="scrollBy(0, document.querySelector(\'#counter-proposal\').offsetTop - 175)"> ende der Seite </span><br><br>',
                counterTitle: 'Andere Verfügbarkeit',
                noContent: 'Keine Verfügbarkeit für die gewünschten Termine vorhanden.'
            },
            search: {
                noContent: 'Kein Inhalt'
            }
        },
        aliases: {
            accomodationStructure : 'Struktur',
            accomodationRange: 'Angebot',
            accomodationEquipment: 'Ausrüstung',
            accomodationRoom: 'Anzahl der Räume'
        }
    }
}

export default de


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

  <groupId>org.keyboardplaying</groupId>
  <artifactId>daily-tasks</artifactId>
  <version>2.0.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>Daily Tasks</name>
  <description>A simple task manager.</description>
  <url>http://${github.user}.github.io/${github.repo}</url>

  <licenses>
    <license>
      <name>ASF 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <!-- Github properties -->
    <github.user>cyChop</github.user>
    <github.repo>${project.artifactId}</github.repo>

    <!-- Compilation settings -->
    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Version management - test -->
    <junit.version>4.12</junit.version>
    <jdepend.version>2.9.1</jdepend.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.3</version>
      <scope>test</scope>
    </dependency>

    <!--<![CDATA[
         _____       _
        |_   _|__ __| |_
          | |/ -_|_-<  _|
          |_|\___/__/\__| ]]>-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>jdepend</groupId>
      <artifactId>jdepend</artifactId>
      <version>${jdepend.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- Default resources dir -->
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <excludes>
          <exclude>**/MessageBundle.properties</exclude>
        </excludes>
      </resource>
      <!-- Filter message bundle to add POM properties -->
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>**/MessageBundle.properties</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <!--<![CDATA[
             __  __           _  __        _
            |  \/  |__ _ _ _ (_)/ _|___ __| |_
            | |\/| / _` | ' \| |  _/ -_|_-<  _|
            |_|  |_\__,_|_||_|_|_| \___/__/\__| ]]>-->
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <!-- Include a manifest -->
              <manifest>
                <mainClass>org.keyboardplaying.dailytasks.Launcher</mainClass>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <url>${project.url}</url>
                <Build-Time>${maven.build.timestamp}</Build-Time>
                <X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
                <X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <!--<![CDATA[
       ___ _ _
      / __(_) |_ ___
      \__ \ |  _/ -_)
      |___/_|\__\___| ]]>-->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

  <!--<![CDATA[
         _   _              _
        /_\ | |__  ___ _  _| |_
       / _ \| '_ \/ _ \ || |  _|
      /_/ \_\_.__/\___/\_,_|\__| ]]>-->
  <scm>
    <url>https://github.com/${github.user}/${github.repo}</url>
    <connection>scm:git:https://github.com/${github.user}/${github.repo}.git</connection>
    <developerConnection>scm:git:git@github.com:${github.user}/${github.repo}.git</developerConnection>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/${github.user}/${github.repo}/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/${github.user}/${github.repo}</url>
  </ciManagement>
  <organization>
    <name>Keyboard Playing</name>
    <url>https://keyboardplaying.org</url>
  </organization>
  <developers>
    <developer>
      <id>cyChop</id>
      <name>Cyrille Chopelet</name>
      <email>cyrille dot chopelet at mines-nancy dot org</email>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>+1</timezone>
      <url>https://keyboardplaying.org</url>
    </developer>
  </developers>
</project>

redpajama_set_name: RedPajamaGithub


text:
package io.fabric8.dosgi;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import io.fabric8.dosgi.impl.EndpointDescription;
import io.fabric8.dosgi.impl.Manager;
import io.fabric8.dosgi.util.Utils;
import org.junit.Test;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.Constants;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class UtilsTest {

    @Test
    public void testXml() throws Exception {

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.OBJECTCLASS, new String[] { BundleActivator.class.getName() });
        props.put("protocols", new String[]{"foo", "bar"});
        props.put("ints", new int[]{1, 2, 3});
        props.put("endpoint.id", "identifier");
        props.put("service.imported.configs", Collections.<Object>singletonList(Manager.CONFIG));;
        EndpointDescription endpoint1 = new EndpointDescription(props);

        String xml = Utils.getEndpointDescriptionXML(endpoint1);

        EndpointDescription endpoint2 = Utils.getEndpointDescription(xml);

        assertNotNull(endpoint2);
        assertNotNull(endpoint2.getInterfaces());
        assertEquals(1, endpoint2.getInterfaces().size());
        assertEquals(BundleActivator.class.getName(), endpoint2.getInterfaces().get(0));
        assertEquals("identifier", endpoint2.getId());
        assertNotNull(endpoint2.getProperties().get("protocols"));
        assertEquals(2, ((String[]) endpoint2.getProperties().get("protocols")).length);
        assertEquals("foo", ((String[]) endpoint2.getProperties().get("protocols"))[0]);
        assertEquals("bar", ((String[]) endpoint2.getProperties().get("protocols"))[1]);
        assertNotNull(endpoint2.getProperties().get("ints"));
        assertEquals(3, ((int[]) endpoint2.getProperties().get("ints")).length);
        assertEquals(1, ((int[]) endpoint2.getProperties().get("ints"))[0]);
        assertEquals(2, ((int[]) endpoint2.getProperties().get("ints"))[1]);
        assertEquals(3, ((int[]) endpoint2.getProperties().get("ints"))[2]);
    }

}


text:
title: 'Parameters'
---

Parameters are a set of static, named metadata about a story, typically used to control the behavior of Storybook features and addons.

For example, let's customize the backgrounds addon via a parameter. We'll use `parameters.backgrounds` to define which backgrounds appear in the backgrounds toolbar when a story is selected.

## Story parameters

We can set a parameter for a single story with the `parameters` key on a CSF export:

<!-- prettier-ignore-start -->

<CodeSnippets
  paths={[
   'common/component-story-custom-params.js.mdx',
   'common/component-story-custom-params.mdx.mdx',
  ]}
/>

<!-- prettier-ignore-end -->

## Component parameters

We can set the parameters for all stories of a component using the `parameters` key on the default CSF export:

<!-- prettier-ignore-start -->

<CodeSnippets
  paths={[
    'react/button-story-with-blue-args.js.mdx',
    'react/button-story-with-blue-args.ts.mdx',
    'react/button-story-with-blue-args.mdx.mdx',
    'vue/button-story-with-blue-args.js.mdx',
    'vue/button-story-with-blue-args.mdx.mdx',
    'angular/button-story-with-blue-args.ts.mdx',
    'angular/button-story-with-blue-args.mdx.mdx',
    'svelte/button-story-with-blue-args.js.mdx',
    'svelte/button-story-with-blue-args.native-format.mdx',
    'svelte/button-story-with-blue-args.mdx.mdx',
    'web-components/button-story-with-blue-args.js.mdx',
  ]}
/>

<!-- prettier-ignore-end -->

## Global parameters

We can also set the parameters for **all stories** via the `parameters` export of your [`.storybook/preview.js`](../configure/overview.md#configure-story-rendering) file (this is the file where you configure all stories):

```js
// .storybook/preview.js

export const parameters = {
  backgrounds: {
    values: [
      { name: 'red', value: '#f00' },
      { name: 'green', value: '#0f0' },
    ],
  },
};
```

Setting a global parameter is a common way to configure addons. With backgrounds, you configure the list of backgrounds that every story can render in.

## Rules of parameter inheritance

The way the global, component and story parameters are combined is:

- More specific parameters take precedence (so a story parameter overwrites a component parameter which overwrites a global parameter).
- Parameters are **merged** so keys are only ever overwritten, never dropped.

The merging of parameters is important. It means it is possible to override a single specific sub-parameter on a per-story basis but still retain the majority of the parameters defined globally.

If you are defining an API that relies on parameters (e.g. an [**addon**](../addons/introduction.md)) it is a good idea to take this behavior into account.


text:
ACCEPTED

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

#### Published in
Dusenia 5: 192 (1954)

#### Original name
Paradiacheopsis curitibana Hertel, 1954

### Remarks
null


text:
package hudson.plugins.valgrind;

import hudson.plugins.analysis.core.AbstractHealthDescriptor;
import hudson.plugins.analysis.core.HealthDescriptor;
import hudson.plugins.analysis.util.model.AnnotationProvider;

import org.jvnet.localizer.Localizable;

/**
 * A health descriptor for FindBugs build results.
 *
 * @author Ulli Hafner
 */
public class LeaksHealthDescriptor extends AbstractHealthDescriptor {
    /** Unique ID of this class. */
    private static final long serialVersionUID = -3404826986876607396L;

    /**
     * Creates a new instance of {@link LeaksHealthDescriptor} based on the
     * values of the specified descriptor.
     *
     * @param healthDescriptor the descriptor to copy the values from
     */
    public LeaksHealthDescriptor(final HealthDescriptor healthDescriptor) {
        super(healthDescriptor);
    }

    /** {@inheritDoc} */
    @Override
    protected Localizable createDescription(final AnnotationProvider result) {
        if (result.getNumberOfAnnotations() == 0) {
            return Messages._Valgrind_ResultAction_HealthReportNoItem();
        }
        else if (result.getNumberOfAnnotations() == 1) {
            return Messages._Valgrind_ResultAction_HealthReportSingleItem();
        }
        else {
            return Messages._Valgrind_ResultAction_HealthReportMultipleItem(result.getNumberOfAnnotations());
        }
    }
}


text:
layout: post
title: Episode 1
date: 2017-08-12
categories:
description:
episode: true
image: /img/boom_boxes.jpg
image-sm: /img/boom_boxes.jpg
---
The world we live in is noisy.

I think it stands to reason, when a starting a new project, to ask yourself: does the world need more noise?


text:
@interface XKIssueManager ()
@property (nonnull, readwrite) IDEIssueManager *IDEIssueManager;

@end

@implementation XKIssueManager

- (nonnull instancetype)initWithIDEIssueManager:(nonnull IDEIssueManager *)IDEIssueManager {
    self = [super init];
    if (self) {
        _IDEIssueManager = IDEIssueManager;
    }

    return self;
}

- (NSMutableArray<IDEIssueProvider *> *)IDEIssueProviders {
    Class managerClass = NSClassFromString(@"IDEIssueManager");
    Ivar ivar = class_getInstanceVariable(managerClass, "_issueProviders");

    return object_getIvar(self.IDEIssueManager, ivar);
}

- (IDEIssueProvider *)IDEBuildIssueProvider {
    for (id provider in [self IDEIssueProviders]) {
        if ([provider isKindOfClass:[IDEBuildIssueProvider class]]) {
            return provider;
        }
    }

    return nil;
}

- (NSArray<IDEIssue *> *)IDEIssues {
    NSMutableArray *issues = [NSMutableArray array];

    for (NSString *documentURL in self.IDEIssueManager.documentURLsWithIssues) {
        [issues addObjectsFromArray:[self.IDEIssueManager issuesForDocumentURL:documentURL]];
    }

    [issues addObjectsFromArray:self.IDEIssueManager.issuesWithNoDocument];

    return [NSArray arrayWithArray:issues];
}

- (NSArray<XKIssue *> *)issues {
    NSMutableArray *issues = [NSMutableArray array];
    NSArray *IDEIssues = self.IDEIssues;
    for (IDEIssue *IDEIssue in IDEIssues) {
        [issues addObject:[[XKIssue alloc] initWithIDEIssue:IDEIssue]];
    }

    return [NSArray arrayWithArray:issues];
}

- (void)addIssue:(XKIssue *)issue {
    IDEIssueProvider *provider = self.IDEBuildIssueProvider;
    if (provider == nil) return;

    IDEIssue *IDEIssue = [issue IDEIssueForIssueProvider:provider];
    issue.IDEIssue = IDEIssue;

    NSSet *issues = [NSSet setWithObject:IDEIssue];

    IDEIssueProviderSession *session = [[IDEIssueProviderSession alloc] init];
    [self.IDEIssueManager _addIssues:issues forProviderContext:self.IDEIssueManager
                           container:nil
                           blueprint:nil
                             session:session
                       tryToCoalesce:NO];
}

- (void)removeIssue:(XKIssue *)issue {
    IDEIssue *IDEIssue = [self IDEIssueForXKIssue:issue];
    if (!IDEIssue) return;

    NSSet *issues = [NSSet setWithObject:IDEIssue];
    [self.IDEIssueManager _removeIssues:issues forProviderContext:self.IDEIssueManager session:nil];
}

- (void)clearAllIssues {
    NSSet *issuesSet = [NSSet setWithArray:[self IDEIssues]];
    [self removeIssues:issuesSet];
}

// TODO: Find a better way to identify generated issues
- (void)clearGeneratedIssues {
    NSMutableSet *generatedIssues = [NSMutableSet set];
    for (IDEIssue *issue in [self IDEIssues]) {
        if ([[issue issueTypeIdentifier] isEqualToString:@"Uncategorized"]) {
            [generatedIssues addObject:issue];
        }
    }
    [self removeIssues:generatedIssues];
}

- (void)removeIssues:(NSSet<IDEIssue *> *)issues {
    [self.IDEIssueManager _removeIssues:issues forProviderContext:self.IDEIssueManager session:nil];
}

- (IDEIssue *)IDEIssueForXKIssue:(XKIssue *)XKIssue {
    if (XKIssue.IDEIssue == nil) return XKIssue.IDEIssue;

    for (IDEIssue *issue in self.issues) {
        if ([issue.fullMessage isEqualToString:XKIssue.title]) {
            return issue;
        }
    }

    return nil;
}

@end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.desktopvirtualization.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of PrivateEndpointConnections. */
public interface PrivateEndpointConnections {
    /**
     * List private endpoint connections associated with hostpool.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of private endpoint connection associated with the specified storage account as paginated response
     *     with {@link PagedIterable}.
     */
    PagedIterable<PrivateEndpointConnectionWithSystemData> listByHostPool(
        String resourceGroupName, String hostPoolName);

    /**
     * List private endpoint connections associated with hostpool.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of private endpoint connection associated with the specified storage account as paginated response
     *     with {@link PagedIterable}.
     */
    PagedIterable<PrivateEndpointConnectionWithSystemData> listByHostPool(
        String resourceGroupName, String hostPoolName, Context context);

    /**
     * Get a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a private endpoint connection.
     */
    PrivateEndpointConnectionWithSystemData getByHostPool(
        String resourceGroupName, String hostPoolName, String privateEndpointConnectionName);

    /**
     * Get a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a private endpoint connection along with {@link Response}.
     */
    Response<PrivateEndpointConnectionWithSystemData> getByHostPoolWithResponse(
        String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context);

    /**
     * Remove a connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName);

    /**
     * Remove a connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    Response<Void> deleteByHostPoolWithResponse(
        String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context);

    /**
     * Approve or reject a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param connection Object containing the updated connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Private Endpoint Connection resource.
     */
    PrivateEndpointConnectionWithSystemData updateByHostPool(
        String resourceGroupName,
        String hostPoolName,
        String privateEndpointConnectionName,
        PrivateEndpointConnection connection);

    /**
     * Approve or reject a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param hostPoolName The name of the host pool within the specified resource group.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param connection Object containing the updated connection.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Private Endpoint Connection resource along with {@link Response}.
     */
    Response<PrivateEndpointConnectionWithSystemData> updateByHostPoolWithResponse(
        String resourceGroupName,
        String hostPoolName,
        String privateEndpointConnectionName,
        PrivateEndpointConnection connection,
        Context context);

    /**
     * List private endpoint connections.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of private endpoint connection associated with the specified storage account as paginated response
     *     with {@link PagedIterable}.
     */
    PagedIterable<PrivateEndpointConnectionWithSystemData> listByWorkspace(
        String resourceGroupName, String workspaceName);

    /**
     * List private endpoint connections.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of private endpoint connection associated with the specified storage account as paginated response
     *     with {@link PagedIterable}.
     */
    PagedIterable<PrivateEndpointConnectionWithSystemData> listByWorkspace(
        String resourceGroupName, String workspaceName, Context context);

    /**
     * Get a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a private endpoint connection.
     */
    PrivateEndpointConnectionWithSystemData getByWorkspace(
        String resourceGroupName, String workspaceName, String privateEndpointConnectionName);

    /**
     * Get a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a private endpoint connection along with {@link Response}.
     */
    Response<PrivateEndpointConnectionWithSystemData> getByWorkspaceWithResponse(
        String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context);

    /**
     * Remove a connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName);

    /**
     * Remove a connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    Response<Void> deleteByWorkspaceWithResponse(
        String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context);

    /**
     * Approve or reject a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param connection Object containing the updated connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Private Endpoint Connection resource.
     */
    PrivateEndpointConnectionWithSystemData updateByWorkspace(
        String resourceGroupName,
        String workspaceName,
        String privateEndpointConnectionName,
        PrivateEndpointConnection connection);

    /**
     * Approve or reject a private endpoint connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workspaceName The name of the workspace.
     * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
     *     resource.
     * @param connection Object containing the updated connection.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Private Endpoint Connection resource along with {@link Response}.
     */
    Response<PrivateEndpointConnectionWithSystemData> updateByWorkspaceWithResponse(
        String resourceGroupName,
        String workspaceName,
        String privateEndpointConnectionName,
        PrivateEndpointConnection connection,
        Context context);
}


text:
require 'spec_helper'

describe Mongoid::Ids::Finders do
  before :each do
  end

  it 'define a finder based on a field_name' do
    klass = Class.new
    field = :another_token
    Mongoid::Ids::Finders.define_custom_token_finder_for(klass, field)
    expect(klass.singleton_methods).to include(:"find_by_#{field}")
  end

  it 'don\'t override the `find` method of the document' do
    klass = Class.new
    klass.define_singleton_method(:find) { |*args| :original_find }
    klass.define_singleton_method(:find_by) { |*args| :token_find }

    Mongoid::Ids::Finders.define_custom_token_finder_for(klass)

    expect(klass.find(BSON::ObjectId.new)).to eq(:original_find)
    expect(klass.find(BSON::ObjectId.new, BSON::ObjectId.new)).to eq(:original_find)
    expect(klass.find()).to eq(:original_find)
    expect(klass.find(BSON::ObjectId.new, 'token')).to eq(:original_find)
    expect(klass.find('token')).to eq(:original_find)
  end

  it 'retrieve a document using the dynamic finder' do
    class Document; include Mongoid::Document; field :token; end
    document = Document.create!(token: '1234')
    Mongoid::Ids::Finders.define_custom_token_finder_for(Document)
    expect(Document.find_by_token('1234')).to eq(document)
  end

  it 'retrieve a document using the `find` method' do
    class AnotherDocument; include Mongoid::Document;  end
    document = AnotherDocument.create! :_id => '1234'
    Mongoid::Ids::Finders.define_custom_token_finder_for(AnotherDocument)
    expect(AnotherDocument.find('1234')).to eq(document)
  end
end


text:
RSpec.configure do |config|
  config.around(clean_with_transaction: false) do |example|
    self.use_transactional_tests = false
    example.run
    self.use_transactional_tests = true

    # Clean with DatabaseCleaner because it's the easiest way to clean everything without using transactions.
    # We don't use DatabaseCleaner for anything else.
    DatabaseCleaner.clean_with(:deletion)
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Saussurea 18:77. 1987

#### Original name
null

### Remarks
null


text:
<?php

namespace Assimp\Tests\Command\Result;

use Assimp\Command\Result\DumpResult;

/**
 * Test for Assimp DumpResult
 *
 * @author magdev
 */
class DumpResultTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Assimp\Command\Result\DumpResult
     */
    protected $object;

    /**
     * @see PHPUnit_Framework_TestCase::setUp()
     */
    protected function setUp()
    {
        $this->object = new DumpResult();
    }

    /**
     * @see PHPUnit_Framework_TestCase::tearDown()
     */
    protected function tearDown()
    {
    	$this->object = null;
    }

    /**
     * @covers \Assimp\Command\Result\DumpResult::parse
     */
    public function testParse()
    {
    	$testdata = array(
            'Launching asset import ...           OK',
            'Validating postprocessing flags ...  OK',
            'Importing file ...                   OK',
            '   import took approx. 0.11398 seconds',
            '',
            'assimp dump: Wrote output dump Fuss2.assbin',
        );

        $result = $this->object->setOutput($testdata);

        $this->assertArrayHasKey('launching_asset_import', $this->object->getOutput());
        $this->assertArrayHasKey('importing_file', $this->object->getOutput());
        $this->assertArrayHasKey('import_time', $this->object->getOutput());
        $this->assertArrayHasKey('output_file', $this->object->getOutput());
    }
}


text:
import logging

class LoggerFactory:

    """
    CRITICAL	50
    ERROR	40
    WARNING	30
    INFO	20
    DEBUG	10
    NOTSET	0
    """

    def __init__(self, logger_name: str, info_log: bool=True) -> None:
        self.logger = logging.getLogger(logger_name)
        self.logger_name = logger_name

        if info_log:
            self.settle_info()
        self.settle_warning()

    def _set_file(self, logger_name: str, level_name: str, level: int, log_format: str) -> None:
        file_handler = logging.FileHandler(f'{logger_name}_{level_name}.log')

        formatter = logging.Formatter(log_format)
        file_handler.setLevel(level)
        file_handler.setFormatter(formatter)
        self.logger.addHandler(file_handler)

    def settle_info(self) -> None:
        self._set_file(self.logger_name, "INFO", logging.INFO, '%(message)s')

    def settle_warning(self) -> None:
        self._set_file(self.logger_name, "WARNING", logging.WARNING,
                       '%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')


text:
__version__ = '0.4.0'

import sys

if sys.version_info[:2] < (2, 4):
    raise RuntimeError('PySMI requires Python 2.4 or later')


text:
#pragma once

#include "../../modelbase_api.h"

namespace Model {

class MODELBASE_API Attribute
{
	private:
		QString name_;
		QString type_;
		bool optional_;
		bool partial_;
		bool persistent_;

	public:
		Attribute();

		Attribute(QString name, QString type, bool optional, bool partial, bool persistent);

		/**
		 * Used for comparisons only.
		 */
		Attribute(QString name);

		const QString& name() const;
		const QString& type() const;
		bool optional() const;
		bool partial() const;
		bool persistent() const;

		bool operator==(const Attribute &other) const;
};

}


text:
"""Tests for fused_batch_norm related functionality in tensorflow.ops.nn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import tensorflow as tf

class BatchNormalizationTest(tf.test.TestCase):

  def _inference_ref(self, x, scale, offset, mean, var, epsilon, data_format):
    if data_format not in ['NHWC', 'NCHW']:
      raise ValueError('data_format must be NCHW or NHWC, '
                       'got %s.' % data_format)
    if data_format == 'NCHW':
      x = tf.transpose(x, [0, 2, 3, 1])
    y = tf.nn.batch_normalization(x, mean, var, offset, scale, epsilon)
    if data_format == 'NCHW':
      y = tf.transpose(y, [0, 3, 1, 2])
    return y.eval()

  def _test_inference(self,
                      x_shape,
                      scale_shape,
                      use_gpu=True,
                      data_format='NHWC'):
    np.random.seed(1)
    x_val = np.random.random_sample(x_shape).astype(np.float32)
    scale_val = np.random.random_sample(scale_shape).astype(np.float32)
    offset_val = np.random.random_sample(scale_shape).astype(np.float32)
    mean_val = np.random.random_sample(scale_shape).astype(np.float32)
    var_val = np.random.random_sample(scale_shape).astype(np.float32)

    with self.test_session(use_gpu=use_gpu) as sess:
      x = tf.constant(x_val, name='x')
      scale = tf.constant(scale_val, name='scale')
      offset = tf.constant(offset_val, name='offset')
      mean = tf.constant(mean_val, name='mean')
      var = tf.constant(var_val, name='variance')
      epsilon = 0.001
      y, _, _ = tf.nn.fused_batch_norm(
          x,
          scale,
          offset,
          mean=mean,
          variance=var,
          epsilon=epsilon,
          data_format=data_format,
          is_training=False)
      y_val = sess.run(y)
      y_ref = self._inference_ref(x, scale, offset, mean, var, epsilon,
                                  data_format)
    self.assertAllClose(y_ref, y_val, atol=1e-3)

  def _training_ref(self, x, scale, offset, epsilon, data_format):
    if data_format not in ['NHWC', 'NCHW']:
      raise ValueError('data_format must be NCHW or NHWC, '
                       'got %s.' % data_format)
    if data_format == 'NCHW':
      x = tf.transpose(x, [0, 2, 3, 1])
    mean, var = tf.nn.moments(x, [0, 1, 2], keep_dims=False)
    y = tf.nn.batch_normalization(x, mean, var, offset, scale, epsilon)
    if data_format == 'NCHW':
      y = tf.transpose(y, [0, 3, 1, 2])
    return y.eval(), mean.eval(), var.eval()

  def _test_training(self,
                     x_shape,
                     scale_shape,
                     use_gpu=True,
                     data_format='NHWC'):
    np.random.seed(1)
    x_val = np.random.random_sample(x_shape).astype(np.float32)
    scale_val = np.random.random_sample(scale_shape).astype(np.float32)
    offset_val = np.random.random_sample(scale_shape).astype(np.float32)
    with self.test_session(use_gpu=use_gpu) as sess:
      x = tf.constant(x_val, name='x')
      scale = tf.constant(scale_val, name='scale')
      offset = tf.constant(offset_val, name='offset')
      epsilon = 0.001
      y, mean, var = tf.nn.fused_batch_norm(
          x,
          scale,
          offset,
          epsilon=epsilon,
          data_format=data_format,
          is_training=True)
      y_val, mean_val, var_val = sess.run([y, mean, var])
      y_ref, mean_ref, var_ref = self._training_ref(x, scale, offset, epsilon,
                                                    data_format)
    self.assertAllClose(y_ref, y_val, atol=1e-3)
    self.assertAllClose(mean_ref, mean_val, atol=1e-3)
    # This is for Bessel's correction. tf.nn.moments uses n, instead of n-1, as
    # the denominator in the formula to calculate variance, while
    # tf.nn.fused_batch_norm has Bessel's correction built in.
    sample_size = x_val.size / scale_val.size
    var_ref = var_ref * sample_size / (max(sample_size - 1.0, 1.0))
    self.assertAllClose(var_ref, var_val, atol=1e-3)

  def _test_gradient(self,
                     x_shape,
                     scale_shape,
                     use_gpu=True,
                     data_format='NHWC'):
    np.random.seed(1)
    x_val = np.random.random_sample(x_shape).astype(np.float32)
    scale_val = np.random.random_sample(scale_shape).astype(np.float32)
    offset_val = np.random.random_sample(scale_shape).astype(np.float32)

    with self.test_session(use_gpu=use_gpu):
      x = tf.constant(x_val, name='x')
      scale = tf.constant(scale_val, name='scale')
      offset = tf.constant(offset_val, name='offset')
      y, _, _ = tf.nn.fused_batch_norm(
          x, scale, offset, data_format=data_format)
      err_x = tf.test.compute_gradient_error(x, x_shape, y, x_shape)
      err_scale = tf.test.compute_gradient_error(scale, scale_shape, y, x_shape)
      err_offset = tf.test.compute_gradient_error(offset, scale_shape, y,
                                                  x_shape)
    err_tolerance = 1e-3
    self.assertLess(err_x, err_tolerance)
    self.assertLess(err_scale, err_tolerance)
    self.assertLess(err_offset, err_tolerance)

  def testInference(self):
    x_shape = [1, 1, 6, 1]
    if tf.test.is_gpu_available():
      self._test_inference(x_shape, [1], use_gpu=True, data_format='NHWC')
      self._test_inference(x_shape, [1], use_gpu=True, data_format='NCHW')
    self._test_inference(x_shape, [1], use_gpu=False, data_format='NHWC')

    x_shape = [1, 1, 6, 2]
    if tf.test.is_gpu_available():
      self._test_inference(x_shape, [2], use_gpu=True, data_format='NHWC')
    self._test_inference(x_shape, [2], use_gpu=False, data_format='NHWC')

    x_shape = [1, 2, 1, 6]
    if tf.test.is_gpu_available():
      self._test_inference(x_shape, [2], use_gpu=True, data_format='NCHW')

    x_shape = [27, 131, 127, 6]
    if tf.test.is_gpu_available():
      self._test_inference(x_shape, [131], use_gpu=True, data_format='NCHW')
      self._test_inference(x_shape, [6], use_gpu=True, data_format='NHWC')
    self._test_inference(x_shape, [6], use_gpu=False, data_format='NHWC')

  def testTraining(self):
    x_shape = [1, 1, 6, 1]
    if tf.test.is_gpu_available():
      self._test_training(x_shape, [1], use_gpu=True, data_format='NHWC')
      self._test_training(x_shape, [1], use_gpu=True, data_format='NCHW')
    self._test_training(x_shape, [1], use_gpu=False, data_format='NHWC')

    x_shape = [1, 1, 6, 2]
    if tf.test.is_gpu_available():
      self._test_training(x_shape, [2], use_gpu=True, data_format='NHWC')
    self._test_training(x_shape, [2], use_gpu=False, data_format='NHWC')

    x_shape = [1, 2, 1, 6]
    if tf.test.is_gpu_available():
      self._test_training(x_shape, [2], use_gpu=True, data_format='NCHW')

    x_shape = [27, 131, 127, 6]
    if tf.test.is_gpu_available():
      self._test_training(x_shape, [131], use_gpu=True, data_format='NCHW')
      self._test_training(x_shape, [6], use_gpu=True, data_format='NHWC')
    self._test_training(x_shape, [6], use_gpu=False, data_format='NHWC')

  def testBatchNormGrad(self):
    x_shape = [1, 1, 6, 1]
    if tf.test.is_gpu_available():
      self._test_gradient(x_shape, [1], use_gpu=True, data_format='NHWC')
      self._test_gradient(x_shape, [1], use_gpu=True, data_format='NCHW')
    self._test_gradient(x_shape, [1], use_gpu=False, data_format='NHWC')

    x_shape = [1, 1, 6, 2]
    if tf.test.is_gpu_available():
      self._test_gradient(x_shape, [2], use_gpu=True, data_format='NHWC')
    self._test_gradient(x_shape, [2], use_gpu=False, data_format='NHWC')

    x_shape = [1, 2, 1, 6]
    if tf.test.is_gpu_available():
      self._test_gradient(x_shape, [2], use_gpu=True, data_format='NCHW')

    x_shape = [7, 9, 13, 6]
    if tf.test.is_gpu_available():
      self._test_gradient(x_shape, [9], use_gpu=True, data_format='NCHW')
      self._test_gradient(x_shape, [6], use_gpu=True, data_format='NHWC')
    self._test_gradient(x_shape, [6], use_gpu=False, data_format='NHWC')

if __name__ == '__main__':
  tf.test.main()


text:
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Tests\Integration\Services\CRM\Deal\Service;

use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Exceptions\TransportException;
use Bitrix24\SDK\Services\CRM\Deal\Service\Deal;
use Bitrix24\SDK\Tests\Integration\Fabric;
use PHPUnit\Framework\TestCase;

/**
 * Class DealsTest
 *
 * @package Bitrix24\SDK\Tests\Integration\Services\CRM\Deals\Service
 */
class DealTest extends TestCase
{
    protected Deal $dealService;

    /**
     * @throws BaseException
     * @throws TransportException
     * @covers Deal::add
     */
    public function testAdd(): void
    {
        self::assertGreaterThan(1, $this->dealService->add(['TITLE' => 'test deal'])->getId());
    }

    /**
     * @throws BaseException
     * @throws TransportException
     * @covers Deal::delete
     */
    public function testDelete(): void
    {
        self::assertTrue($this->dealService->delete($this->dealService->add(['TITLE' => 'test deal'])->getId())->isSuccess());
    }

    /**
     * @covers Deal::fields
     * @throws BaseException
     * @throws TransportException
     */
    public function testFields(): void
    {
        self::assertIsArray($this->dealService->fields()->getFieldsDescription());
    }

    /**
     * @throws BaseException
     * @throws TransportException
     * @covers Deal::get
     */
    public function testGet(): void
    {
        self::assertGreaterThan(
            1,
            $this->dealService->get($this->dealService->add(['TITLE' => 'test deal'])->getId())->deal()->ID
        );
    }

    /**
     * @throws BaseException
     * @throws TransportException
     * @covers Deal::list
     */
    public function testList(): void
    {
        $this->dealService->add(['TITLE' => 'test']);
        self::assertGreaterThanOrEqual(1, $this->dealService->list([], [], ['ID', 'TITLE', 'TYPE_ID'])->getDeals());
    }

    public function testUpdate(): void
    {
        $deal = $this->dealService->add(['TITLE' => 'test']);
        $newTitle = 'test2';

        self::assertTrue($this->dealService->update($deal->getId(), ['TITLE' => $newTitle], [])->isSuccess());
        self::assertEquals($newTitle, $this->dealService->get($deal->getId())->deal()->TITLE);
    }

    /**
     * @throws \Bitrix24\SDK\Core\Exceptions\BaseException
     * @throws \Bitrix24\SDK\Core\Exceptions\TransportException
     * @covers \Bitrix24\SDK\Services\CRM\Deal\Service\Deal::countByFilter
     */
    public function testCountByFilter(): void
    {
        $before = $this->dealService->countByFilter();

        $newDealsCount = 60;
        $deals = [];
        for ($i = 1; $i <= $newDealsCount; $i++) {
            $deals[] = ['TITLE' => 'TITLE-' . $i];
        }
        $cnt = 0;
        foreach ($this->dealService->batch->add($deals) as $item) {
            $cnt++;
        }
        self::assertEquals(count($deals), $cnt);

        $after = $this->dealService->countByFilter();

        $this->assertEquals($before + $newDealsCount, $after);
    }

    public function setUp(): void
    {
        $this->dealService = Fabric::getServiceBuilder()->getCRMScope()->deal();
    }
}


text:
'use strict';

const Audit = require('../../../audits/accessibility/image-alt.js');
const assert = require('assert');

/* eslint-env mocha */

describe('Accessibility: image-alt audit', () => {
  it('generates an audit output', () => {
    const artifacts = {
      Accessibility: {
        violations: [{
          id: 'image-alt',
          nodes: [],
          help: 'http://example.com/',
        }],
      },
    };

    const output = Audit.audit(artifacts);
    assert.equal(output.rawValue, false);
  });

  it('generates an audit output (single node)', () => {
    const artifacts = {
      Accessibility: {
        violations: [{
          id: 'image-alt',
          nodes: [{}],
          help: 'http://example.com/',
        }],
      },
    };

    const output = Audit.audit(artifacts);
    assert.equal(output.rawValue, false);
  });
});


text:
import _plotly_utils.basevalidators

class SectorValidator(_plotly_utils.basevalidators.InfoArrayValidator):
    def __init__(self, plotly_name="sector", parent_name="layout.polar", **kwargs):
        super(SectorValidator, self).__init__(
            plotly_name=plotly_name,
            parent_name=parent_name,
            edit_type=kwargs.pop("edit_type", "plot"),
            items=kwargs.pop(
                "items",
                [
                    {"valType": "number", "editType": "plot"},
                    {"valType": "number", "editType": "plot"},
                ],
            ),
            role=kwargs.pop("role", "info"),
            **kwargs
        )


text:
package edu.pitt.apollo.examples.runsimulationmessages;

import edu.pitt.apollo.services_common.v3_0_2.Authentication;
import edu.pitt.apollo.services_common.v3_0_2.SoftwareIdentification;
import edu.pitt.apollo.simulator_service_types.v3_0_2.RunSimulationMessage;
import edu.pitt.apollo.types.v3_0_2.*;

import java.util.GregorianCalendar;
import java.util.List;
import java.util.Set;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

/**
 *
 * Author: Nick Millett
 Email: nick.millett@gmail.com
 Date: Sep 3, 2014
 Time: 10:28:35 AM
 Class: AbstractRunSimulationMessageBuilder
 */
public abstract class AbstractRunSimulationMessageBuilder {

	public enum ControlMeasureTypeEnum {

		NO_AV_CM, AV_CM, NO_VACC_CM, VACC_CM, ALL_SC_CM_FIXED, ALL_SC_CM_REACTIVE,
		INDIVIDUAL_SC_CM_FIXED, INDIVIDUAL_SC_CM_REACTIVE, NO_SC_CM, NO_VI_CM, VI_CM,
		NO_VQ_CM, VQ_CM, NO_LSL_CM, LSL_CM, NO_DRUG_CM, DRUG_CM, WOLBACHIA,
		INDOOR_RESIDUAL_SPRAYING, LARVICIDE, CONTAINER_REDUCTION, INSECTICIDE_TREATED_NET;
	}

	public enum DefReproductionNumber {

		R0, GES, BETA, TRANSMISSION_PROBABILITY;
	}

	protected abstract SoftwareIdentification getSoftwareIdentification();

	protected abstract SimulatorTimeSpecification getSimulatorTimeSpeficiation();

	protected abstract List<Infection> getInfections();

	protected abstract List<Population> getPopulations();

	protected abstract Location getLocation();

	protected abstract Authentication getAuthentication();

	public abstract RunSimulationMessage getRunSimulationMessage(Set<ControlMeasureTypeEnum> controlMeasureTypes);

	protected RunSimulationMessage getBaseRunSimulationMessage() {

		RunSimulationMessage message = new RunSimulationMessage();

		message.setSoftwareIdentification(getSoftwareIdentification());
		message.setSimulatorTimeSpecification(getSimulatorTimeSpeficiation());
		message.setAuthentication(getAuthentication());
		message.setInfectiousDiseaseScenario(getBaseInfectiousDiseaseScenario());

		return message;
	}

	protected InfectiousDiseaseScenario getBaseInfectiousDiseaseScenario() {

		InfectiousDiseaseScenario scenario = new InfectiousDiseaseScenario();
		scenario.getInfections().addAll(getInfections());
		scenario.getPopulations().addAll(getPopulations());
		scenario.setScenarioDate(getDate());
        scenario.setScenarioLocation(getLocation());

		return scenario;
	}

	protected XMLGregorianCalendar getDate() {
		XMLGregorianCalendar date;
		try {
			GregorianCalendar c = new GregorianCalendar();
			c.set(2009, 8, 8);
			date = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
		} catch (DatatypeConfigurationException ex) {
			throw new RuntimeException("Datatype configuration exception in SimulatorConfigurationFactory");
		}

		return date;
	}

	protected void setBaseInfectiousDiseaseControlStrategy(InfectiousDiseaseControlStrategy strategy) {

		FixedDuration responseDelay = new FixedDuration();
		responseDelay.setValue(1d);
		responseDelay.setUnitOfTime(UnitOfTimeEnum.DAY);
		strategy.setControlStrategyResponseDelay(responseDelay);

		FixedDuration standDownDelay = new FixedDuration();
		standDownDelay.setValue(10d);
		standDownDelay.setUnitOfTime(UnitOfTimeEnum.DAY);
		strategy.setControlStrategyStandDownDelay(standDownDelay);

		FixedDuration startDuration = new FixedDuration();
		startDuration.setValue(0d);
		startDuration.setUnitOfTime(UnitOfTimeEnum.DAY);

		TemporalTriggerDefinition time = new TemporalTriggerDefinition();
		time.setTimeScale(TimeScaleEnum.SIMULATOR_TIME_SCALE);
		time.setTimeSinceTimeScaleZero(startDuration);
		strategy.getControlStrategyStartTime().add(time);

		strategy.setDescription("base infectious disease control strategy");

		strategy.setLocation(getLocation());

	}
}


text:
namespace bx
{
    typedef SOCKET SocketId;
}

#   define SOCK_NULL INVALID_SOCKET
#   define SOCK_ERROR SOCKET_ERROR
#else
namespace bx
{
    typedef int SocketId;
}

#   define SOCK_NULL -1
#   define SOCK_ERROR -1
#endif

namespace bx
{
    enum class SocketType
    {
        UDP,
        TCP
    };

    enum class SocketAddrType
    {
        IPv4,
        IPv6
    };

    class SocketAddr
    {
    public:
        SocketAddrType type;
        int port;

        union AddrIP
        {
            struct IPv4
            {
                uint32_t ip;
            } v4;

            struct IPv6
            {
                uint8_t ip[16];
            } v6;
        } addr;

    public:
        SocketAddr(uint32_t ip4, int port);
        SocketAddr(uint8_t ip6[16], int port);

        String64 ipToString() const;
        bool isValid() const;
    };

    class Socket
    {
    protected:
        Socket();
        virtual ~Socket();

    public:
        bool setBufferedWrite(int size, AllocatorI* alloc);
        void setBufferedWritePtr(void* buffer, int size);

        bool pollRead(int timeoutMs) const;
        bool pollWrite(int timeoutMs) const;

        void close();
        bool isOpen() const;

        virtual void flush() = 0;

    protected:
        uint8_t* m_buffer;
        int m_bufferSize;
        int m_bufferOffset;
        AllocatorI* m_alloc;
        SocketId m_sock;
    };

    class SocketTCP : public Socket, ReaderI, WriterI
    {
    public:
        SocketTCP();
        virtual ~SocketTCP();

        bool listen(int port);
        SocketTCP accept();
        bool connect(const SocketAddr& addr);
        const SocketAddr& getPeerAddr() const { return m_peerAddr; }

        int32_t read(void* data, int32_t size, Error* err = nullptr) override;
        int32_t write(const void* data, int32_t size, Error* err = nullptr) override;

        void flush() override;

    private:
        SocketAddr m_peerAddr;
    };

    class SocketUDP : public Socket, ReaderI, WriterI
    {
    public:
        SocketUDP();
        virtual ~SocketUDP();

        bool bind(int port);
        void setRemoteAddr(const SocketAddr& addr);
        const SocketAddr& getRemoteAddr() const { return m_remoteAddr; }

        int32_t read(void* data, int32_t size, Error* err = nullptr) override;
        int32_t write(const void* data, int32_t size, Error* err = nullptr) override;

        void flush() override;

    private:
        SocketAddr m_remoteAddr;
    };

    // Globals
    const char* getHostName();
    String64 resolveDNS(const char* server_name);
    uint32_t strToIp4(const char* addr);
    SocketAddr::AddrIP::IPv6 strToIp6(const char* addr);
}

#ifdef BX_IMPLEMENT_SOCKETS
#   undef BX_IMPLEMENT_SOCKETS
#   include <cassert>

#if !BX_PLATFORM_WINDOWS
#   include <sys/socket.h>
#   include <netinet/in.h>
#   include <arpa/inet.h>
#   include <unistd.h>
#   include <netdb.h>

#   define closesocket ::close
#   define INET6_ADDR(a)   a.__in6_u.__u6_addr8
#else
#   include <Ws2tcpip.h>

#define inet_ntop InetNtop
#   define INET6_ADDR(a)   a.u.Byte
 typedef int socklen_t;

static const char *inet_ntop(int af, const void *src, char *dst, socklen_t size)
{
    struct sockaddr_storage ss;
    unsigned long s = size;

    bx::memSet(&ss, 0x00, sizeof(ss));
    ss.ss_family = af;

    switch (af) {
    case AF_INET:
        ((sockaddr_in*)&ss)->sin_addr = *(struct in_addr*)src;
        break;
    case AF_INET6:
        ((sockaddr_in6*)&ss)->sin6_addr = *(struct in6_addr*)src;
        break;
    default:
        return NULL;
    }
    // cannot direclty use &size because of strict aliasing rules
    return (WSAAddressToString((sockaddr*)&ss, sizeof(ss), NULL, dst, &s) == 0) ? dst : NULL;
}

namespace bx {
    typedef int socklen_t;
}
#endif

namespace bx
{
    SocketAddr::SocketAddr(uint32_t ip4, int port)
    {
        this->type = SocketAddrType::IPv4;
        bx::memSet(this->addr.v6.ip, 0x00, sizeof(this->addr.v6.ip));
        this->addr.v4.ip = ip4;
        this->port = port;
    }

    SocketAddr::SocketAddr(uint8_t ip6[], int port)
    {
        this->type = SocketAddrType::IPv6;
        memcpy(this->addr.v6.ip, ip6, sizeof(this->addr.v6.ip));
        this->port = port;
    }

    String64 SocketAddr::ipToString() const
    {
        String64 r;
        if (this->type == SocketAddrType::IPv4) {
            in_addr a;
            a.s_addr = htonl(this->addr.v4.ip);
            inet_ntop(AF_INET, &a, r.getBuffer(), sizeof(r));
        } else if (this->type == SocketAddrType::IPv6) {
            in6_addr a;
            memcpy(INET6_ADDR(a), this->addr.v6.ip, sizeof(this->addr.v6.ip));
            inet_ntop(AF_INET6, &a, r.getBuffer(), sizeof(r));
        }
        return r;
    }

    bool SocketAddr::isValid() const
    {
        if (this->type == SocketAddrType::IPv4) {
            return this->addr.v4.ip != 0;
        } else if (this->type == SocketAddrType::IPv6) {
            const char zero[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            return memcmp(this->addr.v6.ip, zero, sizeof(this->addr.v6.ip)) == 0;
        }
        return false;
    }

    uint32_t strToIp4(const char* addr)
    {
        in_addr a;
        inet_pton(AF_INET, addr, &a);
        return (uint32_t)ntohl(a.s_addr);
    }

    SocketAddr::AddrIP::IPv6 strToIp6(const char* addr)
    {
        in6_addr a;
        inet_pton(AF_INET6, addr, &a);
        SocketAddr::AddrIP::IPv6 r;
        memcpy(r.ip, INET6_ADDR(a), sizeof(r.ip));
        return r;

    }

    // Socket
    Socket::Socket()
    {
        m_buffer = nullptr;
        m_bufferSize = 0;
        m_bufferOffset = 0;
        m_alloc = nullptr;
        m_sock = SOCK_NULL;
    }

    Socket::~Socket()
    {
        BX_ASSERT(m_buffer == nullptr);
        BX_ASSERT(m_sock == SOCK_NULL);
    }

    bool Socket::setBufferedWrite(int size, AllocatorI* alloc)
    {
        BX_ASSERT(alloc);
        BX_ASSERT(size);

        m_buffer = (uint8_t*)BX_ALLOC(alloc, size);
        if (!m_buffer)
            return false;

        m_bufferSize = size;
        m_bufferOffset = 0;

        return true;
    }

    void Socket::setBufferedWritePtr(void* buffer, int size)
    {
        BX_ASSERT(buffer);
        BX_ASSERT(size);

        m_buffer = (uint8_t*)buffer;
        m_bufferSize = size;
        m_bufferOffset = 0;
    }

    bool Socket::pollRead(int timeoutMs) const
    {
        BX_ASSERT(m_sock != SOCK_NULL);
        SocketId sock = m_sock;

        timeval tmout = { timeoutMs / 1000, (timeoutMs % 1000) * 1000 };
        fd_set readset;
        FD_ZERO(&readset);
        FD_SET(sock, &readset);

        if (select((int)(sock + 1), &readset, NULL, NULL, &tmout) > 0 && FD_ISSET(sock, &readset))
            return true;

        return false;
    }

    bool Socket::pollWrite(int timeoutMs) const
    {
        BX_ASSERT(m_sock != SOCK_NULL);
        SocketId sock = m_sock;

        timeval tmout = { timeoutMs / 1000, (timeoutMs % 1000) * 1000 };
        fd_set writeset;
        FD_ZERO(&writeset);
        FD_SET(sock, &writeset);

        if (select((int)(sock + 1), NULL, &writeset, NULL, &tmout) > 0 && FD_ISSET(sock, &writeset))
            return true;

        return false;
    }

    void Socket::close()
    {
        flush();

        if (m_buffer && m_alloc)
            BX_FREE(m_alloc, m_buffer);
        m_buffer = nullptr;
        m_alloc = nullptr;

        if (m_sock != SOCK_NULL) {
            closesocket(m_sock);
            m_sock = SOCK_NULL;
        }
    }

    bool Socket::isOpen() const
    {
        return m_sock != SOCK_NULL;
    }

    // SocketTCP
    SocketTCP::SocketTCP() : m_peerAddr((uint32_t)0, 0)
    {

    }

    SocketTCP::~SocketTCP()
    {
    }

    bool SocketTCP::listen(int port)
    {
        BX_ASSERT(m_sock == SOCK_NULL);

        // Create socket
        m_sock = ::socket(AF_INET, SOCK_STREAM, 0);
        if (m_sock == SOCK_NULL)
            return false;

        // Listen
        sockaddr_in addr;
        bx::memSet(&addr, 0x00, sizeof(addr));

        addr.sin_family = AF_INET;
        addr.sin_port = htons(port);
        addr.sin_addr.s_addr = htonl(INADDR_ANY);

        if (::bind(m_sock, (sockaddr*)&addr, sizeof(addr)) == SOCK_ERROR) {
            close();
            return false;
        }

        if (::listen(m_sock, 1) == SOCK_ERROR) {
            close();
            return false;
        }

        return true;
    }

    SocketTCP SocketTCP::accept()
    {
        SocketTCP r;
        sockaddr_in addr;
        socklen_t addrlen = sizeof(addr);
        r.m_sock = ::accept(m_sock, (sockaddr*)&addr, &addrlen);

        // Save Peer address
        if (r.isOpen())
            r.m_peerAddr = SocketAddr(ntohl(addr.sin_addr.s_addr), ntohs(addr.sin_port));

        return r;
    }

    bool SocketTCP::connect(const SocketAddr& addr)
    {
        BX_ASSERT(m_sock == SOCK_NULL);

        if (addr.type == SocketAddrType::IPv4) {
            // Create IP4 socket
            m_sock = ::socket(AF_INET, SOCK_STREAM, 0);
            if (m_sock == SOCK_NULL)
                return false;

            // Connect
            sockaddr_in sa;
            bx::memSet(&sa, 0x00, sizeof(sa));
            sa.sin_family = AF_INET;
            sa.sin_port = htons(addr.port);
            sa.sin_addr.s_addr = htonl(addr.addr.v4.ip);
            int r = ::connect(m_sock, (const sockaddr*)&sa, sizeof(sa));

            if (r != SOCK_ERROR)
                m_peerAddr = addr;
            else
                close();

            return r != SOCK_ERROR;
        } else if (addr.type == SocketAddrType::IPv6) {
            // Create IP6 socket
            m_sock = ::socket(AF_INET6, SOCK_STREAM, 0);
            if (m_sock == SOCK_NULL)
                return false;

            // Connect
            sockaddr_in6 sa;
            bx::memSet(&sa, 0x00, sizeof(sa));
            sa.sin6_family = AF_INET6;
            sa.sin6_port = htons(addr.port);
            memcpy(INET6_ADDR(sa.sin6_addr), addr.addr.v6.ip, sizeof(addr.addr.v6.ip));
            int r = ::connect(m_sock, (const sockaddr*)&sa, sizeof(sa));

            if (r != SOCK_ERROR)
                m_peerAddr = addr;
            else
                close();

            return r != SOCK_ERROR;
        }

        BX_ASSERT(0);
        return false;
    }

    int32_t SocketTCP::read(void* data, int32_t size, Error* err)
    {
        if (m_sock == SOCK_NULL)
            return -1;

        return (int)::recv(m_sock, (char*)data, size, 0);
    }

    int32_t SocketTCP::write(const void* data, int32_t size, Error* err)
    {
        if (m_sock == SOCK_NULL)
            return -1;

        // Buffered write
        if (m_buffer) {
            if (m_bufferSize >= (m_bufferOffset + size)) {
                memcpy(m_buffer + m_bufferOffset, data, size);
                m_bufferOffset += size;
                // Reached the end, flush
                if (m_bufferOffset == m_bufferSize)
                    flush();
            } else if (m_bufferSize < size) {
                flush();
                return (int)::send(m_sock, (const char*)data, size, 0);
            } else {
                int remain = m_bufferSize - m_bufferOffset;
                memcpy(m_buffer + m_bufferOffset, data, remain);
                flush();
                memcpy(m_buffer, (uint8_t*)data + remain, size - remain);
                m_bufferOffset += (size - remain);
            }
        } else {
            return (int)::send(m_sock, (const char*)data, size, 0);
        }

        return 0;
    }

    void SocketTCP::flush()
    {
        if (m_bufferOffset && m_sock != SOCK_NULL) {
            ::send(m_sock, (const char*)m_buffer, m_bufferOffset, 0);
            m_bufferOffset = 0;
        }
    }

    // SocketUDP
    SocketUDP::SocketUDP() : m_remoteAddr((uint32_t)0, 0)
    {
    }

    SocketUDP::~SocketUDP()
    {
    }

    bool SocketUDP::bind(int port)
    {
        BX_ASSERT(m_sock == SOCK_NULL);

        // Create socket
        m_sock = ::socket(AF_INET, SOCK_DGRAM, 0);
        if (m_sock == SOCK_NULL)
            return false;

        // Bind
        sockaddr_in addr;
        bx::memSet(&addr, 0x00, sizeof(addr));
        addr.sin_family = AF_INET;
        addr.sin_port = htons(port);
        addr.sin_addr.s_addr = htonl(INADDR_ANY);

        if (::bind(m_sock, (sockaddr*)&addr, sizeof(addr)) == SOCK_ERROR)
            return false;

        return true;
    }

    void SocketUDP::setRemoteAddr(const SocketAddr& addr)
    {
        m_remoteAddr = addr;
    }

    int32_t SocketUDP::read(void* data, int32_t size, Error* err)
    {
        if (m_sock == SOCK_NULL)
            return -1;

        sockaddr_storage addr;
        bx::memSet(&addr, 0x00, sizeof(sockaddr_storage));
        socklen_t addrlen = sizeof(addr);

        int r = (int)::recvfrom(m_sock, (char*)data, size, 0, (sockaddr*)&addr, &addrlen);

        // Update remote address
        if (r) {
            if (addr.ss_family == AF_INET) {
                m_remoteAddr = SocketAddr(((sockaddr_in*)&addr)->sin_addr.s_addr,
                                          ntohs(((sockaddr_in*)&addr)->sin_port));
            } else if (addr.ss_family == AF_INET6) {
                m_remoteAddr = SocketAddr(INET6_ADDR(((sockaddr_in6*)&addr)->sin6_addr),
                                          ntohs(((sockaddr_in6*)&addr)->sin6_port));
            }
        }

        return r;
    }

    int32_t SocketUDP::write(const void* data, int32_t size, Error* err)
    {
        if (!m_remoteAddr.isValid())
            return -1;

        // Create socket
        if (m_sock == SOCK_NULL) {
            m_sock = ::socket(m_remoteAddr.type == SocketAddrType::IPv4 ? AF_INET : AF_INET6, SOCK_DGRAM, 0);
            if (m_sock == SOCK_NULL)
                return -1;
        }

        int write_bytes = size;

        // Prepare remote address for Berkley socket
        sockaddr_storage addr;
        bx::memSet(&addr, 0x00, sizeof(addr));
        socklen_t addr_len;
        if (m_remoteAddr.type == SocketAddrType::IPv4) {
            addr.ss_family = AF_INET;
            ((sockaddr_in*)&addr)->sin_addr.s_addr = htonl(m_remoteAddr.addr.v4.ip);
            ((sockaddr_in*)&addr)->sin_port = htons(m_remoteAddr.port);
            addr_len = sizeof(sockaddr_in);
        } else {
            addr.ss_family = AF_INET6;
            memcpy(INET6_ADDR(((sockaddr_in6*)&addr)->sin6_addr), m_remoteAddr.addr.v6.ip, sizeof(m_remoteAddr.addr.v6.ip));
            ((sockaddr_in6*)&addr)->sin6_port = htons(m_remoteAddr.port);
            addr_len = sizeof(sockaddr_in6);
        }

        // Buffered write
        if (m_buffer) {
            if (m_bufferSize >= (m_bufferOffset + write_bytes)) {
                memcpy(m_buffer + m_bufferOffset, data, write_bytes);
                m_bufferOffset += write_bytes;
                // Reached the end, flush
                if (m_bufferOffset == m_bufferSize)
                    flush();
            } else if (m_bufferSize < write_bytes) {
                flush();
                return (int)::sendto(m_sock, (const char*)data, write_bytes, 0, (sockaddr*)&addr, addr_len);
            } else {
                int remain = m_bufferSize - m_bufferOffset;
                memcpy(m_buffer + m_bufferOffset, data, remain);
                flush();
                memcpy(m_buffer, (uint8_t*)data + remain, write_bytes - remain);
                m_bufferOffset += (write_bytes - remain);
            }
        } else {
            return (int)::sendto(m_sock, (const char*)data, write_bytes, 0, (sockaddr*)&addr, addr_len);
        }
        return 0;
    }

    void SocketUDP::flush()
    {
        if (!m_remoteAddr.isValid())
            return;

        if (m_bufferOffset && m_sock != SOCK_NULL) {
            // Prepare remote address for Berkley socket
            sockaddr_storage addr;
            socklen_t addr_len;
            bx::memSet(&addr, 0x00, sizeof(addr));
            if (m_remoteAddr.type == SocketAddrType::IPv4) {
                addr.ss_family = AF_INET;
                ((sockaddr_in*)&addr)->sin_addr.s_addr = htonl(m_remoteAddr.addr.v4.ip);
                ((sockaddr_in*)&addr)->sin_port = htons(m_remoteAddr.port);
                addr_len = sizeof(sockaddr_in);
            } else {
                addr.ss_family = AF_INET6;
                memcpy(INET6_ADDR(((sockaddr_in6*)&addr)->sin6_addr), m_remoteAddr.addr.v6.ip,
                       sizeof(m_remoteAddr.addr.v6.ip));
                ((sockaddr_in6*)&addr)->sin6_port = htons(m_remoteAddr.port);
                addr_len = sizeof(sockaddr_in6);
            }

            // Send
            ::sendto(m_sock, (const char*)m_buffer, m_bufferOffset, 0, (sockaddr*)&addr, addr_len);
            m_bufferOffset = 0;
        }
    }

}   // namespace: bx

#endif  // if BX_IMPLEMENT_SOCKETS


text:
<template name="outcomes">

{{ dict 'outcomes.title' }}

      {{{ dict 'outcomes.content' }}}

</template>


text:
<?php
namespace Exar\TestClasses\Annotation;

use Exar\Annotation\Annotation;

/**
 * @Target("class")
 */
class CustomAnnotation extends Annotation {

}


text:
<?php

namespace OpenstoreSchema\Core\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity
 * @ORM\Table(
 *   name="country",
 *   uniqueConstraints={
 *     @ORM\UniqueConstraint(name="unique_reference_idx",columns={"reference"}),
 *     @ORM\UniqueConstraint(name="unique_legacy_mapping_idx",columns={"legacy_mapping"}),
 *   },
 *   options={
 *      "comment" = "Country table",
 *      "charset"="utf8mb4",
 *      "collate"="utf8mb4_unicode_ci"
 *   }
 * )
 */
class Country
{
    /**
     * @ORM\Id
     * @ORM\Column(name="country_id", type="smallint", nullable=false, options={"unsigned"=true})
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $country_id;

    /**
     * @ORM\Column(type="string", length=2, nullable=false, options={"comment" = "ISO country code"})
     */
    private $reference;

    /**
     * @ORM\Column(type="string", length=40, nullable=false)
     */
    private $name;

    /**
     * @ORM\Column(type="boolean", nullable=false, options={"default"=1, "comment"="Whether the brand is country in public website"})
     */
    private $flag_active;

    /**
     * @ORM\Column(type="string", length=40, nullable=true)
     */
    private $icon_class;

    /**
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(type="datetime", nullable=true, options={"comment" = "Record creation timestamp"})
     */
    private $created_at;

    /**
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(type="datetime", nullable=true, options={"comment" = "Record last update timestamp"})
     */
    private $updated_at;

    /**
     * @Gedmo\Blameable(on="create")
     * @ORM\Column(type="string", length=40, nullable=true, options={"comment" = "Creator name"})
     */
    private $created_by;

    /**
     * @Gedmo\Blameable(on="update")
     * @ORM\Column(type="string", length=40, nullable=true, options={"comment" = "Last updater name"})
     */
    private $updated_by;

    /**
     * @ORM\Column(type="string",length=40,nullable=true, options={"comment" = "Unique reference of this record taken from legacy system"})
     */
    protected $legacy_mapping;

    /**
     * @ORM\Column(type="datetime",nullable=true, options={"comment" = "Last synchro timestamp"})
     */
    protected $legacy_synchro_at;

    public function __construct()
    {
        /*
         * Default value for flag_active
         */
        $this->flag_active = true;
    }

    /**
     * @param int $country_id
     */
    public function setCountryId($country_id)
    {
        $this->country_id = $country_id;
    }

    /**
     * @return int
     */
    public function getCountryId()
    {
        return $this->country_id;
    }

    /**
     * Set reference.
     *
     * @param string $reference
     */
    public function setReference($reference)
    {
        $this->reference = $reference;
    }

    /**
     * Return reference.
     *
     * @return string
     */
    public function getReference()
    {
        return $this->reference;
    }

    /**
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    public function setIconClass($icon_class)
    {
        $this->icon_class = $icon_class;
    }

    /**
     * @return string
     */
    public function getIconClass()
    {
        return $this->icon_class;
    }

    /**
     * @return bool
     */
    public function getFlagActive()
    {
        return (bool) $this->flag_active;
    }

    public function setFlagActive($flag_active)
    {
        $this->flag_active = $flag_active;
    }

    /**
     * @return string
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * @param string $created_at
     */
    public function setCreatedAt($created_at)
    {
        $this->created_at = $created_at;
    }

    /**
     * @return string
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * @param string $updated_at
     */
    public function setUpdatedAt($updated_at)
    {
        $this->updated_at = $updated_at;
    }

    public function getCreatedBy(): ?string
    {
        return $this->created_by;
    }

    public function setCreatedBy(string $created_by): void
    {
        $this->created_by = $created_by;
    }

    public function getUpdatedBy(): ?string
    {
        return $this->updated_by;
    }

    public function setUpdatedBy(string $updated_by): void
    {
        $this->updated_by = $updated_by;
    }

    /**
     * Return legacy mapping.
     *
     * @return string $legacy_mapping
     */
    public function getLegacyMapping()
    {
        return $this->legacy_mapping;
    }

    /**
     * Set a legacy mapping for this record.
     *
     * @param string $legacy_mapping
     */
    public function setLegacyMapping($legacy_mapping)
    {
        $this->legacy_mapping = $legacy_mapping;
    }

    /**
     * Set legacy synchro time.
     *
     * @param string $legacy_synchro_at
     */
    public function setLegacySynchroAt($legacy_synchro_at)
    {
        $this->legacy_synchro_at = $legacy_synchro_at;
    }

    /**
     * Return legacy synchro timestamp.
     *
     * @return string
     */
    public function getLegacySynchroAt()
    {
        return $this->legacy_synchro_at;
    }
}


text:
<!DOCTYPE html>

{% include head.md %}

{% include common-header.md %}

        English

        Go to GitHub

{% include main-ja.md %}
{% include footer.md %}


text:
from __future__ import unicode_literals

from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models.signals import post_save
try:
    from django.db.transaction import atomic
except ImportError:
    from django.db.transaction import commit_on_success as atomic

from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now

from .exceptions import MessagingPermissionDenied
from .managers import ConversationManager, ParticipationManager
from .settings import (PRIVATE_CONVERSATION_MEMBER_COUNT,
                       CONVERSATION_CACHE_KEY_PATTERN)
from .signals import message_sent
from .utils import is_date_greater

AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')

@python_2_unicode_compatible
class Participation(models.Model):
    conversation = models.ForeignKey('Conversation',
                                     related_name='participations')
    user = models.ForeignKey(AUTH_USER_MODEL, related_name='participations')
    # messages in conversation seen at
    read_at = models.DateTimeField(null=True, blank=True, db_index=True)
    # replied to conversation at
    replied_at = models.DateTimeField(null=True, blank=True, db_index=True)
    # deleted conversation at
    deleted_at = models.DateTimeField(null=True, blank=True, db_index=True)

    objects = ParticipationManager()

    class Meta:
        ordering = ['conversation']
        unique_together = ('conversation', 'user')

    def __str__(self):
        return "{0} - {1}".format(self.user.username, self.conversation)

    @property
    def is_deleted(self):
        return self.deleted_at is not None

    @property
    def is_read(self):
        return self.read_at is not None

    def read_conversation(self):
        """Mark the conversation as read by the participant who requested."""
        self.read_at = now()
        self.save()

    def revoke(self):
        """Sets the deleted_at field of the participation to the time when the
        member in question left the conversation or was kicked out of it."""
        if self.conversation.is_private:
            # can't leave one-on-one conversations
            return

        self.deleted_at = now()
        self.save()

    def reinstate(self):
        """Clears the deleted_at field of the participation, meaning the user
        re-joined the conversation."""
        self.deleted_at = None
        self.save()

@python_2_unicode_compatible
class Conversation(models.Model):
    latest_message = models.ForeignKey('Message',
                                       related_name='conversation_of_latest',
                                       null=True,
                                       blank=True)
    creator = models.ForeignKey(AUTH_USER_MODEL,
                                related_name='created_conversation')

    objects = ConversationManager()

    class Meta:
        ordering = ['latest_message']

    def __str__(self):
        return "{0} - {1}".format(self.pk, self.latest_message)

    @property
    def active_participations(self):
        """Returns a queryset of active participations, meaning that revoked
        participations(when a user leaves a conversation) won't be included."""
        return self.participations.filter(deleted_at__isnull=True)

    def add_participants(self, participants):
        """Adds participants to an existing conversation.

        :param participants: A QuerySet or list of user objects, who will be
                             added to the conversation as participants."""
        for user in participants:
            participation, created = Participation.objects.get_or_create(
                conversation=self,
                user=user
            )
            if not created and participation.is_deleted:
                # participation already exists and it was marked as deleted, so
                # the user most likely left the conversation, but someone
                # re-added him/her
                participation.reinstate()

    def remove_participants(self, participants):
        """Removes participants from an existing conversation.

        :param participants: A QuerySet or list of user objects, whose
                             participations will be revoked."""
        for user in participants:
            participation = self.participations.get(user=user)
            participation.revoke()

    def is_read_by(self, participant):
        participation = self.participations.get(user=participant)
        return participation.is_read

    @property
    def participants(self):
        """Returns a list of user objects participating in this conversation"""
        return [p.user for p in self.active_participations.all()]

    @property
    def participant_names(self):
        """Returns a list of usernames who participate in this conversation."""
        return list(self.active_participations.values_list('user__username',
                                                           flat=True))

    def has_participant(self, user):
        """Returns whether this user participates in this conversation.

        :param user: A User object (request.user probably)"""
        return self.active_participations.filter(user=user).exists()

    @property
    def is_private(self):
        """Returns whether the conversation is private or not.
        If there are more than PRIVATE_CONVERSATION_MEMBER_COUNT (2)
        participants in the conversation, it is not private."""
        return (self.participations.count() ==
                PRIVATE_CONVERSATION_MEMBER_COUNT)

    @classmethod
    def start(cls, creator, participants):
        """Starts a new conversation between the specified participants.

        :param creator: A User object (request.user probably)
        :param participants: A QuerySet or list of user objects, who will be
                             added to the conversation as participants."""
        conversation = cls.objects.create(creator=creator)
        conversation.add_participants(participants)
        return conversation

@python_2_unicode_compatible
class Message(models.Model):
    body = models.TextField()
    parent = models.ForeignKey('self',
                               related_name='next_messages',
                               blank=True,
                               null=True)
    sender = models.ForeignKey(AUTH_USER_MODEL, related_name='messages')
    sent_at = models.DateTimeField(auto_now_add=True, db_index=True)
    conversation = models.ForeignKey('Conversation', related_name='messages')

    class Meta:
        ordering = ['-sent_at', '-id']

    def __str__(self):
        return "{0} - {1}".format(self.sender.username, self.sent_at)

    @classmethod
    def __send_to_conversation(cls, body, sender, conversation,
                               new_participants=None):
        """Internally used by both send_to_conversation and __send_to_users
        methods. Refactored as a separate method to avoid nesting the atomic
        decorator when __send_to_users needs to call __send_to_conversation."""
        new_participants = list(new_participants) if new_participants else []

        # check whether the sender is participating in the conversation or not
        # without this, arbitary users could send messages into conversations
        # which they're not even part of
        if not conversation.has_participant(sender):
            msg = "{0} not participating".format(sender.username)
            raise MessagingPermissionDenied(msg)

        if new_participants and conversation.is_private:
            # this conversation can NOT be extended to include additional
            # participants, instead a new conversation has to be started which
            # will include all the participants, but not the history of the
            # private conversation
            recipients = conversation.participants + new_participants
            return cls.__send_to_users(body, sender, recipients)

        # this was already a group conversation, so just add the new
        # participants to it
        conversation.add_participants(new_participants)

        message = cls.objects.create(body=body,
                                     parent=conversation.latest_message,
                                     sender=sender,
                                     conversation=conversation)
        # update latest message of conversation
        conversation.latest_message = message
        conversation.save()

        p_sender = sender.participations.get(conversation=conversation)
        p_recipients = conversation.active_participations.exclude(user=sender)
        # mark conversation as not read for all participants except the sender
        p_recipients.update(read_at=None)

        if not any(is_date_greater(pr.replied_at, p_sender.read_at)
                   for pr in p_recipients):
            # if the sender's read_at time is greater than all the other
            # participant's replied_at time, it means the sender already read
            # all the messages the other's sent, so update the sender's read_at
            # value again, to reflect that the sender read it's own (just now
            # sent) message.
            fields = dict(replied_at=now(), read_at=now())
        else:
            # if the sender's read_at time is less than any of the other
            # participants replied_at time, it means the sender didn't yet
            # read the other replier's message, so do not touch the sender's
            # read_at time.
            # this also means that if the sender replies to the conversation,
            # it doesnt't imply that he/she also read the latest message sent
            # before his/her message
            fields = dict(replied_at=now())

        conversation.participations.filter(user=sender).update(**fields)

        return message

    @classmethod
    def __send_to_users(cls, body, sender, recipients):
        """Internally used by both send_to_users and __send_to_conversation
        methods. Refactored as a separate method to avoid nesting the atomic
        decorator when __send_to_conversation needs to call __send_to_users."""
        participants = list(recipients)

        if not participants:
            raise MessagingPermissionDenied("No recipients specified.")

        # if sender is the only participant, deny message sending
        if sender in participants and len(participants) == 1:
            raise MessagingPermissionDenied("No self-messaging allowed.")

        participants.append(sender)
        conversations = Conversation.objects.for_participants(participants)

        if not conversations.exists():
            # no conversation exists between the specified participants, so
            # create a new one
            conversation = Conversation.start(creator=sender,
                                              participants=participants)
        else:
            # a conversation exists between the specified participants, so send
            # the message to that conversation
            (conversation,) = conversations

        return cls.__send_to_conversation(body, sender, conversation)

    @classmethod
    @atomic
    def send_to_conversation(cls, body, sender, conversation,
                             new_participants=None):
        """Sends a message to a specific conversation.

        The transaction is atomic, so if anything fails during message sending,
        nothing will be committed.

        :param body: Body of the new message
        :param sender: A User object (request.user probably)
        :param conversation: Conversation instance
        :param new_participants: Optional, if specified it should be a Queryset
                                 or list of user objects, who will be added to
                                 the existing conversation as new participants.
        """
        return cls.__send_to_conversation(body,
                                          sender,
                                          conversation,
                                          new_participants)

    @classmethod
    @atomic
    def send_to_users(cls, body, sender, recipients):
        """Sends a message to a list of users.

        The transaction is atomic, so if anything fails during message sending,
        nothing will be committed.

        :param body: Body of the new message
        :param sender: A User object (request.user probably)
        :param recipients: Queryset or list of user objects who will receive
                           the message."""
        return cls.__send_to_users(body, sender, recipients)

def clear_conversation_cache(sender, instance, **kwargs):
    """When a message is sent, the cached conversation (all of it's messages)
    shall be invalidated."""
    key = CONVERSATION_CACHE_KEY_PATTERN.format(instance.conversation.pk)
    cache.delete(key)

def fire_message_sent_signal(sender, instance, created, **kwargs):
    if created:
        message_sent.send(sender=sender, instance=instance)

post_save.connect(clear_conversation_cache,
                  sender=Message,
                  dispatch_uid="clear_conversation_cache")

post_save.connect(fire_message_sent_signal,
                  sender=Message,
                  dispatch_uid="fire_message_sent_signal")


text:
package com.opengamma.util;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * Base class for building Spring factories for singleton objects.
 * @param <T> the type of the factory bean
 */
public abstract class SingletonFactoryBean<T> implements FactoryBean<T>, InitializingBean {

  /**
   * The singleton instance.
   */
  private T _instance;

  /**
   * Override this to create the instance.
   * @return the created object
   */
  protected abstract T createObject();

  @Override
  public final T getObject() {
    return _instance;
  }

  /**
   * Gets the object, creating if necessary.
   *
   * @return the object
   */
  public final T getObjectCreating() {
    T object = getObject();
    if (object == null) {
      object = createObject();
    }
    return object;
  }

  @Override
  public final Class<?> getObjectType() {
    final T obj = getObject();
    if (obj == null) {
      return null;
    }
    return obj.getClass();
  }

  @Override
  public final boolean isSingleton() {
    return true;
  }

  @Override
  public void afterPropertiesSet() {
    _instance = createObject();
  }

}


text:
<?php
require_once(dirname(__FILE__) . "/../config.inc.php");
require_once(ModelEngineRoot . 'inc/modelengine.inc.php');

/*-- 表单要求执行的Action的类型 --*/
define('FORM_ACTION_NONE', 'none');
define('FORM_ACTION_ADD', 'add');
define('FORM_ACTION_UPDATE', 'update');

$identity = $httpContext->getUser()->getIdentity();
$uid = $identity->getUserId();
$ext = array('uid' => $uid);

$type = isset($_POST['t']) ? $_POST['t'] : '';

if(strlen($type) > 0){
    $manager = $context->getBean('modelengine.business.model');
    $attributes = $manager->getAttributes($type);
    if(count($attributes) > 0){
        $id = 0;
        $action = FORM_ACTION_ADD;
        $retainable_attributes = array();
        $abandonable_attributes = array();

        foreach($attributes as $attribute){
            if (array_key_exists($attribute['name'], $_POST)) {
                $value = $_POST[$attribute['name']];
                $value = isset($value) ? $value : '';
                $attribute['value'] = $value;
                array_push($retainable_attributes, $attribute);

                if($attribute['primary']){//如果传递了主键参数
                    //有参数值执行更新操作,没有参数值不执行任何操作
                    if ($value && $value > 0) {//假定为数字主键
                        $id = $value;
                        $action = FORM_ACTION_UPDATE;
                    }else{
                        $action = FORM_ACTION_NONE;
                    }
                }
            }else if($attribute['autoupdate']){// 表单没有提交该属性
                array_push($retainable_attributes, $attribute);
            }else{
                $attribute['value'] = '';
                array_push($abandonable_attributes, $attribute);
            }
        }

        switch ($action) {
            case FORM_ACTION_ADD:
                foreach ($abandonable_attributes as $idx => $attribute) {
                    array_push($retainable_attributes, $attribute);
                }
                $manager->create($type, $retainable_attributes, $ext);
                echo 1;
                break;
            case FORM_ACTION_UPDATE:
                $manager->save($type, $id, $retainable_attributes, $ext);
                echo 1;
                break;
            case FORM_ACTION_NONE:
            default:
                echo 0;
        }
    }else{
        echo 0;
    }
}else{
    echo 0;
}
?>


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('forms', '0005_internetnewsperson_age'),
    ]

    operations = [
        migrations.AddField(
            model_name='internetnewsperson',
            name='is_photograph',
            field=models.PositiveIntegerField(default=None, verbose_name='Is there a photograph of the person in the story?', choices=[(1, 'Yes'), (2, 'No'), (3, 'Do not know')]),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='internetnewsperson',
            name='is_quoted',
            field=models.CharField(default=None, help_text='
A person is directly quoted if their own words are printed, e.g. "The war against terror is our first priority" said President Bush.

If the story paraphrases what the person said, that is not a direct quote, e.g. President Bush said that top priority would be given to fighting the war against terror.
', max_length=1, verbose_name='Is the person directly quoted', choices=[(b'Y', 'Yes'), (b'N', 'No')]),
            preserve_default=False,
        ),
    ]


text:
FROM alpine:3.3
MAINTAINER Gravebot

# Install setup that rarely changes.
RUN apk add --update nodejs && \
  npm install -g npm@3.8.7 && \
  rm -rf /usr/share/man /tmp/* /var/tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html

# Copy package.json
COPY ./package.json /app/package.json
WORKDIR /app/

# Install required APKs needed for building, install node modules, fix phantom, then cleanup.
RUN apk add --update git python build-base curl bash && \
  echo "Fixing PhantomJS" && \
  curl -Ls "https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz" | tar xz -C / && \
  echo "Installing node modules" && \
  sed -i '/postinstall/d' package.json && \
  npm install --production && \
  apk del git python build-base curl && \
  rm -rf /usr/share/man /tmp/* /var/tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp

# Copy bot
COPY . /app/

# Post install
RUN npm run postinstall

ENV PREFIX !
ENV PORT 5000
EXPOSE $PORT

CMD ["npm", "start"]


text:
package com.tehreh1uneh.cloudstorage.client.screens;

import com.tehreh1uneh.cloudstorage.client.screenmanager.ClientApp;

public class BaseScreen {

    protected ClientApp clientApp;

    public void setClientApp(ClientApp clientApp) {
        this.clientApp = clientApp;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nova Hedwigia 32(1): 233 (1980)

#### Original name
Aspergillus globosus H.J. Chowdhery & J.N. Rai

### Remarks
null