text:
var mimicry = mimicry || {};

mimicry.creator = (function() {

  var CONSTANTS = {
    minWordLength: 2,
    maxWordLength: 32,
    alphabets: {
      en: 'abcdefghijklmnopqrstuvwxyz',
      fi: 'abcdefghijklmnopqrstuvwxyzäö',
      se: 'abcdefghijklmnopqrstuvwxyzåäö'
    }
  };

  var setProbabilities = function(arr) {
    var sum = 0;
    arr.forEach(function(item) {
      sum += item.count;
    });
    arr.forEach(function(item) {
      item.prob = (item.count / sum) * 100;
    });
    return arr;
  };

  var calculateProbabilities = function(langData) {
    langData.wordSpec = setProbabilities(langData.wordSpec);
    langData.wordSpec.forEach(function(wordSpec) {
      wordSpec.startChars = setProbabilities(wordSpec.startChars);
    });
    langData.chars.forEach(function(charData) {
      charData.next = setProbabilities(charData.next);
    });
    return langData;
  };

  var processChar = function(char, langData, prevChar) {

    var charAdded = false;

    langData.chars.forEach(function(charData) {
      var nextCharAdded = false;

      if (charData.char === char) {
        charAdded = true;
      }

      if (prevChar === charData.char) {
        charData.next.forEach(function(nextChar) {
          if (nextChar.char === char) {
            nextChar.count += 1;
            nextCharAdded = true;
          }
        });
        if (!nextCharAdded) {
          charData.next.push({
            char: char,
            count: 1
          });
        }
      }
    });

    if (!charAdded) {
      langData.chars.push({
        char: char,
        next: []
      });
    }

    return langData;
  };

  var processWord = function(word, langData) {

    var wordSpecAdded = false,
      firstChar = word[0],
      prevChar = null;

    langData.wordSpec.forEach(function(spec) {

      var startCharAdded = false;

      if (spec.wordLength === word.length) {

        spec.startChars.forEach(function(startChar) {
          if (startChar.char === firstChar) {
            startChar.count += 1;
            startCharAdded = true;
          }
        });

        if (!startCharAdded) {
          spec.startChars.push({ char: firstChar, count: 1 });
        }

        spec.count += 1;
        wordSpecAdded = true;
      }
    });

    if (!wordSpecAdded) {
      langData.wordSpec.push({
        wordLength: word.length,
        count: 1,
        startChars: [{ char: firstChar, count: 1 }]
      });
    }

    word.split('').forEach(function(char) {
      if (char) {
        langData = processChar(char, langData, prevChar);
        prevChar = char;
      }
    });

    return langData;
  };

  var processRawText = function(text, langData) {

    var filteredText = '';

    text.split('').forEach(function(char) {
      if (_alphabet.indexOf(char) >= 0 || char === ' ') {
        filteredText += char;
      }
    });

    filteredText.split(' ').forEach(function(word) {
      if (word.length && word.length >= CONSTANTS.minWordLength && word.length <= CONSTANTS.maxWordLength) {
        langData = processWord(word, langData);
      }
    });

    return calculateProbabilities(langData);
  };

  var getLanguageData = function(rawText, alphabet) {
    _alphabet = alphabet ? CONSTANTS.alphabets[alphabet] : CONSTANTS.alphabets.en;
    return processRawText(rawText.toLowerCase(), {
      wordSpec: [],
      chars: []
    });
  };

  return {
    getAlphabets: function() { return CONSTANTS.alphabets; },
    getLanguageData: getLanguageData
  };

}());


text:
package de.lukweb.twitchchat;

import de.lukweb.twitchchat.events.EventManager;
import de.lukweb.twitchchat.twitch.TurboChat;

import java.util.function.Consumer;

public interface TwitchChat {

    /**
     * (Re-)Connects the chat instance with the Twitch IRC.
     * WARNING: Messages in cache may be purged.
     *
     * @return whether the connection attempt was successful
     */
    boolean connect();

    /**
     * Returns whether the client is connected to the Twitch server.
     *
     * @return whether connected to the Twitch server
     */
    boolean isConnected();

    /**
     * Returns the chat of a Twitch channel. When the irc client is already connected to the channel, if not the irc
     * clients connects to the channel and returns it.
     *
     * @param channel a Twitch channel name (without the leading #)
     * @return a Twitch channel
     */
    TwitchChannel getChannel(String channel);

    /**
     * Gets the username of the connected user
     *
     * @return username of the connected user
     */
    String getUsername();

    /**
     * Gets the event manager for registering, unregistering and calling events.
     *
     * @return the event manager
     */
    EventManager getEventManager();

    /**
     * Sends a raw message to the IRC. The message will be delayed if the
     * rate limit was hit.
     *
     * @param message the message to be sent
     */
    void sendRawMessage(String message);

    /**
     * Sends a raw message to the IRC. The message will be delayed if the
     * rate limit was hit.
     *
     * @param message  the message to be sent
     * @param operator whether the twitch client is a operator in this channel
     */
    void sendRawMessage(String message, boolean operator);

    /**
     * Sets a callback for handling warnings. Set it to null to set it to the default value.
     *
     * @param callback the callback for handling warnings
     */
    void setWarningOutput(Consumer<String> callback);

    /**
     * Method to (de)active the debug output of this libary
     *
     * @param debug wheater the mode should be activated
     */
    void setDebug(boolean debug);

    /**
     * Closes the connection to all channels and the irc. Use the method {@link TwitchChat#connect()} to connect again.
     */
    void close();

    /**
     * Initalizes the TwitchChatClient. To get an OAuth Password visit this
     * site. Call the method {@link TurboChat#connect()} to open a connection to the Twitch IRC.
     *
     * @param username The account's twitch username
     * @param oauthkey The OAuth Password of the account
     * @return A Twitch chat client
     */
    static TwitchChat build(String username, String oauthkey) {
        return new TurboChat(username, oauthkey);
    }
}

redpajama_set_name: RedPajamaGithub


text:
export * from './tag-input-event';
export * from './tag-input.component';
export * from './tag-input.module';


text:
package com.vanillaci.distributedinvoke;

import com.vanillaci.distributedinvoke.channels.ResultFuture;
import com.vanillaci.distributedinvoke.exceptions.NotEnoughExecutorsException;
import com.vanillaci.distributedinvoke.machines.Machine;
import com.vanillaci.distributedinvoke.machines.RemoteMachine;
import com.vanillaci.distributedinvoke.machines.RemoteMachineListener;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;

import java.io.IOException;
import java.io.Serializable;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.util.concurrent.Callable;

import static org.testng.Assert.*;

/**
 * User: Joel Johnson
 * Date: 3/2/13
 * Time: 12:35 PM
 */
public class CommunicationTest {
	private RemoteMachineListener listener;
	private Machine machine;

	@AfterMethod
	public void tearDownListener() throws IOException {
		if(listener != null) {
			listener.close();
		}
	}

	@AfterMethod
	public void tearDownMachine() throws IOException, InterruptedException {
		if(machine != null) {
			machine.close();
		}
	}

	@Test
	public void testBasic() throws Exception {
		InetAddress localHost = Inet4Address.getLocalHost();
		int listeningPort = 9191;

		listener = RemoteMachineListener.start(localHost, listeningPort);
		machine = RemoteMachine.connectToMachine("Test Machine", localHost, listeningPort, 1, "");

		assertEquals(machine.getAvailableExecutorCount(), 1);
		String invoke = machine.invoke(new MyCallable("Hello There"), 1);
		assertEquals(machine.getAvailableExecutorCount(), 1, "Available executor count should've been reset.");

		assertEquals(invoke, "Hello There");

		try {
			machine.invoke(new MyCallable("This is too heavy!"), 10);
			fail("Should throw " + NotEnoughExecutorsException.class.getCanonicalName());
		} catch (NotEnoughExecutorsException ignore) {}
	}

	@Test
	public void testAsync() throws Exception {
		InetAddress localHost = Inet4Address.getLocalHost();
		int listeningPort = 9191;

		listener = RemoteMachineListener.start(localHost, listeningPort);
		machine = RemoteMachine.connectToMachine("Test Machine", localHost, listeningPort, 1, "");

		assertEquals(machine.getAvailableExecutorCount(), 1);
		ResultFuture<String> future = machine.invokeAsync(new SlowCallable("Hello There", 100), 1);
		assertEquals(machine.getAvailableExecutorCount(), 0, "Available executor count should be zero");

		String result = future.waitForResult();

		assertEquals(result, "Hello There");
	}
}

class MyCallable implements Callable<String>, Serializable {
	private final String returnValue;
	public MyCallable(String returnValue) {

		this.returnValue = returnValue;
	}

	@Override
	public String call() throws Exception {
		return returnValue;
	}
}

class SlowCallable implements Callable<String>, Serializable {
	private final String returnValue;
	private final int speed;

	public SlowCallable(String returnValue, int speed) {
		this.returnValue = returnValue;
		this.speed = speed;
	}

	@Override
	public String call() throws Exception {
		Thread.sleep(speed);
		return returnValue;
	}
}


text:
"""Jobs that are run by CRON scheduler."""

from __future__ import annotations

from core.domain import blog_domain
from core.domain import blog_services
from core.domain import search_services
from core.jobs import base_jobs
from core.jobs.io import ndb_io
from core.jobs.transforms import job_result_transforms
from core.jobs.types import job_run_result
from core.platform import models

import apache_beam as beam
import result
from typing import Final, Iterable, List

MYPY = False
if MYPY: # pragma: no cover
    from mypy_imports import blog_models
    from mypy_imports import search_services as platform_search_services

(blog_models,) = models.Registry.import_models([models.Names.BLOG])

platform_search_services = models.Registry.import_search_services()

class IndexBlogPostsInSearchJob(base_jobs.JobBase):
    """Job that indexes the blog posts in Elastic Search."""

    MAX_BATCH_SIZE: Final = 1000

    def run(self) -> beam.PCollection[job_run_result.JobRunResult]:
        """Returns a PCollection of 'SUCCESS' or 'FAILURE' results from
        the Elastic Search.

        Returns:
            PCollection. A PCollection of 'SUCCESS' or 'FAILURE' results from
            the Elastic Search.
        """
        return (
            self.pipeline
            | 'Get all non-deleted models' >> (
                ndb_io.GetModels(
                    blog_models.BlogPostSummaryModel.get_all(
                        include_deleted=False
                    )
                ))
            | 'Convert BlogPostSummaryModels to domain objects' >> beam.Map(
                blog_services.get_blog_post_summary_from_model)
            | 'Split models into batches' >> beam.transforms.util.BatchElements(
                max_batch_size=self.MAX_BATCH_SIZE)
            | 'Index batches of models' >> beam.ParDo(
                IndexBlogPostSummaries())
            | 'Count the output' >> (
                job_result_transforms.ResultsToJobRunResults())
        )

# TODO(#15613): Here we use MyPy ignore because the incomplete typing of
# apache_beam library and absences of stubs in Typeshed, forces MyPy to
# assume that PTransform class is of type Any. Thus to avoid MyPy's error
# (Class cannot subclass 'PTransform' (has type 'Any')), we added an
# ignore here.
class IndexBlogPostSummaries(beam.DoFn): # type: ignore[misc]
    """DoFn to index blog post summaries."""

    def process(
        self, blog_post_summaries: List[blog_domain.BlogPostSummary]
    ) -> Iterable[result.Result[None, Exception]]:
        """Index blog post summaries and catch any errors.

        Args:
            blog_post_summaries: list(BlogPostSummaries). List of Blog Post
                Summary domain objects to be indexed.

        Yields:
            JobRunResult. List containing one element, which is either SUCCESS,
            or FAILURE.
        """
        try:
            search_services.index_blog_post_summaries(
                blog_post_summaries)
            for _ in blog_post_summaries:
                yield result.Ok()
        except platform_search_services.SearchException as e:
            yield result.Err(e)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
<title>WIMSE - rebeckaray.se</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

 rebeckaray.se

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        Toggle navigation

      </button>

WIMSE

Uppdateringar

Dina konton

Din hemsida

Skapa poster

Bilder

Markdown

Forum

WIMSE

WIMSE

rebeckaray.se

Uppdateringar

Dina konton

Din hemsida

Skapa poster

Bilder

Markdown

Forum

WIMSE

Chatta

Här kan du ställa frågor och diskutera din hemsida.
    För att kunna ta del, har vi registrerat dig för tjänsten Disqus.
    Logga in med hjälp av användarnamn:  och
    lösenordet:

**När du sedan återvänder hit så måste du vara inloggad på ![Disqus](https://disqus.com)!**

      Please enable JavaScript to view the comments powered by Disqus.

      © 2016  ·
      WIMSE


text:
1. Grab the profiling token from `Monitoring > Requests Profiles` admin page
(highlighted in a blue in the image below).
![Profile token](img/request_profiling_token.png)
1. Pass the header `X-Profile-Token: <token>` to the request you want to profile. You can use any of these tools
    * [ModHeader](https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj) Chrome extension
    * [Modify Headers](https://addons.mozilla.org/en-US/firefox/addon/modify-headers/) Firefox extension
    * `curl --header 'X-Profile-Token: <token>' https://gitlab.example.com/group/project`
1. Once request is finished (which will take a little longer than usual), you can
view the profiling output from `Monitoring > Requests Profiles` admin page.
![Profiling output](img/request_profile_result.png)

## Cleaning up
Profiling output will be cleared out every day via a Sidekiq worker.


text:
package main

import (
	"fmt"
	"io"

	"github.com/spf13/cobra"

	"k8s.io/helm/pkg/helm"
)

var getManifestHelp = `
This command fetches the generated manifest for a given release.

A manifest is a YAML-encoded representation of the Kubernetes resources that
were generated from this release's chart(s). If a chart is dependent on other
charts, those resources will also be included in the manifest.
`

type getManifestCmd struct {
	release string
	out     io.Writer
	client  helm.Interface
}

func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
	get := &getManifestCmd{
		out:    out,
		client: client,
	}
	cmd := &cobra.Command{
		Use:   "manifest [flags] RELEASE_NAME",
		Short: "download the manifest for a named release",
		Long:  getManifestHelp,
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) == 0 {
				return errReleaseRequired
			}
			get.release = args[0]
			if get.client == nil {
				get.client = helm.NewClient(helm.Host(tillerHost))
			}
			return get.run()
		},
	}
	return cmd
}

// getManifest implements 'helm get manifest'
func (g *getManifestCmd) run() error {
	res, err := g.client.ReleaseContent(g.release)
	if err != nil {
		return prettyError(err)
	}
	fmt.Fprintln(g.out, res.Release.Manifest)
	return nil
}


text:
import { connect } from "react-redux";

import ImportCucumberResultsDialog from "./ImportCucumberResultsDialog";
import { importCucumberResultThenReload } from "../redux";

const ImportCucumberResultsDialogContainer = connect(
  undefined,
  {
    onImportCucumberResult: importCucumberResultThenReload
  }
)(ImportCucumberResultsDialog);

export default ImportCucumberResultsDialogContainer;


text:
var nconf = require('nconf');

nconf
  .argv()
  .env()
  .file('./config/config.json');

module.exports = nconf;


text:
module Fog
  module Zerigo
    class DNS
      class Real

        require 'fog/dns/parsers/zerigo/count_zones'

        # Total number of zones hosted Zerigo for this account. It is the same value as provided
        # in the X-Query-Count header in the list_zones API method
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>
        #     * 'count'<~Integer>
        #   * 'status'<~Integer> - 200 indicates success
        def count_zones()
          request(
            :expects  => 200,
            :method   => 'GET',
            :parser   => Fog::Parsers::Zerigo::DNS::CountZones.new,
            :path     => "/api/1.1/zones/count.xml"
          )
        end

      end
    end
  end
end


text:
import CardStyle from '../Card/style.module.css'
import chrome from 'url:./logos/chrome.svg'
import edge from 'url:./logos/edge.svg'
import firefox from 'url:./logos/firefox.svg'
import opera from 'url:./logos/opera.svg'
import safari from 'url:./logos/safari.svg'
import samsung from 'url:./logos/samsung.svg'

const logos = {
  chrome,
  edge,
  firefox,
  opera,
  safari,
  samsung
}

const BROWSERS = Object.keys(logos)

export default function Compat({ browsers, versions }) {
  return (

      {BROWSERS.map(browser => {
        let supported = browsers.includes(browser)
        let version = versions[browser]
        return (
          <Browser
            browser={browser}
            version={version}
            supported={supported}
            polyfillVersion={versions.polyfill}
          />
        )
      })}

  )
}

function Browser({ browser, version, supported, polyfillVersion }) {
  let name = browser[0].toUpperCase() + browser.slice(1)
  let cl = CardStyle.unsupported
  let tip = `Not supported in ${name}`
  if (version === 'WIP') {
    cl = CardStyle.canary
    tip = `Supported in recent canary or preview releases of ${name}`
  }
  else if (supported) {
    cl = CardStyle.supported;
    tip = `Supported in ${name} version ${version}+`
  }
  else if (polyfillVersion) {
    cl = CardStyle.polyfilled
    supported = true
    version = polyfillVersion
    tip = `Supported in ${name} when using css-paint-polyfill`
  }
  else {
    version = '–';
  }
  return (

      <img src={logos[browser]} alt={`${browser} (${version})`} width="32" height="32" />
      {version}

  )
}


text:
#ifndef _LINUX_WAIT_H
#define _LINUX_WAIT_H

#define WNOHANG		0x00000001
#define WUNTRACED	0x00000002
#define WSTOPPED	WUNTRACED
#define WEXITED		0x00000004
#define WCONTINUED	0x00000008
#define WNOWAIT		0x01000000	/* Don't reap, just poll status.  */

#define __WNOTHREAD	0x20000000	/* Don't wait on children of other threads in this group */
#define __WALL		0x40000000	/* Wait on all children, regardless of type */
#define __WCLONE	0x80000000	/* Wait only on non-SIGCHLD children */

/* First argument to waitid: */
#define P_ALL		0
#define P_PID		1
#define P_PGID		2

#ifdef __KERNEL__

#include <linux/list.h>
#include <linux/stddef.h>
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/current.h>

typedef struct __wait_queue wait_queue_t;
typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key);
int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);

struct __wait_queue {
	unsigned int flags;
#define WQ_FLAG_EXCLUSIVE	0x01
	void *private;
	wait_queue_func_t func;
	struct list_head task_list;
};

struct wait_bit_key {
	void *flags;
	int bit_nr;
};

struct wait_bit_queue {
	struct wait_bit_key key;
	wait_queue_t wait;
};

struct __wait_queue_head {
	spinlock_t lock;
	struct list_head task_list;
};
typedef struct __wait_queue_head wait_queue_head_t;

struct task_struct;

/*
 * Macros for declaration and initialisaton of the datatypes
 */

#define __WAITQUEUE_INITIALIZER(name, tsk) {				\
	.private	= tsk,						\
	.func		= default_wake_function,			\
	.task_list	= { NULL, NULL } }

#define DECLARE_WAITQUEUE(name, tsk)					\
	wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk)

#define __WAIT_QUEUE_HEAD_INITIALIZER(name) {				\
	.lock		= __SPIN_LOCK_UNLOCKED(name.lock),		\
	.task_list	= { &(name).task_list, &(name).task_list } }

#define DECLARE_WAIT_QUEUE_HEAD(name) \
	wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name)

#define __WAIT_BIT_KEY_INITIALIZER(word, bit)				\
	{ .flags = word, .bit_nr = bit, }

extern void init_waitqueue_head(wait_queue_head_t *q);

#ifdef CONFIG_LOCKDEP
# define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \
	({ init_waitqueue_head(&name); name; })
# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
	wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
#else
# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name)
#endif

static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
{
	q->flags = 0;
	q->private = p;
	q->func = default_wake_function;
}

static inline void init_waitqueue_func_entry(wait_queue_t *q,
					wait_queue_func_t func)
{
	q->flags = 0;
	q->private = NULL;
	q->func = func;
}

static inline int waitqueue_active(wait_queue_head_t *q)
{
	return !list_empty(&q->task_list);
}

/*
 * Used to distinguish between sync and async io wait context:
 * sync i/o typically specifies a NULL wait queue entry or a wait
 * queue entry bound to a task (current task) to wake up.
 * aio specifies a wait queue entry with an async notification
 * callback routine, not associated with any task.
 */
#define is_sync_wait(wait)	(!(wait) || ((wait)->private))

extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));

static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
{
	list_add(&new->task_list, &head->task_list);
}

/*
 * Used for wake-one threads:
 */
static inline void __add_wait_queue_tail(wait_queue_head_t *head,
						wait_queue_t *new)
{
	list_add_tail(&new->task_list, &head->task_list);
}

static inline void __remove_wait_queue(wait_queue_head_t *head,
							wait_queue_t *old)
{
	list_del(&old->task_list);
}

void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key));
extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode));
extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr));
void FASTCALL(__wake_up_bit(wait_queue_head_t *, void *, int));
int FASTCALL(__wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned));
int FASTCALL(__wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned));
void FASTCALL(wake_up_bit(void *, int));
int FASTCALL(out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned));
int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned));
wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));

#define wake_up(x)			__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, NULL)
#define wake_up_nr(x, nr)		__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr, NULL)
#define wake_up_all(x)			__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, NULL)
#define wake_up_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
#define wake_up_interruptible_nr(x, nr)	__wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
#define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
#define	wake_up_locked(x)		__wake_up_locked((x), TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
#define wake_up_interruptible_sync(x)   __wake_up_sync((x),TASK_INTERRUPTIBLE, 1)

#define __wait_event(wq, condition) 					\
do {									\
	DEFINE_WAIT(__wait);						\
									\
	for (;;) {							\
		prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);	\
		if (condition)						\
			break;						\
		schedule();						\
	}								\
	finish_wait(&wq, &__wait);					\
} while (0)

/**
 * wait_event - sleep until a condition gets true
 * @wq: the waitqueue to wait on
 * @condition: a C expression for the event to wait for
 *
 * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the
 * @condition evaluates to true. The @condition is checked each time
 * the waitqueue @wq is woken up.
 *
 * wake_up() has to be called after changing any variable that could
 * change the result of the wait condition.
 */
#define wait_event(wq, condition) 					\
do {									\
	if (condition)	 						\
		break;							\
	__wait_event(wq, condition);					\
} while (0)

#define __wait_event_timeout(wq, condition, ret)			\
do {									\
	DEFINE_WAIT(__wait);						\
									\
	for (;;) {							\
		prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);	\
		if (condition)						\
			break;						\
		ret = schedule_timeout(ret);				\
		if (!ret)						\
			break;						\
	}								\
	finish_wait(&wq, &__wait);					\
} while (0)

/**
 * wait_event_timeout - sleep until a condition gets true or a timeout elapses
 * @wq: the waitqueue to wait on
 * @condition: a C expression for the event to wait for
 * @timeout: timeout, in jiffies
 *
 * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the
 * @condition evaluates to true. The @condition is checked each time
 * the waitqueue @wq is woken up.
 *
 * wake_up() has to be called after changing any variable that could
 * change the result of the wait condition.
 *
 * The function returns 0 if the @timeout elapsed, and the remaining
 * jiffies if the condition evaluated to true before the timeout elapsed.
 */
#define wait_event_timeout(wq, condition, timeout)			\
({									\
	long __ret = timeout;						\
	if (!(condition)) 						\
		__wait_event_timeout(wq, condition, __ret);		\
	__ret;								\
})

#define __wait_event_interruptible(wq, condition, ret)			\
do {									\
	DEFINE_WAIT(__wait);						\
									\
	for (;;) {							\
		prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE);	\
		if (condition)						\
			break;						\
		if (!signal_pending(current)) {				\
			schedule();					\
			continue;					\
		}							\
		ret = -ERESTARTSYS;					\
		break;							\
	}								\
	finish_wait(&wq, &__wait);					\
} while (0)

/**
 * wait_event_interruptible - sleep until a condition gets true
 * @wq: the waitqueue to wait on
 * @condition: a C expression for the event to wait for
 *
 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
 * @condition evaluates to true or a signal is received.
 * The @condition is checked each time the waitqueue @wq is woken up.
 *
 * wake_up() has to be called after changing any variable that could
 * change the result of the wait condition.
 *
 * The function will return -ERESTARTSYS if it was interrupted by a
 * signal and 0 if @condition evaluated to true.
 */
#define wait_event_interruptible(wq, condition)				\
({									\
	int __ret = 0;							\
	if (!(condition))						\
		__wait_event_interruptible(wq, condition, __ret);	\
	__ret;								\
})

#define __wait_event_interruptible_timeout(wq, condition, ret)		\
do {									\
	DEFINE_WAIT(__wait);						\
									\
	for (;;) {							\
		prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE);	\
		if (condition)						\
			break;						\
		if (!signal_pending(current)) {				\
			ret = schedule_timeout(ret);			\
			if (!ret)					\
				break;					\
			continue;					\
		}							\
		ret = -ERESTARTSYS;					\
		break;							\
	}								\
	finish_wait(&wq, &__wait);					\
} while (0)

/**
 * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses
 * @wq: the waitqueue to wait on
 * @condition: a C expression for the event to wait for
 * @timeout: timeout, in jiffies
 *
 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
 * @condition evaluates to true or a signal is received.
 * The @condition is checked each time the waitqueue @wq is woken up.
 *
 * wake_up() has to be called after changing any variable that could
 * change the result of the wait condition.
 *
 * The function returns 0 if the @timeout elapsed, -ERESTARTSYS if it
 * was interrupted by a signal, and the remaining jiffies otherwise
 * if the condition evaluated to true before the timeout elapsed.
 */
#define wait_event_interruptible_timeout(wq, condition, timeout)	\
({									\
	long __ret = timeout;						\
	if (!(condition))						\
		__wait_event_interruptible_timeout(wq, condition, __ret); \
	__ret;								\
})

#define __wait_event_interruptible_exclusive(wq, condition, ret)	\
do {									\
	DEFINE_WAIT(__wait);						\
									\
	for (;;) {							\
		prepare_to_wait_exclusive(&wq, &__wait,			\
					TASK_INTERRUPTIBLE);		\
		if (condition)						\
			break;						\
		if (!signal_pending(current)) {				\
			schedule();					\
			continue;					\
		}							\
		ret = -ERESTARTSYS;					\
		break;							\
	}								\
	finish_wait(&wq, &__wait);					\
} while (0)

#define wait_event_interruptible_exclusive(wq, condition)		\
({									\
	int __ret = 0;							\
	if (!(condition))						\
		__wait_event_interruptible_exclusive(wq, condition, __ret);\
	__ret;								\
})

/*
 * Must be called with the spinlock in the wait_queue_head_t held.
 */
static inline void add_wait_queue_exclusive_locked(wait_queue_head_t *q,
						   wait_queue_t * wait)
{
	wait->flags |= WQ_FLAG_EXCLUSIVE;
	__add_wait_queue_tail(q,  wait);
}

/*
 * Must be called with the spinlock in the wait_queue_head_t held.
 */
static inline void remove_wait_queue_locked(wait_queue_head_t *q,
					    wait_queue_t * wait)
{
	__remove_wait_queue(q,  wait);
}

/*
 * These are the old interfaces to sleep waiting for an event.
 * They are racy.  DO NOT use them, use the wait_event* interfaces above.
 * We plan to remove these interfaces during 2.7.
 */
extern void FASTCALL(sleep_on(wait_queue_head_t *q));
extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q,
				      signed long timeout));
extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q));
extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q,
						    signed long timeout));

/*
 * Waitqueues which are removed from the waitqueue_head at wakeup time
 */
void FASTCALL(prepare_to_wait(wait_queue_head_t *q,
				wait_queue_t *wait, int state));
void FASTCALL(prepare_to_wait_exclusive(wait_queue_head_t *q,
				wait_queue_t *wait, int state));
void FASTCALL(finish_wait(wait_queue_head_t *q, wait_queue_t *wait));
int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);

#define DEFINE_WAIT(name)						\
	wait_queue_t name = {						\
		.private	= current,				\
		.func		= autoremove_wake_function,		\
		.task_list	= LIST_HEAD_INIT((name).task_list),	\
	}

#define DEFINE_WAIT_BIT(name, word, bit)				\
	struct wait_bit_queue name = {					\
		.key = __WAIT_BIT_KEY_INITIALIZER(word, bit),		\
		.wait	= {						\
			.private	= current,			\
			.func		= wake_bit_function,		\
			.task_list	=				\
				LIST_HEAD_INIT((name).wait.task_list),	\
		},							\
	}

#define init_wait(wait)							\
	do {								\
		(wait)->private = current;				\
		(wait)->func = autoremove_wake_function;		\
		INIT_LIST_HEAD(&(wait)->task_list);			\
	} while (0)

/**
 * wait_on_bit - wait for a bit to be cleared
 * @word: the word being waited on, a kernel virtual address
 * @bit: the bit of the word being waited on
 * @action: the function used to sleep, which may take special actions
 * @mode: the task state to sleep in
 *
 * There is a standard hashed waitqueue table for generic use. This
 * is the part of the hashtable's accessor API that waits on a bit.
 * For instance, if one were to have waiters on a bitflag, one would
 * call wait_on_bit() in threads waiting for the bit to clear.
 * One uses wait_on_bit() where one is waiting for the bit to clear,
 * but has no intention of setting it.
 */
static inline int wait_on_bit(void *word, int bit,
				int (*action)(void *), unsigned mode)
{
	if (!test_bit(bit, word))
		return 0;
	return out_of_line_wait_on_bit(word, bit, action, mode);
}

/**
 * wait_on_bit_lock - wait for a bit to be cleared, when wanting to set it
 * @word: the word being waited on, a kernel virtual address
 * @bit: the bit of the word being waited on
 * @action: the function used to sleep, which may take special actions
 * @mode: the task state to sleep in
 *
 * There is a standard hashed waitqueue table for generic use. This
 * is the part of the hashtable's accessor API that waits on a bit
 * when one intends to set it, for instance, trying to lock bitflags.
 * For instance, if one were to have waiters trying to set bitflag
 * and waiting for it to clear before setting it, one would call
 * wait_on_bit() in threads waiting to be able to set the bit.
 * One uses wait_on_bit_lock() where one is waiting for the bit to
 * clear with the intention of setting it, and when done, clearing it.
 */
static inline int wait_on_bit_lock(void *word, int bit,
				int (*action)(void *), unsigned mode)
{
	if (!test_and_set_bit(bit, word))
		return 0;
	return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}

#endif /* __KERNEL__ */

#endif


text:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>

<?=$menu->render()?>

<?=t('Selected Attributes')?>

	<?=$detail->render()?>


text:
package com.solium.pcd.util;

import java.util.regex.Pattern;

public class Util {

    private Util() {
    }

    /**
     * @param param
     * @param regex
     * @return boolean value to determine if regex matches
     */
    public static boolean regexMatches(String param, Pattern regex) {
        return regex.matcher(param).matches();
    }
}


text:
package org.wso2.carbon.uuf.renderablecreator.hbs.core.js;

@FunctionalInterface
public interface CallMicroServiceFunction {

    String NAME = "callMicroService";

    void call();
}


text:
import * as mod from './empty.js';

assert.equal( typeof mod.foo, 'undefined' );


text:
<?php

namespace Vifeed\PaymentBundle\Controller\Api;

use FOS\RestBundle\Controller\FOSRestController;
use JMS\Serializer\SerializationContext;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use JMS\DiExtraBundle\Annotation as DI;
use FOS\RestBundle\View\View;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Vifeed\PaymentBundle\Entity\Wallet;
use Vifeed\PaymentBundle\Form\WalletType;
use FOS\RestBundle\Controller\Annotations as Rest;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;

/**
 * Class WalletController
 *
 * @package Vifeed\PaymentBundle\Controller
 */
class WalletController extends FOSRestController
{
    /**
     * @DI\Inject("doctrine.orm.entity_manager")
     * @var \Doctrine\ORM\EntityManager
     */
    private $em;

    /**
     * Добавить кошелёк
     *
     * @ApiDoc(
     *     section="Billing API",
     *     input="Vifeed\PaymentBundle\Form\WalletType",
     *     output={
     *          "class"="Vifeed\PaymentBundle\Entity\Wallet",
     *          "groups"={"default"}
     *     },
     *     resource=true,
     *     statusCodes={
     *         201="Returned when successful",
     *         400="Returned when the something was wrong",
     *         403="Returned when the user is not authorized to use this method"
     *     }
     * )
     *
     * @Rest\Put("wallets")
     *
     * @return Response
     */
    public function putWalletAction()
    {
        $form = $this->createForm(new WalletType());
        $form->submit($this->get('request'));

        if ($form->isValid()) {
            /** @var Wallet $wallet */
            $wallet = $form->getData();
            $wallet->setUser($this->getUser());
            $this->em->persist($wallet);
            $this->em->flush();

            $context = new SerializationContext();
            $context->setGroups(array('default'));

            $view = new View($wallet, 201);
            $view->setSerializationContext($context);
        } else {
            $view = new View($form, 400);
        }

        return $this->handleView($view);
    }

    /**
     * Все кошельки юзера
     *
     * @ApiDoc(
     *     section="Billing API",
     *     output={
     *          "class"="Vifeed\PaymentBundle\Entity\Wallet",
     *          "groups"={"default"}
     *     },
     *     statusCodes={
     *         200="Returned when successful",
     *         403="Returned when the user is not authorized to use this method"
     *     }
     * )
     *
     * @return Response
     */
    public function getWalletsAction()
    {
        $data = $this->em->getRepository('VifeedPaymentBundle:Wallet')->getWalletsDataByUser($this->getUser());

        $wallets = [];
        $walletData = [];

        foreach ($data as $row) {
            /** @var Wallet $wallet */
            $wallet = $row[0];
            $wallets[] = $wallet;
            unset($row[0]);
            $walletData[$wallet->getId()] = $row;
        }

        $context = new SerializationContext();
        $context->setGroups(['default'])
                ->setAttribute('wallet_data', $walletData);

        $view = new View($wallets);
        $view->setSerializationContext($context);

        return $this->handleView($view);
    }

    /**
     * Удалить кошелёк
     *
     * @param Wallet $wallet
     *
     * @Rest\Delete("wallets/{id}", requirements={"id"="\d+"})
     * @ParamConverter("wallet", class="VifeedPaymentBundle:Wallet")
     * @ApiDoc(
     *     section="Billing API",
     *     requirements={
     *       {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="id кошелька"}
     *     },
     *     statusCodes={
     *         204="Returned when successful",
     *         403="Returned when the user is not authorized to use this method",
     *         404="Returned when wallet not found"
     *     }
     * )
     *
     * @return Response
     */
    public function deleteWalletAction(Wallet $wallet)
    {
        if ($wallet->getUser() != $this->getUser()) {
            throw new AccessDeniedHttpException('Можно удалять только свои кошельки');
        }

        $this->em->remove($wallet);
        $this->em->flush();

        $view = new View('', 204);

        return $this->handleView($view);
    }

    /**
     * Типы кошельков
     *
     * @ApiDoc(
     *     section="Billing API",
     *     output="array",
     *     statusCodes={
     *         200="Returned when successful",
     *         403="Returned when the user is not authorized to use this method"
     *     }
     * )
     *
     * @return Response
     */
    public function getWalletTypesAction()
    {
        $view = new View(Wallet::getTypes());

        return $this->handleView($view);
    }

}


text:
// This file is automatically generated.

package adila.db;

/*
 * Sharp AQUOS Xx 3
 *
 * DEVICE: SG506SH
 * MODEL: 506SH
 */
final class sg506sh_506sh {
    public static final String DATA = "Sharp|AQUOS Xx 3|";
}


text:
/* globals module */
/**
 * @module notificationsPublishClient
 * @description  Notifications Publish Client provides an easy way to consume  Notifications REST API end-points. In order to obtain needed routes `notificationsPublishClient` uses `notificationsPublishRoute`.
 */

import { injectable, inject } from "inversify";
import { ApiClient, IHttpResponse, httpTYPES } from '../../../httpApi';
import { NotificationsPublishBatchClient, NotificationsPublishRoute, TYPES as notificationsTypes } from './';
import { INotification } from './contracts';

@injectable()
export class NotificationsPublishClient {

    get routeDefinition(): NotificationsPublishRoute {
        return this.notificationsPublishRoute;
    }

    get batch(): NotificationsPublishBatchClient {
        return this.notificationsPublishBatchClient;
    }

    constructor(
        @inject(notificationsTypes.NotificationsPublishRoute) protected notificationsPublishRoute: NotificationsPublishRoute,
        @inject(notificationsTypes.NotificationsPublishBatchClient) protected notificationsPublishBatchClient: NotificationsPublishBatchClient,
        @inject(httpTYPES.ApiClient) protected apiClient: ApiClient
    ) { }

    /**
     * Returns a promise that is resolved once the create notification action has been performed; this action creates a new notification resource.
     * @method
     * @param data The notification.
     * @returns A promise that is resolved once the create notification action has been performed.
     * @example notificationsPublishClient.create({
                    channels: ['<channel-name', '<channel-name>'],
                    moduleName: '<module-name>',
                    templateName: '<template-name>',
                    templateContext: {
                        prop1: '<prop1-value>',
                        prop2: '<prop2-value>'
                    }
                })
                .then(function (data) {
                    // perform success action here
                },
                 function (response, status, headers, config) {
                     // perform error handling here
                });
     */
    create(data: INotification): PromiseLike<IHttpResponse<INotification>> {
        return this.apiClient.post<INotification>(this.routeDefinition.create(), this.routeDefinition.createParams(data));
    }
}

/**
 * @overview
 ***Notes:**
 - Refer to the [REST API documentation](https://github.com/Baasic/baasic-rest-api/wiki) for detailed information about available Baasic REST API end-points.
 - All end-point objects are transformed by the associated route service.
 */


text:
require 'thor'
require 'active_support/core_ext/module'

module Nrcmd

  autoload :Apps,       'nrcmd/apps/cli'
  autoload :Server,     'nrcmd/server/cli'
  autoload :User,       'nrcmd/users_cli'
  autoload :Config,     'nrcmd/util/config'
  autoload :Http,       'nrcmd/util/http'
  autoload :JSON,       'json'
  autoload :PP,         'pp'

  mattr_accessor :conf
  mattr_accessor :log_level

  class CLI < Thor

    URL = 'https://api.newrelic.com/v2'

    class_option :config, :type => :string, :aliases => "-c"
    class_option :verbose, :type => :boolean, :aliases => "-v"

    register(Apps, 'apps', 'apps <sub-command>', 'commands for Applications services')
    register(Server, 'server', 'server <sub-command>', 'commands for Servers services')
    register(User, 'user', 'user <sub-command>', 'commands for Users services')

    default_command :help
    def initialize(*args)
      super
      Nrcmd.conf = Nrcmd::Config.load(!!options["config"] ? options["config"] : "#{Dir.home}/.nrcmd_config.rb")
      Nrcmd.log_level = (!!options["verbose"] ? "DEBUG" : "INFO")
    end

    desc "configure", "setup your config file."
    def configure
      your_api_key = ask("Your NewRelic Api Key: ", :echo => false)
      conf = eval File.read "#{Dir.pwd}/nrcmd_config.rb"
      conf.merge! Hash[ :nr_api_key => your_api_key ]
      File.write("#{Dir.home}/.nrcmd_config.rb", PP.pp(conf, ''))
    end

  end
end

if __FILE__ == $0
  Nrcmd.start
end


text:
package com.heroku.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class PopupViewController {
	@RequestMapping(value="/popup_uploadimg_001",method = RequestMethod.GET)
	public String popupUploadImg001() {
		return "popup/popup_uploadimg_001_view";
	}
	@RequestMapping(value="/popup_uploadimg_002",method = RequestMethod.GET)
	public String popupUploadImg002() {
		return "popup/popup_uploadimg_002_view";
	}

}


text:
import os
import sys

DATA_DIR = os.path.join(
    os.path.dirname(os.path.realpath(__file__)), "data")

if not os.path.exists(DATA_DIR):
    print("Uh, we were expecting a data directory, which contains the toy data")
    sys.exit(1)


text:
var  mongoose       = require('mongoose'),
     Schema         = mongoose.Schema,
     crypto         = require('crypto'),
     thunkify       = require('thunkify'),
     Email          = require('../services/email');

/*
|--------------------------------------------------------------------------
| Validations
|--------------------------------------------------------------------------
*/

var validatePresenceOf = function(value) {
     return (this.provider && this.provider !== 'local') || (value && value.length);
};

/*
|--------------------------------------------------------------------------
| User Model
|--------------------------------------------------------------------------
*/

var userSchema = new Schema({

     firstName: {
          type: String
     },

     lastName: {
          type: String
     },

     email: {
          type:     String,
          match:    [/.+\@.+\..+/, 'Please enter a valid email'],
          required: 'An Email Address is required!',
     },

     hashed_password: {
          type:     String,
          validate: [validatePresenceOf, 'Password cannot be blank'],
          required: 'A Password is required!'
     },

     salt: String,

     created_at: {
          type:     Date,
          default:  Date.now
     },

     updated_at: {
          type:     Date,
          default:  Date.now
     }

});

/*
|--------------------------------------------------------------------------
| Post Save - Updated At
|--------------------------------------------------------------------------
*/

userSchema.pre('save', function(next){
     this.updated_at = new Date;
     if ( !this.created_at ) this.created_at = new Date;
     next();
});

/*
|--------------------------------------------------------------------------
| Virtual Password
|--------------------------------------------------------------------------
*/

userSchema.virtual('password').set(function(password) {
     this._password                = password;
     this.salt                     = this.makeSalt();
     this.hashed_password     = this.hashPassword(password);
}).get(function() {
     return this._password;
});

/*
|--------------------------------------------------------------------------
| Check Password
|--------------------------------------------------------------------------
*/

userSchema.pre('save', function(next) {
     // if (this.isNew && this.provider === 'local' && this.password && !this.password.length)
     //   return next(new Error('Invalid password'));
     // next();
     this._wasNew = this.isNew;
     next();
});

userSchema.post('save', function(user) {
     if(this._wasNew) Email.welcome(user);
});

/*
|--------------------------------------------------------------------------
| Validation
|--------------------------------------------------------------------------
*/

userSchema.path('email').validate(function (value, respond) {
     if( !this.isNew && this.email === value ) return respond(true);
     this.model('User').findOne({ email: value }, function (err, user) {
          (user) ? respond(false) : respond(true);
     });
}, 'This Email Address is already in use');

/*
|--------------------------------------------------------------------------
| Model Methods
|--------------------------------------------------------------------------
*/

userSchema.methods = {

     authenticate: function(plainText) {
          return this.hashPassword(plainText) === this.hashed_password;
     },

     makeSalt: function() {
          return crypto.randomBytes(16).toString('base64');
     },

     hashPassword: function(password) {
          if (!password || !this.salt) return '';
          var salt = new Buffer(this.salt, 'base64');
          return crypto.pbkdf2Sync(password, salt, 10000, 64).toString('base64');
     },

     // Polyfil for Mongoose's lack of Promises on save
     persist: thunkify(function() {
          return this.save.apply(this, arguments);
     })

};

/*
|--------------------------------------------------------------------------
| Export that motha'
|--------------------------------------------------------------------------
*/

module.exports = mongoose.model('User', userSchema);


text:
@import WebKit;

@interface PoolController : UIViewController{

	IBOutlet WKWebView *poolview;
	IBOutlet UIActivityIndicatorView *activityind;
	NSTimer *timer;
}
@end


text:
{% extends "schools/base.html" %}

{% block teachers-active %}active{% endblock %}

{% block action %}
<button id="new-teacher" class="button important regular">Νέος Καθηγητής</button>
{% endblock %}

{% block content %}

	{{ block.super }}

Κονσόλα Μηνυμάτων

{% endblock content %}

{% block extra_js_bottom %}
	{% spaceless %}

	{{ block.super }}

	{% endspaceless %}
{% endblock %}

{% block footer %}

    {% include "handlebars/schools/teachers.html" %}

{% endblock %}


text:
#include "berryQtGlobalEventFilter.h"
#include "internal/berryQtControlWidget.h"

#include <QEvent>
#include <QMouseEvent>
#include <QApplication>
#include <QWidget>

#include <iostream>

namespace berry {

QtGlobalEventFilter::QtGlobalEventFilter(QObject* parent)
 : QObject(parent)
{

}

bool QtGlobalEventFilter::eventFilter(QObject*  /*obj*/, QEvent* event)
{
  if (event->type() == QEvent::MouseButtonPress)
  {
    QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
    QWidget* widget = QApplication::widgetAt(mouseEvent->globalPos());
    if (widget)
    {
      QObject* parent = widget;
      while (parent)
      {
        if (parent->objectName() == "PartPaneControl")
        {
          (dynamic_cast<QtControlWidget*>(parent))->FireActivateEvent();
          break;
        }
        parent = parent->parent();
      }
    }
  }

  return false;
}

}


text:
from pants.contrib.node.targets.node_module import NodeModule
from pants.contrib.scalajs.targets.scala_js_target import ScalaJSTarget

class ScalaJSBinary(ScalaJSTarget, NodeModule):
    """A binary javascript blob built from a collection of ScalaJSLibrary targets.

    Extends NodeModule to allow consumption by NPM and node.
    """

    pass