text:
import logging
import signal
import time
import datetime
# import random
from threading import Thread, Event  # , Lock, Condition
from array import array
import struct

import numpy as np

from basil.dut import Dut
from basil.HL.RegisterHardwareLayer import RegisterHardwareLayer

conf = '''
name    : test_eth
version : 1.0

transfer_layer:
  - name  : ETH
    type  : SiTcp
    init:
        ip : "192.168.10.16"
        udp_port : 4660
        tcp_port : 24
        tcp_connection : True
        tcp_to_bus : True  # if True, use TCP to BUS; if False, UDP (RBCP) to BUS

hw_drivers:
  - name      : SITCP_FIFO
    type      : sitcp_fifo
    interface : ETH

  - name      : REGISTERS
    type      : test_eth
    interface : ETH
    base_addr : 0x0

'''

stop_thread = False

class test_eth(RegisterHardwareLayer):
    '''Register Hardware Layer.

    Implementation of advanced register operations.
    '''
    _registers = {
        'RESET': {'descr': {'addr': 0, 'size': 8, 'properties': ['writeonly']}},
        'VERSION': {'descr': {'addr': 0, 'size': 8, 'properties': ['readonly']}},
        'SETUP': {'default': 0, 'descr': {'addr': 1, 'size': 8, 'offset': 0}},
        'TEST_DATA': {'descr': {'addr': 2, 'size': 64, 'offset': 0}},
        'BUS_WRITE_CNT': {'descr': {'addr': 10, 'size': 32, 'offset': 0}},
        'TCP_WRITE_DLY': {'default': 0, 'descr': {'addr': 14, 'size': 16, 'offset': 0}},
        'TCP_WRITE_CNT': {'descr': {'addr': 16, 'size': 64, 'offset': 0, 'properties': ['readonly']}},
        'TCP_FAILED_WRITE_CNT': {'descr': {'addr': 24, 'size': 64, 'offset': 0, 'properties': ['readonly']}},
        'TCP_RECV_WRITE_CNT': {'descr': {'addr': 32, 'size': 64, 'offset': 0, 'properties': ['readonly']}}
    }

class Test(object):
    def __init__(self):
        self.dut = Dut(conf)
        self.dut.init()
        # fw_version = dut['ETH'].read(0x0000, 1)[0]
        logging.info("Firmware version: %s" % self.dut['REGISTERS'].VERSION)

        signal.signal(signal.SIGINT, self.signal_handler)
        logging.info('Press Ctrl-C to stop')

        self.stop_thread = Event()
        self.total_tcp_err_cnt = 0

    def signal_handler(self, signum, frame):
        logging.info('Pressed Ctrl-C...')
        self.dut['REGISTERS'].TCP_WRITE_DLY = 0  # no TCP data
        self.time_stop = time.time()
        self.stop_thread.set()
        signal.signal(signal.SIGINT, signal.SIG_DFL)  # setting default handler

    def start(self, test_tcp=True, test_bus=True, tcp_write_delay=6, monitor_interval=1.0, deadline=None):
        if not test_tcp and not test_bus:
            return
        self.test_tcp = test_tcp
        self.test_bus = test_bus
        # reset registers
        self.dut['REGISTERS'].RESET
        # setup register values
        # Monitor
        self.monitor_delay = monitor_interval  # Speed of displaying netowrk speed
        # TCP
        self.tcp_readout_delay = 0.1  # Delay between reading TCP buffer
        self.dut['REGISTERS'].TCP_WRITE_DLY = 0  # no TCP data
        self.time_start = time.time()
        self.total_tcp_err_cnt = 0
        self.total_tcp_data_words_read = 0
        self.tcp_exception_cnt = 0
        self.tcp_read_speeds = None
        # BUS
        self.bus_readout_delay = 0.0  # Delay between reading/writing to BUS
        self.total_bus_err_cnt = 0
        self.total_bus_read_write_cnt = 0
        self.bus_exception_cnt = 0
        self.bus_read_write_speeds = None
        # initializing threads
        self.stop_thread.clear()
        self.mon_t = Thread(target=self.monitor, name='Monitor thread', kwargs={})
        self.mon_t.daemon = True
        self.mon_t.start()
        if test_tcp:
            self.tcp_t = Thread(target=self.tcp_read, name='TCP thread', kwargs={})
            self.tcp_t.daemon = True
            self.tcp_t.start()
        if test_bus:
            self.bus_t = Thread(target=self.bus_read_write, name='BUS thread', kwargs={})
            self.bus_t.daemon = True
            self.bus_t.start()
        if test_tcp:
            self.dut['REGISTERS'].TCP_WRITE_DLY = tcp_write_delay  # set TCP write delay: 1 equivalent to write data every clock cycle (1/133MHz=0.0075us=7.5ns)
        self.time_start = time.time()
        self.time_stop = self.time_start + 1.0
        # while loop for signal handler
        while not self.stop_thread.wait(0.05):
            if deadline and self.time_start + deadline < time.time():
                self.signal_handler(None, None)
        self.mon_t.join()
        self.mon_t = None
        logging.info("Stopped Monitor thread")
        if test_tcp:
            self.tcp_t.join()
            self.tcp_t = None
            logging.info("Stopped TCP thread")
        if test_bus:
            self.bus_t.join()
            self.bus_t = None
            logging.info("Stopped BUS thread")

        # some statistics
        logging.info("Total time: %s" % (str(datetime.timedelta(seconds=self.time_stop - self.time_start))))
        if test_tcp:
            logging.info("=== TCP transfer statistics ===")
            logging.info("TCP data error counter: %d" % self.total_tcp_err_cnt)
            logging.info("TCP exception counter: %d" % self.tcp_exception_cnt)
            logging.info("TCP write busy counter: %d" % self.dut['REGISTERS'].TCP_FAILED_WRITE_CNT)
            logging.info("TCP data words: read: %d, expected: %d" % (self.dut['REGISTERS'].TCP_WRITE_CNT * 4 + self.dut['REGISTERS'].TCP_RECV_WRITE_CNT, self.total_tcp_data_words_read * 4))
            if self.total_tcp_data_words_read * 4 / 10.0**6 > 1000000:
                logging.info("Total amount transmitted: %.2f TB" % (self.total_tcp_data_words_read * 4 / 10.0**12))
            elif self.total_tcp_data_words_read * 4 / 10.0**6 > 1000:
                logging.info("Total amount transmitted: %.2f GB" % (self.total_tcp_data_words_read * 4 / 10.0**9))
            else:
                logging.info("Total amount transmitted: %.2f MB" % (self.total_tcp_data_words_read * 4 / 10.0**6))
            total_tcp_avg_read_speed = self.total_tcp_data_words_read * 32 / (self.time_stop - self.time_start) / 10.0**6
            if total_tcp_avg_read_speed < 1.0:
                logging.info("Total average TCP read speed: %.2f kbit/s" % (total_tcp_avg_read_speed * 10**3))
            else:
                logging.info("Total average TCP read speed: %.2f Mbit/s" % (total_tcp_avg_read_speed))
            if self.tcp_read_speeds:
                if np.average(self.tcp_read_speeds) < 1.0:
                    logging.info("TCP read speed (min/median/average/max): %.2f/%.2f/%.2f/%.2f kbit/s" % (np.min(self.tcp_read_speeds) * 10**3, np.median(self.tcp_read_speeds) * 10**3, np.average(self.tcp_read_speeds) * 10**3, np.max(self.tcp_read_speeds) * 10**3))
                else:
                    logging.info("TCP read speed (min/median/average/max): %.2f/%.2f/%.2f/%.2f Mbit/s" % (np.min(self.tcp_read_speeds), np.median(self.tcp_read_speeds), np.average(self.tcp_read_speeds), np.max(self.tcp_read_speeds)))

        if test_bus:
            logging.info("=== BUS transfer statistics ===")
            logging.info("BUS data error counter: %d" % self.total_bus_err_cnt)
            logging.info("BUS exception counter: %d" % self.bus_exception_cnt)
            logging.info("BUS read/write counter: read: %d, expected: %d" % (self.dut['REGISTERS'].BUS_WRITE_CNT, self.total_bus_read_write_cnt * 8))
            if self.total_bus_read_write_cnt * 8 / 10.0**6 > 1000000:
                logging.info("Total amount transmitted: %.2f TB" % (self.total_bus_read_write_cnt * 8 / 10.0**12))
            elif self.total_bus_read_write_cnt * 8 / 10.0**6 > 1000:
                logging.info("Total amount transmitted: %.2f GB" % (self.total_bus_read_write_cnt * 8 / 10.0**9))
            else:
                logging.info("Total amount transmitted: %.2f MB" % (self.total_bus_read_write_cnt * 8 / 10.0**6))
            total_bus_avg_read_speed = self.total_bus_read_write_cnt * 64 / (self.time_stop - self.time_start) / 10.0**6
            if total_bus_avg_read_speed < 1.0:
                logging.info("Total average BUS read/write speed: %.2f kbit/s" % (total_bus_avg_read_speed * 10**3))
            else:
                logging.info("Total average BUS read/write speed: %.2f Mbit/s" % (total_bus_avg_read_speed))
            if self.bus_read_write_speeds:
                if np.average(self.bus_read_write_speeds) < 1.0:
                    logging.info("BUS read/write speed (min/median/average/max): %.2f/%.2f/%.2f/%.2f kbit/s" % (np.min(self.bus_read_write_speeds) * 10**3, np.median(self.bus_read_write_speeds) * 10**3, np.average(self.bus_read_write_speeds) * 10**3, np.max(self.bus_read_write_speeds) * 10**3))
                else:
                    logging.info("BUS read/write speed (min/median/average/max): %.2f/%.2f/%.2f/%.2f Mbit/s" % (np.min(self.bus_read_write_speeds), np.median(self.bus_read_write_speeds), np.average(self.bus_read_write_speeds), np.max(self.bus_read_write_speeds)))

        # close DUT
        self.dut.close()

    def monitor(self):
        logging.info("Started Monitor thread")
        time_read = time.time()
        last_total_tcp_data_words_read = 0
        last_total_bus_read_write_cnt = 0
        while not self.stop_thread.wait(max(0.0, self.monitor_delay - time_read + time.time())):
            tmp_time_read = time.time()
            tmp_total_tcp_data_words_read = self.total_tcp_data_words_read
            tmp_total_bus_read_write_cnt = self.total_bus_read_write_cnt
            if self.test_tcp:
                tcp_read_speed = (tmp_total_tcp_data_words_read - last_total_tcp_data_words_read) * 32 / (tmp_time_read - time_read) / 10**6
                if self.tcp_read_speeds is None:  # add on second iteration
                    self.tcp_read_speeds = []
                else:
                    self.tcp_read_speeds.append(tcp_read_speed)
                if tcp_read_speed < 1.0:
                    logging.info("TCP read speed: %0.2f kbit/s" % (tcp_read_speed * 10**3))
                else:
                    logging.info("TCP read speed: %0.2f Mbit/s" % tcp_read_speed)
            if self.test_bus:
                bus_read_write_speed = (tmp_total_bus_read_write_cnt - last_total_bus_read_write_cnt) * 64 / (tmp_time_read - time_read) / 10**6
                if self.bus_read_write_speeds is None:  # add on second iteration
                    self.bus_read_write_speeds = []
                else:
                    self.bus_read_write_speeds.append(bus_read_write_speed)
                if bus_read_write_speed < 1.0:
                    logging.info("BUS read/write speed: %0.2f kbit/s" % (bus_read_write_speed * 10**3))
                else:
                    logging.info("BUS read/write speed: %0.2f Mbit/s" % bus_read_write_speed)
            time_read = tmp_time_read
            last_total_tcp_data_words_read = tmp_total_tcp_data_words_read
            last_total_bus_read_write_cnt = tmp_total_bus_read_write_cnt
            if self.total_bus_err_cnt > 10 or self.total_tcp_err_cnt > 10:
                self.stop_thread.set()

        logging.info("Stopping Monitor thread...")

    def tcp_read(self):
        logging.info("Started TCP thread")
        fifo_data_last_value = -1
        fifo_was_empty = 0
        time_read = time.time()
        while not self.stop_thread.wait(max(0.0, self.tcp_readout_delay - time_read + time.time())) or fifo_was_empty < 1:
            time_read = time.time()
            try:
                fifo_data = self.dut['SITCP_FIFO'].get_data()
            except Exception as e:
                logging.error(e)
                self.tcp_exception_cnt += 1
            else:
                if fifo_data.shape[0]:
                    self.total_tcp_data_words_read += fifo_data.shape[0]
                    if fifo_data[0] != fifo_data_last_value + 1:
                        logging.warning("TCP not increased by 1 between readouts")
                        self.total_tcp_err_cnt += 1
                    err_cnt = np.count_nonzero(np.diff(fifo_data) != 1)
                    if err_cnt:
                        logging.warning("TCP data not increased by 1: errors=%d" % err_cnt)
                        self.total_tcp_err_cnt += err_cnt
                    fifo_data_last_value = fifo_data[-1]
                elif self.stop_thread.is_set():
                    fifo_was_empty += 1
            if self.stop_thread.is_set():
                time.sleep(max(0.0, self.tcp_readout_delay - time_read + time.time()))
        logging.info("Stopping TCP thread...")

    def bus_read_write(self):
        logging.info("Started BUS thread")
        time_read = time.time()
        while not self.stop_thread.wait(max(0.0, self.bus_readout_delay - time_read + time.time())):
            time_read = time.time()
            write_value = int(np.random.randint(2**64, size=None, dtype=np.uint64))  # random.randint(0, 2**64 - 1)
            try:
                self.dut['REGISTERS'].TEST_DATA = write_value
            except Exception as e:
                logging.error(e)
                self.bus_exception_cnt += 1
            else:
                try:
                    read_value = self.dut['REGISTERS'].TEST_DATA
                except Exception as e:
                    logging.error(e)
                    self.bus_exception_cnt += 1
                else:
                    self.total_bus_read_write_cnt += 1
                    if read_value != write_value:
                        logging.warning("BUS data not correct: read: %s, expected: %s" % (array('B', struct.unpack("BBBBBBBB", struct.pack("Q", read_value))), array('B', struct.unpack("BBBBBBBB", struct.pack("Q", write_value)))))
                        self.total_bus_err_cnt += 1
        logging.info("Stopping BUS thread...")

if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(description='Testing MMC3 Ethernet Interface %s\nExample: python test_eth.py -t 1.0 -d 6 --no-bus', formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('-w', '--deadline', type=float, metavar='<deadline>', action='store', help='timeout in seconds before application exits')
    parser.add_argument('-i', '--interval', type=float, metavar='<interval time>', action='store', help='time interval in seconds for the monitor')
    parser.add_argument('-d', '--delay', type=int, metavar='<clock cycles>', action='store', help='clock cycles between TCP writes')
    parser.add_argument('--no-bus', dest='no_bus', action='store_true', help='disable BUS tests')
    parser.add_argument('--no-tcp', dest='no_tcp', action='store_true', help='disable TCP downstream tests')
    parser.set_defaults(no_m26_jtag_configuration=False)
    args = parser.parse_args()

    config = {}

    if args.deadline is not None:
        config["deadline"] = args.deadline
    if args.interval is not None:
        config["monitor_interval"] = args.interval
    if args.delay is not None:
        config["tcp_write_delay"] = args.delay
    if args.no_bus:
        config["test_bus"] = False
    if args.no_tcp:
        config["test_tcp"] = False

    test = Test()
    test.start(**config)


text:
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

print_header "Customizing the environment" "Sylius"
run_command "git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH" || exit $? # Make origin/master available for is_suitable steps
run_command "phpenv config-rm xdebug.ini" # Disable XDebug
run_command "echo \"memory_limit=6144M\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" || exit $? # Increase memory limit to 6GB
run_command "composer self-update --preview"
run_command "mkdir -p \"${SYLIUS_CACHE_DIR}\"" || exit $? # Create Sylius cache directory
run_command "mkdir -p web/media/image" || exit $? # Create Sylius images directory

redpajama_set_name: RedPajamaGithub


text:
/*
 *  c 2001 PPC 64 Team, IBM Corp
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      as published by the Free Software Foundation; either version
 *      2 of the License, or (at your option) any later version.
 *
 * /dev/nvram driver for PPC
 *
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <asm/prom.h>
#include <asm/machdep.h>

static unsigned int nvram_size;
static unsigned char nvram_buf[4];
static DEFINE_SPINLOCK(nvram_lock);

static unsigned char chrp_nvram_read(int addr)
{
	unsigned long done, flags;
	unsigned char ret;

	if (addr >= nvram_size) {
		printk(KERN_DEBUG "%s: read addr %d > nvram_size %u\n",
		       current->comm, addr, nvram_size);
		return 0xff;
	}
	spin_lock_irqsave(&nvram_lock, flags);
	if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
		ret = 0xff;
	else
		ret = nvram_buf[0];
	spin_unlock_irqrestore(&nvram_lock, flags);

	return ret;
}

static void chrp_nvram_write(int addr, unsigned char val)
{
	unsigned long done, flags;

	if (addr >= nvram_size) {
		printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
		       current->comm, addr, nvram_size);
		return;
	}
	spin_lock_irqsave(&nvram_lock, flags);
	nvram_buf[0] = val;
	if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
		printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
	spin_unlock_irqrestore(&nvram_lock, flags);
}

void __init chrp_nvram_init(void)
{
	struct device_node *nvram;
	unsigned int *nbytes_p, proplen;

	nvram = of_find_node_by_type(NULL, "nvram");
	if (nvram == NULL)
		return;

	nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
	if (nbytes_p == NULL || proplen != sizeof(unsigned int))
		return;

	nvram_size = *nbytes_p;

	printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size);
	of_node_put(nvram);

	ppc_md.nvram_read_val = chrp_nvram_read;
	ppc_md.nvram_write_val = chrp_nvram_write;

	return;
}


text:
package com.google.cloud.dataplex.v1.samples;

// [START dataplex_v1_generated_DataplexService_ListAssets_Zonename_sync]
import com.google.cloud.dataplex.v1.Asset;
import com.google.cloud.dataplex.v1.DataplexServiceClient;
import com.google.cloud.dataplex.v1.ZoneName;

public class SyncListAssetsZonename {

  public static void main(String[] args) throws Exception {
    syncListAssetsZonename();
  }

  public static void syncListAssetsZonename() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]");
      for (Asset element : dataplexServiceClient.listAssets(parent).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}
// [END dataplex_v1_generated_DataplexService_ListAssets_Zonename_sync]


text:
<?php

namespace LaravelPackageManager;

use Illuminate\Support\ServiceProvider;

class LaravelPackageManagerServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        if ($this->app->runningInConsole()) {
            $this->registerCommands();
        }
    }

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the artisan commands.
     *
     * @return void
     */
    private function registerCommands()
    {
        $this->commands([
          \LaravelPackageManager\Console\Commands\RequirePackageCommand::class,
          \LaravelPackageManager\Console\Commands\UnregisterPackageCommand::class,
        ]);
    }
}


text:
<?php

namespace Qodeboy\Mailman\Logger;

use Illuminate\Filesystem\Filesystem;
use Qodeboy\Mailman\Contracts\MailmanSwiftMessageAdapter;

/**
 * Class MailmanFilesystemLogger.
 */
class MailmanFilesystemLogger extends AbstractMailmanLogger
{
    /**
     * Base path where email logs are stored.
     *
     * @var string
     */
    protected $storagePath;

    /**
     * FileSystem adapter.
     *
     * @var Filesystem
     */
    protected $fileSystem;

    /**
     * MailmanFilesystemLogger constructor.
     */
    public function __construct()
    {
        $this->storagePath = config('mailman.storage.filesystem.path');
        $this->fileSystem = app(Filesystem::class);
    }

    /**
     * Log given Swift_Mime_Message email message.
     *
     * @param MailmanSwiftMessageAdapter $message
     *
     * @return mixed
     */
    public function log(MailmanSwiftMessageAdapter $message)
    {
        $this->prepareStorage($message);

        $this->fileSystem->put(
            $this->getMessageLogFilePath($message).'.html',
            $this->getMessageHTMLContent($message)
        );

        $this->fileSystem->put(
            $this->getMessageLogFilePath($message).'.eml',
            $this->getMessageEMLContent($message)
        );
    }

    /**
     * Generate a human readable HTML comment with message info.
     *
     * @param MailmanSwiftMessageAdapter $message
     *
     * @return string
     */
    protected function getMessageInfo(MailmanSwiftMessageAdapter $message)
    {
        return sprintf(
            "<!--\nStatus: %s, \nMessageID: %s, \nContent-Type: %s, \nFrom:%s, \nTo:%s, \nReply-To:%s, \nCC:%s, \nBCC:%s, \nSubject:%s\n-->\n",
            $message->getStatus(),
            $message->getId(),
            $message->getContentType(),
            json_encode($message->getFrom()),
            json_encode($message->getTo()),
            json_encode($message->getReplyTo()),
            json_encode($message->getCc()),
            json_encode($message->getBcc()),
            $message->getSubject()
        );
    }

    /**
     * Get the HTML content for the log file.
     *
     * @param  MailmanSwiftMessageAdapter $message
     *
     * @return string
     */
    protected function getMessageHTMLContent(MailmanSwiftMessageAdapter $message)
    {
        $messageInfo = $this->getMessageInfo($message);

        return $messageInfo.$message->getBody();
    }

    /**
     * Get the EML content for the log file.
     *
     * @param  MailmanSwiftMessageAdapter $message
     *
     * @return string
     */
    protected function getMessageEMLContent(MailmanSwiftMessageAdapter $message)
    {
        return $message->toString();
    }

    /**
     * Get the path to the email log file.
     *
     * @param  MailmanSwiftMessageAdapter $message
     *
     * @return string
     */
    protected function getMessageLogFilePath(MailmanSwiftMessageAdapter $message)
    {
        $messageLogDirectory = $this->getMessageLogDirectoryPath($message);
        $messageLogFileName = str_replace(['@', '.'], ['_at_', '_'], $message->getId());

        return $messageLogDirectory.'/'.str_slug($messageLogFileName);
    }

    /**
     * Get the path to the email log directory.
     *
     * @param MailmanSwiftMessageAdapter $message
     *
     * @return string
     */
    protected function getMessageLogDirectoryPath(MailmanSwiftMessageAdapter $message)
    {
        list($messageId) = explode('@', $message->getId());

        return storage_path($this->storagePath.'/'.$messageId);
    }

    /**
     * Create required directories for logging.
     *
     * @param MailmanSwiftMessageAdapter $message
     */
    protected function prepareStorage(MailmanSwiftMessageAdapter $message)
    {
        $messageLogStorageDirectory = storage_path($this->storagePath);
        if (! $this->fileSystem->exists($messageLogStorageDirectory)) {
            $this->fileSystem->makeDirectory($messageLogStorageDirectory);
            $this->fileSystem->put($messageLogStorageDirectory.'/.gitignore', "*\n!.gitignore");
        }

        $messageLogDirectory = $this->getMessageLogDirectoryPath($message);
        if (! $this->fileSystem->exists($messageLogDirectory)) {
            $this->fileSystem->makeDirectory($messageLogDirectory);
        }
    }
}


text:
@class DVTPerformanceMetric, IDEIndex, IDEIndexImportSession, NSDictionary, NSMutableArray, NSMutableDictionary, NSMutableSet, NSObject<OS_dispatch_queue>;

@interface IDEIndexingEngine : NSObject <NSCopying>
{
    IDEIndex *_index;
    NSObject *_engine_queue;
    NSMutableArray *_waitingLoadJobs;
    NSMutableArray *_waitingFileJobs;
    NSMutableSet *_waitingDeferredJobs;
    NSMutableSet *_waitingHeldJobs;
    NSMutableDictionary *_registeredIndexables;
    NSMutableDictionary *_productInfos;
    NSMutableDictionary *_rootPaths;
    NSMutableSet *_registeredFiles;
    NSMutableDictionary *_missingFiles;
    NSMutableDictionary *_priorityFiles;
    IDEIndexImportSession *_session;
    id _prebuildNotificationToken;
    double _timeIndexablesChanged;
    double _timeFilesChanged;
    double _timeFileJobsChanged;
    double _timeJobsEnded;
    int _suspended;
    int _nScheduledJobs;
    int _nWaitingModuleJobs;
    int _nScheduledModuleJobs;
    BOOL _wroteWorkspaceHeaderMap;
    BOOL _wroteAuxiliaryFiles;
    BOOL _purgedStaleData;
    BOOL _isActive;
    BOOL _isIndexing;
    BOOL _notified;
    BOOL _mightNotResume;
    BOOL _waitingForSessionToEnd;
    BOOL _aborted;
    BOOL _registeredFilesAdded;
    BOOL _waitingForMoreFiles;
    BOOL _waitingForMoreIndexables;
    BOOL _waitingForMoreFileJobs;
    BOOL _waitingToStartDeferredJob;
    BOOL _doingDeferredJobs;
    BOOL _dontDeferJobs;
    BOOL _lastLogWasDeferred;
    BOOL _initializedTextIndex;
    dispatch_block_t _abortCallback;
    DVTPerformanceMetric *_indexingMetric;
    long long _nCompleted;
    double _throttleFactor;
    NSDictionary *_notifiedDeferred;
    NSMutableArray *_filesReadyBlocks;
    double _autoQueryProgress;
}

+ (void)runDeferredJob:(id)arg1;
+ (void)runFileJob:(id)arg1;
+ (void)runLoadJob:(id)arg1;
+ (void)setClangOnly:(BOOL)arg1;
+ (id)auxDataSourceVersion;
+ (id)auxDataSource;
+ (void)initialize;
@property(nonatomic) double throttleFactor; // @synthesize throttleFactor=_throttleFactor;
@property(readonly, nonatomic) IDEIndex *index; // @synthesize index=_index;
- (void)reset;
- (void)abort:(dispatch_block_t)arg1;
@property(readonly, nonatomic) BOOL hasHeldJobs;
@property(readonly, nonatomic) BOOL isLoading;
@property(readonly, nonatomic) BOOL isActive;
@property(readonly, nonatomic) BOOL isQuiescent;
- (void)_endActivity;
- (void)_endFileActivity;
- (void)_reportProgress;
- (void)_startFileActivity;
- (void)_startActivity;
- (void)_purgeStaleData;
- (void)_writeAuxiliaryFiles;
- (void)_writeWorkspaceHeaderMap;
- (void)_setRootPaths:(id)arg1 forIndexable:(id)arg2;
- (void)didForgetFiles:(id)arg1;
- (void)didEndImportSession:(id)arg1;
- (void)_scheduleJobs;
- (void)didCancelJob:(id)arg1;
- (void)didCompleteJob:(id)arg1;
- (BOOL)shouldRunJob:(id)arg1;
- (void)_deferJob:(id)arg1;
- (void)_cancelJobs;
- (void)_scheduleJob:(id)arg1;
- (void)prunePriorityFiles;
- (void)addPriorityFile:(id)arg1;
- (void)reportAutoQueryProgress:(double)arg1;
- (void)retryHeldJobs;
- (void)dontDeferJobForFile:(id)arg1 indexable:(id)arg2;
- (void)dontDeferJobs;
- (void)indexFile:(id)arg1 indexable:(id)arg2 dirtyFile:(id)arg3 settings:(id)arg4;
- (void)indexFile:(id)arg1 indexable:(id)arg2 dirtyFile:(id)arg3;
- (void)stopIndexing;
- (void)resumeIndexing;
- (void)suspendIndexing;
- (void)suspendIndexing:(BOOL)arg1;
- (void)clearHotFiles;
- (void)registerHotFile:(id)arg1;
- (void)doWhenFilesReady:(dispatch_block_t)arg1;
- (void)willRegisterMoreFiles:(BOOL)arg1;
- (void)unregisterFile:(id)arg1;
- (void)registerFile:(id)arg1;
- (void)unregisterIndexable:(id)arg1;
- (void)buildSettingsChanged:(id)arg1;
- (void)indexableChanged:(id)arg1 addOnly:(BOOL)arg2;
- (void)registerIndexable:(id)arg1;
- (void)dealloc;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)initWithIndex:(id)arg1;

@end


text:
package org.wso2.carbon.apimgt.rest.api.store.dto;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.wso2.carbon.apimgt.rest.api.store.dto.CompositeAPIInfoDTO;
import java.util.Objects;

/**
 * CompositeAPIListDTO
 */
public class CompositeAPIListDTO   {
  @SerializedName("count")
  private Integer count = null;

  @SerializedName("next")
  private String next = null;

  @SerializedName("previous")
  private String previous = null;

  @SerializedName("list")
  private List<CompositeAPIInfoDTO> list = new ArrayList<CompositeAPIInfoDTO>();

  public CompositeAPIListDTO count(Integer count) {
    this.count = count;
    return this;
  }

   /**
   * Number of Composite APIs returned.
   * @return count
  **/
  @ApiModelProperty(value = "Number of Composite APIs returned. ")
  public Integer getCount() {
    return count;
  }

  public void setCount(Integer count) {
    this.count = count;
  }

  public CompositeAPIListDTO next(String next) {
    this.next = next;
    return this;
  }

   /**
   * Link to the next subset of resources qualified. Empty if no more resources are to be returned.
   * @return next
  **/
  @ApiModelProperty(value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
  public String getNext() {
    return next;
  }

  public void setNext(String next) {
    this.next = next;
  }

  public CompositeAPIListDTO previous(String previous) {
    this.previous = previous;
    return this;
  }

   /**
   * Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
   * @return previous
  **/
  @ApiModelProperty(value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
  public String getPrevious() {
    return previous;
  }

  public void setPrevious(String previous) {
    this.previous = previous;
  }

  public CompositeAPIListDTO list(List<CompositeAPIInfoDTO> list) {
    this.list = list;
    return this;
  }

  public CompositeAPIListDTO addListItem(CompositeAPIInfoDTO listItem) {
    this.list.add(listItem);
    return this;
  }

   /**
   * Get list
   * @return list
  **/
  @ApiModelProperty(value = "")
  public List<CompositeAPIInfoDTO> getList() {
    return list;
  }

  public void setList(List<CompositeAPIInfoDTO> list) {
    this.list = list;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CompositeAPIListDTO compositeAPIList = (CompositeAPIListDTO) o;
    return Objects.equals(this.count, compositeAPIList.count) &&
        Objects.equals(this.next, compositeAPIList.next) &&
        Objects.equals(this.previous, compositeAPIList.previous) &&
        Objects.equals(this.list, compositeAPIList.list);
  }

  @Override
  public int hashCode() {
    return Objects.hash(count, next, previous, list);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CompositeAPIListDTO {\n");

    sb.append("    count: ").append(toIndentedString(count)).append("\n");
    sb.append("    next: ").append(toIndentedString(next)).append("\n");
    sb.append("    previous: ").append(toIndentedString(previous)).append("\n");
    sb.append("    list: ").append(toIndentedString(list)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
package org.infinispan.spark.test

import org.apache.spark.sql.SparkSession
import org.apache.spark.{SparkConf, SparkContext}
import org.infinispan.spark.rdd.InfinispanRDD
import org.scalatest.{BeforeAndAfterAll, Suite}

/**
  * Trait to be mixed-in by tests that require a org.apache.spark.SparkContext
  *
  * @author gustavonalle
  */
trait Spark extends BeforeAndAfterAll {
   this: Suite with RemoteTest =>

   protected def getSparkConfig = new SparkConf().setMaster("local[8]").setAppName(this.getClass.getName).set("spark.driver.host", "127.0.0.1")

   protected var sc: SparkContext = _

   protected def getSparkSession = SparkSession.builder().config(getSparkConfig).getOrCreate()

   def createInfinispanRDD[K, V] = {
      new InfinispanRDD[K, V](sc, configuration = getConfiguration)
   }

   override protected def beforeAll(): Unit = {
      sc = new SparkContext(getSparkConfig)
      super.beforeAll()
   }

   override protected def afterAll(): Unit = {
      sc.stop()
      super.afterAll()
   }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
# Copyright 2016 Classmethod, Inc. or its affiliates. All Rights Reserved.
# Portions copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

BEGIN adaptation of:
https://github.com/awslabs/dynamodb-titan-storage-backend/blob/1.0.0/pom.xml#L2
 -->
    <modelVersion>4.0.0</modelVersion>
    <groupId>jp.classmethod</groupId>
    <artifactId>tupl-titan100-storage-backend</artifactId>
    <version>1.0.1</version>
    <packaging>jar</packaging>
    <name>Classmethod Tupl Storage Backend for Titan</name>
    <url>https://github.com/classmethod-aws/tupl-titan-storage-backend</url>
    <description>The Classmethod Tupl Storage Backend for Titan: Distributed Graph Database allows Titan graphs to use Tupl as a storage backend.</description>
    <scm>
        <connection>scm:git:git@github.com:classmethod/tupl-titan-storage-backend.git</connection>
        <developerConnection>scm:git:git@github.com:classmethod/tupl-titan-storage-backend.git</developerConnection>
        <url>git@github.com:classmethod/tupl-titan-storage-backend.git</url>
        <tag>titan1.0.0-${project.version}</tag>
    </scm>
    <organization>
        <name>Classmethod, Inc.</name>
        <url>http://classmethod.jp</url>
    </organization>
    <issueManagement>
        <url>https://github.com/classmethod/tupl-titan-storage-backend/issues</url>
    </issueManagement>
    <properties>
        <default.test.jvm.opts>-Xms256m -Xmx1280m
            -XX:+HeapDumpOnOutOfMemoryError</default.test.jvm.opts>
        <mem.jvm.opts>-Xms256m -Xmx768m -ea
            -XX:+HeapDumpOnOutOfMemoryError</mem.jvm.opts>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>
        <titan.version>1.0.0</titan.version>
        <tinkerpop.version>3.0.1-incubating</tinkerpop.version>
        <tupl.version>v1.3.0</tupl.version>
        <dependency.plugin.version>2.10</dependency.plugin.version>
        <maven.assembly.plugin.version>2.5.5</maven.assembly.plugin.version>
        <maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
        <maven.surefire.version>2.18.1</maven.surefire.version>
        <maven.resources.plugin.version>2.7</maven.resources.plugin.version>
        <exec.maven.plugin.version>1.2</exec.maven.plugin.version>
        <nexus.staging.maven.plugin.version>1.6.7</nexus.staging.maven.plugin.version>
        <maven.source.plugin.version>3.0.0</maven.source.plugin.version>
        <maven.javadoc.plugin.version>2.10.3</maven.javadoc.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <slf4j.version>1.7.12</slf4j.version>
        <opencsv.version>2.4</opencsv.version>
        <commons.logging.version>1.1.1</commons.logging.version>
        <hadoop.version>2.2.0</hadoop.version>
        <test.excluded.groups>com.thinkaurelius.titan.testcategory.MemoryTests,com.thinkaurelius.titan.testcategory.PerformanceTests,com.thinkaurelius.titan.testcategory.BrittleTests,com.thinkaurelius.titan.testcategory.UnorderedKeyStoreTests,com.thinkaurelius.titan.testcategory.SerialTests</test.excluded.groups>
    </properties>
    <developers>
        <developer>
            <name>Alexander Patrikalakis</name>
            <email>amcp@me.com</email>
            <organization>Classmethod, Inc.</organization>
            <organizationUrl>classmethod.jp</organizationUrl>
            <url>https://www.linkedin.com/in/amcpatrix/en</url>
        </developer>
    </developers>
    <inceptionYear>2016</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <!-- Libraries -->
    <dependencies>
        <dependency>
            <groupId>com.github.cojen</groupId>
            <artifactId>Tupl</artifactId>
            <version>${tupl.version}</version>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-core</artifactId>
            <version>${titan.version}</version>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-test</artifactId>
            <version>${titan.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-es</artifactId>
            <version>${titan.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>au.com.bytecode</groupId>
            <artifactId>opencsv</artifactId>
            <version>${opencsv.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!-- Gremlin -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-core</artifactId>
            <version>${tinkerpop.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-groovy</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-test</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- for Gremlin console -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-console</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <!-- Use the integration-tests profile below -->
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${dependency.plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus.staging.maven.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.version}</version>
                        <executions>
                            <execution>
                                <id>surefire-it</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>start-gremlin</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>${exec.maven.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <configuration>
                                    <executable>java</executable>
                                    <arguments>
                                        <argument>-cp</argument>
                                        <argument>${basedir}/target/dependencies/*${path.separator}${basedir}/target/tupl-titan100-storage-backend-${project.version}.jar</argument>
                                        <argument>org.apache.tinkerpop.gremlin.console.Console</argument>
                                    </arguments>
                                </configuration>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- END adaptation of: https://github.com/awslabs/dynamodb-titan-storage-backend/blob/1.0.0/pom.xml#L339 -->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
</project>


text:
"""Remote Thermalblock demo.

Usage:
  thermalblock.py [-eh] [--estimator-norm=NORM] [--extension-alg=ALG] [--grid=NI] [--help]
                  [--reductor=RED] [--test=COUNT] XBLOCKS YBLOCKS SNAPSHOTS RBSIZE

Arguments:
  XBLOCKS    Number of blocks in x direction.

  YBLOCKS    Number of blocks in y direction.

  SNAPSHOTS  Number of snapshots for basis generation per component.
             In total SNAPSHOTS^(XBLOCKS * YBLOCKS).

  RBSIZE     Size of the reduced basis

Options:
  -e, --with-estimator   Use error estimator.

  --estimator-norm=NORM  Norm (trivial, h1) in which to calculate the residual
                         [default: trivial].

  --extension-alg=ALG    Basis extension algorithm (trivial, gram_schmidt, h1_gram_schmidt)
                         to be used [default: h1_gram_schmidt].

  --grid=NI              Use grid with 2*NI*NI elements [default: 100].

  -h, --help             Show this message.

  --reductor=RED         Reduction algorithm (default, numpy_default) [default: default].

  --test=COUNT           Use COUNT snapshots for stochastic error estimation
                         [default: 10].
"""

from __future__ import absolute_import, division, print_function

import sys
import time
from functools import partial

import numpy as np
from docopt import docopt

from pymor.core import logger
logger.MAX_HIERACHY_LEVEL = 2
from pymor.algorithms.greedy import greedy
from pymor.algorithms.basisextension import trivial_basis_extension, gram_schmidt_basis_extension
from pymor.reductors.linear import reduce_stationary_affine_linear
logger.getLogger('pymor.algorithms').setLevel('INFO')
logger.getLogger('pymor.discretizations').setLevel('INFO')
logger.getLogger('pymor.la').setLevel('INFO')

def thermalblock_demo(args):
    args['XBLOCKS'] = int(args['XBLOCKS'])
    args['YBLOCKS'] = int(args['YBLOCKS'])
    args['--grid'] = int(args['--grid'])
    args['SNAPSHOTS'] = int(args['SNAPSHOTS'])
    args['RBSIZE'] = int(args['RBSIZE'])
    args['--test'] = int(args['--test'])
    args['--estimator-norm'] = args['--estimator-norm'].lower()
    assert args['--estimator-norm'] in {'trivial', 'h1'}
    args['--extension-alg'] = args['--extension-alg'].lower()
    assert args['--extension-alg'] in {'trivial', 'gram_schmidt', 'h1_gram_schmidt'}
    args['--reductor'] = args['--reductor'].lower()
    assert args['--reductor'] in {'default', 'numpy_default'}

    import IPython.parallel as p
    from pymor.playground.remote import setup_remote, RemoteStationaryDiscretization

    rc = p.Client()
    rv = rc[0]

    print('Discretize ...')
    rv.execute('''
import numpy as np

import pymor.core as core
core.logger.MAX_HIERACHY_LEVEL = 2
from pymor.analyticalproblems import ThermalBlockProblem
from pymor.discretizers import discretize_elliptic_cg
core.getLogger('pymor.algorithms').setLevel('INFO')
core.getLogger('pymor.discretizations').setLevel('INFO')
core.getLogger('pymor.la').setLevel('INFO')

print('Setup Problem ...')
problem = ThermalBlockProblem(num_blocks=({nx}, {ny}))

print('Discretize ...')
discretization, _ = discretize_elliptic_cg(problem, diameter=m.sqrt(2) / {grid})
'''.format(nx=args['XBLOCKS'], ny=args['YBLOCKS'], grid=args['--grid']))

    discretization_id = setup_remote(rv, 'discretization')
    discretization = RemoteStationaryDiscretization(rv, discretization_id)

    print('The parameter type is {}'.format(discretization.parameter_type))

    print('RB generation ...')

    error_product = discretization.h1_product if args['--estimator-norm'] == 'h1' else None
    reductors = {'default': partial(reduce_stationary_affine_linear, error_product=error_product)}
    reductor = reductors[args['--reductor']]
    extension_algorithms = {'trivial': trivial_basis_extension,
                            'gram_schmidt': gram_schmidt_basis_extension,
                            'h1_gram_schmidt': partial(gram_schmidt_basis_extension, product=discretization.h1_product)}
    extension_algorithm = extension_algorithms[args['--extension-alg']]
    greedy_data = greedy(discretization, reductor, discretization.parameter_space.sample_uniformly(args['SNAPSHOTS']),
                         use_estimator=args['--with-estimator'], error_norm=discretization.h1_norm,
                         initial_basis=discretization.operator.type_source.empty(dim=discretization.operator.dim_source),  # NOQA
                         extension_algorithm=extension_algorithm, max_extensions=args['RBSIZE'])
    rb_discretization, reconstructor = greedy_data['reduced_discretization'], greedy_data['reconstructor']

    print('\nSearching for maximum error on random snapshots ...')

    tic = time.time()
    h1_err_max = -1
    cond_max = -1
    for mu in discretization.parameter_space.sample_randomly(args['--test']):
        print('Solving RB-Scheme for mu = {} ... '.format(mu), end='')
        URB = reconstructor.reconstruct(rb_discretization.solve(mu))
        U = discretization.solve(mu)
        h1_err = discretization.h1_norm(U - URB)[0]
        cond = np.linalg.cond(rb_discretization.operator.assemble(mu)._matrix)
        if h1_err > h1_err_max:
            h1_err_max = h1_err
            Umax = U
            URBmax = URB
            mumax = mu
        if cond > cond_max:
            cond_max = cond
            cond_max_mu = mu
        print('H1-error = {}, condition = {}'.format(h1_err, cond))
    toc = time.time()
    t_est = toc - tic
    real_rb_size = len(greedy_data['basis'])

    print('''
    *** RESULTS ***

    Problem:
       number of blocks:                   {args[XBLOCKS]}x{args[YBLOCKS]}
       h:                                  sqrt(2)/{args[--grid]}

    Greedy basis generation:
       number of snapshots:                {args[SNAPSHOTS]}^({args[XBLOCKS]}x{args[YBLOCKS]})
       used estimator:                     {args[--with-estimator]}
       estimator norm:                     {args[--estimator-norm]}
       extension method:                   {args[--extension-alg]}
       prescribed basis size:              {args[RBSIZE]}
       actual basis size:                  {real_rb_size}
       elapsed time:                       {greedy_data[time]}

    Stochastic error estimation:
       number of samples:                  {args[--test]}
       maximal H1-error:                   {h1_err_max}  (mu = {mumax})
       maximal condition of system matrix: {cond_max}  (mu = {cond_max_mu})
       elapsed time:                       {t_est}
    '''.format(**locals()))

    sys.stdout.flush()

if __name__ == '__main__':
    # parse arguments
    args = docopt(__doc__)
    # run demo
    thermalblock_demo(args)


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";
const HarmonyImportDependency = require("./HarmonyImportDependency");

class HarmonyAcceptImportDependency extends HarmonyImportDependency {
	constructor(request, originModule, parserScope) {
		super(request, originModule, NaN, parserScope);
		this.weak = true;
	}

	get type() {
		return "harmony accept";
	}
}

HarmonyAcceptImportDependency.Template = class HarmonyAcceptImportDependencyTemplate extends HarmonyImportDependency.Template {
	apply(dep, source, runtime) {}
};

module.exports = HarmonyAcceptImportDependency;


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
<meta name="generator" content="joDoc">
<title>Apache Cordova API Documentation</title>
<link rel="stylesheet" type="text/css" href="index.css">
<link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width: 1024px)">
<link rel="stylesheet" type="text/css" href="prettify/prettify.css">

Apache Cordova Documentation

                <select><optgroup label="English" value="en">
<option value="edge">edge</option>
<option value="2.9.0rc1">2.9.0rc1</option>
<option value="2.9.0">2.9.0</option>
<option value="2.8.0">2.8.0</option>
<option value="2.7.0rc1">2.7.0rc1</option>
<option value="2.7.0">2.7.0</option>
<option value="2.6.0rc1">2.6.0rc1</option>
<option value="2.6.0">2.6.0</option>
<option value="2.5.0rc1">2.5.0rc1</option>
<option value="2.5.0">2.5.0</option>
<option value="2.4.0rc1">2.4.0rc1</option>
<option value="2.4.0">2.4.0</option>
<option value="2.3.0rc2">2.3.0rc2</option>
<option value="2.3.0rc1">2.3.0rc1</option>
<option value="2.3.0">2.3.0</option>
<option value="2.2.0rc2">2.2.0rc2</option>
<option value="2.2.0rc1">2.2.0rc1</option>
<option value="2.2.0">2.2.0</option>
<option value="2.1.0rc2">2.1.0rc2</option>
<option value="2.1.0rc1">2.1.0rc1</option>
<option selected value="2.1.0">2.1.0</option>
<option value="2.0.0rc1">2.0.0rc1</option>
<option value="2.0.0">2.0.0</option>
<option value="1.9.0rc1">1.9.0rc1</option>
<option value="1.9.0">1.9.0</option>
<option value="1.8.1">1.8.1</option>
<option value="1.8.0rc1">1.8.0rc1</option>
<option value="1.8.0">1.8.0</option>
<option value="1.7.0rc1">1.7.0rc1</option>
<option value="1.7.0">1.7.0</option>
<option value="1.6.1">1.6.1</option>
<option value="1.6.0rc1">1.6.0rc1</option>
<option value="1.6.0">1.6.0</option>
<option value="1.5.0rc1">1.5.0rc1</option>
<option value="1.5.0">1.5.0</option>
</optgroup>
<optgroup label="Japanese" value="jp">
<option value="2.2.0">2.2.0</option>
<option value="2.1.0">2.1.0</option>
<option value="2.0.0">2.0.0</option>
<option value="1.9.0">1.9.0</option>
<option value="1.8.1">1.8.1</option>
<option value="1.7.0">1.7.0</option>
</optgroup>
<optgroup label="Korean" value="kr"><option value="2.0.0">2.0.0</option></optgroup></select>

camera.cleanup

            <select><option value="camera.cleanup">camera.cleanup</option>
<option value="camera.cleanup_description">      - Description</option>
<option value="camera.cleanup_supported_platforms">      - Supported Platforms</option>
<option value="camera.cleanup_example">      - Example</option></select>

API Reference

Accelerometer

Camera

Capture

Compass

Connection

Contacts

Device

Events

File

Geolocation

Media

Notification

Storage

Guides

Getting Started Guides

Command-Line Usage

Upgrading Guides

Plugin Development Guide

Domain Whitelist Guide

Embedding WebView

Keyword Index

camera.cleanup

Cleans up the image files that were taken by the camera, that were stored in a temporary storage location.

navigator.camera.cleanup( cameraSuccess, cameraError );

Description

Cleans up the image files stored in the temporary storage location, when the function camera.getPicture is used with  Camera.sourceType = Camera.PictureSourceType.CAMERA and Camera.destinationType = Camera.DestinationType.FILE_URI

Supported Platforms

iOS

Example

navigator.camera.cleanup(onSuccess, onFail);

function onSuccess() {
    console.log("Camera cleanup success.")
}

function onFail(message) {
    alert('Failed because: ' + message);
}