text:
package org.apache.flink.streaming.api.transformations;

import static org.apache.flink.util.Preconditions.checkNotNull;

import java.util.Collection;
import org.apache.flink.annotation.Internal;
import org.apache.flink.api.common.functions.InvalidTypesException;
import org.apache.flink.api.common.operators.ResourceSpec;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.typeutils.MissingTypeInfo;
import org.apache.flink.streaming.api.graph.StreamGraph;
import org.apache.flink.streaming.api.graph.StreamGraphGenerator;
import org.apache.flink.streaming.api.operators.ChainingStrategy;
import org.apache.flink.util.Preconditions;

/**
 * A {@code StreamTransformation} represents the operation that creates a
 * {@link org.apache.flink.streaming.api.datastream.DataStream}. Every
 * {@link org.apache.flink.streaming.api.datastream.DataStream} has an underlying
 * {@code StreamTransformation} that is the origin of said DataStream.
 *
 *
API operations such as {@link org.apache.flink.streaming.api.datastream.DataStream#map} create
 * a tree of {@code StreamTransformation}s underneath. When the stream program is to be executed
 * this graph is translated to a {@link StreamGraph} using
 * {@link org.apache.flink.streaming.api.graph.StreamGraphGenerator}.
 *
 *
A {@code StreamTransformation} does not necessarily correspond to a physical operation
 * at runtime. Some operations are only logical concepts. Examples of this are union,
 * split/select data stream, partitioning.
 *
 *
The following graph of {@code StreamTransformations}:
 *
{@code
 *   Source              Source
 *      +                   +
 *      |                   |
 *      v                   v
 *  Rebalance          HashPartition
 *      +                   +
 *      |                   |
 *      |                   |
 *      +------>Union<------+
 *                +
 *                |
 *                v
 *              Split
 *                +
 *                |
 *                v
 *              Select
 *                +
 *                v
 *               Map
 *                +
 *                |
 *                v
 *              Sink
 * }

 *
 *
Would result in this graph of operations at runtime:
 *
{@code
 *  Source              Source
 *    +                   +
 *    |                   |
 *    |                   |
 *    +------->Map<-------+
 *              +
 *              |
 *              v
 *             Sink
 * }

 *
 *
The information about partitioning, union, split/select end up being encoded in the edges
 * that connect the sources to the map operation.
 *
 * @param <T> The type of the elements that result from this {@code StreamTransformation}
 */
@Internal
public abstract class StreamTransformation<T> {

	// This is used to assign a unique ID to every StreamTransformation
	protected static Integer idCounter = 0;

	public static int getNewNodeId() {
		idCounter++;
		return idCounter;
	}

	protected final int id;

	protected String name;

	protected TypeInformation<T> outputType;
	// This is used to handle MissingTypeInfo. As long as the outputType has not been queried
	// it can still be changed using setOutputType(). Afterwards an exception is thrown when
	// trying to change the output type.
	protected boolean typeUsed;

	private int parallelism;

	/**
	 * The maximum parallelism for this stream transformation. It defines the upper limit for
	 * dynamic scaling and the number of key groups used for partitioned state.
	 */
	private int maxParallelism = -1;

	/**
	 *  The minimum resources for this stream transformation. It defines the lower limit for
	 *  dynamic resources resize in future plan.
	 */
	private ResourceSpec minResources = ResourceSpec.DEFAULT;

	/**
	 *  The preferred resources for this stream transformation. It defines the upper limit for
	 *  dynamic resource resize in future plan.
	 */
	private ResourceSpec preferredResources = ResourceSpec.DEFAULT;

	/**
	 * User-specified ID for this transformation. This is used to assign the
	 * same operator ID across job restarts. There is also the automatically
	 * generated {@link #id}, which is assigned from a static counter. That
	 * field is independent from this.
	 */
	private String uid;

	private String userProvidedNodeHash;

	protected long bufferTimeout = -1;

	private String slotSharingGroup;

	/**
	 * Creates a new {@code StreamTransformation} with the given name, output type and parallelism.
	 *
	 * @param name The name of the {@code StreamTransformation}, this will be shown in Visualizations and the Log
	 * @param outputType The output type of this {@code StreamTransformation}
	 * @param parallelism The parallelism of this {@code StreamTransformation}
	 */
	public StreamTransformation(String name, TypeInformation<T> outputType, int parallelism) {
		this.id = getNewNodeId();
		this.name = Preconditions.checkNotNull(name);
		this.outputType = outputType;
		this.parallelism = parallelism;
		this.slotSharingGroup = null;
	}

	/**
	 * Returns the unique ID of this {@code StreamTransformation}.
	 */
	public int getId() {
		return id;
	}

	/**
	 * Changes the name of this {@code StreamTransformation}.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Returns the name of this {@code StreamTransformation}.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Returns the parallelism of this {@code StreamTransformation}.
	 */
	public int getParallelism() {
		return parallelism;
	}

	/**
	 * Sets the parallelism of this {@code StreamTransformation}.
	 *
	 * @param parallelism The new parallelism to set on this {@code StreamTransformation}.
	 */
	public void setParallelism(int parallelism) {
		Preconditions.checkArgument(parallelism > 0, "Parallelism must be bigger than zero.");
		this.parallelism = parallelism;
	}

	/**
	 * Gets the maximum parallelism for this stream transformation.
	 *
	 * @return Maximum parallelism of this transformation.
	 */
	public int getMaxParallelism() {
		return maxParallelism;
	}

	/**
	 * Sets the maximum parallelism for this stream transformation.
	 *
	 * @param maxParallelism Maximum parallelism for this stream transformation.
	 */
	public void setMaxParallelism(int maxParallelism) {
		Preconditions.checkArgument(maxParallelism > 0
						&& maxParallelism <= StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM,
				"Maximum parallelism must be between 1 and " + StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM
						+ ". Found: " + maxParallelism);
		this.maxParallelism = maxParallelism;
	}

	/**
	 * Sets the minimum and preferred resources for this stream transformation.
	 *
	 * @param minResources The minimum resource of this transformation.
	 * @param preferredResources The preferred resource of this transformation.
	 */
	public void setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
		this.minResources = checkNotNull(minResources);
		this.preferredResources = checkNotNull(preferredResources);
	}

	/**
	 * Gets the minimum resource of this stream transformation.
	 *
	 * @return The minimum resource of this transformation.
	 */
	public ResourceSpec getMinResources() {
		return minResources;
	}

	/**
	 * Gets the preferred resource of this stream transformation.
	 *
	 * @return The preferred resource of this transformation.
	 */
	public ResourceSpec getPreferredResources() {
		return preferredResources;
	}

	/**
	 * Sets an user provided hash for this operator. This will be used AS IS the create the
	 * JobVertexID.
	 *
	 *
The user provided hash is an alternative to the generated hashes, that is considered when
	 * identifying an operator through the default hash mechanics fails (e.g. because of changes
	 * between Flink versions).
	 *
	 *
Important: this should be used as a workaround or for trouble shooting.
	 * The provided hash needs to be unique per transformation and job. Otherwise, job submission
	 * will fail. Furthermore, you cannot assign user-specified hash to intermediate nodes in an
	 * operator chain and trying so will let your job fail.
	 *
	 *
A use case for this is in migration between Flink versions or changing the jobs in a way
	 * that changes the automatically generated hashes. In this case, providing the previous hashes
	 * directly through this method (e.g. obtained from old logs) can help to reestablish a lost
	 * mapping from states to their target operator.
	 *
	 * @param uidHash The user provided hash for this operator. This will become the JobVertexID, which is shown in the
	 *                 logs and web ui.
	 */
	public void setUidHash(String uidHash) {

		Preconditions.checkNotNull(uidHash);
		Preconditions.checkArgument(uidHash.matches("^[0-9A-Fa-f]{32}$"),
				"Node hash must be a 32 character String that describes a hex code. Found: " + uidHash);

		this.userProvidedNodeHash = uidHash;
	}

	/**
	 * Gets the user provided hash.
	 *
	 * @return The user provided hash.
	 */
	public String getUserProvidedNodeHash() {
		return userProvidedNodeHash;
	}

	/**
	 * Sets an ID for this {@link StreamTransformation}. This is will later be hashed to a uidHash which is then used to
	 * create the JobVertexID (that is shown in logs and the web ui).
	 *
	 *
The specified ID is used to assign the same operator ID across job
	 * submissions (for example when starting a job from a savepoint).
	 *
	 *
Important: this ID needs to be unique per
	 * transformation and job. Otherwise, job submission will fail.
	 *
	 * @param uid The unique user-specified ID of this transformation.
	 */
	public void setUid(String uid) {
		this.uid = uid;
	}

	/**
	 * Returns the user-specified ID of this transformation.
	 *
	 * @return The unique user-specified ID of this transformation.
	 */
	public String getUid() {
		return uid;
	}

	/**
	 * Returns the slot sharing group of this transformation.
	 *
	 * @see #setSlotSharingGroup(String)
	 */
	public String getSlotSharingGroup() {
		return slotSharingGroup;
	}

	/**
	 * Sets the slot sharing group of this transformation. Parallel instances of operations that
	 * are in the same slot sharing group will be co-located in the same TaskManager slot, if
	 * possible.
	 *
	 *
Initially, an operation is in the default slot sharing group. This can be explicitly
	 * set using {@code setSlotSharingGroup("default")}.
	 *
	 * @param slotSharingGroup The slot sharing group name.
	 */
	public void setSlotSharingGroup(String slotSharingGroup) {
		this.slotSharingGroup = slotSharingGroup;
	}

	/**
	 * Tries to fill in the type information. Type information can be filled in
	 * later when the program uses a type hint. This method checks whether the
	 * type information has ever been accessed before and does not allow
	 * modifications if the type was accessed already. This ensures consistency
	 * by making sure different parts of the operation do not assume different
	 * type information.
	 *
	 * @param outputType The type information to fill in.
	 *
	 * @throws IllegalStateException Thrown, if the type information has been accessed before.
	 */
	public void setOutputType(TypeInformation<T> outputType) {
		if (typeUsed) {
			throw new IllegalStateException(
					"TypeInformation cannot be filled in for the type after it has been used. "
							+ "Please make sure that the type info hints are the first call after"
							+ " the transformation function, "
							+ "before any access to types or semantic properties, etc.");
		}
		this.outputType = outputType;
	}

	/**
	 * Returns the output type of this {@code StreamTransformation} as a {@link TypeInformation}. Once
	 * this is used once the output type cannot be changed anymore using {@link #setOutputType}.
	 *
	 * @return The output type of this {@code StreamTransformation}
	 */
	public TypeInformation<T> getOutputType() {
		if (outputType instanceof MissingTypeInfo) {
			MissingTypeInfo typeInfo = (MissingTypeInfo) this.outputType;
			throw new InvalidTypesException(
					"The return type of function '"
							+ typeInfo.getFunctionName()
							+ "' could not be determined automatically, due to type erasure. "
							+ "You can give type information hints by using the returns(...) "
							+ "method on the result of the transformation call, or by letting "
							+ "your function implement the 'ResultTypeQueryable' "
							+ "interface.", typeInfo.getTypeException());
		}
		typeUsed = true;
		return this.outputType;
	}

	/**
	 * Sets the chaining strategy of this {@code StreamTransformation}.
	 */
	public abstract void setChainingStrategy(ChainingStrategy strategy);

	/**
	 * Set the buffer timeout of this {@code StreamTransformation}. The timeout is used when
	 * sending elements over the network. The timeout specifies how long a network buffer
	 * should be kept waiting before sending. A higher timeout means that more elements will
	 * be sent in one buffer, this increases throughput. The latency, however, is negatively
	 * affected by a higher timeout.
	 */
	public void setBufferTimeout(long bufferTimeout) {
		this.bufferTimeout = bufferTimeout;
	}

	/**
	 * Returns the buffer timeout of this {@code StreamTransformation}.
	 *
	 * @see #setBufferTimeout(long)
	 */
	public long getBufferTimeout() {
		return bufferTimeout;
	}

	/**
	 * Returns all transitive predecessor {@code StreamTransformation}s of this {@code StreamTransformation}. This
	 * is, for example, used when determining whether a feedback edge of an iteration
	 * actually has the iteration head as a predecessor.
	 *
	 * @return The list of transitive predecessors.
	 */
	public abstract Collection<StreamTransformation<?>> getTransitivePredecessors();

	@Override
	public String toString() {
		return getClass().getSimpleName() + "{" +
				"id=" + id +
				", name='" + name + '\'' +
				", outputType=" + outputType +
				", parallelism=" + parallelism +
				'}';
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof StreamTransformation)) {
			return false;
		}

		StreamTransformation<?> that = (StreamTransformation<?>) o;

		if (bufferTimeout != that.bufferTimeout) {
			return false;
		}
		if (id != that.id) {
			return false;
		}
		if (parallelism != that.parallelism) {
			return false;
		}
		if (!name.equals(that.name)) {
			return false;
		}
		return outputType != null ? outputType.equals(that.outputType) : that.outputType == null;
	}

	@Override
	public int hashCode() {
		int result = id;
		result = 31 * result + name.hashCode();
		result = 31 * result + (outputType != null ? outputType.hashCode() : 0);
		result = 31 * result + parallelism;
		result = 31 * result + (int) (bufferTimeout ^ (bufferTimeout >>> 32));
		return result;
	}
}


text:
using Google.Apis.Customsearch.v1.Data;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace NadekoBot.Core.Services
{
    public interface IGoogleApiService : INService
    {
        IEnumerable<string> Languages { get; }

        Task<IEnumerable<string>> GetVideoLinksByKeywordAsync(string keywords, int count = 1);
        Task<IEnumerable<(string Name, string Id, string Url)>> GetVideoInfosByKeywordAsync(string keywords, int count = 1);
        Task<IEnumerable<string>> GetPlaylistIdsByKeywordsAsync(string keywords, int count = 1);
        Task<IEnumerable<string>> GetRelatedVideosAsync(string url, int count = 1);
        Task<IEnumerable<string>> GetPlaylistTracksAsync(string playlistId, int count = 50);
        Task<IReadOnlyDictionary<string, TimeSpan>> GetVideoDurationsAsync(IEnumerable<string> videoIds);
        Task<ImageResult> GetImageAsync(string query, int start = 1);
        Task<string> Translate(string sourceText, string sourceLanguage, string targetLanguage);

        Task<string> ShortenUrl(string url);
    }

    public struct ImageResult
    {
        public Result.ImageData Image { get; }
        public string Link { get; }

        public ImageResult(Result.ImageData image, string link)
        {
            this.Image = image;
            this.Link = link;
        }
    }
}

redpajama_set_name: RedPajamaGithub


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/maven-v4_0_0.xsd">
    <parent>
        <artifactId>Dracarys-Mall</artifactId>
        <groupId>com.dmall</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>dmall-order-web</artifactId>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>com.dmall</groupId>
            <artifactId>dmall-order-interface</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.dmall</groupId>
            <artifactId>dmall-cart-interface</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.dmall</groupId>
            <artifactId>dmall-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <!-- JSP相关 -->
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- dubbo相关 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.dmall</groupId>
            <artifactId>dmall-sso-pojo</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.dmall</groupId>
            <artifactId>dmall-sso-interface</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <!-- 配置tomcat插件 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <path>/</path>
                    <port>8092</port>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
package fr.keemto.web;

import fr.keemto.core.AccountInterceptor;
import fr.keemto.core.User;
import fr.keemto.provider.social.SocialAccountKey;
import org.junit.Before;
import org.junit.Test;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionKey;
import org.springframework.social.connect.ConnectionRepository;

import java.util.ArrayList;
import java.util.List;

import static org.mockito.Mockito.*;

public class ObservableConnectionRepositoryTest {

    private ObservableConnectionRepository connectionRepository;
    private ConnectionRepository realConnectionRepository;
    private AccountInterceptor interceptor;
    private String username = "aUser";

    @Before
    public void setUp() throws Exception {
        realConnectionRepository = mock(ConnectionRepository.class);
        interceptor = mock(AccountInterceptor.class);
        connectionRepository = new ObservableConnectionRepository(username, realConnectionRepository, interceptor);
    }

    @Test
    public void whenConnectionIsRemovedShouldTriggerInterceptor() throws Exception {

        ConnectionKey key = new ConnectionKey("provider", "userId");

        connectionRepository.removeConnection(key);

        SocialAccountKey socialAccountKey = new SocialAccountKey(key, new User(username));
        verify(interceptor).accountDeleted(socialAccountKey);
    }

    @Test
    public void whenAllProviderConnectionsAreRemovedShouldTriggerInterceptor() throws Exception {

        Connection connection = mock(Connection.class);
        ConnectionKey key = new ConnectionKey("provider", "userId");
        List<Connection<?>> connections = new ArrayList<Connection<?>>();
        connections.add(connection);
        connections.add(connection);
        when(realConnectionRepository.findConnections("provider")).thenReturn(connections);
        when(connection.getKey()).thenReturn(key);

        connectionRepository.removeConnections("provider");

        verify(interceptor, times(2)).accountDeleted(any(SocialAccountKey.class));
    }

    @Test
    public void whenConnectionIsAddedShouldTriggerInterceptor() throws Exception {

        ConnectionKey key = new ConnectionKey("provider", "userId");
        Connection connection = mock(Connection.class);
        when(connection.getKey()).thenReturn(key);

        connectionRepository.addConnection(connection);

        SocialAccountKey socialAccountKey = new SocialAccountKey(key, new User(username));
        verify(interceptor).accountCreated(socialAccountKey);
    }

}


text:
use crate::snippet::Style;
use crate::CodeSuggestion;
use crate::Level;
use crate::Substitution;
use crate::SubstitutionPart;
use crate::SuggestionStyle;
use crate::ToolMetadata;
use rustc_lint_defs::Applicability;
use rustc_serialize::json::Json;
use rustc_span::{MultiSpan, Span, DUMMY_SP};
use std::fmt;
use std::hash::{Hash, Hasher};

#[must_use]
#[derive(Clone, Debug, Encodable, Decodable)]
pub struct Diagnostic {
    pub level: Level,
    pub message: Vec<(String, Style)>,
    pub code: Option<DiagnosticId>,
    pub span: MultiSpan,
    pub children: Vec<SubDiagnostic>,
    pub suggestions: Vec<CodeSuggestion>,

    /// This is not used for highlighting or rendering any error message.  Rather, it can be used
    /// as a sort key to sort a buffer of diagnostics.  By default, it is the primary span of
    /// `span` if there is one.  Otherwise, it is `DUMMY_SP`.
    pub sort_span: Span,

    /// If diagnostic is from Lint, custom hash function ignores notes
    /// otherwise hash is based on the all the fields
    pub is_lint: bool,
}

#[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable)]
pub enum DiagnosticId {
    Error(String),
    Lint { name: String, has_future_breakage: bool, is_force_warn: bool },
}

/// A "sub"-diagnostic attached to a parent diagnostic.
/// For example, a note attached to an error.
#[derive(Clone, Debug, PartialEq, Hash, Encodable, Decodable)]
pub struct SubDiagnostic {
    pub level: Level,
    pub message: Vec<(String, Style)>,
    pub span: MultiSpan,
    pub render_span: Option<MultiSpan>,
}

#[derive(Debug, PartialEq, Eq)]
pub struct DiagnosticStyledString(pub Vec<StringPart>);

impl DiagnosticStyledString {
    pub fn new() -> DiagnosticStyledString {
        DiagnosticStyledString(vec![])
    }
    pub fn push_normal<S: Into<String>>(&mut self, t: S) {
        self.0.push(StringPart::Normal(t.into()));
    }
    pub fn push_highlighted<S: Into<String>>(&mut self, t: S) {
        self.0.push(StringPart::Highlighted(t.into()));
    }
    pub fn push<S: Into<String>>(&mut self, t: S, highlight: bool) {
        if highlight {
            self.push_highlighted(t);
        } else {
            self.push_normal(t);
        }
    }
    pub fn normal<S: Into<String>>(t: S) -> DiagnosticStyledString {
        DiagnosticStyledString(vec![StringPart::Normal(t.into())])
    }

    pub fn highlighted<S: Into<String>>(t: S) -> DiagnosticStyledString {
        DiagnosticStyledString(vec![StringPart::Highlighted(t.into())])
    }

    pub fn content(&self) -> String {
        self.0.iter().map(|x| x.content()).collect::<String>()
    }
}

#[derive(Debug, PartialEq, Eq)]
pub enum StringPart {
    Normal(String),
    Highlighted(String),
}

impl StringPart {
    pub fn content(&self) -> &str {
        match self {
            &StringPart::Normal(ref s) | &StringPart::Highlighted(ref s) => s,
        }
    }
}

impl Diagnostic {
    pub fn new(level: Level, message: &str) -> Self {
        Diagnostic::new_with_code(level, None, message)
    }

    pub fn new_with_code(level: Level, code: Option<DiagnosticId>, message: &str) -> Self {
        Diagnostic {
            level,
            message: vec![(message.to_owned(), Style::NoStyle)],
            code,
            span: MultiSpan::new(),
            children: vec![],
            suggestions: vec![],
            sort_span: DUMMY_SP,
            is_lint: false,
        }
    }

    pub fn is_error(&self) -> bool {
        match self.level {
            Level::Bug | Level::Fatal | Level::Error { .. } | Level::FailureNote => true,

            Level::Warning | Level::Note | Level::Help | Level::Cancelled | Level::Allow => false,
        }
    }

    pub fn has_future_breakage(&self) -> bool {
        match self.code {
            Some(DiagnosticId::Lint { has_future_breakage, .. }) => has_future_breakage,
            _ => false,
        }
    }

    pub fn is_force_warn(&self) -> bool {
        match self.code {
            Some(DiagnosticId::Lint { is_force_warn, .. }) => is_force_warn,
            _ => false,
        }
    }

    /// Cancel the diagnostic (a structured diagnostic must either be emitted or
    /// canceled or it will panic when dropped).
    pub fn cancel(&mut self) {
        self.level = Level::Cancelled;
    }

    /// Check if this diagnostic [was cancelled][Self::cancel()].
    pub fn cancelled(&self) -> bool {
        self.level == Level::Cancelled
    }

    /// Adds a span/label to be included in the resulting snippet.
    ///
    /// This is pushed onto the [`MultiSpan`] that was created when the diagnostic
    /// was first built. That means it will be shown together with the original
    /// span/label, *not* a span added by one of the `span_{note,warn,help,suggestions}` methods.
    ///
    /// This span is *not* considered a ["primary span"][`MultiSpan`]; only
    /// the `Span` supplied when creating the diagnostic is primary.
    pub fn span_label<T: Into<String>>(&mut self, span: Span, label: T) -> &mut Self {
        self.span.push_span_label(span, label.into());
        self
    }

    pub fn replace_span_with(&mut self, after: Span) -> &mut Self {
        let before = self.span.clone();
        self.set_span(after);
        for span_label in before.span_labels() {
            if let Some(label) = span_label.label {
                self.span_label(after, label);
            }
        }
        self
    }

    crate fn note_expected_found(
        &mut self,
        expected_label: &dyn fmt::Display,
        expected: DiagnosticStyledString,
        found_label: &dyn fmt::Display,
        found: DiagnosticStyledString,
    ) -> &mut Self {
        self.note_expected_found_extra(expected_label, expected, found_label, found, &"", &"")
    }

    crate fn note_unsuccessful_coercion(
        &mut self,
        expected: DiagnosticStyledString,
        found: DiagnosticStyledString,
    ) -> &mut Self {
        let mut msg: Vec<_> =
            vec![("required when trying to coerce from type `".to_string(), Style::NoStyle)];
        msg.extend(expected.0.iter().map(|x| match *x {
            StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
            StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
        }));
        msg.push(("` to type '".to_string(), Style::NoStyle));
        msg.extend(found.0.iter().map(|x| match *x {
            StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
            StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
        }));
        msg.push(("`".to_string(), Style::NoStyle));

        // For now, just attach these as notes
        self.highlighted_note(msg);
        self
    }

    pub fn note_expected_found_extra(
        &mut self,
        expected_label: &dyn fmt::Display,
        expected: DiagnosticStyledString,
        found_label: &dyn fmt::Display,
        found: DiagnosticStyledString,
        expected_extra: &dyn fmt::Display,
        found_extra: &dyn fmt::Display,
    ) -> &mut Self {
        let expected_label = expected_label.to_string();
        let expected_label = if expected_label.is_empty() {
            "expected".to_string()
        } else {
            format!("expected {}", expected_label)
        };
        let found_label = found_label.to_string();
        let found_label = if found_label.is_empty() {
            "found".to_string()
        } else {
            format!("found {}", found_label)
        };
        let (found_padding, expected_padding) = if expected_label.len() > found_label.len() {
            (expected_label.len() - found_label.len(), 0)
        } else {
            (0, found_label.len() - expected_label.len())
        };
        let mut msg: Vec<_> =
            vec![(format!("{}{} `", " ".repeat(expected_padding), expected_label), Style::NoStyle)];
        msg.extend(expected.0.iter().map(|x| match *x {
            StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
            StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
        }));
        msg.push((format!("`{}\n", expected_extra), Style::NoStyle));
        msg.push((format!("{}{} `", " ".repeat(found_padding), found_label), Style::NoStyle));
        msg.extend(found.0.iter().map(|x| match *x {
            StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
            StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
        }));
        msg.push((format!("`{}", found_extra), Style::NoStyle));

        // For now, just attach these as notes.
        self.highlighted_note(msg);
        self
    }

    pub fn note_trait_signature(&mut self, name: String, signature: String) -> &mut Self {
        self.highlighted_note(vec![
            (format!("`{}` from trait: `", name), Style::NoStyle),
            (signature, Style::Highlight),
            ("`".to_string(), Style::NoStyle),
        ]);
        self
    }

    /// Add a note attached to this diagnostic.
    pub fn note(&mut self, msg: &str) -> &mut Self {
        self.sub(Level::Note, msg, MultiSpan::new(), None);
        self
    }

    pub fn highlighted_note(&mut self, msg: Vec<(String, Style)>) -> &mut Self {
        self.sub_with_highlights(Level::Note, msg, MultiSpan::new(), None);
        self
    }

    /// Prints the span with a note above it.
    /// This is like [`Diagnostic::note()`], but it gets its own span.
    crate fn span_note<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut Self {
        self.sub(Level::Note, msg, sp.into(), None);
        self
    }

    /// Add a warning attached to this diagnostic.
    crate fn warn(&mut self, msg: &str) -> &mut Self {
        self.sub(Level::Warning, msg, MultiSpan::new(), None);
        self
    }

    /// Prints the span with a warning above it.
    /// This is like [`Diagnostic::warn()`], but it gets its own span.
    crate fn span_warn<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut Self {
        self.sub(Level::Warning, msg, sp.into(), None);
        self
    }

    /// Add a help message attached to this diagnostic.
    crate fn help(&mut self, msg: &str) -> &mut Self {
        self.sub(Level::Help, msg, MultiSpan::new(), None);
        self
    }

    /// Prints the span with some help above it.
    /// This is like [`Diagnostic::help()`], but it gets its own span.
    crate fn span_help<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut Self {
        self.sub(Level::Help, msg, sp.into(), None);
        self
    }

    /// Show a suggestion that has multiple parts to it.
    /// In other words, multiple changes need to be applied as part of this suggestion.
    pub fn multipart_suggestion(
        &mut self,
        msg: &str,
        suggestion: Vec<(Span, String)>,
        applicability: Applicability,
    ) -> &mut Self {
        self.multipart_suggestion_with_style(
            msg,
            suggestion,
            applicability,
            SuggestionStyle::ShowCode,
        )
    }

    /// Show a suggestion that has multiple parts to it, always as it's own subdiagnostic.
    /// In other words, multiple changes need to be applied as part of this suggestion.
    pub fn multipart_suggestion_verbose(
        &mut self,
        msg: &str,
        suggestion: Vec<(Span, String)>,
        applicability: Applicability,
    ) -> &mut Self {
        self.multipart_suggestion_with_style(
            msg,
            suggestion,
            applicability,
            SuggestionStyle::ShowAlways,
        )
    }
    /// [`Diagnostic::multipart_suggestion()`] but you can set the [`SuggestionStyle`].
    pub fn multipart_suggestion_with_style(
        &mut self,
        msg: &str,
        suggestion: Vec<(Span, String)>,
        applicability: Applicability,
        style: SuggestionStyle,
    ) -> &mut Self {
        assert!(!suggestion.is_empty());
        self.suggestions.push(CodeSuggestion {
            substitutions: vec![Substitution {
                parts: suggestion
                    .into_iter()
                    .map(|(span, snippet)| SubstitutionPart { snippet, span })
                    .collect(),
            }],
            msg: msg.to_owned(),
            style,
            applicability,
            tool_metadata: Default::default(),
        });
        self
    }

    /// Prints out a message with for a multipart suggestion without showing the suggested code.
    ///
    /// This is intended to be used for suggestions that are obvious in what the changes need to
    /// be from the message, showing the span label inline would be visually unpleasant
    /// (marginally overlapping spans or multiline spans) and showing the snippet window wouldn't
    /// improve understandability.
    pub fn tool_only_multipart_suggestion(
        &mut self,
        msg: &str,
        suggestion: Vec<(Span, String)>,
        applicability: Applicability,
    ) -> &mut Self {
        assert!(!suggestion.is_empty());
        self.suggestions.push(CodeSuggestion {
            substitutions: vec![Substitution {
                parts: suggestion
                    .into_iter()
                    .map(|(span, snippet)| SubstitutionPart { snippet, span })
                    .collect(),
            }],
            msg: msg.to_owned(),
            style: SuggestionStyle::CompletelyHidden,
            applicability,
            tool_metadata: Default::default(),
        });
        self
    }

    /// Prints out a message with a suggested edit of the code.
    ///
    /// In case of short messages and a simple suggestion, rustc displays it as a label:
    ///
    /// ```text
    /// try adding parentheses: `(tup.0).1`
    /// ```
    ///
    /// The message
    ///
    /// * should not end in any punctuation (a `:` is added automatically)
    /// * should not be a question (avoid language like "did you mean")
    /// * should not contain any phrases like "the following", "as shown", etc.
    /// * may look like "to do xyz, use" or "to do xyz, use abc"
    /// * may contain a name of a function, variable, or type, but not whole expressions
    ///
    /// See `CodeSuggestion` for more information.
    pub fn span_suggestion(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
    ) -> &mut Self {
        self.span_suggestion_with_style(
            sp,
            msg,
            suggestion,
            applicability,
            SuggestionStyle::ShowCode,
        );
        self
    }

    /// [`Diagnostic::span_suggestion()`] but you can set the [`SuggestionStyle`].
    pub fn span_suggestion_with_style(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
        style: SuggestionStyle,
    ) -> &mut Self {
        self.suggestions.push(CodeSuggestion {
            substitutions: vec![Substitution {
                parts: vec![SubstitutionPart { snippet: suggestion, span: sp }],
            }],
            msg: msg.to_owned(),
            style,
            applicability,
            tool_metadata: Default::default(),
        });
        self
    }

    /// Always show the suggested change.
    pub fn span_suggestion_verbose(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
    ) -> &mut Self {
        self.span_suggestion_with_style(
            sp,
            msg,
            suggestion,
            applicability,
            SuggestionStyle::ShowAlways,
        );
        self
    }

    /// Prints out a message with multiple suggested edits of the code.
    /// See also [`Diagnostic::span_suggestion()`].
    pub fn span_suggestions(
        &mut self,
        sp: Span,
        msg: &str,
        suggestions: impl Iterator<Item = String>,
        applicability: Applicability,
    ) -> &mut Self {
        let mut suggestions: Vec<_> = suggestions.collect();
        suggestions.sort();
        let substitutions = suggestions
            .into_iter()
            .map(|snippet| Substitution { parts: vec![SubstitutionPart { snippet, span: sp }] })
            .collect();
        self.suggestions.push(CodeSuggestion {
            substitutions,
            msg: msg.to_owned(),
            style: SuggestionStyle::ShowCode,
            applicability,
            tool_metadata: Default::default(),
        });
        self
    }

    /// Prints out a message with multiple suggested edits of the code.
    /// See also [`Diagnostic::span_suggestion()`].
    pub fn multipart_suggestions(
        &mut self,
        msg: &str,
        suggestions: impl Iterator<Item = Vec<(Span, String)>>,
        applicability: Applicability,
    ) -> &mut Self {
        self.suggestions.push(CodeSuggestion {
            substitutions: suggestions
                .map(|sugg| Substitution {
                    parts: sugg
                        .into_iter()
                        .map(|(span, snippet)| SubstitutionPart { snippet, span })
                        .collect(),
                })
                .collect(),
            msg: msg.to_owned(),
            style: SuggestionStyle::ShowCode,
            applicability,
            tool_metadata: Default::default(),
        });
        self
    }
    /// Prints out a message with a suggested edit of the code. If the suggestion is presented
    /// inline, it will only show the message and not the suggestion.
    ///
    /// See `CodeSuggestion` for more information.
    pub fn span_suggestion_short(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
    ) -> &mut Self {
        self.span_suggestion_with_style(
            sp,
            msg,
            suggestion,
            applicability,
            SuggestionStyle::HideCodeInline,
        );
        self
    }

    /// Prints out a message for a suggestion without showing the suggested code.
    ///
    /// This is intended to be used for suggestions that are obvious in what the changes need to
    /// be from the message, showing the span label inline would be visually unpleasant
    /// (marginally overlapping spans or multiline spans) and showing the snippet window wouldn't
    /// improve understandability.
    pub fn span_suggestion_hidden(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
    ) -> &mut Self {
        self.span_suggestion_with_style(
            sp,
            msg,
            suggestion,
            applicability,
            SuggestionStyle::HideCodeAlways,
        );
        self
    }

    /// Adds a suggestion to the JSON output that will not be shown in the CLI.
    ///
    /// This is intended to be used for suggestions that are *very* obvious in what the changes
    /// need to be from the message, but we still want other tools to be able to apply them.
    pub fn tool_only_span_suggestion(
        &mut self,
        sp: Span,
        msg: &str,
        suggestion: String,
        applicability: Applicability,
    ) -> &mut Self {
        self.span_suggestion_with_style(
            sp,
            msg,
            suggestion,
            applicability,
            SuggestionStyle::CompletelyHidden,
        );
        self
    }

    /// Adds a suggestion intended only for a tool. The intent is that the metadata encodes
    /// the suggestion in a tool-specific way, as it may not even directly involve Rust code.
    pub fn tool_only_suggestion_with_metadata(
        &mut self,
        msg: &str,
        applicability: Applicability,
        tool_metadata: Json,
    ) {
        self.suggestions.push(CodeSuggestion {
            substitutions: vec![],
            msg: msg.to_owned(),
            style: SuggestionStyle::CompletelyHidden,
            applicability,
            tool_metadata: ToolMetadata::new(tool_metadata),
        })
    }

    pub fn set_span<S: Into<MultiSpan>>(&mut self, sp: S) -> &mut Self {
        self.span = sp.into();
        if let Some(span) = self.span.primary_span() {
            self.sort_span = span;
        }
        self
    }

    pub fn set_is_lint(&mut self) -> &mut Self {
        self.is_lint = true;
        self
    }

    pub fn code(&mut self, s: DiagnosticId) -> &mut Self {
        self.code = Some(s);
        self
    }

    pub fn clear_code(&mut self) -> &mut Self {
        self.code = None;
        self
    }

    pub fn get_code(&self) -> Option<DiagnosticId> {
        self.code.clone()
    }

    crate fn set_primary_message<M: Into<String>>(&mut self, msg: M) -> &mut Self {
        self.message[0] = (msg.into(), Style::NoStyle);
        self
    }

    pub fn message(&self) -> String {
        self.message.iter().map(|i| i.0.as_str()).collect::<String>()
    }

    pub fn styled_message(&self) -> &Vec<(String, Style)> {
        &self.message
    }

    /// Convenience function for internal use, clients should use one of the
    /// public methods above.
    ///
    /// Used by `proc_macro_server` for implementing `server::Diagnostic`.
    pub fn sub(
        &mut self,
        level: Level,
        message: &str,
        span: MultiSpan,
        render_span: Option<MultiSpan>,
    ) {
        let sub = SubDiagnostic {
            level,
            message: vec![(message.to_owned(), Style::NoStyle)],
            span,
            render_span,
        };
        self.children.push(sub);
    }

    /// Convenience function for internal use, clients should use one of the
    /// public methods above.
    fn sub_with_highlights(
        &mut self,
        level: Level,
        message: Vec<(String, Style)>,
        span: MultiSpan,
        render_span: Option<MultiSpan>,
    ) {
        let sub = SubDiagnostic { level, message, span, render_span };
        self.children.push(sub);
    }

    /// Fields used for Hash, and PartialEq trait
    fn keys(
        &self,
    ) -> (
        &Level,
        &Vec<(String, Style)>,
        &Option<DiagnosticId>,
        &MultiSpan,
        &Vec<CodeSuggestion>,
        Option<&Vec<SubDiagnostic>>,
    ) {
        (
            &self.level,
            &self.message,
            &self.code,
            &self.span,
            &self.suggestions,
            (if self.is_lint { None } else { Some(&self.children) }),
        )
    }
}

impl Hash for Diagnostic {
    fn hash<H>(&self, state: &mut H)
    where
        H: Hasher,
    {
        self.keys().hash(state);
    }
}

impl PartialEq for Diagnostic {
    fn eq(&self, other: &Self) -> bool {
        self.keys() == other.keys()
    }
}

impl SubDiagnostic {
    pub fn message(&self) -> String {
        self.message.iter().map(|i| i.0.as_str()).collect::<String>()
    }

    pub fn styled_message(&self) -> &Vec<(String, Style)> {
        &self.message
    }
}


text:
\chapter{EXPECTED RESULTS}
\par Describe what is the expected output of the method you've proposed. Mention
how this is different from the results of the existing system.
Also mention any performance/quality improvement obtained using your system.
\newpage


text:
import IExtension = require("../../modules/coreplayer-shared-module/iExtension");

interface ISeadragonExtension extends IExtension{
    getMode(): string;
    getViewerBounds(): string;
    getViewerRotation(): number;
}

export = ISeadragonExtension;


text:
'use strict';

// require external bower-managed angular libraries
require('angular');
require('angular-ui-router');

// require controllers ng-module definition
require('./controllers');

// require environment settings
var env = require('./env');

// require a vanilla npm-managed module
var _ = require('lodash');

// a trivial example to use an npm module
_.forEach(_.keys(env), function (key) {
  console.log('env[', key, '] = ', env[key]);
});

// define and export app
var app = module.exports = angular.module('MyApp', [
  'ui.router',
  'MyApp.controllers'
]);

// define app routes
app.config(function ($stateProvider, $urlRouterProvider) {
  $stateProvider
    .state('home', {
      url: '/home',
      templateUrl: env.templatePath('home.html'),
      controller: 'HomeController'
    });

  $urlRouterProvider.otherwise('/home');
});


text:
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Test of ftello() function.
   Copyright (C) 2007-2011 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */

#include <config.h>

/* None of the files accessed by this test are large, so disable the
   fseek link warning if we are not using the gnulib fseek module.  */
#define _GL_NO_LARGE_FILES
#include <stdio.h>

#include "signature.h"
SIGNATURE_CHECK (ftello, off_t, (FILE *));

#include "binary-io.h"
#include "macros.h"

#ifndef FUNC_UNGETC_BROKEN
# define FUNC_UNGETC_BROKEN 0
#endif

int
main (int argc, char **argv _GL_UNUSED)
{
  int ch;
  /* Assume stdin is seekable iff argc > 1.  */
  if (argc == 1)
    {
      ASSERT (ftell (stdin) == -1);
      ASSERT (ftello (stdin) == -1);
      return 0;
    }

  /* mingw ftell is unreliable on text mode input.  */
  SET_BINARY (0);

  /* Simple tests.  For each test, make sure ftell and ftello agree.  */
  ASSERT (ftell (stdin) == 0);
  ASSERT (ftello (stdin) == 0);

  ch = fgetc (stdin);
  ASSERT (ch == '#');
  ASSERT (ftell (stdin) == 1);
  ASSERT (ftello (stdin) == 1);

  /* Test ftell after ungetc of read input.  */
  ch = ungetc ('#', stdin);
  ASSERT (ch == '#');
  ASSERT (ftell (stdin) == 0);
  ASSERT (ftello (stdin) == 0);

  ch = fgetc (stdin);
  ASSERT (ch == '#');
  ASSERT (ftell (stdin) == 1);
  ASSERT (ftello (stdin) == 1);

  /* Test ftell after fseek.  */
  ASSERT (fseek (stdin, 2, SEEK_SET) == 0);
  ASSERT (ftell (stdin) == 2);
  ASSERT (ftello (stdin) == 2);

  /* Test ftell after random ungetc.  */
  ch = fgetc (stdin);
  ASSERT (ch == '/');
  ch = ungetc ('@', stdin);
  ASSERT (ch == '@');
  ASSERT (ftell (stdin) == 2);
  ASSERT (ftello (stdin) == 2);

  ch = fgetc (stdin);
  ASSERT (ch == '@');
  ASSERT (ftell (stdin) == 3);
  ASSERT (ftello (stdin) == 3);

  if (2 < argc)
    {
      if (FUNC_UNGETC_BROKEN)
        {
          fputs ("Skipping test: ungetc cannot handle arbitrary bytes\n",
                 stderr);
          return 77;
        }
      /* Test ftell after ungetc without read.  */
      ASSERT (fseek (stdin, 0, SEEK_CUR) == 0);
      ASSERT (ftell (stdin) == 3);
      ASSERT (ftello (stdin) == 3);

      ch = ungetc ('~', stdin);
      ASSERT (ch == '~');
      ASSERT (ftell (stdin) == 2);
      ASSERT (ftello (stdin) == 2);
    }

#if !defined __MINT__ /* FreeMiNT has problems seeking past end of file */
  /* Test ftell beyond end of file.  */
  ASSERT (fseek (stdin, 0, SEEK_END) == 0);
  ch = ftello (stdin);
  ASSERT (fseek (stdin, 10, SEEK_END) == 0);
  ASSERT (ftell (stdin) == ch + 10);
  ASSERT (ftello (stdin) == ch + 10);
#endif

  return 0;
}


text:
using System;
namespace Valle.TpvFinal
{
	public class VenSecciones : GtkUtilidades.VenBotones
	{
		public VenSecciones ()
		{
		}
		public VenSecciones( int numBonotnes): base(numBonotnes){

		}

		protected override void btnSalir_Click (object sender, EventArgs e)
		{
		    this.HandleBotonera4handleclickBoton(null,null);
			base.btnSalir_Click (sender, e);
		}
	}
}


text:
<?php

namespace DIServer\Services;

use DIServer\Interfaces\IHandler;
use DIServer\Interfaces\IRequest;
use DIServer\Services\Application;

class HandlerManager extends Facade
{
	protected $handlers;

	public static function getFacadeAccessor()
	{
		return \DIServer\Interfaces\IHandlerManager::class;
	}

	/**
	 * @param          $handlerID
	 *
	 * @return IHandler
	 */
	public static function GetHandlerByID($handlerID)
	{
		return static::__callStatic(__FUNCTION__, func_get_args());
	}
}


text:
package test;

import static org.junit.Assert.assertEquals;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;

import org.junit.Test;

import pl.edu.mimuw.cloudatlas.agent.modules.gossip.CommunicateSerializer;
import pl.edu.mimuw.cloudatlas.agent.modules.gossip.ZmisFreshness;
import pl.edu.mimuw.cloudatlas.agent.modules.gossip.messages.GossipCommunicate;
import pl.edu.mimuw.cloudatlas.agent.modules.gossip.messages.QueriesCommunicateInit;
import pl.edu.mimuw.cloudatlas.agent.modules.gossip.messages.ZmiCommunicate;
import pl.edu.mimuw.cloudatlas.common.model.Attribute;
import pl.edu.mimuw.cloudatlas.common.model.AttributesMap;
import pl.edu.mimuw.cloudatlas.common.model.PathName;
import pl.edu.mimuw.cloudatlas.common.model.ValueContact;
import pl.edu.mimuw.cloudatlas.common.model.ValueInt;
import pl.edu.mimuw.cloudatlas.common.model.ValueQuery;
import pl.edu.mimuw.cloudatlas.common.model.ValueString;
import pl.edu.mimuw.cloudatlas.common.single_machine_model.SingleMachineZmiData.ZmiLevel;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Output;

public class CommunicateSerializerTest {
	private void singleTest(GossipCommunicate input) {
		CommunicateSerializer serializer = new CommunicateSerializer();
		byte[] o = serializer.serialize(input);
		System.out.println(o.length);
		GossipCommunicate output = serializer.deserialize(serializer.serialize(input));
		assertEquals(output, input);
	}

	private void serialize(Object obj) {
		CommunicateSerializer serializer = new CommunicateSerializer();

		Output o = new Output(1, Integer.MAX_VALUE);
		serializer.getKryo().writeObject(o, obj);
		System.out.println(o.toBytes().length);
	}

	@Test
	public void test() throws UnknownHostException {
		AttributesMap attrs = new AttributesMap();
		attrs.add("name", new ValueString("pc1"));
		attrs.add("contact", new ValueContact(new PathName("/j/dasdas"), InetAddress.getLocalHost()));
		attrs.add("query", new ValueQuery("&a", "b", 1l, new byte[1]));
		attrs.add("int", new ValueInt(1l));
		singleTest(new ZmiCommunicate(PathName.ROOT, attrs));

		Kryo kryo = new Kryo();
		Output o = new Output(1111);
		kryo.writeObject(o, "qwerty".getBytes());
		System.out.println(o.toBytes().length);

		serialize(new PathName("/j/dasdas"));
		serialize(InetAddress.getLocalHost());
		serialize(new ValueContact(new PathName("/j/dasdas"), InetAddress.getLocalHost()));
		serialize(new Attribute("contact"));

		serialize(attrs);
		singleTest(new ZmiCommunicate(PathName.ROOT, attrs));

		serialize(new QueriesCommunicateInit(new ArrayList<ValueQuery>(), 0));
		serialize(new ZmisFreshness(new ArrayList<ZmiLevel<Long>>()));

	}

}


text:
<?php

namespace aik099\PHPUnit\BrowserConfiguration;

use aik099\PHPUnit\BrowserTestCase;

/**
 * Interface for browser factory creation.
 *
 * @method \Mockery\Expectation shouldReceive(string $name)
 */
interface IBrowserConfigurationFactory
{

	/**
	 * Returns browser configuration instance.
	 *
	 * @param array           $config    Browser.
	 * @param BrowserTestCase $test_case Test case.
	 *
	 * @return BrowserConfiguration
	 */
	public function createBrowserConfiguration(array $config, BrowserTestCase $test_case);

	/**
	 * Registers a browser configuration.
	 *
	 * @param BrowserConfiguration $browser Browser configuration.
	 *
	 * @return void
	 * @throws \InvalidArgumentException When browser configuration is already registered.
	 */
	public function register(BrowserConfiguration $browser);

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Overview List
</TITLE>

<META NAME="date" CONTENT="2013-04-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

Packages

ca.teamTen.recitopia.activities

ca.teamTen.recitopia.models


text:
<title>Arnold and Kayo's Wedding Ceremony</title>
<meta http-equiv="Content-Type" content="text/html;">
<meta name="GENERATOR" content="uWebAbm">

Arnold and Kayo's Wedding

<basefont size="2" face="Verdana">

Page 93 of 115


text:
package de.semlink.csv.test;

import de.semlink.csv.annotation.CSVItem;

public class RootEntity {

	@CSVItem
	protected Long rootId;

	public Long getRootId() {
		return rootId;
	}

	public void setRootId(Long rootId) {
		this.rootId = rootId;
	}

}


text:
import pytest
import json
import sys

import six

from flex.constants import EMPTY
from flex.http import JSONDecodeError

from tests.factories import (
    RequestFactory,
)

def test_null_body_returns_null():
    request = RequestFactory(body=None)
    assert request.data is None

def test_empty_string_body_returns_empty_string():
    request = RequestFactory(body='')
    assert request.data == ''

def test_empty_body_returns_empty():
    request = RequestFactory(body=EMPTY)
    assert request.data is EMPTY

def test_json_content_type_with_json_body():
    request = RequestFactory(
        body=json.dumps({'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'}),
        content_type='application/json',
    )
    assert request.data == {'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'}

def test_json_content_type_with_json_bytes_body():
    body = json.dumps({'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'}).encode('utf-8')
    assert type(body) == bytes
    request = RequestFactory(
        body=body,
        content_type='application/json',
    )
    assert request.data == {'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'}

def test_form_content_type_with_body():
    request = RequestFactory(
        body="key=value&key2=value2&arr[1]=subvalue1&arr[2]=subvalue2",
        content_type='application/x-www-form-urlencoded',
    )
    assert request.data == {'key': 'value', 'key2': 'value2', 'arr[1]': 'subvalue1', 'arr[2]': 'subvalue2'}

def test_unsupported_content_type():
    request = RequestFactory(
        body=json.dumps({'key': 'value'}),
        content_type='application/unsupported',
    )
    with pytest.raises(NotImplementedError):
        request.data

@pytest.mark.skipif(sys.version_info[0:2] >= (3, 5), reason='Python35+ has json.JSONDecodeError')
def test_py2_invalid_json():
    body = '{"trailing comma not valid": [1,]}'
    request = RequestFactory(
        body=body,
        content_type='application/json',
    )

    try:
        json.loads(body)
    except ValueError as e:
        expected_message = str(e)

    with pytest.raises(JSONDecodeError) as e:
        request.data
    assert str(e.value) == expected_message

@pytest.mark.skipif(sys.version_info[0:2] < (3, 5), reason='Python2-34 do not have json.JSONDecodeError')
def test_py3_invalid_json():
    body = '{"trailing comma not valid": [1,]}'
    request = RequestFactory(
        body=body,
        content_type='application/json',
    )

    try:
        json.loads(body)
    except JSONDecodeError as e:
        expected_exception = e

    with pytest.raises(JSONDecodeError) as e:
        request.data
    assert e.value.msg == expected_exception.msg

def test_content_type_is_none():
    request = RequestFactory(body='some content', content_type=None)
    with pytest.raises(NotImplementedError):
        request.data


text:
package music

// GetMp3InfoPath : return path of mp3info.
func GetMp3InfoPath(folder string)string{
    return "mp3info"
}


text:
package org.apache.tomcat.util.http.parser;

import java.io.IOException;
import java.io.StringReader;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.junit.Assert;
import org.junit.Test;

/**
 * Unit tests for {@link HttpParser} focusing on media-type as defined in
 * section 3.7 of RFC 2616.
 */
public class TestMediaType {

    // Include whitespace to ensure Parser handles it correctly (it should be
    // skipped).
    private static final String TYPE = " foo ";
    private static final String SUBTYPE = " bar ";
    private static final String TYPES = TYPE + "/" + SUBTYPE;

    private static final Parameter PARAM_TOKEN =
            new Parameter("a", "b");
    private static final Parameter PARAM_QUOTED =
            new Parameter("x", "\"y\"");
    private static final Parameter PARAM_EMPTY_QUOTED =
            new Parameter("z", "\"\"");
    private static final Parameter PARAM_COMPLEX_QUOTED =
            new Parameter("w", "\"foo'bar,a=b;x=y\"");

    private static final String CHARSET = "UTF-8";
    private static final String WS_CHARSET = " \tUTF-8";
    private static final String CHARSET_WS = "UTF-8 \t";
    // Since this is quoted, it should retain the space at the end
    private static final String CHARSET_QUOTED = "\"" + CHARSET_WS + "\"";
    private static final Parameter PARAM_CHARSET =
            new Parameter("charset", CHARSET);
    private static final Parameter PARAM_WS_CHARSET =
            new Parameter("charset", WS_CHARSET);
    private static final Parameter PARAM_CHARSET_WS =
            new Parameter("charset", CHARSET_WS);
    private static final Parameter PARAM_CHARSET_QUOTED =
            new Parameter("charset", CHARSET_QUOTED);

    private static final String[] LWS_VALUES = new String[] {
            "", " ", "\t", "\r", "\n", "\r\n", " \r", " \n", " \r\n",
            "\r ", "\n ", "\r\n ", " \r ", " \n ", " \r\n " };

    @Test
    public void testSimple() throws IOException {
        doTest();
    }

    @Test
    public void testSimpleWithToken() throws IOException {
        doTest(PARAM_TOKEN);
    }

    @Test
    public void testSimpleWithQuotedString() throws IOException {
        doTest(PARAM_QUOTED);
    }

    @Test
    public void testSimpleWithEmptyQuotedString() throws IOException {
        doTest(PARAM_EMPTY_QUOTED);
    }

    @Test
    public void testSimpleWithComplexQuotedString() throws IOException {
        doTest(PARAM_COMPLEX_QUOTED);
    }

    @Test
    public void testSimpleWithCharset() throws IOException {
        doTest(PARAM_CHARSET);
    }

    @Test
    public void testSimpleWithCharsetWhitespaceBefore() throws IOException {
        doTest(PARAM_WS_CHARSET);
    }

    @Test
    public void testSimpleWithCharsetWhitespaceAfter() throws IOException {
        doTest(PARAM_CHARSET_WS);
    }

    @Test
    public void testSimpleWithCharsetQuoted() throws IOException {
        doTest(PARAM_CHARSET_QUOTED);
    }

    @Test
    public void testSimpleWithAll() throws IOException {
        doTest(PARAM_COMPLEX_QUOTED, PARAM_EMPTY_QUOTED, PARAM_QUOTED,
                PARAM_TOKEN, PARAM_CHARSET);
    }

    @Test
    public void testCharset() throws IOException {
        StringBuilder sb = new StringBuilder();
        sb.append(TYPES);
        sb.append(PARAM_CHARSET);
        sb.append(PARAM_TOKEN);

        StringReader sr = new StringReader(sb.toString());
        MediaType m = MediaType.parseMediaType(sr);

        assertEquals("foo/bar; charset=UTF-8; a=b", m.toString());
        assertEquals(CHARSET, m.getCharset());
        assertEquals("foo/bar; a=b", m.toStringNoCharset());
    }

    @Test
    public void testCharsetQuoted() throws IOException {
        StringBuilder sb = new StringBuilder();
        sb.append(TYPES);
        sb.append(PARAM_CHARSET_QUOTED);

        StringReader sr = new StringReader(sb.toString());
        MediaType m = MediaType.parseMediaType(sr);

        assertEquals(CHARSET_WS, m.getCharset());
        assertEquals(TYPES.replaceAll(" ", ""),
                m.toStringNoCharset());
    }

    @Test
    public void testBug52811() throws IOException {
        String input = "multipart/related;boundary=1_4F50BD36_CDF8C28;" +
                "Start=\"<31671603.smil>\";" +
                "Type=\"application/smil;charset=UTF-8\"";

        StringReader sr = new StringReader(input);
        MediaType m = MediaType.parseMediaType(sr);

        // Check the types
        assertEquals("multipart", m.getType());
        assertEquals("related", m.getSubtype());

        // Check the parameters
        assertTrue(m.getParameterCount() == 3);

        assertEquals("1_4F50BD36_CDF8C28", m.getParameterValue("boundary"));
        assertEquals("\"<31671603.smil>\"", m.getParameterValue("Start"));
        assertEquals("\"application/smil;charset=UTF-8\"",
                m.getParameterValue("Type"));

        String expected = "multipart/related; boundary=1_4F50BD36_CDF8C28; " +
                "start=\"<31671603.smil>\"; " +
                "type=\"application/smil;charset=UTF-8\"";
        assertEquals(expected, m.toString());
        assertEquals(expected, m.toStringNoCharset());
        assertNull(m.getCharset());
    }

    @Test
    public void testBug53353() throws IOException {
        String input = "text/html; UTF-8;charset=UTF-8";

        StringReader sr = new StringReader(input);
        MediaType m = MediaType.parseMediaType(sr);

        // Check the types
        assertEquals("text", m.getType());
        assertEquals("html", m.getSubtype());

        // Check the parameters
        assertTrue(m.getParameterCount() == 2);

        assertEquals("", m.getParameterValue("UTF-8"));
        assertEquals("UTF-8", m.getCharset());

        // Note: Invalid input is filtered out
        assertEquals("text/html; charset=UTF-8", m.toString());
        assertEquals("UTF-8", m.getCharset());
    }

    @Test
    public void testBug55454() throws IOException {
        String input = "text/html;;charset=UTF-8";

        StringReader sr = new StringReader(input);
        MediaType m = MediaType.parseMediaType(sr);

        assertEquals("text", m.getType());
        assertEquals("html", m.getSubtype());

        assertTrue(m.getParameterCount() == 1);

        assertEquals("UTF-8", m.getParameterValue("charset"));
        assertEquals("UTF-8", m.getCharset());

        assertEquals("text/html; charset=UTF-8", m.toString());
    }

    private void doTest(Parameter... parameters) throws IOException {
        for (String lws : LWS_VALUES) {
            doTest(lws, parameters);
        }
    }

    private void doTest(String lws, Parameter... parameters)
            throws IOException {
        StringBuilder sb = new StringBuilder();
        sb.append(TYPES);
        for (Parameter p : parameters) {
            sb.append(p.toString(lws));
        }

        StringReader sr = new StringReader(sb.toString());
        MediaType m = MediaType.parseMediaType(sr);

        // Check all expected parameters are present
        assertTrue(m.getParameterCount() == parameters.length);

        // Check the types
        assertEquals(TYPE.trim(), m.getType());
        assertEquals(SUBTYPE.trim(), m.getSubtype());

        // Check the parameters
        for (int i = 0; i <  parameters.length; i++) {
            assertEquals(parameters[i].getValue().trim(),
                    m.getParameterValue(parameters[i].getName().trim()));
        }
    }

    private static class Parameter {
        private final String name;
        private final String value;

        public Parameter(String name,String value) {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return toString("");
        }

        public String toString(String lws) {
            StringBuilder sb = new StringBuilder();
            sb.append(lws);
            sb.append(";");
            sb.append(lws);
            sb.append(name);
            sb.append(lws);
            sb.append("=");
            sb.append(lws);
            sb.append(value);
            sb.append(lws);
            return sb.toString();
        }
}

    @Test
    public void testCase() throws Exception {
        StringReader sr = new StringReader("type/sub-type;a=1;B=2");
        MediaType m = MediaType.parseMediaType(sr);

        Assert.assertEquals("1", m.getParameterValue("A"));
        Assert.assertEquals("1", m.getParameterValue("a"));
        Assert.assertEquals("2", m.getParameterValue("B"));
        Assert.assertEquals("2", m.getParameterValue("b"));
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Nachträge zur Flechtliste aus der Umgenbung Revals 61 (1913)

#### Original name
Parmelia physodes f. vittatoides Mereschk.

### Remarks
null


text:
package org.racoonman.modelanddao.dao;

import java.util.List;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Query;
import org.racoonman.modelanddao.model.Company;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author daniel
 */
@Transactional
@Component
public class CompanyDaoImpl implements CompanyDao {

    @Autowired
    @Qualifier("pmfTransactionAware")
    private PersistenceManagerFactory pmf;

    @Override
    public Company getCompanyById(String identificator) {
        PersistenceManager pm = pmf.getPersistenceManager();
        Query q = pm.newQuery(Company.class, "identificator == :id");
        List<Company> list = (List<Company>) q.execute(identificator);

        if (list.size() == 1) {
            return list.get(0);
        }

        return null;
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Source: models/Show.js</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Source: models/Show.js

/**
 * @module Show
 * @description Model to represent TV Show
 * @param name { string }  name of the show
 * @param description { string } description on the show
 * @param imageUrl { string } show's image
 * @param users { Array } users following the show
 * @docs        :: http://sailsjs.org/documentation/concepts/models-and-orm/models
 */

module.exports = {

  /** attributes - name, description, imageUrl */
  attributes: {
    name: {
      type: 'string',
      required: true
    },
    description: {
      type: 'string'
    },
    imageUrl: {
      type: 'string'
    },

    users: {
      collection: 'user',
      via: 'shows',
    },
  }
};

Home

Modules

AuthController

sessionAuth

Show

ShowController

ShowRating

ShowRatingController

User

UserShowController

    Documentation generated by JSDoc 3.4.0 on Mon May 16 2016 00:50:39 GMT+0200 (CEST)


text:
/* config.h.  Generated by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strlcat' function. */
/* #undef HAVE_STRLCAT */

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Name of package */
#define PACKAGE "libXpm"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"

/* Define to the full name of this package. */
#define PACKAGE_NAME "libXpm"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libXpm 3.5.4.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libXpm"

/* Define to the version of this package. */
#define PACKAGE_VERSION "3.5.4.2"

/* Define to 1 to automatically look for files with .Z & .gz extensions */
#define STAT_ZFILE 1

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "3.5.4.2"


text:
'use strict';

fdescribe('Testing the about controller', () => {

let $q, vm, $rootScope, pages, mockPages, setPromise, defer, promise,
 response = { data: { pageId: 1, Title: 'page1' }};

  beforeEach(() => {
    module('myApp.about');
    module('myApp.config');
    module(($provide) => {
      $provide.factory('pages', ['$q', ($q) => {
        setPromise = true;
        defer = $q.defer();
        promise = defer.promise;
        function getPages() {
          if(setPromise) {
            defer.resolve(response);
          } else {
            defer.reject('bad');
          }
          return defer.promise;
        }
        return {
          getPages: getPages
        }
      }]);
    });
  });

  beforeEach(inject((_$q_, _$rootScope_, $controller, pages) => {
    $rootScope = _$rootScope_;
    mockPages = pages;
    spyOn(mockPages, 'getPages').and.callThrough();
    vm = $controller('aboutCtrl', {
      pages: mockPages
    });
  }));

  it('expect message to be all good', () => {
    expect(vm.message).toEqual('all is good');
  });

  it('mockPages to have been called', () => {
    $rootScope.$digest();
    expect(mockPages.getPages).toHaveBeenCalled();
  });

  it('resolve the pages promise', () => {
    $rootScope.$digest();
    expect(vm.pages).toBe(response.data);
  });

});

fdescribe('Testing the about controller promise rejected', () => {

let $q, vm, $rootScope, pages, mockPages, setPromise, defer, promise,
 response = { data: { pageId: 1, Title: 'page1' }};

  beforeEach(() => {
    module('myApp.about');
    module('myApp.config');
    module(($provide) => {
      $provide.factory('pages', ['$q', ($q) => {
        setPromise = false;
        defer = $q.defer();
        promise = defer.promise;
        function getPages() {
          if(setPromise) {
            defer.resolve(response);
          } else {
            defer.reject('bad');
          }
          return defer.promise;
        }
        return {
          getPages: getPages
        }
      }]);
    });
  });

  beforeEach(inject((_$q_, _$rootScope_, $controller, pages) => {
    $rootScope = _$rootScope_;
    mockPages = pages;
    spyOn(mockPages, 'getPages').and.callThrough();
    vm = $controller('aboutCtrl', {
      pages: mockPages
    });
  }));

  it('mockPages to have been called', () => {
    $rootScope.$digest();
    expect(mockPages.getPages).toHaveBeenCalled();
  });

  it('resolve the pages promise', () => {
    $rootScope.$digest();
    expect(vm.error).toBe('getPages has thrown an error');
  });

});

fdescribe('Testing the pages factory', () => {

  let vm, mockPages, myConfig, http, httpBackend, jsonResponse = { title: 'first page'};

  beforeEach(() => {
    module('myApp.about');
    module('myApp.config');
  });

  beforeEach(inject(($controller, pages, _myConfig_, $http, $httpBackend) => {
    mockPages = pages;
    myConfig = _myConfig_;
    httpBackend = $httpBackend;
    httpBackend.whenGET(/(wp-json\/wp\/v2\/pages$)/).respond(jsonResponse);
    spyOn(mockPages, 'getPages').and.callThrough();
    vm = $controller('aboutCtrl', {
      pages: mockPages,
      $http: http
    });
  }));

  it('aboutCtrl pages message', () => {
    expect(vm.message).toEqual('all is good');
  });

  it('pages promise to have been called', () => {
    expect(mockPages.getPages).toHaveBeenCalled();
  });

  it('mock httpbackend test pages promise', () => {
    httpBackend.flush();
    expect(vm.pages).toEqual(jasmine.objectContaining({ title: 'first page' }));
  });

});


text:
#import "ARDVideoCallView.h"

#import <AVFoundation/AVFoundation.h>
#import "UIImage+ARDUtilities.h"

static CGFloat const kHangupButtonPadding = 16;
static CGFloat const kHangupButtonSize = 48;
static CGFloat const kLocalVideoViewWidth = 90;
static CGFloat const kLocalVideoViewHeight = 120;
static CGFloat const kLocalVideoViewPadding = 8;

@interface ARDVideoCallView () <RTCEAGLVideoViewDelegate>
@end

@implementation ARDVideoCallView {
  UIButton *_hangupButton;
  CGSize _localVideoSize;
  CGSize _remoteVideoSize;
}

@synthesize statusLabel = _statusLabel;
@synthesize localVideoView = _localVideoView;
@synthesize remoteVideoView = _remoteVideoView;
@synthesize delegate = _delegate;

- (instancetype)initWithFrame:(CGRect)frame {
  if (self = [super initWithFrame:frame]) {
    _remoteVideoView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero];
    _remoteVideoView.delegate = self;
    [self addSubview:_remoteVideoView];

    _localVideoView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero];
    _localVideoView.transform = CGAffineTransformMakeScale(-1, 1);
    _localVideoView.delegate = self;
    [self addSubview:_localVideoView];

    _hangupButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _hangupButton.backgroundColor = [UIColor redColor];
    _hangupButton.layer.cornerRadius = kHangupButtonSize / 2;
    _hangupButton.layer.masksToBounds = YES;
    UIImage *image = [UIImage imageForName:@"ic_call_end_black_24dp.png"
                                     color:[UIColor whiteColor]];
    [_hangupButton setImage:image forState:UIControlStateNormal];
    [_hangupButton addTarget:self
                      action:@selector(onHangup:)
            forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_hangupButton];

    _statusLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    _statusLabel.font = [UIFont fontWithName:@"Roboto" size:16];
    _statusLabel.textColor = [UIColor whiteColor];
    [self addSubview:_statusLabel];
  }
  return self;
}

- (void)layoutSubviews {
  CGRect bounds = self.bounds;
  if (_remoteVideoSize.width > 0 && _remoteVideoSize.height > 0) {
    // Aspect fill remote video into bounds.
    CGRect remoteVideoFrame =
        AVMakeRectWithAspectRatioInsideRect(_remoteVideoSize, bounds);
    CGFloat scale = 1;
    if (remoteVideoFrame.size.width > remoteVideoFrame.size.height) {
      // Scale by height.
      scale = bounds.size.height / remoteVideoFrame.size.height;
    } else {
      // Scale by width.
      scale = bounds.size.width / remoteVideoFrame.size.width;
    }
    remoteVideoFrame.size.height *= scale;
    remoteVideoFrame.size.width *= scale;
    _remoteVideoView.frame = remoteVideoFrame;
    _remoteVideoView.center =
        CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));
  } else {
    _remoteVideoView.frame = bounds;
  }

  CGRect localVideoFrame = CGRectZero;
  localVideoFrame.origin.x =
      CGRectGetMaxX(bounds) - kLocalVideoViewWidth - kLocalVideoViewPadding;
  localVideoFrame.origin.y =
      CGRectGetMaxY(bounds) - kLocalVideoViewHeight - kLocalVideoViewPadding;
  localVideoFrame.size.width = kLocalVideoViewWidth;
  localVideoFrame.size.height = kLocalVideoViewHeight;
  _localVideoView.frame = localVideoFrame;

  _hangupButton.frame =
      CGRectMake(CGRectGetMinX(bounds) + kHangupButtonPadding,
                 CGRectGetMaxY(bounds) - kHangupButtonPadding -
                     kHangupButtonSize,
                 kHangupButtonSize,
                 kHangupButtonSize);

  [_statusLabel sizeToFit];
  _statusLabel.center =
      CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));
}

#pragma mark - RTCEAGLVideoViewDelegate

- (void)videoView:(RTCEAGLVideoView*)videoView didChangeVideoSize:(CGSize)size {
  if (videoView == _localVideoView) {
    _localVideoSize = size;
  } else if (videoView == _remoteVideoView) {
    _remoteVideoSize = size;
  }
  [self setNeedsLayout];
}

#pragma mark - Private

- (void)onHangup:(id)sender {
  [_delegate videoCallViewDidHangup:self];
}

@end


text:
package org.drools.guvnor.client.explorer.drools;

import com.google.gwt.place.shared.WithTokenizers;
import org.drools.guvnor.client.explorer.GuvnorPlaceHistoryMapper;
import org.drools.guvnor.client.explorer.navigation.browse.StatePlace;
import org.drools.guvnor.client.explorer.navigation.deployment.SnapshotAssetListPlace;

@WithTokenizers(
        {
                StatePlace.Tokenizer.class,
                SnapshotAssetListPlace.Tokenizer.class
        }
)
public interface GuvnorDroolsPlaceHistoryMapper extends GuvnorPlaceHistoryMapper {

}


text:
<?php

/**
 * PayPal Donations
 */

// Load plugin options
require_once( dirname( __FILE__) . '/keel-paypal-donations-options.php' );

// PayPal Donations Class
class Keel_PayPal_Donations {

	/**
	 * Get the URL of the current page
	 * @return string The URL
	 */
	private static function get_url() {

		// Get URL
		$url  = @( $_SERVER['HTTPS'] != 'on' ) ? 'http://' . $_SERVER['SERVER_NAME'] :  'https://' . $_SERVER['SERVER_NAME'];
		$url .= ( $_SERVER['SERVER_PORT'] !== 80 ) ? ":" . $_SERVER['SERVER_PORT'] : '';
		$url .= $_SERVER['REQUEST_URI'];

		return $url;

	}

	/**
	 * Process donations table on submit
	 */
	public static function process_donations_table() {

		// Verify form exists and was properly posted
		if ( isset( $_POST['keel_paypal_donations_table_process'] ) ) {
			if ( wp_verify_nonce( $_POST['keel_paypal_donations_table_process'], 'keel_paypal_donations_table_nonce' ) ) {

				// Variables
				$options = keel_paypal_donations_get_theme_options();
				$referer = self::get_url();

				// Values
				$type = isset( $_POST['paypal_donations_form_recurring'] ) ? '_xclick-subscriptions' : '_donations';
				$description = isset( $_POST['paypal_donations_form_recurring'] ) ? 'Monthly Donation' : 'Donation';
				$in_honor = isset( $_POST['paypal_donations_form_in_honor'] ) && !empty( $_POST['paypal_donations_form_in_honor'] ) ? ' - ' . $options['in_honor'] . ' ' . $_POST['paypal_donations_form_in_honor'] : '';
				$amount = isset( $_POST['paypal_donations_form_amount'] ) ? $_POST['paypal_donations_form_amount'] : '';
				if ( ( empty($amount) || $amount === 'other' ) && isset( $_POST['paypal_donations_form_other'] ) && !empty( $_POST['paypal_donations_form_other'] ) ) {
					$amount = ltrim( $_POST['paypal_donations_form_other'], '$ £' );
				}
				$currency = empty( $amount ) ? '' : ': ' . $options['currency'] . $amount;
				$return = empty( $options['success_link'] ) ? $referer : $options['success_link'];

				// Construct PayPal URL
				$base_url = 'https://www.paypal.com/cgi-bin/webscr?';
				$queries = http_build_query(
					array(
						'cmd' => $type,
						'business' => $options['email'],
						'item_name' => $description . $currency . $in_honor,
						'amount' => $amount,
						'a3' => $amount,
						'p3' => 1,
						't3' => 'M',
						'src' => 1,
						'return' => $return,
						'cancel_return' => $referer,
						'notify_url' => $options['notify_url'],
					)
				);
				$url = $base_url . $queries;

				wp_redirect( $url );
				exit;

			} else {
				die( 'Security check' );
			}
		}

	}

	/**
	 * Process donation button on submit
	 */
	public static function process_donations_button() {

		// Verify form exists and was properly posted
		if ( isset( $_POST['keel_paypal_donations_button_process'] ) ) {
			if ( wp_verify_nonce( $_POST['keel_paypal_donations_button_process'], 'keel_paypal_donations_button_nonce' ) ) {

				// Variables
				$options = keel_paypal_donations_get_theme_options();
				$referer = self::get_url();

				// Values
				$type = isset( $_POST['paypal_donations_button_recurring'] ) ? '_xclick-subscriptions' : '_donations';
				$description = isset( $_POST['paypal_donations_button_description'] ) ? $_POST['paypal_donations_button_description'] : 'Donation';
				$amount = isset( $_POST['paypal_donations_button_amount'] ) ? $_POST['paypal_donations_button_amount'] : '';
				$currency = empty( $amount ) ? '' : ': ' . $options['currency'] . $amount;
				$return = empty( $options['success_link'] ) ? $referer : $options['success_link'];
				$notify_url = isset( $_POST['paypal_donations_button_notify_url'] ) ? $_POST['paypal_donations_button_notify_url'] : '';

				// Construct PayPal URL
				$base_url = 'https://www.paypal.com/cgi-bin/webscr?';
				$queries = http_build_query(
					array(
						'cmd' => $type,
						'business' => $options['email'],
						'item_name' => $description . $currency,
						'amount' => $amount,
						'a3' => $amount,
						'p3' => 1,
						't3' => 'M',
						'src' => 1,
						'return' => $return,
						'cancel_return' => $referer,
						'notify_url' => $notify_url,
					)
				);
				$url = $base_url . $queries;

				wp_redirect( $url );
				exit;

			} else {
				die( 'Security check' );
			}
		}

	}

	/**
	 * Render the PayPal donations table
	 * @return string  The donation table markup
	 */
	public static function render_donations_table() {

		// Check that feature is activated
		$dev_options = keel_developer_options();
		if ( !$dev_options['paypal'] ) return '';

		// Options and settings
		$options = keel_paypal_donations_get_theme_options();
		$table = '';
		$table_body = '';
		$show_in_honor = $options['show_in_honor'] === 'on';
		$show_recurring = $options['show_recurring'] === 'on';

		if ( empty( $options['email'] ) || empty( $options['amounts'][0]['amount'] ) || empty( $options['amounts'][0]['description'] ) ) return $table;

		foreach ($options['amounts'] as $key => $amount) {
			$table_body .=
				'
' .
					'' .
						'' .
							'<input type="radio" name="paypal_donations_form_amount" id="paypal_donations_form_amount_' . $key . '" value="' . $amount['amount'] . '" ' . checked( $options['default_amount'], $key ) . '> ' .
							$options['currency'] . $amount['amount'] .
						'' .
					'	' .
					'' .
						'' .
							$amount['description'] .
						'' .
					'	' .
				'
';
		}

		if ( $options['show_other'] === 'on' ) {
			$table_body .=
				'
' .
					'' .
						'' .
							'<input type="radio" name="paypal_donations_form_amount" id="paypal_donations_form_amount_other" value="other"> ' .
							__( 'Other', 'keel' ) .
						'' .
					'	' .
					'' .
						$options['currency'] . ' <input type="number" step="any" min="0" class="input-inline input-condensed input-underline no-margin-bottom" name="paypal_donations_form_other" id="paypal_donations_form_other" value="">' .
					'	' .
				'
';
		}

		if ( $show_in_honor || $show_recurring ) {
			$table_body .=
				'
' .
					'';

			if ( $show_in_honor ) {
				$table_body .=
					'' .
						// '<input type="checkbox" id="paypal_donations_form_donate_in_honor"> ' .
						$options['in_honor'] . ' <input type="text" class="input-inline input-condensed input-underline no-margin-bottom" name="paypal_donations_form_in_honor" id="paypal_donations_form_in_honor" value="">' .
					'';
			}

			if ( $show_recurring ) {
				$table_body .=
					'' .
						'<input type="checkbox" name="paypal_donations_form_recurring" value="on"> ' .
						$options['recurring'] .
					'';
			}

			$table_body .=
					'	' .
				'
';
		}

		$table =
			'<form class="paypal-donations-table" id="paypal-donations-table" name="paypal-donations-table" action="" method="post">' .
				'
' .
					'
' .
						'
' .
							'' . __( $options['heading_amount'], 'keel' ) . '	' .
							'' . __( $options['heading_impact'], 'keel' ) . '	' .
						'
' .
					'
' .
					'
' .
						$table_body .
					'
' .
				'
' .
				wp_nonce_field( 'keel_paypal_donations_table_nonce', 'keel_paypal_donations_table_process' ) .
				'<button class="btn">' . $options['donate'] . '</button>' .
			'</form>';

		$script = '';

			// Unminified
			//

		return $table . $script;

	}

	/**
	 * Render a PayPal donation button
	 * @return string  The donation button markup
	 */
	public static function render_donations_button( $atts ) {

		// Check that feature is activated
		$dev_options = keel_developer_options();
		if ( !$dev_options['paypal'] ) return '';

		// Shortcode values
		$paypal = shortcode_atts( array(
			'amount' => '',
			'label' => '',
			'recurring' => false,
			'description' => '',
			'size' => '',
			'notify_url' => '',
		), $atts );

		// Options and settings
		$options = keel_paypal_donations_get_theme_options();

		// If not PayPal account is provided, do nothing
		if ( empty( $options['email'] ) ) return;

		// Variables
		$amount = ltrim( $paypal['amount'], '$ £' );
		$label = empty( $paypal['label'] ) ? $options['currency'] . $amount : $paypal['label'];
		$recurring = empty( $paypal['recurring'] ) ? '' : '<input type="hidden" name="paypal_donations_button_recurring" value="true">';
		$description = empty( $paypal['description'] ) ? '' : '<input type="hidden" name="paypal_donations_button_description" value="' . $paypal['description'] . '">';
		$form =
			'<form class="paypal-donations-button" id="paypal-donations-table-' . $amount . '" name="paypal-donations-table" action="" method="post">' .
				'<input type="hidden" name="paypal_donations_button_amount" value="' . $amount . '">' .
				'<input type="hidden" name="paypal_donations_button_notify_url" value="' . $paypal['notify_url'] . '">' .
				$recurring .
				$description .
				wp_nonce_field( 'keel_paypal_donations_button_nonce', 'keel_paypal_donations_button_process' ) .
				'<button class="btn btn-' . $paypal['size'] . '">' . $label . '</button>' .
			'</form>';

		return $form;

	}

	/**
	 * Initialize hooks and shortcodes
	 */
	public function __construct() {
		add_shortcode( 'paypal_donations_form', array( $this, 'render_donations_table' ) );
		add_shortcode( 'paypal_donations_button', array( $this, 'render_donations_button' ) );
		add_action( 'init', array( $this, 'process_donations_table' ) );
		add_action( 'init', array( $this, 'process_donations_button' ) );
	}

}

new Keel_PayPal_Donations();


text:
/*
eslint-disable no-console
*/

import chalk from 'chalk'
import moment from 'moment'
import _ from 'lodash'

type LogType = 'assert' | 'debug' | 'error' | 'info' | 'log' | 'table' | 'trace' | 'warn'

type DefaultLogger = Console['log']

const logLevels = {
  assert: {
    color: '#ed556a',
  },
  debug: {
    color: '#EEAEEE',
  },
  error: {
    color: '#ed556a',
  },
  info: {
    color: 'cyan',
  },
  log: {
    color: '#66ff66',
  },
  table: {
    color: '#913999',
  },
  trace: {
    color: '#FFAEB9',
  },
  warn: {
    color: '#ff9900',
  },
}

const getLogformatArgs = (logLevel: LogType = 'log', prefix: string) => [
  `%c${moment().format('YYYY-MM-DD HH:mm:ss')} <${logLevel.toUpperCase()}> ${prefix.toUpperCase()}`,
  `
    background: ${logLevels[logLevel]?.color};
    font-weight: bold;
    padding: 3px 5px;
    margin-bottom: 5px;
    color: ${logLevel === 'error' ? '#fff' : '#000'};
    border-radius: 5px;
  `,
  `\n`,
]

// Debug wrapper class is only for the purpose of beautifying
// when certain function is called through the dev-tool console.
// (e.g., shows 'Debug {enabled: true}' instead of 'undefined')
// It should NOT be used for any other purpose.
class Debug {
  public static wrap(o: string | object) {
    if (typeof o === 'string') {
      return Object.assign(new Debug(), { msg: o })
    } else if (typeof o === 'object') {
      return Object.assign(new Debug(), o)
    } else {
      return o
    }
  }
}

// Globals
console.assert(process, `process doesn't exist`)

// The debug instance depends on Electron process type
const isRenderer = (process || {}).type === 'renderer'

// the very base class
abstract class BaseDebugger {
  public debug = this.getLeveledLog('debug')

  public log = this.getLeveledLog('log')

  public info: Console['info'] = (...args) => this.getLeveledLog('info')(...args)

  public warn: Console['warn'] = (...args) => this.getLeveledLog('warn')(...args)

  public error: Console['error'] = (...args) => this.getLeveledLog('error')(...args)

  public trace: Console['trace'] | void = (...args) => this.getLeveledLog('trace')(...args)

  public table: Console['table'] = (...args) =>
    (this.getLeveledLog('table') as Console['table'])(...args)

  public assert: Console['assert'] = (...args) => this.getLeveledLog('assert')(...args)

  protected prefix = '[MAIN]'

  protected _enabled = false

  public isEnabled() {
    return this._enabled
  }

  public setEnabled(b = true) {
    this._enabled = b
    return Debug.wrap({ enabled: b })
  }

  public enable() {
    this.setEnabled(true)
  }

  public disable() {
    this.setEnabled(false)
  }

  protected abstract getLogFunc(level: LogType): DefaultLogger

  protected getLeveledLog(level: LogType): (...args: any[]) => void {
    if (this.isEnabled()) {
      switch (level) {
        case 'assert':
          return console.assert.bind(console)
        case 'table':
          return console.table.bind(console)
        default:
          return this.getLogFunc(level)
      }
    } else {
      return _.noop
    }
  }
}

// Extra Option Handler
class ExtraDebugger extends BaseDebugger {
  constructor(tag: string) {
    super()
    this.prefix = tag
  }

  protected getLogFunc(level: LogType = 'log') {
    if (this.prefix != null) {
      return console[level as 'log'].bind(console, ...getLogformatArgs(level, this.prefix))
    } else {
      return console[level].bind(console)
    }
  }
}

// Base Implementation
abstract class DebuggerBase extends BaseDebugger {
  public h = new Map<string, ExtraDebugger>()
  public internalLog = this.getLogFunc('log')

  protected initialised = false

  constructor() {
    super()
    this.init()
  }

  public isInitialised() {
    const r = this.initialised
    this.initialised = true
    return r
  }

  public validateTagName(tag: string) {
    const valid = typeof tag === 'string' && tag.length > 0
    console.assert(valid, 'You must pass a non-empty string! Current:', tag)
    return valid
  }

  public enableExtra(tag: string) {
    if (!this.extra(tag)) {
      return Debug.wrap('Invalid extra option name')
    }
    this.extra(tag).enable()
    return Debug.wrap({ enabledExtra: tag })
  }

  public disableExtra(tag: string) {
    if (!this.validateTagName(tag)) {
      return Debug.wrap('Invalid extra option name')
    }
    this.extra(tag).disable()
    return Debug.wrap({ disabledExtra: tag })
  }

  public isExtraEnabled(tag: string) {
    if (!this.validateTagName(tag)) {
      return false
    }
    const h = this.h.get(tag)
    return h && h.isEnabled()
  }

  public getAllExtraOptionsAsArray() {
    return Array.from(this.h)
  }

  public extra(tag: string, enableImmediately = false) {
    if (this.validateTagName(tag) && !this.h.get(tag)) {
      const extraHandler = new ExtraDebugger(tag)
      if (enableImmediately) {
        extraHandler.setEnabled()
      }
      this.h.set(tag, extraHandler)
    }
    return this.h.get(tag)!
  }

  public main() {
    if (!this.h || !this.h.get('main')) {
      this.h.set('main', new ExtraDebugger('[MAIN]'))
    }
    return this.h.get('main')!
  }

  public init() {
    this.isEnabled() && this.log('Debugger Enabled')
    if (this.h.size > 0) {
      this.internalLog(`handler(s): ${Array.from(this.h.keys())}`)
    }
  }

  protected abstract getLogFunc(level: LogType): DefaultLogger
}

// add two clickable method to enable/disable
class Booster {
  public enabled: boolean
  public type: string

  constructor(dbgr: BaseDebugger, type: string, relistFunc: () => void) {
    this.enabled = dbgr.isEnabled()
    this.type = type
    const enable = dbgr.enable.bind(dbgr)
    const disable = dbgr.disable.bind(dbgr)
    if (this.enabled) {
      Reflect.defineProperty(this, 'ClickToDisable -->', {
        get: () => {
          disable()
          relistFunc()
          return 'Disabled'
        },
      })
    } else {
      Reflect.defineProperty(this, 'ClickToEnable -->', {
        get: () => {
          enable()
          relistFunc()
          return 'Enabled'
        },
      })
    }
  }
}

// For the Main Process
class DebuggerMain extends DebuggerBase {
  public static getInstance() {
    if (!DebuggerMain.instance) {
      DebuggerMain.instance = new DebuggerMain()
    }
    return DebuggerMain.instance
  }

  private static instance: DebuggerMain | null = null

  constructor() {
    super()
    this.assert(!DebuggerMain.instance, 'cannot create second instance')
    this.info('debugger main created')
  }

  public getLogFunc(level: LogType = 'log') {
    return console[level as 'log'].bind(
      console,
      chalk.cyan(`${this.prefix} %s`),
    ) as Console[LogType]
  }
}

// Helper classes to make life easier with DevTools
class DevToolsBooster {
  [key: string]: Booster | null
}

// For the Renderer Processes
class DebuggerRenderer extends DebuggerBase {
  public static getInstance() {
    if (!DebuggerRenderer.instance) {
      DebuggerRenderer.instance = new DebuggerRenderer()
    }
    return DebuggerRenderer.instance
  }

  private static instance: DebuggerRenderer | null = null

  public list() {
    const relist = this.list.bind(this)
    const output = new DevToolsBooster()
    output.DEBUG = new Booster(this, 'main', relist)
    this.h.forEach((handler, opt) => {
      if (opt === 'main') {
        return
      }
      output[opt] = new Booster(handler, 'extra', relist)
    })
    console.table(output)
  }

  protected getLogFunc(level: LogType = 'log'): Console[LogType] {
    if (this.prefix != null) {
      return console[level as 'log'].bind(console, ...getLogformatArgs(level, this.prefix))
    } else {
      return console[level].bind(console)
    }
  }
}

const dbg = isRenderer ? DebuggerRenderer.getInstance() : DebuggerMain.getInstance()

console.log(dbg.isEnabled())

export default dbg


text:
package annotate

// [START video_object_tracking_gcs]

import (
	"context"
	"fmt"
	"io"

	video "cloud.google.com/go/videointelligence/apiv1"
	videopb "cloud.google.com/go/videointelligence/apiv1/videointelligencepb"
	"github.com/golang/protobuf/ptypes"
)

// objectTrackingGCS analyzes a video and extracts entities with their bounding boxes.
func objectTrackingGCS(w io.Writer, gcsURI string) error {
	// gcsURI := "gs://cloud-samples-data/video/cat.mp4"

	ctx := context.Background()

	// Creates a client.
	client, err := video.NewClient(ctx)
	if err != nil {
		return fmt.Errorf("video.NewClient: %v", err)
	}
	defer client.Close()

	op, err := client.AnnotateVideo(ctx, &videopb.AnnotateVideoRequest{
		InputUri: gcsURI,
		Features: []videopb.Feature{
			videopb.Feature_OBJECT_TRACKING,
		},
	})
	if err != nil {
		return fmt.Errorf("AnnotateVideo: %v", err)
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		return fmt.Errorf("Wait: %v", err)
	}

	// Only one video was processed, so get the first result.
	result := resp.GetAnnotationResults()[0]

	for _, annotation := range result.ObjectAnnotations {
		fmt.Fprintf(w, "Description: %q\n", annotation.Entity.GetDescription())
		if len(annotation.Entity.EntityId) > 0 {
			fmt.Fprintf(w, "\tEntity ID: %q\n", annotation.Entity.GetEntityId())
		}

		segment := annotation.GetSegment()
		start, _ := ptypes.Duration(segment.GetStartTimeOffset())
		end, _ := ptypes.Duration(segment.GetEndTimeOffset())
		fmt.Fprintf(w, "\tSegment: %v to %v\n", start, end)

		fmt.Fprintf(w, "\tConfidence: %f\n", annotation.GetConfidence())

		// Here we print only the bounding box of the first frame in this segment.
		frame := annotation.GetFrames()[0]
		seconds := float32(frame.GetTimeOffset().GetSeconds())
		nanos := float32(frame.GetTimeOffset().GetNanos())
		fmt.Fprintf(w, "\tTime offset of the first frame: %fs\n", seconds+nanos/1e9)

		box := frame.GetNormalizedBoundingBox()
		fmt.Fprintf(w, "\tBounding box position:\n")
		fmt.Fprintf(w, "\t\tleft  : %f\n", box.GetLeft())
		fmt.Fprintf(w, "\t\ttop   : %f\n", box.GetTop())
		fmt.Fprintf(w, "\t\tright : %f\n", box.GetRight())
		fmt.Fprintf(w, "\t\tbottom: %f\n", box.GetBottom())
	}

	return nil
}

// [END video_object_tracking_gcs]