text:
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/interrupt.h>
#include <linux/profile.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/io.h>
#include <linux/bug.h>
#include <asm/cpuinfo.h>
#include <asm/setup.h>
#include <asm/prom.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <linux/cnt32_to_63.h>

#ifdef CONFIG_SELFMOD_TIMER
#include <asm/selfmod.h>
#define TIMER_BASE	BARRIER_BASE_ADDR
#else
static unsigned int timer_baseaddr;
#define TIMER_BASE	timer_baseaddr
#endif

static unsigned int freq_div_hz;
static unsigned int timer_clock_freq;

#define TCSR0	(0x00)
#define TLR0	(0x04)
#define TCR0	(0x08)
#define TCSR1	(0x10)
#define TLR1	(0x14)
#define TCR1	(0x18)

#define TCSR_MDT	(1<<0)
#define TCSR_UDT	(1<<1)
#define TCSR_GENT	(1<<2)
#define TCSR_CAPT	(1<<3)
#define TCSR_ARHT	(1<<4)
#define TCSR_LOAD	(1<<5)
#define TCSR_ENIT	(1<<6)
#define TCSR_ENT	(1<<7)
#define TCSR_TINT	(1<<8)
#define TCSR_PWMA	(1<<9)
#define TCSR_ENALL	(1<<10)

static inline void microblaze_timer0_stop(void)
{
	out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0) & ~TCSR_ENT);
}

static inline void microblaze_timer0_start_periodic(unsigned long load_val)
{
	if (!load_val)
		load_val = 1;
	out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */

	/* load the initial value */
	out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);

	/* see timer data sheet for detail
	 * !ENALL - don't enable 'em all
	 * !PWMA - disable pwm
	 * TINT - clear interrupt status
	 * ENT- enable timer itself
	 * EINT - enable interrupt
	 * !LOAD - clear the bit to let go
	 * ARHT - auto reload
	 * !CAPT - no external trigger
	 * !GENT - no external signal
	 * UDT - set the timer as down counter
	 * !MDT0 - generate mode
	 */
	out_be32(TIMER_BASE + TCSR0,
			TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
}

static inline void microblaze_timer0_start_oneshot(unsigned long load_val)
{
	if (!load_val)
		load_val = 1;
	out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */

	/* load the initial value */
	out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);

	out_be32(TIMER_BASE + TCSR0,
			TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
}

static int microblaze_timer_set_next_event(unsigned long delta,
					struct clock_event_device *dev)
{
	pr_debug("%s: next event, delta %x\n", __func__, (u32)delta);
	microblaze_timer0_start_oneshot(delta);
	return 0;
}

static void microblaze_timer_set_mode(enum clock_event_mode mode,
				struct clock_event_device *evt)
{
	switch (mode) {
	case CLOCK_EVT_MODE_PERIODIC:
		printk(KERN_INFO "%s: periodic\n", __func__);
		microblaze_timer0_start_periodic(freq_div_hz);
		break;
	case CLOCK_EVT_MODE_ONESHOT:
		printk(KERN_INFO "%s: oneshot\n", __func__);
		break;
	case CLOCK_EVT_MODE_UNUSED:
		printk(KERN_INFO "%s: unused\n", __func__);
		break;
	case CLOCK_EVT_MODE_SHUTDOWN:
		printk(KERN_INFO "%s: shutdown\n", __func__);
		microblaze_timer0_stop();
		break;
	case CLOCK_EVT_MODE_RESUME:
		printk(KERN_INFO "%s: resume\n", __func__);
		break;
	}
}

static struct clock_event_device clockevent_microblaze_timer = {
	.name		= "microblaze_clockevent",
	.features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
	.shift		= 8,
	.rating		= 300,
	.set_next_event	= microblaze_timer_set_next_event,
	.set_mode	= microblaze_timer_set_mode,
};

static inline void timer_ack(void)
{
	out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0));
}

static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
	struct clock_event_device *evt = &clockevent_microblaze_timer;
#ifdef CONFIG_HEART_BEAT
	heartbeat();
#endif
	timer_ack();
	evt->event_handler(evt);
	return IRQ_HANDLED;
}

static struct irqaction timer_irqaction = {
	.handler = timer_interrupt,
	.flags = IRQF_DISABLED | IRQF_TIMER,
	.name = "timer",
	.dev_id = &clockevent_microblaze_timer,
};

static __init void microblaze_clockevent_init(void)
{
	clockevent_microblaze_timer.mult =
		div_sc(timer_clock_freq, NSEC_PER_SEC,
				clockevent_microblaze_timer.shift);
	clockevent_microblaze_timer.max_delta_ns =
		clockevent_delta2ns((u32)~0, &clockevent_microblaze_timer);
	clockevent_microblaze_timer.min_delta_ns =
		clockevent_delta2ns(1, &clockevent_microblaze_timer);
	clockevent_microblaze_timer.cpumask = cpumask_of(0);
	clockevents_register_device(&clockevent_microblaze_timer);
}

static cycle_t microblaze_read(struct clocksource *cs)
{
	/* reading actual value of timer 1 */
	return (cycle_t) (in_be32(TIMER_BASE + TCR1));
}

static struct timecounter microblaze_tc = {
	.cc = NULL,
};

static cycle_t microblaze_cc_read(const struct cyclecounter *cc)
{
	return microblaze_read(NULL);
}

static struct cyclecounter microblaze_cc = {
	.read = microblaze_cc_read,
	.mask = CLOCKSOURCE_MASK(32),
	.shift = 8,
};

static int __init init_microblaze_timecounter(void)
{
	microblaze_cc.mult = div_sc(timer_clock_freq, NSEC_PER_SEC,
				microblaze_cc.shift);

	timecounter_init(&microblaze_tc, &microblaze_cc, sched_clock());

	return 0;
}

static struct clocksource clocksource_microblaze = {
	.name		= "microblaze_clocksource",
	.rating		= 300,
	.read		= microblaze_read,
	.mask		= CLOCKSOURCE_MASK(32),
	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
};

static int __init microblaze_clocksource_init(void)
{
	if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
		panic("failed to register clocksource");

	/* stop timer1 */
	out_be32(TIMER_BASE + TCSR1, in_be32(TIMER_BASE + TCSR1) & ~TCSR_ENT);
	/* start timer1 - up counting without interrupt */
	out_be32(TIMER_BASE + TCSR1, TCSR_TINT|TCSR_ENT|TCSR_ARHT);

	/* register timecounter - for ftrace support */
	init_microblaze_timecounter();
	return 0;
}

/*
 * We have to protect accesses before timer initialization
 * and return 0 for sched_clock function below.
 */
static int timer_initialized;

void __init time_init(void)
{
	u32 irq, i = 0;
	u32 timer_num = 1;
	struct device_node *timer = NULL;
	const void *prop;
#ifdef CONFIG_SELFMOD_TIMER
	unsigned int timer_baseaddr = 0;
	int arr_func[] = {
				(int)&microblaze_read,
				(int)&timer_interrupt,
				(int)&microblaze_clocksource_init,
				(int)&microblaze_timer_set_mode,
				(int)&microblaze_timer_set_next_event,
				0
			};
#endif
	const char * const timer_list[] = {
		"xlnx,xps-timer-1.00.a",
		NULL
	};

	for (i = 0; timer_list[i] != NULL; i++) {
		timer = of_find_compatible_node(NULL, NULL, timer_list[i]);
		if (timer)
			break;
	}
	BUG_ON(!timer);

	timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
	timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
	irq = be32_to_cpup(of_get_property(timer, "interrupts", NULL));
	timer_num = be32_to_cpup(of_get_property(timer,
						"xlnx,one-timer-only", NULL));
	if (timer_num) {
		eprintk(KERN_EMERG "Please enable two timers in HW\n");
		BUG();
	}

#ifdef CONFIG_SELFMOD_TIMER
	selfmod_function((int *) arr_func, timer_baseaddr);
#endif
	printk(KERN_INFO "%s #0 at 0x%08x, irq=%d\n",
		timer_list[i], timer_baseaddr, irq);

	/* If there is clock-frequency property than use it */
	prop = of_get_property(timer, "clock-frequency", NULL);
	if (prop)
		timer_clock_freq = be32_to_cpup(prop);
	else
		timer_clock_freq = cpuinfo.cpu_clock_freq;

	freq_div_hz = timer_clock_freq / HZ;

	setup_irq(irq, &timer_irqaction);
#ifdef CONFIG_HEART_BEAT
	setup_heartbeat();
#endif
	microblaze_clocksource_init();
	microblaze_clockevent_init();
	timer_initialized = 1;
}

unsigned long long notrace sched_clock(void)
{
	if (timer_initialized) {
		struct clocksource *cs = &clocksource_microblaze;
		cycle_t cyc = cnt32_to_63(cs->read(NULL));
		return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
	}
	return 0;
}


text:
package keetz.barkr.Activities.Tasks;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;

import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;

import com.amazonaws.mobile.auth.core.IdentityManager;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferListener;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferObserver;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferState;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.amazonaws.services.s3.model.UploadObjectRequest;

import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Created by riley on 12/7/17.
 * This class lets the user pick an image from their gallery and upload it as their profile picture (on AWS).
 * This feature works (I tested it) but is never used because we did not get far enough with the profile feature (which I did not work on, but was ready to do back end with).
 */

public class UploadImageTask extends Activity {

    /**
     * This is an activity because we need the application's context.
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        /**
         * Start a thread that does all the work because we cannot have the network on the main thread.
         * Credit for below at: https://stackoverflow.com/questions/39866869/how-to-ask-permission-to-access-gallery-on-android-m
         */
        new Thread(new Runnable() {

            @Override
            public void run() {

                /** We must get permission to use photo gallery if we do not already have it, so check for that! */
                if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {

                    /** request permission to use photo gallery for photo upload */
                    ActivityCompat.requestPermissions(getParent(),
                            new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                            1);
                }

                /** user already gave permission, so start the image picking activity */
                else{
                    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                    intent.setType("image/*");
                    startActivityForResult(intent, 1);
                }
            }
        }).start();

    }

    /** what to do with users response to permission asking */
    @Override
    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {

        switch (requestCode) {
            case 1: {
                /** permission was granted - pick the image
                 * https://stackoverflow.com/questions/5309190/android-pick-images-from-gallery
                 * */
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                    intent.setType("image/*");
                    startActivityForResult(intent, 1);
                }
                /** permission not granted - finish upload task & return to parent activity */
                else{
                    finish();
                }
            }
        }
    }

    /** after user picks an image
     * https://stackoverflow.com/questions/5309190/android-pick-images-from-gallery
     * */
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {

        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == 1 && resultCode == Activity.RESULT_OK) {
            /** something went wrong if the data is null */
            if (data == null) {
                Log.d("IMAGE SELECTION", "FAILED - Intent Data Null");
            }
            /** otherwise, upload is considered successful */
            else {
                Log.d("IMAGE SELECTION", "SUCCESS");

                /** try uploading the image! */
                Uri picURI = data.getData();
                new UploadImage().execute(new File(picURI.getPath()));
            }

        }
    }

    /** woohoo actually uploading it! */
    class UploadImage extends AsyncTask<File, Void, Void> {

        @Override
        protected Void doInBackground(File... files) {

            /** set the photo file and get user credentials for an S3 client (s3 used to store user files) */
            final File photo = files[0];
            AmazonS3 s3 = new AmazonS3Client(IdentityManager.getDefaultIdentityManager().getCredentialsProvider().getCredentials());

            /** set up aws transfer objects for the upload. image to be stored in user's protected bucket */
            TransferUtility transferUtility = TransferUtility.builder().context(getApplicationContext()).s3Client(s3).build();
            TransferObserver uploadObserver = transferUtility.upload("barkr-userfiles-mobilehub-1219400988/protected/" + IdentityManager.getDefaultIdentityManager().getCachedUserID(), "profile_photo.jpg", photo);

            /** doing the upload!*/
            uploadObserver.setTransferListener(new TransferListener() {

                @Override
                public void onStateChanged(int id, TransferState state) {

                    if (state == TransferState.COMPLETED){
                        Log.d("IMAGE UPLOAD", "SUCCESS");
                        finish();
                    }

                }

                @Override
                public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {
                    //don't need to do anything necessarily
                }

                /** something went wrong- log it */
                @Override
                public void onError(int id, Exception ex) {
                    Log.d("IMAGE UPLOAD","FAILURE");
                }
            });

            return null;
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Plugin Event class.
 */
export default class PluginEvent
{
   /**
    * Initializes PluginEvent.
    *
    * @param {object}   data - event data.
    * @param {boolean}  copy - potentially copy data.
    */
   constructor(data = {}, copy = true)
   {
      /**
       * Stores the data provided to the event and potentially copying it via `Object.assign`.
       * @type {object}
       */
      this.data = copy ? Object.assign({}, data) : data;
   }
}


text:
A simple command-line script to check file if it obey the rule of UTF-8 bytes.

If check failed, report the position of first wrong byte.


text:
'use strict';

require('shelljs/global');
var assert = require('assert');
var EventEmitter = require('events');

class Release extends EventEmitter {

  constructor(options) {
    super();

    assert(which('git'), 'This script requires git');
    assert(options.name, "Please set the app's name via options.name");
    assert(options.github_path, "Please set the app's Github Path with options.github_path");
    assert(options.github_ident_email, 'You need to set an email for Github ident');
    assert(options.github_ident_name, 'You need to set a name for the Github ident');

    var defaultOptions = {
      commit_header: 'Release',
      release_header: 'Release Notes',
      commit_regex: '^\*.*',
      build_command: null
    };

    this.options = Object.assign(defaultOptions, options);

    exec('git fetch --tags');
    exec(`git config --global user.email "${options.github_ident_name}"`);
    exec(`git config --global user.name "${options.github_ident_name}"`);

    if (options.build_command) {
      let buildResult = exec(options.build_command);
      assert.strictEqual(buildResult.code, 0, 'Build command failed during release');
      echo('Build Complete: ${buildResult.output}');
      let buildCommitResult = exec('git commit -am "Deploy/Build"');
      assert.strictEqual(buildCommitResult.code, 0, 'Commiting build back to repo failed');
      let buildPushResult = exec('git push origin develop');
      assert.strictEqual(buildPushResult.code, 0, 'Pushing build to remote has failed');
    }

    let checkoutMasterResult = exec('git checkout master');
    assert.strictEqual(checkoutMasterResult.code, 0, 'Failed to check out master branch. Please ensure the script has access and master branch exists');
    let pullResult = exec(`git pull origin master`);
    assert.strictEqual(pullResult.code, 0, 'Failed to pull master');
    let developMergeResult = exec('git merge --no-ff --no-edit develop');
    assert.strictEqual(developMergeResult.code, 0, 'Failed to merge develop with master before publishing release');

    let lastAvailableTag = this.getLastAvailableTag();
    let releaseNotes = this.gatherReleaseNotes(lastAvailableTag);

    if (releaseNotes.length > 0) {
      //Trigger a build
      let mergePushResult = exec('git push origin master');
      assert.strictEqual(mergePushResult.code, 0, 'Failed to push master after merging with develop');

      let releaseTag = this.getNewVersion();

      //Go free into the world release!
      this.publishRelease(releaseTag, releaseNotes);
    } else {
      echo(`Release cancelled. No Release notes found. ${releaseNotes}`);
    }
  }

  publishRelease(releaseTag, releaseNotes) {
    const payload = `{\"tag_name\":\"${releaseTag}\",\"name\":\"${this.options.name} Version ${releaseTag}\", \"body\":\"# ${this.options.release_header}\\n${releaseNotes}\"}`;
    echo(`Deploying release with payload: ${payload}`);
    let ghPublishResult = exec(`curl -H "Content-Type: application/json" -X POST -d '${payload}' https://api.github.com/repos/${this.options.github_path}/releases?access_token=${env.GH_API_TOKEN}`);
    assert.strictEqual(ghPublishResult.code, 0, `Failed to publish release to githun: ${ghPublishResult.output}`);
    this.emit('done', `Release Completed: ${ghPublishResult.output}`);
  }

  getLastAvailableTag() {
    let describeRes = exec('git describe --tags --abbrev=0');
    assert.strictEqual(describeRes.code, 0, `Could not describe current git repo ${describeRes.output}`);

    return describeRes.output.trim();
  }

  gatherReleaseNotes(lastTag) {
    echo(`Gathering release notes for ${lastTag}`);
    const logCmd = `git log --pretty=format:%B  --grep=${this.options.commit_header} ${lastTag}..origin | grep -oh '${this.options.commit_regex}'`;
    echo(logCmd);
    let releaseNotesRes = exec(logCmd);
    if (releaseNotesRes.code === 1) {
      return '';
    } else {
      return releaseNotesRes.output.replace(/(?:\r\n|\r|\n)/g, '\\n');
    }
  }

  getNewVersion() {
    let npmVersionResult = exec('npm version patch');
    assert.strictEqual(npmVersionResult.code, 0, `Failed to bump patch version of repo ${npmVersionResult.output}`);
    let versionPushResult = exec('git push --tags origin master'); //TODO: Spike forcing (with lease) this push
    assert.strictEqual(versionPushResult.code, 0, `Failed to push new tag ${versionPushResult.output}`);

    return npmVersionResult.output.trim();
  }
}

module.exports = Release;


text:
package br.eti.qisolucoes.contactcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import br.eti.qisolucoes.contactcloud.model.Usuario;
import br.eti.qisolucoes.contactcloud.service.AgendaService;

@Controller
@RequestMapping(value = "/agenda")
public class AgendaController {

	@Autowired
	private AgendaService agendaService;

	@GetMapping(value = "/abrir")
	public ModelAndView get(Authentication authentication) {
		Usuario usuario = (Usuario) authentication.getPrincipal();
		return new ModelAndView("agenda").addObject("contatos", agendaService.find(usuario.getId()).getContatos());
	}

}


text:
var express = require('express')
var app = express()
app.use(express.static(__dirname))
app.listen(process.env.PORT || 3006)
exports.exp = app


text:
using System.Collections.Generic;
using System.Globalization;

namespace Knoema.Localization
{
	public interface ILocalizationRepository
	{
		/// <summary>
		/// Function returns list of supported cultures
		/// This method is constantly called, it should be as fast as possible. It isn't cached with common caching mechanism due to performance issues
		/// </summary>
		/// <returns></returns>
		IEnumerable<CultureInfo> GetCultures();
		ILocalizedObject Create();
		ILocalizedObject Get(int key);
		IEnumerable<ILocalizedObject> GetAll(CultureInfo culture);
		int GetCount(CultureInfo culture);
		void Save(params ILocalizedObject[] list);
		void Delete(params ILocalizedObject[] list);
	}
}


text:
#ifndef __GTK_ICON_VIEW_H__
#define __GTK_ICON_VIEW_H__

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkcontainer.h>
#include <gtk/gtktreemodel.h>
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkcellarea.h>
#include <gtk/gtkselection.h>
#include <gtk/gtktooltip.h>

G_BEGIN_DECLS

#define GTK_TYPE_ICON_VIEW            (gtk_icon_view_get_type ())
#define GTK_ICON_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
#define GTK_ICON_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
#define GTK_IS_ICON_VIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW))
#define GTK_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
#define GTK_ICON_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))

typedef struct _GtkIconView           GtkIconView;
typedef struct _GtkIconViewClass      GtkIconViewClass;
typedef struct _GtkIconViewPrivate    GtkIconViewPrivate;

/**
 * GtkIconViewForeachFunc:
 * @icon_view: a #GtkIconView
 * @path: The #GtkTreePath of a selected row
 * @data: user data
 *
 * A function used by gtk_icon_view_selected_foreach() to map all
 * selected rows.  It will be called on every selected row in the view.
 */
typedef void (* GtkIconViewForeachFunc)     (GtkIconView      *icon_view,
					     GtkTreePath      *path,
					     gpointer          data);

/**
 * GtkIconViewDropPosition:
 * @GTK_ICON_VIEW_NO_DROP: no drop possible
 * @GTK_ICON_VIEW_DROP_INTO: dropped item replaces the item
 * @GTK_ICON_VIEW_DROP_LEFT: droppped item is inserted to the left
 * @GTK_ICON_VIEW_DROP_RIGHT: dropped item is inserted to the right
 * @GTK_ICON_VIEW_DROP_ABOVE: dropped item is inserted above
 * @GTK_ICON_VIEW_DROP_BELOW: dropped item is inserted below
 *
 * An enum for determining where a dropped item goes.
 */
typedef enum
{
  GTK_ICON_VIEW_NO_DROP,
  GTK_ICON_VIEW_DROP_INTO,
  GTK_ICON_VIEW_DROP_LEFT,
  GTK_ICON_VIEW_DROP_RIGHT,
  GTK_ICON_VIEW_DROP_ABOVE,
  GTK_ICON_VIEW_DROP_BELOW
} GtkIconViewDropPosition;

struct _GtkIconView
{
  GtkContainer parent;

  /*< private >*/
  GtkIconViewPrivate *priv;
};

struct _GtkIconViewClass
{
  GtkContainerClass parent_class;

  void    (* item_activated)         (GtkIconView      *icon_view,
				      GtkTreePath      *path);
  void    (* selection_changed)      (GtkIconView      *icon_view);

  /* Key binding signals */
  void    (* select_all)             (GtkIconView      *icon_view);
  void    (* unselect_all)           (GtkIconView      *icon_view);
  void    (* select_cursor_item)     (GtkIconView      *icon_view);
  void    (* toggle_cursor_item)     (GtkIconView      *icon_view);
  gboolean (* move_cursor)           (GtkIconView      *icon_view,
				      GtkMovementStep   step,
				      gint              count);
  gboolean (* activate_cursor_item)  (GtkIconView      *icon_view);

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
};

GDK_AVAILABLE_IN_ALL
GType          gtk_icon_view_get_type          (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkWidget *    gtk_icon_view_new               (void);
GDK_AVAILABLE_IN_ALL
GtkWidget *    gtk_icon_view_new_with_area     (GtkCellArea    *area);
GDK_AVAILABLE_IN_ALL
GtkWidget *    gtk_icon_view_new_with_model    (GtkTreeModel   *model);

GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_model         (GtkIconView    *icon_view,
 					        GtkTreeModel   *model);
GDK_AVAILABLE_IN_ALL
GtkTreeModel * gtk_icon_view_get_model         (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_text_column   (GtkIconView    *icon_view,
	 	 			        gint            column);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_text_column   (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_markup_column (GtkIconView    *icon_view,
					        gint            column);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_markup_column (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_pixbuf_column (GtkIconView    *icon_view,
					        gint            column);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_pixbuf_column (GtkIconView    *icon_view);

GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_item_orientation (GtkIconView    *icon_view,
                                                   GtkOrientation  orientation);
GDK_AVAILABLE_IN_ALL
GtkOrientation gtk_icon_view_get_item_orientation (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_columns       (GtkIconView    *icon_view,
		 			        gint            columns);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_columns       (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_item_width    (GtkIconView    *icon_view,
					        gint            item_width);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_item_width    (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_spacing       (GtkIconView    *icon_view,
		 			        gint            spacing);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_spacing       (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_row_spacing   (GtkIconView    *icon_view,
					        gint            row_spacing);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_row_spacing   (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_column_spacing (GtkIconView    *icon_view,
					        gint            column_spacing);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_column_spacing (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_margin        (GtkIconView    *icon_view,
					        gint            margin);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_margin        (GtkIconView    *icon_view);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_item_padding  (GtkIconView    *icon_view,
					        gint            item_padding);
GDK_AVAILABLE_IN_ALL
gint           gtk_icon_view_get_item_padding  (GtkIconView    *icon_view);

GDK_AVAILABLE_IN_ALL
GtkTreePath *  gtk_icon_view_get_path_at_pos   (GtkIconView     *icon_view,
						gint             x,
						gint             y);
GDK_AVAILABLE_IN_ALL
gboolean       gtk_icon_view_get_item_at_pos   (GtkIconView     *icon_view,
						gint              x,
						gint              y,
						GtkTreePath     **path,
						GtkCellRenderer **cell);
GDK_AVAILABLE_IN_ALL
gboolean       gtk_icon_view_get_visible_range (GtkIconView      *icon_view,
						GtkTreePath     **start_path,
						GtkTreePath     **end_path);
GDK_AVAILABLE_IN_3_8
void           gtk_icon_view_set_activate_on_single_click (GtkIconView  *icon_view,
                                                           gboolean      single);
GDK_AVAILABLE_IN_3_8
gboolean       gtk_icon_view_get_activate_on_single_click (GtkIconView  *icon_view);

GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
						 GtkIconViewForeachFunc  func,
						 gpointer                data);
GDK_AVAILABLE_IN_ALL
void           gtk_icon_view_set_selection_mode (GtkIconView            *icon_view,
						 GtkSelectionMode        mode);
GDK_AVAILABLE_IN_ALL
GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView            *icon_view);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_select_path        (GtkIconView            *icon_view,
						   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
						   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
						   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
gint             gtk_icon_view_get_item_row       (GtkIconView            *icon_view,
                                                   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
gint             gtk_icon_view_get_item_column    (GtkIconView            *icon_view,
                                                   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
GList           *gtk_icon_view_get_selected_items (GtkIconView            *icon_view);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_select_all         (GtkIconView            *icon_view);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_unselect_all       (GtkIconView            *icon_view);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_item_activated     (GtkIconView            *icon_view,
						   GtkTreePath            *path);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_set_cursor         (GtkIconView            *icon_view,
						   GtkTreePath            *path,
						   GtkCellRenderer        *cell,
						   gboolean                start_editing);
GDK_AVAILABLE_IN_ALL
gboolean         gtk_icon_view_get_cursor         (GtkIconView            *icon_view,
						   GtkTreePath           **path,
						   GtkCellRenderer       **cell);
GDK_AVAILABLE_IN_ALL
void             gtk_icon_view_scroll_to_path     (GtkIconView            *icon_view,
                                                   GtkTreePath            *path,
						   gboolean                use_align,
						   gfloat                  row_align,
                                                   gfloat                  col_align);

/* Drag-and-Drop support */
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_enable_model_drag_source (GtkIconView              *icon_view,
							       GdkModifierType           start_button_mask,
							       const GtkTargetEntry     *targets,
							       gint                      n_targets,
							       GdkDragAction             actions);
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_enable_model_drag_dest   (GtkIconView              *icon_view,
							       const GtkTargetEntry     *targets,
							       gint                      n_targets,
							       GdkDragAction             actions);
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_unset_model_drag_source  (GtkIconView              *icon_view);
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_unset_model_drag_dest    (GtkIconView              *icon_view);
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_set_reorderable          (GtkIconView              *icon_view,
							       gboolean                  reorderable);
GDK_AVAILABLE_IN_ALL
gboolean               gtk_icon_view_get_reorderable          (GtkIconView              *icon_view);

/* These are useful to implement your own custom stuff. */
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_set_drag_dest_item       (GtkIconView              *icon_view,
							       GtkTreePath              *path,
							       GtkIconViewDropPosition   pos);
GDK_AVAILABLE_IN_ALL
void                   gtk_icon_view_get_drag_dest_item       (GtkIconView              *icon_view,
							       GtkTreePath             **path,
							       GtkIconViewDropPosition  *pos);
GDK_AVAILABLE_IN_ALL
gboolean               gtk_icon_view_get_dest_item_at_pos     (GtkIconView              *icon_view,
							       gint                      drag_x,
							       gint                      drag_y,
							       GtkTreePath             **path,
							       GtkIconViewDropPosition  *pos);
GDK_AVAILABLE_IN_ALL
cairo_surface_t       *gtk_icon_view_create_drag_icon         (GtkIconView              *icon_view,
							       GtkTreePath              *path);

GDK_AVAILABLE_IN_ALL
void    gtk_icon_view_convert_widget_to_bin_window_coords     (GtkIconView *icon_view,
                                                               gint         wx,
                                                               gint         wy,
                                                               gint        *bx,
                                                               gint        *by);
GDK_AVAILABLE_IN_3_6
gboolean gtk_icon_view_get_cell_rect                          (GtkIconView     *icon_view,
							       GtkTreePath     *path,
							       GtkCellRenderer *cell,
							       GdkRectangle    *rect);

GDK_AVAILABLE_IN_ALL
void    gtk_icon_view_set_tooltip_item                        (GtkIconView     *icon_view,
                                                               GtkTooltip      *tooltip,
                                                               GtkTreePath     *path);
GDK_AVAILABLE_IN_ALL
void    gtk_icon_view_set_tooltip_cell                        (GtkIconView     *icon_view,
                                                               GtkTooltip      *tooltip,
                                                               GtkTreePath     *path,
                                                               GtkCellRenderer *cell);
GDK_AVAILABLE_IN_ALL
gboolean gtk_icon_view_get_tooltip_context                    (GtkIconView       *icon_view,
                                                               gint              *x,
                                                               gint              *y,
                                                               gboolean           keyboard_tip,
                                                               GtkTreeModel     **model,
                                                               GtkTreePath      **path,
                                                               GtkTreeIter       *iter);
GDK_AVAILABLE_IN_ALL
void     gtk_icon_view_set_tooltip_column                     (GtkIconView       *icon_view,
                                                               gint               column);
GDK_AVAILABLE_IN_ALL
gint     gtk_icon_view_get_tooltip_column                     (GtkIconView       *icon_view);

G_END_DECLS

#endif /* __GTK_ICON_VIEW_H__ */


text:
package com.updateimpact.report;

import java.io.*;

public class ModuleIvyReport {
    private final DependencyId moduleId;
    private final String config;
    private final String ivyReport;

    public ModuleIvyReport(DependencyId moduleId, String config, String ivyReport) {
        this.moduleId = moduleId;
        this.config = config;
        this.ivyReport = ivyReport;
    }

    public DependencyId getModuleId() {
        return moduleId;
    }

    public String getConfig() {
        return config;
    }

    public String getIvyReport() {
        return ivyReport;
    }

    public static ModuleIvyReport newWithReport(DependencyId moduleId, String config, File report) throws IOException {
        return new ModuleIvyReport(moduleId, config, readFile(report));
    }

    private static String readFile(File f) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(f));
        try {
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();

            while (line != null) {
                sb.append(line);
                sb.append(System.lineSeparator());
                line = br.readLine();
            }
            return sb.toString();
        } finally {
            br.close();
        }
    }

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

        ModuleIvyReport that = (ModuleIvyReport) o;

        if (moduleId != null ? !moduleId.equals(that.moduleId) : that.moduleId != null) return false;
        if (config != null ? !config.equals(that.config) : that.config != null) return false;
        return !(ivyReport != null ? !ivyReport.equals(that.ivyReport) : that.ivyReport != null);

    }

    @Override
    public int hashCode() {
        int result = moduleId != null ? moduleId.hashCode() : 0;
        result = 31 * result + (config != null ? config.hashCode() : 0);
        result = 31 * result + (ivyReport != null ? ivyReport.hashCode() : 0);
        return result;
    }
}


text:
package org.apache.spark.api.java.function;

import java.io.Serializable;

import scala.Tuple2;

/**
 * A function that returns zero or more key-value pair records from each input record. The
 * key-value pairs are represented as scala.Tuple2 objects.
 */
public interface PairFlatMapFunction<T, K, V> extends Serializable {
  public Iterable<Tuple2<K, V>> call(T t) throws Exception;
}


text:
package com.limitx;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

/**
 * Created by root on 2018/1/23.
 */

public class MVPPresenter implements MVPContract.Presenter {

    public MVPPresenter(@Nullable String taskId, //@NonNull TasksDataSource tasksRepository,
                        @NonNull MVPContract.View addTaskView, boolean shouldLoadDataFromRepo) {
        /*mTaskId = taskId;
        mTasksRepository = checkNotNull(tasksRepository);
        mAddTaskView = checkNotNull(addTaskView);
        mIsDataMissing = shouldLoadDataFromRepo;

        mAddTaskView.setPresenter(this);*/
    }

    @Override
    public void start() {
        /*if (!isNewTask() && mIsDataMissing) {
            populateTask();
        }*/
    }

    @Override
    public void populateTask() {
        /*if (isNewTask()) {
            throw new RuntimeException("populateTask() was called but task is new.");
        }
        mTasksRepository.getTask(mTaskId, this);*/
    }

    @Override
    public void saveTask(String title, String description) {
        /*if (isNewTask()) {
            createTask(title, description);
        } else {
            updateTask(title, description);
        }*/
    }

    @Override
    public boolean isDataMissing() {
        return false;//mIsDataMissing;
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var rule_1 = require("../rule/rule");
var WalkContext = /** @class */ (function () {
    function WalkContext(sourceFile, ruleName, options) {
        this.sourceFile = sourceFile;
        this.ruleName = ruleName;
        this.options = options;
        this.failures = [];
    }
    /** Add a failure with any arbitrary span. Prefer `addFailureAtNode` if possible. */
    WalkContext.prototype.addFailureAt = function (start, width, failure, fix) {
        this.addFailure(start, start + width, failure, fix);
    };
    WalkContext.prototype.addFailure = function (start, end, failure, fix) {
        var fileLength = this.sourceFile.end;
        this.failures.push(new rule_1.RuleFailure(this.sourceFile, Math.min(start, fileLength), Math.min(end, fileLength), failure, this.ruleName, fix));
    };
    /** Add a failure using a node's span. */
    WalkContext.prototype.addFailureAtNode = function (node, failure, fix) {
        this.addFailure(node.getStart(this.sourceFile), node.getEnd(), failure, fix);
    };
    return WalkContext;
}());
exports.WalkContext = WalkContext;


text:
// The XlaDevice executes a TensorFlow graph using the XLA linear algebra
// runtime.
//
// Operators assigned to an XlaDevice are compiled into XLA computations.
// Tensors on an XlaDevice are thin wrappers around XLA GlobalDataHandles; state
// is managed by XLA.
//
// XlaDevice is instantiated separately for each XLA backend (e.g., CPU or GPU),
// under different names (e.g., XLA_CPU or XLA_GPU).

#ifndef TENSORFLOW_COMPILER_JIT_XLA_DEVICE_H_
#define TENSORFLOW_COMPILER_JIT_XLA_DEVICE_H_

#include "tensorflow/compiler/jit/xla_tensor.h"
#include "tensorflow/compiler/tf2xla/xla_op_registry.h"
#include "tensorflow/compiler/xla/client/local_client.h"
#include "tensorflow/core/common_runtime/device_factory.h"
#include "tensorflow/core/common_runtime/local_device.h"
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/device_base.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/resource_mgr.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/platform/stream_executor_no_cuda.h"

namespace tensorflow {

class XlaDevice : public LocalDevice {
 public:
  // Wrapper class to store metadata about the XlaDevice, where it can be
  // retrieved e.g., when lazily creating the XlaCompilationCache device.
  class Metadata {
   public:
    Metadata(int device_ordinal, perftools::gputools::Platform* platform,
             const DeviceType& device_type);

    // The index of the device on this host.
    int device_ordinal() const;

    perftools::gputools::Platform* platform() const;
    xla::LocalClient* client() const;
    const DeviceType& jit_device_type() const;

   private:
    const int device_ordinal_;
    const DeviceType device_type_;
    perftools::gputools::Platform* platform_;  // Not owned.

    TF_DISALLOW_COPY_AND_ASSIGN(Metadata);
  };

  // Sets `*metadata` to the XlaDevice Metadata in the XLA device used by `ctx`.
  static Status GetMetadata(OpKernelContext* ctx, const Metadata** metadata);

  // Factory function. 'platform_name' is the name of the XLA platform.
  // 'device_name' is the name of the Tensorflow device to create.
  // 'jit_device_name' is the name of the corresponding JIT device.
  // 'transfer_as_literal' is true if device<->host transfers must be done using
  // XLA's TransferLiteral{To,From}Device interface. If false, we can use
  // ThenMemcpy instead.
  static Status Create(const string& platform_name, const string& device_name,
                       int device_ordinal, const string& jit_device_name,
                       const SessionOptions& options, const string& name_prefix,
                       const XlaOpRegistry::DeviceRegistration& registration,
                       bool transfer_as_literal,
                       std::unique_ptr<XlaDevice>* device);

  XlaDevice(const SessionOptions& options, const DeviceAttributes& attrs,
            int device_ordinal, const DeviceType& jit_device_name,
            ::perftools::gputools::Platform* platform,
            bool transfer_as_literal);
  ~XlaDevice() override;

  Allocator* GetAllocator(AllocatorAttributes attr) override;
  void Compute(OpKernel* op_kernel, OpKernelContext* context) override;
  void ComputeAsync(AsyncOpKernel* op_kernel, OpKernelContext* context,
                    AsyncOpKernel::DoneCallback done) override;
  Status Sync() override { return Status::OK(); }

  Status FillContextMap(const Graph* graph,
                        DeviceContextMap* device_context_map) override;

  Status MakeTensorFromProto(const TensorProto& tensor_proto,
                             const AllocatorAttributes alloc_attrs,
                             Tensor* tensor) override;

  xla::LocalClient* client() const;
  xla::StatusOr<::perftools::gputools::Stream*> GetStream();

 private:
  // The metadata of this XlaDevice.
  const Metadata xla_metadata_;
  // Which hardware device in the client's platform this XlaDevice controls.
  const int device_ordinal_;
  // The name of the device that is used to compile Ops for this XlaDevice.
  DeviceType jit_device_name_;
  // Memory allocator associated with this device.
  Allocator* xla_allocator_;                   // Not owned.
  ::perftools::gputools::Platform* platform_;  // Not owned.
  // Stream associated with this device. Operations enqueued on this
  // stream are executed on the device. Operations include data
  // copying back and forth between CPU and the device, and
  // computations enqueued by XLA.
  xla::Backend::StreamPtr stream_;
  // Must we use XLA's transfer manager for correct host<->device transfers? if
  // false, we can use ThenMemcpy() instead.
  bool transfer_as_literal_;
};

// Builds OpKernel registrations on 'device' for the JIT operators
// registered on 'jit_device'. Returns ownership of a XlaDeviceOpRegistrations
// object that encapsulates the kernel registrations.
struct XlaDeviceOpRegistrations {
  std::vector<std::unique_ptr<kernel_factory::OpKernelRegistrar>>
      op_kernel_registrars;
};
XlaDeviceOpRegistrations* RegisterXlaDeviceKernels(const char* device,
                                                   const char* jit_device);

}  // namespace tensorflow

#endif  // TENSORFLOW_COMPILER_JIT_XLA_DEVICE_H_


text:
import nanoModal from 'nanomodal'
import t from 't-component'
import merge from 'mout/object/merge'
import { domRender } from '../render/render'
import template from './template.jade'

const defaultOptions = {
  text: t('modals.error.default'),
  closeText: t('common.ok')
}

export default function error (options = {}) {
  if (options instanceof Error || typeof options === 'string') {
    options = { text: options.toString() }
  }

  const opts = merge(defaultOptions, options)
  const el = domRender(template, opts)

  const modal = nanoModal(el, {
    classes: 'modals modals-confirm',
    buttons: [{
      text: opts.closeText,
      classes: 'btn btn-default',
      handler: 'hide'
    }],
    autoRemove: true,
    overlayClose: true
  })

  modal.show()

  return modal
}


text:
var query = function(key, polygons, query) {
  // console.log("Trying the query from the data: ", query, 'against:', polygons, 'with key', key);
  var screen_left = parseFloat(query[0]);
  var screen_right = parseFloat(query[1]);
  var screen_bottom = parseFloat(query[2]);
  var screen_top = parseFloat(query[3]);
  var matches = [];
  for (var i=0; i<polygons.length; i++) {
    var polygon = polygons[i];
    if (
      (
           ((screen_left <    polygon.left)    && (screen_right >  polygon.left))
        || ((screen_left <    polygon.right)   && (screen_right >  polygon.right))
        || ((screen_left >=   polygon.left)    && (screen_right <= polygon.right))
      ) && (
           ((screen_bottom <  polygon.bottom)  && (screen_top >    polygon.bottom))
        || ((screen_bottom <  polygon.top)     && (screen_top >    polygon.top))
        || ((screen_bottom >= polygon.bottom)  && (screen_top <=   polygon.top))
      )
    ) {
      matches.push(polygon[key]);
    }
  }
  return matches;
};

var bboxToFloat = function(key, polygons) {
  var result = [];
  for (var i=0; i<polygons.length; i++) {
    var polygon = {
      left: polygons[i].left,
      right: polygons[i].right,
      top: polygons[i].top,
      bottom: polygons[i].bottom,
    };
    polygon[key] = polygons[i][key];

    if (typeof polygon.left !== "number" && typeof polygon.left !== "string") {
      throw 'Unknown value "'+polygon.left+'" for "left" in row '+i;
    }
    if (typeof polygon.right !== "number" && typeof polygon.right !== "string") {
      throw 'Unknown value "'+polygon.right+'" for "right" in row '+i;
    }
    if (typeof polygon.top !== "number" && typeof polygon.top !== "string") {
      throw 'Unknown value "'+polygon.top+'" for "top" in row '+i;
    }
    if (typeof polygon.bottom !== "string" && typeof polygon.bottom !== "string") {
      throw 'Unknown value "'+polygon.bottom+'" for "bottom" in row '+i;
    }
    polygon.left = parseFloat(polygon.left);
    polygon.right = parseFloat(polygon.right);
    polygon.top = parseFloat(polygon.top);
    polygon.bottom = parseFloat(polygon.bottom);
    result.push(polygon);
  }
  return result;
};

module.exports = {
  bboxQuery: query,
  bboxToFloat: bboxToFloat
};


text:
The Code42 Exfiltration playbook acts on Code42 Security Alerts, retrieves file event data, and allows security teams to remediate file exfiltration events by revoking access rights to cloud files or containing endpoints.

## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.

### Sub-playbooks
* Active Directory - Get User Manager Details

### Integrations
* jira-v2
* CrowdstrikeFalcon

### Scripts
This playbook does not use any scripts.

### Commands
* send-mail
* closeInvestigation
* jira-create-issue
* cs-falcon-search-device
* code42-alert-resolve
* cs-falcon-contain-host

## Playbook Inputs
---

| **Name** | **Description** | **Default Value** | **Required** |
| --- | --- | --- | --- |
| JiraProject | Jira Project for created incident ticket | Security | Optional |
| JiraType | Type of Jira ticket to create | Investigation | Optional |
| JiraSummary | Summary to use with Jira ticket creation | Code42 Security Alert for Cortex XSOAR Incident ${incident.id} | Optional |
| ContainHostsMax | Maximum number of network hosts to contain. | 2 | Optional |
| DemistoInstanceURL | URL of Demisto instance for emails. | https://example.com/ | Optional |

## Playbook Outputs
---
There are no outputs for this playbook.

## Playbook Image
---
![Code42 Exfiltration Playbook](https://raw.githubusercontent.com/demisto/content/dd418027433970a18ce06ebef97933c70a92a940/Packs/Code42/doc_files/Code42_Exfiltration_Playbook.png)


text:
package org.turbogwt.net.http.client.books;

import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.junit.client.GWTTestCase;

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

import org.turbogwt.core.future.shared.DoneCallback;
import org.turbogwt.net.http.client.Requestor;
import org.turbogwt.net.http.client.RequestorImpl;
import org.turbogwt.net.http.client.header.ContentTypeHeader;
import org.turbogwt.net.http.client.mock.ResponseMock;
import org.turbogwt.net.http.client.mock.ServerStub;

/**
 * @author Danilo Reinert
 */
public class RestTest extends GWTTestCase {

    @Override
    public String getModuleName() {
        return "org.turbogwt.net.http.HttpTest";
    }

    public void testCreate() {
        ServerStub.clearStub();

        final Requestor requestor = new RequestorImpl();
        requestor.registerSerdes(Book.class, BookJsonSerdes.getInstance());

        final String uri = "/server/books";

        ServerStub.responseFor(uri, ResponseMock.of(null, 200, "OK", new ContentTypeHeader("application/json")));

        final String expected = "{\"id\":1,\"title\":\"RESTful Web Services\",\"author\":\"Leonard Richardson\"}";

        final boolean[] callbacksCalled = new boolean[1];
        final Book data = new Book(1, "RESTful Web Services", "Leonard Richardson");

        requestor.request(uri).payload(data).post().done(new DoneCallback<Void>() {
            @Override
            public void onDone(Void aVoid) {
                callbacksCalled[0] = true;
            }
        });
        ServerStub.triggerPendingRequest();

        assertTrue(callbacksCalled[0]);
        assertEquals(expected, ServerStub.getRequestData(uri).getData());
        assertEquals(RequestBuilder.POST, ServerStub.getRequestData(uri).getMethod());
    }

    public void testDelete() {
        ServerStub.clearStub();

        final Requestor requestor = new RequestorImpl();

        final String uri = "/server/books/1";

        ServerStub.responseFor(uri, ResponseMock.of(null, 200, "OK", new ContentTypeHeader("application/json")));

        requestor.request(uri).delete(); // You can optionally dismiss any server response
        ServerStub.triggerPendingRequest();

        assertEquals(RequestBuilder.DELETE, ServerStub.getRequestData(uri).getMethod());
    }

    public void testGetAll() {
        ServerStub.clearStub();

        final Requestor requestor = new RequestorImpl();
        requestor.registerSerdes(Book.class, BookJsonSerdes.getInstance());

        final String uri = "/server/books";

      final String responseText = "[{\"id\":1, \"title\":\"RESTful Web Services\", \"author\":\"Leonard Richardson\"}"
                + ", {\"id\":2, \"title\":\"Agile Software Development: Principles, Patterns, and Practices\", "
                + "\"author\":\"Robert C. Martin\"}]";
        ServerStub.responseFor(uri, ResponseMock.of(responseText, 200, "OK",
                new ContentTypeHeader("application/json")));

        final List<Book> expected = new ArrayList<>(2);
        expected.add(new Book(1, "RESTful Web Services", "Leonard Richardson"));
        expected.add(new Book(2, "Agile Software Development: Principles, Patterns, and Practices",
                "Robert C. Martin"));

        final boolean[] callbacksCalled = new boolean[1];

        requestor.request(uri).get(Book.class, List.class).done(new DoneCallback<Collection<Book>>() {
            @Override
            public void onDone(Collection<Book> books) {
                callbacksCalled[0] = true;
                assertEquals(expected, books);
            }
        });
        ServerStub.triggerPendingRequest();

        assertTrue(callbacksCalled[0]);
        assertEquals(RequestBuilder.GET, ServerStub.getRequestData(uri).getMethod());
    }

    public void testGetOne() {
        ServerStub.clearStub();

        final Requestor requestor = new RequestorImpl();
        requestor.registerSerdes(Book.class, BookJsonSerdes.getInstance());

        final String uri = "/server/books/1";

      final String responseText = "{\"id\":1, \"title\":\"RESTful Web Services\", \"author\":\"Leonard Richardson\"}";
        ServerStub.responseFor(uri, ResponseMock.of(responseText, 200, "OK",
                new ContentTypeHeader("application/json")));

        final Book expected = new Book(1, "RESTful Web Services", "Leonard Richardson");

        final boolean[] callbacksCalled = new boolean[1];

        requestor.request(uri).get(Book.class).done(new DoneCallback<Book>() {
            @Override
            public void onDone(Book book) {
                callbacksCalled[0] = true;
                assertEquals(expected, book);
            }
        });
        ServerStub.triggerPendingRequest();

        assertTrue(callbacksCalled[0]);
        assertEquals(RequestBuilder.GET, ServerStub.getRequestData(uri).getMethod());
    }

    public void testUpdate() {
        ServerStub.clearStub();

        final Requestor requestor = new RequestorImpl();
        requestor.registerSerdes(Book.class, BookJsonSerdes.getInstance());

        final String uri = "/server/books/1";

        ServerStub.responseFor(uri, ResponseMock.of(null, 200, "OK", new ContentTypeHeader("application/json")));

        final String expected = "{\"id\":1,\"title\":\"RESTful Web Services\",\"author\":\"Leonard Richardson\"}";

        final boolean[] callbacksCalled = new boolean[1];
        final Book data = new Book(1, "RESTful Web Services", "Leonard Richardson");

        requestor.request(uri).payload(data).put().done(new DoneCallback<Void>() {
            @Override
            public void onDone(Void result) {
                callbacksCalled[0] = true;
            }
        });
        ServerStub.triggerPendingRequest();

        assertTrue(callbacksCalled[0]);
        assertEquals(expected, ServerStub.getRequestData(uri).getData());
        assertEquals(RequestBuilder.PUT, ServerStub.getRequestData(uri).getMethod());
    }
}


text:
case node['platform']
when 'windows'

  require 'chef/win32/version'
  windows_version = Chef::ReservedNames::Win32::Version.new

  if (windows_version.windows_server_2012? || windows_version.windows_8?) && windows_version.core?
    # Windows Server 2012 Core does not come with Powershell 2.0 enabled

    windows_feature 'MicrosoftWindowsPowerShellV2' do
      action :install
    end
    windows_feature 'MicrosoftWindowsPowerShellV2-WOW64' do
      action :install
      only_if { node['kernel']['machine'] == 'x86_64' }
    end

  elsif (windows_version.windows_server_2008_r2? || windows_version.windows_7?) && windows_version.core?
    # Windows Server 2008 R2 Core does not come with .NET or Powershell 2.0 enabled

    windows_feature 'NetFx2-ServerCore' do
      action :install
    end
    windows_feature 'NetFx2-ServerCore-WOW64' do
      action :install
      only_if { node['kernel']['machine'] == 'x86_64' }
    end
    windows_feature 'MicrosoftWindowsPowerShell' do
      action :install
    end
    windows_feature 'MicrosoftWindowsPowerShell-WOW64' do
      action :install
      only_if { node['kernel']['machine'] == 'x86_64' }
    end

  elsif windows_version.windows_server_2008? || windows_version.windows_server_2003_r2? ||
        windows_version.windows_server_2003? || windows_version.windows_xp?

    include_recipe 'ms_dotnet2'

    windows_package 'Windows Management Framework Core' do
      source node['powershell']['powershell2']['url']
      checksum node['powershell']['powershell2']['checksum']
      installer_type :custom
      options '/quiet /norestart'
      action :install
      not_if do
        begin
          registry_data_exists?('HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine', { :name => 'PowerShellVersion', :type => :string, :data => '2.0' })
        rescue Chef::Exceptions::Win32RegKeyMissing
          false
        end
      end
    end
  else
    Chef::Log.warn("PowerShell 2.0 is not supported or already installed on this version of Windows: #{node['platform_version']}")
  end
else
  Chef::Log.warn('PowerShell 2.0 can only be installed on the Windows platform.')
end


text:
module.exports = function(config) {

    'use strict';

    config.set({

        basePath: './',

        browsers: ['PhantomJS'],

        frameworks: ['jasmine', 'requirejs'],

        files: [
            'test/config.js',
            {pattern: 'src/**/*.js', included: false, watched: true},
            {pattern: 'test/**/*.js', included: false, watched: true}
        ],

        autoWatch: true,
        singleRun: false,
        captureTimeout: 120000,

        reporters: ['story']

    });
};


text:
package org.gaurav.webapp.dto;

public class MailContent {

	private String recipient;
	private String subject;
	private String body;
	private String sender;

	public MailContent(String recipient, String subject, String body) {
		this.recipient = recipient;
		this.subject = subject;
		this.body = body;
	}

	public MailContent(String recipient, String subject, String body,
			String sender) {
		super();
		this.recipient = recipient;
		this.subject = subject;
		this.body = body;
		this.sender = sender;
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

}


text:
"""The package indicator for Fusion serving backend (wsgi.fusion).

The Fusion serving backend contains modules for serving Fusion functionality.
"""


text:
<?xml version="1.0"?>
<ProcessHandle Version="1" Minor="0">
    <Process Command="vivado" Owner="thomas" Host="localhost.localdomain" Pid="10863">
    </Process>
</ProcessHandle>


text:
// ReSharper disable InconsistentNaming
using System.Collections.Generic;
using System;
using System.Threading.Tasks;
using EasyNetQ.AutoSubscribe;
using EasyNetQ.Tests.Mocking;
using NUnit.Framework;
using RabbitMQ.Client;
using Rhino.Mocks;

namespace EasyNetQ.Tests.AutoSubscriberTests
{
    [TestFixture]
    public class When_autosubscribing
    {
        private MockBuilder mockBuilder;

        private const string expectedQueueName1 =
            "EasyNetQ.Tests.AutoSubscriberTests.When_autosubscribing+MessageA:EasyNetQ.Tests_my_app:d7617d39b90b6b695b90c630539a12e2";

        private const string expectedQueueName2 =
            "EasyNetQ.Tests.AutoSubscriberTests.When_autosubscribing+MessageB:EasyNetQ.Tests_MyExplicitId";

        private const string expectedQueueName3 =
            "EasyNetQ.Tests.AutoSubscriberTests.When_autosubscribing+MessageC:EasyNetQ.Tests_my_app:8b7980aa5e42959b4202e32ee442fc52";

        [SetUp]
        public void SetUp()
        {
            mockBuilder = new MockBuilder();
//            mockBuilder = new MockBuilder(x => x.Register<IEasyNetQLogger, ConsoleLogger>());

            var autoSubscriber = new AutoSubscriber(mockBuilder.Bus, "my_app");

            autoSubscriber.Subscribe(typeof(MyAsyncConsumer), typeof(MyConsumer), typeof(MyGenericAbstractConsumer<>));
        }

        [Test]
        public void Should_have_declared_the_queues()
        {
            Action<string> assertQueueDeclared = queueName =>
                mockBuilder.Channels[0].AssertWasCalled(x => x.QueueDeclare(
                    Arg<string>.Is.Equal(queueName),
                    Arg<bool>.Is.Equal(true),
                    Arg<bool>.Is.Equal(false),
                    Arg<bool>.Is.Equal(false),
                    Arg<IDictionary<string, object>>.Is.Anything
                    ));

            assertQueueDeclared(expectedQueueName1);
            assertQueueDeclared(expectedQueueName2);
            assertQueueDeclared(expectedQueueName3);
        }

        [Test]
        public void Should_have_bound_to_queues()
        {
            Action<int, string, string> assertConsumerStarted = (channelIndex, queueName, topicName) =>
                                                        mockBuilder.Channels[0].AssertWasCalled(x =>
                                                x.QueueBind(
                                                Arg<string>.Is.Equal(queueName),
                                                Arg<string>.Is.Anything,
                                                Arg<string>.Is.Equal(topicName))
                                                );

            assertConsumerStarted(1, expectedQueueName1, "#");
            assertConsumerStarted(2, expectedQueueName2, "#");
            assertConsumerStarted(3, expectedQueueName3, "Important");
        }

        [Test]
        public void Should_have_started_consuming_from_the_correct_queues()
        {
            mockBuilder.ConsumerQueueNames.Contains(expectedQueueName1).ShouldBeTrue();
            mockBuilder.ConsumerQueueNames.Contains(expectedQueueName2).ShouldBeTrue();
            mockBuilder.ConsumerQueueNames.Contains(expectedQueueName3).ShouldBeTrue();
        }

        // Discovered by reflection over test assembly, do not remove.
        private class MyConsumer : IConsume<MessageA>, IConsume<MessageB>, IConsume<MessageC>
        {
            public void Consume(MessageA message)
            {
            }

            [AutoSubscriberConsumer(SubscriptionId = "MyExplicitId")]
            public void Consume(MessageB message)
            {
            }

            [ForTopicAttribute("Important")]
            public void Consume(MessageC message)
            {
            }

        }

        //Discovered by reflection over test assembly, do not remove.
        private class MyAsyncConsumer : IConsumeAsync<MessageA>, IConsumeAsync<MessageB>, IConsumeAsync<MessageC>
        {
            public Task Consume(MessageA message)
            {
                throw new NotImplementedException();
            }

            [AutoSubscriberConsumer(SubscriptionId = "MyExplicitId")]
            public Task Consume(MessageB message)
            {
                throw new NotImplementedException();
            }

            public Task Consume(MessageC message)
            {
                throw new NotImplementedException();
            }
        }

        //Discovered by reflection over test assembly, do not remove.
        private abstract class MyGenericAbstractConsumer<TMessage> : IConsume<TMessage>
          where TMessage : class
        {
            public virtual void Consume(TMessage message)
            {
                throw new NotImplementedException();
            }
        }

        private class MessageA
        {
            public string Text { get; set; }
        }

        private class MessageB
        {
            public string Text { get; set; }
        }

        private class MessageC
        {
            public string Text { get; set; }
        }

    }
}

// ReSharper restore InconsistentNaming


text:
<Record>
<Term>Domoxin</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<ParentTerm>Monoamine Oxidase Inhibitor</ParentTerm>
<ClassificationPath>Chemicals_and_Drugs_Kind/Drug, Food, Chemical or Biomedical Material/Pharmacologic Substance/Enzyme Inhibitor/Monoamine Oxidase Inhibitor/Domoxin</ClassificationPath>
<BroaderTerm>Chemicals_and_Drugs_Kind</BroaderTerm>
<BroaderTerm>Enzyme Inhibitor</BroaderTerm>
<BroaderTerm>Pharmacologic Substance</BroaderTerm>
<BroaderTerm>Monoamine Oxidase Inhibitor</BroaderTerm>
<BroaderTerm>Domoxin</BroaderTerm>
<BroaderTerm>Drug, Food, Chemical or Biomedical Material</BroaderTerm>
<Synonym>DOMOXIN</Synonym>
<Synonym>Domoxin</Synonym>
<Source>NCI Thesaurus</Source>
</Record>