text:
"""Tests for :module:'heat.engine.clients.os.nova'."""

import collections
import uuid

import mock
from novaclient import exceptions as nova_exceptions
from oslo_config import cfg
import six

from heat.common import exception
from heat.engine.clients.os import nova
from heat.engine import resource
from heat.tests import common
from heat.tests.nova import fakes as fakes_nova
from heat.tests import utils

class NovaClientPluginTestCase(common.HeatTestCase):
    def setUp(self):
        super(NovaClientPluginTestCase, self).setUp()
        self.nova_client = mock.MagicMock()
        con = utils.dummy_context()
        c = con.clients
        self.nova_plugin = c.client_plugin('nova')
        self.nova_plugin._client = self.nova_client

class NovaClientPluginTests(NovaClientPluginTestCase):
    """
    Basic tests for the helper methods in
    :module:'heat.engine.clients.os.nova'.
    """

    def test_create(self):
        self.nova_plugin._get_client_option = mock.MagicMock()
        self.nova_plugin.url_for = mock.MagicMock()
        if hasattr(nova.nc, 'discover_extensions'):
            # novaclient >= 2.24.0 has this function
            # so we should test it
            nova.nc.discover_extensions = mock.MagicMock()
            self.nova_plugin._create()
            nova.nc.discover_extensions.assert_called_once_with('2')
        else:
            # FIXME(kairat_kushaev) need to delete this leaf when novaclient
            # version will be greater than 2.24.0
            with mock.patch(
                    "nova.novashell.OpenStackComputeShell") as comp_shell:
                self.nova_plugin._create()
                comp_shell._discover_extensions.assert_called_once_with('2')

    def test_get_ip(self):
        my_image = mock.MagicMock()
        my_image.addresses = {
            'public': [{'version': 4,
                        'addr': '4.5.6.7'},
                       {'version': 6,
                        'addr': '2401:1801:7800:0101:c058:dd33:ff18:04e6'}],
            'private': [{'version': 4,
                         'addr': '10.13.12.13'}]}

        expected = '4.5.6.7'
        observed = self.nova_plugin.get_ip(my_image, 'public', 4)
        self.assertEqual(expected, observed)

        expected = '10.13.12.13'
        observed = self.nova_plugin.get_ip(my_image, 'private', 4)
        self.assertEqual(expected, observed)

        expected = '2401:1801:7800:0101:c058:dd33:ff18:04e6'
        observed = self.nova_plugin.get_ip(my_image, 'public', 6)
        self.assertEqual(expected, observed)

    def test_get_flavor_id(self):
        """Tests the get_flavor_id function."""
        flav_id = str(uuid.uuid4())
        flav_name = 'X-Large'
        my_flavor = mock.MagicMock()
        my_flavor.name = flav_name
        my_flavor.id = flav_id
        self.nova_client.flavors.list.return_value = [my_flavor]
        self.assertEqual(flav_id, self.nova_plugin.get_flavor_id(flav_name))
        self.assertEqual(flav_id, self.nova_plugin.get_flavor_id(flav_id))
        self.assertRaises(exception.FlavorMissing,
                          self.nova_plugin.get_flavor_id, 'noflavor')
        self.assertEqual(3, self.nova_client.flavors.list.call_count)
        self.assertEqual([(), (), ()],
                         self.nova_client.flavors.list.call_args_list)

    def test_get_keypair(self):
        """Tests the get_keypair function."""
        my_pub_key = 'a cool public key string'
        my_key_name = 'mykey'
        my_key = mock.MagicMock()
        my_key.public_key = my_pub_key
        my_key.name = my_key_name
        self.nova_client.keypairs.get.side_effect = [
            my_key, nova_exceptions.NotFound(404)]
        self.assertEqual(my_key, self.nova_plugin.get_keypair(my_key_name))
        self.assertRaises(exception.UserKeyPairMissing,
                          self.nova_plugin.get_keypair, 'notakey')
        calls = [mock.call(my_key_name),
                 mock.call('notakey')]
        self.nova_client.keypairs.get.assert_has_calls(calls)

    def test_get_server(self):
        """Tests the get_server function."""
        my_server = mock.MagicMock()
        self.nova_client.servers.get.side_effect = [
            my_server, nova_exceptions.NotFound(404)]
        self.assertEqual(my_server, self.nova_plugin.get_server('my_server'))
        self.assertRaises(exception.EntityNotFound,
                          self.nova_plugin.get_server, 'idontexist')
        calls = [mock.call('my_server'),
                 mock.call('idontexist')]
        self.nova_client.servers.get.assert_has_calls(calls)

    def test_get_network_id_by_label(self):
        """Tests the get_net_id_by_label function."""
        net = mock.MagicMock()
        net.id = str(uuid.uuid4())
        self.nova_client.networks.find.side_effect = [
            net, nova_exceptions.NotFound(404),
            nova_exceptions.NoUniqueMatch()]
        self.assertEqual(net.id,
                         self.nova_plugin.get_net_id_by_label('net_label'))

        exc = self.assertRaises(
            exception.NovaNetworkNotFound,
            self.nova_plugin.get_net_id_by_label, 'idontexist')
        expected = 'The Nova network (idontexist) could not be found'
        self.assertIn(expected, six.text_type(exc))
        exc = self.assertRaises(
            exception.PhysicalResourceNameAmbiguity,
            self.nova_plugin.get_net_id_by_label, 'notUnique')
        expected = ('Multiple physical resources were found '
                    'with name (notUnique)')
        self.assertIn(expected, six.text_type(exc))
        calls = [mock.call(label='net_label'),
                 mock.call(label='idontexist'),
                 mock.call(label='notUnique')]
        self.nova_client.networks.find.assert_has_calls(calls)

    def test_get_nova_network_id(self):
        """Tests the get_nova_network_id function."""
        net = mock.MagicMock()
        net.id = str(uuid.uuid4())
        not_existent_net_id = str(uuid.uuid4())
        self.nova_client.networks.get.side_effect = [
            net, nova_exceptions.NotFound(404)]
        self.nova_client.networks.find.side_effect = [
            nova_exceptions.NotFound(404)]

        self.assertEqual(net.id,
                         self.nova_plugin.get_nova_network_id(net.id))
        exc = self.assertRaises(
            exception.NovaNetworkNotFound,
            self.nova_plugin.get_nova_network_id, not_existent_net_id)
        expected = ('The Nova network (%s) could not be found' %
                    not_existent_net_id)
        self.assertIn(expected, six.text_type(exc))

        calls = [mock.call(net.id),
                 mock.call(not_existent_net_id)]
        self.nova_client.networks.get.assert_has_calls(calls)
        self.nova_client.networks.find.assert_called_once_with(
            label=not_existent_net_id)

    def test_get_status(self):
        server = self.m.CreateMockAnything()
        server.status = 'ACTIVE'

        observed = self.nova_plugin.get_status(server)
        self.assertEqual('ACTIVE', observed)

        server.status = 'ACTIVE(STATUS)'
        observed = self.nova_plugin.get_status(server)
        self.assertEqual('ACTIVE', observed)

class NovaClientPluginRefreshServerTests(NovaClientPluginTestCase):
    msg = ("ClientException: The server has either erred or is "
           "incapable of performing the requested operation.")

    scenarios = [
        ('successful_refresh', dict(
            value=None,
            e_raise=False)),
        ('overlimit_error', dict(
            value=nova_exceptions.OverLimit(413, "limit reached"),
            e_raise=False)),
        ('500_error', dict(
            value=nova_exceptions.ClientException(500, msg),
            e_raise=False)),
        ('503_error', dict(
            value=nova_exceptions.ClientException(503, msg),
            e_raise=False)),
        ('unhandled_exception', dict(
            value=nova_exceptions.ClientException(501, msg),
            e_raise=True)),
    ]

    def test_refresh(self):
        server = mock.MagicMock()
        server.get.side_effect = [self.value]
        if self.e_raise:
            self.assertRaises(nova_exceptions.ClientException,
                              self.nova_plugin.refresh_server, server)
        else:
            self.assertIsNone(self.nova_plugin.refresh_server(server))
        server.get.assert_called_once_with()

class NovaClientPluginFetchServerTests(NovaClientPluginTestCase):

    server = mock.Mock()
    # set explicitly as id and name has internal meaning in mock.Mock
    server.id = '1234'
    server.name = 'test_fetch_server'
    msg = ("ClientException: The server has either erred or is "
           "incapable of performing the requested operation.")
    scenarios = [
        ('successful_refresh', dict(
            value=server,
            e_raise=False)),
        ('overlimit_error', dict(
            value=nova_exceptions.OverLimit(413, "limit reached"),
            e_raise=False)),
        ('500_error', dict(
            value=nova_exceptions.ClientException(500, msg),
            e_raise=False)),
        ('503_error', dict(
            value=nova_exceptions.ClientException(503, msg),
            e_raise=False)),
        ('unhandled_exception', dict(
            value=nova_exceptions.ClientException(501, msg),
            e_raise=True)),
    ]

    def test_fetch_server(self):
        self.nova_client.servers.get.side_effect = [self.value]
        if self.e_raise:
            self.assertRaises(nova_exceptions.ClientException,
                              self.nova_plugin.fetch_server, self.server.id)
        elif isinstance(self.value, mock.Mock):
            self.assertEqual(self.value,
                             self.nova_plugin.fetch_server(self.server.id))
        else:
            self.assertIsNone(self.nova_plugin.fetch_server(self.server.id))

        self.nova_client.servers.get.assert_called_once_with(self.server.id)

class NovaClientPluginCheckActiveTests(NovaClientPluginTestCase):

    scenarios = [
        ('active', dict(
            status='ACTIVE',
            e_raise=False)),
        ('deferred', dict(
            status='BUILD',
            e_raise=False)),
        ('error', dict(
            status='ERROR',
            e_raise=resource.ResourceInError)),
        ('unknown', dict(
            status='VIKINGS!',
            e_raise=resource.ResourceUnknownStatus))
    ]

    def setUp(self):
        super(NovaClientPluginCheckActiveTests, self).setUp()
        self.server = mock.Mock()
        self.server.id = '1234'
        self.server.status = self.status
        self.r_mock = self.patchobject(self.nova_plugin, 'refresh_server',
                                       return_value=None)
        self.f_mock = self.patchobject(self.nova_plugin, 'fetch_server',
                                       return_value=self.server)

    def test_check_active_with_object(self):
        if self.e_raise:
            self.assertRaises(self.e_raise,
                              self.nova_plugin._check_active, self.server)
            self.r_mock.assert_called_once_with(self.server)
        elif self.status in self.nova_plugin.deferred_server_statuses:
            self.assertFalse(self.nova_plugin._check_active(self.server))
            self.r_mock.assert_called_once_with(self.server)
        else:
            self.assertTrue(self.nova_plugin._check_active(self.server))
            self.assertEqual(0, self.r_mock.call_count)
        self.assertEqual(0, self.f_mock.call_count)

    def test_check_active_with_string(self):
        if self.e_raise:
            self.assertRaises(self.e_raise,
                              self.nova_plugin._check_active, self.server.id)
        elif self.status in self.nova_plugin.deferred_server_statuses:
            self.assertFalse(self.nova_plugin._check_active(self.server.id))
        else:
            self.assertTrue(self.nova_plugin._check_active(self.server.id))

        self.f_mock.assert_called_once_with(self.server.id)
        self.assertEqual(0, self.r_mock.call_count)

    def test_check_active_with_string_unavailable(self):
        self.f_mock.return_value = None
        self.assertFalse(self.nova_plugin._check_active(self.server.id))
        self.f_mock.assert_called_once_with(self.server.id)
        self.assertEqual(0, self.r_mock.call_count)

class NovaClientPluginUserdataTests(NovaClientPluginTestCase):

    def test_build_userdata(self):
        """Tests the build_userdata function."""
        cfg.CONF.set_override('heat_metadata_server_url',
                              'http://server.test:123')
        cfg.CONF.set_override('heat_watch_server_url',
                              'http://server.test:345')
        cfg.CONF.set_override('instance_connection_is_secure',
                              False)
        cfg.CONF.set_override(
            'instance_connection_https_validate_certificates', False)
        data = self.nova_plugin.build_userdata({})
        self.assertIn("Content-Type: text/cloud-config;", data)
        self.assertIn("Content-Type: text/cloud-boothook;", data)
        self.assertIn("Content-Type: text/part-handler;", data)
        self.assertIn("Content-Type: text/x-cfninitdata;", data)
        self.assertIn("Content-Type: text/x-shellscript;", data)
        self.assertIn("http://server.test:345", data)
        self.assertIn("http://server.test:123", data)
        self.assertIn("[Boto]", data)

    def test_build_userdata_without_instance_user(self):
        """Don't add a custom instance user when not requested."""
        cfg.CONF.set_override('instance_user',
                              'config_instance_user')
        cfg.CONF.set_override('heat_metadata_server_url',
                              'http://server.test:123')
        cfg.CONF.set_override('heat_watch_server_url',
                              'http://server.test:345')
        data = self.nova_plugin.build_userdata({}, instance_user=None)
        self.assertNotIn('user: ', data)
        self.assertNotIn('useradd', data)
        self.assertNotIn('config_instance_user', data)

    def test_build_userdata_with_instance_user(self):
        """Add the custom instance user when requested."""
        self.m.StubOutWithMock(nova.cfg, 'CONF')
        cnf = nova.cfg.CONF
        cnf.instance_user = 'config_instance_user'
        cnf.heat_metadata_server_url = 'http://server.test:123'
        cnf.heat_watch_server_url = 'http://server.test:345'
        data = self.nova_plugin.build_userdata(
            None, instance_user="custominstanceuser")
        self.assertNotIn('config_instance_user', data)
        self.assertIn("custominstanceuser", data)

class NovaClientPluginMetadataTests(NovaClientPluginTestCase):

    def test_serialize_string(self):
        original = {'test_key': 'simple string value'}
        self.assertEqual(original, self.nova_plugin.meta_serialize(original))

    def test_serialize_int(self):
        original = {'test_key': 123}
        expected = {'test_key': '123'}
        self.assertEqual(expected, self.nova_plugin.meta_serialize(original))

    def test_serialize_list(self):
        original = {'test_key': [1, 2, 3]}
        expected = {'test_key': '[1, 2, 3]'}
        self.assertEqual(expected, self.nova_plugin.meta_serialize(original))

    def test_serialize_dict(self):
        original = {'test_key': {'a': 'b', 'c': 'd'}}
        expected = {'test_key': '{"a": "b", "c": "d"}'}
        self.assertEqual(expected, self.nova_plugin.meta_serialize(original))

    def test_serialize_none(self):
        original = {'test_key': None}
        expected = {'test_key': 'null'}
        self.assertEqual(expected, self.nova_plugin.meta_serialize(original))

    def test_serialize_no_value(self):
        """This test is to prove that the user can only pass in a dict to nova
        metadata.
        """
        excp = self.assertRaises(exception.StackValidationFailed,
                                 self.nova_plugin.meta_serialize, "foo")
        self.assertIn('metadata needs to be a Map', six.text_type(excp))

    def test_serialize_combined(self):
        original = {
            'test_key_1': 123,
            'test_key_2': 'a string',
            'test_key_3': {'a': 'b'},
            'test_key_4': None,
        }
        expected = {
            'test_key_1': '123',
            'test_key_2': 'a string',
            'test_key_3': '{"a": "b"}',
            'test_key_4': 'null',
        }

        self.assertEqual(expected, self.nova_plugin.meta_serialize(original))

class ServerConstraintTest(common.HeatTestCase):

    def setUp(self):
        super(ServerConstraintTest, self).setUp()
        self.ctx = utils.dummy_context()
        self.mock_get_server = mock.Mock()
        self.ctx.clients.client_plugin(
            'nova').get_server = self.mock_get_server
        self.constraint = nova.ServerConstraint()

    def test_validation(self):
        self.mock_get_server.return_value = mock.MagicMock()
        self.assertTrue(self.constraint.validate("foo", self.ctx))

    def test_validation_error(self):
        self.mock_get_server.side_effect = exception.EntityNotFound(
            entity='Server', name='bar')
        self.assertFalse(self.constraint.validate("bar", self.ctx))

class FlavorConstraintTest(common.HeatTestCase):

    def test_validate(self):
        client = fakes_nova.FakeClient()
        self.stub_keystoneclient()
        self.patchobject(nova.NovaClientPlugin, '_create', return_value=client)
        client.flavors = mock.MagicMock()

        flavor = collections.namedtuple("Flavor", ["id", "name"])
        flavor.id = "1234"
        flavor.name = "foo"
        client.flavors.list.return_value = [flavor]

        constraint = nova.FlavorConstraint()
        ctx = utils.dummy_context()
        self.assertFalse(constraint.validate("bar", ctx))
        self.assertTrue(constraint.validate("foo", ctx))
        self.assertTrue(constraint.validate("1234", ctx))
        nova.NovaClientPlugin._create.assert_called_once_with()
        self.assertEqual(3, client.flavors.list.call_count)
        self.assertEqual([(), (), ()],
                         client.flavors.list.call_args_list)

class NetworkConstraintTest(common.HeatTestCase):

    def test_validate(self):
        client = fakes_nova.FakeClient()
        self.stub_keystoneclient()
        self.patchobject(nova.NovaClientPlugin, '_create', return_value=client)
        client.networks = mock.Mock()

        network = collections.namedtuple("Network", ['id', 'label'])
        network.id = '7f47ff06-0353-4013-b814-123b70b1b27d'
        network.label = 'foo'
        client.networks.get.return_value = network

        constraint = nova.NetworkConstraint()
        ctx = utils.dummy_context()

        self.assertTrue(constraint.validate(network.id, ctx))
        client.networks.get.side_effect = nova_exceptions.NotFound('')
        client.networks.find.return_value = network
        self.assertTrue(constraint.validate(network.id, ctx))

        client.networks.find.side_effect = nova_exceptions.NotFound('')
        self.assertFalse(constraint.validate(network.id, ctx))

        client.networks.find.side_effect = nova_exceptions.NoUniqueMatch()
        self.assertFalse(constraint.validate(network.id, ctx))

        network.id = 'nonuuid'
        client.networks.find.return_value = network
        client.networks.find.side_effect = None
        self.assertTrue(constraint.validate(network.id, ctx))

class KeypairConstraintTest(common.HeatTestCase):

    def test_validation(self):
        client = fakes_nova.FakeClient()
        self.patchobject(nova.NovaClientPlugin, '_create', return_value=client)
        client.keypairs = mock.MagicMock()

        key = collections.namedtuple("Key", ["name"])
        key.name = "foo"
        client.keypairs.get.side_effect = [
            fakes_nova.fake_exception(), key]

        constraint = nova.KeypairConstraint()
        ctx = utils.dummy_context()
        self.assertFalse(constraint.validate("bar", ctx))
        self.assertTrue(constraint.validate("foo", ctx))
        self.assertTrue(constraint.validate("", ctx))
        nova.NovaClientPlugin._create.assert_called_once_with()
        calls = [mock.call('bar'),
                 mock.call(key.name)]
        client.keypairs.get.assert_has_calls(calls)

class ConsoleUrlsTest(common.HeatTestCase):

    scenarios = [
        ('novnc', dict(console_type='novnc', srv_method='vnc')),
        ('xvpvnc', dict(console_type='xvpvnc', srv_method='vnc')),
        ('spice', dict(console_type='spice-html5', srv_method='spice')),
        ('rdp', dict(console_type='rdp-html5', srv_method='rdp')),
        ('serial', dict(console_type='serial', srv_method='serial')),
    ]

    def setUp(self):
        super(ConsoleUrlsTest, self).setUp()
        self.nova_client = mock.Mock()
        con = utils.dummy_context()
        c = con.clients
        self.nova_plugin = c.client_plugin('nova')
        self.nova_plugin._client = self.nova_client
        self.server = mock.Mock()
        self.console_method = getattr(self.server,
                                      'get_%s_console' % self.srv_method)

    def test_get_console_url(self):
        console = {
            'console': {
                'type': self.console_type,
                'url': '%s_console_url' % self.console_type
            }
        }
        self.console_method.return_value = console

        console_url = self.nova_plugin.get_console_urls(self.server)[
            self.console_type]

        self.assertEqual(console['console']['url'], console_url)
        self.console_method.assert_called_once_with(self.console_type)

    def test_get_console_url_tolerate_unavailable(self):
        msg = 'Unavailable console type %s.' % self.console_type
        self.console_method.side_effect = nova_exceptions.BadRequest(
            400, message=msg)

        console_url = self.nova_plugin.get_console_urls(self.server)[
            self.console_type]

        self.console_method.assert_called_once_with(self.console_type)
        self.assertEqual(msg, console_url)

    def test_get_console_urls_reraises_other_400(self):
        exc = nova_exceptions.BadRequest
        self.console_method.side_effect = exc(400, message="spam")

        urls = self.nova_plugin.get_console_urls(self.server)
        e = self.assertRaises(exc, urls.__getitem__, self.console_type)
        self.assertIn('spam', e.message)
        self.console_method.assert_called_once_with(self.console_type)

    def test_get_console_urls_reraises_other(self):
        exc = Exception
        self.console_method.side_effect = exc("spam")

        urls = self.nova_plugin.get_console_urls(self.server)
        e = self.assertRaises(exc, urls.__getitem__, self.console_type)
        self.assertIn('spam', e.args)
        self.console_method.assert_called_once_with(self.console_type)


text:
"""Add extra attendees to CustomForm.

Revision ID: 825dad56a2c3
Revises: 7525fd3b67d5
Create Date: 2018-01-13 16:19:50.651900

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '825dad56a2c3'
down_revision = '009352d11348'

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('custom_form', sa.Column('introductions', sa.Integer(),
                                           nullable=True))
    op.add_column('custom_form_result', sa.Column('introductions',
                                                  sa.Integer(), nullable=True))
    # ### end Alembic commands ###
    connection = op.get_bind()

    connection.execute("""
        UPDATE custom_form_result
           SET introductions = 0
         WHERE introductions is NULL
    """)

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('custom_form_result', 'introductions')
    op.drop_column('custom_form', 'introductions')
    # ### end Alembic commands ###

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>VO808X: upload.HttpRpcServer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

VO808X

Main Page

Related Pages

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

Public Attributes |
List of all members

upload.HttpRpcServer Class Reference

elif e.code >= 500 and e.code < 600:

Server Error - try again.

 More...

Inheritance diagram for upload.HttpRpcServer:

[legend]

Collaboration diagram for upload.HttpRpcServer:

[legend]

Public Attributes

 	cookie_file

 	cookie_jar

 	authenticated

 Public Attributes inherited from upload.AbstractRpcServer

 	host

 	host_override

 	auth_function

 	authenticated

 	extra_headers

 	save_cookies

 	opener

Additional Inherited Members

 Public Member Functions inherited from upload.AbstractRpcServer

def 	__init__ (self, host, auth_function, host_override=None, extra_headers={}, save_cookies=False)

def 	Send (self, request_path, payload=None, content_type="application/octet-stream", timeout=None, kwargs)

def 	__init__ (self, host, auth_function, host_override=None, extra_headers={}, save_cookies=False)

def 	Send (self, request_path, payload=None, content_type="application/octet-stream", timeout=None, kwargs)

Detailed Description

elif e.code >= 500 and e.code < 600:

Server Error - try again.

continue

Provides a simplified RPC-style interface for HTTP requests.

Definition at line 344 of file upload.py.

Member Data Documentation

          upload.HttpRpcServer.authenticated

Definition at line 373 of file upload.py.

          upload.HttpRpcServer.cookie_file

Definition at line 368 of file upload.py.

          upload.HttpRpcServer.cookie_jar

Definition at line 369 of file upload.py.

The documentation for this class was generated from the following file:

/home/bhargavi/Documents/SDR/Copy_Exam_808X/vendor/googletest/googlemock/scripts/upload.py

upload

HttpRpcServer

Generated by

     1.8.11


text:
using System;

namespace DukptNet.Test.Extensions
{
    public static class StringExtensions
    {
        public static byte[] HexStringToByteArray(this string hex)
        {
            int NumberChars = hex.Length;
            byte[] bytes = new byte[NumberChars / 2];
            for (int i = 0; i < NumberChars; i += 2)
                bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
            return bytes;
        }
    }
}


text:
import webapp2
from google.appengine.api import users

from service import private_station
from service import private_rating
from service import private_container

SERVICE_WELCOME_MESSAGE = """\

    <title>Google Search APIs</title>
    Google Search APIs service for Lerigos Music

    Enterprise Hardware Version 2.9.190 with Google Kubernetes

    Developed by Dmitriy Groschovskiy - ex-Googler

"""

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.write(SERVICE_WELCOME_MESSAGE)
        user = users.get_current_user()
        if user:
            self.response.write('Welcome, %s@%s! ' % (user.nickname(), user.auth_domain()))
            if user.nickname() == "groschovskiy":
                self.response.write('We found your Googler address %s@google.com and %s@corp.google.com' % (user.nickname(), user.nickname()))

class RequestLikes(webapp2.RequestHandler):
    def get(self, object_ident):
        private_station.RequestBroadcastIdent(self, object_ident)

#
#   Lerigos Music Beta APIs for Android/iOS
#   https://lerigos.co/mobile - APIs for smart devices
#   Comming soon we will support Internet of Things
#

class StandartWaterfall(webapp2.RequestHandler):
    def get(self):
        private_rating.getStandartWaterfall(self)

class ShareCustomerFeedback(webapp2.RequestHandler):
    def get(self):
        private_container.UpdateContainers(self)

#
#   Lerigos Music Special Gateway Application Interface
#

app = webapp2.WSGIApplication([
    ('/', MainHandler),
    ('/api/station/(\w+)', RequestLikes),
    ('/api/waterfall_default', StandartWaterfall)
], debug=True)


text:
<!DOCTYPE html>

        <title>Blurr Album Cover Example</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,900' rel='stylesheet' type='text/css'>

Album information example

Play track

Can't do without you

Caribou - Summer 2014

Caribou's 2014 return, via the single "Can't Do Without You," just got all the more Balearic-ally irresistible. Canadian producer Dan Snaith now serves up the song's extended mix which, clocking in at six-and-a-half soulful minutes, allows those warm waves of earful pleasure reach all new heights — all of which we hope speaks to the captivating consistency of the man's upcoming album, Our Love.


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

namespace Agathas.Storefront.Repository.NHibernate.SessionStorage
{
    public static class SessionStorageFactory
    {
        private static ISessionStorageContainer _nhSessionStorageContainer;

        public static ISessionStorageContainer GetStorageContainer()
        {
            if (_nhSessionStorageContainer == null)
            {
                if (HttpContext.Current == null)
                    _nhSessionStorageContainer = new ThreadSessionStorageContainer();
                else
                    _nhSessionStorageContainer = new HttpSessionContainer();
            }

            return _nhSessionStorageContainer;
        }
    }

}


text:
package org.springframework.data.crate.core;

import io.crate.action.sql.SQLRequest;

/**
 * @author Hasnain Javed
 * @since 1.0.0
 */
public interface CrateAction extends CrateSQLAction {

    public SQLRequest getSQLRequest();
}


text:
package com.sdl.odata.renderer.atom.writer;

import com.sdl.odata.api.edm.ODataEdmException;
import com.sdl.odata.api.edm.model.EntityDataModel;
import com.sdl.odata.api.edm.model.EntityType;
import com.sdl.odata.api.edm.model.NavigationProperty;
import com.sdl.odata.api.edm.model.Type;
import com.sdl.odata.api.parser.ODataUri;
import com.sdl.odata.api.parser.ODataUriUtil;
import com.sdl.odata.api.parser.TargetType;
import com.sdl.odata.util.edm.EntityDataModelUtil;
import scala.Option;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import static com.sdl.odata.AtomConstants.ATOM_AUTHOR;
import static com.sdl.odata.AtomConstants.ATOM_AUTHOR_ODATA_FRAMEWORK;
import static com.sdl.odata.AtomConstants.ATOM_CATEGORY;
import static com.sdl.odata.AtomConstants.ATOM_ID;
import static com.sdl.odata.AtomConstants.ATOM_LINK;
import static com.sdl.odata.AtomConstants.ATOM_NAME;
import static com.sdl.odata.AtomConstants.ATOM_NS;
import static com.sdl.odata.AtomConstants.ATOM_SUMMARY;
import static com.sdl.odata.AtomConstants.ATOM_UPDATED;
import static com.sdl.odata.AtomConstants.COUNT;
import static com.sdl.odata.AtomConstants.EDIT;
import static com.sdl.odata.AtomConstants.HASH;
import static com.sdl.odata.AtomConstants.HREF;
import static com.sdl.odata.AtomConstants.METADATA;
import static com.sdl.odata.AtomConstants.ODATA_CONTEXT;
import static com.sdl.odata.AtomConstants.ODATA_DATA;
import static com.sdl.odata.AtomConstants.ODATA_SCHEME_NS;
import static com.sdl.odata.AtomConstants.ODATA_XML_BASE;
import static com.sdl.odata.AtomConstants.REL;
import static com.sdl.odata.AtomConstants.SCHEME;
import static com.sdl.odata.AtomConstants.SELF;
import static com.sdl.odata.AtomConstants.TERM;
import static com.sdl.odata.AtomConstants.TITLE;
import static com.sdl.odata.ODataRendererUtils.checkNotNull;
import static com.sdl.odata.api.parser.ODataUriUtil.getEntitySetId;
import static com.sdl.odata.api.parser.ODataUriUtil.getEntitySetName;
import static com.sdl.odata.util.edm.EntityDataModelUtil.formatEntityKey;
import static com.sdl.odata.util.edm.EntityDataModelUtil.getAndCheckEntityType;
import static com.sdl.odata.util.edm.EntityDataModelUtil.getEntityName;
import static com.sdl.odata.util.edm.EntityDataModelUtil.isSingletonEntity;

/**
 *

 * Helper writer capable of writing metadata elements for {@code <feed>} and {@code <entry>} elements. Those elements
 * include:
 *

 *

 *
{@code <id>} element (both for {@code <feed>} and {@code <entry>}).

 *
{@code <title>} element (both for {@code <feed>} and {@code <entry>}).

 *
{@code <updated>} element (both for {@code <feed>} and {@code <entry>}).

 *
{@code <link>} element (for {@code <feed>} and {@code <entry>}, excluding navigation properties).

 *
{@code } element (only for {@code <entry>}).

 *
{@code <author>} element (only for {@code <entry>}).

 *
{@code <category>} element (both for {@code <feed>} and {@code <entry>}).

 *

 *

 * Please note that it is necessary to open the XML writer used by instances of this class before calling any method,
 * and close it after the writing process is finished.
 *

 */
public class AtomMetadataWriter {

    private final XMLStreamWriter xmlWriter;
    private final ODataUri oDataUri;
    private final EntityDataModel entityDataModel;
    private final AtomNSConfigurationProvider nsConfigurationProvider;

    /**
     * Creates an instance of {@link AtomMetadataWriter}
     * by specifying the writer to use.
     *
     * @param xmlWriter       The XML writer to use. It can not be {@code null}.
     * @param oDataUri        The OData URI. It can not be {@code null}.
     * @param entityDataModel The Entity Data Model. It can not be {@code null}.
     * @param nsConfigurationProvider The NameSpace provider to provide OData Atom specific namespaces.
     */
    public AtomMetadataWriter(XMLStreamWriter xmlWriter, ODataUri oDataUri,
                              EntityDataModel entityDataModel, AtomNSConfigurationProvider nsConfigurationProvider) {
        this.xmlWriter = checkNotNull(xmlWriter);
        this.oDataUri = checkNotNull(oDataUri);
        this.entityDataModel = checkNotNull(entityDataModel);
        this.nsConfigurationProvider = checkNotNull(nsConfigurationProvider);
    }

    /**
     * Write the metadata XML attributes of the root element (both {@code <feed>} and {@code <entry>}).
     *
     * @param contextURL The 'Context URL' to write.
     * @throws XMLStreamException If unable to write to stream
     */
    void writeODataMetadata(String contextURL) throws XMLStreamException {

        xmlWriter.writeNamespace(METADATA, nsConfigurationProvider.getOdataMetadataNs());
        xmlWriter.writeNamespace(ODATA_DATA, nsConfigurationProvider.getOdataDataNs());
        xmlWriter.writeDefaultNamespace(ATOM_NS);
        xmlWriter.writeAttribute(nsConfigurationProvider.getOdataMetadataNs(), ODATA_CONTEXT, contextURL);
        xmlWriter.writeAttribute(ODATA_XML_BASE, oDataUri.serviceRoot());
    }

    /**
     * Write a {@code <title>} element.
     *
     * @throws XMLStreamException If unable to write to stream
     */
    void writeTitle() throws XMLStreamException {

        xmlWriter.writeStartElement(TITLE);
        xmlWriter.writeEndElement();
    }

    /**
     * Write a {@code } element.
     *
     * @throws XMLStreamException If unable to write to stream
     */
    void writeSummary() throws XMLStreamException {

        xmlWriter.writeStartElement(ATOM_SUMMARY);
        xmlWriter.writeEndElement();
    }

    /**
     * Write a {@code <updated>} element.
     *
     * @throws XMLStreamException If unable to write to stream
     */
    void writeUpdate(ZonedDateTime dateTime) throws XMLStreamException {

        xmlWriter.writeStartElement(ATOM_UPDATED);
        xmlWriter.writeCharacters(dateTime.format(DateTimeFormatter.ISO_INSTANT));
        xmlWriter.writeEndElement();
    }

    /**
     * Write an {@code <author>} element.
     *
     * @throws XMLStreamException If unable to write to stream
     */
    void writeAuthor() throws XMLStreamException {

        xmlWriter.writeStartElement(ATOM_AUTHOR);
        xmlWriter.writeStartElement(ATOM_NAME);
        xmlWriter.writeCharacters(ATOM_AUTHOR_ODATA_FRAMEWORK);
        xmlWriter.writeEndElement();
        xmlWriter.writeEndElement();
    }

    /**
     * Write an {@code <id>} element when the parent element is an {@code <entry>} element.
     *
     * @param entity The entity to be contained by the {@code <entry>} element.
     * @throws XMLStreamException If unable to write to stream
     * @throws ODataEdmException  If unable to write entry to stream
     */
    void writeEntryId(Object entity) throws XMLStreamException, ODataEdmException {

        xmlWriter.writeStartElement(ATOM_ID);
        xmlWriter.writeCharacters(getEntryIdString(entity));
        xmlWriter.writeEndElement();
    }

    /**
     * Write an {@code <id>} element when the parent element is a {@code <feed>} element.
     *
     * @throws XMLStreamException If unable to write to stream
     * @throws ODataEdmException  If unable to write feed id to stream
     */
    void writeFeedId() throws XMLStreamException, ODataEdmException {
        writeFeedId(null, null);
    }

    /**
     * Write an {@code <id>} element when the parent element is a {@code <feed>} element.
     *
     * @param entity   The enclosing entity for which the feed is getting generated.
     * @param property The property that will be expanded in the feed.
     * @throws XMLStreamException If unable to write to stream
     * @throws ODataEdmException  If unable to write feed id to stream
     */
    void writeFeedId(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {

        xmlWriter.writeStartElement(ATOM_ID);

        if (entity != null) {
            xmlWriter.writeCharacters(String.format("%s/%s/%s", oDataUri.serviceRoot(),
                    getEntityWithKey(entity), property.getName()));
        } else {
            String id;
            if (ODataUriUtil.isActionCallUri(oDataUri) ||
                    ODataUriUtil.isFunctionCallUri(oDataUri)) {
                id = buildFeedIdFromOperationCall(oDataUri);
            } else {
                id = getEntitySetId(oDataUri).get();
            }
            xmlWriter.writeCharacters(id);
        }
        xmlWriter.writeEndElement();
    }

    private String buildFeedIdFromOperationCall(ODataUri odataUri) {
        String serviceRoot = odataUri.serviceRoot();
        String returnType = ODataUriUtil.getOperationReturnType(odataUri, entityDataModel);
        return serviceRoot + "/" + returnType;
    }

    /**
     * Write a feed {@code <link>} element.
     *
     * @throws XMLStreamException If unable to write to stream
     */
    void writeFeedLink(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {

        xmlWriter.writeStartElement(ATOM_LINK);
        xmlWriter.writeAttribute(REL, SELF);

        if (entity == null) {
            if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) {
                Option<TargetType> targetTypeOption = ODataUriUtil.resolveTargetType(oDataUri, entityDataModel);
                if (targetTypeOption.isDefined()) {
                    TargetType targetType = targetTypeOption.get();
                    String entitySetName = EntityDataModelUtil.getEntitySetByEntityTypeName(entityDataModel,
                            targetType.typeName()).getName();
                    xmlWriter.writeAttribute(TITLE, entitySetName);
                    xmlWriter.writeAttribute(HREF, entitySetName);
                } else {
                    throw new ODataEdmException("Failed to resolve entity target type");
                }

            } else {
                xmlWriter.writeAttribute(TITLE, getEntitySetName(oDataUri).get());
                xmlWriter.writeAttribute(HREF, getEntitySetName(oDataUri).get());
            }
        } else {
            xmlWriter.writeAttribute(TITLE, property.getName());
            xmlWriter.writeAttribute(HREF, String.format("%s/%s", getEntityWithKey(entity), property.getName()));
        }

        xmlWriter.writeEndElement();
    }

    /**
     * Write a {@code <link>} element for a given entity.
     *
     * @param entity The given entity.
     * @throws XMLStreamException If unable to write to stream
     * @throws ODataEdmException  if unable to check entity types
     */
    public void writeEntryEntityLink(Object entity) throws XMLStreamException, ODataEdmException {

        EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass());
        xmlWriter.writeStartElement(ATOM_LINK);
        if (entityType.isReadOnly()) {
            xmlWriter.writeAttribute(REL, SELF);
        } else {
            xmlWriter.writeAttribute(REL, EDIT);
        }
        xmlWriter.writeAttribute(TITLE, entityType.getName());
        xmlWriter.writeAttribute(HREF, getEntityWithKey(entity));
        xmlWriter.writeEndElement();
    }

    /**
     * Write a {@code <category>} element for a given entity.
     *
     * @param entity The given entity.
     * @throws XMLStreamException If unable to write to stream
     */
    void writeEntryCategory(Object entity) throws XMLStreamException {

        Type entityType = entityDataModel.getType(entity.getClass());
        xmlWriter.writeStartElement(ATOM_CATEGORY);
        xmlWriter.writeAttribute(SCHEME, ODATA_SCHEME_NS);
        xmlWriter.writeAttribute(TERM, String.format("%s%s.%s", HASH, entityType.getNamespace(), entityType.getName()));
        xmlWriter.writeEndElement();
    }

    private String getEntityWithKey(Object entity) throws ODataEdmException {
        if (isSingletonEntity(entityDataModel, entity)) {
            return String.format("%s", getEntityName(entityDataModel, entity));
        } else {
            return String.format("%s(%s)", getEntityName(entityDataModel, entity),
                    formatEntityKey(entityDataModel, entity));
        }
    }

    private String getEntryIdString(Object entity) throws ODataEdmException {
        if (isSingletonEntity(entityDataModel, entity)) {
            return String.format("%s/%s", oDataUri.serviceRoot(), getEntityName(entityDataModel, entity));
        } else {
            return String.format("%s/%s(%s)", oDataUri.serviceRoot(),
                    getEntityName(entityDataModel, entity), formatEntityKey(entityDataModel, entity));
        }
    }

    public void writeCount(Object count) throws XMLStreamException {
        xmlWriter.writeStartElement(METADATA, COUNT, nsConfigurationProvider.getOdataMetadataNs());
        xmlWriter.writeCharacters(String.valueOf(count));
        xmlWriter.writeEndElement();
    }
}


text:
package org.mpilone.vaadin.uitask;

/**
 *

 * A component that can listen for data changes that happen asynchronously,
 * outside of the normal UI lock. These data changes must be synchronized with
 * the UI via the {@link UIAccessor} before being applied. A {@link UITask} can
 * be used for long running processes that may need to synchronize with the UI.
 *

 *

 * The most common use case for this interface is on a controller or view-model
 * that can be enabled for asynchronous changes via a call from a UI attach
 * method and then disabled via a UI detach method. The view-model/controller
 * doesn't need to be aware of the UI details but can simply begin asynchronous
 * operations (such as using a thread pool or subscribing to a data feed) and
 * update the UI using the provided {@link UIAccessor}. It is important to
 * always call disable after calling enable otherwise there could be resource
 * leaks such as stale listeners or orphaned threads.
 *

 *
 * @author mpilone
 * @see UITask
 */
public interface AsynchronousDataChangeAware {

  /**
   * Enables handling of background, asynchronous data changes. Data changes
   * that could affect the UI must be synchronized using the given
   * {@link UIAccessor}.
   *
   * @param uiAccessor the accessor that can synchronize and access the UI
   * safely from a background thread
   */
  void enableAsynchronousDataChanges(UIAccessor uiAccessor);

  /**
   * Disables handling of background, asynchronous data changes. This method
   * should always be called if an enable call was made on the same
   * implementation. It is recommended that implementations handle and ignore
   * calls to this method if not enabled.
   */
  void disableAsynchronousDataChanges();
}


text:
package org.gbougeard.model.accounts

import play.api.libs.json.Json

/**
 * Created with IntelliJ IDEA.
 * User: gbougeard
 * Date: 13/07/13
 * Time: 19:11
 * To change this template use File | Settings | File Templates.
 */
case class CapabilityInfo(administrateServer: Boolean,
                          queryLimit: QueryLimitInfo,
                          createAccount: Boolean,
                          createGroup: Boolean,
                          createProject: Boolean,
                          emailReviewers: Boolean,
                          killTask: Boolean,
                          viewCaches: Boolean,
                          flushCaches: Boolean,
                          viewConnections: Boolean,
                          viewQueue: Boolean,
                          runGC: Boolean,
                          startReplication: Boolean)

object CapabilityInfo {
  implicit val format = Json.format[CapabilityInfo]
}


text:
package com.gs.fw.common.mithra.test.attribute;

import junit.framework.TestCase;

import com.gs.fw.common.mithra.attribute.ToStringFormatter;

public class ToStringFormatterTest extends TestCase
{

    public void testFormatNullString() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong null formatted value", "", formatter.format(null));
    }

    public void testFormatObject() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong null formatted value", "Something", formatter.format(new Object()
        {
            public String toString()
            {
                return "Something";
            }
        }));
    }

    public void testFormatBoolean() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for true", "true", formatter.format(true));
        assertEquals("Wrong value for false", "false", formatter.format(false));
    }

    public void testFormatByte() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for byte", "10", formatter.format((byte) 10));
    }

    public void testFormatChar() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for char", "c", formatter.format('c'));
    }

    public void testFormatDouble() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for double", "10.1", formatter.format(10.1d));
    }

    public void testFormatFloat() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for float", "12.23", formatter.format(12.23f));
    }

    public void testFormatInt() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for int", "5", formatter.format(5));
    }

    public void testFormatLong() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for long", "7", formatter.format(7l));
    }

    public void testFormatShort() throws Exception
    {
        ToStringFormatter formatter = new ToStringFormatter();
        assertEquals("Wrong value for short", "2", formatter.format((short) 2));
    }
}


text:
package com.ferox.renderer.impl.jogl;

import com.ferox.math.Matrix4;
import com.ferox.math.Vector3;
import com.ferox.math.Vector4;
import com.ferox.math.bounds.Frustum;
import com.ferox.renderer.*;
import com.ferox.renderer.geom.Geometry;
import com.ferox.renderer.geom.Shapes;

/**
 *
 */
public class JoglGlslTest {
    public static final String VERTEX_120 = "#version 120\n" +
                                            "attribute vec4 vertex;\n" +
                                            "attribute vec4 normal;\n" +
                                            "varying vec4 color;\n" +
                                            "uniform mat4 projection;\n" +
                                            "uniform mat4 modelview;\n" +
                                            "void main() {\n" +
                                            "color = normal * 0.5 + vec4(0.5);\n" +
                                            "gl_Position = projection * modelview * vertex;\n" +
                                            "}\n";
    public static final String FRAGMENT_120 = "#version 120\n" +
                                              "varying vec4 color;\n" +
                                              "void main() {\n" +
                                              "gl_FragColor = color;\n" +
                                              "}\n";

    public static final String VERTEX_150 = "#version 150\n" +
                                            "in vec4 vertex;\n" +
                                            "in vec4 normal;\n" +
                                            "out vec4 color;\n" +
                                            "uniform mat4 projection;\n" +
                                            "uniform mat4 modelview;\n" +
                                            "void main() {\n" +
                                            "color = normal * 0.5 + vec4(0.5);\n" +
                                            "gl_Position = projection * modelview * vertex;\n" +
                                            "}\n";
    public static final String FRAGMENT_150 = "#version 150\n" +
                                              "in vec4 color;\n" +
                                              "out vec4 fColor;\n" +
                                              "void main() {\n" +
                                              "fColor = color;\n" +
                                              "}\n";

    static double x = 0;

    public static void main(String[] args) throws Exception {
        final Framework framework = Framework.Factory.create();
        final OnscreenSurface s = framework.createSurface(new OnscreenSurfaceOptions().windowed(500, 500)
                                                                                .withDepthBuffer(24));
        s.setTitle("Hello World");
        s.setVSyncEnabled(false);

        //        final Geometry box = Sphere.create(framework, 1.5, 8);
        final Geometry box = Shapes.createBox(framework, 3.0);

        final Shader shader;

        if (framework.getCapabilities().getMajorVersion() >= 3) {
            shader = framework.newShader().withVertexShader(VERTEX_150).withFragmentShader(FRAGMENT_150)
                              .build();
        } else {
            shader = framework.newShader().withVertexShader(VERTEX_120).withFragmentShader(FRAGMENT_120)
                              .build();
        }
        final Shader.Uniform modelview = shader.getUniform("modelview");
        final Shader.Uniform projection = shader.getUniform("projection");
        final Shader.Attribute vertex = shader.getAttribute("vertex");
        final Shader.Attribute normal = shader.getAttribute("normal");

        try {
            while (!s.isDestroyed()) {
                framework.invoke(new Task<Void>() {
                    @Override
                    public Void run(HardwareAccessLayer access) {
                        Context c = access.setActiveSurface(s);
                        GlslRenderer r = c.getGlslRenderer();
                        r.clear(true, true, true);

                        Frustum view = new Frustum(60.0, 1.0, 1.0, 1000.0);
                        view.setOrientation(new Vector3(0, 0, 25), new Vector3(0, 0, -1),
                                            new Vector3(0, 1, 0));

                        r.setShader(shader);
                        r.setUniform(modelview, view.getViewMatrix());
                        r.setUniform(projection, view.getProjectionMatrix());

                        r.bindAttribute(vertex, box.getVertices());
                        r.bindAttribute(normal, box.getNormals());
                        r.setIndices(box.getIndices());

                        r.setDrawStyle(Renderer.DrawStyle.SOLID, Renderer.DrawStyle.LINE);
                        r.setDepthTest(Renderer.Comparison.ALWAYS);
                        r.setDepthTest(Renderer.Comparison.LESS);

                        Matrix4 m = new Matrix4().setIdentity();
                        Vector4 t = new Vector4();

                        for (int y = 0; y < 5; y++) {
                            for (int x = 0; x < 5; x++) {
                                t.set(JoglGlslTest.x + 2.8 * (x - 2), 2.8 * (y - 2), 0, 1);
                                m.setCol(3, t);

                                r.setUniform(modelview, m.mul(view.getViewMatrix(), m));
                                r.render(box.getPolygonType(), box.getIndexOffset(), box.getIndexCount());
                            }
                        }
                        x += 0.001;
                        if (x > 10) {
                            x = -10;
                        }

                        c.flush();

                        return null;
                    }
                }).get();
            }
        } finally {
            framework.destroy();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/CCLabelTTF.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/CCLabelTTF</TokenIdentifier>
			<Abstract type="html">CCLabelTTF displays a rendered TTF font texture. The label is created from a platform font.
Attributed strings are supported on Mac and iOS6+ which allows for greater text formatting control.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setString:</TokenIdentifier>
			<Abstract type="html">The label text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *string</Declaration>

			<Anchor>//api/name/string</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/string</TokenIdentifier>
			<Abstract type="html">The label text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *string</Declaration>

			<Anchor>//api/name/string</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/string</TokenIdentifier>
			<Abstract type="html">The label text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *string</Declaration>

			<Anchor>//api/name/string</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setAttributedString:</TokenIdentifier>
			<Abstract type="html">The label attributed text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSAttributedString *attributedString</Declaration>

			<Anchor>//api/name/attributedString</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/attributedString</TokenIdentifier>
			<Abstract type="html">The label attributed text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSAttributedString *attributedString</Declaration>

			<Anchor>//api/name/attributedString</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/attributedString</TokenIdentifier>
			<Abstract type="html">The label attributed text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSAttributedString *attributedString</Declaration>

			<Anchor>//api/name/attributedString</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setFontName:</TokenIdentifier>
			<Abstract type="html">The platform font to use for the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *fontName</Declaration>

			<Anchor>//api/name/fontName</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/fontName</TokenIdentifier>
			<Abstract type="html">The platform font to use for the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *fontName</Declaration>

			<Anchor>//api/name/fontName</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/fontName</TokenIdentifier>
			<Abstract type="html">The platform font to use for the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) NSString *fontName</Declaration>

			<Anchor>//api/name/fontName</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setFontSize:</TokenIdentifier>
			<Abstract type="html">The font size of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float fontSize</Declaration>

			<Anchor>//api/name/fontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/fontSize</TokenIdentifier>
			<Abstract type="html">The font size of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float fontSize</Declaration>

			<Anchor>//api/name/fontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/fontSize</TokenIdentifier>
			<Abstract type="html">The font size of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float fontSize</Declaration>

			<Anchor>//api/name/fontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setFontColor:</TokenIdentifier>
			<Abstract type="html">The color of the text (If not using shadow or outline).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *fontColor</Declaration>

			<Anchor>//api/name/fontColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/fontColor</TokenIdentifier>
			<Abstract type="html">The color of the text (If not using shadow or outline).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *fontColor</Declaration>

			<Anchor>//api/name/fontColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/fontColor</TokenIdentifier>
			<Abstract type="html">The color of the text (If not using shadow or outline).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *fontColor</Declaration>

			<Anchor>//api/name/fontColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setHorizontalAlignment:</TokenIdentifier>
			<Abstract type="html">The horizontal alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCTextAlignment horizontalAlignment</Declaration>

			<Anchor>//api/name/horizontalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/horizontalAlignment</TokenIdentifier>
			<Abstract type="html">The horizontal alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCTextAlignment horizontalAlignment</Declaration>

			<Anchor>//api/name/horizontalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/horizontalAlignment</TokenIdentifier>
			<Abstract type="html">The horizontal alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCTextAlignment horizontalAlignment</Declaration>

			<Anchor>//api/name/horizontalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setVerticalAlignment:</TokenIdentifier>
			<Abstract type="html">The vertical alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCVerticalTextAlignment verticalAlignment</Declaration>

			<Anchor>//api/name/verticalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/verticalAlignment</TokenIdentifier>
			<Abstract type="html">The vertical alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCVerticalTextAlignment verticalAlignment</Declaration>

			<Anchor>//api/name/verticalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/verticalAlignment</TokenIdentifier>
			<Abstract type="html">The vertical alignment technique of the text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCVerticalTextAlignment verticalAlignment</Declaration>

			<Anchor>//api/name/verticalAlignment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setDimensions:</TokenIdentifier>
			<Abstract type="html">Dimensions of the label in Points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGSize dimensions</Declaration>

			<Anchor>//api/name/dimensions</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/dimensions</TokenIdentifier>
			<Abstract type="html">Dimensions of the label in Points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGSize dimensions</Declaration>

			<Anchor>//api/name/dimensions</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/dimensions</TokenIdentifier>
			<Abstract type="html">Dimensions of the label in Points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGSize dimensions</Declaration>

			<Anchor>//api/name/dimensions</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setDimensionsType:</TokenIdentifier>
			<Abstract type="html">Dimension type of the label.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCSizeType dimensionsType</Declaration>

			<Anchor>//api/name/dimensionsType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/dimensionsType</TokenIdentifier>
			<Abstract type="html">Dimension type of the label.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCSizeType dimensionsType</Declaration>

			<Anchor>//api/name/dimensionsType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/dimensionsType</TokenIdentifier>
			<Abstract type="html">Dimension type of the label.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCSizeType dimensionsType</Declaration>

			<Anchor>//api/name/dimensionsType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setAdjustsFontSizeToFit:</TokenIdentifier>
			<Abstract type="html">If true, the label will be scaled down to fit into the size provided by the dimensions property. Only has an effect if dimensions are set.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) BOOL adjustsFontSizeToFit</Declaration>

			<Anchor>//api/name/adjustsFontSizeToFit</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/adjustsFontSizeToFit</TokenIdentifier>
			<Abstract type="html">If true, the label will be scaled down to fit into the size provided by the dimensions property. Only has an effect if dimensions are set.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) BOOL adjustsFontSizeToFit</Declaration>

			<Anchor>//api/name/adjustsFontSizeToFit</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/adjustsFontSizeToFit</TokenIdentifier>
			<Abstract type="html">If true, the label will be scaled down to fit into the size provided by the dimensions property. Only has an effect if dimensions are set.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) BOOL adjustsFontSizeToFit</Declaration>

			<Anchor>//api/name/adjustsFontSizeToFit</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setMinimumFontSize:</TokenIdentifier>
			<Abstract type="html">Used together with adjustsFontSizeToFit. Fonts will not be scaled down below this size (the label will instead be clipped).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float minimumFontSize</Declaration>

			<Anchor>//api/name/minimumFontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/minimumFontSize</TokenIdentifier>
			<Abstract type="html">Used together with adjustsFontSizeToFit. Fonts will not be scaled down below this size (the label will instead be clipped).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float minimumFontSize</Declaration>

			<Anchor>//api/name/minimumFontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/minimumFontSize</TokenIdentifier>
			<Abstract type="html">Used together with adjustsFontSizeToFit. Fonts will not be scaled down below this size (the label will instead be clipped).</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float minimumFontSize</Declaration>

			<Anchor>//api/name/minimumFontSize</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setBaselineAdjustment:</TokenIdentifier>
			<Abstract type="html">Adjusts the fonts baseline, the value is set in points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float baselineAdjustment</Declaration>

			<Anchor>//api/name/baselineAdjustment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/baselineAdjustment</TokenIdentifier>
			<Abstract type="html">Adjusts the fonts baseline, the value is set in points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float baselineAdjustment</Declaration>

			<Anchor>//api/name/baselineAdjustment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/baselineAdjustment</TokenIdentifier>
			<Abstract type="html">Adjusts the fonts baseline, the value is set in points.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float baselineAdjustment</Declaration>

			<Anchor>//api/name/baselineAdjustment</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setShadowColor:</TokenIdentifier>
			<Abstract type="html">The color of the text shadow. If the color is transparent, no shadow will be used.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *shadowColor</Declaration>

			<Anchor>//api/name/shadowColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/shadowColor</TokenIdentifier>
			<Abstract type="html">The color of the text shadow. If the color is transparent, no shadow will be used.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *shadowColor</Declaration>

			<Anchor>//api/name/shadowColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/shadowColor</TokenIdentifier>
			<Abstract type="html">The color of the text shadow. If the color is transparent, no shadow will be used.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *shadowColor</Declaration>

			<Anchor>//api/name/shadowColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setShadowOffset:</TokenIdentifier>
			<Abstract type="html">The offset of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGPoint shadowOffset</Declaration>

			<Anchor>//api/name/shadowOffset</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/shadowOffset</TokenIdentifier>
			<Abstract type="html">The offset of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGPoint shadowOffset</Declaration>

			<Anchor>//api/name/shadowOffset</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/shadowOffset</TokenIdentifier>
			<Abstract type="html">The offset of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CGPoint shadowOffset</Declaration>

			<Anchor>//api/name/shadowOffset</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setShadowOffsetInPoints:</TokenIdentifier>
			<Abstract type="html">The offset of the shadow in points</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, readonly) CGPoint shadowOffsetInPoints</Declaration>

			<Anchor>//api/name/shadowOffsetInPoints</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/shadowOffsetInPoints</TokenIdentifier>
			<Abstract type="html">The offset of the shadow in points</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, readonly) CGPoint shadowOffsetInPoints</Declaration>

			<Anchor>//api/name/shadowOffsetInPoints</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/shadowOffsetInPoints</TokenIdentifier>
			<Abstract type="html">The offset of the shadow in points</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, readonly) CGPoint shadowOffsetInPoints</Declaration>

			<Anchor>//api/name/shadowOffsetInPoints</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setShadowOffsetType:</TokenIdentifier>
			<Abstract type="html">The position type to be used for the shadow offset.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCPositionType shadowOffsetType</Declaration>

			<Anchor>//api/name/shadowOffsetType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/shadowOffsetType</TokenIdentifier>
			<Abstract type="html">The position type to be used for the shadow offset.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCPositionType shadowOffsetType</Declaration>

			<Anchor>//api/name/shadowOffsetType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/shadowOffsetType</TokenIdentifier>
			<Abstract type="html">The position type to be used for the shadow offset.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) CCPositionType shadowOffsetType</Declaration>

			<Anchor>//api/name/shadowOffsetType</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setShadowBlurRadius:</TokenIdentifier>
			<Abstract type="html">The blur radius of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float shadowBlurRadius</Declaration>

			<Anchor>//api/name/shadowBlurRadius</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/shadowBlurRadius</TokenIdentifier>
			<Abstract type="html">The blur radius of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float shadowBlurRadius</Declaration>

			<Anchor>//api/name/shadowBlurRadius</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/shadowBlurRadius</TokenIdentifier>
			<Abstract type="html">The blur radius of the shadow.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float shadowBlurRadius</Declaration>

			<Anchor>//api/name/shadowBlurRadius</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setOutlineColor:</TokenIdentifier>
			<Abstract type="html">The color of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *outlineColor</Declaration>

			<Anchor>//api/name/outlineColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/outlineColor</TokenIdentifier>
			<Abstract type="html">The color of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *outlineColor</Declaration>

			<Anchor>//api/name/outlineColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/outlineColor</TokenIdentifier>
			<Abstract type="html">The color of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, strong) CCColor *outlineColor</Declaration>

			<Anchor>//api/name/outlineColor</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setOutlineWidth:</TokenIdentifier>
			<Abstract type="html">The width of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float outlineWidth</Declaration>

			<Anchor>//api/name/outlineWidth</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/outlineWidth</TokenIdentifier>
			<Abstract type="html">The width of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float outlineWidth</Declaration>

			<Anchor>//api/name/outlineWidth</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/CCLabelTTF/outlineWidth</TokenIdentifier>
			<Abstract type="html">The width of the text's outline.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>@property (nonatomic, assign) float outlineWidth</Declaration>

			<Anchor>//api/name/outlineWidth</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/clm/CCLabelTTF/labelWithString:fontName:fontSize:</TokenIdentifier>
			<Abstract type="html">Creates and returns a label object using the specified text, font name and font size.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>+ (id)labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size</Declaration>
			<Parameters>
				<Parameter>
					<Name>string</Name>
					<Abstract type="html">Label text.</Abstract>
				</Parameter><Parameter>
					<Name>name</Name>
					<Abstract type="html">Label font name.</Abstract>
				</Parameter><Parameter>
					<Name>size</Name>
					<Abstract type="html">Label font size (in points).</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">The CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/labelWithString:fontName:fontSize:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/clm/CCLabelTTF/labelWithString:fontName:fontSize:dimensions:</TokenIdentifier>
			<Abstract type="html">Creates and returns a label object using the specified text, font name, font size and dimensions.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>+ (id)labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions</Declaration>
			<Parameters>
				<Parameter>
					<Name>string</Name>
					<Abstract type="html">Label text.</Abstract>
				</Parameter><Parameter>
					<Name>name</Name>
					<Abstract type="html">Label font name.</Abstract>
				</Parameter><Parameter>
					<Name>size</Name>
					<Abstract type="html">Label font size (in points).</Abstract>
				</Parameter><Parameter>
					<Name>dimensions</Name>
					<Abstract type="html">Label dimensions.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">The CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/labelWithString:fontName:fontSize:dimensions:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/clm/CCLabelTTF/labelWithAttributedString:</TokenIdentifier>
			<Abstract type="html">Creates and returns a label object using the specified attributed text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>+ (id)labelWithAttributedString:(NSAttributedString *)attrString</Declaration>
			<Parameters>
				<Parameter>
					<Name>attrString</Name>
					<Abstract type="html">Label Attributed text.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">The CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/labelWithAttributedString:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/clm/CCLabelTTF/labelWithAttributedString:dimensions:</TokenIdentifier>
			<Abstract type="html">Creates and returns a label object using the specified attributed text and dimensions.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>+ (id)labelWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions</Declaration>
			<Parameters>
				<Parameter>
					<Name>attrString</Name>
					<Abstract type="html">Label Attributed text.</Abstract>
				</Parameter><Parameter>
					<Name>dimensions</Name>
					<Abstract type="html">Label dimensions.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">The CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/labelWithAttributedString:dimensions:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/initWithString:fontName:fontSize:</TokenIdentifier>
			<Abstract type="html">Initializes and returns a label object using the specified text, font name and font size.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>- (id)initWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size</Declaration>
			<Parameters>
				<Parameter>
					<Name>string</Name>
					<Abstract type="html">Label text.</Abstract>
				</Parameter><Parameter>
					<Name>name</Name>
					<Abstract type="html">Label font name.</Abstract>
				</Parameter><Parameter>
					<Name>size</Name>
					<Abstract type="html">Label font size (in points).</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">An initialized CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/initWithString:fontName:fontSize:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/initWithString:fontName:fontSize:dimensions:</TokenIdentifier>
			<Abstract type="html">Initializes and returns a label object using the specified text, font name, font size and dimensions.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>- (id)initWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions</Declaration>
			<Parameters>
				<Parameter>
					<Name>string</Name>
					<Abstract type="html">Label text.</Abstract>
				</Parameter><Parameter>
					<Name>name</Name>
					<Abstract type="html">Label font name.</Abstract>
				</Parameter><Parameter>
					<Name>size</Name>
					<Abstract type="html">Label font size (in points).</Abstract>
				</Parameter><Parameter>
					<Name>dimensions</Name>
					<Abstract type="html">Label dimensions.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">An initialized CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/initWithString:fontName:fontSize:dimensions:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/initWithAttributedString:</TokenIdentifier>
			<Abstract type="html">Initializes and returns a label object using the specified attributed text.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>- (id)initWithAttributedString:(NSAttributedString *)attrString</Declaration>
			<Parameters>
				<Parameter>
					<Name>attrString</Name>
					<Abstract type="html">Label Attributed text.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">An initialized CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/initWithAttributedString:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/initWithAttributedString:dimensions:</TokenIdentifier>
			<Abstract type="html">Initializes and returns a label object using the specified attributed text and dimensions.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>- (id)initWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions</Declaration>
			<Parameters>
				<Parameter>
					<Name>attrString</Name>
					<Abstract type="html">Label Attributed text.</Abstract>
				</Parameter><Parameter>
					<Name>dimensions</Name>
					<Abstract type="html">Label dimensions.</Abstract>
				</Parameter>
			</Parameters>
			<ReturnValue><Abstract type="html">An initialized CCLabelTTF Object.</Abstract></ReturnValue>
			<Anchor>//api/name/initWithAttributedString:dimensions:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/CCLabelTTF/setHTML:</TokenIdentifier>
			<Abstract type="html">(OS X) HTML Label</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>- (void)setHTML:(NSString *)html</Declaration>
			<Parameters>
				<Parameter>
					<Name>html</Name>
					<Abstract type="html">HTML Description.</Abstract>
				</Parameter>
			</Parameters>

			<Anchor>//api/name/setHTML:</Anchor>
            <NodeRef refid="69"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/clm/CCLabelTTF/registerCustomTTF:</TokenIdentifier>
			<Abstract type="html">Register a TTF font resource.</Abstract>
			<DeclaredIn>CCLabelTTF.h</DeclaredIn>

			<Declaration>+ (void)registerCustomTTF:(NSString *)fontFile</Declaration>
			<Parameters>
				<Parameter>
					<Name>fontFile</Name>
					<Abstract type="html">Font file path.</Abstract>
				</Parameter>
			</Parameters>

			<Anchor>//api/name/registerCustomTTF:</Anchor>
            <NodeRef refid="69"/>
		</Token>

	</File>
</Tokens>


text:
package com.app.infideap.stylishwidget.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;

public class TransparentTextView extends ATextView {
    private Bitmap mMaskBitmap;
    private Canvas mMaskCanvas;
    private Paint mPaint;
    private Drawable mBackground;
    private Bitmap mBackgroundBitmap;
    private Canvas mBackgroundCanvas;

    public TransparentTextView(final Context context) {
        super(context);
        init();
    }

    public TransparentTextView(final Context context, final AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        mPaint = new Paint();
        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
        super.setTextColor(Color.BLACK);
        super.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }

    @Override
    @Deprecated
    public void setBackgroundDrawable(final Drawable bg) {
        if (mBackground == bg) {
            return;
        }

        mBackground = bg;

        // Will always draw drawable using view bounds. This might be a
        // problem if the drawable should force the view to be bigger, e.g.
        // the view sets its dimensions to wrap_content and the drawable
        // is larger than the text.
        int w = getWidth();
        int h = getHeight();
        if (mBackground != null && w != 0 && h != 0) {
            mBackground.setBounds(0, 0, w, h);
        }
        requestLayout();
        invalidate();
    }

    @Override
    public void setBackgroundColor(final int color) {
        setBackgroundDrawable(new ColorDrawable(color));
    }

    @Override
    protected void onSizeChanged(final int w, final int h, final int oldw, final int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        if (w == 0 || h == 0) {
            freeBitmaps();
            return;
        }

        createBitmaps(w, h);
        if (mBackground != null) {
            mBackground.setBounds(0, 0, w, h);
        }
    }

    private void createBitmaps(int w, int h) {
        mBackgroundBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
        mBackgroundCanvas = new Canvas(mBackgroundBitmap);
        mMaskBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ALPHA_8);
        mMaskCanvas = new Canvas(mMaskBitmap);
    }

    private void freeBitmaps() {
        mBackgroundBitmap = null;
        mBackgroundCanvas = null;
        mMaskBitmap = null;
        mMaskCanvas = null;
    }

    @Override
    protected void onDraw(final Canvas canvas) {
        if (isNothingToDraw()) {
            return;
        }
        drawMask();
        drawBackground();
        canvas.drawBitmap(mBackgroundBitmap, 0.f, 0.f, null);
    }

    private boolean isNothingToDraw() {
        return mBackground == null
                || getWidth() == 0
                || getHeight() == 0;
    }

    // draw() calls onDraw() leading to stack overflow
    @SuppressLint("WrongCall")
    private void drawMask() {
        clear(mMaskCanvas);
        super.onDraw(mMaskCanvas);
    }

    private void drawBackground() {
        clear(mBackgroundCanvas);
        mBackground.draw(mBackgroundCanvas);
        mBackgroundCanvas.drawBitmap(mMaskBitmap, 0.f, 0.f, mPaint);
    }

    private static void clear(Canvas canvas) {
        canvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR);
    }
}


text:
from __future__ import unicode_literals
from .conf import settings

try:
    from south.modelsinspector import add_introspection_rules
    add_introspection_rules([], ["^.fields\.GeopositionField"])
except ImportError:
    pass


text:
<?php

namespace LaravelLangBundler\Bundle;

use Illuminate\Support\Collection;
use LaravelLangBundler\BundleItems\BundleItem;
use LaravelLangBundler\BundleItems\ItemFactory;

class Bundle
{
    /**
     * Bundle id provided by client.
     *
     * @var string
     */
    protected $id;

    /**
     * BundleMap instance.
     *
     * @var BundleMap
     */
    protected $bundleMap;

    /**
     * Array of path keys.
     *
     * @var array
     */
    protected $pathKeys = [];

    /**
     * Path resolved from id.
     *
     * @var string
     */
    protected $path = '';

    /**
     * Path namespace.
     *
     * @var string
     */
    protected $namespace = '';

    /**
     * Collection of lang values.
     *
     * @var Collection
     */
    protected $values;

    /**
     * Construct.
     *
     * @param string $id
     */
    public function __construct($id, BundleMap $bundleMap)
    {
        $this->id = $id;
        $this->path = $id;

        $this->bundleMap = $bundleMap;

        $this->getValuesFromMap();
    }

    /**
     * Get bundle namespace.
     *
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * Get pathKeys array.
     *
     * @return array
     */
    public function getPathKeys()
    {
        return $this->pathKeys;
    }

    /**
     * Get path values collection.
     *
     * @return Collection
     */
    public function getValues()
    {
        return $this->values;
    }

    /**
     * Return array of values.
     *
     * @return array
     */
    public function getValuesArray()
    {
        return $this->values->all();
    }

    /**
     * Return true if bundle contains no trans values.
     *
     * @return bool
     */
    public function hasNoValues()
    {
        return $this->values->isEmpty();
    }

    /**
     * Return true if namespace is valid bundle namespace.
     *
     * @return bool
     */
    public function hasValidNamespace()
    {
        return $this->getNamespace() === 'bundles';
    }

    /**
     * Set the namespace on the object.
     *
     * @param string $namespace
     */
    protected function setNamespace($namespace)
    {
        $this->namespace = $namespace;
    }

    /**
     * Set pathKeys on object.
     *
     * @param array $pathKeys
     */
    protected function setPathKeys(array $pathKeys)
    {
        $this->pathKeys = $pathKeys;
    }

    /**
     * Set values collection on object.
     *
     * @param Collection $values
     *
     * @return Collection
     */
    protected function setValues(Collection $values)
    {
        return $this->values = $values->map(function ($value) {
            if (!$value instanceof BundleItem) {
                return ItemFactory::build($value);
            }

            return $value;
        });
    }

    /**
     * Get bundle values from bundle map.
     *
     * @return Collection
     */
    protected function getValuesFromMap()
    {
        if ($this->bundleMap->bundleMapIsEmpty()) {
            $this->bundleMap->mapBundles();
        }

        $this->buildKeys();

        if (!$this->hasValidNamespace()) {
            $this->setValues(collect([]));
        } else {
            $values = $this->bundleMap->getBundleValues($this->getPathKeys());

            $this->setValues($values);
        }
    }

    /**
     * Build pathKeys array and set namespace.
     */
    protected function buildKeys()
    {
        $pathKeys = $this->getKeysFromId();

        $this->setNamespace(array_shift($pathKeys));

        $this->setPathKeys($pathKeys);
    }

    /**
     * Get keys from id.
     *
     * @return array
     */
    protected function getKeysFromId()
    {
        $aliases = config('lang-bundler.aliases');

        $autoAliases = collect($this->bundleMap->getAutoAliases())
            ->filter(function ($value) {
                return $value === $this->id;
            });

        if (in_array($this->id, array_keys($aliases))) {
            $this->path = $aliases[$this->id];
        } elseif ($autoAliases->count() === 1) {
            $this->path = 'bundles.'.$autoAliases->keys()[0];
        }

        return explode('.', $this->path);
    }
}


text:
package sttnf.app.nfkita.models;

/**
 * Created by isfaaghyth on 7/13/17.
 */

public class ArticleModel {
    private NewsModel.Post post;

    public NewsModel.Post getPost() {
        return post;
    }
}