text:
namespace update_client {

namespace {

const char kOutput[] = "output";
const char kSha256[] = "sha256";

// The integer offset disambiguates between overlapping error ranges.
const int kCourgetteErrorOffset = 300;
const int kBsdiffErrorOffset = 600;

}  // namespace

const char kOp[] = "op";
const char kBsdiff[] = "bsdiff";
const char kCourgette[] = "courgette";
const char kInput[] = "input";
const char kPatch[] = "patch";

DeltaUpdateOp* CreateDeltaUpdateOp(
    const std::string& operation,
    const scoped_refptr<OutOfProcessPatcher>& out_of_process_patcher) {
  if (operation == "copy") {
    return new DeltaUpdateOpCopy();
  } else if (operation == "create") {
    return new DeltaUpdateOpCreate();
  } else if (operation == "bsdiff" || operation == "courgette") {
    return new DeltaUpdateOpPatch(operation, out_of_process_patcher);
  }
  return NULL;
}

DeltaUpdateOp::DeltaUpdateOp() {
}

DeltaUpdateOp::~DeltaUpdateOp() {
}

void DeltaUpdateOp::Run(
    const base::DictionaryValue* command_args,
    const base::FilePath& input_dir,
    const base::FilePath& unpack_dir,
    const scoped_refptr<CrxInstaller>& installer,
    const ComponentUnpacker::Callback& callback,
    const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
  callback_ = callback;
  task_runner_ = task_runner;
  std::string output_rel_path;
  if (!command_args->GetString(kOutput, &output_rel_path) ||
      !command_args->GetString(kSha256, &output_sha256_)) {
    DoneRunning(ComponentUnpacker::kDeltaBadCommands, 0);
    return;
  }

  output_abs_path_ =
      unpack_dir.Append(base::FilePath::FromUTF8Unsafe(output_rel_path));
  ComponentUnpacker::Error parse_result =
      DoParseArguments(command_args, input_dir, installer);
  if (parse_result != ComponentUnpacker::kNone) {
    DoneRunning(parse_result, 0);
    return;
  }

  const base::FilePath parent = output_abs_path_.DirName();
  if (!base::DirectoryExists(parent)) {
    if (!base::CreateDirectory(parent)) {
      DoneRunning(ComponentUnpacker::kIoError, 0);
      return;
    }
  }

  DoRun(base::Bind(&DeltaUpdateOp::DoneRunning,
                   scoped_refptr<DeltaUpdateOp>(this)));
}

void DeltaUpdateOp::DoneRunning(ComponentUnpacker::Error error,
                                int extended_error) {
  if (error == ComponentUnpacker::kNone)
    error = CheckHash();
  task_runner_->PostTask(FROM_HERE,
                         base::Bind(callback_, error, extended_error));
  callback_.Reset();
}

// Uses the hash as a checksum to confirm that the file now residing in the
// output directory probably has the contents it should.
ComponentUnpacker::Error DeltaUpdateOp::CheckHash() {
  return VerifyFileHash256(output_abs_path_, output_sha256_)
             ? ComponentUnpacker::kNone
             : ComponentUnpacker::kDeltaVerificationFailure;
}

scoped_refptr<base::SequencedTaskRunner> DeltaUpdateOp::GetTaskRunner() {
  return task_runner_;
}

DeltaUpdateOpCopy::DeltaUpdateOpCopy() {
}

DeltaUpdateOpCopy::~DeltaUpdateOpCopy() {
}

ComponentUnpacker::Error DeltaUpdateOpCopy::DoParseArguments(
    const base::DictionaryValue* command_args,
    const base::FilePath& input_dir,
    const scoped_refptr<CrxInstaller>& installer) {
  std::string input_rel_path;
  if (!command_args->GetString(kInput, &input_rel_path))
    return ComponentUnpacker::kDeltaBadCommands;

  if (!installer->GetInstalledFile(input_rel_path, &input_abs_path_))
    return ComponentUnpacker::kDeltaMissingExistingFile;

  return ComponentUnpacker::kNone;
}

void DeltaUpdateOpCopy::DoRun(const ComponentUnpacker::Callback& callback) {
  if (!base::CopyFile(input_abs_path_, output_abs_path_))
    callback.Run(ComponentUnpacker::kDeltaOperationFailure, 0);
  else
    callback.Run(ComponentUnpacker::kNone, 0);
}

DeltaUpdateOpCreate::DeltaUpdateOpCreate() {
}

DeltaUpdateOpCreate::~DeltaUpdateOpCreate() {
}

ComponentUnpacker::Error DeltaUpdateOpCreate::DoParseArguments(
    const base::DictionaryValue* command_args,
    const base::FilePath& input_dir,
    const scoped_refptr<CrxInstaller>& installer) {
  std::string patch_rel_path;
  if (!command_args->GetString(kPatch, &patch_rel_path))
    return ComponentUnpacker::kDeltaBadCommands;

  patch_abs_path_ =
      input_dir.Append(base::FilePath::FromUTF8Unsafe(patch_rel_path));

  return ComponentUnpacker::kNone;
}

void DeltaUpdateOpCreate::DoRun(const ComponentUnpacker::Callback& callback) {
  if (!base::Move(patch_abs_path_, output_abs_path_))
    callback.Run(ComponentUnpacker::kDeltaOperationFailure, 0);
  else
    callback.Run(ComponentUnpacker::kNone, 0);
}

DeltaUpdateOpPatch::DeltaUpdateOpPatch(
    const std::string& operation,
    scoped_refptr<OutOfProcessPatcher> out_of_process_patcher)
    : operation_(operation), out_of_process_patcher_(out_of_process_patcher) {
  DCHECK(operation == kBsdiff || operation == kCourgette);
}

DeltaUpdateOpPatch::~DeltaUpdateOpPatch() {
}

ComponentUnpacker::Error DeltaUpdateOpPatch::DoParseArguments(
    const base::DictionaryValue* command_args,
    const base::FilePath& input_dir,
    const scoped_refptr<CrxInstaller>& installer) {
  std::string patch_rel_path;
  std::string input_rel_path;
  if (!command_args->GetString(kPatch, &patch_rel_path) ||
      !command_args->GetString(kInput, &input_rel_path))
    return ComponentUnpacker::kDeltaBadCommands;

  if (!installer->GetInstalledFile(input_rel_path, &input_abs_path_))
    return ComponentUnpacker::kDeltaMissingExistingFile;

  patch_abs_path_ =
      input_dir.Append(base::FilePath::FromUTF8Unsafe(patch_rel_path));

  return ComponentUnpacker::kNone;
}

void DeltaUpdateOpPatch::DoRun(const ComponentUnpacker::Callback& callback) {
  if (out_of_process_patcher_.get()) {
    out_of_process_patcher_->Patch(
        operation_, GetTaskRunner(), input_abs_path_, patch_abs_path_,
        output_abs_path_,
        base::Bind(&DeltaUpdateOpPatch::DonePatching, this, callback));
    return;
  }

  if (operation_ == kBsdiff) {
    DonePatching(callback,
                 courgette::ApplyBinaryPatch(input_abs_path_, patch_abs_path_,
                                             output_abs_path_));
  } else if (operation_ == kCourgette) {
    DonePatching(callback, courgette::ApplyEnsemblePatch(
                               input_abs_path_.value().c_str(),
                               patch_abs_path_.value().c_str(),
                               output_abs_path_.value().c_str()));
  } else {
    NOTREACHED();
  }
}

void DeltaUpdateOpPatch::DonePatching(
    const ComponentUnpacker::Callback& callback,
    int result) {
  if (operation_ == kBsdiff) {
    if (result == courgette::OK) {
      callback.Run(ComponentUnpacker::kNone, 0);
    } else {
      callback.Run(ComponentUnpacker::kDeltaOperationFailure,
                   result + kBsdiffErrorOffset);
    }
  } else if (operation_ == kCourgette) {
    if (result == courgette::C_OK) {
      callback.Run(ComponentUnpacker::kNone, 0);
    } else {
      callback.Run(ComponentUnpacker::kDeltaOperationFailure,
                   result + kCourgetteErrorOffset);
    }
  } else {
    NOTREACHED();
  }
}

}  // namespace update_client


text:
package com.thetonyk.UHC.Commands;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.World.Environment;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;

import com.thetonyk.UHC.Main;
import com.thetonyk.UHC.Utils.DatabaseUtils;
import com.thetonyk.UHC.Utils.GameUtils;
import com.thetonyk.UHC.Utils.GameUtils.Status;
import com.thetonyk.UHC.Utils.WorldUtils;

public class WorldCommand implements CommandExecutor, TabCompleter {

	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

		if (!sender.hasPermission("uhc.world")) {

			sender.sendMessage(Main.NO_PERMS);
			return true;

		}

		if (args.length < 1) {

			sender.sendMessage(Main.PREFIX + "Usage of /world:");
			sender.sendMessage("§8⫸ §6/world create §8- §7Create a world.");
			sender.sendMessage("§8⫸ §6/world delete §8- §7Delete a world.");
			sender.sendMessage("§8⫸ §6/world reload §8- §7Reload a world.");
			sender.sendMessage("§8⫸ §6/world list §8- §7List all worlds.");
			sender.sendMessage("§8⫸ §6/world tp §8- §7Teleport to a world.");
			return true;

		}

		if (args[0].equalsIgnoreCase("create")) {

			if (args.length < 3) {

				sender.sendMessage(Main.PREFIX + "Usage: /world create <name> <size> [nether] [end] [seed]");
				return true;

			}

			String name = args[1];

			if (WorldUtils.exist(name)) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' is already created.");
				return true;

			}

			if (name.equalsIgnoreCase("world") || name.equalsIgnoreCase("lobby")) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' is already created.");
				return true;

			}

			if (name.endsWith("_end") || name.endsWith("_nether")) {

				sender.sendMessage(Main.PREFIX + "You can't created Nether or End world by yourself.");
				return true;

			}

			int radius = 2000;

			try {

				radius = Integer.parseInt(args[2]);

			} catch (Exception exception) {

				sender.sendMessage(Main.PREFIX + "The radius is incorrect.");
				return true;

			}

			Boolean nether = false;
			Boolean end = false;
			long seed = new Random().nextLong();

			if (args.length > 3) {

				try {

					nether = Boolean.parseBoolean(args[3]);

				} catch (Exception exception) {

					sender.sendMessage(Main.PREFIX + "Nether can only be '§6true§7' or '§6false§7'.");
					return true;

				}

			}

			if (args.length > 4) {

				try {

					end = Boolean.parseBoolean(args[4]);

				} catch (Exception exception) {

					sender.sendMessage(Main.PREFIX + "The End can only be '§6true§7' or '§6false§7'.");
					return true;

				}

			}

			if (args.length > 5) {

				try {

					seed = Long.parseLong(args[5]);

				} catch (Exception exception) {

					sender.sendMessage(Main.PREFIX + "This seed is incorrect.");
					return true;

				}

			}

			Bukkit.broadcastMessage(Main.PREFIX + "Creation of world '§6" + name + "§7'...");
			Bukkit.broadcastMessage("§8⫸ §7Size: §a" + radius);
			Bukkit.broadcastMessage("§8⫸ §7Seed: §a" + seed);
			Bukkit.broadcastMessage("§8⫸ §7Nether: §a" + nether);
			Bukkit.broadcastMessage("§8⫸ §7End: §a" + end);

			WorldUtils.createWorld(name, Environment.NORMAL, seed, WorldType.NORMAL, radius, false);

			if (nether) WorldUtils.createWorld(name + "_nether", Environment.NETHER, seed, WorldType.NORMAL, radius, false);

			if (end) WorldUtils.createWorld(name + "_end", Environment.THE_END, seed, WorldType.NORMAL, radius, false);

			sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' has been created.");
			return true;

		}

		if (args[0].equalsIgnoreCase("delete")) {

			if (args.length < 2) {

				sender.sendMessage(Main.PREFIX + "Usage: /world delete <world>");
				return true;

			}

			String name = args[1];

			if (name.contains("_end") || name.contains("_nether")) {

				sender.sendMessage(Main.PREFIX + "You can't delete Nether or End world by yourself.");
				return true;

			}

			if (!WorldUtils.exist(name)) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' doesn't exist.");
				return true;

			}

			if (name.equalsIgnoreCase("lobby")) {

				sender.sendMessage(Main.PREFIX + "You can't delete the lobby.");
				return true;

			}

			WorldUtils.deleteWorld(name);

			sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' has been deleted.");

			if (WorldUtils.exist(name + "_nether")) WorldUtils.deleteWorld(name + "_nether");
			if (WorldUtils.exist(name + "_end")) WorldUtils.deleteWorld(name + "_end");
			return true;

		}

		if (args[0].equalsIgnoreCase("reload")) {

			if (args.length < 2) {

				sender.sendMessage(Main.PREFIX + "Usage: /world reload <world>");
				return true;

			}

			String name = args[1];

			if (!WorldUtils.exist(name)) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' doesn't exist.");
				return true;

			}

			if (Bukkit.getWorld(name) != null) {

				WorldUtils.unloadWorld(name);

			}

			WorldUtils.loadWorld(name);

			sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' has been reloaded.");
			return true;

		}

		if (args[0].equalsIgnoreCase("list")) {

			sender.sendMessage(Main.PREFIX + "Existing worlds:");

			World lobby = Bukkit.getWorld("lobby");

			if (lobby != null) sender.sendMessage(Main.PREFIX + "§7lobby §8- §a" + lobby.getEnvironment().name() + "§7.");
			else sender.sendMessage(Main.PREFIX + "§clobby §8- §aNORMAL§7.");

			try {

				ResultSet worlds = DatabaseUtils.sqlQuery("SELECT * FROM uhc_worlds;");

				while (worlds.next()) {

					String world = worlds.getString("name");
					String color = "§7";

					switch (worlds.getString("environment")) {

						case "NORMAL":
							color = "§a";
							break;
						case "NETHER":
							color = "§c";
							break;
						case "THE_END":
							color = "§9";
							break;
						default:
							break;

					}

					String worldColor = Bukkit.getWorld(world) != null ? "§7" : "§c";

					sender.sendMessage(Main.PREFIX + worldColor + world + " §8- " + color + worlds.getString("environment") + "§7.");

				}

				worlds.close();

			} catch (SQLException exception) {

				Bukkit.getLogger().severe("[WorldUtils] Error to fetch informations of worlds in DB.");
				sender.sendMessage(Main.PREFIX + "§cError to fetch informations of worlds in DB.");

			}

			return true;

		}

		if (args[0].equalsIgnoreCase("tp")) {

			if (args.length < 2) {

				sender.sendMessage(Main.PREFIX + "Usage: /world tp <world>");
				return true;

			}

			String name = args[1];

			if (!WorldUtils.exist(name) && !name.equalsIgnoreCase("lobby")) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' doesn't exist.");
				return true;

			}

			if (Bukkit.getWorld(name) == null) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' is not loaded.");

			}

			World world = Bukkit.getWorld(name);
			Player player = Bukkit.getPlayer(sender.getName());

			player.teleport(world.getSpawnLocation());
			sender.sendMessage(Main.PREFIX + "You have been teleported to world '§6" + name + "§7'.");
			return true;

		}

		if (args[0].equalsIgnoreCase("game")) {

			if (args.length < 2) {

				sender.sendMessage(Main.PREFIX + "Usage: /world game <world>");
				return true;

			}

			String name = args[1];

			if (!WorldUtils.exist(name) && !name.equalsIgnoreCase("lobby")) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' doesn't exist.");
				return true;

			}

			if (Bukkit.getWorld(name) == null) {

				sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' is not loaded.");

			}

			if (name.equalsIgnoreCase("lobby")) {

				sender.sendMessage(Main.PREFIX + "You can't use the lobby world.");
		        return true;

			}

			Status status = GameUtils.getStatus();

			if (status == Status.TELEPORT || status == Status.PLAY || status == Status.END) {

				sender.sendMessage(Main.PREFIX + "You can't change the world during the game.");
		        return true;

			}

		    GameUtils.setWorld(name);
		    GameUtils.setStatus(Status.READY);
		    sender.sendMessage(Main.PREFIX + "The world '§6" + name + "§7' is now the game world.");
		    return true;

		    }

		sender.sendMessage(Main.PREFIX + "Usage of /world:");
		sender.sendMessage("§8⫸ §6/world create §8- §7Create a world.");
		sender.sendMessage("§8⫸ §6/world delete §8- §7Delete a world.");
		sender.sendMessage("§8⫸ §6/world reload §8- §7Reload a world.");
		sender.sendMessage("§8⫸ §6/world list §8- §7List all worlds.");
		sender.sendMessage("§8⫸ §6/world tp §8- §7Teleport to a world.");
		return true;

	}

	@Override
	public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {

		if (!sender.hasPermission("uhc.world")) return null;

		List<String> complete = new ArrayList<String>();

		if (args.length == 1) {

			complete.add("create");
			complete.add("delete");
			complete.add("reload");
			complete.add("list");
			complete.add("tp");

		} else if (args.length == 2) {

			if (args[0].equalsIgnoreCase("delete") || args[0].equalsIgnoreCase("reload") || args[0].equalsIgnoreCase("tp")) {

				for (World world : Bukkit.getWorlds()) {

					if (world.getName().equalsIgnoreCase("lobby")) {

						continue;

					}

					complete.add(world.getName());

				}

			}

		} else if (args.length == 4 || args.length == 5) {

			if (args[0].equalsIgnoreCase("create")) {

				complete.add("true");
				complete.add("false");

			}

		}

		List<String> tabCompletions = new ArrayList<String>();

		if (args[args.length - 1].isEmpty()) {

			for (String type : complete) {

				tabCompletions.add(type);

			}

		} else {

			for (String type : complete) {

				if (type.toLowerCase().startsWith(args[args.length - 1].toLowerCase())) tabCompletions.add(type);

			}

		}

		return tabCompletions;

	}

}

redpajama_set_name: RedPajamaGithub


text:
package test.builder;

public interface AbstractFileCreater {

	public void createFloder(String name);

	public void createFile(String name);

	public void createModule(String name);

}


text:
/*
    RoundedBorder.java

    Creates custom calculator buttons.
 */

package calculator.view;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class RoundedBorder implements Border {

    private int radius;

    RoundedBorder(int radius) {
        this.radius = radius;
    }

    public Insets getBorderInsets(Component c) {
        return new Insets(this.radius+1, this.radius+1, this.radius+2, this.radius);
    }

    public boolean isBorderOpaque() {
        return true;
    }

    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
        g.drawRoundRect(x, y, width-1, height-1, radius, radius);
    }
}


text:
package com.intellij.psi.impl.source.tree.java;

import com.intellij.lang.ASTNode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.psi.JavaElementVisitor;
import com.intellij.psi.JavaTokenType;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiSwitchLabelStatement;
import com.intellij.psi.impl.source.tree.ChildRole;
import com.intellij.psi.impl.source.tree.ElementType;
import com.intellij.psi.impl.source.tree.JavaElementType;
import com.intellij.psi.tree.ChildRoleBase;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;

public class PsiSwitchLabelStatementImpl extends PsiSwitchLabelStatementBaseImpl implements PsiSwitchLabelStatement {
  private static final Logger LOG = Logger.getInstance(PsiSwitchLabelStatementImpl.class);

  public PsiSwitchLabelStatementImpl() {
    super(JavaElementType.SWITCH_LABEL_STATEMENT);
  }

  @Override
  public ASTNode findChildByRole(int role) {
    LOG.assertTrue(ChildRole.isUnique(role));
    switch (role) {
      case ChildRole.CASE_KEYWORD: return findChildByType(JavaTokenType.CASE_KEYWORD);
      case ChildRole.DEFAULT_KEYWORD: return findChildByType(JavaTokenType.DEFAULT_KEYWORD);
      case ChildRole.CASE_EXPRESSION: return findChildByType(ElementType.EXPRESSION_BIT_SET);
      case ChildRole.COLON: return findChildByType(JavaTokenType.COLON);
      default: return null;
    }
  }

  @Override
  public int getChildRole(@NotNull ASTNode child) {
    LOG.assertTrue(child.getTreeParent() == this);
    IElementType i = child.getElementType();
    if (i == JavaTokenType.CASE_KEYWORD) return ChildRole.CASE_KEYWORD;
    if (i == JavaTokenType.DEFAULT_KEYWORD) return ChildRole.DEFAULT_KEYWORD;
    if (i == JavaTokenType.COLON) return ChildRole.COLON;
    if (ElementType.EXPRESSION_BIT_SET.contains(child.getElementType())) return ChildRole.CASE_EXPRESSION;
    return ChildRoleBase.NONE;
  }

  @Override
  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof JavaElementVisitor) {
      ((JavaElementVisitor)visitor).visitSwitchLabelStatement(this);
    }
    else {
      visitor.visitElement(this);
    }
  }

  @Override
  public String toString() {
    return "PsiSwitchLabelStatement";
  }
}


text:
package org.lastaflute.xlsreport;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.lastaflute.xlsreport.exception.ReportingXlsWriteFailureException;

/**
 * @author jflute
 */
public class XlsBook {

    protected final HSSFWorkbook workbook;

    public XlsBook(HSSFWorkbook workbook) {
        this.workbook = workbook;
    }

    public void write(OutputStream stream) {
        try {
            workbook.write(stream);
        } catch (IOException e) {
            String msg = "Failed to write the xls book: " + workbook;
            throw new ReportingXlsWriteFailureException(msg, e);
        } finally {
            try {
                stream.close();
            } catch (IOException ignored) {}
        }
    }

    public void protect(String username, String password) {
        workbook.writeProtectWorkbook(password, username);
    }

    public HSSFWorkbook getWorkbook() {
        return workbook;
    }
}


text:
const channels = {}

export default {
  subscribe(channel, cb) {
    if(!channels[channel]) {
      channels[channel] = []
    }

    channels[channel].push(cb)
  },

  publish(channel, data) {
    if(!channels[channel]) { return }

    channels[channel].forEach(cb => {
      cb(data)
    })
  }
}


text:
from gi.repository import Gtk

class DeviceStatusBar(Gtk.Box):
    def __init__(self, instrument):
        super().__init__(orientation=Gtk.Orientation.HORIZONTAL)
        self._instrument = instrument
        self._statuslabels = {}
        self._connections = {}
        self._status = {}
        self._auxstatus = {}
        for device in sorted(self._instrument.devices):
            dev = self._instrument.get_device(device)
            frame = Gtk.Frame(label=device)
            self._status[dev] = dev.get_variable('_status')
            try:
                self._auxstatus[dev] = dev.get_variable('_auxstatus')
            except KeyError:
                self._auxstatus[dev] = None
            self._statuslabels[device] = Gtk.Label(label=self.get_labeltext(dev))
            frame.add(self._statuslabels[device])
            self.pack_start(frame, True, True, 0)
            self._connections[dev] = dev.connect('variable-change', self.on_variable_change, device)

    def get_labeltext(self, device):
        if (device not in self._auxstatus) or (self._auxstatus[device] is None):
            return str(self._status[device])
        else:
            return '{} ({})'.format(self._status[device], self._auxstatus[device])

    def do_destroy(self):
        try:
            for d in self._connections:
                d.disconnect(self._connections[d])
        finally:
            self._connections = {}

    def on_variable_change(self, device, variablename, newvalue, devicename):
        if variablename == '_status':
            self._status[device] = newvalue
            self._statuslabels[devicename].set_text(self.get_labeltext(device))
        elif variablename == '_auxstatus':
            self._auxstatus[device] = newvalue
            self._statuslabels[devicename].set_text(self.get_labeltext(device))
        return False


text:
#ifndef __EXIV2_PREVIEWMANAGER_PRIVATE_H__
#define __EXIV2_PREVIEWMANAGER_PRIVATE_H__

#include "exiv2-previewmanager.h"
#include <exiv2/preview.hpp>

G_BEGIN_DECLS

struct _Exiv2PreviewManagerPrivate
{
	Exiv2::PreviewManager *manager;
};

G_END_DECLS

#endif /* __EXIV2_PREVIEWMANAGER_PRIVATE_H__ */


text:
using System;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.Modules;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Orchard.Autoroute.Drivers;
using Orchard.Autoroute.Indexing;
using Orchard.Autoroute.Model;
using Orchard.Autoroute.Routing;
using Orchard.Autoroute.Services;
using Orchard.Autoroute.Settings;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Display.ContentDisplay;
using Orchard.ContentManagement.Handlers;
using Orchard.ContentManagement.Records;
using Orchard.ContentTypes.Editors;
using Orchard.Data.Migration;
using Orchard.Environment.Shell;
using Orchard.Indexing;
using Orchard.Security.Permissions;
using Orchard.Title.Handlers;
using Orchard.Tokens;
using YesSql.Core.Indexes;
using YesSql.Core.Services;

namespace Orchard.Autoroute
{
    public class Startup : StartupBase
    {
        public override void ConfigureServices(IServiceCollection services)
        {
            // Autoroute Part
            services.AddScoped<IContentPartDisplayDriver, AutoroutePartDisplay>();
            services.AddScoped<IPermissionProvider, Permissions>();
            services.AddSingleton<ContentPart, AutoroutePart>();
            services.AddScoped<IContentPartHandler, AutoroutePartHandler>();
            services.AddScoped<IContentTypePartDefinitionDisplayDriver, AutoroutePartSettingsDisplayDriver>();
            services.AddScoped<IContentPartIndexHandler, AutoroutePartIndexHandler>();

            services.AddScoped<IIndexProvider, AutoroutePartIndexProvider>();
            services.AddScoped<IDataMigration, Migrations>();

            services.AddSingleton<IAutorouteEntries, AutorouteEntries>();

            services.AddNullTokenizer();
        }

        public override void Configure(IApplicationBuilder app, IRouteBuilder routes, IServiceProvider serviceProvider)
        {
            var entries = serviceProvider.GetRequiredService<IAutorouteEntries>();
            var session = serviceProvider.GetRequiredService<ISession>();
            var autoroutes = session.QueryIndexAsync<AutoroutePartIndex>().List().GetAwaiter().GetResult();

            entries.AddEntries(autoroutes.Select(x => new AutorouteEntry { ContentItemId = x.ContentItemId, Path = x.Path }));

            var autorouteRoute = new AutorouteRoute(entries, routes.DefaultHandler);

            routes.Routes.Insert(0, autorouteRoute);
        }
    }
}


text:
import home from './home'
import me from './me'
import record from '/record'
import login from '/login'

export default {
    home,
    me,
    record,
    login,
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

/** @file base64.h
*	@brief Prototypes for functions related to encoding/decoding
*	a @c buffer using standard base64 encoding.
*/

#ifndef BASE64_H
#define BASE64_H

#include "strings.h"
#include "buffer_.h"

#ifdef __cplusplus
#include <cstddef>
extern "C" {
#else
#include <stddef.h>
#endif

/**
 * @brief	Base64 encodes a buffer and returns the resulting string.
 *
 * @param	input	The buffer that needs to be base64 encoded.
 *
 * 			Base64_Encode takes as a parameter a pointer to a BUFFER. If @p input is @c NULL then
 * 			@c Base64_Encode returns @c NULL. The size of the BUFFER pointed to by @p input may
 * 			be zero. If when allocating memory to produce the encoding a failure occurs, then @c
 * 			Base64_Encode returns @c NULL. Otherwise
 * 			@c Base64_Encode returns a pointer to a STRING. That string contains the
 * 			base 64 encoding of the @p input. This encoding of @p input will not contain embedded
 * 			line feeds.
 *
 * @return	A @c STRING_HANDLE containing the base64 encoding of @p input.
 */
extern STRING_HANDLE Base64_Encode(BUFFER_HANDLE input);

/**
 * @brief	Base64 encodes the buffer pointed to by @p source and returns the resulting string.
 *
 * @param	source	The buffer that needs to be base64 encoded.
 * @param	size  	The size.
 *
 * 			This function produces a @c STRING_HANDLE containing the base64 encoding of the
 * 			buffer pointed to by @p source, having the size as given by
 * 			@p size. If @p source is @c NULL then @c Base64_Encode_Bytes returns @c NULL
 * 			If @p source is not @c NULL and @p size is zero, then @c Base64_Encode_Bytes produces
 * 			an empty @c STRING_HANDLE. Otherwise, @c Base64_Encode_Bytes produces a
 * 			@c STRING_HANDLE containing the Base64 representation of the buffer. In case of
 * 			any errors, @c Base64_Encode_Bytes returns @c NULL.].
 *
 * @return	@c NULL in case an error occurs or a @c STRING_HANDLE containing the base64 encoding
 * 			of @p input.
 *
 */
extern STRING_HANDLE Base64_Encode_Bytes(const unsigned char* source, size_t size);

/**
 * @brief	Base64 decodes the buffer pointed to by @p source and returns the resulting buffer.
 *
 * @param	source	A base64 encoded string buffer.
 *
 *       	This function decodes the string pointed at by @p source using base64 decoding and
 * 			returns the resulting buffer. If @p source is @c NULL then
 * 			@c Base64_Decoder returns NULL. If the string pointed to by @p source is zero
 * 			length then the handle returned refers to a zero length buffer. If there is any
 * 			memory allocation failure during the decode or if the source string has an invalid
 * 			length for a base 64 encoded string then @c Base64_Decoder returns @c NULL.
 *
 * @return	A @c BUFFER_HANDLE pointing to a buffer containing the result of base64 decoding @p
 * 			source.
 */
extern BUFFER_HANDLE Base64_Decoder(const char* source);

#ifdef __cplusplus
}
#endif

#endif /* BASE64_H */


text:
@implementation Region {

}
- (instancetype)initWithName:(NSString *)name {
    self = [super init];
    if (self) {
        self.name = name;
    }

    return self;
}

@end


text:
<button (click)="videoService.playOrPause()" id="playBtn" mat-fab color="white">
  <mat-icon *ngIf="videoService.player.paused">play_arrow</mat-icon>
  <mat-icon *ngIf="!videoService.player.paused">pause</mat-icon>
</button>
<!-- <button (click)="videoService.mute()" mat-raised-button mat-icon-button>
  <mat-icon *ngIf="videoService.player.muted">volume_off</mat-icon>
  <mat-icon *ngIf="!videoService.player.muted">volume_up</mat-icon>
</button> -->


text:
<?php
namespace TSwiackiewicz\EventsCollector\Event\Watcher\Action\Handler;

use TSwiackiewicz\EventsCollector\Exception\InvalidParameterException;

/**
 * Class WatcherEmailActionHandler
 * @package TSwiackiewicz\EventsCollector\Event\Watcher\Action\Handler
 */
class WatcherEmailActionHandler implements WatcherActionHandler
{
    /**
     * @var string
     */
    private $toAddress;

    /**
     * @var string
     */
    private $subject;

    /**
     * @param string $toAddress
     * @param string $subject
     */
    public function __construct($toAddress, $subject)
    {
        $this->toAddress = $toAddress;
        $this->subject = $subject;

        $this->validateEmailToAddress();
        $this->validateSubject();
    }

    /**
     * @throws InvalidParameterException
     */
    private function validateEmailToAddress()
    {
        if (false === filter_var($this->toAddress, FILTER_VALIDATE_EMAIL)) {
            throw new InvalidParameterException('Invalid recipient email address');
        }
    }

    /**
     * @throws InvalidParameterException
     */
    private function validateSubject()
    {
        if (empty($this->subject) || !is_string($this->subject)) {
            throw new InvalidParameterException('Not empty email message subject is required');
        }
    }

    /**
     * @param string $message
     */
    public function handle($message)
    {
        print "TO: `{$this->toAddress}`, SUBJECT: `{$this->subject}`, MESSAGE: `" . $message . "`" . PHP_EOL;

        //mail($this->toAddress, $this->subject, $message);
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package jselfbot.utils;

import java.awt.FontMetrics;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Globally available utility classes, mostly for string manipulation.
 *
 * @author Jim Menard, jimm@io.com
 */
public class WrapUtil {
  /**
   * Returns an array of strings, one for each line in the string after it has
   * been wrapped to fit lines of <var>maxWidth</var>. Lines end with any of
   * cr, lf, or cr lf. A line ending at the end of the string will not output a
   * further, empty string.
   *

   * This code assumes <var>str</var> is not null.
   *
   * @param str
   *          the string to split
   * @param fm
   *          needed for string width calculations
   * @param maxWidth
   *          the max line width, in points
   * @return a non-empty list of strings
   */
  public static List wrap(String str, FontMetrics fm, int maxWidth) {
    List lines = splitIntoLines(str);
    if (lines.isEmpty())
      return lines;

    ArrayList strings = new ArrayList();
    for (Iterator iter = lines.iterator(); iter.hasNext();)
      wrapLineInto((String) iter.next(), strings, fm, maxWidth);
    return strings;
  }

  /**
   * Given a line of text and font metrics information, wrap the line and add
   * the new line(s) to <var>list</var>.
   *
   * @param line
   *          a line of text
   * @param list
   *          an output list of strings
   * @param fm
   *          font metrics
   * @param maxWidth
   *          maximum width of the line(s)
   */
  public static void wrapLineInto(String line, List list, FontMetrics fm, int maxWidth) {
    int len = line.length();
    int width;
    while (len > 0 && (width = fm.stringWidth(line)) > maxWidth) {
      // Guess where to split the line. Look for the next space before
      // or after the guess.
      int guess = len * maxWidth / width;
      String before = line.substring(0, guess).trim();

      width = fm.stringWidth(before);
      int pos;
      if (width > maxWidth) // Too long
        pos = findBreakBefore(line, guess);
      else { // Too short or possibly just right
        pos = findBreakAfter(line, guess);
        if (pos != -1) { // Make sure this doesn't make us too long
          before = line.substring(0, pos).trim();
          if (fm.stringWidth(before) > maxWidth)
            pos = findBreakBefore(line, guess);
        }
      }
      if (pos == -1)
        pos = guess; // Split in the middle of the word

      list.add(line.substring(0, pos).trim());
      line = line.substring(pos).trim();
      len = line.length();
    }
    if (len > 0)
      list.add(line);
  }

  /**
   * Returns the index of the first whitespace character or '-' in <var>line</var>
   * that is at or before <var>start</var>. Returns -1 if no such character is
   * found.
   *
   * @param line
   *          a string
   * @param start
   *          where to star looking
     * @return
   */
  public static int findBreakBefore(String line, int start) {
    for (int i = start; i >= 0; --i) {
      char c = line.charAt(i);
      if (Character.isWhitespace(c) || c == '-')
        return i;
    }
    return -1;
  }

  /**
   * Returns the index of the first whitespace character or '-' in <var>line</var>
   * that is at or after <var>start</var>. Returns -1 if no such character is
   * found.
   *
   * @param line
   *          a string
   * @param start
   *          where to star looking
     * @return
   */
  public static int findBreakAfter(String line, int start) {
    int len = line.length();
    for (int i = start; i < len; ++i) {
      char c = line.charAt(i);
      if (Character.isWhitespace(c) || c == '-')
        return i;
    }
    return -1;
  }
  /**
   * Returns an array of strings, one for each line in the string. Lines end
   * with any of cr, lf, or cr lf. A line ending at the end of the string will
   * not output a further, empty string.
   *

   * This code assumes <var>str</var> is not null.
   *
   * @param str
   *          the string to split
   * @return a non-empty list of strings
   */
  public static List splitIntoLines(String str) {
    ArrayList strings = new ArrayList();

    int len = str.length();
    if (len == 0) {
      strings.add("");
      return strings;
    }

    int lineStart = 0;

    for (int i = 0; i < len; ++i) {
      char c = str.charAt(i);
      if (c == '\r') {
        int newlineLength = 1;
        if ((i + 1) < len && str.charAt(i + 1) == '\n')
          newlineLength = 2;
        strings.add(str.substring(lineStart, i));
        lineStart = i + newlineLength;
        if (newlineLength == 2) // skip \n next time through loop
          ++i;
      } else if (c == '\n') {
        strings.add(str.substring(lineStart, i));
        lineStart = i + 1;
      }
    }
    if (lineStart < len)
      strings.add(str.substring(lineStart));

    return strings;
  }

}


text:
<?php $this->load->view('partials/head', ['extra_css' => [
    '/assets/css/offsicks/create.css',
    '/assets/lib/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css'
]]); ?>

<?php $this->load->view('partials/navbar'); ?>

Nueva baja

            <form action="/offsicks/store/" method="POST" >

                <?php $this->load->view('offsicks/partials/form.php'); ?>

                            Cancelar

                        <button type="submit" class="btn btn-primary" id="submit" >
                            Guardar
                        </button>

            </form>

<?php $this->load->view('partials/footer', ['extra_js' => [
    '/assets/lib/bootstrap-datepicker/js/bootstrap-datepicker.min.js',
    '/assets/lib/bootstrap-datepicker/locales/bootstrap-datepicker.es.min.js',
    '/assets/js/offsicks/create.js'
]]); ?>


text:
<?php

namespace JJs\Bundle\ToolchainBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
 * Toolchain Extension
 *
 * Symfony2 kernel extension which integrates configuration artifacts from your
 * symfony2 application into your javascript toolchain.
 *
 * @author Josiah <josiah@jjs.id.au>
 */
class JJsToolchainExtension extends Extension
{
    /**
     * Container Extension Alias
     *
     * @var string
     */
    const Alias = "toolchain";

    /**
     * Loads a specific configuration.
     *
     * @param array            $config    An array of configuration values
     * @param ContainerBuilder $container A ContainerBuilder instance
     *
     * @throws InvalidArgumentException When provided tag is not defined in this extension
     */
    public function load(array $config, ContainerBuilder $container)
    {
        // Resolve the config
        $config = (new Processor())->processConfiguration(new Configuration(), $config);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load("toolchain.xml");

        // Load the plovr configuration
        if (array_key_exists('plovr', $config)) {
            $loader->load('plovr.xml');
            $this->loadPlovrConfig($config['plovr'], $container);
        }

        // Load the sass configuration
        if (array_key_exists('sass', $config)) {
            $loader->load('sass.xml');
            $this->loadSassConfig($config['sass'], $container);
        }
    }

    /**
     * Loads the sass configuration
     *
     * @param array            $config    Sass configuration
     * @param ContainerBuilder $container Container builder
     */
    public function loadSassConfig(array $config, ContainerBuilder $container)
    {
        $sass = $container->getDefinition('toolchain.sass.build_configuration');

        // Map values from the configuration into the service container
        $container->setParameter("toolchain.sass.bin", $config['bin']);

        // Map values from the configuration to method calls
        $sass->addMethodCall('setCompassEnabled', [$config['compass']]);

        // Add the input and output files
        foreach ($config['files'] as $file) {
            $sass->addMethodCall('addFile', [$file['input'], $file['output']]);
        }

        // Add the load paths
        foreach ($config['paths'] as $path) {
            $sass->addMethodCall('addLoadPath', [$path]);
        }
    }

    /**
     * Loads the plovr configuration
     *
     * @param array            $config    Plovr configuration
     * @param ContainerBuilder $container Container builder
     */
    public function loadPlovrConfig(array $config, ContainerBuilder $container)
    {
        // Map values from the configuration into the service container
        $container->setParameter("toolchain.plovr.bin", $config['bin']);

        // Create a map of build defaults
        $defaults = [];
        foreach (['closure_library'] as $key) {
            if (array_key_exists($key, $config)) {
                $defaults[$key] = $config[$key];
            }
        }

        // Configure each bundle in turn
        if (array_key_exists('builds', $config)) {
            foreach ($config['builds'] as $id => $options) {
                $options['id'] = $id;

                $this->loadBuildConfig(array_merge($defaults, $options), $container);
            }
        }
    }

    /**
     * Loads the plovr build configuration
     *
     * @param array            $config    Build configuration
     * @param ContainerBuilder $container Service container
     */
    public function loadBuildConfig(array $config, ContainerBuilder $container)
    {
        // Transform the build configuration
        foreach (['output'] as $prefix) {
            if (!array_key_exists($prefix, $config)) continue;

            foreach ($config[$prefix] as $key => $value) {
                $config["{$prefix}-{$key}"] = $value;
            }

            unset($config[$prefix]);
        }

        // Rewrite config keys
        foreach (['closure_library' => 'closure-library'] as $configKey => $plovrKey) {
            if (!array_key_exists($configKey, $config)) continue;

            $config[$plovrKey] = $config[$configKey];
            unset($config[$configKey]);
        }

        $compiler = $container->getDefinition('toolchain.plovr.build_manager');
        $compiler->addMethodCall('addBuild', [$config['id'], $config]);
    }

    /**
     * Returns the recommended alias to use in XML.
     *
     * This alias is also the mandatory prefix to use when using YAML.
     *
     * @return string The alias
     */
    public function getAlias()
    {
        return static::Alias;
    }
}


text:
package com.crowdin.parameters;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author ihor <ihor.popyk@crowdin.com>
 */
public class CrowdinApiParametersBuilder {

  private Boolean applyUntranslatedStringsOnly;

  private Boolean approveTranslated;

  private Boolean autoApproveImported;

  private Boolean autoTranslateDialects;

  private String branch;

  private String cname;

  private String charTransformation;

  private Boolean contentSegmentation;

  private String description;

  private String destinationFolder;

  private String downloadPackage;

  private String engine;

  private Integer escapeQuotes;

  private Boolean exportApprovedOnly;

  private String exportLanguage;

  private Map<String, String> exportPatterns = new HashMap<>();

  private Boolean exportTranslatedOnly;

  private String firstLineContainsHeader;

  private String file;

  private String files;

  private String format;

  private Map<String, String> headers = new HashMap<>();

  private Boolean hideDuplicates;

  private String identifier;

  private Boolean importDuplicates;

  private Boolean importEqSuggestion;

  private Boolean includeAssigned;

  private Boolean inContext;

  private Boolean isBranch;

  private String joinPolicy;

  private String json;

  private String jsonp;

  private String language;

  private List<String> languages = new ArrayList<>();

  private String languageAccessPolicy;

  private Integer lengthTransformation;

  private String login;

  private String logo;

  private String method;

  private String name;

  private String newName;

  private Boolean perfectMatch;

  private String prefix;

  private String projectIdentifier;

  private String pseudoLanguages;

  private Boolean publicDownlaod;

  private String scheme;

  private String sourceLanguage;

  private String suffix;

  private String title;

  private Map<String, String> titles = new HashMap<>();

  private List<String> translatableElements = new ArrayList<>();

  private Boolean translateAttributes;

  private Boolean translateContent;

  private String type;

  private String updateOption;

  private Boolean useGlobalTM;

  private String version;

  private String webhookFileProofread;

  private String webhookFileTranslated;

  private String webhookProjectProofread;

  private String webhookProjectTranslated;

  private String xml;

  public Boolean getApplyUntranslatedStringsOnly() {
    return this.applyUntranslatedStringsOnly;
  }

  /**
   *
   * @param applyUntranslatedStringsOnly
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder applyUntranslatedStringsOnly(Boolean applyUntranslatedStringsOnly) {
    this.applyUntranslatedStringsOnly = applyUntranslatedStringsOnly;
    return this;
  }

  public Boolean getApproveTranslated() {
    return this.approveTranslated;
  }

  /**
   *
   * @param approveTranslated
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder approveTranslated(Boolean approveTranslated) {
    this.approveTranslated = approveTranslated;
    return this;
  }

  public Boolean getAutoApproveImported() {
    return this.autoApproveImported;
  }

  /**
   *
   * @param autoApproveImported
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder autoApproveImported(Boolean autoApproveImported) {
    this.autoApproveImported = autoApproveImported;
    return this;
  }

  public Boolean getAutoTranslateDialects() {
    return this.autoTranslateDialects;
  }

  /**
   *
   * @param autoTranslateDialects
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder autoTranslateDialects(Boolean autoTranslateDialects) {
    this.autoTranslateDialects = autoTranslateDialects;
    return this;
  }

  public String getBranch() {
    return this.branch;
  }

  /**
   *
   * @param branch
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder branch(String branch) {
    this.branch = branch;
    return this;
  }

  public String getCname() {
    return this.cname;
  }

  /**
   *
   * @param cname
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder cname(String cname) {
    this.cname = cname;
    return this;
  }

  public String getCharTransformation() {
    return this.charTransformation;
  }

  /**
   *
   * @param charTransformation
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder charTransformation(String charTransformation) {
    this.charTransformation = charTransformation;
    return this;
  }

  public Boolean getContentSegmentation() {
    return this.contentSegmentation;
  }

  /**
   *
   * @param contentSegmentation
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder contentSegmentation(Boolean contentSegmentation) {
    this.contentSegmentation = contentSegmentation;
    return this;
  }

  public String getDownloadPackage() {
    return this.downloadPackage;
  }

  /**
   *
   * @param downloadPackage
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder downloadPackage(String downloadPackage) {
    this.downloadPackage = downloadPackage;
    return this;
  }

  public String getDescription() {
    return this.description;
  }

  /**
   *
   * @param description
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder description(String description) {
    this.description = description;
    return this;
  }

  public String getDestinationFolder() {
    return this.destinationFolder;
  }

  /**
   *
   * @param destinationFolder
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder destinationFolder(String destinationFolder) {
    this.destinationFolder = destinationFolder;
    return this;
  }

  public String getEngine() {
    return  this.engine;
  }

  /**
   *
   * @param engine
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder engine(String engine) {
    this.engine = engine;
    return this;
  }

  public Integer getEscapeQuotes() {
    return this.escapeQuotes;
  }

  /**
   *
   * @param escapeQuotes
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder escapeQuotes(Integer escapeQuotes) {
    this.escapeQuotes = escapeQuotes;
    return this;
  }

  public Boolean getExportApprovedOnly() {
    return this.exportApprovedOnly;
  }

  /**
   *
   * @param exportApprovedOnly
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder exportApprovedOnly(Boolean exportApprovedOnly) {
    this.exportApprovedOnly = exportApprovedOnly;
    return this;
  }

  public String getExportLanguage() {
    return this.exportLanguage;
  }

  public CrowdinApiParametersBuilder exportLanguage(String exportLanguage) {
    this.exportLanguage = exportLanguage;
    return this;
  }

  public Map<String, String>  getExportPatterns() {
    return this.exportPatterns;
  }

  /**
   *
   * @param exportPatterns
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder exportPatterns(String path, String exportPatterns) {
    this.exportPatterns.put(path, exportPatterns);
    return this;
  }

  public Boolean getExportTranslatedOnly() {
    return this.exportTranslatedOnly;
  }

  /**
   *
   * @param exportTranslatedOnly
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder exportTranslatedOnly(Boolean exportTranslatedOnly) {
    this.exportTranslatedOnly = exportTranslatedOnly;
    return this;
  }

  public String getFirstLineContainsHeader() {
    return this.firstLineContainsHeader;
  }

  /**
   *
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder firstLineContainsHeader() {
    this.firstLineContainsHeader = Boolean.TRUE.toString();
    return this;
  }

  public String getFile() {
    return this.file;
  }

  /**
   *
   * @param file
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder file(String file) {
    this.file = file;
    return this;
  }

  public String getFiles() {
    return this.files;
  }

  public CrowdinApiParametersBuilder files(String file) {
    this.files = file;
    return this;
  }

  public String getFormat() {
    return this.format;
  }

  /**
   *
   * @param format
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder format(String format) {
    this.format = format;
    return this;
  }

  public Map<String, String> getHeaders() {
    return this.headers;
  }

  public CrowdinApiParametersBuilder headers(String key, String value) {
    this.headers.put(key, value);
    return this;
  }

  public Boolean getHideDuplicates() {
    return this.hideDuplicates;
  }

  /**
   *
   * @param hideDuplicates
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder hideDuplicates(Boolean hideDuplicates) {
    this.hideDuplicates = hideDuplicates;
    return this;
  }

  public String getIdentifier() {
    return this.identifier;
  }

  /**
   *
   * @param identifier
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder identifier(String identifier) {
    this.identifier = identifier;
    return this;
  }

  public Boolean getImportDuplicates() {
    return this.importDuplicates;
  }

  /**
   *
   * @param importDuplicates
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder importDuplicates(Boolean importDuplicates) {
    this.importDuplicates = importDuplicates;
    return this;
  }

  public Boolean getImportEqSuggestion() {
    return this.importEqSuggestion;
  }

  /**
   *
   * @param importEqSuggestion
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder importEqSuggestion(Boolean importEqSuggestion) {
    this.importEqSuggestion = importEqSuggestion;
    return this;
  }

  public Boolean getIncludeAssigned() {
    return this.includeAssigned;
  }

  /**
   *
   * @param includeAssigned
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder includeAssigned(Boolean includeAssigned) {
    this.includeAssigned = includeAssigned;
    return this;
  }

  public Boolean getInContext() {
    return this.inContext;
  }

  /**
   *
   * @param inContext
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder inContext(Boolean inContext) {
    this.inContext = inContext;
    return this;
  }

  public Boolean getIsBranch() {
    return this.isBranch;
  }

  /**
   *
   * @param isBranch
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder isBranch(Boolean isBranch) {
    this.isBranch = isBranch;
    return this;
  }

  public String getJoinPolicy() {
    return this.joinPolicy;
  }

  /**
   *
   * @param joinPolicy
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder joinPolicy(String joinPolicy) {
    this.joinPolicy = joinPolicy;
    return this;
  }

  public String getJson() {
    return this.json;
  }

  /**
   *
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder json() {
    this.json = Boolean.TRUE.toString();
    return this;
  }

  public String getJsonp() {
    return this.jsonp;
  }

  /**
   *
   * @param jsonp
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder jsonp(String jsonp) {
    this.jsonp = jsonp;
    return this;
  }

  public String getLanguage() {
    return this.language;
  }

  /**
   *
   * @param language
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder language(String language) {
    this.language = language;
    return this;
  }

  public List<String> getLanguages() {
    return this.languages;
  }

  /**
   *
   * @param languages
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder languages(List<String> languages) {
    this.languages.addAll(languages);
    return this;
  }

  public String getLanguageAccessPolicy() {
    return this.languageAccessPolicy;
  }

  /**
   *
   * @param languageAccessPolicy
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder languageAccessPolicy(String languageAccessPolicy) {
    this.languageAccessPolicy = languageAccessPolicy;
    return this;
  }

  public Integer lengthTransformation() {
    return this.lengthTransformation;
  }

  /**
   *
   * @param lengthTransformation
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder lengthTransformation(Integer lengthTransformation) {
    this.lengthTransformation = lengthTransformation;
    return this;
  }

  public String getLogin() {
    return this.login;
  }

  /**
   *
   * @param login
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder login(String login) {
    this.login = login;
    return this;
  }

  public String getLogo() {
    return this.logo;
  }

  /**
   *
   * @param logo
   * @return CrowdinApiParametersBuilder
   */
  public CrowdinApiParametersBuilder logo(String logo) {
    this.logo = logo;
    return this;
  }

  public String getMethod() {
    return this.method;
  }

  /**
   *
   * @param method
   * @return CrowdinApiParametersBuilder
   */
  public CrowdinApiParametersBuilder method(String method) {
    this.method = method;
    return this;
  }

  public String getName() {
    return this.name;
  }

  /**
   *
   * @param name
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder name(String name) {
    this.name = name;
    return this;
  }

  public String getNewName() {
    return this.newName;
  }

  /**
   *
   * @param newName
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder newName(String newName) {
    this.newName = newName;
    return this;
  }

  public Boolean getPerfectMatch() {
    return this.perfectMatch;
  }

  /**
   *
   * @param perfectMatch
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder perfectMatch(Boolean perfectMatch) {
    this.perfectMatch = perfectMatch;
    return this;
  }

  public String getPrefix() {
    return this.prefix;
  }

  /**
   *
   * @param prefix
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder prefix(String prefix) {
    this.prefix = prefix;
    return this;
  }

  public String getProjectIdentifier() {
    return this.projectIdentifier;
  }

  /**
   *
   * @param projectIdentifier
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder projectIdentifier(String projectIdentifier) {
    this.projectIdentifier = projectIdentifier;
    return this;
  }

  public String getPseudoLanguages() {
    return this.pseudoLanguages;
  }

  /**
   *
   * @param pseudoLanguages
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder pseudoLanguages(String pseudoLanguages) {
    this.pseudoLanguages = pseudoLanguages;
    return this;
  }

  public Boolean getPublicDownlaod() {
    return this.publicDownlaod;
  }

  /**
   *
   * @param publicDownlaod
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder publicDownlaod(Boolean publicDownlaod) {
    this.publicDownlaod = publicDownlaod;
    return this;
  }

  public String getScheme() {
    return this.scheme;
  }

  /**
   *
   * @param scheme
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder scheme(String scheme) {
    this.scheme = scheme;
    return this;
  }

  public String getSourceLanguage() {
    return this.sourceLanguage;
  }

  /**
   *
   * @param sourceLanguage
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder sourceLanguage(String sourceLanguage) {
    this.sourceLanguage = sourceLanguage;
    return this;
  }

  public String getTitle() {
    return this.title;
  }

  /**
   *
   * @param title
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder title(String title) {
    this.title = title;
    return this;
  }

  public String getSuffix() {
    return this.suffix;
  }

  /**
   *
   * @param suffix
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder suffix(String suffix) {
    this.suffix = suffix;
    return this;
  }

  public Map<String, String> getTitles() {
    return this.titles;
  }

  /**
   *
   * @param path
   * @param title
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder titles(String path, String title) {
    this.titles.put(path, title);
    return this;
  }

  public List<String> getTranslatableElements() {
    return this.translatableElements;
  }

  /**
   *
   * @param translatableElements
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder translatableElements(List<String> translatableElements) {
    this.translatableElements.addAll(translatableElements);
    return this;
  }

  public Boolean getTranslateAttributes() {
    return this.translateAttributes;
  }

  /**
   *
   * @param translateAttributes
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder translateAttributes(Boolean translateAttributes) {
    this.translateAttributes = translateAttributes;
    return this;
  }

  public Boolean getTranslateContent() {
    return this.translateContent;
  }

  /**
   *
   * @param translateContent
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder translateContent(Boolean translateContent) {
    this.translateContent = translateContent;
    return this;
  }

  public String getType() {
    return this.type;
  }

  /**
   *
   * @param type
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder type(String type) {
    this.type = type;
    return this;
  }

  public String getUpdateOption() {
    return this.updateOption;
  }

  /**
   *
   * @param updateOption
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder updateOption(String updateOption) {
    this.updateOption = updateOption;
    return this;
  }

  public Boolean getUseGlobalTM() {
    return this.useGlobalTM;
  }

  /**
   *
   * @param useGlobalTM
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder useGlobalTM(Boolean useGlobalTM) {
    this.useGlobalTM = useGlobalTM;
    return this;
  }

  public String getVersion() {
    return this.version;
  }

  public CrowdinApiParametersBuilder version(String version) {
    this.version = version;
    return this;
  }

  public String getWebhookFileProofread() {
    return this.webhookFileProofread;
  }

  /**
   *
   * @param webhookFileProofread
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder webhookFileProofread(String webhookFileProofread) {
    this.webhookFileProofread = webhookFileProofread;
    return this;
  }

  public String getWebhookFileTranslated() {
    return this.webhookFileTranslated;
  }

  /**
   *
   * @param webhookFileTranslated
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder webhookFileTranslated(String webhookFileTranslated) {
    this.webhookFileTranslated = webhookFileTranslated;
    return this;
  }

  public String getWebhookProjectProofread() {
    return this.webhookProjectProofread;
  }

  /**
   *
   * @param webhookProjectProofread
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder webhookProjectProofread(String webhookProjectProofread) {
    this.webhookProjectProofread = webhookProjectProofread;
    return this;
  }

  public String getWebhookProjectTranslated() {
    return this.webhookProjectTranslated;
  }

  /**
   *
   * @param webhookProjectTranslated
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder webhookProjectTranslated(String webhookProjectTranslated) {
    this.webhookProjectTranslated = webhookProjectTranslated;
    return this;
  }

  public String getXml() {
    return this.xml;
  }

  /**
   *
   * @return CrowdinApiParametersBuilder
   *
   */
  public CrowdinApiParametersBuilder xml() {
    this.xml = Boolean.TRUE.toString();
    return this;
  }
}


text:
<?php
// here are the table creation for this module e.g.:
$this->startSetup();
//$this->run("HERE YOUR SQL");
$this->endSetup();


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

using Duality.Drawing;

namespace Duality.Resources
{
	/// <summary>
	/// Provides information about a shader variable.
	/// </summary>
	public class ShaderFieldInfo
	{
		private ShaderFieldScope scope;
		private ShaderFieldType type;
		private int arrayLength;
		private string name;
		private string description;
		private string editorTypeTag;
		private float minValue;
		private float maxValue;
		private bool isPrivate;

		/// <summary>
		/// [GET] The <see cref="ShaderFieldScope">scope</see> of the variable
		/// </summary>
		public ShaderFieldScope Scope
		{
			get { return this.scope; }
		}
		/// <summary>
		/// [GET] The <see cref="ShaderFieldType">type</see> of the variable
		/// </summary>
		public ShaderFieldType Type
		{
			get { return this.type; }
		}
		/// <summary>
		/// [GET] If the variable is an array, this is its length. Arrays
		/// are only supported for <see cref="ShaderFieldType.Int"/> and
		/// <see cref="ShaderFieldType.Float"/>.
		/// </summary>
		public int ArrayLength
		{
			get { return this.arrayLength; }
		}
		/// <summary>
		/// [GET] The name of the variable, as declared in the shader.
		/// </summary>
		public string Name
		{
			get { return this.name; }
		}
		/// <summary>
		/// [GET] Returns whether the shader variable should be considered private.
		/// </summary>
		public bool IsPrivate
		{
			get { return this.isPrivate; }
		}
		/// <summary>
		/// [GET] An optional tag that can be used to select an appropriate editor beyond
		/// the basic field <see cref="Type"/> definition. For example, colors are usually
		/// defined as <see cref="ShaderFieldType.Vec4"/> shader fields, but should actually
		/// be edited as colors.
		/// </summary>
		public string EditorTypeTag
		{
			get { return this.editorTypeTag; }
		}
		/// <summary>
		/// [GET] An optional description that can be displayed as an editor tooltip for this
		/// shader field.
		/// </summary>
		public string Description
		{
			get { return this.description; }
		}
		/// <summary>
		/// [GET] The minimum value of this field, should it represent a numeric type.
		/// For other fields, this value is ignored. Note that this value is only enforced
		/// in the editor. You can still set arbitrary values via code.
		/// </summary>
		public float MinValue
		{
			get { return this.minValue; }
		}
		/// <summary>
		/// [GET] The maximum value of this field, should it represent a numeric type.
		/// For other fields, this value is ignored. Note that this value is only enforced
		/// in the editor. You can still set arbitrary values via code.
		/// </summary>
		public float MaxValue
		{
			get { return this.maxValue; }
		}

		public ShaderFieldInfo(string name, ShaderFieldType type, ShaderFieldScope scope, int arrayLength, string editorTypeTag, string description, float minValue, float maxValue)
		{
			this.name = name;
			this.type = type;
			this.scope = scope;
			this.arrayLength = arrayLength;
			this.editorTypeTag = editorTypeTag;
			this.description = description;
			this.minValue = minValue;
			this.maxValue = maxValue;
			this.isPrivate = string.IsNullOrEmpty(name) || name[0] == '_';
		}

		public override string ToString()
		{
			return string.Format("{1} {0}{2}",
				this.name,
				this.type,
				this.arrayLength > 1 ? string.Format("[{0}]", this.arrayLength) : "");
		}
	}
}


text:
import six
import inspect
import functools
import importlib

from collections import defaultdict
from django.conf import urls
from .patterns import URLPattern

class URLView(object):
    """
        Abstract class with url and name.

        Since URLs can't be changed on runtime it is kind of pointless
        to have ``get_url`` or ``get_url_name`` methods. So there are not any.
    """

    url = NotImplemented
    url_name = NotImplemented
    url_priority = None

def url_view(url_pattern, name=None, priority=None):
    """
    Decorator for registering functional views.
    Meta decorator syntax has to be used in order to accept arguments.

    This decorator does not really do anything that magical:

    This:
    >>> from urljects import U, url_view
    >>> @url_view(U / 'my_view')
    ... def my_view(request)
    ...     pass

    is equivalent to this:
    >>> def my_view(request)
    ...     pass
    >>> my_view.urljects_view = True
    >>> my_view.url = U / 'my_view'
    >>> my_view.url_name = 'my_view'

    Those view are then supposed to be used with ``view_include`` which will
    register all views that have ``urljects_view`` set to ``True``.

    :param url_pattern: regex or URLPattern or anything passable to url()
    :param name: name of the view, __name__ will be used otherwise.
    :param priority: priority of the view, the lower the better
    """

    def meta_wrapper(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            return func(*args, **kwargs)

        wrapper.urljects_view = True
        wrapper.url = url_pattern
        wrapper.url_name = name or func.__name__
        wrapper.url_priority = priority

        return wrapper
    return meta_wrapper

def resolve_name(view):
    """
    Auto guesses name of the view.
    For function it will be ``view.__name__``
    For classes it will be ``view.url_name``
    """
    if inspect.isfunction(view):
        return view.__name__
    if hasattr(view, 'url_name'):
        return view.url_name
    if isinstance(view, six.string_types):
        return view.split('.')[-1]
    return None

def url(url_pattern, view, kwargs=None, name=None):
    """
    This is replacement for ``django.conf.urls.url`` function.
    This url auto calls ``as_view`` method for Class based views and resolves
    URLPattern objects.

    If ``name`` is not specified it will try to guess it.

    :param url_pattern: string with regular expression or URLPattern
    :param view: function/string/class of the view
    :param kwargs: kwargs that are to be passed to view
    :param name: name of the view, if empty it will be guessed
    """
    # Special handling for included view
    if isinstance(url_pattern, URLPattern) and isinstance(view, tuple):
        url_pattern = url_pattern.for_include()

    if name is None:
        name = resolve_name(view)

    if callable(view) and hasattr(view, 'as_view') and callable(view.as_view):
        view = view.as_view()

    return urls.url(
        regex=url_pattern,
        view=view,
        kwargs=kwargs,
        name=name)

def view_include(view_module, namespace=None, app_name=None):
    """
    Includes view in the url, works similar to django include function.
    Auto imports all class based views that are subclass of ``URLView`` and
    all functional views that have been decorated with ``url_view``.

    :param view_module: object of the module or string with importable path
    :param namespace: name of the namespaces, it will be guessed otherwise
    :param app_name: application name
    :return: result of urls.include
    """

    # since Django 1.8 patterns() are deprecated, list should be used instead
    # {priority:[views,]}
    view_dict = defaultdict(list)

    if isinstance(view_module, six.string_types):
        view_module = importlib.import_module(view_module)

    # pylint:disable=unused-variable
    for member_name, member in inspect.getmembers(view_module):
        is_class_view = inspect.isclass(member) and issubclass(member, URLView)
        is_func_view = (inspect.isfunction(member) and
                        hasattr(member, 'urljects_view') and
                        member.urljects_view)

        if (is_class_view and member is not URLView) or is_func_view:
            view_dict[member.url_priority].append(
                url(member.url, member, name=member.url_name))

    view_patterns = list(*[
        view_dict[priority] for priority in sorted(view_dict)
        ])

    return urls.include(
        arg=view_patterns,
        namespace=namespace,
        app_name=app_name)


text:
module.exports = {
  schema: {
    usePhysics: {default: 'ifavailable'}
  },
  physicsInit: function () {
    this.constraints = new Map()
  },
  physicsUpdate: function () {
    if (this.data.usePhysics === 'never' && this.constraints.size) {
      this.physicsClear()
    }
  },
  physicsRemove: function () {
    this.physicsClear()
  },
  physicsStart: function (evt) {
    // initiate physics constraint if available and not already existing
    if (this.data.usePhysics !== 'never' && this.el.body &&
        evt.detail.hand.body && !this.constraints.has(evt.detail.hand)) {
      const newConId = Math.random().toString(36).substr(2, 9)
      this.el.setAttribute('constraint__' + newConId, {
        target: evt.detail.hand
      })
      this.constraints.set(evt.detail.hand, newConId)
      return true
    }
    // Prevent manual grab by returning true
    if (this.data.usePhysics === 'only') { return true }
    return false
  },
  physicsEnd: function (evt) {
    let constraintId = this.constraints.get(evt.detail.hand)
    if (constraintId) {
      this.el.removeAttribute('constraint__' + constraintId)
      this.constraints.delete(evt.detail.hand)
    }
  },
  physicsClear: function () {
    if (this.el.body) {
      for (let c of this.constraints.values()) {
        this.el.body.world.removeConstraint(c)
      }
    }
    this.constraints.clear()
  },
  physicsIsConstrained: function (el) {
    return this.constraints.has(el)
  },
  physicsIsGrabbing () {
    return this.constraints.size > 0
  }
}


text:
require 'tweetstream/client'
require 'tweetstream/hash'
require 'tweetstream/status'
require 'tweetstream/user'
require 'tweetstream/daemon'

module TweetStream
  class Terminated < ::StandardError; end
  class Error < ::StandardError; end
  class ConnectionError < TweetStream::Error; end
end


text:
package com.thinkaurelius.titan.graphdb.loading;

import com.thinkaurelius.titan.graphdb.query.SimpleAtomicQuery;
import com.thinkaurelius.titan.graphdb.transaction.InMemoryTitanGraph;
import com.thinkaurelius.titan.graphdb.transaction.TransactionConfig;
import com.thinkaurelius.titan.graphdb.types.system.SystemLabel;
import com.thinkaurelius.titan.graphdb.loadingstatus.DefaultLoadingStatus;
import com.thinkaurelius.titan.graphdb.loadingstatus.LoadingStatus;
import com.tinkerpop.blueprints.Direction;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class EdgeLoadingTest {

	@Test
	public void edgeLoadingTest() {
        InMemoryTitanGraph tx = new InMemoryTitanGraph(new TransactionConfig());

		LoadingStatus status1 = DefaultLoadingStatus.AllLoaded;
		LoadingStatus status2 = DefaultLoadingStatus.NothingLoaded;
		SimpleAtomicQuery q = new SimpleAtomicQuery(tx,1);
		assertTrue(status1.hasLoadedEdges(q));
		assertFalse(status2.hasLoadedEdges(q));
		assertTrue(status1==status1.loadedEdges(q));
		assertFalse(status2==status2.loadedEdges(q));

		LoadingStatus status=status2;
		assertTrue(status.loadedEdges(q).hasLoadedEdges(q));
		q.direction(Direction.OUT);
		assertFalse(status.hasLoadedEdges(q));
		status2 = status.loadedEdges(q);
		assertTrue(status2.hasLoadedEdges(q));
		q.type(SystemLabel.TYPE);
		assertTrue(status2.hasLoadedEdges(q));
		assertFalse(status.hasLoadedEdges(q));
	}

}


text:
#if ARDUINO >= 100
#ifndef IPAddress_h
#define IPAddress_h

#include <Printable.h>

// A class to make it easier to handle and pass around IP addresses

class IPAddress : public Printable {
private:
    uint8_t _address[4];  // IPv4 address
    // Access the raw byte array containing the address.  Because this returns a pointer
    // to the internal structure rather than a copy of the address this function should only
    // be used when you know that the usage of the returned uint8_t* will be transient and not
    // stored.
    uint8_t* raw_address() { return _address; };

public:
    // Constructors
    IPAddress();
    IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
    IPAddress(uint32_t address);
    IPAddress(const uint8_t *address);

    // Overloaded cast operator to allow IPAddress objects to be used where a pointer
    // to a four-byte uint8_t array is expected
    operator uint32_t () { return _address[0] | (_address[1] << 8)
	| (_address[2] << 16) | (_address[3] << 24); }
    bool operator==(const IPAddress& addr) { return _address[0] == addr._address[0]
	&& _address[1] == addr._address[1]
	&& _address[2] == addr._address[2]
	&& _address[3] == addr._address[3]; }
    bool operator==(const uint8_t* addr);

    // Overloaded index operator to allow getting and setting individual octets of the address
    uint8_t operator[](int index) const { return _address[index]; };
    uint8_t& operator[](int index) { return _address[index]; };

    // Overloaded copy operators to allow initialisation of IPAddress objects from other types
    IPAddress& operator=(const uint8_t *address);
    IPAddress& operator=(uint32_t address);

    virtual size_t printTo(Print& p) const;

    friend class EthernetClass;
    friend class UDP;
    friend class Client;
    friend class Server;
    friend class DhcpClass;
    friend class DNSClient;
};

const IPAddress INADDR_NONE(0,0,0,0);

#endif
#endif


text:
package com.amazonaws.services.glacier.model;

import java.io.Serializable;

/**
 *

 * Contains the Amazon Glacier response to your request.
 *

 */
public class GetVaultNotificationsResult implements Serializable, Cloneable {

    /**
     *

     * Returns the notification configuration set on the vault.
     *

     */
    private VaultNotificationConfig vaultNotificationConfig;

    /**
     *

     * Returns the notification configuration set on the vault.
     *

     *
     * @param vaultNotificationConfig
     *        Returns the notification configuration set on the vault.
     */

    public void setVaultNotificationConfig(
            VaultNotificationConfig vaultNotificationConfig) {
        this.vaultNotificationConfig = vaultNotificationConfig;
    }

    /**
     *

     * Returns the notification configuration set on the vault.
     *

     *
     * @return Returns the notification configuration set on the vault.
     */

    public VaultNotificationConfig getVaultNotificationConfig() {
        return this.vaultNotificationConfig;
    }

    /**
     *

     * Returns the notification configuration set on the vault.
     *

     *
     * @param vaultNotificationConfig
     *        Returns the notification configuration set on the vault.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public GetVaultNotificationsResult withVaultNotificationConfig(
            VaultNotificationConfig vaultNotificationConfig) {
        setVaultNotificationConfig(vaultNotificationConfig);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getVaultNotificationConfig() != null)
            sb.append("VaultNotificationConfig: "
                    + getVaultNotificationConfig());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof GetVaultNotificationsResult == false)
            return false;
        GetVaultNotificationsResult other = (GetVaultNotificationsResult) obj;
        if (other.getVaultNotificationConfig() == null
                ^ this.getVaultNotificationConfig() == null)
            return false;
        if (other.getVaultNotificationConfig() != null
                && other.getVaultNotificationConfig().equals(
                        this.getVaultNotificationConfig()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getVaultNotificationConfig() == null) ? 0
                        : getVaultNotificationConfig().hashCode());
        return hashCode;
    }

    @Override
    public GetVaultNotificationsResult clone() {
        try {
            return (GetVaultNotificationsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
#pragma once
#include <aws/mediaconvert/MediaConvert_EXPORTS.h>
#include <aws/mediaconvert/model/Preset.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace MediaConvert
{
namespace Model
{
  class AWS_MEDIACONVERT_API CreatePresetResult
  {
  public:
    CreatePresetResult();
    CreatePresetResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    CreatePresetResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    inline const Preset& GetPreset() const{ return m_preset; }

    inline void SetPreset(const Preset& value) { m_preset = value; }

    inline void SetPreset(Preset&& value) { m_preset = std::move(value); }

    inline CreatePresetResult& WithPreset(const Preset& value) { SetPreset(value); return *this;}

    inline CreatePresetResult& WithPreset(Preset&& value) { SetPreset(std::move(value)); return *this;}

  private:

    Preset m_preset;
  };

} // namespace Model
} // namespace MediaConvert
} // namespace Aws


text:
@interface UIView (Frame)

@property (nonatomic) CGFloat left;        ///< Shortcut for frame.origin.x.
@property (nonatomic) CGFloat top;         ///< Shortcut for frame.origin.y
@property (nonatomic) CGFloat right;       ///< Shortcut for frame.origin.x + frame.size.width
@property (nonatomic) CGFloat bottom;      ///< Shortcut for frame.origin.y + frame.size.height
@property (nonatomic) CGFloat width;       ///< Shortcut for frame.size.width.
@property (nonatomic) CGFloat height;      ///< Shortcut for frame.size.height.
@property (nonatomic) CGFloat centerX;     ///< Shortcut for center.x
@property (nonatomic) CGFloat centerY;     ///< Shortcut for center.y
@property (nonatomic) CGPoint origin;      ///< Shortcut for frame.origin.
@property (nonatomic) CGSize  size;        ///< Shortcut for frame.size.

@end


text:
{% from "_formhelpers.html" import render_field %}
{% extends "base.html" %}
{% block landregistry_grid %}

Home

    Land registry
    Find property information

      Concept

You can search the Land Registry for information on property or land such as title number, lease and purchase history. Interactive maps are also available.

    <form action="/search" method="get">
      <fieldset>

          Search for property or land

For example: postcode, street name, town or city

          <input type="text" class="form-control" id="q" name="q" />
          <button type="submit" class="button">Search</button>

      </fieldset>

        You can also search using a map.

    </form>

Help with your property

Authorise a solicitor or conveyancer

Update register

Change owner name

Register land

Land Registry guides

How to obtain Land Registry information

Update your contact address

Protecting home rights

 For solicitors and conveyancers

      Sign in with GOV.UK

{% endblock %}


text:
package org.dcm4chee.web.war.trash.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.dcm4che2.data.DicomObject;
import org.dcm4che2.data.Tag;
import org.dcm4chee.archive.entity.PrivateInstance;
import org.dcm4chee.web.war.common.model.AbstractDicomModel;

/**
 * @author Franz Willer <franz.willer@gmail.com>
 * @version $Revision$ $Date$
 * @since May 10, 2010
 */
public class PrivInstanceModel extends AbstractDicomModel implements Serializable {

    private static final long serialVersionUID = 1L;

    public PrivInstanceModel(PrivateInstance inst, PrivSeriesModel seriesModel) {
        setPk(inst.getPk());
        this.dataset = inst.getAttributes();
        setSeries(seriesModel);
    }

    private void setSeries(PrivSeriesModel seriesModel) {
        setParent(seriesModel);
    }

    public PrivSeriesModel getSeries() {
        return (PrivSeriesModel) getParent();
    }

    public String getSOPInstanceUID() {
        return dataset.getString(Tag.SOPInstanceUID, "");
    }

    private static String toDescription(DicomObject dataset) {
        String pmi = dataset.getString(Tag.PhotometricInterpretation);
        if (pmi != null) {
            StringBuilder sb = new StringBuilder();
            sb.append(pmi);
            sb.append(", ");
            sb.append(dataset.getString(Tag.BitsAllocated));
            sb.append(" bits, ");
            sb.append(dataset.getInt(Tag.Columns));
            sb.append("x");
            sb.append(dataset.getInt(Tag.Rows));
            sb.append("x");
            sb.append(dataset.getInt(Tag.NumberOfFrames, 1));
            return sb.toString();
        }
        String s;
        if ((s = dataset.getString(Tag.ContentDescription)) != null) {
            return s;
        }
        if ((s = dataset.getString(Tag.DocumentTitle)) != null) {
            return s;
        }
        return dataset.getString(
                new int[] { Tag.ConceptNameCodeSequence, 0, Tag.CodeMeaning });
    }

    public Date getDatetime() {
        return isPresentationState(getSopClassUID())
                ? toDate(Tag.PresentationCreationDate, Tag.PresentationCreationDate)
                : toDate(Tag.ContentDate, Tag.ContentTime);
    }

    private boolean isPresentationState(String cuid) {
        return cuid.startsWith("1.2.840.10008.5.1.4.1.1.11.");
    }

    public String getInstanceNumber() {
        return dataset.getString(Tag.InstanceNumber, "");
    }

    public String getSopClassUID() {
        return dataset.getString(Tag.SOPClassUID);
    }

    public String getDescription() {
        return toDescription(dataset);
    }

    public String getAvailability() {
        return dataset.getString(Tag.InstanceAvailability);
    }

    @Override
    public int getRowspan() {
        int rowspan = isDetails() ? 2 : 1;
        return rowspan;
    }

    @Override
    public void collapse() {
    }

    @Override
    public boolean isCollapsed() {
        return true;
    }

    @Override
    public void expand() {
    }

    @Override
    public int levelOfModel() {
        return INSTANCE_LEVEL;
    }

    @Override
    public List<? extends AbstractDicomModel> getDicomModelsOfNextLevel() {
        return null; //instance is the last DICOM level.
    }
}


text:
package ie.cit.group3.service;

/**
 * @author John Murphy
 *
 * This interface defines the contract/methods that a Comment Object can use at the Service Layer.
 * Activities are:
 * 	List<Comment> findBychobject_idANDFlagFalse(String chobject_id);
	List<Comment> findBychobject_id(String chobject_id);
	Page<Comment> findByCommenttextLike(String commenttext, Pageable pageable);
	long countByCommenttextLike(String commenttext);
	public Comment findOne(int id);
	public void save(Comment comment);
 *
 */

import ie.cit.group3.entity.Comment;
import ie.cit.group3.entity.CommentFlag;
import ie.cit.group3.repository.CommentFlagRepository;
import ie.cit.group3.repository.CommentRepository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class CommentServiceImpl implements CommentService{

	@Autowired
	CommentRepository repo;

	public CommentServiceImpl() {
		super();
		// TODO empty constructor
	}

	public CommentServiceImpl(CommentRepository repo) {
		// TODO constructor with one @param CommentRepository
		this.repo = repo;
	}

	@Override
	public List<Comment> findBychobject_idANDFlagFalse(String id) {
		// TODO method that returns a list of comments based on chobject_id and flag = false
		return repo.findBychobject_idANDFlagFalse(id);
	}

	@Override
	public List<Comment> findBychobject_id(String id) {
		// TODO method that returns a list of comments based on chobject_id
		return repo.findBychobject_id(id);
	}

	@Override
	public Page<Comment> findByCommenttextLike(String commenttext,
			Pageable pageable) {
		// TODO method that returns a Page of comments based on commenttext argument
		return repo.findByCommenttextLike(commenttext, pageable);
	}

	@Override
	public long countByCommenttextLike(String commenttext) {
		// TODO method that returns a count of the commenttext items that are like the argument passed in.
		return repo.countByCommenttextLike(commenttext);
	}

	@Override
	public Comment findOne(int id) {
		// TODO method that finds a comment based on its id
		return repo.findOne(id);
	}

	@Override
	public void save(Comment comment) {
		// TODO method that saves Comment object to repo
		repo.save(comment);
	}

	}


text:
#ifndef CDSLIB_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H
#define CDSLIB_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H

#include <functional>   // ref
#include <list>
#include <algorithm>    // std::lower_bound
#include <cds/container/striped_set/adapter.h>

#undef CDS_STD_LIST_SIZE_CXX11_CONFORM
#if !( defined(__GLIBCXX__ ) && (!defined(_GLIBCXX_USE_CXX11_ABI) || _GLIBCXX_USE_CXX11_ABI == 0 ))
#   define CDS_STD_LIST_SIZE_CXX11_CONFORM
#endif

//@cond
namespace cds { namespace container {
    namespace striped_set {

        // Copy policy for std::list
        template <typename T, typename Alloc>
        struct copy_item_policy< std::list< T, Alloc > >
        {
            typedef std::list< T, Alloc > list_type;
            typedef typename list_type::iterator iterator;

            void operator()( list_type& list, iterator itInsert, iterator itWhat )
            {
                itInsert = list.insert( itInsert, *itWhat );
            }
        };

        // Swap policy for std::list
        template <typename T, typename Alloc>
        struct swap_item_policy< std::list< T, Alloc > >
        {
            typedef std::list< T, Alloc > list_type;
            typedef typename list_type::iterator iterator;

            void operator()( list_type& list, iterator itInsert, iterator itWhat )
            {
                typename list_type::value_type newVal;
                itInsert = list.insert( itInsert, newVal );
                std::swap( *itWhat, *itInsert );
            }
        };

        // Move policy for std::list
        template <typename T, typename Alloc>
        struct move_item_policy< std::list< T, Alloc > >
        {
            typedef std::list< T, Alloc > list_type;
            typedef typename list_type::iterator iterator;

            void operator()( list_type& list, iterator itInsert, iterator itWhat )
            {
                list.insert( itInsert, std::move( *itWhat ) );
            }
        };
    }   // namespace striped_set
}} // namespace cds::container

namespace cds { namespace intrusive { namespace striped_set {

    /// std::list adapter for hash set bucket
    template <typename T, class Alloc, typename... Options>
    class adapt< std::list<T, Alloc>, Options... >
    {
    public:
        typedef std::list<T, Alloc>     container_type          ;   ///< underlying container type

    private:
        /// Adapted container type
        class adapted_container: public cds::container::striped_set::adapted_sequential_container
        {
        public:
            typedef typename container_type::value_type value_type  ;   ///< value type stored in the container
            typedef typename container_type::iterator      iterator ;   ///< container iterator
            typedef typename container_type::const_iterator const_iterator ;    ///< container const iterator

            static bool const has_find_with = true;
            static bool const has_erase_with = true;

        private:
            //@cond
            typedef typename cds::opt::details::make_comparator_from_option_list< value_type, Options... >::type key_comparator;

            typedef typename cds::opt::select<
                typename cds::opt::value<
                    typename cds::opt::find_option<
                        cds::opt::copy_policy< cds::container::striped_set::move_item >
                        , Options...
                    >::type
                >::copy_policy
                , cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
                , cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
                , cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
            >::type copy_item;

            struct find_predicate
            {
                bool operator()( value_type const& i1, value_type const& i2) const
                {
                    return key_comparator()( i1, i2 ) < 0;
                }

                template <typename Q>
                bool operator()( Q const& i1, value_type const& i2) const
                {
                    return key_comparator()( i1, i2 ) < 0;
                }

                template <typename Q>
                bool operator()( value_type const& i1, Q const& i2) const
                {
                    return key_comparator()( i1, i2 ) < 0;
                }
            };
            //@endcond

        private:
            //@cond
            container_type  m_List;
#       if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
            // GCC C++ lib bug:
            // In GCC, the complexity of std::list::size() is O(N)
            // (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49561)
            // Fixed in GCC 5
            size_t          m_nSize ;   // list size
#       endif
            //@endcond

        public:
            adapted_container()
#       if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                : m_nSize(0)
#       endif
            {}

            template <typename Q, typename Func>
            bool insert( const Q& val, Func f )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), val, find_predicate() );
                if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                    value_type newItem( val );
                    it = m_List.insert( it, newItem );
                    f( *it );

#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                    ++m_nSize;
#           endif
                    return true;
                }

                // key already exists
                return false;
            }

            template <typename... Args>
            bool emplace( Args&&... args )
            {
                value_type val(std::forward<Args>(args)...);
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), val, find_predicate() );
                if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                    it = m_List.emplace( it, std::move( val ) );
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                    ++m_nSize;
#           endif
                    return true;
                }
                return false;
            }

            template <typename Q, typename Func>
            std::pair<bool, bool> update( const Q& val, Func func, bool bAllowInsert )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), val, find_predicate() );
                if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                    // insert new
                    if ( !bAllowInsert )
                        return std::make_pair( false, false );

                    value_type newItem( val );
                    it = m_List.insert( it, newItem );
                    func( true, *it, val );
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                    ++m_nSize;
#           endif
                    return std::make_pair( true, true );
                }
                else {
                    // already exists
                    func( false, *it, val );
                    return std::make_pair( true, false );
                }
            }

            template <typename Q, typename Func>
            bool erase( const Q& key, Func f )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), key, find_predicate() );
                if ( it == m_List.end() || key_comparator()( key, *it ) != 0 )
                    return false;

                // key exists
                f( *it );
                m_List.erase( it );
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                --m_nSize;
#           endif

                return true;
            }

            template <typename Q, typename Less, typename Func>
            bool erase( Q const& key, Less pred, Func f )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), key, pred );
                if ( it == m_List.end() || pred( key, *it ) || pred( *it, key ) )
                    return false;

                // key exists
                f( *it );
                m_List.erase( it );
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                --m_nSize;
#           endif

                return true;
            }

            template <typename Q, typename Func>
            bool find( Q& val, Func f )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), val, find_predicate() );
                if ( it == m_List.end() || key_comparator()( val, *it ) != 0 )
                    return false;

                // key exists
                f( *it, val );
                return true;
            }

            template <typename Q, typename Less, typename Func>
            bool find( Q& val, Less pred, Func f )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), val, pred );
                if ( it == m_List.end() || pred( val, *it ) || pred( *it, val ) )
                    return false;

                // key exists
                f( *it, val );
                return true;
            }

            /// Clears the container
            void clear()
            {
                m_List.clear();
            }

            iterator begin()                { return m_List.begin(); }
            const_iterator begin() const    { return m_List.begin(); }
            iterator end()                  { return m_List.end(); }
            const_iterator end() const      { return m_List.end(); }

            void move_item( adapted_container& /*from*/, iterator itWhat )
            {
                iterator it = std::lower_bound( m_List.begin(), m_List.end(), *itWhat, find_predicate() );
                assert( it == m_List.end() || key_comparator()( *itWhat, *it ) != 0 );

                copy_item()( m_List, it, itWhat );
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                ++m_nSize;
#           endif
            }

            size_t size() const
            {
#           if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
                return m_nSize;
#           else
                return m_List.size();
#           endif

            }
        };

    public:
        typedef adapted_container type ; ///< Result of \p adapt metafunction

    };
}}}

//@endcond

#endif // #ifndef CDSLIB_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H