text:
namespace Microsoft.Azure.Management.Logic.Models
{
    using Azure;
    using Management;
    using Logic;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// The AS2 agreement acknowledegment connection settings.
    /// </summary>
    public partial class AS2AcknowledgementConnectionSettings
    {
        /// <summary>
        /// Initializes a new instance of the
        /// AS2AcknowledgementConnectionSettings class.
        /// </summary>
        public AS2AcknowledgementConnectionSettings() { }

        /// <summary>
        /// Initializes a new instance of the
        /// AS2AcknowledgementConnectionSettings class.
        /// </summary>
        /// <param name="ignoreCertificateNameMismatch">The value indicating
        /// whether to ignore mismatch in certificate name.</param>
        /// <param name="supportHttpStatusCodeContinue">The value indicating
        /// whether to support HTTP status code 'CONTINUE'.</param>
        /// <param name="keepHttpConnectionAlive">The value indicating whether
        /// to keep the connection alive.</param>
        /// <param name="unfoldHttpHeaders">The value indicating whether to
        /// unfold the HTTP headers.</param>
        public AS2AcknowledgementConnectionSettings(bool ignoreCertificateNameMismatch, bool supportHttpStatusCodeContinue, bool keepHttpConnectionAlive, bool unfoldHttpHeaders)
        {
            IgnoreCertificateNameMismatch = ignoreCertificateNameMismatch;
            SupportHttpStatusCodeContinue = supportHttpStatusCodeContinue;
            KeepHttpConnectionAlive = keepHttpConnectionAlive;
            UnfoldHttpHeaders = unfoldHttpHeaders;
        }

        /// <summary>
        /// Gets or sets the value indicating whether to ignore mismatch in
        /// certificate name.
        /// </summary>
        [JsonProperty(PropertyName = "ignoreCertificateNameMismatch")]
        public bool IgnoreCertificateNameMismatch { get; set; }

        /// <summary>
        /// Gets or sets the value indicating whether to support HTTP status
        /// code 'CONTINUE'.
        /// </summary>
        [JsonProperty(PropertyName = "supportHttpStatusCodeContinue")]
        public bool SupportHttpStatusCodeContinue { get; set; }

        /// <summary>
        /// Gets or sets the value indicating whether to keep the connection
        /// alive.
        /// </summary>
        [JsonProperty(PropertyName = "keepHttpConnectionAlive")]
        public bool KeepHttpConnectionAlive { get; set; }

        /// <summary>
        /// Gets or sets the value indicating whether to unfold the HTTP
        /// headers.
        /// </summary>
        [JsonProperty(PropertyName = "unfoldHttpHeaders")]
        public bool UnfoldHttpHeaders { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            //Nothing to validate
        }
    }
}


text:
namespace content {

// static
BrowserPluginManagerFactory* BrowserPluginManager::factory_ = NULL;

BrowserPluginManager* BrowserPluginManager::Create(
    RenderViewImpl* render_view) {
  if (factory_)
    return factory_->CreateBrowserPluginManager(render_view);
  return new BrowserPluginManagerImpl(render_view);
}

BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view)
    : RenderViewObserver(render_view),
      current_instance_id_(browser_plugin::kInstanceIDNone),
      render_view_(render_view->AsWeakPtr()) {
}

BrowserPluginManager::~BrowserPluginManager() {
}

void BrowserPluginManager::AddBrowserPlugin(
    int browser_plugin_instance_id,
    BrowserPlugin* browser_plugin) {
  instances_.AddWithID(browser_plugin, browser_plugin_instance_id);
}

void BrowserPluginManager::RemoveBrowserPlugin(int browser_plugin_instance_id) {
  instances_.Remove(browser_plugin_instance_id);
}

BrowserPlugin* BrowserPluginManager::GetBrowserPlugin(
    int browser_plugin_instance_id) const {
  return instances_.Lookup(browser_plugin_instance_id);
}

int BrowserPluginManager::GetNextInstanceID() {
  return ++current_instance_id_;
}

void BrowserPluginManager::UpdateDeviceScaleFactor(float device_scale_factor) {
  IDMap<BrowserPlugin>::iterator iter(&instances_);
  while (!iter.IsAtEnd()) {
    iter.GetCurrentValue()->UpdateDeviceScaleFactor(device_scale_factor);
    iter.Advance();
  }
}

void BrowserPluginManager::UpdateFocusState() {
  IDMap<BrowserPlugin>::iterator iter(&instances_);
  while (!iter.IsAtEnd()) {
    iter.GetCurrentValue()->UpdateGuestFocusState();
    iter.Advance();
  }
}

void BrowserPluginManager::Attach(int browser_plugin_instance_id) {
  BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id);
  if (plugin)
    plugin->Attach();
}

}  // namespace content

redpajama_set_name: RedPajamaGithub


text:
package com.intirix.openmm.server.ui.html.pages;

import org.simpleframework.xml.Default;

import com.intirix.openmm.server.ui.html.PageData;
import com.intirix.openmm.server.ui.html.pages.beans.TvdbEpisodeBean;

@Default
public class ShowsTvdbSeasonDetailsBean extends PageData
{

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private String id;

	private int seasonNumber;

	private String banner = "";

	private String name = "";

	private TvdbEpisodeBean[] episodes = new TvdbEpisodeBean[]{};

	public String getId()
	{
		return id;
	}

	public void setId( String id )
	{
		this.id = id;
	}

	public int getSeasonNumber()
	{
		return seasonNumber;
	}

	public void setSeasonNumber( int seasonNumber )
	{
		this.seasonNumber = seasonNumber;
	}

	public String getBanner()
	{
		return banner;
	}

	public void setBanner( String banner )
	{
		this.banner = banner;
	}

	public String getName()
	{
		return name;
	}

	public void setName( String name )
	{
		this.name = name;
	}

	public TvdbEpisodeBean[] getEpisodes()
	{
		return episodes;
	}

	public void setEpisodes( TvdbEpisodeBean[] episodes )
	{
		this.episodes = episodes;
	}

}


text:
namespace Objects
{
	class ProjectileObject :
		public RigidBodyObject
	{
	public:
		ProjectileObject(Ogre::Vector3 pos);
		~ProjectileObject(void);

		virtual void initialise();

		virtual void update( float deltaTime );
	};
}


text:
<?#Register Src="~/Controls/Message.php" TagPrefix="php" TagName="Message"?>
<?#Register Src="~/Controls/TabControl.php" TagPrefix="php" TagName="TabControl"?>
<?#Register Src="~/Controls/Panel.php" TagPrefix="php" TagName="Panel"?>

		<php:Content ID="MainContent">

${Introduction}

${IntroductionText1}

${IntroductionText2}

${IntroductionText3}

${IntroductionText4}

${IntroductionText5}

${IntroductionText6}

${Contents}

${RegistrationAndPlacement}

${UserControlsAsIncludeFiles}

${ObjectModel}

					${Class} Control

${Properties}

							${Events}

Load

LoadComplete

${Localization}

${RegistrationAndPlacement}

${RegistrationAndPlacementText1}

${RegistrationAndPlacementText2}

${RegistrationAndPlacementText3}

<?#Register Src="~/Controls/Message.php" TagPrefix="php" TagName="Message"?>

${RegistrationAndPlacementText4}

${RegistrationAndPlacementText5}

<php:Message>${ExampleMessage1}</php:Message>
<php:Message>${ExampleMessage2}</php:Message>
<php:Message>${ExampleMessage3}</php:Message>

${RegistrationAndPlacementText6}

${RegistrationAndPlacementText7}

<?#Register Src="~/Controls/Message.php" TagPrefix="my" TagName="Information"?>

<my:Information>${HelloWorld}</my:Information>

${RegistrationAndPlacementText8}

${UserControlsAsIncludeFiles}

${UserControlsAsIncludeFilesText1}

${UserControlsAsIncludeFilesText2}

${SimpleExampleText1}
<br /><br />
<?="${SimpleExampleText2}"?>

${UserControlsAsIncludeFilesText3}

${UserControlsAsIncludeFilesText4}

			<php:TabControl>
				<php:Items>
					<php:TabItem Key="Control" Title="Panel.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/Panel.php'))))?>

					</php:TabItem>
					<php:TabItem Key="Place" Title="${PlacementOnPage}">

<?#Register Src="~/Controls/Panel.php" TagPrefix="php" TagName="Panel"?>

<php:Panel Title="${ExampleTitle}" Content="${HelloWorld}" />

					</php:TabItem>
					<php:TabItem Key="Result" Title="${Result}">
						<php:Panel Title="${ExampleTitle}" Content="${HelloWorld}" />
					</php:TabItem>
				</php:Items>
			</php:TabControl>

${ObjectModel}

${ObjectModelText1}

${ObjectModelText2}

			<php:TabControl>
				<php:Items>
					<php:TabItem Key="Design" Title="Message.html.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/Message.html.php'))))?>

					</php:TabItem>
					<php:TabItem Key="Class" Title="Message.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/Message.php'))))?>

					</php:TabItem>
				</php:Items>
			</php:TabControl>

${ObjectModelText3}

${ObjectModelText4}

			<php:Message Type="Warning">${ObjectModelText5}</php:Message>

${ObjectModelText6}

<php:Message ID="MyMessage1">${Example2Message1}</php:Message>
<php:Message ID="AnyMessage">${Example2Message2}</php:Message>

${ObjectModelText7}

function Load()
{
  $this->Controls['MyMessage1']->Content = '${Example3Message1}';
  $this->Controls['AnyMessage']->Content = '${Example3Message2}';
}

${ObjectModelText8}

${ObjectModelText9}

			<php:TabControl>
				<php:Items>
					<php:TabItem Key="TabControl" Title="TabControl.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/TabControl.php'))))?>

					</php:TabItem>
					<php:TabItem Key="TabItem" Title="TabItem.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/TabItem.php'))))?>

					</php:TabItem>
					<php:TabItem Key="TabControlHtml" Title="TabControl.html.php">

<?=str_replace("\t", '  ', \Nemiro\Text::HtmlEncode(file_get_contents(\Nemiro\Server::MapPath('~/Controls/TabControl.html.php'))))?>

					</php:TabItem>
				</php:Items>
			</php:TabControl>

${ObjectModelText10}

${ObjectModelText11}

<php:TabControl>
  <php:Items>
    <php:TabItem Key="Item1" Title="${Tab} #1">
      ${TabContent} #1
    </php:TabItem>
    <php:TabItem Key="Item2" Title="${Tab} #2">
      ${TabContent} #2
    </php:TabItem>
    <php:TabItem Key="Item3" Title="${Tab} #3">
      ${TabContent} #3
    </php:TabItem>
  </php:Items>
</php:TabControl>

${Class} Control

${ClassControlText1}

${ClassControlText2}

${ClassControlText3}

${ClassControlText4}

<?php
class Menu extends \Nemiro\UI\Control
{

}
?>

${Properties}

${PropertiesControlText1}

						${Property}
						<nobr>${ValueType}</nobr>
						${Description}

						DefaultValues
						${Dictionary}

							${ReadOnly}. ${ControlDefaultValues}

						Source
						${String}

							${ReadOnly}. ${ControlSource}

						TagPrefix
						${String}

							${ReadOnly}. ${ControlTagPrefix}

						TagName
						${String}

							${ReadOnly}. ${ControlTagName}

						Name
						${String}

							${ReadOnly}. ${ControlName}

						Parent
						${Object}

							${ReadOnly}. ${ControlParent}

						Body
						${String}
						${ControlBody}

${PropertiesControlText2}

${PropertiesControlText3}

${PropertiesControlText4}

<php:Message>${PropertiesControlText5}</php:Message>
<php:Message Content="${PropertiesControlText6}" />

${Events}

${EventsControlText1}

${EventsControlText2}

Load

${EventLoadText1}

${EventLoadText2}

${EventLoadText3}

${EventLoadText4}

<?php
class Message extends \Nemiro\UI\Control
{

  public $Content = '';

  function Load()
  {
    $this->Content = '${ExampleEventsMessageText1}: '.$this->Content;
  }

}
?>

LoadComplete

${EventLoadCompleteText1}

${EventLoadCompleteText2}

${EventLoadCompleteText3}

<?php
class Message extends \Nemiro\UI\Control
{

  public $Content = '';

  function LoadComplete()
  {
    $this->Body = '${ExampleEventsMessageText2}: '.$this->Content;
  }

}
?>

${Localization}

${LocalizationText1}

${ReadMoreAboutLocalization}.

		</php:Content>


text:
package io.druid.segment.serde;

import io.druid.data.input.InputRow;

/**
 */
public interface ComplexMetricExtractor
{
  public Class<?> extractedClass();
  public Object extractValue(InputRow inputRow, String metricName);
}


text:
@interface OQManualExecuteOperation : NSObject

- (BOOL)manualPerformOperation:(NSOperation *)operation;

@end


text:
import argparse
from subprocess import Popen, PIPE
from time import sleep
import sys
import os
from voluptuous import Schema
import yaml

def call(cmd):
    return Popen(cmd, stdout=PIPE, shell=True).communicate()[0].strip()

def build_images():
    parser = argparse.ArgumentParser()
    parser.add_argument('path')
    parser.add_argument('prefix', default='test_')
    parser.add_argument('--dist', default=False)
    args = parser.parse_args()

    path = args.path
    prefix = args.prefix

    if args.dist:
        all_distr = args.dist.split(',')
    else:
        all_distr = os.listdir(path)

    for image in all_distr:
        print('Building %s ...' % image)
        os.system('docker build -t %(prefix)s%(image)s %(path)s/%(image)s' % locals())
        print('done building: %(path)s/%(image)s -> %(prefix)s%(image)s' % locals())

    print('All done.')

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--cov', action='store_true', default=False)
    parser.add_argument('--dist', default=False)
    parser.add_argument('--env', default=False)
    parser.add_argument('-p', '--parallel', action='store_true', default=False)
    parser.add_argument('-m', '--marks', default=False)
    parser.add_argument('-s', action='store_true', default=False)
    parser.add_argument('--coverage-dir', default='coverage_html')

    parser.add_argument('--no-large', default=False)
    parser.add_argument('--no-medium', default=False)

    parser.add_argument('--large', default=False)
    parser.add_argument('--medium', default=False)
    parser.add_argument('--small', default=False)

    args = parser.parse_args()

    with open('toxer.yml') as f:
        config = yaml.load(f)

    schema = Schema({
        'images': {
            str: {
                'image': str,
                'envs': [str]
            }
        },
        'packages': {
            'code': str,
            'tests': str
        },
        'coverage': {
            'image': str
        }
    })
    schema(config)

    os.system("find %s -name *.pyc -delete" % config['packages']['code'])
    os.system("find %s -name *.pyc -delete" % config['packages']['tests'])

    if args.dist:
        all_distr = [x.strip() for x in args.dist.split(',')]
    else:
        all_distr = config['images'].keys()

    processes_running = []
    for image, info in config['images'].items():

        if not image in all_distr:
            continue

        if args.parallel:
            running_mode = '-d'
        else:
            running_mode = '-i -t'

        cmd = 'docker run %(mode)s -w "/code" -e "TOX_DOCKER=1" -e "TOX_DISTRO=%(image)s" -v %(cwd)s:/code %(image)s' % {
            'image': info['image'],
            'cwd': os.getcwd(),
            'mode': running_mode
        }

        envs = info['envs']

        if args.env:
            env_to_run = [e for e in args.env.split(',') if e in envs]
        else:
            env_to_run = envs

        if not env_to_run:
            print('Skip %s as there is no env needed [%s]' % (image, ','.join(envs)))
            continue

        for env in env_to_run:
            cmd_env = cmd + ' tox -c tox.toxer.ini -e %s' % env

            cmd_env += ' --'

            if args.cov:
                cmd_env += ' --cov-config .tox.coveragerc --cov %s' % config['packages']['code']

            if args.s:
                cmd_env += ' -s'

            if args.parallel:
                process_id = call(cmd_env)
                processes_running.append((process_id, image, env))
            else:
                os.system(cmd_env)

    if args.parallel:

        while processes_running:
            sleep(0.5)

            sys.stdout.write('.')

            for process_info in processes_running:

                process, image, env = process_info

                is_running = call('docker inspect --format=\'{{.State.Running}}\' %s' % process) == "true"

                if not is_running:
                    processes_running.remove(process_info)

                    ret = int(call('docker inspect --format=\'{{.State.ExitCode}}\' %s' % process))

                    print('%s:%s ... done' % (image, env))
                    print('ret code: %s' % ret)
                    if ret != 0:
                        print('=' * 40)
                        print('=' * 40)
                        os.system('docker logs %s' % process)
                        print('=' * 40)
                        print('=' * 40)
                    else:
                        print('ok')


text:
package griffon.pivot.support.adapters;

import griffon.core.CallableWithArgs;
import org.junit.Test;

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

public class DialogStateAdapterTest {
    private DialogStateAdapter adapter = new DialogStateAdapter();

    @Test
    public void testPreviewDialogClose() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<org.apache.pivot.util.Vote> callable = new CallableWithArgs<org.apache.pivot.util.Vote>() {
            public org.apache.pivot.util.Vote call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getPreviewDialogClose());
        adapter.previewDialogClose(null, false);
        assertFalse(invoked[0]);

        adapter.setPreviewDialogClose(callable);
        adapter.previewDialogClose(null, false);
        assertTrue(invoked[0]);
    }

    @Test
    public void testDialogCloseVetoed() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<Void> callable = new CallableWithArgs<Void>() {
            public Void call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getDialogCloseVetoed());
        adapter.dialogCloseVetoed(null, null);
        assertFalse(invoked[0]);

        adapter.setDialogCloseVetoed(callable);
        adapter.dialogCloseVetoed(null, null);
        assertTrue(invoked[0]);
    }

    @Test
    public void testDialogClosed() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<Void> callable = new CallableWithArgs<Void>() {
            public Void call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getDialogClosed());
        adapter.dialogClosed(null, false);
        assertFalse(invoked[0]);

        adapter.setDialogClosed(callable);
        adapter.dialogClosed(null, false);
        assertTrue(invoked[0]);
    }

}


text:
import unittest

from kernprof import ContextualProfile

def f(x):
    """ A function. """
    y = x + 10
    return y

def g(x):
    """ A generator. """
    y = yield x + 10
    yield y + 20

class TestKernprof(unittest.TestCase):

    def test_enable_disable(self):
        profile = ContextualProfile()
        self.assertEqual(profile.enable_count, 0)
        profile.enable_by_count()
        self.assertEqual(profile.enable_count, 1)
        profile.enable_by_count()
        self.assertEqual(profile.enable_count, 2)
        profile.disable_by_count()
        self.assertEqual(profile.enable_count, 1)
        profile.disable_by_count()
        self.assertEqual(profile.enable_count, 0)
        profile.disable_by_count()
        self.assertEqual(profile.enable_count, 0)

        with profile:
            self.assertEqual(profile.enable_count, 1)
            with profile:
                self.assertEqual(profile.enable_count, 2)
            self.assertEqual(profile.enable_count, 1)
        self.assertEqual(profile.enable_count, 0)

        with self.assertRaises(RuntimeError):
            self.assertEqual(profile.enable_count, 0)
            with profile:
                self.assertEqual(profile.enable_count, 1)
                raise RuntimeError()
        self.assertEqual(profile.enable_count, 0)

    def test_function_decorator(self):
        profile = ContextualProfile()
        f_wrapped = profile(f)
        self.assertEqual(f_wrapped.__name__, f.__name__)
        self.assertEqual(f_wrapped.__doc__, f.__doc__)

        self.assertEqual(profile.enable_count, 0)
        value = f_wrapped(10)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(value, f(10))

    def test_gen_decorator(self):
        profile = ContextualProfile()
        g_wrapped = profile(g)
        self.assertEqual(g_wrapped.__name__, g.__name__)
        self.assertEqual(g_wrapped.__doc__, g.__doc__)

        self.assertEqual(profile.enable_count, 0)
        i = g_wrapped(10)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(next(i), 20)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(i.send(30), 50)
        self.assertEqual(profile.enable_count, 0)
        with self.assertRaises(StopIteration):
            next(i)
        self.assertEqual(profile.enable_count, 0)


text:
<?php

namespace JHWEB\PersonalBundle\Controller;

use JHWEB\PersonalBundle\Entity\PnalCfgTipoNombramiento;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;

/**
 * Pnalcfgtiponombramiento controller.
 *
 * @Route("pnalcfgtiponombramiento")
 */
class PnalCfgTipoNombramientoController extends Controller
{
    /**
     * Lists all pnalCfgTipoNombramiento entities.
     *
     * @Route("/", name="pnalcfgtiponombramiento_index")
     * @Method("GET")
     */
    public function indexAction()
    {
        $helpers = $this->get("app.helpers");

        $em = $this->getDoctrine()->getManager();

        $tiposNombramiento = $em->getRepository('JHWEBPersonalBundle:PnalCfgTipoNombramiento')->findBy(
            array(
                'activo' => true
            )
        );

        $response['data'] = array();

        if ($tiposNombramiento) {
            $response = array(
                'status' => 'success',
                'code' => 200,
                'message' => count($tiposNombramiento).' registros encontrados.',
                'data'=> $tiposNombramiento,
            );
        }

        return $helpers->json($response);
    }

    /**
     * Creates a new pnalCfgTipoNombramiento entity.
     *
     * @Route("/new", name="pnalcfgtiponombramiento_new")
     * @Method({"GET", "POST"})
     */
    public function newAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck== true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipoNombramiento = new PnalCfgTipoNombramiento();

            $tipoNombramiento->setNombre(mb_strtoupper($params->nombre, 'utf-8'));
            $tipoNombramiento->setGestionable($params->gestionable);
            $tipoNombramiento->setHorarios($params->horarios);
            $tipoNombramiento->setProrroga($params->prorroga);
            $tipoNombramiento->setSuspension($params->suspension);
            $tipoNombramiento->setActivo(true);

            $em->persist($tipoNombramiento);

            $em->flush();

            $response = array(
                'status' => 'success',
                'code' => 200,
                'message' => 'Registro creado con exito.',
            );
        }else{
            $response = array(
                'status' => 'error',
                'code' => 400,
                'message' => 'Autorizacion no valida.',
            );
        }

        return $helpers->json($response);
    }

    /**
     * Finds and displays a pnalCfgTipoNombramiento entity.
     *
     * @Route("/show", name="pnalcfgtiponombramiento_show")
     * @Method("POST")
     */
    public function showAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck == true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipoNombramiento = $em->getRepository('JHWEBPersonalBundle:PnalCfgTipoNombramiento')->find(
                $params->id
            );

            $response = array(
                'status' => 'success',
                'code' => 200,
                'message' => 'Registro encontrado con exito.',
                'data' => $tipoNombramiento
            );
        }else{
            $response = array(
                'status' => 'error',
                'code' => 400,
                'message' => 'Autorizacion no valida.',
            );
        }

        return $helpers->json($response);
    }

    /**
     * Displays a form to edit an existing pnalCfgTipoNombramiento entity.
     *
     * @Route("/edit", name="pnalcfgtiponombramiento_edit")
     * @Method({"GET", "POST"})
     */
    public function editAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck==true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipoNombramiento = $em->getRepository("JHWEBPersonalBundle:PnalCfgTipoNombramiento")->find($params->id);

            if ($tipoNombramiento) {
                $tipoNombramiento->setNombre(
                    mb_strtoupper($params->nombre, 'utf-8')
                );
                $tipoNombramiento->setGestionable($params->gestionable);
                $tipoNombramiento->setHorarios($params->horarios);
                $tipoNombramiento->setProrroga($params->prorroga);
                $tipoNombramiento->setSuspension($params->suspension);

                $em->flush();

                $response = array(
                    'status' => 'success',
                    'code' => 200,
                    'message' => 'Registro actualizado con exito.',
                    'data'=> $tipoNombramiento,
                );
            }else{
                $response = array(
                    'status' => 'error',
                    'code' => 400,
                    'message' => 'El registro no se encuentra en la base de datos.',
                );
            }
        }else{
            $response = array(
                    'status' => 'error',
                    'code' => 400,
                    'message' => 'Autorizacion no valida para editar.',
                );
        }

        return $helpers->json($response);
    }

    /**
     * Deletes a pnalCfgTipoNombramiento entity.
     *
     * @Route("/delete", name="pnalcfgtiponombramiento_delete")
     * @Method("POST")
     */
    public function deleteAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck== true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipoNombramiento = $em->getRepository('JHWEBPersonalBundle:PnalCfgTipoNombramiento')->find(
                $params->id
            );

            $tipoNombramiento->setActivo(false);

            $em->flush();

            $response = array(
                'status' => 'success',
                'code' => 200,
                'message' => "Registro eliminado con exito"
            );
        }else{
            $response = array(
                'status' => 'error',
                'code' => 400,
                'message' => "Autorizacion no valida",
            );
        }

        return $helpers->json($response);
    }

    /**
     * Creates a form to delete a pnalCfgTipoNombramiento entity.
     *
     * @param PnalCfgTipoNombramiento $pnalCfgTipoNombramiento The pnalCfgTipoNombramiento entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm(PnalCfgTipoNombramiento $pnalCfgTipoNombramiento)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('pnalcfgtiponombramiento_delete', array('id' => $pnalCfgTipoNombramiento->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }

    /* ============================================== */

    /**
     * Listado de tipos de nombramiento para selección con búsqueda
     *
     * @Route("/select", name="pnalcfgtiponombramiento_select")
     * @Method({"GET", "POST"})
     */
    public function selectAction()
    {
        $helpers = $this->get("app.helpers");

        $em = $this->getDoctrine()->getManager();

        $tiposNombramiento = $em->getRepository('JHWEBPersonalBundle:PnalCfgTipoNombramiento')->findBy(
            array('activo' => true)
        );

        $response = null;

        foreach ($tiposNombramiento as $key => $tipoNombramiento) {
            $response[$key] = array(
                'value' => $tipoNombramiento->getId(),
                'label' => $tipoNombramiento->getNombre(),
            );
        }

        return $helpers->json($response);
    }
}


text:
package com.lbh.dongfengnews.domain;

import java.util.List;

public class PhotoData {

	public int retcode;

	public PhotoDetailData data;

	public class PhotoDetailData {
		public String countcommenturl;
		public String more;

		public List<NewsChild> news;
		public String title;

		public List<TopicChild> topic;
	}

	public class NewsChild {
		public String id;
		public String listimage;
		public String pubdate;
		public String title;
		public String type;
		public String url;
	}

	public class TopicChild {

	}
}


text:
import ls from "./localStorage";
import {rudexAPIs} from "api/apiConfig";
const rudexStorage = ls("");

export function fetchCoinList(url = rudexAPIs.BASE + rudexAPIs.COINS_LIST) {
    return fetch(url, {method: "post"})
        .then(reply =>
            reply.json().then(result => {
                return result;
            })
        )
        .catch(err => {
            console.log("error fetching rudex list of coins", err, url);
        });
}

export function requestDepositAddress({
    inputCoinType,
    outputCoinType,
    outputAddress,
    url = rudexAPIs.BASE,
    stateCallback
}) {
    let body = {
        inputCoinType,
        outputCoinType,
        outputAddress
    };

    let body_string = JSON.stringify(body);

    fetch(url + rudexAPIs.NEW_DEPOSIT_ADDRESS, {
        method: "post",
        headers: new Headers({
            Accept: "application/json",
            "Content-Type": "application/json"
        }),
        body: body_string
    })
        .then(
            reply => {
                reply.json().then(
                    json => {
                        // console.log( "reply: ", json )
                        let address = {
                            address: json.inputAddress || "unknown",
                            memo: json.inputMemo,
                            error: json.error || null
                        };
                        if (stateCallback) stateCallback(address);
                    },
                    error => {
                        // console.log( "error: ",error  );
                        if (stateCallback)
                            stateCallback({address: "unknown", memo: null});
                    }
                );
            },
            error => {
                // console.log( "error: ",error  );
                if (stateCallback)
                    stateCallback({address: "unknown", memo: null});
            }
        )
        .catch(err => {
            console.log("fetch error:", err);
        });
}

export function validateAddress({
    url = rudexAPIs.BASE,
    walletType,
    newAddress
}) {
    if (!newAddress) return new Promise(res => res());
    return fetch(url + "/wallets/" + walletType + "/check-address", {
        method: "post",
        headers: new Headers({
            Accept: "application/json",
            "Content-Type": "application/json"
        }),
        body: JSON.stringify({address: newAddress})
    })
        .then(reply => reply.json().then(json => json))
        .catch(err => {
            console.log("validate error:", err);
        });
}

function hasWithdrawalAddress(wallet) {
    return rudexStorage.has(`history_address_${wallet}`);
}

function setWithdrawalAddresses({wallet, addresses}) {
    rudexStorage.set(`history_address_${wallet}`, addresses);
}

function getWithdrawalAddresses(wallet) {
    return rudexStorage.get(`history_address_${wallet}`, []);
}

function setLastWithdrawalAddress({wallet, address}) {
    rudexStorage.set(`history_address_last_${wallet}`, address);
}

function getLastWithdrawalAddress(wallet) {
    return rudexStorage.get(`history_address_last_${wallet}`, "");
}

export const WithdrawAddresses = {
    has: hasWithdrawalAddress,
    set: setWithdrawalAddresses,
    get: getWithdrawalAddresses,
    setLast: setLastWithdrawalAddress,
    getLast: getLastWithdrawalAddress
};


text:
require 'log4r'
require 'vagrant'

module VagrantPlugins
  module VCloudAir
    class Provider < Vagrant.plugin('2', :provider)
      def initialize(machine)
        @machine = machine
      end

      def action(name)
        action_method = "action_#{name}"
        return Action.send(action_method) if Action.respond_to?(action_method)
        nil
      end

      def ssh_info
        env = @machine.action('read_ssh_info')
        env[:machine_ssh_info]
      end

      def state
        env = @machine.action('read_state')

        state_id = env[:machine_state_id]

        # Translate into short/long descriptions
        short = state_id.to_s.gsub('_', ' ')
        long  = I18n.t("vagrant_vcloudair.vm.states.#{state_id}")

        # Return the MachineState object
        Vagrant::MachineState.new(state_id, short, long)
      end

      def to_s
        id = @machine.id.nil? ? 'new' : @machine.id
        "vCloud Air (#{id})"
      end
    end
  end
end


text:
using Poco::Net::ServerSocket;
using Poco::Net::HTTPRequestHandler;
using Poco::Net::HTTPRequestHandlerFactory;
using Poco::Net::HTTPServer;
using Poco::Net::HTTPServerRequest;
using Poco::Net::HTTPServerResponse;
using Poco::Net::HTTPServerParams;
using Poco::Timestamp;
using Poco::DateTimeFormatter;
using Poco::DateTimeFormat;
using Poco::ThreadPool;
using Poco::Util::ServerApplication;
using Poco::Util::Application;
using Poco::Util::Option;
using Poco::Util::OptionSet;
using Poco::Util::HelpFormatter;

class TimeRequestHandler: public HTTPRequestHandler
	/// Return a HTML document with the current date and time.
{
public:
	TimeRequestHandler(const std::string& format):
		_format(format)
	{
	}

	void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
	{
		Application& app = Application::instance();
		app.logger().information("Request from " + request.clientAddress().toString());

		Timestamp now;
		std::string dt(DateTimeFormatter::format(now, _format));

		response.setChunkedTransferEncoding(true);
		response.setContentType("text/html");

		std::ostream& ostr = response.send();
		ostr << "<title>HTTPTimeServer powered by POCO C++ Libraries</title>";
		ostr << "<meta http-equiv=\"refresh\" content=\"1\">";
		ostr << "
";
		ostr << dt;
		ostr << "
";
	}

private:
	std::string _format;
};

class TimeRequestHandlerFactory: public HTTPRequestHandlerFactory
{
public:
	TimeRequestHandlerFactory(const std::string& format):
		_format(format)
	{
	}

	HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request)
	{
		if (request.getURI() == "/")
			return new TimeRequestHandler(_format);
		else
			return 0;
	}

private:
	std::string _format;
};

class HTTPTimeServer: public Poco::Util::ServerApplication
	/// The main application class.
	///
	/// This class handles command-line arguments and
	/// configuration files.
	/// Start the HTTPTimeServer executable with the help
	/// option (/help on Windows, --help on Unix) for
	/// the available command line options.
	///
	/// To use the sample configuration file (HTTPTimeServer.properties),
	/// copy the file to the directory where the HTTPTimeServer executable
	/// resides. If you start the debug version of the HTTPTimeServer
	/// (HTTPTimeServerd[.exe]), you must also create a copy of the configuration
	/// file named HTTPTimeServerd.properties. In the configuration file, you
	/// can specify the port on which the server is listening (default
	/// 9980) and the format of the date/time string sent back to the client.
	///
	/// To test the TimeServer you can use any web browser (http://localhost:9980/).
{
public:
	HTTPTimeServer(): _helpRequested(false)
	{
	}

	~HTTPTimeServer()
	{
	}

protected:
	void initialize(Application& self)
	{
		loadConfiguration(); // load default configuration files, if present
		ServerApplication::initialize(self);
	}

	void uninitialize()
	{
		ServerApplication::uninitialize();
	}

	void defineOptions(OptionSet& options)
	{
		ServerApplication::defineOptions(options);

		options.addOption(
			Option("help", "h", "display help information on command line arguments")
				.required(false)
				.repeatable(false));
	}

	void handleOption(const std::string& name, const std::string& value)
	{
		ServerApplication::handleOption(name, value);

		if (name == "help")
			_helpRequested = true;
	}

	void displayHelp()
	{
		HelpFormatter helpFormatter(options());
		helpFormatter.setCommand(commandName());
		helpFormatter.setUsage("OPTIONS");
		helpFormatter.setHeader("A web server that serves the current date and time.");
		helpFormatter.format(std::cout);
	}

	int main(const std::vector<std::string>& args)
	{
		if (_helpRequested)
		{
			displayHelp();
		}
		else
		{
			// get parameters from configuration file
			unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", 8080);
			std::string format(config().getString("HTTPTimeServer.format", DateTimeFormat::SORTABLE_FORMAT));
			int maxQueued  = config().getInt("HTTPTimeServer.maxQueued", 100);
			int maxThreads = config().getInt("HTTPTimeServer.maxThreads", 16);
			ThreadPool::defaultPool().addCapacity(maxThreads);

			HTTPServerParams* pParams = new HTTPServerParams;
			pParams->setMaxQueued(maxQueued);
			pParams->setMaxThreads(maxThreads);

			// set-up a server socket
			ServerSocket svs(port);
			// set-up a HTTPServer instance
			HTTPServer srv(new TimeRequestHandlerFactory(format), svs, pParams);
			// start the HTTPServer
			srv.start();
			// wait for CTRL-C or kill
			waitForTerminationRequest();
			// Stop the HTTPServer
			srv.stop();
		}
		return Application::EXIT_OK;
	}

private:
	bool _helpRequested;
};

int main(int argc, char** argv)
{
	HTTPTimeServer app;
	return app.run(argc, argv);
}


text:
@implementation APContactDataExtractor

#pragma mark - public

- (NSString *)stringProperty:(ABPropertyID)property
{
    return [self stringProperty:property fromRecordRef:self.recordRef];
}

- (NSArray *)arrayProperty:(ABPropertyID)property
{
    return [self mapMultiValueOfProperty:property withBlock:^id(ABMultiValueRef multiValue, CFTypeRef value, CFIndex index)
    {
        return (__bridge NSString *)value;
    }];
}

- (NSDate *)dateProperty:(ABPropertyID)property
{
    CFDateRef dateRef = ABRecordCopyValue(self.recordRef, property);
    return (__bridge_transfer NSDate *)dateRef;
}

- (UIImage *)imagePropertyFullSize:(BOOL)isFullSize
{
    ABPersonImageFormat format = isFullSize ? kABPersonImageFormatOriginalSize :
                                 kABPersonImageFormatThumbnail;
    NSData *data = (__bridge_transfer NSData *)ABPersonCopyImageDataWithFormat(self.recordRef, format);
    return [UIImage imageWithData:data scale:UIScreen.mainScreen.scale];
}

- (NSArray *)phonesWithLabels
{
    return [self mapMultiValueOfProperty:kABPersonPhoneProperty withBlock:^id(ABMultiValueRef multiValue, CFTypeRef value, CFIndex index)
    {
        APPhoneWithLabel *phoneWithLabel;
        if (value)
        {
            NSString *phone = (__bridge NSString *)value;
            NSString *originalLabel = [self originalLabelFromMultiValue:multiValue index:index];
            NSString *localizedLabel = [self localizedLabelFromMultiValue:multiValue index:index];
            phoneWithLabel = [[APPhoneWithLabel alloc] init];
            phoneWithLabel.phone = phone;
            phoneWithLabel.originalLabel = originalLabel;
            phoneWithLabel.localizedLabel = localizedLabel;
        }
        return phoneWithLabel;
    }];
}

- (NSArray *)emailsWithLabels
{
    return [self mapMultiValueOfProperty:kABPersonEmailProperty withBlock:^id(ABMultiValueRef multiValue, CFTypeRef value, CFIndex index)
    {
        APEmailWithLabel *emailWithLabel;
        if (value)
        {
            NSString *email = (__bridge NSString *)value;
            NSString *originalLabel = [self originalLabelFromMultiValue:multiValue index:index];
            NSString *localizedLabel = [self localizedLabelFromMultiValue:multiValue index:index];
            emailWithLabel = [[APEmailWithLabel alloc] init];
            emailWithLabel.email = email;
            emailWithLabel.originalLabel = originalLabel;
            emailWithLabel.localizedLabel = localizedLabel;
        }
        return emailWithLabel;
    }];
}

- (NSArray *)addresses
{
    NSMutableArray *addresses = [[NSMutableArray alloc] init];
    NSArray *array = [self arrayProperty:kABPersonAddressProperty];
    for (NSDictionary *dictionary in array)
    {
        APAddress *address = [[APAddress alloc] init];
        address.street = dictionary[(__bridge NSString *)kABPersonAddressStreetKey];
        address.city = dictionary[(__bridge NSString *)kABPersonAddressCityKey];
        address.state = dictionary[(__bridge NSString *)kABPersonAddressStateKey];
        address.zip = dictionary[(__bridge NSString *)kABPersonAddressZIPKey];
        address.country = dictionary[(__bridge NSString *)kABPersonAddressCountryKey];
        address.countryCode = dictionary[(__bridge NSString *)kABPersonAddressCountryCodeKey];
        [addresses addObject:address];
    }
    return addresses.copy;
}

- (NSString *)compositeName
{
    CFStringRef compositeNameRef = ABRecordCopyCompositeName(self.recordRef);
    return (__bridge_transfer NSString *)compositeNameRef;
}

- (NSArray *)socialProfiles
{
    NSMutableArray *profiles = [[NSMutableArray alloc] init];
    NSArray *array = [self arrayProperty:kABPersonSocialProfileProperty];
    for (NSDictionary *dictionary in array)
    {
        APSocialProfile *profile = [[APSocialProfile alloc] init];
        NSString *socialService = dictionary[(__bridge NSString *)kABPersonSocialProfileServiceKey];
        profile.socialNetwork = [APSocialServiceHelper socialNetworkTypeWithString:socialService];
        profile.url = dictionary[(__bridge NSString *)kABPersonSocialProfileURLKey];
        profile.username = dictionary[(__bridge NSString *)kABPersonSocialProfileUsernameKey];
        profile.userIdentifier = dictionary[(__bridge NSString *)kABPersonSocialProfileUserIdentifierKey];
        [profiles addObject:profile];
    }
    return profiles.copy;
}

- (NSArray *)linkedRecordIDs
{
    NSMutableOrderedSet *linkedRecordIDs = [[NSMutableOrderedSet alloc] init];
    CFArrayRef linkedPeopleRef = ABPersonCopyArrayOfAllLinkedPeople(self.recordRef);
    CFIndex count = CFArrayGetCount(linkedPeopleRef);
    NSNumber *contactRecordID = @(ABRecordGetRecordID(self.recordRef));
    for (CFIndex i = 0; i < count; i++)
    {
        ABRecordRef linkedRecordRef = CFArrayGetValueAtIndex(linkedPeopleRef, i);
        NSNumber *linkedRecordID = @(ABRecordGetRecordID(linkedRecordRef));
        if (![linkedRecordID isEqualToNumber:contactRecordID])
        {
            [linkedRecordIDs addObject:linkedRecordID];
        }
    }
    CFRelease(linkedPeopleRef);
    return linkedRecordIDs.array;
}

- (APSource *)source
{
    APSource *source;
    ABRecordRef sourceRef = ABPersonCopySource(self.recordRef);
    if (sourceRef)
    {
        source = [[APSource alloc] init];
        source.sourceType = [self stringProperty:kABSourceNameProperty fromRecordRef:sourceRef];
        source.sourceID =  @(ABRecordGetRecordID(sourceRef));
        CFRelease(sourceRef);
    }
    return source;
}

- (NSArray *)relatedPersons
{
    return [self mapMultiValueOfProperty:kABPersonRelatedNamesProperty withBlock:^id(ABMultiValueRef multiValue, CFTypeRef value, CFIndex index)
    {
        APRelatedPerson *relatedPerson;
        if (value)
        {
            relatedPerson = [[APRelatedPerson alloc] init];
            relatedPerson.name = (__bridge NSString *)value;
            relatedPerson.originalLabel = [self originalLabelFromMultiValue:multiValue index:index];
            relatedPerson.localizedLabel = [self localizedLabelFromMultiValue:multiValue index:index];
        }
        return relatedPerson;
    }];
}

#pragma mark - private

- (NSString *)originalLabelFromMultiValue:(ABMultiValueRef)multiValue index:(CFIndex)index
{
    CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index);
    NSString *label = (__bridge_transfer NSString *)rawLabel;
    return label;
}

- (NSString *)localizedLabelFromMultiValue:(ABMultiValueRef)multiValue index:(CFIndex)index
{
    NSString *label;
    CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index);
    if (rawLabel)
    {
        CFStringRef localizedLabel = ABAddressBookCopyLocalizedLabel(rawLabel);
        if (localizedLabel)
        {
            label = (__bridge_transfer NSString *)localizedLabel;
        }
        CFRelease(rawLabel);
    }
    return label;
}

- (NSArray *)mapMultiValueOfProperty:(ABPropertyID)property
                           withBlock:(id (^)(ABMultiValueRef multiValue, CFTypeRef value, CFIndex index))block
{
    NSMutableArray *array = [[NSMutableArray alloc] init];
    ABMultiValueRef multiValue = ABRecordCopyValue(self.recordRef, property);
    if (multiValue)
    {
        CFIndex count = ABMultiValueGetCount(multiValue);
        for (CFIndex i = 0; i < count; i++)
        {
            CFTypeRef value = ABMultiValueCopyValueAtIndex(multiValue, i);
            id object = block(multiValue, value, i);
            if (object)
            {
                [array addObject:object];
            }
            CFRelease(value);
        }
        CFRelease(multiValue);
    }
    return array.count > 0 ? array.copy : nil;
}

- (NSString *)stringProperty:(ABPropertyID)property fromRecordRef:(ABRecordRef)recordRef
{
    CFTypeRef valueRef = (ABRecordCopyValue(recordRef, property));
    return (__bridge_transfer NSString *)valueRef;
}

@end


text:
/* Make the masthead heading the same height as the navigation */
.page-header h3 {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 40px;
}

.no-topics {
	text-align: center;
}

#search-results-wp {
	margin-top: 20px;
}

#search-results-nothing {
	text-align: center;
}

#custom-topic-suggestion {
	text-align: center;
}

.comment {
	color: #666666;
}

.unit-code {
	font-weight: bold;
}

.label {
    margin-right: 0.5em;
}

/* -- Topics table --------- */

.topics-table .glyphicon-check {
    color: green;
}

.topics-table .glyphicon-unchecked {
    color: gray;
}

.topics-table td {
    vertical-align: middle !important;
    position: relative;
}

.topics-table .name-column {
    text-align: left;
    width: 30%;
}

.topics-table .name-column a.custom_topic {
    font-style: italic;
}

.topics-table .context-column {
    text-align: left;
    width: 30%;
}

.topics-table .alias-column {
    text-align: left;
    width: 30%;
}

.topics-table .flag-column {
    text-align: center;
}

.topics-table .actions-column {
    text-align: center;
    white-space: nowrap;
}

.topic-row button.hiding {
    visibility: hidden;
}

.topic-row:hover button.hiding {
    visibility: visible;
}

.graph {
   position: relative;
}

svg text {
    text-rendering: optimizeSpeed;
}

svg g[id^=topic] g:nth-of-type(2) a:hover text {
	fill: LightGreen;
}

svg g a:hover {
	text-decoration: none;
}

svg g a:hover text {
	fill: LightGreen;
}

/* -- End of Topic table -- */


text:
namespace Microsoft.Azure.Management.Sql.Fluent
{
    using Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions;
    using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
    using Microsoft.Azure.Management.Sql.Fluent.SqlServer.Definition;

    /// <summary>
    /// Entry point to SQL Server management API.
    /// </summary>
    public interface ISqlServers  :
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsCreating<SqlServer.Definition.IBlank>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsListing<Microsoft.Azure.Management.Sql.Fluent.ISqlServer>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsListingByResourceGroup<Microsoft.Azure.Management.Sql.Fluent.ISqlServer>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsGettingByResourceGroup<Microsoft.Azure.Management.Sql.Fluent.ISqlServer>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsGettingById<Microsoft.Azure.Management.Sql.Fluent.ISqlServer>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsDeletingById,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsDeletingByResourceGroup,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsBatchCreation<Microsoft.Azure.Management.Sql.Fluent.ISqlServer>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsBatchDeletion,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasManager<Microsoft.Azure.Management.Sql.Fluent.ISqlManager>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasInner<Microsoft.Azure.Management.Sql.Fluent.IServersOperations>,
        Microsoft.Azure.Management.Sql.Fluent.ISqlServersBeta
    {
    }
}


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

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateResolverEndpointRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * A unique string that identifies the request and that allows failed requests to be retried without the risk of
     * running the operation twice. CreatorRequestId can be any unique string, for example, a date/time
     * stamp.
     *

     */
    private String creatorRequestId;
    /**
     *

     * A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53 console.
     *

     */
    private String name;
    /**
     *

     * The ID of one or more security groups that you want to use to control access to this VPC. The security group that
     * you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound rules (for
     * outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access, open
     * port 53. For outbound access, open the port that you're using for DNS queries on your network.
     *

     */
    private java.util.List<String> securityGroupIds;
    /**
     *

     * Specify the applicable value:
     *

     *

     *

     *

     * INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     * OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     *

     */
    private String direction;
    /**
     *

     * The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that you
     * forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     *

     */
    private java.util.List<IpAddressRequest> ipAddresses;
    /**
     *

     * A list of the tag keys and values that you want to associate with the endpoint.
     *

     */
    private java.util.List<Tag> tags;

    /**
     *

     * A unique string that identifies the request and that allows failed requests to be retried without the risk of
     * running the operation twice. CreatorRequestId can be any unique string, for example, a date/time
     * stamp.
     *

     *
     * @param creatorRequestId
     *        A unique string that identifies the request and that allows failed requests to be retried without the risk
     *        of running the operation twice. CreatorRequestId can be any unique string, for example, a
     *        date/time stamp.
     */

    public void setCreatorRequestId(String creatorRequestId) {
        this.creatorRequestId = creatorRequestId;
    }

    /**
     *

     * A unique string that identifies the request and that allows failed requests to be retried without the risk of
     * running the operation twice. CreatorRequestId can be any unique string, for example, a date/time
     * stamp.
     *

     *
     * @return A unique string that identifies the request and that allows failed requests to be retried without the
     *         risk of running the operation twice. CreatorRequestId can be any unique string, for example,
     *         a date/time stamp.
     */

    public String getCreatorRequestId() {
        return this.creatorRequestId;
    }

    /**
     *

     * A unique string that identifies the request and that allows failed requests to be retried without the risk of
     * running the operation twice. CreatorRequestId can be any unique string, for example, a date/time
     * stamp.
     *

     *
     * @param creatorRequestId
     *        A unique string that identifies the request and that allows failed requests to be retried without the risk
     *        of running the operation twice. CreatorRequestId can be any unique string, for example, a
     *        date/time stamp.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withCreatorRequestId(String creatorRequestId) {
        setCreatorRequestId(creatorRequestId);
        return this;
    }

    /**
     *

     * A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53 console.
     *

     *
     * @param name
     *        A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53
     *        console.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53 console.
     *

     *
     * @return A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53
     *         console.
     */

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

    /**
     *

     * A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53 console.
     *

     *
     * @param name
     *        A friendly name that lets you easily find a configuration in the Resolver dashboard in the Route 53
     *        console.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The ID of one or more security groups that you want to use to control access to this VPC. The security group that
     * you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound rules (for
     * outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access, open
     * port 53. For outbound access, open the port that you're using for DNS queries on your network.
     *

     *
     * @return The ID of one or more security groups that you want to use to control access to this VPC. The security
     *         group that you specify must include one or more inbound rules (for inbound Resolver endpoints) or
     *         outbound rules (for outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP
     *         access. For inbound access, open port 53. For outbound access, open the port that you're using for DNS
     *         queries on your network.
     */

    public java.util.List<String> getSecurityGroupIds() {
        return securityGroupIds;
    }

    /**
     *

     * The ID of one or more security groups that you want to use to control access to this VPC. The security group that
     * you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound rules (for
     * outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access, open
     * port 53. For outbound access, open the port that you're using for DNS queries on your network.
     *

     *
     * @param securityGroupIds
     *        The ID of one or more security groups that you want to use to control access to this VPC. The security
     *        group that you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound
     *        rules (for outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For
     *        inbound access, open port 53. For outbound access, open the port that you're using for DNS queries on your
     *        network.
     */

    public void setSecurityGroupIds(java.util.Collection<String> securityGroupIds) {
        if (securityGroupIds == null) {
            this.securityGroupIds = null;
            return;
        }

        this.securityGroupIds = new java.util.ArrayList<String>(securityGroupIds);
    }

    /**
     *

     * The ID of one or more security groups that you want to use to control access to this VPC. The security group that
     * you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound rules (for
     * outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access, open
     * port 53. For outbound access, open the port that you're using for DNS queries on your network.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setSecurityGroupIds(java.util.Collection)} or {@link #withSecurityGroupIds(java.util.Collection)} if you
     * want to override the existing values.
     *

     *
     * @param securityGroupIds
     *        The ID of one or more security groups that you want to use to control access to this VPC. The security
     *        group that you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound
     *        rules (for outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For
     *        inbound access, open port 53. For outbound access, open the port that you're using for DNS queries on your
     *        network.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withSecurityGroupIds(String... securityGroupIds) {
        if (this.securityGroupIds == null) {
            setSecurityGroupIds(new java.util.ArrayList<String>(securityGroupIds.length));
        }
        for (String ele : securityGroupIds) {
            this.securityGroupIds.add(ele);
        }
        return this;
    }

    /**
     *

     * The ID of one or more security groups that you want to use to control access to this VPC. The security group that
     * you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound rules (for
     * outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access, open
     * port 53. For outbound access, open the port that you're using for DNS queries on your network.
     *

     *
     * @param securityGroupIds
     *        The ID of one or more security groups that you want to use to control access to this VPC. The security
     *        group that you specify must include one or more inbound rules (for inbound Resolver endpoints) or outbound
     *        rules (for outbound Resolver endpoints). Inbound and outbound rules must allow TCP and UDP access. For
     *        inbound access, open port 53. For outbound access, open the port that you're using for DNS queries on your
     *        network.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withSecurityGroupIds(java.util.Collection<String> securityGroupIds) {
        setSecurityGroupIds(securityGroupIds);
        return this;
    }

    /**
     *

     * Specify the applicable value:
     *

     *

     *

     *

     * INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     * OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     *

     *
     * @param direction
     *        Specify the applicable value:

     *

     *

     *

     *        INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     *        OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     * @see ResolverEndpointDirection
     */

    public void setDirection(String direction) {
        this.direction = direction;
    }

    /**
     *

     * Specify the applicable value:
     *

     *

     *

     *

     * INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     * OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     *

     *
     * @return Specify the applicable value:

     *

     *

     *

     *         INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     *         OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     * @see ResolverEndpointDirection
     */

    public String getDirection() {
        return this.direction;
    }

    /**
     *

     * Specify the applicable value:
     *

     *

     *

     *

     * INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     * OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     *

     *
     * @param direction
     *        Specify the applicable value:

     *

     *

     *

     *        INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     *        OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResolverEndpointDirection
     */

    public CreateResolverEndpointRequest withDirection(String direction) {
        setDirection(direction);
        return this;
    }

    /**
     *

     * Specify the applicable value:
     *

     *

     *

     *

     * INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     * OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     *

     *
     * @param direction
     *        Specify the applicable value:

     *

     *

     *

     *        INBOUND: Resolver forwards DNS queries to the DNS service for a VPC from your network
     *

     *

     *

     *

     *        OUTBOUND: Resolver forwards DNS queries from the DNS service for a VPC to your network
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResolverEndpointDirection
     */

    public CreateResolverEndpointRequest withDirection(ResolverEndpointDirection direction) {
        this.direction = direction.toString();
        return this;
    }

    /**
     *

     * The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that you
     * forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     *

     *
     * @return The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that
     *         you forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     */

    public java.util.List<IpAddressRequest> getIpAddresses() {
        return ipAddresses;
    }

    /**
     *

     * The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that you
     * forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     *

     *
     * @param ipAddresses
     *        The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that
     *        you forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     */

    public void setIpAddresses(java.util.Collection<IpAddressRequest> ipAddresses) {
        if (ipAddresses == null) {
            this.ipAddresses = null;
            return;
        }

        this.ipAddresses = new java.util.ArrayList<IpAddressRequest>(ipAddresses);
    }

    /**
     *

     * The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that you
     * forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setIpAddresses(java.util.Collection)} or {@link #withIpAddresses(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param ipAddresses
     *        The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that
     *        you forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withIpAddresses(IpAddressRequest... ipAddresses) {
        if (this.ipAddresses == null) {
            setIpAddresses(new java.util.ArrayList<IpAddressRequest>(ipAddresses.length));
        }
        for (IpAddressRequest ele : ipAddresses) {
            this.ipAddresses.add(ele);
        }
        return this;
    }

    /**
     *

     * The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that you
     * forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     *

     *
     * @param ipAddresses
     *        The subnets and IP addresses in your VPC that DNS queries originate from (for outbound endpoints) or that
     *        you forward DNS queries to (for inbound endpoints). The subnet ID uniquely identifies a VPC.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withIpAddresses(java.util.Collection<IpAddressRequest> ipAddresses) {
        setIpAddresses(ipAddresses);
        return this;
    }

    /**
     *

     * A list of the tag keys and values that you want to associate with the endpoint.
     *

     *
     * @return A list of the tag keys and values that you want to associate with the endpoint.
     */

    public java.util.List<Tag> getTags() {
        return tags;
    }

    /**
     *

     * A list of the tag keys and values that you want to associate with the endpoint.
     *

     *
     * @param tags
     *        A list of the tag keys and values that you want to associate with the endpoint.
     */

    public void setTags(java.util.Collection<Tag> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<Tag>(tags);
    }

    /**
     *

     * A list of the tag keys and values that you want to associate with the endpoint.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param tags
     *        A list of the tag keys and values that you want to associate with the endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withTags(Tag... tags) {
        if (this.tags == null) {
            setTags(new java.util.ArrayList<Tag>(tags.length));
        }
        for (Tag ele : tags) {
            this.tags.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of the tag keys and values that you want to associate with the endpoint.
     *

     *
     * @param tags
     *        A list of the tag keys and values that you want to associate with the endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateResolverEndpointRequest withTags(java.util.Collection<Tag> tags) {
        setTags(tags);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCreatorRequestId() != null)
            sb.append("CreatorRequestId: ").append(getCreatorRequestId()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getSecurityGroupIds() != null)
            sb.append("SecurityGroupIds: ").append(getSecurityGroupIds()).append(",");
        if (getDirection() != null)
            sb.append("Direction: ").append(getDirection()).append(",");
        if (getIpAddresses() != null)
            sb.append("IpAddresses: ").append(getIpAddresses()).append(",");
        if (getTags() != null)
            sb.append("Tags: ").append(getTags());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof CreateResolverEndpointRequest == false)
            return false;
        CreateResolverEndpointRequest other = (CreateResolverEndpointRequest) obj;
        if (other.getCreatorRequestId() == null ^ this.getCreatorRequestId() == null)
            return false;
        if (other.getCreatorRequestId() != null && other.getCreatorRequestId().equals(this.getCreatorRequestId()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getSecurityGroupIds() == null ^ this.getSecurityGroupIds() == null)
            return false;
        if (other.getSecurityGroupIds() != null && other.getSecurityGroupIds().equals(this.getSecurityGroupIds()) == false)
            return false;
        if (other.getDirection() == null ^ this.getDirection() == null)
            return false;
        if (other.getDirection() != null && other.getDirection().equals(this.getDirection()) == false)
            return false;
        if (other.getIpAddresses() == null ^ this.getIpAddresses() == null)
            return false;
        if (other.getIpAddresses() != null && other.getIpAddresses().equals(this.getIpAddresses()) == false)
            return false;
        if (other.getTags() == null ^ this.getTags() == null)
            return false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getCreatorRequestId() == null) ? 0 : getCreatorRequestId().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getSecurityGroupIds() == null) ? 0 : getSecurityGroupIds().hashCode());
        hashCode = prime * hashCode + ((getDirection() == null) ? 0 : getDirection().hashCode());
        hashCode = prime * hashCode + ((getIpAddresses() == null) ? 0 : getIpAddresses().hashCode());
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
        return hashCode;
    }

    @Override
    public CreateResolverEndpointRequest clone() {
        return (CreateResolverEndpointRequest) super.clone();
    }

}


text:
foam.CLASS({
  package: 'foam.dao',
  name: 'AbstractF3FileJournal',
  abstract: true,
  flags: ['java'],

  javaImports: [
    'foam.core.ClassInfo',
    'foam.core.FObject',
    'foam.core.PropertyInfo',
    'foam.core.ProxyX',
    'foam.core.X',
    'foam.lib.formatter.FObjectFormatter',
    'foam.lib.formatter.JSONFObjectFormatter',
    'foam.lib.json.ExprParser',
    'foam.lib.json.JSONParser',
    'foam.lib.parse.*',
    'foam.lib.StoragePropertyPredicate',
    'foam.nanos.auth.LastModifiedByAware',
    'foam.nanos.auth.Subject',
    'foam.nanos.auth.User',
    'foam.nanos.logger.Logger',
    'foam.nanos.logger.PrefixLogger',
    'foam.nanos.logger.StdoutLogger',
    'java.io.BufferedReader',
    'java.io.BufferedWriter',
    'java.io.InputStream',
    'java.io.InputStreamReader',
    'java.io.OutputStream',
    'java.io.OutputStreamWriter',
    'java.util.Calendar',
    'java.util.Iterator',
    'java.util.List',
    'java.util.regex.Pattern',
    'java.util.TimeZone'
  ],

  axioms: [
    {
      name: 'javaExtras',
      buildJavaClass: function (cls) {
        cls.extras.push(`
          protected static Pattern COMMENT = Pattern.compile("(/\\\\*([^*]|[\\\\r\\\\n]|(\\\\*+([^*/]|[\\\\r\\\\n])))*\\\\*+/)|(//.*)");

          protected static ThreadLocal<JSONFObjectFormatter> formatter = new ThreadLocal<JSONFObjectFormatter>() {
            @Override
            protected JSONFObjectFormatter initialValue() {
              return new JSONFObjectFormatter();
            }
            @Override
            public JSONFObjectFormatter get() {
              JSONFObjectFormatter b = super.get();
              b.reset();
              b.setPropertyPredicate(new StoragePropertyPredicate());
              b.setOutputShortNames(true);
              return b;
            }
          };

          protected JSONFObjectFormatter getFormatter(X x) {
            JSONFObjectFormatter f = formatter.get();
            f.setX(x);
            return f;
          }

          protected static ThreadLocal<StringBuilder> sb = new ThreadLocal<StringBuilder>() {
            @Override
            protected StringBuilder initialValue() {
              return new StringBuilder();
            }
            @Override
            public StringBuilder get() {
              StringBuilder b = super.get();
              b.setLength(0);
              return b;
            }
          };

          // used for reading, and is shared across threads
          protected StringBuilder stringBuilder = new StringBuilder();

          protected static ThreadLocal<foam.lib.json.JSONParser> jsonParser = new ThreadLocal<foam.lib.json.JSONParser>() {
            @Override
            protected foam.lib.json.JSONParser initialValue() {
              return new JSONParser();
            }
            @Override
            public foam.lib.json.JSONParser get() {
              foam.lib.json.JSONParser parser = super.get();
              return parser;
            }
          };

          protected foam.lib.json.JSONParser getParser(X x) {
            foam.lib.json.JSONParser p = jsonParser.get();
            p.setX(x);
            return p;
          }
        `);
      }
    }
  ],

  properties: [
    {
      class: 'Object',
      name: 'line',
      javaType: 'foam.util.concurrent.AssemblyLine',
      javaFactory: 'return new foam.util.concurrent.SyncAssemblyLine(getX());'
    },
    {
      class: 'Object',
      name: 'timeStamper',
      javaType: 'foam.util.FastTimestamper',
      javaFactory: `return new foam.util.FastTimestamper();`
    },
    {
      class: 'FObjectProperty',
      of: 'foam.nanos.logger.Logger',
      name: 'logger',
      javaFactory: `
        Logger logger = (Logger) getX().get("logger");
        if ( logger == null ) {
          logger = new StdoutLogger();
        }
        return new PrefixLogger(new Object[] { "[JDAO]", getFilename() }, logger);
      `
    },
    {
      class: 'String',
      name: 'filename',
      required: true
    },
    {
      class: 'Boolean',
      name: 'multiLineOutput',
      value: false
    },
    {
      class: 'Boolean',
      name: 'createFile',
      documentation: 'Flag to create file if not present',
      value: true,
    },
    // reader uses a getter because we want a new reader on file replay
    {
      class: 'Object',
      name: 'reader',
      javaType: 'java.io.BufferedReader',
      javaGetter: `
try {
  InputStream is = getX().get(foam.nanos.fs.Storage.class).getInputStream(getFilename());
  if ( is == null ) {
    getLogger().warning("File not found", getFilename());
  }
  return (is == null) ? null : new BufferedReader(new InputStreamReader(is));
} catch ( Throwable t ) {
  getLogger().error("Failed to initialize reader on journal", getFilename(), t);
  throw new RuntimeException(t);
}
      `
    },
    // Writer uses a factory because we want to use one writer for the lifetime of this journal object
    {
      class: 'Object',
      name: 'writer',
      javaType: 'java.io.BufferedWriter',
      javaFactory: `
try {
  OutputStream os = getX().get(foam.nanos.fs.Storage.class).getOutputStream(getFilename());
  if ( os == null ) {
    getLogger().warning("File not found", getFilename());
  }
  return (os == null) ? null : new BufferedWriter(new OutputStreamWriter(os));
} catch ( Throwable t ) {
  getLogger().error("Failed to initialize writer on journal", getFilename(), t);
  throw new RuntimeException(t);
}
      `
    },
    {
      class: 'Long',
      name: 'lastUser'
    },
    {
      class: 'Long',
      name: 'lastTimestamp'
    }
  ],

  methods: [
    {
      name: 'put',
      type: 'FObject',
      args: [ 'Context x', 'String prefix', 'DAO dao', 'foam.core.FObject obj' ],
      javaCode: `
        final Object               id  = obj.getProperty("id");
        final ClassInfo            of  = dao.getOf();
        final JSONFObjectFormatter fmt = getFormatter(x);

        getLine().enqueue(new foam.util.concurrent.AbstractAssembly() {
          FObject old;

          public Object[] requestLocks() {
            return new Object[] { id };
          }

          public void executeUnderLock() {
            old = dao.find_(x, id);
            dao.put_(x, obj);
          }

          public void executeJob() {
            try {
              if ( old != null ) {
                fmt.maybeOutputDelta(old, obj, of);
              } else {
                fmt.output(obj, of);
              }
            } catch (Throwable t) {
              getLogger().error("Failed to write put entry to journal", t);
              fmt.reset();
            }
          }

          public void endJob(boolean isLast) {
            if ( fmt.builder().length() == 0 ) return;

            try {
              writeComment_(x, obj);
              writePut_(
                x,
                fmt.builder(),
                getMultiLineOutput() ? "\\n" : "",
                foam.util.SafetyUtil.isEmpty(prefix) ? "" : prefix + ".");

              if ( isLast ) getWriter().flush();
            } catch (Throwable t) {
              getLogger().error("Failed to write put entry to journal", t);
            }
          }
        });

        return obj;
      `
    },
    {
      name: 'writePut_',
      javaThrows: [
        'java.io.IOException'
      ],
      args: [ 'Context x', 'CharSequence record', 'String c', 'String prefix' ],
      javaCode: `
      BufferedWriter writer = getWriter();
      writer.write(prefix);
      writer.write("p(");
      writer.append(record);
      writer.write(')');
      writer.write(c);
      writer.newLine();
      `
    },
    {
      name: 'remove',
      type: 'FObject',
      args: [ 'Context x', 'String prefix', 'DAO dao', 'foam.core.FObject obj' ],
      javaCode: `
      final Object id = obj.getProperty("id");
      JSONFObjectFormatter fmt = getFormatter(x);
      getLine().enqueue(new foam.util.concurrent.AbstractAssembly() {

        public Object[] requestLocks() {
          return new Object[] { id };
        }

        public void executeUnderLock() {
          dao.remove_(x, obj);
        }

        public void executeJob() {
          try {
            // TODO: Would be more efficient to output the ID portion of the object.  But
            // if ID is an alias or multi part id we should only output the
            // true properties that ID/MultiPartID maps too.
            FObject toWrite = (FObject) obj.getClassInfo().newInstance();
            toWrite.setProperty("id", obj.getProperty("id"));
            fmt.output(toWrite, dao.getOf());
          } catch (Throwable t) {
            getLogger().error("Failed to write put entry to journal", t);
          }
        }

        public void endJob(boolean isLast) {
          if ( fmt.builder().length() == 0 ) return;

          try {
            writeComment_(x, obj);
            writeRemove_(x, fmt.builder(), foam.util.SafetyUtil.isEmpty(prefix) ? "" : prefix + ".");

            if ( isLast ) getWriter().flush();
          } catch (Throwable t) {
            getLogger().error("Failed to write put entry to journal", t);
          }
        }
      });

      return obj;
      `
    },
    {
      name: 'writeRemove_',
      javaThrows: [
        'java.io.IOException'
      ],
      args: ['Context x', 'CharSequence record', 'String prefix' ],
      javaCode: `
      write_(sb.get()
        .append(prefix)
        .append("r(")
        .append(record)
        .append(")"));
      getWriter().newLine();
      `
    },
    {
      name: 'write_',
      javaThrows: [
        'java.io.IOException'
      ],
      args: ['CharSequence data'],
      javaCode: `
        BufferedWriter writer = getWriter();
        writer.append(data);
      `
    },
    {
      name: 'writeComment_',
     // synchronized: true,
      javaThrows: [
        'java.io.IOException'
      ],
      args: [ 'Context x', 'foam.core.FObject obj' ],
      javaCode: `
        User user = ((Subject) x.get("subject")).getUser();
        if ( user == null || user.getId() <= 1 ) return;
        if ( obj instanceof LastModifiedByAware && ((LastModifiedByAware) obj).getLastModifiedBy() != 0L ) return;
        long now    = System.currentTimeMillis();
        long userId = user.getId();
        if ( now == getLastTimestamp() && userId == getLastUser() ) return;
        setLastTimestamp(now);
        setLastUser(userId);

        write_(sb.get()
          .append("// Modified by ")
          .append(user.toSummary())
          .append(" (")
          .append(userId)
          .append(") at ")
          .append(getTimeStamper().createTimestamp()));
        getWriter().newLine();
      `
    },
    {
      name: 'getEntry',
      documentation: 'retrieves a meaningful unit of text from the journal',
      type: 'CharSequence',
      args: [ 'BufferedReader reader' ],
      javaCode: `
        try {
          String line = reader.readLine();
          if ( line == null ) return null;
          if ( ! line.equals("p({") && ! line.equals("r({") ) return line;
          stringBuilder.setLength(0);
          stringBuilder.append(line);
          while( ! line.equals("})") ) {
            if ( (line = reader.readLine()) == null ) break;
            if ( line.equals("p({") ) {
              getLogger().error("Entry is not properly closed: " + stringBuilder.toString());
            }
            stringBuilder.append("\\n");
            stringBuilder.append(line);
          }
          return stringBuilder;
        } catch (Throwable t) {
          getLogger().error("Failed to read from journal", t);
          return null;
        }
      `
    },
    {
      name: 'getParsingErrorMessage',
      documentation: 'Gets the result of a failed parsing of a journal line',
      type: 'CharSequence',
      args: [ 'String line' ],
      javaCode: `
        Parser        parser = ExprParser.instance();
        PStream       ps     = new StringPStream();
        ParserContext x      = new ParserContextImpl();

        ((StringPStream) ps).setString(line);
        x.set("X", ( getX() == null ) ? new ProxyX() : getX());

        ErrorReportingPStream eps = new ErrorReportingPStream(ps);
        ps = eps.apply(parser, x);
        return eps.getMessage();
      `
    },
    {
      name: 'mergeFObject',
      type: 'foam.core.FObject',
      documentation: 'Add diff property to old property',
      args: ['FObject oldFObject', 'FObject diffFObject' ],
      javaCode: `
        //get PropertyInfos
        List list = oldFObject.getClassInfo().getAxiomsByClass(PropertyInfo.class);
        Iterator e = list.iterator();

        while( e.hasNext() ) {
          PropertyInfo prop = (PropertyInfo) e.next();
          mergeProperty(oldFObject, diffFObject, prop);
        }
        return diffFObject.copyFrom(oldFObject);
      `
    },
    {
      name: 'mergeProperty',
      args: [ 'FObject oldFObject', 'FObject diffFObject', 'foam.core.PropertyInfo prop' ],
      javaCode: `
        if ( prop.isSet(diffFObject) ) {
          prop.set(oldFObject, prop.get(diffFObject));
        }
      `
    }
  ]
});


text:
describe LineItem do
  describe ".unbilled" do
    it "excludes billed line items" do
      unbilled = FactoryBot.create :work, invoice: nil
      billed = FactoryBot.create :work, invoice: FactoryBot.create(:invoice)
      LineItem.unbilled.should == [unbilled]
    end
  end

  describe ".on_date" do
    it "filters out line items not on supplied date" do
      yesterday = FactoryBot.create :work, start: Time.zone.parse("2012-6-30 23:59:59")
      today = FactoryBot.create :work, start: Time.zone.parse("2012-7-1 00:00:00")
      tomorrow = FactoryBot.create :work, start: Time.zone.parse("2012-7-2 00:00:00")
      LineItem.on_date(Time.zone.parse("2012-7-1 23:59:59")).should == [today]
    end
  end

  describe ".on_week" do
    it "filters out line items not on supplied date's week" do
      # 2012-7-1 is a sunday
      last_week = FactoryBot.create :work, start: Time.zone.parse("2012-6-30 23:59:59")
      this_week = FactoryBot.create :work, start: Time.zone.parse("2012-7-1 00:00:00")
      next_week = FactoryBot.create :work, start: Time.zone.parse("2012-7-8 00:00:00")
      LineItem.on_week(Time.zone.parse("2012-7-7 23:59:59")).should == [this_week]
    end
  end

  describe ".on_month" do
    it "filters out line items not on supplied date's month" do
      last_month = FactoryBot.create :work, start: Time.zone.parse("2012-6-30 23:59:59")
      this_month = FactoryBot.create :work, start: Time.zone.parse("2012-7-1 00:00:00")
      next_month = FactoryBot.create :work, start: Time.zone.parse("2012-8-1 00:00:00")
      LineItem.on_month(Time.zone.parse("2012-7-31 23:59:59")).should == [this_month]
    end
  end

  describe ".on_year" do
    it "filters out line items not on supplied date's year" do
      last_year = FactoryBot.create :work, start: Time.zone.parse("2011-12-31 23:59:59")
      this_year = FactoryBot.create :work, start: Time.zone.parse("2012-6-1 00:00:00")
      next_year = FactoryBot.create :work, start: Time.zone.parse("2013-1-1 00:00:00")
      LineItem.on_year(Time.zone.parse("2012-12-31 23:59:59")).should == [this_year]
    end
  end

  it "should be able to set the total manually" do
    @line_item = FactoryBot.create :work
    @line_item.total = 200
    @line_item.total.should == 200
  end

  it "should be able to set user name manually" do
    @line_item = FactoryBot.create(:work)
    @user = FactoryBot.create(:user)
    @line_item.user_name = @user.name
    @line_item.user.should eql @user
  end

  it "should return invoice total if billed" do
    @invoice = FactoryBot.create(:invoice)
    @billed = FactoryBot.create(:work, invoice: @invoice)
    @billed.invoice_total.should eql @invoice.total
  end

  it "should return client balance if unbilled" do
    @client = FactoryBot.create(:client)
    @unbilled = FactoryBot.create(:work, client: @client, invoice: nil)
    @unbilled.invoice_total.should eql @client.balance
  end
end


text:
"""Support for hive water heaters."""
from homeassistant.components.water_heater import (
    STATE_ECO,
    STATE_OFF,
    STATE_ON,
    SUPPORT_OPERATION_MODE,
    WaterHeaterEntity,
)
from homeassistant.const import TEMP_CELSIUS

from . import DATA_HIVE, DOMAIN, HiveEntity, refresh_system

SUPPORT_FLAGS_HEATER = SUPPORT_OPERATION_MODE

HIVE_TO_HASS_STATE = {"SCHEDULE": STATE_ECO, "ON": STATE_ON, "OFF": STATE_OFF}
HASS_TO_HIVE_STATE = {STATE_ECO: "SCHEDULE", STATE_ON: "ON", STATE_OFF: "OFF"}
SUPPORT_WATER_HEATER = [STATE_ECO, STATE_ON, STATE_OFF]

def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Hive water heater devices."""
    if discovery_info is None:
        return

    session = hass.data.get(DATA_HIVE)
    devs = []
    for dev in discovery_info:
        devs.append(HiveWaterHeater(session, dev))
    add_entities(devs)

class HiveWaterHeater(HiveEntity, WaterHeaterEntity):
    """Hive Water Heater Device."""

    @property
    def unique_id(self):
        """Return unique ID of entity."""
        return self._unique_id

    @property
    def device_info(self):
        """Return device information."""
        return {"identifiers": {(DOMAIN, self.unique_id)}, "name": self.name}

    @property
    def supported_features(self):
        """Return the list of supported features."""
        return SUPPORT_FLAGS_HEATER

    @property
    def name(self):
        """Return the name of the water heater."""
        if self.node_name is None:
            self.node_name = "Hot Water"
        return self.node_name

    @property
    def temperature_unit(self):
        """Return the unit of measurement."""
        return TEMP_CELSIUS

    @property
    def current_operation(self):
        """Return current operation."""
        return HIVE_TO_HASS_STATE[self.session.hotwater.get_mode(self.node_id)]

    @property
    def operation_list(self):
        """List of available operation modes."""
        return SUPPORT_WATER_HEATER

    @refresh_system
    def set_operation_mode(self, operation_mode):
        """Set operation mode."""
        new_mode = HASS_TO_HIVE_STATE[operation_mode]
        self.session.hotwater.set_mode(self.node_id, new_mode)

    def update(self):
        """Update all Node data from Hive."""
        self.session.core.update_data(self.node_id)


text:
import sys

from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)

from scantools import Scanner_OSX

def main():
    print "---Scanning IBCarbonRuntime.h---"
    input = ["IBCarbonRuntime.h"]
    output = "IBCarbongen.py"
    defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
    scanner = IBCarbon_Scanner(input, output, defsoutput)
    scanner.scan()
    scanner.close()
    print "=== Testing definitions output code ==="
    execfile(defsoutput, {}, {})
    print "--done scanning, importing--"
    import IBCarbonsupport
    print "done"

class IBCarbon_Scanner(Scanner_OSX):

    def destination(self, type, name, arglist):
        classname = "IBCarbonFunction"
        listname = "functions"
        if arglist:
            t, n, m = arglist[0]
            if t == "IBNibRef" and m == "InMode":
                classname = "IBCarbonMethod"
                listname = "methods"
        return classname, listname

    def makeblacklistnames(self):
        return [
                "DisposeNibReference",                          # taken care of by destructor
                "CreateNibReferenceWithCFBundle",  ## need to wrap CFBundle.h properly first
                ]

    def makerepairinstructions(self):
        return []

if __name__ == "__main__":
    main()


text:
<?php

namespace Zaggoware\SimpleWeb\ActionResults;

use Zaggoware\Generic\IEnumerable;
use Zaggoware\Helpers\JsonHelper;
use Zaggoware\SimpleWeb\IController;

class JsonResult extends ActionResult {
    /** @var mixed */
    private $object;

    /**
     * JsonResult constructor.
     * @param mixed $object
     */
    public function __construct($object) {
        $this->object = $object;
    }

    /**
     * @param IController $controller
     * @return string
     */
    public function executeResult(IController $controller) {
        header("Content-Type: text/json");

        if ($this->object instanceof IEnumerable) {
            $this->object = $this->object->toArray();
        }

        return JsonHelper::serialize($this->object);
    }
}


text:
''' Created on Nov 8, 2013

@author: Craig Bryan
'''

from production_files import router, logger
import traceback
from time import sleep
import os
from production_files import utils
import time

count = 0
logr = logger.Logger("system_status")
running = True
print utils.get_log_dir()

start_time = time.time();
try:
    while(running):
        if(time.time() - start_time > 86400):
            logr.log("Normal daily restart routine")
            os.system("sudo reboot")

        try:
            r = router.Router()
        except Exception as e:
            print "Exception on router instantiation: %s" %str(e)
            print traceback.format_exc(e)
            logr.log("Exception on router instantiation: %s" %str(e))
            count += 1

            if count > 3:
                os.system("sudo reboot")

            sleep(60)
            continue
        else:
            count = 0

            while(True):
                if(time.time() - start_time > 86400):
                        os.system("sudo reboot")

                try:
                    r.next()
                except Exception as e:
                    print "Exception during router running: %s" %str(e)
                    print traceback.format_exc(e)
                    logr.log("Exception during router running: %s" %str(e))
                    sleep(60)
                    del r
                    break

except Exception as e:
    logr.log(e);
    print traceback.format_exc(e)
    os.system("sudo reboot")