text:
package pack

import (
	"archive/tar"
	"archive/zip"
	"compress/gzip"
	"flag"
	"fmt"
	"io"
	"os"
	"os/exec"
	path "path/filepath"
	"regexp"
	"runtime"
	"sort"
	"strconv"
	"strings"
	"syscall"
	"time"

	"github.com/beego/bee/cmd/commands"
	"github.com/beego/bee/cmd/commands/version"
	beeLogger "github.com/beego/bee/logger"
	"github.com/beego/bee/utils"
)

var CmdPack = &commands.Command{
	CustomFlags: true,
	UsageLine:   "pack",
	Short:       "Compresses a Beego application into a single file",
	Long: `Pack is used to compress Beego applications into a tarball/zip file.
  This eases the deployment by directly extracting the file to a server.

  {{"Example:"|bold}}
    $ bee pack -v -ba="-ldflags '-s -w'"
`,
	PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() },
	Run:    packApp,
}

var (
	appPath   string
	excludeP  string
	excludeS  string
	outputP   string
	excludeR  utils.ListOpts
	fsym      bool
	ssym      bool
	build     bool
	buildArgs string
	buildEnvs utils.ListOpts
	verbose   bool
	format    string
)

func init() {
	fs := flag.NewFlagSet("pack", flag.ContinueOnError)
	fs.StringVar(&appPath, "p", "", "Set the application path. Defaults to the current path.")
	fs.BoolVar(&build, "b", true, "Tell the command to do a build for the current platform. Defaults to true.")
	fs.StringVar(&buildArgs, "ba", "", "Specify additional args for Go build.")
	fs.Var(&buildEnvs, "be", "Specify additional env variables for Go build. e.g. GOARCH=arm.")
	fs.StringVar(&outputP, "o", "", "Set the compressed file output path. Defaults to the current path.")
	fs.StringVar(&format, "f", "tar.gz", "Set file format. Either tar.gz or zip. Defaults to tar.gz.")
	fs.StringVar(&excludeP, "exp", ".", "Set prefixes of paths to be excluded. Uses a column (:) as separator.")
	fs.StringVar(&excludeS, "exs", ".go:.DS_Store:.tmp", "Set suffixes of paths to be excluded. Uses a column (:) as separator.")
	fs.Var(&excludeR, "exr", "Set a regular expression of files to be excluded.")
	fs.BoolVar(&fsym, "fs", false, "Tell the command to follow symlinks. Defaults to false.")
	fs.BoolVar(&ssym, "ss", false, "Tell the command to skip symlinks. Defaults to false.")
	fs.BoolVar(&verbose, "v", false, "Be more verbose during the operation. Defaults to false.")
	CmdPack.Flag = *fs
	commands.AvailableCommands = append(commands.AvailableCommands, CmdPack)
}

type walker interface {
	isExclude(string) bool
	isEmpty(string) bool
	relName(string) string
	virPath(string) string
	compress(string, string, os.FileInfo) (bool, error)
	walkRoot(string) error
}

type byName []os.FileInfo

func (f byName) Len() int           { return len(f) }
func (f byName) Less(i, j int) bool { return f[i].Name() < f[j].Name() }
func (f byName) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }

type walkFileTree struct {
	wak           walker
	prefix        string
	excludePrefix []string
	excludeRegexp []*regexp.Regexp
	excludeSuffix []string
	allfiles      map[string]bool
	output        *io.Writer
}

func (wft *walkFileTree) isExclude(fPath string) bool {
	if fPath == "" {
		return true
	}

	for _, prefix := range wft.excludePrefix {
		if strings.HasPrefix(fPath, prefix) {
			return true
		}
	}
	for _, suffix := range wft.excludeSuffix {
		if strings.HasSuffix(fPath, suffix) {
			return true
		}
	}
	return false
}

func (wft *walkFileTree) isExcludeName(name string) bool {
	for _, r := range wft.excludeRegexp {
		if r.MatchString(name) {
			return true
		}
	}

	return false
}

func (wft *walkFileTree) isEmpty(fpath string) bool {
	fh, _ := os.Open(fpath)
	defer fh.Close()
	infos, _ := fh.Readdir(-1)
	for _, fi := range infos {
		fn := fi.Name()
		fp := path.Join(fpath, fn)
		if wft.isExclude(wft.virPath(fp)) {
			continue
		}
		if wft.isExcludeName(fn) {
			continue
		}
		if fi.Mode()&os.ModeSymlink > 0 {
			continue
		}
		if fi.IsDir() && wft.isEmpty(fp) {
			continue
		}
		return false
	}
	return true
}

func (wft *walkFileTree) relName(fpath string) string {
	name, _ := path.Rel(wft.prefix, fpath)
	return name
}

func (wft *walkFileTree) virPath(fpath string) string {
	name := fpath[len(wft.prefix):]
	if name == "" {
		return ""
	}
	name = name[1:]
	name = path.ToSlash(name)
	return name
}

func (wft *walkFileTree) readDir(dirname string) ([]os.FileInfo, error) {
	f, err := os.Open(dirname)
	if err != nil {
		return nil, err
	}
	list, err := f.Readdir(-1)
	f.Close()
	if err != nil {
		return nil, err
	}
	sort.Sort(byName(list))
	return list, nil
}

func (wft *walkFileTree) walkLeaf(fpath string, fi os.FileInfo, err error) error {
	if err != nil {
		return err
	}

	if fpath == outputP {
		return nil
	}

	if fi.IsDir() {
		return nil
	}

	if ssym && fi.Mode()&os.ModeSymlink > 0 {
		return nil
	}

	name := wft.virPath(fpath)

	if wft.allfiles[name] {
		return nil
	}

	if added, err := wft.wak.compress(name, fpath, fi); added {
		if verbose {
			fmt.Fprintf(*wft.output, "\t%s%scompressed%s\t %s%s\n", "\x1b[32m", "\x1b[1m", "\x1b[21m", name, "\x1b[0m")
		}
		wft.allfiles[name] = true
		return err
	}
	return err
}

func (wft *walkFileTree) iterDirectory(fpath string, fi os.FileInfo) error {
	doFSym := fsym && fi.Mode()&os.ModeSymlink > 0
	if doFSym {
		nfi, err := os.Stat(fpath)
		if os.IsNotExist(err) {
			return nil
		}
		fi = nfi
	}

	relPath := wft.virPath(fpath)

	if len(relPath) > 0 {
		if wft.isExcludeName(fi.Name()) {
			return nil
		}

		if wft.isExclude(relPath) {
			return nil
		}
	}

	err := wft.walkLeaf(fpath, fi, nil)
	if err != nil {
		if fi.IsDir() && err == path.SkipDir {
			return nil
		}
		return err
	}

	if !fi.IsDir() {
		return nil
	}

	list, err := wft.readDir(fpath)
	if err != nil {
		return wft.walkLeaf(fpath, fi, err)
	}

	for _, fileInfo := range list {
		err = wft.iterDirectory(path.Join(fpath, fileInfo.Name()), fileInfo)
		if err != nil {
			if !fileInfo.IsDir() || err != path.SkipDir {
				return err
			}
		}
	}
	return nil
}

func (wft *walkFileTree) walkRoot(root string) error {
	wft.prefix = root
	fi, err := os.Stat(root)
	if err != nil {
		return err
	}
	return wft.iterDirectory(root, fi)
}

type tarWalk struct {
	walkFileTree
	tw *tar.Writer
}

func (wft *tarWalk) compress(name, fpath string, fi os.FileInfo) (bool, error) {
	isSym := fi.Mode()&os.ModeSymlink > 0
	link := ""
	if isSym {
		link, _ = os.Readlink(fpath)
	}

	hdr, err := tar.FileInfoHeader(fi, link)
	if err != nil {
		return false, err
	}
	hdr.Name = name

	tw := wft.tw
	err = tw.WriteHeader(hdr)
	if err != nil {
		return false, err
	}

	if !isSym {
		fr, err := os.Open(fpath)
		if err != nil {
			return false, err
		}
		defer utils.CloseFile(fr)
		_, err = io.Copy(tw, fr)
		if err != nil {
			return false, err
		}
		tw.Flush()
	}

	return true, nil
}

type zipWalk struct {
	walkFileTree
	zw *zip.Writer
}

func (wft *zipWalk) compress(name, fpath string, fi os.FileInfo) (bool, error) {
	isSym := fi.Mode()&os.ModeSymlink > 0

	hdr, err := zip.FileInfoHeader(fi)
	if err != nil {
		return false, err
	}
	hdr.Name = name

	zw := wft.zw
	w, err := zw.CreateHeader(hdr)
	if err != nil {
		return false, err
	}

	if !isSym {
		fr, err := os.Open(fpath)
		if err != nil {
			return false, err
		}
		defer utils.CloseFile(fr)
		_, err = io.Copy(w, fr)
		if err != nil {
			return false, err
		}
	} else {
		var link string
		if link, err = os.Readlink(fpath); err != nil {
			return false, err
		}
		_, err = w.Write([]byte(link))
		if err != nil {
			return false, err
		}
	}

	return true, nil
}

func packDirectory(output io.Writer, excludePrefix []string, excludeSuffix []string,
	excludeRegexp []*regexp.Regexp, includePath ...string) (err error) {

	beeLogger.Log.Infof("Excluding relpath prefix: %s", strings.Join(excludePrefix, ":"))
	beeLogger.Log.Infof("Excluding relpath suffix: %s", strings.Join(excludeSuffix, ":"))
	if len(excludeRegexp) > 0 {
		beeLogger.Log.Infof("Excluding filename regex: `%s`", strings.Join(excludeR, "`, `"))
	}

	w, err := os.OpenFile(outputP, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
	if err != nil {
		return err
	}

	var wft walker

	if format == "zip" {
		walk := new(zipWalk)
		walk.output = &output
		zw := zip.NewWriter(w)
		defer func() {
			zw.Close()
		}()
		walk.allfiles = make(map[string]bool)
		walk.zw = zw
		walk.wak = walk
		walk.excludePrefix = excludePrefix
		walk.excludeSuffix = excludeSuffix
		walk.excludeRegexp = excludeRegexp
		wft = walk
	} else {
		walk := new(tarWalk)
		walk.output = &output
		cw := gzip.NewWriter(w)
		tw := tar.NewWriter(cw)

		defer func() {
			tw.Flush()
			cw.Flush()
			tw.Close()
			cw.Close()
		}()
		walk.allfiles = make(map[string]bool)
		walk.tw = tw
		walk.wak = walk
		walk.excludePrefix = excludePrefix
		walk.excludeSuffix = excludeSuffix
		walk.excludeRegexp = excludeRegexp
		wft = walk
	}

	for _, p := range includePath {
		err = wft.walkRoot(p)
		if err != nil {
			return
		}
	}

	return
}

func packApp(cmd *commands.Command, args []string) int {
	output := cmd.Out()
	curPath, _ := os.Getwd()
	thePath := ""

	nArgs := []string{}
	has := false
	for _, a := range args {
		if a != "" && a[0] == '-' {
			has = true
		}
		if has {
			nArgs = append(nArgs, a)
		}
	}
	cmd.Flag.Parse(nArgs)

	if !path.IsAbs(appPath) {
		appPath = path.Join(curPath, appPath)
	}

	thePath, err := path.Abs(appPath)
	if err != nil {
		beeLogger.Log.Fatalf("Wrong application path: %s", thePath)
	}
	if stat, err := os.Stat(thePath); os.IsNotExist(err) || !stat.IsDir() {
		beeLogger.Log.Fatalf("Application path does not exist: %s", thePath)
	}

	beeLogger.Log.Infof("Packaging application on '%s'...", thePath)

	appName := path.Base(thePath)

	goos := runtime.GOOS
	if v, found := syscall.Getenv("GOOS"); found {
		goos = v
	}
	goarch := runtime.GOARCH
	if v, found := syscall.Getenv("GOARCH"); found {
		goarch = v
	}

	str := strconv.FormatInt(time.Now().UnixNano(), 10)[9:]

	tmpdir := path.Join(os.TempDir(), "beePack-"+str)

	os.Mkdir(tmpdir, 0700)
	defer func() {
		// Remove the tmpdir once bee pack is done
		err := os.RemoveAll(tmpdir)
		if err != nil {
			beeLogger.Log.Error("Failed to remove the generated temp dir")
		}
	}()

	if build {
		beeLogger.Log.Info("Building application...")
		var envs []string
		for _, env := range buildEnvs {
			parts := strings.SplitN(env, "=", 2)
			if len(parts) == 2 {
				k, v := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1])
				if len(k) > 0 && len(v) > 0 {
					switch k {
					case "GOOS":
						goos = v
					case "GOARCH":
						goarch = v
					default:
						envs = append(envs, fmt.Sprintf("%s=%s", k, v))
					}
				}
			}
		}

		os.Setenv("GOOS", goos)
		os.Setenv("GOARCH", goarch)

		beeLogger.Log.Infof("Using: GOOS=%s GOARCH=%s", goos, goarch)

		binPath := path.Join(tmpdir, appName)
		if goos == "windows" {
			binPath += ".exe"
		}

		args := []string{"build", "-o", binPath}
		if len(buildArgs) > 0 {
			args = append(args, strings.Fields(buildArgs)...)
		}

		if verbose {
			fmt.Fprintf(output, "\t%s%s+ go %s%s%s\n", "\x1b[32m", "\x1b[1m", strings.Join(args, " "), "\x1b[21m", "\x1b[0m")
		}

		execmd := exec.Command("go", args...)
		execmd.Env = append(os.Environ(), envs...)
		execmd.Stdout = os.Stdout
		execmd.Stderr = os.Stderr
		execmd.Dir = thePath
		err = execmd.Run()
		if err != nil {
			beeLogger.Log.Fatal(err.Error())
		}

		beeLogger.Log.Success("Build Successful!")
	}

	switch format {
	case "zip":
	default:
		format = "tar.gz"
	}

	outputN := appName + "." + format

	if outputP == "" || !path.IsAbs(outputP) {
		outputP = path.Join(curPath, outputP)
	}

	if _, err := os.Stat(outputP); err != nil {
		err = os.MkdirAll(outputP, 0755)
		if err != nil {
			beeLogger.Log.Fatal(err.Error())
		}
	}

	outputP = path.Join(outputP, outputN)

	var exp, exs []string
	for _, p := range strings.Split(excludeP, ":") {
		if len(p) > 0 {
			exp = append(exp, p)
		}
	}
	for _, p := range strings.Split(excludeS, ":") {
		if len(p) > 0 {
			exs = append(exs, p)
		}
	}

	var exr []*regexp.Regexp
	for _, r := range excludeR {
		if len(r) > 0 {
			if re, err := regexp.Compile(r); err != nil {
				beeLogger.Log.Fatal(err.Error())
			} else {
				exr = append(exr, re)
			}
		}
	}

	beeLogger.Log.Infof("Writing to output: %s", outputP)

	err = packDirectory(output, exp, exs, exr, tmpdir, thePath)
	if err != nil {
		beeLogger.Log.Fatal(err.Error())
	}

	beeLogger.Log.Success("Application packed!")
	return 0
}


text:
@interface AKANSAlertWindowMatcher ()

@end

@implementation AKANSAlertWindowMatcher

+ (instancetype)matcher
{
	return [[self alloc] init];
}

#pragma mark AKAViewMatcher methods

- (BOOL)matchesWindow:(NSWindow *)window
{
	return [window isKindOfClass:[NSPanel class]];
}

- (NSString *)debugDescription
{
	return @"is alert";
}

@end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="sulu_core.rest_helper.class">Sulu\Component\Rest\RestHelper</parameter>
        <parameter key="sulu_core.doctrine_rest_helper.class">Sulu\Component\Rest\DoctrineRestHelper</parameter>
        <parameter key="sulu_core.list_rest_helper.class">Sulu\Component\Rest\ListBuilder\ListRestHelper</parameter>
        <parameter key="sulu_core.doctrine_list_builder_factory.class">Sulu\Component\Rest\ListBuilder\Doctrine\DoctrineListBuilderFactory</parameter>
        <parameter key="sulu_core.rest.datetime_handler.class">Sulu\Component\Rest\Handler\DateHandler</parameter>
    </parameters>

    <services>
        <service id="sulu_core.rest_helper" class="%sulu_core.rest_helper.class%" scope="request">
            <argument type="service" id="sulu_core.list_rest_helper"/>
        </service>

        <service id="sulu_core.doctrine_rest_helper" class="%sulu_core.doctrine_rest_helper.class%" scope="request">
            <argument type="service" id="sulu_core.list_rest_helper"/>
        </service>

        <service id="sulu_core.list_rest_helper" class="%sulu_core.list_rest_helper.class%" scope="request">
            <argument type="service" id="request"/>
        </service>

        <service id="sulu_core.rest.exception_wrapper_handler" class="Sulu\Component\Rest\ExceptionWrapperHandler"/>

        <service id="sulu_core.doctrine_list_builder_factory" class="%sulu_core.doctrine_list_builder_factory.class%">
            <argument type="service" id="doctrine.orm.entity_manager"/>
            <argument type="service" id="event_dispatcher"/>
            <argument>%sulu_security.permissions%</argument>
        </service>

        <service id="sulu_core.rest.datetime_handler" class="%sulu_core.rest.datetime_handler.class%">
            <tag name="jms_serializer.subscribing_handler" />
        </service>

        <service id="sulu_core.rest.view_handler.csv" class="Sulu\Component\Rest\Csv\CsvHandler">
            <argument type="service" id="serializer"/>
        </service>
    </services>
</container>


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using Serilog;

namespace Calculator.GestureTraining
{
    public partial class GestureTrainingPage
    {
        private static ILogger Log { get; } = Serilog.Log.ForContext<GestureTrainingPage>();

        public GestureTrainingPage()
        {
            DataContextChanged += OnDataContextChanged;

            try
            {
                InitializeComponent();
            }
            catch (Exception e)
            {
                Log.Error(e, e.Message);
                throw;
            }
        }

        private static void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            var viewModel = (GestureTrainingPageViewModel)args.NewValue;
            Debug.Assert(viewModel != null, "ViewModel was null");

            ApplyTrainingSet(viewModel.PathSamples);
            viewModel.PathNamesToLoad.Value = GetCharactersToLoad().Select(c => c.ToString());

            Log.Information("Loading strokes from file...");
            if (viewModel.LoadCommand.CanExecute())
            {
                viewModel.LoadCommand.Execute(null);
            }
        }

        private static void ApplyTrainingSet(ICollection<PathSampleViewModel> pathSamples)
        {
            pathSamples.Clear();
            foreach (var pathSample in CreateTrainingSet())
            {
                pathSamples.Add(pathSample);
            }
        }

        private static IEnumerable<PathSampleViewModel> CreateTrainingSet()
        {
            var characters = GetCharactersToLoad();
            return characters.ToTrainingSet();
        }

        private static IEnumerable<char> GetCharactersToLoad()
        {
            var numbers = Enumerable.Range(48, 10).ToChars();
            var smallCharacters = Enumerable.Range(97, 26).ToChars();
            var upperCharacters = Enumerable.Range(65, 26).ToChars();
            var characters = numbers.Concat(smallCharacters).Concat(upperCharacters);
            return characters;
        }
    }
}


text: ![](../../plugins/@PLUGIN_KEY@/images/parameters/Revert_panel.png)


text:
const { constants } = require('mocha/lib/runner');
const BaseRunner = require('mocha/lib/reporters/base');

const {
	EVENT_TEST_BEGIN,
	EVENT_TEST_PASS,
	EVENT_TEST_FAIL,
	EVENT_RUN_BEGIN,
	EVENT_RUN_END,
} = constants;

/**
 * Similar to the mocha JSON stream, but includes additional information
 * on failure. Specifically, the mocha json-stream does not include unmangled
 * expected versus actual results.
 *
 * Writes a superset of the data that json-stream normally would.
 */
module.exports = class FullJsonStreamReporter extends BaseRunner {
	constructor(runner, options) {
		super(runner, options);

		const total = runner.total;
		runner.once(EVENT_RUN_BEGIN, () => writeEvent(['start', { total }]));
		runner.once(EVENT_RUN_END, () => writeEvent(['end', this.stats]));

		runner.on(EVENT_TEST_BEGIN, test => writeEvent(['testStart', clean(test)]));
		runner.on(EVENT_TEST_PASS, test => writeEvent(['pass', clean(test)]));
		runner.on(EVENT_TEST_FAIL, (test, err) => {
			test = clean(test);
			test.actual = err.actual;
			test.expected = err.expected;
			test.err = err.message;
			test.stack = err.stack || null;
			writeEvent(['fail', test]);
		});
	}
}

function writeEvent(event) {
	process.stdout.write(JSON.stringify(event) + '\n');
}

const clean = test => ({
	title: test.title,
	fullTitle: test.fullTitle(),
	duration: test.duration,
	currentRetry: test.currentRetry()
});


text:
#ifndef TENSORFLOW_CORE_TPU_KERNELS_TPU_UTIL_C_API_H_
#define TENSORFLOW_CORE_TPU_KERNELS_TPU_UTIL_C_API_H_

#include "tensorflow/core/tpu/kernels/tpu_mesh_state_c_api.h"
#include "tensorflow/core/tpu/libtftpu.h"
#include "tensorflow/stream_executor/tpu/proto_helper.h"

// Property for creating compilation cache key.
struct CompilationCacheKeyProperty {
  const char* config_prefix;
  const char* shapes_prefix;
  const char* function_name;
  const char* mlir_module;
  const int32_t* device_ids;
  size_t device_ids_size;
  int32_t guaranteed_constants_size;
  uint64_t function_library_fingerprint;
  int32_t num_cores_per_replica;
  int32_t num_replicas;
  const XLA_TpuMeshState* mesh_state;
};

// Compilation cache key result returning both the key and a more verbose debug
// version.
struct CompilationCacheKeyResult {
  const char* key;
  const char* debug_string;
};

extern "C" {

// Checks if whether a TPU compilation is enabled.
TFTPU_CAPI_EXPORT bool TpuCompile_IsTpuCompilationEnabled();

// XLA compilation cannot be cancelled. To avoid hanging the TF worker will exit
// when cancellation is requested for an XLA compile op. Some tests require this
// behavior to be disabled, and we test for this condition with the following
// flag function.
TFTPU_CAPI_EXPORT bool TpuCompile_ShouldTpuCompileOpIgnoreCancellation();

// Returns the number of available TPU core count.
TFTPU_CAPI_EXPORT int TpuTopology_AvailableCoreCount(
    const XLA_TpuMeshState* mesh_state, TpuCoreTypeEnum tpu_core_type);

// Recycle unused service port.
TFTPU_CAPI_EXPORT void TpuNetUtil_RecycleUnusedPort(int port);

// Creates a unique compilation cache `key` used for `put` and `get` operations.
// Returned buffers are heap-allocated and must be owned.
TFTPU_CAPI_EXPORT CompilationCacheKeyResult
TpuCompile_CreateCompilationCacheKey(CompilationCacheKeyProperty property);

// Destroys the CompilationCacheKeyResult returned by calling the
// `TpuCompile_CreateCompilationCacheKey` API.
TFTPU_CAPI_EXPORT void TpuCompile_DestroyCompilationCacheKey(
    CompilationCacheKeyResult result);

// Creates a guaranteed const fingerprint. Guarantee const is normally used in
// TPU inference to avoid re-copying unchanged variables onto the TPU device.
// It promises the value is identical for every execution in the same session
// even if the actual value changes in later executions.
TFTPU_CAPI_EXPORT uint64_t TpuCompile_CreateGuaranteedConstFingerprint(
    uint64_t fingerprint, const char* data, size_t size);

}  // extern "C"

struct TfTpu_UtilApiFn {
  TFTPU_ADD_FN_IN_STRUCT(TpuCompile_IsTpuCompilationEnabled);
  TFTPU_ADD_FN_IN_STRUCT(TpuCompile_ShouldTpuCompileOpIgnoreCancellation);
  TFTPU_ADD_FN_IN_STRUCT(TpuTopology_AvailableCoreCount);
  TFTPU_ADD_FN_IN_STRUCT(TpuNetUtil_RecycleUnusedPort);
  TFTPU_ADD_FN_IN_STRUCT(TpuCompile_CreateCompilationCacheKey);
  TFTPU_ADD_FN_IN_STRUCT(TpuCompile_DestroyCompilationCacheKey);
  TFTPU_ADD_FN_IN_STRUCT(TpuCompile_CreateGuaranteedConstFingerprint);
};

#endif  // TENSORFLOW_CORE_TPU_KERNELS_TPU_UTIL_C_API_H_


text:
"""Channels models"""
from uuid import uuid4

import base36
from bitfield import BitField
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fields import JSONField
from django.db import models

from widgets.models import WidgetList

from channels.constants import (
    ROLE_CHOICES,
    VALID_EXTENDED_POST_CHOICES,
    VALID_CHANNEL_CHOICES,
    LINK_TYPE_SELF,
    LINK_TYPE_LINK,
)
from channels.utils import (
    AVATAR_MEDIUM_MAX_DIMENSION,
    AVATAR_SMALL_MAX_DIMENSION,
    reddit_slugify,
    render_article_text,
)
from open_discussions.models import TimestampedModel
from open_discussions.utils import markdown_to_plain_text
from profiles.utils import (
    avatar_uri,
    avatar_uri_small,
    avatar_uri_medium,
    banner_uri,
    make_thumbnail,
    article_image_uri,
)

class Base36IntegerField(models.BigIntegerField):
    """Handles a Reddit base36 encoded string id which is stored as a base10 integer"""

    def get_prep_value(self, value):
        """Converts from base36 to base10 for the DB"""
        if value is not None:
            return base36.loads(value)
        return value

    def from_db_value(
        self, value, expression, connection
    ):  # pylint: disable=unused-argument
        """Converts from base10 to base36 for application"""
        if value is None:
            return value
        return base36.dumps(value)

    def to_python(self, value):
        """Converts from base10 to base36 for application"""
        if not value:
            return value

        return base36.dumps(value)

class RedditRefreshToken(models.Model):
    """
    Tracks the refresh token for a given user
    """

    user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

    token_value = models.CharField(null=True, max_length=255)

    def __str__(self):
        return "{}".format(self.token_value)

class RedditAccessToken(models.Model):
    """
    Tracks the access tokens for a given user

    We generate a new one whenever the latest one expires and then clean up stale ones in a cron
    """

    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

    token_value = models.CharField(null=True, max_length=255)
    token_expires_at = models.DateTimeField(null=True)

    @classmethod
    def valid_tokens_for_user(cls, user, threshold_date):
        """
        Returns a QuerySet for valid tokens for the user and threshold_date

        Args:
            user (User): the user to find tokens for
            threshold_date (datetime): the date before which the tokens should still be valid

        Returns:
            QuerySet: query set filtered to nonexpired tokens sorted by most recent first
        """
        return cls.objects.filter(
            user=user, token_expires_at__gt=threshold_date
        ).order_by("-token_expires_at")

    def __str__(self):
        return "{} expires: {}".format(self.token_value, self.token_expires_at)

class Subscription(TimestampedModel):
    """
    Tracks user subscriptions to a post or a comment
    """

    user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
        related_name="content_subscriptions",
    )
    post_id = Base36IntegerField()
    comment_id = Base36IntegerField(null=True)

    def __str__(self):
        """Prints the subscription as a str"""
        return "{} is subscribed to post_id: {}, comment_id: {}".format(
            self.user, self.post_id, self.comment_id
        )

    class Meta:
        unique_together = (("user", "post_id", "comment_id"),)
        index_together = (("post_id", "comment_id"),)

class Channel(TimestampedModel):
    """
    Keep track of channels which are stored in reddit
    """

    name = models.CharField(unique=True, max_length=100)
    title = models.CharField(max_length=100, null=True)
    membership_is_managed = models.BooleanField(default=False)

    avatar = models.ImageField(null=True, max_length=2083, upload_to=avatar_uri)
    avatar_small = models.ImageField(
        null=True, max_length=2083, upload_to=avatar_uri_small, blank=True
    )
    avatar_medium = models.ImageField(
        null=True, max_length=2083, upload_to=avatar_uri_medium, blank=True
    )
    banner = models.ImageField(
        null=True, max_length=2083, upload_to=banner_uri, blank=True
    )
    ga_tracking_id = models.CharField(max_length=24, blank=True, null=True)
    widget_list = models.ForeignKey(WidgetList, on_delete=models.SET_NULL, null=True)
    about = JSONField(blank=True, null=True)

    # Bitfield mutates the list passed to
    allowed_post_types = BitField(flags=VALID_EXTENDED_POST_CHOICES, null=True)
    channel_type = models.CharField(
        max_length=20, choices=VALID_CHANNEL_CHOICES, null=True
    )
    moderator_notifications = models.BooleanField(default=False, null=False)

    def save(
        self, *args, update_image=False, **kwargs
    ):  # pylint: disable=arguments-differ
        if update_image:
            if self.avatar:
                small_thumbnail = make_thumbnail(
                    self.avatar, AVATAR_SMALL_MAX_DIMENSION
                )
                medium_thumbnail = make_thumbnail(
                    self.avatar, AVATAR_MEDIUM_MAX_DIMENSION
                )

                # name doesn't matter here, we use upload_to to produce that
                self.avatar_small.save(f"{uuid4().hex}.jpg", small_thumbnail)
                self.avatar_medium.save(f"{uuid4().hex}.jpg", medium_thumbnail)
            else:
                self.avatar_small = None
                self.avatar_medium = None

        return super().save(*args, **kwargs)

    @property
    def subscribers(self):
        """
        Retrieve channel subscribers

        Returns:
            iterable of User: users who are channel subscribers

        """
        return User.objects.filter(
            is_active=True,
            id__in=ChannelSubscription.objects.filter(channel=self)
            .order_by("created_on")
            .values_list("user", flat=True),
        ).iterator()

    def __str__(self):
        return f"{self.name}"

class ChannelInvitation(TimestampedModel):
    """A pending invitation to a channel"""

    channel = models.ForeignKey(Channel, on_delete=models.CASCADE)
    inviter = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
        related_name="sent_invitations",
    )
    user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
        null=True,
        related_name="received_invitations",
    )
    email = models.EmailField()
    redeemed = models.BooleanField(default=False, db_index=True)

    class Meta:
        index_together = (("email", "redeemed"),)
        unique_together = (("channel", "email"),)

    def __str__(self):
        return f"Invitation to {self.channel.title} by {self.inviter.profile.name} for {self.email}"

class LinkMeta(TimestampedModel):
    """
    The thumbnail embedly provides for a particular URL
    """

    url = models.URLField(unique=True, max_length=2048)
    thumbnail = models.URLField(blank=True, null=True, max_length=2048)

    def __str__(self):
        return f"{self.url} with thumbnail {self.thumbnail}"

class Post(TimestampedModel):
    """Data model for posts"""

    channel = models.ForeignKey(Channel, on_delete=models.CASCADE)
    author = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
    link_meta = models.ForeignKey(LinkMeta, null=True, on_delete=models.CASCADE)

    post_id = Base36IntegerField(unique=True)
    post_type = models.CharField(
        max_length=10, choices=VALID_EXTENDED_POST_CHOICES, null=True
    )

    title = models.CharField(max_length=300, null=True)
    text = models.TextField(null=True)
    preview_text = models.TextField(null=True)
    url = models.URLField(max_length=2048, null=True)
    score = models.BigIntegerField(null=True)
    num_comments = models.BigIntegerField(null=True)
    edited = models.BooleanField(null=True)
    removed = models.BooleanField(null=True)
    deleted = models.BooleanField(null=True)
    exclude_from_frontpage_emails = models.BooleanField(null=True)

    @property
    def plain_text(self):
        """Returns a plaintext represention of the post"""
        if getattr(self, "article", None) is not None:
            return render_article_text(self.article.content)
        elif self.post_type == LINK_TYPE_SELF:
            return markdown_to_plain_text(self.text)
        elif self.post_type == LINK_TYPE_LINK:
            return self.preview_text
        return None

    @property
    def thumbnail_url(self):
        """Returns the url to the thumbnail"""
        return self.link_meta.thumbnail if self.link_meta is not None else None

    @property
    def slug(self):
        """Slugifies the post title"""
        return reddit_slugify(self.title)

    def __str__(self):
        return f"{self.post_id} on channel {self.channel}"

class Article(TimestampedModel):
    """Data for an article post_type"""

    author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    post = models.OneToOneField(Post, on_delete=models.CASCADE)
    cover_image = models.ImageField(
        null=True, blank=True, max_length=2083, upload_to=article_image_uri
    )
    content = JSONField()

    def __str__(self):
        return f"{self.post.id} on channel {self.post.channel} by {self.author.profile.name}"

class Comment(TimestampedModel):
    """Data model for post comments"""

    post = models.ForeignKey(Post, on_delete=models.CASCADE)
    author = models.ForeignKey(User, null=True, on_delete=models.CASCADE)

    comment_id = Base36IntegerField(unique=True)
    parent_id = Base36IntegerField(null=True)

    text = models.TextField(null=True)
    score = models.BigIntegerField(null=True)
    edited = models.BooleanField(null=True)
    removed = models.BooleanField(null=True)
    deleted = models.BooleanField(null=True)

    def __str__(self):
        return f"{self.comment_id} on post {self.post}"

class ChannelSubscription(TimestampedModel):
    """
    Keep track of channel subscribers
    """

    channel = models.ForeignKey(Channel, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

    class Meta:
        unique_together = (("user", "channel"),)

    def __str__(self):
        return f"User {self.user.username} subscription for Channel {self.channel.name}"

class ChannelGroupRole(TimestampedModel):
    """
    Keep track of channel moderators and contributors
    """

    channel = models.ForeignKey(Channel, on_delete=models.CASCADE)
    group = models.ForeignKey(Group, on_delete=models.CASCADE)
    role = models.CharField(max_length=48, choices=zip(ROLE_CHOICES, ROLE_CHOICES))

    class Meta:
        unique_together = (("channel", "group", "role"),)
        index_together = (("channel", "role"),)

    def __str__(self):
        return (
            f"Group {self.group.name} role {self.role} for Channel {self.channel.name}"
        )

class ChannelMembershipConfig(TimestampedModel):
    """Data model for managed channel membership configuration"""

    name = models.CharField(max_length=150)
    query = JSONField(default=dict)
    channels = models.ManyToManyField(
        Channel, related_name="channel_membership_configs"
    )

    def __str__(self):
        return self.name

class SpamCheckResult(TimestampedModel):
    """Data model for spam checks"""

    content_type = models.ForeignKey(
        ContentType,
        null=True,
        limit_choices_to={"model__in": ("post", "comment")},
        on_delete=models.CASCADE,
    )
    object_id = models.PositiveIntegerField(null=True)
    content_object = GenericForeignKey("content_type", "object_id")

    user_ip = models.CharField(max_length=256, null=True, blank=True)
    user_agent = models.TextField(null=True, blank=True)
    checks = models.IntegerField(default=1)
    is_spam = models.BooleanField(default=False)

    class Meta:
        unique_together = (("content_type", "object_id"),)
        index_together = (("content_type", "object_id"),)


text:
<?php

/*
 * This file is part of Sulu.
 *
 * (c) MASSIVE ART WebServices GmbH
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Sulu\Component\Websocket\Exception;

/**
 * Represents a missing Parameter.
 */
class MissingParameterException extends \Exception
{
    /**
     * @var string
     */
    private $name;

    public function __construct($name)
    {
        parent::__construct(sprintf('Parameter "%s" missing for preview', $name));

        $this->name = $name;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        return $this->getName();
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Marching Cubes Performance Test (Javascript)</title>

Marching Cubes Performance Test (Javascript)

This is a performance test of Marching cubes parallel implementation with WebWorkers.
 Volume values are generated with hyperboloid equation: x^2 + y^2 - z^2 - 25 with axes range [-10, 10]."

    <form style="margin-left: 20px;">

Test input:

            Custom input volume (optional):

            Select volume file:  <input type="file" id="volFile">

            Values data type:
            <select id="valueType">
                <option value="Int8Array">Char</option>
                <option value="Uint8Array">Unsigned char</option>
                <option value="Int16Array">Short</option>
                <option value="Uint16Array">Unsigned short</option>
                <option value="Int32Array">Integer</option>
                <option value="Uint32Array">Unsigned integer</option>
                <option value="Float32Array">Float</option>
                <option value="Float64Array">Double</option>
            </select>

            ---------------------------------------------------------------------------------------------

        Volume dimensions: (<input type="number" id="sizeX" required style="width: 50px" min="64" max="1024" value="128">, <input type="number" id="sizeY" required style="width: 50px" min="64" max="1024" value="128">, <input type="number" id="sizeZ" required style="width: 50px" min="64" max="1024" value="128">)

        Voxel dimensions: (<input type="number" id="voxDimX" required style="width: 35px" value="1" step="0.1">, <input type="number" id="voxDimY" required style="width: 35px" value="1" step="0.1">, <input type="number" id="voxDimZ" required style="width: 35px" value="1" step="0.1">)

        Iso value: <input type="number" id="isoValue" required value="0.5" step="0.1">

        Num. workers range: Min: <input type="number" id="numWorkersMin" style="margin-right:10px; width: 40px" min="1" max="16" value="1"> Max: <input type="number" id="numWorkersMax" style="width: 40px" min="1" max="16" value="4">

        Num. iterations: <input type="number" id="numIterations" style="margin-right:10px; width: 40px" min="1" max="100" value="10">

        <button type="button" onclick="startTest()">Start test</button>
    </form>

Console output:

    <button style="float: right; margin-top: 20px; margin-right: 20px;" onclick="document.getElementById('debugDiv').innerHTML = ''">Clear output</button>


text:
{% extends "base.html" %}
{% load static %}
{% load url from future %}
{% load greenmine_utils %}
{% load i18n %}

{% block title %}
     ›
    {{ project.name }}
     ›
    {% trans "Tasks" %}
{% endblock %}

{% block wrapper %}

        {% trans "Task Create:" %}

    <form action="{{ full_current_url }}" method="post" class="inline">
        {% csrf_token %}

            {{ form.subject.label }}
            {{ form.subject.errors }}
            {{ form.subject }}

            {{ form.status.label }}
            {{ form.status.errors }}
            {{ form.status }}

            {{ form.priority.label }}
            {{ form.priority.errors }}
            {{ form.priority }}

            {{ form.user_story.label }}
            {{ form.user_story.errors }}
            {{ form.user_story }}

            {{ form.assigned_to.label }}
            {{ form.assigned_to.errors }}
            {{ form.assigned_to }}

            {{ form.description.label }}
            {{ form.description }}
            {{ form.description.errors }}

           <input type="submit" value="{% trans "Save" %}" class="btn01"></input>
           {% comment %}
           <input type="submit" value="{% trans "Save & create other" %}" class="btn01"></input>
           {% endcomment %}

    </form>

{% endblock %}

{% block bottom-headers %}

{% include "modules/wikiwidget.html" %}
{% endblock %}


text:
I no longer have the time to maintain this project, if you are interested in contributing let me know!

# Pesterchum-Discord
A Discord client mimicking the Pesterchum chat client from Homestuck, for the few people who are still interested in that.

If you have any questions either contact me the github or add me at Henry#8808 on Discord.

This app is NOT an all-in-one client! It is meant to enhance RP and anything else you wish to do with it, however
it is recommended you still use regular Discord for technical functions.

### Donate
If you like what I've made, consider [buying me a coffee](https://ko-fi.com/A372XXA)

# Install
The release download is distributed as a .zip file. Unzip the file and inside will be a file called `pesterchum.exe`
If there is an update, updater.exe will launch in a console.
It doesn't install anywhere, its fairly portable. It is not yet for OSX/Linux, contact me if anyone is interested in
supporting it.

If you are running an older version and would like to update (> v1.0.6) you can enable the auto updater
by going into your `cfg/options.json` and changing the value `"auto_update": false` to `"auto_update": true`

# Updating
Auto updating by default is disabled, but can be enabled in settings, if you would rather manually install the new
update, copy and replace the following files and folders into the old installation
`discord, pesterchum.exe, updater.exe, python3.6.zip, python3.6.dll, asyncio, pywintypes36.dll`
If there are new themes or quirks, copy the relevant files / folders into the `pyquirks` folder and the `themes` folder

# Tokens
The Discord API no longer allows use of login credentials! Once you update to v1.3.0 or later you MUST use a token. All accounts
have tokens, [here](https://discordhelp.net/discord-token)'s how to find yours.

# Quirks
Pesterchum-Discord lets you do custom quirks using Regex! (Regular Expression) for help on quirks (they work identically) check out
[illuminatedWax's quirk info](https://github.com/illuminatedwax/pesterchum#quirks-1) on the original Pesterchum. Misspeller has not yet been added. Works similarly to how its documented [here](https://github.com/illuminatedwax/pesterchum/blob/master/PYQUIRKS.mkdn), you do NOT need to add the `function.command = "name"`

Add custom quirk commands by going to the pyquirks folder and removing quirk_funcs.pyc and replacing it with your own quirk_funcs.py
(if you want parts from the original just grab the [source](https://github.com/henry232323/Pesterchum-Discord/blob/master/pyquirks/quirk_funcs.py))

# Bugs
Please report all bugs in the [issues](https://github.com/henry232323/Pesterchum-Discord/issues).
If the application is not starting or crashes on startup, try starting it again, if that fails,
delete cfg/auth, cfg/config.json, cfg/options.json (and if else fails try removing quirks.json too)

# Themes
While I've made every theme available so far, they're easy (ish) for anyone to make. If you'd like
me to add a theme, just send a pull request or message me.
If you want to make a theme, best chance is to reverse engineer the already available (in the source)
.ui files of an existing theme.

All themes have several main parts:
##### theme.json
 ```json
{
  "name": "Pesterchum",
  "ui_path": "ui",
  "inherits": "Pesterchum 2.5",
  "css": "pesterchum.css"
}
 ```
 This file is found in the theme folder. Name the folder whatever you'd like, that doesn't matter,
 for example this is in the `themes/Pesterchum` folder.
 In your folder there are several things.
 - A folder (designated in the `theme.json`) with your UI's in it,
 this one has its in `themes/Pesterchum/ui` as designated in the file `"ui_path": "ui"`
 - All your image files, look at the other themes for examples. These must be `.png`'s, eventually
 I'll map out where every image is needed, for now its pretty easy to figure out.
 - Your css / styles, this is the file that is used to decorate your theme, just like a webpage, and
 is designated in your `theme.json`, in this one it is set to the path `themes/Pesterchum/pesterchum.css`
 with the line `"css": "pesterchum.css"` Look at example css to figure out how to use IDs and Classes
 in your css to match with the UIs, for example the main window can be targeted with `.Gui` or `.QMainWindow`

 The `theme.json` will designate four things, like mentioned above
 - `name` The name of the theme (as displayed in the options)
 - `ui_path` The relative path in the folder to find the ui's
 - `inherits` Which theme's css it will inherit (for example Pesterchum inherits Pesterchum 2.5)
 - `css` The relative path to the css file with the themes styles

 Make sure all relative paths do not start with a `/`

 Another note, in order to designate the associated mood with the button, the mood button must be
 checkable and called moodButton# where # is a number between 0 and 22 designating to the position in this list minus 1
 ```python
 ["chummy", "rancorous", "offline", "pleasant", "distraught",
 "pranky", "smooth", "ecstatic", "relaxed", "discontent",
 "devious", "sleek", "detestful", "mirthful", "manipulative",
 "vigorous", "perky", "acceptant", "protective", "mystified",
 "amazed", "insolent", "bemused"]
 ```
 For example moodButton0 would be the button for "Chummy" or moodButton2 would reference Offline / Abscond.
 The text on the button will remain and does not matter.
### Pesterchum 2.5
![PesterchumPreview2](https://raw.githubusercontent.com/henry232323/Pesterchum-Discord/master/resources/pesterchum2.5-preview.png)

### Trollian 2.5
![TrollianPreview](https://raw.githubusercontent.com/henry232323/Pesterchum-Discord/master/resources/trollian2.5-preview.png)

### Pesterchum
![PesterchumPreview](https://raw.githubusercontent.com/henry232323/Pesterchum-Discord/master/resources/pesterchum-preview.png)

### Serious Business
![DadPreview](https://raw.githubusercontent.com/henry232323/Pesterchum-Discord/master/resources/dad-preview.png)

### sbahj
![sbahjPreview](https://raw.githubusercontent.com/henry232323/Pesterchum-Discord/master/resources/sbahj-preview.png)


text:
<?php
namespace Fortifi\FortifiApi\Customer\Payloads;

use Fortifi\FortifiApi\Foundation\Payloads\FidPayload;

class CustomerSetLocationPayload extends FidPayload
{
  public $continent;
  public $country;
  public $county;
  public $city;
  public $postal;
  public $timezone;
  public $userIp;
}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Adding model 'Job'
        db.create_table('oozie_job', (
            ('is_shared', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True, blank=True)),
            ('description', self.gf('django.db.models.fields.CharField')(max_length=1024, blank=True)),
            ('parameters', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('deployment_dir', self.gf('django.db.models.fields.CharField')(max_length=1024, blank=True)),
            ('schema_version', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('last_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)),
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('oozie', ['Job'])

        # Adding model 'Workflow'
        db.create_table('oozie_workflow', (
            ('job_xml', self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True)),
            ('end', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='end_workflow', null=True, to=orm['oozie.Node'])),
            ('is_single', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)),
            ('job_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Job'], unique=True, primary_key=True)),
            ('job_properties', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('start', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='start_workflow', null=True, to=orm['oozie.Node'])),
        ))
        db.send_create_signal('oozie', ['Workflow'])

        # Adding model 'Link'
        db.create_table('oozie_link', (
            ('comment', self.gf('django.db.models.fields.CharField')(default='', max_length=1024, blank=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(related_name='child_node', to=orm['oozie.Node'])),
            ('child', self.gf('django.db.models.fields.related.ForeignKey')(related_name='parent_node', to=orm['oozie.Node'])),
        ))
        db.send_create_signal('oozie', ['Link'])

        # Adding model 'Node'
        db.create_table('oozie_node', (
            ('description', self.gf('django.db.models.fields.CharField')(default='', max_length=1024, blank=True)),
            ('workflow', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Workflow'])),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('node_type', self.gf('django.db.models.fields.CharField')(max_length=64)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('oozie', ['Node'])

        # Adding model 'Mapreduce'
        db.create_table('oozie_mapreduce', (
            ('files', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('job_xml', self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True)),
            ('jar_path', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('job_properties', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('archives', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True)),
            ('prepares', self.gf('django.db.models.fields.TextField')(default='[]')),
        ))
        db.send_create_signal('oozie', ['Mapreduce'])

        # Adding model 'Streaming'
        db.create_table('oozie_streaming', (
            ('files', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('mapper', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('reducer', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('job_properties', self.gf('django.db.models.fields.TextField')(default='[{"name":"oozie.use.system.libpath","value":"true"}]')),
            ('archives', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
        ))
        db.send_create_signal('oozie', ['Streaming'])

        # Adding model 'Java'
        db.create_table('oozie_java', (
            ('files', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('job_xml', self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True)),
            ('jar_path', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('java_opts', self.gf('django.db.models.fields.CharField')(max_length=256, blank=True)),
            ('args', self.gf('django.db.models.fields.CharField')(max_length=4096, blank=True)),
            ('job_properties', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('prepares', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('archives', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
            ('main_class', self.gf('django.db.models.fields.CharField')(max_length=256)),
        ))
        db.send_create_signal('oozie', ['Java'])

        # Adding model 'Pig'
        db.create_table('oozie_pig', (
            ('files', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('job_xml', self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True)),
            ('job_properties', self.gf('django.db.models.fields.TextField')(default='[{"name":"oozie.use.system.libpath","value":"true"}]')),
            ('params', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('archives', self.gf('django.db.models.fields.CharField')(default='[]', max_length=512)),
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
            ('prepares', self.gf('django.db.models.fields.TextField')(default='[]')),
            ('script_path', self.gf('django.db.models.fields.CharField')(max_length=256)),
        ))
        db.send_create_signal('oozie', ['Pig'])

        # Adding model 'Start'
        db.create_table('oozie_start', (
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True)),
        ))
        db.send_create_signal('oozie', ['Start'])

        # Adding model 'End'
        db.create_table('oozie_end', (
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
        ))
        db.send_create_signal('oozie', ['End'])

        # Adding model 'Kill'
        db.create_table('oozie_kill', (
            ('message', self.gf('django.db.models.fields.CharField')(default='Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]', max_length=256)),
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
        ))
        db.send_create_signal('oozie', ['Kill'])

        # Adding model 'Fork'
        db.create_table('oozie_fork', (
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
        ))
        db.send_create_signal('oozie', ['Fork'])

        # Adding model 'Join'
        db.create_table('oozie_join', (
            ('node_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Node'], unique=True, primary_key=True)),
        ))
        db.send_create_signal('oozie', ['Join'])

        # Adding model 'Coordinator'
        db.create_table('oozie_coordinator', (
            ('end', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 9, 7, 15, 12, 23, 992784))),
            ('concurrency', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True)),
            ('frequency_number', self.gf('django.db.models.fields.SmallIntegerField')(default=1)),
            ('workflow', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Workflow'], null=True)),
            ('job_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Job'], unique=True, primary_key=True)),
            ('frequency_unit', self.gf('django.db.models.fields.CharField')(default='days', max_length=20)),
            ('start', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 9, 4, 15, 12, 23, 992735))),
            ('timeout', self.gf('django.db.models.fields.SmallIntegerField')(null=True, blank=True)),
            ('timezone', self.gf('django.db.models.fields.CharField')(default='America/Los_Angeles', max_length=24)),
            ('throttle', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True)),
            ('execution', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)),
        ))
        db.send_create_signal('oozie', ['Coordinator'])

        # Adding model 'Dataset'
        db.create_table('oozie_dataset', (
            ('description', self.gf('django.db.models.fields.CharField')(default='', max_length=1024, blank=True)),
            ('frequency_number', self.gf('django.db.models.fields.SmallIntegerField')(default=1)),
            ('coordinator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Coordinator'])),
            ('frequency_unit', self.gf('django.db.models.fields.CharField')(default='days', max_length=20)),
            ('uri', self.gf('django.db.models.fields.CharField')(default='/data/${YEAR}${MONTH}${DAY}', max_length=1024)),
            ('start', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 9, 4, 15, 12, 23, 993608))),
            ('timezone', self.gf('django.db.models.fields.CharField')(default='America/Los_Angeles', max_length=24)),
            ('done_flag', self.gf('django.db.models.fields.CharField')(default='', max_length=64, blank=True)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('oozie', ['Dataset'])

        # Adding model 'DataInput'
        db.create_table('oozie_datainput', (
            ('coordinator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Coordinator'])),
            ('dataset', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Dataset'], unique=True)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('oozie', ['DataInput'])

        # Adding model 'DataOutput'
        db.create_table('oozie_dataoutput', (
            ('coordinator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Coordinator'])),
            ('dataset', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['oozie.Dataset'], unique=True)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('oozie', ['DataOutput'])

        # Adding model 'History'
        db.create_table('oozie_history', (
            ('submission_date', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)),
            ('job', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oozie.Job'])),
            ('properties', self.gf('django.db.models.fields.TextField')()),
            ('oozie_job_id', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('submitter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
        ))
        db.send_create_signal('oozie', ['History'])

    def backwards(self, orm):

        # Deleting model 'Job'
        db.delete_table('oozie_job')

        # Deleting model 'Workflow'
        db.delete_table('oozie_workflow')

        # Deleting model 'Link'
        db.delete_table('oozie_link')

        # Deleting model 'Node'
        db.delete_table('oozie_node')

        # Deleting model 'Mapreduce'
        db.delete_table('oozie_mapreduce')

        # Deleting model 'Streaming'
        db.delete_table('oozie_streaming')

        # Deleting model 'Java'
        db.delete_table('oozie_java')

        # Deleting model 'Pig'
        db.delete_table('oozie_pig')

        # Deleting model 'Start'
        db.delete_table('oozie_start')

        # Deleting model 'End'
        db.delete_table('oozie_end')

        # Deleting model 'Kill'
        db.delete_table('oozie_kill')

        # Deleting model 'Fork'
        db.delete_table('oozie_fork')

        # Deleting model 'Join'
        db.delete_table('oozie_join')

        # Deleting model 'Coordinator'
        db.delete_table('oozie_coordinator')

        # Deleting model 'Dataset'
        db.delete_table('oozie_dataset')

        # Deleting model 'DataInput'
        db.delete_table('oozie_datainput')

        # Deleting model 'DataOutput'
        db.delete_table('oozie_dataoutput')

        # Deleting model 'History'
        db.delete_table('oozie_history')

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'oozie.coordinator': {
            'Meta': {'object_name': 'Coordinator', '_ormbases': ['oozie.Job']},
            'concurrency': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 9, 7, 15, 12, 23, 992784)'}),
            'execution': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
            'frequency_number': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
            'frequency_unit': ('django.db.models.fields.CharField', [], {'default': "'days'", 'max_length': '20'}),
            'job_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Job']", 'unique': 'True', 'primary_key': 'True'}),
            'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 9, 4, 15, 12, 23, 992735)'}),
            'throttle': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'timeout': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'timezone': ('django.db.models.fields.CharField', [], {'default': "'America/Los_Angeles'", 'max_length': '24'}),
            'workflow': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Workflow']", 'null': 'True'})
        },
        'oozie.datainput': {
            'Meta': {'object_name': 'DataInput'},
            'coordinator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Coordinator']"}),
            'dataset': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Dataset']", 'unique': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
        },
        'oozie.dataoutput': {
            'Meta': {'object_name': 'DataOutput'},
            'coordinator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Coordinator']"}),
            'dataset': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Dataset']", 'unique': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
        },
        'oozie.dataset': {
            'Meta': {'object_name': 'Dataset'},
            'coordinator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Coordinator']"}),
            'description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024', 'blank': 'True'}),
            'done_flag': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'blank': 'True'}),
            'frequency_number': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
            'frequency_unit': ('django.db.models.fields.CharField', [], {'default': "'days'", 'max_length': '20'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 9, 4, 15, 12, 23, 993608)'}),
            'timezone': ('django.db.models.fields.CharField', [], {'default': "'America/Los_Angeles'", 'max_length': '24'}),
            'uri': ('django.db.models.fields.CharField', [], {'default': "'/data/${YEAR}${MONTH}${DAY}'", 'max_length': '1024'})
        },
        'oozie.end': {
            'Meta': {'object_name': 'End'},
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'})
        },
        'oozie.fork': {
            'Meta': {'object_name': 'Fork'},
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'})
        },
        'oozie.history': {
            'Meta': {'object_name': 'History'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Job']"}),
            'oozie_job_id': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'properties': ('django.db.models.fields.TextField', [], {}),
            'submission_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
            'submitter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
        },
        'oozie.java': {
            'Meta': {'object_name': 'Java'},
            'archives': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'args': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'blank': 'True'}),
            'files': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'jar_path': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'java_opts': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'job_properties': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'job_xml': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}),
            'main_class': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'}),
            'prepares': ('django.db.models.fields.TextField', [], {'default': "'[]'"})
        },
        'oozie.job': {
            'Meta': {'object_name': 'Job'},
            'deployment_dir': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}),
            'description': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_shared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'parameters': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'schema_version': ('django.db.models.fields.CharField', [], {'max_length': '128'})
        },
        'oozie.join': {
            'Meta': {'object_name': 'Join'},
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'})
        },
        'oozie.kill': {
            'Meta': {'object_name': 'Kill'},
            'message': ('django.db.models.fields.CharField', [], {'default': "'Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]'", 'max_length': '256'}),
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'})
        },
        'oozie.link': {
            'Meta': {'object_name': 'Link'},
            'child': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parent_node'", 'to': "orm['oozie.Node']"}),
            'comment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'child_node'", 'to': "orm['oozie.Node']"})
        },
        'oozie.mapreduce': {
            'Meta': {'object_name': 'Mapreduce'},
            'archives': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'files': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'jar_path': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'job_properties': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'job_xml': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}),
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True'}),
            'prepares': ('django.db.models.fields.TextField', [], {'default': "'[]'"})
        },
        'oozie.node': {
            'Meta': {'object_name': 'Node'},
            'children': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'parents'", 'symmetrical': 'False', 'through': "orm['oozie.Link']", 'to': "orm['oozie.Node']"}),
            'description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'node_type': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            'workflow': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oozie.Workflow']"})
        },
        'oozie.pig': {
            'Meta': {'object_name': 'Pig'},
            'archives': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'files': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'job_properties': ('django.db.models.fields.TextField', [], {'default': '\'[{"name":"oozie.use.system.libpath","value":"true"}]\''}),
            'job_xml': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}),
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'}),
            'params': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'prepares': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'script_path': ('django.db.models.fields.CharField', [], {'max_length': '256'})
        },
        'oozie.start': {
            'Meta': {'object_name': 'Start'},
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True'})
        },
        'oozie.streaming': {
            'Meta': {'object_name': 'Streaming'},
            'archives': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'files': ('django.db.models.fields.CharField', [], {'default': "'[]'", 'max_length': '512'}),
            'job_properties': ('django.db.models.fields.TextField', [], {'default': '\'[{"name":"oozie.use.system.libpath","value":"true"}]\''}),
            'mapper': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Node']", 'unique': 'True', 'primary_key': 'True'}),
            'reducer': ('django.db.models.fields.CharField', [], {'max_length': '512'})
        },
        'oozie.workflow': {
            'Meta': {'object_name': 'Workflow', '_ormbases': ['oozie.Job']},
            'end': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'end_workflow'", 'null': 'True', 'to': "orm['oozie.End']"}),
            'is_single': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'job_properties': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
            'job_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['oozie.Job']", 'unique': 'True', 'primary_key': 'True'}),
            'job_xml': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}),
            'start': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'start_workflow'", 'null': 'True', 'to': "orm['oozie.Start']"})
        }
    }

    complete_apps = ['oozie']


text:
$(function(){
	loadInfo(function(){
		setTimeout(
	  		function() {
	  			$("body").css("background", "rgba(214, 214, 214, 0.89)");
				$("body").css("color", "black");
				$(".loading_wrap").hide();
				$(".container").show();
				$("header").show();
				$("footer").show();
			}, 5000);
	});
});

$(function(){
	$("#delete_persona").on("click",function(){
		var id = getURL_Id();
		var request = $.ajax({
        url: "/persona/json/delete/" + id + "/",
        type: "DELETE",
        dataType: "json"
      });

      request.done(function( msg ) {
        $(".alert p").text(msg.mensaje);
        if(msg.respuesta){
          $(".alert").hide();
          window.location = "../?status=true&operation=delete";
        }else{
          $(".alert").removeClass("alert-success");
          $(".alert").addClass("alert-danger");
          $(".alert").show();
          $('html, body').animate({scrollTop : 0},800);
        }
      });

      request.fail(function( msg ) {
        $(".alert p").text("Ocurrió un error al realizar la eliminación. Intente nuevamente en un instante.");
        $(".alert").removeClass("alert-success");
        $(".alert").addClass("alert-danger");
        $(".alert").show();
        $('html, body').animate({scrollTop : 0},800);
      });
	});
});

function loadInfo(callback){

  var persona_id = getURL_Id();

  $.getJSON("/persona/json/view/" + persona_id + "/",function(data){

    $("#persona_nombre").text(data[0].fields.nombre);
    $("#persona_apellido").text(data[0].fields.apellido);
    $("#persona_edad").text(data[0].fields.edad);

    callback.call();

  });

}


text:
`RangeInt`/`RangeFloat` are editable data types that take an int/float range. Used for things like "Spawn 2 to 4 enemies."

## Example
![RangeExample Editor Screenshot](https://raw.githubusercontent.com/TobiasWehrum/unity-utilities/master/_Images/RangeExample.png)

```C#
public class RangeExample : MonoBehaviour
    {
        [SerializeField] RangeInt amountRange;
        [SerializeField] RangeFloat numberRange;

        private void Awake()
        {
            // Get a random number in amountRange
            int amount = amountRange.RandomInclusive;

            // Output [amount] numbers
            for (int i = 0; i < amount; i++)
            {
                // Transform [i..(amount-1)] to [0..1]
                var t = ((float)i / (amount - 1));

                // Mathf.Lerp(numberRange.From, numberRange.To, t)
                Debug.Log(numberRange.Lerp(t));
            }
        }
    }
}
```

## Dependencies

None.


text:
<?php
/**
 * Created by PhpStorm.
 * User: Pavel Batanov <pavel@batanov.me>
 * Date: 04.02.14
 * Time: 17:44
 */

namespace NemesisPlatform\Core\Account\Entity;

use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use NemesisPlatform\Game\Entity\Participant;
use NemesisPlatform\Game\Entity\Season;
use Serializable;
use Symfony\Component\Security\Core\Encoder\EncoderAwareInterface;
use Symfony\Component\Security\Core\Role\RoleInterface;
use Symfony\Component\Security\Core\User\EquatableInterface;
use Symfony\Component\Security\Core\User\UserInterface;

/**
 * Class User
 *
 * @package Entity
 */
class User implements NamedUserInterface, EquatableInterface, EncoderAwareInterface, Serializable
{
    const EMAIL_PENDING   = 0;
    const EMAIL_CONFIRMED = 1;
    const BANNED          = 2;

    /**@var int|null */
    private $id;
    /**@var string */
    private $email;
    /** @var string */
    private $password = '';
    /** @var string */
    private $encoder = 'bcrypt';

    /** @var  int */
    private $status = self::EMAIL_PENDING;
    /** @var DateTime */
    private $registerDate;
    /** @var string */
    private $code = null;
    /** @var string */
    private $pwdCode = null;
    /** @var Phone[]|ArrayCollection */
    private $phones;
    /** @var RoleInterface[] */
    private $roles = [];
    /** @var  Phone */
    private $phone;
    /** @var  string */
    private $lastname;
    /** @var  string */
    private $firstname;
    /** @var  string */
    private $middlename;
    /** @var  string */
    private $avatar;
    /** @var  DateTime */
    private $birth_date;
    /** @var  Participant[]|ArrayCollection */
    private $participations;

    /** @var  string */
    private $about;
    /** @var  string */
    private $social_vkontakte;
    /** @var  string */
    private $social_twitter;
    /** @var  string */
    private $social_facebook;
    /** @var  ArrayCollection|Tag[] */
    private $tags;
    /** @var  string */
    private $admin_comment;

    /**
     * User constructor.
     *
     * @param string $email
     * @param string $password
     * @param string $firstName
     * @param string $lastName
     */
    public function __construct($email, $password, $firstName, $lastName)
    {
        $this->email          = $email;
        $this->password       = $password;
        $this->firstname      = $firstName;
        $this->lastname       = $lastName;
        $this->participations = new ArrayCollection();
        $this->phones         = new ArrayCollection();
        $this->registerDate   = new DateTime();
        $this->tags           = new ArrayCollection();
    }

    /**
     * @return mixed
     */
    public function getAdminComment()
    {
        return $this->admin_comment;
    }

    /**
     * @param mixed $admin_comment
     */
    public function setAdminComment($admin_comment)
    {
        $this->admin_comment = $admin_comment;
    }

    /**
     * @return ArrayCollection|\NemesisPlatform\Core\Account\Entity\Tag[]
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * @param ArrayCollection|\NemesisPlatform\Core\Account\Entity\Tag[] $tags
     */
    public function setTags($tags)
    {
        $this->tags = $tags;
    }

    /**
     * @return string
     */
    public function getAbout()
    {
        return $this->about;
    }

    /**
     * @param string $about
     */
    public function setAbout($about)
    {
        $this->about = $about;
    }

    /**
     * @return string
     */
    public function getSocialFacebook()
    {
        return $this->social_facebook;
    }

    /**
     * @param string $social_facebook
     */
    public function setSocialFacebook($social_facebook)
    {
        $this->social_facebook = $social_facebook;
    }

    /**
     * @return string
     */
    public function getSocialTwitter()
    {
        return $this->social_twitter;
    }

    /**
     * @param string $social_twitter
     */
    public function setSocialTwitter($social_twitter)
    {
        $this->social_twitter = $social_twitter;
    }

    /**
     * @return string
     */
    public function getSocialVkontakte()
    {
        return $this->social_vkontakte;
    }

    /**
     * @param string $social_vkontakte
     */
    public function setSocialVkontakte($social_vkontakte)
    {
        $this->social_vkontakte = $social_vkontakte;
    }

    /**
     * @return Participant[]|ArrayCollection
     */
    public function getParticipations()
    {
        return $this->participations;
    }

    /**
     * @param ArrayCollection|Participant[] $participations
     */
    public function setParticipations($participations)
    {
        $this->participations = $participations;
    }

    /**
     * @param Season $season
     *
     * @return Participant|null
     */
    public function getParticipation(\NemesisPlatform\Game\Entity\Season $season)
    {
        foreach ($this->participations as $data) {
            if ($data->getSeason() === $season) {
                return $data;
            }
        }

        return null;
    }

    public function isFrozen()
    {
        foreach ($this->participations as $data) {
            if ($data->isFrozen()) {
                return true;
            }
        }

        return false;
    }

    /**
     * @return mixed
     */
    public function getAvatar()
    {
        return $this->avatar;
    }

    /**
     * @param mixed $avatar
     */
    public function setAvatar($avatar)
    {
        $this->avatar = $avatar;
    }

    /**
     * @return mixed
     */
    public function getBirthdate()
    {
        return $this->birth_date;
    }

    /**
     * @param mixed $birthdate
     */
    public function setBirthdate($birthdate)
    {
        $this->birth_date = $birthdate;
    }

    /**
     * @return string
     */
    public function getPwdCode()
    {
        return $this->pwdCode;
    }

    /**
     * @param string $pwdCode
     */
    public function setPwdCode($pwdCode)
    {
        $this->pwdCode = $pwdCode;
    }

    /**
     * @return string
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @param string $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * @return ArrayCollection|Phone[]
     */
    public function getPhones()
    {
        return $this->phones;
    }

    /**
     * @return DateTime
     */
    public function getRegisterDate()
    {
        return $this->registerDate;
    }

    /**
     * @param DateTime $registerDate
     */
    public function setRegisterDate($registerDate)
    {
        $this->registerDate = $registerDate;
    }

    /**
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param int $status
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }

    /**
     * @return Phone
     */
    public function getPhone()
    {
        return $this->phone;
    }

    /**
     * @param Phone $phone
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;
    }

    /**
     * @return boolean
     */
    public function isEmailPublic()
    {
        return false;
    }

    /**
     * @return string
     */
    public function getPhoto()
    {
        return $this->avatar;
    }

    /**
     * @param string $photo
     */
    public function setPhoto($photo)
    {
        $this->avatar = $photo;
    }

    /**
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * @param string $email
     */
    public function setEmail($email)
    {
        $this->email = $email;
    }

    /**
     * @return bool
     */
    public function hasPhoto()
    {
        return $this->avatar !== null && $this->avatar != '0' && $this->avatar != '';
    }

    /**
     * @return mixed
     */
    public function getID()
    {
        return $this->id;
    }

    /**
     * @return bool
     */
    public function hasUnconfirmedNumber()
    {
        $result = false;

        foreach ($this->phones as $phone) {
            $result = $result || $phone->getStatus() === Phone::STATUS_UNCONFIRMED;
        }

        return $result;
    }

    /**
     * @return bool
     */
    public function hasConfirmedNumbers()
    {
        foreach ($this->phones as $phone) {
            if ($phone->isConfirmed()) {
                return true;
            }
        }

        return false;
    }

    /**
     * @return bool
     */
    public function hasPendingNumber()
    {
        foreach ($this->phones as $phone) {
            if ($phone->isPendingConfirmation()) {
                return true;
            }
        }

        return false;
    }

    /**
     * @return Phone|null
     */
    public function getPendingNumber()
    {
        foreach ($this->phones as $phone) {
            if ($phone->isPendingConfirmation()) {
                return $phone;
            }
        }

        return null;
    }

    /**
     * @return Phone|null
     */
    public function getUnconfirmedNumber()
    {
        foreach ($this->phones as $phone) {
            if ($phone->isNotConfirmed()) {
                return $phone;
            }
        }

        return null;
    }

    /** {@inheritdoc} */
    public function isAccountNonExpired()
    {
        return true;
    }

    /** {@inheritdoc} */
    public function isAccountNonLocked()
    {
        return $this->status !== self::BANNED;
    }

    /** {@inheritdoc} */
    public function isCredentialsNonExpired()
    {
        return true;
    }

    /** {@inheritdoc} */
    public function isEnabled()
    {
        return $this->status === self::EMAIL_CONFIRMED;
    }

    /** {@inheritdoc} */
    public function eraseCredentials()
    {
        // TODO: Implement eraseCredentials() method.
    }

    public function __toString()
    {
        return '['.$this->id.'] '.$this->getFormattedName('%l %f %m');
    }

    /** {@inheritdoc} */
    public function getFormattedName($format = '%l %f %m')
    {
        $result = $format;
        $result = str_replace('%l', $this->getLastname(), $result);
        $result = str_replace('%f', $this->getFirstname(), $result);
        $result = str_replace('%m', $this->getMiddlename(), $result);

        $result = str_replace('%sl', mb_substr($this->getLastname(), 0, 1, 'utf-8'), $result);
        $result = str_replace('%sf', mb_substr($this->getFirstname(), 0, 1, 'utf-8'), $result);
        $result = str_replace('%sm', mb_substr($this->getMiddlename(), 0, 1, 'utf-8'), $result);

        return $result;
    }

    /**
     * @return string
     */
    public function getLastname()
    {
        return $this->lastname;
    }

    /**
     * @param string $lastname
     */
    public function setLastname($lastname)
    {
        $this->lastname = $lastname;
    }

    /**
     * @return string
     */
    public function getFirstname()
    {
        return $this->firstname;
    }

    /**
     * @param string $firstname
     */
    public function setFirstname($firstname)
    {
        $this->firstname = $firstname;
    }

    /**
     * @return string
     */
    public function getMiddlename()
    {
        return $this->middlename;
    }

    /**
     * @param string $middlename
     */
    public function setMiddlename($middlename)
    {
        $this->middlename = $middlename;
    }

    public function addPhone(Phone $phone)
    {
        $phone->setUser($this);
        if (!$this->phones->contains($phone)) {
            $this->phones->add($phone);
        }
    }

    public function removePhone(Phone $phone)
    {
        if ($this->phones->contains($phone)) {
            $phone->setUser(null);
            $this->phones->removeElement($phone);
        }
    }

    /** {@inheritdoc} */
    public function isEqualTo(UserInterface $user)
    {
        if ($user->getUsername() !== $this->getUsername()) {
            return false;
        }
        if ($user->getPassword() !== $this->getPassword()) {
            return false;
        }
        if ($user->getSalt() !== $this->getSalt()) {
            return false;
        }

        if (count($user->getRoles()) !== count($this->getRoles())) {
            return false;
        }

        foreach ($this->getRoles() as $role) {
            if (!in_array($role, $user->getRoles(), true)) {
                return false;
            }
        }

        return true;
    }

    /**
     * Returns the username used to authenticate the user.
     *
     * @return string The username
     */
    public function getUsername()
    {
        return $this->email;
    }

    /**
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * @param string $encodedPassword
     */
    public function setPassword($encodedPassword)
    {
        $this->password = $encodedPassword;
    }

    /**
     * @return string
     */
    public function getSalt()
    {
        if ('bcrypt' === $this->encoder) {
            return null;
        }

        return $this->email;
    }

    /** {@inheritdoc} */
    public function getRoles()
    {
        return $this->roles;
    }

    /**
     * @param RoleInterface[] $roles
     */
    public function setRoles($roles)
    {
        $this->roles = $roles;
    }

    /** {@inheritdoc} */
    public function getEncoderName()
    {
        return $this->encoder;
    }

    /** {@inheritdoc} */
    public function serialize()
    {
        return serialize(
            [
                $this->id,
                $this->email,
                $this->password,
                $this->getSalt(),
            ]
        );
    }

    /** {@inheritdoc} */
    public function unserialize($serialized)
    {
        list(
            $this->id,
            $this->email,
            $this->password,
            // see section on salt below
            // $this->salt
            )
            = unserialize($serialized);
    }

    public function confirm()
    {
        $this->code   = null;
        $this->status = self::EMAIL_CONFIRMED;
    }
}


text:
package pdb

import (
	"fmt"

	"github.com/TuftsBCB/structure"
)

// RMSD is a convenience function for computing the RMSD between two sets of
// residues, where each set is take from a chain of a PDB entry. Note that RMSD
// is only computed using carbon-alpha atoms.
//
// Each set of atoms to be used is specified by a four-tuple: a PDB entry file,
// a chain identifier, and the start and end residue numbers to use as a range.
// (Where the range is inclusive.)
//
// An error will be returned if: chainId{1,2} does not correspond to a chain
// in entry{1,2}. The ranges specified by start{1,2}-end{1,2} are not valid.
// The ranges specified by start{1,2}-end{1,2} do not correspond to precisely
// the same number of carbon-alpha atoms.
func RMSD(entry1 *Entry, chainId1 byte, start1, end1 int,
	entry2 *Entry, chainId2 byte, start2, end2 int) (float64, error) {

	chain1 := entry1.Chain(chainId1)
	if chain1 == nil {
		return 0.0, fmt.Errorf("The chain '%c' could not be found in '%s'.",
			chainId1, entry1.Path)
	}
	chain2 := entry2.Chain(chainId2)
	if chain2 == nil {
		return 0.0, fmt.Errorf("The chain '%c' could not be found in '%s'.",
			chainId2, entry2.Path)
	}
	return RMSDChains(chain1, start1, end1, chain2, start2, end2)
}

// RMSDChains is the same as RMSD, except it uses *Chain values directly.
func RMSDChains(chain1 *Chain, start1, end1 int,
	chain2 *Chain, start2, end2 int) (float64, error) {

	// In order to fetch the appropriate carbon-alpha atoms, we need to
	// traverse each chain's carbon-alpha atom slice and pick only the carbon
	// alpha atoms with residue indices in the range specified.
	struct1 := chain1.SequenceCaAtomSlice(start1-1, end1)
	struct2 := chain2.SequenceCaAtomSlice(start2-1, end2)

	// Verify that neither of the atom sets is 0.
	if struct1 == nil || len(struct1) == 0 {
		return 0.0, fmt.Errorf("The range '%d-%d' (for chain %c in %s) does "+
			"not correspond to any carbon-alpha ATOM records.",
			start1, end1, chain1.Ident, chain1.Entry.Path)
	}
	if struct2 == nil || len(struct2) == 0 {
		return 0.0, fmt.Errorf("The range '%d-%d' (for chain %c in %s) does "+
			"not correspond to any carbon-alpha ATOM records.",
			start2, end2, chain2.Ident, chain2.Entry.Path)
	}

	// If we don't have the same number of atoms from each chain, we can't
	// compute RMSD.
	if len(struct1) != len(struct2) {
		return 0.0, fmt.Errorf("The range '%d-%d' (%d ATOM records for chain "+
			"%c in %s) does not correspond to the same number of carbon-alpha "+
			"atoms as the range '%d-%d' (%d ATOM records for chain %c in %s). "+
			"It is possible that the PDB file does not contain a carbon-alpha "+
			"atom for every residue index in the ranges.",
			start1, end1, len(struct1), chain1.Ident, chain1.Entry.Path,
			start2, end2, len(struct2), chain2.Ident, chain2.Entry.Path)
	}

	// We're good to go...
	return structure.RMSD(struct1, struct2), nil
}


text:
'use strict'

var url = require('url');
var querystring = require('querystring');
var crypto = require('crypto');
var md5sum = crypto.createHash('md5');

exports.md5 = function (str) {
  return md5sum.update(str).digest('hex');
};

exports.parseUrl = function (str) {
  return url.parse(str);
};

exports.parseQuery = function (str) {
  return querystring.parse(str);
};

exports.getRegExp = function (str) {
  switch(typeof str) {
    case 'string':
      if (str.length)
        return new RegExp(str, 'g');
      return null;
    case 'object':
      if (str.constructor == RegExp)
        return str;
    default:
      return null;
  }
}

exports.getGlobalRegExp = function (str) {
  var re = exports.getRegExp(str);
  if (!re) throw new Error('Invalid RegExp: ' + str);

  if (re.global) {
    return re;
  }
  var flags = 'g';
  if (re.ignoreCase) flags += 'i';
  if (re.multiline) flags += 'm';
  return new RegExp(re.source, flags)
}


text:
<?php

namespace Terramar\Packages\Controller;

use Nice\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Yaml\Yaml;
use Terramar\Packages\Repository\PackageRepository;

class ManageController
{
    public function indexAction(Application $app, Request $request)
    {
        /** @var \Doctrine\ORM\EntityManager $entityManager */
        $entityManager = $app->get('doctrine.orm.entity_manager');
        $packages = $entityManager->getRepository('Terramar\Packages\Entity\Package')->createQueryBuilder('p')
            ->select('COUNT(p)')
            ->where('p.enabled = true')
            ->getQuery()->getSingleScalarResult();

        $remotes = $entityManager->getRepository('Terramar\Packages\Entity\Remote')->createQueryBuilder('c')
            ->select('COUNT(c)')
            ->where('c.enabled = true')
            ->getQuery()->getSingleScalarResult();

        return new Response($app->get('templating')->render('Manage/index.html.twig', array(
                    'packages' => $packages,
                    'remotes'  => $remotes,
                )));
    }
}