text:
package org.neo4j.hintplugin.utils;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Node;
import org.neo4j.helpers.collection.IteratorUtil;

import java.lang.Math;

@Path("/predgraph")
public class Predgraph {

    private final GraphDatabaseService database;
    private Node node;
    private double numberOfWords;
    /**
     * The Public constructor.
     */
    public Predgraph(@Context GraphDatabaseService database) {
        this.database = database;
    }
    /**
     * The RESTful Method to be called to retrieve Similarity Between two nodes.
     * @param node: the target node.
     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{node}")
    public Response predgraph(@PathParam("node") long node) {
        Gson       gson = new GsonBuilder().create();
        JsonObject obj  = new JsonObject();
        try{
            obj.addProperty("predgraph",    this.getPredgraph(node));
            obj.addProperty("nodeId",       node);
            obj.addProperty("numberOfWords",this.numberOfWords);
        } catch (Exception ex) {
            System.err.println("utils.PredGraph Class: " + ex);
        }
        return Response.ok(gson.toJson(obj), MediaType.APPLICATION_JSON).build();
    }
    /**
     * Calculates Similarity Between Two Nodes, Based on Jaccard Index.
     * @param node_a:       the start node to calculate similarity.
     * @param node_b:       the end node to calculate similarity.
     * @param threshold:    the threshold that must be equal or up to create a relationship.
     */
    private double getPredgraph(long node){
        this.numberOfWords  = 0.0;
        double predgraph    = 0.0;
        double degree       = 0.0;
        Transaction tx = database.beginTx();
        try {
            this.node = database.getNodeById(node);
            for (Relationship r: this.node.getRelationships()){
                if(r.hasProperty("weight")){
                    predgraph = new Double(r.getProperty("weight").toString()) + predgraph;
                    degree++;
                }
            }
            this.numberOfWords = degree;
            this.node.setProperty("predgraph",predgraph);
            tx.success();
        } catch (Exception e) {
            System.out.println("Fail, This happened: " + e);
        } finally {
            tx.close();
        }
        return predgraph;
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 */
package gluemodel.COSEM.COSEMObjects.impl;

import gluemodel.COSEM.COSEMObjects.COSEMObjectsPackage;
import gluemodel.COSEM.COSEMObjects.PushSetupObject;

import gluemodel.COSEM.InterfaceClasses.impl.PushsetupImpl;

import org.eclipse.emf.ecore.EClass;

/**
 *
 * An implementation of the model object 'Push Setup Object'.
 *
 *
 * @generated
 */
public class PushSetupObjectImpl extends PushsetupImpl implements PushSetupObject {
	/**
	 *
	 *
	 * @generated
	 */
	protected PushSetupObjectImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return COSEMObjectsPackage.eINSTANCE.getPushSetupObject();
	}

} //PushSetupObjectImpl


text:
<?php

namespace Illuminate\Mail\Transport;

use Swift_Mime_SimpleMessage;
use GuzzleHttp\ClientInterface;

class MailgunTransport extends Transport
{
    /**
     * Guzzle client instance.
     *
     * @var \GuzzleHttp\ClientInterface
     */
    protected $client;

    /**
     * The Mailgun API key.
     *
     * @var string
     */
    protected $key;

    /**
     * The Mailgun domain.
     *
     * @var string
     */
    protected $domain;

    /**
     * THe Mailgun API end-point.
     *
     * @var string
     */
    protected $url;

    /**
     * Create a new Mailgun transport instance.
     *
     * @param  \GuzzleHttp\ClientInterface  $client
     * @param  string  $key
     * @param  string  $domain
     * @return void
     */
    public function __construct(ClientInterface $client, $key, $domain)
    {
        $this->key = $key;
        $this->client = $client;
        $this->setDomain($domain);
    }

    /**
     * {@inheritdoc}
     */
    public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
    {
        $this->beforeSendPerformed($message);

        $to = $this->getTo($message);

        $message->setBcc([]);

        $this->client->post($this->url, $this->payload($message, $to));

        $this->sendPerformed($message);

        return $this->numberOfRecipients($message);
    }

    /**
     * Get the HTTP payload for sending the Mailgun message.
     *
     * @param  \Swift_Mime_SimpleMessage  $message
     * @param  string  $to
     * @return array
     */
    protected function payload(Swift_Mime_SimpleMessage $message, $to)
    {
        return [
            'auth' => [
                'api',
                $this->key,
            ],
            'multipart' => [
                [
                    'name' => 'to',
                    'contents' => $to,
                ],
                [
                    'name' => 'message',
                    'contents' => $message->toString(),
                    'filename' => 'message.mime',
                ],
            ],
        ];
    }

    /**
     * Get the "to" payload field for the API request.
     *
     * @param  \Swift_Mime_SimpleMessage  $message
     * @return string
     */
    protected function getTo(Swift_Mime_SimpleMessage $message)
    {
        return collect($this->allContacts($message))->map(function ($display, $address) {
            return $display ? $display." <{$address}>" : $address;
        })->values()->implode(',');
    }

    /**
     * Get all of the contacts for the message.
     *
     * @param  \Swift_Mime_SimpleMessage  $message
     * @return array
     */
    protected function allContacts(Swift_Mime_SimpleMessage $message)
    {
        return array_merge(
            (array) $message->getTo(), (array) $message->getCc(), (array) $message->getBcc()
        );
    }

    /**
     * Get the API key being used by the transport.
     *
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Set the API key being used by the transport.
     *
     * @param  string  $key
     * @return string
     */
    public function setKey($key)
    {
        return $this->key = $key;
    }

    /**
     * Get the domain being used by the transport.
     *
     * @return string
     */
    public function getDomain()
    {
        return $this->domain;
    }

    /**
     * Set the domain being used by the transport.
     *
     * @param  string  $domain
     * @return void
     */
    public function setDomain($domain)
    {
        $this->url = 'https://api.mailgun.net/v3/'.$domain.'/messages.mime';

        return $this->domain = $domain;
    }
}


text:
import {html, LitElement} from 'lit';
import {property} from 'lit/decorators.js';

import {Dimensions, GoldenConfig, ImageComparisonAnalysis, ScenarioRecord, toDecibel} from '../common.js';

const DEFAULT_DIMENSIONS: Dimensions = {
  width: 0,
  height: 0
};

export class RenderingScenario extends LitElement {
  @property({type: String}) name: string = '';

  @property({type: Object}) goldens: Array<GoldenConfig> = [];

  @property({type: Object}) dimensions: Dimensions = DEFAULT_DIMENSIONS;

  @property({type: Array}) exclude: Array<string> = [];

  @property({type: Object}) analysis: ScenarioRecord|null = null;

  get basePath() {
    if (!this.name) {
      return '';
    }

    return `./results/${this.name}`;
  }

  updated(changedProperties: Map<any, any>) {
    super.updated(changedProperties);

    if (this.analysis == null) {
      this.loadAnalysis();
    }
  }

  private async loadAnalysis() {
    const analysisPath = `${this.basePath}/analysis.json`;
    this.analysis = await (await fetch(analysisPath)).json();
  }

  private metricTemplate(
      analysisResults: ImageComparisonAnalysis, goldenName: string) {
    const rmsInDecibel = toDecibel(analysisResults.rmsDistanceRatio).toFixed(2);
    return html` ${rmsInDecibel} dB

          Root mean square(RMS) color distance between ${goldenName}'s golden
          and model-viewer's on rendering ${this.name} in decibels.
          The decibel is given by: 10 * log(RMS). More negative means a closer match.

`
  }

  render() {
    const {basePath} = this;
    const {width} = this.dimensions;

    const images =
        this.goldens.filter(golden => !this.exclude.includes(golden.name))
            .map(
                (golden, index) => html`

${golden.description}

                    ${
                    index == 0 || this.analysis == null ?
                        html`<span>---</span>` :
                        this.metricTemplate(
                            this.analysis.analysisResults[index - 1],
                            golden.name)}

`);

    return html`

${this.name}

  ${images}

`;
  }
}

customElements.define('rendering-scenario', RenderingScenario);


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.4.4.22-9-c-i-29
description: >
    Array.prototype.reduceRight applied to Function object which
    implements its own property get method
---*/

        var testResult = false;
        var initialValue = 0;
        function callbackfn(prevVal, curVal, idx, obj) {
            if (idx === 1) {
                testResult = (curVal === 1);
            }
        }

        var obj = function (a, b, c) {
            return a + b + c;
        };
        obj[0] = 0;
        obj[1] = 1;
        obj[2] = 2;
        obj[3] = 3;

        Array.prototype.reduceRight.call(obj, callbackfn, initialValue);

assert(testResult, 'testResult !== true');


text:
```yaml
size: 557mb
compileTime: 3 mins
```

### usage

```bash
$ git clone https://gist.github.com/25c28b652135258ac31d.git mayabase && cd mayabase
$ docker build -t mottosso/mayabase .
```


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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.bigobject</groupId>
    <artifactId>spark-bo-1.5</artifactId>
    <version>0.1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <groupId>com.bigobject</groupId>
  <artifactId>spark-bo-examples</artifactId>
  <version>0.2</version>
  <name>${project.artifactId}</name>
  <description>Spark BO Examples</description>
  <packaging>jar</packaging>
  <url>http://www.bigobject.io/</url>

  <dependencies>
    <dependency>
      <groupId>com.bigobject</groupId>
      <artifactId>spark-bo</artifactId>
	  <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>../../examples/src/main/scala</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.0</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <args>
                <arg>-make:transitive</arg>
                <arg>-dependencyfile</arg>
                <arg>${project.build.directory}/.scala_dependencies</arg>
              </args>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <useFile>false</useFile>
          <disableXmlReport>true</disableXmlReport>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
package com.ajoshow.mock.repository.entity;

import com.ajoshow.mock.domain.Link;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * Created by andychu on 2017/4/22.
 */
@Entity
@Table(name = "ad_content",
        uniqueConstraints = {
                @UniqueConstraint(name = "unique_title", columnNames="title"),
        }
)
public class AdContent implements Serializable {

    private Integer id;
    private String title;
    private Set<String> impressionEvent;
    private Set<String> viewEvent;
    private List<Asset> assets;
    private Link link;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="AD_CONTENT_ID", nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @NotNull
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @ElementCollection(fetch = FetchType.EAGER)
    @CollectionTable(
            name = "ad_content_impression_url",
            joinColumns = {
                    @JoinColumn(name = "AD_CONTENT_ID", referencedColumnName = "AD_CONTENT_ID", nullable = false)
            },
            foreignKey = @ForeignKey(name = "fk_impression_url")
    )
    @Column(name="impression_url", length = 1000, nullable = false)
    public Set<String> getImpressionEvent() {
        return impressionEvent;
    }

    public void setImpressionEvent(Set<String> impressionEvent) {
        this.impressionEvent = impressionEvent;
    }

    @ElementCollection(fetch = FetchType.EAGER)
    @CollectionTable(
            name = "ad_content_view_url",
            joinColumns = {
                    @JoinColumn(name = "AD_CONTENT_ID", referencedColumnName = "AD_CONTENT_ID", nullable = false)
            },
            foreignKey = @ForeignKey(name = "fk_view_url")
    )
    @Column(name="view_url", length = 1000, nullable = false)
    public Set<String> getViewEvent() {
        return viewEvent;
    }

    public void setViewEvent(Set<String> viewEvent) {
        this.viewEvent = viewEvent;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
    @JoinColumn(name = "AD_CONTENT_ID", referencedColumnName = "AD_CONTENT_ID")
    public List<Asset> getAssets() {
        return assets;
    }

    public void setAssets(List<Asset> assets) {
        this.assets = assets;
    }

    @Embedded
    public Link getLink() {
        return link;
    }

    public void setLink(Link link) {
        this.link = link;
    }
}


text:
package org.apache.geronimo.jee.naming;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for resource-env-refType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="resource-env-refType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="ref-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <choice>
 *           <element name="pattern" type="{http://geronimo.apache.org/xml/ns/naming-1.2}patternType"/>
 *           <element name="message-destination-link" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *           <sequence>
 *             <element name="admin-object-module" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *             <element name="admin-object-link" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *           </sequence>
 *         </choice>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 * @version $Rev$ $Date$
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "resource-env-refType", propOrder = {
    "refName",
    "pattern",
    "messageDestinationLink",
    "adminObjectModule",
    "adminObjectLink"
})
public class ResourceEnvRef implements Serializable
{

    private final static long serialVersionUID = 12343L;
    @XmlElement(name = "ref-name", required = true)
    protected String refName;
    protected Pattern pattern;
    @XmlElement(name = "message-destination-link")
    protected String messageDestinationLink;
    @XmlElement(name = "admin-object-module")
    protected String adminObjectModule;
    @XmlElement(name = "admin-object-link")
    protected String adminObjectLink;

    /**
     * Gets the value of the refName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRefName() {
        return refName;
    }

    /**
     * Sets the value of the refName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRefName(String value) {
        this.refName = value;
    }

    /**
     * Gets the value of the pattern property.
     *
     * @return
     *     possible object is
     *     {@link Pattern }
     *
     */
    public Pattern getPattern() {
        return pattern;
    }

    /**
     * Sets the value of the pattern property.
     *
     * @param value
     *     allowed object is
     *     {@link Pattern }
     *
     */
    public void setPattern(Pattern value) {
        this.pattern = value;
    }

    /**
     * Gets the value of the messageDestinationLink property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getMessageDestinationLink() {
        return messageDestinationLink;
    }

    /**
     * Sets the value of the messageDestinationLink property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setMessageDestinationLink(String value) {
        this.messageDestinationLink = value;
    }

    /**
     * Gets the value of the adminObjectModule property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAdminObjectModule() {
        return adminObjectModule;
    }

    /**
     * Sets the value of the adminObjectModule property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAdminObjectModule(String value) {
        this.adminObjectModule = value;
    }

    /**
     * Gets the value of the adminObjectLink property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAdminObjectLink() {
        return adminObjectLink;
    }

    /**
     * Sets the value of the adminObjectLink property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAdminObjectLink(String value) {
        this.adminObjectLink = value;
    }

}


text:
<form name="work_edit" class="work_edit" novalidate>

    <input-field>
      <textarea ng-model="work.content" class="materialize-textarea brown-text text-darken-2" required autofocus>
        {{work.content}}
      </textarea>
      Portfolio Content...
    </input-field>

    <input-field>
      <input type="text" ng-model="prof.tags" value="{{work.tags}}" class="brown-text text-darken-2" required/>
      Keywords...
    </input-field>

</form>


text:
class QtLogo;
class QTimer;

typedef void(*MOUSEEVENT_FUNCPTR)(QMouseEvent *event);
typedef void(*RESIZE_FUNCPTR)(QResizeEvent* event);
typedef void(*ACCEL_FUNCPTR)(QKeyEvent *event);

class GLView : public QGLWidget
{
    Q_OBJECT

public:
    explicit GLView(QWidget *parent = 0, const int width = 800, const int height = 600);
    virtual ~GLView();

    void setMouseMoveFunc( MOUSEEVENT_FUNCPTR func);
    void setMousePressFunc( MOUSEEVENT_FUNCPTR func);
    void setMouseReleaseFunc( MOUSEEVENT_FUNCPTR func);
    void setResizeFunc( RESIZE_FUNCPTR func);
    void setKeyEventFunc( ACCEL_FUNCPTR func);

protected:
    void initializeGL();
    void paintGL();
    void resizeGL(int width, int height);

    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
    void resizeEvent(QResizeEvent *event);

private:
    MOUSEEVENT_FUNCPTR mouseMoveFunc;
    MOUSEEVENT_FUNCPTR mousePressFunc;
    MOUSEEVENT_FUNCPTR mouseReleaseFunc;
    RESIZE_FUNCPTR frameResizeFunc;

    ACCEL_FUNCPTR keyEventFunc;

//! [1]
public slots:
    void setXRotation(int angle);
    void setYRotation(int angle);
    void setZRotation(int angle);

signals:
    void xRotationChanged(int angle);
    void yRotationChanged(int angle);
    void zRotationChanged(int angle);
//! [1]

private:
    QtLogo *logo;
    int xRot;
    int yRot;
    int zRot;
    QPoint lastPos;
    QColor qtGreen;
    QColor qtPurple;
};

#endif // _GL_WIDGET_H_


text:
Abstraction for grid query.

This package is moved to a new repository. Please use [ajcastro/searchable](https://github.com/ajcastro/searchable).


text:
package org.apache.jackrabbit.oak.plugins.index.p2;

import static org.apache.jackrabbit.oak.plugins.index.p2.Property2Index.TYPE;

import java.util.List;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.jackrabbit.oak.plugins.index.IndexHook;
import org.apache.jackrabbit.oak.plugins.index.IndexHookProvider;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;

import com.google.common.collect.ImmutableList;

/**
 * Service that provides PropertyIndex based IndexHooks.
 *
 * @see Property2IndexDiff
 * @see IndexHookProvider
 *
 */
@Component
@Service(IndexHookProvider.class)
public class Property2IndexHookProvider implements IndexHookProvider {

    @Override
    public List<? extends IndexHook> getIndexHooks(String type,
            NodeBuilder builder) {
        if (TYPE.equals(type)) {
            return ImmutableList.of(new Property2IndexDiff(builder));
        }
        return ImmutableList.of();
    }

}


text:
namespace crashpad {

//! \brief Implements a PtraceConnection over a socket.
//!
//! This class is the server half of the connection. The broker should be run
//! in a process with `ptrace` capabilities for the target process and may run
//! in a compromised context.
class PtraceBroker {
 public:
#pragma pack(push, 1)
  //! \brief A request sent to a PtraceBroker from a PtraceClient.
  struct Request {
    static constexpr uint16_t kVersion = 1;

    //! \brief The version number for this Request.
    uint16_t version = kVersion;

    //! \brief The type of request to serve.
    enum Type : uint16_t {
      //! \brief `ptrace`-attach the specified thread ID. Responds with
      //!     kBoolTrue on success, otherwise kBoolFalse, followed by an Errno.
      kTypeAttach,

      //! \brief Responds with kBoolTrue if the target process is 64-bit.
      //!     Otherwise, kBoolFalse.
      kTypeIs64Bit,

      //! \brief Responds with a GetThreadInfoResponse containing a ThreadInfo
      //!     for the specified thread ID. If an error occurs,
      //!     GetThreadInfoResponse::success is set to kBoolFalse and is
      //!     followed by an Errno.
      kTypeGetThreadInfo,

      //! \brief Reads memory from the attached process. The data is returned in
      //!     a series of messages. Each message begins with an int32_t
      //!     indicating the number of bytes read, 0 for end-of-file, or -1 for
      //!     errors, followed by a ReadError. On success the bytes read follow.
      kTypeReadMemory,

      //! \brief Read a file's contents. The data is returned in a series of
      //!     messages. The first message is an OpenResult, indicating the
      //!     validity of the received file path. If the OpenResult is
      //!     kOpenResultSuccess, each subsequent message begins with an int32_t
      //!     indicating the number of bytes read, 0 for end-of-file, or -1 for
      //!     errors, followed by an Errno. On success, the bytes read follow.
      kTypeReadFile,

      //! \brief Reads the contents of a directory. The data is returned in a
      //!     series of messages. The first message is an OpenResult, indicating
      //!     the validity of the received file path. If the OpenResult is
      //!     kOpenResultSuccess, the subsequent messages return the contents of
      //!     the directory as a dirent stream, as read by `getdents64()`. Each
      //!     subsequent message begins with an int32_t indicating the number of
      //!     bytes read, 0 for end-of-file, or -1 for errors, followed by an
      //!     Errno. On success, the bytes read follow.
      kTypeListDirectory,

      //! \brief Causes the broker to return from Run(), detaching all attached
      //!     threads. Does not respond.
      kTypeExit
    } type;

    //! \brief The thread ID associated with this request. Valid for kTypeAttach,
    //!     kTypeGetThreadInfo, and kTypeReadMemory.
    pid_t tid;

    union {
      //! \brief Specifies the memory region to read for a kTypeReadMemory
      //! request.
      struct {
        //! \brief The base address of the memory region.
        VMAddress base;

        //! \brief The size of the memory region.
        VMSize size;
      } iov;

      //! \brief Specifies the file path to read for a kTypeReadFile request.
      struct {
        //! \brief The number of bytes in #path. The path should not include a
        //!     `NUL`-terminator.
        VMSize path_length;

        //! \brief The file path to read.
        char path[];
      } path;
    };
  };

  //! \brief A result used in operations that accept paths.
  //!
  //! Positive values of this enum are reserved for sending errno values.
  enum OpenResult : int32_t {
    //! \brief Access to the path is denied.
    kOpenResultAccessDenied = -2,

    //! \brief The path name is too long.
    kOpenResultTooLong = -1,

    //! \brief The file was successfully opened.
    kOpenResultSuccess = 0,
  };

  //! \brief A result used in operations that read from memory or files.
  //!
  //! Positive values of this enum are reserved for sending errno values.
  enum ReadError : int32_t {
    //! \brief Access to this data is denied.
    kReadErrorAccessDenied = -1,
  };

  //! \brief The response sent for a Request with type kTypeGetThreadInfo.
  struct GetThreadInfoResponse {
    //! \brief Information about the specified thread. Only valid if #success
    //!     is kBoolTrue.
    ThreadInfo info;

    //! \brief Specifies the success or failure of this call.
    ExceptionHandlerProtocol::Bool success;
  };
#pragma pack(pop)

  //! \brief Constructs this object.
  //!
  //! \param[in] sock A socket on which to read requests from a connected
  //!     PtraceClient. Does not take ownership of the socket.
  //! \param[in] pid The process ID of the process the broker is expected to
  //!     trace. Setting this value exends the default file root to
  //!     "/proc/[pid]/" and enables memory reading via /proc/[pid]/mem. The
  //!     broker will deny any requests to read memory from processes whose
  //!     processID is not \a pid. If pid is -1, the broker will serve requests
  //!     to read memory from any process it is able to via `ptrace PEEKDATA`.
  //! \param[in] is_64_bit Whether this broker should be configured to trace a
  //!     64-bit process.
  PtraceBroker(int sock, pid_t pid, bool is_64_bit);

  PtraceBroker(const PtraceBroker&) = delete;
  PtraceBroker& operator=(const PtraceBroker&) = delete;

  ~PtraceBroker();

  //! \brief Restricts the broker to serving the contents of files under \a
  //!     root.
  //!
  //! If this method is not called, the broker defaults to only serving files
  //! under "/proc/" or "/proc/[pid]/" if a pid was set.
  //!
  //! Calling this function disables reading from a memory file if one has not
  //! already been opened.
  //!
  //! \param[in] root A NUL-terminated c-string containing the path to the new
  //!     root. \a root must not be `nullptr`, must end in a '/', and the caller
  //!     should ensure that \a root remains valid for the lifetime of the
  //!     broker.
  void SetFileRoot(const char* root);

  //! \brief Begin serving requests on the configured socket.
  //!
  //! This method returns when a PtraceBrokerRequest with type kTypeExit is
  //! received or an error is encountered on the socket.
  //!
  //! \return 0 if Run() exited due to an exit request. Otherwise an error code.
  int Run();

 private:
  class AttachmentsArray;

  int RunImpl(AttachmentsArray*);
  int SendError(ExceptionHandlerProtocol::Errno err);
  int SendReadError(ReadError err);
  int SendOpenResult(OpenResult result);
  int SendFileContents(FileHandle handle);
  int SendDirectory(FileHandle handle);
  void TryOpeningMemFile();
  int SendMemory(pid_t pid, VMAddress address, VMSize size);
  int ReceiveAndOpenFilePath(VMSize path_length,
                             bool is_directory,
                             ScopedFileHandle* handle);

  char file_root_buffer_[32];
  Ptracer ptracer_;
  const char* file_root_;
  ScopedFileHandle memory_file_;
  int sock_;
  pid_t memory_pid_;
  bool tried_opening_mem_file_;
};

}  // namespace crashpad

#endif  // CRASHPAD_UTIL_LINUX_PTRACE_BROKER_H_


text:
// This file is automatically generated.

package adila.db;

/*
 * Samsung Galaxy Tab 10.1
 *
 * DEVICE: GT-P7500M
 * MODEL: GT-P7500M
 */
final class gt2dp7500m_gt2dp7500m {
    public static final String DATA = "Samsung|Galaxy Tab 10.1|";
}


text:
class Role < ActiveRecord::Base
  ADMIN = 'admin'
  CURATOR = 'curator'
  ADMIN_ROLE = Role.find_or_create_by(name: ADMIN)
  CURATOR_ROLE = Role.find_or_create_by(name: CURATOR)
end


text:
function Set-GitHubRelease {
<#
    .SYNOPSIS
    Set information about a release

    .DESCRIPTION
    Set information about a release

    .PARAMETER Repository
    The name of the repository

    .PARAMETER Id
    The id of the release

    .PARAMETER Tag
    The name of the TagName

    .PARAMETER Target
    Specifies the commitish value that determines where the Git tag is created from.
    Can be any branch or commit SHA. Unused if the Git tag already exists.
    Default: the repository's default branch (usually master).

    .PARAMETER Name
    The name of the release

    .PARAMETER Body
    Text describing the contents of the tag

    .PARAMETER Draft
    Makes the release a draft

    .PARAMETER Prerelease
    Makes the release a Prerelease

    .INPUTS
    System.String
    System.S

    .OUTPUTS
    System.Management.Automation.PSObject

    .EXAMPLE
    Set-GitHubReleaseAsset -Repository MyRepository -Id xxxx -Name NewName

    .EXAMPLE
    Set-GitHubReleaseAsset -Repository MyRepository -Id xxxx -Label NewLabel

    .EXAMPLE
    Set-GitHubReleaseAsset -Repository MyRepository -Id xxxx -Name NewName -Label NewLabel

#>
[CmdletBinding(SupportsShouldProcess,ConfirmImpact="Low")][OutputType('System.Management.Automation.PSObject')]

    Param (

        [Parameter(Mandatory=$false, Position=0)]
        [ValidateNotNullOrEmpty()]
        [String]$Repository,

        [Parameter(Mandatory=$false, Position=1)]
        [ValidateNotNullOrEmpty()]
        [String]$Id,

        [Parameter(Mandatory=$false, Position=2)]
        [ValidateNotNullOrEmpty()]
        [String]$Tag,

        [Parameter(Mandatory=$false, Position=3)]
        [ValidateNotNullOrEmpty()]
        [String]$Target,

        [Parameter(Mandatory=$true, Position=4)]
        [ValidateNotNullOrEmpty()]
        [String]$Name,

        [Parameter(Mandatory=$false, Position=5)]
        [ValidateNotNullOrEmpty()]
        [String]$Body,

        [Parameter(Mandatory=$false, Position=6)]
        [ValidateNotNullOrEmpty()]
        [System.Management.Automation.SwitchParameter]$Draft,

        [Parameter(Mandatory=$false, Position=3)]
        [ValidateNotNullOrEmpty()]
        [System.Management.Automation.SwitchParameter]$Prerelease

    )

    try {

        # --- Grab the sessionstate variable & test throw if it is null
        $SessionInfo = Get-GitHubSessionInformation -Verbose:$VerbosePreference

        $Release = [PSCustomObject] @{
            name = $Name
        }

        if ($PSBoundParameters.ContainsKey("Tag")){

            $Release | Add-Member -MemberType NoteProperty -Name tag_name -Value $Tag

        }

        if ($PSBoundParameters.ContainsKey("Target")){

            $Release | Add-Member -MemberType NoteProperty -Name target_commitish -Value $Target

        }

        if ($PSBoundParameters.ContainsKey("Body")){

            $Release | Add-Member -MemberType NoteProperty -Name body -Value $Body

        }

        if ($PSBoundParameters.ContainsKey("Draft")){

            $Release | Add-Member -MemberType NoteProperty -Name draft -Value $true

        }

        if ($PSBoundParameters.ContainsKey("Prerelease")){

            $Release | Add-Member -MemberType NoteProperty -Name prerelease -Value $true

        }

        if ($PSCmdlet.ShouldProcess($Id)){

            $URI = "/repos/$($SessionInfo.Username)/$($Repository)/releases/$($Id)"
            Invoke-GitHubRestMethod -Method PATCH -URI $URI -Body ($Release | ConvertTo-Json) -Verbose:$VerbosePreference

        }

    }
    catch [Exception]{

        throw $_.Exception

    }

}


text:
import gulp from 'gulp';
import cssBase64 from 'gulp-css-base64';

// Fetch replace all the font urls with base64-encoded data URI strings.
gulp.task('default', () => {
  return gulp.src('../downloads/index.css')
          .pipe(cssBase64())
          .pipe(gulp.dest('../src'));
});


text:
require 'spec_helper'

describe WeatherForecasts::Client::SelectionAttributes do
  let(:attr) { :blah }

  subject { WeatherForecasts::Client::SelectionAttributes.new(attr) }

  describe "#valid?" do
    it "raises an error if an invalid selection attribute is used" do
      expect { subject.valid?(:wrong) }.to raise_error(WeatherForecasts::Client::InvalidSelectionAttributeError)
    end
  end
end


text:
package com.aaron.loving;

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

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LovingView view = new LovingView(this);
        setContentView(view);
    }
}


text:
<?php

namespace App\Modules\ContentManager\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Facades\Theme;
use App\Modules\ContentManager\Models\WidgetGroups;
use App\Modules\ContentManager\Models\Widget as ModelWidget;

class WidgetController extends Controller
{
    public function index(){
        $widgetGroups = WidgetGroups::where("theme_id",Theme::getID())->get();
        $default = $this->listDirWidget("defaultWidget");
        $theme = $this->listDirWidget(Theme::strActive());
    	return view("ContentManager::widget.index",[
                'default'=>$default,
                'theme'=>$theme,
                "widgetGroups"=>$widgetGroups
            ]);
    }

    public function store(Request $request){
        $tmp = $request->widget;
        unset($tmp['id']);
        $model = ModelWidget::find($request->widget['id']);
        $model->options = serialize($tmp);
        $model->save();
    }

    public function reorder(Request $request){
        $data = $request->datawidget;
        $countData = count($data);
        for ($i=1; $i < $countData ; $i++) {
            $id = $data[$i]["id"];
            $model = ModelWidget::find($id);
            $model->order = $i;
            $model->save();
        }
    }

    public function destroy($id){
        ModelWidget::destroy($id);
    }

    public function addWidget(Request $request){
        $this->validate($request, [
            'className' => 'required',
            'position' => 'required',
        ]);
        $tmp = $request->className;
        $widget = new $tmp();
        $widget->init(["baseID"=>str_random(10),'title'=>$widget->name]);
        $model = new ModelWidget();
        $model->group_id = $request->position;
        $model->class_name = $request->className;
        $model->options = serialize($widget->options);
        $model->order = 0;
        $model->save();
    }

    private function listDirWidget($pathWidget){
        $res = [];
        $path = app_path('Widgets/'.$pathWidget);
        if ($handle = opendir($path)) {
            while (false !== ($entry = readdir($handle))) {
                if ($entry != "." && $entry != "..") {
                    $tmp = 'App\\Widgets\\'.$pathWidget.'\\'.basename($entry, '.php');
                    $class = new $tmp();
                    $res[] = $class;
                }
            }
            closedir($handle);
        }
        return $res;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.example.android.camera.utils.AutoFitSurfaceView
        android:id="@+id/view_finder"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <View
        android:id="@+id/overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:foreground="@android:color/transparent" />

    <ImageButton
        android:id="@+id/capture_button"
        android:layout_width="96dp"
        android:layout_height="96dp"
        android:layout_marginRight="96dp"
        android:scaleType="fitCenter"
        android:background="@drawable/ic_shutter"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:contentDescription="@string/capture"
        tools:ignore="RtlHardcoded" />

</androidx.constraintlayout.widget.ConstraintLayout>


text:
import Ember from 'ember';

export default Ember.Route.extend({
  // since we have two models needed, let's retrieve one of them using beforeModel hook. Also we can retrieve needed info on most top route
  beforeModel: function() {
    var users = this.store.findAll('user');
    this.controllerFor('s.vendors.vendor.tasks.create').set('users', users);
  },

  model: function() {
    return this.store.find('vendor', this.controllerFor('s.vendors.vendor').get('vendor.id'));
  },

  actions: {

    willTransition: function() {
      this.controllerFor('s.vendors.vendor.tasks.create').set('name', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('selectedUser', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('description', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('selectedEmployee', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('dueDate', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('user', null);
      this.controllerFor('s.vendors.vendor.tasks.create').set('employee', null);
    }

  }

});


text:
package twzip.context;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.safari.SafariOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;
import org.openqa.selenium.firefox.FirefoxProfile;

/**
 *
 * @author Kent Yeh
 */
public class WebDriverFactory {

    public static enum Brwoser {

        FIREFOX,
        CHROME,
        SAFARI,
        EDGE,
        HTMLUNIT,
    }

    public static WebDriver getInstance() {
        return getInstance(Brwoser.HTMLUNIT);
    }

    public static WebDriver getInstance(Brwoser browser, long implicitlyWaitSecs) {
        WebDriver driver = getInstance(browser);
        driver.manage().timeouts().implicitlyWait(implicitlyWaitSecs, TimeUnit.SECONDS);
        return driver;
    }

    public static WebDriver getInstance(Brwoser browser) {
        switch (browser) {
            case FIREFOX:
                FirefoxProfile firefoxProfile = new FirefoxProfile();
                firefoxProfile.setPreference("media.navigator.streams.fake", true);
                FirefoxOptions ffOptions = new FirefoxOptions();
                ffOptions.setProfile(firefoxProfile);
                ffOptions.setAcceptInsecureCerts(true);
                ffOptions.setBinary("/usr/bin/firefox");
                return new FirefoxDriver(ffOptions);
            case CHROME:
                ChromeOptions cOptions = new ChromeOptions();
                cOptions.setAcceptInsecureCerts(true);
                cOptions.setBinary("/usr/bin/google-chrome");
                cOptions.addArguments("use-fake-ui-for-media-stream");
                cOptions.addArguments("use-fake-device-for-media-stream");
                return new ChromeDriver(cOptions);
            case SAFARI:
                DesiredCapabilities cs = DesiredCapabilities.safari();
                cs.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
                SafariOptions sOptions = new SafariOptions(cs);
                sOptions.setCapability("autoclose", true);
                sOptions.setCapability("headless", true);
                sOptions.setUseTechnologyPreview(true);
                return new SafariDriver(sOptions);
            case EDGE:
                EdgeOptions eOptions = new EdgeOptions();
                eOptions.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
                eOptions.setCapability("autoclose", true);
                eOptions.setCapability("headless", true);
                eOptions.setCapability("avoidProxy", true);
                return new EdgeDriver(eOptions);
            default:
                DesiredCapabilities ch = DesiredCapabilities.htmlUnit();
                ch.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
                return new HtmlUnitDriver(ch);
        }
    }
}


text:
var EventEmitter = require('events').EventEmitter;

/**
 * Wechat site is an api stub which developers can call
 * @constructor
 */
var WechatSiteApi = function(site){
    //this.emitter = new EventEmitter();
    this.site = site;
};

WechatSiteApi.prototype.createTmpQRCode = function(sceneId, expire, callback){
    var result = {
        "ticket":"gQG28DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL0FuWC1DNmZuVEhvMVp4NDNMRnNRAAIEesLvUQMECAcAAA==",
        "expire_seconds":expire
    };
    this.site.tempSceneIds[sceneId] = Math.floor(new Date().getTime()/1000) + expire;

    if(callback) callback(null, result);
};

WechatSiteApi.prototype.createLimitQRCode = function(sceneId, callback){
    var result = {
        "ticket":"gQG28DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL0FuWC1DNmZuVEhvMVp4NDNMRnNRAAIEesLvUQMECAcAAA=="
    };
    this.site.sceneIds[sceneId] = true;

    if(callback) callback(null, result);
};

WechatSiteApi.prototype.showQRCodeURL = function(ticket){
    return ''; //TODO
};

module.exports = WechatSiteApi;


text:
// Copyright 2018 the Service Broker Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
Package toggles defines a standard way to define, list, and use feature
toggles in the service broker.

It mimics Go's `flags` package, but uses Viper as a backing store to abstract
out how a particular flag is set.

*/
package toggles

import (
	"sort"

	"github.com/GoogleCloudPlatform/gcp-service-broker/utils"
	"github.com/spf13/viper"
)

// Features is the default set of flags for enabling different features.
// For legacy compatibility reasons the flags are put under the "compatibility"
// namespace.
var Features = NewToggleSet("compatibility.")

// Toggle represents a single feature that the user can enable or disable.
type Toggle struct {
	Name           string
	Default        bool
	Description    string
	propertyPrefix string
}

// EnvironmentVariable gets the environment variable used to control the toggle.
func (toggle Toggle) EnvironmentVariable() string {
	return utils.PropertyToEnv(toggle.viperProperty())
}

// viperProperty gets the viper property of the variable to control the toggle.
func (toggle Toggle) viperProperty() string {
	return toggle.propertyPrefix + toggle.Name
}

// IsActive returns true if the toggle is enabled and false if it isn't.
func (toggle Toggle) IsActive() bool {
	return viper.GetBool(toggle.viperProperty())
}

// A ToggleSet represents a set of defined toggles. The zero value of a ToggleSet
// has no property prefix.
type ToggleSet struct {
	toggles        []Toggle
	propertyPrefix string
}

// Toggles returns a list of all registered toggles sorted lexicographically by
// their property name.
func (set *ToggleSet) Toggles() []Toggle {
	var copy []Toggle

	for _, tgl := range set.toggles {
		copy = append(copy, tgl)
	}

	sort.Slice(copy, func(i, j int) bool { return copy[i].Name < copy[j].Name })
	return copy
}

// Toggle creates a new toggle with the given name, default value, label and description.
// It also adds the toggle to an internal registry and initializes the default value in viper.
func (set *ToggleSet) Toggle(name string, value bool, description string) Toggle {
	toggle := Toggle{
		Name:           name,
		Default:        value,
		Description:    description,
		propertyPrefix: set.propertyPrefix,
	}

	set.toggles = append(set.toggles, toggle)
	viper.SetDefault(toggle.viperProperty(), value)

	return toggle
}

// NewFlagSet returns a new, empty toggle set with the specified property prefix.
// The property prefix will be prepended to any toggles exactly as-is. You MUST
// specify a trailing period if you want your properties to be namespaced.
func NewToggleSet(propertyPrefix string) *ToggleSet {
	return &ToggleSet{
		propertyPrefix: propertyPrefix,
	}
}


text:
package main

import (
	"context"
	"encoding/json"
	"net/http"
	"net/http/httptest"
	"testing"

	log "github.com/sirupsen/logrus"

	"github.com/stretchr/testify/suite"
)

// EntityGetAllTestSuite defines the suite, and absorbs the built-in basic suite
// functionality from testify - including a T() method which
// returns the current testing context
type EntityGetAllTestSuite struct {
	suite.Suite
}

// Make sure that VariableThatShouldStartAtFive is set to five
// before each test
func (suite *EntityGetAllTestSuite) SetupSuite() {
	manager := GetQPManager()
	log.Info(" -- EntityGetAll Test Suite --\n")
	log.Debug("EntityGetAllTestSuite.SetupSuite() - setting active parsers to format1, format2, format3")
	manager.SetActiveParsers("format1", "format2", "format3")
}

// In order for 'go test' to run this suite, we need to create
// a normal test function and pass our suite to suite.Run
func TestEntityGetAllTestSuite(t *testing.T) {
	log.Debug("EntityGetALlTestSuite - Running test suite")
	suite.Run(t, new(EntityGetAllTestSuite))
	log.Debug("EntityGetAllTestSuite - Finished test suite")
}

func (suite *EntityGetAllTestSuite) TestFindAllSimple() {
	req := getRequest("/Project")
	w := httptest.NewRecorder()

	//{"results":{"entities":[{"type":"Project","id":63},{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}
	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"type":"Project","id":63},{"type":"Project","id":65}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":63},{"type":"Project","id":65}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)
}

func (suite *EntityGetAllTestSuite) TestFindAllWithFields() {
	req := getRequest("/Project?fields=name,sg_status")
	w := httptest.NewRecorder()

	//{"results":{"entities":[{"type":"Project","id":63},{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}
	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"id":63,"name":"Template Project","sg_status":null,"type":"Project"},{"id":65,"name":"Big Buck Bunny","sg_status":"Active","type":"Project"}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type   string `json:"type"`
		Id     int    `json:"id"`
		Name   string `json:"name"`
		Status string `json:"sg_status"`
	}

	expected := `[{"id":63,"name":"Template Project","sg_status":null,"type":"Project"},{"id":65,"name":"Big Buck Bunny","sg_status":"Active","type":"Project"}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)
}

func (suite *EntityGetAllTestSuite) TestFindAllPagingLimit1() {
	req := getRequest("/Project?limit=1&page=2")
	w := httptest.NewRecorder()

	//{"results":{"entities":[{"type":"Project","id":63},{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}
	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"id":63,"name":"Template Project","sg_status":null,"type":"Project"},{"id":65,"name":"Big Buck Bunny","sg_status":"Active","type":"Project"}],"paging_info":{"current_page":1,"page_count":1,"entity_count":4,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":63}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

}

func (suite *EntityGetAllTestSuite) TestFindAllBadPageValue() {
	req := getRequest("/Project?limit=1&page=foo")
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"exception":true,"message":"API read() invalid/missing integer 'paging' 'entities_per_page':\n{\"current_page\"=>\"foo\", \"entities_per_page\"=>1}","error_code":103}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusBadRequest, w.Code)

}

func (suite *EntityGetAllTestSuite) TestFindAllBadLimitValue() {
	req := getRequest("/Project?limit=foo&page=1")
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"exception":true,"message":"API read() invalid/missing integer 'paging' 'entities_per_page':\n{\"current_page\"=>2, \"entities_per_page\"=>\"foo\"}","error_code":103}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusBadRequest, w.Code)
}

// Coming soon
func (suite *EntityGetAllTestSuite) TestFindAllNoResults() {
	req := getRequest(`/Project?q=[["name", "is", "foo"]]`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[],"paging_info":{"current_page":0,"page_count":0,"entity_count":0,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusNoContent, w.Code)
}

func (suite *EntityGetAllTestSuite) TestFindAllMapQuery() {
	req := getRequest(`/Project?q={"logical_operator": "and", "conditions": [["name", "starts_with", "Big"]]}`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"id":65, "type":"Project"}],"paging_info":{"current_page":1,"page_count":1,"entity_count":1,"entities_per_page":1}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":65}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)

}

func (suite *EntityGetAllTestSuite) TestFindAllArrayQuery() {
	req := getRequest(`/Project?q=[["name", "starts_with", "Big"]]`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"id":65, "type":"Project"}],"paging_info":{"current_page":1,"page_count":1,"entity_count":1,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":65}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)

}

func (suite *EntityGetAllTestSuite) TestFindAllAndStringQuery() {
	req := getRequest(`/Project?q=and(["name", "starts_with", "Big"])`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"id":65, "type":"Project"}],"paging_info":{"current_page":1,"page_count":1,"entity_count":1,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":65}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)

}

func (suite *EntityGetAllTestSuite) TestFindAllOrStringQuery() {
	req := getRequest(`/Project?q=or(["name", "starts_with", "Big"],["name", "starts_with", "Test"])`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}],"paging_info":{"current_page":1,"page_count":1,"entity_count":3,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusOK, w.Code)

	type Entity struct {
		Type string `json:"type"`
		Id   int    `json:"id"`
	}

	expected := `[{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}]`
	var jsonExpected []Entity
	err := json.Unmarshal([]byte(expected), &jsonExpected)
	suite.Nil(err)

	var jsonResp []Entity
	err = json.Unmarshal(w.Body.Bytes(), &jsonResp)
	suite.Nil(err)

	suite.Equal(jsonExpected, jsonResp)

}

func (suite *EntityGetAllTestSuite) TestFindAllBadQuery() {
	req := getRequest(`/Project?q=and(["name", "starts_with", "Test"],)`)
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200,
		`{"results":{"entities":[{"type":"Project","id":65},{"type":"Project","id":66},{"type":"Project","id":71}],"paging_info":{"current_page":1,"page_count":1,"entity_count":3,"entities_per_page":500}}}`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))

	suite.Equal(http.StatusBadRequest, w.Code)

}

func (suite *EntityGetAllTestSuite) TestFindAllBadAuth() {
	req, _ := http.NewRequest("GET", `/Project`, nil)
	w := httptest.NewRecorder()

	server, _, config := mockShotgun(200,
		`{"exception":true,"message":"Can't authenticate script 'TestScript'","error_code":102}`)
	defer server.Close()

	router(config).ServeHTTP(w, req)

	suite.Equal(http.StatusUnauthorized, w.Code)
}

func (suite *EntityGetAllTestSuite) TestFindAllBadResponseJson() {
	req := getRequest("/Project")
	w := httptest.NewRecorder()

	server, client, config := mockShotgun(200, `foo`)
	defer server.Close()

	ctx := req.Context()
	ctx = context.WithValue(ctx, "sgConn", *client)
	router(config).ServeHTTP(w, req.WithContext(ctx))
	suite.Equal(http.StatusBadGateway, w.Code)
}

func (suite *EntityGetAllTestSuite) TestFindAllAnException() {
	req := getRequest("/Project")
	w := httptest.NewRecorder()

	server, _, config := mockShotgun(200,
		`{"exception":true,"message":"Can't authenticate script 'TestScript'","error_code":102}`)
	defer server.Close()

	router(config).ServeHTTP(w, req)

	suite.Equal(http.StatusInternalServerError, w.Code)
}


text:
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {FormsModule} from '@angular/forms';
import {HttpModule, JsonpModule} from '@angular/http';

import {routing, appRoutingProviders} from './app.routing';

import {MessagesPanelComponent} from './common/components/messages.panel.component';
import {SigninComponent} from './auth/components/signin.component';
import {SignupComponent} from './auth/components/signup.component';
import {DashboardComponent} from './pages/dashboard/dashboard.component';
import {AgentComponent} from './admin/agent/components/agent.component';
import {AgentFormComponent} from './admin/agent/components/agent.form.component';
import {OperationComponent} from './admin/operation/components/operation.component';
import {OperationFormComponent} from './admin/operation/components/operation.form.component';
import {ResponseComponent} from './admin/response/components/response.component';
import {ResponseFormComponent} from './admin/response/components/response.form.component';
import {FilterComponent} from './admin/filter/components/filter.component';
import {FilterFormComponent} from './admin/filter/components/filter.form.component';
import {RequestConditionEditorComponent} from './admin/request_condition/components/request.condition.editor';
import {ResponseConditionEditorComponent} from './admin/response_condition/components/response.condition.editor';

import {FilterMessageTypePipe} from './common/pipes/filter.message.type.pipe';
import {TruncateStringPipe} from './common/pipes/truncate.string.pipe';

@NgModule({
  declarations: [
    AppComponent,
    MessagesPanelComponent,
    SigninComponent,
    SignupComponent,
    DashboardComponent,
    AgentComponent,
    AgentFormComponent,
    OperationComponent,
    OperationFormComponent,
    ResponseComponent,
    ResponseFormComponent,
    FilterComponent,
    FilterFormComponent,
    RequestConditionEditorComponent,
    ResponseConditionEditorComponent,
    FilterMessageTypePipe,
    TruncateStringPipe
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    JsonpModule,
    routing
  ],
  providers: [
    appRoutingProviders
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.worldcolck"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.worldcolck.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver
            android:name="com.example.worldcolck.AlarmReceiver"
            ></receiver>
        <activity android:name="PlayAlarmAty" android:screenOrientation="portrait"></activity>
    </application>

</manifest>


text:
pandas\_profiling.config.MissingPlot
====================================

.. currentmodule:: pandas_profiling.config

.. autopydantic_model:: MissingPlot


text:
<?php
declare(strict_types = 1);

namespace Tests\Innmind\AMQP\Model\Connection;

use Innmind\AMQP\{
    Model\Connection\MaxChannels,
    Exception\DomainException,
    Exception\FrameChannelExceedAllowedChannelNumber,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\{
    PHPUnit\BlackBox,
    Set,
};

class MaxChannelsTest extends TestCase
{
    use BlackBox;

    public function testInterface()
    {
        $max = new MaxChannels(42);

        $this->assertSame(42, $max->toInt());
        $this->assertTrue($max->allows(0));
        $this->assertTrue($max->allows(42));
        $this->assertFalse($max->allows(43));

        $this->assertTrue((new MaxChannels(0))->allows(1));
    }

    public function testAllowAnyNumberWhenNoLimit()
    {
        $this
            ->forAll(Set\Integers::between(0, 65535)) // max allowed by the specification 0.9.1
            ->then(function($number) {
                $max = new MaxChannels(0);

                $this->assertTrue($max->allows($number));
            });
    }

    public function testDoesntAllowAnyNumberAboveTheLimit()
    {
        $this
            ->forAll(
                Set\Integers::between(1, 65535), // max allowed by the specification 0.9.1
                Set\Integers::between(1, 65535),
            )
            ->then(function($allowed, $extraNumber) {
                $max = new MaxChannels($allowed);

                $this->assertFalse($max->allows($allowed + $extraNumber));
            });
    }

    public function testAllowAnyNumberBelowTheLimit()
    {
        $this
            ->forAll(
                Set\Integers::between(1, 65535), // max allowed by the specification 0.9.1
                Set\Integers::between(0, 65535),
            )
            ->then(function($allowed, $sizeBelow) {
                $max = new MaxChannels($allowed);

                $this->assertTrue($max->allows($allowed - $sizeBelow));
            });
    }

    public function testVerifyAllowedNumbers()
    {
        $this
            ->forAll(Set\Integers::between(0, 65535)) // max allowed by the specification 0.9.1
            ->then(function($size) {
                $max = new MaxChannels(0);

                $this->assertNull($max->verify($size));
            });
        $this
            ->forAll(
                Set\Integers::between(0, 65535), // max allowed by the specification 0.9.1
                Set\Integers::between(1, 65535),
            )
            ->then(function($allowed, $numberBelow) {
                $max = new MaxChannels($allowed);

                $this->assertNull($max->verify($allowed - $numberBelow));
            });
    }

    public function testThrowWhenVerifyingNumberAboveMaxAllowed()
    {
        $this
            ->forAll(
                Set\Integers::between(0, 65535), // max allowed by the specification 0.9.1
                Set\Integers::between(1, 65535),
            )
            ->then(function($allowed, $extraNumber) {
                $max = new MaxChannels($allowed);

                $above = $allowed + $extraNumber;

                $this->expectException(FrameChannelExceedAllowedChannelNumber::class);
                $this->expectExceptionMessage("Max channel id can be $allowed but got $above");

                $max->verify($above);
            });
    }

    public function testThrowWhenNegativeValue()
    {
        $this->expectException(DomainException::class);

        new MaxChannels(-1);
    }
}


text:
import abc
import contextlib
import tempfile
from CommonServerPython import *
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxltieclient import TieClient
from typing import NamedTuple
from dxltieclient.constants import FileReputationProp, FileGtiAttrib, FileEnterpriseAttrib, AtdAttrib, TrustLevel,\
    HashType, EnterpriseAttrib, FileProvider, FirstRefProp, AtdTrustLevel

VENDOR_NAME = 'McAfee Threat Intelligence Exchange'
OUTPUT_PREFIX = 'McAfee.TIE'
LOWEST_TRUST_LEVEL_KEY = 'lowest_trust_level_key'
LOWEST_SCORE_KEY = 'lowest_score_key'
MAX_QUERY_LIMIT = 500

DXLConfigFiles = NamedTuple('DXLConfigFiles', [('broker_ca_bundle_file', str),
                                               ('client_cert_file', str),
                                               ('private_key_file', str),
                                               ('broker_urls', list[str]),
                                               ])

InstanceCertificates = NamedTuple('InstanceCertificates', [('broker_ca_bundle', str),
                                                           ('client_cert', str),
                                                           ('private_key', str),
                                                           ('broker_urls', list[str]),
                                                           ])

ProviderInfo = NamedTuple('ProviderInfo', [('name', str),
                                           ('abbreviation', str)
                                           ])

PROVIDER_INFO = {
    FileProvider.GTI: ProviderInfo(name='Global Threat Intelligence (GTI)', abbreviation='GTI'),
    FileProvider.ENTERPRISE: ProviderInfo(name='Enterprise reputation', abbreviation='Enterprise'),
    FileProvider.ATD: ProviderInfo(name='Advanced Threat Defense (ATD)', abbreviation='ATD'),
    FileProvider.MWG: ProviderInfo(name='Web Gateway (MWG)', abbreviation='MWG'),
}

TRUST_LEVELS = {
    TrustLevel.KNOWN_TRUSTED_INSTALLER: 'KNOWN_TRUSTED_INSTALLER',
    TrustLevel.KNOWN_TRUSTED: 'KNOWN_TRUSTED',
    TrustLevel.MOST_LIKELY_TRUSTED: 'MOST_LIKELY_TRUSTED',
    TrustLevel.MIGHT_BE_TRUSTED: 'MIGHT_BE_TRUSTED',
    TrustLevel.UNKNOWN: 'UNKNOWN',
    TrustLevel.MIGHT_BE_MALICIOUS: 'MIGHT_BE_MALICIOUS',
    TrustLevel.MOST_LIKELY_MALICIOUS: 'MOST_LIKELY_MALICIOUS',
    TrustLevel.KNOWN_MALICIOUS: 'KNOWN_MALICIOUS',
    TrustLevel.NOT_SET: 'NOT_SET',
}

HASH_TYPE_KEYS = {
    'md5': HashType.MD5,
    'sha1': HashType.SHA1,
    'sha256': HashType.SHA256
}

class GeneralFileReputationParser(abc.ABC):
    """
    This abstract class is in charge of parsing the reputations' data returned from the following API call:
    https://opendxl.github.io/opendxl-tie-client-python/pydoc/dxltieclient.client.html#dxltieclient.client.TieClient.get_file_reputation
    Since all reputations have two sections, one that it is unique to each vendor, and the second that it is mutual to all,
    this class provides a method to parse the mutual section, and an abstract method that each child class
    (representing a specific vendor) must implement to parse the unique section of each vendor.
    """
    GENERAL_REPUTATION_KEYS = {
        FileReputationProp.PROVIDER_ID: "Provider",
        FileReputationProp.TRUST_LEVEL: "Trust_Level",
        FileReputationProp.CREATE_DATE: "Create_Date",
    }

    @staticmethod
    def init(provider: int):
        if(provider == FileProvider.GTI):
            return GtiFileReputationParser()

        elif(provider == FileProvider.ENTERPRISE):
            return EnterpriseFileReputationParser()

        elif(provider == FileProvider.ATD):
            return AtdFileReputationParser()

        else:
            demisto.debug(f'Unexpected provider ID returned - {provider}')
            return UnknownReputationHandler()

    @abstractmethod
    def parse_attributes(self, attributes: Dict[str, Any]):
        """
        The abstract method that is in charge of parsing the vendor's unique attributes.
        Each child class implementing this abstract method holds a dictionary that maps the data returned
        from the API (which are in numeric form) to humand readable data in order for the user to understand the
        returned results.
        """
        pass

    def parse_reputation_key(self, reputation_key: str, val: Union[str, int]):
        """
        This method is in charge of parsing the mutual section of the reputations by using the dictionary
        that is defined in the parent class (GeneralFileReputationParser).
        """
        if(reputation_key == FileReputationProp.PROVIDER_ID):
            return {self.GENERAL_REPUTATION_KEYS[reputation_key]: get_provider_name(provider_id=val)}

        elif(reputation_key == FileReputationProp.CREATE_DATE):
            return {self.GENERAL_REPUTATION_KEYS[reputation_key]: epoch_to_localtime(int(val))}

        elif(reputation_key in self.GENERAL_REPUTATION_KEYS):
            return {self.GENERAL_REPUTATION_KEYS[reputation_key]: val}

        else:
            return {reputation_key: val}

    def parse_data(self, reputation_data: Dict[str, Any]):
        """
        This method is in charge of parsing the full reputation, it does so by parsing the vendror's unique
        attributes, and the mutual attributes of all vendors.
        """
        parsed_res: Dict[str, Any] = {}
        for key, val in reputation_data.items():
            if(key == FileReputationProp.ATTRIBUTES):
                parsed_res |= self.parse_attributes(attributes=val)

            else:
                parsed_res |= self.parse_reputation_key(reputation_key=key,
                                                        val=val)
        return parsed_res

class GtiFileReputationParser(GeneralFileReputationParser):
    ATTRIBUTES_KEYS = {
        FileGtiAttrib.FIRST_CONTACT: "First_Contact",
        FileGtiAttrib.PREVALENCE: "Prevalence",
        FileGtiAttrib.ORIGINAL_RESPONSE: "Original_Response",
    }

    def parse_attributes(self, attributes: Dict[str, Any]) -> Dict[str, Any]:
        parsed_res: Dict[str, Any] = {}
        for key, val in attributes.items():
            if(key == FileGtiAttrib.FIRST_CONTACT):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = epoch_to_localtime(int(val))

            elif(key in self.ATTRIBUTES_KEYS):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = val

            else:
                parsed_res[key] = val

        return parsed_res

class EnterpriseFileReputationParser(GeneralFileReputationParser):
    ATTRIBUTES_KEYS = {
        FileEnterpriseAttrib.SERVER_VERSION: "Server_Version",
        FileEnterpriseAttrib.FIRST_CONTACT: "First_Contact",
        FileEnterpriseAttrib.PREVALENCE: "Prevalence",
        FileEnterpriseAttrib.ENTERPRISE_SIZE: "Enterprise_Size",
        FileEnterpriseAttrib.MIN_LOCAL_REP: "Min_Local_Rep",
        FileEnterpriseAttrib.MAX_LOCAL_REP: "Max_Local_Rep",
        FileEnterpriseAttrib.AVG_LOCAL_REP: "Avg_Local_Rep",
        FileEnterpriseAttrib.PARENT_MIN_LOCAL_REP: "Parent_Min_Local_Rep",
        FileEnterpriseAttrib.PARENT_MAX_LOCAL_REP: "Parent_Max_Local_Rep",
        FileEnterpriseAttrib.PARENT_AVG_LOCAL_REP: "Parent_Avg_Local_Rep",
        FileEnterpriseAttrib.FILE_NAME_COUNT: "File_Name_Count",
        FileEnterpriseAttrib.DETECTION_COUNT: "Detection_Count",
        FileEnterpriseAttrib.LAST_DETECTION_TIME: "Last_Detection_Time",
        FileEnterpriseAttrib.IS_PREVALENT: "Is_Prevalent",
        FileEnterpriseAttrib.CHILD_FILE_REPS: "Child_File_Reps",
        FileEnterpriseAttrib.PARENT_FILE_REPS: "Parent_File_Reps",
    }

    def parse_attributes(self, attributes: Dict[str, Any]) -> Dict[str, Any]:
        parsed_res: Dict[str, Any] = {}
        for key, val in attributes.items():
            if(key == FileEnterpriseAttrib.FIRST_CONTACT or key == FileEnterpriseAttrib.LAST_DETECTION_TIME):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = epoch_to_localtime(int(val))

            elif(key == FileEnterpriseAttrib.SERVER_VERSION):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = EnterpriseAttrib.to_version_string(val)

            elif(key == FileEnterpriseAttrib.CHILD_FILE_REPS or key == FileEnterpriseAttrib.PARENT_FILE_REPS):

                parsed_res[self.ATTRIBUTES_KEYS[key]] = val
            elif(key in self.ATTRIBUTES_KEYS):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = val

            else:
                parsed_res[key] = val

        return parsed_res

class AtdFileReputationParser(GeneralFileReputationParser):
    ATTRIBUTES_KEYS = {
        AtdAttrib.GAM_SCORE: "GAM_Score",
        AtdAttrib.AV_ENGINE_SCORE: "AV_Engine_Score",
        AtdAttrib.SANDBOX_SCORE: "Sandbox_Score",
        AtdAttrib.VERDICT: "Verdict",
        AtdAttrib.BEHAVIORS: "Behaviors",
    }
    ATD_TRUST_LEVELS = {
        AtdTrustLevel.KNOWN_TRUSTED: "KNOWN_TRUSTED",
        AtdTrustLevel.MOST_LIKELY_TRUSTED: "MOST_LIKELY_TRUSTED",
        AtdTrustLevel.MIGHT_BE_TRUSTED: "MIGHT_BE_TRUSTED",
        AtdTrustLevel.UNKNOWN: "UNKNOWN",
        AtdTrustLevel.MIGHT_BE_MALICIOUS: "MIGHT_BE_MALICIOUS",
        AtdTrustLevel.MOST_LIKELY_MALICIOUS: "MOST_LIKELY_MALICIOUS",
        AtdTrustLevel.KNOWN_MALICIOUS: "KNOWN_MALICIOUS",
        AtdTrustLevel.NOT_SET: "NOT_SET",
    }

    def parse_attributes(self, attributes: Dict[str, Any]) -> Dict[str, Any]:
        parsed_res: Dict[str, Any] = {}
        for key, val in attributes.items():
            if(key in self.ATTRIBUTES_KEYS):
                parsed_res[self.ATTRIBUTES_KEYS[key]] = val

            else:
                parsed_res[key] = val

        return parsed_res

class UnknownReputationHandler(GeneralFileReputationParser):

    def parse_attributes(self, attributes: Dict[str, Any]) -> Dict[str, Any]:
        return attributes

def get_client_config(dxl_config_files: DXLConfigFiles) -> DxlClientConfig:
    config = DxlClientConfig(
        broker_ca_bundle=dxl_config_files.broker_ca_bundle_file,
        cert_file=dxl_config_files.client_cert_file,
        private_key=dxl_config_files.private_key_file,
        brokers=[Broker.parse(url) for url in dxl_config_files.broker_urls]
    )

    config.connect_retries = 1
    config.reconnect_delay = 1
    config.reconnect_delay_max = 10

    return config

def get_provider_name(provider_id: Union[int, str]) -> str:
    provider_id_int = arg_to_number(provider_id)
    provider_info = PROVIDER_INFO.get(provider_id_int, None)
    if provider_info:
        return provider_info.name
    else:
        return str(provider_id)

def get_provider_abbr(provider_id: Union[int, str]) -> str:
    provider_id_int = arg_to_number(provider_id)
    provider_info = PROVIDER_INFO.get(provider_id_int, None)
    if provider_info:
        return provider_info.abbreviation
    else:
        return str(provider_id)

def epoch_to_localtime(epoch_time: int) -> str:
    try:
        date = datetime.fromtimestamp(epoch_time, tz=timezone.utc)
    except ValueError:
        date = datetime.fromtimestamp(epoch_time / 1000, tz=timezone.utc)

    return date.strftime("%Y-%m-%d %H:%M:%S")

def parse_reputation_human_readable(reputation):
    trust_level = reputation.get(FileReputationProp.TRUST_LEVEL)
    verbose_trust_level = TRUST_LEVELS.get(trust_level, trust_level)

    provider_id = reputation.get(FileReputationProp.PROVIDER_ID)
    provider = get_provider_name(provider_id)

    create_date = reputation.get(FileReputationProp.CREATE_DATE)
    create_date_str = epoch_to_localtime(int(create_date))

    res = {
        'Trust level': trust_level,
        'Trust level (verbose)': verbose_trust_level,
        'Provider ID': provider_id,
        'Provider (verbose)': provider,
        'Created date': create_date_str
    }

    return res

def parse_reference_human_readable(reference):
    agent_guid = reference.get(FirstRefProp.SYSTEM_GUID)
    date = reference.get(FirstRefProp.DATE)

    return {
        'Date': epoch_to_localtime(date),
        'AgentGuid': agent_guid.replace('{', '').replace('}', '')  # Remove brackets if exist
    }

def reputations_to_human_readable(reputations):
    return [parse_reputation_human_readable(rep) for rep in reputations]

def references_to_human_readable(references):
    return [parse_reference_human_readable(ref) for ref in references]

def trust_level_to_score(trust_level):
    if (trust_level >= TrustLevel.MIGHT_BE_TRUSTED):
        return Common.DBotScore.GOOD

    elif (trust_level == TrustLevel.MIGHT_BE_MALICIOUS):
        return Common.DBotScore.SUSPICIOUS

    elif (trust_level == TrustLevel.NOT_SET or trust_level == TrustLevel.UNKNOWN):
        return Common.DBotScore.NONE

    elif (trust_level < TrustLevel.MIGHT_BE_MALICIOUS):
        return Common.DBotScore.BAD

    else:
        # Shouldn't reach here, as the API doesn't support 31-69 values except for 50)
        return Common.DBotScore.NONE

def test_module(dxl_client: DxlClient):
    """Tests if there is a connection with DxlClient(which is used for connection with McAfee TIE, instead of the Client class)"""
    dxl_client.connect()
    return 'ok'

def safe_get_file_reputation(tie_client: TieClient, api_input: Dict[str, str]):
    try:
        res = tie_client.get_file_reputation(api_input)
    except Exception as e:
        demisto.info(f'McAfee failed to get file reputation with error: {str(e)}')
        return None
    return res

def get_hash_type_key(file_hash: str):
    hash_type = get_hash_type(file_hash)
    hash_type_key = HASH_TYPE_KEYS.get(hash_type, None)
    if not hash_type_key:
        raise DemistoException(f'Invalid value, {file_hash} is not a valid SHA1, SHA256 or MD5 value.')
    return hash_type_key

def get_file_instance(dbot_score: Union[Common.DBotScore, None], file_hash: str, hash_type_key: str) -> Common.File:
    return Common.File(dbot_score=dbot_score,
                       md5=file_hash if hash_type_key == HashType.MD5 else None,
                       sha1=file_hash if hash_type_key == HashType.SHA1 else None,
                       sha256=file_hash if hash_type_key == HashType.SHA256 else None)

def parse_reputation(provider_id: int, reputation: Dict):
    file_reputation_parser = GeneralFileReputationParser.init(provider=provider_id)
    parsed_reputation = file_reputation_parser.parse_data(reputation_data=reputation)
    parsed_reputation['Provider_ID'] = provider_id
    return parsed_reputation

def parse_file_reputation_raw_result(raw_result: Dict, file_hash: str, reliability: str, hash_type_key: str):
    context_data = {}
    parsed_reputation_data = {}

    # Since the range of trust levels is [0,1,...,100], we want to get the minimum trust level
    # that is not 0, therefore we define a variable that is larger than the maximum in the predefined range
    # and iterate in order to retrieve the minimum, if our minimum was not changed, that means all the trust levels
    # are zero.
    max_num = TrustLevel.KNOWN_TRUSTED_INSTALLER + 1  # More than the maximum possible trust level
    lowest_trust_level = max_num
    reputations = raw_result.values()
    for reputation in reputations:
        # Parse the raw result of each reputation result
        provider_id = reputation[FileReputationProp.PROVIDER_ID]
        parsed_reputation_data[get_provider_abbr(provider_id=provider_id)] = parse_reputation(provider_id=provider_id,
                                                                                reputation=reputation)
        # Get the vendor's data with the lowest score
        rep_trust_level = reputation.get(FileReputationProp.TRUST_LEVEL, TrustLevel.NOT_SET)
        if rep_trust_level != TrustLevel.NOT_SET and rep_trust_level < lowest_trust_level:
            lowest_trust_level = rep_trust_level

    if lowest_trust_level == max_num:
        lowest_tl_score = {
            LOWEST_TRUST_LEVEL_KEY: TrustLevel.NOT_SET,
            LOWEST_SCORE_KEY: Common.DBotScore.NONE
        }
    else:
        lowest_tl_score = {
            LOWEST_TRUST_LEVEL_KEY: lowest_trust_level,
            LOWEST_SCORE_KEY: trust_level_to_score(lowest_trust_level)
        }
    dbot_score = Common.DBotScore(indicator=file_hash,
                                  indicator_type=DBotScoreType.FILE,
                                  reliability=reliability,
                                  score=lowest_tl_score[LOWEST_SCORE_KEY],
                                  )

    file_instance = get_file_instance(dbot_score=dbot_score,
                                      file_hash=file_hash,
                                      hash_type_key=hash_type_key)
    if lowest_tl_score[LOWEST_SCORE_KEY] >= Common.DBotScore.SUSPICIOUS:
        dbot_score.malicious_description = f"Trust level is {str(lowest_tl_score[LOWEST_TRUST_LEVEL_KEY])}"

    context_data = {'Reputations': {'Hash': file_hash}}
    context_data['Reputations'] |= parsed_reputation_data
    table = reputations_to_human_readable(reputations)
    return CommandResults(readable_output=tableToMarkdown(f'McAfee TIE Hash Reputations For {file_hash}:', table),
                          raw_response=raw_result,
                          outputs_prefix=f'{OUTPUT_PREFIX}.FilesReputations',
                          outputs=context_data,
                          indicator=file_instance,
                          )

def files_reputations_command(hashes: List[str], tie_client: TieClient, reliability: str) -> List[CommandResults]:
    command_results: List[CommandResults] = []
    for file_hash in hashes:
        hash_type_key = get_hash_type_key(file_hash=file_hash)
        api_input = {hash_type_key: file_hash}
        raw_result = safe_get_file_reputation(tie_client, api_input)

        if not raw_result:
            dbot_score = Common.DBotScore(indicator=file_hash,
                                          indicator_type=DBotScoreType.FILE,
                                          reliability=reliability,
                                          score=Common.DBotScore.NONE,
                                          )

            file_instance = get_file_instance(dbot_score=dbot_score,
                                              file_hash=file_hash,
                                              hash_type_key=hash_type_key)

            command_result = CommandResults(readable_output=f'McAfee TIE Hash Reputation For {file_hash} was not found',
                                            indicator=file_instance,
                                            )
        else:
            command_result = parse_file_reputation_raw_result(raw_result=raw_result,
                                                              file_hash=file_hash,
                                                              reliability=reliability,
                                                              hash_type_key=hash_type_key,
                                                              )

        command_results.append(command_result)
    return command_results

def files_references_command(hashes: List[str], tie_client: TieClient, query_limit: int) -> List[CommandResults]:
    if(query_limit > MAX_QUERY_LIMIT):
        raise DemistoException(f'Query limit must not exceed {MAX_QUERY_LIMIT}')
    elif(query_limit <= 0):
        raise DemistoException('Query limit must not be zero or negative')

    command_results: List[CommandResults] = []
    for file_hash in hashes:
        hash_type_key = get_hash_type_key(file_hash=file_hash)

        api_input = {hash_type_key: file_hash}
        raw_result = tie_client.get_file_first_references(api_input,
                                                          query_limit=query_limit)

        table = references_to_human_readable(raw_result)

        file_instance = get_file_instance(dbot_score=None,
                                          file_hash=file_hash,
                                          hash_type_key=hash_type_key)
        if not raw_result:
            command_result = CommandResults(readable_output=f'McAfee TIE Hash Reference For {file_hash} was not found',
                                            indicator=file_instance,)
        else:
            context_data = {'Hash': file_hash}
            context_data['References'] = table
            command_result = CommandResults(readable_output=tableToMarkdown(f'References For Hash {file_hash}:', table),
                                            raw_response=raw_result,
                                            outputs_prefix=f'{OUTPUT_PREFIX}.FilesReferences',
                                            indicator=file_instance,
                                            outputs=context_data,
                                            )

        command_results.append(command_result)
    return command_results

def get_trust_level_key(trust_level: str):
    trust_level_key = [key for (key, val) in TRUST_LEVELS.items() if val == trust_level]
    if not trust_level_key:
        raise DemistoException(f'Illegal argument trust_level {trust_level}. Choose value from predefined values')
    else:
        return trust_level_key[0]

def set_files_reputation_command(hashes: List[str], tie_client: TieClient, trust_level: str, filename: str, comment: str):
    # Find trust_level key
    trust_level_key = get_trust_level_key(trust_level=trust_level)

    for file_hash in hashes:
        hash_type_key = get_hash_type_key(file_hash=file_hash)
        api_input = {hash_type_key: file_hash}

        tie_client.set_file_reputation(trust_level=trust_level_key,
                                       hashes=api_input,
                                       filename=filename,
                                       comment=comment)
    return CommandResults(readable_output='Successfully set files reputation')

def create_temp_credentials(temp_file: tempfile._TemporaryFileWrapper, data_to_write: str):
    temp_file.write(data_to_write)
    temp_file.seek(0)

@contextlib.contextmanager
def create_dxl_config(instance_cert: InstanceCertificates) -> DxlClientConfig:
    with tempfile.NamedTemporaryFile(mode='w+', dir='./', suffix='.crt') as broker_certs_file,\
            tempfile.NamedTemporaryFile(mode='w+', dir='./', suffix='.crt') as client_cert_file,\
            tempfile.NamedTemporaryFile(mode='w+', dir='./', suffix='.key') as private_key_file:
        broker_certs_file.delete
        create_temp_credentials(broker_certs_file, instance_cert.broker_ca_bundle)
        create_temp_credentials(client_cert_file, instance_cert.client_cert)
        create_temp_credentials(private_key_file, instance_cert.private_key)
        dxl_config_files = DXLConfigFiles(broker_ca_bundle_file=broker_certs_file.name,
                                          client_cert_file=client_cert_file.name,
                                          private_key_file=private_key_file.name,
                                          broker_urls=instance_cert.broker_urls)
        yield get_client_config(dxl_config_files=dxl_config_files)

@contextlib.contextmanager
def create_dxl_client(instance_cert: InstanceCertificates):
    with create_dxl_config(instance_cert=instance_cert) as dxl_client_config:
        dxl_client_cm = DxlClient(dxl_client_config)

    with dxl_client_cm as dxl_client:
        yield dxl_client

def get_tie_client(dxl_client: DxlClient):
    dxl_client.connect()  # We need to connect to the DXL fabric in order to create a TIE Client instance
    return TieClient(dxl_client)

def get_instance_certificates(params: Dict[str, str]) -> InstanceCertificates:
    return InstanceCertificates(broker_ca_bundle=params['broker_ca_bundle'],
                                client_cert=params['cert_file'],
                                private_key=params['private_key'],
                                broker_urls=params['broker_urls'].split(','))

def files_reputations(dxl_client: DxlClient, hashes: List[str], reliability: str) -> List[CommandResults]:
    tie_client = get_tie_client(dxl_client)
    return files_reputations_command(hashes=hashes,
                                     tie_client=tie_client,
                                     reliability=reliability
                                     )

def files_references(dxl_client: DxlClient, hashes: List[str], args_query_limit: Union[int, None]) -> List[CommandResults]:
    tie_client = get_tie_client(dxl_client)
    query_limit = args_query_limit if args_query_limit else MAX_QUERY_LIMIT
    return files_references_command(hashes=hashes,
                                    tie_client=tie_client,
                                    query_limit=query_limit,
                                    )

def set_files_reputation(dxl_client: DxlClient, hashes: List[str], trust_level: str,
                         filename: str, comment: str) -> CommandResults:
    tie_client = get_tie_client(dxl_client)
    return set_files_reputation_command(hashes=hashes,
                                        tie_client=tie_client,
                                        trust_level=trust_level,
                                        filename=filename,
                                        comment=comment,
                                        )

def main():  # pragma: no cover
    try:
        command = demisto.command()
        args = demisto.args()
        params = demisto.params()
        instance_cert = get_instance_certificates(params=params)
        reliability = DBotScoreReliability.get_dbot_score_reliability_from_str(
            demisto.params().get('integrationReliability', 'C - Fairly reliable'))
        hashes = argToList(args.get('file'))
        demisto.debug(f'Command being called is {command}')
        with create_dxl_client(instance_cert=instance_cert) as dxl_client:
            # We must configure the DxlClient before trying to connect, which is why
            # we wrapped the following code with a "with" statement according to the DxlClient Docs.
            # Only after successfully configuring, can we try to connect using dxl_client.connect
            # If a configuration error is returned from the configuration phase, it will be caught before trying to connect.
            if command == 'test-module':
                # This is the call made when clicking the integration Test button.
                return_results(test_module(dxl_client=dxl_client))

            elif command == 'file':
                return_results(files_reputations(dxl_client=dxl_client,
                                                 hashes=hashes,
                                                 reliability=reliability))

            elif command == 'tie-file-references':
                return_results(files_references(dxl_client=dxl_client,
                                                hashes=hashes,
                                                args_query_limit=arg_to_number(args.get('query_limit', None))))

            elif command == 'tie-set-file-reputation':
                return_results(set_files_reputation(dxl_client=dxl_client,
                                                    hashes=hashes,
                                                    trust_level=args.get('trust_level'),
                                                    filename=args.get('filename', ''),
                                                    comment=args.get('comment', ''),
                                                    ))
            else:
                raise NotImplementedError(f'Command {command} is not supported.')

    except Exception as e:
        demisto.error(traceback.format_exc())  # print the traceback
        exception_des = str(e)
        if('4044' in exception_des):
            return_error('Invalid value - Client certificates')
        elif('4293' in exception_des):
            return_error('Invalid value - Broker CA certificates')
        elif('4065' in exception_des):
            return_error('Invalid value - Client private key')
        else:
            return_error(f'Failed to execute {command} command.'
                         f'\nError:\n{str(e)}')

if __name__ in ['__main__', '__builtin__', 'builtins']:
    main()


text:
//
//  Util.m
//  CocoaGCDTests
//
//  Created by Christos Sotiriou on 6/11/13.
//  Copyright (c) 2013 Oramind. All rights reserved.
//

#import "Util.h"
#include <mach/mach_host.h>

@implementation Util

+ (NSString *)userHomeDirectoryPath
{
	return NSHomeDirectory();
}

+ (NSString *)logDirectoryPath
{
	return [[NSHomeDirectory() stringByAppendingPathComponent:CS_INTERMEDIATE_PATHS_DIRECTORY] stringByAppendingPathComponent:CS_LOG_DIRECTORY_NAME];
}

+ (BOOL)array:(NSArray *)array ContainsString:(NSString *)string
{
	for (NSString *str in array) {
		if ([str rangeOfString:string].location != NSNotFound) {
			return YES;
		}
	}
	return NO;
}

/*
 Code found in:
 http://stackoverflow.com/questions/7241936/how-do-i-detect-a-dual-core-cpu-on-ios
 */
+ (int)getNumberOfAvailableCoresForCurrentMachine
{
	host_basic_info_data_t hostInfo;
	mach_msg_type_number_t infoCount;

	infoCount = HOST_BASIC_INFO_COUNT;
	host_info( mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo, &infoCount ) ;

	return hostInfo.max_cpus ;
}
@end


text:
FROM        debian:jessie
MAINTAINER  Paul R. Tagliamonte <paultag@debian.org>

ENV DEBIAN_FRONTEND noninteractive

# add deb-src entries
RUN find /etc/apt/sources.list* -type f -exec sed -i 'p; s/^deb /deb-src /' '{}' +

RUN apt-get update && apt-get install -y \
    python3.4 \
    python3-pip \
    git \
    node-uglify \
    node-less \
    coffeescript \
    locales-all \
    libssl-dev \
    libffi-dev \
    python-dev

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV PYTHONIOENCODING utf-8

RUN apt-get update && apt-get build-dep -y python3-psycopg2

RUN mkdir -p /opt/pault.ag/
ADD . /opt/pault.ag/moxie/

RUN cd /opt/pault.ag/moxie; python3.4 /usr/bin/pip3 install \
    slacker websockets aiohttp
# Hurm. Why?

RUN cd /opt/pault.ag/moxie; python3.4 /usr/bin/pip3 install -r \
        requirements.txt

RUN python3.4 /usr/bin/pip3 install -e \
        /opt/pault.ag/moxie/

RUN make -C /opt/pault.ag/moxie/

RUN mkdir -p /moxie/
WORKDIR /moxie/

CMD ["moxied"]


text:
package app.application.system;

import app.domain.user.LoginId;
import lombok.ToString;

import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;

/**
 * ログインユーザーの情報を保持したクラス.
 */
@Named
@ToString
@SessionScoped
public class LoginUser implements Serializable {
    @Inject
    private HttpServletRequest request;
    private LoginId loginId;

    /**
     * 現在のリクエストがログイン済みかどうかを確認する.
     * @return ログイン済みの場合は true
     */
    public boolean isLoggedIn() {
        return this.loginId != null;
    }

    /**
     * ログイン処理を実行する.
     * @param loginId ログインユーザのログインID
     */
    void login(LoginId loginId) {
        this.request.changeSessionId();
        this.loginId = loginId;
    }

    /**
     * ログアウト処理を実行する.
     */
    void logout() {
        this.request.getSession().invalidate();
        this.loginId = null;
    }

    /**
     * 現在ログインしているユーザのログインID を取得する.
     * @return ログインID
     */
    public LoginId getLoginId() {
        return loginId;
    }
}


text:
<head>
	<meta charset="utf-8">
	<title>{% if blog %}{{ blog.title }}|{{ site.title }} {% else %}{{ site.title }}{% endif %}</title>
	<meta name="keywords" content="{% if blog %}{{ blog.keywords}},{{ site.keywords }}{% else %}{{ site.keywords }}{% endif %}">
	<meta name="description" content="{% if blog %}{{ blog.summary | striptags | replace({'\n': ''}) | slice(0, 140) }}{% else %}{{ site.description }}{% endif %}">
	<link rel="stylesheet" href="{{site.url}}theme/cube/css/font-awesome.min.css?ver={{ site.version }}">
	<link rel="stylesheet" href="{{site.url}}theme/cube/css/style.css?ver={{ site.version }}">
	<link rel="stylesheet" href="{{site.url}}theme/cube/css/style-mobile.css?ver={{ site.version }}">
	<link rel="stylesheet" href="{{site.url}}theme/cube/css/main.css?ver={{ site.version }}">
	<link rel="alternate" type="application/rss+xml" title="{{ confObj.title }}" href="{{ confObj.url }}/feed.xml" />
    <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900" rel="stylesheet" type="text/css">

	{% if site.baiduAnalytics %}<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?{{ site.baiduAnalytics }}";
	  var s = document.getElementsByTagName("script")[0];
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
	{% endif %}
</head>